npm package diff

Package: @forge/bridge

Versions: 5.7.0-next.8-experimental-ab371ba - 5.7.0-next.10

File: package/out/object-store/download.js

Index: package/out/object-store/download.js
===================================================================
--- package/out/object-store/download.js
+++ package/out/object-store/download.js
@@ -2,46 +2,46 @@
 Object.defineProperty(exports, "__esModule", { value: true });
 exports.download = void 0;
 const invoke_1 = require("../invoke");
 const errors_1 = require("../errors");
-const download = async ({ filterAndGenerateDownloadUrls, objectKeys }) => {
-    if (!(filterAndGenerateDownloadUrls === null || filterAndGenerateDownloadUrls === void 0 ? void 0 : filterAndGenerateDownloadUrls.function)) {
-        throw new errors_1.BridgeAPIError('filterAndGenerateDownloadUrls.function is required');
+const download = async ({ functionKey, keys }) => {
+    if (!functionKey || functionKey.length === 0) {
+        throw new errors_1.BridgeAPIError('functionKey is required to filter and generate download URLs');
     }
-    if (!Array.isArray(objectKeys) || objectKeys.length === 0) {
-        throw new errors_1.BridgeAPIError('objectKeys array is required and must not be empty');
+    if (!Array.isArray(keys) || keys.length === 0) {
+        throw new errors_1.BridgeAPIError('keys array is required and must not be empty');
     }
-    const downloadUrlsToObjectKeys = (await (0, invoke_1.invoke)(filterAndGenerateDownloadUrls.function, {
-        objectKeys
+    const downloadUrlsTokeys = (await (0, invoke_1.invoke)(functionKey, {
+        keys
     }));
-    if (!downloadUrlsToObjectKeys || typeof downloadUrlsToObjectKeys !== 'object') {
-        throw new errors_1.BridgeAPIError('Invalid response from filterAndGenerateDownloadUrls function');
+    if (!downloadUrlsTokeys || typeof downloadUrlsTokeys !== 'object') {
+        throw new errors_1.BridgeAPIError('Invalid response from functionKey');
     }
-    const downloadPromises = Object.entries(downloadUrlsToObjectKeys).map(async ([downloadUrl, key]) => {
+    const downloadPromises = Object.entries(downloadUrlsTokeys).map(async ([downloadUrl, key]) => {
         try {
             const response = await fetch(downloadUrl, {
                 method: 'GET'
             });
             if (!response.ok) {
                 return {
                     success: false,
-                    objectKey: key,
+                    key: key,
                     status: response.status,
                     error: `Download failed with status ${response.status}`
                 };
             }
             const blob = await response.blob();
             return {
                 success: true,
-                objectKey: key,
+                key: key,
                 blob,
                 status: response.status
             };
         }
         catch (error) {
             return {
                 success: false,
-                objectKey: key,
+                key: key,
                 status: 503,
                 error: error instanceof Error ? error.message : 'Download failed'
             };
         }