Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@forge/bridge

Package Overview
Dependencies
Maintainers
8
Versions
139
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@forge/bridge - npm Package Compare versions

Comparing version 1.0.0 to 1.0.1-next.0

out/bridge.d.ts

6

CHANGELOG.md
# @forge/bridge
## 1.0.1-next.0
### Patch Changes
- 14b6ef7: Remove retriable invoke as is no longer necessary with bridge core handshake
## 1.0.0

@@ -4,0 +10,0 @@

52

out/index.js

@@ -6,3 +6,4 @@ "use strict";

var errors_1 = require("./errors");
var delay = function (time) { return Promise.resolve(function (res) { return setTimeout(res, time); }); };
var bridge_1 = require("./bridge");
var callBridge = bridge_1.getCallBridge();
var validatePayload = function (payload) {

@@ -15,40 +16,15 @@ if (!payload)

};
var MAX_INVOKE_RETRIES = 10;
exports.invoke = function (functionKey, payload) {
if (typeof functionKey !== 'string') {
throw new errors_1.BridgeAPIError('functionKey must be a string!');
}
validatePayload(payload);
var callBridge = window.__bridge.callBridge;
var retriableInvoke = function (retryCount) {
if (retryCount === void 0) { retryCount = MAX_INVOKE_RETRIES; }
return tslib_1.__awaiter(void 0, void 0, void 0, function () {
var error_1;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
if (retryCount <= 0) {
throw new errors_1.BridgeAPIError("\n Unable to call invoke(). Product handler for this event was not found or is not ready yet\n ");
}
_a.label = 1;
case 1:
_a.trys.push([1, 3, , 7]);
return [4, callBridge('invoke', { functionKey: functionKey, payload: payload })];
case 2: return [2, _a.sent()];
case 3:
error_1 = _a.sent();
if (!(error_1 === null || error_1 === void 0 ? void 0 : error_1.message.startsWith('No handler found for post message: invoke'))) return [3, 5];
return [4, delay((MAX_INVOKE_RETRIES - retryCount + 1) * 100)];
case 4:
_a.sent();
return [2, retriableInvoke(--retryCount)];
case 5: throw error_1;
case 6: return [3, 7];
case 7: return [2];
exports.invoke = function (functionKey, payload) { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
if (typeof functionKey !== 'string') {
throw new errors_1.BridgeAPIError('functionKey must be a string!');
}
});
});
};
return retriableInvoke();
};
validatePayload(payload);
return [4, callBridge('invoke', { functionKey: functionKey, payload: payload })];
case 1: return [2, _a.sent()];
}
});
}); };
exports.requestJira = function (fetchUrl, fetchOptions) {

@@ -55,0 +31,0 @@ return exports.invoke('__request', { product: 'jira', fetchUrl: fetchUrl, fetchOptions: fetchOptions });

{
"name": "@forge/bridge",
"version": "1.0.0",
"version": "1.0.1-next.0",
"description": "Forge bridge API for custom UI apps",

@@ -5,0 +5,0 @@ "author": "Atlassian",

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc