@enonic-types/lib-node 7.11.0-RC3 → 7.11.0-RC4

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.
Files changed (2) hide show
  1. package/node.d.ts +17 -20
  2. package/package.json +2 -2
package/node.d.ts CHANGED
@@ -17,7 +17,7 @@ declare type WithRequiredProperty<T, K extends keyof T> = T & {
17
17
  [P in K]-?: T[P];
18
18
  };
19
19
  export interface Bucket {
20
- [subAggregationName: string]: BucketsAggregation | StatsAggregation | SingleValueMetricAggregation | string | number | undefined;
20
+ [subAggregationName: string]: AggregationsResult | string | number | undefined;
21
21
  key: string;
22
22
  docCount: number;
23
23
  }
@@ -29,20 +29,20 @@ export interface DateBucket extends Bucket {
29
29
  from?: string;
30
30
  to?: string;
31
31
  }
32
- export interface BucketsAggregation {
32
+ export interface BucketsAggregationResult {
33
33
  buckets: (DateBucket | NumericBucket)[];
34
34
  }
35
- export interface StatsAggregation {
35
+ export interface StatsAggregationResult {
36
36
  count: number;
37
37
  min: number;
38
38
  max: number;
39
39
  avg: number;
40
40
  sum: number;
41
41
  }
42
- export interface SingleValueMetricAggregation {
42
+ export interface SingleValueMetricAggregationResult {
43
43
  value: number;
44
44
  }
45
- export declare type AggregationsResult = BucketsAggregation | StatsAggregation | SingleValueMetricAggregation;
45
+ export declare type AggregationsResult = BucketsAggregationResult | StatsAggregationResult | SingleValueMetricAggregationResult;
46
46
  export declare type Aggregation = TermsAggregation | HistogramAggregation | DateHistogramAggregation | NumericRangeAggregation | DateRangeAggregation | StatsAggregation | GeoDistanceAggregation | MinAggregation | MaxAggregation | ValueCountAggregation;
47
47
  export interface TermsAggregation {
48
48
  terms: {
@@ -181,7 +181,6 @@ export interface BooleanFilter {
181
181
  };
182
182
  }
183
183
  export declare type Filter = ExistsFilter | NotExistsFilter | HasValueFilter | IdsFilter | BooleanFilter;
184
- export declare type Suggestion = TermSuggestion;
185
184
  export interface TermSuggestion {
186
185
  text: string;
187
186
  term: TermSuggestionOptions;
@@ -306,24 +305,22 @@ export interface NodeQueryResultHit {
306
305
  explanation?: Explanation;
307
306
  highlight?: HighlightResult;
308
307
  }
309
- export interface NodeQueryResultSuggestion {
310
- [suggestionName: string]: {
308
+ export interface SuggestionResult {
309
+ text: string;
310
+ length: number;
311
+ offset: number;
312
+ options: {
311
313
  text: string;
312
- length: number;
313
- offset: number;
314
- options: {
315
- text: string;
316
- score: number;
317
- freq?: number;
318
- }[];
314
+ score: number;
315
+ freq?: number;
319
316
  }[];
320
317
  }
321
318
  export interface NodeQueryResult {
322
319
  total: number;
323
320
  count: number;
324
321
  hits: NodeQueryResultHit[];
325
- aggregations?: AggregationsResult;
326
- suggestions?: NodeQueryResultSuggestion[];
322
+ aggregations?: Record<string, AggregationsResult>;
323
+ suggestions?: Record<string, SuggestionResult[]>;
327
324
  }
328
325
  export interface NodeMultiRepoQueryResult {
329
326
  total: number;
@@ -332,8 +329,8 @@ export interface NodeMultiRepoQueryResult {
332
329
  repoId: string;
333
330
  branch: string;
334
331
  })[];
335
- aggregations?: AggregationsResult;
336
- suggestions?: NodeQueryResultSuggestion[];
332
+ aggregations?: Record<string, AggregationsResult>;
333
+ suggestions?: Record<string, SuggestionResult[]>;
337
334
  }
338
335
  export declare type CreateNodeParams<NodeData = unknown> = {
339
336
  _name?: string;
@@ -398,7 +395,7 @@ export interface QueryNodeParams {
398
395
  sort?: string | SortDsl | SortDsl[];
399
396
  filters?: Filter | Filter[];
400
397
  aggregations?: Record<string, Aggregation>;
401
- suggestions?: Record<string, Suggestion>;
398
+ suggestions?: Record<string, TermSuggestion>;
402
399
  highlight?: Highlight;
403
400
  explain?: boolean;
404
401
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@enonic-types/lib-node",
3
- "version": "7.11.0-RC3",
3
+ "version": "7.11.0-RC4",
4
4
  "description": "Type definitions for lib-node.",
5
5
  "types": "node.d.ts",
6
6
  "files": [
@@ -27,7 +27,7 @@
27
27
  },
28
28
  "homepage": "https://github.com/enonic/xp/tree/master#readme",
29
29
  "dependencies": {
30
- "@enonic-types/core": "7.11.0-RC3"
30
+ "@enonic-types/core": "7.11.0-RC4"
31
31
  },
32
32
  "publishConfig": {
33
33
  "access": "public"