@forge/api 6.0.3-next.0-experimental-8a53773 → 6.1.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 +8 -2
- package/out/api/errors.d.ts +5 -0
- package/out/api/errors.d.ts.map +1 -1
- package/out/api/errors.js +12 -1
- package/out/api/service.d.ts +7 -0
- package/out/api/service.d.ts.map +1 -0
- package/out/api/service.js +28 -0
- package/out/index.d.ts +3 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +5 -2
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,11 +1,17 @@
|
|
|
1
1
|
# @forge/api
|
|
2
2
|
|
|
3
|
-
## 6.0
|
|
3
|
+
## 6.1.0-next.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 518c490: Add invokeService to @forge/api
|
|
8
|
+
|
|
9
|
+
## 6.0.3
|
|
4
10
|
|
|
5
11
|
### Patch Changes
|
|
6
12
|
|
|
7
13
|
- Updated dependencies [10c0bc6]
|
|
8
|
-
- @forge/egress@2.0.2
|
|
14
|
+
- @forge/egress@2.0.2
|
|
9
15
|
|
|
10
16
|
## 6.0.3-next.0
|
|
11
17
|
|
package/out/api/errors.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare const REQUEST_EGRESS_ALLOWLIST_ERR = "REQUEST_EGRESS_ALLOWLIST_ER
|
|
|
3
3
|
export declare const FUNCTION_FETCH_ERR = "FUNCTION_FETCH_ERR";
|
|
4
4
|
export declare const NEEDS_AUTHENTICATION_ERR = "NEEDS_AUTHENTICATION_ERR";
|
|
5
5
|
export declare const INVALID_REMOTE_ERR = "INVALID_REMOTE_ERR";
|
|
6
|
+
export declare const INVALID_CONTAINER_SERVICE_ERR = "INVALID_CONTAINER_SERVICE_ERR";
|
|
6
7
|
export declare const PROXY_ERR = "PROXY_ERR";
|
|
7
8
|
export declare function isForgePlatformError(err: Error): boolean;
|
|
8
9
|
export declare function isHostedCodeError(err: Error | string): boolean;
|
|
@@ -42,6 +43,10 @@ export declare class InvalidRemoteError extends HttpError {
|
|
|
42
43
|
readonly remoteKey: string;
|
|
43
44
|
constructor(error: string, remoteKey: string);
|
|
44
45
|
}
|
|
46
|
+
export declare class InvalidContainerServiceError extends HttpError {
|
|
47
|
+
readonly serviceKey: string;
|
|
48
|
+
constructor(error: string, serviceKey: string);
|
|
49
|
+
}
|
|
45
50
|
export declare class ProxyRequestError extends HttpError {
|
|
46
51
|
status: number;
|
|
47
52
|
errorCode: string;
|
package/out/api/errors.d.ts.map
CHANGED
|
@@ -1 +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,kBAAkB,uBAAuB,CAAC;AACvD,eAAO,MAAM,SAAS,cAAc,CAAC;AAErC,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,KAAK,WAE9C;AAED,wBAAgB,iBAAiB,CAAC,GAAG,EAAE,KAAK,GAAG,MAAM,WAIpD;AAKD,wBAAgB,eAAe,CAAC,GAAG,EAAE,KAAK,GAAG,OAAO,CAEnD;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,SA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|
@@ -1,11 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ProxyRequestError = exports.InvalidRemoteError = exports.NeedsAuthenticationError = exports.InvalidWorkspaceRequestedError = exports.RequestProductNotAllowedError = exports.ProductEndpointNotAllowedError = exports.ExternalEndpointNotAllowedError = exports.NotAllowedError = exports.FetchError = exports.HttpError = exports.isExpectedError = exports.isHostedCodeError = exports.isForgePlatformError = exports.PROXY_ERR = exports.INVALID_REMOTE_ERR = exports.NEEDS_AUTHENTICATION_ERR = exports.FUNCTION_FETCH_ERR = exports.REQUEST_EGRESS_ALLOWLIST_ERR = exports.FUNCTION_ERR = void 0;
|
|
3
|
+
exports.ProxyRequestError = exports.InvalidContainerServiceError = exports.InvalidRemoteError = exports.NeedsAuthenticationError = exports.InvalidWorkspaceRequestedError = exports.RequestProductNotAllowedError = exports.ProductEndpointNotAllowedError = exports.ExternalEndpointNotAllowedError = exports.NotAllowedError = exports.FetchError = exports.HttpError = exports.isExpectedError = exports.isHostedCodeError = exports.isForgePlatformError = exports.PROXY_ERR = exports.INVALID_CONTAINER_SERVICE_ERR = exports.INVALID_REMOTE_ERR = exports.NEEDS_AUTHENTICATION_ERR = exports.FUNCTION_FETCH_ERR = exports.REQUEST_EGRESS_ALLOWLIST_ERR = exports.FUNCTION_ERR = void 0;
|
|
4
4
|
exports.FUNCTION_ERR = 'FUNCTION_ERR';
|
|
5
5
|
exports.REQUEST_EGRESS_ALLOWLIST_ERR = 'REQUEST_EGRESS_ALLOWLIST_ERR';
|
|
6
6
|
exports.FUNCTION_FETCH_ERR = 'FUNCTION_FETCH_ERR';
|
|
7
7
|
exports.NEEDS_AUTHENTICATION_ERR = 'NEEDS_AUTHENTICATION_ERR';
|
|
8
8
|
exports.INVALID_REMOTE_ERR = 'INVALID_REMOTE_ERR';
|
|
9
|
+
exports.INVALID_CONTAINER_SERVICE_ERR = 'INVALID_CONTAINER_SERVICE_ERR';
|
|
9
10
|
exports.PROXY_ERR = 'PROXY_ERR';
|
|
10
11
|
function isForgePlatformError(err) {
|
|
11
12
|
return [exports.REQUEST_EGRESS_ALLOWLIST_ERR, exports.FUNCTION_FETCH_ERR, exports.NEEDS_AUTHENTICATION_ERR, exports.PROXY_ERR].includes(err.name);
|
|
@@ -90,6 +91,16 @@ class InvalidRemoteError extends HttpError {
|
|
|
90
91
|
}
|
|
91
92
|
}
|
|
92
93
|
exports.InvalidRemoteError = InvalidRemoteError;
|
|
94
|
+
class InvalidContainerServiceError extends HttpError {
|
|
95
|
+
serviceKey;
|
|
96
|
+
constructor(error, serviceKey) {
|
|
97
|
+
super(error);
|
|
98
|
+
this.serviceKey = serviceKey;
|
|
99
|
+
this.name = exports.INVALID_CONTAINER_SERVICE_ERR;
|
|
100
|
+
this.status = 400;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
exports.InvalidContainerServiceError = InvalidContainerServiceError;
|
|
93
104
|
class ProxyRequestError extends HttpError {
|
|
94
105
|
status;
|
|
95
106
|
errorCode;
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { APIResponse, RequestInit } from '../index';
|
|
2
|
+
declare type InvokeServiceOptions = {
|
|
3
|
+
path: string;
|
|
4
|
+
};
|
|
5
|
+
export declare function invokeService(serviceKey: string, options: RequestInit & InvokeServiceOptions): Promise<APIResponse>;
|
|
6
|
+
export {};
|
|
7
|
+
//# sourceMappingURL=service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"service.d.ts","sourceRoot":"","sources":["../../src/api/service.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AAIpD,aAAK,oBAAoB,GAAG;IAC1B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAsB,aAAa,CACjC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,WAAW,GAAG,oBAAoB,GAC1C,OAAO,CAAC,WAAW,CAAC,CAqBtB"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.invokeService = void 0;
|
|
4
|
+
const errors_1 = require("./errors");
|
|
5
|
+
const fetch_1 = require("./fetch");
|
|
6
|
+
async function invokeService(serviceKey, options) {
|
|
7
|
+
const { path, ...fetchOptions } = options;
|
|
8
|
+
if (!serviceKey) {
|
|
9
|
+
throw new Error('Missing service key provided to invokeService');
|
|
10
|
+
}
|
|
11
|
+
if (!path) {
|
|
12
|
+
throw new Error('Missing or empty path provided to invokeService');
|
|
13
|
+
}
|
|
14
|
+
const response = await global.__forge_fetch__({
|
|
15
|
+
type: 'fcc',
|
|
16
|
+
service: serviceKey
|
|
17
|
+
}, path, fetchOptions);
|
|
18
|
+
handleResponseErrors(response, serviceKey);
|
|
19
|
+
return response;
|
|
20
|
+
}
|
|
21
|
+
exports.invokeService = invokeService;
|
|
22
|
+
function handleResponseErrors(response, serviceKey) {
|
|
23
|
+
const forgeProxyError = (0, fetch_1.getForgeProxyError)(response);
|
|
24
|
+
if (forgeProxyError === 'INVALID_SERVICE_KEY') {
|
|
25
|
+
throw new errors_1.InvalidContainerServiceError(`Invalid service key provided: "${serviceKey}"`, serviceKey);
|
|
26
|
+
}
|
|
27
|
+
(0, fetch_1.handleProxyResponseErrors)(response);
|
|
28
|
+
}
|
package/out/index.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ import { authorize } from './authorization';
|
|
|
3
3
|
import { Route } from './safeUrl';
|
|
4
4
|
import { webTrigger, WebTriggerResponse, WebTriggerRequest, WebTriggerMethod, WebTriggerContext } from './webTrigger';
|
|
5
5
|
import { invokeRemote } from './api/remote';
|
|
6
|
+
import { invokeService } from './api/service';
|
|
6
7
|
import { __fetchProduct, __requestAtlassianAsApp, __requestAtlassianAsUser } from './api/fetch';
|
|
7
8
|
export interface RequestInit {
|
|
8
9
|
body?: ArrayBuffer | string | URLSearchParams;
|
|
@@ -85,6 +86,7 @@ export interface FetchAPI extends RequestProductMethods {
|
|
|
85
86
|
}
|
|
86
87
|
export interface ForgeAPI extends FetchAPI {
|
|
87
88
|
invokeRemote: typeof invokeRemote;
|
|
89
|
+
invokeService: typeof invokeService;
|
|
88
90
|
}
|
|
89
91
|
declare const asUser: (userId?: string) => AsUserFetchMethods;
|
|
90
92
|
declare const asApp: () => AsAppFetchMethods;
|
|
@@ -98,7 +100,7 @@ export declare const privacy: {
|
|
|
98
100
|
reportPersonalData: (accounts: import("./privacy").Account[]) => Promise<import("./privacy").AccountUpdate[]>;
|
|
99
101
|
};
|
|
100
102
|
export default API;
|
|
101
|
-
export { asUser, asApp, authorize, fetch, requestJira, requestConfluence, requestBitbucket, invokeRemote, storage, webTrigger, WebTriggerRequest, WebTriggerResponse, WebTriggerMethod, WebTriggerContext, __requestAtlassianAsApp, __requestAtlassianAsUser, __fetchProduct };
|
|
103
|
+
export { asUser, asApp, authorize, fetch, requestJira, requestConfluence, requestBitbucket, invokeRemote, invokeService, storage, webTrigger, WebTriggerRequest, WebTriggerResponse, WebTriggerMethod, WebTriggerContext, __requestAtlassianAsApp, __requestAtlassianAsUser, __fetchProduct };
|
|
102
104
|
export declare const createRequestStargateAsApp: () => FetchMethod;
|
|
103
105
|
export { QueryBuilder, QueryApi, EntityStorageApi, Condition, ListResult, Predicate, Result, Value, WherePredicate, FilterPredicate, startsWith, WhereConditions, FilterConditions, SortOrder } from '@forge/storage';
|
|
104
106
|
export { route, assumeTrustedRoute, routeFromAbsolute, Route } from './safeUrl';
|
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,OA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AC7G,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;AAEtB,OAAO,EAAE,IAAI,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC"}
|
package/out/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.i18n = 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.bindInvocationContext = exports.__getRuntime = exports.getAppContext = exports.routeFromAbsolute = exports.assumeTrustedRoute = exports.route = exports.SortOrder = exports.FilterConditions = exports.WhereConditions = exports.startsWith = exports.createRequestStargateAsApp = exports.__fetchProduct = exports.__requestAtlassianAsUser = exports.__requestAtlassianAsApp = exports.webTrigger = exports.storage = exports.invokeRemote = exports.requestBitbucket = exports.requestConfluence = exports.requestJira = exports.fetch = exports.authorize = exports.asApp = exports.asUser = exports.privacy = void 0;
|
|
3
|
+
exports.i18n = 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.bindInvocationContext = exports.__getRuntime = exports.getAppContext = exports.routeFromAbsolute = exports.assumeTrustedRoute = exports.route = exports.SortOrder = exports.FilterConditions = exports.WhereConditions = exports.startsWith = exports.createRequestStargateAsApp = exports.__fetchProduct = exports.__requestAtlassianAsUser = exports.__requestAtlassianAsApp = exports.webTrigger = exports.storage = exports.invokeService = exports.invokeRemote = 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,6 +9,8 @@ const webTrigger_1 = require("./webTrigger");
|
|
|
9
9
|
Object.defineProperty(exports, "webTrigger", { enumerable: true, get: function () { return webTrigger_1.webTrigger; } });
|
|
10
10
|
const remote_1 = require("./api/remote");
|
|
11
11
|
Object.defineProperty(exports, "invokeRemote", { enumerable: true, get: function () { return remote_1.invokeRemote; } });
|
|
12
|
+
const service_1 = require("./api/service");
|
|
13
|
+
Object.defineProperty(exports, "invokeService", { enumerable: true, get: function () { return service_1.invokeService; } });
|
|
12
14
|
const fetch_1 = require("./api/fetch");
|
|
13
15
|
Object.defineProperty(exports, "__fetchProduct", { enumerable: true, get: function () { return fetch_1.__fetchProduct; } });
|
|
14
16
|
Object.defineProperty(exports, "__requestAtlassianAsApp", { enumerable: true, get: function () { return fetch_1.__requestAtlassianAsApp; } });
|
|
@@ -31,7 +33,8 @@ const storage = (0, storage_1.getStorageInstanceWithQuery)(new storage_1.GlobalS
|
|
|
31
33
|
exports.storage = storage;
|
|
32
34
|
const API = {
|
|
33
35
|
...fetchAPI,
|
|
34
|
-
invokeRemote: remote_1.invokeRemote
|
|
36
|
+
invokeRemote: remote_1.invokeRemote,
|
|
37
|
+
invokeService: service_1.invokeService
|
|
35
38
|
};
|
|
36
39
|
exports.privacy = {
|
|
37
40
|
reportPersonalData: (0, privacy_1.createReportPersonalData)(fetch_1.__requestAtlassianAsApp)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/api",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0-next.0",
|
|
4
4
|
"description": "Forge API methods",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"@atlassian/ari": "^2.199.0",
|
|
17
17
|
"@atlassian/in-memory-metrics": "0.1.0",
|
|
18
18
|
"@atlassian/metrics-interface": "4.0.0",
|
|
19
|
-
"@forge/runtime": "6.0.
|
|
19
|
+
"@forge/runtime": "6.0.3-next.0",
|
|
20
20
|
"@types/node": "20.19.1",
|
|
21
21
|
"@types/node-fetch": "^2.6.12",
|
|
22
22
|
"expect-type": "^0.17.3",
|
|
@@ -26,7 +26,7 @@
|
|
|
26
26
|
},
|
|
27
27
|
"dependencies": {
|
|
28
28
|
"@forge/auth": "0.0.8",
|
|
29
|
-
"@forge/egress": "2.0.2
|
|
29
|
+
"@forge/egress": "2.0.2",
|
|
30
30
|
"@forge/i18n": "0.0.7",
|
|
31
31
|
"@forge/storage": "2.0.2",
|
|
32
32
|
"headers-utils": "^3.0.2"
|