coveo.analytics 2.26.2 → 2.26.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "coveo.analytics",
3
- "version": "2.26.2",
3
+ "version": "2.26.3",
4
4
  "description": "📈 Coveo analytics client (node and browser compatible) ",
5
5
  "main": "dist/library.js",
6
6
  "module": "dist/library.es.js",
@@ -24,7 +24,8 @@
24
24
  "license": "MIT",
25
25
  "dependencies": {
26
26
  "cross-fetch": "^3.1.5",
27
- "uuid": "^9.0.0"
27
+ "uuid": "^9.0.0",
28
+ "react-native-get-random-values": "^1.8.0"
28
29
  },
29
30
  "devDependencies": {
30
31
  "@rollup/plugin-alias": "^3.1.2",
@@ -462,6 +462,12 @@ describe('custom clientId', () => {
462
462
  expect(await client.getCurrentVisitorId()).toBe('c7d57b22-4aa8-487a-a106-be5243885f0a');
463
463
  });
464
464
 
465
+ it('persists clientId in lowercase', async () => {
466
+ const client = new CoveoAnalyticsClient({});
467
+ client.setClientId('C7D57B22-4AA8-487A-A106-BE5243885F0A');
468
+ expect(await client.getCurrentVisitorId()).toBe('c7d57b22-4aa8-487a-a106-be5243885f0a');
469
+ });
470
+
465
471
  it('allows setting a custom consistent clientId given a string', async () => {
466
472
  const client = new CoveoAnalyticsClient({});
467
473
  client.setClientId('somestring', 'testNameSpace');
@@ -228,7 +228,7 @@ export class CoveoAnalyticsClient implements AnalyticsClient, VisitorIdProvider
228
228
 
229
229
  async setClientId(value: string, namespace?: string) {
230
230
  if (uuidValidate(value)) {
231
- this.setCurrentVisitorId(value);
231
+ this.setCurrentVisitorId(value.toLowerCase());
232
232
  } else {
233
233
  if (!namespace) {
234
234
  throw Error('Cannot generate uuid client id without a specific namespace string.');
@@ -1,2 +1,3 @@
1
1
  export {ReactNativeRuntime, ReactNativeRuntimeOptions, ReactNativeStorage} from './react-native-runtime';
2
2
  export * from '../coveoua/headless';
3
+ import 'react-native-get-random-values';
@@ -1,5 +1,5 @@
1
1
  import CoveoAnalyticsClient from '../client/analytics';
2
- import {ReactNativeRuntime} from './index';
2
+ import {ReactNativeRuntime} from './react-native-runtime';
3
3
 
4
4
  describe('ReactNativeRuntime', () => {
5
5
  let runtimeEnvironment: ReactNativeRuntime;
@@ -148,7 +148,6 @@ describe('SearchPageClient', () => {
148
148
  anonymous: false,
149
149
  actionCause,
150
150
  customData,
151
- queryPipeline: 'my-pipeline',
152
151
  language: 'en',
153
152
  clientId: 'visitor-id',
154
153
  facetState: fakeFacetState,