Skip to content

Commit da5c6a9

Browse files
authored
Fix watcher.get_watch Response (elastic#321)
* Fix watcher.get_watch Response * make contrib * compilable * validated
1 parent e7f7277 commit da5c6a9

32 files changed

+478
-276
lines changed

output/schema/schema.json

+296-172
Large diffs are not rendered by default.

output/typescript/types.ts

+67-49
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ export interface Action {
3939
throttle_period?: Time
4040
throttle_period_in_millis?: EpochMillis
4141
transform?: TransformContainer
42-
index: ActionIndex
42+
index?: ActionIndex
43+
logging?: LoggingAction
4344
}
4445

4546
export type ActionExecutionMode = 'simulate' | 'force_simulate' | 'execute' | 'force_execute' | 'skip'
@@ -48,6 +49,7 @@ export type ActionExecutionState = 'awaits_execution' | 'checking' | 'execution_
4849

4950
export interface ActionIndex {
5051
index: IndexName
52+
doc_id?: Id
5153
}
5254

5355
export interface ActionStatus {
@@ -390,7 +392,7 @@ export interface ApiKeys {
390392
invalidated: boolean
391393
name: Name
392394
realm: string
393-
username: Name
395+
username: Username
394396
metadata?: Record<string, any>
395397
}
396398

@@ -2675,7 +2677,7 @@ export interface CcrUsage extends XPackUsage {
26752677
}
26762678

26772679
export interface ChainInput {
2678-
inputs: Record<string, InputContainer>
2680+
inputs: Array<InputContainer>
26792681
}
26802682

26812683
export interface ChainTransform {
@@ -3479,9 +3481,19 @@ export interface CompactNodeInfo {
34793481
}
34803482

34813483
export interface CompareCondition {
3482-
comparison: string
3483-
path: string
3484-
value: any
3484+
comparison?: string
3485+
path?: string
3486+
value?: any
3487+
'ctx.payload.match'?: CompareContextPayloadCondition
3488+
'ctx.payload.value'?: CompareContextPayloadCondition
3489+
}
3490+
3491+
export interface CompareContextPayloadCondition {
3492+
eq?: any
3493+
lt?: any
3494+
gt?: any
3495+
lte?: any
3496+
gte?: any
34853497
}
34863498

34873499
export interface CompletionProperty extends DocValuesPropertyBase {
@@ -6045,18 +6057,19 @@ export interface HtmlStripCharFilter extends CharFilterBase {
60456057
export type HttpHeaders = Record<string, string | Array<string>>
60466058

60476059
export interface HttpInput {
6048-
extract: Array<string>
6049-
request: HttpInputRequestDefinition
6050-
response_content_type: ResponseContentType
6060+
http?: HttpInput
6061+
extract?: Array<string>
6062+
request?: HttpInputRequestDefinition
6063+
response_content_type?: ResponseContentType
60516064
}
60526065

60536066
export interface HttpInputAuthentication {
60546067
basic: HttpInputBasicAuthentication
60556068
}
60566069

60576070
export interface HttpInputBasicAuthentication {
6058-
password: string
6059-
username: string
6071+
password: Password
6072+
username: Username
60606073
}
60616074

60626075
export type HttpInputMethod = 'head' | 'get' | 'post' | 'put' | 'delete'
@@ -6742,6 +6755,7 @@ export interface IndicesOptions {
67426755
allow_no_indices: boolean
67436756
expand_wildcards: ExpandWildcards
67446757
ignore_unavailable: boolean
6758+
ignore_throttled?: boolean
67456759
}
67466760

67476761
export interface IndicesPrivileges {
@@ -7171,7 +7185,7 @@ export interface InputContainer {
71717185
chain?: ChainInput
71727186
http?: HttpInput
71737187
search?: SearchInput
7174-
simple?: SimpleInput
7188+
simple?: Record<string, any>
71757189
}
71767190

71777191
export type InputType = 'http' | 'search' | 'simple'
@@ -7180,13 +7194,6 @@ export interface IntegerRangeProperty extends RangePropertyBase {
71807194
type: 'integer_range'
71817195
}
71827196

7183-
export interface Interval extends ScheduleBase {
7184-
factor: long
7185-
unit: IntervalUnit
7186-
}
7187-
7188-
export type IntervalUnit = 's' | 'm' | 'h' | 'd' | 'w'
7189-
71907197
export interface IntervalsAllOf {
71917198
intervals?: Array<IntervalsContainer>
71927199
max_gaps?: integer
@@ -7612,6 +7619,11 @@ export interface ListTasksResponse extends ResponseBase {
76127619
tasks?: Record<string, TaskInfo> | Array<TaskInfo>
76137620
}
76147621

7622+
export interface LoggingAction {
7623+
level: string
7624+
text: string
7625+
}
7626+
76157627
export interface LoggingActionResult {
76167628
logged_text: string
76177629
}
@@ -9435,6 +9447,8 @@ export interface PartitionScore {
94359447
record_score: double
94369448
}
94379449

9450+
export type Password = string
9451+
94389452
export interface PathHierarchyTokenizer extends TokenizerBase {
94399453
buffer_size: integer
94409454
delimiter: string
@@ -10478,7 +10492,7 @@ export interface ReloadSecureSettingsRequest extends RequestBase {
1047810492
node_id?: NodeIds
1047910493
timeout?: Time
1048010494
body?: {
10481-
secure_settings_password?: string
10495+
secure_settings_password?: Password
1048210496
}
1048310497
}
1048410498

@@ -10490,9 +10504,9 @@ export interface ReloadSecureSettingsResponse extends NodesResponseBase {
1049010504
export interface RemoteSource {
1049110505
connect_timeout: Time
1049210506
host: Host
10493-
password: string
10507+
username: Username
10508+
password: Password
1049410509
socket_timeout: Time
10495-
username: string
1049610510
}
1049710511

1049810512
export interface RemoveDuplicatesTokenFilter extends TokenFilterBase {
@@ -10880,7 +10894,7 @@ export interface ScheduleContainer {
1088010894
cron?: CronExpression
1088110895
daily?: DailySchedule
1088210896
hourly?: HourlySchedule
10883-
interval?: Interval
10897+
interval?: Time
1088410898
monthly?: Array<TimeOfMonth>
1088510899
weekly?: Array<TimeOfWeek>
1088610900
yearly?: Array<TimeOfYear>
@@ -11021,17 +11035,22 @@ export interface SearchAsYouTypeProperty extends CorePropertyBase {
1102111035
}
1102211036

1102311037
export interface SearchInput {
11024-
extract: Array<string>
11038+
extract?: Array<string>
1102511039
request: SearchInputRequestDefinition
11026-
timeout: Time
11040+
timeout?: Time
11041+
}
11042+
11043+
export interface SearchInputRequestBody {
11044+
query: QueryContainer
1102711045
}
1102811046

1102911047
export interface SearchInputRequestDefinition {
11030-
body?: SearchRequest
11048+
body?: SearchInputRequestBody
1103111049
indices?: Array<IndexName>
1103211050
indices_options?: IndicesOptions
1103311051
search_type?: SearchType
1103411052
template?: SearchTemplateRequest
11053+
rest_total_hits_as_int?: boolean
1103511054
}
1103611055

1103711056
export interface SearchNode {
@@ -11297,16 +11316,16 @@ export interface SecurityAuthenticateResponse extends ResponseBase {
1129711316
lookup_realm: RealmInfo
1129811317
metadata: Record<string, any>
1129911318
roles: Array<string>
11300-
username: Name
11319+
username: Username
1130111320
enabled: boolean
1130211321
authentication_type: string
1130311322
}
1130411323

1130511324
export interface SecurityChangePasswordRequest extends RequestBase {
11306-
username?: Name
11325+
username?: Username
1130711326
refresh?: Refresh
1130811327
body: {
11309-
password?: string
11328+
password?: Password
1131011329
}
1131111330
}
1131211331

@@ -11398,7 +11417,7 @@ export interface SecurityDeleteRoleResponse extends ResponseBase {
1139811417
}
1139911418

1140011419
export interface SecurityDeleteUserRequest extends RequestBase {
11401-
username: Name
11420+
username: Username
1140211421
refresh?: Refresh
1140311422
}
1140411423

@@ -11407,7 +11426,7 @@ export interface SecurityDeleteUserResponse extends ResponseBase {
1140711426
}
1140811427

1140911428
export interface SecurityDisableUserRequest extends RequestBase {
11410-
username: Name
11429+
username: Username
1141111430
refresh?: Refresh
1141211431
}
1141311432

@@ -11416,7 +11435,7 @@ export interface SecurityDisableUserResponse extends ResponseBase {
1141611435
}
1141711436

1141811437
export interface SecurityEnableUserRequest extends RequestBase {
11419-
username: Name
11438+
username: Username
1142011439
refresh?: Refresh
1142111440
}
1142211441

@@ -11433,7 +11452,7 @@ export interface SecurityGetApiKeyRequest extends RequestBase {
1143311452
name?: Name
1143411453
owner?: boolean
1143511454
realm_name?: Name
11436-
username?: Name
11455+
username?: Username
1143711456
}
1143811457

1143911458
export interface SecurityGetApiKeyResponse extends ResponseBase {
@@ -11475,10 +11494,10 @@ export interface SecurityGetTokenRequest extends RequestBase {
1147511494
body: {
1147611495
grant_type?: AccessTokenGrantType
1147711496
scope?: string
11478-
password?: string
11497+
password?: Password
1147911498
kerberos_ticket?: string
1148011499
refresh_token?: string
11481-
username?: string
11500+
username?: Username
1148211501
}
1148311502
}
1148411503

@@ -11505,7 +11524,7 @@ export interface SecurityGetUserPrivilegesResponse extends ResponseBase {
1150511524
}
1150611525

1150711526
export interface SecurityGetUserRequest extends RequestBase {
11508-
username?: Names
11527+
username?: Array<Username>
1150911528
}
1151011529

1151111530
export interface SecurityGetUserResponse extends DictionaryResponseBase<string, XPackUser> {
@@ -11516,8 +11535,8 @@ export interface SecurityGrantApiKeyRequest extends RequestBase {
1151611535
api_key: ApiKey
1151711536
grant_type: ApiKeyGrantType
1151811537
access_token?: string
11519-
username?: Name
11520-
password?: string
11538+
username?: Username
11539+
password?: Password
1152111540
}
1152211541
}
1152311542

@@ -11542,7 +11561,7 @@ export interface SecurityHasPrivilegesResponse extends ResponseBase {
1154211561
cluster: Record<string, boolean>
1154311562
has_all_requested: boolean
1154411563
index: Record<IndexName, Privileges>
11545-
username: string
11564+
username: Username
1154611565
}
1154711566

1154811567
export interface SecurityInvalidateApiKeyRequest extends RequestBase {
@@ -11552,7 +11571,7 @@ export interface SecurityInvalidateApiKeyRequest extends RequestBase {
1155211571
name?: Name
1155311572
owner?: boolean
1155411573
realm_name?: string
11555-
username?: Name
11574+
username?: Username
1155611575
}
1155711576
}
1155811577

@@ -11568,7 +11587,7 @@ export interface SecurityInvalidateTokenRequest extends RequestBase {
1156811587
token?: string
1156911588
refresh_token?: string
1157011589
realm_name?: Name
11571-
username?: Name
11590+
username?: Username
1157211591
}
1157311592
}
1157411593

@@ -11627,14 +11646,14 @@ export interface SecurityPutRoleResponse extends ResponseBase {
1162711646
}
1162811647

1162911648
export interface SecurityPutUserRequest extends RequestBase {
11630-
username: Name
11649+
username: Username
1163111650
refresh?: Refresh
1163211651
body: {
11633-
username?: Name
11652+
username?: Username
1163411653
email?: string | null
1163511654
full_name?: string | null
1163611655
metadata?: Record<string, any>
11637-
password?: string
11656+
password?: Password
1163811657
password_hash?: string
1163911658
roles?: Array<string>
1164011659
enabled?: boolean
@@ -12118,10 +12137,6 @@ export interface SignificantTextAggregation extends BucketAggregationBase {
1211812137
source_fields?: Fields
1211912138
}
1212012139

12121-
export interface SimpleInput {
12122-
payload: Record<string, any>
12123-
}
12124-
1212512140
export type SimpleQueryStringFlags = 'NONE' | 'AND' | 'OR' | 'NOT' | 'PREFIX' | 'PHRASE' | 'PRECEDENCE' | 'ESCAPE' | 'WHITESPACE' | 'FUZZY' | 'NEAR' | 'SLOP' | 'ALL'
1212612141

1212712142
export interface SimpleQueryStringQuery extends QueryBase {
@@ -13825,6 +13840,8 @@ export interface UserRealm {
1382513840
type: string
1382613841
}
1382713842

13843+
export type Username = string
13844+
1382813845
export type Uuid = string
1382913846

1383013847
export interface ValueAggregate extends AggregateBase {
@@ -13889,6 +13906,7 @@ export interface Watch {
1388913906
throttle_period?: string
1389013907
transform?: TransformContainer
1389113908
trigger: TriggerContainer
13909+
throttle_period_in_millis?: long
1389213910
}
1389313911

1389413912
export interface WatchRecord {
@@ -14262,7 +14280,7 @@ export interface XPackUser {
1426214280
full_name?: Name
1426314281
metadata: Record<string, any>
1426414282
roles: Array<string>
14265-
username: Name
14283+
username: Username
1426614284
enabled: boolean
1426714285
}
1426814286

Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Licensed to Elasticsearch B.V. under one or more contributor
3+
* license agreements. See the NOTICE file distributed with
4+
* this work for additional information regarding copyright
5+
* ownership. Elasticsearch B.V. licenses this file to you under
6+
* the Apache License, Version 2.0 (the "License"); you may
7+
* not use this file except in compliance with the License.
8+
* You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
export type Username = string
21+
export type Password = string

0 commit comments

Comments
 (0)