@forge/bridge
Advanced tools
Comparing version 2.4.0 to 2.5.0-next.0
# @forge/bridge | ||
## 2.5.0-next.0 | ||
### Minor Changes | ||
- 6269d73d: Fix return type for getContext method | ||
## 2.4.0 | ||
@@ -4,0 +10,0 @@ |
@@ -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; |
@@ -5,3 +5,3 @@ "use strict"; | ||
const bridge_1 = require("../bridge"); | ||
const callBridge = bridge_1.getCallBridge(); | ||
const callBridge = (0, bridge_1.getCallBridge)(); | ||
const emit = (event, payload) => { | ||
@@ -8,0 +8,0 @@ return callBridge('emit', { event, payload }); |
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; |
@@ -7,4 +7,4 @@ "use strict"; | ||
const errors_1 = require("../errors"); | ||
const callBridge = bridge_1.getCallBridge(); | ||
exports.showFlag = (options) => { | ||
const callBridge = (0, bridge_1.getCallBridge)(); | ||
const showFlag = (options) => { | ||
var _a; | ||
@@ -22,1 +22,2 @@ if (!options.id) { | ||
}; | ||
exports.showFlag = showFlag; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.showFlag = void 0; | ||
var flag_1 = require("./flag"); | ||
Object.defineProperty(exports, "showFlag", { enumerable: true, get: function () { return flag_1.showFlag; } }); |
@@ -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'); |
@@ -7,3 +7,3 @@ "use strict"; | ||
const errors_1 = require("../errors"); | ||
const callBridge = bridge_1.getCallBridge(); | ||
const callBridge = (0, bridge_1.getCallBridge)(); | ||
const noop = () => { }; | ||
@@ -10,0 +10,0 @@ class Modal { |
@@ -6,3 +6,3 @@ "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' }); }); | ||
@@ -9,0 +9,0 @@ const open = (url) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { return callBridge('navigate', { url, type: 'new-tab' }); }); |
@@ -8,6 +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; |
@@ -6,4 +6,4 @@ "use strict"; | ||
const bridge_1 = require("../bridge"); | ||
const callBridge = bridge_1.getCallBridge(); | ||
exports.createHistory = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const callBridge = (0, bridge_1.getCallBridge)(); | ||
const createHistory = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const history = yield callBridge('createHistory'); | ||
@@ -15,1 +15,2 @@ history.listen((location) => { | ||
}); | ||
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.refresh = (payload) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const callBridge = (0, bridge_1.getCallBridge)(); | ||
const refresh = (payload) => tslib_1.__awaiter(void 0, void 0, void 0, function* () { | ||
const success = yield callBridge('refresh', payload); | ||
@@ -15,1 +15,2 @@ if (success === false) { | ||
}); | ||
exports.refresh = refresh; |
@@ -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; |
{ | ||
"name": "@forge/bridge", | ||
"version": "2.4.0", | ||
"version": "2.5.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
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
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
30199
434
2