@coveo/platform-client 46.3.0 → 47.0.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.
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SolutionType = exports.projectResourceTypes = exports.ProjectSortBy = void 0;
3
+ exports.ProjectType = exports.projectResourceTypes = exports.ProjectSortBy = void 0;
4
4
  var ProjectSortBy;
5
5
  (function (ProjectSortBy) {
6
6
  ProjectSortBy["name"] = "NAME";
@@ -24,12 +24,12 @@ exports.projectResourceTypes = [
24
24
  'SOURCE',
25
25
  'UA_REPORT',
26
26
  ];
27
- var SolutionType;
28
- (function (SolutionType) {
29
- SolutionType["Commerce"] = "COMMERCE";
30
- SolutionType["Other"] = "OTHER";
31
- SolutionType["Service"] = "SERVICE";
32
- SolutionType["Website"] = "WEBSITE";
33
- SolutionType["Workplace"] = "WORKPLACE";
34
- })(SolutionType || (exports.SolutionType = SolutionType = {}));
27
+ var ProjectType;
28
+ (function (ProjectType) {
29
+ ProjectType["Commerce"] = "COMMERCE";
30
+ ProjectType["Other"] = "OTHER";
31
+ ProjectType["Service"] = "SERVICE";
32
+ ProjectType["Website"] = "WEBSITE";
33
+ ProjectType["Workplace"] = "WORKPLACE";
34
+ })(ProjectType || (exports.ProjectType = ProjectType = {}));
35
35
  //# sourceMappingURL=ProjectInterfaces.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectInterfaces.js","sourceRoot":"","sources":["../../../../src/resources/Projects/ProjectInterfaces.ts"],"names":[],"mappings":";;;AAGA,IAAY,aAMX;AAND,WAAY,aAAa;IACrB,8BAAa,CAAA;IACb,yCAAwB,CAAA;IACxB,6CAA4B,CAAA;IAC5B,yCAAwB,CAAA;IACxB,6CAA4B,CAAA;AAChC,CAAC,EANW,aAAa,6BAAb,aAAa,QAMxB;AAEY,QAAA,oBAAoB,GAAG;IAChC,SAAS;IACT,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,uBAAuB;IACvB,eAAe;IACf,UAAU;IACV,gBAAgB;IAChB,YAAY;IACZ,aAAa;IACb,mBAAmB;IACnB,QAAQ;IACR,WAAW;CACd,CAAC;AAIF,IAAY,YAMX;AAND,WAAY,YAAY;IACpB,qCAAqB,CAAA;IACrB,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;AAC3B,CAAC,EANW,YAAY,4BAAZ,YAAY,QAMvB"}
1
+ {"version":3,"file":"ProjectInterfaces.js","sourceRoot":"","sources":["../../../../src/resources/Projects/ProjectInterfaces.ts"],"names":[],"mappings":";;;AAGA,IAAY,aAMX;AAND,WAAY,aAAa;IACrB,8BAAa,CAAA;IACb,yCAAwB,CAAA;IACxB,6CAA4B,CAAA;IAC5B,yCAAwB,CAAA;IACxB,6CAA4B,CAAA;AAChC,CAAC,EANW,aAAa,6BAAb,aAAa,QAMxB;AAEY,QAAA,oBAAoB,GAAG;IAChC,SAAS;IACT,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,uBAAuB;IACvB,eAAe;IACf,UAAU;IACV,gBAAgB;IAChB,YAAY;IACZ,aAAa;IACb,mBAAmB;IACnB,QAAQ;IACR,WAAW;CACd,CAAC;AAIF,IAAY,WAMX;AAND,WAAY,WAAW;IACnB,oCAAqB,CAAA;IACrB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;AAC3B,CAAC,EANW,WAAW,2BAAX,WAAW,QAMtB"}
@@ -2,6 +2,7 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const tslib_1 = require("tslib");
4
4
  const _query_string_1 = tslib_1.__importDefault(require("query-string-cjs"));
5
+ const defaultOptions = { skipEmptyString: true, skipNull: true, sort: false };
5
6
  class Resource {
6
7
  api;
7
8
  serverlessApi;
@@ -10,15 +11,15 @@ class Resource {
10
11
  this.api = api;
11
12
  this.serverlessApi = serverlessApi;
12
13
  }
13
- buildPath(route, parameters) {
14
- return route + this.convertObjectToQueryString(parameters);
14
+ buildPath(route, parameters, options) {
15
+ return route + this.convertObjectToQueryString(parameters, options);
15
16
  }
16
- convertObjectToQueryString(parameters) {
17
+ convertObjectToQueryString(parameters, userOptions) {
17
18
  if (!parameters) {
18
19
  return '';
19
20
  }
20
21
  else {
21
- const requestURL = _query_string_1.default.stringify(parameters, { skipEmptyString: true, skipNull: true, sort: false });
22
+ const requestURL = _query_string_1.default.stringify(parameters, { ...defaultOptions, ...userOptions });
22
23
  return requestURL.length ? `?${requestURL}` : '';
23
24
  }
24
25
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Resource.js","sourceRoot":"","sources":["../../../src/resources/Resource.ts"],"names":[],"mappings":";;;AACA,0EAAwC;AAExC,MAAM,QAAQ;IAII;IACA;IAJd,MAAM,CAAC,OAAO,CAAS;IAEvB,YACc,GAAQ,EACR,aAAkB;QADlB,QAAG,GAAH,GAAG,CAAK;QACR,kBAAa,GAAb,aAAa,CAAK;IAC7B,CAAC;IAEM,SAAS,CAAC,KAAa,EAAE,UAAgB;QAC/C,OAAO,KAAK,GAAG,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC;IAC/D,CAAC;IAEO,0BAA0B,CAAC,UAAe;QAC9C,IAAI,CAAC,UAAU,EAAE;YACb,OAAO,EAAE,CAAC;SACb;aAAM;YACH,MAAM,UAAU,GAAG,uBAAW,CAAC,SAAS,CAAC,UAAU,EAAE,EAAC,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC;YAC3G,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpD;IACL,CAAC;CACJ;AAED,kBAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Resource.js","sourceRoot":"","sources":["../../../src/resources/Resource.ts"],"names":[],"mappings":";;;AACA,0EAAwC;AAExC,MAAM,cAAc,GAAiC,EAAC,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,CAAC;AAE1G,MAAM,QAAQ;IAII;IACA;IAJd,MAAM,CAAC,OAAO,CAAS;IAEvB,YACc,GAAQ,EACR,aAAkB;QADlB,QAAG,GAAH,GAAG,CAAK;QACR,kBAAa,GAAb,aAAa,CAAK;IAC7B,CAAC;IAEM,SAAS,CAAC,KAAa,EAAE,UAAgB,EAAE,OAAsC;QACvF,OAAO,KAAK,GAAG,IAAI,CAAC,0BAA0B,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;IAEO,0BAA0B,CAAC,UAAe,EAAE,WAA0C;QAC1F,IAAI,CAAC,UAAU,EAAE;YACb,OAAO,EAAE,CAAC;SACb;aAAM;YACH,MAAM,UAAU,GAAG,uBAAW,CAAC,SAAS,CAAC,UAAU,EAAE,EAAC,GAAG,cAAc,EAAE,GAAG,WAAW,EAAC,CAAC,CAAC;YAC1F,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpD;IACL,CAAC;CACJ;AAED,kBAAe,QAAQ,CAAC"}
@@ -52,11 +52,17 @@ class Search extends Resource_js_1.default {
52
52
  /**
53
53
  * Get an item's preview in HTML format
54
54
  */
55
- previewHTML(params) {
56
- return this.api.get(this.buildPath(`${Search.baseUrl}/html`, {
57
- ...params,
58
- organizationId: params.organizationId ?? this.api.organizationId,
59
- }), { responseBodyFormat: 'text' });
55
+ previewHTML({ enableNavigation, findNext, findPrevious, organizationId, page, requestedOutputSize, uniqueId, viewAllContent, ...body }) {
56
+ return this.api.post(this.buildPath(`${Search.baseUrl}/html`, {
57
+ enableNavigation,
58
+ findNext,
59
+ findPrevious,
60
+ page,
61
+ requestedOutputSize,
62
+ uniqueId,
63
+ viewAllContent,
64
+ organizationId: organizationId ?? this.api.organizationId,
65
+ }), body, { responseBodyFormat: 'text' });
60
66
  }
61
67
  /**
62
68
  * Get item in JSON format
@@ -65,7 +71,7 @@ class Search extends Resource_js_1.default {
65
71
  return this.api.get(this.buildPath(`${Search.baseUrl}/document`, {
66
72
  ...params,
67
73
  organizationId: params.organizationId ?? this.api.organizationId,
68
- }));
74
+ }, { skipEmptyString: false }));
69
75
  }
70
76
  /**
71
77
  * Executes a facet search request.
@@ -1 +1 @@
1
- {"version":3,"file":"Search.js","sourceRoot":"","sources":["../../../../src/resources/Search/Search.ts"],"names":[],"mappings":";;;AACA,0EAAmC;AACnC,yEAAuC;AAevC,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,CAAC,CACL,CAAC;IACN,CA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,EAAE,GAAG,cAAc,EAAC,GAAG,MAAM,CAAC;QAEnE,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAChB,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,QAAQ,EAAE;YACtC,cAAc,EAAE,cAAc,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc;YACzD,cAAc;SACjB,CAAC,EACF,cAAc,CACjB,CAAC;IACN,CAAC;;AAhIL,yBAiIC"}
@@ -21,12 +21,12 @@ export const projectResourceTypes = [
21
21
  'SOURCE',
22
22
  'UA_REPORT',
23
23
  ];
24
- export var SolutionType;
25
- (function (SolutionType) {
26
- SolutionType["Commerce"] = "COMMERCE";
27
- SolutionType["Other"] = "OTHER";
28
- SolutionType["Service"] = "SERVICE";
29
- SolutionType["Website"] = "WEBSITE";
30
- SolutionType["Workplace"] = "WORKPLACE";
31
- })(SolutionType || (SolutionType = {}));
24
+ export var ProjectType;
25
+ (function (ProjectType) {
26
+ ProjectType["Commerce"] = "COMMERCE";
27
+ ProjectType["Other"] = "OTHER";
28
+ ProjectType["Service"] = "SERVICE";
29
+ ProjectType["Website"] = "WEBSITE";
30
+ ProjectType["Workplace"] = "WORKPLACE";
31
+ })(ProjectType || (ProjectType = {}));
32
32
  //# sourceMappingURL=ProjectInterfaces.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ProjectInterfaces.js","sourceRoot":"","sources":["../../../../src/resources/Projects/ProjectInterfaces.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,aAMX;AAND,WAAY,aAAa;IACrB,8BAAa,CAAA;IACb,yCAAwB,CAAA;IACxB,6CAA4B,CAAA;IAC5B,yCAAwB,CAAA;IACxB,6CAA4B,CAAA;AAChC,CAAC,EANW,aAAa,KAAb,aAAa,QAMxB;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,SAAS;IACT,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,uBAAuB;IACvB,eAAe;IACf,UAAU;IACV,gBAAgB;IAChB,YAAY;IACZ,aAAa;IACb,mBAAmB;IACnB,QAAQ;IACR,WAAW;CACd,CAAC;AAIF,MAAM,CAAN,IAAY,YAMX;AAND,WAAY,YAAY;IACpB,qCAAqB,CAAA;IACrB,+BAAe,CAAA;IACf,mCAAmB,CAAA;IACnB,mCAAmB,CAAA;IACnB,uCAAuB,CAAA;AAC3B,CAAC,EANW,YAAY,KAAZ,YAAY,QAMvB"}
1
+ {"version":3,"file":"ProjectInterfaces.js","sourceRoot":"","sources":["../../../../src/resources/Projects/ProjectInterfaces.ts"],"names":[],"mappings":"AAGA,MAAM,CAAN,IAAY,aAMX;AAND,WAAY,aAAa;IACrB,8BAAa,CAAA;IACb,yCAAwB,CAAA;IACxB,6CAA4B,CAAA;IAC5B,yCAAwB,CAAA;IACxB,6CAA4B,CAAA;AAChC,CAAC,EANW,aAAa,KAAb,aAAa,QAMxB;AAED,MAAM,CAAC,MAAM,oBAAoB,GAAG;IAChC,SAAS;IACT,aAAa;IACb,iBAAiB;IACjB,WAAW;IACX,uBAAuB;IACvB,eAAe;IACf,UAAU;IACV,gBAAgB;IAChB,YAAY;IACZ,aAAa;IACb,mBAAmB;IACnB,QAAQ;IACR,WAAW;CACd,CAAC;AAIF,MAAM,CAAN,IAAY,WAMX;AAND,WAAY,WAAW;IACnB,oCAAqB,CAAA;IACrB,8BAAe,CAAA;IACf,kCAAmB,CAAA;IACnB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;AAC3B,CAAC,EANW,WAAW,KAAX,WAAW,QAMtB"}
@@ -1,4 +1,5 @@
1
1
  import queryString from 'query-string-esm';
2
+ const defaultOptions = { skipEmptyString: true, skipNull: true, sort: false };
2
3
  class Resource {
3
4
  api;
4
5
  serverlessApi;
@@ -7,15 +8,15 @@ class Resource {
7
8
  this.api = api;
8
9
  this.serverlessApi = serverlessApi;
9
10
  }
10
- buildPath(route, parameters) {
11
- return route + this.convertObjectToQueryString(parameters);
11
+ buildPath(route, parameters, options) {
12
+ return route + this.convertObjectToQueryString(parameters, options);
12
13
  }
13
- convertObjectToQueryString(parameters) {
14
+ convertObjectToQueryString(parameters, userOptions) {
14
15
  if (!parameters) {
15
16
  return '';
16
17
  }
17
18
  else {
18
- const requestURL = queryString.stringify(parameters, { skipEmptyString: true, skipNull: true, sort: false });
19
+ const requestURL = queryString.stringify(parameters, { ...defaultOptions, ...userOptions });
19
20
  return requestURL.length ? `?${requestURL}` : '';
20
21
  }
21
22
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Resource.js","sourceRoot":"","sources":["../../../src/resources/Resource.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,MAAM,QAAQ;IAII;IACA;IAJd,MAAM,CAAC,OAAO,CAAS;IAEvB,YACc,GAAQ,EACR,aAAkB;QADlB,QAAG,GAAH,GAAG,CAAK;QACR,kBAAa,GAAb,aAAa,CAAK;IAC7B,CAAC;IAEM,SAAS,CAAC,KAAa,EAAE,UAAgB;QAC/C,OAAO,KAAK,GAAG,IAAI,CAAC,0BAA0B,CAAC,UAAU,CAAC,CAAC;IAC/D,CAAC;IAEO,0BAA0B,CAAC,UAAe;QAC9C,IAAI,CAAC,UAAU,EAAE;YACb,OAAO,EAAE,CAAC;SACb;aAAM;YACH,MAAM,UAAU,GAAG,WAAW,CAAC,SAAS,CAAC,UAAU,EAAE,EAAC,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,CAAC,CAAC;YAC3G,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpD;IACL,CAAC;CACJ;AAED,eAAe,QAAQ,CAAC"}
1
+ {"version":3,"file":"Resource.js","sourceRoot":"","sources":["../../../src/resources/Resource.ts"],"names":[],"mappings":"AACA,OAAO,WAAW,MAAM,eAAe,CAAC;AAExC,MAAM,cAAc,GAAiC,EAAC,eAAe,EAAE,IAAI,EAAE,QAAQ,EAAE,IAAI,EAAE,IAAI,EAAE,KAAK,EAAC,CAAC;AAE1G,MAAM,QAAQ;IAII;IACA;IAJd,MAAM,CAAC,OAAO,CAAS;IAEvB,YACc,GAAQ,EACR,aAAkB;QADlB,QAAG,GAAH,GAAG,CAAK;QACR,kBAAa,GAAb,aAAa,CAAK;IAC7B,CAAC;IAEM,SAAS,CAAC,KAAa,EAAE,UAAgB,EAAE,OAAsC;QACvF,OAAO,KAAK,GAAG,IAAI,CAAC,0BAA0B,CAAC,UAAU,EAAE,OAAO,CAAC,CAAC;IACxE,CAAC;IAEO,0BAA0B,CAAC,UAAe,EAAE,WAA0C;QAC1F,IAAI,CAAC,UAAU,EAAE;YACb,OAAO,EAAE,CAAC;SACb;aAAM;YACH,MAAM,UAAU,GAAG,WAAW,CAAC,SAAS,CAAC,UAAU,EAAE,EAAC,GAAG,cAAc,EAAE,GAAG,WAAW,EAAC,CAAC,CAAC;YAC1F,OAAO,UAAU,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,UAAU,EAAE,CAAC,CAAC,CAAC,EAAE,CAAC;SACpD;IACL,CAAC;CACJ;AAED,eAAe,QAAQ,CAAC"}
@@ -49,11 +49,17 @@ export default class Search extends Ressource {
49
49
  /**
50
50
  * Get an item's preview in HTML format
51
51
  */
52
- previewHTML(params) {
53
- return this.api.get(this.buildPath(`${Search.baseUrl}/html`, {
54
- ...params,
55
- organizationId: params.organizationId ?? this.api.organizationId,
56
- }), { responseBodyFormat: 'text' });
52
+ previewHTML({ enableNavigation, findNext, findPrevious, organizationId, page, requestedOutputSize, uniqueId, viewAllContent, ...body }) {
53
+ return this.api.post(this.buildPath(`${Search.baseUrl}/html`, {
54
+ enableNavigation,
55
+ findNext,
56
+ findPrevious,
57
+ page,
58
+ requestedOutputSize,
59
+ uniqueId,
60
+ viewAllContent,
61
+ organizationId: organizationId ?? this.api.organizationId,
62
+ }), body, { responseBodyFormat: 'text' });
57
63
  }
58
64
  /**
59
65
  * Get item in JSON format
@@ -62,7 +68,7 @@ export default class Search extends Ressource {
62
68
  return this.api.get(this.buildPath(`${Search.baseUrl}/document`, {
63
69
  ...params,
64
70
  organizationId: params.organizationId ?? this.api.organizationId,
65
- }));
71
+ }, { skipEmptyString: false }));
66
72
  }
67
73
  /**
68
74
  * Executes a facet search request.
@@ -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;AAevC,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,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,CAAC,CACL,CAAC;IACN,CAAC;IAED,2DAA2D;IAC3D,w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,cAAc,EAAE,cAAc,EAAE,GAAG,cAAc,EAAC,GAAG,MAAM,CAAC;QAEnE,OAAO,IAAI,CAAC,GAAG,CAAC,IAAI,CAChB,IAAI,CAAC,SAAS,CAAC,GAAG,MAAM,CAAC,OAAO,QAAQ,EAAE;YACtC,cAAc,EAAE,cAAc,IAAI,IAAI,CAAC,GAAG,CAAC,cAAc;YACzD,cAAc;SACjB,CAAC,EACF,cAAc,CACjB,CAAC;IACN,CAAC"}
@@ -9,7 +9,7 @@ export declare enum ProjectSortBy {
9
9
  }
10
10
  export declare const projectResourceTypes: string[];
11
11
  export type ProjectResourceType = (typeof projectResourceTypes)[number];
12
- export declare enum SolutionType {
12
+ export declare enum ProjectType {
13
13
  Commerce = "COMMERCE",
14
14
  Other = "OTHER",
15
15
  Service = "SERVICE",
@@ -26,9 +26,9 @@ export interface BaseProjectModel {
26
26
  */
27
27
  description: string;
28
28
  /**
29
- * The solution type of the project.
29
+ * The type of the project.
30
30
  */
31
- solutionType: SolutionType;
31
+ type: ProjectType;
32
32
  /**
33
33
  * The list of usernames that will be points of contact for the project.
34
34
  *
@@ -44,7 +44,7 @@ export interface BaseProjectModel {
44
44
  }
45
45
  export interface ProjectModel extends BaseProjectModel {
46
46
  /**
47
- * The unique identitifier of the project.
47
+ * The unique identifier of the project.
48
48
  */
49
49
  id: string;
50
50
  /**
@@ -93,8 +93,4 @@ export interface ListProjectParams extends Paginated {
93
93
  * @example: 'ASC'
94
94
  */
95
95
  order?: SortingOrder;
96
- /**
97
- * Whether to include resources when returning results.
98
- */
99
- includeResources?: boolean;
100
96
  }
@@ -1,10 +1,11 @@
1
1
  import API from '../APICore.js';
2
+ import queryString from '#query-string';
2
3
  declare class Resource {
3
4
  protected api: API;
4
5
  protected serverlessApi: API;
5
6
  static baseUrl: string;
6
7
  constructor(api: API, serverlessApi: API);
7
- protected buildPath(route: string, parameters?: any): string;
8
+ protected buildPath(route: string, parameters?: any, options?: queryString.StringifyOptions): string;
8
9
  private convertObjectToQueryString;
9
10
  }
10
11
  export default Resource;
@@ -1,6 +1,6 @@
1
- import { ListFieldValuesBodyQueryParams, PostSearchQuerySuggestBodyParams } from './index.js';
2
1
  import Ressource from '../Resource.js';
3
- import { SingleItemParameters, ItemPreviewHtmlParameters, RestQueryParams, RestQueryResult, RestTokenParams, SearchListFieldsParams, SearchListFieldsResponse, SearchResponse, TokenModel, RestFacetSearchParameters, RestFacetSearchResponse } from './SearchInterfaces.js';
2
+ import { ItemPreviewHtmlParameters, RestFacetSearchParameters, RestFacetSearchResponse, RestQueryParams, RestQueryResult, RestTokenParams, SearchListFieldsParams, SearchListFieldsResponse, SearchResponse, SingleItemParameters, TokenModel } from './SearchInterfaces.js';
3
+ import { ListFieldValuesBodyQueryParams, PostSearchQuerySuggestBodyParams } from './index.js';
4
4
  export default class Search extends Ressource {
5
5
  static baseUrl: string;
6
6
  createToken(tokenParams: RestTokenParams): Promise<TokenModel>;
@@ -18,7 +18,7 @@ export default class Search extends Ressource {
18
18
  /**
19
19
  * Get an item's preview in HTML format
20
20
  */
21
- previewHTML(params: ItemPreviewHtmlParameters): Promise<string>;
21
+ previewHTML({ enableNavigation, findNext, findPrevious, organizationId, page, requestedOutputSize, uniqueId, viewAllContent, ...body }: ItemPreviewHtmlParameters): Promise<string>;
22
22
  /**
23
23
  * Get item in JSON format
24
24
  */
@@ -1,5 +1,5 @@
1
1
  import { RestUserIdType } from '../Enums.js';
2
- export interface SearchListFieldsParams {
2
+ interface SharedSearchParams {
3
3
  /**
4
4
  * The unique identifier of the target Coveo Cloud organization.
5
5
  * Specifying a value for this parameter is only necessary when you are authenticating the API call with an OAuth2 token.
@@ -8,7 +8,69 @@ export interface SearchListFieldsParams {
8
8
  /**
9
9
  * Whether to bypass document permissions. Only effective if the access token grants the Search - View all content privilege.
10
10
  */
11
- viewAllContent?: boolean;
11
+ viewAllContent?: boolean | number;
12
+ /**
13
+ * The name of the query pipeline to use for this request (bypassing its conditions, if it has any).
14
+ *
15
+ * You can pass an empty `pipeline` value to use an empty query pipeline (i.e., `?pipeline=` or `"pipeline": ""`).
16
+ *
17
+ * 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).
18
+ *
19
+ * **Notes:**
20
+ * - This parameter will be overridden if the search request is authenticated by a search token that enforces a specific `pipeline`, or a `searchHub` that routes queries to a specific `pipeline` via a query pipeline condition.
21
+ * - 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).
22
+ *
23
+ * See also [Managing Query Pipelines](https://docs.coveo.com/en/1450/).
24
+ *
25
+ * @example `CustomerQueryPipeline`
26
+ */
27
+ pipeline?: string;
28
+ /**
29
+ * The first level of origin of the request, typically the identifier of the graphical search interface from which the request originates.
30
+ *
31
+ * Coveo Machine Learning models use this information to provide contextually relevant output.
32
+ *
33
+ * **Notes:**
34
+ * - This parameter will be overridden if the search request is authenticated by a search token that enforces a specific `searchHub`.
35
+ * - When logging a **Search** usage analytics event for a query, the `originLevel1` field of that event should be set to the value of the `searchHub` search request parameter.
36
+ *
37
+ * See also the `tab` parameter.
38
+ *
39
+ * @example `CustomerPortal`
40
+ */
41
+ searchHub?: string;
42
+ /**
43
+ * The [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) identifier of the time zone to use to correctly interpret dates in the query expression and result items.
44
+ *
45
+ * If not specified, the default time zone of the server hosting the index is used.
46
+ *
47
+ * **Note:** While no Coveo Machine Learning model uses this information, it can nevertheless affect the ranking scores (and thus, potentially the order) of result items, as ranking expressions may be based on time constants.
48
+ *
49
+ * @example `America/New_York`
50
+ */
51
+ timezone?: string;
52
+ /**
53
+ * Whether to force a successful response to include debug information.
54
+ *
55
+ * **Notes:**
56
+ * - Debug information can only appear in responses in the JSON format (see the `format` parameter).
57
+ * - Avoid setting this parameter to `true` in production, as it has a negative impact on query performance.
58
+ *
59
+ * @default `false`
60
+ */
61
+ debug?: boolean;
62
+ /**
63
+ * The identifier of the index mirror to forward the request to. See also the `indexToken` parameter.
64
+ *
65
+ * If you do not specify an `index` (or `indexToken`) value, any index mirror could be used.
66
+ *
67
+ * **Note:** Passing an `index` (or `indexToken`) value has no effect when the results of a specific request can be returned from cache (see the `maximumAge` parameter).
68
+ *
69
+ * @example `myorg-nvoqun-Indexer1-pbi2nbuw`
70
+ */
71
+ index?: string;
72
+ }
73
+ export interface SearchListFieldsParams extends Pick<SharedSearchParams, 'organizationId' | 'viewAllContent'> {
12
74
  }
13
75
  export interface SearchListFieldsResponse {
14
76
  fields: Array<{
@@ -26,14 +88,12 @@ export interface SearchListFieldsResponse {
26
88
  sortByField: boolean;
27
89
  }>;
28
90
  }
29
- export interface RestTokenParams {
91
+ export interface RestTokenParams extends Pick<SharedSearchParams, 'searchHub' | 'pipeline'> {
30
92
  userIds: RestUserId[];
31
93
  userGroups?: string[];
32
94
  userDisplayName?: string;
33
95
  canSeeUserProfileOf?: string[];
34
- pipeline?: string;
35
96
  filter?: string;
36
- searchHub?: string;
37
97
  salesforceOrganizationId?: string;
38
98
  validFor?: number;
39
99
  salesforceUser?: string;
@@ -61,22 +121,13 @@ export interface RestCommerceParameters {
61
121
  export interface TokenModel {
62
122
  token: string;
63
123
  }
64
- export type RestQueryParams = PostSearchBodyQueryParams & PostSearchQueryStringParams;
65
- export interface PostSearchQueryStringParams {
66
- /**
67
- * The unique identifier of the target Coveo Cloud organization.
68
- * Specifying a value for this parameter is only necessary when you are authenticating the API call with an OAuth2 token.
69
- */
70
- organizationId?: string;
71
- /**
72
- * Whether to bypass document permissions. Only effective if the access token grants the Search - View all content privilege.
73
- */
74
- viewAllContent?: boolean | number;
124
+ export type RestQueryParams = PostSearchBodyQueryParams;
125
+ export interface PostSearchQueryStringParams extends Pick<SharedSearchParams, 'organizationId' | 'viewAllContent'> {
75
126
  }
76
127
  /**
77
128
  * Defines the body parameters of the list field values request.
78
129
  */
79
- export interface ListFieldValuesBodyQueryParams extends PostSearchQueryStringParams {
130
+ export interface ListFieldValuesBodyQueryParams extends SharedSearchParams {
80
131
  /**
81
132
  * Whether to treat accentuated characters as non-accentuated characters when retrieving field values (e.g., treat é, è, ê, etc., as e).
82
133
  *
@@ -152,22 +203,6 @@ export interface ListFieldValuesBodyQueryParams extends PostSearchQueryStringPar
152
203
  * Suppose that in your index, the `@price` dictionary field contains different values for its `storeA` and `storeB` keys. Including `"dictionaryFieldContext": { "price": "storeA" }` in the query means that any part of the query expression that targets the `@price` field will in fact only query the `storeA` values of that field.
153
204
  */
154
205
  dictionaryFieldContext?: RestDictionaryFieldContextRequest;
155
- /**
156
- * The name of the query pipeline to use for this request (bypassing its conditions, if it has any).
157
- *
158
- * You can pass an empty `pipeline` value to use an empty query pipeline (i.e., `?pipeline=` or `"pipeline": ""`).
159
- *
160
- * 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).
161
- *
162
- * **Notes:**
163
- * - This parameter will be overridden if the search request is authenticated by a search token that enforces a specific `pipeline`, or a `searchHub` that routes queries to a specific `pipeline` via a query pipeline condition.
164
- * - 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).
165
- *
166
- * See also [Managing Query Pipelines](https://docs.coveo.com/en/1450/).
167
- *
168
- * @example `CustomerQueryPipeline`
169
- */
170
- pipeline?: string;
171
206
  /**
172
207
  * The maximum age of cached results, in milliseconds.
173
208
  *
@@ -178,20 +213,6 @@ export interface ListFieldValuesBodyQueryParams extends PostSearchQueryStringPar
178
213
  * @default `-1` (which corresponds to the internal default value (15 minutes))
179
214
  */
180
215
  maximumAge?: number;
181
- /**
182
- * The first level of origin of the request, typically the identifier of the graphical search interface from which the request originates.
183
- *
184
- * Coveo Machine Learning models use this information to provide contextually relevant output.
185
- *
186
- * **Notes:**
187
- * - This parameter will be overridden if the search request is authenticated by a search token that enforces a specific `searchHub`.
188
- * - When logging a **Search** usage analytics event for a query, the `originLevel1` field of that event should be set to the value of the `searchHub` search request parameter.
189
- *
190
- * See also the `tab` parameter.
191
- *
192
- * @example `CustomerPortal`
193
- */
194
- searchHub?: string;
195
216
  /**
196
217
  * The second level of origin of the request, typically the identifier of the selected tab in the graphical search interface from which the request originates.
197
218
  *
@@ -261,16 +282,6 @@ export interface ListFieldValuesBodyQueryParams extends PostSearchQueryStringPar
261
282
  * @example `en-US`
262
283
  */
263
284
  locale?: string;
264
- /**
265
- * The [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) identifier of the time zone to use to correctly interpret dates in the query expression and result items.
266
- *
267
- * If not specified, the default time zone of the server hosting the index is used.
268
- *
269
- * **Note:** While no Coveo Machine Learning model uses this information, it can nevertheless affect the ranking scores (and thus, potentially the order) of result items, as ranking expressions may be based on time constants.
270
- *
271
- * @example `America/New_York`
272
- */
273
- timezone?: string;
274
285
  /**
275
286
  * The format of a successful response.
276
287
  *
@@ -283,16 +294,6 @@ export interface ListFieldValuesBodyQueryParams extends PostSearchQueryStringPar
283
294
  * @default `json`
284
295
  */
285
296
  format?: RestFormat;
286
- /**
287
- * Whether to force a successful response to include debug information.
288
- *
289
- * **Notes:**
290
- * - Debug information can only appear in responses in the JSON format (see the `format` parameter).
291
- * - Avoid setting this parameter to `true` in production, as it has a negative impact on query performance.
292
- *
293
- * @default `false`
294
- */
295
- debug?: boolean;
296
297
  /**
297
298
  * The Base64 encoded identifier of the index mirror to forward the request to. See also the `index` parameter.
298
299
  *
@@ -359,16 +360,6 @@ export interface ListFieldValuesBodyQueryParams extends PostSearchQueryStringPar
359
360
  * @default `coveo`
360
361
  */
361
362
  indexType?: string;
362
- /**
363
- * The identifier of the index mirror to forward the request to. See also the `indexToken` parameter.
364
- *
365
- * If you do not specify an `index` (or `indexToken`) value, any index mirror could be used.
366
- *
367
- * **Note:** Passing an `index` (or `indexToken`) value has no effect when the results of a specific request can be returned from cache (see the `maximumAge` parameter).
368
- *
369
- * @example `myorg-nvoqun-Indexer1-pbi2nbuw`
370
- */
371
- index?: string;
372
363
  /**
373
364
  * The identifier for a logical group of indexes that have been configured to include documents form the same sources.
374
365
  *
@@ -419,10 +410,6 @@ export interface ListFieldValuesBodyQueryParams extends PostSearchQueryStringPar
419
410
  * ```
420
411
  */
421
412
  analytics?: RestAnalyticsRequest;
422
- /**
423
- * Whether to bypass document permissions. Only effective if the access token grants the Search - View all content privilege.
424
- */
425
- viewAllContent?: boolean;
426
413
  }
427
414
  /**
428
415
  * Defines the body parameters of the search request.
@@ -856,7 +843,7 @@ export interface PostSearchBodyQueryParams extends PostSearchBodyCommonParams {
856
843
  */
857
844
  wildcards?: boolean;
858
845
  }
859
- interface PostSearchBodyCommonParams {
846
+ interface PostSearchBodyCommonParams extends SharedSearchParams {
860
847
  /**
861
848
  * The query and page view actions previously made by the current user.
862
849
  *
@@ -919,16 +906,6 @@ interface PostSearchBodyCommonParams {
919
906
  * ```
920
907
  */
921
908
  context?: RestContextRequest;
922
- /**
923
- * Whether to force a successful response to include debug information.
924
- *
925
- * **Notes:**
926
- * - Debug information can only appear in responses in the JSON format (see the `format` parameter).
927
- * - Avoid setting this parameter to `true` in production, as it has a negative impact on query performance.
928
- *
929
- * @default `false`
930
- */
931
- debug?: boolean;
932
909
  /**
933
910
  * The format of a successful response.
934
911
  *
@@ -941,16 +918,6 @@ interface PostSearchBodyCommonParams {
941
918
  * @default `json`
942
919
  */
943
920
  format?: RestFormat;
944
- /**
945
- * The identifier of the index mirror to forward the request to. See also the `indexToken` parameter.
946
- *
947
- * If you do not specify an `index` (or `indexToken`) value, any index mirror could be used.
948
- *
949
- * **Note:** Passing an `index` (or `indexToken`) value has no effect when the results of a specific request can be returned from cache (see the `maximumAge` parameter).
950
- *
951
- * @example `myorg-nvoqun-Indexer1-pbi2nbuw`
952
- */
953
- index?: string;
954
921
  /**
955
922
  * The Base64 encoded identifier of the index mirror to forward the request to. See also the `index` parameter.
956
923
  *
@@ -1037,22 +1004,6 @@ interface PostSearchBodyCommonParams {
1037
1004
  * ```
1038
1005
  */
1039
1006
  mlParameters?: Record<string, any>;
1040
- /**
1041
- * The name of the query pipeline to use for this request (bypassing its conditions, if it has any).
1042
- *
1043
- * You can pass an empty `pipeline` value to use an empty query pipeline (i.e., `?pipeline=` or `"pipeline": ""`).
1044
- *
1045
- * 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).
1046
- *
1047
- * **Notes:**
1048
- * - This parameter will be overridden if the search request is authenticated by a search token that enforces a specific `pipeline`, or a `searchHub` that routes queries to a specific `pipeline` via a query pipeline condition.
1049
- * - 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).
1050
- *
1051
- * See also [Managing Query Pipelines](https://docs.coveo.com/en/1450/).
1052
- *
1053
- * @example `CustomerQueryPipeline`
1054
- */
1055
- pipeline?: string;
1056
1007
  /**
1057
1008
  * The basic query expression, typically the keywords entered by the end user in a query box.
1058
1009
  *
@@ -1081,20 +1032,6 @@ interface PostSearchBodyCommonParams {
1081
1032
  * @example `http://www.example.com`
1082
1033
  */
1083
1034
  referrer?: string;
1084
- /**
1085
- * The first level of origin of the request, typically the identifier of the graphical search interface from which the request originates.
1086
- *
1087
- * Coveo Machine Learning models use this information to provide contextually relevant output.
1088
- *
1089
- * **Notes:**
1090
- * - This parameter will be overridden if the search request is authenticated by a search token that enforces a specific `searchHub`.
1091
- * - When logging a **Search** usage analytics event for a query, the `originLevel1` field of that event should be set to the value of the `searchHub` search request parameter.
1092
- *
1093
- * See also the `tab` parameter.
1094
- *
1095
- * @example `CustomerPortal`
1096
- */
1097
- searchHub?: string;
1098
1035
  /**
1099
1036
  * The criteria to use for sorting the query results.
1100
1037
  *
@@ -1127,16 +1064,6 @@ interface PostSearchBodyCommonParams {
1127
1064
  * @example `ForumTab`
1128
1065
  */
1129
1066
  tab?: string;
1130
- /**
1131
- * The [tz database](https://en.wikipedia.org/wiki/List_of_tz_database_time_zones) identifier of the time zone to use to correctly interpret dates in the query expression and result items.
1132
- *
1133
- * If not specified, the default time zone of the server hosting the index is used.
1134
- *
1135
- * **Note:** While no Coveo Machine Learning model uses this information, it can nevertheless affect the ranking scores (and thus, potentially the order) of result items, as ranking expressions may be based on time constants.
1136
- *
1137
- * @example `America/New_York`
1138
- */
1139
- timezone?: string;
1140
1067
  /**
1141
1068
  * A GUID representing the current user, who can be authenticated or anonymous. This GUID is normally generated by the usage analytics service and stored in a non-expiring browser cookie.
1142
1069
  *
@@ -2168,7 +2095,7 @@ export interface RestUserActionsParameters {
2168
2095
  */
2169
2096
  tagViewsOfUser?: string;
2170
2097
  }
2171
- export interface ItemPreviewHtmlParameters extends PostSearchQueryStringParams {
2098
+ export interface ItemPreviewHtmlParameters extends RestQueryParams {
2172
2099
  /**
2173
2100
  * The unique ID of the document.
2174
2101
  */
@@ -2652,13 +2579,13 @@ export interface SearchResponse {
2652
2579
  */
2653
2580
  [key: string]: unknown;
2654
2581
  }
2655
- export interface SingleItemParameters extends PostSearchQueryStringParams {
2582
+ export interface SingleItemParameters extends SharedSearchParams {
2656
2583
  /**
2657
2584
  * The unique ID of the document.
2658
2585
  */
2659
2586
  uniqueId: string;
2660
2587
  }
2661
- export interface RestFacetSearchParameters extends PostSearchQueryStringParams {
2588
+ export interface RestFacetSearchParameters extends Pick<SharedSearchParams, 'organizationId' | 'viewAllContent'> {
2662
2589
  /**
2663
2590
  * The name of the field against which to execute the facet search request.
2664
2591
  */
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveo/platform-client",
3
- "version": "46.3.0",
3
+ "version": "47.0.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {