@riil-frontend/component-topology 11.0.30 → 11.0.31

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 (217) hide show
  1. package/build/1.js +2 -2
  2. package/build/2.js +1 -1
  3. package/build/index.css +2 -4
  4. package/build/index.js +34 -49
  5. package/es/components/MultiResourceDrawer/index.js +18 -16
  6. package/es/components/ResourceList/ResourceSelect.js +50 -48
  7. package/es/components/ResourceSelectDrawer/ResourceSelectDrawer.js +26 -24
  8. package/es/components/SingleResourceDrawer/SelectDrawer.js +20 -18
  9. package/es/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +25 -23
  10. package/es/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
  11. package/es/core/components/titlebar/widgets/TitleWidget.js +3 -5
  12. package/es/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
  13. package/es/core/editor/components/BackgroundView/index.js +129 -119
  14. package/es/core/editor/components/CustomIconPlugin/RenameDialog.js +22 -20
  15. package/es/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
  16. package/es/core/editor/components/CustomIconPlugin/utils/svgToShape.js +17 -15
  17. package/es/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +9 -7
  18. package/es/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
  19. package/es/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
  20. package/es/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
  21. package/es/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
  22. package/es/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +13 -11
  23. package/es/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +23 -21
  24. package/es/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
  25. package/es/core/editor/components/settings/propertyViews/view/BackgroundSize.js +12 -10
  26. package/es/core/editor/components/titlebar/TopoEditorTitleBar.js +27 -21
  27. package/es/core/editor/hooks/useKeyboardShortcut.js +2 -2
  28. package/es/core/editor/hooks/useNewElementTheme.js +2 -2
  29. package/es/core/editor/store/background.js +10 -8
  30. package/es/core/editor/store/topoEdit.js +6 -4
  31. package/es/core/editor/utils/edgeTypeStyleUtil.js +4 -2
  32. package/es/core/hooks/usePolling.js +121 -117
  33. package/es/core/hooks/useResourceConfig.js +66 -58
  34. package/es/core/hooks/useTopoEdit.js +511 -476
  35. package/es/core/models/Alarm.js +298 -281
  36. package/es/core/models/AttributeMetricDisplay.js +107 -101
  37. package/es/core/models/PluginManager.js +3 -4
  38. package/es/core/models/SelectionModel.js +5 -4
  39. package/es/core/models/TopoApp.js +240 -205
  40. package/es/core/models/TopoGraphView.js +21 -18
  41. package/es/core/models/cache/CiCache.js +27 -28
  42. package/es/core/models/cache/CiTypeCache.js +41 -37
  43. package/es/core/models/cache/DictCache.js +35 -33
  44. package/es/core/models/graph/Background.js +17 -15
  45. package/es/core/models/plugins/resourceWebControllUrl.js +82 -76
  46. package/es/core/models/tagstips/ElementTagTipConfig.js +38 -34
  47. package/es/core/models/topoData.js +70 -68
  48. package/es/core/models/utils/linkUtils.js +43 -41
  49. package/es/core/models/utils/nodeNameVisibleUtil.js +4 -4
  50. package/es/core/services/alarm.js +16 -14
  51. package/es/core/services/background.js +67 -59
  52. package/es/core/services/cmdb/metric.js +11 -9
  53. package/es/core/services/cmdb.js +20 -18
  54. package/es/core/services/index.js +45 -39
  55. package/es/core/services/overview.js +151 -131
  56. package/es/core/services/topo/basic.js +13 -11
  57. package/es/core/services/topo/tagtip.js +12 -10
  58. package/es/core/store/models/ciModel.js +62 -58
  59. package/es/core/store/models/customIcon.js +134 -120
  60. package/es/core/store/models/displayConfig.js +19 -15
  61. package/es/core/store/models/selection.js +6 -4
  62. package/es/core/store/models/topoAlarm.js +145 -162
  63. package/es/core/store/models/topoBaseInfoOverview.js +6 -4
  64. package/es/core/store/models/topoBizMod.js +32 -28
  65. package/es/core/store/models/topoConfig.js +231 -215
  66. package/es/core/store/models/topoGraphView.js +6 -4
  67. package/es/core/store/models/topoMod.js +395 -373
  68. package/es/core/utils/imageUtil.js +20 -18
  69. package/es/core/utils/saveSerialize.js +11 -9
  70. package/es/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
  71. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +17 -15
  72. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +357 -343
  73. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
  74. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
  75. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +205 -189
  76. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +109 -107
  77. package/es/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
  78. package/es/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +37 -33
  79. package/es/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
  80. package/es/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
  81. package/es/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +19 -17
  82. package/es/networkTopo/components/Link/hook.js +77 -73
  83. package/es/networkTopo/components/Link/index.js +94 -86
  84. package/es/networkTopo/components/Link/setting.js +44 -42
  85. package/es/networkTopo/getTopoData.js +69 -63
  86. package/es/networkTopo/hooks/viewer/useRelateTopo.js +32 -30
  87. package/es/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  88. package/es/networkTopo/models/TopoCenter.js +22 -18
  89. package/es/networkTopo/services/alert.js +22 -18
  90. package/es/networkTopo/services/authorization.js +55 -45
  91. package/es/networkTopo/services/cmdb.js +470 -422
  92. package/es/networkTopo/services/funcAuth.js +24 -22
  93. package/es/networkTopo/services/link.js +117 -107
  94. package/es/networkTopo/services/mdc.js +24 -18
  95. package/es/networkTopo/services/metric.js +27 -23
  96. package/es/networkTopo/services/model.js +509 -445
  97. package/es/networkTopo/services/risk.js +11 -9
  98. package/es/networkTopo/services/topo/auth.js +33 -27
  99. package/es/networkTopo/services/topo/basic.js +314 -274
  100. package/es/networkTopo/services/topo/blacklist.js +24 -20
  101. package/es/networkTopo/services/topo/ciInfo.js +31 -27
  102. package/es/networkTopo/services/topo/icon.js +59 -49
  103. package/es/networkTopo/services/topo/networkLink.js +36 -32
  104. package/es/networkTopo/services/topo/relation.js +11 -9
  105. package/es/networkTopo/services/topo/resourceWebUrl.js +42 -36
  106. package/es/networkTopo/store/functionAuth.js +37 -31
  107. package/es/networkTopo/store/topoCenter.js +152 -142
  108. package/es/networkTopo/store/topoLinkMod.js +6 -4
  109. package/es/networkTopo/store/topoTreeMod.js +182 -170
  110. package/es/networkTopo/utils/exportData.js +54 -52
  111. package/lib/components/MultiResourceDrawer/index.js +18 -16
  112. package/lib/components/ResourceList/ResourceSelect.js +50 -48
  113. package/lib/components/ResourceSelectDrawer/ResourceSelectDrawer.js +29 -27
  114. package/lib/components/SingleResourceDrawer/SelectDrawer.js +20 -18
  115. package/lib/core/components/DisplaySettingDrawer/DisplaySettingDrawer.js +32 -30
  116. package/lib/core/components/DisplaySettingDrawer/hooks/useDisplaySetting.js +84 -78
  117. package/lib/core/components/titlebar/widgets/TitleWidget.js +3 -5
  118. package/lib/core/editor/components/BackgroundView/UploadDialog/index.js +17 -15
  119. package/lib/core/editor/components/BackgroundView/index.js +128 -118
  120. package/lib/core/editor/components/CustomIconPlugin/RenameDialog.js +24 -22
  121. package/lib/core/editor/components/CustomIconPlugin/UploadIconDialog.js +33 -31
  122. package/lib/core/editor/components/CustomIconPlugin/utils/svgToShape.js +21 -19
  123. package/lib/core/editor/components/GroupAddResourceDrawerPlugin/GroupAddResourceDrawer.js +10 -8
  124. package/lib/core/editor/components/Sidebar/views/CanvasPanel/hooks/useCanvasThemeConfig.js +41 -37
  125. package/lib/core/editor/components/Toolbar/widgets/BoxBackgroundButton/BoxBackgroundSetting.js +54 -50
  126. package/lib/core/editor/components/Toolbar/widgets/FontColorButton.js +54 -50
  127. package/lib/core/editor/components/Toolbar/widgets/IconSelect/index.module.scss +1 -1
  128. package/lib/core/editor/components/settings/propertyViews/layer/DataTab/DefaultLayerAddResourceDrawer.js +14 -12
  129. package/lib/core/editor/components/settings/propertyViews/node/data/BindResourceDrawer.js +28 -26
  130. package/lib/core/editor/components/settings/propertyViews/node/data/Data.js +17 -15
  131. package/lib/core/editor/components/settings/propertyViews/view/BackgroundSize.js +14 -12
  132. package/lib/core/editor/components/titlebar/TopoEditorTitleBar.js +31 -25
  133. package/lib/core/editor/hooks/useKeyboardShortcut.js +2 -2
  134. package/lib/core/editor/hooks/useNewElementTheme.js +2 -2
  135. package/lib/core/editor/store/background.js +10 -8
  136. package/lib/core/editor/store/topoEdit.js +6 -4
  137. package/lib/core/editor/utils/edgeTypeStyleUtil.js +4 -2
  138. package/lib/core/hooks/usePolling.js +120 -116
  139. package/lib/core/hooks/useResourceConfig.js +66 -58
  140. package/lib/core/hooks/useTopoEdit.js +503 -468
  141. package/lib/core/models/Alarm.js +292 -275
  142. package/lib/core/models/AttributeMetricDisplay.js +110 -104
  143. package/lib/core/models/PluginManager.js +3 -4
  144. package/lib/core/models/SelectionModel.js +5 -4
  145. package/lib/core/models/TopoApp.js +240 -205
  146. package/lib/core/models/TopoGraphView.js +21 -18
  147. package/lib/core/models/cache/CiCache.js +32 -33
  148. package/lib/core/models/cache/CiTypeCache.js +42 -38
  149. package/lib/core/models/cache/DictCache.js +35 -33
  150. package/lib/core/models/graph/Background.js +18 -16
  151. package/lib/core/models/plugins/resourceWebControllUrl.js +80 -74
  152. package/lib/core/models/tagstips/ElementTagTipConfig.js +38 -34
  153. package/lib/core/models/topoData.js +71 -69
  154. package/lib/core/models/utils/linkUtils.js +43 -41
  155. package/lib/core/models/utils/nodeNameVisibleUtil.js +4 -4
  156. package/lib/core/services/alarm.js +20 -18
  157. package/lib/core/services/background.js +78 -70
  158. package/lib/core/services/cmdb/metric.js +12 -10
  159. package/lib/core/services/cmdb.js +22 -20
  160. package/lib/core/services/index.js +51 -45
  161. package/lib/core/services/overview.js +151 -131
  162. package/lib/core/services/topo/basic.js +15 -13
  163. package/lib/core/services/topo/tagtip.js +14 -12
  164. package/lib/core/store/models/ciModel.js +70 -66
  165. package/lib/core/store/models/customIcon.js +134 -120
  166. package/lib/core/store/models/displayConfig.js +19 -15
  167. package/lib/core/store/models/selection.js +6 -4
  168. package/lib/core/store/models/topoAlarm.js +145 -163
  169. package/lib/core/store/models/topoBaseInfoOverview.js +6 -4
  170. package/lib/core/store/models/topoBizMod.js +38 -34
  171. package/lib/core/store/models/topoConfig.js +238 -222
  172. package/lib/core/store/models/topoGraphView.js +6 -4
  173. package/lib/core/store/models/topoMod.js +397 -375
  174. package/lib/core/utils/imageUtil.js +24 -22
  175. package/lib/core/utils/saveSerialize.js +11 -9
  176. package/lib/core/viewer/components/plugins/ResourceDetail/components/ClusterMemberTable.js +58 -56
  177. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/EventsCard.js +17 -15
  178. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/ResourceOverview.js +358 -344
  179. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/Configurator/index.js +92 -86
  180. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/LinkTopoCard.js +41 -39
  181. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/components/LinkTopo/services/index.js +206 -190
  182. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useAlarmAndRiskData.js +109 -107
  183. package/lib/core/viewer/components/plugins/ResourceDetail/components/ResourceOverview/hooks/useMetricModels.js +59 -57
  184. package/lib/core/viewer/components/plugins/ResourceDetail/components/WebConsole/WebConsoleForm/hooks/useWebConsole.js +33 -29
  185. package/lib/core/viewer/components/plugins/ResourceDetail/getCiDisplayMetricModels.js +29 -25
  186. package/lib/core/viewer/components/plugins/ResourceDetail/hooks/useUserId.js +36 -32
  187. package/lib/core/viewer/components/plugins/ResourceWebControllUrlSettingDialog.js +20 -18
  188. package/lib/networkTopo/components/Link/hook.js +77 -73
  189. package/lib/networkTopo/components/Link/index.js +95 -87
  190. package/lib/networkTopo/components/Link/setting.js +44 -42
  191. package/lib/networkTopo/getTopoData.js +69 -63
  192. package/lib/networkTopo/hooks/viewer/useRelateTopo.js +33 -31
  193. package/lib/networkTopo/models/LinkDynamicStyleExecutor.js +2 -2
  194. package/lib/networkTopo/models/TopoCenter.js +22 -18
  195. package/lib/networkTopo/services/alert.js +22 -18
  196. package/lib/networkTopo/services/authorization.js +65 -55
  197. package/lib/networkTopo/services/cmdb.js +470 -422
  198. package/lib/networkTopo/services/funcAuth.js +26 -24
  199. package/lib/networkTopo/services/link.js +118 -108
  200. package/lib/networkTopo/services/mdc.js +27 -21
  201. package/lib/networkTopo/services/metric.js +31 -27
  202. package/lib/networkTopo/services/model.js +509 -445
  203. package/lib/networkTopo/services/risk.js +13 -11
  204. package/lib/networkTopo/services/topo/auth.js +33 -27
  205. package/lib/networkTopo/services/topo/basic.js +317 -277
  206. package/lib/networkTopo/services/topo/blacklist.js +24 -20
  207. package/lib/networkTopo/services/topo/ciInfo.js +38 -34
  208. package/lib/networkTopo/services/topo/icon.js +69 -59
  209. package/lib/networkTopo/services/topo/networkLink.js +36 -32
  210. package/lib/networkTopo/services/topo/relation.js +13 -11
  211. package/lib/networkTopo/services/topo/resourceWebUrl.js +50 -44
  212. package/lib/networkTopo/store/functionAuth.js +37 -31
  213. package/lib/networkTopo/store/topoCenter.js +152 -142
  214. package/lib/networkTopo/store/topoLinkMod.js +6 -4
  215. package/lib/networkTopo/store/topoTreeMod.js +178 -166
  216. package/lib/networkTopo/utils/exportData.js +61 -59
  217. package/package.json +3 -3
@@ -37,19 +37,21 @@ var _excluded = ["checkAuth"],
37
37
  var queryById = /*#__PURE__*/function () {
38
38
  var _ref = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee(id) {
39
39
  return _regenerator["default"].wrap(function _callee$(_context) {
40
- while (1) switch (_context.prev = _context.next) {
41
- case 0:
42
- _context.next = 2;
43
- return _componentTopologyUtils.request.post('/mdc/v1/api/cmdb/queryCiById', {
44
- id: id
45
- });
46
-
47
- case 2:
48
- return _context.abrupt("return", _context.sent);
49
-
50
- case 3:
51
- case "end":
52
- return _context.stop();
40
+ while (1) {
41
+ switch (_context.prev = _context.next) {
42
+ case 0:
43
+ _context.next = 2;
44
+ return _componentTopologyUtils.request.post('/mdc/v1/api/cmdb/queryCiById', {
45
+ id: id
46
+ });
47
+
48
+ case 2:
49
+ return _context.abrupt("return", _context.sent);
50
+
51
+ case 3:
52
+ case "end":
53
+ return _context.stop();
54
+ }
53
55
  }
54
56
  }, _callee);
55
57
  }));
@@ -74,19 +76,21 @@ exports.queryById = queryById;
74
76
  var deleteById = /*#__PURE__*/function () {
75
77
  var _ref2 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee2(id) {
76
78
  return _regenerator["default"].wrap(function _callee2$(_context2) {
77
- while (1) switch (_context2.prev = _context2.next) {
78
- case 0:
79
- _context2.next = 2;
80
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/deleteById', {
81
- id: id
82
- });
83
-
84
- case 2:
85
- return _context2.abrupt("return", _context2.sent);
86
-
87
- case 3:
88
- case "end":
89
- return _context2.stop();
79
+ while (1) {
80
+ switch (_context2.prev = _context2.next) {
81
+ case 0:
82
+ _context2.next = 2;
83
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/deleteById', {
84
+ id: id
85
+ });
86
+
87
+ case 2:
88
+ return _context2.abrupt("return", _context2.sent);
89
+
90
+ case 3:
91
+ case "end":
92
+ return _context2.stop();
93
+ }
90
94
  }
91
95
  }, _callee2);
92
96
  }));
@@ -112,27 +116,29 @@ var batchDeleteById = /*#__PURE__*/function () {
112
116
  var _ref3 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee3(keys) {
113
117
  var ids;
114
118
  return _regenerator["default"].wrap(function _callee3$(_context3) {
115
- while (1) switch (_context3.prev = _context3.next) {
116
- case 0:
117
- if (keys === void 0) {
118
- keys = [];
119
- }
120
-
121
- // TODO 替换为map
122
- ids = keys.map(function (key) {
123
- return {
124
- id: key
125
- };
126
- });
127
- _context3.next = 4;
128
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchDeleteById', ids);
129
-
130
- case 4:
131
- return _context3.abrupt("return", _context3.sent);
119
+ while (1) {
120
+ switch (_context3.prev = _context3.next) {
121
+ case 0:
122
+ if (keys === void 0) {
123
+ keys = [];
124
+ }
132
125
 
133
- case 5:
134
- case "end":
135
- return _context3.stop();
126
+ // TODO 替换为map
127
+ ids = keys.map(function (key) {
128
+ return {
129
+ id: key
130
+ };
131
+ });
132
+ _context3.next = 4;
133
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchDeleteById', ids);
134
+
135
+ case 4:
136
+ return _context3.abrupt("return", _context3.sent);
137
+
138
+ case 5:
139
+ case "end":
140
+ return _context3.stop();
141
+ }
136
142
  }
137
143
  }, _callee3);
138
144
  }));
@@ -166,81 +172,83 @@ var fetchCommonQuery = /*#__PURE__*/function () {
166
172
  var newCondition, _ref5, _ref5$checkAuth, checkAuth, otherOption, url, sorts, params, response, _ref6, totalPage, pageIndex, data, result;
167
173
 
168
174
  return _regenerator["default"].wrap(function _callee4$(_context4) {
169
- while (1) switch (_context4.prev = _context4.next) {
170
- case 0:
171
- newCondition = condition;
172
-
173
- if (typeof newCondition !== 'string') {
174
- newCondition = Object.keys(newCondition).reduce(function (param, current) {
175
- if (current === 'ciType') {
176
- param.push("type(" + (Array.isArray(newCondition[current]) ? newCondition[current].map(function (item) {
177
- return "'" + item + "'";
178
- }).toString() : "'" + newCondition[current] + "'") + ")");
179
- } else if (current === 'principal') {
180
- param.push(newCondition[current]);
181
- } else if (current === 'searchValue' && newCondition.searchValue && newCondition.searchIndexArray) {
182
- param.push("contain('" + newCondition.searchValue + "'," + newCondition.searchIndexArray.toString() + ")");
183
- } else if (current === 'alert') {
184
- var alert = Object.keys(newCondition[current]).map(function (item) {
185
- return item + " = " + newCondition[current][item];
186
- }).join(' && ');
187
- param.push("alert(" + alert + ")");
188
- }
175
+ while (1) {
176
+ switch (_context4.prev = _context4.next) {
177
+ case 0:
178
+ newCondition = condition;
179
+
180
+ if (typeof newCondition !== 'string') {
181
+ newCondition = Object.keys(newCondition).reduce(function (param, current) {
182
+ if (current === 'ciType') {
183
+ param.push("type(" + (Array.isArray(newCondition[current]) ? newCondition[current].map(function (item) {
184
+ return "'" + item + "'";
185
+ }).toString() : "'" + newCondition[current] + "'") + ")");
186
+ } else if (current === 'principal') {
187
+ param.push(newCondition[current]);
188
+ } else if (current === 'searchValue' && newCondition.searchValue && newCondition.searchIndexArray) {
189
+ param.push("contain('" + newCondition.searchValue + "'," + newCondition.searchIndexArray.toString() + ")");
190
+ } else if (current === 'alert') {
191
+ var alert = Object.keys(newCondition[current]).map(function (item) {
192
+ return item + " = " + newCondition[current][item];
193
+ }).join(' && ');
194
+ param.push("alert(" + alert + ")");
195
+ }
196
+
197
+ return param;
198
+ }, []).join(' && ');
199
+ }
200
+
201
+ _ref5 = authOption || {}, _ref5$checkAuth = _ref5.checkAuth, checkAuth = _ref5$checkAuth === void 0 ? true : _ref5$checkAuth, otherOption = (0, _objectWithoutPropertiesLoose2["default"])(_ref5, _excluded); // const url = checkAuth
202
+ // ? '/appserver/api/v1/cmdb/ci/commonQuery'
203
+ // : '/api/v1/cmdb/ci/commonQuery';
204
+ // const url ='/api/v1/cmdb/ci/commonQuery';
205
+ // let params = {
206
+ // condition: condition.conditions
207
+ // ? `${newCondition} && ${condition.conditions}`
208
+ // : newCondition,
209
+ // sort: sort || `${sortIndex} ${sortMethod}`,
210
+ // currentPage,
211
+ // pageSize,
212
+ // };
213
+ // APPBIR MVP
214
+ // ------------------------------------------------
215
+ // TODO important 带确认权限接口是否可通 ---
216
+
217
+ url = checkAuth ? '/mdc/v1/api/cmdb/authority/commonQueryCiData' : '/mdc/v1/api/cmdb/commonQueryCiData';
218
+ sorts = sort ? sort.split(" ") : [sortIndex, sortMethod];
219
+ params = {
220
+ condition: condition.conditions ? newCondition + " && " + condition.conditions : newCondition,
221
+ // APPBIR MVP 临时去掉排序 等接口OK
222
+ // orders: [{
223
+ // name: sorts[0],
224
+ // type: sorts[1]
225
+ // }],
226
+ pageIndex: currentPage,
227
+ pageSize: pageSize
228
+ };
229
+
230
+ if (checkAuth && otherOption) {
231
+ params = (0, _extends2["default"])({}, params, otherOption);
232
+ } // 处理 返回结果
233
+
234
+
235
+ _context4.next = 9;
236
+ return _componentTopologyUtils.request.post(url, params);
189
237
 
190
- return param;
191
- }, []).join(' && ');
192
- }
193
-
194
- _ref5 = authOption || {}, _ref5$checkAuth = _ref5.checkAuth, checkAuth = _ref5$checkAuth === void 0 ? true : _ref5$checkAuth, otherOption = (0, _objectWithoutPropertiesLoose2["default"])(_ref5, _excluded); // const url = checkAuth
195
- // ? '/appserver/api/v1/cmdb/ci/commonQuery'
196
- // : '/api/v1/cmdb/ci/commonQuery';
197
- // const url ='/api/v1/cmdb/ci/commonQuery';
198
- // let params = {
199
- // condition: condition.conditions
200
- // ? `${newCondition} && ${condition.conditions}`
201
- // : newCondition,
202
- // sort: sort || `${sortIndex} ${sortMethod}`,
203
- // currentPage,
204
- // pageSize,
205
- // };
206
- // APPBIR MVP
207
- // ------------------------------------------------
208
- // TODO important 带确认权限接口是否可通 ---
209
-
210
- url = checkAuth ? '/mdc/v1/api/cmdb/authority/commonQueryCiData' : '/mdc/v1/api/cmdb/commonQueryCiData';
211
- sorts = sort ? sort.split(" ") : [sortIndex, sortMethod];
212
- params = {
213
- condition: condition.conditions ? newCondition + " && " + condition.conditions : newCondition,
214
- // APPBIR MVP 临时去掉排序 等接口OK
215
- // orders: [{
216
- // name: sorts[0],
217
- // type: sorts[1]
218
- // }],
219
- pageIndex: currentPage,
220
- pageSize: pageSize
221
- };
222
-
223
- if (checkAuth && otherOption) {
224
- params = (0, _extends2["default"])({}, params, otherOption);
225
- } // 处理 返回结果
226
-
227
-
228
- _context4.next = 9;
229
- return _componentTopologyUtils.request.post(url, params);
230
-
231
- case 9:
232
- response = _context4.sent;
233
- // TODO ---
234
- _ref6 = response || {}, totalPage = _ref6.totalPage, pageIndex = _ref6.pageIndex, data = _ref6.data, result = (0, _objectWithoutPropertiesLoose2["default"])(_ref6, _excluded2);
235
- return _context4.abrupt("return", (0, _extends2["default"])({}, result, {
236
- total: totalPage,
237
- page: pageIndex,
238
- content: data
239
- }));
240
-
241
- case 12:
242
- case "end":
243
- return _context4.stop();
238
+ case 9:
239
+ response = _context4.sent;
240
+ // TODO ---
241
+ _ref6 = response || {}, totalPage = _ref6.totalPage, pageIndex = _ref6.pageIndex, data = _ref6.data, result = (0, _objectWithoutPropertiesLoose2["default"])(_ref6, _excluded2);
242
+ return _context4.abrupt("return", (0, _extends2["default"])({}, result, {
243
+ total: totalPage,
244
+ page: pageIndex,
245
+ content: data
246
+ }));
247
+
248
+ case 12:
249
+ case "end":
250
+ return _context4.stop();
251
+ }
244
252
  }
245
253
  }, _callee4);
246
254
  }));
@@ -266,17 +274,19 @@ function commonQuery(_x11) {
266
274
  function _commonQuery() {
267
275
  _commonQuery = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee18(param) {
268
276
  return _regenerator["default"].wrap(function _callee18$(_context18) {
269
- while (1) switch (_context18.prev = _context18.next) {
270
- case 0:
271
- _context18.next = 2;
272
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/commonQuery', param);
273
-
274
- case 2:
275
- return _context18.abrupt("return", _context18.sent);
276
-
277
- case 3:
278
- case "end":
279
- return _context18.stop();
277
+ while (1) {
278
+ switch (_context18.prev = _context18.next) {
279
+ case 0:
280
+ _context18.next = 2;
281
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/commonQuery', param);
282
+
283
+ case 2:
284
+ return _context18.abrupt("return", _context18.sent);
285
+
286
+ case 3:
287
+ case "end":
288
+ return _context18.stop();
289
+ }
280
290
  }
281
291
  }, _callee18);
282
292
  }));
@@ -288,52 +298,54 @@ var batchUpdateAttributes = /*#__PURE__*/function () {
288
298
  var aa, _aa;
289
299
 
290
300
  return _regenerator["default"].wrap(function _callee5$(_context5) {
291
- while (1) switch (_context5.prev = _context5.next) {
292
- case 0:
293
- if (!fieldName) {
294
- _context5.next = 8;
295
- break;
296
- }
297
-
298
- // 传了要更新的属性名,更新某一个属性
299
- aa = {};
300
- aa[fieldName] = values[fieldName];
301
- _context5.next = 5;
302
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
303
- id: values.id,
304
- attributes: aa
305
- }]);
306
-
307
- case 5:
308
- return _context5.abrupt("return", _context5.sent);
309
-
310
- case 8:
311
- if (!Array.isArray(values)) {
312
- _context5.next = 12;
313
- break;
314
- }
315
-
316
- _context5.next = 11;
317
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', values);
318
-
319
- case 11:
320
- return _context5.abrupt("return", _context5.sent);
321
-
322
- case 12:
323
- _aa = values.id;
324
- delete values.id;
325
- _context5.next = 16;
326
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
327
- id: _aa,
328
- attributes: values
329
- }]);
330
-
331
- case 16:
332
- return _context5.abrupt("return", _context5.sent);
333
-
334
- case 17:
335
- case "end":
336
- return _context5.stop();
301
+ while (1) {
302
+ switch (_context5.prev = _context5.next) {
303
+ case 0:
304
+ if (!fieldName) {
305
+ _context5.next = 8;
306
+ break;
307
+ }
308
+
309
+ // 传了要更新的属性名,更新某一个属性
310
+ aa = {};
311
+ aa[fieldName] = values[fieldName];
312
+ _context5.next = 5;
313
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
314
+ id: values.id,
315
+ attributes: aa
316
+ }]);
317
+
318
+ case 5:
319
+ return _context5.abrupt("return", _context5.sent);
320
+
321
+ case 8:
322
+ if (!Array.isArray(values)) {
323
+ _context5.next = 12;
324
+ break;
325
+ }
326
+
327
+ _context5.next = 11;
328
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', values);
329
+
330
+ case 11:
331
+ return _context5.abrupt("return", _context5.sent);
332
+
333
+ case 12:
334
+ _aa = values.id;
335
+ delete values.id;
336
+ _context5.next = 16;
337
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchUpdateAttributes', [{
338
+ id: _aa,
339
+ attributes: values
340
+ }]);
341
+
342
+ case 16:
343
+ return _context5.abrupt("return", _context5.sent);
344
+
345
+ case 17:
346
+ case "end":
347
+ return _context5.stop();
348
+ }
337
349
  }
338
350
  }, _callee5);
339
351
  }));
@@ -349,17 +361,19 @@ exports.batchUpdateAttributes = batchUpdateAttributes;
349
361
  var createInstance = /*#__PURE__*/function () {
350
362
  var _ref8 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee6(values) {
351
363
  return _regenerator["default"].wrap(function _callee6$(_context6) {
352
- while (1) switch (_context6.prev = _context6.next) {
353
- case 0:
354
- _context6.next = 2;
355
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/create', values);
356
-
357
- case 2:
358
- return _context6.abrupt("return", _context6.sent);
359
-
360
- case 3:
361
- case "end":
362
- return _context6.stop();
364
+ while (1) {
365
+ switch (_context6.prev = _context6.next) {
366
+ case 0:
367
+ _context6.next = 2;
368
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/create', values);
369
+
370
+ case 2:
371
+ return _context6.abrupt("return", _context6.sent);
372
+
373
+ case 3:
374
+ case "end":
375
+ return _context6.stop();
376
+ }
363
377
  }
364
378
  }, _callee6);
365
379
  }));
@@ -390,17 +404,19 @@ function changeManageStatus(_x15) {
390
404
  function _changeManageStatus() {
391
405
  _changeManageStatus = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee19(param) {
392
406
  return _regenerator["default"].wrap(function _callee19$(_context19) {
393
- while (1) switch (_context19.prev = _context19.next) {
394
- case 0:
395
- _context19.next = 2;
396
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/changeManageStatus', param);
397
-
398
- case 2:
399
- return _context19.abrupt("return", _context19.sent);
400
-
401
- case 3:
402
- case "end":
403
- return _context19.stop();
407
+ while (1) {
408
+ switch (_context19.prev = _context19.next) {
409
+ case 0:
410
+ _context19.next = 2;
411
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/changeManageStatus', param);
412
+
413
+ case 2:
414
+ return _context19.abrupt("return", _context19.sent);
415
+
416
+ case 3:
417
+ case "end":
418
+ return _context19.stop();
419
+ }
404
420
  }
405
421
  }, _callee19);
406
422
  }));
@@ -424,17 +440,19 @@ function batchChangeManageStatus(_x16) {
424
440
  function _batchChangeManageStatus() {
425
441
  _batchChangeManageStatus = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee20(param) {
426
442
  return _regenerator["default"].wrap(function _callee20$(_context20) {
427
- while (1) switch (_context20.prev = _context20.next) {
428
- case 0:
429
- _context20.next = 2;
430
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchChangeManageStatus', param);
431
-
432
- case 2:
433
- return _context20.abrupt("return", _context20.sent);
434
-
435
- case 3:
436
- case "end":
437
- return _context20.stop();
443
+ while (1) {
444
+ switch (_context20.prev = _context20.next) {
445
+ case 0:
446
+ _context20.next = 2;
447
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/batchChangeManageStatus', param);
448
+
449
+ case 2:
450
+ return _context20.abrupt("return", _context20.sent);
451
+
452
+ case 3:
453
+ case "end":
454
+ return _context20.stop();
455
+ }
438
456
  }
439
457
  }, _callee20);
440
458
  }));
@@ -454,17 +472,19 @@ function commonCount(_x17) {
454
472
  function _commonCount() {
455
473
  _commonCount = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee21(param) {
456
474
  return _regenerator["default"].wrap(function _callee21$(_context21) {
457
- while (1) switch (_context21.prev = _context21.next) {
458
- case 0:
459
- _context21.next = 2;
460
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/commonCount', param);
461
-
462
- case 2:
463
- return _context21.abrupt("return", _context21.sent);
464
-
465
- case 3:
466
- case "end":
467
- return _context21.stop();
475
+ while (1) {
476
+ switch (_context21.prev = _context21.next) {
477
+ case 0:
478
+ _context21.next = 2;
479
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/commonCount', param);
480
+
481
+ case 2:
482
+ return _context21.abrupt("return", _context21.sent);
483
+
484
+ case 3:
485
+ case "end":
486
+ return _context21.stop();
487
+ }
468
488
  }
469
489
  }, _callee21);
470
490
  }));
@@ -487,17 +507,19 @@ function queryCiWithComponents(_x18) {
487
507
  function _queryCiWithComponents() {
488
508
  _queryCiWithComponents = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee22(mainCiIds) {
489
509
  return _regenerator["default"].wrap(function _callee22$(_context22) {
490
- while (1) switch (_context22.prev = _context22.next) {
491
- case 0:
492
- _context22.next = 2;
493
- return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/queryCiWithComponents', mainCiIds);
494
-
495
- case 2:
496
- return _context22.abrupt("return", _context22.sent);
497
-
498
- case 3:
499
- case "end":
500
- return _context22.stop();
510
+ while (1) {
511
+ switch (_context22.prev = _context22.next) {
512
+ case 0:
513
+ _context22.next = 2;
514
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/ci/queryCiWithComponents', mainCiIds);
515
+
516
+ case 2:
517
+ return _context22.abrupt("return", _context22.sent);
518
+
519
+ case 3:
520
+ case "end":
521
+ return _context22.stop();
522
+ }
501
523
  }
502
524
  }, _callee22);
503
525
  }));
@@ -516,25 +538,27 @@ function queryPageIgnoreRelations(_x19, _x20, _x21, _x22, _x23) {
516
538
  function _queryPageIgnoreRelations() {
517
539
  _queryPageIgnoreRelations = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee23(relationType, currentPage, pageSize, condition, sort) {
518
540
  return _regenerator["default"].wrap(function _callee23$(_context23) {
519
- while (1) switch (_context23.prev = _context23.next) {
520
- case 0:
521
- _context23.next = 2;
522
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/ignore/list', (0, _extends2["default"])({
523
- relationType: relationType,
524
- currentPage: currentPage,
525
- pageSize: pageSize
526
- }, condition ? {
527
- condition: condition
528
- } : {}, sort ? {
529
- sort: sort
530
- } : {}));
531
-
532
- case 2:
533
- return _context23.abrupt("return", _context23.sent);
534
-
535
- case 3:
536
- case "end":
537
- return _context23.stop();
541
+ while (1) {
542
+ switch (_context23.prev = _context23.next) {
543
+ case 0:
544
+ _context23.next = 2;
545
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/ignore/list', (0, _extends2["default"])({
546
+ relationType: relationType,
547
+ currentPage: currentPage,
548
+ pageSize: pageSize
549
+ }, condition ? {
550
+ condition: condition
551
+ } : {}, sort ? {
552
+ sort: sort
553
+ } : {}));
554
+
555
+ case 2:
556
+ return _context23.abrupt("return", _context23.sent);
557
+
558
+ case 3:
559
+ case "end":
560
+ return _context23.stop();
561
+ }
538
562
  }
539
563
  }, _callee23);
540
564
  }));
@@ -549,21 +573,23 @@ function deleteIgnoreRelations(_x24) {
549
573
  function _deleteIgnoreRelations() {
550
574
  _deleteIgnoreRelations = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee24(ids) {
551
575
  return _regenerator["default"].wrap(function _callee24$(_context24) {
552
- while (1) switch (_context24.prev = _context24.next) {
553
- case 0:
554
- _context24.next = 2;
555
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/ignore/batchDeleteById', ids.map(function (id) {
556
- return {
557
- id: id
558
- };
559
- }));
560
-
561
- case 2:
562
- return _context24.abrupt("return", _context24.sent);
563
-
564
- case 3:
565
- case "end":
566
- return _context24.stop();
576
+ while (1) {
577
+ switch (_context24.prev = _context24.next) {
578
+ case 0:
579
+ _context24.next = 2;
580
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/ignore/batchDeleteById', ids.map(function (id) {
581
+ return {
582
+ id: id
583
+ };
584
+ }));
585
+
586
+ case 2:
587
+ return _context24.abrupt("return", _context24.sent);
588
+
589
+ case 3:
590
+ case "end":
591
+ return _context24.stop();
592
+ }
567
593
  }
568
594
  }, _callee24);
569
595
  }));
@@ -574,36 +600,38 @@ var uploadFile = /*#__PURE__*/function () {
574
600
  var _ref9 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee7(files, userId, modelType) {
575
601
  var formData, names, originFiles, config, result;
576
602
  return _regenerator["default"].wrap(function _callee7$(_context7) {
577
- while (1) switch (_context7.prev = _context7.next) {
578
- case 0:
579
- formData = new FormData(); // 用户id
580
-
581
- formData.append('userId', userId);
582
- modelType && formData.append('modelType', modelType);
583
- names = [];
584
- originFiles = [];
585
- files.forEach(function (_ref10) {
586
- var name = _ref10.name,
587
- originFileObj = _ref10.originFileObj;
588
- names.push(name);
589
- originFiles.push(originFileObj);
590
- formData.append('files', originFileObj, name);
591
- });
592
- config = {
593
- headers: {
594
- 'Content-Type': "multipart/form-data;boundary=" + new Date().getTime()
595
- }
596
- };
597
- _context7.next = 9;
598
- return _componentTopologyUtils.request.post('/cmdb/v1/api/import', formData, config);
603
+ while (1) {
604
+ switch (_context7.prev = _context7.next) {
605
+ case 0:
606
+ formData = new FormData(); // 用户id
607
+
608
+ formData.append('userId', userId);
609
+ modelType && formData.append('modelType', modelType);
610
+ names = [];
611
+ originFiles = [];
612
+ files.forEach(function (_ref10) {
613
+ var name = _ref10.name,
614
+ originFileObj = _ref10.originFileObj;
615
+ names.push(name);
616
+ originFiles.push(originFileObj);
617
+ formData.append('files', originFileObj, name);
618
+ });
619
+ config = {
620
+ headers: {
621
+ 'Content-Type': "multipart/form-data;boundary=" + new Date().getTime()
622
+ }
623
+ };
624
+ _context7.next = 9;
625
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/import', formData, config);
599
626
 
600
- case 9:
601
- result = _context7.sent;
602
- return _context7.abrupt("return", result);
627
+ case 9:
628
+ result = _context7.sent;
629
+ return _context7.abrupt("return", result);
603
630
 
604
- case 11:
605
- case "end":
606
- return _context7.stop();
631
+ case 11:
632
+ case "end":
633
+ return _context7.stop();
634
+ }
607
635
  }
608
636
  }, _callee7);
609
637
  }));
@@ -620,21 +648,23 @@ var closeRecord = /*#__PURE__*/function () {
620
648
  var _ref11 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee8(userId, modelType) {
621
649
  var result;
622
650
  return _regenerator["default"].wrap(function _callee8$(_context8) {
623
- while (1) switch (_context8.prev = _context8.next) {
624
- case 0:
625
- _context8.next = 2;
626
- return _componentTopologyUtils.request.post('/cmdb/v1/api/delete/import/record', {
627
- userId: userId,
628
- modelType: modelType
629
- });
630
-
631
- case 2:
632
- result = _context8.sent;
633
- return _context8.abrupt("return", result);
634
-
635
- case 4:
636
- case "end":
637
- return _context8.stop();
651
+ while (1) {
652
+ switch (_context8.prev = _context8.next) {
653
+ case 0:
654
+ _context8.next = 2;
655
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/delete/import/record', {
656
+ userId: userId,
657
+ modelType: modelType
658
+ });
659
+
660
+ case 2:
661
+ result = _context8.sent;
662
+ return _context8.abrupt("return", result);
663
+
664
+ case 4:
665
+ case "end":
666
+ return _context8.stop();
667
+ }
638
668
  }
639
669
  }, _callee8);
640
670
  }));
@@ -650,20 +680,22 @@ exports.closeRecord = closeRecord;
650
680
  var getRecord = /*#__PURE__*/function () {
651
681
  var _ref12 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee9(userId, modelType) {
652
682
  return _regenerator["default"].wrap(function _callee9$(_context9) {
653
- while (1) switch (_context9.prev = _context9.next) {
654
- case 0:
655
- _context9.next = 2;
656
- return _componentTopologyUtils.request.post('/cmdb/v1/api/get/import/record', {
657
- userId: userId,
658
- modelType: modelType
659
- });
660
-
661
- case 2:
662
- return _context9.abrupt("return", _context9.sent);
663
-
664
- case 3:
665
- case "end":
666
- return _context9.stop();
683
+ while (1) {
684
+ switch (_context9.prev = _context9.next) {
685
+ case 0:
686
+ _context9.next = 2;
687
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/get/import/record', {
688
+ userId: userId,
689
+ modelType: modelType
690
+ });
691
+
692
+ case 2:
693
+ return _context9.abrupt("return", _context9.sent);
694
+
695
+ case 3:
696
+ case "end":
697
+ return _context9.stop();
698
+ }
667
699
  }
668
700
  }, _callee9);
669
701
  }));
@@ -684,17 +716,19 @@ exports.getRecord = getRecord;
684
716
  var batchCreateRelation = /*#__PURE__*/function () {
685
717
  var _ref13 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee10(params) {
686
718
  return _regenerator["default"].wrap(function _callee10$(_context10) {
687
- while (1) switch (_context10.prev = _context10.next) {
688
- case 0:
689
- _context10.next = 2;
690
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchCreate', params);
691
-
692
- case 2:
693
- return _context10.abrupt("return", _context10.sent);
694
-
695
- case 3:
696
- case "end":
697
- return _context10.stop();
719
+ while (1) {
720
+ switch (_context10.prev = _context10.next) {
721
+ case 0:
722
+ _context10.next = 2;
723
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchCreate', params);
724
+
725
+ case 2:
726
+ return _context10.abrupt("return", _context10.sent);
727
+
728
+ case 3:
729
+ case "end":
730
+ return _context10.stop();
731
+ }
698
732
  }
699
733
  }, _callee10);
700
734
  }));
@@ -709,19 +743,21 @@ exports.batchCreateRelation = batchCreateRelation;
709
743
  var queryRelationByEndpoint = /*#__PURE__*/function () {
710
744
  var _ref14 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee11(id) {
711
745
  return _regenerator["default"].wrap(function _callee11$(_context11) {
712
- while (1) switch (_context11.prev = _context11.next) {
713
- case 0:
714
- _context11.next = 2;
715
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/queryByEndpoint', {
716
- id: id
717
- });
718
-
719
- case 2:
720
- return _context11.abrupt("return", _context11.sent);
721
-
722
- case 3:
723
- case "end":
724
- return _context11.stop();
746
+ while (1) {
747
+ switch (_context11.prev = _context11.next) {
748
+ case 0:
749
+ _context11.next = 2;
750
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/queryByEndpoint', {
751
+ id: id
752
+ });
753
+
754
+ case 2:
755
+ return _context11.abrupt("return", _context11.sent);
756
+
757
+ case 3:
758
+ case "end":
759
+ return _context11.stop();
760
+ }
725
761
  }
726
762
  }, _callee11);
727
763
  }));
@@ -742,17 +778,19 @@ exports.queryRelationByEndpoint = queryRelationByEndpoint;
742
778
  var batchUpdateRelation = /*#__PURE__*/function () {
743
779
  var _ref15 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee12(params) {
744
780
  return _regenerator["default"].wrap(function _callee12$(_context12) {
745
- while (1) switch (_context12.prev = _context12.next) {
746
- case 0:
747
- _context12.next = 2;
748
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchUpdateAttributes', params);
749
-
750
- case 2:
751
- return _context12.abrupt("return", _context12.sent);
752
-
753
- case 3:
754
- case "end":
755
- return _context12.stop();
781
+ while (1) {
782
+ switch (_context12.prev = _context12.next) {
783
+ case 0:
784
+ _context12.next = 2;
785
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchUpdateAttributes', params);
786
+
787
+ case 2:
788
+ return _context12.abrupt("return", _context12.sent);
789
+
790
+ case 3:
791
+ case "end":
792
+ return _context12.stop();
793
+ }
756
794
  }
757
795
  }, _callee12);
758
796
  }));
@@ -773,19 +811,21 @@ exports.batchUpdateRelation = batchUpdateRelation;
773
811
  var deleteRelation = /*#__PURE__*/function () {
774
812
  var _ref16 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee13(id) {
775
813
  return _regenerator["default"].wrap(function _callee13$(_context13) {
776
- while (1) switch (_context13.prev = _context13.next) {
777
- case 0:
778
- _context13.next = 2;
779
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/delete', {
780
- id: id
781
- });
782
-
783
- case 2:
784
- return _context13.abrupt("return", _context13.sent);
785
-
786
- case 3:
787
- case "end":
788
- return _context13.stop();
814
+ while (1) {
815
+ switch (_context13.prev = _context13.next) {
816
+ case 0:
817
+ _context13.next = 2;
818
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/delete', {
819
+ id: id
820
+ });
821
+
822
+ case 2:
823
+ return _context13.abrupt("return", _context13.sent);
824
+
825
+ case 3:
826
+ case "end":
827
+ return _context13.stop();
828
+ }
789
829
  }
790
830
  }, _callee13);
791
831
  }));
@@ -806,17 +846,19 @@ exports.deleteRelation = deleteRelation;
806
846
  var batchDeleteRelation = /*#__PURE__*/function () {
807
847
  var _ref17 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee14(params) {
808
848
  return _regenerator["default"].wrap(function _callee14$(_context14) {
809
- while (1) switch (_context14.prev = _context14.next) {
810
- case 0:
811
- _context14.next = 2;
812
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchDelete', params);
813
-
814
- case 2:
815
- return _context14.abrupt("return", _context14.sent);
816
-
817
- case 3:
818
- case "end":
819
- return _context14.stop();
849
+ while (1) {
850
+ switch (_context14.prev = _context14.next) {
851
+ case 0:
852
+ _context14.next = 2;
853
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchDelete', params);
854
+
855
+ case 2:
856
+ return _context14.abrupt("return", _context14.sent);
857
+
858
+ case 3:
859
+ case "end":
860
+ return _context14.stop();
861
+ }
820
862
  }
821
863
  }, _callee14);
822
864
  }));
@@ -837,20 +879,22 @@ exports.batchDeleteRelation = batchDeleteRelation;
837
879
  var forceDeleteRelation = /*#__PURE__*/function () {
838
880
  var _ref18 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee15(id) {
839
881
  return _regenerator["default"].wrap(function _callee15$(_context15) {
840
- while (1) switch (_context15.prev = _context15.next) {
841
- case 0:
842
- _context15.next = 2;
843
- return batchDeleteRelation([{
844
- id: id,
845
- force: true
846
- }]);
847
-
848
- case 2:
849
- return _context15.abrupt("return", _context15.sent);
850
-
851
- case 3:
852
- case "end":
853
- return _context15.stop();
882
+ while (1) {
883
+ switch (_context15.prev = _context15.next) {
884
+ case 0:
885
+ _context15.next = 2;
886
+ return batchDeleteRelation([{
887
+ id: id,
888
+ force: true
889
+ }]);
890
+
891
+ case 2:
892
+ return _context15.abrupt("return", _context15.sent);
893
+
894
+ case 3:
895
+ case "end":
896
+ return _context15.stop();
897
+ }
854
898
  }
855
899
  }, _callee15);
856
900
  }));
@@ -871,17 +915,19 @@ exports.forceDeleteRelation = forceDeleteRelation;
871
915
  var batchQueryRelationById = /*#__PURE__*/function () {
872
916
  var _ref19 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee16(params) {
873
917
  return _regenerator["default"].wrap(function _callee16$(_context16) {
874
- while (1) switch (_context16.prev = _context16.next) {
875
- case 0:
876
- _context16.next = 2;
877
- return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchQueryById', params);
878
-
879
- case 2:
880
- return _context16.abrupt("return", _context16.sent);
881
-
882
- case 3:
883
- case "end":
884
- return _context16.stop();
918
+ while (1) {
919
+ switch (_context16.prev = _context16.next) {
920
+ case 0:
921
+ _context16.next = 2;
922
+ return _componentTopologyUtils.request.post('/cmdb/v1/api/relation/batchQueryById', params);
923
+
924
+ case 2:
925
+ return _context16.abrupt("return", _context16.sent);
926
+
927
+ case 3:
928
+ case "end":
929
+ return _context16.stop();
930
+ }
885
931
  }
886
932
  }, _callee16);
887
933
  }));
@@ -902,21 +948,23 @@ exports.batchQueryRelationById = batchQueryRelationById;
902
948
  var queryRelationByIds = /*#__PURE__*/function () {
903
949
  var _ref20 = (0, _asyncToGenerator2["default"])( /*#__PURE__*/_regenerator["default"].mark(function _callee17(ids) {
904
950
  return _regenerator["default"].wrap(function _callee17$(_context17) {
905
- while (1) switch (_context17.prev = _context17.next) {
906
- case 0:
907
- _context17.next = 2;
908
- return batchQueryRelationById(ids.map(function (id) {
909
- return {
910
- id: id
911
- };
912
- }));
913
-
914
- case 2:
915
- return _context17.abrupt("return", _context17.sent);
916
-
917
- case 3:
918
- case "end":
919
- return _context17.stop();
951
+ while (1) {
952
+ switch (_context17.prev = _context17.next) {
953
+ case 0:
954
+ _context17.next = 2;
955
+ return batchQueryRelationById(ids.map(function (id) {
956
+ return {
957
+ id: id
958
+ };
959
+ }));
960
+
961
+ case 2:
962
+ return _context17.abrupt("return", _context17.sent);
963
+
964
+ case 3:
965
+ case "end":
966
+ return _context17.stop();
967
+ }
920
968
  }
921
969
  }, _callee17);
922
970
  }));