@forge/bridge
Advanced tools
Comparing version 0.0.0-experimental-8caa8a2 to 0.0.0-experimental-906222c
# @forge/bridge | ||
## 0.0.0-experimental-8caa8a2 | ||
## 0.0.0-experimental-906222c | ||
### Major Changes | ||
- 906222c: Add new resolvers | ||
## 2.0.0 | ||
### Major Changes | ||
- 2f07efb: Add new client-side 3LO requestJira and requestConfluence methods | ||
## 2.0.0-next.0 | ||
### Major Changes | ||
- 2f07efb: Add new client-side 3LO requestJira and requestConfluence methods | ||
## 1.5.0 | ||
### Minor Changes | ||
- c5aedc4: Move createHistory method into view namespace | ||
- 05977d4: Add modal api | ||
- eafead6: Add createHistory method to router API | ||
## 1.5.0-next.2 | ||
### Minor Changes | ||
- c5aedc4: Move createHistory method into view namespace | ||
## 1.5.0-next.1 | ||
### Minor Changes | ||
- eafead6: Add createHistory method to router API | ||
## 1.5.0-next.0 | ||
### Minor Changes | ||
- 05977d4: Add modal api | ||
## 1.4.0 | ||
### Minor Changes | ||
- 6bb4c77: router.open and router.navigate are now supported in Confluence | ||
## 1.4.0-next.0 | ||
### Minor Changes | ||
- 6bb4c77: router.open and router.navigate are now supported in Confluence | ||
## 1.3.0 | ||
### Minor Changes | ||
- 69e2a9e: Expose router.open for opening external links in new tabs | ||
- fbc16b0: Add router.navigate to bridge | ||
### Patch Changes | ||
- 180e45a: Throw error if router is used from confluence | ||
- ff35ac9: Check for Jira instead of Confluence | ||
## 1.3.0-next.3 | ||
### Patch Changes | ||
- ff35ac9: Check for Jira instead of Confluence | ||
## 1.3.0-next.2 | ||
### Minor Changes | ||
- 69e2a9e: Expose router.open for opening external links in new tabs | ||
## 1.3.0-next.1 | ||
### Patch Changes | ||
- 180e45a: Throw error if router is used from confluence | ||
## 1.3.0-next.0 | ||
### Minor Changes | ||
- fbc16b0: Add router.navigate to bridge | ||
## 1.2.0 | ||
### Minor Changes | ||
- 74a0279: Add getContext method | ||
@@ -8,0 +100,0 @@ |
export * from './invoke'; | ||
export * from './view'; | ||
export * from './router'; | ||
export * from './modal'; | ||
export * from './fetch'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -6,1 +6,4 @@ "use strict"; | ||
tslib_1.__exportStar(require("./view"), exports); | ||
tslib_1.__exportStar(require("./router"), exports); | ||
tslib_1.__exportStar(require("./modal"), exports); | ||
tslib_1.__exportStar(require("./fetch"), exports); |
export * from './invoke'; | ||
export * from './requestJira'; | ||
export * from './requestConfluence'; | ||
//# sourceMappingURL=index.d.ts.map |
@@ -5,3 +5,1 @@ "use strict"; | ||
tslib_1.__exportStar(require("./invoke"), exports); | ||
tslib_1.__exportStar(require("./requestJira"), exports); | ||
tslib_1.__exportStar(require("./requestConfluence"), exports); |
import { InvokePayload } from '../types'; | ||
export declare const invoke: <T>(functionKey: string, payload?: InvokePayload | undefined) => Promise<T>; | ||
export declare const resolver: { | ||
get: (fullPath: string, options: RequestInit) => Promise<Response>; | ||
post: (fullPath: string, options: RequestInit) => Promise<Response>; | ||
put: (fullPath: string, options: RequestInit) => Promise<Response>; | ||
patch: (fullPath: string, options: RequestInit) => Promise<Response>; | ||
delete: (fullPath: string, options: RequestInit) => Promise<Response>; | ||
}; | ||
//# sourceMappingURL=invoke.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.invoke = void 0; | ||
exports.resolver = exports.invoke = void 0; | ||
var tslib_1 = require("tslib"); | ||
var bridge_1 = require("../bridge"); | ||
@@ -23,1 +24,43 @@ var errors_1 = require("../errors"); | ||
exports.invoke = utils_1.withRateLimiter(_invoke, 20, 2000, 'Resolver calls are rate limited at 20req/2s'); | ||
var parseQs = function (qs) { | ||
var query = {}; | ||
var items = qs.split('&'); | ||
items.forEach(function (item) { | ||
var _a = item.split('='), key = _a[0], value = _a[1]; | ||
query[key] = value; | ||
}); | ||
return query; | ||
}; | ||
var provisionResolverMethod = function (method) { | ||
return function (fullPath, options) { return tslib_1.__awaiter(void 0, void 0, void 0, function () { | ||
var _a, path, queryString, query, response; | ||
return tslib_1.__generator(this, function (_b) { | ||
switch (_b.label) { | ||
case 0: | ||
_a = fullPath.split('?'), path = _a[0], queryString = _a[1]; | ||
query = parseQs(queryString); | ||
return [4, exports.invoke(path, { | ||
__meta: { | ||
headers: options.headers, | ||
body: options.body, | ||
query: query, | ||
method: method | ||
} | ||
})]; | ||
case 1: | ||
response = _b.sent(); | ||
return [2, new Response(response.body, { | ||
headers: new Headers(response.headers), | ||
status: response.statusCode | ||
})]; | ||
} | ||
}); | ||
}); }; | ||
}; | ||
exports.resolver = { | ||
get: provisionResolverMethod('GET'), | ||
post: provisionResolverMethod('POST'), | ||
put: provisionResolverMethod('PUT'), | ||
patch: provisionResolverMethod('PATCH'), | ||
delete: provisionResolverMethod('DELETE') | ||
}; |
@@ -5,6 +5,6 @@ export declare type InvokePayload = { | ||
export declare type InvokeResponse = Record<string, any> | void; | ||
export declare type ProductResponse = { | ||
body: any; | ||
} & Pick<Response, 'ok' | 'status' | 'statusText'>; | ||
export declare type ProductFetchResponse = { | ||
body?: string; | ||
} & Pick<ResponseInit, 'headers' | 'status' | 'statusText'>; | ||
export declare type FullContext = {}; | ||
//# sourceMappingURL=types.d.ts.map |
@@ -1,2 +0,2 @@ | ||
export declare const close: () => Promise<void>; | ||
export declare const close: (payload?: any) => Promise<void>; | ||
//# sourceMappingURL=close.d.ts.map |
@@ -8,3 +8,3 @@ "use strict"; | ||
var callBridge = bridge_1.getCallBridge(); | ||
exports.close = function () { return tslib_1.__awaiter(void 0, void 0, void 0, function () { | ||
exports.close = function (payload) { return tslib_1.__awaiter(void 0, void 0, void 0, function () { | ||
var success, e_1; | ||
@@ -15,3 +15,3 @@ return tslib_1.__generator(this, function (_a) { | ||
_a.trys.push([0, 2, , 3]); | ||
return [4, callBridge('close')]; | ||
return [4, callBridge('close', payload)]; | ||
case 1: | ||
@@ -18,0 +18,0 @@ success = _a.sent(); |
export declare const view: { | ||
close: () => Promise<void>; | ||
close: (payload?: any) => Promise<void>; | ||
createHistory: () => Promise<import("history").History<unknown>>; | ||
getContext: () => Promise<import("../types").FullContext>; | ||
}; | ||
//# sourceMappingURL=view.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.view = void 0; | ||
var close_1 = require("./close"); | ||
var createHistory_1 = require("./createHistory"); | ||
var getContext_1 = require("./getContext"); | ||
var close_1 = require("./close"); | ||
exports.view = { | ||
close: close_1.close, | ||
createHistory: createHistory_1.createHistory, | ||
getContext: getContext_1.getContext | ||
}; |
{ | ||
"name": "@forge/bridge", | ||
"version": "0.0.0-experimental-8caa8a2", | ||
"version": "0.0.0-experimental-906222c", | ||
"description": "Forge bridge API for custom UI apps", | ||
@@ -14,5 +14,10 @@ "author": "Atlassian", | ||
}, | ||
"dependencies": { | ||
"@types/history": "^4.7.8" | ||
}, | ||
"devDependencies": { | ||
"jest-date-mock": "^1.0.8" | ||
"history": "4.10.1", | ||
"jest-date-mock": "^1.0.8", | ||
"isomorphic-fetch": "^3.0.0" | ||
} | ||
} |
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
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Network access
Supply chain riskThis module accesses the network.
Found 1 instance in 1 package
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
24909
57
388
1
3
7357
3
0
+ Added@types/history@^4.7.8
+ Added@types/history@4.7.11(transitive)