@forge/api 3.6.0-next.0 → 3.7.0-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 +1 -1
- package/out/api/fetch.d.ts.map +1 -1
- package/out/index.d.ts +3 -2
- package/out/index.d.ts.map +1 -1
- package/out/index.js +7 -4
- package/out/runtime/fetch-and-storage.d.ts +6 -3
- package/out/runtime/fetch-and-storage.d.ts.map +1 -1
- package/out/runtime/fetch-and-storage.js +14 -15
- package/out/webTrigger.js +3 -3
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @forge/api
|
|
2
2
|
|
|
3
|
+
## 3.7.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 2cd49c2: Add \_\_requestAtlassian methods
|
|
8
|
+
|
|
9
|
+
## 3.6.0
|
|
10
|
+
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 1588c76: Embed metrics for external auth method calls in Node Runtime
|
|
14
|
+
|
|
3
15
|
## 3.6.0-next.0
|
|
4
16
|
|
|
5
17
|
### Minor Changes
|
package/out/api/fetch.d.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { RequestInit } from 'node-fetch';
|
|
2
2
|
import { FetchAPI, FetchMethod } from '..';
|
|
3
|
-
declare type AuthProvider = 'app' | 'user' | 'none';
|
|
3
|
+
export declare type AuthProvider = 'app' | 'user' | 'none';
|
|
4
4
|
declare type RemoteAPI = 'jira' | 'confluence' | 'stargate' | 'bitbucket';
|
|
5
5
|
declare type ExternalAuthProvider = string;
|
|
6
6
|
declare type ExternalAuthRemote = string;
|
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,
|
|
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,oBAAY,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AACnD,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,kBAAkB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAuB7G,wBAAgB,YAAY,CAAC,IAAI,EAAE,SAAS,GAAG,WAAW,CAqBzD;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,qBAAqB,GAAG,WAAW,CA0BpE;AA+GD,eAAO,MAAM,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,WAG1E,CAAC;AAkDH,wBAAgB,iBAAiB,IAAI,QAAQ,CAsB5C;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,GAAG,GAAG,QAAQ,CAEvD"}
|
package/out/index.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import { QueryApi, EntityStorageApi } from '@forge/storage';
|
|
|
3
3
|
import { authorize } from './authorization';
|
|
4
4
|
import { Route } from './safeUrl';
|
|
5
5
|
import { webTrigger } from './webTrigger';
|
|
6
|
-
import {
|
|
6
|
+
import { __requestAtlassianAsApp, __requestAtlassianAsUser } from './runtime/fetch-and-storage';
|
|
7
7
|
export declare type APIResponse = Pick<Response, 'json' | 'text' | 'arrayBuffer' | 'ok' | 'status' | 'statusText' | 'headers'>;
|
|
8
8
|
export declare type FetchMethod = (url: string, init?: RequestInit) => Promise<APIResponse>;
|
|
9
9
|
export declare type FetchMethodAllowingRoute = (url: string | Route, init?: RequestInit) => Promise<APIResponse>;
|
|
@@ -88,7 +88,8 @@ export declare const privacy: {
|
|
|
88
88
|
reportPersonalData: (accounts: import("./privacy").Account[]) => Promise<import("./privacy").AccountUpdate[]>;
|
|
89
89
|
};
|
|
90
90
|
export default API;
|
|
91
|
-
export { asUser, asApp, authorize, fetch, requestJira, requestConfluence, requestBitbucket, store, storage, properties, webTrigger,
|
|
91
|
+
export { asUser, asApp, authorize, fetch, requestJira, requestConfluence, requestBitbucket, store, storage, properties, webTrigger, __requestAtlassianAsApp, __requestAtlassianAsUser };
|
|
92
|
+
export declare const createRequestStargateAsApp: () => FetchMethod;
|
|
92
93
|
export { QueryBuilder, QueryApi, EntityStorageApi, Condition, ListResult, Predicate, Result, Value, WherePredicate, FilterPredicate, startsWith, WhereConditions, FilterConditions, SortOrder } from '@forge/storage';
|
|
93
94
|
export { route, assumeTrustedRoute, routeFromAbsolute, Route } from './safeUrl';
|
|
94
95
|
export { ForgeRuntime, AppContext, getAppContext, __getRuntime } from './api/runtime';
|
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AACnD,OAAO,EAA8C,QAAQ,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAExG,OAAO,EAAE,SA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ACV,eAAe,EACf,gBAAgB,EAChB,SAAS,EACV,MAAM,gBAAgB,CAAC;AAExB,OAAO,EAAE,KAAK,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAChF,OAAO,EAAE,YAAY,EAAE,UAAU,EAAE,aAAa,EAAE,YAAY,EAAE,MAAM,eAAe,CAAC;AACtF,OAAO,EACL,wBAAwB,EACxB,+BAA+B,EAC/B,iBAAiB,EACjB,UAAU,EACV,+BAA+B,EAC/B,8BAA8B,EAC9B,6BAA6B,EAC7B,eAAe,EACf,8BAA8B,EAC9B,SAAS,EACT,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EACjB,eAAe,EAChB,MAAM,cAAc,CAAC"}
|
package/out/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isExpectedError = exports.isHostedCodeError = exports.isForgePlatformError = exports.FUNCTION_ERR = exports.HttpError = exports.InvalidWorkspaceRequestedError = exports.NotAllowedError = exports.RequestProductNotAllowedError = exports.ProductEndpointNotAllowedError = exports.ExternalEndpointNotAllowedError = exports.FetchError = exports.ProxyRequestError = exports.NeedsAuthenticationError = exports.__getRuntime = exports.getAppContext = exports.routeFromAbsolute = exports.assumeTrustedRoute = exports.route = exports.SortOrder = exports.FilterConditions = exports.WhereConditions = exports.startsWith = exports.createRequestStargateAsApp = exports.webTrigger = exports.properties = exports.storage = exports.store = exports.requestBitbucket = exports.requestConfluence = exports.requestJira = exports.fetch = exports.authorize = exports.asApp = exports.asUser = exports.privacy = void 0;
|
|
3
|
+
exports.isExpectedError = exports.isHostedCodeError = exports.isForgePlatformError = exports.FUNCTION_ERR = exports.HttpError = exports.InvalidWorkspaceRequestedError = exports.NotAllowedError = exports.RequestProductNotAllowedError = exports.ProductEndpointNotAllowedError = exports.ExternalEndpointNotAllowedError = exports.FetchError = exports.ProxyRequestError = exports.NeedsAuthenticationError = exports.__getRuntime = exports.getAppContext = exports.routeFromAbsolute = exports.assumeTrustedRoute = exports.route = exports.SortOrder = exports.FilterConditions = exports.WhereConditions = exports.startsWith = exports.createRequestStargateAsApp = exports.__requestAtlassianAsUser = exports.__requestAtlassianAsApp = exports.webTrigger = exports.properties = exports.storage = exports.store = exports.requestBitbucket = exports.requestConfluence = exports.requestJira = exports.fetch = exports.authorize = exports.asApp = exports.asUser = exports.privacy = void 0;
|
|
4
4
|
const storage_1 = require("@forge/storage");
|
|
5
5
|
const authorization_1 = require("./authorization");
|
|
6
6
|
Object.defineProperty(exports, "authorize", { enumerable: true, get: function () { return authorization_1.authorize; } });
|
|
@@ -9,7 +9,8 @@ const privacy_1 = require("./privacy");
|
|
|
9
9
|
const webTrigger_1 = require("./webTrigger");
|
|
10
10
|
Object.defineProperty(exports, "webTrigger", { enumerable: true, get: function () { return webTrigger_1.webTrigger; } });
|
|
11
11
|
const fetch_and_storage_1 = require("./runtime/fetch-and-storage");
|
|
12
|
-
Object.defineProperty(exports, "
|
|
12
|
+
Object.defineProperty(exports, "__requestAtlassianAsApp", { enumerable: true, get: function () { return fetch_and_storage_1.__requestAtlassianAsApp; } });
|
|
13
|
+
Object.defineProperty(exports, "__requestAtlassianAsUser", { enumerable: true, get: function () { return fetch_and_storage_1.__requestAtlassianAsUser; } });
|
|
13
14
|
function withDeprecatedMessage(method, message) {
|
|
14
15
|
const wrappedMethod = (...args) => {
|
|
15
16
|
console.warn(message);
|
|
@@ -40,15 +41,17 @@ const deprecatedPropertiesApi = Object.entries(properties_1.propertiesApi)
|
|
|
40
41
|
.reduce((acc, next) => Object.assign(acc, next), {});
|
|
41
42
|
const store = deprecatedPropertiesApi;
|
|
42
43
|
exports.store = store;
|
|
43
|
-
const storage = (0, storage_1.getStorageInstanceWithQuery)(new storage_1.GlobalStorage(fetch_and_storage_1.getContextAri,
|
|
44
|
+
const storage = (0, storage_1.getStorageInstanceWithQuery)(new storage_1.GlobalStorage(fetch_and_storage_1.getContextAri, fetch_and_storage_1.__requestAtlassianAsApp));
|
|
44
45
|
exports.storage = storage;
|
|
45
46
|
const properties = properties_1.propertiesApi;
|
|
46
47
|
exports.properties = properties;
|
|
47
48
|
const API = Object.assign(Object.assign({}, fetchAPI), { store: Object.assign({}, store) });
|
|
48
49
|
exports.privacy = {
|
|
49
|
-
reportPersonalData: (0, privacy_1.createReportPersonalData)(
|
|
50
|
+
reportPersonalData: (0, privacy_1.createReportPersonalData)(fetch_and_storage_1.__requestAtlassianAsApp)
|
|
50
51
|
};
|
|
51
52
|
exports.default = API;
|
|
53
|
+
const createRequestStargateAsApp = () => fetch_and_storage_1.__requestAtlassianAsApp;
|
|
54
|
+
exports.createRequestStargateAsApp = createRequestStargateAsApp;
|
|
52
55
|
var storage_2 = require("@forge/storage");
|
|
53
56
|
Object.defineProperty(exports, "startsWith", { enumerable: true, get: function () { return storage_2.startsWith; } });
|
|
54
57
|
Object.defineProperty(exports, "WhereConditions", { enumerable: true, get: function () { return storage_2.WhereConditions; } });
|
|
@@ -1,5 +1,8 @@
|
|
|
1
1
|
import { FetchMethod } from '..';
|
|
2
|
-
|
|
3
|
-
export declare
|
|
4
|
-
export declare
|
|
2
|
+
import { AuthProvider } from '../api/fetch';
|
|
3
|
+
export declare function getContextAri(): any;
|
|
4
|
+
export declare function getFetchAPI(): import("..").FetchAPI;
|
|
5
|
+
export declare function getRequestStargate(provider: AuthProvider): FetchMethod;
|
|
6
|
+
export declare const __requestAtlassianAsApp: FetchMethod;
|
|
7
|
+
export declare const __requestAtlassianAsUser: FetchMethod;
|
|
5
8
|
//# sourceMappingURL=fetch-and-storage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-and-storage.d.ts","sourceRoot":"","sources":["../../src/runtime/fetch-and-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch-and-storage.d.ts","sourceRoot":"","sources":["../../src/runtime/fetch-and-storage.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,IAAI,CAAC;AACjC,OAAO,EAAyD,YAAY,EAAE,MAAM,cAAc,CAAC;AAGnG,wBAAgB,aAAa,QAE5B;AAED,wBAAgB,WAAW,0BAO1B;AAED,wBAAgB,kBAAkB,CAAC,QAAQ,EAAE,YAAY,GAAG,WAAW,CAEtE;AAED,eAAO,MAAM,uBAAuB,EAAE,WAAuC,CAAC;AAC9E,eAAO,MAAM,wBAAwB,EAAE,WAAwC,CAAC"}
|
|
@@ -1,22 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.__requestAtlassianAsUser = exports.__requestAtlassianAsApp = exports.getRequestStargate = exports.getFetchAPI = exports.getContextAri = void 0;
|
|
4
4
|
const fetch_1 = require("../api/fetch");
|
|
5
5
|
const runtime_1 = require("../api/runtime");
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
const sandboxGetAppAri = (_a = global.api) === null || _a === void 0 ? void 0 : _a.__getAppAri;
|
|
11
|
-
if (sandboxGetAppAri) {
|
|
12
|
-
return sandboxGetAppAri();
|
|
13
|
-
}
|
|
14
|
-
else {
|
|
15
|
-
return (0, runtime_1.__getRuntime)().contextAri;
|
|
16
|
-
}
|
|
17
|
-
};
|
|
6
|
+
function getContextAri() {
|
|
7
|
+
var _a, _b, _c;
|
|
8
|
+
return (_c = (_b = (_a = global.api) === null || _a === void 0 ? void 0 : _a.__getAppAri) === null || _b === void 0 ? void 0 : _b.call(_a)) !== null && _c !== void 0 ? _c : (0, runtime_1.__getRuntime)().contextAri;
|
|
9
|
+
}
|
|
18
10
|
exports.getContextAri = getContextAri;
|
|
19
|
-
|
|
11
|
+
function getFetchAPI() {
|
|
20
12
|
const { api: sandboxAPI } = global;
|
|
21
13
|
if (sandboxAPI && Object.keys(sandboxAPI).length) {
|
|
22
14
|
return (0, fetch_1.getSandboxRuntimeAPI)(sandboxAPI);
|
|
@@ -24,5 +16,12 @@ const getFetchAPI = () => {
|
|
|
24
16
|
else {
|
|
25
17
|
return (0, fetch_1.getNodeRuntimeAPI)();
|
|
26
18
|
}
|
|
27
|
-
}
|
|
19
|
+
}
|
|
28
20
|
exports.getFetchAPI = getFetchAPI;
|
|
21
|
+
function getRequestStargate(provider) {
|
|
22
|
+
var _a, _b;
|
|
23
|
+
return (_b = (_a = global.api) === null || _a === void 0 ? void 0 : _a.asApp().__requestAtlassian) !== null && _b !== void 0 ? _b : (0, fetch_1.fetchProduct)({ provider, remote: 'stargate' });
|
|
24
|
+
}
|
|
25
|
+
exports.getRequestStargate = getRequestStargate;
|
|
26
|
+
exports.__requestAtlassianAsApp = getRequestStargate('app');
|
|
27
|
+
exports.__requestAtlassianAsUser = getRequestStargate('user');
|
package/out/webTrigger.js
CHANGED
|
@@ -6,7 +6,7 @@ const fetch_and_storage_1 = require("./runtime/fetch-and-storage");
|
|
|
6
6
|
const proxyGetWebTriggerURL = (0, runtime_1.wrapInMetrics)('api.getWebTriggerUrl', async (webTriggerModuleKey, forceCreate) => {
|
|
7
7
|
var _a, _b;
|
|
8
8
|
const runtime = (0, runtime_1.__getRuntime)();
|
|
9
|
-
const response = await (0, fetch_and_storage_1.
|
|
9
|
+
const response = await (0, fetch_and_storage_1.__requestAtlassianAsApp)('/graphql', {
|
|
10
10
|
method: 'POST',
|
|
11
11
|
headers: { 'Content-Type': 'application/json' },
|
|
12
12
|
body: JSON.stringify({
|
|
@@ -40,7 +40,7 @@ const proxyGetWebTriggerURL = (0, runtime_1.wrapInMetrics)('api.getWebTriggerUrl
|
|
|
40
40
|
const proxyDeleteWebTriggerURL = (0, runtime_1.wrapInMetrics)('api.deleteWebTriggerUrl', async (webTriggerUrl) => {
|
|
41
41
|
const callDelete = async (webTriggerUrlId) => {
|
|
42
42
|
var _a, _b, _c, _d;
|
|
43
|
-
const response = await (0, fetch_and_storage_1.
|
|
43
|
+
const response = await (0, fetch_and_storage_1.__requestAtlassianAsApp)('/graphql', {
|
|
44
44
|
method: 'POST',
|
|
45
45
|
headers: { 'Content-Type': 'application/json' },
|
|
46
46
|
body: JSON.stringify({
|
|
@@ -74,7 +74,7 @@ const proxyDeleteWebTriggerURL = (0, runtime_1.wrapInMetrics)('api.deleteWebTrig
|
|
|
74
74
|
const proxyGetWebTriggerUrlIds = (0, runtime_1.wrapInMetrics)('api.getWebTriggerUrlIds', async (webTriggerUrl) => {
|
|
75
75
|
var _a;
|
|
76
76
|
const runtime = (0, runtime_1.__getRuntime)();
|
|
77
|
-
const response = await (0, fetch_and_storage_1.
|
|
77
|
+
const response = await (0, fetch_and_storage_1.__requestAtlassianAsApp)('/graphql', {
|
|
78
78
|
method: 'POST',
|
|
79
79
|
headers: { 'Content-Type': 'application/json' },
|
|
80
80
|
body: JSON.stringify({
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/api",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.7.0-next.0",
|
|
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.8.0
|
|
15
|
+
"@forge/runtime": "5.8.0",
|
|
16
16
|
"@types/node": "14.18.63",
|
|
17
17
|
"expect-type": "^0.17.3",
|
|
18
18
|
"jest-matcher-specific-error": "^1.0.0",
|