@jujulego/jill 1.1.15 → 1.1.19

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 (98) hide show
  1. package/dist/commands/each.command.d.ts +16 -0
  2. package/dist/commands/each.command.d.ts.map +1 -0
  3. package/dist/commands/each.command.js +203 -0
  4. package/dist/commands/each.command.js.map +1 -0
  5. package/dist/commands/info.command.d.ts +8 -0
  6. package/dist/commands/info.command.d.ts.map +1 -0
  7. package/dist/commands/info.command.js +178 -0
  8. package/dist/commands/info.command.js.map +1 -0
  9. package/dist/commands/list.command.d.ts +21 -0
  10. package/dist/commands/list.command.d.ts.map +1 -0
  11. package/dist/commands/list.command.js +251 -0
  12. package/dist/commands/list.command.js.map +1 -0
  13. package/dist/commands/run.command.d.ts +12 -0
  14. package/dist/commands/run.command.d.ts.map +1 -0
  15. package/dist/commands/run.command.js +111 -0
  16. package/dist/commands/run.command.js.map +1 -0
  17. package/dist/index.d.ts +4 -9
  18. package/dist/index.d.ts.map +1 -0
  19. package/dist/index.js +13 -26
  20. package/dist/index.js.map +1 -0
  21. package/dist/main.d.ts.map +1 -0
  22. package/dist/main.js +53 -134
  23. package/dist/main.js.map +1 -0
  24. package/dist/myr/commands/kill.command.d.ts +10 -0
  25. package/dist/myr/commands/kill.command.d.ts.map +1 -0
  26. package/dist/myr/commands/kill.command.js +89 -0
  27. package/dist/myr/commands/kill.command.js.map +1 -0
  28. package/dist/myr/commands/list.command.d.ts +17 -0
  29. package/dist/myr/commands/list.command.d.ts.map +1 -0
  30. package/dist/myr/commands/list.command.js +167 -0
  31. package/dist/myr/commands/list.command.js.map +1 -0
  32. package/dist/myr/commands/logs.command.d.ts +10 -0
  33. package/dist/myr/commands/logs.command.d.ts.map +1 -0
  34. package/dist/myr/commands/logs.command.js +165 -0
  35. package/dist/myr/commands/logs.command.js.map +1 -0
  36. package/dist/myr/commands/spawn.command.d.ts +10 -0
  37. package/dist/myr/commands/spawn.command.d.ts.map +1 -0
  38. package/dist/myr/commands/spawn.command.js +84 -0
  39. package/dist/myr/commands/spawn.command.js.map +1 -0
  40. package/dist/myr/commands/stop.command.d.ts +6 -0
  41. package/dist/myr/commands/stop.command.d.ts.map +1 -0
  42. package/dist/myr/commands/stop.command.js +80 -0
  43. package/dist/myr/commands/stop.command.js.map +1 -0
  44. package/dist/myr/myr-client.d.ts +11 -5
  45. package/dist/myr/myr-client.d.ts.map +1 -0
  46. package/dist/myr/myr-client.js +291 -368
  47. package/dist/myr/myr-client.js.map +1 -0
  48. package/dist/myr/myr.command.d.ts +8 -0
  49. package/dist/myr/myr.command.d.ts.map +1 -0
  50. package/dist/myr/myr.command.js +42 -0
  51. package/dist/myr/myr.command.js.map +1 -0
  52. package/dist/myr/myr.process.d.ts.map +1 -0
  53. package/dist/myr/myr.process.js +41 -6
  54. package/dist/myr/myr.process.js.map +1 -0
  55. package/dist/myr/watch.command.d.ts +12 -0
  56. package/dist/myr/watch.command.d.ts.map +1 -0
  57. package/dist/myr/watch.command.js +169 -0
  58. package/dist/myr/watch.command.js.map +1 -0
  59. package/dist/task-logger.d.ts.map +1 -0
  60. package/dist/task-logger.js +28 -17
  61. package/dist/task-logger.js.map +1 -0
  62. package/package.json +29 -23
  63. package/dist/commands/each.d.ts +0 -12
  64. package/dist/commands/each.js +0 -74
  65. package/dist/commands/info.d.ts +0 -5
  66. package/dist/commands/info.js +0 -42
  67. package/dist/commands/list.d.ts +0 -15
  68. package/dist/commands/list.js +0 -119
  69. package/dist/commands/run.d.ts +0 -9
  70. package/dist/commands/run.js +0 -43
  71. package/dist/filters/affected.d.ts +0 -10
  72. package/dist/filters/affected.js +0 -81
  73. package/dist/filters/filter.d.ts +0 -8
  74. package/dist/filters/filter.js +0 -35
  75. package/dist/filters/index.d.ts +0 -2
  76. package/dist/filters/index.js +0 -21
  77. package/dist/logger.d.ts +0 -32
  78. package/dist/logger.js +0 -189
  79. package/dist/myr/command.d.ts +0 -2
  80. package/dist/myr/command.js +0 -52
  81. package/dist/myr/commands/kill.d.ts +0 -5
  82. package/dist/myr/commands/kill.js +0 -34
  83. package/dist/myr/commands/list.d.ts +0 -10
  84. package/dist/myr/commands/list.js +0 -91
  85. package/dist/myr/commands/spawn.d.ts +0 -7
  86. package/dist/myr/commands/spawn.js +0 -39
  87. package/dist/myr/commands/stop.d.ts +0 -2
  88. package/dist/myr/commands/stop.js +0 -31
  89. package/dist/myr/watch.d.ts +0 -8
  90. package/dist/myr/watch.js +0 -79
  91. package/dist/pipeline.d.ts +0 -9
  92. package/dist/pipeline.js +0 -52
  93. package/dist/utils/cli-list.d.ts +0 -15
  94. package/dist/utils/cli-list.js +0 -86
  95. package/dist/utils/deps-tree.d.ts +0 -2
  96. package/dist/utils/deps-tree.js +0 -51
  97. package/dist/wrapper.d.ts +0 -9
  98. package/dist/wrapper.js +0 -38
@@ -5,72 +5,225 @@ Object.defineProperty(exports, "__esModule", {
5
5
  });
6
6
  exports.MyrClient = void 0;
7
7
 
8
+ var _jillCore = require("@jujulego/jill-core");
9
+
8
10
  var _jillMyr = require("@jujulego/jill-myr");
9
11
 
12
+ var _repeater = require("@repeaterjs/repeater");
13
+
10
14
  var _child_process = require("child_process");
11
15
 
16
+ var _graphql = require("graphql");
17
+
12
18
  var _graphqlRequest = require("graphql-request");
13
19
 
20
+ var _graphqlWs = require("graphql-ws");
21
+
22
+ var _graphqlTag = _interopRequireDefault(require("graphql-tag"));
23
+
14
24
  var _path = _interopRequireDefault(require("path"));
15
25
 
16
- var _logger = require("../logger");
26
+ var _ws = _interopRequireDefault(require("ws"));
17
27
 
18
28
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
19
29
 
20
- function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
30
+ var __awaiter = void 0 && (void 0).__awaiter || function (thisArg, _arguments, P, generator) {
31
+ function adopt(value) {
32
+ return value instanceof P ? value : new P(function (resolve) {
33
+ resolve(value);
34
+ });
35
+ }
36
+
37
+ return new (P || (P = Promise))(function (resolve, reject) {
38
+ function fulfilled(value) {
39
+ try {
40
+ step(generator.next(value));
41
+ } catch (e) {
42
+ reject(e);
43
+ }
44
+ }
45
+
46
+ function rejected(value) {
47
+ try {
48
+ step(generator["throw"](value));
49
+ } catch (e) {
50
+ reject(e);
51
+ }
52
+ }
53
+
54
+ function step(result) {
55
+ result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);
56
+ }
57
+
58
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
59
+ });
60
+ };
61
+
62
+ var __rest = void 0 && (void 0).__rest || function (s, e) {
63
+ var t = {};
64
+
65
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];
66
+
67
+ if (s != null && typeof Object.getOwnPropertySymbols === "function") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
68
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];
69
+ }
70
+ return t;
71
+ };
72
+
73
+ var __asyncValues = void 0 && (void 0).__asyncValues || function (o) {
74
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
75
+ var m = o[Symbol.asyncIterator],
76
+ i;
77
+ return m ? m.call(o) : (o = typeof __values === "function" ? __values(o) : o[Symbol.iterator](), i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {
78
+ return this;
79
+ }, i);
80
+
81
+ function verb(n) {
82
+ i[n] = o[n] && function (v) {
83
+ return new Promise(function (resolve, reject) {
84
+ v = o[n](v), settle(resolve, reject, v.done, v.value);
85
+ });
86
+ };
87
+ }
88
+
89
+ function settle(resolve, reject, d, v) {
90
+ Promise.resolve(v).then(function (v) {
91
+ resolve({
92
+ value: v,
93
+ done: d
94
+ });
95
+ }, reject);
96
+ }
97
+ };
98
+
99
+ var __await = void 0 && (void 0).__await || function (v) {
100
+ return this instanceof __await ? (this.v = v, this) : new __await(v);
101
+ };
102
+
103
+ var __asyncGenerator = void 0 && (void 0).__asyncGenerator || function (thisArg, _arguments, generator) {
104
+ if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
105
+ var g = generator.apply(thisArg, _arguments || []),
106
+ i,
107
+ q = [];
108
+ return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () {
109
+ return this;
110
+ }, i;
111
+
112
+ function verb(n) {
113
+ if (g[n]) i[n] = function (v) {
114
+ return new Promise(function (a, b) {
115
+ q.push([n, v, a, b]) > 1 || resume(n, v);
116
+ });
117
+ };
118
+ }
119
+
120
+ function resume(n, v) {
121
+ try {
122
+ step(g[n](v));
123
+ } catch (e) {
124
+ settle(q[0][3], e);
125
+ }
126
+ }
127
+
128
+ function step(r) {
129
+ r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);
130
+ }
131
+
132
+ function fulfill(value) {
133
+ resume("next", value);
134
+ }
135
+
136
+ function reject(value) {
137
+ resume("throw", value);
138
+ }
139
+
140
+ function settle(f, v) {
141
+ if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);
142
+ }
143
+ };
21
144
 
22
145
  // Class
23
146
  class MyrClient {
24
- // Attributes
25
147
  // Constructor
26
148
  constructor(project) {
27
- this.project = project;
149
+ this.project = project; // Attributes
28
150
 
29
- _defineProperty(this, "_logger", _logger.logger.child({
151
+ this._logger = _jillCore.logger.child({
30
152
  context: MyrClient.name
31
- }));
153
+ });
154
+ this._endpoint = 'http://localhost:5001/graphql';
155
+ this._qclient = new _graphqlRequest.GraphQLClient(this._endpoint);
156
+ this._sclient = (0, _graphqlWs.createClient)({
157
+ url: this._endpoint.replace(/^http/, 'ws'),
158
+ webSocketImpl: _ws.default,
159
+ lazy: true
160
+ });
161
+ } // Methods
32
162
 
33
- _defineProperty(this, "_endpoint", 'http://localhost:5001/graphql');
34
163
 
35
- _defineProperty(this, "_qclient", new _graphqlRequest.GraphQLClient(this._endpoint));
36
- } // Methods
164
+ _autoStart(fn) {
165
+ return __awaiter(this, void 0, void 0, function* () {
166
+ try {
167
+ return yield fn();
168
+ } catch (error) {
169
+ if (error.code !== 'ECONNREFUSED') throw error; // Start myr if connection impossible
37
170
 
171
+ this._logger.verbose('Unable to connect to myr server, trying to start it');
38
172
 
39
- async _autoStart(fn) {
40
- try {
41
- return await fn();
42
- } catch (error) {
43
- if (error.code !== 'ECONNREFUSED') throw error; // Start myr if connection impossible
173
+ yield this.start(); // Retry
174
+
175
+ return yield fn();
176
+ }
177
+ });
178
+ }
44
179
 
45
- this._logger.verbose('Unable to connect to myr server, trying to start it');
180
+ _subscription(query, variables) {
181
+ return new _repeater.Repeater((push, stop) => {
182
+ this._sclient.subscribe({
183
+ query: (0, _graphql.print)(query),
184
+ variables
185
+ }, {
186
+ next(value) {
187
+ push(value.data).then();
188
+ },
46
189
 
47
- await this.start(); // Retry
190
+ error(error) {
191
+ stop(error);
192
+ },
48
193
 
49
- return await fn();
50
- }
194
+ complete() {
195
+ stop();
196
+ }
197
+
198
+ });
199
+ });
51
200
  }
52
201
 
53
202
  start() {
203
+ var _a, _b;
204
+
54
205
  const child = (0, _child_process.fork)(_path.default.resolve(__dirname, './myr.process'), [], {
55
206
  cwd: this.project.root,
56
207
  detached: true,
57
208
  stdio: ['ignore', 'pipe', 'pipe', 'ipc']
58
209
  }); // Transmit logs to logger
59
210
 
60
- child.stdout?.on('data', msg => {
211
+ (_a = child.stdout) === null || _a === void 0 ? void 0 : _a.on('data', msg => {
61
212
  for (const line of msg.toString('utf-8').split('\n')) {
62
213
  if (!line) continue;
63
- const {
214
+
215
+ const _a = JSON.parse(line),
216
+ {
64
217
  level,
65
- message,
66
- ...meta
67
- } = JSON.parse(line);
218
+ message
219
+ } = _a,
220
+ meta = __rest(_a, ["level", "message"]);
68
221
 
69
- _logger.logger.log(level, message, meta);
222
+ _jillCore.logger.log(level, message, meta);
70
223
  }
71
224
  });
72
- child.stderr?.on('data', msg => {
73
- _logger.logger.error(msg.toString('utf-8'));
225
+ (_b = child.stderr) === null || _b === void 0 ? void 0 : _b.on('data', msg => {
226
+ _jillCore.logger.error(msg.toString('utf-8'));
74
227
  }); // Start server
75
228
 
76
229
  return new Promise((resolve, reject) => {
@@ -88,368 +241,138 @@ class MyrClient {
88
241
  });
89
242
  }
90
243
 
91
- async stop() {
92
- try {
93
- await this._qclient.request({
94
- "kind": "Document",
95
- "definitions": [{
96
- "kind": "OperationDefinition",
97
- "operation": "mutation",
98
- "name": {
99
- "kind": "Name",
100
- "value": "Shutdown"
101
- },
102
- "variableDefinitions": [],
103
- "directives": [],
104
- "selectionSet": {
105
- "kind": "SelectionSet",
106
- "selections": [{
107
- "kind": "Field",
108
- "name": {
109
- "kind": "Name",
110
- "value": "shutdown"
111
- },
112
- "arguments": [],
113
- "directives": []
114
- }]
115
- }
116
- }],
117
- "loc": {
118
- "start": 0,
119
- "end": 64,
120
- "source": {
121
- "body": "\n mutation Shutdown {\n shutdown\n }\n ",
122
- "name": "GraphQL request",
123
- "locationOffset": {
124
- "line": 1,
125
- "column": 1
126
- }
127
- }
244
+ stop() {
245
+ return __awaiter(this, void 0, void 0, function* () {
246
+ try {
247
+ yield this._qclient.request((0, _graphqlTag.default)`
248
+ mutation Shutdown {
249
+ shutdown
128
250
  }
129
- });
130
- return true;
131
- } catch (error) {
132
- if (error.code !== 'ECONNREFUSED') throw error;
133
- return false;
134
- }
251
+ `);
252
+ return true;
253
+ } catch (error) {
254
+ if (error.code !== 'ECONNREFUSED') throw error;
255
+ return false;
256
+ }
257
+ });
135
258
  }
136
259
 
137
- async tasks() {
138
- return await this._autoStart(async () => {
139
- const {
140
- tasks
141
- } = await this._qclient.request({
142
- "kind": "Document",
143
- "definitions": [{
144
- "kind": "OperationDefinition",
145
- "operation": "query",
146
- "name": {
147
- "kind": "Name",
148
- "value": "Tasks"
149
- },
150
- "variableDefinitions": [],
151
- "directives": [],
152
- "selectionSet": {
153
- "kind": "SelectionSet",
154
- "selections": [{
155
- "kind": "Field",
156
- "name": {
157
- "kind": "Name",
158
- "value": "tasks"
159
- },
160
- "arguments": [],
161
- "directives": [],
162
- "selectionSet": {
163
- "kind": "SelectionSet",
164
- "selections": [{
165
- "kind": "FragmentSpread",
166
- "name": {
167
- "kind": "Name",
168
- "value": "Task"
169
- },
170
- "directives": []
171
- }]
260
+ tasks() {
261
+ return __awaiter(this, void 0, void 0, function* () {
262
+ return yield this._autoStart(() => __awaiter(this, void 0, void 0, function* () {
263
+ const {
264
+ tasks
265
+ } = yield this._qclient.request((0, _graphqlTag.default)`
266
+ query Tasks {
267
+ tasks {
268
+ ...Task
172
269
  }
173
- }]
174
- }
175
- }].concat(_jillMyr.TaskFragment.definitions).reduce((acc, definition) => definition.kind === 'FragmentDefinition' && acc.find(curDef => curDef.kind === 'FragmentDefinition' && curDef.name.value === definition.name.value) ? acc : acc.concat(definition), []),
176
- "loc": {
177
- "start": 0,
178
- "end": 119,
179
- "source": {
180
- "body": "\n query Tasks {\n tasks {\n ...Task\n }\n }\n\n \n ",
181
- "name": "GraphQL request",
182
- "locationOffset": {
183
- "line": 1,
184
- "column": 1
185
- }
186
270
  }
187
- }
188
- });
189
- return tasks;
271
+
272
+ ${_jillMyr.TaskFragment}
273
+ `);
274
+ return tasks;
275
+ }));
190
276
  });
191
277
  }
192
278
 
193
- async spawn(cwd, cmd, args = []) {
194
- return await this._autoStart(async () => {
195
- const {
196
- spawn
197
- } = await this._qclient.request({
198
- "kind": "Document",
199
- "definitions": [{
200
- "kind": "OperationDefinition",
201
- "operation": "mutation",
202
- "name": {
203
- "kind": "Name",
204
- "value": "Spawn"
205
- },
206
- "variableDefinitions": [{
207
- "kind": "VariableDefinition",
208
- "variable": {
209
- "kind": "Variable",
210
- "name": {
211
- "kind": "Name",
212
- "value": "cwd"
213
- }
214
- },
215
- "type": {
216
- "kind": "NonNullType",
217
- "type": {
218
- "kind": "NamedType",
219
- "name": {
220
- "kind": "Name",
221
- "value": "String"
222
- }
223
- }
224
- },
225
- "directives": []
226
- }, {
227
- "kind": "VariableDefinition",
228
- "variable": {
229
- "kind": "Variable",
230
- "name": {
231
- "kind": "Name",
232
- "value": "cmd"
233
- }
234
- },
235
- "type": {
236
- "kind": "NonNullType",
237
- "type": {
238
- "kind": "NamedType",
239
- "name": {
240
- "kind": "Name",
241
- "value": "String"
242
- }
243
- }
244
- },
245
- "directives": []
246
- }, {
247
- "kind": "VariableDefinition",
248
- "variable": {
249
- "kind": "Variable",
250
- "name": {
251
- "kind": "Name",
252
- "value": "args"
253
- }
254
- },
255
- "type": {
256
- "kind": "NonNullType",
257
- "type": {
258
- "kind": "ListType",
259
- "type": {
260
- "kind": "NonNullType",
261
- "type": {
262
- "kind": "NamedType",
263
- "name": {
264
- "kind": "Name",
265
- "value": "String"
266
- }
267
- }
268
- }
269
- }
270
- },
271
- "directives": []
272
- }],
273
- "directives": [],
274
- "selectionSet": {
275
- "kind": "SelectionSet",
276
- "selections": [{
277
- "kind": "Field",
278
- "name": {
279
- "kind": "Name",
280
- "value": "spawn"
281
- },
282
- "arguments": [{
283
- "kind": "Argument",
284
- "name": {
285
- "kind": "Name",
286
- "value": "cwd"
287
- },
288
- "value": {
289
- "kind": "Variable",
290
- "name": {
291
- "kind": "Name",
292
- "value": "cwd"
293
- }
294
- }
295
- }, {
296
- "kind": "Argument",
297
- "name": {
298
- "kind": "Name",
299
- "value": "cmd"
300
- },
301
- "value": {
302
- "kind": "Variable",
303
- "name": {
304
- "kind": "Name",
305
- "value": "cmd"
306
- }
307
- }
308
- }, {
309
- "kind": "Argument",
310
- "name": {
311
- "kind": "Name",
312
- "value": "args"
313
- },
314
- "value": {
315
- "kind": "Variable",
316
- "name": {
317
- "kind": "Name",
318
- "value": "args"
319
- }
320
- }
321
- }],
322
- "directives": [],
323
- "selectionSet": {
324
- "kind": "SelectionSet",
325
- "selections": [{
326
- "kind": "FragmentSpread",
327
- "name": {
328
- "kind": "Name",
329
- "value": "Task"
330
- },
331
- "directives": []
332
- }]
279
+ spawn(cwd, cmd, args = []) {
280
+ return __awaiter(this, void 0, void 0, function* () {
281
+ return yield this._autoStart(() => __awaiter(this, void 0, void 0, function* () {
282
+ const {
283
+ spawn
284
+ } = yield this._qclient.request((0, _graphqlTag.default)`
285
+ mutation Spawn($cwd: String!, $cmd: String!, $args: [String!]!) {
286
+ spawn(cwd: $cwd, cmd: $cmd, args: $args) {
287
+ ...Task
333
288
  }
334
- }]
335
- }
336
- }].concat(_jillMyr.TaskFragment.definitions).reduce((acc, definition) => definition.kind === 'FragmentDefinition' && acc.find(curDef => curDef.kind === 'FragmentDefinition' && curDef.name.value === definition.name.value) ? acc : acc.concat(definition), []),
337
- "loc": {
338
- "start": 0,
339
- "end": 206,
340
- "source": {
341
- "body": "\n mutation Spawn($cwd: String!, $cmd: String!, $args: [String!]!) {\n spawn(cwd: $cwd, cmd: $cmd, args: $args) {\n ...Task\n }\n }\n\n \n ",
342
- "name": "GraphQL request",
343
- "locationOffset": {
344
- "line": 1,
345
- "column": 1
346
- }
347
289
  }
348
- }
349
- }, {
350
- cwd,
351
- cmd,
352
- args
353
- });
354
- return spawn;
290
+
291
+ ${_jillMyr.TaskFragment}
292
+ `, {
293
+ cwd,
294
+ cmd,
295
+ args
296
+ });
297
+ return spawn;
298
+ }));
355
299
  });
356
300
  }
357
301
 
358
- async spawnScript(wks, script, args = []) {
359
- return await this.spawn(wks.cwd, await wks.project.packageManager(), [script, ...args]);
302
+ spawnScript(wks, script, args = []) {
303
+ return __awaiter(this, void 0, void 0, function* () {
304
+ return yield this.spawn(wks.cwd, yield wks.project.packageManager(), [script, ...args]);
305
+ });
360
306
  }
361
307
 
362
- async kill(id) {
363
- return await this._autoStart(async () => {
364
- const {
365
- kill
366
- } = await this._qclient.request({
367
- "kind": "Document",
368
- "definitions": [{
369
- "kind": "OperationDefinition",
370
- "operation": "mutation",
371
- "name": {
372
- "kind": "Name",
373
- "value": "Kill"
374
- },
375
- "variableDefinitions": [{
376
- "kind": "VariableDefinition",
377
- "variable": {
378
- "kind": "Variable",
379
- "name": {
380
- "kind": "Name",
381
- "value": "id"
382
- }
383
- },
384
- "type": {
385
- "kind": "NonNullType",
386
- "type": {
387
- "kind": "NamedType",
388
- "name": {
389
- "kind": "Name",
390
- "value": "ID"
391
- }
392
- }
393
- },
394
- "directives": []
395
- }],
396
- "directives": [],
397
- "selectionSet": {
398
- "kind": "SelectionSet",
399
- "selections": [{
400
- "kind": "Field",
401
- "name": {
402
- "kind": "Name",
403
- "value": "kill"
404
- },
405
- "arguments": [{
406
- "kind": "Argument",
407
- "name": {
408
- "kind": "Name",
409
- "value": "id"
410
- },
411
- "value": {
412
- "kind": "Variable",
413
- "name": {
414
- "kind": "Name",
415
- "value": "id"
416
- }
417
- }
418
- }],
419
- "directives": [],
420
- "selectionSet": {
421
- "kind": "SelectionSet",
422
- "selections": [{
423
- "kind": "FragmentSpread",
424
- "name": {
425
- "kind": "Name",
426
- "value": "Task"
427
- },
428
- "directives": []
429
- }]
430
- }
431
- }]
308
+ logs() {
309
+ return __awaiter(this, void 0, void 0, function* () {
310
+ try {
311
+ const res = yield this._qclient.request((0, _graphqlTag.default)`
312
+ query Logs {
313
+ logs
314
+ }
315
+ `);
316
+ return res.logs;
317
+ } catch (error) {
318
+ if (error.code !== 'ECONNREFUSED') throw error;
319
+ return [];
320
+ }
321
+ });
322
+ }
323
+
324
+ logs$() {
325
+ return __asyncGenerator(this, arguments, function* logs$_1() {
326
+ var e_1, _a;
327
+
328
+ try {
329
+ try {
330
+ for (var _b = __asyncValues(this._subscription((0, _graphqlTag.default)`subscription Logs { log }`, {})), _c; _c = yield __await(_b.next()), !_c.done;) {
331
+ const {
332
+ log
333
+ } = _c.value;
334
+ yield yield __await(log);
432
335
  }
433
- }].concat(_jillMyr.TaskFragment.definitions).reduce((acc, definition) => definition.kind === 'FragmentDefinition' && acc.find(curDef => curDef.kind === 'FragmentDefinition' && curDef.name.value === definition.name.value) ? acc : acc.concat(definition), []),
434
- "loc": {
435
- "start": 0,
436
- "end": 139,
437
- "source": {
438
- "body": "\n mutation Kill($id: ID!) {\n kill(id: $id) {\n ...Task\n }\n }\n\n \n ",
439
- "name": "GraphQL request",
440
- "locationOffset": {
441
- "line": 1,
442
- "column": 1
443
- }
336
+ } catch (e_1_1) {
337
+ e_1 = {
338
+ error: e_1_1
339
+ };
340
+ } finally {
341
+ try {
342
+ if (_c && !_c.done && (_a = _b.return)) yield __await(_a.call(_b));
343
+ } finally {
344
+ if (e_1) throw e_1.error;
444
345
  }
445
346
  }
446
- }, {
447
- id
448
- });
449
- return kill;
347
+ } catch (error) {
348
+ if (error.code !== 'ECONNREFUSED') throw error;
349
+ return yield __await(void 0);
350
+ }
351
+ });
352
+ }
353
+
354
+ kill(id) {
355
+ return __awaiter(this, void 0, void 0, function* () {
356
+ return yield this._autoStart(() => __awaiter(this, void 0, void 0, function* () {
357
+ const {
358
+ kill
359
+ } = yield this._qclient.request((0, _graphqlTag.default)`
360
+ mutation Kill($id: ID!) {
361
+ kill(id: $id) {
362
+ ...Task
363
+ }
364
+ }
365
+
366
+ ${_jillMyr.TaskFragment}
367
+ `, {
368
+ id
369
+ });
370
+ return kill;
371
+ }));
450
372
  });
451
373
  }
452
374
 
453
375
  }
454
376
 
455
- exports.MyrClient = MyrClient;
377
+ exports.MyrClient = MyrClient;
378
+ //# sourceMappingURL=myr-client.js.map