@forge/api 2.10.1-next.0 → 2.11.0-next.2
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 +14 -0
- package/out/api/errors.d.ts +39 -0
- package/out/api/errors.d.ts.map +1 -0
- package/out/api/errors.js +82 -0
- package/out/api/fetch.d.ts.map +1 -1
- package/out/api/fetch.js +11 -2
- package/out/index.d.ts +1 -0
- package/out/index.d.ts.map +1 -1
- package/out/index.js +14 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,19 @@
|
|
|
1
1
|
# @forge/api
|
|
2
2
|
|
|
3
|
+
## 2.11.0-next.2
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 3a1dd86: Move API errors to @forge/api package
|
|
8
|
+
- df3811d: Handle NeedsAuthError returned from the proxy for Runtime v2
|
|
9
|
+
|
|
10
|
+
## 2.10.1-next.1
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- Updated dependencies [aa193085]
|
|
15
|
+
- @forge/egress@1.1.2-next.0
|
|
16
|
+
|
|
3
17
|
## 2.10.1-next.0
|
|
4
18
|
|
|
5
19
|
### Patch Changes
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
export declare const FUNCTION_ERR = "FUNCTION_ERR";
|
|
2
|
+
export declare const REQUEST_EGRESS_ALLOWLIST_ERR = "REQUEST_EGRESS_ALLOWLIST_ERR";
|
|
3
|
+
export declare const FUNCTION_FETCH_ERR = "FUNCTION_FETCH_ERR";
|
|
4
|
+
export declare const NEEDS_AUTHENTICATION_ERR = "NEEDS_AUTHENTICATION_ERR";
|
|
5
|
+
export declare const PROXY_ERR = "PROXY_ERR";
|
|
6
|
+
export declare function isForgePlatformError(err: Error): boolean;
|
|
7
|
+
export declare function isHostedCodeError(err: Error): boolean;
|
|
8
|
+
export declare class HttpError extends Error {
|
|
9
|
+
status: number | undefined;
|
|
10
|
+
constructor(message: string);
|
|
11
|
+
}
|
|
12
|
+
export declare class FetchError extends Error {
|
|
13
|
+
constructor(cause: string);
|
|
14
|
+
}
|
|
15
|
+
export declare class NotAllowedError extends HttpError {
|
|
16
|
+
constructor(message: string);
|
|
17
|
+
}
|
|
18
|
+
export declare class ExternalEndpointNotAllowedError extends NotAllowedError {
|
|
19
|
+
constructor(failedURL: string);
|
|
20
|
+
}
|
|
21
|
+
export declare class ProductEndpointNotAllowedError extends NotAllowedError {
|
|
22
|
+
constructor(failedURL: string);
|
|
23
|
+
}
|
|
24
|
+
export declare class RequestProductNotAllowedError extends NotAllowedError {
|
|
25
|
+
constructor(requestedProduct: string, invocationProduct: string);
|
|
26
|
+
}
|
|
27
|
+
export declare class InvalidWorkspaceRequestedError extends NotAllowedError {
|
|
28
|
+
constructor(failedURL: string);
|
|
29
|
+
}
|
|
30
|
+
export declare class NeedsAuthenticationError extends HttpError {
|
|
31
|
+
serviceKey: string;
|
|
32
|
+
constructor(error: string, serviceKey: string);
|
|
33
|
+
}
|
|
34
|
+
export declare class ProxyRequestError extends HttpError {
|
|
35
|
+
status: number;
|
|
36
|
+
errorCode: string;
|
|
37
|
+
constructor(status: number, errorCode: string);
|
|
38
|
+
}
|
|
39
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/api/errors.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,YAAY,iBAAiB,CAAC;AAC3C,eAAO,MAAM,4BAA4B,iCAAiC,CAAC;AAC3E,eAAO,MAAM,kBAAkB,uBAAuB,CAAC;AACvD,eAAO,MAAM,wBAAwB,6BAA6B,CAAC;AACnE,eAAO,MAAM,SAAS,cAAc,CAAC;AAErC,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,KAAK,WAE9C;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,KAAK,WAE3C;AAED,qBAAa,SAAU,SAAQ,KAAK;IAClC,MAAM,EAAE,MAAM,GAAG,SAAS,CAAC;gBACf,OAAO,EAAE,MAAM;CAG5B;AAED,qBAAa,UAAW,SAAQ,KAAK;gBACvB,KAAK,EAAE,MAAM;CAK1B;AAED,qBAAa,eAAgB,SAAQ,SAAS;gBAChC,OAAO,EAAE,MAAM;CAM5B;AAED,qBAAa,+BAAgC,SAAQ,eAAe;gBACtD,SAAS,EAAE,MAAM;CAK9B;AAED,qBAAa,8BAA+B,SAAQ,eAAe;gBACrD,SAAS,EAAE,MAAM;CAG9B;AAED,qBAAa,6BAA8B,SAAQ,eAAe;gBACpD,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM;CAGhE;AAED,qBAAa,8BAA+B,SAAQ,eAAe;gBACrD,SAAS,EAAE,MAAM;CAG9B;AAED,qBAAa,wBAAyB,SAAQ,SAAS;IACnB,UAAU,EAAE,MAAM;gBAAxC,KAAK,EAAE,MAAM,EAAS,UAAU,EAAE,MAAM;CAMrD;AAED,qBAAa,iBAAkB,SAAQ,SAAS;IAC3B,MAAM,EAAE,MAAM;IAAS,SAAS,EAAE,MAAM;gBAAxC,MAAM,EAAE,MAAM,EAAS,SAAS,EAAE,MAAM;CAI5D"}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ProxyRequestError = exports.NeedsAuthenticationError = exports.InvalidWorkspaceRequestedError = exports.RequestProductNotAllowedError = exports.ProductEndpointNotAllowedError = exports.ExternalEndpointNotAllowedError = exports.NotAllowedError = exports.FetchError = exports.HttpError = exports.isHostedCodeError = exports.isForgePlatformError = exports.PROXY_ERR = exports.NEEDS_AUTHENTICATION_ERR = exports.FUNCTION_FETCH_ERR = exports.REQUEST_EGRESS_ALLOWLIST_ERR = exports.FUNCTION_ERR = void 0;
|
|
4
|
+
exports.FUNCTION_ERR = 'FUNCTION_ERR';
|
|
5
|
+
exports.REQUEST_EGRESS_ALLOWLIST_ERR = 'REQUEST_EGRESS_ALLOWLIST_ERR';
|
|
6
|
+
exports.FUNCTION_FETCH_ERR = 'FUNCTION_FETCH_ERR';
|
|
7
|
+
exports.NEEDS_AUTHENTICATION_ERR = 'NEEDS_AUTHENTICATION_ERR';
|
|
8
|
+
exports.PROXY_ERR = 'PROXY_ERR';
|
|
9
|
+
function isForgePlatformError(err) {
|
|
10
|
+
return [exports.REQUEST_EGRESS_ALLOWLIST_ERR, exports.FUNCTION_FETCH_ERR, exports.NEEDS_AUTHENTICATION_ERR, exports.PROXY_ERR].includes(err.name);
|
|
11
|
+
}
|
|
12
|
+
exports.isForgePlatformError = isForgePlatformError;
|
|
13
|
+
function isHostedCodeError(err) {
|
|
14
|
+
return [exports.FUNCTION_ERR, exports.REQUEST_EGRESS_ALLOWLIST_ERR, exports.FUNCTION_FETCH_ERR, exports.NEEDS_AUTHENTICATION_ERR].includes(err.name);
|
|
15
|
+
}
|
|
16
|
+
exports.isHostedCodeError = isHostedCodeError;
|
|
17
|
+
class HttpError extends Error {
|
|
18
|
+
constructor(message) {
|
|
19
|
+
super(message);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.HttpError = HttpError;
|
|
23
|
+
class FetchError extends Error {
|
|
24
|
+
constructor(cause) {
|
|
25
|
+
super(cause);
|
|
26
|
+
this.stack = undefined;
|
|
27
|
+
this.name = exports.FUNCTION_FETCH_ERR;
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
exports.FetchError = FetchError;
|
|
31
|
+
class NotAllowedError extends HttpError {
|
|
32
|
+
constructor(message) {
|
|
33
|
+
super(message);
|
|
34
|
+
this.stack = undefined;
|
|
35
|
+
this.name = exports.REQUEST_EGRESS_ALLOWLIST_ERR;
|
|
36
|
+
this.status = 403;
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
exports.NotAllowedError = NotAllowedError;
|
|
40
|
+
class ExternalEndpointNotAllowedError extends NotAllowedError {
|
|
41
|
+
constructor(failedURL) {
|
|
42
|
+
super(`URL not included in the external fetch backend permissions: ${failedURL}. Visit go.atlassian.com/forge-egress for more information.`);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
exports.ExternalEndpointNotAllowedError = ExternalEndpointNotAllowedError;
|
|
46
|
+
class ProductEndpointNotAllowedError extends NotAllowedError {
|
|
47
|
+
constructor(failedURL) {
|
|
48
|
+
super(`URL not allowed: ${failedURL}.`);
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
exports.ProductEndpointNotAllowedError = ProductEndpointNotAllowedError;
|
|
52
|
+
class RequestProductNotAllowedError extends NotAllowedError {
|
|
53
|
+
constructor(requestedProduct, invocationProduct) {
|
|
54
|
+
super(`Request ${requestedProduct} is not allowed from ${invocationProduct} context.`);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
exports.RequestProductNotAllowedError = RequestProductNotAllowedError;
|
|
58
|
+
class InvalidWorkspaceRequestedError extends NotAllowedError {
|
|
59
|
+
constructor(failedURL) {
|
|
60
|
+
super(`Invalid workspace requested in URL: ${failedURL}.`);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
exports.InvalidWorkspaceRequestedError = InvalidWorkspaceRequestedError;
|
|
64
|
+
class NeedsAuthenticationError extends HttpError {
|
|
65
|
+
constructor(error, serviceKey) {
|
|
66
|
+
super(error);
|
|
67
|
+
this.serviceKey = serviceKey;
|
|
68
|
+
this.stack = undefined;
|
|
69
|
+
this.name = exports.NEEDS_AUTHENTICATION_ERR;
|
|
70
|
+
this.status = 401;
|
|
71
|
+
}
|
|
72
|
+
}
|
|
73
|
+
exports.NeedsAuthenticationError = NeedsAuthenticationError;
|
|
74
|
+
class ProxyRequestError extends HttpError {
|
|
75
|
+
constructor(status, errorCode) {
|
|
76
|
+
super(`Forge platform failed to process runtime HTTP request - ${status} - ${errorCode}`);
|
|
77
|
+
this.status = status;
|
|
78
|
+
this.errorCode = errorCode;
|
|
79
|
+
this.name = exports.PROXY_ERR;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
exports.ProxyRequestError = ProxyRequestError;
|
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,EAAW,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAK9B,aAAK,aAAa,GAAG,CAAC,GAAG,EAAE,WAAW,GAAG,GAAG,EAAE,OAAO,EAAE,WAAW,GAAG,SAAS,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/api/fetch.ts"],"names":[],"mappings":";AAAA,OAAc,EAAE,WAAW,EAAE,WAAW,EAAE,QAAQ,EAAW,MAAM,YAAY,CAAC;AAChF,OAAO,EAAE,GAAG,EAAE,MAAM,KAAK,CAAC;AAE1B,OAAO,EAAE,QAAQ,EAAE,MAAM,IAAI,CAAC;AAK9B,aAAK,aAAa,GAAG,CAAC,GAAG,EAAE,WAAW,GAAG,GAAG,EAAE,OAAO,EAAE,WAAW,GAAG,SAAS,KAAK,OAAO,CAAC,QAAQ,CAAC,CAAC;AAIrG,eAAO,MAAM,gBAAgB,aACjB,KAAK,GAAG,MAAM,GAAG,SAAS,UAC5B,MAAM,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,KACvD,aAwBF,CAAC;AAuBF,wBAAgB,iBAAiB,IAAI,QAAQ,CAoB5C;AAED,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,GAAG,GAAG,QAAQ,CAEvD"}
|
package/out/api/fetch.js
CHANGED
|
@@ -7,14 +7,23 @@ const _1 = require(".");
|
|
|
7
7
|
const runtime_1 = require("./runtime");
|
|
8
8
|
const polyfill_response_1 = require("./polyfill-response");
|
|
9
9
|
const egress_1 = require("@forge/egress");
|
|
10
|
+
const errors_1 = require("./errors");
|
|
11
|
+
const ATLASSIAN_TOKEN_SERVICE_KEY = 'atlassian-token-service-key';
|
|
10
12
|
const createProxyFetch = (provider, remote) => {
|
|
11
|
-
return (url, options) => {
|
|
13
|
+
return async (url, options) => {
|
|
12
14
|
const { proxy } = (0, runtime_1.getRuntime)();
|
|
13
15
|
const request = new node_fetch_1.Request(url, options);
|
|
14
16
|
const proxyRequest = new node_fetch_1.Request(`${proxy.url}/fpp/provider/${provider}/remote/${remote}`, request);
|
|
15
17
|
proxyRequest.headers.set('Forge-Proxy-Target-Relative', request.url);
|
|
16
18
|
proxyRequest.headers.set('Forge-Proxy-Authorization', `Bearer ${proxy.token}`);
|
|
17
|
-
|
|
19
|
+
const response = await (0, node_fetch_1.default)(proxyRequest);
|
|
20
|
+
if (response.headers.has('forge-proxy-error')) {
|
|
21
|
+
if (response.headers.get('forge-proxy-error') === 'NEEDS_AUTHENTICATION_ERR') {
|
|
22
|
+
throw new errors_1.NeedsAuthenticationError('Authentication Required', ATLASSIAN_TOKEN_SERVICE_KEY);
|
|
23
|
+
}
|
|
24
|
+
throw new errors_1.ProxyRequestError(response.status, response.headers.get('forge-proxy-error'));
|
|
25
|
+
}
|
|
26
|
+
return response;
|
|
18
27
|
};
|
|
19
28
|
};
|
|
20
29
|
exports.createProxyFetch = createProxyFetch;
|
package/out/index.d.ts
CHANGED
|
@@ -85,4 +85,5 @@ export { QueryBuilder, QueryApi, Condition, ListResult, Predicate, Result, Value
|
|
|
85
85
|
export { startsWith } from '@forge/storage';
|
|
86
86
|
export { route, assumeTrustedRoute, routeFromAbsolute, Route } from './safeUrl';
|
|
87
87
|
export { ForgeRuntime, getRuntime } from './api/runtime';
|
|
88
|
+
export { NeedsAuthenticationError, ProxyRequestError, FetchError, ExternalEndpointNotAllowedError, ProductEndpointNotAllowedError, RequestProductNotAllowedError, NotAllowedError, InvalidWorkspaceRequestedError, HttpError, FUNCTION_ERR, isForgePlatformError, isHostedCodeError } from './api/errors';
|
|
88
89
|
//# sourceMappingURL=index.d.ts.map
|
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,MAAM,gBAAgB,CAAC;AAEtF,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,OAAO,EAAE,KAAK,EAAE,MAAM,WAAW,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAe,0BAA0B,EAAiB,MAAM,6BAA6B,CAAC;AAErG,oBAAY,WAAW,GAAG,IAAI,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,GAAG,aAAa,GAAG,IAAI,GAAG,QAAQ,GAAG,YAAY,GAAG,SAAS,CAAC,CAAC;AACvH,oBAAY,WAAW,GAAG,CAAC,GAAG,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;AACpF,oBAAY,wBAAwB,GAAG,CAAC,GAAG,EAAE,MAAM,GAAG,KAAK,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;AACzG,oBAAY,oBAAoB,GAAG,CAAC,GAAG,EAAE,KAAK,EAAE,IAAI,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,WAAW,CAAC,CAAC;AAC5F,oBAAY,YAAY,GAAG,WAAW,CAAC;AAEvC,MAAM,WAAW,qBAAqB;IACpC,WAAW,EAAE,oBAAoB,CAAC;IAClC,iBAAiB,EAAE,oBAAoB,CAAC;IACxC,gBAAg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,EACf,8BAA8B,EAC9B,SAAS,EACT,YAAY,EACZ,oBAAoB,EACpB,iBAAiB,EAClB,MAAM,cAAc,CAAC"}
|
package/out/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var _a;
|
|
3
3
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.getRuntime = exports.routeFromAbsolute = exports.assumeTrustedRoute = exports.route = 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;
|
|
4
|
+
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.routeFromAbsolute = exports.assumeTrustedRoute = exports.route = 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;
|
|
5
5
|
const storage_1 = require("@forge/storage");
|
|
6
6
|
const authorization_1 = require("./authorization");
|
|
7
7
|
Object.defineProperty(exports, "authorize", { enumerable: true, get: function () { return authorization_1.authorize; } });
|
|
@@ -58,3 +58,16 @@ Object.defineProperty(exports, "assumeTrustedRoute", { enumerable: true, get: fu
|
|
|
58
58
|
Object.defineProperty(exports, "routeFromAbsolute", { enumerable: true, get: function () { return safeUrl_1.routeFromAbsolute; } });
|
|
59
59
|
var runtime_1 = require("./api/runtime");
|
|
60
60
|
Object.defineProperty(exports, "getRuntime", { enumerable: true, get: function () { return runtime_1.getRuntime; } });
|
|
61
|
+
var errors_1 = require("./api/errors");
|
|
62
|
+
Object.defineProperty(exports, "NeedsAuthenticationError", { enumerable: true, get: function () { return errors_1.NeedsAuthenticationError; } });
|
|
63
|
+
Object.defineProperty(exports, "ProxyRequestError", { enumerable: true, get: function () { return errors_1.ProxyRequestError; } });
|
|
64
|
+
Object.defineProperty(exports, "FetchError", { enumerable: true, get: function () { return errors_1.FetchError; } });
|
|
65
|
+
Object.defineProperty(exports, "ExternalEndpointNotAllowedError", { enumerable: true, get: function () { return errors_1.ExternalEndpointNotAllowedError; } });
|
|
66
|
+
Object.defineProperty(exports, "ProductEndpointNotAllowedError", { enumerable: true, get: function () { return errors_1.ProductEndpointNotAllowedError; } });
|
|
67
|
+
Object.defineProperty(exports, "RequestProductNotAllowedError", { enumerable: true, get: function () { return errors_1.RequestProductNotAllowedError; } });
|
|
68
|
+
Object.defineProperty(exports, "NotAllowedError", { enumerable: true, get: function () { return errors_1.NotAllowedError; } });
|
|
69
|
+
Object.defineProperty(exports, "InvalidWorkspaceRequestedError", { enumerable: true, get: function () { return errors_1.InvalidWorkspaceRequestedError; } });
|
|
70
|
+
Object.defineProperty(exports, "HttpError", { enumerable: true, get: function () { return errors_1.HttpError; } });
|
|
71
|
+
Object.defineProperty(exports, "FUNCTION_ERR", { enumerable: true, get: function () { return errors_1.FUNCTION_ERR; } });
|
|
72
|
+
Object.defineProperty(exports, "isForgePlatformError", { enumerable: true, get: function () { return errors_1.isForgePlatformError; } });
|
|
73
|
+
Object.defineProperty(exports, "isHostedCodeError", { enumerable: true, get: function () { return errors_1.isHostedCodeError; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/api",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.11.0-next.2",
|
|
4
4
|
"description": "Forge API methods",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "UNLICENSED",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
},
|
|
17
17
|
"dependencies": {
|
|
18
18
|
"@forge/auth": "^0.0.1",
|
|
19
|
-
"@forge/egress": "^1.1.
|
|
19
|
+
"@forge/egress": "^1.1.2-next.0",
|
|
20
20
|
"@forge/storage": "^1.3.1",
|
|
21
21
|
"@types/node-fetch": "^2.5.7",
|
|
22
22
|
"node-fetch": "2.6.7"
|