@forge/api 2.18.4-next.2 → 2.18.4-next.3
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
CHANGED
package/out/api/runtime.d.ts
CHANGED
package/out/api/runtime.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"runtime.d.ts","sourceRoot":"","sources":["../../src/api/runtime.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,wCAAwC,CAAC;AAU5E,MAAM,MAAM,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,MAAM,MAAM,YAAY,GAAG;IACzB,KAAK,EAAE,SAAS,CAAC;IACjB,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAC;QACd,aAAa,EAAE,MAAM,CAAC;QACtB,UAAU,EAAE,MAAM,CAAC;QACnB,WAAW,EAAE,MAAM,CAAC;QACpB,UAAU,EAAE,MAAM,CAAC;QACnB,SAAS,EAAE,MAAM,CAAC;KACnB,CAAC;IACF,aAAa,EAAE,MAAM,EAAE,CAAC;IACxB,aAAa,EAAE;QACb,YAAY,EAAE,MAAM,CAAC;KACtB,CAAC;IACF,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,MAAM,EAAE,MAAM,CAAC;KAChB,CAAC;IACF,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,CAAC,EAAE;QACJ,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;CACH,CAAC;AAEF,wBAAgB,UAAU,IAAI,YAAY,CAOzC;AAED,wBAAgB,aAAa,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,GAAG,EACvD,IAAI,EAAE,M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C,IAAI,SAAS,OAAO,EAAE,EAAE,GAAG,EACvD,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,EACnC,EAAE,IAAI,EAAE,GAAE;IAAE,IAAI,CAAC,EAAE,IAAI,CAAA;CAAO,GAC7B,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,CAiBjC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authorization/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS;;;;;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/authorization/index.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,SAAS;;;;;CA0BrB,CAAC"}
|
|
@@ -2,16 +2,23 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.authorize = void 0;
|
|
4
4
|
const auth_1 = require("@forge/auth");
|
|
5
|
-
const
|
|
5
|
+
const __1 = require("..");
|
|
6
6
|
const authorize = () => {
|
|
7
|
-
|
|
7
|
+
let accountId;
|
|
8
|
+
if (global.api) {
|
|
9
|
+
accountId = process.env.__CURRENT_USER_ACCOUNT_ID;
|
|
10
|
+
}
|
|
11
|
+
else {
|
|
12
|
+
accountId = (0, __1.getRuntime)().aaid;
|
|
13
|
+
}
|
|
14
|
+
if (!accountId) {
|
|
8
15
|
throw new Error(`Couldn’t find the accountId of the invoking user. This API can only be used inside user-invoked modules.`);
|
|
9
|
-
|
|
16
|
+
}
|
|
10
17
|
return Object.assign(Object.assign({}, (0, auth_1.authorizeConfluenceWithFetch)(async (path, opts) => {
|
|
11
|
-
const res = await
|
|
18
|
+
const res = await (0, __1.asUser)().requestConfluence((0, __1.assumeTrustedRoute)(path), opts);
|
|
12
19
|
return res.json();
|
|
13
20
|
}, accountId)), (0, auth_1.authorizeJiraWithFetch)(async (path, opts) => {
|
|
14
|
-
const res = await
|
|
21
|
+
const res = await (0, __1.asUser)().requestJira((0, __1.assumeTrustedRoute)(path), opts);
|
|
15
22
|
return res.json();
|
|
16
23
|
}, accountId));
|
|
17
24
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/api",
|
|
3
|
-
"version": "2.18.4-next.
|
|
3
|
+
"version": "2.18.4-next.3",
|
|
4
4
|
"description": "Forge API methods",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -12,13 +12,13 @@
|
|
|
12
12
|
"compile": "tsc -b -v"
|
|
13
13
|
},
|
|
14
14
|
"devDependencies": {
|
|
15
|
-
"@forge/runtime": "4.4.6-next.
|
|
15
|
+
"@forge/runtime": "4.4.6-next.4",
|
|
16
16
|
"@types/node": "14.18.54",
|
|
17
17
|
"jest-matcher-specific-error": "^1.0.0",
|
|
18
18
|
"nock": "^10.0.6"
|
|
19
19
|
},
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@forge/auth": "0.0.4-next.
|
|
21
|
+
"@forge/auth": "0.0.4-next.1",
|
|
22
22
|
"@forge/egress": "1.2.2",
|
|
23
23
|
"@forge/storage": "1.5.6-next.1",
|
|
24
24
|
"@forge/util": "1.3.1",
|