@@ -8,16 +8,16 @@ export interface CommonFields {
88 ast ?: AST ;
99 plan ?: Plan ;
1010 stats ?: Stats ;
11- } ;
11+ }
1212
1313interface DeprecatedCommonFields {
1414 stats ?: Stats ;
1515}
1616
17- export interface ErrorRepsonse {
17+ export interface ErrorResponse {
1818 error ?: any ;
1919 issues ?: any ;
20- } ;
20+ }
2121
2222export type ExecuteActions = 'execute-script' | 'execute' | 'execute-scan' | undefined ;
2323export type ExplainActions = 'explain' | 'explain-ast' ;
@@ -34,7 +34,7 @@ type CellValue = string | number | null | undefined;
3434
3535export type KeyValueRow < T = CellValue > = {
3636 [ key : string ] : T ;
37- }
37+ } ;
3838
3939export type ArrayRow < T = CellValue > = Array < T > ;
4040
@@ -63,17 +63,15 @@ export type ExecuteYdbResponse = {
6363 result : KeyValueRow [ ] ;
6464} & CommonFields ;
6565
66- type ExecuteResponse < Schema extends Schemas > =
66+ type ExecuteResponse < Schema extends Schemas > =
6767 | CommonFields // result can be undefined for queries like `insert into`
68- | (
69- Schema extends 'modern'
70- ? ExecuteModernResponse
71- : Schema extends 'ydb'
72- ? ExecuteYdbResponse
73- : Schema extends 'classic' | undefined
74- ? ExecuteClassicResponse
75- : unknown
76- ) ;
68+ | ( Schema extends 'modern'
69+ ? ExecuteModernResponse
70+ : Schema extends 'ydb'
71+ ? ExecuteYdbResponse
72+ : Schema extends 'classic' | undefined
73+ ? ExecuteClassicResponse
74+ : unknown ) ;
7775
7876// deprecated response from older versions, backward compatibility
7977
@@ -92,8 +90,9 @@ export type DeprecatedExecuteResponseDeep = {
9290// can be undefined for queries like `insert into`
9391export type DeprecatedExecuteResponsePlain = DeprecatedExecuteResponseValue | undefined ;
9492
95- export type DeprecatedExecuteResponse = DeprecatedExecuteResponseDeep | DeprecatedExecuteResponsePlain ;
96-
93+ export type DeprecatedExecuteResponse =
94+ | DeprecatedExecuteResponseDeep
95+ | DeprecatedExecuteResponsePlain ;
9796
9897// ==== EXPLAIN ====
9998
@@ -103,14 +102,12 @@ type ExplainResponse = CommonFields;
103102
104103// deprecated response from older versions, backward compatibility
105104
106- type DeprecatedExplainResponse < Action extends ExplainActions > = (
105+ type DeprecatedExplainResponse < Action extends ExplainActions > =
107106 Action extends 'explain-ast'
108107 ? ( { result : { ast : AST } } & Required < DeprecatedCommonFields > ) | { ast : AST }
109108 : Action extends 'explain'
110109 ? ( { result : Plan } & Required < DeprecatedCommonFields > ) | Plan
111- : unknown
112- ) ;
113-
110+ : unknown ;
114111
115112// ==== COMBINED API RESPONSE ====
116113
@@ -124,15 +121,14 @@ export type QueryAPIExplainResponse<Action extends ExplainActions> =
124121 | DeprecatedExplainResponse < Action >
125122 | null ;
126123
127- export type QueryAPIResponse < Action extends Actions , Schema extends Schemas = undefined > = (
124+ export type QueryAPIResponse < Action extends Actions , Schema extends Schemas = undefined > =
128125 Action extends ExecuteActions
129126 ? QueryAPIExecuteResponse < Schema >
130127 : Action extends ExplainActions
131128 ? QueryAPIExplainResponse < Action >
132- : unknown
133- ) ;
129+ : unknown ;
134130
135- export type AnyExecuteResponse =
131+ export type AnyExecuteResponse =
136132 | ExecuteModernResponse
137133 | ExecuteClassicResponse
138134 | ExecuteYdbResponse
@@ -146,13 +142,11 @@ export type DeepExecuteResponse =
146142 | ExecuteYdbResponse
147143 | DeprecatedExecuteResponseDeep ;
148144
149- export type AnyExplainResponse =
145+ export type AnyExplainResponse =
150146 | ExplainResponse
151147 | CommonFields
152148 | DeprecatedExplainResponse < 'explain' >
153149 | DeprecatedExplainResponse < 'explain-ast' >
154150 | null ;
155151
156- export type AnyResponse =
157- | AnyExecuteResponse
158- | AnyExplainResponse ;
152+ export type AnyResponse = AnyExecuteResponse | AnyExplainResponse ;
0 commit comments