@coveo/platform-client 45.0.0 → 45.2.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/cjs/resources/Search/Search.js +22 -0
- package/dist/cjs/resources/Search/Search.js.map +1 -1
- package/dist/esm/resources/Search/Search.js +22 -0
- package/dist/esm/resources/Search/Search.js.map +1 -1
- package/dist/types/resources/MachineLearning/MachineLearningInterfaces.d.ts +10 -1
- package/dist/types/resources/Search/Search.d.ts +12 -1
- package/dist/types/resources/Search/SearchInterfaces.d.ts +6 -0
- package/package.json +5 -5
|
@@ -33,6 +33,19 @@ class Search extends Resource_js_1.default {
|
|
|
33
33
|
viewAllContent: viewAllContent ? 1 : undefined,
|
|
34
34
|
}), bodyParameters);
|
|
35
35
|
}
|
|
36
|
+
/**
|
|
37
|
+
* Exports search results to a Microsoft Excel™ spreadsheet
|
|
38
|
+
*
|
|
39
|
+
* @param restQueryParameters Parameters of the query
|
|
40
|
+
* @returns A .xlsx file containing the search results of the specified query
|
|
41
|
+
*/
|
|
42
|
+
exportQuery(restQueryParameters) {
|
|
43
|
+
const { viewAllContent, ...bodyParameters } = restQueryParameters;
|
|
44
|
+
return this.api.post(this.buildPath(Search.baseUrl, {
|
|
45
|
+
organizationId: this.api.organizationId,
|
|
46
|
+
viewAllContent: viewAllContent ? 1 : undefined,
|
|
47
|
+
}), { ...bodyParameters, format: 'xlsx' }, { responseBodyFormat: 'blob' });
|
|
48
|
+
}
|
|
36
49
|
querySuggestPost(restQuerySuggestParameters) {
|
|
37
50
|
return this.api.post(this.buildPath(`${Search.baseUrl}/querySuggest`, {
|
|
38
51
|
organizationId: this.api.organizationId,
|
|
@@ -47,6 +60,15 @@ class Search extends Resource_js_1.default {
|
|
|
47
60
|
organizationId: params.organizationId ?? this.api.organizationId,
|
|
48
61
|
}), { responseBodyFormat: 'text' });
|
|
49
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* Get item in JSON format
|
|
65
|
+
*/
|
|
66
|
+
getDocument(params) {
|
|
67
|
+
return this.api.get(this.buildPath(`${Search.baseUrl}/document`, {
|
|
68
|
+
...params,
|
|
69
|
+
organizationId: params.organizationId ?? this.api.organizationId,
|
|
70
|
+
}));
|
|
71
|
+
}
|
|
50
72
|
}
|
|
51
73
|
exports.default = Search;
|
|
52
74
|
//# sourceMappingURL=Search.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../../../src/resources/Search/Search.ts"],"names":[],"mappings":";;;;;AACA,kEAAmC;AACnC,iEAAuC;
|
|
1
|
+
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../../../src/resources/Search/Search.ts"],"names":[],"mappings":";;;;;AACA,kEAAmC;AACnC,iEAAuC;AAavC,MAAqB,MAAO,SAAQ,qBAAS;IACzC,MAAM,CAAC,OAAO,GAAG,iBAAiB,CAAC;IAEnC,WAAW,CAAC,WAA4B;QACpC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAa,GAAG,MAAM,CAAC,OAAO,yBAAyB,oBAAG,CAAC,cAAc,EAAE,EAAE,WAAW,CAAC,CAAC;IAClH,CAAC;IAED,UAAU,CAAC,MAA+B;QACtC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,SAAS,EAAE;YACvC,GAAG,MAAM;YACT,cAAc,EAAE,MAAM,EAAE,cAAc,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc;SACpE,CAAC,CACL,CAAC;IACN,CAAC;IAED,cAAc,CAAC,SAAiB,EAAE,MAAuC;QACrE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,SAAS,EAAE;YACvC,KAAK,EAAE,SAAS,CAAC,GAAG,SAAS,EAAE,CAAC;YAChC,GAAG,MAAM;YACT,cAAc,EAAE,MAAM,EAAE,c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GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,OAAO,EAAE;YACrC,GAAG,MAAM;YACT,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc;SACnE,CAAC,EACF,EAAC,kBAAkB,EAAE,MAAM,EAAC,CAC/B,CAAC;IACN,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,MAA4B;QACpC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,WAAW,EAAE;YACzC,GAAG,MAAM;YACT,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc;SACnE,CAAC,CACL,CAAC;IACN,CAAC;;AA5FL,yBA6FC"}
|
|
@@ -28,6 +28,19 @@ export default class Search extends Ressource {
|
|
|
28
28
|
viewAllContent: viewAllContent ? 1 : undefined,
|
|
29
29
|
}), bodyParameters);
|
|
30
30
|
}
|
|
31
|
+
/**
|
|
32
|
+
* Exports search results to a Microsoft Excel™ spreadsheet
|
|
33
|
+
*
|
|
34
|
+
* @param restQueryParameters Parameters of the query
|
|
35
|
+
* @returns A .xlsx file containing the search results of the specified query
|
|
36
|
+
*/
|
|
37
|
+
exportQuery(restQueryParameters) {
|
|
38
|
+
const { viewAllContent, ...bodyParameters } = restQueryParameters;
|
|
39
|
+
return this.api.post(this.buildPath(Search.baseUrl, {
|
|
40
|
+
organizationId: this.api.organizationId,
|
|
41
|
+
viewAllContent: viewAllContent ? 1 : undefined,
|
|
42
|
+
}), { ...bodyParameters, format: 'xlsx' }, { responseBodyFormat: 'blob' });
|
|
43
|
+
}
|
|
31
44
|
querySuggestPost(restQuerySuggestParameters) {
|
|
32
45
|
return this.api.post(this.buildPath(`${Search.baseUrl}/querySuggest`, {
|
|
33
46
|
organizationId: this.api.organizationId,
|
|
@@ -42,5 +55,14 @@ export default class Search extends Ressource {
|
|
|
42
55
|
organizationId: params.organizationId ?? this.api.organizationId,
|
|
43
56
|
}), { responseBodyFormat: 'text' });
|
|
44
57
|
}
|
|
58
|
+
/**
|
|
59
|
+
* Get item in JSON format
|
|
60
|
+
*/
|
|
61
|
+
getDocument(params) {
|
|
62
|
+
return this.api.get(this.buildPath(`${Search.baseUrl}/document`, {
|
|
63
|
+
...params,
|
|
64
|
+
organizationId: params.organizationId ?? this.api.organizationId,
|
|
65
|
+
}));
|
|
66
|
+
}
|
|
45
67
|
}
|
|
46
68
|
//# sourceMappingURL=Search.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../../../src/resources/Search/Search.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,kBAAkB,CAAC;AACnC,OAAO,SAAS,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"Search.js","sourceRoot":"","sources":["../../../../src/resources/Search/Search.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,MAAM,kBAAkB,CAAC;AACnC,OAAO,SAAS,MAAM,gBAAgB,CAAC;AAavC,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,SAAS;IACzC,MAAM,CAAC,OAAO,GAAG,iBAAiB,CAAC;IAEnC,WAAW,CAAC,WAA4B;QACpC,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAAa,GAAG,MAAM,CAAC,OAAO,yBAAyB,GAAG,CAAC,cAAc,EAAE,EAAE,WAAW,CAAC,CAAC;IAClH,CAAC;IAED,UAAU,CAAC,MAA+B;QACtC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,SAAS,EAAE;YACvC,GAAG,MAAM;YACT,cAAc,EAAE,MAAM,EAAE,cAAc,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc;SACpE,CAAC,CACL,CAAC;IACN,CAAC;IAED,cAAc,CAAC,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AI,CAChB,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,eAAe,EAAE;YAC7C,cAAc,EAAE,IAAI,CAAC,GAAG,CAAC,cAAc;SAC1C,CAAC,EACF,0BAA0B,CAC7B,CAAC;IACN,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,MAAiC;QACzC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,OAAO,EAAE;YACrC,GAAG,MAAM;YACT,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc;SACnE,CAAC,EACF,EAAC,kBAAkB,EAAE,MAAM,EAAC,CAC/B,CAAC;IACN,CAAC;IAED;;OAEG;IACH,WAAW,CAAC,MAA4B;QACpC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,WAAW,EAAE;YACzC,GAAG,MAAM;YACT,cAAc,EAAE,MAAM,CAAC,cAAc,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc;SACnE,CAAC,CACL,CAAC;IACN,CAAC"}
|
|
@@ -11,13 +11,20 @@ export interface UrlReplacePatterns {
|
|
|
11
11
|
}
|
|
12
12
|
export interface PageViewFiltered {
|
|
13
13
|
contentType: {
|
|
14
|
-
|
|
14
|
+
values: string[];
|
|
15
15
|
};
|
|
16
16
|
}
|
|
17
17
|
export interface CommerceSupport {
|
|
18
18
|
enabled: boolean;
|
|
19
19
|
[key: string]: any;
|
|
20
20
|
}
|
|
21
|
+
export interface IndexExport {
|
|
22
|
+
query: string;
|
|
23
|
+
}
|
|
24
|
+
export interface DocumentContentSource {
|
|
25
|
+
objectType: string;
|
|
26
|
+
sourceLocations: string[];
|
|
27
|
+
}
|
|
21
28
|
export interface ExtraConfig {
|
|
22
29
|
recommendedContentTypeFilter?: string[];
|
|
23
30
|
eventConfigsTemplates?: string[];
|
|
@@ -35,6 +42,8 @@ export interface ExtraConfig {
|
|
|
35
42
|
recommendationStrategy?: string;
|
|
36
43
|
urlReplacePatterns?: UrlReplacePatterns[];
|
|
37
44
|
parsingMode?: string;
|
|
45
|
+
documentContentSources?: DocumentContentSource[];
|
|
46
|
+
indexExport?: IndexExport;
|
|
38
47
|
[key: string]: any;
|
|
39
48
|
}
|
|
40
49
|
export interface RegistrationModel extends GranularResource {
|
|
@@ -1,15 +1,26 @@
|
|
|
1
1
|
import { ListFieldValuesBodyQueryParams, PostSearchQuerySuggestBodyParams } from './index.js';
|
|
2
2
|
import Ressource from '../Resource.js';
|
|
3
|
-
import { ItemPreviewHtmlParameters, RestQueryParams, RestTokenParams, SearchListFieldsParams, SearchListFieldsResponse, SearchResponse, TokenModel } from './SearchInterfaces.js';
|
|
3
|
+
import { SingleItemParameters, ItemPreviewHtmlParameters, RestQueryParams, RestQueryResult, RestTokenParams, SearchListFieldsParams, SearchListFieldsResponse, SearchResponse, TokenModel } from './SearchInterfaces.js';
|
|
4
4
|
export default class Search extends Ressource {
|
|
5
5
|
static baseUrl: string;
|
|
6
6
|
createToken(tokenParams: RestTokenParams): Promise<TokenModel>;
|
|
7
7
|
listFields(params?: SearchListFieldsParams): Promise<SearchListFieldsResponse>;
|
|
8
8
|
getFieldValues(fieldName: string, params?: ListFieldValuesBodyQueryParams): Promise<any>;
|
|
9
9
|
query(restQueryParameters: RestQueryParams): Promise<SearchResponse>;
|
|
10
|
+
/**
|
|
11
|
+
* Exports search results to a Microsoft Excel™ spreadsheet
|
|
12
|
+
*
|
|
13
|
+
* @param restQueryParameters Parameters of the query
|
|
14
|
+
* @returns A .xlsx file containing the search results of the specified query
|
|
15
|
+
*/
|
|
16
|
+
exportQuery(restQueryParameters: RestQueryParams): Promise<Blob>;
|
|
10
17
|
querySuggestPost(restQuerySuggestParameters: PostSearchQuerySuggestBodyParams): Promise<any>;
|
|
11
18
|
/**
|
|
12
19
|
* Get an item's preview in HTML format
|
|
13
20
|
*/
|
|
14
21
|
previewHTML(params: ItemPreviewHtmlParameters): Promise<string>;
|
|
22
|
+
/**
|
|
23
|
+
* Get item in JSON format
|
|
24
|
+
*/
|
|
25
|
+
getDocument(params: SingleItemParameters): Promise<RestQueryResult>;
|
|
15
26
|
}
|
|
@@ -2651,4 +2651,10 @@ export interface SearchResponse {
|
|
|
2651
2651
|
*/
|
|
2652
2652
|
[key: string]: unknown;
|
|
2653
2653
|
}
|
|
2654
|
+
export interface SingleItemParameters extends PostSearchQueryStringParams {
|
|
2655
|
+
/**
|
|
2656
|
+
* The unique ID of the document.
|
|
2657
|
+
*/
|
|
2658
|
+
uniqueId: string;
|
|
2659
|
+
}
|
|
2654
2660
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coveo/platform-client",
|
|
3
|
-
"version": "45.
|
|
3
|
+
"version": "45.2.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -32,17 +32,17 @@
|
|
|
32
32
|
"prepare": "husky install"
|
|
33
33
|
},
|
|
34
34
|
"devDependencies": {
|
|
35
|
-
"@commitlint/cli": "17.6.
|
|
36
|
-
"@commitlint/config-conventional": "17.6.
|
|
35
|
+
"@commitlint/cli": "17.6.7",
|
|
36
|
+
"@commitlint/config-conventional": "17.6.7",
|
|
37
37
|
"@types/jest": "29.5.3",
|
|
38
38
|
"@typescript-eslint/eslint-plugin": "5.62.0",
|
|
39
39
|
"@typescript-eslint/parser": "5.62.0",
|
|
40
40
|
"abortcontroller-polyfill": "1.7.5",
|
|
41
41
|
"cz-conventional-changelog": "3.3.0",
|
|
42
|
-
"eslint": "8.
|
|
42
|
+
"eslint": "8.45.0",
|
|
43
43
|
"eslint-config-prettier": "8.8.0",
|
|
44
44
|
"eslint-config-typescript": "3.0.0",
|
|
45
|
-
"eslint-plugin-jest": "27.2.
|
|
45
|
+
"eslint-plugin-jest": "27.2.3",
|
|
46
46
|
"eslint-plugin-prettier": "4.2.1",
|
|
47
47
|
"husky": "8.0.3",
|
|
48
48
|
"jest": "29.6.1",
|