@axinom/mosaic-id-link-be 0.39.0 → 0.40.0-rc.4
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/dist/common/gql-client.d.ts.map +1 -1
- package/dist/common/gql-client.js +2 -1
- package/dist/common/gql-client.js.map +1 -1
- package/dist/well-known-endpoints/index.d.ts.map +1 -1
- package/dist/well-known-endpoints/index.js +4 -2
- package/dist/well-known-endpoints/index.js.map +1 -1
- package/package.json +5 -5
- package/src/common/gql-client.ts +2 -0
- package/src/well-known-endpoints/index.ts +6 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gql-client.d.ts","sourceRoot":"","sources":["../../src/common/gql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAIZ,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"gql-client.d.ts","sourceRoot":"","sources":["../../src/common/gql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,YAAY,EAIZ,qBAAqB,EACtB,MAAM,qBAAqB,CAAC;AAI7B,eAAO,MAAM,YAAY,GACvB,UAAU,MAAM,EAChB,cAAc,MAAM,KACnB,YAAY,CAAC,qBAAqB,CAcpC,CAAC"}
|
|
@@ -5,13 +5,14 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getGqlClient = void 0;
|
|
7
7
|
const core_1 = require("@apollo/client/core");
|
|
8
|
+
const mosaic_service_common_1 = require("@axinom/mosaic-service-common");
|
|
8
9
|
const cross_fetch_1 = __importDefault(require("cross-fetch"));
|
|
9
10
|
const getGqlClient = (endpoint, accessToken) => {
|
|
10
11
|
return new core_1.ApolloClient({
|
|
11
12
|
link: core_1.ApolloLink.from([
|
|
12
13
|
new core_1.HttpLink({
|
|
13
14
|
uri: endpoint,
|
|
14
|
-
headers: Object.assign({}, (accessToken ? { authorization: `Bearer ${accessToken}` } : {})),
|
|
15
|
+
headers: Object.assign(Object.assign({}, (0, mosaic_service_common_1.getRequestContextHeaders)()), (accessToken ? { authorization: `Bearer ${accessToken}` } : {})),
|
|
15
16
|
fetch: cross_fetch_1.default,
|
|
16
17
|
}),
|
|
17
18
|
]),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"gql-client.js","sourceRoot":"","sources":["../../src/common/gql-client.ts"],"names":[],"mappings":";;;;;;AAAA,8CAM6B;AAC7B,8DAAgC;AAEzB,MAAM,YAAY,GAAG,CAC1B,QAAgB,EAChB,WAAoB,EACiB,EAAE;IACvC,OAAO,IAAI,mBAAY,CAAC;QACtB,IAAI,EAAE,iBAAU,CAAC,IAAI,CAAC;YACpB,IAAI,eAAQ,CAAC;gBACX,GAAG,EAAE,QAAQ;gBACb,OAAO,
|
|
1
|
+
{"version":3,"file":"gql-client.js","sourceRoot":"","sources":["../../src/common/gql-client.ts"],"names":[],"mappings":";;;;;;AAAA,8CAM6B;AAC7B,yEAAyE;AACzE,8DAAgC;AAEzB,MAAM,YAAY,GAAG,CAC1B,QAAgB,EAChB,WAAoB,EACiB,EAAE;IACvC,OAAO,IAAI,mBAAY,CAAC;QACtB,IAAI,EAAE,iBAAU,CAAC,IAAI,CAAC;YACpB,IAAI,eAAQ,CAAC;gBACX,GAAG,EAAE,QAAQ;gBACb,OAAO,kCACF,IAAA,gDAAwB,GAAE,GAC1B,CAAC,WAAW,CAAC,CAAC,CAAC,EAAE,aAAa,EAAE,UAAU,WAAW,EAAE,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC,CACnE;gBACD,KAAK,EAAL,qBAAK;aACN,CAAC;SACH,CAAC;QACF,KAAK,EAAE,IAAI,oBAAa,EAAE;KAC3B,CAAC,CAAC;AACL,CAAC,CAAC;AAjBW,QAAA,YAAY,gBAiBvB"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/well-known-endpoints/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/well-known-endpoints/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,kBAAkB,EAAE,MAAM,iBAAiB,CAAC;AAErD;;;;GAIG;AACH,wBAAsB,qBAAqB,CACzC,YAAY,EAAE,MAAM,GACnB,OAAO,CAAC,kBAAkB,CAAC,CAU7B"}
|
|
@@ -4,6 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.getWellKnownEndpoints = getWellKnownEndpoints;
|
|
7
|
+
const mosaic_service_common_1 = require("@axinom/mosaic-service-common");
|
|
7
8
|
const axios_1 = __importDefault(require("axios"));
|
|
8
9
|
/**
|
|
9
10
|
* This function returns the well known endpoints of id-service.
|
|
@@ -12,8 +13,9 @@ const axios_1 = __importDefault(require("axios"));
|
|
|
12
13
|
*/
|
|
13
14
|
async function getWellKnownEndpoints(authEndpoint) {
|
|
14
15
|
const wellKnownEndpointUrl = new URL(`/.well-known`, `${authEndpoint}`).href;
|
|
15
|
-
const result = (await axios_1.default.get(wellKnownEndpointUrl
|
|
16
|
-
.
|
|
16
|
+
const result = (await axios_1.default.get(wellKnownEndpointUrl, {
|
|
17
|
+
headers: (0, mosaic_service_common_1.getRequestContextHeaders)(),
|
|
18
|
+
})).data;
|
|
17
19
|
return result;
|
|
18
20
|
}
|
|
19
21
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/well-known-endpoints/index.ts"],"names":[],"mappings":";;;;;
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/well-known-endpoints/index.ts"],"names":[],"mappings":";;;;;AASA,sDAYC;AArBD,yEAAyE;AACzE,kDAA0B;AAG1B;;;;GAIG;AACI,KAAK,UAAU,qBAAqB,CACzC,YAAoB;IAEpB,MAAM,oBAAoB,GAAG,IAAI,GAAG,CAAC,cAAc,EAAE,GAAG,YAAY,EAAE,CAAC,CAAC,IAAI,CAAC;IAE7E,MAAM,MAAM,GAAuB,CACjC,MAAM,eAAK,CAAC,GAAG,CAAC,oBAAoB,EAAE;QACpC,OAAO,EAAE,IAAA,gDAAwB,GAAE;KACpC,CAAC,CACH,CAAC,IAAI,CAAC;IAEP,OAAO,MAAM,CAAC;AAChB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@axinom/mosaic-id-link-be",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.40.0-rc.4",
|
|
4
4
|
"description": "Integration utilities from id-service for Axinom Mosaic services",
|
|
5
5
|
"author": "Axinom",
|
|
6
6
|
"license": "PROPRIETARY",
|
|
@@ -32,9 +32,9 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"@apollo/client": "^3.7.9",
|
|
35
|
-
"@axinom/mosaic-core": "^0.4.
|
|
36
|
-
"@axinom/mosaic-id-utils": "^0.
|
|
37
|
-
"@axinom/mosaic-service-common": "^0.
|
|
35
|
+
"@axinom/mosaic-core": "^0.4.34-rc.4",
|
|
36
|
+
"@axinom/mosaic-id-utils": "^0.28.0-rc.4",
|
|
37
|
+
"@axinom/mosaic-service-common": "^0.70.0-rc.4",
|
|
38
38
|
"axios": "^1.8.3",
|
|
39
39
|
"cross-fetch": "^3.0.4",
|
|
40
40
|
"graphql": "^15.4.0",
|
|
@@ -52,5 +52,5 @@
|
|
|
52
52
|
"publishConfig": {
|
|
53
53
|
"access": "public"
|
|
54
54
|
},
|
|
55
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "1286a116f2e06be15726a9094b19987c56d3bc49"
|
|
56
56
|
}
|
package/src/common/gql-client.ts
CHANGED
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
InMemoryCache,
|
|
6
6
|
NormalizedCacheObject,
|
|
7
7
|
} from '@apollo/client/core';
|
|
8
|
+
import { getRequestContextHeaders } from '@axinom/mosaic-service-common';
|
|
8
9
|
import fetch from 'cross-fetch';
|
|
9
10
|
|
|
10
11
|
export const getGqlClient = (
|
|
@@ -16,6 +17,7 @@ export const getGqlClient = (
|
|
|
16
17
|
new HttpLink({
|
|
17
18
|
uri: endpoint,
|
|
18
19
|
headers: {
|
|
20
|
+
...getRequestContextHeaders(),
|
|
19
21
|
...(accessToken ? { authorization: `Bearer ${accessToken}` } : {}),
|
|
20
22
|
},
|
|
21
23
|
fetch,
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { getRequestContextHeaders } from '@axinom/mosaic-service-common';
|
|
1
2
|
import axios from 'axios';
|
|
2
3
|
import { WellKnownEndpoints } from '../common/types';
|
|
3
4
|
|
|
@@ -11,8 +12,11 @@ export async function getWellKnownEndpoints(
|
|
|
11
12
|
): Promise<WellKnownEndpoints> {
|
|
12
13
|
const wellKnownEndpointUrl = new URL(`/.well-known`, `${authEndpoint}`).href;
|
|
13
14
|
|
|
14
|
-
const result: WellKnownEndpoints = (
|
|
15
|
-
.
|
|
15
|
+
const result: WellKnownEndpoints = (
|
|
16
|
+
await axios.get(wellKnownEndpointUrl, {
|
|
17
|
+
headers: getRequestContextHeaders(),
|
|
18
|
+
})
|
|
19
|
+
).data;
|
|
16
20
|
|
|
17
21
|
return result;
|
|
18
22
|
}
|