@forge/api 3.3.1 → 3.4.0-experimental-6835792
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 +7 -2
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @forge/api
|
|
2
2
|
|
|
3
|
+
## 3.4.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 4d149f1: Support absolute paths for withProvider fetch for the Node runtime
|
|
8
|
+
|
|
9
|
+
## 3.4.0-next.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 4d149f1: Support absolute paths for withProvider fetch for the Node runtime
|
|
14
|
+
|
|
3
15
|
## 3.3.1
|
|
4
16
|
|
|
5
17
|
### Patch 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":"AAEA,OAAc,EAAE,WAAW,EAAkC,MAAM,YAAY,CAAC;AAShF,OAAO,EAIL,QAAQ,EACR,WAAW,EAEZ,MAAM,IAAI,CAAC;AAKZ,aAAK,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AAC5C,aAAK,SAAS,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,CAAC;AAElE,aAAK,oBAAoB,GAAG,MAAM,CAAC;AACnC,aAAK,kBAAkB,GAAG,MAAM,CAAC;AAEjC,aAAK,SAAS,GAAG;IAAE,QAAQ,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,SAAS,CAAA;CAAE,CAAC;AAC/D,aAAK,qBAAqB,GAAG;IAAE,QAAQ,EAAE,oBAAoB,CAAC;IAAC,MAAM,EAAE,kBA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
|
|
|
22
22
|
exports.fetchProduct = fetchProduct;
|
|
23
23
|
function fetchRemote(args) {
|
|
24
24
|
return async (path, init) => {
|
|
25
|
-
const
|
|
25
|
+
const remoteUrl = new URL(`https://${args.remote}`);
|
|
26
|
+
const url = new URL(path, remoteUrl);
|
|
27
|
+
if (url.hostname !== remoteUrl.hostname) {
|
|
28
|
+
throw new Error(`Invalid path provided ${path}`);
|
|
29
|
+
}
|
|
30
|
+
remoteUrl.searchParams.append('path', path);
|
|
26
31
|
init = (0, exports.addMagicAgent)(init, 'EXTERNAL_AUTH_REQUEST');
|
|
27
32
|
init.headers = Object.assign(Object.assign({}, init.headers), { authorization: `Forge user ${args.provider} ${args.account}` });
|
|
28
|
-
const response = await (0, node_fetch_1.default)(
|
|
33
|
+
const response = await (0, node_fetch_1.default)(remoteUrl, init);
|
|
29
34
|
handleProxyResponseErrors(response);
|
|
30
35
|
return response;
|
|
31
36
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/api",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.0-experimental-6835792",
|
|
4
4
|
"description": "Forge API methods",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
"compile": "tsc -b -v"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@forge/runtime": "5.
|
|
15
|
+
"@forge/runtime": "5.6.0-experimental-6835792",
|
|
16
16
|
"@types/node": "14.18.63",
|
|
17
17
|
"expect-type": "^0.17.3",
|
|
18
18
|
"jest-matcher-specific-error": "^1.0.0",
|