npm package diff

Package: @forge/bridge

Versions: 4.5.3 - 4.6.0-next.0

File: package/out/invoke-remote/invoke-remote.js

Index: package/out/invoke-remote/invoke-remote.js
===================================================================
--- package/out/invoke-remote/invoke-remote.js
+++ package/out/invoke-remote/invoke-remote.js
@@ -1,31 +0,0 @@
-"use strict";
-Object.defineProperty(exports, "__esModule", { value: true });
-exports.invokeRemote = void 0;
-const bridge_1 = require("../bridge");
-const errors_1 = require("../errors");
-const utils_1 = require("../utils");
-const MAX_NUM_OPERATIONS = 500;
-const OPERATION_INTERVAL_MS = 1000 * 25;
-const callBridge = (0, bridge_1.getCallBridge)();
-const validatePayload = (payload) => {
-    if (!payload)
-        return;
-    if (Object.values(payload).some((val) => typeof val === 'function')) {
-        throw new errors_1.BridgeAPIError('Passing functions as part of the payload is not supported!');
-    }
-};
-const _invokeRemote = async (input) => {
-    var _a;
-    validatePayload(input);
-    const { success, payload, error } = (_a = (await callBridge('invoke', input))) !== null && _a !== void 0 ? _a : {};
-    const response = { ...(success ? payload : error) };
-    if (response && response.headers) {
-        for (const header in response.headers) {
-            if (Array.isArray(response.headers[header])) {
-                response.headers[header] = response.headers[header].join(',');
-            }
-        }
-    }
-    return response;
-};
-exports.invokeRemote = (0, utils_1.withRateLimiter)(_invokeRemote, MAX_NUM_OPERATIONS, OPERATION_INTERVAL_MS, 'Remote invocation calls are rate limited at 500req/25s');