@coveo/platform-client 44.11.2 → 45.1.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/Search/Search.d.ts +13 -2
- package/dist/types/resources/Search/SearchInterfaces.d.ts +474 -0
- package/package.json +6 -6
|
@@ -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,cAAc,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc;SACpE,C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AAG,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,SAAiB,EAAE,MAAuC;QACrE,OAAO,IAAI,CAAC,GAA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AC,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"}
|
|
@@ -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, 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
|
-
query(restQueryParameters: RestQueryParams
|
|
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
|
}
|
|
@@ -2183,4 +2183,478 @@ export interface ItemPreviewHtmlParameters extends PostSearchQueryStringParams {
|
|
|
2183
2183
|
*/
|
|
2184
2184
|
requestedOutputSize?: number;
|
|
2185
2185
|
}
|
|
2186
|
+
export interface RestCategoryFacetValue {
|
|
2187
|
+
numberOfResults?: number[];
|
|
2188
|
+
value?: string;
|
|
2189
|
+
}
|
|
2190
|
+
export interface RestCategoryFacetResponse {
|
|
2191
|
+
field?: string;
|
|
2192
|
+
parentValues?: RestCategoryFacetValue[];
|
|
2193
|
+
values?: RestCategoryFacetValue[];
|
|
2194
|
+
}
|
|
2195
|
+
export interface RestHierarchicalFacetResponseValue {
|
|
2196
|
+
/**
|
|
2197
|
+
* The number of query results that can be expected if the facet value is selected in the search interface.
|
|
2198
|
+
*
|
|
2199
|
+
* Note: This property only gets populated when the facet currently has no selected or excluded values.
|
|
2200
|
+
*/
|
|
2201
|
+
numberOfResults: number;
|
|
2202
|
+
path: string[];
|
|
2203
|
+
/**
|
|
2204
|
+
* The current facet value state in the search interface.
|
|
2205
|
+
*
|
|
2206
|
+
* @default 'idle'
|
|
2207
|
+
*/
|
|
2208
|
+
state: 'idle' | 'selected' | 'excluded';
|
|
2209
|
+
/**
|
|
2210
|
+
* The facet value name.
|
|
2211
|
+
*
|
|
2212
|
+
* Note: In the case of a hierarchical facet value, this represents a single path segment.
|
|
2213
|
+
*/
|
|
2214
|
+
value: string;
|
|
2215
|
+
/**
|
|
2216
|
+
* The children of this hierarchical facet value.
|
|
2217
|
+
*
|
|
2218
|
+
* Each child is a full-fledged hierarchical facet value that may in turn have its own children and so forth, up to a maximum depth of 50 levels.
|
|
2219
|
+
*/
|
|
2220
|
+
children?: RestHierarchicalFacetResponseValue[];
|
|
2221
|
+
/**
|
|
2222
|
+
* Whether the facet value was automatically selected by Coveo ML.
|
|
2223
|
+
*/
|
|
2224
|
+
isAutoSelected?: boolean;
|
|
2225
|
+
/**
|
|
2226
|
+
* Whether the hierarchical value is a childless node.
|
|
2227
|
+
*/
|
|
2228
|
+
isLeafValue?: boolean;
|
|
2229
|
+
/**
|
|
2230
|
+
* Whether additional values are available for the facet.
|
|
2231
|
+
*/
|
|
2232
|
+
moreValuesAvailable?: boolean;
|
|
2233
|
+
}
|
|
2234
|
+
export interface RestFacetResultValue extends RestHierarchicalFacetResponseValue {
|
|
2235
|
+
/**
|
|
2236
|
+
* The end of the range.
|
|
2237
|
+
*/
|
|
2238
|
+
end?: string | number;
|
|
2239
|
+
/**
|
|
2240
|
+
* Whether to include the `end` value in the range.
|
|
2241
|
+
*
|
|
2242
|
+
* @default false
|
|
2243
|
+
*/
|
|
2244
|
+
endInclusive?: boolean;
|
|
2245
|
+
isSuggested?: boolean;
|
|
2246
|
+
/**
|
|
2247
|
+
* The start of the range.
|
|
2248
|
+
*/
|
|
2249
|
+
start?: string | number;
|
|
2250
|
+
}
|
|
2251
|
+
export interface RestFacetResult {
|
|
2252
|
+
/**
|
|
2253
|
+
* The name of the field on which the facet is based.
|
|
2254
|
+
*
|
|
2255
|
+
* @example 'author'
|
|
2256
|
+
*/
|
|
2257
|
+
field: string;
|
|
2258
|
+
/**
|
|
2259
|
+
* The ranking score computed by the index for this facet.
|
|
2260
|
+
*/
|
|
2261
|
+
indexScore: number;
|
|
2262
|
+
/**
|
|
2263
|
+
* Whether additional values are available for the facet.
|
|
2264
|
+
*/
|
|
2265
|
+
moreValuesAvailable: boolean;
|
|
2266
|
+
/**
|
|
2267
|
+
* The returned facet values
|
|
2268
|
+
*/
|
|
2269
|
+
values: RestFacetResultValue[];
|
|
2270
|
+
/**
|
|
2271
|
+
* Whether the facet was recommended by Coveo ML.
|
|
2272
|
+
*/
|
|
2273
|
+
isFromAutoSelect?: boolean;
|
|
2274
|
+
/**
|
|
2275
|
+
* The ranking score computed by Coveo ML DNE for this facet.
|
|
2276
|
+
*/
|
|
2277
|
+
mlScore?: number;
|
|
2278
|
+
}
|
|
2279
|
+
export interface RestGroupByValue {
|
|
2280
|
+
/**
|
|
2281
|
+
* The results of the computed fields (see the computedFields Group By parameter).
|
|
2282
|
+
*/
|
|
2283
|
+
computedFieldResults: number[];
|
|
2284
|
+
/**
|
|
2285
|
+
* The number of query result items having this field value.
|
|
2286
|
+
*/
|
|
2287
|
+
numberOfResults: number;
|
|
2288
|
+
/**
|
|
2289
|
+
* The Group By value score, computed from the numberOfResults value as well as from the position of the items having this value in the ranked query result set.
|
|
2290
|
+
*/
|
|
2291
|
+
score: number;
|
|
2292
|
+
/**
|
|
2293
|
+
* The Group By value name.
|
|
2294
|
+
*/
|
|
2295
|
+
value: string;
|
|
2296
|
+
/**
|
|
2297
|
+
* The type of Group By value.
|
|
2298
|
+
*/
|
|
2299
|
+
valueType: string;
|
|
2300
|
+
}
|
|
2301
|
+
export interface RestGroupByResult {
|
|
2302
|
+
/**
|
|
2303
|
+
* The field on which the Group By operation was executed.
|
|
2304
|
+
*/
|
|
2305
|
+
field: string;
|
|
2306
|
+
/**
|
|
2307
|
+
* The global computed fields that were processed by the index.
|
|
2308
|
+
*/
|
|
2309
|
+
globalComputedFieldResults: number[];
|
|
2310
|
+
/**
|
|
2311
|
+
* The resulting Group By values.
|
|
2312
|
+
*/
|
|
2313
|
+
values: RestGroupByValue[];
|
|
2314
|
+
}
|
|
2315
|
+
export interface RestWordCorrection {
|
|
2316
|
+
/**
|
|
2317
|
+
* The suggested word correction.
|
|
2318
|
+
*/
|
|
2319
|
+
correctedWord: string;
|
|
2320
|
+
/**
|
|
2321
|
+
* The length (in number of characters) of the corrected word.
|
|
2322
|
+
*/
|
|
2323
|
+
length: number;
|
|
2324
|
+
/**
|
|
2325
|
+
* The offset (in number of characters) of the corrected word, from the beginning of the resulting query expression correction suggestion.
|
|
2326
|
+
*/
|
|
2327
|
+
offset: number;
|
|
2328
|
+
/**
|
|
2329
|
+
* The original, un-corrected word.
|
|
2330
|
+
*/
|
|
2331
|
+
originalWord: string;
|
|
2332
|
+
}
|
|
2333
|
+
export interface RestQueryCorrection {
|
|
2334
|
+
/**
|
|
2335
|
+
* The resulting query expression correction suggestion.
|
|
2336
|
+
*/
|
|
2337
|
+
correctedQuery: string;
|
|
2338
|
+
/**
|
|
2339
|
+
* The word correction suggestions.
|
|
2340
|
+
*/
|
|
2341
|
+
wordCorrections: RestWordCorrection[];
|
|
2342
|
+
}
|
|
2343
|
+
export interface RestHighlightResponse {
|
|
2344
|
+
/**
|
|
2345
|
+
* The length (in number of characters) of the word to highlight.
|
|
2346
|
+
*/
|
|
2347
|
+
length: number;
|
|
2348
|
+
/**
|
|
2349
|
+
* The 0-based index position of the first character of the word to highlight in the string.
|
|
2350
|
+
*/
|
|
2351
|
+
offset: number;
|
|
2352
|
+
}
|
|
2353
|
+
export interface RestQueryResult {
|
|
2354
|
+
/**
|
|
2355
|
+
* The basic query expression terms which this query result item does not match.
|
|
2356
|
+
*
|
|
2357
|
+
* Note: This property is populated by terms from the query pipeline-processed `q` value (not from the original `q` value).
|
|
2358
|
+
*/
|
|
2359
|
+
absentTerms: string[];
|
|
2360
|
+
/**
|
|
2361
|
+
* An array of references to the children of this item, if result folding was applied (see the `filterField` query parameter). The query results contained in this field will have both their parent and child results set to `null`.
|
|
2362
|
+
*/
|
|
2363
|
+
childResults: RestQueryResult[];
|
|
2364
|
+
/**
|
|
2365
|
+
* The hyperlinkable item URI.
|
|
2366
|
+
*
|
|
2367
|
+
* Notes:
|
|
2368
|
+
* - Use the `clickUri` value when you want to create hyperlinks to the item, rather than the `uri` or `printableUri` value.
|
|
2369
|
+
* - The `clickUri` value is not necessarily unique for each item.
|
|
2370
|
+
*/
|
|
2371
|
+
clickUri: string;
|
|
2372
|
+
/**
|
|
2373
|
+
* The contextual excerpt generated for the item (see the excerptLength query parameter).
|
|
2374
|
+
*/
|
|
2375
|
+
excerpt: string;
|
|
2376
|
+
/**
|
|
2377
|
+
* The length and offset of each word to highlight in the item `excerpt` string.
|
|
2378
|
+
*/
|
|
2379
|
+
excerptHighlights: RestHighlightResponse[];
|
|
2380
|
+
/**
|
|
2381
|
+
* The first sentences retrieved from the item (see the `retrieveFirstSentences` query parameter).
|
|
2382
|
+
*/
|
|
2383
|
+
firstSentences: string;
|
|
2384
|
+
/**
|
|
2385
|
+
* The length and offset of each word to highlight in the item `firstSentences` string.
|
|
2386
|
+
*/
|
|
2387
|
+
firstSentencesHighlights: RestHighlightResponse[];
|
|
2388
|
+
/**
|
|
2389
|
+
* The flags that are set on the item by the index. Distinct values are separated by semicolons.
|
|
2390
|
+
*/
|
|
2391
|
+
flags: string;
|
|
2392
|
+
/**
|
|
2393
|
+
* Whether the index contains an HTML version of this item.
|
|
2394
|
+
*/
|
|
2395
|
+
hasHtmlVersion: boolean;
|
|
2396
|
+
/**
|
|
2397
|
+
* Whether the index contains a mobile HTML version of this item.
|
|
2398
|
+
*/
|
|
2399
|
+
hasMobileHtmlVersion: boolean;
|
|
2400
|
+
/**
|
|
2401
|
+
* Whether the item score was boosted as a Coveo ML recommendation.
|
|
2402
|
+
*/
|
|
2403
|
+
isRecommendation: boolean;
|
|
2404
|
+
/**
|
|
2405
|
+
* Whether the item score was boosted by a featured result rule in the query pipeline.
|
|
2406
|
+
*/
|
|
2407
|
+
isTopResult: boolean;
|
|
2408
|
+
/**
|
|
2409
|
+
* Whether the item score was boosted as a Coveo ML recommendation.
|
|
2410
|
+
*/
|
|
2411
|
+
isUserActionView: boolean;
|
|
2412
|
+
parentResult: RestQueryResult;
|
|
2413
|
+
/**
|
|
2414
|
+
* The item ranking score expressed as a percentage (see the `sortCriteria` and `rankingFunctions` query parameters).
|
|
2415
|
+
*/
|
|
2416
|
+
percentScore: number;
|
|
2417
|
+
/**
|
|
2418
|
+
* The human readable item URI.
|
|
2419
|
+
*
|
|
2420
|
+
* Note: Avoid using the `printableUri` value to create hyperlinks to the item. Use the `clickUri` value instead.
|
|
2421
|
+
*/
|
|
2422
|
+
printableUri: string;
|
|
2423
|
+
/**
|
|
2424
|
+
* The length and offset of each word to highlight in the item printableUri string.
|
|
2425
|
+
*/
|
|
2426
|
+
printableUriHighlights: RestHighlightResponse[];
|
|
2427
|
+
/**
|
|
2428
|
+
* The raw debug information generated by the index to detail how the item was ranked. This property is `null` unless the `debug` query parameter is set to `true`.
|
|
2429
|
+
*/
|
|
2430
|
+
rankingInfo: string;
|
|
2431
|
+
/**
|
|
2432
|
+
* The item rating (see the enableCollaborativeRating query parameter).
|
|
2433
|
+
*
|
|
2434
|
+
* Note: Unless collaborative rating is enabled for your index, the value of this property is always 3.
|
|
2435
|
+
*/
|
|
2436
|
+
rating: number;
|
|
2437
|
+
/**
|
|
2438
|
+
* The values of the fields which were retrieved for this item (see the fieldsToInclude and fieldsToExclude query parameters).
|
|
2439
|
+
*/
|
|
2440
|
+
raw: Record<string, any>;
|
|
2441
|
+
/**
|
|
2442
|
+
* The total ranking score computed for the item (see the `sortCriteria` and `rankingFunctions` query parameters).
|
|
2443
|
+
*/
|
|
2444
|
+
score: number;
|
|
2445
|
+
/**
|
|
2446
|
+
* The item summary (see the `summaryLength` query parameter).
|
|
2447
|
+
*/
|
|
2448
|
+
summary: string;
|
|
2449
|
+
/**
|
|
2450
|
+
* The length and offset of each word to highlight in the item `summary` string.
|
|
2451
|
+
*/
|
|
2452
|
+
summaryHighlights: RestHighlightResponse[];
|
|
2453
|
+
/**
|
|
2454
|
+
* The item title.
|
|
2455
|
+
*
|
|
2456
|
+
* Note: When logging a **Click** usage analytics event for an opened query result item, the `documentTitle` field of that event should be set to the `title` value of the opened query result item.
|
|
2457
|
+
*/
|
|
2458
|
+
title: string;
|
|
2459
|
+
/**
|
|
2460
|
+
* The length and offset of each word to highlight in the item title string.
|
|
2461
|
+
*/
|
|
2462
|
+
titleHighlights: RestHighlightResponse[];
|
|
2463
|
+
/**
|
|
2464
|
+
* The total number of children available in the index for this item, if result folding was applied (see the `filterField` query parameter).
|
|
2465
|
+
*/
|
|
2466
|
+
totalNumberOfChildResults: number;
|
|
2467
|
+
/**
|
|
2468
|
+
* The unique item identifier. You should consider the `uniqueId` value as an opaque string.
|
|
2469
|
+
*/
|
|
2470
|
+
uniqueId: string;
|
|
2471
|
+
/**
|
|
2472
|
+
* The item URI.
|
|
2473
|
+
*
|
|
2474
|
+
* Notes:
|
|
2475
|
+
* - Avoid using the `uri` value to create hyperlinks to the item. Use the `clickUri` value instead.
|
|
2476
|
+
* - When logging a **Click** usage analytics event for an opened query result item, the `documentUrl` field of that event should be set to the `uri` value of the opened query result item.
|
|
2477
|
+
*/
|
|
2478
|
+
uri: string;
|
|
2479
|
+
/**
|
|
2480
|
+
* Additional undocumented or deprecated properties that might be sent by the Search API
|
|
2481
|
+
*/
|
|
2482
|
+
[key: string]: unknown;
|
|
2483
|
+
}
|
|
2484
|
+
export interface RestSuggestedFacetValue {
|
|
2485
|
+
/**
|
|
2486
|
+
* A DNE facet value suggestion.
|
|
2487
|
+
*
|
|
2488
|
+
* @example 'Alice Smith'
|
|
2489
|
+
*/
|
|
2490
|
+
value: string;
|
|
2491
|
+
/**
|
|
2492
|
+
* The path to the suggested facet value (only applies to hierarchical facet value suggestions).
|
|
2493
|
+
*
|
|
2494
|
+
* If the suggested hierarchical facet value is `'Parrot'`, the returned path could be `["Animals", "Birds", "Parrot"]`.
|
|
2495
|
+
*/
|
|
2496
|
+
path: string[];
|
|
2497
|
+
}
|
|
2498
|
+
export interface RestSuggestedFacet {
|
|
2499
|
+
/**
|
|
2500
|
+
* The name of the field on which the DNE facet suggestion is based.
|
|
2501
|
+
*
|
|
2502
|
+
* @example 'author'
|
|
2503
|
+
*/
|
|
2504
|
+
field: string;
|
|
2505
|
+
values: RestSuggestedFacetValue[];
|
|
2506
|
+
}
|
|
2507
|
+
export interface RestTriggerResponse {
|
|
2508
|
+
content: Record<string, unknown>;
|
|
2509
|
+
/**
|
|
2510
|
+
* The type of Coveo Cloud query pipeline **Trigger** statement (see [Managing Query Pipeline Triggers](https://docs.coveo.com/en/1550/)).
|
|
2511
|
+
*/
|
|
2512
|
+
type: 'notify' | 'execute' | 'query' | 'redirect';
|
|
2513
|
+
}
|
|
2514
|
+
export interface RestContentId {
|
|
2515
|
+
contentIdKey: string;
|
|
2516
|
+
contentIdValue: string;
|
|
2517
|
+
}
|
|
2518
|
+
export interface RestQuestion {
|
|
2519
|
+
answerSnippet: string;
|
|
2520
|
+
documentId: RestContentId;
|
|
2521
|
+
question: string;
|
|
2522
|
+
score: number;
|
|
2523
|
+
}
|
|
2524
|
+
export interface RestQuestionAnswer extends RestQuestion {
|
|
2525
|
+
allContentIds: RestContentId[];
|
|
2526
|
+
answerFound: boolean;
|
|
2527
|
+
answerId: string;
|
|
2528
|
+
relatedQuestions: RestQuestion[];
|
|
2529
|
+
raw: Record<string, any>;
|
|
2530
|
+
}
|
|
2531
|
+
export interface SearchResponse {
|
|
2532
|
+
/**
|
|
2533
|
+
* The version of the Search API that sent the query.
|
|
2534
|
+
*/
|
|
2535
|
+
apiVersion: number;
|
|
2536
|
+
/**
|
|
2537
|
+
* Hierarchical data results corresponding the to hierarchical data in the query.
|
|
2538
|
+
*/
|
|
2539
|
+
categoryFacets: RestCategoryFacetResponse[];
|
|
2540
|
+
/**
|
|
2541
|
+
* The `requestDuration` added to the computing time (in milliseconds) that was required by the Search API.
|
|
2542
|
+
*/
|
|
2543
|
+
duration: number;
|
|
2544
|
+
/**
|
|
2545
|
+
* The facet results returned by the query. These results are included in the order they were requested in the facets query parameter.
|
|
2546
|
+
*/
|
|
2547
|
+
facets: RestFacetResult[];
|
|
2548
|
+
/**
|
|
2549
|
+
* The Group By results returned by the query. These results are included in the order they were requested in the groupBy query parameter.
|
|
2550
|
+
*/
|
|
2551
|
+
groupByResults: RestGroupByResult[];
|
|
2552
|
+
/**
|
|
2553
|
+
* The identifier of the index mirror against which the query was executed (see the indexToken query parameter).
|
|
2554
|
+
*/
|
|
2555
|
+
index: string;
|
|
2556
|
+
/**
|
|
2557
|
+
* The time (in milliseconds) that was required by the index to find the query items.
|
|
2558
|
+
*/
|
|
2559
|
+
indexDuration: number;
|
|
2560
|
+
/**
|
|
2561
|
+
* The phrases to highlight in each query result item. This property is populated when the basic query expression (see the `q` query parameter) contains one or several exact phrase match requests (terms between double quote characters).
|
|
2562
|
+
*/
|
|
2563
|
+
phrasesToHighlight: Record<string, Record<string, string[]>>;
|
|
2564
|
+
/**
|
|
2565
|
+
* The name of the query pipeline to use for this request (bypassing its conditions, if it has any).
|
|
2566
|
+
*
|
|
2567
|
+
* You can pass an empty `pipeline` value to use an empty query pipeline (i.e., `?pipeline=` or `"pipeline": ""`).
|
|
2568
|
+
*
|
|
2569
|
+
* If a query does not contain the `pipeline` parameter, the first query pipeline whose conditions are met by the request is used (query pipelines without conditions are not evaluated). Should the request fail to meet the conditions of each evaluated query pipeline, the default query pipeline of the target Coveo Cloud organization is used (bypassing its conditions, if it has any).
|
|
2570
|
+
*
|
|
2571
|
+
* Notes:
|
|
2572
|
+
* - This parameter will be overridden if the search request is authenticated by a [search token](https://docs.coveo.com/en/56/) that enforces a specific `pipeline`, or a `searchHub` that routes queries to a specific `pipeline` via a query pipeline condition.
|
|
2573
|
+
* - For reporting purposes, when logging a **Search** usage analytics event for a query, the `queryPipeline` field of that event should be set to the `pipeline` value of the query (or to the `"default"` string, if no `pipeline` value was specified in the query).
|
|
2574
|
+
*
|
|
2575
|
+
* See also [Managing Query Pipelines](https://docs.coveo.com/en/1450/).
|
|
2576
|
+
*/
|
|
2577
|
+
pipeline: string;
|
|
2578
|
+
/**
|
|
2579
|
+
* The query corrections suggested by the index, if the `enableDidYouMean` query parameter was set to `true`.
|
|
2580
|
+
*/
|
|
2581
|
+
queryCorrections: RestQueryCorrection[];
|
|
2582
|
+
/**
|
|
2583
|
+
* The refined keywords used by the Coveo ML automatic relevance tuning model.
|
|
2584
|
+
*/
|
|
2585
|
+
refinedKeywords: string[];
|
|
2586
|
+
/**
|
|
2587
|
+
* The indexDuration added to the time (in milliseconds) that was required to establish a connection between the Search API server and the index server.
|
|
2588
|
+
*/
|
|
2589
|
+
requestDuration: number;
|
|
2590
|
+
/**
|
|
2591
|
+
* The items returned for the query.
|
|
2592
|
+
*/
|
|
2593
|
+
results: RestQueryResult[];
|
|
2594
|
+
/**
|
|
2595
|
+
* The query [UUID](https://en.wikipedia.org/wiki/Universally_unique_identifier). Each query sent to the Search API has its own randomly generated `searchUid`.
|
|
2596
|
+
*
|
|
2597
|
+
* Note: When logging a **Search** or **Custom* usage analytics event for a query, or a **Click** usage analytics event for an opened query result item, the `searchQueryUid` field of that event should be set to the `searchUid` value of the query response.
|
|
2598
|
+
*/
|
|
2599
|
+
searchUid: string;
|
|
2600
|
+
/**
|
|
2601
|
+
* A DNE facet suggestion.
|
|
2602
|
+
*/
|
|
2603
|
+
suggestedFacets: RestSuggestedFacet[];
|
|
2604
|
+
/**
|
|
2605
|
+
* The terms to highlight in each query result item. Includes all basic query expression keywords, as well as any word stemmed from a basic query expression keyword (see the `q` query parameter), unless this keyword was preceded by the no stemming Coveo Cloud query syntax operator (`+`).
|
|
2606
|
+
*/
|
|
2607
|
+
termsToHighlight: Record<string, string[]>;
|
|
2608
|
+
/**
|
|
2609
|
+
* The total number of items matching the query for the current user (security trimming applied).
|
|
2610
|
+
*
|
|
2611
|
+
* Note: When logging a **Search** usage analytics event for a query, the `numberOfResults` field of that event should be set to the `totalCount` value of the query (for reporting purposes).
|
|
2612
|
+
*/
|
|
2613
|
+
totalCount: number;
|
|
2614
|
+
/**
|
|
2615
|
+
* The total number of items matching the query for the current user (security trimming applied) after duplicate filtering has been applied (see the `duplicateFiltering` query parameter).
|
|
2616
|
+
*/
|
|
2617
|
+
totalCountFiltered: number;
|
|
2618
|
+
/**
|
|
2619
|
+
* The actions to perform by the client based on the Trigger statements defined in query pipelines (see the pipeline query parameter).
|
|
2620
|
+
*
|
|
2621
|
+
* Note: A Trigger statement must have a condition. Otherwise, the Search API ignores it and does not include it in the `triggers` array of the query response (see [Managing Query Pipeline Triggers](http://www.coveo.com/go?dest=cloudhelp&lcid=9&context=146)).
|
|
2622
|
+
*/
|
|
2623
|
+
triggers: RestTriggerResponse[];
|
|
2624
|
+
/**
|
|
2625
|
+
* The errors that critically changed the query behaviour. These should be addressed right away to prevent future errors.
|
|
2626
|
+
*/
|
|
2627
|
+
errors?: string[];
|
|
2628
|
+
exception?: {
|
|
2629
|
+
code: string;
|
|
2630
|
+
context?: string;
|
|
2631
|
+
};
|
|
2632
|
+
/**
|
|
2633
|
+
* The Base64 encoded identifier of the index mirror to forward the request to. See also the `index` parameter.
|
|
2634
|
+
*
|
|
2635
|
+
* If you do not specify an `indexToken` (or `index`) value, any index mirror could be used.
|
|
2636
|
+
*
|
|
2637
|
+
* Note: Passing an `indexToken` (or `index`) value has no effect when the results of a specific request can be returned from cache (see the `maximumAge` parameter).
|
|
2638
|
+
*/
|
|
2639
|
+
indexToken?: string;
|
|
2640
|
+
/**
|
|
2641
|
+
* Whether the admin session ID was allowed and used by the Coveo for Salesforce search engine. The value will be set to `true` when it is the case, and might be absent or set to `false` otherwise.
|
|
2642
|
+
*/
|
|
2643
|
+
isFallbackToAdmin?: boolean;
|
|
2644
|
+
questionAnswer?: RestQuestionAnswer;
|
|
2645
|
+
/**
|
|
2646
|
+
* The errors that did not make the query fail, but should be addressed. They might be security issues, deprecated behaviors, or any other kind of concern.
|
|
2647
|
+
*/
|
|
2648
|
+
warnings?: string[];
|
|
2649
|
+
/**
|
|
2650
|
+
* Additional undocumented or deprecated properties that might be sent by the Search API
|
|
2651
|
+
*/
|
|
2652
|
+
[key: string]: unknown;
|
|
2653
|
+
}
|
|
2654
|
+
export interface SingleItemParameters extends PostSearchQueryStringParams {
|
|
2655
|
+
/**
|
|
2656
|
+
* The unique ID of the document.
|
|
2657
|
+
*/
|
|
2658
|
+
uniqueId: string;
|
|
2659
|
+
}
|
|
2186
2660
|
export {};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@coveo/platform-client",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "45.1.0",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -34,9 +34,9 @@
|
|
|
34
34
|
"devDependencies": {
|
|
35
35
|
"@commitlint/cli": "17.6.6",
|
|
36
36
|
"@commitlint/config-conventional": "17.6.6",
|
|
37
|
-
"@types/jest": "29.5.
|
|
38
|
-
"@typescript-eslint/eslint-plugin": "5.
|
|
39
|
-
"@typescript-eslint/parser": "5.
|
|
37
|
+
"@types/jest": "29.5.3",
|
|
38
|
+
"@typescript-eslint/eslint-plugin": "5.62.0",
|
|
39
|
+
"@typescript-eslint/parser": "5.62.0",
|
|
40
40
|
"abortcontroller-polyfill": "1.7.5",
|
|
41
41
|
"cz-conventional-changelog": "3.3.0",
|
|
42
42
|
"eslint": "8.44.0",
|
|
@@ -45,12 +45,12 @@
|
|
|
45
45
|
"eslint-plugin-jest": "27.2.2",
|
|
46
46
|
"eslint-plugin-prettier": "4.2.1",
|
|
47
47
|
"husky": "8.0.3",
|
|
48
|
-
"jest": "29.
|
|
48
|
+
"jest": "29.6.1",
|
|
49
49
|
"jest-fetch-mock": "3.0.3",
|
|
50
50
|
"jest-runner-eslint": "2.1.0",
|
|
51
51
|
"lint-staged": "13.2.3",
|
|
52
52
|
"prettier": "2.8.8",
|
|
53
|
-
"semantic-release": "21.0.
|
|
53
|
+
"semantic-release": "21.0.7",
|
|
54
54
|
"ts-jest": "29.1.1",
|
|
55
55
|
"tsjs": "4.2.1",
|
|
56
56
|
"tslib": "2.6.0",
|