@resolution/atlassian-api-common 0.16.5 → 0.16.7
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/lib/fetch/common/index.d.ts +16 -2
- package/lib/fetch/common/index.js.map +1 -1
- package/lib/fetch/createForgeApiExternalFetch.d.ts +12 -2
- package/lib/fetch/createForgeApiExternalFetch.js +1 -1
- package/lib/fetch/createForgeApiExternalFetch.js.map +1 -1
- package/lib/fetch/createForgeApiFetch.d.ts +20 -2
- package/lib/fetch/createForgeApiFetch.js +1 -1
- package/lib/fetch/createForgeApiFetch.js.map +1 -1
- package/lib/fetch/createForgeApiWithProviderFetch.d.ts +8 -2
- package/lib/fetch/createForgeApiWithProviderFetch.js +3 -3
- package/lib/fetch/createForgeApiWithProviderFetch.js.map +1 -1
- package/lib/fetch/createForgeBridgeFetch.d.ts +8 -3
- package/lib/fetch/createForgeBridgeFetch.js +3 -3
- package/lib/fetch/createForgeBridgeFetch.js.map +1 -1
- package/package.json +2 -4
|
@@ -1,5 +1,19 @@
|
|
|
1
|
-
import type { APIResponse } from "@forge/api";
|
|
2
1
|
import type { CommonHttpClientFetchResponseBody } from "api-typescript-generator/openapi-client";
|
|
2
|
+
/**
|
|
3
|
+
* Minimal response type compatible with both native fetch and Forge API responses.
|
|
4
|
+
*/
|
|
5
|
+
export interface AnyResponse {
|
|
6
|
+
ok: boolean;
|
|
7
|
+
status: number;
|
|
8
|
+
statusText: string;
|
|
9
|
+
headers: {
|
|
10
|
+
get(key: string): string | null;
|
|
11
|
+
has(key: string): boolean;
|
|
12
|
+
forEach(callbackfn: (value: string, key: string) => void): void;
|
|
13
|
+
};
|
|
14
|
+
text(): Promise<string>;
|
|
15
|
+
arrayBuffer(): Promise<ArrayBuffer>;
|
|
16
|
+
}
|
|
3
17
|
/**
|
|
4
18
|
* The product name of the Atlassian product instance.
|
|
5
19
|
*/
|
|
@@ -18,4 +32,4 @@ export declare const isJsonMediaType: (mediaType: string) => boolean;
|
|
|
18
32
|
* Helper function to get response body from fetch response.
|
|
19
33
|
* Checks for empty JSON responses and returns data: null in such cases.
|
|
20
34
|
*/
|
|
21
|
-
export declare function getResponseBodyFromFetchResponse(response:
|
|
35
|
+
export declare function getResponseBodyFromFetchResponse(response: AnyResponse): Promise<CommonHttpClientFetchResponseBody>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/fetch/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/fetch/common/index.ts"],"names":[],"mappings":";;;;;;;;;;;;AAuBa,QAAA,qBAAqB,GAAG,cAAc,CAAC;AAEpD;;;GAGG;AACU,QAAA,qBAAqB,GAAsC;IACtE,IAAI,EAAE,MAAM;IACZ,IAAI,EAAE,IAAI;CACX,CAAC;AAEF;;GAEG;AACI,MAAM,eAAe,GAAG,CAAC,SAAiB,EAAW,EAAE,CAC5D,OAAO,CAAC,SAAS,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC,CAAC;AAD5C,QAAA,eAAe,mBAC6B;AAEzD;;;GAGG;AACH,SAAsB,gCAAgC,CACpD,QAAqB;;QAErB,MAAM,WAAW,GAAG,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,6BAAqB,CAAC,CAAC;QAEhE,IAAI,WAAW,IAAI,IAAA,uBAAe,EAAC,WAAW,CAAC,EAAE,CAAC;YAChD,MAAM,QAAQ,GAAG,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;YACvC,OAAO,QAAQ;gBACb,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,EAAE;gBAC9C,CAAC,CAAC,6BAAqB,CAAC;QAC5B,CAAC;QAED,OAAO;YACL,IAAI,EAAE,MAAM;YACZ,IAAI,EAAE,IAAI,IAAI,CAAC,CAAC,MAAM,QAAQ,CAAC,WAAW,EAAE,CAAC,CAAC;SAC/C,CAAC;IACJ,CAAC;CAAA;AAhBD,4EAgBC"}
|
|
@@ -1,5 +1,14 @@
|
|
|
1
|
-
import type { fetch as externalFetch } from "@forge/api";
|
|
2
1
|
import type { CommonHttpClientFetchRequest, CommonHttpClientFetchResponse } from "api-typescript-generator/openapi-client";
|
|
2
|
+
import type { AnyResponse } from "./common";
|
|
3
|
+
/**
|
|
4
|
+
* A fetch-like function compatible with `@forge/api`'s `fetch`.
|
|
5
|
+
*/
|
|
6
|
+
type ForgeApiFetchFunction = (url: string, init?: {
|
|
7
|
+
method?: string;
|
|
8
|
+
headers?: Record<string, string>;
|
|
9
|
+
body?: unknown;
|
|
10
|
+
redirect?: string;
|
|
11
|
+
}) => Promise<AnyResponse>;
|
|
3
12
|
/**
|
|
4
13
|
* Options for creating a Forge API fetch function.
|
|
5
14
|
*
|
|
@@ -9,7 +18,7 @@ export interface ApiClientForgeApiExternalOptions {
|
|
|
9
18
|
/**
|
|
10
19
|
* Fetch function from the browser or `@forge/api` package.
|
|
11
20
|
*/
|
|
12
|
-
fetch:
|
|
21
|
+
fetch: ForgeApiFetchFunction;
|
|
13
22
|
/**
|
|
14
23
|
* Base URL for the cloud website.
|
|
15
24
|
*/
|
|
@@ -20,3 +29,4 @@ export interface ApiClientForgeApiExternalOptions {
|
|
|
20
29
|
systemToken?: string;
|
|
21
30
|
}
|
|
22
31
|
export declare function createForgeApiExternalFetch({ fetch, systemToken, }: ApiClientForgeApiExternalOptions): (url: URL, request: CommonHttpClientFetchRequest) => Promise<CommonHttpClientFetchResponse>;
|
|
32
|
+
export {};
|
|
@@ -39,7 +39,7 @@ function createForgeApiExternalFetch({ fetch, systemToken, }) {
|
|
|
39
39
|
response.headers.forEach((value, key) => {
|
|
40
40
|
headers[key] = value;
|
|
41
41
|
});
|
|
42
|
-
if (response.headers.has("set-cookie")
|
|
42
|
+
if (response.headers.has("set-cookie") &&
|
|
43
43
|
"getSetCookie" in response.headers) {
|
|
44
44
|
headers["set-cookie"] = response.headers.getSetCookie();
|
|
45
45
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createForgeApiExternalFetch.js","sourceRoot":"","sources":["../../src/fetch/createForgeApiExternalFetch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAOA,qCAA4D;
|
|
1
|
+
{"version":3,"file":"createForgeApiExternalFetch.js","sourceRoot":"","sources":["../../src/fetch/createForgeApiExternalFetch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAOA,qCAA4D;AAmC5D,SAAgB,2BAA2B,CAAC,EAC1C,KAAK,EACL,WAAW,GACsB;IACjC,OAAO,SAAe,qBAAqB,CACzC,GAAQ,EACR,OAAqC;;YAErC,MAAW,YAAY,UAAK,OAAO,EAA7B,EAAmB,CAAU,CAAC;YACpC,MAAM,WAAW,GAAgB,YAAY,CAAC;YAC9C,IAAI,cAAc,GAAG,OAAO,CAAC,OAAiC,CAAC;YAC/D,IAAI,WAAW,EAAE,CAAC;gBAChB,cAAc,mCACT,cAAc,KACjB,aAAa,EAAE,UAAU,WAAW,EAAE,GACvC,CAAC;YACJ,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,GAAG,CAAC,QAAQ,EAAE,kCACtC,WAAW,KACd,OAAO,EAAE,cAAc;gBACvB,mCAAmC;gBACnC,IAAI,EAAE,OAAO,CAAC,IAAa,IAC3B,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,IAAA,yCAAgC,EAAC,QAAQ,CAAC,CAAC;YAC9D,MAAM,OAAO,GAAoC,EAAE,CAAC;YACpD,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;gBACtC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACvB,CAAC,CAAC,CAAC;YACH,IACE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;gBAClC,cAAc,IAAI,QAAQ,CAAC,OAAO,EAClC,CAAC;gBACD,OAAO,CAAC,YAAY,CAAC,GACnB,QAAQ,CAAC,OAGV,CAAC,YAAY,EAAE,CAAC;YACnB,CAAC;YACD,OAAO;gBACL,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;gBAC/B,IAAI;gBACJ,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;gBACnB,OAAO;gBACP,EAAE,EAAE,QAAQ,CAAC,EAAE;gBACf,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;aAC/C,CAAC;QACJ,CAAC;KAAA,CAAC;AACJ,CAAC;AAhDD,kEAgDC"}
|
|
@@ -1,5 +1,23 @@
|
|
|
1
|
-
import type * as ForgeApi from "@forge/api";
|
|
2
1
|
import type { CommonHttpClientFetchRequest, CommonHttpClientFetchResponse } from "api-typescript-generator/openapi-client";
|
|
2
|
+
import type { AnyResponse } from "./common";
|
|
3
|
+
/**
|
|
4
|
+
* A product request function compatible with `@forge/api`'s `requestJira`/`requestConfluence`.
|
|
5
|
+
*/
|
|
6
|
+
type ForgeApiProductRequestFunction = (url: string, init?: Record<string, unknown>) => Promise<AnyResponse>;
|
|
7
|
+
/**
|
|
8
|
+
* Minimal type stub for the `@forge/api` namespace.
|
|
9
|
+
*/
|
|
10
|
+
interface ForgeApiNamespace {
|
|
11
|
+
asApp(): {
|
|
12
|
+
requestJira: ForgeApiProductRequestFunction;
|
|
13
|
+
requestConfluence: ForgeApiProductRequestFunction;
|
|
14
|
+
};
|
|
15
|
+
asUser(): {
|
|
16
|
+
requestJira: ForgeApiProductRequestFunction;
|
|
17
|
+
requestConfluence: ForgeApiProductRequestFunction;
|
|
18
|
+
};
|
|
19
|
+
assumeTrustedRoute(route: string): string;
|
|
20
|
+
}
|
|
3
21
|
/**
|
|
4
22
|
* The product name of the Atlassian product instance supported by `createForgeApiWithProviderFetch`.
|
|
5
23
|
*/
|
|
@@ -13,7 +31,7 @@ export interface ApiClientForgeApiOptions {
|
|
|
13
31
|
/**
|
|
14
32
|
* Forge API namespace. Can be imported using: import * as forgeApi from `@forge/api`;
|
|
15
33
|
*/
|
|
16
|
-
forgeApi:
|
|
34
|
+
forgeApi: ForgeApiNamespace;
|
|
17
35
|
/**
|
|
18
36
|
* Whether to make requests as an app. If not provided, the request will be made on behalf of the user.
|
|
19
37
|
*/
|
|
@@ -25,7 +25,7 @@ function createForgeApiFetch({ forgeApi, asApp }, productName) {
|
|
|
25
25
|
response.headers.forEach((value, key) => {
|
|
26
26
|
headers[key] = value;
|
|
27
27
|
});
|
|
28
|
-
if (response.headers.has("set-cookie")
|
|
28
|
+
if (response.headers.has("set-cookie") &&
|
|
29
29
|
"getSetCookie" in response.headers) {
|
|
30
30
|
headers["set-cookie"] = response.headers.getSetCookie();
|
|
31
31
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createForgeApiFetch.js","sourceRoot":"","sources":["../../src/fetch/createForgeApiFetch.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,qCAA4D;
|
|
1
|
+
{"version":3,"file":"createForgeApiFetch.js","sourceRoot":"","sources":["../../src/fetch/createForgeApiFetch.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,qCAA4D;AA8C5D;;GAEG;AACH,SAAgB,mBAAmB,CACjC,EAAE,QAAQ,EAAE,KAAK,EAA4B,EAC7C,WAAyC;IAEzC,OAAO,SAAe,aAAa,CACjC,GAAQ,EACR,OAAqC;;YAErC,MAAM,QAAQ,GAAG,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,MAAM,EAAE,CAAC,CACnE,WAAW,KAAK,MAAM,CAAC,CAAC,CAAC,aAAa,CAAC,CAAC,CAAC,mBAAmB,CAC7D,CAAC,QAAQ,CAAC,kBAAkB,CAAC,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC,kCACxD,OAAO;gBACV,yGAAyG;gBACzG,IAAI,EAAE,OAAO,CAAC,IAAa,IAC3B,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,IAAA,yCAAgC,EAAC,QAAQ,CAAC,CAAC;YAC9D,MAAM,OAAO,GAAoC,EAAE,CAAC;YACpD,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;gBACtC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACvB,CAAC,CAAC,CAAC;YACH,IACE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;gBAClC,cAAc,IAAI,QAAQ,CAAC,OAAO,EAClC,CAAC;gBACD,OAAO,CAAC,YAAY,CAAC,GACnB,QAAQ,CAAC,OAGV,CAAC,YAAY,EAAE,CAAC;YACnB,CAAC;YACD,OAAO;gBACL,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;gBAC/B,IAAI;gBACJ,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;gBACnB,OAAO;gBACP,EAAE,EAAE,QAAQ,CAAC,EAAE;gBACf,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;aAC/C,CAAC;QACJ,CAAC;KAAA,CAAC;AACJ,CAAC;AAxCD,kDAwCC"}
|
|
@@ -1,5 +1,11 @@
|
|
|
1
|
-
import type { ExternalAuthFetchMethods } from "@forge/api";
|
|
2
1
|
import type { CommonHttpClientFetchRequest, CommonHttpClientFetchResponse } from "api-typescript-generator/openapi-client";
|
|
2
|
+
import type { AnyResponse } from "./common";
|
|
3
|
+
/**
|
|
4
|
+
* Minimal type stub for `@forge/api`'s `ExternalAuthFetchMethods`.
|
|
5
|
+
*/
|
|
6
|
+
interface ForgeExternalAuthFetchMethods {
|
|
7
|
+
fetch(url: string, init?: Record<string, unknown>): Promise<AnyResponse>;
|
|
8
|
+
}
|
|
3
9
|
/**
|
|
4
10
|
* The product name of the Atlassian product instance supported by `createForgeApiWithProviderFetch`.
|
|
5
11
|
*/
|
|
@@ -13,7 +19,7 @@ export interface ApiClientForgeApiWithProviderOptions {
|
|
|
13
19
|
/**
|
|
14
20
|
* Result of `forgeApi.asUser().withProvider(...)` call.
|
|
15
21
|
*/
|
|
16
|
-
forgeApiWithProvider:
|
|
22
|
+
forgeApiWithProvider: ForgeExternalAuthFetchMethods;
|
|
17
23
|
/**
|
|
18
24
|
* The cloud ID of the Atlassian product instance.
|
|
19
25
|
*/
|
|
@@ -10,7 +10,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
|
|
|
10
10
|
};
|
|
11
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
12
|
exports.createForgeApiWithProviderFetch = void 0;
|
|
13
|
-
const
|
|
13
|
+
const common_1 = require("./common");
|
|
14
14
|
/**
|
|
15
15
|
* The base URL for the Atlassian API.
|
|
16
16
|
* Is not used in order to perform the request, but is used to construct the URL for the response.
|
|
@@ -26,12 +26,12 @@ function createForgeApiWithProviderFetch({ forgeApiWithProvider, cloudId }, prod
|
|
|
26
26
|
const response = yield forgeApiWithProvider.fetch(path, Object.assign(Object.assign({}, request), {
|
|
27
27
|
// Forge API package uses BodyInit from `node-fetch` package, which is a bit different to the native one.
|
|
28
28
|
body: request.body }));
|
|
29
|
-
const body = yield (0,
|
|
29
|
+
const body = yield (0, common_1.getResponseBodyFromFetchResponse)(response);
|
|
30
30
|
const headers = {};
|
|
31
31
|
response.headers.forEach((value, key) => {
|
|
32
32
|
headers[key] = value;
|
|
33
33
|
});
|
|
34
|
-
if (response.headers.has("set-cookie")
|
|
34
|
+
if (response.headers.has("set-cookie") &&
|
|
35
35
|
"getSetCookie" in response.headers) {
|
|
36
36
|
headers["set-cookie"] = response.headers.getSetCookie();
|
|
37
37
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createForgeApiWithProviderFetch.js","sourceRoot":"","sources":["../../src/fetch/createForgeApiWithProviderFetch.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,
|
|
1
|
+
{"version":3,"file":"createForgeApiWithProviderFetch.js","sourceRoot":"","sources":["../../src/fetch/createForgeApiWithProviderFetch.ts"],"names":[],"mappings":";;;;;;;;;;;;AAOA,qCAA4D;AAc5D;;;GAGG;AACH,MAAM,UAAU,GAAG,2BAA2B,CAAC;AAkB/C;;GAEG;AACH,SAAgB,+BAA+B,CAC7C,EAAE,oBAAoB,EAAE,OAAO,EAAwC,EACvE,WAAqD;IAErD,OAAO,SAAe,gBAAgB,CACpC,GAAQ,EACR,OAAqC;;YAErC,MAAM,IAAI,GAAG,OAAO,WAAW,IAAI,OAAO,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE,CAAC;YACzE,MAAM,QAAQ,GAAG,MAAM,oBAAoB,CAAC,KAAK,CAAC,IAAI,kCACjD,OAAO;gBACV,yGAAyG;gBACzG,IAAI,EAAE,OAAO,CAAC,IAAa,IAC3B,CAAC;YACH,MAAM,IAAI,GAAG,MAAM,IAAA,yCAAgC,EAAC,QAAQ,CAAC,CAAC;YAC9D,MAAM,OAAO,GAAoC,EAAE,CAAC;YACpD,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;gBACtC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACvB,CAAC,CAAC,CAAC;YACH,IACE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;gBAClC,cAAc,IAAI,QAAQ,CAAC,OAAO,EAClC,CAAC;gBACD,OAAO,CAAC,YAAY,CAAC,GACnB,QAAQ,CAAC,OAGV,CAAC,YAAY,EAAE,CAAC;YACnB,CAAC;YACD,OAAO;gBACL,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;gBAC/B,IAAI;gBACJ,GAAG,EAAE,GAAG,UAAU,GAAG,IAAI,EAAE;gBAC3B,OAAO;gBACP,EAAE,EAAE,QAAQ,CAAC,EAAE;gBACf,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;aAC/C,CAAC;QACJ,CAAC;KAAA,CAAC;AACJ,CAAC;AAvCD,0EAuCC"}
|
|
@@ -1,12 +1,16 @@
|
|
|
1
|
-
import type { requestConfluence, requestJira } from "@forge/bridge";
|
|
2
1
|
import type { CommonHttpClientFetchRequest, CommonHttpClientFetchResponse } from "api-typescript-generator/openapi-client";
|
|
2
|
+
import type { AnyResponse } from "./common";
|
|
3
|
+
/**
|
|
4
|
+
* A request function compatible with `@forge/bridge`'s `requestJira`/`requestConfluence`.
|
|
5
|
+
*/
|
|
6
|
+
type BridgeRequestFunction = (path: string, init?: RequestInit) => Promise<AnyResponse>;
|
|
3
7
|
/**
|
|
4
8
|
* Forge-based frontend API client options for JIRA.
|
|
5
9
|
*
|
|
6
10
|
* @category API Client Constructor Options
|
|
7
11
|
*/
|
|
8
12
|
export interface ApiClientForgeBridgeJiraOptions {
|
|
9
|
-
requestJira:
|
|
13
|
+
requestJira: BridgeRequestFunction;
|
|
10
14
|
}
|
|
11
15
|
/**
|
|
12
16
|
* Forge-based frontend API client options for Confluence.
|
|
@@ -14,7 +18,8 @@ export interface ApiClientForgeBridgeJiraOptions {
|
|
|
14
18
|
* @category API Client Constructor Options
|
|
15
19
|
*/
|
|
16
20
|
export interface ApiClientForgeBridgeConfluenceOptions {
|
|
17
|
-
requestConfluence:
|
|
21
|
+
requestConfluence: BridgeRequestFunction;
|
|
18
22
|
}
|
|
19
23
|
export declare const createJiraForgeBridgeFetch: ({ requestJira, }: ApiClientForgeBridgeJiraOptions) => (url: URL, request: CommonHttpClientFetchRequest) => Promise<CommonHttpClientFetchResponse>;
|
|
20
24
|
export declare const createConfluenceForgeBridgeFetch: ({ requestConfluence, }: ApiClientForgeBridgeConfluenceOptions) => (url: URL, request: CommonHttpClientFetchRequest) => Promise<CommonHttpClientFetchResponse>;
|
|
25
|
+
export {};
|
|
@@ -21,7 +21,7 @@ var __rest = (this && this.__rest) || function (s, e) {
|
|
|
21
21
|
};
|
|
22
22
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
23
23
|
exports.createConfluenceForgeBridgeFetch = exports.createJiraForgeBridgeFetch = void 0;
|
|
24
|
-
const
|
|
24
|
+
const common_1 = require("./common");
|
|
25
25
|
const createJiraForgeBridgeFetch = ({ requestJira, }) => createForgeBridgeFetch({ bridgeRequest: requestJira });
|
|
26
26
|
exports.createJiraForgeBridgeFetch = createJiraForgeBridgeFetch;
|
|
27
27
|
const createConfluenceForgeBridgeFetch = ({ requestConfluence, }) => createForgeBridgeFetch({ bridgeRequest: requestConfluence });
|
|
@@ -32,12 +32,12 @@ function createForgeBridgeFetch({ bridgeRequest, }) {
|
|
|
32
32
|
const requestProps = __rest(request, []);
|
|
33
33
|
const requestInit = requestProps;
|
|
34
34
|
const response = yield bridgeRequest(`${url.pathname}${url.search}`, requestInit);
|
|
35
|
-
const body = yield (0,
|
|
35
|
+
const body = yield (0, common_1.getResponseBodyFromFetchResponse)(response);
|
|
36
36
|
const headers = {};
|
|
37
37
|
response.headers.forEach((value, key) => {
|
|
38
38
|
headers[key] = value;
|
|
39
39
|
});
|
|
40
|
-
if (response.headers.has("set-cookie")
|
|
40
|
+
if (response.headers.has("set-cookie") &&
|
|
41
41
|
"getSetCookie" in response.headers) {
|
|
42
42
|
headers["set-cookie"] = response.headers.getSetCookie();
|
|
43
43
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createForgeBridgeFetch.js","sourceRoot":"","sources":["../../src/fetch/createForgeBridgeFetch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAOA,
|
|
1
|
+
{"version":3,"file":"createForgeBridgeFetch.js","sourceRoot":"","sources":["../../src/fetch/createForgeBridgeFetch.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;AAOA,qCAA4D;AA4BrD,MAAM,0BAA0B,GAAG,CAAC,EACzC,WAAW,GACqB,EAAE,EAAE,CACpC,sBAAsB,CAAC,EAAE,aAAa,EAAE,WAAW,EAAE,CAAC,CAAC;AAH5C,QAAA,0BAA0B,8BAGkB;AAElD,MAAM,gCAAgC,GAAG,CAAC,EAC/C,iBAAiB,GACqB,EAAE,EAAE,CAC1C,sBAAsB,CAAC,EAAE,aAAa,EAAE,iBAAiB,EAAE,CAAC,CAAC;AAHlD,QAAA,gCAAgC,oCAGkB;AAM/D,SAAS,sBAAsB,CAAC,EAC9B,aAAa,GACe;IAC5B,OAAO,SAAe,gBAAgB,CACpC,GAAQ,EACR,OAAqC;;YAErC,MAAW,YAAY,UAAK,OAAO,EAA7B,EAAmB,CAAU,CAAC;YACpC,MAAM,WAAW,GAAgB,YAAY,CAAC;YAC9C,MAAM,QAAQ,GAAG,MAAM,aAAa,CAClC,GAAG,GAAG,CAAC,QAAQ,GAAG,GAAG,CAAC,MAAM,EAAE,EAC9B,WAAW,CACZ,CAAC;YACF,MAAM,IAAI,GAAG,MAAM,IAAA,yCAAgC,EAAC,QAAQ,CAAC,CAAC;YAC9D,MAAM,OAAO,GAAoC,EAAE,CAAC;YACpD,QAAQ,CAAC,OAAO,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE;gBACtC,OAAO,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;YACvB,CAAC,CAAC,CAAC;YACH,IACE,QAAQ,CAAC,OAAO,CAAC,GAAG,CAAC,YAAY,CAAC;gBAClC,cAAc,IAAI,QAAQ,CAAC,OAAO,EAClC,CAAC;gBACD,OAAO,CAAC,YAAY,CAAC,GACnB,QAAQ,CAAC,OAGV,CAAC,YAAY,EAAE,CAAC;YACnB,CAAC;YACD,OAAO;gBACL,MAAM,EAAE,QAAQ,CAAC,MAAM;gBACvB,UAAU,EAAE,QAAQ,CAAC,UAAU;gBAC/B,IAAI;gBACJ,GAAG,EAAE,GAAG,CAAC,QAAQ,EAAE;gBACnB,OAAO;gBACP,EAAE,EAAE,QAAQ,CAAC,EAAE;gBACf,kBAAkB,EAAE,OAAO,CAAC,kBAAkB;aAC/C,CAAC;QACJ,CAAC;KAAA,CAAC;AACJ,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@resolution/atlassian-api-common",
|
|
3
|
-
"version": "0.16.
|
|
3
|
+
"version": "0.16.7",
|
|
4
4
|
"description": "Shared code across different implementations of Atlassian API Clients.",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -31,8 +31,6 @@
|
|
|
31
31
|
},
|
|
32
32
|
"homepage": "https://bitbucket.org/resolutiongmbh/atlassian-api-clients#readme",
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@forge/api": "^3.6.0",
|
|
35
|
-
"@forge/bridge": "^3.4.0",
|
|
36
34
|
"@types/atlassian-connect-js": "^5.2.17",
|
|
37
35
|
"@types/request": "^2.48.12",
|
|
38
36
|
"atlassian-connect-express": "^10.0.2"
|
|
@@ -43,5 +41,5 @@
|
|
|
43
41
|
"publishConfig": {
|
|
44
42
|
"access": "public"
|
|
45
43
|
},
|
|
46
|
-
"gitHead": "
|
|
44
|
+
"gitHead": "4d08643b5b800fc1fe767aff3494e2a07dba57bd"
|
|
47
45
|
}
|