@coveo/platform-client 41.0.0 → 42.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.
@@ -9,6 +9,7 @@ class Limits extends Resource_js_1.default {
9
9
  static getBaseUrl = () => `/rest/organizations/${APICore_js_1.default.orgPlaceholder}/limits`;
10
10
  static getWithSection = (sectionName) => `${Limits.getBaseUrl()}/${sectionName}`;
11
11
  static getWithSectionAndHistory = (sectionName, limitKey) => `${Limits.getWithSection(sectionName)}/${limitKey}/history`;
12
+ static getSpecificLimit = (sectionName, limitKey) => `${Limits.getWithSection(sectionName)}/${limitKey}`;
12
13
  get(sectionName) {
13
14
  return this.api.get(Limits.getWithSection(sectionName));
14
15
  }
@@ -18,6 +19,15 @@ class Limits extends Resource_js_1.default {
18
19
  getAllPerLimitType(limitType) {
19
20
  return this.api.get(this.buildPath(Limits.getBaseUrl(), { limitType: limitType }));
20
21
  }
22
+ /**
23
+ * Shows the status of a specific limit in an organization
24
+ *
25
+ * @param sectionName The name of the target license section
26
+ * @param limitKey The unique identifier of the target limit status to show
27
+ */
28
+ getSpecificLimitStatus(sectionName, limitKey) {
29
+ return this.api.get(Limits.getSpecificLimit(sectionName, limitKey));
30
+ }
21
31
  getHistoryLimit(sectionName, limitKey, options) {
22
32
  return this.api.get(this.buildPath(Limits.getWithSectionAndHistory(sectionName, limitKey), options));
23
33
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Limits.js","sourceRoot":"","sources":["../../../../src/resources/Limits/Limits.ts"],"names":[],"mappings":";;;;;AAAA,kEAAmC;AAEnC,iEAAsC;AAStC,MAAqB,MAAO,SAAQ,qBAAQ;IACxC,MAAM,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC,uBAAuB,oBAAG,CAAC,cAAc,SAAS,CAAC;IAC7E,MAAM,CAAC,cAAc,GAAG,CAAC,WAA2B,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,UAAU,EAAE,IAAI,WAAW,EAAE,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AAE,EAAE,CAChF,GAAG,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,QAAQ,UAAU,CAAC;IAChE,MAAM,CAAC,gBAAgB,GAAG,CAAC,WAA2B,EAAE,QAAgB,EAAE,EAAE,CACxE,GAAG,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,QAAQ,EAAE,CAAC;IAExD,GAAG,CAAC,WAA2B;QAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAc,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;IACzE,CAAC;IAED,MAAM;QACF,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAiB,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,kBAAkB,CAAC,SAAoB;QACnC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAiB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,EAAC,SAAS,EAAE,SAAS,EAAC,CAAC,CAAC,CAAC;IACrG,CAAC;IAED;;;;;OAKG;IACH,sBAAsB,CAAC,WAA2B,EAAE,QAAgB;QAChE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAa,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IACpF,CAAC;IAED,eAAe,CAAC,WAA2B,EAAE,QAAgB,EAAE,OAA6B;QACxF,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,wBAAwB,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,CAClF,CAAC;IACN,CAAC;;AAlCL,yBAmCC"}
@@ -4,6 +4,7 @@ export default class Limits extends Resource {
4
4
  static getBaseUrl = () => `/rest/organizations/${API.orgPlaceholder}/limits`;
5
5
  static getWithSection = (sectionName) => `${Limits.getBaseUrl()}/${sectionName}`;
6
6
  static getWithSectionAndHistory = (sectionName, limitKey) => `${Limits.getWithSection(sectionName)}/${limitKey}/history`;
7
+ static getSpecificLimit = (sectionName, limitKey) => `${Limits.getWithSection(sectionName)}/${limitKey}`;
7
8
  get(sectionName) {
8
9
  return this.api.get(Limits.getWithSection(sectionName));
9
10
  }
@@ -13,6 +14,15 @@ export default class Limits extends Resource {
13
14
  getAllPerLimitType(limitType) {
14
15
  return this.api.get(this.buildPath(Limits.getBaseUrl(), { limitType: limitType }));
15
16
  }
17
+ /**
18
+ * Shows the status of a specific limit in an organization
19
+ *
20
+ * @param sectionName The name of the target license section
21
+ * @param limitKey The unique identifier of the target limit status to show
22
+ */
23
+ getSpecificLimitStatus(sectionName, limitKey) {
24
+ return this.api.get(Limits.getSpecificLimit(sectionName, limitKey));
25
+ }
16
26
  getHistoryLimit(sectionName, limitKey, options) {
17
27
  return this.api.get(this.buildPath(Limits.getWithSectionAndHistory(sectionName, limitKey), options));
18
28
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Limits.js","sourceRoot":"","sources":["../../../../src/resources/Limits/Limits.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,MAAM,kBAAkB,CAAC;AAEnC,OAAO,QAAQ,MAAM,gBAAgB,CAAC;AAStC,MAAM,CAAC,OAAO,OAAO,MAAO,SAAQ,QAAQ;IACxC,MAAM,CAAC,UAAU,GAAG,GAAG,EAAE,CAAC,uBAAuB,GAAG,CAAC,cAAc,SAAS,CAAC;IAC7E,MAAM,CAAC,cAAc,GAAG,CAAC,WAA2B,EAAE,EAAE,CAAC,GAAG,MAAM,CAAC,UAAU,EAAE,IAAI,WAAW,EAAE,CAAC;IACjG,MAAM,CAAC,wBAAwB,GAAG,CAAC,WAA2B,EAAE,QAAgB,EAAE,EAAE,CAChF,GAAG,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,IAAI,QAAQ,UAAU,CAAC;IAEhE,GAAG,CAAC,WAA2B;QAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAc,MAA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AC,WAAW,CAAC,IAAI,QAAQ,EAAE,CAAC;IAExD,GAAG,CAAC,WAA2B;QAC3B,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAc,MAAM,CAAC,cAAc,CAAC,WAAW,CAAC,CAAC,CAAC;IACzE,CAAC;IAED,MAAM;QACF,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAiB,MAAM,CAAC,UAAU,EAAE,CAAC,CAAC;IAC7D,CAAC;IAED,kBAAkB,CAAC,SAAoB;QACnC,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAiB,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,UAAU,EAAE,EAAE,EAAC,SAAS,EAAE,SAAS,EAAC,CAAC,CAAC,CAAC;IACrG,CAAC;IAED;;;;;OAKG;IACH,sBAAsB,CAAC,WAA2B,EAAE,QAAgB;QAChE,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CAAa,MAAM,CAAC,gBAAgB,CAAC,WAAW,EAAE,QAAQ,CAAC,CAAC,CAAC;IACpF,CAAC;IAED,eAAe,CAAC,WAA2B,EAAE,QAAgB,EAAE,OAA6B;QACxF,OAAO,IAAI,CAAC,GAAG,CAAC,GAAG,CACf,IAAI,CAAC,SAAS,CAAC,MAAM,CAAC,wBAAwB,CAAC,WAAW,EAAE,QAAQ,CAAC,EAAE,OAAO,CAAC,CAClF,CAAC;IACN,CAAC"}
@@ -49,7 +49,7 @@ export interface CreateCatalogConfigurationModel {
49
49
  /**
50
50
  * The configuration mapping of index fields to standard commerce fields
51
51
  */
52
- fieldsMapping: CatalogFieldsMapping;
52
+ fieldsMapping?: CatalogFieldsMapping;
53
53
  }
54
54
  export interface CatalogConfigurationModel {
55
55
  /**
@@ -75,11 +75,11 @@ export interface CatalogConfigurationModel {
75
75
  /**
76
76
  * The configuration mapping of index fields to standard commerce fields
77
77
  */
78
- fieldsMapping: CatalogFieldsMapping;
78
+ fieldsMapping?: CatalogFieldsMapping;
79
79
  /**
80
80
  * Catalogs associated to the configuration
81
81
  */
82
- associatedCatalogs: IAssociatedCatalogModel[];
82
+ associatedCatalogs?: IAssociatedCatalogModel[];
83
83
  }
84
84
  export interface IAssociatedCatalogModel {
85
85
  /**
@@ -187,15 +187,47 @@ export interface CatalogModel extends BaseCatalogModel {
187
187
  configuration?: CatalogConfigurationModel;
188
188
  }
189
189
  export type CreateCatalogModel = BaseCatalogModel & ({
190
+ /**
191
+ * @deprecated use `configuration.product` instead.
192
+ */
190
193
  product?: CreateProductHierarchyModel;
194
+ /**
195
+ * @deprecated use `configuration.variant` instead.
196
+ */
191
197
  variant?: CreateVariantHierarchyModel;
198
+ /**
199
+ * @deprecated use `configuration.availability` instead.
200
+ */
192
201
  availability?: CreateAvailabilityHierarchyModel;
202
+ /**
203
+ * The related catalog configuration id
204
+ */
193
205
  catalogConfigurationId?: never;
206
+ /**
207
+ * The catalog configuration
208
+ */
209
+ configuration: CreateCatalogConfigurationModel;
194
210
  } | {
211
+ /**
212
+ * @deprecated use `configuration.product` instead.
213
+ */
195
214
  product?: never;
215
+ /**
216
+ * @deprecated use `configuration.variant` instead.
217
+ */
196
218
  variant?: never;
219
+ /**
220
+ * @deprecated use `configuration.availability` instead.
221
+ */
197
222
  availability?: never;
223
+ /**
224
+ * The related catalog configuration id
225
+ */
198
226
  catalogConfigurationId: string;
227
+ /**
228
+ * The catalog configuration
229
+ */
230
+ configuration?: never;
199
231
  });
200
232
  export interface FieldsSuggestionsQueryModel {
201
233
  /**
@@ -1,12 +1,20 @@
1
1
  import { LicenseSection } from '../Enums.js';
2
2
  import Resource from '../Resource.js';
3
- import { AllLimitsModel, LimitHistoryDataPointModel, LimitHistoryOptions, LimitsModel, LimitType } from './LimitsInterfaces.js';
3
+ import { AllLimitsModel, LimitHistoryDataPointModel, LimitHistoryOptions, LimitsModel, LimitType, LimitModel } from './LimitsInterfaces.js';
4
4
  export default class Limits extends Resource {
5
5
  static getBaseUrl: () => string;
6
6
  static getWithSection: (sectionName: LicenseSection) => string;
7
7
  static getWithSectionAndHistory: (sectionName: LicenseSection, limitKey: string) => string;
8
+ static getSpecificLimit: (sectionName: LicenseSection, limitKey: string) => string;
8
9
  get(sectionName: LicenseSection): Promise<LimitsModel>;
9
10
  getAll(): Promise<AllLimitsModel>;
10
11
  getAllPerLimitType(limitType: LimitType): Promise<AllLimitsModel>;
12
+ /**
13
+ * Shows the status of a specific limit in an organization
14
+ *
15
+ * @param sectionName The name of the target license section
16
+ * @param limitKey The unique identifier of the target limit status to show
17
+ */
18
+ getSpecificLimitStatus(sectionName: LicenseSection, limitKey: string): Promise<LimitModel>;
11
19
  getHistoryLimit(sectionName: LicenseSection, limitKey: string, options?: LimitHistoryOptions): Promise<LimitHistoryDataPointModel[]>;
12
20
  }
@@ -2,7 +2,7 @@ export interface MLModelInfo<T extends MLModelTypeInfo = never> {
2
2
  id: string;
3
3
  info?: T;
4
4
  }
5
- export type MLModelTypeInfo = ModelInformationART | ModelInformationCC | ModelInformationDNE | ModelInformationER | ModelInformationPR | ModelInformationQS | ModelInformationSS;
5
+ export type MLModelTypeInfo = ModelInformationART | ModelInformationCC | ModelInformationDNE | ModelInformationER | ModelInformationPR | ModelInformationQS | ModelInformationSmartSnippets;
6
6
  export interface MetaInfo {
7
7
  modelName: string;
8
8
  version: string;
@@ -183,17 +183,11 @@ export interface ModelInformationQS {
183
183
  featureSelectLog: FeatureSelectLog;
184
184
  [key: string]: any;
185
185
  }
186
- export interface MetaInfoSS extends MetaInfo {
186
+ export interface MetaInfoSmartSnippets extends MetaInfo {
187
187
  modelId: string;
188
188
  engineName: string;
189
189
  modelSize: string;
190
190
  }
191
- export interface BuildingStatsSS {
192
- documentCount: number;
193
- snippetCount: number;
194
- headerCount: number;
195
- meanSnippetLength: number;
196
- }
197
191
  /**
198
192
  * Snippet details per document
199
193
  */
@@ -201,8 +195,6 @@ export interface SnippetsPerDocument {
201
195
  min: number;
202
196
  max: number;
203
197
  mean: number;
204
- median: number;
205
- p95: number;
206
198
  }
207
199
  export interface StatsSmartSnippets {
208
200
  /**
@@ -238,16 +230,29 @@ export interface StatsSmartSnippets {
238
230
  */
239
231
  snippetsPerDocument: SnippetsPerDocument;
240
232
  }
241
- export interface PreparationStatsSS extends StatsSmartSnippets {
233
+ export interface BuildingStatsSmartSnippets extends StatsSmartSnippets {
234
+ /**
235
+ * Number of documents with HTML headers
236
+ */
237
+ headerCount: number;
238
+ /**
239
+ * Average number of words per snippet
240
+ */
241
+ meanSnippetLength: number;
242
+ /**
243
+ * Additional stats related to each source
244
+ */
245
+ statsPerSource: StatsPerSource[];
246
+ }
247
+ export interface StatsPerSource extends StatsSmartSnippets {
242
248
  /**
243
- * Additional statistic per source
249
+ * Name of the source
244
250
  */
245
- statsPerSource: Record<string, StatsSmartSnippets>;
251
+ sourceName: string;
246
252
  }
247
- export interface ModelInformationSS {
248
- metaInfo: MetaInfoSS;
249
- modelBuildingStats: BuildingStatsSS;
250
- preparationStats: PreparationStatsSS;
253
+ export interface ModelInformationSmartSnippets {
254
+ metaInfo: MetaInfoSmartSnippets;
255
+ modelBuildingStats: BuildingStatsSmartSnippets;
251
256
  }
252
257
  export interface DatasetFieldDetails {
253
258
  numSamples: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@coveo/platform-client",
3
- "version": "41.0.0",
3
+ "version": "42.1.0",
4
4
  "description": "",
5
5
  "type": "module",
6
6
  "exports": {