gitlab-radiator 3.4.3 → 3.5.0

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.
@@ -15,7 +15,7 @@ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (O
15
15
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16
16
  function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }
17
17
  function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
18
- function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
18
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i]; return arr2; }
19
19
  function fetchLatestPipelines(_x, _x2) {
20
20
  return _fetchLatestPipelines.apply(this, arguments);
21
21
  } // eslint-disable-next-line max-statements
@@ -23,53 +23,49 @@ function _fetchLatestPipelines() {
23
23
  _fetchLatestPipelines = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(projectId, gitlab) {
24
24
  var pipelines;
25
25
  return _regenerator.default.wrap(function _callee2$(_context2) {
26
- while (1) {
27
- switch (_context2.prev = _context2.next) {
28
- case 0:
29
- _context2.next = 2;
30
- return fetchLatestAndMasterPipeline(projectId, gitlab);
31
- case 2:
32
- pipelines = _context2.sent;
33
- return _context2.abrupt("return", Promise.all(pipelines.map( /*#__PURE__*/function () {
34
- var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
35
- var id, ref, status, _yield$fetchJobs, commit, stages, downstreamStages;
36
- return _regenerator.default.wrap(function _callee$(_context) {
37
- while (1) {
38
- switch (_context.prev = _context.next) {
39
- case 0:
40
- id = _ref.id, ref = _ref.ref, status = _ref.status;
41
- _context.next = 3;
42
- return fetchJobs(projectId, id, gitlab);
43
- case 3:
44
- _yield$fetchJobs = _context.sent;
45
- commit = _yield$fetchJobs.commit;
46
- stages = _yield$fetchJobs.stages;
47
- _context.next = 8;
48
- return fetchDownstreamJobs(projectId, id, gitlab);
49
- case 8:
50
- downstreamStages = _context.sent;
51
- return _context.abrupt("return", {
52
- id,
53
- ref,
54
- status,
55
- commit,
56
- stages: stages.concat(downstreamStages)
57
- });
58
- case 10:
59
- case "end":
60
- return _context.stop();
61
- }
62
- }
63
- }, _callee);
64
- }));
65
- return function (_x14) {
66
- return _ref2.apply(this, arguments);
67
- };
68
- }())));
69
- case 4:
70
- case "end":
71
- return _context2.stop();
72
- }
26
+ while (1) switch (_context2.prev = _context2.next) {
27
+ case 0:
28
+ _context2.next = 2;
29
+ return fetchLatestAndMasterPipeline(projectId, gitlab);
30
+ case 2:
31
+ pipelines = _context2.sent;
32
+ return _context2.abrupt("return", Promise.all(pipelines.map( /*#__PURE__*/function () {
33
+ var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(_ref) {
34
+ var id, ref, status, _yield$fetchJobs, commit, stages, downstreamStages;
35
+ return _regenerator.default.wrap(function _callee$(_context) {
36
+ while (1) switch (_context.prev = _context.next) {
37
+ case 0:
38
+ id = _ref.id, ref = _ref.ref, status = _ref.status;
39
+ _context.next = 3;
40
+ return fetchJobs(projectId, id, gitlab);
41
+ case 3:
42
+ _yield$fetchJobs = _context.sent;
43
+ commit = _yield$fetchJobs.commit;
44
+ stages = _yield$fetchJobs.stages;
45
+ _context.next = 8;
46
+ return fetchDownstreamJobs(projectId, id, gitlab);
47
+ case 8:
48
+ downstreamStages = _context.sent;
49
+ return _context.abrupt("return", {
50
+ id,
51
+ ref,
52
+ status,
53
+ commit,
54
+ stages: stages.concat(downstreamStages)
55
+ });
56
+ case 10:
57
+ case "end":
58
+ return _context.stop();
59
+ }
60
+ }, _callee);
61
+ }));
62
+ return function (_x14) {
63
+ return _ref2.apply(this, arguments);
64
+ };
65
+ }())));
66
+ case 4:
67
+ case "end":
68
+ return _context2.stop();
73
69
  }
74
70
  }, _callee2);
75
71
  }));
@@ -82,49 +78,47 @@ function _fetchLatestAndMasterPipeline() {
82
78
  _fetchLatestAndMasterPipeline = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee3(projectId, config) {
83
79
  var pipelines, latestPipeline, latestMasterPipeline, masterPipelines;
84
80
  return _regenerator.default.wrap(function _callee3$(_context3) {
85
- while (1) {
86
- switch (_context3.prev = _context3.next) {
87
- case 0:
88
- _context3.next = 2;
89
- return fetchPipelines(projectId, config, {
90
- per_page: 100
91
- });
92
- case 2:
93
- pipelines = _context3.sent;
94
- if (!(pipelines.length === 0)) {
95
- _context3.next = 5;
96
- break;
97
- }
98
- return _context3.abrupt("return", []);
99
- case 5:
100
- latestPipeline = _lodash.default.take(pipelines, 1);
101
- if (!(latestPipeline[0].ref === 'master')) {
102
- _context3.next = 8;
103
- break;
104
- }
105
- return _context3.abrupt("return", latestPipeline);
106
- case 8:
107
- latestMasterPipeline = (0, _lodash.default)(pipelines).filter({
108
- ref: 'master'
109
- }).take(1).value();
110
- if (!(latestMasterPipeline.length > 0)) {
111
- _context3.next = 11;
112
- break;
113
- }
114
- return _context3.abrupt("return", latestPipeline.concat(latestMasterPipeline));
115
- case 11:
116
- _context3.next = 13;
117
- return fetchPipelines(projectId, config, {
118
- per_page: 50,
119
- ref: 'master'
120
- });
121
- case 13:
122
- masterPipelines = _context3.sent;
123
- return _context3.abrupt("return", latestPipeline.concat(_lodash.default.take(masterPipelines, 1)));
124
- case 15:
125
- case "end":
126
- return _context3.stop();
127
- }
81
+ while (1) switch (_context3.prev = _context3.next) {
82
+ case 0:
83
+ _context3.next = 2;
84
+ return fetchPipelines(projectId, config, {
85
+ per_page: 100
86
+ });
87
+ case 2:
88
+ pipelines = _context3.sent;
89
+ if (!(pipelines.length === 0)) {
90
+ _context3.next = 5;
91
+ break;
92
+ }
93
+ return _context3.abrupt("return", []);
94
+ case 5:
95
+ latestPipeline = _lodash.default.take(pipelines, 1);
96
+ if (!(latestPipeline[0].ref === 'master')) {
97
+ _context3.next = 8;
98
+ break;
99
+ }
100
+ return _context3.abrupt("return", latestPipeline);
101
+ case 8:
102
+ latestMasterPipeline = (0, _lodash.default)(pipelines).filter({
103
+ ref: 'master'
104
+ }).take(1).value();
105
+ if (!(latestMasterPipeline.length > 0)) {
106
+ _context3.next = 11;
107
+ break;
108
+ }
109
+ return _context3.abrupt("return", latestPipeline.concat(latestMasterPipeline));
110
+ case 11:
111
+ _context3.next = 13;
112
+ return fetchPipelines(projectId, config, {
113
+ per_page: 50,
114
+ ref: 'master'
115
+ });
116
+ case 13:
117
+ masterPipelines = _context3.sent;
118
+ return _context3.abrupt("return", latestPipeline.concat(_lodash.default.take(masterPipelines, 1)));
119
+ case 15:
120
+ case "end":
121
+ return _context3.stop();
128
122
  }
129
123
  }, _callee3);
130
124
  }));
@@ -137,19 +131,17 @@ function _fetchPipelines() {
137
131
  _fetchPipelines = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee4(projectId, config, options) {
138
132
  var _yield$gitlabRequest, pipelines;
139
133
  return _regenerator.default.wrap(function _callee4$(_context4) {
140
- while (1) {
141
- switch (_context4.prev = _context4.next) {
142
- case 0:
143
- _context4.next = 2;
144
- return (0, _client.gitlabRequest)("/projects/".concat(projectId, "/pipelines"), options, config);
145
- case 2:
146
- _yield$gitlabRequest = _context4.sent;
147
- pipelines = _yield$gitlabRequest.data;
148
- return _context4.abrupt("return", pipelines.filter(pipeline => pipeline.status !== 'skipped'));
149
- case 5:
150
- case "end":
151
- return _context4.stop();
152
- }
134
+ while (1) switch (_context4.prev = _context4.next) {
135
+ case 0:
136
+ _context4.next = 2;
137
+ return (0, _client.gitlabRequest)("/projects/".concat(projectId, "/pipelines"), options, config);
138
+ case 2:
139
+ _yield$gitlabRequest = _context4.sent;
140
+ pipelines = _yield$gitlabRequest.data;
141
+ return _context4.abrupt("return", pipelines.filter(pipeline => pipeline.status !== 'skipped'));
142
+ case 5:
143
+ case "end":
144
+ return _context4.stop();
153
145
  }
154
146
  }, _callee4);
155
147
  }));
@@ -162,69 +154,65 @@ function _fetchDownstreamJobs() {
162
154
  _fetchDownstreamJobs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee5(projectId, pipelineId, config) {
163
155
  var _yield$gitlabRequest2, gitlabBridgeJobs, childPipelines, downstreamStages, _iterator, _step, _loop;
164
156
  return _regenerator.default.wrap(function _callee5$(_context6) {
165
- while (1) {
166
- switch (_context6.prev = _context6.next) {
167
- case 0:
168
- _context6.next = 2;
169
- return (0, _client.gitlabRequest)("/projects/".concat(projectId, "/pipelines/").concat(pipelineId, "/bridges"), {
170
- per_page: 100
171
- }, config);
172
- case 2:
173
- _yield$gitlabRequest2 = _context6.sent;
174
- gitlabBridgeJobs = _yield$gitlabRequest2.data;
175
- childPipelines = gitlabBridgeJobs.filter(bridge => bridge.downstream_pipeline.status !== 'skipped');
176
- downstreamStages = [];
177
- _iterator = _createForOfIteratorHelper(childPipelines);
178
- _context6.prev = 7;
179
- _loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
180
- var childPipeline, _yield$fetchJobs2, stages;
181
- return _regenerator.default.wrap(function _loop$(_context5) {
182
- while (1) {
183
- switch (_context5.prev = _context5.next) {
184
- case 0:
185
- childPipeline = _step.value;
186
- _context5.next = 3;
187
- return fetchJobs(projectId, childPipeline.downstream_pipeline.id, config);
188
- case 3:
189
- _yield$fetchJobs2 = _context5.sent;
190
- stages = _yield$fetchJobs2.stages;
191
- downstreamStages.push(stages.map(stage => _objectSpread(_objectSpread({}, stage), {}, {
192
- name: "".concat(childPipeline.stage, ":").concat(stage.name)
193
- })));
194
- case 6:
195
- case "end":
196
- return _context5.stop();
197
- }
198
- }
199
- }, _loop);
200
- });
201
- _iterator.s();
202
- case 10:
203
- if ((_step = _iterator.n()).done) {
204
- _context6.next = 14;
205
- break;
206
- }
207
- return _context6.delegateYield(_loop(), "t0", 12);
208
- case 12:
209
- _context6.next = 10;
210
- break;
211
- case 14:
212
- _context6.next = 19;
157
+ while (1) switch (_context6.prev = _context6.next) {
158
+ case 0:
159
+ _context6.next = 2;
160
+ return (0, _client.gitlabRequest)("/projects/".concat(projectId, "/pipelines/").concat(pipelineId, "/bridges"), {
161
+ per_page: 100
162
+ }, config);
163
+ case 2:
164
+ _yield$gitlabRequest2 = _context6.sent;
165
+ gitlabBridgeJobs = _yield$gitlabRequest2.data;
166
+ childPipelines = gitlabBridgeJobs.filter(bridge => bridge.downstream_pipeline.status !== 'skipped');
167
+ downstreamStages = [];
168
+ _iterator = _createForOfIteratorHelper(childPipelines);
169
+ _context6.prev = 7;
170
+ _loop = /*#__PURE__*/_regenerator.default.mark(function _loop() {
171
+ var childPipeline, _yield$fetchJobs2, stages;
172
+ return _regenerator.default.wrap(function _loop$(_context5) {
173
+ while (1) switch (_context5.prev = _context5.next) {
174
+ case 0:
175
+ childPipeline = _step.value;
176
+ _context5.next = 3;
177
+ return fetchJobs(projectId, childPipeline.downstream_pipeline.id, config);
178
+ case 3:
179
+ _yield$fetchJobs2 = _context5.sent;
180
+ stages = _yield$fetchJobs2.stages;
181
+ downstreamStages.push(stages.map(stage => _objectSpread(_objectSpread({}, stage), {}, {
182
+ name: "".concat(childPipeline.stage, ":").concat(stage.name)
183
+ })));
184
+ case 6:
185
+ case "end":
186
+ return _context5.stop();
187
+ }
188
+ }, _loop);
189
+ });
190
+ _iterator.s();
191
+ case 10:
192
+ if ((_step = _iterator.n()).done) {
193
+ _context6.next = 14;
213
194
  break;
214
- case 16:
215
- _context6.prev = 16;
216
- _context6.t1 = _context6["catch"](7);
217
- _iterator.e(_context6.t1);
218
- case 19:
219
- _context6.prev = 19;
220
- _iterator.f();
221
- return _context6.finish(19);
222
- case 22:
223
- return _context6.abrupt("return", downstreamStages.flat());
224
- case 23:
225
- case "end":
226
- return _context6.stop();
227
- }
195
+ }
196
+ return _context6.delegateYield(_loop(), "t0", 12);
197
+ case 12:
198
+ _context6.next = 10;
199
+ break;
200
+ case 14:
201
+ _context6.next = 19;
202
+ break;
203
+ case 16:
204
+ _context6.prev = 16;
205
+ _context6.t1 = _context6["catch"](7);
206
+ _iterator.e(_context6.t1);
207
+ case 19:
208
+ _context6.prev = 19;
209
+ _iterator.f();
210
+ return _context6.finish(19);
211
+ case 22:
212
+ return _context6.abrupt("return", downstreamStages.flat());
213
+ case 23:
214
+ case "end":
215
+ return _context6.stop();
228
216
  }
229
217
  }, _callee5, null, [[7, 16, 19, 22]]);
230
218
  }));
@@ -237,48 +225,46 @@ function _fetchJobs() {
237
225
  _fetchJobs = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee6(projectId, pipelineId, config) {
238
226
  var _yield$gitlabRequest3, gitlabJobs, commit, stages;
239
227
  return _regenerator.default.wrap(function _callee6$(_context7) {
240
- while (1) {
241
- switch (_context7.prev = _context7.next) {
242
- case 0:
243
- _context7.next = 2;
244
- return (0, _client.gitlabRequest)("/projects/".concat(projectId, "/pipelines/").concat(pipelineId, "/jobs?include_retried=true"), {
245
- per_page: 100
246
- }, config);
247
- case 2:
248
- _yield$gitlabRequest3 = _context7.sent;
249
- gitlabJobs = _yield$gitlabRequest3.data;
250
- if (!(gitlabJobs.length === 0)) {
251
- _context7.next = 6;
252
- break;
253
- }
254
- return _context7.abrupt("return", {});
255
- case 6:
256
- commit = findCommit(gitlabJobs);
257
- stages = (0, _lodash.default)(gitlabJobs).map(job => ({
258
- id: job.id,
259
- status: job.status,
260
- stage: job.stage,
261
- name: job.name,
262
- startedAt: job.started_at,
263
- finishedAt: job.finished_at,
264
- url: job.web_url
265
- })).orderBy('id').groupBy('stage').mapValues(mergeRetriedJobs).mapValues(cleanup).toPairs().map(_ref3 => {
266
- var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
267
- name = _ref4[0],
268
- jobs = _ref4[1];
269
- return {
270
- name,
271
- jobs: _lodash.default.sortBy(jobs, 'name')
272
- };
273
- }).value();
274
- return _context7.abrupt("return", {
275
- commit,
276
- stages
277
- });
278
- case 9:
279
- case "end":
280
- return _context7.stop();
281
- }
228
+ while (1) switch (_context7.prev = _context7.next) {
229
+ case 0:
230
+ _context7.next = 2;
231
+ return (0, _client.gitlabRequest)("/projects/".concat(projectId, "/pipelines/").concat(pipelineId, "/jobs?include_retried=true"), {
232
+ per_page: 100
233
+ }, config);
234
+ case 2:
235
+ _yield$gitlabRequest3 = _context7.sent;
236
+ gitlabJobs = _yield$gitlabRequest3.data;
237
+ if (!(gitlabJobs.length === 0)) {
238
+ _context7.next = 6;
239
+ break;
240
+ }
241
+ return _context7.abrupt("return", {});
242
+ case 6:
243
+ commit = findCommit(gitlabJobs);
244
+ stages = (0, _lodash.default)(gitlabJobs).map(job => ({
245
+ id: job.id,
246
+ status: job.status,
247
+ stage: job.stage,
248
+ name: job.name,
249
+ startedAt: job.started_at,
250
+ finishedAt: job.finished_at,
251
+ url: job.web_url
252
+ })).orderBy('id').groupBy('stage').mapValues(mergeRetriedJobs).mapValues(cleanup).toPairs().map(_ref3 => {
253
+ var _ref4 = (0, _slicedToArray2.default)(_ref3, 2),
254
+ name = _ref4[0],
255
+ jobs = _ref4[1];
256
+ return {
257
+ name,
258
+ jobs: _lodash.default.sortBy(jobs, 'name')
259
+ };
260
+ }).value();
261
+ return _context7.abrupt("return", {
262
+ commit,
263
+ stages
264
+ });
265
+ case 9:
266
+ case "end":
267
+ return _context7.stop();
282
268
  }
283
269
  }, _callee6);
284
270
  }));
@@ -15,20 +15,18 @@ function _fetchProjects() {
15
15
  _fetchProjects = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(gitlab) {
16
16
  var projects;
17
17
  return _regenerator.default.wrap(function _callee$(_context) {
18
- while (1) {
19
- switch (_context.prev = _context.next) {
20
- case 0:
21
- _context.next = 2;
22
- return fetchOwnProjects(gitlab);
23
- case 2:
24
- projects = _context.sent;
25
- return _context.abrupt("return", projects
26
- // Ignore projects for which CI/CD is not enabled
27
- .filter(project => project.jobs_enabled).map(projectMapper).filter(includeRegexFilter(gitlab)).filter(excludeRegexFilter(gitlab)).filter(archivedFilter(gitlab)));
28
- case 4:
29
- case "end":
30
- return _context.stop();
31
- }
18
+ while (1) switch (_context.prev = _context.next) {
19
+ case 0:
20
+ _context.next = 2;
21
+ return fetchOwnProjects(gitlab);
22
+ case 2:
23
+ projects = _context.sent;
24
+ return _context.abrupt("return", projects
25
+ // Ignore projects for which CI/CD is not enabled
26
+ .filter(project => project.jobs_enabled).map(projectMapper).filter(includeRegexFilter(gitlab)).filter(excludeRegexFilter(gitlab)).filter(archivedFilter(gitlab)));
27
+ case 4:
28
+ case "end":
29
+ return _context.stop();
32
30
  }
33
31
  }, _callee);
34
32
  }));
@@ -41,43 +39,41 @@ function _fetchOwnProjects() {
41
39
  _fetchOwnProjects = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(gitlab) {
42
40
  var projects, SAFETY_MAX_PAGE, page, _yield$gitlabRequest, data, headers;
43
41
  return _regenerator.default.wrap(function _callee2$(_context2) {
44
- while (1) {
45
- switch (_context2.prev = _context2.next) {
46
- case 0:
47
- projects = [];
48
- SAFETY_MAX_PAGE = 10;
49
- page = 1;
50
- case 3:
51
- if (!(page <= SAFETY_MAX_PAGE)) {
52
- _context2.next = 15;
53
- break;
54
- }
55
- _context2.next = 6;
56
- return (0, _client.gitlabRequest)('/projects', {
57
- page,
58
- per_page: 100,
59
- membership: true
60
- }, gitlab);
61
- case 6:
62
- _yield$gitlabRequest = _context2.sent;
63
- data = _yield$gitlabRequest.data;
64
- headers = _yield$gitlabRequest.headers;
65
- projects.push(data);
66
- if (!(data.length === 0 || !headers['x-next-page'])) {
67
- _context2.next = 12;
68
- break;
69
- }
70
- return _context2.abrupt("break", 15);
71
- case 12:
72
- page += 1;
73
- _context2.next = 3;
42
+ while (1) switch (_context2.prev = _context2.next) {
43
+ case 0:
44
+ projects = [];
45
+ SAFETY_MAX_PAGE = 10;
46
+ page = 1;
47
+ case 3:
48
+ if (!(page <= SAFETY_MAX_PAGE)) {
49
+ _context2.next = 15;
74
50
  break;
75
- case 15:
76
- return _context2.abrupt("return", projects.flat());
77
- case 16:
78
- case "end":
79
- return _context2.stop();
80
- }
51
+ }
52
+ _context2.next = 6;
53
+ return (0, _client.gitlabRequest)('/projects', {
54
+ page,
55
+ per_page: 100,
56
+ membership: true
57
+ }, gitlab);
58
+ case 6:
59
+ _yield$gitlabRequest = _context2.sent;
60
+ data = _yield$gitlabRequest.data;
61
+ headers = _yield$gitlabRequest.headers;
62
+ projects.push(data);
63
+ if (!(data.length === 0 || !headers['x-next-page'])) {
64
+ _context2.next = 12;
65
+ break;
66
+ }
67
+ return _context2.abrupt("break", 15);
68
+ case 12:
69
+ page += 1;
70
+ _context2.next = 3;
71
+ break;
72
+ case 15:
73
+ return _context2.abrupt("return", projects.flat());
74
+ case 16:
75
+ case "end":
76
+ return _context2.stop();
81
77
  }
82
78
  }, _callee2);
83
79
  }));
@@ -15,22 +15,20 @@ function _fetchOfflineRunners() {
15
15
  _fetchOfflineRunners = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(gitlab) {
16
16
  var runners, offline;
17
17
  return _regenerator.default.wrap(function _callee$(_context) {
18
- while (1) {
19
- switch (_context.prev = _context.next) {
20
- case 0:
21
- _context.next = 2;
22
- return fetchRunners(gitlab);
23
- case 2:
24
- runners = _context.sent;
25
- offline = runners.filter(r => r.status === 'offline');
26
- return _context.abrupt("return", {
27
- offline,
28
- totalCount: runners.length
29
- });
30
- case 5:
31
- case "end":
32
- return _context.stop();
33
- }
18
+ while (1) switch (_context.prev = _context.next) {
19
+ case 0:
20
+ _context.next = 2;
21
+ return fetchRunners(gitlab);
22
+ case 2:
23
+ runners = _context.sent;
24
+ offline = runners.filter(r => r.status === 'offline');
25
+ return _context.abrupt("return", {
26
+ offline,
27
+ totalCount: runners.length
28
+ });
29
+ case 5:
30
+ case "end":
31
+ return _context.stop();
34
32
  }
35
33
  }, _callee);
36
34
  }));
@@ -43,22 +41,20 @@ function _fetchRunners() {
43
41
  _fetchRunners = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(gitlab) {
44
42
  var _yield$gitlabRequest, runners;
45
43
  return _regenerator.default.wrap(function _callee2$(_context2) {
46
- while (1) {
47
- switch (_context2.prev = _context2.next) {
48
- case 0:
49
- _context2.next = 2;
50
- return (0, _client.gitlabRequest)('/runners', {}, gitlab);
51
- case 2:
52
- _yield$gitlabRequest = _context2.sent;
53
- runners = _yield$gitlabRequest.data;
54
- return _context2.abrupt("return", runners.map(r => ({
55
- name: r.description || r.id,
56
- status: r.status
57
- })));
58
- case 5:
59
- case "end":
60
- return _context2.stop();
61
- }
44
+ while (1) switch (_context2.prev = _context2.next) {
45
+ case 0:
46
+ _context2.next = 2;
47
+ return (0, _client.gitlabRequest)('/runners', {}, gitlab);
48
+ case 2:
49
+ _yield$gitlabRequest = _context2.sent;
50
+ runners = _yield$gitlabRequest.data;
51
+ return _context2.abrupt("return", runners.map(r => ({
52
+ name: r.description || r.id,
53
+ status: r.status
54
+ })));
55
+ case 5:
56
+ case "end":
57
+ return _context2.stop();
62
58
  }
63
59
  }, _callee2);
64
60
  }));