@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.
@@ -31,21 +31,17 @@ class TokenStandardClient {
31
31
  baseUrl,
32
32
  fetch: async (url, options = {}) => {
33
33
  const accessToken = await this.accessTokenProvider.getAccessToken();
34
- return fetch(url, {
35
- ...options,
36
- headers: {
37
- ...(options.headers || {}),
38
- ...(accessToken
39
- ? { Authorization: `Bearer ${accessToken}` }
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
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- (cant align this with openapi-fetch generics :shrug:)
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
- // eslint-disable-next-line @typescript-eslint/no-explicit-any -- (cant align this with openapi-fetch generics :shrug:)
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}`);