New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@forge/bridge

Package Overview
Dependencies
Maintainers
2
Versions
144
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 0.0.0-experimental-64caa5a to 0.0.0-experimental-72f4150

out/events/events.d.ts

89

CHANGELOG.md
# @forge/bridge
## 0.0.0-experimental-64caa5a
## 0.0.0-experimental-72f4150
### Patch Changes
- 6c53377: Add main field to package.json
## 2.5.1-next.0
### Patch Changes
- 6c533774: Add main field to package.json
## 2.5.0
### Minor Changes
- 4eef67b: Fix return type for getContext method
- 6269d73: Fix return type for getContext method
## 2.5.0-next.0
### Minor Changes
- 6269d73d: Fix return type for getContext method
## 2.4.0
### Minor Changes
- 14cd9b0: Add a new view.refresh() method
## 2.4.0-next.0
### Minor Changes
- 14cd9b02: Add a new view.refresh() method
## 2.3.0
### Minor Changes
- ae90999: Add router.reload()
- 27af6ce: Add showFlag API to open flags in products
- d307c8f: Add on and emit methods to Events API
## 2.3.0-next.2
### Minor Changes
- 27af6ce4: Add showFlag API to open flags in products
## 2.3.0-next.1
### Minor Changes
- ae90999: Add router.reload()
## 2.3.0-next.0
### Minor Changes
- d307c8f: Add on and emit methods to Events API
## 2.2.1
### Patch Changes
- 97ce1f3: update history.location in bridge when route changes
## 2.2.1-next.0
### Patch Changes
- 97ce1f3: update history.location in bridge when route changes
## 2.2.0
### Minor Changes
- 6fe6082: Ability to disable close on escape and overlay click for modals
## 2.2.0-next.0
### Minor Changes
- 6fe60823: Ability to disable close on escape and overlay click for modals
## 2.1.3
### Patch Changes
- 7c11b22: Improve error message for when the Custom UI bridge is not available

@@ -8,0 +95,0 @@

3

out/bridge.js

@@ -8,3 +8,3 @@ "use strict";

}
exports.getCallBridge = () => {
const getCallBridge = () => {
if (!isBridgeAvailable(window.__bridge)) {

@@ -18,1 +18,2 @@ throw new errors_1.BridgeAPIError(`

};
exports.getCallBridge = getCallBridge;
import { getCallBridge } from '../bridge';
export declare const productFetchApi: (callBridge: ReturnType<typeof getCallBridge>) => {
requestConfluence: (restPath: string, fetchOptions?: RequestInit | undefined) => Promise<Response>;
requestJira: (restPath: string, fetchOptions?: RequestInit | undefined) => Promise<Response>;
requestConfluence: (restPath: string, fetchOptions?: RequestInit) => Promise<Response>;
requestJira: (restPath: string, fetchOptions?: RequestInit) => Promise<Response>;
};
//# sourceMappingURL=fetch.d.ts.map

@@ -14,3 +14,3 @@ "use strict";

});
exports.productFetchApi = (callBridge) => {
const productFetchApi = (callBridge) => {
const fetch = (product, restPath, init) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {

@@ -34,1 +34,2 @@ const { body: requestBody, headers: requestHeaders } = yield parseBodyAndHeaders(init);

};
exports.productFetchApi = productFetchApi;

@@ -1,2 +0,2 @@

export declare const requestConfluence: (restPath: string, fetchOptions?: RequestInit | undefined) => Promise<Response>, requestJira: (restPath: string, fetchOptions?: RequestInit | undefined) => Promise<Response>;
export declare const requestConfluence: (restPath: string, fetchOptions?: RequestInit) => Promise<Response>, requestJira: (restPath: string, fetchOptions?: RequestInit) => Promise<Response>;
//# sourceMappingURL=index.d.ts.map

@@ -7,2 +7,2 @@ "use strict";

const fetch_1 = require("./fetch");
_a = fetch_1.productFetchApi(bridge_1.getCallBridge()), exports.requestConfluence = _a.requestConfluence, exports.requestJira = _a.requestJira;
_a = (0, fetch_1.productFetchApi)((0, bridge_1.getCallBridge)()), exports.requestConfluence = _a.requestConfluence, exports.requestJira = _a.requestJira;

@@ -6,2 +6,4 @@ export * from './invoke';

export * from './fetch';
export * from './flag';
export * from './events';
//# sourceMappingURL=index.d.ts.map

@@ -9,1 +9,3 @@ "use strict";

tslib_1.__exportStar(require("./fetch"), exports);
tslib_1.__exportStar(require("./flag"), exports);
tslib_1.__exportStar(require("./events"), exports);

@@ -7,3 +7,3 @@ "use strict";

const utils_1 = require("../utils");
const callBridge = bridge_1.getCallBridge();
const callBridge = (0, bridge_1.getCallBridge)();
const validatePayload = (payload) => {

@@ -23,2 +23,2 @@ if (!payload)

};
exports.invoke = utils_1.withRateLimiter(_invoke, 20, 2000, 'Resolver calls are rate limited at 20req/2s');
exports.invoke = (0, utils_1.withRateLimiter)(_invoke, 20, 2000, 'Resolver calls are rate limited at 20req/2s');

@@ -6,2 +6,4 @@ export interface ModalOptions {

context?: any;
closeOnEscape?: boolean;
closeOnOverlayClick?: boolean;
}

@@ -13,2 +15,4 @@ export declare class Modal {

context: any;
closeOnEscape: boolean;
closeOnOverlayClick: boolean;
constructor(opts?: ModalOptions);

@@ -15,0 +19,0 @@ open(): Promise<void>;

@@ -7,6 +7,7 @@ "use strict";

const errors_1 = require("../errors");
const callBridge = bridge_1.getCallBridge();
const callBridge = (0, bridge_1.getCallBridge)();
const noop = () => { };
class Modal {
constructor(opts) {
var _a, _b;
this.resource = (opts === null || opts === void 0 ? void 0 : opts.resource) || null;

@@ -16,2 +17,4 @@ this.onClose = (opts === null || opts === void 0 ? void 0 : opts.onClose) || noop;

this.context = (opts === null || opts === void 0 ? void 0 : opts.context) || {};
this.closeOnEscape = (_a = opts === null || opts === void 0 ? void 0 : opts.closeOnEscape) !== null && _a !== void 0 ? _a : true;
this.closeOnOverlayClick = (_b = opts === null || opts === void 0 ? void 0 : opts.closeOnOverlayClick) !== null && _b !== void 0 ? _b : true;
}

@@ -25,3 +28,5 @@ open() {

size: this.size,
context: this.context
context: this.context,
closeOnEscape: this.closeOnEscape,
closeOnOverlayClick: this.closeOnOverlayClick
});

@@ -28,0 +33,0 @@ if (success === false) {

export declare const router: {
navigate: (url: string) => Promise<void>;
open: (url: string) => Promise<void>;
reload: () => Promise<void>;
};
//# sourceMappingURL=router.d.ts.map

@@ -6,8 +6,10 @@ "use strict";

const bridge_1 = require("../bridge");
const callBridge = bridge_1.getCallBridge();
const callBridge = (0, bridge_1.getCallBridge)();
const navigate = (url) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { return callBridge('navigate', { url, type: 'same-tab' }); });
const open = (url) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { return callBridge('navigate', { url, type: 'new-tab' }); });
const reload = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { return callBridge('reload'); });
exports.router = {
navigate,
open
open,
reload
};

@@ -8,3 +8,23 @@ export declare type InvokePayload = {

} & Pick<ResponseInit, 'headers' | 'status' | 'statusText'>;
export declare type FullContext = {};
export interface FullContext {
accountId?: string;
cloudId?: string;
extension: ExtensionData;
license?: LicenseState;
localId: string;
locale: string;
moduleKey: string;
siteUrl: string;
timezone: string;
}
interface ExtensionData {
[k: string]: any;
}
interface LicenseState {
isActive?: boolean;
}
export declare type Subscription = {
unsubscribe: () => void;
};
export {};
//# sourceMappingURL=types.d.ts.map

@@ -1,2 +0,2 @@

export declare const withRateLimiter: <Fn extends (...args: any[]) => any>(wrappedFn: Fn, maxOps: number, intervalInMs: number, exceededErrorMessage?: string | undefined) => <T>(...args: Parameters<Fn>) => Promise<T>;
export declare const withRateLimiter: <Fn extends (...args: any[]) => any>(wrappedFn: Fn, maxOps: number, intervalInMs: number, exceededErrorMessage?: string) => <T>(...args: Parameters<Fn>) => Promise<T>;
//# sourceMappingURL=index.d.ts.map

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

const errors_1 = require("../errors");
exports.withRateLimiter = (wrappedFn, maxOps, intervalInMs, exceededErrorMessage) => {
const withRateLimiter = (wrappedFn, maxOps, intervalInMs, exceededErrorMessage) => {
let start = Date.now();

@@ -24,1 +24,2 @@ let numOps = 0;

};
exports.withRateLimiter = withRateLimiter;

@@ -7,4 +7,4 @@ "use strict";

const errors_1 = require("../errors");
const callBridge = bridge_1.getCallBridge();
exports.close = (payload) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
const callBridge = (0, bridge_1.getCallBridge)();
const close = (payload) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
try {

@@ -20,1 +20,2 @@ const success = yield callBridge('close', payload);

});
exports.close = close;
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.createHistory = void 0;
const tslib_1 = require("tslib");
const bridge_1 = require("../bridge");
const callBridge = bridge_1.getCallBridge();
exports.createHistory = () => {
return callBridge('createHistory');
};
const callBridge = (0, bridge_1.getCallBridge)();
const createHistory = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
const history = yield callBridge('createHistory');
history.listen((location) => {
history.location = location;
});
return history;
});
exports.createHistory = createHistory;

@@ -5,5 +5,6 @@ "use strict";

const bridge_1 = require("../bridge");
const callBridge = bridge_1.getCallBridge();
exports.getContext = () => {
const callBridge = (0, bridge_1.getCallBridge)();
const getContext = () => {
return callBridge('getContext');
};
exports.getContext = getContext;

@@ -7,4 +7,4 @@ "use strict";

const errors_1 = require("../errors");
const callBridge = bridge_1.getCallBridge();
exports.submit = (payload) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
const callBridge = (0, bridge_1.getCallBridge)();
const submit = (payload) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
const success = yield callBridge('submit', payload);

@@ -15,1 +15,2 @@ if (success === false) {

});
exports.submit = submit;
export declare const view: {
submit: (payload?: any) => Promise<void>;
close: (payload?: any) => Promise<void>;
refresh: (payload?: any) => Promise<void>;
createHistory: () => Promise<import("history").History<unknown>>;

@@ -5,0 +6,0 @@ getContext: () => Promise<import("../types").FullContext>;

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

const close_1 = require("./close");
const refresh_1 = require("./refresh");
const createHistory_1 = require("./createHistory");

@@ -12,4 +13,5 @@ const getContext_1 = require("./getContext");

close: close_1.close,
refresh: refresh_1.refresh,
createHistory: createHistory_1.createHistory,
getContext: getContext_1.getContext
};
{
"name": "@forge/bridge",
"version": "0.0.0-experimental-64caa5a",
"version": "0.0.0-experimental-72f4150",
"description": "Forge bridge API for custom UI apps",
"author": "Atlassian",
"license": "UNLICENSED",
"main": "out/index.js",
"browser": "out/index.js",

@@ -8,0 +9,0 @@ "types": "out/index.d.ts",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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