@evoke-platform/context 1.0.0-dev.119 → 1.0.0-dev.120

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.
@@ -11,9 +11,10 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
11
11
  };
12
12
  import axios from 'axios';
13
13
  import { useMemo } from 'react';
14
+ import { v4 as uuidv4 } from 'uuid';
14
15
  import { useAuthenticationContext } from '../authentication/AuthenticationContextProvider.js';
15
16
  import { useApiBaseUrl } from './ApiBaseUrlProvider.js';
16
- import { v4 as uuidv4 } from 'uuid';
17
+ import { paramsSerializer } from './paramsSerializer.js';
17
18
  const sessionId = uuidv4();
18
19
  export class ApiServices {
19
20
  constructor(api, authContext) {
@@ -143,6 +144,6 @@ export class ApiServices {
143
144
  export function useApiServices() {
144
145
  const authContext = useAuthenticationContext();
145
146
  const baseURL = useApiBaseUrl();
146
- const apiServices = useMemo(() => new ApiServices(axios.create({ baseURL }), authContext), [authContext, baseURL]);
147
+ const apiServices = useMemo(() => new ApiServices(axios.create({ baseURL, paramsSerializer }), authContext), [authContext, baseURL]);
147
148
  return apiServices;
148
149
  }
@@ -0,0 +1,2 @@
1
+ import { ParamsSerializerOptions } from 'axios';
2
+ export declare function paramsSerializer(params: Record<string, unknown>, options?: ParamsSerializerOptions): string;
@@ -0,0 +1,7 @@
1
+ export function paramsSerializer(params, options) {
2
+ const searchParams = new URLSearchParams();
3
+ for (const [key, value] of Object.entries(params)) {
4
+ searchParams.append(key, typeof value !== 'string' ? JSON.stringify(value) : value);
5
+ }
6
+ return searchParams.toString();
7
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@evoke-platform/context",
3
- "version": "1.0.0-dev.119",
3
+ "version": "1.0.0-dev.120",
4
4
  "description": "Utilities that provide context to Evoke platform widgets",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -68,7 +68,7 @@
68
68
  },
69
69
  "dependencies": {
70
70
  "@microsoft/signalr": "^7.0.12",
71
- "axios": "^1.7.7",
71
+ "axios": "^1.7.9",
72
72
  "uuid": "^9.0.1"
73
73
  }
74
74
  }