elasticlink 1.0.0-beta.1 → 1.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.
- package/README.md +74 -31
- package/dist/index.cjs +1528 -0
- package/dist/index.cjs.map +1 -0
- package/dist/index.d.cts +1890 -0
- package/dist/index.d.cts.map +1 -0
- package/dist/index.d.ts +1889 -20
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1474 -18
- package/dist/index.js.map +1 -0
- package/package.json +27 -21
- package/dist/aggregation.builder.d.ts +0 -6
- package/dist/aggregation.builder.d.ts.map +0 -1
- package/dist/aggregation.builder.js +0 -81
- package/dist/aggregation.types.d.ts +0 -258
- package/dist/aggregation.types.d.ts.map +0 -1
- package/dist/aggregation.types.js +0 -6
- package/dist/bulk.builder.d.ts +0 -29
- package/dist/bulk.builder.d.ts.map +0 -1
- package/dist/bulk.builder.js +0 -51
- package/dist/bulk.types.d.ts +0 -47
- package/dist/bulk.types.d.ts.map +0 -1
- package/dist/bulk.types.js +0 -6
- package/dist/field.helpers.d.ts +0 -241
- package/dist/field.helpers.d.ts.map +0 -1
- package/dist/field.helpers.js +0 -333
- package/dist/field.types.d.ts +0 -348
- package/dist/field.types.d.ts.map +0 -1
- package/dist/field.types.js +0 -6
- package/dist/index-management.builder.d.ts +0 -38
- package/dist/index-management.builder.d.ts.map +0 -1
- package/dist/index-management.builder.js +0 -69
- package/dist/index-management.types.d.ts +0 -136
- package/dist/index-management.types.d.ts.map +0 -1
- package/dist/index-management.types.js +0 -6
- package/dist/mapping.builder.d.ts +0 -53
- package/dist/mapping.builder.d.ts.map +0 -1
- package/dist/mapping.builder.js +0 -39
- package/dist/mapping.types.d.ts +0 -200
- package/dist/mapping.types.d.ts.map +0 -1
- package/dist/mapping.types.js +0 -6
- package/dist/multi-search.builder.d.ts +0 -23
- package/dist/multi-search.builder.d.ts.map +0 -1
- package/dist/multi-search.builder.js +0 -48
- package/dist/multi-search.types.d.ts +0 -50
- package/dist/multi-search.types.d.ts.map +0 -1
- package/dist/multi-search.types.js +0 -6
- package/dist/query.builder.d.ts +0 -4
- package/dist/query.builder.d.ts.map +0 -1
- package/dist/query.builder.js +0 -329
- package/dist/query.types.d.ts +0 -468
- package/dist/query.types.d.ts.map +0 -1
- package/dist/query.types.js +0 -7
- package/dist/settings.presets.d.ts +0 -117
- package/dist/settings.presets.d.ts.map +0 -1
- package/dist/settings.presets.js +0 -137
- package/dist/suggester.builder.d.ts +0 -23
- package/dist/suggester.builder.d.ts.map +0 -1
- package/dist/suggester.builder.js +0 -51
- package/dist/suggester.types.d.ts +0 -90
- package/dist/suggester.types.d.ts.map +0 -1
- package/dist/suggester.types.js +0 -6
- package/dist/vector.types.d.ts +0 -17
- package/dist/vector.types.d.ts.map +0 -1
- package/dist/vector.types.js +0 -6
|
@@ -1,258 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type definitions for Aggregations
|
|
3
|
-
* Derived from official @elastic/elasticsearch types for accuracy and completeness.
|
|
4
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations.html
|
|
5
|
-
*/
|
|
6
|
-
import type { AggregationsTermsAggregation, AggregationsDateHistogramAggregation, AggregationsRangeAggregation, AggregationsHistogramAggregation, AggregationsAverageAggregation, AggregationsSumAggregation, AggregationsMinAggregation, AggregationsMaxAggregation, AggregationsCardinalityAggregation, AggregationsPercentilesAggregation, AggregationsStatsAggregation, AggregationsValueCountAggregation, AggregationsCalendarInterval, AggregationsExtendedStatsAggregation, AggregationsTopHitsAggregation, AggregationsAutoDateHistogramAggregation, AggregationsCompositeAggregation, AggregationsCompositeAggregationSource, AggregationsDateRangeAggregation, AggregationsFiltersAggregation, AggregationsSignificantTermsAggregation, AggregationsRareTermsAggregation, AggregationsMultiTermsAggregation, AggregationsGeoDistanceAggregation, AggregationsGeoHashGridAggregation, AggregationsGeoTileGridAggregation, AggregationsGeoBoundsAggregation, AggregationsGeoCentroidAggregation, AggregationsMissingAggregation, AggregationsTopMetricsAggregation, AggregationsWeightedAverageAggregation, AggregationsBucketScriptAggregation, AggregationsBucketSelectorAggregation, AggregationsDerivativeAggregation, AggregationsCumulativeSumAggregation, QueryDslQueryContainer } from '@elastic/elasticsearch/lib/api/types';
|
|
7
|
-
import type { FieldTypeString } from './index-management.types.js';
|
|
8
|
-
import type { DateFields, NumericFields, KeywordFields, BooleanFields, IpFields, TextFields, GeoPointFields, NestedPathFields, SubFieldsOf } from './mapping.types.js';
|
|
9
|
-
/**
|
|
10
|
-
* Options for terms aggregation (excludes 'field' which is handled by the builder)
|
|
11
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-terms-aggregation.html
|
|
12
|
-
*/
|
|
13
|
-
export type TermsAggOptions = Omit<AggregationsTermsAggregation, 'field'>;
|
|
14
|
-
/**
|
|
15
|
-
* Date histogram interval units — re-exported from official @elastic/elasticsearch types
|
|
16
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html
|
|
17
|
-
*/
|
|
18
|
-
export type DateHistogramInterval = AggregationsCalendarInterval;
|
|
19
|
-
/**
|
|
20
|
-
* Options for date_histogram aggregation (excludes 'field' which is handled by the builder)
|
|
21
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-datehistogram-aggregation.html
|
|
22
|
-
*/
|
|
23
|
-
export type DateHistogramAggOptions = Omit<AggregationsDateHistogramAggregation, 'field'>;
|
|
24
|
-
/**
|
|
25
|
-
* Options for range aggregation (excludes 'field' which is handled by the builder)
|
|
26
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-range-aggregation.html
|
|
27
|
-
*/
|
|
28
|
-
export type RangeAggOptions = Omit<AggregationsRangeAggregation, 'field'>;
|
|
29
|
-
/**
|
|
30
|
-
* Options for histogram aggregation (excludes 'field' which is handled by the builder)
|
|
31
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-histogram-aggregation.html
|
|
32
|
-
*/
|
|
33
|
-
export type HistogramAggOptions = Omit<AggregationsHistogramAggregation, 'field'>;
|
|
34
|
-
/**
|
|
35
|
-
* Options for avg aggregation (excludes 'field' which is handled by the builder)
|
|
36
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-avg-aggregation.html
|
|
37
|
-
*/
|
|
38
|
-
export type AvgAggOptions = Omit<AggregationsAverageAggregation, 'field'>;
|
|
39
|
-
/**
|
|
40
|
-
* Options for sum aggregation (excludes 'field' which is handled by the builder)
|
|
41
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-sum-aggregation.html
|
|
42
|
-
*/
|
|
43
|
-
export type SumAggOptions = Omit<AggregationsSumAggregation, 'field'>;
|
|
44
|
-
/**
|
|
45
|
-
* Options for min aggregation (excludes 'field' which is handled by the builder)
|
|
46
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-min-aggregation.html
|
|
47
|
-
*/
|
|
48
|
-
export type MinAggOptions = Omit<AggregationsMinAggregation, 'field'>;
|
|
49
|
-
/**
|
|
50
|
-
* Options for max aggregation (excludes 'field' which is handled by the builder)
|
|
51
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-max-aggregation.html
|
|
52
|
-
*/
|
|
53
|
-
export type MaxAggOptions = Omit<AggregationsMaxAggregation, 'field'>;
|
|
54
|
-
/**
|
|
55
|
-
* Options for cardinality aggregation (excludes 'field' which is handled by the builder)
|
|
56
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-cardinality-aggregation.html
|
|
57
|
-
*/
|
|
58
|
-
export type CardinalityAggOptions = Omit<AggregationsCardinalityAggregation, 'field'>;
|
|
59
|
-
/**
|
|
60
|
-
* Options for percentiles aggregation (excludes 'field' which is handled by the builder)
|
|
61
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-percentile-aggregation.html
|
|
62
|
-
*/
|
|
63
|
-
export type PercentilesAggOptions = Omit<AggregationsPercentilesAggregation, 'field'>;
|
|
64
|
-
/**
|
|
65
|
-
* Options for stats aggregation (excludes 'field' which is handled by the builder)
|
|
66
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-stats-aggregation.html
|
|
67
|
-
*/
|
|
68
|
-
export type StatsAggOptions = Omit<AggregationsStatsAggregation, 'field'>;
|
|
69
|
-
/**
|
|
70
|
-
* Options for value_count aggregation (excludes 'field' which is handled by the builder)
|
|
71
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-valuecount-aggregation.html
|
|
72
|
-
*/
|
|
73
|
-
export type ValueCountAggOptions = Omit<AggregationsValueCountAggregation, 'field'>;
|
|
74
|
-
/**
|
|
75
|
-
* Options for extended_stats aggregation (excludes 'field' which is handled by the builder)
|
|
76
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-extendedstats-aggregation.html
|
|
77
|
-
*/
|
|
78
|
-
export type ExtendedStatsAggOptions = Omit<AggregationsExtendedStatsAggregation, 'field'>;
|
|
79
|
-
/**
|
|
80
|
-
* Options for top_hits aggregation
|
|
81
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-metrics-top-hits-aggregation.html
|
|
82
|
-
*/
|
|
83
|
-
export type TopHitsAggOptions = AggregationsTopHitsAggregation;
|
|
84
|
-
/**
|
|
85
|
-
* Options for auto_date_histogram aggregation (excludes 'field' which is handled by the builder)
|
|
86
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-autodatehistogram-aggregation.html
|
|
87
|
-
*/
|
|
88
|
-
export type AutoDateHistogramAggOptions = Omit<AggregationsAutoDateHistogramAggregation, 'field'>;
|
|
89
|
-
/**
|
|
90
|
-
* Options for date_range aggregation (excludes 'field' which is handled by the builder).
|
|
91
|
-
* Complement to `range` for date-typed fields; supports date-math expressions in `ranges[].from`/`to`.
|
|
92
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-daterange-aggregation.html
|
|
93
|
-
*/
|
|
94
|
-
export type DateRangeAggOptions = Omit<AggregationsDateRangeAggregation, 'field'>;
|
|
95
|
-
/**
|
|
96
|
-
* Options for filters aggregation — multi-filter buckets. Distinct from the single-query
|
|
97
|
-
* `.filter(name, query)` metric-wrapping aggregation. `filters` creates one named bucket per
|
|
98
|
-
* supplied query, plus an optional `other_bucket` for non-matches.
|
|
99
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-filters-aggregation.html
|
|
100
|
-
*/
|
|
101
|
-
export type FiltersAggOptions = Omit<AggregationsFiltersAggregation, 'filters'>;
|
|
102
|
-
/**
|
|
103
|
-
* Options for significant_terms aggregation (excludes 'field' which is handled by the builder).
|
|
104
|
-
* Text-analytics staple — returns terms that are statistically significant in the foreground
|
|
105
|
-
* set relative to the background set.
|
|
106
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-significantterms-aggregation.html
|
|
107
|
-
*/
|
|
108
|
-
export type SignificantTermsAggOptions = Omit<AggregationsSignificantTermsAggregation, 'field'>;
|
|
109
|
-
/** Options for rare_terms aggregation (excludes 'field' which is handled by the builder) */
|
|
110
|
-
export type RareTermsAggOptions = Omit<AggregationsRareTermsAggregation, 'field'>;
|
|
111
|
-
/** Options for multi_terms aggregation — full passthrough (field is inside `terms` array) */
|
|
112
|
-
export type MultiTermsAggOptions = AggregationsMultiTermsAggregation;
|
|
113
|
-
/** Options for geo_distance aggregation (excludes 'field' which is handled by the builder) */
|
|
114
|
-
export type GeoDistanceAggOptions = Omit<AggregationsGeoDistanceAggregation, 'field'>;
|
|
115
|
-
/** Options for geohash_grid aggregation (excludes 'field' which is handled by the builder) */
|
|
116
|
-
export type GeohashGridAggOptions = Omit<AggregationsGeoHashGridAggregation, 'field'>;
|
|
117
|
-
/** Options for geotile_grid aggregation (excludes 'field' which is handled by the builder) */
|
|
118
|
-
export type GeotileGridAggOptions = Omit<AggregationsGeoTileGridAggregation, 'field'>;
|
|
119
|
-
/** Options for geo_bounds aggregation (excludes 'field' which is handled by the builder) */
|
|
120
|
-
export type GeoBoundsAggOptions = Omit<AggregationsGeoBoundsAggregation, 'field'>;
|
|
121
|
-
/** Options for geo_centroid aggregation (excludes 'field' which is handled by the builder) */
|
|
122
|
-
export type GeoCentroidAggOptions = Omit<AggregationsGeoCentroidAggregation, 'field'>;
|
|
123
|
-
/** Options for missing aggregation (excludes 'field' which is handled by the builder) */
|
|
124
|
-
export type MissingAggOptions = Omit<AggregationsMissingAggregation, 'field'>;
|
|
125
|
-
/** Options for top_metrics aggregation — full passthrough (metrics and sort in options) */
|
|
126
|
-
export type TopMetricsAggOptions = AggregationsTopMetricsAggregation;
|
|
127
|
-
/** Options for weighted_avg aggregation — full passthrough (value and weight in options) */
|
|
128
|
-
export type WeightedAvgAggOptions = AggregationsWeightedAverageAggregation;
|
|
129
|
-
/** Options for bucket_script pipeline aggregation — full passthrough */
|
|
130
|
-
export type BucketScriptAggOptions = AggregationsBucketScriptAggregation;
|
|
131
|
-
/** Options for bucket_selector pipeline aggregation — full passthrough */
|
|
132
|
-
export type BucketSelectorAggOptions = AggregationsBucketSelectorAggregation;
|
|
133
|
-
/** Options for derivative pipeline aggregation — full passthrough */
|
|
134
|
-
export type DerivativeAggOptions = AggregationsDerivativeAggregation;
|
|
135
|
-
/** Options for cumulative_sum pipeline aggregation — full passthrough */
|
|
136
|
-
export type CumulativeSumAggOptions = AggregationsCumulativeSumAggregation;
|
|
137
|
-
/**
|
|
138
|
-
* Source entry for composite aggregation — a named single-value source definition
|
|
139
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/search-aggregations-bucket-composite-aggregation.html
|
|
140
|
-
*/
|
|
141
|
-
export type CompositeAggSource = Record<string, AggregationsCompositeAggregationSource>;
|
|
142
|
-
/**
|
|
143
|
-
* Options for composite aggregation (excludes 'sources' which is handled by the builder)
|
|
144
|
-
*/
|
|
145
|
-
export type CompositeAggOptions = Omit<AggregationsCompositeAggregation, 'sources'>;
|
|
146
|
-
/**
|
|
147
|
-
* Aggregation state for build output
|
|
148
|
-
*/
|
|
149
|
-
export type AggregationState = {
|
|
150
|
-
[key: string]: any;
|
|
151
|
-
};
|
|
152
|
-
/**
|
|
153
|
-
* Shared metric and bucket aggregation methods.
|
|
154
|
-
* `Self` is the return type for each method — varies by context (root vs nested).
|
|
155
|
-
*/
|
|
156
|
-
export type BaseAggMethods<M extends Record<string, FieldTypeString>, Self> = {
|
|
157
|
-
terms: <K extends (KeywordFields<M> | NumericFields<M> | BooleanFields<M> | IpFields<M>) & string>(name: string, field: K, options?: TermsAggOptions) => Self;
|
|
158
|
-
dateHistogram: <K extends DateFields<M> & string>(name: string, field: K, options?: DateHistogramAggOptions) => Self;
|
|
159
|
-
range: <K extends (NumericFields<M> | DateFields<M>) & string>(name: string, field: K, options?: RangeAggOptions) => Self;
|
|
160
|
-
/** Date-range aggregation — complement to `range` for date-typed fields. Supports date-math in range bounds. */
|
|
161
|
-
dateRange: <K extends DateFields<M> & string>(name: string, field: K, options?: DateRangeAggOptions) => Self;
|
|
162
|
-
/**
|
|
163
|
-
* Multi-filter aggregation — creates one named bucket per supplied query, plus an optional
|
|
164
|
-
* `other_bucket` for non-matches. Distinct from the single-query `.filter(name, query)`.
|
|
165
|
-
*/
|
|
166
|
-
filters: (name: string, filters: Record<string, QueryDslQueryContainer>, options?: FiltersAggOptions) => Self;
|
|
167
|
-
/** Significant-terms aggregation — statistically significant terms relative to the background set. */
|
|
168
|
-
significantTerms: <K extends (KeywordFields<M> | TextFields<M>) & string>(name: string, field: K, options?: SignificantTermsAggOptions) => Self;
|
|
169
|
-
histogram: <K extends NumericFields<M> & string>(name: string, field: K, options?: HistogramAggOptions) => Self;
|
|
170
|
-
avg: <K extends NumericFields<M> & string>(name: string, field: K, options?: AvgAggOptions) => Self;
|
|
171
|
-
sum: <K extends NumericFields<M> & string>(name: string, field: K, options?: SumAggOptions) => Self;
|
|
172
|
-
min: <K extends NumericFields<M> & string>(name: string, field: K, options?: MinAggOptions) => Self;
|
|
173
|
-
max: <K extends NumericFields<M> & string>(name: string, field: K, options?: MaxAggOptions) => Self;
|
|
174
|
-
cardinality: <K extends (KeywordFields<M> | TextFields<M> | NumericFields<M> | DateFields<M> | BooleanFields<M> | IpFields<M>) & string>(name: string, field: K, options?: CardinalityAggOptions) => Self;
|
|
175
|
-
percentiles: <K extends NumericFields<M> & string>(name: string, field: K, options?: PercentilesAggOptions) => Self;
|
|
176
|
-
stats: <K extends NumericFields<M> & string>(name: string, field: K, options?: StatsAggOptions) => Self;
|
|
177
|
-
valueCount: <K extends (KeywordFields<M> | TextFields<M> | NumericFields<M> | DateFields<M> | BooleanFields<M> | IpFields<M>) & string>(name: string, field: K, options?: ValueCountAggOptions) => Self;
|
|
178
|
-
extendedStats: <K extends NumericFields<M> & string>(name: string, field: K, options?: ExtendedStatsAggOptions) => Self;
|
|
179
|
-
topHits: (name: string, options?: TopHitsAggOptions) => Self;
|
|
180
|
-
autoDateHistogram: <K extends DateFields<M> & string>(name: string, field: K, options?: AutoDateHistogramAggOptions) => Self;
|
|
181
|
-
composite: (name: string, sources: CompositeAggSource[], options?: CompositeAggOptions) => Self;
|
|
182
|
-
filter: (name: string, query: QueryDslQueryContainer) => Self;
|
|
183
|
-
/** Rare-terms aggregation — returns terms that are rare in the index (inverse of terms). */
|
|
184
|
-
rareTerms: <K extends (KeywordFields<M> | NumericFields<M> | IpFields<M>) & string>(name: string, field: K, options?: RareTermsAggOptions) => Self;
|
|
185
|
-
/** Multi-terms aggregation — creates buckets from combinations of multiple field values. */
|
|
186
|
-
multiTerms: (name: string, options: MultiTermsAggOptions) => Self;
|
|
187
|
-
/** Geo-distance aggregation — buckets documents by distance from an origin point. */
|
|
188
|
-
geoDistance: <K extends GeoPointFields<M> & string>(name: string, field: K, options: GeoDistanceAggOptions) => Self;
|
|
189
|
-
/** Geohash-grid aggregation — groups geo_point values into grid cells. */
|
|
190
|
-
geohashGrid: <K extends GeoPointFields<M> & string>(name: string, field: K, options?: GeohashGridAggOptions) => Self;
|
|
191
|
-
/** Geotile-grid aggregation — groups geo_point values into map tile cells. */
|
|
192
|
-
geotileGrid: <K extends GeoPointFields<M> & string>(name: string, field: K, options?: GeotileGridAggOptions) => Self;
|
|
193
|
-
/** Geo-bounds aggregation — computes the bounding box containing all geo_point values. */
|
|
194
|
-
geoBounds: <K extends GeoPointFields<M> & string>(name: string, field: K, options?: GeoBoundsAggOptions) => Self;
|
|
195
|
-
/** Geo-centroid aggregation — computes the weighted centroid of all geo_point values. */
|
|
196
|
-
geoCentroid: <K extends GeoPointFields<M> & string>(name: string, field: K, options?: GeoCentroidAggOptions) => Self;
|
|
197
|
-
/** Missing aggregation — counts documents with missing or null values for a field. */
|
|
198
|
-
missing: <K extends (KeywordFields<M> | TextFields<M> | NumericFields<M> | DateFields<M> | BooleanFields<M> | IpFields<M>) & string>(name: string, field: K, options?: MissingAggOptions) => Self;
|
|
199
|
-
/** Top-metrics aggregation — returns the top document's metrics sorted by a given criterion. */
|
|
200
|
-
topMetrics: (name: string, options: TopMetricsAggOptions) => Self;
|
|
201
|
-
/** Weighted-average aggregation — computes a weighted average of numeric values. */
|
|
202
|
-
weightedAvg: (name: string, options: WeightedAvgAggOptions) => Self;
|
|
203
|
-
/** Bucket-script pipeline aggregation — executes a script on bucket values from other aggs. */
|
|
204
|
-
bucketScript: (name: string, options: BucketScriptAggOptions) => Self;
|
|
205
|
-
/** Bucket-selector pipeline aggregation — filters buckets based on a script predicate. */
|
|
206
|
-
bucketSelector: (name: string, options: BucketSelectorAggOptions) => Self;
|
|
207
|
-
/** Derivative pipeline aggregation — calculates the derivative of a metric in a parent histogram/date_histogram. */
|
|
208
|
-
derivative: (name: string, options: DerivativeAggOptions) => Self;
|
|
209
|
-
/** Cumulative-sum pipeline aggregation — calculates the cumulative sum of a metric in a parent histogram/date_histogram. */
|
|
210
|
-
cumulativeSum: (name: string, options: CumulativeSumAggOptions) => Self;
|
|
211
|
-
build: () => AggregationState;
|
|
212
|
-
};
|
|
213
|
-
/**
|
|
214
|
-
* Root-level aggregation builder. Supports `global` and `nested`; does not expose `reverseNested`.
|
|
215
|
-
*
|
|
216
|
-
* Declared as an `interface` (not a `type` alias) so that TypeScript's lazy interface resolution
|
|
217
|
-
* handles the 3-way mutual recursion between `RootAggregationBuilder`, `NestedEntryBuilder`,
|
|
218
|
-
* and `NestedAggregationBuilder` without triggering TS2456 (circular type alias).
|
|
219
|
-
*/
|
|
220
|
-
export interface RootAggregationBuilder<M extends Record<string, FieldTypeString>> extends BaseAggMethods<M, RootAggregationBuilder<M>> {
|
|
221
|
-
/** Global aggregation — escapes the current filter context to aggregate across all documents.
|
|
222
|
-
* @remarks Only valid at the root aggregation level, not inside a nested context. */
|
|
223
|
-
global: (name: string) => RootAggregationBuilder<M>;
|
|
224
|
-
/** Nested aggregation — enters a nested document context for aggregating nested fields.
|
|
225
|
-
* Returns a `NestedEntryBuilder` whose `subAgg` callback receives the nested sub-field types. */
|
|
226
|
-
nested: <K extends NestedPathFields<M> & string>(name: string, path: K) => NestedEntryBuilder<M, SubFieldsOf<M, K>, RootAggregationBuilder<M>, M>;
|
|
227
|
-
/** Add sub-aggregation to the last bucket aggregation */
|
|
228
|
-
subAgg: (fn: (agg: RootAggregationBuilder<M>) => RootAggregationBuilder<M>) => RootAggregationBuilder<M>;
|
|
229
|
-
}
|
|
230
|
-
/**
|
|
231
|
-
* Returned by `.nested()` on a root or nested builder.
|
|
232
|
-
*
|
|
233
|
-
* Dual-context design: metric/bucket helpers inherited from `BaseAggMethods<M, R>` operate
|
|
234
|
-
* on the parent field map `M` (sibling aggregations), while the `subAgg` callback is typed
|
|
235
|
-
* to `NestedAggregationBuilder<N>`, giving it access only to the nested sub-fields `N`.
|
|
236
|
-
*
|
|
237
|
-
* `R` is the parent context — `RootAggregationBuilder<M>` when called from root,
|
|
238
|
-
* `NestedAggregationBuilder<M>` when called from inside a nested context.
|
|
239
|
-
*/
|
|
240
|
-
export interface NestedEntryBuilder<M extends Record<string, FieldTypeString>, N extends Record<string, FieldTypeString>, R = RootAggregationBuilder<M>, Root extends Record<string, FieldTypeString> = M> extends BaseAggMethods<M, R> {
|
|
241
|
-
global: (name: string) => RootAggregationBuilder<M>;
|
|
242
|
-
nested: <K extends NestedPathFields<M> & string>(name: string, path: K) => NestedEntryBuilder<M, SubFieldsOf<M, K>, R, Root>;
|
|
243
|
-
subAgg: (fn: (agg: NestedAggregationBuilder<N, Root>) => NestedAggregationBuilder<N, Root>) => R;
|
|
244
|
-
}
|
|
245
|
-
/**
|
|
246
|
-
* Nested-context aggregation builder. Supports `reverseNested` and nested-level `nested`;
|
|
247
|
-
* does not expose `global`.
|
|
248
|
-
*/
|
|
249
|
-
export interface NestedAggregationBuilder<N extends Record<string, FieldTypeString>, Root extends Record<string, FieldTypeString> = N> extends BaseAggMethods<N, NestedAggregationBuilder<N, Root>> {
|
|
250
|
-
/** Nested aggregation within a nested context — supports multi-level nesting */
|
|
251
|
-
nested: <K extends NestedPathFields<N> & string>(name: string, path: K) => NestedEntryBuilder<N, SubFieldsOf<N, K>, NestedAggregationBuilder<N, Root>, Root>;
|
|
252
|
-
/** Reverse nested aggregation — returns from a nested context back to the root document.
|
|
253
|
-
* @remarks Only valid inside a nested aggregation context. */
|
|
254
|
-
reverseNested: (name: string, path?: string) => NestedAggregationBuilder<Root, Root>;
|
|
255
|
-
/** Add sub-aggregation to the last bucket aggregation */
|
|
256
|
-
subAgg: (fn: (agg: NestedAggregationBuilder<N, Root>) => NestedAggregationBuilder<N, Root>) => NestedAggregationBuilder<N, Root>;
|
|
257
|
-
}
|
|
258
|
-
//# sourceMappingURL=aggregation.types.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"aggregation.types.d.ts","sourceRoot":"","s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,wBAAwB,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;CACxC"}
|
package/dist/bulk.builder.d.ts
DELETED
|
@@ -1,29 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bulk API builder
|
|
3
|
-
* Enables batching multiple index/create/update/delete operations
|
|
4
|
-
*/
|
|
5
|
-
import type { BulkOperationContainer, BulkUpdateAction } from '@elastic/elasticsearch/lib/api/types';
|
|
6
|
-
import type { FieldTypeString } from './index-management.types.js';
|
|
7
|
-
import type { MappingsSchema } from './mapping.types.js';
|
|
8
|
-
import { BulkBuilder } from './bulk.types.js';
|
|
9
|
-
/**
|
|
10
|
-
* Creates a bulk operations builder
|
|
11
|
-
* @returns BulkBuilder instance
|
|
12
|
-
*/
|
|
13
|
-
export declare const createBulkBuilder: <T>(operations?: Array<BulkOperationContainer | T | Partial<T> | BulkUpdateAction<T, Partial<T>>>) => BulkBuilder<T>;
|
|
14
|
-
/**
|
|
15
|
-
* Create a new bulk operations builder.
|
|
16
|
-
* `.build()` returns an NDJSON string (newline-delimited JSON) ready to POST to `/_bulk`.
|
|
17
|
-
* `.buildArray()` returns the raw operation objects if you need to inspect or transform them.
|
|
18
|
-
* @example
|
|
19
|
-
* const ndjson = bulk(productMappings)
|
|
20
|
-
* .index({ id: '1', name: 'Product 1' }, { _index: 'products', _id: '1' })
|
|
21
|
-
* .create({ id: '2', name: 'Product 2' }, { _index: 'products', _id: '2' })
|
|
22
|
-
* .update({ _index: 'products', _id: '3', doc: { name: 'Updated' } })
|
|
23
|
-
* .delete({ _index: 'products', _id: '4' })
|
|
24
|
-
* .build(); // POST to /_bulk with Content-Type: application/x-ndjson
|
|
25
|
-
*/
|
|
26
|
-
export declare const bulk: <M extends Record<string, FieldTypeString>>(_schema: MappingsSchema<M>) => BulkBuilder<{
|
|
27
|
-
[x: string]: unknown;
|
|
28
|
-
}>;
|
|
29
|
-
//# sourceMappingURL=bulk.builder.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bulk.builder.d.ts","sourceRoot":"","sources":["../src/bulk.builder.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,OAAO,KAAK,EAAE,sBAAsB,EAAE,gBAAgB,EAAE,MAAM,sCAAsC,CAAC;AACrG,OAAO,KAAK,EAAE,eAAe,EAAE,MAAM,6BAA6B,CAAC;AACnE,OAAO,KAAK,EAAE,cAAc,EAAS,MAAM,oBAAoB,CAAC;AAChE,OAAO,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAE9C;;;GAGG;AACH,eAAO,MAAM,iBAAiB,GAAI,CAAC,EACjC,aAAY,KAAK,CAAC,sBAAsB,GAAG,CAAC,GAAG,OAAO,CAAC,CAAC,CAAC,GAAG,gBAAgB,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAM,KAChG,WAAW,CAAC,CAAC,CAmCd,CAAC;AAEH;;;;;;;;;;;GAWG;AACH,eAAO,MAAM,IAAI,GAAI,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,eAAe,CAAC,EAAE,SAAS,cAAc,CAAC,CAAC,CAAC;;EAC3C,CAAC"}
|
package/dist/bulk.builder.js
DELETED
|
@@ -1,51 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Bulk API builder
|
|
3
|
-
* Enables batching multiple index/create/update/delete operations
|
|
4
|
-
*/
|
|
5
|
-
/**
|
|
6
|
-
* Creates a bulk operations builder
|
|
7
|
-
* @returns BulkBuilder instance
|
|
8
|
-
*/
|
|
9
|
-
export const createBulkBuilder = (operations = []) => ({
|
|
10
|
-
index: (doc, meta = {}) => {
|
|
11
|
-
return createBulkBuilder([...operations, { index: meta }, doc]);
|
|
12
|
-
},
|
|
13
|
-
create: (doc, meta = {}) => {
|
|
14
|
-
return createBulkBuilder([...operations, { create: meta }, doc]);
|
|
15
|
-
},
|
|
16
|
-
update: (meta) => {
|
|
17
|
-
const { doc, script, upsert, doc_as_upsert, detect_noop, scripted_upsert, _source, ...header } = meta;
|
|
18
|
-
const updateDoc = {
|
|
19
|
-
...(doc && { doc }),
|
|
20
|
-
...(script && { script }),
|
|
21
|
-
...(upsert && { upsert }),
|
|
22
|
-
...(doc_as_upsert !== undefined && { doc_as_upsert }),
|
|
23
|
-
...(detect_noop !== undefined && { detect_noop }),
|
|
24
|
-
...(scripted_upsert !== undefined && { scripted_upsert }),
|
|
25
|
-
...(_source !== undefined && { _source })
|
|
26
|
-
};
|
|
27
|
-
return createBulkBuilder([...operations, { update: header }, updateDoc]);
|
|
28
|
-
},
|
|
29
|
-
delete: (meta) => {
|
|
30
|
-
return createBulkBuilder([...operations, { delete: meta }]);
|
|
31
|
-
},
|
|
32
|
-
// eslint-disable-next-line functional/functional-parameters
|
|
33
|
-
build: () => {
|
|
34
|
-
return `${operations.map((op) => JSON.stringify(op)).join('\n')}\n`;
|
|
35
|
-
},
|
|
36
|
-
// eslint-disable-next-line functional/functional-parameters
|
|
37
|
-
buildArray: () => operations
|
|
38
|
-
});
|
|
39
|
-
/**
|
|
40
|
-
* Create a new bulk operations builder.
|
|
41
|
-
* `.build()` returns an NDJSON string (newline-delimited JSON) ready to POST to `/_bulk`.
|
|
42
|
-
* `.buildArray()` returns the raw operation objects if you need to inspect or transform them.
|
|
43
|
-
* @example
|
|
44
|
-
* const ndjson = bulk(productMappings)
|
|
45
|
-
* .index({ id: '1', name: 'Product 1' }, { _index: 'products', _id: '1' })
|
|
46
|
-
* .create({ id: '2', name: 'Product 2' }, { _index: 'products', _id: '2' })
|
|
47
|
-
* .update({ _index: 'products', _id: '3', doc: { name: 'Updated' } })
|
|
48
|
-
* .delete({ _index: 'products', _id: '4' })
|
|
49
|
-
* .build(); // POST to /_bulk with Content-Type: application/x-ndjson
|
|
50
|
-
*/
|
|
51
|
-
export const bulk = (_schema) => createBulkBuilder();
|
package/dist/bulk.types.d.ts
DELETED
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type definitions for Bulk API
|
|
3
|
-
* Derived from official @elastic/elasticsearch types for accuracy and completeness.
|
|
4
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
|
|
5
|
-
*/
|
|
6
|
-
import type { BulkIndexOperation, BulkCreateOperation, BulkOperationContainer, BulkUpdateOperation, BulkUpdateAction, BulkDeleteOperation } from '@elastic/elasticsearch/lib/api/types';
|
|
7
|
-
export type { BulkOperationContainer } from '@elastic/elasticsearch/lib/api/types';
|
|
8
|
-
/**
|
|
9
|
-
* Metadata for bulk index operation — re-exported from official @elastic/elasticsearch types
|
|
10
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
|
|
11
|
-
*/
|
|
12
|
-
export type BulkIndexMeta = BulkIndexOperation;
|
|
13
|
-
/**
|
|
14
|
-
* Metadata for bulk create operation — re-exported from official @elastic/elasticsearch types
|
|
15
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
|
|
16
|
-
*/
|
|
17
|
-
export type BulkCreateMeta = BulkCreateOperation;
|
|
18
|
-
/**
|
|
19
|
-
* Metadata for bulk update operation.
|
|
20
|
-
* Combines official BulkUpdateOperation (header) with BulkUpdateAction (body) for ergonomic API.
|
|
21
|
-
* The builder splits these into separate header and body when building the bulk request.
|
|
22
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
|
|
23
|
-
*/
|
|
24
|
-
export type BulkUpdateMeta<T> = BulkUpdateOperation & BulkUpdateAction<T, Partial<T>>;
|
|
25
|
-
/**
|
|
26
|
-
* Metadata for bulk delete operation — re-exported from official @elastic/elasticsearch types
|
|
27
|
-
* @see https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html
|
|
28
|
-
*/
|
|
29
|
-
export type BulkDeleteMeta = BulkDeleteOperation;
|
|
30
|
-
/**
|
|
31
|
-
* Bulk operations builder interface
|
|
32
|
-
*/
|
|
33
|
-
export type BulkBuilder<T> = {
|
|
34
|
-
/** Index a document (create or replace) */
|
|
35
|
-
index: (doc: T, meta?: BulkIndexMeta) => BulkBuilder<T>;
|
|
36
|
-
/** Create a new document (fails if already exists) */
|
|
37
|
-
create: (doc: T, meta?: BulkCreateMeta) => BulkBuilder<T>;
|
|
38
|
-
/** Update an existing document */
|
|
39
|
-
update: (meta: BulkUpdateMeta<T>) => BulkBuilder<T>;
|
|
40
|
-
/** Delete a document */
|
|
41
|
-
delete: (meta: BulkDeleteMeta) => BulkBuilder<T>;
|
|
42
|
-
/** Build as NDJSON string format for Elasticsearch */
|
|
43
|
-
build: () => string;
|
|
44
|
-
/** Build as array of operation headers and document bodies. Alternating operation/document pairs (except `delete` which is header-only). */
|
|
45
|
-
buildArray: () => Array<BulkOperationContainer | T | Partial<T> | BulkUpdateAction<T, Partial<T>>>;
|
|
46
|
-
};
|
|
47
|
-
//# sourceMappingURL=bulk.types.d.ts.map
|
package/dist/bulk.types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"bulk.types.d.ts","sourceRoot":"","sources":["../src/bulk.types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,KAAK,EACV,kBAAkB,EAClB,mBAAmB,EACnB,sBAAsB,EACtB,mBAAmB,EACnB,gBAAgB,EAChB,mBAAmB,EACpB,MAAM,sCAAsC,CAAC;AAC9C,YAAY,EAAE,sBAAsB,EAAE,MAAM,sCAAsC,CAAC;AAEnF;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,kBAAkB,CAAC;AAE/C;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAEjD;;;;;GAKG;AACH,MAAM,MAAM,cAAc,CAAC,CAAC,IAAI,mBAAmB,GAAG,gBAAgB,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;AAEtF;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,mBAAmB,CAAC;AAEjD;;GAEG;AACH,MAAM,MAAM,WAAW,CAAC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