ydb-embedded-ui 6.4.0 → 6.5.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (131) hide show
  1. package/README.md +1 -1
  2. package/dist/components/AsyncReplicationState/AsyncReplicationState.d.ts +6 -0
  3. package/dist/components/AsyncReplicationState/AsyncReplicationState.js +20 -0
  4. package/dist/components/AsyncReplicationState/index.d.ts +1 -0
  5. package/dist/components/AsyncReplicationState/index.js +1 -0
  6. package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.d.ts +6 -2
  7. package/dist/components/ButtonWithConfirmDialog/ButtonWithConfirmDialog.js +12 -3
  8. package/dist/components/Errors/ResponseError/ResponseError.js +3 -0
  9. package/dist/components/PDiskInfo/i18n/index.d.ts +1 -1
  10. package/dist/components/QueryExecutionStatus/QueryExecutionStatus.d.ts +1 -2
  11. package/dist/components/QueryExecutionStatus/QueryExecutionStatus.js +2 -1
  12. package/dist/components/VDiskInfo/i18n/index.d.ts +1 -1
  13. package/dist/containers/Clusters/Clusters.js +7 -2
  14. package/dist/containers/Clusters/constants.d.ts +1 -3
  15. package/dist/containers/Clusters/constants.js +0 -18
  16. package/dist/containers/PDiskPage/PDiskPage.js +2 -1
  17. package/dist/containers/PDiskPage/i18n/en.json +2 -1
  18. package/dist/containers/PDiskPage/i18n/index.d.ts +1 -1
  19. package/dist/containers/Tablet/TabletControls/TabletControls.js +3 -1
  20. package/dist/containers/Tablet/i18n/en.json +3 -0
  21. package/dist/containers/Tablet/i18n/index.d.ts +1 -1
  22. package/dist/containers/Tablet/i18n/index.js +1 -2
  23. package/dist/containers/Tablets/Tablets.js +2 -1
  24. package/dist/containers/Tablets/i18n/en.json +2 -1
  25. package/dist/containers/Tablets/i18n/index.d.ts +1 -1
  26. package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.d.ts +7 -0
  27. package/dist/containers/Tenant/Diagnostics/DiagnosticsPages.js +2 -0
  28. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.js +29 -18
  29. package/dist/containers/Tenant/Diagnostics/HotKeys/HotKeys.scss +14 -4
  30. package/dist/containers/Tenant/Diagnostics/HotKeys/i18n/en.json +2 -1
  31. package/dist/containers/Tenant/Diagnostics/HotKeys/i18n/index.d.ts +1 -1
  32. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/AsyncReplicationInfo.d.ts +7 -0
  33. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/AsyncReplicationInfo.js +39 -0
  34. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/Credentials.d.ts +6 -0
  35. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/Credentials.js +14 -0
  36. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/i18n/en.json +7 -0
  37. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/i18n/index.d.ts +2 -0
  38. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/i18n/index.js +4 -0
  39. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/index.d.ts +1 -0
  40. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationInfo/index.js +1 -0
  41. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.d.ts +7 -0
  42. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.js +34 -0
  43. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/AsyncReplicationPaths.scss +7 -0
  44. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/i18n/en.json +7 -0
  45. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/i18n/index.d.ts +2 -0
  46. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/i18n/index.js +4 -0
  47. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/index.d.ts +1 -0
  48. package/dist/containers/Tenant/Diagnostics/Overview/AsyncReplicationPaths/index.js +1 -0
  49. package/dist/containers/Tenant/Diagnostics/Overview/Overview.js +2 -0
  50. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopQueries.js +2 -1
  51. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantCpu/TopShards.js +2 -1
  52. package/dist/containers/Tenant/Diagnostics/TenantOverview/TenantStorage/TopTables.js +2 -1
  53. package/dist/containers/Tenant/Diagnostics/TenantOverview/i18n/index.d.ts +1 -1
  54. package/dist/containers/Tenant/Diagnostics/TopQueries/TopQueries.js +3 -3
  55. package/dist/containers/Tenant/Diagnostics/TopShards/TopShards.js +3 -3
  56. package/dist/containers/Tenant/ObjectSummary/ObjectSummary.js +20 -6
  57. package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.d.ts +2 -2
  58. package/dist/containers/Tenant/Query/ExecuteResult/ExecuteResult.js +5 -6
  59. package/dist/containers/Tenant/Query/ExplainResult/ExplainResult.js +5 -13
  60. package/dist/containers/Tenant/Query/Preview/Preview.js +2 -2
  61. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.d.ts +1 -7
  62. package/dist/containers/Tenant/Query/QueryEditor/QueryEditor.js +18 -19
  63. package/dist/containers/Tenant/Tenant.js +3 -2
  64. package/dist/containers/Tenant/utils/schema.js +8 -0
  65. package/dist/containers/Tenant/utils/schemaActions.js +1 -0
  66. package/dist/containers/Tenant/utils/schemaControls.js +1 -0
  67. package/dist/containers/VDiskPage/VDiskPage.js +2 -1
  68. package/dist/containers/VDiskPage/i18n/en.json +2 -1
  69. package/dist/containers/VDiskPage/i18n/index.d.ts +1 -1
  70. package/dist/services/api.d.ts +3 -3
  71. package/dist/services/settings.d.ts +1 -0
  72. package/dist/services/settings.js +2 -1
  73. package/dist/store/configureStore.d.ts +0 -4
  74. package/dist/store/defaultStore.d.ts +0 -2
  75. package/dist/store/reducers/authentication/authentication.d.ts +187 -7
  76. package/dist/store/reducers/authentication/authentication.js +12 -3
  77. package/dist/store/reducers/authentication/types.d.ts +5 -1
  78. package/dist/store/reducers/cluster/cluster.js +4 -0
  79. package/dist/store/reducers/executeQuery.d.ts +4 -63
  80. package/dist/store/reducers/executeQuery.js +38 -34
  81. package/dist/store/reducers/executeTopQueries/executeTopQueries.js +4 -1
  82. package/dist/store/reducers/explainQuery/explainQuery.d.ts +9 -0
  83. package/dist/store/reducers/explainQuery/explainQuery.js +32 -0
  84. package/dist/store/reducers/explainQuery/types.d.ts +12 -0
  85. package/dist/store/reducers/explainQuery/utils.d.ts +6 -0
  86. package/dist/store/reducers/explainQuery/utils.js +40 -0
  87. package/dist/store/reducers/healthcheckInfo/healthcheckInfo.d.ts +0 -20
  88. package/dist/store/reducers/host.d.ts +61 -2
  89. package/dist/store/reducers/index.d.ts +0 -3
  90. package/dist/store/reducers/index.js +0 -2
  91. package/dist/store/reducers/node/selectors.d.ts +0 -1
  92. package/dist/store/reducers/nodesList.d.ts +0 -1
  93. package/dist/store/reducers/olapStats.js +4 -1
  94. package/dist/store/reducers/preview.js +4 -1
  95. package/dist/store/reducers/schema/schema.d.ts +61 -2
  96. package/dist/store/reducers/schemaAcl/schemaAcl.d.ts +61 -2
  97. package/dist/store/reducers/shardsWorkload/shardsWorkload.js +4 -1
  98. package/dist/store/reducers/tablets.d.ts +0 -1
  99. package/dist/store/reducers/tabletsFilters.d.ts +61 -2
  100. package/dist/store/reducers/tenantOverview/executeTopTables/executeTopTables.js +6 -3
  101. package/dist/store/reducers/tenantOverview/topQueries/tenantOverviewTopQueries.js +6 -3
  102. package/dist/store/reducers/tenantOverview/topShards/tenantOverviewTopShards.js +6 -3
  103. package/dist/store/reducers/tenants/selectors.d.ts +0 -9
  104. package/dist/store/reducers/topic.d.ts +0 -15
  105. package/dist/store/utils.d.ts +2 -3
  106. package/dist/store/utils.js +1 -1
  107. package/dist/types/api/schema/replication.d.ts +74 -0
  108. package/dist/types/api/schema/replication.js +7 -0
  109. package/dist/types/api/schema/schema.d.ts +4 -1
  110. package/dist/types/api/schema/schema.js +1 -0
  111. package/dist/types/api/whoami.d.ts +6 -0
  112. package/dist/types/store/executeQuery.d.ts +2 -9
  113. package/dist/utils/constants.d.ts +1 -0
  114. package/dist/utils/constants.js +1 -0
  115. package/dist/utils/monaco/yql/constants.d.ts +2 -0
  116. package/dist/utils/monaco/yql/constants.js +33 -0
  117. package/dist/utils/monaco/yql/generateSuggestions.d.ts +1 -0
  118. package/dist/utils/monaco/yql/generateSuggestions.js +28 -11
  119. package/dist/utils/monaco/yql/yqlSuggestions.js +6 -1
  120. package/dist/utils/query.d.ts +5 -3
  121. package/dist/utils/query.js +27 -4
  122. package/dist/utils/response.d.ts +4 -0
  123. package/dist/utils/response.js +9 -0
  124. package/package.json +3 -3
  125. package/dist/containers/Tablet/i18n/ru.json +0 -10
  126. package/dist/store/reducers/explainQuery.d.ts +0 -145
  127. package/dist/store/reducers/explainQuery.js +0 -94
  128. package/dist/types/store/explainQuery.d.ts +0 -27
  129. package/dist/utils/error.d.ts +0 -2
  130. package/dist/utils/error.js +0 -13
  131. /package/dist/{types/store/explainQuery.js → store/reducers/explainQuery/types.js} +0 -0
@@ -13,7 +13,7 @@ import type { TNetInfo } from '../types/api/netInfo';
13
13
  import type { TNodesInfo } from '../types/api/nodes';
14
14
  import type { TEvNodesInfo } from '../types/api/nodesList';
15
15
  import type { TEvPDiskStateResponse } from '../types/api/pdisk';
16
- import type { Actions, ExplainActions, ExplainResponse, QueryAPIResponse, Schemas } from '../types/api/query';
16
+ import type { Actions, ErrorResponse, ExplainActions, ExplainResponse, QueryAPIResponse, Schemas } from '../types/api/query';
17
17
  import type { JsonRenderRequestParams, JsonRenderResponse } from '../types/api/render';
18
18
  import type { RestartPDiskResponse } from '../types/api/restartPDisk';
19
19
  import type { TEvDescribeSchemeResult } from '../types/api/schema';
@@ -94,8 +94,8 @@ export declare class YdbEmbeddedAPI extends AxiosWrapper {
94
94
  stats?: string;
95
95
  schema?: Schema;
96
96
  syntax?: QuerySyntax;
97
- }, { concurrentId, signal }?: AxiosOptions): Promise<QueryAPIResponse<Action, Schema>>;
98
- getExplainQuery<Action extends ExplainActions>(query: string, database: string, action: Action, syntax?: QuerySyntax): Promise<ExplainResponse<Action>>;
97
+ }, { concurrentId, signal }?: AxiosOptions): Promise<ErrorResponse | QueryAPIResponse<Action, Schema>>;
98
+ getExplainQuery<Action extends ExplainActions>(query: string, database: string, action: Action, syntax?: QuerySyntax): Promise<ErrorResponse | ExplainResponse<Action>>;
99
99
  getExplainQueryAst(query: string, database: string): Promise<import("../types/api/query").ExplainQueryResponse>;
100
100
  getHotKeys(path: string, enableSampling: boolean, { concurrentId, signal }?: AxiosOptions): Promise<JsonHotKeysResponse>;
101
101
  getHealthcheckInfo(database: string, { concurrentId, signal }?: AxiosOptions): Promise<HealthCheckAPIResponse>;
@@ -17,6 +17,7 @@ export declare const DEFAULT_USER_SETTINGS: {
17
17
  readonly useClusterBalancerAsBacked: true;
18
18
  readonly enableAutocomplete: false;
19
19
  readonly autocompleteOnEnter: true;
20
+ readonly isHotKeysHelpHidden: false;
20
21
  };
21
22
  declare class SettingsManager {
22
23
  /**
@@ -1,5 +1,5 @@
1
1
  import { TENANT_PAGES_IDS } from '../store/reducers/tenant/constants';
2
- import { ASIDE_HEADER_COMPACT_KEY, AUTOCOMPLETE_ON_ENTER, BINARY_DATA_IN_PLAIN_TEXT_DISPLAY, ENABLE_AUTOCOMPLETE, INVERTED_DISKS_KEY, LANGUAGE_KEY, LAST_USED_QUERY_ACTION_KEY, PARTITIONS_HIDDEN_COLUMNS_KEY, QUERY_INITIAL_MODE_KEY, QUERY_USE_MULTI_SCHEMA_KEY, SAVED_QUERIES_KEY, TENANT_INITIAL_PAGE_KEY, THEME_KEY, USE_BACKEND_PARAMS_FOR_TABLES_KEY, USE_CLUSTER_BALANCER_AS_BACKEND_KEY, USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY, } from '../utils/constants';
2
+ import { ASIDE_HEADER_COMPACT_KEY, AUTOCOMPLETE_ON_ENTER, BINARY_DATA_IN_PLAIN_TEXT_DISPLAY, ENABLE_AUTOCOMPLETE, INVERTED_DISKS_KEY, IS_HOTKEYS_HELP_HIDDDEN_KEY, LANGUAGE_KEY, LAST_USED_QUERY_ACTION_KEY, PARTITIONS_HIDDEN_COLUMNS_KEY, QUERY_INITIAL_MODE_KEY, QUERY_USE_MULTI_SCHEMA_KEY, SAVED_QUERIES_KEY, TENANT_INITIAL_PAGE_KEY, THEME_KEY, USE_BACKEND_PARAMS_FOR_TABLES_KEY, USE_CLUSTER_BALANCER_AS_BACKEND_KEY, USE_NODES_ENDPOINT_IN_DIAGNOSTICS_KEY, } from '../utils/constants';
3
3
  import { QUERY_ACTIONS, QUERY_MODES } from '../utils/query';
4
4
  import { parseJson } from '../utils/utils';
5
5
  /** User settings keys and their default values */
@@ -20,6 +20,7 @@ export const DEFAULT_USER_SETTINGS = {
20
20
  [USE_CLUSTER_BALANCER_AS_BACKEND_KEY]: true,
21
21
  [ENABLE_AUTOCOMPLETE]: false,
22
22
  [AUTOCOMPLETE_ON_ENTER]: true,
23
+ [IS_HOTKEYS_HELP_HIDDDEN_KEY]: false,
23
24
  };
24
25
  class SettingsManager {
25
26
  constructor() {
@@ -17,7 +17,6 @@ export declare function configureStore({ aRootReducer, singleClusterMode, api, }
17
17
  tenants: import("./reducers/tenants/types").TenantsState;
18
18
  partitions: import("./reducers/partitions/types").PartitionsState;
19
19
  executeQuery: import("../types/store/executeQuery").ExecuteQueryState;
20
- explainQuery: import("../types/store/explainQuery").ExplainQueryState;
21
20
  tabletsFilters: {
22
21
  loading: boolean;
23
22
  requestTime: number;
@@ -78,7 +77,6 @@ export declare function configureStore({ aRootReducer, singleClusterMode, api, }
78
77
  tenants: import("./reducers/tenants/types").TenantsState | undefined;
79
78
  partitions: import("./reducers/partitions/types").PartitionsState | undefined;
80
79
  executeQuery: never;
81
- explainQuery: never;
82
80
  tabletsFilters: {
83
81
  data: undefined;
84
82
  loading: boolean;
@@ -114,7 +112,6 @@ export declare function configureStore({ aRootReducer, singleClusterMode, api, }
114
112
  tenants: import("./reducers/tenants/types").TenantsState;
115
113
  partitions: import("./reducers/partitions/types").PartitionsState;
116
114
  executeQuery: import("../types/store/executeQuery").ExecuteQueryState;
117
- explainQuery: import("../types/store/explainQuery").ExplainQueryState;
118
115
  tabletsFilters: {
119
116
  loading: boolean;
120
117
  requestTime: number;
@@ -176,7 +173,6 @@ export declare function configureStore({ aRootReducer, singleClusterMode, api, }
176
173
  tenants: import("./reducers/tenants/types").TenantsState;
177
174
  partitions: import("./reducers/partitions/types").PartitionsState;
178
175
  executeQuery: import("../types/store/executeQuery").ExecuteQueryState;
179
- explainQuery: import("../types/store/explainQuery").ExplainQueryState;
180
176
  tabletsFilters: {
181
177
  loading: boolean;
182
178
  requestTime: number;
@@ -10,7 +10,6 @@ export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
10
10
  tenants: import("./reducers/tenants/types").TenantsState;
11
11
  partitions: import("./reducers/partitions/types").PartitionsState;
12
12
  executeQuery: import("../types/store/executeQuery").ExecuteQueryState;
13
- explainQuery: import("../types/store/explainQuery").ExplainQueryState;
14
13
  tabletsFilters: {
15
14
  loading: boolean;
16
15
  requestTime: number;
@@ -72,7 +71,6 @@ export declare const store: import("@reduxjs/toolkit").EnhancedStore<{
72
71
  tenants: import("./reducers/tenants/types").TenantsState;
73
72
  partitions: import("./reducers/partitions/types").PartitionsState;
74
73
  executeQuery: import("../types/store/executeQuery").ExecuteQueryState;
75
- explainQuery: import("../types/store/explainQuery").ExplainQueryState;
76
74
  tabletsFilters: {
77
75
  loading: boolean;
78
76
  requestTime: number;
@@ -16,7 +16,67 @@ export declare const FETCH_USER: {
16
16
  readonly FAILURE: "authentication/FETCH_USER_FAILURE";
17
17
  };
18
18
  declare const authentication: Reducer<AuthenticationState, AuthenticationAction>;
19
- export declare const authenticate: (user: string, password: string) => (dispatch: import("redux").Dispatch<import("redux").UnknownAction>, getState: () => {
19
+ export declare const authenticate: (user: string, password: string) => (dispatch: import("redux-thunk").ThunkDispatch<{
20
+ api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
21
+ singleClusterMode: boolean;
22
+ cluster: import("../cluster/types").ClusterState;
23
+ tenant: import("../tenant/types").TenantState;
24
+ tooltip: import("../../../types/store/tooltip").ITooltipState;
25
+ tablets: import("../../../types/store/tablets").TabletsState;
26
+ schema: import("../schema/types").SchemaState;
27
+ host: import("../../../types/store/host").IHostState;
28
+ tenants: import("../tenants/types").TenantsState;
29
+ partitions: import("../partitions/types").PartitionsState;
30
+ executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
31
+ tabletsFilters: {
32
+ loading: boolean;
33
+ requestTime: number;
34
+ data: undefined;
35
+ wasLoaded: boolean;
36
+ stateFilter: never[];
37
+ typeFilter: never[];
38
+ } | {
39
+ tabletsData: any;
40
+ nodes: any;
41
+ loading: boolean;
42
+ wasLoaded: boolean;
43
+ timeoutForRequest: number;
44
+ error: undefined;
45
+ data: undefined;
46
+ stateFilter: never[];
47
+ typeFilter: never[];
48
+ } | {
49
+ error: any;
50
+ loading: boolean;
51
+ data: undefined;
52
+ wasLoaded: boolean;
53
+ stateFilter: never[];
54
+ typeFilter: never[];
55
+ } | {
56
+ stateFilter: any;
57
+ data: undefined;
58
+ loading: boolean;
59
+ wasLoaded: boolean;
60
+ typeFilter: never[];
61
+ } | {
62
+ typeFilter: any;
63
+ data: undefined;
64
+ loading: boolean;
65
+ wasLoaded: boolean;
66
+ stateFilter: never[];
67
+ };
68
+ heatmap: import("../../../types/store/heatmap").IHeatmapState;
69
+ settings: import("../settings/types").SettingsState;
70
+ schemaAcl: import("../schemaAcl/types").SchemaAclState;
71
+ executeTopQueries: import("../executeTopQueries/types").TopQueriesFilters;
72
+ shardsWorkload: import("../shardsWorkload/types").ShardsWorkloadFilters;
73
+ hotKeys: import("../hotKeys/types").HotKeysState;
74
+ authentication: AuthenticationState;
75
+ header: import("../header/types").HeaderState;
76
+ saveQuery: string | null;
77
+ fullscreen: boolean;
78
+ clusters: import("../clusters/types").ClustersFilters;
79
+ }, undefined, import("redux").UnknownAction> & import("redux").Dispatch<any>, getState: () => {
20
80
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
21
81
  singleClusterMode: boolean;
22
82
  cluster: import("../cluster/types").ClusterState;
@@ -28,7 +88,6 @@ export declare const authenticate: (user: string, password: string) => (dispatch
28
88
  tenants: import("../tenants/types").TenantsState;
29
89
  partitions: import("../partitions/types").PartitionsState;
30
90
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
31
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
32
91
  tabletsFilters: {
33
92
  loading: boolean;
34
93
  requestTime: number;
@@ -78,7 +137,67 @@ export declare const authenticate: (user: string, password: string) => (dispatch
78
137
  fullscreen: boolean;
79
138
  clusters: import("../clusters/types").ClustersFilters;
80
139
  }) => Promise<unknown>;
81
- export declare const logout: () => (dispatch: import("redux").Dispatch<import("redux").UnknownAction>, getState: () => {
140
+ export declare const logout: () => (dispatch: import("redux-thunk").ThunkDispatch<{
141
+ api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
142
+ singleClusterMode: boolean;
143
+ cluster: import("../cluster/types").ClusterState;
144
+ tenant: import("../tenant/types").TenantState;
145
+ tooltip: import("../../../types/store/tooltip").ITooltipState;
146
+ tablets: import("../../../types/store/tablets").TabletsState;
147
+ schema: import("../schema/types").SchemaState;
148
+ host: import("../../../types/store/host").IHostState;
149
+ tenants: import("../tenants/types").TenantsState;
150
+ partitions: import("../partitions/types").PartitionsState;
151
+ executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
152
+ tabletsFilters: {
153
+ loading: boolean;
154
+ requestTime: number;
155
+ data: undefined;
156
+ wasLoaded: boolean;
157
+ stateFilter: never[];
158
+ typeFilter: never[];
159
+ } | {
160
+ tabletsData: any;
161
+ nodes: any;
162
+ loading: boolean;
163
+ wasLoaded: boolean;
164
+ timeoutForRequest: number;
165
+ error: undefined;
166
+ data: undefined;
167
+ stateFilter: never[];
168
+ typeFilter: never[];
169
+ } | {
170
+ error: any;
171
+ loading: boolean;
172
+ data: undefined;
173
+ wasLoaded: boolean;
174
+ stateFilter: never[];
175
+ typeFilter: never[];
176
+ } | {
177
+ stateFilter: any;
178
+ data: undefined;
179
+ loading: boolean;
180
+ wasLoaded: boolean;
181
+ typeFilter: never[];
182
+ } | {
183
+ typeFilter: any;
184
+ data: undefined;
185
+ loading: boolean;
186
+ wasLoaded: boolean;
187
+ stateFilter: never[];
188
+ };
189
+ heatmap: import("../../../types/store/heatmap").IHeatmapState;
190
+ settings: import("../settings/types").SettingsState;
191
+ schemaAcl: import("../schemaAcl/types").SchemaAclState;
192
+ executeTopQueries: import("../executeTopQueries/types").TopQueriesFilters;
193
+ shardsWorkload: import("../shardsWorkload/types").ShardsWorkloadFilters;
194
+ hotKeys: import("../hotKeys/types").HotKeysState;
195
+ authentication: AuthenticationState;
196
+ header: import("../header/types").HeaderState;
197
+ saveQuery: string | null;
198
+ fullscreen: boolean;
199
+ clusters: import("../clusters/types").ClustersFilters;
200
+ }, undefined, import("redux").UnknownAction> & import("redux").Dispatch<any>, getState: () => {
82
201
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
83
202
  singleClusterMode: boolean;
84
203
  cluster: import("../cluster/types").ClusterState;
@@ -90,7 +209,6 @@ export declare const logout: () => (dispatch: import("redux").Dispatch<import("r
90
209
  tenants: import("../tenants/types").TenantsState;
91
210
  partitions: import("../partitions/types").PartitionsState;
92
211
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
93
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
94
212
  tabletsFilters: {
95
213
  loading: boolean;
96
214
  requestTime: number;
@@ -140,7 +258,67 @@ export declare const logout: () => (dispatch: import("redux").Dispatch<import("r
140
258
  fullscreen: boolean;
141
259
  clusters: import("../clusters/types").ClustersFilters;
142
260
  }) => Promise<unknown>;
143
- export declare const getUser: () => (dispatch: import("redux").Dispatch<import("redux").UnknownAction>, getState: () => {
261
+ export declare const getUser: () => (dispatch: import("redux-thunk").ThunkDispatch<{
262
+ api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
263
+ singleClusterMode: boolean;
264
+ cluster: import("../cluster/types").ClusterState;
265
+ tenant: import("../tenant/types").TenantState;
266
+ tooltip: import("../../../types/store/tooltip").ITooltipState;
267
+ tablets: import("../../../types/store/tablets").TabletsState;
268
+ schema: import("../schema/types").SchemaState;
269
+ host: import("../../../types/store/host").IHostState;
270
+ tenants: import("../tenants/types").TenantsState;
271
+ partitions: import("../partitions/types").PartitionsState;
272
+ executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
273
+ tabletsFilters: {
274
+ loading: boolean;
275
+ requestTime: number;
276
+ data: undefined;
277
+ wasLoaded: boolean;
278
+ stateFilter: never[];
279
+ typeFilter: never[];
280
+ } | {
281
+ tabletsData: any;
282
+ nodes: any;
283
+ loading: boolean;
284
+ wasLoaded: boolean;
285
+ timeoutForRequest: number;
286
+ error: undefined;
287
+ data: undefined;
288
+ stateFilter: never[];
289
+ typeFilter: never[];
290
+ } | {
291
+ error: any;
292
+ loading: boolean;
293
+ data: undefined;
294
+ wasLoaded: boolean;
295
+ stateFilter: never[];
296
+ typeFilter: never[];
297
+ } | {
298
+ stateFilter: any;
299
+ data: undefined;
300
+ loading: boolean;
301
+ wasLoaded: boolean;
302
+ typeFilter: never[];
303
+ } | {
304
+ typeFilter: any;
305
+ data: undefined;
306
+ loading: boolean;
307
+ wasLoaded: boolean;
308
+ stateFilter: never[];
309
+ };
310
+ heatmap: import("../../../types/store/heatmap").IHeatmapState;
311
+ settings: import("../settings/types").SettingsState;
312
+ schemaAcl: import("../schemaAcl/types").SchemaAclState;
313
+ executeTopQueries: import("../executeTopQueries/types").TopQueriesFilters;
314
+ shardsWorkload: import("../shardsWorkload/types").ShardsWorkloadFilters;
315
+ hotKeys: import("../hotKeys/types").HotKeysState;
316
+ authentication: AuthenticationState;
317
+ header: import("../header/types").HeaderState;
318
+ saveQuery: string | null;
319
+ fullscreen: boolean;
320
+ clusters: import("../clusters/types").ClustersFilters;
321
+ }, undefined, import("redux").UnknownAction> & import("redux").Dispatch<any>, getState: () => {
144
322
  api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
145
323
  singleClusterMode: boolean;
146
324
  cluster: import("../cluster/types").ClusterState;
@@ -152,7 +330,6 @@ export declare const getUser: () => (dispatch: import("redux").Dispatch<import("
152
330
  tenants: import("../tenants/types").TenantsState;
153
331
  partitions: import("../partitions/types").PartitionsState;
154
332
  executeQuery: import("../../../types/store/executeQuery").ExecuteQueryState;
155
- explainQuery: import("../../../types/store/explainQuery").ExplainQueryState;
156
333
  tabletsFilters: {
157
334
  loading: boolean;
158
335
  requestTime: number;
@@ -201,5 +378,8 @@ export declare const getUser: () => (dispatch: import("redux").Dispatch<import("
201
378
  saveQuery: string | null;
202
379
  fullscreen: boolean;
203
380
  clusters: import("../clusters/types").ClustersFilters;
204
- }) => Promise<string | undefined>;
381
+ }) => Promise<{
382
+ user: string | undefined;
383
+ isUserAllowedToMakeChanges: boolean;
384
+ } | undefined>;
205
385
  export default authentication;
@@ -19,7 +19,9 @@ const authentication = (state = initialState, action) => {
19
19
  return Object.assign(Object.assign({}, state), { error: action.error });
20
20
  }
21
21
  case FETCH_USER.SUCCESS: {
22
- return Object.assign(Object.assign({}, state), { user: action.data });
22
+ const { user, isUserAllowedToMakeChanges } = action.data;
23
+ return Object.assign(Object.assign({}, state), { user,
24
+ isUserAllowedToMakeChanges });
23
25
  }
24
26
  default:
25
27
  return Object.assign({}, state);
@@ -42,8 +44,15 @@ export const getUser = () => {
42
44
  request: window.api.whoami(),
43
45
  actions: FETCH_USER,
44
46
  dataHandler: (data) => {
45
- const { UserSID, AuthType } = data;
46
- return AuthType === 'Login' ? UserSID : undefined;
47
+ const { UserSID, AuthType, IsMonitoringAllowed } = data;
48
+ return {
49
+ user: AuthType === 'Login' ? UserSID : undefined,
50
+ // If ydb version supports this feature,
51
+ // There should be explicit flag in whoami response
52
+ // Otherwise every user is allowed to make changes
53
+ // Anyway there will be guards on backend
54
+ isUserAllowedToMakeChanges: IsMonitoringAllowed !== false,
55
+ };
47
56
  },
48
57
  });
49
58
  };
@@ -3,7 +3,11 @@ import type { ApiRequestAction } from '../../utils';
3
3
  import type { FETCH_USER, SET_AUTHENTICATED, SET_UNAUTHENTICATED } from './authentication';
4
4
  export interface AuthenticationState {
5
5
  isAuthenticated: boolean;
6
+ isUserAllowedToMakeChanges?: boolean;
6
7
  user: string | undefined;
7
8
  error: AuthErrorResponse | undefined;
8
9
  }
9
- export type AuthenticationAction = ApiRequestAction<typeof SET_UNAUTHENTICATED, unknown, unknown> | ApiRequestAction<typeof SET_AUTHENTICATED, unknown, AuthErrorResponse> | ApiRequestAction<typeof FETCH_USER, string | undefined, unknown>;
10
+ export type AuthenticationAction = ApiRequestAction<typeof SET_UNAUTHENTICATED, unknown, unknown> | ApiRequestAction<typeof SET_AUTHENTICATED, unknown, AuthErrorResponse> | ApiRequestAction<typeof FETCH_USER, {
11
+ user: string | undefined;
12
+ isUserAllowedToMakeChanges: boolean;
13
+ }, unknown>;
@@ -1,6 +1,7 @@
1
1
  import { createSlice } from '@reduxjs/toolkit';
2
2
  import { clusterTabsIds, isClusterTab } from '../../../containers/Cluster/utils';
3
3
  import { DEFAULT_CLUSTER_TAB_KEY } from '../../../utils/constants';
4
+ import { isQueryErrorResponse } from '../../../utils/query';
4
5
  import { api } from '../api';
5
6
  import { createSelectClusterGroupsQuery, parseGroupsStatsQueryResponse } from './utils';
6
7
  const defaultClusterTabLS = localStorage.getItem(DEFAULT_CLUSTER_TAB_KEY);
@@ -54,6 +55,9 @@ export const clusterApi = api.injectEndpoints({
54
55
  database: clusterRoot,
55
56
  action: 'execute-scan',
56
57
  });
58
+ if (isQueryErrorResponse(groupsStatsResponse)) {
59
+ return { data: { clusterData } };
60
+ }
57
61
  return {
58
62
  data: {
59
63
  clusterData,
@@ -1,7 +1,7 @@
1
1
  import type { Reducer } from '@reduxjs/toolkit';
2
2
  import type { Schemas } from '../../types/api/query';
3
3
  import type { ExecuteQueryAction, ExecuteQueryState, ExecuteQueryStateSlice, QueryInHistory } from '../../types/store/executeQuery';
4
- import type { QueryMode, QueryRequestParams } from '../../types/store/query';
4
+ import type { IQueryResult, QueryMode, QueryRequestParams } from '../../types/store/query';
5
5
  export declare const SEND_QUERY: {
6
6
  readonly REQUEST: "query/SEND_QUERY_REQUEST";
7
7
  readonly SUCCESS: "query/SEND_QUERY_SUCCESS";
@@ -12,68 +12,9 @@ interface SendQueryParams extends QueryRequestParams {
12
12
  mode?: QueryMode;
13
13
  schema?: Schemas;
14
14
  }
15
- export declare const sendExecuteQuery: ({ query, database, mode, schema }: SendQueryParams) => (dispatch: import("redux").Dispatch<import("redux").UnknownAction>, getState: () => {
16
- api: import("@reduxjs/toolkit/query").CombinedState<{}, "All", "api">;
17
- singleClusterMode: boolean;
18
- cluster: import("./cluster/types").ClusterState;
19
- tenant: import("./tenant/types").TenantState;
20
- tooltip: import("../../types/store/tooltip").ITooltipState;
21
- tablets: import("../../types/store/tablets").TabletsState;
22
- schema: import("./schema/types").SchemaState;
23
- host: import("../../types/store/host").IHostState;
24
- tenants: import("./tenants/types").TenantsState;
25
- partitions: import("./partitions/types").PartitionsState;
26
- executeQuery: ExecuteQueryState;
27
- explainQuery: import("../../types/store/explainQuery").ExplainQueryState;
28
- tabletsFilters: {
29
- loading: boolean;
30
- requestTime: number;
31
- data: undefined;
32
- wasLoaded: boolean;
33
- stateFilter: never[];
34
- typeFilter: never[];
35
- } | {
36
- tabletsData: any;
37
- nodes: any;
38
- loading: boolean;
39
- wasLoaded: boolean;
40
- timeoutForRequest: number;
41
- error: undefined;
42
- data: undefined;
43
- stateFilter: never[];
44
- typeFilter: never[];
45
- } | {
46
- error: any;
47
- loading: boolean;
48
- data: undefined;
49
- wasLoaded: boolean;
50
- stateFilter: never[];
51
- typeFilter: never[];
52
- } | {
53
- stateFilter: any;
54
- data: undefined;
55
- loading: boolean;
56
- wasLoaded: boolean;
57
- typeFilter: never[];
58
- } | {
59
- typeFilter: any;
60
- data: undefined;
61
- loading: boolean;
62
- wasLoaded: boolean;
63
- stateFilter: never[];
64
- };
65
- heatmap: import("../../types/store/heatmap").IHeatmapState;
66
- settings: import("./settings/types").SettingsState;
67
- schemaAcl: import("./schemaAcl/types").SchemaAclState;
68
- executeTopQueries: import("./executeTopQueries/types").TopQueriesFilters;
69
- shardsWorkload: import("./shardsWorkload/types").ShardsWorkloadFilters;
70
- hotKeys: import("./hotKeys/types").HotKeysState;
71
- authentication: import("./authentication/types").AuthenticationState;
72
- header: import("./header/types").HeaderState;
73
- saveQuery: string | null;
74
- fullscreen: boolean;
75
- clusters: import("./clusters/types").ClustersFilters;
76
- }) => Promise<import("../../types/store/query").IQueryResult | undefined>;
15
+ export declare const executeQueryApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("./api")._NEVER, unknown, {}>, {
16
+ executeQuery: import("@reduxjs/toolkit/query").MutationDefinition<SendQueryParams, import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("./api")._NEVER, unknown, {}>, "All", IQueryResult, "api">;
17
+ }, "api", "All", typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/dist/query/react").reactHooksModuleName>;
77
18
  export declare const saveQueryToHistory: (queryText: string, mode: QueryMode) => {
78
19
  readonly type: "query/SAVE_QUERY_TO_HISTORY";
79
20
  readonly data: {
@@ -1,8 +1,8 @@
1
1
  import { settingsManager } from '../../services/settings';
2
2
  import { QUERIES_HISTORY_KEY } from '../../utils/constants';
3
- import { parseQueryError } from '../../utils/error';
4
- import { QUERY_MODES, QUERY_SYNTAX, parseQueryAPIExecuteResponse } from '../../utils/query';
5
- import { createApiRequest, createRequestActionTypes } from '../utils';
3
+ import { QUERY_MODES, QUERY_SYNTAX, isQueryErrorResponse, parseQueryAPIExecuteResponse, } from '../../utils/query';
4
+ import { createRequestActionTypes } from '../utils';
5
+ import { api } from './api';
6
6
  const MAXIMUM_QUERIES_IN_HISTORY = 20;
7
7
  export const SEND_QUERY = createRequestActionTypes('query', 'SEND_QUERY');
8
8
  const CHANGE_USER_INPUT = 'query/CHANGE_USER_INPUT';
@@ -26,15 +26,6 @@ const initialState = {
26
26
  };
27
27
  const executeQuery = (state = initialState, action) => {
28
28
  switch (action.type) {
29
- case SEND_QUERY.REQUEST: {
30
- return Object.assign(Object.assign({}, state), { loading: true, data: undefined, error: undefined });
31
- }
32
- case SEND_QUERY.SUCCESS: {
33
- return Object.assign(Object.assign({}, state), { data: action.data, stats: action.data.stats, loading: false, error: undefined });
34
- }
35
- case SEND_QUERY.FAILURE: {
36
- return Object.assign(Object.assign({}, state), { error: parseQueryError(action.error), loading: false });
37
- }
38
29
  case CHANGE_USER_INPUT: {
39
30
  return Object.assign(Object.assign({}, state), { input: action.data.input });
40
31
  }
@@ -76,29 +67,42 @@ const executeQuery = (state = initialState, action) => {
76
67
  return state;
77
68
  }
78
69
  };
79
- export const sendExecuteQuery = ({ query, database, mode, schema = 'modern' }) => {
80
- let action = 'execute';
81
- let syntax = QUERY_SYNTAX.yql;
82
- if (mode === 'pg') {
83
- action = 'execute-query';
84
- syntax = QUERY_SYNTAX.pg;
85
- }
86
- else if (mode) {
87
- action = `execute-${mode}`;
88
- }
89
- return createApiRequest({
90
- request: window.api.sendQuery({
91
- schema,
92
- query,
93
- database,
94
- action,
95
- syntax,
96
- stats: 'full',
70
+ export const executeQueryApi = api.injectEndpoints({
71
+ endpoints: (build) => ({
72
+ executeQuery: build.mutation({
73
+ queryFn: async ({ query, database, mode, schema = 'modern' }) => {
74
+ let action = 'execute';
75
+ let syntax = QUERY_SYNTAX.yql;
76
+ if (mode === 'pg') {
77
+ action = 'execute-query';
78
+ syntax = QUERY_SYNTAX.pg;
79
+ }
80
+ else if (mode) {
81
+ action = `execute-${mode}`;
82
+ }
83
+ try {
84
+ const response = await window.api.sendQuery({
85
+ schema,
86
+ query,
87
+ database,
88
+ action,
89
+ syntax,
90
+ stats: 'full',
91
+ });
92
+ if (isQueryErrorResponse(response)) {
93
+ return { error: response };
94
+ }
95
+ const data = parseQueryAPIExecuteResponse(response);
96
+ return { data };
97
+ }
98
+ catch (error) {
99
+ return { error };
100
+ }
101
+ },
97
102
  }),
98
- actions: SEND_QUERY,
99
- dataHandler: parseQueryAPIExecuteResponse,
100
- });
101
- };
103
+ }),
104
+ overrideExisting: 'throw',
105
+ });
102
106
  export const saveQueryToHistory = (queryText, mode) => {
103
107
  return {
104
108
  type: SAVE_QUERY_TO_HISTORY,
@@ -1,6 +1,6 @@
1
1
  import { createSlice } from '@reduxjs/toolkit';
2
2
  import { HOUR_IN_SECONDS } from '../../../utils/constants';
3
- import { parseQueryAPIExecuteResponse } from '../../../utils/query';
3
+ import { isQueryErrorResponse, parseQueryAPIExecuteResponse } from '../../../utils/query';
4
4
  import { api } from '../api';
5
5
  import { getFiltersConditions } from './utils';
6
6
  const initialState = {};
@@ -43,6 +43,9 @@ export const topQueriesApi = api.injectEndpoints({
43
43
  database,
44
44
  action: 'execute-scan',
45
45
  }, { signal });
46
+ if (isQueryErrorResponse(response)) {
47
+ return { error: response };
48
+ }
46
49
  const data = parseQueryAPIExecuteResponse(response);
47
50
  // FIXME: do we really need this?
48
51
  if (!(filters === null || filters === void 0 ? void 0 : filters.from) && !(filters === null || filters === void 0 ? void 0 : filters.to)) {
@@ -0,0 +1,9 @@
1
+ import type { QueryMode, QueryRequestParams } from '../../../types/store/query';
2
+ import type { PreparedExplainResponse } from './types';
3
+ interface ExplainQueryParams extends QueryRequestParams {
4
+ mode?: QueryMode;
5
+ }
6
+ export declare const explainQueryApi: import("@reduxjs/toolkit/query").Api<import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("../api")._NEVER, unknown, {}>, {
7
+ explainQuery: import("@reduxjs/toolkit/query").MutationDefinition<ExplainQueryParams, import("@reduxjs/toolkit/query").BaseQueryFn<void, typeof import("../api")._NEVER, unknown, {}>, "All", PreparedExplainResponse, "api">;
8
+ }, "api", "All", typeof import("@reduxjs/toolkit/query").coreModuleName | typeof import("@reduxjs/toolkit/dist/query/react").reactHooksModuleName>;
9
+ export {};
@@ -0,0 +1,32 @@
1
+ import { QUERY_SYNTAX, isQueryErrorResponse } from '../../../utils/query';
2
+ import { api } from '../api';
3
+ import { prepareExplainResponse } from './utils';
4
+ export const explainQueryApi = api.injectEndpoints({
5
+ endpoints: (build) => ({
6
+ explainQuery: build.mutation({
7
+ queryFn: async ({ query, database, mode }) => {
8
+ let action = 'explain';
9
+ let syntax = QUERY_SYNTAX.yql;
10
+ if (mode === 'pg') {
11
+ action = 'explain-query';
12
+ syntax = QUERY_SYNTAX.pg;
13
+ }
14
+ else if (mode) {
15
+ action = `explain-${mode}`;
16
+ }
17
+ try {
18
+ const response = await window.api.getExplainQuery(query, database, action, syntax);
19
+ if (isQueryErrorResponse(response)) {
20
+ return { error: response };
21
+ }
22
+ const data = prepareExplainResponse(response);
23
+ return { data };
24
+ }
25
+ catch (error) {
26
+ return { error };
27
+ }
28
+ },
29
+ }),
30
+ }),
31
+ overrideExisting: 'throw',
32
+ });
@@ -0,0 +1,12 @@
1
+ import type { ExplainPlanNodeData, GraphNode, Link } from '@gravity-ui/paranoid';
2
+ import type { PlanTable, QueryPlan, ScriptPlan } from '../../../types/api/query';
3
+ export interface PreparedExplainResponse {
4
+ plan?: {
5
+ links?: Link[];
6
+ nodes?: GraphNode<ExplainPlanNodeData>[];
7
+ tables?: PlanTable[];
8
+ version?: string;
9
+ pristine?: QueryPlan | ScriptPlan;
10
+ };
11
+ ast?: string;
12
+ }