@canton-network/core-token-standard 1.14.0 → 1.15.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/dist/index.browser.js +8 -12
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +8 -12
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +2 -1
- package/dist/index.js +8 -12
- package/dist/index.js.map +1 -1
- package/dist/token-standard-client.d.ts +1 -1
- package/dist/token-standard-client.d.ts.map +1 -1
- package/package.json +10 -11
package/dist/index.browser.js
CHANGED
|
@@ -31,21 +31,17 @@ class TokenStandardClient {
|
|
|
31
31
|
baseUrl,
|
|
32
32
|
fetch: async (url, options = {}) => {
|
|
33
33
|
const accessToken = await this.accessTokenProvider.getAccessToken();
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
headers
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
: {}),
|
|
41
|
-
'Content-Type': 'application/json',
|
|
42
|
-
},
|
|
43
|
-
});
|
|
34
|
+
const headers = new Headers(options.headers);
|
|
35
|
+
if (accessToken) {
|
|
36
|
+
headers.set('Authorization', `Bearer ${accessToken}`);
|
|
37
|
+
}
|
|
38
|
+
headers.set('Content-Type', 'application/json');
|
|
39
|
+
return fetch(url, { ...options, headers });
|
|
44
40
|
},
|
|
45
41
|
});
|
|
46
42
|
}
|
|
47
43
|
async post(path, body, params) {
|
|
48
|
-
//
|
|
44
|
+
// oxlint-disable-next-line typescript/no-explicit-any -- (cant align this with openapi-fetch generics :shrug:)
|
|
49
45
|
const options = { body, params };
|
|
50
46
|
this.logger.debug({ requestBody: body }, `POST ${path}`);
|
|
51
47
|
const resp = await this.client.POST(path, options);
|
|
@@ -53,7 +49,7 @@ class TokenStandardClient {
|
|
|
53
49
|
return this.valueOrError(resp);
|
|
54
50
|
}
|
|
55
51
|
async get(path, params) {
|
|
56
|
-
//
|
|
52
|
+
// oxlint-disable-next-line typescript/no-explicit-any -- (cant align this with openapi-fetch generics :shrug:)
|
|
57
53
|
const options = { params };
|
|
58
54
|
const resp = await this.client.GET(path, options);
|
|
59
55
|
this.logger.debug({ path: path, params: params, response: resp }, `GET ${path}`);
|