@forge/api 5.1.0-next.4 → 5.1.0-next.5-experimental-edac07a
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 +25 -0
- package/out/api/fetch.d.ts +2 -2
- package/out/api/fetch.d.ts.map +1 -1
- package/out/api/fetch.js +26 -77
- package/out/api/polyfill-response.js +2 -2
- package/out/api/remote.d.ts.map +1 -1
- package/out/api/remote.js +4 -15
- package/out/api/runtime.d.ts +12 -0
- package/out/api/runtime.d.ts.map +1 -1
- package/out/api/runtime.js +3 -4
- package/out/index.d.ts.map +1 -1
- package/out/runtime/fetch-and-storage.js +1 -1
- package/package.json +7 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,30 @@
|
|
|
1
1
|
# @forge/api
|
|
2
2
|
|
|
3
|
+
## 5.1.0-next.5-experimental-edac07a
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- fa82e2a: Add installation to AppContext
|
|
8
|
+
- a72008e: add graph value in fetch types
|
|
9
|
+
- 2086b3d: Remove node-fetch as a dependency
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 55d56f7: update typing to add support to kvs config
|
|
14
|
+
- Updated dependencies [c25288c]
|
|
15
|
+
- Updated dependencies [89c96bf]
|
|
16
|
+
- Updated dependencies [3302cc2]
|
|
17
|
+
- Updated dependencies [2086b3d]
|
|
18
|
+
- @forge/egress@1.4.0-next.1-experimental-edac07a
|
|
19
|
+
- @forge/util@1.4.8-next.0-experimental-edac07a
|
|
20
|
+
- @forge/storage@1.7.2-experimental-edac07a
|
|
21
|
+
|
|
22
|
+
## 5.1.0-next.5
|
|
23
|
+
|
|
24
|
+
### Minor Changes
|
|
25
|
+
|
|
26
|
+
- fa82e2a: Add installation to AppContext
|
|
27
|
+
|
|
3
28
|
## 5.1.0-next.4
|
|
4
29
|
|
|
5
30
|
### Patch Changes
|
package/out/api/fetch.d.ts
CHANGED
|
@@ -6,15 +6,15 @@ declare type ExternalAuthRemote = string;
|
|
|
6
6
|
declare type FetchArgs = {
|
|
7
7
|
provider: AuthProvider;
|
|
8
8
|
remote: RemoteAPI;
|
|
9
|
+
type: 'fpp' | 'sql' | 'os';
|
|
9
10
|
};
|
|
10
11
|
declare type ExternalAuthFetchArgs = {
|
|
11
12
|
provider: ExternalAuthProvider;
|
|
12
13
|
remote: ExternalAuthRemote;
|
|
13
14
|
account: string;
|
|
14
15
|
};
|
|
15
|
-
export declare function __fetchProduct(args: FetchArgs
|
|
16
|
+
export declare function __fetchProduct(args: FetchArgs): FetchMethod;
|
|
16
17
|
export declare function fetchRemote(args: ExternalAuthFetchArgs): FetchMethod;
|
|
17
|
-
export declare function createRemoteUrlWithPath(baseUrl: string, path: string): URL;
|
|
18
18
|
export declare const getForgeProxyError: (response: Response) => string | null;
|
|
19
19
|
export declare const handleProxyResponseErrors: (response: Response) => void;
|
|
20
20
|
export declare const addMagicAgent: (init?: RequestInit, agentOverride?: string) => RequestInit;
|
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":"
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/api/fetch.ts"],"names":[],"mappings":"AAQA,OAAO,EAIL,QAAQ,EACR,WAAW,EAEX,WAAW,EACX,QAAQ,EACT,MAAM,IAAI,CAAC;AAKZ,oBAAY,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AACnD,aAAK,SAAS,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,GAAG,KAAK,GAAG,IAAI,CAAC;AAEjF,aAAK,oBAAoB,GAAG,MAAM,CAAC;AACnC,aAAK,kBAAkB,GAAG,MAAM,CAAC;AAEjC,aAAK,SAAS,GAAG;IAAE,QAAQ,EAAE,YAAY,CAAC;IAAC,MAAM,EAAE,SAAS,CAAC;IAAC,IAAI,EAAE,KAAK,GAAG,KAAK,GAAG,IAAI,CAAA;CAAE,CAAC;AAC3F,aAAK,qBAAqB,GAAG;IAAE,QAAQ,EAAE,oBAAoB,CAAC;IAAC,MAAM,EAAE,kBAAkB,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC;AAuB7G,wBAAgB,cAAc,CAAC,IAAI,EAAE,SAAS,GAAG,WAAW,CAc3D;AAED,wBAAgB,WAAW,CAAC,IAAI,EAAE,qBAAqB,GAAG,WAAW,CAgBpE;AAyBD,eAAO,MAAM,kBAAkB,aAAc,QAAQ,kBAA8C,CAAC;AACpG,eAAO,MAAM,yBAAyB,aAAc,QAAQ,KAAG,IAa9D,CAAC;AAwDF,eAAO,MAAM,aAAa,EAAE,CAAC,IAAI,CAAC,EAAE,WAAW,EAAE,aAAa,CAAC,EAAE,MAAM,KAAK,WAG1E,CAAC;AAkDH,wBAAgB,iBAAiB,IAAI,QAAQ,CAiC5C;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,GAAG,GAAG,QAAQ,CAEvD"}
|
package/out/api/fetch.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getSandboxRuntimeAPI = exports.getNodeRuntimeAPI = exports.addMagicAgent = exports.handleProxyResponseErrors = exports.getForgeProxyError = exports.
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
3
|
+
exports.getSandboxRuntimeAPI = exports.getNodeRuntimeAPI = exports.addMagicAgent = exports.handleProxyResponseErrors = exports.getForgeProxyError = exports.fetchRemote = exports.__fetchProduct = void 0;
|
|
6
4
|
const _1 = require(".");
|
|
7
5
|
const runtime_1 = require("./runtime");
|
|
8
6
|
const polyfill_response_1 = require("./polyfill-response");
|
|
@@ -18,23 +16,13 @@ async function wrapInMetrics(options, cb) {
|
|
|
18
16
|
timer.stop();
|
|
19
17
|
}
|
|
20
18
|
}
|
|
21
|
-
function __fetchProduct(args
|
|
19
|
+
function __fetchProduct(args) {
|
|
22
20
|
return async (path, init) => {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
remote: args.remote
|
|
29
|
-
}, path, init);
|
|
30
|
-
}
|
|
31
|
-
else {
|
|
32
|
-
const url = productURL(args.remote, path);
|
|
33
|
-
init = (0, exports.addMagicAgent)(init);
|
|
34
|
-
const defaultHeaders = getDefaultHeaders(init.headers, args);
|
|
35
|
-
init.headers = { ...init.headers, ...defaultHeaders };
|
|
36
|
-
response = await (0, node_fetch_1.default)(url, init);
|
|
37
|
-
}
|
|
21
|
+
const response = await global.__forge_fetch__({
|
|
22
|
+
type: args.type,
|
|
23
|
+
provider: args.provider,
|
|
24
|
+
remote: args.remote
|
|
25
|
+
}, path, init);
|
|
38
26
|
(0, exports.handleProxyResponseErrors)(response);
|
|
39
27
|
return response;
|
|
40
28
|
};
|
|
@@ -42,39 +30,17 @@ function __fetchProduct(args, useUndici = false) {
|
|
|
42
30
|
exports.__fetchProduct = __fetchProduct;
|
|
43
31
|
function fetchRemote(args) {
|
|
44
32
|
return async (path, init) => {
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
accountId: args.account
|
|
52
|
-
}, path, init);
|
|
53
|
-
}
|
|
54
|
-
else {
|
|
55
|
-
const remoteUrl = createRemoteUrlWithPath(`https://${args.remote}`, path);
|
|
56
|
-
init = (0, exports.addMagicAgent)(init, 'EXTERNAL_AUTH_REQUEST');
|
|
57
|
-
init.headers = {
|
|
58
|
-
...init.headers,
|
|
59
|
-
authorization: `Forge user ${args.provider} ${args.account}`
|
|
60
|
-
};
|
|
61
|
-
response = await (0, node_fetch_1.default)(remoteUrl, init);
|
|
62
|
-
}
|
|
33
|
+
const response = await global.__forge_fetch__({
|
|
34
|
+
type: 'tpp',
|
|
35
|
+
provider: args.provider,
|
|
36
|
+
remote: args.remote,
|
|
37
|
+
accountId: args.account
|
|
38
|
+
}, path, init);
|
|
63
39
|
(0, exports.handleProxyResponseErrors)(response);
|
|
64
40
|
return response;
|
|
65
41
|
};
|
|
66
42
|
}
|
|
67
43
|
exports.fetchRemote = fetchRemote;
|
|
68
|
-
function createRemoteUrlWithPath(baseUrl, path) {
|
|
69
|
-
const remoteUrl = new URL(baseUrl);
|
|
70
|
-
const url = new URL(path, remoteUrl);
|
|
71
|
-
if (url.hostname !== remoteUrl.hostname) {
|
|
72
|
-
throw new Error(`Invalid path provided ${path}`);
|
|
73
|
-
}
|
|
74
|
-
remoteUrl.searchParams.append('path', path);
|
|
75
|
-
return remoteUrl;
|
|
76
|
-
}
|
|
77
|
-
exports.createRemoteUrlWithPath = createRemoteUrlWithPath;
|
|
78
44
|
function getDefaultRemote(provider) {
|
|
79
45
|
const externalAuthProvider = findExternalAuthProviderConfigOrThrow(provider);
|
|
80
46
|
if (!externalAuthProvider.remotes.length) {
|
|
@@ -105,23 +71,6 @@ const handleProxyResponseErrors = (response) => {
|
|
|
105
71
|
}
|
|
106
72
|
};
|
|
107
73
|
exports.handleProxyResponseErrors = handleProxyResponseErrors;
|
|
108
|
-
const getDefaultHeaders = (headersInit, args) => {
|
|
109
|
-
let defaultHeaders = {};
|
|
110
|
-
const headers = new Headers(headersInit);
|
|
111
|
-
if (!headers.has('Content-Type')) {
|
|
112
|
-
defaultHeaders = { 'Content-Type': 'application/json' };
|
|
113
|
-
}
|
|
114
|
-
if (!headers.has('authorization')) {
|
|
115
|
-
defaultHeaders = { ...defaultHeaders, authorization: `Forge ${args.provider}` };
|
|
116
|
-
}
|
|
117
|
-
return defaultHeaders;
|
|
118
|
-
};
|
|
119
|
-
function productURL(remote, path) {
|
|
120
|
-
if (!path.startsWith('/')) {
|
|
121
|
-
path = '/' + path;
|
|
122
|
-
}
|
|
123
|
-
return `https://${remote}${path}`;
|
|
124
|
-
}
|
|
125
74
|
function lazyThrowNeedsAuthenticationError(serviceKey) {
|
|
126
75
|
return async (scopes) => wrapInMetrics({ name: 'api.asUser.withProvider.requestCredentials', tags: { passingScopes: String(!!scopes) } }, async () => {
|
|
127
76
|
throw new errors_1.NeedsAuthenticationError('Authentication Required', serviceKey, { scopes, isExpectedError: true });
|
|
@@ -195,23 +144,23 @@ function getNodeRuntimeAPI() {
|
|
|
195
144
|
}
|
|
196
145
|
return {
|
|
197
146
|
fetch: (0, _1.wrapWithRouteUnwrapper)(fetch),
|
|
198
|
-
requestJira: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'none', remote: 'jira' }
|
|
199
|
-
requestConfluence: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'none', remote: 'confluence' }
|
|
200
|
-
requestBitbucket: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'none', remote: 'bitbucket' }
|
|
147
|
+
requestJira: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'none', remote: 'jira', type: 'fpp' })),
|
|
148
|
+
requestConfluence: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'none', remote: 'confluence', type: 'fpp' })),
|
|
149
|
+
requestBitbucket: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'none', remote: 'bitbucket', type: 'fpp' })),
|
|
201
150
|
asUser: () => ({
|
|
202
|
-
requestJira: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'user', remote: 'jira' }
|
|
203
|
-
requestConfluence: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'user', remote: 'confluence' }
|
|
204
|
-
requestBitbucket: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'user', remote: 'bitbucket' }
|
|
205
|
-
requestGraph: (0, _1.wrapRequestGraph)(__fetchProduct({ provider: 'user', remote: 'stargate' }
|
|
206
|
-
requestConnectedData: (0, _1.wrapRequestConnectedData)(__fetchProduct({ provider: 'user', remote: 'stargate' }
|
|
151
|
+
requestJira: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'user', remote: 'jira', type: 'fpp' })),
|
|
152
|
+
requestConfluence: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'user', remote: 'confluence', type: 'fpp' })),
|
|
153
|
+
requestBitbucket: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'user', remote: 'bitbucket', type: 'fpp' })),
|
|
154
|
+
requestGraph: (0, _1.wrapRequestGraph)(__fetchProduct({ provider: 'user', remote: 'stargate', type: 'fpp' })),
|
|
155
|
+
requestConnectedData: (0, _1.wrapRequestConnectedData)(__fetchProduct({ provider: 'user', remote: 'stargate', type: 'fpp' })),
|
|
207
156
|
withProvider
|
|
208
157
|
}),
|
|
209
158
|
asApp: () => ({
|
|
210
|
-
requestJira: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'app', remote: 'jira' }
|
|
211
|
-
requestConfluence: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'app', remote: 'confluence' }
|
|
212
|
-
requestBitbucket: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'app', remote: 'bitbucket' }
|
|
213
|
-
requestGraph: (0, _1.wrapRequestGraph)(__fetchProduct({ provider: 'app', remote: 'stargate' }
|
|
214
|
-
requestConnectedData: (0, _1.wrapRequestConnectedData)(__fetchProduct({ provider: 'app', remote: 'stargate' }
|
|
159
|
+
requestJira: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'app', remote: 'jira', type: 'fpp' })),
|
|
160
|
+
requestConfluence: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'app', remote: 'confluence', type: 'fpp' })),
|
|
161
|
+
requestBitbucket: (0, _1.wrapRequestProduct)(__fetchProduct({ provider: 'app', remote: 'bitbucket', type: 'fpp' })),
|
|
162
|
+
requestGraph: (0, _1.wrapRequestGraph)(__fetchProduct({ provider: 'app', remote: 'stargate', type: 'fpp' })),
|
|
163
|
+
requestConnectedData: (0, _1.wrapRequestConnectedData)(__fetchProduct({ provider: 'app', remote: 'stargate', type: 'fpp' }))
|
|
215
164
|
})
|
|
216
165
|
};
|
|
217
166
|
}
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.transformResponse = void 0;
|
|
4
|
-
const
|
|
4
|
+
const headers_utils_1 = require("headers-utils");
|
|
5
5
|
const transformResponse = (fetchApi) => async (url, init) => {
|
|
6
6
|
const response = await fetchApi(url, init);
|
|
7
7
|
return {
|
|
8
8
|
...response,
|
|
9
|
-
headers: new
|
|
9
|
+
headers: new headers_utils_1.Headers(response.headers)
|
|
10
10
|
};
|
|
11
11
|
};
|
|
12
12
|
exports.transformResponse = transformResponse;
|
package/out/api/remote.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/api/remote.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"remote.d.ts","sourceRoot":"","sources":["../../src/api/remote.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIpD,aAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,WAAW,GAAG,mBAAmB,GACzC,OAAO,CAAC,WAAW,CAAC,CAqBtB"}
|
package/out/api/remote.js
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.invokeRemote = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const node_fetch_1 = tslib_1.__importDefault(require("node-fetch"));
|
|
6
4
|
const errors_1 = require("./errors");
|
|
7
5
|
const fetch_1 = require("./fetch");
|
|
8
6
|
async function invokeRemote(remoteKey, options) {
|
|
@@ -13,19 +11,10 @@ async function invokeRemote(remoteKey, options) {
|
|
|
13
11
|
if (!path) {
|
|
14
12
|
throw new Error('Missing or empty path provided to invokeRemote');
|
|
15
13
|
}
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
remote: remoteKey
|
|
21
|
-
}, path, fetchOptions);
|
|
22
|
-
}
|
|
23
|
-
else {
|
|
24
|
-
const url = (0, fetch_1.createRemoteUrlWithPath)('https://atl-paas.net', path);
|
|
25
|
-
url.searchParams.set('remoteKey', remoteKey);
|
|
26
|
-
const init = (0, fetch_1.addMagicAgent)(fetchOptions, 'FORGE_REMOTE_COMPUTE_REQUEST');
|
|
27
|
-
response = await (0, node_fetch_1.default)(url, init);
|
|
28
|
-
}
|
|
14
|
+
const response = await global.__forge_fetch__({
|
|
15
|
+
type: 'frc',
|
|
16
|
+
remote: remoteKey
|
|
17
|
+
}, path, fetchOptions);
|
|
29
18
|
handleResponseErrors(response, remoteKey);
|
|
30
19
|
return response;
|
|
31
20
|
}
|
package/out/api/runtime.d.ts
CHANGED
|
@@ -33,6 +33,16 @@ export declare type License = {
|
|
|
33
33
|
trialEndDate?: string;
|
|
34
34
|
type?: string;
|
|
35
35
|
};
|
|
36
|
+
export interface ProductAri {
|
|
37
|
+
cloudId?: string;
|
|
38
|
+
workspaceId?: string;
|
|
39
|
+
product?: string;
|
|
40
|
+
toString: () => string;
|
|
41
|
+
}
|
|
42
|
+
export interface Installation {
|
|
43
|
+
ari: InstallationAri;
|
|
44
|
+
products: ProductAri[];
|
|
45
|
+
}
|
|
36
46
|
export declare type ForgeRuntime = {
|
|
37
47
|
proxy: ProxyInfo;
|
|
38
48
|
contextAri: string;
|
|
@@ -52,6 +62,7 @@ export declare type ForgeRuntime = {
|
|
|
52
62
|
moduleType: string;
|
|
53
63
|
moduleKey: string;
|
|
54
64
|
license?: License;
|
|
65
|
+
installation?: Installation;
|
|
55
66
|
};
|
|
56
67
|
aaid?: string;
|
|
57
68
|
allowedEgress: string[];
|
|
@@ -85,6 +96,7 @@ export declare type AppContext = {
|
|
|
85
96
|
installationAri: InstallationAri;
|
|
86
97
|
moduleKey: string;
|
|
87
98
|
license?: License;
|
|
99
|
+
installation?: Installation;
|
|
88
100
|
};
|
|
89
101
|
export declare function __getRuntime(): ForgeRuntime;
|
|
90
102
|
export declare function getAppContext(): AppContext;
|
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;
|
|
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;AAE5E,OAAO,EAAoD,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAQlH,oBAAY,SAAS,GAAG;IACtB,KAAK,EAAE,MAAM,CAAC;IACd,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;CACf,CAAC;AAEF,oBAAY,2BAA2B,GAAG;IACxC,EAAE,EAAE,MAAM,CAAC;IACX,iBAAiB,EAAE,MAAM,CAAC;IAC1B,WAAW,EAAE,MAAM,CAAC;IACpB,MAAM,EAAE,MAAM,EAAE,CAAC;IACjB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB,CAAC;AAEF,oBAAY,oBAAoB,GAAG;IACjC,OAAO,EAAE,MAAM,CAAC;IAChB,OAAO,EAAE;QACP,OAAO,EAAE,MAAM,CAAC;QAChB,GAAG,EAAE,MAAM,CAAC;KACb,EAAE,CAAC;IACJ,QAAQ,EAAE,2BAA2B,EAAE,CAAC;CACz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,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,CAqBjC;AAED,wBAAgB,qBAAqB,CAAC,IAAI,SAAS,CAAC,GAAG,IAAI,EAAE,KAAK,EAAE,KAAK,OAAO,EAAE,EAAE,EAAE,IAAI,GAAG,IAAI,CAShG"}
|
package/out/api/runtime.js
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.bindInvocationContext = exports.wrapInMetrics = exports.getAppContext = exports.__getRuntime = void 0;
|
|
4
4
|
const errors_1 = require("./errors");
|
|
5
|
-
const node_fetch_1 = require("node-fetch");
|
|
6
5
|
const ari_1 = require("./ari");
|
|
7
6
|
function __getRuntime() {
|
|
8
7
|
const runtime = global.__forge_runtime__;
|
|
@@ -14,7 +13,7 @@ function __getRuntime() {
|
|
|
14
13
|
exports.__getRuntime = __getRuntime;
|
|
15
14
|
function getAppContext() {
|
|
16
15
|
const runtime = __getRuntime();
|
|
17
|
-
const { appId, appVersion, environmentId, environmentType, invocationId, installationId, moduleKey, license } = runtime.appContext;
|
|
16
|
+
const { appId, appVersion, environmentId, environmentType, invocationId, installationId, moduleKey, license, installation } = runtime.appContext;
|
|
18
17
|
const invocationRemainingTimeInMillis = runtime.lambdaContext.getRemainingTimeInMillis ??
|
|
19
18
|
(() => {
|
|
20
19
|
throw new Error('Lambda remaining time is not available. If tunnelling, update Forge CLI to the latest version.');
|
|
@@ -28,7 +27,8 @@ function getAppContext() {
|
|
|
28
27
|
invocationId,
|
|
29
28
|
invocationRemainingTimeInMillis,
|
|
30
29
|
moduleKey,
|
|
31
|
-
license
|
|
30
|
+
license,
|
|
31
|
+
installation
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
34
|
exports.getAppContext = getAppContext;
|
|
@@ -44,7 +44,6 @@ function wrapInMetrics(name, fn, { tags } = {}) {
|
|
|
44
44
|
catch (e) {
|
|
45
45
|
const undiciError = global.__forge_undici_error__;
|
|
46
46
|
if (e instanceof errors_1.ProxyRequestError ||
|
|
47
|
-
e instanceof node_fetch_1.FetchError ||
|
|
48
47
|
(undiciError && typeof undiciError === 'function' && e instanceof undiciError)) {
|
|
49
48
|
success = false;
|
|
50
49
|
}
|
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,EAA8C,QAAQ,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAExG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtH,OAAO,EAEL,uBAAuB,EACvB,wBAAwB,EAEzB,MAAM,6BAA6B,CAAC;AACrC,OAAO,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AAC5C,OAAO,EAAE,cAAc,EAAE,MAAM,aAAa,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAA8C,QAAQ,EAAE,gBAAgB,EAAE,MAAM,gBAAgB,CAAC;AAExG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,cAAc,CAAC;AACtH,OAAO,EAEL,uBAAuB,EAC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ChB,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,qBAAqB,EAAE,MAAM,eAAe,CAAC;AAC7G,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"}
|
|
@@ -37,7 +37,7 @@ function getRequestStargate(provider) {
|
|
|
37
37
|
return sandboxApi.asUser().__requestAtlassian;
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
return (0, fetch_1.__fetchProduct)({ provider, remote: 'stargate' }
|
|
40
|
+
return (0, fetch_1.__fetchProduct)({ provider, remote: 'stargate', type: 'fpp' });
|
|
41
41
|
}
|
|
42
42
|
exports.getRequestStargate = getRequestStargate;
|
|
43
43
|
exports.__requestAtlassianAsApp = getRequestStargate('app');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/api",
|
|
3
|
-
"version": "5.1.0-next.
|
|
3
|
+
"version": "5.1.0-next.5-experimental-edac07a",
|
|
4
4
|
"description": "Forge API methods",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -13,8 +13,9 @@
|
|
|
13
13
|
"postbuild": "yarn bolt w forge-scripts preserve-deprecated-tags ../forge-api"
|
|
14
14
|
},
|
|
15
15
|
"devDependencies": {
|
|
16
|
-
"@forge/runtime": "5.10.6-next.0",
|
|
16
|
+
"@forge/runtime": "5.10.6-next.0-experimental-edac07a",
|
|
17
17
|
"@types/node": "14.18.63",
|
|
18
|
+
"@types/node-fetch": "^2.6.11",
|
|
18
19
|
"expect-type": "^0.17.3",
|
|
19
20
|
"express": "^4.18.3",
|
|
20
21
|
"jest-matcher-specific-error": "^1.0.0",
|
|
@@ -22,10 +23,9 @@
|
|
|
22
23
|
},
|
|
23
24
|
"dependencies": {
|
|
24
25
|
"@forge/auth": "0.0.6",
|
|
25
|
-
"@forge/egress": "1.4.0-next.1",
|
|
26
|
-
"@forge/storage": "1.7.2",
|
|
27
|
-
"@forge/util": "1.4.8-next.0",
|
|
28
|
-
"
|
|
29
|
-
"node-fetch": "2.7.0"
|
|
26
|
+
"@forge/egress": "1.4.0-next.1-experimental-edac07a",
|
|
27
|
+
"@forge/storage": "1.7.2-experimental-edac07a",
|
|
28
|
+
"@forge/util": "1.4.8-next.0-experimental-edac07a",
|
|
29
|
+
"headers-utils": "^3.0.2"
|
|
30
30
|
}
|
|
31
31
|
}
|