@ytsaurus/ui 1.12.2 → 1.13.1

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 (176) hide show
  1. package/build/cjs/@types/core.d.ts +38 -0
  2. package/build/cjs/server/components/layout-config.js +6 -1
  3. package/build/cjs/server/components/layout-config.js.map +1 -1
  4. package/build/cjs/server/components/oauth.d.ts +26 -0
  5. package/build/cjs/server/components/oauth.js +123 -0
  6. package/build/cjs/server/components/oauth.js.map +1 -0
  7. package/build/cjs/server/components/yt-auth.d.ts +6 -0
  8. package/build/cjs/server/components/yt-auth.js +23 -0
  9. package/build/cjs/server/components/yt-auth.js.map +1 -0
  10. package/build/cjs/server/controllers/login.d.ts +0 -1
  11. package/build/cjs/server/controllers/login.js +4 -26
  12. package/build/cjs/server/controllers/login.js.map +1 -1
  13. package/build/cjs/server/controllers/logout.d.ts +2 -0
  14. package/build/cjs/server/controllers/logout.js +15 -0
  15. package/build/cjs/server/controllers/logout.js.map +1 -0
  16. package/build/cjs/server/controllers/oauth-login.d.ts +4 -0
  17. package/build/cjs/server/controllers/oauth-login.js +30 -0
  18. package/build/cjs/server/controllers/oauth-login.js.map +1 -0
  19. package/build/cjs/server/index.js +9 -1
  20. package/build/cjs/server/index.js.map +1 -1
  21. package/build/cjs/server/middlewares/authorization.d.ts +2 -0
  22. package/build/cjs/server/middlewares/authorization.js +42 -0
  23. package/build/cjs/server/middlewares/authorization.js.map +1 -0
  24. package/build/cjs/server/middlewares/oauth.d.ts +2 -0
  25. package/build/cjs/server/middlewares/oauth.js +27 -0
  26. package/build/cjs/server/middlewares/oauth.js.map +1 -0
  27. package/build/cjs/server/middlewares/yt-auth.d.ts +1 -1
  28. package/build/cjs/server/middlewares/yt-auth.js +10 -42
  29. package/build/cjs/server/middlewares/yt-auth.js.map +1 -1
  30. package/build/cjs/server/routes.js +6 -1
  31. package/build/cjs/server/routes.js.map +1 -1
  32. package/build/cjs/server/utils/authorization.d.ts +6 -0
  33. package/build/cjs/server/utils/authorization.js +33 -0
  34. package/build/cjs/server/utils/authorization.js.map +1 -0
  35. package/build/cjs/shared/constants/index.d.ts +3 -0
  36. package/build/cjs/shared/constants/index.js +3 -1
  37. package/build/cjs/shared/constants/index.js.map +1 -1
  38. package/build/cjs/shared/yt-types.d.ts +2 -0
  39. package/build/cjs/ui/components/Login/LoginFormPage/LoginFormPage.js +23 -5
  40. package/build/cjs/ui/components/Login/LoginFormPage/LoginFormPage.js.map +1 -1
  41. package/build/cjs/ui/components/Login/LoginPageWrapper/LoginPageWrapper.css +8 -0
  42. package/build/cjs/ui/components/Login/LoginPageWrapper/LoginPageWrapper.css.map +1 -1
  43. package/build/cjs/ui/components/NumberInput/NumberInput.d.ts +1 -1
  44. package/build/cjs/ui/containers/AppNavigation/AppNavigation.js +2 -0
  45. package/build/cjs/ui/containers/AppNavigation/AppNavigation.js.map +1 -1
  46. package/build/cjs/ui/containers/AppNavigation/AppNavigationComponent.d.ts +1 -1
  47. package/build/cjs/ui/containers/AppNavigation/AppNavigationComponent.js +5 -7
  48. package/build/cjs/ui/containers/AppNavigation/AppNavigationComponent.js.map +1 -1
  49. package/build/cjs/ui/containers/AppNavigation/AppNavigationPageLayout.d.ts +2 -0
  50. package/build/cjs/ui/containers/AppNavigation/AppNavigationPageLayout.js.map +1 -1
  51. package/build/cjs/ui/rum/constants.d.ts +5 -1
  52. package/build/cjs/ui/rum/constants.js +5 -2
  53. package/build/cjs/ui/rum/constants.js.map +1 -1
  54. package/build/cjs/ui/rum/rum-counter.js +1 -1
  55. package/build/cjs/ui/rum/rum-counter.js.map +1 -1
  56. package/build/cjs/ui/store/actions/system/masters.d.ts +7 -5
  57. package/build/cjs/ui/store/actions/system/masters.js +305 -235
  58. package/build/cjs/ui/store/actions/system/masters.js.map +1 -1
  59. package/build/cjs/ui/store/reducers/global/index.d.ts +1 -0
  60. package/build/cjs/ui/store/reducers/global/index.js +1 -0
  61. package/build/cjs/ui/store/reducers/global/index.js.map +1 -1
  62. package/build/cjs/ui/store/reducers/system/masters.d.ts +2 -2
  63. package/build/cjs/ui/store/reducers/system/masters.js.map +1 -1
  64. package/build/cjs/ui/store/selectors/global/index.d.ts +4 -0
  65. package/build/cjs/ui/store/selectors/global/index.js +14 -4
  66. package/build/cjs/ui/store/selectors/global/index.js.map +1 -1
  67. package/build/cjs/ui/store/selectors/system/masters.d.ts +1 -1
  68. package/build/cjs/ui/store/selectors/system/masters.js.map +1 -1
  69. package/build/esm/@types/core.d.ts +38 -0
  70. package/build/esm/server/components/layout-config.js +7 -2
  71. package/build/esm/server/components/layout-config.js.map +1 -1
  72. package/build/esm/server/components/oauth.d.ts +26 -0
  73. package/build/esm/server/components/oauth.js +169 -0
  74. package/build/esm/server/components/oauth.js.map +1 -0
  75. package/build/esm/server/components/yt-auth.d.ts +6 -0
  76. package/build/esm/server/components/yt-auth.js +17 -0
  77. package/build/esm/server/components/yt-auth.js.map +1 -0
  78. package/build/esm/server/controllers/login.d.ts +0 -1
  79. package/build/esm/server/controllers/login.js +41 -88
  80. package/build/esm/server/controllers/login.js.map +1 -1
  81. package/build/esm/server/controllers/logout.d.ts +2 -0
  82. package/build/esm/server/controllers/logout.js +11 -0
  83. package/build/esm/server/controllers/logout.js.map +1 -0
  84. package/build/esm/server/controllers/oauth-login.d.ts +4 -0
  85. package/build/esm/server/controllers/oauth-login.js +50 -0
  86. package/build/esm/server/controllers/oauth-login.js.map +1 -0
  87. package/build/esm/server/index.js +7 -2
  88. package/build/esm/server/index.js.map +1 -1
  89. package/build/esm/server/middlewares/authorization.d.ts +2 -0
  90. package/build/esm/server/middlewares/authorization.js +74 -0
  91. package/build/esm/server/middlewares/authorization.js.map +1 -0
  92. package/build/esm/server/middlewares/oauth.d.ts +2 -0
  93. package/build/esm/server/middlewares/oauth.js +50 -0
  94. package/build/esm/server/middlewares/oauth.js.map +1 -0
  95. package/build/esm/server/middlewares/yt-auth.d.ts +1 -1
  96. package/build/esm/server/middlewares/yt-auth.js +8 -58
  97. package/build/esm/server/middlewares/yt-auth.js.map +1 -1
  98. package/build/esm/server/routes.js +16 -2
  99. package/build/esm/server/routes.js.map +1 -1
  100. package/build/esm/server/utils/authorization.d.ts +6 -0
  101. package/build/esm/server/utils/authorization.js +28 -0
  102. package/build/esm/server/utils/authorization.js.map +1 -0
  103. package/build/esm/shared/constants/index.d.ts +3 -0
  104. package/build/esm/shared/constants/index.js +2 -1
  105. package/build/esm/shared/constants/index.js.map +1 -1
  106. package/build/esm/shared/yt-types.d.ts +2 -0
  107. package/build/esm/ui/components/Login/LoginFormPage/LoginFormPage.js +24 -6
  108. package/build/esm/ui/components/Login/LoginFormPage/LoginFormPage.js.map +1 -1
  109. package/build/esm/ui/components/Login/LoginPageWrapper/LoginPageWrapper.css +8 -0
  110. package/build/esm/ui/components/Login/LoginPageWrapper/LoginPageWrapper.css.map +1 -1
  111. package/build/esm/ui/components/Login/LoginPageWrapper/LoginPageWrapper.scss +12 -0
  112. package/build/esm/ui/components/NumberInput/NumberInput.d.ts +1 -1
  113. package/build/esm/ui/containers/AppNavigation/AppNavigation.js +3 -1
  114. package/build/esm/ui/containers/AppNavigation/AppNavigation.js.map +1 -1
  115. package/build/esm/ui/containers/AppNavigation/AppNavigationComponent.d.ts +1 -1
  116. package/build/esm/ui/containers/AppNavigation/AppNavigationComponent.js +5 -7
  117. package/build/esm/ui/containers/AppNavigation/AppNavigationComponent.js.map +1 -1
  118. package/build/esm/ui/containers/AppNavigation/AppNavigationPageLayout.d.ts +2 -0
  119. package/build/esm/ui/containers/AppNavigation/AppNavigationPageLayout.js.map +1 -1
  120. package/build/esm/ui/rum/constants.d.ts +5 -1
  121. package/build/esm/ui/rum/constants.js +5 -2
  122. package/build/esm/ui/rum/constants.js.map +1 -1
  123. package/build/esm/ui/rum/rum-counter.js +1 -1
  124. package/build/esm/ui/rum/rum-counter.js.map +1 -1
  125. package/build/esm/ui/store/actions/system/masters.d.ts +7 -5
  126. package/build/esm/ui/store/actions/system/masters.js +303 -233
  127. package/build/esm/ui/store/actions/system/masters.js.map +1 -1
  128. package/build/esm/ui/store/reducers/global/index.d.ts +1 -0
  129. package/build/esm/ui/store/reducers/global/index.js +1 -0
  130. package/build/esm/ui/store/reducers/global/index.js.map +1 -1
  131. package/build/esm/ui/store/reducers/system/masters.d.ts +2 -2
  132. package/build/esm/ui/store/reducers/system/masters.js.map +1 -1
  133. package/build/esm/ui/store/selectors/global/index.d.ts +4 -0
  134. package/build/esm/ui/store/selectors/global/index.js +12 -2
  135. package/build/esm/ui/store/selectors/global/index.js.map +1 -1
  136. package/build/esm/ui/store/selectors/system/masters.d.ts +1 -1
  137. package/build/esm/ui/store/selectors/system/masters.js.map +1 -1
  138. package/dist/public/build/assets-manifest.json +12 -12
  139. package/dist/public/build/css/{main.136a49c7.css → main.e919e247.css} +2 -2
  140. package/dist/public/build/css/main.e919e247.css.map +1 -0
  141. package/dist/public/build/js/89.07445d46.chunk.js +2 -0
  142. package/dist/public/build/js/89.07445d46.chunk.js.map +1 -0
  143. package/dist/public/build/js/main.4eb01db4.js +3 -0
  144. package/dist/public/build/js/{main.f91e3651.js.map → main.4eb01db4.js.map} +1 -1
  145. package/dist/public/build/js/{runtime.6c8d85d3.js → runtime.9491563b.js} +2 -2
  146. package/dist/public/build/js/{runtime.6c8d85d3.js.map → runtime.9491563b.js.map} +1 -1
  147. package/dist/public/build/manifest.json +8 -8
  148. package/dist/server/components/layout-config.js +6 -1
  149. package/dist/server/components/oauth.d.ts +26 -0
  150. package/dist/server/components/oauth.js +123 -0
  151. package/dist/server/components/yt-auth.d.ts +6 -0
  152. package/dist/server/components/yt-auth.js +23 -0
  153. package/dist/server/controllers/login.d.ts +0 -1
  154. package/dist/server/controllers/login.js +4 -26
  155. package/dist/server/controllers/logout.d.ts +2 -0
  156. package/dist/server/controllers/logout.js +15 -0
  157. package/dist/server/controllers/oauth-login.d.ts +4 -0
  158. package/dist/server/controllers/oauth-login.js +30 -0
  159. package/dist/server/index.js +9 -1
  160. package/dist/server/middlewares/authorization.d.ts +2 -0
  161. package/dist/server/middlewares/authorization.js +42 -0
  162. package/dist/server/middlewares/oauth.d.ts +2 -0
  163. package/dist/server/middlewares/oauth.js +27 -0
  164. package/dist/server/middlewares/yt-auth.d.ts +1 -1
  165. package/dist/server/middlewares/yt-auth.js +10 -42
  166. package/dist/server/routes.js +6 -1
  167. package/dist/server/utils/authorization.d.ts +6 -0
  168. package/dist/server/utils/authorization.js +33 -0
  169. package/dist/shared/constants/index.d.ts +3 -0
  170. package/dist/shared/constants/index.js +3 -1
  171. package/package.json +2 -2
  172. package/dist/public/build/css/main.136a49c7.css.map +0 -1
  173. package/dist/public/build/js/89.6ea87438.chunk.js +0 -2
  174. package/dist/public/build/js/89.6ea87438.chunk.js.map +0 -1
  175. package/dist/public/build/js/main.f91e3651.js +0 -3
  176. /package/dist/public/build/js/{main.f91e3651.js.LICENSE.txt → main.4eb01db4.js.LICENSE.txt} +0 -0
@@ -5,196 +5,238 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.FETCH_MASTER_DATA = exports.FETCH_MASTER_CONFIG = void 0;
7
7
  exports.loadMasters = loadMasters;
8
- var _sortBy2 = _interopRequireDefault(require("lodash/sortBy"));
9
- var _each2 = _interopRequireDefault(require("lodash/each"));
10
8
  var _reduce2 = _interopRequireDefault(require("lodash/reduce"));
11
- var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
12
9
  var _keys2 = _interopRequireDefault(require("lodash/keys"));
13
10
  var _map2 = _interopRequireDefault(require("lodash/map"));
11
+ var _toConsumableArray2 = _interopRequireDefault(require("@babel/runtime/helpers/toConsumableArray"));
14
12
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
15
13
  var _objectSpread2 = _interopRequireDefault(require("@babel/runtime/helpers/objectSpread2"));
14
+ var _sortBy2 = _interopRequireDefault(require("lodash/sortBy"));
15
+ var _each2 = _interopRequireDefault(require("lodash/each"));
16
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
17
+ var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
16
18
  var _ypath = _interopRequireDefault(require("../../../common/thor/ypath"));
17
19
  var _uikit = require("@gravity-ui/uikit");
18
20
  var _utils = _interopRequireDefault(require("../../../constants/utils"));
19
21
  var _index = require("../../../utils/index");
20
22
  var _utils2 = require("../../../utils/utils");
21
- var _yt = _interopRequireDefault(require("@ytsaurus/javascript-wrapper/lib/yt"));
23
+ var _constants = require("../../../rum/constants");
22
24
  var _rumWrapApi = require("../../../rum/rum-wrap-api");
23
- var _constants = require("../../../../shared/constants");
25
+ var _constants2 = require("../../../../shared/constants");
24
26
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
25
27
  var FETCH_MASTER_CONFIG = exports.FETCH_MASTER_CONFIG = (0, _utils.default)('MASTER_CONFIG');
26
28
  var FETCH_MASTER_DATA = exports.FETCH_MASTER_DATA = (0, _utils.default)('MASTER_DATA');
27
29
  var toaster = new _uikit.Toaster();
30
+ var NODE_DOES_NOT_EXIST = _constants.YTErrors.NODE_DOES_NOT_EXIST;
28
31
  function loadMastersConfig() {
29
- var requests = [{
30
- command: 'get',
31
- parameters: (0, _objectSpread2.default)({
32
- path: '//sys/primary_masters',
33
- attributes: ['annotations', 'maintenance', 'maintenance_message']
34
- }, _constants.USE_SUPRESS_SYNC)
35
- }, {
36
- command: 'get',
37
- parameters: (0, _objectSpread2.default)({
38
- path: '//sys/@cell_tag'
39
- }, _constants.USE_SUPRESS_SYNC)
40
- }, {
41
- command: 'get',
42
- parameters: (0, _objectSpread2.default)({
43
- path: '//sys/secondary_masters',
44
- attributes: ['annotations', 'maintenance', 'maintenance_message']
45
- }, _constants.USE_SUPRESS_SYNC)
46
- }, {
47
- command: 'get',
48
- parameters: (0, _objectSpread2.default)({
49
- path: '//sys/timestamp_providers',
50
- attributes: ['annotations', 'native_cell_tag', 'maintenance', 'maintenance_message']
51
- }, _constants.USE_SUPRESS_SYNC)
52
- }, {
53
- command: 'get',
54
- parameters: (0, _objectSpread2.default)({
55
- path: '//sys/discovery_servers',
56
- attributes: ['annotations', 'native_cell_tag']
57
- }, _constants.USE_SUPRESS_SYNC)
58
- }, {
59
- command: 'get',
60
- parameters: (0, _objectSpread2.default)({
61
- path: '//sys/queue_agents/instances',
62
- attributes: ['annotations', 'maintenance', 'maintenance_message']
63
- }, _constants.USE_SUPRESS_SYNC)
64
- }];
65
- return _rumWrapApi.ytApiV3Id.executeBatch(_rumWrapApi.YTApiId.systemMastersConfig, {
66
- requests: requests
67
- }).then(function (_ref) {
32
+ return _loadMastersConfig.apply(this, arguments);
33
+ }
34
+ function _loadMastersConfig() {
35
+ _loadMastersConfig = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2() {
68
36
  var _timestampProvidersRe, _queueAgentsResult$er;
69
- var _ref2 = (0, _slicedToArray2.default)(_ref, 6),
70
- primaryMasterResult = _ref2[0],
71
- primaryCellTagResult = _ref2[1],
72
- secondaryMastersResult = _ref2[2],
73
- timestampProvidersResult = _ref2[3],
74
- discoveryServersResult = _ref2[4],
75
- queueAgentsResult = _ref2[5];
76
- var batchError = (0, _utils2.getBatchError)([primaryMasterResult, primaryCellTagResult, secondaryMastersResult], "Masters' details cannot be loaded");
77
- if (batchError) {
78
- throw batchError;
79
- }
80
- var error = (0, _utils2.getBatchError)([timestampProvidersResult], 'Timestamp providers cannot be loaded');
81
- if (error && ((_timestampProvidersRe = timestampProvidersResult.error) === null || _timestampProvidersRe === void 0 ? void 0 : _timestampProvidersRe.code) !== _yt.default.codes.NODE_DOES_NOT_EXIST) {
82
- throw error;
83
- }
84
- var queueAgentsError = (0, _utils2.getBatchError)([queueAgentsResult], 'Queue agents cannot be loaded');
85
- if (queueAgentsError && ((_queueAgentsResult$er = queueAgentsResult.error) === null || _queueAgentsResult$er === void 0 ? void 0 : _queueAgentsResult$er.code) !== _yt.default.codes.NODE_DOES_NOT_EXIST) {
86
- throw queueAgentsError;
87
- }
88
- var primaryMaster = primaryMasterResult.output;
89
- var secondaryMasters = secondaryMastersResult.output;
90
- var primaryCellTag = primaryCellTagResult.output;
91
- var timestampProviders = !timestampProvidersResult.output ? {} : {
92
- addresses: (0, _map2.default)(_ypath.default.getValue(timestampProvidersResult.output), function (value, address) {
93
- return {
94
- host: address,
95
- physicalHost: _ypath.default.getValue(value, '/@annotations/physical_host'),
96
- attributes: _ypath.default.getValue(value, '/@')
97
- };
98
- }),
99
- cellTag: _ypath.default.getValue(timestampProvidersResult.output, '/@native_cell_tag')
100
- };
101
- return [{
102
- primaryMaster: {
103
- addresses: (0, _map2.default)((0, _keys2.default)(primaryMaster), function (address) {
104
- var value = primaryMaster[address];
105
- return {
106
- host: address,
107
- physicalHost: _ypath.default.getValue(value, '/@annotations/physical_host'),
108
- attributes: _ypath.default.getValue(value, '/@')
37
+ var requests, _yield$ytApiV3Id$exec, _yield$ytApiV3Id$exec2, primaryMasterResult, secondaryMastersResult, timestampProvidersResult, discoveryServersResult, queueAgentsResult, batchError, error, queueAgentsError, _ref3, timestamp_path, _ref4, primary_path, tag_cell_requests, _yield$ytApiV3Id$exec3, _yield$ytApiV3Id$exec4, primaryMasterCellTag, timestampProviderCellTag, primaryMaster, secondaryMasters, timestampProviders, mainResult, discoveryRequests, queueAgentsStateRequests, discoveryServersStatuses, queueAgentsStatuses, results, discoveryResults, queueAgentsStateResults;
38
+ return _regenerator.default.wrap(function _callee2$(_context2) {
39
+ while (1) switch (_context2.prev = _context2.next) {
40
+ case 0:
41
+ requests = [{
42
+ command: 'get',
43
+ parameters: (0, _objectSpread2.default)({
44
+ path: '//sys/primary_masters',
45
+ attributes: ['annotations', 'maintenance', 'maintenance_message']
46
+ }, _constants2.USE_SUPRESS_SYNC)
47
+ }, {
48
+ command: 'get',
49
+ parameters: (0, _objectSpread2.default)({
50
+ path: '//sys/secondary_masters',
51
+ attributes: ['annotations', 'maintenance', 'maintenance_message']
52
+ }, _constants2.USE_SUPRESS_SYNC)
53
+ }, {
54
+ command: 'get',
55
+ parameters: (0, _objectSpread2.default)({
56
+ path: '//sys/timestamp_providers',
57
+ attributes: ['annotations', 'maintenance', 'maintenance_message']
58
+ }, _constants2.USE_SUPRESS_SYNC)
59
+ }, {
60
+ command: 'get',
61
+ parameters: (0, _objectSpread2.default)({
62
+ path: '//sys/discovery_servers',
63
+ attributes: ['annotations', 'native_cell_tag']
64
+ }, _constants2.USE_SUPRESS_SYNC)
65
+ }, {
66
+ command: 'get',
67
+ parameters: (0, _objectSpread2.default)({
68
+ path: '//sys/queue_agents/instances',
69
+ attributes: ['annotations', 'maintenance', 'maintenance_message']
70
+ }, _constants2.USE_SUPRESS_SYNC)
71
+ }];
72
+ _context2.next = 3;
73
+ return _rumWrapApi.ytApiV3Id.executeBatch(_rumWrapApi.YTApiId.systemMastersConfig, {
74
+ requests: requests
75
+ });
76
+ case 3:
77
+ _yield$ytApiV3Id$exec = _context2.sent;
78
+ _yield$ytApiV3Id$exec2 = (0, _slicedToArray2.default)(_yield$ytApiV3Id$exec, 5);
79
+ primaryMasterResult = _yield$ytApiV3Id$exec2[0];
80
+ secondaryMastersResult = _yield$ytApiV3Id$exec2[1];
81
+ timestampProvidersResult = _yield$ytApiV3Id$exec2[2];
82
+ discoveryServersResult = _yield$ytApiV3Id$exec2[3];
83
+ queueAgentsResult = _yield$ytApiV3Id$exec2[4];
84
+ batchError = (0, _utils2.getBatchError)([primaryMasterResult, secondaryMastersResult], "Masters' details cannot be loaded");
85
+ if (!batchError) {
86
+ _context2.next = 13;
87
+ break;
88
+ }
89
+ throw batchError;
90
+ case 13:
91
+ error = (0, _utils2.getBatchError)([timestampProvidersResult], 'Timestamp providers cannot be loaded');
92
+ if (!(error && ((_timestampProvidersRe = timestampProvidersResult.error) === null || _timestampProvidersRe === void 0 ? void 0 : _timestampProvidersRe.code) !== NODE_DOES_NOT_EXIST)) {
93
+ _context2.next = 16;
94
+ break;
95
+ }
96
+ throw error;
97
+ case 16:
98
+ queueAgentsError = (0, _utils2.getBatchError)([queueAgentsResult], 'Queue agents cannot be loaded');
99
+ if (!(queueAgentsError && ((_queueAgentsResult$er = queueAgentsResult.error) === null || _queueAgentsResult$er === void 0 ? void 0 : _queueAgentsResult$er.code) !== NODE_DOES_NOT_EXIST)) {
100
+ _context2.next = 19;
101
+ break;
102
+ }
103
+ throw queueAgentsError;
104
+ case 19:
105
+ _ref3 = (0, _toConsumableArray2.default)(Object.keys(_ypath.default.getValue(timestampProvidersResult.output))), timestamp_path = _ref3[0];
106
+ _ref4 = (0, _toConsumableArray2.default)(Object.keys(_ypath.default.getValue(primaryMasterResult.output))), primary_path = _ref4[0];
107
+ tag_cell_requests = [{
108
+ command: 'get',
109
+ parameters: (0, _objectSpread2.default)({
110
+ path: "//sys/primary_masters/".concat(primary_path, "/orchid/config/primary_master/cell_id")
111
+ }, _constants2.USE_SUPRESS_SYNC)
112
+ }, {
113
+ command: 'get',
114
+ parameters: (0, _objectSpread2.default)({
115
+ path: "//sys/timestamp_providers/".concat(timestamp_path, "/orchid/config/clock_cell")
116
+ }, _constants2.USE_SUPRESS_SYNC)
117
+ }];
118
+ _context2.next = 24;
119
+ return _rumWrapApi.ytApiV3Id.executeBatch(_rumWrapApi.YTApiId.systemMastersConfig, {
120
+ requests: [].concat(tag_cell_requests)
121
+ });
122
+ case 24:
123
+ _yield$ytApiV3Id$exec3 = _context2.sent;
124
+ _yield$ytApiV3Id$exec4 = (0, _slicedToArray2.default)(_yield$ytApiV3Id$exec3, 2);
125
+ primaryMasterCellTag = _yield$ytApiV3Id$exec4[0];
126
+ timestampProviderCellTag = _yield$ytApiV3Id$exec4[1];
127
+ primaryMaster = primaryMasterResult.output;
128
+ secondaryMasters = secondaryMastersResult.output;
129
+ timestampProviders = !timestampProvidersResult.output ? {} : {
130
+ addresses: (0, _map2.default)(_ypath.default.getValue(timestampProvidersResult.output), function (value, address) {
131
+ return {
132
+ host: address,
133
+ physicalHost: _ypath.default.getValue(value, '/@annotations/physical_host'),
134
+ attributes: _ypath.default.getValue(value, '/@')
135
+ };
136
+ }),
137
+ cellTag: getCellIdTag(_ypath.default.getValue(timestampProviderCellTag.output).cell_id)
138
+ };
139
+ mainResult = {
140
+ primaryMaster: {
141
+ addresses: (0, _map2.default)((0, _keys2.default)(primaryMaster), function (address) {
142
+ var value = primaryMaster[address];
143
+ return {
144
+ host: address,
145
+ physicalHost: _ypath.default.getValue(value, '/@annotations/physical_host'),
146
+ attributes: _ypath.default.getValue(value, '/@')
147
+ };
148
+ }),
149
+ cellTag: getCellIdTag(primaryMasterCellTag.output)
150
+ },
151
+ secondaryMasters: (0, _map2.default)(secondaryMasters, function (addresses, cellTag) {
152
+ return {
153
+ addresses: (0, _map2.default)((0, _keys2.default)(addresses), function (address) {
154
+ var value = secondaryMasters[cellTag][address];
155
+ return {
156
+ host: address,
157
+ physicalHost: _ypath.default.getValue(value, '/@annotations/physical_host'),
158
+ attributes: _ypath.default.getValue(value, '/@')
159
+ };
160
+ }),
161
+ cellTag: Number(cellTag)
162
+ };
163
+ }),
164
+ timestampProviders: timestampProviders,
165
+ discoveryServers: {},
166
+ queueAgents: {}
109
167
  };
110
- }),
111
- cellTag: primaryCellTag
112
- },
113
- secondaryMasters: (0, _map2.default)(secondaryMasters, function (addresses, cellTag) {
114
- return {
115
- addresses: (0, _map2.default)((0, _keys2.default)(addresses), function (address) {
116
- var value = secondaryMasters[cellTag][address];
168
+ discoveryRequests = (0, _map2.default)(_ypath.default.getValue(discoveryServersResult.output), function (_v, address) {
117
169
  return {
118
- host: address,
119
- physicalHost: _ypath.default.getValue(value, '/@annotations/physical_host'),
120
- attributes: _ypath.default.getValue(value, '/@')
170
+ command: 'get',
171
+ parameters: (0, _objectSpread2.default)({
172
+ path: "//sys/discovery_servers/".concat(address, "/orchid/discovery_server")
173
+ }, _constants2.USE_SUPRESS_SYNC),
174
+ address: address
121
175
  };
122
- }),
123
- cellTag: Number(cellTag)
124
- };
125
- }),
126
- timestampProviders: timestampProviders
127
- }, discoveryServersResult, queueAgentsResult];
128
- }).then(function (_ref3) {
129
- var _ref4 = (0, _slicedToArray2.default)(_ref3, 3),
130
- mainResult = _ref4[0],
131
- discoveryServersResult = _ref4[1],
132
- queueAgentsResult = _ref4[2];
133
- var discoveryRequests = (0, _map2.default)(_ypath.default.getValue(discoveryServersResult.output), function (value, address) {
134
- return {
135
- command: 'get',
136
- parameters: (0, _objectSpread2.default)({
137
- path: "//sys/discovery_servers/".concat(address, "/orchid/discovery_server")
138
- }, _constants.USE_SUPRESS_SYNC),
139
- address: address
140
- };
141
- });
142
- var queueAgentsStateRequests = (0, _map2.default)(_ypath.default.getValue(queueAgentsResult.output), function (value, address) {
143
- return {
144
- command: 'get',
145
- parameters: (0, _objectSpread2.default)({
146
- path: "//sys/queue_agents/instances/".concat(address, "/orchid/cypress_synchronizer/active")
147
- }, _constants.USE_SUPRESS_SYNC),
148
- address: address
149
- };
150
- });
151
- return _rumWrapApi.ytApiV3Id.executeBatch(_rumWrapApi.YTApiId.systemMastersConfigDiscoveryServer, {
152
- requests: [].concat((0, _toConsumableArray2.default)(discoveryRequests), (0, _toConsumableArray2.default)(queueAgentsStateRequests))
153
- }).then(function (results) {
154
- var discoveryResults = results.slice(0, discoveryRequests.length);
155
- var queueAgentsStateResults = results.slice(discoveryRequests.length, queueAgentsStateRequests.length);
156
- var discoveryServersStatuses = (0, _reduce2.default)(discoveryResults, function (acc, item, key) {
157
- acc[discoveryRequests[key].address] = item !== null && item !== void 0 && item.error ? 'offline' : 'online';
158
- return acc;
159
- }, {});
160
- var queueAgentsStatuses = (0, _reduce2.default)(queueAgentsStateResults, function (acc, item, key) {
161
- acc[queueAgentsStateRequests[key].address] = typeof item.output !== 'undefined' ? item.output ? 'active' : 'standby' : 'offline';
162
- return acc;
163
- }, {});
164
- return [mainResult, discoveryServersResult, queueAgentsResult, discoveryServersStatuses, queueAgentsStatuses];
165
- })["catch"](function () {
166
- return [mainResult, discoveryServersResult, queueAgentsResult];
167
- });
168
- }).then(function (_ref5) {
169
- var _ref6 = (0, _slicedToArray2.default)(_ref5, 5),
170
- mainResult = _ref6[0],
171
- discoveryServersResult = _ref6[1],
172
- queueAgentsResult = _ref6[2],
173
- discoveryServersStatuses = _ref6[3],
174
- queueAgentsStatuses = _ref6[4];
175
- mainResult.discoveryServers = discoveryServersResult.output ? {
176
- addresses: (0, _map2.default)(_ypath.default.getValue(discoveryServersResult.output), function (value, address) {
177
- return {
178
- host: address,
179
- physicalHost: _ypath.default.getValue(value, '/@annotations/physical_host'),
180
- attributes: _ypath.default.getValue(value, '/@'),
181
- state: discoveryServersStatuses[address]
182
- };
183
- }),
184
- cellTag: _ypath.default.getValue(discoveryServersResult.output, '/@native_cell_tag')
185
- } : {};
186
- mainResult.queueAgents = queueAgentsResult.output ? {
187
- addresses: (0, _map2.default)(_ypath.default.getValue(queueAgentsResult.output), function (value, address) {
188
- return {
189
- host: address,
190
- physicalHost: _ypath.default.getValue(value, '/@annotations/physical_host'),
191
- attributes: _ypath.default.getValue(value, '/@'),
192
- state: queueAgentsStatuses[address]
193
- };
194
- })
195
- } : {};
196
- return mainResult;
197
- });
176
+ });
177
+ queueAgentsStateRequests = (0, _map2.default)(_ypath.default.getValue(queueAgentsResult.output), function (_v, address) {
178
+ return {
179
+ command: 'get',
180
+ parameters: (0, _objectSpread2.default)({
181
+ path: "//sys/queue_agents/instances/".concat(address, "/orchid/cypress_synchronizer/active")
182
+ }, _constants2.USE_SUPRESS_SYNC),
183
+ address: address
184
+ };
185
+ });
186
+ discoveryServersStatuses = {};
187
+ queueAgentsStatuses = {};
188
+ _context2.prev = 36;
189
+ _context2.next = 39;
190
+ return _rumWrapApi.ytApiV3Id.executeBatch(_rumWrapApi.YTApiId.systemMastersConfigDiscoveryServer, {
191
+ requests: [].concat((0, _toConsumableArray2.default)(discoveryRequests), (0, _toConsumableArray2.default)(queueAgentsStateRequests))
192
+ });
193
+ case 39:
194
+ results = _context2.sent;
195
+ discoveryResults = results.slice(0, discoveryRequests.length);
196
+ queueAgentsStateResults = results.slice(discoveryRequests.length, queueAgentsStateRequests.length);
197
+ discoveryServersStatuses = (0, _reduce2.default)(discoveryResults, function (acc, item, key) {
198
+ acc[discoveryRequests[key].address] = item !== null && item !== void 0 && item.error ? 'offline' : 'online';
199
+ return acc;
200
+ }, {});
201
+ queueAgentsStatuses = (0, _reduce2.default)(queueAgentsStateResults, function (acc, item, key) {
202
+ acc[queueAgentsStateRequests[key].address] = typeof item.output !== 'undefined' ? item.output ? 'active' : 'standby' : 'offline';
203
+ return acc;
204
+ }, {});
205
+ _context2.next = 48;
206
+ break;
207
+ case 46:
208
+ _context2.prev = 46;
209
+ _context2.t0 = _context2["catch"](36);
210
+ case 48:
211
+ mainResult.discoveryServers = discoveryServersResult.output ? {
212
+ addresses: (0, _map2.default)(_ypath.default.getValue(discoveryServersResult.output), function (value, address) {
213
+ return {
214
+ host: address,
215
+ physicalHost: _ypath.default.getValue(value, '/@annotations/physical_host'),
216
+ attributes: _ypath.default.getValue(value, '/@'),
217
+ state: discoveryServersStatuses[address]
218
+ };
219
+ }),
220
+ cellTag: _ypath.default.getValue(discoveryServersResult.output, '/@native_cell_tag')
221
+ } : {};
222
+ mainResult.queueAgents = queueAgentsResult.output ? {
223
+ addresses: (0, _map2.default)(_ypath.default.getValue(queueAgentsResult.output), function (value, address) {
224
+ return {
225
+ host: address,
226
+ physicalHost: _ypath.default.getValue(value, '/@annotations/physical_host'),
227
+ attributes: _ypath.default.getValue(value, '/@'),
228
+ state: queueAgentsStatuses[address]
229
+ };
230
+ })
231
+ } : {};
232
+ return _context2.abrupt("return", mainResult);
233
+ case 51:
234
+ case "end":
235
+ return _context2.stop();
236
+ }
237
+ }, _callee2, null, [[36, 46]]);
238
+ }));
239
+ return _loadMastersConfig.apply(this, arguments);
198
240
  }
199
241
  function loadHydra(requests, masterInfo, type, masterEntry) {
200
242
  var addresses = masterEntry.addresses,
@@ -214,8 +256,8 @@ function loadHydra(requests, masterInfo, type, masterEntry) {
214
256
  }
215
257
  (0, _each2.default)((0, _sortBy2.default)(addresses, function (address) {
216
258
  return address.host;
217
- }), function (_ref7) {
218
- var host = _ref7.host;
259
+ }), function (_ref) {
260
+ var host = _ref.host;
219
261
  masterInfo.push({
220
262
  host: host,
221
263
  type: type,
@@ -224,72 +266,100 @@ function loadHydra(requests, masterInfo, type, masterEntry) {
224
266
  requests.push({
225
267
  command: 'get',
226
268
  parameters: (0, _objectSpread2.default)({
227
- path: cypressPath + '/' + host + hydraPath,
228
- timeout: 5000
229
- }, _constants.USE_SUPRESS_SYNC)
269
+ path: cypressPath + '/' + host + hydraPath
270
+ }, _constants2.USE_SUPRESS_SYNC)
230
271
  });
231
272
  });
232
273
  }
233
274
  function loadMasters() {
234
- return function (dispatch) {
235
- dispatch({
236
- type: FETCH_MASTER_CONFIG.REQUEST
237
- });
238
- return loadMastersConfig().then(function (config) {
239
- dispatch({
240
- type: FETCH_MASTER_CONFIG.SUCCESS,
241
- data: config
242
- });
243
- dispatch({
244
- type: FETCH_MASTER_DATA.REQUEST
245
- });
246
- var masterDataRequests = [];
247
- var masterInfo = [];
248
- loadHydra(masterDataRequests, masterInfo, 'primary', config.primaryMaster);
249
- (0, _each2.default)(config.secondaryMasters, function (currentConfig) {
250
- loadHydra(masterDataRequests, masterInfo, 'secondary', currentConfig);
251
- });
252
- loadHydra(masterDataRequests, masterInfo, 'providers', config.timestampProviders);
253
- loadHydra(masterDataRequests, masterInfo, 'discovery', config.discoveryServers);
254
- return _rumWrapApi.ytApiV3Id.executeBatch(_rumWrapApi.YTApiId.systemMasters, {
255
- requests: masterDataRequests
256
- }).then(function (data) {
257
- dispatch({
258
- type: FETCH_MASTER_DATA.SUCCESS,
259
- data: {
260
- masterInfo: masterInfo,
261
- data: data
262
- }
263
- });
264
- });
265
- })["catch"](function (error) {
266
- var _error$response;
267
- dispatch({
268
- type: FETCH_MASTER_DATA.FAILURE,
269
- data: error
270
- });
271
- var data = (error === null || error === void 0 || (_error$response = error.response) === null || _error$response === void 0 ? void 0 : _error$response.data) || error;
272
- var code = data.code,
273
- message = data.message;
274
- toaster.add({
275
- name: 'load/system/masters',
276
- autoHiding: false,
277
- type: 'error',
278
- content: "[code ".concat(code, "] ").concat(message),
279
- title: 'Could not load Masters',
280
- actions: [{
281
- label: ' view',
282
- onClick: function onClick() {
283
- return (0, _utils2.showErrorPopup)(error);
284
- }
285
- }]
286
- });
287
- if ((0, _index.isRetryFutile)(error.code)) {
288
- return {
289
- isRetryFutile: true
290
- };
291
- }
292
- });
293
- };
275
+ return /*#__PURE__*/function () {
276
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(dispatch) {
277
+ var config, masterDataRequests, masterInfo, data, _response, _data, code, message;
278
+ return _regenerator.default.wrap(function _callee$(_context) {
279
+ while (1) switch (_context.prev = _context.next) {
280
+ case 0:
281
+ dispatch({
282
+ type: FETCH_MASTER_CONFIG.REQUEST
283
+ });
284
+ _context.prev = 1;
285
+ _context.next = 4;
286
+ return loadMastersConfig();
287
+ case 4:
288
+ config = _context.sent;
289
+ dispatch({
290
+ type: FETCH_MASTER_CONFIG.SUCCESS,
291
+ data: config
292
+ });
293
+ dispatch({
294
+ type: FETCH_MASTER_DATA.REQUEST
295
+ });
296
+ masterDataRequests = [];
297
+ masterInfo = [];
298
+ loadHydra(masterDataRequests, masterInfo, 'primary', config.primaryMaster);
299
+ (0, _each2.default)(config.secondaryMasters, function (currentConfig) {
300
+ loadHydra(masterDataRequests, masterInfo, 'secondary', currentConfig);
301
+ });
302
+ loadHydra(masterDataRequests, masterInfo, 'providers', config.timestampProviders);
303
+ loadHydra(masterDataRequests, masterInfo, 'discovery', config.discoveryServers);
304
+ _context.next = 15;
305
+ return _rumWrapApi.ytApiV3Id.executeBatch(_rumWrapApi.YTApiId.systemMasters, {
306
+ requests: masterDataRequests
307
+ });
308
+ case 15:
309
+ data = _context.sent;
310
+ dispatch({
311
+ type: FETCH_MASTER_DATA.SUCCESS,
312
+ data: {
313
+ masterInfo: masterInfo,
314
+ data: data
315
+ }
316
+ });
317
+ _context.next = 27;
318
+ break;
319
+ case 19:
320
+ _context.prev = 19;
321
+ _context.t0 = _context["catch"](1);
322
+ dispatch({
323
+ type: FETCH_MASTER_DATA.FAILURE,
324
+ data: _context.t0
325
+ });
326
+ _data = (_context.t0 === null || _context.t0 === void 0 || (_response = _context.t0.response) === null || _response === void 0 ? void 0 : _response.data) || _context.t0;
327
+ code = _data.code, message = _data.message;
328
+ toaster.add({
329
+ name: 'load/system/masters',
330
+ autoHiding: false,
331
+ type: 'error',
332
+ content: "[code ".concat(code, "] ").concat(message),
333
+ title: 'Could not load Masters',
334
+ actions: [{
335
+ label: ' view',
336
+ onClick: function onClick() {
337
+ return (0, _utils2.showErrorPopup)(_context.t0);
338
+ }
339
+ }]
340
+ });
341
+ if (!(0, _index.isRetryFutile)(_context.t0 === null || _context.t0 === void 0 ? void 0 : _context.t0.code)) {
342
+ _context.next = 27;
343
+ break;
344
+ }
345
+ return _context.abrupt("return", {
346
+ isRetryFutile: true
347
+ });
348
+ case 27:
349
+ case "end":
350
+ return _context.stop();
351
+ }
352
+ }, _callee, null, [[1, 19]]);
353
+ }));
354
+ return function (_x) {
355
+ return _ref2.apply(this, arguments);
356
+ };
357
+ }();
358
+ }
359
+ function getCellIdTag(uuid) {
360
+ var _uuid$split = uuid.split('-'),
361
+ _uuid$split2 = (0, _slicedToArray2.default)(_uuid$split, 3),
362
+ third = _uuid$split2[2];
363
+ return Number("0x".concat(third.substring(0, third.length - 4)));
294
364
  }
295
365
  // #sourceMappingURL=masters.js.map