@forge/api 2.9.0-next.0 → 2.9.1-next.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +12 -0
- package/out/api/fetch.d.ts.map +1 -1
- package/out/api/fetch.js +10 -1
- package/package.json +2 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @forge/api
|
|
2
2
|
|
|
3
|
+
## 2.9.1-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 7a4fa35: Support internet egress calls in the new runtime
|
|
8
|
+
|
|
9
|
+
## 2.9.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- e5dd325: support for requestBitbucket
|
|
14
|
+
|
|
3
15
|
## 2.9.0-next.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/out/api/fetch.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/api/fetch.ts"],"names":[],"mappings":";AAAA,OAAc,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAoB,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/api/fetch.ts"],"names":[],"mappings":";AAAA,OAAc,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAoB,MAAM,YAAY,CAAC;AACzF,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAI9B,aAAK,aAAa,GAAG,CAAC,GAAG,EAAE,WAAW,GAAG,GAAG,EAAE,OAAO,EAAE,WAAW,GAAG,SAAS,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAErG,MAAM,WAAW,gBAAgB;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;CACb;AAED,eAAO,MAAM,gBAAgB,aACjB,KAAK,GAAG,MAAM,GAAG,SAAS,UAC5B,MAAM,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,KACvD,aAiBF,CAAC;AAuBF,wBAAgB,iBAAiB,IAAI,QAAQ,CAoB5C;AAED,wBAAgB,oBAAoB,IAAI,QAAQ,GAAG,IAAI,CAOtD"}
|
package/out/api/fetch.js
CHANGED
|
@@ -5,6 +5,7 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const node_fetch_1 = tslib_1.__importStar(require("node-fetch"));
|
|
6
6
|
const _1 = require(".");
|
|
7
7
|
const polyfill_response_1 = require("./polyfill-response");
|
|
8
|
+
const egress_1 = require("@forge/egress");
|
|
8
9
|
const createProxyFetch = (provider, remote) => {
|
|
9
10
|
return (url, options) => {
|
|
10
11
|
const proxy = global.proxyInfo;
|
|
@@ -20,9 +21,17 @@ exports.createProxyFetch = createProxyFetch;
|
|
|
20
21
|
const throwNotImplementedError = () => {
|
|
21
22
|
throw new Error('not implemented');
|
|
22
23
|
};
|
|
24
|
+
const wrapExternalEgress = (url, options) => {
|
|
25
|
+
const allowedEgress = global.allowedEgress;
|
|
26
|
+
const egressFilteringService = new egress_1.EgressFilteringService(allowedEgress);
|
|
27
|
+
if (!egressFilteringService.isValidUrl(url)) {
|
|
28
|
+
throw new Error(`URL not included in the external fetch backend permissions: ${url}. Visit go.atlassian.com/forge-egress for more information.`);
|
|
29
|
+
}
|
|
30
|
+
return (0, node_fetch_1.default)(url, options);
|
|
31
|
+
};
|
|
23
32
|
function getNodeRuntimeAPI() {
|
|
24
33
|
return {
|
|
25
|
-
fetch:
|
|
34
|
+
fetch: (0, _1.wrapWithRouteUnwrapper)(wrapExternalEgress),
|
|
26
35
|
requestJira: throwNotImplementedError,
|
|
27
36
|
requestConfluence: throwNotImplementedError,
|
|
28
37
|
requestBitbucket: throwNotImplementedError,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/api",
|
|
3
|
-
"version": "2.9.
|
|
3
|
+
"version": "2.9.1-next.0",
|
|
4
4
|
"description": "Forge API methods",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@forge/auth": "^0.0.1",
|
|
19
|
+
"@forge/egress": "^1.1.1",
|
|
19
20
|
"@forge/storage": "^1.3.1",
|
|
20
21
|
"@types/node-fetch": "^2.5.7",
|
|
21
22
|
"node-fetch": "2.6.7"
|