@webda/async 2.0.0-beta.2 → 2.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.d.ts CHANGED
@@ -1,4 +1,4 @@
1
- export * from "./models";
2
- export * from "./services/asyncjobservice";
3
- export * from "./services/runner";
4
- export * from "./services/localrunner";
1
+ export * from "./models.js";
2
+ export * from "./services/asyncjobservice.js";
3
+ export * from "./services/runner.js";
4
+ export * from "./services/localrunner.js";
package/lib/index.js CHANGED
@@ -1,21 +1,5 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./models"), exports);
18
- __exportStar(require("./services/asyncjobservice"), exports);
19
- __exportStar(require("./services/runner"), exports);
20
- __exportStar(require("./services/localrunner"), exports);
1
+ export * from "./models.js";
2
+ export * from "./services/asyncjobservice.js";
3
+ export * from "./services/runner.js";
4
+ export * from "./services/localrunner.js";
21
5
  //# sourceMappingURL=index.js.map
package/lib/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,6DAA2C;AAC3C,oDAAkC;AAClC,yDAAuC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,UAAU,CAAC;AACzB,cAAc,4BAA4B,CAAC;AAC3C,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC"}
package/lib/models.d.ts CHANGED
@@ -26,6 +26,10 @@ export interface Job {
26
26
  * @WebdaModel
27
27
  */
28
28
  export default class AsyncAction extends CoreModel {
29
+ /**
30
+ * Action uuid
31
+ */
32
+ uuid: string;
29
33
  /**
30
34
  * Current status
31
35
  */
package/lib/models.js CHANGED
@@ -1,19 +1,14 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.AsyncAction = exports.WebdaAsyncAction = void 0;
4
- const core_1 = require("@webda/core");
1
+ import { CoreModel } from "@webda/core";
5
2
  /**
6
3
  * Define here a model that can be used along with Store service
7
4
  * @WebdaModel
8
5
  */
9
- class AsyncAction extends core_1.CoreModel {
6
+ export default class AsyncAction extends CoreModel {
10
7
  }
11
- exports.default = AsyncAction;
12
- exports.AsyncAction = AsyncAction;
13
8
  /**
14
9
  * Define a Webda Async Action
15
10
  */
16
- class WebdaAsyncAction extends AsyncAction {
11
+ export class WebdaAsyncAction extends AsyncAction {
17
12
  }
18
- exports.WebdaAsyncAction = WebdaAsyncAction;
13
+ export { AsyncAction };
19
14
  //# sourceMappingURL=models.js.map
package/lib/models.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":";;;AAAA,sCAAwC;AAyBxC;;;GAGG;AACH,MAAqB,WAAY,SAAQ,gBAAS;CAuDjD;AAvDD,8BAuDC;AAgBQ,kCAAW;AAdpB;;GAEG;AACH,MAAa,gBAAiB,SAAQ,WAAW;CAShD;AATD,4CASC"}
1
+ {"version":3,"file":"models.js","sourceRoot":"","sources":["../src/models.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAyBxC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,SAAS;CA2DjD;AAED;;GAEG;AACH,MAAM,OAAO,gBAAiB,SAAQ,WAAW;CAShD;AAED,OAAO,EAAE,WAAW,EAAE,CAAC"}
@@ -1,6 +1,6 @@
1
1
  import { CloudBinary, Context, Queue, RequestFilter, Service, ServiceParameters, Store } from "@webda/core";
2
- import { AsyncAction, AsyncActionQueueItem } from "../models";
3
- import { Runner } from "./runner";
2
+ import { AsyncAction, AsyncActionQueueItem } from "../models.js";
3
+ import { Runner } from "./runner.js";
4
4
  /**
5
5
  * Represent a Job information as you will find in env
6
6
  */
@@ -90,7 +90,7 @@ export default class AsyncJobService<T extends AsyncJobServiceParameters = Async
90
90
  /**
91
91
  * @inheritdoc
92
92
  */
93
- resolve(): void;
93
+ resolve(): this;
94
94
  /**
95
95
  * Allow job status report url
96
96
  */
@@ -131,8 +131,7 @@ export default class AsyncJobService<T extends AsyncJobServiceParameters = Async
131
131
  * @returns
132
132
  */
133
133
  getHeaders(jobInfo: JobInfo): {
134
- "X-Job-Id": string;
135
- "X-Job-Time": string;
134
+ [key: string]: string;
136
135
  };
137
136
  /**
138
137
  * Wrap async job and call the job status hook
@@ -1,40 +1,26 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.AsyncJobService = exports.AsyncJobServiceParameters = void 0;
13
- const core_1 = require("@webda/core");
14
- const axios_1 = require("axios");
15
- const crypto = require("crypto");
16
- const uuid_1 = require("uuid");
17
- const runner_1 = require("./runner");
1
+ import { Service, ServiceParameters } from "@webda/core";
2
+ import axios from "axios";
3
+ import * as crypto from "crypto";
4
+ import { v4 as uuidv4 } from "uuid";
5
+ import { Runner } from "./runner.js";
18
6
  /**
19
7
  * @inheritdoc
20
8
  */
21
- class AsyncJobServiceParameters extends core_1.ServiceParameters {
9
+ export class AsyncJobServiceParameters extends ServiceParameters {
22
10
  constructor(params) {
23
- var _a, _b, _c, _d;
24
11
  super(params);
25
- (_a = this.url) !== null && _a !== void 0 ? _a : (this.url = "/async/jobs");
26
- (_b = this.queue) !== null && _b !== void 0 ? _b : (this.queue = "AsyncActionsQueue");
27
- (_c = this.store) !== null && _c !== void 0 ? _c : (this.store = "AsyncActions");
28
- (_d = this.runners) !== null && _d !== void 0 ? _d : (this.runners = []);
12
+ this.url ?? (this.url = "/async/jobs");
13
+ this.queue ?? (this.queue = "AsyncActionsQueue");
14
+ this.store ?? (this.store = "AsyncActions");
15
+ this.runners ?? (this.runners = []);
29
16
  }
30
17
  }
31
- exports.AsyncJobServiceParameters = AsyncJobServiceParameters;
32
18
  /**
33
19
  * AsyncService allows you to launch jobs and report status
34
20
  *
35
21
  * @WebdaModda
36
22
  */
37
- class AsyncJobService extends core_1.Service {
23
+ export default class AsyncJobService extends Service {
38
24
  /**
39
25
  * @inheritdoc
40
26
  */
@@ -86,132 +72,124 @@ class AsyncJobService extends core_1.Service {
86
72
  });
87
73
  }
88
74
  this.getWebda().registerRequestFilter(this);
75
+ return this;
89
76
  }
90
77
  /**
91
78
  * Allow job status report url
92
79
  */
93
- checkRequest(context) {
94
- return __awaiter(this, void 0, void 0, function* () {
95
- const url = context.getHttpContext().getRelativeUri();
96
- if (url.startsWith(this.parameters.url)) {
97
- // Allow status url to be called without other mechanism
98
- yield this.verifyJobRequest(context);
99
- return true;
100
- }
101
- return false;
102
- });
80
+ async checkRequest(context) {
81
+ const url = context.getHttpContext().getRelativeUri();
82
+ if (url.startsWith(this.parameters.url)) {
83
+ // Allow status url to be called without other mechanism
84
+ await this.verifyJobRequest(context);
85
+ return true;
86
+ }
87
+ return false;
103
88
  }
104
89
  /**
105
90
  *
106
91
  * @param context
107
92
  * @param action
108
93
  */
109
- verifyJobRequest(context) {
110
- return __awaiter(this, void 0, void 0, function* () {
111
- const jobId = context.getHttpContext().getUniqueHeader("X-Job-Id");
112
- if (!jobId) {
113
- this.log("TRACE", "Require Job Id");
114
- throw 404;
115
- }
116
- const action = yield this.store.get(jobId);
117
- if (!action) {
118
- this.log("TRACE", `Unknown Job Id '${jobId}'`);
119
- throw 404;
120
- }
121
- const jobTime = context.getHttpContext().getUniqueHeader("X-Job-Time");
122
- const jobHash = context.getHttpContext().getUniqueHeader("X-Job-Hash");
123
- // Ensure hash mac is correct
124
- if (jobHash !== crypto.createHmac(AsyncJobService.HMAC_ALGO, action.__secretKey).update(jobTime).digest("hex")) {
125
- this.log("TRACE", "Invalid Job HMAC");
126
- throw 403;
127
- }
128
- // Set the context extension
129
- context.setExtension("asyncJob", action);
130
- return action;
131
- });
94
+ async verifyJobRequest(context) {
95
+ const jobId = context.getHttpContext().getUniqueHeader("X-Job-Id");
96
+ if (!jobId) {
97
+ this.log("TRACE", "Require Job Id");
98
+ throw 404;
99
+ }
100
+ const action = await this.store.get(jobId);
101
+ if (!action) {
102
+ this.log("TRACE", `Unknown Job Id '${jobId}'`);
103
+ throw 404;
104
+ }
105
+ const jobTime = context.getHttpContext().getUniqueHeader("X-Job-Time");
106
+ const jobHash = context.getHttpContext().getUniqueHeader("X-Job-Hash");
107
+ // Ensure hash mac is correct
108
+ if (jobHash !== crypto.createHmac(AsyncJobService.HMAC_ALGO, action.__secretKey).update(jobTime).digest("hex")) {
109
+ this.log("TRACE", "Invalid Job HMAC");
110
+ throw 403;
111
+ }
112
+ // Set the context extension
113
+ context.setExtension("asyncJob", action);
114
+ return action;
132
115
  }
133
116
  /**
134
117
  * Status hook for job report
135
118
  *
136
119
  * Only updates specific fields: status, errorMessage, statusDetails, results, logs (appending)
137
120
  */
138
- statusHook(context) {
139
- return __awaiter(this, void 0, void 0, function* () {
140
- const action = yield this.verifyJobRequest(context);
141
- const body = yield context.getRequestBody();
142
- action._lastJobUpdate = Number.parseInt(context.getHttpContext().getUniqueHeader("X-Job-Time")) || 0;
143
- if (Date.now() - action._lastJobUpdate > 60) {
144
- action._lastJobUpdate = Date.now();
121
+ async statusHook(context) {
122
+ const action = await this.verifyJobRequest(context);
123
+ const body = await context.getRequestBody();
124
+ action._lastJobUpdate = Number.parseInt(context.getHttpContext().getUniqueHeader("X-Job-Time")) || 0;
125
+ if (Date.now() - action._lastJobUpdate > 60) {
126
+ action._lastJobUpdate = Date.now();
127
+ }
128
+ if (body.logs && Array.isArray(body.logs)) {
129
+ action.logs.push(...body.logs);
130
+ // Prevent having too much logs
131
+ if (action.logs.length > 100) {
132
+ action.logs = action.logs.slice(-100);
145
133
  }
146
- if (body.logs && Array.isArray(body.logs)) {
147
- action.logs.push(...body.logs);
148
- // Prevent having too much logs
149
- if (action.logs.length > 100) {
150
- action.logs = action.logs.slice(-100);
151
- }
134
+ }
135
+ ["status", "errorMessage", "statusDetails", "results"].forEach(k => {
136
+ if (body[k] !== undefined) {
137
+ // @ts-ignore
138
+ action[k] = body[k];
152
139
  }
153
- ["status", "errorMessage", "statusDetails", "results"].forEach(k => {
154
- if (body[k] !== undefined) {
155
- action[k] = body[k];
156
- }
157
- });
158
- yield this.store.save(action);
159
- context.write(Object.assign(Object.assign({}, action), { logs: undefined, statusDetails: undefined }));
160
140
  });
141
+ await this.store.save(action);
142
+ context.write({ ...action, logs: undefined, statusDetails: undefined });
161
143
  }
162
144
  /**
163
145
  * Worker
164
146
  *
165
147
  * This will launch actions based on defined runners
166
148
  */
167
- worker() {
168
- return __awaiter(this, void 0, void 0, function* () {
169
- if (this.runners.length === 0) {
170
- throw new Error(`AsyncJobService.worker requires runners`);
171
- }
172
- return this.queue.consume(this.handleEvent.bind(this));
173
- });
149
+ async worker() {
150
+ if (this.runners.length === 0) {
151
+ throw new Error(`AsyncJobService.worker requires runners`);
152
+ }
153
+ return this.queue.consume(this.handleEvent.bind(this));
174
154
  }
175
155
  /**
176
156
  * Handle one event from the queue and launch the job
177
157
  * @param event
178
158
  */
179
- handleEvent(event) {
180
- return __awaiter(this, void 0, void 0, function* () {
181
- let selectedRunner;
182
- // Take first to acknowledge the job
183
- for (let runner of this.runners) {
184
- if (runner.handleType(event.type)) {
185
- selectedRunner = runner;
186
- break;
187
- }
188
- }
189
- // Fallback if needed
190
- if (selectedRunner === undefined && this.parameters.fallbackOnFirst) {
191
- selectedRunner = this.runners[0];
192
- }
193
- if (selectedRunner === undefined) {
194
- yield this.store.patch({
195
- uuid: event.uuid,
196
- status: "ERROR",
197
- errorMessage: `No runner found for the job`
198
- });
199
- return;
159
+ async handleEvent(event) {
160
+ let selectedRunner;
161
+ // Take first to acknowledge the job
162
+ for (let runner of this.runners) {
163
+ if (runner.handleType(event.type)) {
164
+ selectedRunner = runner;
165
+ break;
200
166
  }
201
- yield this.store.patch({
167
+ }
168
+ // Fallback if needed
169
+ if (selectedRunner === undefined && this.parameters.fallbackOnFirst) {
170
+ selectedRunner = this.runners[0];
171
+ }
172
+ if (selectedRunner === undefined) {
173
+ await this.store.patch({
202
174
  uuid: event.uuid,
203
- status: "STARTING"
204
- });
205
- const action = yield this.store.get(event.uuid);
206
- const info = {
207
- JOB_SECRET_KEY: action.__secretKey,
208
- JOB_ID: action.getUuid(),
209
- JOB_HOOK: this.getWebda().getApiUrl(this.parameters.url),
210
- JOB_ORCHESTRATOR: this.getName()
211
- };
212
- yield action.update({
213
- job: yield selectedRunner.launchAction(action, info)
175
+ status: "ERROR",
176
+ errorMessage: `No runner found for the job`
214
177
  });
178
+ return;
179
+ }
180
+ await this.store.patch({
181
+ uuid: event.uuid,
182
+ status: "STARTING"
183
+ });
184
+ const action = await this.store.get(event.uuid);
185
+ const info = {
186
+ JOB_SECRET_KEY: action.__secretKey,
187
+ JOB_ID: action.getUuid(),
188
+ JOB_HOOK: this.getWebda().getApiUrl(this.parameters.url),
189
+ JOB_ORCHESTRATOR: this.getName()
190
+ };
191
+ await action.patch({
192
+ job: await selectedRunner.launchAction(action, info)
215
193
  });
216
194
  }
217
195
  /**
@@ -219,17 +197,15 @@ class AsyncJobService extends core_1.Service {
219
197
  * @param action
220
198
  * @returns
221
199
  */
222
- launchAction(action) {
223
- return __awaiter(this, void 0, void 0, function* () {
224
- action.status = "QUEUED";
225
- action.type = action.constructor.name;
226
- action.__secretKey = (0, uuid_1.v4)();
227
- yield this.store.save(action);
228
- if (this.parameters.localLaunch) {
229
- return this.handleEvent({ uuid: action.getUuid(), __secretKey: action.__secretKey, type: action.type });
230
- }
231
- return this.queue.sendMessage({ uuid: action.getUuid(), __secretKey: action.__secretKey, type: action.type });
232
- });
200
+ async launchAction(action) {
201
+ action.status = "QUEUED";
202
+ action.type = action.constructor.name;
203
+ action.__secretKey = uuidv4();
204
+ await this.store.save(action);
205
+ if (this.parameters.localLaunch) {
206
+ return this.handleEvent({ uuid: action.getUuid(), __secretKey: action.__secretKey, type: action.type });
207
+ }
208
+ return this.queue.sendMessage({ uuid: action.getUuid(), __secretKey: action.__secretKey, type: action.type });
233
209
  }
234
210
  /**
235
211
  * Return headers to request status hook
@@ -251,70 +227,73 @@ class AsyncJobService extends core_1.Service {
251
227
  /**
252
228
  * Wrap async job and call the job status hook
253
229
  */
254
- runWebdaAsyncAction(jobInfo = undefined) {
255
- return __awaiter(this, void 0, void 0, function* () {
256
- // Get it from environment
257
- if (jobInfo === undefined) {
258
- jobInfo = {};
259
- Object.keys(process.env)
260
- .filter(k => k.startsWith("JOB_"))
261
- .forEach(k => (jobInfo[k] = process.env[k]));
230
+ async runWebdaAsyncAction(jobInfo) {
231
+ // Get it from environment
232
+ if (jobInfo === undefined) {
233
+ jobInfo = {};
234
+ Object.keys(process.env)
235
+ .filter(k => k.startsWith("JOB_"))
236
+ // @ts-ignore
237
+ .forEach((k) => (jobInfo[k] = process.env[k]));
238
+ }
239
+ // Ensure correct context
240
+ if (!jobInfo.JOB_ORCHESTRATOR || !jobInfo.JOB_ID || !jobInfo.JOB_SECRET_KEY || !jobInfo.JOB_HOOK) {
241
+ throw new Error("Cannot run AsyncAction without context");
242
+ }
243
+ // If we are not the target redirect to the right one
244
+ if (jobInfo.JOB_ORCHESTRATOR !== this.getName()) {
245
+ return this.getService(jobInfo.JOB_ORCHESTRATOR).runWebdaAsyncAction(jobInfo);
246
+ }
247
+ // Get action info by calling the hook
248
+ let action = (await axios.post(jobInfo.JOB_HOOK, {
249
+ agent: {
250
+ ...Runner.getAgentInfo(),
251
+ nodeVersion: process.version
252
+ },
253
+ status: "RUNNING"
254
+ }, {
255
+ headers: this.getHeaders(jobInfo)
256
+ })).data;
257
+ let results;
258
+ try {
259
+ // Check it contains the right info
260
+ if (!action.method || !action.serviceName) {
261
+ throw new Error("WebdaAsyncAction must have method and serviceName defined at least");
262
262
  }
263
- // Ensure correct context
264
- if (!jobInfo.JOB_ORCHESTRATOR || !jobInfo.JOB_ID || !jobInfo.JOB_SECRET_KEY || !jobInfo.JOB_HOOK) {
265
- throw new Error("Cannot run AsyncAction without context");
263
+ // Call the service[method](...args)
264
+ let service = this.getService(action.serviceName);
265
+ if (!service) {
266
+ throw new Error(`WebdaAsyncAction Service '${action.serviceName}' not found: mismatch app version`);
266
267
  }
267
- // If we are not the target redirect to the right one
268
- if (jobInfo.JOB_ORCHESTRATOR !== this.getName()) {
269
- return this.getService(jobInfo.JOB_ORCHESTRATOR).runWebdaAsyncAction(jobInfo);
268
+ // @ts-ignore
269
+ if (!service[action.method]) {
270
+ throw new Error(`WebdaAsyncAction Method '${action.method}' not found in service ${action.serviceName}: mismatch app version`);
270
271
  }
271
- // Get action info by calling the hook
272
- let action = (yield axios_1.default.post(jobInfo.JOB_HOOK, {
273
- agent: Object.assign(Object.assign({}, runner_1.Runner.getAgentInfo()), { nodeVersion: process.version }),
274
- status: "RUNNING"
275
- }, {
276
- headers: this.getHeaders(jobInfo)
277
- })).data;
278
- let results;
279
- try {
280
- // Check it contains the right info
281
- if (!action.method || !action.serviceName) {
282
- throw new Error("WebdaAsyncAction must have method and serviceName defined at least");
283
- }
284
- // Call the service[method](...args)
285
- let service = this.getService(action.serviceName);
286
- if (!service) {
287
- throw new Error(`WebdaAsyncAction Service '${action.serviceName}' not found: mismatch app version`);
288
- }
289
- if (!service[action.method]) {
290
- throw new Error(`WebdaAsyncAction Method '${action.method}' not found in service ${action.serviceName}: mismatch app version`);
291
- }
292
- results = yield service[action.method](...action.arguments);
293
- }
294
- catch (err) {
295
- // Job is in error
296
- yield axios_1.default.post(jobInfo.JOB_HOOK, {
297
- errorMessage: err.message,
298
- status: "ERROR"
299
- }, {
300
- headers: this.getHeaders(jobInfo)
301
- });
302
- return;
303
- }
304
- // Update status
305
- yield axios_1.default.post(jobInfo.JOB_HOOK, {
306
- results,
307
- status: "SUCCESS"
272
+ // @ts-ignore
273
+ results = await service[action.method](...(action.arguments || []));
274
+ }
275
+ catch (err) {
276
+ // Job is in error
277
+ await axios.post(jobInfo.JOB_HOOK, {
278
+ errorMessage: err?.message,
279
+ status: "ERROR"
308
280
  }, {
309
281
  headers: this.getHeaders(jobInfo)
310
282
  });
283
+ return;
284
+ }
285
+ // Update status
286
+ await axios.post(jobInfo.JOB_HOOK, {
287
+ results,
288
+ status: "SUCCESS"
289
+ }, {
290
+ headers: this.getHeaders(jobInfo)
311
291
  });
312
292
  }
313
293
  }
314
- exports.default = AsyncJobService;
315
- exports.AsyncJobService = AsyncJobService;
316
294
  /**
317
295
  * HMAC Algorithm used for simple auth
318
296
  */
319
297
  AsyncJobService.HMAC_ALGO = "sha256";
298
+ export { AsyncJobService };
320
299
  //# sourceMappingURL=asyncjobservice.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"asyncjobservice.js","sourceRoot":"","sources":["../../src/services/asyncjobservice.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,sCAA4G;AAC5G,iCAA6C;AA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CAAC;YAClD,IAAI,CAAC,OAAO,EAAE;gBACZ,MAAM,IAAI,KAAK,CAAC,6BAA6B,MAAM,CAAC,WAAW,mCAAmC,CAAC,CAAC;aACrG;YACD,aAAa;YACb,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE;gBAC3B,MAAM,IAAI,KAAK,CACb,4BAA4B,MAAM,CAAC,MAAM,0BAA0B,MAAM,CAAC,WAAW,wBAAwB,CAC9G,CAAC;aACH;YACD,aAAa;YACb,OAAO,GAAG,MAAM,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,CAAC,MAAM,CAAC,SAAS,IAAI,EAAE,CAAC,CAAC,CAAC;SACrE;QAAC,OAAO,GAAG,EAAE;YACZ,kBAAkB;YAClB,MAAM,KAAK,CAAC,IAAI,CACd,OAAO,CAAC,QAAQ,EAChB;gBACE,YAAY,EAA4B,GAAI,EAAE,OAAO;gBACrD,MAAM,EAAE,OAAO;aAChB,EACD;gBACE,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;aAClC,CACF,CAAC;YACF,OAAO;SACR;QACD,gBAAgB;QAChB,MAAM,KAAK,CAAC,IAAI,CACd,OAAO,CAAC,QAAQ,EAChB;YACE,OAAO;YACP,MAAM,EAAE,SAAS;SAClB,EACD;YACE,OAAO,EAAE,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC;SAClC,CACF,CAAC;IACJ,CAAC;;AAlTD;;GAEG;AACI,yBAAS,GAAW,QAAQ,CAAC;AAkTtC,OAAO,EAAE,eAAe,EAAE,CAAC"}
@@ -1,9 +1,9 @@
1
1
  /// <reference types="node" />
2
2
  import { ServiceParameters } from "@webda/core";
3
3
  import { SpawnOptions } from "child_process";
4
- import { AsyncAction } from "../models";
5
- import { JobInfo } from "./asyncjobservice";
6
- import { AgentInfo, Runner, RunnerParameters } from "./runner";
4
+ import { AsyncAction } from "../models.js";
5
+ import { JobInfo } from "./asyncjobservice.js";
6
+ import { AgentInfo, Runner, RunnerParameters } from "./runner.js";
7
7
  export declare class LocalRunnerParameters extends RunnerParameters {
8
8
  /**
9
9
  * Command to launch
@@ -42,6 +42,7 @@ export default class LocalRunner<T extends LocalRunnerParameters = LocalRunnerPa
42
42
  * @inheritdoc
43
43
  */
44
44
  loadParameters(params: any): ServiceParameters;
45
+ spawn(command: string, args: string[], options?: SpawnOptions | undefined): import("child_process").ChildProcess;
45
46
  /**
46
47
  * @inheritdoc
47
48
  */
@@ -1,76 +1,70 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.LocalRunnerParameters = void 0;
13
- const child_process_1 = require("child_process");
14
- const runner_1 = require("./runner");
15
- class LocalRunnerParameters extends runner_1.RunnerParameters {
1
+ import { spawn } from "child_process";
2
+ import { Runner, RunnerParameters } from "./runner.js";
3
+ export class LocalRunnerParameters extends RunnerParameters {
16
4
  constructor(params) {
17
- var _a, _b;
18
- var _c;
5
+ var _a;
19
6
  super(params);
20
- (_a = this.options) !== null && _a !== void 0 ? _a : (this.options = {});
21
- (_b = (_c = this.options).env) !== null && _b !== void 0 ? _b : (_c.env = {});
7
+ this.options ?? (this.options = {});
8
+ (_a = this.options).env ?? (_a.env = {});
22
9
  }
23
10
  }
24
- exports.LocalRunnerParameters = LocalRunnerParameters;
25
11
  /**
26
12
  * Run a Job locally on the server by spawning a child process
27
13
  *
28
14
  * @WebdaModda
29
15
  */
30
- class LocalRunner extends runner_1.Runner {
16
+ export default class LocalRunner extends Runner {
31
17
  /**
32
18
  * @inheritdoc
33
19
  */
34
20
  loadParameters(params) {
35
21
  return new LocalRunnerParameters(params);
36
22
  }
23
+ spawn(command, args, options) {
24
+ /* c8 ignore next 2 */
25
+ return spawn(command, args, options);
26
+ }
37
27
  /**
38
28
  * @inheritdoc
39
29
  */
40
- launchAction(action, info) {
41
- return __awaiter(this, void 0, void 0, function* () {
42
- let envs = Object.assign(Object.assign({}, this.parameters.options.env), info);
43
- this.log("INFO", "Job", action.getUuid(), "started with", Object.keys(envs)
44
- .map(k => `${k}=${envs[k]}`)
45
- .join(" "), this.parameters.command, this.parameters.args ? this.parameters.args.map(a => `'${a}'`).join(" ") : "");
46
- const child = (0, child_process_1.spawn)(this.parameters.command, this.parameters.args, Object.assign(Object.assign({}, this.parameters.options), { env: envs, detached: true }));
47
- // AutoStatus based on process info
48
- if (this.parameters.autoStatus) {
49
- child.stdout.on("data", data => {
50
- action.getStore().upsertItemToCollection(action.getUuid(), "logs", data);
51
- });
52
- child.stderr.on("data", data => {
53
- action.getStore().upsertItemToCollection(action.getUuid(), "logs", data);
54
- });
55
- // As this is local just and mostly used for batch auto status it
56
- yield action.getStore().patch({ uuid: action.getUuid(), status: "RUNNING" });
57
- child.on("exit", (code) => __awaiter(this, void 0, void 0, function* () {
58
- if (code !== 0) {
59
- this.log("INFO", "Job", action.getUuid(), "errored with", code);
60
- yield action.getStore().patch({ uuid: action.getUuid(), status: "ERROR" });
61
- }
62
- else {
63
- this.log("INFO", "Job", action.getUuid(), "successful");
64
- yield action.getStore().patch({ uuid: action.getUuid(), status: "SUCCESS" });
65
- }
66
- }));
67
- }
68
- return {
69
- agent: runner_1.Runner.getAgentInfo(),
70
- pid: child.pid
71
- };
30
+ async launchAction(action, info) {
31
+ let envs = {
32
+ ...this.parameters.options?.env,
33
+ ...info
34
+ };
35
+ this.log("INFO", "Job", action.getUuid(), "started with", Object.keys(envs)
36
+ .map(k => `${k}=${envs[k]}`)
37
+ .join(" "), this.parameters.command, this.parameters.args ? this.parameters.args.map(a => `'${a}'`).join(" ") : "");
38
+ const child = this.spawn(this.parameters.command, this.parameters.args || [], {
39
+ ...this.parameters.options,
40
+ env: envs,
41
+ detached: true
72
42
  });
43
+ // AutoStatus based on process info
44
+ if (this.parameters.autoStatus && child) {
45
+ child.stdout?.on("data", data => {
46
+ action.getStore().upsertItemToCollection(action.getUuid(), "logs", data);
47
+ });
48
+ child.stderr?.on("data", data => {
49
+ action.getStore().upsertItemToCollection(action.getUuid(), "logs", data);
50
+ });
51
+ // As this is local just and mostly used for batch auto status it
52
+ await action.getStore().patch({ uuid: action.getUuid(), status: "RUNNING" });
53
+ child.on("exit", async (code) => {
54
+ if (code !== 0) {
55
+ this.log("INFO", "Job", action.getUuid(), "errored with", code);
56
+ await action.getStore().patch({ uuid: action.getUuid(), status: "ERROR" });
57
+ }
58
+ else {
59
+ this.log("INFO", "Job", action.getUuid(), "successful");
60
+ await action.getStore().patch({ uuid: action.getUuid(), status: "SUCCESS" });
61
+ }
62
+ });
63
+ }
64
+ return {
65
+ agent: Runner.getAgentInfo(),
66
+ pid: child?.pid || -1
67
+ };
73
68
  }
74
69
  }
75
- exports.default = LocalRunner;
76
70
  //# sourceMappingURL=localrunner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"localrunner.js","sourceRoot":"","sources":["../../src/services/localrunner.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,iDAAoD;AAGpD,qCAA+D;AAE/D,MAAa,qBAAsB,SAAQ,yBAAgB;IAoBzD,YAAY,MAAW;;;QACrB,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,MAAA,IAAI,CAAC,OAAO,oCAAZ,IAAI,CAAC,OAAO,GAAK,EAAE,EAAC;QACpB,YAAA,IAAI,CAAC,OAAO,EAAC,GAAG,uCAAH,GAAG,GAAK,EAAE,EAAC;IAC1B,CAAC;CACF;AAzBD,sDAyBC;AAUD;;;;GAIG;AACH,MAAqB,WAAqE,SA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E,cAAc,EAAE,IAAI,CAAC,CAAC;oBAChE,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,OAAO,EAAE,CAAC,CAAC;iBAC5E;qBAAM;oBACL,IAAI,CAAC,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,MAAM,CAAC,OAAO,EAAE,EAAE,YAAY,CAAC,CAAC;oBACxD,MAAM,MAAM,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,MAAM,CAAC,OAAO,EAAE,EAAE,MAAM,EAAE,SAAS,EAAE,CAAC,CAAC;iBAC9E;YACH,CAAC,CAAC,CAAC;SACJ;QAED,OAAO;YACL,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE;YAC5B,GAAG,EAAE,KAAK,EAAE,GAAG,IAAI,CAAC,CAAC;SACtB,CAAC;IACJ,CAAC;CACF"}
@@ -1,6 +1,6 @@
1
- import { ServiceParameters, Service } from "@webda/core";
2
- import { AsyncAction } from "../models";
3
- import { JobInfo } from "./asyncjobservice";
1
+ import { Service, ServiceParameters } from "@webda/core";
2
+ import { AsyncAction } from "../models.js";
3
+ import { JobInfo } from "./asyncjobservice.js";
4
4
  export declare class RunnerParameters extends ServiceParameters {
5
5
  /**
6
6
  * Actions managed by the runner
@@ -1,20 +1,15 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.Runner = exports.RunnerParameters = void 0;
4
- const core_1 = require("@webda/core");
5
- const os = require("os");
6
- class RunnerParameters extends core_1.ServiceParameters {
1
+ import { Service, ServiceParameters } from "@webda/core";
2
+ import * as os from "os";
3
+ export class RunnerParameters extends ServiceParameters {
7
4
  constructor(params) {
8
- var _a;
9
5
  super(params);
10
- (_a = this.actions) !== null && _a !== void 0 ? _a : (this.actions = []);
6
+ this.actions ?? (this.actions = []);
11
7
  }
12
8
  }
13
- exports.RunnerParameters = RunnerParameters;
14
9
  /**
15
10
  * Runner take and launch an action
16
11
  */
17
- class Runner extends core_1.Service {
12
+ export class Runner extends Service {
18
13
  /**
19
14
  * @inheritdoc
20
15
  */
@@ -27,7 +22,7 @@ class Runner extends core_1.Service {
27
22
  * @returns
28
23
  */
29
24
  handleType(type) {
30
- return this.parameters.actions.includes(type);
25
+ return this.parameters.actions?.includes(type) ?? false;
31
26
  }
32
27
  /**
33
28
  * Return agent information
@@ -43,5 +38,4 @@ class Runner extends core_1.Service {
43
38
  };
44
39
  }
45
40
  }
46
- exports.Runner = Runner;
47
41
  //# sourceMappingURL=runner.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/services/runner.ts"],"names":[],"mappings":";;;AAAA,sCAAyD;AAEzD,yBAAyB;AAGzB,MAAa,gBAAiB,SAAQ,wBAAiB;IAOrD,YAAY,MAAW;;QACrB,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,MAAA,IAAI,CAAC,OAAO,oCAAZ,IAAI,CAAC,OAAO,GAAK,EAAE,EAAC;IACtB,CAAC;CACF;AAXD,4CAWC;AAoBD;;GAEG;AACH,MAAsB,MAAsD,SAAQ,cAAU;IAC5F;;OAEG;IACH,cAAc,CAAC,MAAW;QACxB,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IACD;;;;OAIG;IACH,UAAU,CAAC,IAAY;QACrB,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,CAAC,QAAQ,CAAC,IAAI,CAAC,CAAC;IAChD,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,YAAY;QACjB,OAAO;YACL,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE;YACvB,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE;YACvB,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE;YACrB,MAAM,EAAE,EAAE,CAAC,QAAQ,EAAE;YACrB,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE;SAChB,CAAA;IACH,CAAC;CAMF;AAlCD,wBAkCC"}
1
+ {"version":3,"file":"runner.js","sourceRoot":"","sources":["../../src/services/runner.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AACzD,OAAO,KAAK,EAAE,MAAM,IAAI,CAAC;AAIzB,MAAM,OAAO,gBAAiB,SAAQ,iBAAiB;IAOrD,YAAY,MAAW;QACrB,KAAK,CAAC,MAAM,CAAC,CAAC;QACd,IAAI,CAAC,OAAO,KAAZ,IAAI,CAAC,OAAO,GAAK,EAAE,EAAC;IACtB,CAAC;CACF;AAoBD;;GAEG;AACH,MAAM,OAAgB,MAAsD,SAAQ,OAAU;IAC5F;;OAEG;IACH,cAAc,CAAC,MAAW;QACxB,OAAO,IAAI,gBAAgB,CAAC,MAAM,CAAC,CAAC;IACtC,CAAC;IACD;;;;OAIG;IACH,UAAU,CAAC,IAAY;QACrB,OAAO,IAAI,CAAC,UAAU,CAAC,OAAO,EAAE,QAAQ,CAAC,IAAI,CAAC,IAAI,KAAK,CAAC;IAC1D,CAAC;IAED;;;OAGG;IACH,MAAM,CAAC,YAAY;QACjB,OAAO;YACL,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE;YACvB,QAAQ,EAAE,EAAE,CAAC,QAAQ,EAAE;YACvB,OAAO,EAAE,EAAE,CAAC,OAAO,EAAE;YACrB,MAAM,EAAE,EAAE,CAAC,QAAQ,EAAE;YACrB,IAAI,EAAE,EAAE,CAAC,IAAI,EAAE;SAChB,CAAC;IACJ,CAAC;CAMF"}
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@webda/async",
3
- "version": "2.0.0-beta.2",
3
+ "version": "2.0.1",
4
4
  "description": "Async System",
5
5
  "main": "lib/index.js",
6
6
  "scripts": {
7
- "build": "tsc",
7
+ "build": "tsc-esm",
8
+ "build:module": "webda build",
8
9
  "pretest": "npm run build",
9
- "test": "nyc mocha --recursive --exit --timeout=100000 -r ../../node_modules/ts-node/register src/**/*.spec.ts",
10
+ "test": "c8 mocha --recursive --exit --timeout=100000 -r ../../node_modules/ts-node/register src/**/*.spec.ts",
10
11
  "run": "node core"
11
12
  },
12
13
  "keywords": [
@@ -18,22 +19,19 @@
18
19
  "package.json"
19
20
  ],
20
21
  "dependencies": {
21
- "@types/node": "^16.4.14",
22
- "@webda/core": "^2.0.0-beta.2",
22
+ "@webda/core": "^2.0.1",
23
23
  "axios": "^0.27.2"
24
24
  },
25
25
  "devDependencies": {
26
- "@istanbuljs/nyc-config-typescript": "^1.0.1",
27
- "@types/node": "14.0.0",
26
+ "@types/node": "14.6.0",
27
+ "@webda/tsc-esm": "^1.0.0",
28
28
  "mocha": "^10.0.0",
29
- "nyc": "^15.1.0",
30
29
  "sinon": "^14.0.0",
31
30
  "source-map-support": "^0.5.19",
32
31
  "ts-node": "^10.2.0",
33
- "typescript": "~4.6.4"
32
+ "typescript": "~4.7.2"
34
33
  },
35
- "nyc": {
36
- "extends": "@istanbuljs/nyc-config-typescript",
34
+ "c8": {
37
35
  "report-dir": "./reports",
38
36
  "reporter": [
39
37
  "html",
@@ -59,5 +57,9 @@
59
57
  "webda": {
60
58
  "namespace": "Webda"
61
59
  },
62
- "gitHead": "4928e6830cd4164166d00195ff2fef0d52bf0ba6"
60
+ "type": "module",
61
+ "engines": {
62
+ "node": ">=14.6.0"
63
+ },
64
+ "gitHead": "9b32b64d7cd6dee23eaaeea9cd28a7286cdcac6a"
63
65
  }
package/webda.module.json CHANGED
@@ -3,8 +3,313 @@
3
3
  "webda/asyncjobservice": "lib/services/asyncjobservice:default",
4
4
  "webda/localrunner": "lib/services/localrunner:default"
5
5
  },
6
+ "beans": {},
6
7
  "models": {
7
8
  "webda/asyncaction": "lib/models:default"
8
9
  },
9
- "deployers": {}
10
- }
10
+ "deployers": {},
11
+ "schemas": {
12
+ "webda/asyncaction": {
13
+ "type": "object",
14
+ "properties": {
15
+ "_creationDate": {
16
+ "type": "string",
17
+ "format": "date-time",
18
+ "description": "Creation date",
19
+ "readOnly": true
20
+ },
21
+ "_lastUpdate": {
22
+ "type": "string",
23
+ "format": "date-time",
24
+ "description": "Last update date",
25
+ "readOnly": true
26
+ },
27
+ "uuid": {
28
+ "type": "string",
29
+ "description": "Action uuid"
30
+ },
31
+ "status": {
32
+ "type": "string",
33
+ "enum": [
34
+ "RUNNING",
35
+ "SUCCESS",
36
+ "ERROR",
37
+ "QUEUED",
38
+ "STARTING",
39
+ "TIMEOUT"
40
+ ],
41
+ "description": "Current status"
42
+ },
43
+ "errorMessage": {
44
+ "type": "string",
45
+ "description": "If an error occured it should contain the message"
46
+ },
47
+ "job": {
48
+ "type": "object",
49
+ "description": "Job information"
50
+ },
51
+ "_lastJobUpdate": {
52
+ "type": "number",
53
+ "description": "Last time the job was updated",
54
+ "readOnly": true
55
+ },
56
+ "results": {
57
+ "description": "Results from the job"
58
+ },
59
+ "statusDetails": {
60
+ "description": "Job current status"
61
+ },
62
+ "type": {
63
+ "type": "string"
64
+ },
65
+ "arguments": {
66
+ "type": "array",
67
+ "items": {}
68
+ },
69
+ "logs": {
70
+ "type": "array",
71
+ "items": {
72
+ "type": "string"
73
+ },
74
+ "description": "Current logs"
75
+ },
76
+ "action": {
77
+ "type": "string",
78
+ "description": "Expected action for the job\n\nIt should be a verb"
79
+ }
80
+ },
81
+ "required": [
82
+ "uuid",
83
+ "status",
84
+ "job",
85
+ "results",
86
+ "statusDetails",
87
+ "type",
88
+ "logs"
89
+ ],
90
+ "description": "Define here a model that can be used along with Store service",
91
+ "$schema": "http://json-schema.org/draft-07/schema#",
92
+ "title": "AsyncAction"
93
+ },
94
+ "webda/asyncjobservice": {
95
+ "type": "object",
96
+ "properties": {
97
+ "type": {
98
+ "type": "string",
99
+ "description": "Type of the service"
100
+ },
101
+ "url": {
102
+ "type": "string",
103
+ "description": "URL to expose job status report hook",
104
+ "default": "/async/jobs"
105
+ },
106
+ "store": {
107
+ "type": "string",
108
+ "description": "Store name to use for async actions",
109
+ "default": "AsyncActions"
110
+ },
111
+ "binaryStore": {
112
+ "type": "string",
113
+ "description": "If we want to expose a way to upload/download binary for the job\n\nIt will expose a /download and /upload additional url"
114
+ },
115
+ "localLaunch": {
116
+ "type": "boolean",
117
+ "description": "If set runner will be called without queue",
118
+ "default": false
119
+ },
120
+ "queue": {
121
+ "type": "string",
122
+ "description": "Queue to post execution to",
123
+ "default": "AsyncActionsQueue"
124
+ },
125
+ "fallbackOnFirst": {
126
+ "type": "boolean",
127
+ "description": "Fallback on first runner if none match",
128
+ "default": false
129
+ },
130
+ "runners": {
131
+ "type": "array",
132
+ "items": {
133
+ "type": "string"
134
+ },
135
+ "description": "Runners to use"
136
+ },
137
+ "concurrencyLimit": {
138
+ "type": "number",
139
+ "description": "Limit the maximum number of jobs running in //"
140
+ },
141
+ "openapi": {
142
+ "type": "object",
143
+ "additionalProperties": true
144
+ }
145
+ },
146
+ "required": [
147
+ "fallbackOnFirst",
148
+ "queue",
149
+ "runners",
150
+ "store",
151
+ "type",
152
+ "url"
153
+ ],
154
+ "$schema": "http://json-schema.org/draft-07/schema#",
155
+ "title": "AsyncJobService"
156
+ },
157
+ "webda/localrunner": {
158
+ "type": "object",
159
+ "properties": {
160
+ "type": {
161
+ "type": "string",
162
+ "description": "Type of the service"
163
+ },
164
+ "url": {
165
+ "type": "string",
166
+ "description": "URL on which to serve the content"
167
+ },
168
+ "actions": {
169
+ "type": "array",
170
+ "items": {
171
+ "type": "string"
172
+ },
173
+ "description": "Actions managed by the runner",
174
+ "default": []
175
+ },
176
+ "command": {
177
+ "type": "string",
178
+ "description": "Command to launch"
179
+ },
180
+ "args": {
181
+ "type": "array",
182
+ "items": {
183
+ "type": "string"
184
+ },
185
+ "description": "Args"
186
+ },
187
+ "options": {
188
+ "type": "object",
189
+ "properties": {
190
+ "serialization": {
191
+ "$ref": "#/definitions/SerializationType",
192
+ "description": "Specify the kind of serialization used for sending messages between processes.",
193
+ "default": "json"
194
+ },
195
+ "uid": {
196
+ "type": "number"
197
+ },
198
+ "gid": {
199
+ "type": "number"
200
+ },
201
+ "cwd": {
202
+ "type": "string"
203
+ },
204
+ "env": {
205
+ "type": "object",
206
+ "properties": {}
207
+ },
208
+ "windowsHide": {
209
+ "type": "boolean",
210
+ "default": true
211
+ },
212
+ "timeout": {
213
+ "type": "number",
214
+ "default": 0
215
+ },
216
+ "argv0": {
217
+ "type": "string"
218
+ },
219
+ "stdio": {
220
+ "$ref": "#/definitions/StdioOptions"
221
+ },
222
+ "shell": {
223
+ "type": [
224
+ "boolean",
225
+ "string"
226
+ ]
227
+ },
228
+ "windowsVerbatimArguments": {
229
+ "type": "boolean"
230
+ },
231
+ "detached": {
232
+ "type": "boolean"
233
+ }
234
+ },
235
+ "description": "Options\n\nBased on https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options"
236
+ },
237
+ "autoStatus": {
238
+ "type": "boolean",
239
+ "description": "Use the observability of ChildProcess to update status accordingly"
240
+ },
241
+ "openapi": {
242
+ "type": "object",
243
+ "additionalProperties": true
244
+ }
245
+ },
246
+ "required": [
247
+ "command",
248
+ "type"
249
+ ],
250
+ "$schema": "http://json-schema.org/draft-07/schema#",
251
+ "definitions": {
252
+ "SerializationType": {
253
+ "type": "string",
254
+ "enum": [
255
+ "json",
256
+ "advanced"
257
+ ]
258
+ },
259
+ "StdioOptions": {
260
+ "anyOf": [
261
+ {
262
+ "type": "string",
263
+ "const": "pipe"
264
+ },
265
+ {
266
+ "type": "string",
267
+ "const": "ignore"
268
+ },
269
+ {
270
+ "type": "string",
271
+ "const": "inherit"
272
+ },
273
+ {
274
+ "type": "array",
275
+ "items": {
276
+ "anyOf": [
277
+ {
278
+ "type": "string",
279
+ "const": "pipe"
280
+ },
281
+ {
282
+ "type": "string",
283
+ "const": "ipc"
284
+ },
285
+ {
286
+ "type": "string",
287
+ "const": "ignore"
288
+ },
289
+ {
290
+ "type": "string",
291
+ "const": "inherit"
292
+ },
293
+ {
294
+ "type": "object",
295
+ "properties": {}
296
+ },
297
+ {
298
+ "type": "number"
299
+ },
300
+ {
301
+ "type": "null"
302
+ },
303
+ {
304
+ "not": {}
305
+ }
306
+ ]
307
+ }
308
+ }
309
+ ]
310
+ }
311
+ },
312
+ "title": "LocalRunner"
313
+ }
314
+ }
315
+ }