@forge/api 7.2.1 → 7.2.2-experimental-04cc2b9
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 +46 -0
- package/out/api/ari.d.ts +3 -3
- package/out/api/ari.d.ts.map +1 -1
- package/out/api/endpoint.d.ts +1 -1
- package/out/api/endpoint.d.ts.map +1 -1
- package/out/api/endpoint.js +2 -3
- package/out/api/errors.d.ts.map +1 -1
- package/out/api/errors.js +4 -4
- package/out/api/fetch.d.ts +6 -6
- package/out/api/fetch.d.ts.map +1 -1
- package/out/api/fetch.js +4 -4
- package/out/api/i18n.d.ts +1 -1
- package/out/api/i18n.d.ts.map +1 -1
- package/out/api/permissions.d.ts +5 -5
- package/out/api/permissions.d.ts.map +1 -1
- package/out/api/permissions.js +4 -4
- package/out/api/runtime.d.ts +9 -9
- package/out/api/runtime.d.ts.map +1 -1
- package/out/api/runtime.js +7 -7
- package/out/index.d.ts +8 -24
- package/out/index.d.ts.map +1 -1
- package/out/index.js +5 -14
- package/out/privacy/index.d.ts +2 -2
- package/out/privacy/index.d.ts.map +1 -1
- package/out/safeUrl.d.ts +1 -1
- package/out/safeUrl.d.ts.map +1 -1
- package/out/safeUrl.js +5 -6
- package/out/webTrigger.d.ts +2 -2
- package/out/webTrigger.d.ts.map +1 -1
- package/package.json +16 -8
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,51 @@
|
|
|
1
1
|
# @forge/api
|
|
2
2
|
|
|
3
|
+
## 7.2.2-experimental-04cc2b9
|
|
4
|
+
|
|
5
|
+
### Major Changes
|
|
6
|
+
|
|
7
|
+
- 561f8f4: Remove "storage" module from "@forge/api"
|
|
8
|
+
- d9ef926: Adds support for TypeScript 5
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- Updated dependencies [814b8fe]
|
|
13
|
+
- Updated dependencies [d9ef926]
|
|
14
|
+
- @forge/manifest@12.9.0-experimental-04cc2b9
|
|
15
|
+
- @forge/auth@0.0.9-experimental-04cc2b9
|
|
16
|
+
- @forge/egress@2.3.2-experimental-04cc2b9
|
|
17
|
+
- @forge/i18n@0.0.7-experimental-04cc2b9
|
|
18
|
+
|
|
19
|
+
## 7.2.2
|
|
20
|
+
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [ccdcfc3]
|
|
24
|
+
- Updated dependencies [8197e66]
|
|
25
|
+
- Updated dependencies [723fab8]
|
|
26
|
+
- Updated dependencies [4493006]
|
|
27
|
+
- Updated dependencies [5beb8ad]
|
|
28
|
+
- Updated dependencies [f1f11f0]
|
|
29
|
+
- Updated dependencies [b7b1f36]
|
|
30
|
+
- Updated dependencies [ee691bf]
|
|
31
|
+
- Updated dependencies [9f3add6]
|
|
32
|
+
- @forge/manifest@12.9.0
|
|
33
|
+
|
|
34
|
+
## 7.2.2-next.1
|
|
35
|
+
|
|
36
|
+
### Patch Changes
|
|
37
|
+
|
|
38
|
+
- Updated dependencies [723fab8]
|
|
39
|
+
- Updated dependencies [9f3add6]
|
|
40
|
+
- @forge/manifest@12.9.0-next.3
|
|
41
|
+
|
|
42
|
+
## 7.2.2-next.0
|
|
43
|
+
|
|
44
|
+
### Patch Changes
|
|
45
|
+
|
|
46
|
+
- Updated dependencies [ccdcfc3]
|
|
47
|
+
- @forge/manifest@12.8.1-next.0
|
|
48
|
+
|
|
3
49
|
## 7.2.1
|
|
4
50
|
|
|
5
51
|
### Patch Changes
|
package/out/api/ari.d.ts
CHANGED
|
@@ -2,15 +2,15 @@ interface Ari {
|
|
|
2
2
|
toString: () => string;
|
|
3
3
|
toJSON?: () => string;
|
|
4
4
|
}
|
|
5
|
-
export
|
|
5
|
+
export type AppAri = Ari & {
|
|
6
6
|
appId: string;
|
|
7
7
|
};
|
|
8
8
|
export declare const getAppAri: (appId: string) => AppAri;
|
|
9
|
-
export
|
|
9
|
+
export type EnvironmentAri = Ari & {
|
|
10
10
|
environmentId: string;
|
|
11
11
|
};
|
|
12
12
|
export declare const getEnvironmentAri: (appId: string, environmentId: string) => EnvironmentAri;
|
|
13
|
-
export
|
|
13
|
+
export type InstallationAri = Ari & {
|
|
14
14
|
installationId: string;
|
|
15
15
|
};
|
|
16
16
|
export declare const getInstallationAri: (installationId: string) => InstallationAri;
|
package/out/api/ari.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ari.d.ts","sourceRoot":"","sources":["../../src/api/ari.ts"],"names":[],"mappings":"AAAA,UAAU,GAAG;IACX,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;CACvB;AAED,
|
|
1
|
+
{"version":3,"file":"ari.d.ts","sourceRoot":"","sources":["../../src/api/ari.ts"],"names":[],"mappings":"AAAA,UAAU,GAAG;IACX,QAAQ,EAAE,MAAM,MAAM,CAAC;IACvB,MAAM,CAAC,EAAE,MAAM,MAAM,CAAC;CACvB;AAED,MAAM,MAAM,MAAM,GAAG,GAAG,GAAG;IAAE,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7C,eAAO,MAAM,SAAS,GAAI,OAAO,MAAM,KAAG,MAIxC,CAAC;AAEH,MAAM,MAAM,cAAc,GAAG,GAAG,GAAG;IAAE,aAAa,EAAE,MAAM,CAAA;CAAE,CAAC;AAC7D,eAAO,MAAM,iBAAiB,GAAI,OAAO,MAAM,EAAE,eAAe,MAAM,KAAG,cAIvE,CAAC;AAEH,MAAM,MAAM,eAAe,GAAG,GAAG,GAAG;IAAE,cAAc,EAAE,MAAM,CAAA;CAAE,CAAC;AAC/D,eAAO,MAAM,kBAAkB,GAAI,gBAAgB,MAAM,KAAG,eAI1D,CAAC"}
|
package/out/api/endpoint.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { APIResponse, RequestInit } from '../index';
|
|
2
|
-
|
|
2
|
+
type InvokeEndpointOptions = {
|
|
3
3
|
path: string;
|
|
4
4
|
};
|
|
5
5
|
export declare function invokeRemote(remoteKey: string, options: RequestInit & InvokeEndpointOptions): Promise<APIResponse>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../src/api/endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AASpD,
|
|
1
|
+
{"version":3,"file":"endpoint.d.ts","sourceRoot":"","sources":["../../src/api/endpoint.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,MAAM,UAAU,CAAC;AASpD,KAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,MAAM,CAAC;CACd,CAAC;AAEF,wBAAsB,YAAY,CAChC,SAAS,EAAE,MAAM,EACjB,OAAO,EAAE,WAAW,GAAG,qBAAqB,GAC3C,OAAO,CAAC,WAAW,CAAC,CAEtB;AAED,wBAAsB,aAAa,CACjC,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,WAAW,GAAG,qBAAqB,GAC3C,OAAO,CAAC,WAAW,CAAC,CAEtB"}
|
package/out/api/endpoint.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.invokeRemote = invokeRemote;
|
|
4
|
+
exports.invokeService = invokeService;
|
|
4
5
|
const errors_1 = require("./errors");
|
|
5
6
|
const fetch_1 = require("./fetch");
|
|
6
7
|
var InvokeType;
|
|
@@ -11,11 +12,9 @@ var InvokeType;
|
|
|
11
12
|
async function invokeRemote(remoteKey, options) {
|
|
12
13
|
return invokeEndpoint(remoteKey, options, InvokeType.REMOTE);
|
|
13
14
|
}
|
|
14
|
-
exports.invokeRemote = invokeRemote;
|
|
15
15
|
async function invokeService(serviceKey, options) {
|
|
16
16
|
return invokeEndpoint(serviceKey, options, InvokeType.CONTAINER);
|
|
17
17
|
}
|
|
18
|
-
exports.invokeService = invokeService;
|
|
19
18
|
async function invokeEndpoint(key, options, type) {
|
|
20
19
|
const { path, ...fetchOptions } = options;
|
|
21
20
|
if (!key) {
|
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,6BAA6B,kCAAkC,CAAC;AAC7E,eAAO,MAAM,SAAS,cAAc,CAAC;AACrC,eAAO,MAAM,iBAAiB,sBAAsB,CAAC;AAErD,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,KAAK,WAQ9C;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,SAAQ,eAAe;gBACrD,SAAS,EAAE,MAAM;CAG9B;AAED,qBAAa,6BAA8B,SAAQ,eAAe;gBACpD,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM;CAGhE;AAED,q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AAe;gBACpD,gBAAgB,EAAE,MAAM,EAAE,iBAAiB,EAAE,MAAM;CAGhE;AAED,qBAAa,8BAA+B,SAAQ,eAAe;gBACrD,SAAS,EAAE,MAAM;CAG9B;AAED,MAAM,WAAW,+BAA+B;IAI9C,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAKlB,eAAe,CAAC,EAAE,OAAO,CAAC;CAC3B;AAED,qBAAa,wBAAyB,SAAQ,SAAS;aAGnC,UAAU,EAAE,MAAM;aAClB,OAAO,CAAC,EAAE,+BAA+B;gBAFzD,KAAK,EAAE,MAAM,EACG,UAAU,EAAE,MAAM,EAClB,OAAO,CAAC,EAAE,+BAA+B,YAAA;CAO5D;AAED,qBAAa,kBAAmB,SAAQ,SAAS;aAG7B,SAAS,EAAE,MAAM;gBADjC,KAAK,EAAE,MAAM,EACG,SAAS,EAAE,MAAM;CAMpC;AAED,qBAAa,4BAA6B,SAAQ,SAAS;aAGvC,UAAU,EAAE,MAAM;gBADlC,KAAK,EAAE,MAAM,EACG,UAAU,EAAE,MAAM;CAMrC;AAED,qBAAa,iBAAkB,SAAQ,SAAS;IAErC,MAAM,EAAE,MAAM;IACd,SAAS,EAAE,MAAM;gBADjB,MAAM,EAAE,MAAM,EACd,SAAS,EAAE,MAAM;CAK3B;AAED,qBAAa,gBAAiB,SAAQ,KAAK;gBAC7B,OAAO,SAAsC;CAI1D"}
|
package/out/api/errors.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ApiNotReadyError = exports.ProxyRequestError = exports.InvalidContainerServiceError = exports.InvalidRemoteError = exports.NeedsAuthenticationError = exports.InvalidWorkspaceRequestedError = exports.RequestProductNotAllowedError = exports.ProductEndpointNotAllowedError = exports.ExternalEndpointNotAllowedError = exports.NotAllowedError = exports.FetchError = exports.HttpError = exports.
|
|
3
|
+
exports.ApiNotReadyError = exports.ProxyRequestError = exports.InvalidContainerServiceError = exports.InvalidRemoteError = exports.NeedsAuthenticationError = exports.InvalidWorkspaceRequestedError = exports.RequestProductNotAllowedError = exports.ProductEndpointNotAllowedError = exports.ExternalEndpointNotAllowedError = exports.NotAllowedError = exports.FetchError = exports.HttpError = exports.API_NOT_READY_ERR = 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
|
+
exports.isForgePlatformError = isForgePlatformError;
|
|
5
|
+
exports.isHostedCodeError = isHostedCodeError;
|
|
6
|
+
exports.isExpectedError = isExpectedError;
|
|
4
7
|
exports.FUNCTION_ERR = 'FUNCTION_ERR';
|
|
5
8
|
exports.REQUEST_EGRESS_ALLOWLIST_ERR = 'REQUEST_EGRESS_ALLOWLIST_ERR';
|
|
6
9
|
exports.FUNCTION_FETCH_ERR = 'FUNCTION_FETCH_ERR';
|
|
@@ -18,15 +21,12 @@ function isForgePlatformError(err) {
|
|
|
18
21
|
exports.API_NOT_READY_ERR
|
|
19
22
|
].includes(err.name);
|
|
20
23
|
}
|
|
21
|
-
exports.isForgePlatformError = isForgePlatformError;
|
|
22
24
|
function isHostedCodeError(err) {
|
|
23
25
|
return [exports.FUNCTION_ERR, exports.REQUEST_EGRESS_ALLOWLIST_ERR, exports.FUNCTION_FETCH_ERR, exports.NEEDS_AUTHENTICATION_ERR].includes(typeof err === 'string' ? err : err.name);
|
|
24
26
|
}
|
|
25
|
-
exports.isHostedCodeError = isHostedCodeError;
|
|
26
27
|
function isExpectedError(err) {
|
|
27
28
|
return err.name === exports.NEEDS_AUTHENTICATION_ERR && !!err.options?.isExpectedError;
|
|
28
29
|
}
|
|
29
|
-
exports.isExpectedError = isExpectedError;
|
|
30
30
|
class HttpError extends Error {
|
|
31
31
|
status;
|
|
32
32
|
constructor(message) {
|
package/out/api/fetch.d.ts
CHANGED
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
import { FetchAPI, FetchMethod, RequestProductMethod, Response } from '..';
|
|
2
|
-
export
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
2
|
+
export type AuthProvider = 'app' | 'user' | 'none';
|
|
3
|
+
type RemoteAPI = 'jira' | 'confluence' | 'stargate' | 'bitbucket' | 'sql' | 'os' | 'feature-flags';
|
|
4
|
+
type ExternalAuthProvider = string;
|
|
5
|
+
type ExternalAuthRemote = string;
|
|
6
|
+
type FetchArgs = {
|
|
7
7
|
provider: AuthProvider;
|
|
8
8
|
remote: RemoteAPI;
|
|
9
9
|
type: 'fpp' | 'sql' | 'os' | 'feature-flags';
|
|
10
10
|
accountId?: string;
|
|
11
11
|
};
|
|
12
|
-
|
|
12
|
+
type ExternalAuthFetchArgs = {
|
|
13
13
|
provider: ExternalAuthProvider;
|
|
14
14
|
remote: ExternalAuthRemote;
|
|
15
15
|
account: 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":"AAAA,OAAO,EAIL,QAAQ,EACR,WAAW,EAGX,oBAAoB,EACpB,QAAQ,EACT,MAAM,IAAI,CAAC;AAKZ,
|
|
1
|
+
{"version":3,"file":"fetch.d.ts","sourceRoot":"","sources":["../../src/api/fetch.ts"],"names":[],"mappings":"AAAA,OAAO,EAIL,QAAQ,EACR,WAAW,EAGX,oBAAoB,EACpB,QAAQ,EACT,MAAM,IAAI,CAAC;AAKZ,MAAM,MAAM,YAAY,GAAG,KAAK,GAAG,MAAM,GAAG,MAAM,CAAC;AACnD,KAAK,SAAS,GAAG,MAAM,GAAG,YAAY,GAAG,UAAU,GAAG,WAAW,GAAG,KAAK,GAAG,IAAI,GAAG,eAAe,CAAC;AAEnG,KAAK,oBAAoB,GAAG,MAAM,CAAC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.__requestAtlassianAsUser = exports.__requestAtlassianAsApp = exports.
|
|
3
|
+
exports.__requestAtlassianAsUser = exports.__requestAtlassianAsApp = exports.wrapRequestConnectedData = exports.wrapRequestTeamworkGraph = exports.wrapRequestGraph = exports.handleProxyResponseErrors = exports.getForgeProxyError = void 0;
|
|
4
|
+
exports.__fetchProduct = __fetchProduct;
|
|
5
|
+
exports.fetchRemote = fetchRemote;
|
|
6
|
+
exports.getFetchAPI = getFetchAPI;
|
|
4
7
|
const safeUrl_1 = require("../safeUrl");
|
|
5
8
|
const errors_1 = require("./errors");
|
|
6
9
|
const runtime_1 = require("./runtime");
|
|
@@ -27,7 +30,6 @@ function __fetchProduct(args) {
|
|
|
27
30
|
return response;
|
|
28
31
|
};
|
|
29
32
|
}
|
|
30
|
-
exports.__fetchProduct = __fetchProduct;
|
|
31
33
|
function fetchRemote(args) {
|
|
32
34
|
return async (path, init) => {
|
|
33
35
|
const response = await global.__forge_fetch__({
|
|
@@ -40,7 +42,6 @@ function fetchRemote(args) {
|
|
|
40
42
|
return response;
|
|
41
43
|
};
|
|
42
44
|
}
|
|
43
|
-
exports.fetchRemote = fetchRemote;
|
|
44
45
|
function getDefaultRemote(provider) {
|
|
45
46
|
const externalAuthProvider = findExternalAuthProviderConfigOrThrow(provider);
|
|
46
47
|
if (!externalAuthProvider.remotes.length) {
|
|
@@ -195,7 +196,6 @@ function getFetchAPI() {
|
|
|
195
196
|
})
|
|
196
197
|
};
|
|
197
198
|
}
|
|
198
|
-
exports.getFetchAPI = getFetchAPI;
|
|
199
199
|
function getRequestStargate(provider) {
|
|
200
200
|
if (provider !== 'app' && provider !== 'user') {
|
|
201
201
|
throw new Error(`Unsupported provider: ${provider}`);
|
package/out/api/i18n.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { type GetTranslationsOptions, type GetTranslationsResult } from '@forge/i18n';
|
|
2
2
|
export declare const resetTranslationsCache: () => void;
|
|
3
3
|
export declare const getTranslations: (rawLocale: string, options?: GetTranslationsOptions) => Promise<GetTranslationsResult>;
|
|
4
|
-
export
|
|
4
|
+
export type TranslationFunction = (i18nKey: string, defaultValue?: string) => string;
|
|
5
5
|
export declare const createTranslationFunction: (rawLocale: string) => Promise<TranslationFunction>;
|
|
6
6
|
export declare const i18n: {
|
|
7
7
|
createTranslationFunction: (rawLocale: string) => Promise<TranslationFunction>;
|
package/out/api/i18n.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/api/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAQ3B,MAAM,aAAa,CAAC;AAmDrB,eAAO,MAAM,sBAAsB,QAAO,IAGzC,CAAC;AAEF,eAAO,MAAM,eAAe,
|
|
1
|
+
{"version":3,"file":"i18n.d.ts","sourceRoot":"","sources":["../../src/api/i18n.ts"],"names":[],"mappings":"AAAA,OAAO,EAGL,KAAK,sBAAsB,EAC3B,KAAK,qBAAqB,EAQ3B,MAAM,aAAa,CAAC;AAmDrB,eAAO,MAAM,sBAAsB,QAAO,IAGzC,CAAC;AAEF,eAAO,MAAM,eAAe,GAC1B,WAAW,MAAM,EACjB,UAAS,sBAER,KACA,OAAO,CAAC,qBAAqB,CAG/B,CAAC;AAUF,MAAM,MAAM,mBAAmB,GAAG,CAAC,OAAO,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,MAAM,KAAK,MAAM,CAAC;AASrF,eAAO,MAAM,yBAAyB,GAAU,WAAW,MAAM,KAAG,OAAO,CAAC,mBAAmB,CAQ9F,CAAC;AAkBF,eAAO,MAAM,IAAI;2CA1B0C,MAAM,KAAG,OAAO,CAAC,mBAAmB,CAAC;iCA1BnF,MAAM,YACR,sBAAsB,KAG9B,OAAO,CAAC,qBAAqB,CAAC;CAmDhC,CAAC"}
|
package/out/api/permissions.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { PermissionRequirements, MissingPermissions } from './runtime';
|
|
2
2
|
import { External, Fetch } from '@forge/manifest';
|
|
3
3
|
declare const RESOURCE_TYPES: readonly ["fonts", "styles", "frames", "images", "media", "scripts"];
|
|
4
|
-
export
|
|
4
|
+
export type ResourceType = (typeof RESOURCE_TYPES)[number];
|
|
5
5
|
declare const FETCH_TYPES: readonly ["backend", "client"];
|
|
6
|
-
export
|
|
7
|
-
export
|
|
6
|
+
export type FetchType = (typeof FETCH_TYPES)[number];
|
|
7
|
+
export type ValidatedArrayField = string[] | External[ResourceType] | Fetch[FetchType];
|
|
8
8
|
export declare function extractUrlString(url: string | {
|
|
9
9
|
address: string;
|
|
10
10
|
} | {
|
|
@@ -19,11 +19,11 @@ export interface PermissionResult {
|
|
|
19
19
|
export declare const hasPermission: (requirements: Partial<PermissionRequirements>) => PermissionResult;
|
|
20
20
|
export declare const hasScope: (scope: string) => boolean;
|
|
21
21
|
export declare const canFetchFrom: (type: FetchType, url: string) => boolean;
|
|
22
|
-
export declare const canLoadResource: (type: Exclude<keyof External,
|
|
22
|
+
export declare const canLoadResource: (type: Exclude<keyof External, "fetch">, url: string) => boolean;
|
|
23
23
|
export declare const permissions: {
|
|
24
24
|
hasPermission: (requirements: Partial<PermissionRequirements>) => PermissionResult;
|
|
25
25
|
hasScope: (scope: string) => boolean;
|
|
26
26
|
canFetchFrom: (type: FetchType, url: string) => boolean;
|
|
27
|
-
canLoadResource: (type: Exclude<keyof External,
|
|
27
|
+
canLoadResource: (type: Exclude<keyof External, "fetch">, url: string) => boolean;
|
|
28
28
|
};
|
|
29
29
|
//# sourceMappingURL=permissions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"permissions.d.ts","sourceRoot":"","sources":["../../src/api/permissions.ts"],"names":[],"mappings":"AAAA,OAAO,EAAiB,sBAAsB,EAAE,kBAAkB,EAAgB,MAAM,WAAW,CAAC;AAEpG,OAAO,EAAU,QAAQ,EAAE,KAAK,EAAE,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,OAAO,CAAC,MAAM,QAAQ,EAAE,OAAO,CAAC,EAAE,KAAK,MAAM,KAAG,OAKrF,CAAC;AAKF,eAAO,MAAM,WAAW;kCAzIoB,OAAO,CAAC,sBAAsB,CAAC,KAAG,gBAAgB;sBAmE9D,MAAM,KAAG,OAAO;yBA8Bb,SAAS,OAAO,MAAM,KAAG,OAAO;4BA8B7B,OAAO,CAAC,MAAM,QAAQ,EAAE,OAAO,CAAC,OAAO,MAAM,KAAG,OAAO;CAe5F,CAAC"}
|
package/out/api/permissions.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.permissions = exports.canLoadResource = exports.canFetchFrom = exports.hasScope = exports.hasPermission =
|
|
3
|
+
exports.permissions = exports.canLoadResource = exports.canFetchFrom = exports.hasScope = exports.hasPermission = void 0;
|
|
4
|
+
exports.extractUrlString = extractUrlString;
|
|
4
5
|
const runtime_1 = require("./runtime");
|
|
5
6
|
const errors_1 = require("./errors");
|
|
6
7
|
const egress_1 = require("@forge/egress");
|
|
@@ -15,7 +16,6 @@ function extractUrlString(url) {
|
|
|
15
16
|
}
|
|
16
17
|
return url.remote;
|
|
17
18
|
}
|
|
18
|
-
exports.extractUrlString = extractUrlString;
|
|
19
19
|
function wrapInSyncMetrics(options, cb) {
|
|
20
20
|
const metrics = (0, runtime_1.__getRuntime)().metrics;
|
|
21
21
|
metrics.counter(options.name, options.tags).incr();
|
|
@@ -87,14 +87,14 @@ const validatePermissionRequirements = (requirements) => {
|
|
|
87
87
|
validateKeys(requirements.external, VALID_EXTERNAL_TYPES);
|
|
88
88
|
for (const type of VALID_EXTERNAL_TYPES) {
|
|
89
89
|
if (type !== 'fetch' && type !== 'configurable') {
|
|
90
|
-
validateArrayField(requirements.external[type], `external.${type}`);
|
|
90
|
+
validateArrayField(requirements.external[type], `external.${String(type)}`);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
93
93
|
if (requirements.external.fetch !== undefined) {
|
|
94
94
|
validateObjectField(requirements.external.fetch, 'external.fetch');
|
|
95
95
|
validateKeys(requirements.external.fetch, VALID_FETCH_TYPES);
|
|
96
96
|
for (const type of VALID_FETCH_TYPES) {
|
|
97
|
-
validateArrayField(requirements.external.fetch[type], `external.fetch.${type}`);
|
|
97
|
+
validateArrayField(requirements.external.fetch[type], `external.fetch.${String(type)}`);
|
|
98
98
|
}
|
|
99
99
|
}
|
|
100
100
|
}
|
package/out/api/runtime.d.ts
CHANGED
|
@@ -18,21 +18,21 @@ interface Gauge {
|
|
|
18
18
|
export interface Metrics {
|
|
19
19
|
timing(name: string, tags?: Record<string, string>): Timing;
|
|
20
20
|
counter(name: string, tags?: Record<string, string>): Counter;
|
|
21
|
-
gauge(name: string): Gauge;
|
|
21
|
+
gauge(name: string, tags?: Record<string, string>): Gauge;
|
|
22
22
|
}
|
|
23
|
-
export
|
|
23
|
+
export type ProxyInfo = {
|
|
24
24
|
token: string;
|
|
25
25
|
url: string;
|
|
26
26
|
host?: string;
|
|
27
27
|
};
|
|
28
|
-
export
|
|
28
|
+
export type ExternalAuthMetaDataAccount = {
|
|
29
29
|
id: string;
|
|
30
30
|
externalAccountId: string;
|
|
31
31
|
displayName: string;
|
|
32
32
|
scopes: string[];
|
|
33
33
|
avatarUrl?: string;
|
|
34
34
|
};
|
|
35
|
-
export
|
|
35
|
+
export type ExternalAuthMetaData = {
|
|
36
36
|
service: string;
|
|
37
37
|
remotes: {
|
|
38
38
|
baseUrl: string;
|
|
@@ -40,8 +40,8 @@ export declare type ExternalAuthMetaData = {
|
|
|
40
40
|
}[];
|
|
41
41
|
accounts: ExternalAuthMetaDataAccount[];
|
|
42
42
|
};
|
|
43
|
-
export
|
|
44
|
-
export
|
|
43
|
+
export type CapabilitySet = 'capabilityStandard' | 'capabilityAdvanced';
|
|
44
|
+
export type License = {
|
|
45
45
|
active?: boolean;
|
|
46
46
|
isActive?: boolean;
|
|
47
47
|
billingPeriod?: string;
|
|
@@ -66,7 +66,7 @@ export interface Installation {
|
|
|
66
66
|
export interface Realtime {
|
|
67
67
|
contextToken?: string;
|
|
68
68
|
}
|
|
69
|
-
export
|
|
69
|
+
export type External = ManifestExternal;
|
|
70
70
|
export declare abstract class Permissions implements ManifestPermissions {
|
|
71
71
|
abstract scopes?: ManifestScopes;
|
|
72
72
|
abstract external?: ManifestExternal;
|
|
@@ -87,7 +87,7 @@ export declare class MissingPermissions extends Permissions {
|
|
|
87
87
|
external?: ManifestExternal | undefined;
|
|
88
88
|
constructor(scopes?: ManifestScopes | undefined, external?: ManifestExternal | undefined);
|
|
89
89
|
}
|
|
90
|
-
export
|
|
90
|
+
export type ForgeRuntime = {
|
|
91
91
|
proxy: ProxyInfo;
|
|
92
92
|
contextAri: string;
|
|
93
93
|
container: {
|
|
@@ -132,7 +132,7 @@ export declare type ForgeRuntime = {
|
|
|
132
132
|
externalAuth?: ExternalAuthMetaData[];
|
|
133
133
|
featureFlags: (flag: string) => boolean;
|
|
134
134
|
};
|
|
135
|
-
export
|
|
135
|
+
export type AppContext = {
|
|
136
136
|
appAri: AppAri;
|
|
137
137
|
appVersion: string;
|
|
138
138
|
environmentAri: EnvironmentAri;
|
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":"AACA,OAAO,EAAoD,MAAM,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,OAAO,CAAC;AAClH,OAAO,EACL,WAAW,IAAI,mBAAmB,EAClC,QAAQ,IAAI,gBAAgB,EAC5B,MAAM,IAAI,cAAc,EAEzB,MAAM,iBAAiB,CAAC;AAIzB,UAAU,KAAK;IACb,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAAC;CAC3C;AAED,UAAU,OAAO;IACf,IAAI,IAAI,IAAI,CAAC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oBAAoB,EAAE,CAAC;IACtC,YAAY,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC;CACzC,CAAC;AAKF,MAAM,MAAM,UAAU,GAAG;IACvB,MAAM,EAAE,MAAM,CAAC;IACf,UAAU,EAAE,MAAM,CAAC;IACnB,cAAc,EAAE,cAAc,CAAC;IAC/B,eAAe,EAAE,MAAM,CAAC;IACxB,YAAY,EAAE,MAAM,CAAC;IACrB,+BAA+B,IAAI,MAAM,CAAC;IAC1C,eAAe,EAAE,eAAe,CAAC;IACjC,SAAS,EAAE,MAAM,CAAC;IAClB,OAAO,CAAC,EAAE,OAAO,CAAC;IAClB,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B,WAAW,CAAC,EAAE,WAAW,CAAC;CAC3B,CAAC;AAEF,wBAAgB,YAAY,IAAI,YAAY,CAO3C;AAED,wBAAgB,aAAa,IAAI,UAAU,CAkC1C;AAED,wBAAgB,aAAa,CAAC,IAAI,SAAS,OAAO,EAAE,EAAE,GAAG,EACvD,IAAI,EAAE,MAAM,EACZ,EAAE,EAAE,CAAC,GAAG,IAAI,EAAE,IAAI,KAAK,OAAO,CAAC,GAAG,CAAC,GAClC,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
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.MissingPermissions = exports.PermissionRequirements = exports.RuntimePermissions = exports.Permissions = void 0;
|
|
4
|
+
exports.__getRuntime = __getRuntime;
|
|
5
|
+
exports.getAppContext = getAppContext;
|
|
6
|
+
exports.wrapInMetrics = wrapInMetrics;
|
|
7
|
+
exports.bindInvocationContext = bindInvocationContext;
|
|
4
8
|
const errors_1 = require("./errors");
|
|
5
9
|
const ari_1 = require("./ari");
|
|
6
10
|
const extractUrlString = (item) => {
|
|
@@ -33,7 +37,7 @@ const formatExternalSection = (external) => {
|
|
|
33
37
|
else {
|
|
34
38
|
const externalUrls = external[type];
|
|
35
39
|
if (externalUrls && Array.isArray(externalUrls) && externalUrls.length > 0) {
|
|
36
|
-
const capitalizedType = type.charAt(0).toUpperCase() + type.slice(1);
|
|
40
|
+
const capitalizedType = String(type).charAt(0).toUpperCase() + String(type).slice(1);
|
|
37
41
|
const urlList = externalUrls.map(extractUrlString).join(', ');
|
|
38
42
|
externalParts.push(`${capitalizedType}: ${urlList}`);
|
|
39
43
|
}
|
|
@@ -50,7 +54,7 @@ const getFetchPermissions = (fetch) => {
|
|
|
50
54
|
const urls = fetch[fetchType];
|
|
51
55
|
if (urls && urls.length > 0) {
|
|
52
56
|
const urlList = urls.map(extractUrlString).join(', ');
|
|
53
|
-
const capitalizedType = fetchType.charAt(0).toUpperCase() + fetchType.slice(1);
|
|
57
|
+
const capitalizedType = String(fetchType).charAt(0).toUpperCase() + String(fetchType).slice(1);
|
|
54
58
|
fetchParts.push(`Fetch ${capitalizedType}: ${urlList}`);
|
|
55
59
|
}
|
|
56
60
|
});
|
|
@@ -108,7 +112,6 @@ function __getRuntime() {
|
|
|
108
112
|
}
|
|
109
113
|
return runtime;
|
|
110
114
|
}
|
|
111
|
-
exports.__getRuntime = __getRuntime;
|
|
112
115
|
function getAppContext() {
|
|
113
116
|
const runtime = __getRuntime();
|
|
114
117
|
const { appId, appVersion, environmentId, environmentType, invocationId, installationId, moduleKey, license, installation, permissions } = runtime.appContext;
|
|
@@ -130,7 +133,6 @@ function getAppContext() {
|
|
|
130
133
|
permissions: new RuntimePermissions(permissions?.scopes || [], permissions?.external || {})
|
|
131
134
|
};
|
|
132
135
|
}
|
|
133
|
-
exports.getAppContext = getAppContext;
|
|
134
136
|
function wrapInMetrics(name, fn) {
|
|
135
137
|
return async (...args) => {
|
|
136
138
|
const { metrics } = __getRuntime();
|
|
@@ -153,9 +155,7 @@ function wrapInMetrics(name, fn) {
|
|
|
153
155
|
}
|
|
154
156
|
};
|
|
155
157
|
}
|
|
156
|
-
exports.wrapInMetrics = wrapInMetrics;
|
|
157
158
|
function bindInvocationContext(fn) {
|
|
158
159
|
const AsyncLocalStorage = require('async_hooks').AsyncLocalStorage;
|
|
159
160
|
return AsyncLocalStorage.bind(fn);
|
|
160
161
|
}
|
|
161
|
-
exports.bindInvocationContext = bindInvocationContext;
|
package/out/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { EntityStorageApi, QueryApi } from '@forge/storage';
|
|
2
1
|
import { invokeRemote, invokeService } from './api/endpoint';
|
|
3
2
|
import { __fetchProduct, __requestAtlassianAsApp, __requestAtlassianAsUser } from './api/fetch';
|
|
4
3
|
import { authorize } from './authorization';
|
|
@@ -28,11 +27,11 @@ export interface Response {
|
|
|
28
27
|
statusText: string;
|
|
29
28
|
headers: Headers;
|
|
30
29
|
}
|
|
31
|
-
export
|
|
32
|
-
export
|
|
33
|
-
export
|
|
34
|
-
export
|
|
35
|
-
export
|
|
30
|
+
export type APIResponse = Response;
|
|
31
|
+
export type FetchMethod = (url: string, init?: RequestInit) => Promise<APIResponse>;
|
|
32
|
+
export type FetchMethodAllowingRoute = (url: string | Route, init?: RequestInit) => Promise<APIResponse>;
|
|
33
|
+
export type RequestProductMethod = (url: Route, init?: RequestInit) => Promise<APIResponse>;
|
|
34
|
+
export type FetchOptions = RequestInit;
|
|
36
35
|
export interface RequestProductMethods {
|
|
37
36
|
requestJira: RequestProductMethod;
|
|
38
37
|
requestConfluence: RequestProductMethod;
|
|
@@ -70,20 +69,8 @@ export interface ExternalAuthFetchMethods extends ExternalAuthAccountMethods {
|
|
|
70
69
|
export interface ExternalAuthFetchMethodsProvider {
|
|
71
70
|
withProvider: (provider: string, remoteName?: string, tokenId?: string) => ExternalAuthFetchMethods;
|
|
72
71
|
}
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
set: (key: string, value: string | number | boolean | Record<string, any> | any[]) => Promise<void>;
|
|
76
|
-
delete: (key: string) => Promise<void>;
|
|
77
|
-
}
|
|
78
|
-
export interface StorageAPI extends StorageMethods, QueryApi, EntityStorageApi {
|
|
79
|
-
}
|
|
80
|
-
export interface ForgeStorageAPI extends StorageAPI {
|
|
81
|
-
getSecret: (key: string) => Promise<any>;
|
|
82
|
-
setSecret: (key: string, value: any) => Promise<void>;
|
|
83
|
-
deleteSecret: (key: string) => Promise<void>;
|
|
84
|
-
}
|
|
85
|
-
declare type AsUserFetchMethods = RequestProductMethods & GraphQLFetchMethods & ConnectedDataFetchMethods & ExternalAuthFetchMethodsProvider & RequestAtlassianMethods & TeamworkGraphFetchMethods;
|
|
86
|
-
declare type AsAppFetchMethods = RequestProductMethods & GraphQLFetchMethods & ConnectedDataFetchMethods & RequestAtlassianMethods;
|
|
72
|
+
type AsUserFetchMethods = RequestProductMethods & GraphQLFetchMethods & ConnectedDataFetchMethods & ExternalAuthFetchMethodsProvider & RequestAtlassianMethods & TeamworkGraphFetchMethods;
|
|
73
|
+
type AsAppFetchMethods = RequestProductMethods & GraphQLFetchMethods & ConnectedDataFetchMethods & RequestAtlassianMethods;
|
|
87
74
|
export interface FetchAPI extends RequestProductMethods {
|
|
88
75
|
asUser(userId?: string): AsUserFetchMethods;
|
|
89
76
|
asApp(): AsAppFetchMethods;
|
|
@@ -99,17 +86,14 @@ declare const fetch: FetchMethodAllowingRoute;
|
|
|
99
86
|
declare const requestJira: RequestProductMethod;
|
|
100
87
|
declare const requestConfluence: RequestProductMethod;
|
|
101
88
|
declare const requestBitbucket: RequestProductMethod;
|
|
102
|
-
/** @deprecated Use "@forge/kvs" package instead. */
|
|
103
|
-
declare const storage: ForgeStorageAPI;
|
|
104
89
|
declare const API: ForgeAPI;
|
|
105
90
|
export declare const privacy: {
|
|
106
91
|
reportPersonalData: (accounts: import("./privacy").Account[]) => Promise<import("./privacy").AccountUpdate[]>;
|
|
107
92
|
};
|
|
108
93
|
export default API;
|
|
109
|
-
export { __fetchProduct, __requestAtlassianAsApp, __requestAtlassianAsUser, asApp, asUser, authorize, fetch, invokeRemote, invokeService, requestBitbucket, requestConfluence, requestJira,
|
|
94
|
+
export { __fetchProduct, __requestAtlassianAsApp, __requestAtlassianAsUser, asApp, asUser, authorize, fetch, invokeRemote, invokeService, requestBitbucket, requestConfluence, requestJira, webTrigger, WebTriggerContext, WebTriggerMethod, WebTriggerRequest, WebTriggerResponse };
|
|
110
95
|
/** @deprecated Use __requestAtlassianAsApp directly */
|
|
111
96
|
export declare const createRequestStargateAsApp: () => FetchMethod;
|
|
112
|
-
export { Condition, EntityStorageApi, FilterConditions, FilterPredicate, ListResult, Predicate, QueryApi, QueryBuilder, Result, SortOrder, startsWith, Value, WhereConditions, WherePredicate } from '@forge/storage';
|
|
113
97
|
export { ExternalEndpointNotAllowedError, FetchError, FUNCTION_ERR, HttpError, InvalidWorkspaceRequestedError, isExpectedError, isForgePlatformError, isHostedCodeError, NeedsAuthenticationError, NeedsAuthenticationErrorOptions, NotAllowedError, ProductEndpointNotAllowedError, ProxyRequestError, RequestProductNotAllowedError } from './api/errors';
|
|
114
98
|
export { __getRuntime, AppContext, bindInvocationContext, ForgeRuntime, getAppContext } from './api/runtime';
|
|
115
99
|
export { assumeTrustedRoute, route, Route, routeFromAbsolute } 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,EAAE,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC7D,OAAO,EAAE,cAAc,EAAE,uBAAuB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AK,EAAE,iBAAiB,EAAE,MAAM,WAAW,CAAC;AAEhF,OAAO,EAAE,IAAI,EAAE,KAAK,mBAAmB,EAAE,MAAM,YAAY,CAAC;AAE5D,OAAO,EAAE,WAAW,EAAE,MAAM,mBAAmB,CAAC"}
|
package/out/index.js
CHANGED
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.permissions = exports.i18n = exports.routeFromAbsolute = exports.route = exports.assumeTrustedRoute = exports.getAppContext = exports.bindInvocationContext = exports.__getRuntime = exports.RequestProductNotAllowedError = exports.ProxyRequestError = exports.ProductEndpointNotAllowedError = exports.NotAllowedError = exports.NeedsAuthenticationError = exports.isHostedCodeError = exports.isForgePlatformError = exports.isExpectedError = exports.InvalidWorkspaceRequestedError = exports.HttpError = exports.FUNCTION_ERR = exports.FetchError = exports.ExternalEndpointNotAllowedError = exports.
|
|
4
|
-
const storage_1 = require("@forge/storage");
|
|
3
|
+
exports.permissions = exports.i18n = exports.routeFromAbsolute = exports.route = exports.assumeTrustedRoute = exports.getAppContext = exports.bindInvocationContext = exports.__getRuntime = exports.RequestProductNotAllowedError = exports.ProxyRequestError = exports.ProductEndpointNotAllowedError = exports.NotAllowedError = exports.NeedsAuthenticationError = exports.isHostedCodeError = exports.isForgePlatformError = exports.isExpectedError = exports.InvalidWorkspaceRequestedError = exports.HttpError = exports.FUNCTION_ERR = exports.FetchError = exports.ExternalEndpointNotAllowedError = exports.createRequestStargateAsApp = exports.webTrigger = exports.requestJira = exports.requestConfluence = exports.requestBitbucket = exports.invokeService = exports.invokeRemote = exports.fetch = exports.authorize = exports.asUser = exports.asApp = exports.__requestAtlassianAsUser = exports.__requestAtlassianAsApp = exports.__fetchProduct = exports.privacy = void 0;
|
|
5
4
|
const endpoint_1 = require("./api/endpoint");
|
|
6
5
|
Object.defineProperty(exports, "invokeRemote", { enumerable: true, get: function () { return endpoint_1.invokeRemote; } });
|
|
7
6
|
Object.defineProperty(exports, "invokeService", { enumerable: true, get: function () { return endpoint_1.invokeService; } });
|
|
@@ -9,7 +8,6 @@ const fetch_1 = require("./api/fetch");
|
|
|
9
8
|
Object.defineProperty(exports, "__fetchProduct", { enumerable: true, get: function () { return fetch_1.__fetchProduct; } });
|
|
10
9
|
Object.defineProperty(exports, "__requestAtlassianAsApp", { enumerable: true, get: function () { return fetch_1.__requestAtlassianAsApp; } });
|
|
11
10
|
Object.defineProperty(exports, "__requestAtlassianAsUser", { enumerable: true, get: function () { return fetch_1.__requestAtlassianAsUser; } });
|
|
12
|
-
const runtime_1 = require("./api/runtime");
|
|
13
11
|
const authorization_1 = require("./authorization");
|
|
14
12
|
Object.defineProperty(exports, "authorize", { enumerable: true, get: function () { return authorization_1.authorize; } });
|
|
15
13
|
const privacy_1 = require("./privacy");
|
|
@@ -28,8 +26,6 @@ const requestConfluence = fetchAPI.requestConfluence;
|
|
|
28
26
|
exports.requestConfluence = requestConfluence;
|
|
29
27
|
const requestBitbucket = fetchAPI.requestBitbucket;
|
|
30
28
|
exports.requestBitbucket = requestBitbucket;
|
|
31
|
-
const storage = (0, storage_1.getStorageInstanceWithQuery)(new storage_1.GlobalStorage(fetch_1.__requestAtlassianAsApp, () => (0, runtime_1.__getRuntime)().metrics));
|
|
32
|
-
exports.storage = storage;
|
|
33
29
|
const API = {
|
|
34
30
|
...fetchAPI,
|
|
35
31
|
invokeRemote: endpoint_1.invokeRemote,
|
|
@@ -41,11 +37,6 @@ exports.privacy = {
|
|
|
41
37
|
exports.default = API;
|
|
42
38
|
const createRequestStargateAsApp = () => fetch_1.__requestAtlassianAsApp;
|
|
43
39
|
exports.createRequestStargateAsApp = createRequestStargateAsApp;
|
|
44
|
-
var storage_2 = require("@forge/storage");
|
|
45
|
-
Object.defineProperty(exports, "FilterConditions", { enumerable: true, get: function () { return storage_2.FilterConditions; } });
|
|
46
|
-
Object.defineProperty(exports, "SortOrder", { enumerable: true, get: function () { return storage_2.SortOrder; } });
|
|
47
|
-
Object.defineProperty(exports, "startsWith", { enumerable: true, get: function () { return storage_2.startsWith; } });
|
|
48
|
-
Object.defineProperty(exports, "WhereConditions", { enumerable: true, get: function () { return storage_2.WhereConditions; } });
|
|
49
40
|
var errors_1 = require("./api/errors");
|
|
50
41
|
Object.defineProperty(exports, "ExternalEndpointNotAllowedError", { enumerable: true, get: function () { return errors_1.ExternalEndpointNotAllowedError; } });
|
|
51
42
|
Object.defineProperty(exports, "FetchError", { enumerable: true, get: function () { return errors_1.FetchError; } });
|
|
@@ -60,10 +51,10 @@ Object.defineProperty(exports, "NotAllowedError", { enumerable: true, get: funct
|
|
|
60
51
|
Object.defineProperty(exports, "ProductEndpointNotAllowedError", { enumerable: true, get: function () { return errors_1.ProductEndpointNotAllowedError; } });
|
|
61
52
|
Object.defineProperty(exports, "ProxyRequestError", { enumerable: true, get: function () { return errors_1.ProxyRequestError; } });
|
|
62
53
|
Object.defineProperty(exports, "RequestProductNotAllowedError", { enumerable: true, get: function () { return errors_1.RequestProductNotAllowedError; } });
|
|
63
|
-
var
|
|
64
|
-
Object.defineProperty(exports, "__getRuntime", { enumerable: true, get: function () { return
|
|
65
|
-
Object.defineProperty(exports, "bindInvocationContext", { enumerable: true, get: function () { return
|
|
66
|
-
Object.defineProperty(exports, "getAppContext", { enumerable: true, get: function () { return
|
|
54
|
+
var runtime_1 = require("./api/runtime");
|
|
55
|
+
Object.defineProperty(exports, "__getRuntime", { enumerable: true, get: function () { return runtime_1.__getRuntime; } });
|
|
56
|
+
Object.defineProperty(exports, "bindInvocationContext", { enumerable: true, get: function () { return runtime_1.bindInvocationContext; } });
|
|
57
|
+
Object.defineProperty(exports, "getAppContext", { enumerable: true, get: function () { return runtime_1.getAppContext; } });
|
|
67
58
|
var safeUrl_1 = require("./safeUrl");
|
|
68
59
|
Object.defineProperty(exports, "assumeTrustedRoute", { enumerable: true, get: function () { return safeUrl_1.assumeTrustedRoute; } });
|
|
69
60
|
Object.defineProperty(exports, "route", { enumerable: true, get: function () { return safeUrl_1.route; } });
|
package/out/privacy/index.d.ts
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { FetchMethod } from '../';
|
|
2
2
|
export declare const URL = "/app/report-accounts";
|
|
3
3
|
export declare const LIMIT = 90;
|
|
4
|
-
export
|
|
4
|
+
export type Account = {
|
|
5
5
|
accountId: string;
|
|
6
6
|
updatedAt: string;
|
|
7
7
|
};
|
|
8
|
-
export
|
|
8
|
+
export type AccountUpdate = {
|
|
9
9
|
accountId: string;
|
|
10
10
|
status: 'updated' | 'closed';
|
|
11
11
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/privacy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAElC,eAAO,MAAM,GAAG,yBAAyB,CAAC;AAC1C,eAAO,MAAM,KAAK,KAAK,CAAC;AAExB,
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/privacy/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,KAAK,CAAC;AAElC,eAAO,MAAM,GAAG,yBAAyB,CAAC;AAC1C,eAAO,MAAM,KAAK,KAAK,CAAC;AAExB,MAAM,MAAM,OAAO,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAA;CAAE,CAAC;AAC/D,MAAM,MAAM,aAAa,GAAG;IAAE,SAAS,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,SAAS,GAAG,QAAQ,CAAA;CAAE,CAAC;AAEhF,eAAO,MAAM,wBAAwB,GAAI,kBAAkB,WAAW,MACvC,UAAU,OAAO,EAAE,KAAG,OAAO,CAAC,aAAa,EAAE,CAqB3E,CAAC"}
|
package/out/safeUrl.d.ts
CHANGED
package/out/safeUrl.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"safeUrl.d.ts","sourceRoot":"","sources":["../src/safeUrl.ts"],"names":[],"mappings":"AAAA,
|
|
1
|
+
{"version":3,"file":"safeUrl.d.ts","sourceRoot":"","sources":["../src/safeUrl.ts"],"names":[],"mappings":"AAAA,MAAM,MAAM,KAAK,GAAG;IAClB,QAAQ,CAAC,KAAK,EAAE,MAAM,CAAC;CACxB,CAAC;AAcF,wBAAgB,OAAO,CAAC,CAAC,EAAE,OAAO,GAAG,CAAC,IAAI,KAAK,CAE9C;AAED,wBAAgB,iBAAiB,CAAC,YAAY,EAAE,MAAM,GAAG,KAAK,CAG7D;AA6DD,wBAAgB,KAAK,CACnB,QAAQ,EAAE,oBAAoB,EAC9B,GAAG,UAAU,EAAE,CAAC,MAAM,GAAG,MAAM,GAAG,eAAe,GAAG,KAAK,CAAC,EAAE,GAC3D,KAAK,CAoBP;AAED,wBAAgB,cAAc,CAAC,GAAG,EAAE,OAAO,GAAG,KAAK,CASlD;AAED,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,MAAM,GAAG,KAAK,CAEvD"}
|
package/out/safeUrl.js
CHANGED
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isRoute = isRoute;
|
|
4
|
+
exports.routeFromAbsolute = routeFromAbsolute;
|
|
5
|
+
exports.route = route;
|
|
6
|
+
exports.requireSafeUrl = requireSafeUrl;
|
|
7
|
+
exports.assumeTrustedRoute = assumeTrustedRoute;
|
|
4
8
|
class ReadonlyRoute {
|
|
5
9
|
value_;
|
|
6
10
|
constructor(value_) {
|
|
@@ -16,12 +20,10 @@ class ReadonlyRoute {
|
|
|
16
20
|
function isRoute(x) {
|
|
17
21
|
return x instanceof ReadonlyRoute;
|
|
18
22
|
}
|
|
19
|
-
exports.isRoute = isRoute;
|
|
20
23
|
function routeFromAbsolute(absolutePath) {
|
|
21
24
|
const absoluteURL = new URL(absolutePath);
|
|
22
25
|
return assumeTrustedRoute(`${absoluteURL.pathname}${absoluteURL.search}`);
|
|
23
26
|
}
|
|
24
|
-
exports.routeFromAbsolute = routeFromAbsolute;
|
|
25
27
|
const DOUBLE_DOT = ['..', '.%2e', '%2e.', '%2e%2e', '.%2E', '%2E.', '%2E%2e'];
|
|
26
28
|
const DIRECTORY_PATH = ['/', '\\'];
|
|
27
29
|
const ENDS_PATH = ['?', '#'];
|
|
@@ -69,7 +71,6 @@ function route(template, ...parameters) {
|
|
|
69
71
|
}
|
|
70
72
|
return new ReadonlyRoute(result);
|
|
71
73
|
}
|
|
72
|
-
exports.route = route;
|
|
73
74
|
function requireSafeUrl(url) {
|
|
74
75
|
if (url instanceof ReadonlyRoute) {
|
|
75
76
|
return url;
|
|
@@ -77,8 +78,6 @@ function requireSafeUrl(url) {
|
|
|
77
78
|
throw new Error(`You must create your route using the 'route' export from '@forge/api'.
|
|
78
79
|
See https://go.atlassian.com/forge-fetch-route for more information.`);
|
|
79
80
|
}
|
|
80
|
-
exports.requireSafeUrl = requireSafeUrl;
|
|
81
81
|
function assumeTrustedRoute(route) {
|
|
82
82
|
return new ReadonlyRoute(route);
|
|
83
83
|
}
|
|
84
|
-
exports.assumeTrustedRoute = assumeTrustedRoute;
|
package/out/webTrigger.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ interface WebTriggerAPI {
|
|
|
3
3
|
deleteUrl: (webTriggerUrl: string) => Promise<void>;
|
|
4
4
|
queryUrls: (moduleKey?: string) => Promise<WebTriggerQueryResult[]>;
|
|
5
5
|
}
|
|
6
|
-
export
|
|
6
|
+
export type WebTriggerQueryResult = {
|
|
7
7
|
moduleKey: string;
|
|
8
8
|
url: string;
|
|
9
9
|
};
|
|
@@ -22,7 +22,7 @@ export interface WebTriggerContext {
|
|
|
22
22
|
installContext: `ari:${string}`;
|
|
23
23
|
}
|
|
24
24
|
/** @experimental */
|
|
25
|
-
export
|
|
25
|
+
export type WebTriggerMethod = 'GET' | 'POST' | 'PUT' | 'DELETE' | 'PATCH';
|
|
26
26
|
/** @experimental */
|
|
27
27
|
export interface WebTriggerRequest {
|
|
28
28
|
method: WebTriggerMethod;
|
package/out/webTrigger.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"webTrigger.d.ts","sourceRoot":"","sources":["../src/webTrigger.ts"],"names":[],"mappings":"AAGA,UAAU,aAAa;IACrB,MAAM,EAAE,CAAC,mBAAmB,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAChF,SAAS,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC;CACrE;AAED,
|
|
1
|
+
{"version":3,"file":"webTrigger.d.ts","sourceRoot":"","sources":["../src/webTrigger.ts"],"names":[],"mappings":"AAGA,UAAU,aAAa;IACrB,MAAM,EAAE,CAAC,mBAAmB,EAAE,MAAM,EAAE,WAAW,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,MAAM,CAAC,CAAC;IAChF,SAAS,EAAE,CAAC,aAAa,EAAE,MAAM,KAAK,OAAO,CAAC,IAAI,CAAC,CAAC;IACpD,SAAS,EAAE,CAAC,SAAS,CAAC,EAAE,MAAM,KAAK,OAAO,CAAC,qBAAqB,EAAE,CAAC,CAAC;CACrE;AAED,MAAM,MAAM,qBAAqB,GAAG;IAClC,SAAS,EAAE,MAAM,CAAC;IAClB,GAAG,EAAE,MAAM,CAAC;CACb,CAAC;AA4IF,eAAO,MAAM,UAAU,EAAE,aAKxB,CAAC;AAMF,MAAM,WAAW,kBAAkB;IACjC,UAAU,EAAE,MAAM,CAAC;IACnB,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,OAAO,CAAC,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,EAAE,CAAA;KAAE,CAAC;CACvC;AAMD,MAAM,WAAW,iBAAiB;IAChC,cAAc,EAAE,OAAO,MAAM,EAAE,CAAC;CACjC;AAKD,MAAM,MAAM,gBAAgB,GAAG,KAAK,GAAG,MAAM,GAAG,KAAK,GAAG,QAAQ,GAAG,OAAO,CAAC;AAM3E,MAAM,WAAW,iBAAiB;IAChC,MAAM,EAAE,gBAAgB,CAAC;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;IAClC,eAAe,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,EAAE,CAAC,CAAC;CAC3C"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/api",
|
|
3
|
-
"version": "7.2.
|
|
3
|
+
"version": "7.2.2-experimental-04cc2b9",
|
|
4
4
|
"description": "Forge API methods",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -16,23 +16,31 @@
|
|
|
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.1.3",
|
|
19
|
+
"@forge/runtime": "6.1.3-experimental-04cc2b9",
|
|
20
20
|
"@types/node": "20.19.1",
|
|
21
21
|
"@types/node-fetch": "^2.6.12",
|
|
22
22
|
"expect-type": "^0.17.3",
|
|
23
23
|
"express": "^4.18.3",
|
|
24
24
|
"jest-matcher-specific-error": "^1.0.0",
|
|
25
|
-
"nock": "13.5.6"
|
|
25
|
+
"nock": "13.5.6",
|
|
26
|
+
"typescript": "5.9.2"
|
|
26
27
|
},
|
|
27
28
|
"dependencies": {
|
|
28
|
-
"@forge/auth": "0.0.9",
|
|
29
|
-
"@forge/egress": "2.3.2",
|
|
30
|
-
"@forge/i18n": "0.0.7",
|
|
31
|
-
"@forge/manifest": "^12.
|
|
32
|
-
"@forge/storage": "2.0.3",
|
|
29
|
+
"@forge/auth": "0.0.9-experimental-04cc2b9",
|
|
30
|
+
"@forge/egress": "2.3.2-experimental-04cc2b9",
|
|
31
|
+
"@forge/i18n": "0.0.7-experimental-04cc2b9",
|
|
32
|
+
"@forge/manifest": "^12.9.0-experimental-04cc2b9",
|
|
33
33
|
"headers-utils": "^3.0.2"
|
|
34
34
|
},
|
|
35
35
|
"publishConfig": {
|
|
36
36
|
"registry": "https://packages.atlassian.com/api/npm/npm-public/"
|
|
37
|
+
},
|
|
38
|
+
"peerDependencies": {
|
|
39
|
+
"typescript": ">=5.0.0"
|
|
40
|
+
},
|
|
41
|
+
"peerDependenciesMeta": {
|
|
42
|
+
"typescript": {
|
|
43
|
+
"optional": true
|
|
44
|
+
}
|
|
37
45
|
}
|
|
38
46
|
}
|