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.1.0 to 1.2.0-next.0

out/invoke/index.d.ts

6

CHANGELOG.md
# @forge/bridge
## 1.2.0-next.0
### Minor Changes
- 3bc0722: Add getContext method
## 1.1.0

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

24

out/index.d.ts

@@ -1,23 +0,3 @@

declare type InvokePayload = {
[key in number | string]: any;
};
declare type InvokeResponse = Record<string, any> | void;
export declare const invoke: <T = InvokeResponse>(functionKey: string, payload?: InvokePayload | undefined) => Promise<T>;
export declare type ProductResponse = {
body: any;
} & Pick<Response, 'ok' | 'status' | 'statusText'>;
export declare const requestJira: (fetchUrl: string, fetchOptions?: RequestInit | undefined) => Promise<ProductResponse>;
export declare const requestConfluence: (fetchUrl: string, fetchOptions?: RequestInit | undefined) => Promise<ProductResponse>;
export declare const view: {
close: () => Promise<void>;
};
declare const _default: {
invoke: <T = InvokeResponse>(functionKey: string, payload?: InvokePayload | undefined) => Promise<T>;
requestJira: (fetchUrl: string, fetchOptions?: RequestInit | undefined) => Promise<ProductResponse>;
requestConfluence: (fetchUrl: string, fetchOptions?: RequestInit | undefined) => Promise<ProductResponse>;
view: {
close: () => Promise<void>;
};
};
export default _default;
export * from './invoke';
export * from './view';
//# sourceMappingURL=index.d.ts.map
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.view = exports.requestConfluence = exports.requestJira = exports.invoke = void 0;
var tslib_1 = require("tslib");
var errors_1 = require("./errors");
var bridge_1 = require("./bridge");
var callBridge = bridge_1.getCallBridge();
var validatePayload = function (payload) {
if (!payload)
return;
if (Object.values(payload).some(function (val) { return typeof val === 'function'; })) {
throw new errors_1.BridgeAPIError('Passing functions as part of the payload is not supported!');
}
};
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!');
}
validatePayload(payload);
return [4, callBridge('invoke', { functionKey: functionKey, payload: payload })];
case 1: return [2, _a.sent()];
}
});
}); };
exports.requestJira = function (fetchUrl, fetchOptions) {
return exports.invoke('__request', { product: 'jira', fetchUrl: fetchUrl, fetchOptions: fetchOptions });
};
exports.requestConfluence = function (fetchUrl, fetchOptions) {
return exports.invoke('__request', { product: 'confluence', fetchUrl: fetchUrl, fetchOptions: fetchOptions });
};
var close = function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () {
var success, e_1;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
return [4, callBridge('close')];
case 1:
success = _a.sent();
if (success === false) {
throw new errors_1.BridgeAPIError("this resource's view is not closable.");
}
return [3, 3];
case 2:
e_1 = _a.sent();
throw new errors_1.BridgeAPIError("this resource's view is not closable.");
case 3: return [2];
}
});
}); };
exports.view = {
close: close
};
exports.default = {
invoke: exports.invoke,
requestJira: exports.requestJira,
requestConfluence: exports.requestConfluence,
view: exports.view
};
tslib_1.__exportStar(require("./invoke"), exports);
tslib_1.__exportStar(require("./view"), exports);
{
"name": "@forge/bridge",
"version": "1.1.0",
"version": "1.2.0-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