@coveo/headless-react 2.1.1 → 2.1.2-pre.195b9ac516
Sign up to get free protection for your applications and to get access to all the features.
@@ -1,27 +1,27 @@
|
|
1
|
-
import { Controller,
|
1
|
+
import { Controller, ControllerDefinitionsMap, CommerceEngineDefinitionOptions, CommerceEngineOptions, SolutionType } from '@coveo/headless/ssr-commerce';
|
2
2
|
import React from 'react';
|
3
3
|
import { SingletonGetter } from '../utils.js';
|
4
4
|
import { ContextState, ReactEngineDefinition } from './types.js';
|
5
|
-
export type ReactCommerceEngineDefinition<TControllers extends ControllerDefinitionsMap<
|
6
|
-
export declare function createSingletonContext<TControllers extends ControllerDefinitionsMap<
|
5
|
+
export type ReactCommerceEngineDefinition<TControllers extends ControllerDefinitionsMap<Controller>, TSolutionType extends SolutionType> = ReactEngineDefinition<TControllers, CommerceEngineOptions, TSolutionType>;
|
6
|
+
export declare function createSingletonContext<TControllers extends ControllerDefinitionsMap<Controller>, TSolutionType extends SolutionType = SolutionType>(): SingletonGetter<React.Context<ContextState<TControllers, TSolutionType> | null>>;
|
7
7
|
/**
|
8
8
|
* Returns controller hooks as well as SSR and CSR context providers that can be used to interact with a Commerce engine
|
9
9
|
* on the server and client side respectively.
|
10
10
|
*/
|
11
|
-
export declare function defineCommerceEngine<TControllers extends ControllerDefinitionsMap<
|
12
|
-
useEngine: () => CommerceEngine | undefined;
|
11
|
+
export declare function defineCommerceEngine<TControllers extends ControllerDefinitionsMap<Controller>>(options: CommerceEngineDefinitionOptions<TControllers>): {
|
12
|
+
useEngine: () => import("@coveo/headless/ssr-commerce").CommerceEngine | undefined;
|
13
13
|
controllers: import("./types.js").InferControllerHooksMapFromDefinition<TControllers>;
|
14
14
|
listingEngineDefinition: {
|
15
15
|
StaticStateProvider: ({ controllers, children, }: React.PropsWithChildren<{
|
16
16
|
controllers: import("@coveo/headless/ssr-commerce").InferControllerStaticStateMapFromDefinitionsWithSolutionType<TControllers, SolutionType.listing>;
|
17
17
|
}>) => import("react/jsx-runtime").JSX.Element;
|
18
18
|
HydratedStateProvider: ({ engine, controllers, children, }: React.PropsWithChildren<{
|
19
|
-
engine: CommerceEngine;
|
19
|
+
engine: import("@coveo/headless/ssr-commerce").CommerceEngine;
|
20
20
|
controllers: import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.listing>;
|
21
21
|
}>) => import("react/jsx-runtime").JSX.Element;
|
22
|
-
fetchStaticState: import("@coveo/headless/ssr-commerce").FetchStaticState<CommerceEngine, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.listing>, import("redux").UnknownAction, import("@coveo/headless/ssr-commerce").InferControllerStaticStateMapFromDefinitionsWithSolutionType<TControllers, SolutionType.listing>, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
23
|
-
hydrateStaticState: import("@coveo/headless/ssr-commerce").HydrateStaticState<CommerceEngine, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.listing>, import("redux").UnknownAction, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
24
|
-
build: import("@coveo/headless/ssr-commerce").Build<CommerceEngine, CommerceEngineOptions, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.listing>, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
22
|
+
fetchStaticState: import("@coveo/headless/ssr-commerce").FetchStaticState<import("@coveo/headless/ssr-commerce").CommerceEngine, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.listing>, import("redux").UnknownAction, import("@coveo/headless/ssr-commerce").InferControllerStaticStateMapFromDefinitionsWithSolutionType<TControllers, SolutionType.listing>, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
23
|
+
hydrateStaticState: import("@coveo/headless/ssr-commerce").HydrateStaticState<import("@coveo/headless/ssr-commerce").CommerceEngine, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.listing>, import("redux").UnknownAction, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
24
|
+
build: import("@coveo/headless/ssr-commerce").Build<import("@coveo/headless/ssr-commerce").CommerceEngine, CommerceEngineOptions, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.listing>, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
25
25
|
setNavigatorContextProvider: (navigatorContextProvider: import("@coveo/headless/ssr-commerce").NavigatorContextProvider) => void;
|
26
26
|
};
|
27
27
|
searchEngineDefinition: {
|
@@ -29,12 +29,12 @@ export declare function defineCommerceEngine<TControllers extends ControllerDefi
|
|
29
29
|
controllers: import("@coveo/headless/ssr-commerce").InferControllerStaticStateMapFromDefinitionsWithSolutionType<TControllers, SolutionType.search>;
|
30
30
|
}>) => import("react/jsx-runtime").JSX.Element;
|
31
31
|
HydratedStateProvider: ({ engine, controllers, children, }: React.PropsWithChildren<{
|
32
|
-
engine: CommerceEngine;
|
32
|
+
engine: import("@coveo/headless/ssr-commerce").CommerceEngine;
|
33
33
|
controllers: import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.search>;
|
34
34
|
}>) => import("react/jsx-runtime").JSX.Element;
|
35
|
-
fetchStaticState: import("@coveo/headless/ssr-commerce").FetchStaticState<CommerceEngine, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.search>, import("redux").UnknownAction, import("@coveo/headless/ssr-commerce").InferControllerStaticStateMapFromDefinitionsWithSolutionType<TControllers, SolutionType.search>, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
36
|
-
hydrateStaticState: import("@coveo/headless/ssr-commerce").HydrateStaticState<CommerceEngine, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.search>, import("redux").UnknownAction, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
37
|
-
build: import("@coveo/headless/ssr-commerce").Build<CommerceEngine, CommerceEngineOptions, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.search>, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
35
|
+
fetchStaticState: import("@coveo/headless/ssr-commerce").FetchStaticState<import("@coveo/headless/ssr-commerce").CommerceEngine, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.search>, import("redux").UnknownAction, import("@coveo/headless/ssr-commerce").InferControllerStaticStateMapFromDefinitionsWithSolutionType<TControllers, SolutionType.search>, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
36
|
+
hydrateStaticState: import("@coveo/headless/ssr-commerce").HydrateStaticState<import("@coveo/headless/ssr-commerce").CommerceEngine, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.search>, import("redux").UnknownAction, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
37
|
+
build: import("@coveo/headless/ssr-commerce").Build<import("@coveo/headless/ssr-commerce").CommerceEngine, CommerceEngineOptions, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.search>, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
38
38
|
setNavigatorContextProvider: (navigatorContextProvider: import("@coveo/headless/ssr-commerce").NavigatorContextProvider) => void;
|
39
39
|
};
|
40
40
|
standaloneEngineDefinition: {
|
@@ -42,12 +42,12 @@ export declare function defineCommerceEngine<TControllers extends ControllerDefi
|
|
42
42
|
controllers: import("@coveo/headless/ssr-commerce").InferControllerStaticStateMapFromDefinitionsWithSolutionType<TControllers, SolutionType.standalone>;
|
43
43
|
}>) => import("react/jsx-runtime").JSX.Element;
|
44
44
|
HydratedStateProvider: ({ engine, controllers, children, }: React.PropsWithChildren<{
|
45
|
-
engine: CommerceEngine;
|
45
|
+
engine: import("@coveo/headless/ssr-commerce").CommerceEngine;
|
46
46
|
controllers: import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.standalone>;
|
47
47
|
}>) => import("react/jsx-runtime").JSX.Element;
|
48
|
-
fetchStaticState: import("@coveo/headless/ssr-commerce").FetchStaticState<CommerceEngine, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.standalone>, import("redux").UnknownAction, import("@coveo/headless/ssr-commerce").InferControllerStaticStateMapFromDefinitionsWithSolutionType<TControllers, SolutionType.standalone>, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
49
|
-
hydrateStaticState: import("@coveo/headless/ssr-commerce").HydrateStaticState<CommerceEngine, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.standalone>, import("redux").UnknownAction, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
50
|
-
build: import("@coveo/headless/ssr-commerce").Build<CommerceEngine, CommerceEngineOptions, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.standalone>, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
48
|
+
fetchStaticState: import("@coveo/headless/ssr-commerce").FetchStaticState<import("@coveo/headless/ssr-commerce").CommerceEngine, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.standalone>, import("redux").UnknownAction, import("@coveo/headless/ssr-commerce").InferControllerStaticStateMapFromDefinitionsWithSolutionType<TControllers, SolutionType.standalone>, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
49
|
+
hydrateStaticState: import("@coveo/headless/ssr-commerce").HydrateStaticState<import("@coveo/headless/ssr-commerce").CommerceEngine, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.standalone>, import("redux").UnknownAction, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
50
|
+
build: import("@coveo/headless/ssr-commerce").Build<import("@coveo/headless/ssr-commerce").CommerceEngine, CommerceEngineOptions, import("@coveo/headless/ssr-commerce").InferControllersMapFromDefinition<TControllers, SolutionType.standalone>, import("@coveo/headless/ssr-commerce").InferControllerPropsMapFromDefinitions<TControllers>>;
|
51
51
|
setNavigatorContextProvider: (navigatorContextProvider: import("@coveo/headless/ssr-commerce").NavigatorContextProvider) => void;
|
52
52
|
};
|
53
53
|
};
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"commerce-engine.js","sourceRoot":"","sources":["../../src/ssr-commerce/commerce-engine.tsx"],"names":[],"mappings":"AAAA,OAAO,
|
1
|
+
{"version":3,"file":"commerce-engine.js","sourceRoot":"","sources":["../../src/ssr-commerce/commerce-engine.tsx"],"names":[],"mappings":"AAAA,OAAO,EAIL,oBAAoB,IAAI,wBAAwB,GAGjD,MAAM,8BAA8B,CAAC;AACtC,wEAAwE;AACxE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAC,SAAS,EAAkB,MAAM,aAAa,CAAC;AACvD,OAAO,EACL,oBAAoB,EACpB,eAAe,EACf,0BAA0B,EAC1B,wBAAwB,GACzB,MAAM,aAAa,CAAC;AAQrB,8GAA8G;AAC9G,MAAM,UAAU,sBAAsB;IAIpC,OAAO,SAAS,CAAC,GAAG,EAAE,CACpB,KAAK,CAAC,aAAa,CAAmD,IAAI,CAAC,CAC5E,CAAC;AACJ,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,oBAAoB,CAElC,OAAsD;IACtD,MAAM,gBAAgB,GAAG,sBAAsB,EAAgB,CAAC;IAShE,MAAM,EACJ,uBAAuB,EACvB,sBAAsB,EACtB,0BAA0B,GAC3B,GAAG,wBAAwB,CAAC,EAAC,GAAG,OAAO,EAAC,CAAC,CAAC;IAC3C,OAAO;QACL,SAAS,EAAE,eAAe,CAAC,gBAAgB,CAAC;QAC5C,WAAW,EAAE,oBAAoB,CAAC,gBAAgB,EAAE,OAAO,CAAC,WAAW,CAAC;QACxE,uBAAuB,EAAE;YACvB,GAAG,uBAAuB;YAC1B,mBAAmB,EAAE,wBAAwB,CAC3C,gBAAkC,CACnC;YAED,qBAAqB,EAAE,0BAA0B,CAC/C,gBAAkC,CACnC;SACF;QACD,sBAAsB,EAAE;YACtB,GAAG,sBAAsB;YACzB,mBAAmB,EAAE,wBAAwB,CAC3C,gBAAiC,CAClC;YACD,qBAAqB,EAAE,0BAA0B,CAC/C,gBAAiC,CAClC;SACF;QACD,0BAA0B,EAAE;YAC1B,GAAG,0BAA0B;YAC7B,mBAAmB,EAAE,wBAAwB,CAC3C,gBAAqC,CACtC;YACD,qBAAqB,EAAE,0BAA0B,CAC/C,gBAAqC,CACtC;SACF;KACF,CAAC;AACJ,CAAC"}
|
@@ -1,13 +1,13 @@
|
|
1
|
-
import { Controller, ControllerDefinitionsMap,
|
1
|
+
import { Controller, ControllerDefinitionsMap, InferControllerStaticStateMapFromDefinitionsWithSolutionType, InferControllersMapFromDefinition, SolutionType, CommerceEngine as SSRCommerceEngine } from '@coveo/headless/ssr-commerce';
|
2
2
|
import { Context, PropsWithChildren } from 'react';
|
3
3
|
import { SingletonGetter } from '../utils.js';
|
4
4
|
import { ContextState, InferControllerHooksMapFromDefinition } from './types.js';
|
5
|
-
export declare function buildControllerHooks<
|
6
|
-
export declare function buildEngineHook<
|
7
|
-
export declare function buildStaticStateProvider<
|
5
|
+
export declare function buildControllerHooks<TControllers extends ControllerDefinitionsMap<Controller>, TSolutionType extends SolutionType>(singletonContext: SingletonGetter<Context<ContextState<TControllers, TSolutionType> | null>>, controllersMap?: TControllers): InferControllerHooksMapFromDefinition<TControllers>;
|
6
|
+
export declare function buildEngineHook<TControllers extends ControllerDefinitionsMap<Controller>, TSolutionType extends SolutionType>(singletonContext: SingletonGetter<Context<ContextState<TControllers, TSolutionType> | null>>): () => SSRCommerceEngine | undefined;
|
7
|
+
export declare function buildStaticStateProvider<TControllers extends ControllerDefinitionsMap<Controller>, TSolutionType extends SolutionType>(singletonContext: SingletonGetter<Context<ContextState<TControllers, TSolutionType> | null>>): ({ controllers, children, }: PropsWithChildren<{
|
8
8
|
controllers: InferControllerStaticStateMapFromDefinitionsWithSolutionType<TControllers, TSolutionType>;
|
9
9
|
}>) => import("react/jsx-runtime").JSX.Element;
|
10
|
-
export declare function buildHydratedStateProvider<
|
11
|
-
engine:
|
10
|
+
export declare function buildHydratedStateProvider<TControllers extends ControllerDefinitionsMap<Controller>, TSolutionType extends SolutionType>(singletonContext: SingletonGetter<Context<ContextState<TControllers, TSolutionType> | null>>): ({ engine, controllers, children, }: PropsWithChildren<{
|
11
|
+
engine: SSRCommerceEngine;
|
12
12
|
controllers: InferControllersMapFromDefinition<TControllers, TSolutionType>;
|
13
13
|
}>) => import("react/jsx-runtime").JSX.Element;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/ssr-commerce/common.tsx"],"names":[],"mappings":";AASA,OAAO,EACL,UAAU,EACV,WAAW,EACX,OAAO,GAGR,MAAM,OAAO,CAAC;AACf,OAAO,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAC,0BAA0B,EAAC,MAAM,cAAc,CAAC;AACxD,OAAO,EAAkB,UAAU,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC;AAQnE,SAAS,sBAAsB,
|
1
|
+
{"version":3,"file":"common.js","sourceRoot":"","sources":["../../src/ssr-commerce/common.tsx"],"names":[],"mappings":";AASA,OAAO,EACL,UAAU,EACV,WAAW,EACX,OAAO,GAGR,MAAM,OAAO,CAAC;AACf,OAAO,EAAC,oBAAoB,EAAC,MAAM,oBAAoB,CAAC;AACxD,OAAO,EAAC,0BAA0B,EAAC,MAAM,cAAc,CAAC;AACxD,OAAO,EAAkB,UAAU,EAAE,SAAS,EAAC,MAAM,aAAa,CAAC;AAQ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,OAAO,CAAC,EACN,MAAM,EACN,WAAW,EACX,QAAQ,GAIR,EAAE,EAAE;QACJ,MAAM,EAAC,QAAQ,EAAC,GAAG,gBAAgB,CAAC,GAAG,EAAE,CAAC;QAC1C,OAAO,KAAC,QAAQ,IAAC,KAAK,EAAE,EAAC,MAAM,EAAE,WAAW,EAAC,YAAG,QAAQ,GAAY,CAAC;IACvE,CAAC,CAAC;AACJ,CAAC"}
|
@@ -1,28 +1,28 @@
|
|
1
|
-
import { Controller, ControllerDefinitionsMap, InferControllerFromDefinition, InferControllersMapFromDefinition, InferControllerStaticStateMapFromDefinitionsWithSolutionType, EngineDefinition, SolutionType,
|
1
|
+
import { Controller, ControllerDefinitionsMap, InferControllerFromDefinition, InferControllersMapFromDefinition, InferControllerStaticStateMapFromDefinitionsWithSolutionType, EngineDefinition, SolutionType, CommerceEngine as SSRCommerceEngine } from '@coveo/headless/ssr-commerce';
|
2
2
|
import { FunctionComponent, PropsWithChildren } from 'react';
|
3
|
-
export type ContextStaticState<
|
3
|
+
export type ContextStaticState<TControllers extends ControllerDefinitionsMap<Controller>, TSolutionType extends SolutionType> = {
|
4
4
|
controllers: InferControllerStaticStateMapFromDefinitionsWithSolutionType<TControllers, TSolutionType>;
|
5
5
|
};
|
6
|
-
export type ContextHydratedState<
|
7
|
-
engine:
|
6
|
+
export type ContextHydratedState<TControllers extends ControllerDefinitionsMap<Controller>, TSolutionType extends SolutionType> = {
|
7
|
+
engine: SSRCommerceEngine;
|
8
8
|
controllers: InferControllersMapFromDefinition<TControllers, TSolutionType>;
|
9
9
|
};
|
10
|
-
export type ContextState<
|
10
|
+
export type ContextState<TControllers extends ControllerDefinitionsMap<Controller>, TSolutionType extends SolutionType> = ContextStaticState<TControllers, TSolutionType> | ContextHydratedState<TControllers, TSolutionType>;
|
11
11
|
export type ControllerHook<TController extends Controller> = () => {
|
12
12
|
state: TController['state'];
|
13
13
|
methods?: Omit<TController, 'state' | 'subscribe'>;
|
14
14
|
};
|
15
|
-
export type InferControllerHooksMapFromDefinition<TControllers extends ControllerDefinitionsMap<
|
15
|
+
export type InferControllerHooksMapFromDefinition<TControllers extends ControllerDefinitionsMap<Controller>> = {
|
16
16
|
[K in keyof TControllers as `use${Capitalize<K extends string ? K : never>}`]: ControllerHook<InferControllerFromDefinition<TControllers[K]>>;
|
17
17
|
};
|
18
|
-
export type ReactEngineDefinition<
|
18
|
+
export type ReactEngineDefinition<TControllers extends ControllerDefinitionsMap<Controller>, TEngineOptions, TSolutionType extends SolutionType> = EngineDefinition<TControllers, TEngineOptions, TSolutionType> & {
|
19
19
|
controllers: InferControllerHooksMapFromDefinition<TControllers>;
|
20
|
-
useEngine():
|
20
|
+
useEngine(): SSRCommerceEngine | undefined;
|
21
21
|
StaticStateProvider: FunctionComponent<PropsWithChildren<{
|
22
22
|
controllers: InferControllerStaticStateMapFromDefinitionsWithSolutionType<TControllers, TSolutionType>;
|
23
23
|
}>>;
|
24
24
|
HydratedStateProvider: FunctionComponent<PropsWithChildren<{
|
25
|
-
engine:
|
25
|
+
engine: SSRCommerceEngine;
|
26
26
|
controllers: InferControllersMapFromDefinition<TControllers, TSolutionType>;
|
27
27
|
}>>;
|
28
28
|
};
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@coveo/headless-react",
|
3
|
-
"version": "2.1.
|
3
|
+
"version": "2.1.2-pre.195b9ac516",
|
4
4
|
"description": "React utilities for SSR (Server Side Rendering) with headless",
|
5
5
|
"homepage": "https://docs.coveo.com/en/headless/latest/",
|
6
6
|
"repository": {
|
@@ -34,7 +34,7 @@
|
|
34
34
|
"promote:npm:latest": "npm run-script -w=@coveo/release promote-npm-prod"
|
35
35
|
},
|
36
36
|
"dependencies": {
|
37
|
-
"@coveo/headless": "3.
|
37
|
+
"@coveo/headless": "3.10.0-pre.195b9ac516"
|
38
38
|
},
|
39
39
|
"devDependencies": {
|
40
40
|
"@coveo/release": "1.0.0",
|