@webda/async 2.0.0-beta.3 → 2.0.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.
package/webda.module.json CHANGED
@@ -3,8 +3,454 @@
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
+ "status": {
28
+ "type": "string",
29
+ "enum": [
30
+ "RUNNING",
31
+ "SUCCESS",
32
+ "ERROR",
33
+ "QUEUED",
34
+ "STARTING",
35
+ "TIMEOUT"
36
+ ],
37
+ "description": "Current status"
38
+ },
39
+ "errorMessage": {
40
+ "type": "string",
41
+ "description": "If an error occured it should contain the message"
42
+ },
43
+ "job": {
44
+ "type": "object",
45
+ "description": "Job information"
46
+ },
47
+ "_lastJobUpdate": {
48
+ "type": "number",
49
+ "description": "Last time the job was updated",
50
+ "readOnly": true
51
+ },
52
+ "results": {
53
+ "description": "Results from the job"
54
+ },
55
+ "statusDetails": {
56
+ "description": "Job current status"
57
+ },
58
+ "type": {
59
+ "type": "string"
60
+ },
61
+ "arguments": {
62
+ "type": "array",
63
+ "items": {}
64
+ },
65
+ "logs": {
66
+ "type": "array",
67
+ "items": {
68
+ "type": "string"
69
+ },
70
+ "description": "Current logs"
71
+ },
72
+ "action": {
73
+ "type": "string",
74
+ "description": "Expected action for the job\n\nIt should be a verb"
75
+ }
76
+ },
77
+ "required": [
78
+ "status",
79
+ "job",
80
+ "results",
81
+ "statusDetails",
82
+ "type",
83
+ "logs"
84
+ ],
85
+ "description": "Define here a model that can be used along with Store service",
86
+ "$schema": "http://json-schema.org/draft-07/schema#",
87
+ "title": "AsyncAction"
88
+ },
89
+ "webda/asyncjobservice": {
90
+ "type": "object",
91
+ "properties": {
92
+ "type": {
93
+ "type": "string",
94
+ "description": "Type of the service"
95
+ },
96
+ "url": {
97
+ "type": "string",
98
+ "description": "URL to expose job status report hook",
99
+ "default": "/async/jobs"
100
+ },
101
+ "store": {
102
+ "type": "string",
103
+ "description": "Store name to use for async actions",
104
+ "default": "AsyncActions"
105
+ },
106
+ "binaryStore": {
107
+ "type": "string",
108
+ "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"
109
+ },
110
+ "localLaunch": {
111
+ "type": "boolean",
112
+ "description": "If set runner will be called without queue",
113
+ "default": false
114
+ },
115
+ "queue": {
116
+ "type": "string",
117
+ "description": "Queue to post execution to",
118
+ "default": "AsyncActionsQueue"
119
+ },
120
+ "fallbackOnFirst": {
121
+ "type": "boolean",
122
+ "description": "Fallback on first runner if none match",
123
+ "default": false
124
+ },
125
+ "runners": {
126
+ "type": "array",
127
+ "items": {
128
+ "type": "string"
129
+ },
130
+ "description": "Runners to use"
131
+ },
132
+ "concurrencyLimit": {
133
+ "type": "number",
134
+ "description": "Limit the maximum number of jobs running in //"
135
+ },
136
+ "openapi": {
137
+ "type": "object",
138
+ "additionalProperties": true
139
+ }
140
+ },
141
+ "required": [
142
+ "fallbackOnFirst",
143
+ "queue",
144
+ "runners",
145
+ "store",
146
+ "type",
147
+ "url"
148
+ ],
149
+ "$schema": "http://json-schema.org/draft-07/schema#",
150
+ "title": "AsyncJobService"
151
+ },
152
+ "webda/localrunner": {
153
+ "type": "object",
154
+ "properties": {
155
+ "type": {
156
+ "type": "string",
157
+ "description": "Type of the service"
158
+ },
159
+ "url": {
160
+ "type": "string",
161
+ "description": "URL on which to serve the content"
162
+ },
163
+ "actions": {
164
+ "type": "array",
165
+ "items": {
166
+ "type": "string"
167
+ },
168
+ "description": "Actions managed by the runner",
169
+ "default": []
170
+ },
171
+ "command": {
172
+ "type": "string",
173
+ "description": "Command to launch"
174
+ },
175
+ "args": {
176
+ "type": "array",
177
+ "items": {
178
+ "type": "string"
179
+ },
180
+ "description": "Args"
181
+ },
182
+ "options": {
183
+ "type": "object",
184
+ "properties": {
185
+ "signal": {
186
+ "type": "object",
187
+ "properties": {
188
+ "aborted": {
189
+ "type": "boolean"
190
+ },
191
+ "onabort": {
192
+ "anyOf": [
193
+ {},
194
+ {
195
+ "type": "null"
196
+ }
197
+ ]
198
+ },
199
+ "reason": {}
200
+ },
201
+ "required": [
202
+ "aborted",
203
+ "onabort",
204
+ "reason"
205
+ ],
206
+ "description": "When provided the corresponding `AbortController` can be used to cancel an asynchronous action."
207
+ },
208
+ "serialization": {
209
+ "$ref": "#/definitions/SerializationType",
210
+ "description": "Specify the kind of serialization used for sending messages between processes.",
211
+ "default": "json"
212
+ },
213
+ "killSignal": {
214
+ "anyOf": [
215
+ {
216
+ "$ref": "#/definitions/global.NodeJS.Signals"
217
+ },
218
+ {
219
+ "type": "number"
220
+ }
221
+ ],
222
+ "description": "The signal value to be used when the spawned process will be killed by the abort signal.",
223
+ "default": "SIGTERM"
224
+ },
225
+ "timeout": {
226
+ "type": "number",
227
+ "default": 0
228
+ },
229
+ "uid": {
230
+ "type": "number"
231
+ },
232
+ "gid": {
233
+ "type": "number"
234
+ },
235
+ "cwd": {
236
+ "anyOf": [
237
+ {
238
+ "type": "string"
239
+ },
240
+ {
241
+ "type": "object",
242
+ "properties": {
243
+ "hash": {
244
+ "type": "string",
245
+ "description": "Gets and sets the fragment portion of the URL.\n\n```js const myURL = new URL('https://example.org/foo#bar'); console.log(myURL.hash); // Prints #bar\n\nmyURL.hash = 'baz'; console.log(myURL.href); // Prints https://example.org/foo#baz ```\n\nInvalid URL characters included in the value assigned to the `hash` property are `percent-encoded`. The selection of which characters to percent-encode may vary somewhat from what the {@link parse } and {@link format } methods would produce."
246
+ },
247
+ "host": {
248
+ "type": "string",
249
+ "description": "Gets and sets the host portion of the URL.\n\n```js const myURL = new URL('https://example.org:81/foo'); console.log(myURL.host); // Prints example.org:81\n\nmyURL.host = 'example.com:82'; console.log(myURL.href); // Prints https://example.com:82/foo ```\n\nInvalid host values assigned to the `host` property are ignored."
250
+ },
251
+ "hostname": {
252
+ "type": "string",
253
+ "description": "Gets and sets the host name portion of the URL. The key difference between`url.host` and `url.hostname` is that `url.hostname` does _not_ include the port.\n\n```js const myURL = new URL('https://example.org:81/foo'); console.log(myURL.hostname); // Prints example.org\n\n// Setting the hostname does not change the port myURL.hostname = 'example.com:82'; console.log(myURL.href); // Prints https://example.com:81/foo\n\n// Use myURL.host to change the hostname and port myURL.host = 'example.org:82'; console.log(myURL.href); // Prints https://example.org:82/foo ```\n\nInvalid host name values assigned to the `hostname` property are ignored."
254
+ },
255
+ "href": {
256
+ "type": "string",
257
+ "description": "Gets and sets the serialized URL.\n\n```js const myURL = new URL('https://example.org/foo'); console.log(myURL.href); // Prints https://example.org/foo\n\nmyURL.href = 'https://example.com/bar'; console.log(myURL.href); // Prints https://example.com/bar ```\n\nGetting the value of the `href` property is equivalent to calling {@link toString } .\n\nSetting the value of this property to a new value is equivalent to creating a new `URL` object using `new URL(value)`. Each of the `URL`object's properties will be modified.\n\nIf the value assigned to the `href` property is not a valid URL, a `TypeError`will be thrown."
258
+ },
259
+ "origin": {
260
+ "type": "string",
261
+ "description": "Gets the read-only serialization of the URL's origin.\n\n```js const myURL = new URL('https://example.org/foo/bar?baz'); console.log(myURL.origin); // Prints https://example.org ```\n\n```js const idnURL = new URL('https://測試'); console.log(idnURL.origin); // Prints https://xn--g6w251d\n\nconsole.log(idnURL.hostname); // Prints xn--g6w251d ```"
262
+ },
263
+ "password": {
264
+ "type": "string",
265
+ "description": "Gets and sets the password portion of the URL.\n\n```js const myURL = new URL('https://abc:xyz@example.com'); console.log(myURL.password); // Prints xyz\n\nmyURL.password = '123'; console.log(myURL.href); // Prints https://abc:123@example.com ```\n\nInvalid URL characters included in the value assigned to the `password` property are `percent-encoded`. The selection of which characters to percent-encode may vary somewhat from what the {@link parse } and {@link format } methods would produce."
266
+ },
267
+ "pathname": {
268
+ "type": "string",
269
+ "description": "Gets and sets the path portion of the URL.\n\n```js const myURL = new URL('https://example.org/abc/xyz?123'); console.log(myURL.pathname); // Prints /abc/xyz\n\nmyURL.pathname = '/abcdef'; console.log(myURL.href); // Prints https://example.org/abcdef?123 ```\n\nInvalid URL characters included in the value assigned to the `pathname`property are `percent-encoded`. The selection of which characters to percent-encode may vary somewhat from what the {@link parse } and {@link format } methods would produce."
270
+ },
271
+ "port": {
272
+ "type": "string",
273
+ "description": "Gets and sets the port portion of the URL.\n\nThe port value may be a number or a string containing a number in the range`0` to `65535` (inclusive). Setting the value to the default port of the`URL` objects given `protocol` will result in the `port` value becoming the empty string (`''`).\n\nThe port value can be an empty string in which case the port depends on the protocol/scheme:\n\n<omitted>\n\nUpon assigning a value to the port, the value will first be converted to a string using `.toString()`.\n\nIf that string is invalid but it begins with a number, the leading number is assigned to `port`. If the number lies outside the range denoted above, it is ignored.\n\n```js const myURL = new URL('https://example.org:8888'); console.log(myURL.port); // Prints 8888\n\n// Default ports are automatically transformed to the empty string // (HTTPS protocol's default port is 443) myURL.port = '443'; console.log(myURL.port); // Prints the empty string console.log(myURL.href); // Prints https://example.org/\n\nmyURL.port = 1234; console.log(myURL.port); // Prints 1234 console.log(myURL.href); // Prints https://example.org:1234/\n\n// Completely invalid port strings are ignored myURL.port = 'abcd'; console.log(myURL.port); // Prints 1234\n\n// Leading numbers are treated as a port number myURL.port = '5678abcd'; console.log(myURL.port); // Prints 5678\n\n// Non-integers are truncated myURL.port = 1234.5678; console.log(myURL.port); // Prints 1234\n\n// Out-of-range numbers which are not represented in scientific notation // will be ignored. myURL.port = 1e10; // 10000000000, will be range-checked as described below console.log(myURL.port); // Prints 1234 ```\n\nNumbers which contain a decimal point, such as floating-point numbers or numbers in scientific notation, are not an exception to this rule. Leading numbers up to the decimal point will be set as the URL's port, assuming they are valid:\n\n```js myURL.port = 4.567e21; console.log(myURL.port); // Prints 4 (because it is the leading number in the string '4.567e21') ```"
274
+ },
275
+ "protocol": {
276
+ "type": "string",
277
+ "description": "Gets and sets the protocol portion of the URL.\n\n```js const myURL = new URL('https://example.org'); console.log(myURL.protocol); // Prints https:\n\nmyURL.protocol = 'ftp'; console.log(myURL.href); // Prints ftp://example.org/ ```\n\nInvalid URL protocol values assigned to the `protocol` property are ignored."
278
+ },
279
+ "search": {
280
+ "type": "string",
281
+ "description": "Gets and sets the serialized query portion of the URL.\n\n```js const myURL = new URL('https://example.org/abc?123'); console.log(myURL.search); // Prints ?123\n\nmyURL.search = 'abc=xyz'; console.log(myURL.href); // Prints https://example.org/abc?abc=xyz ```\n\nAny invalid URL characters appearing in the value assigned the `search`property will be `percent-encoded`. The selection of which characters to percent-encode may vary somewhat from what the {@link parse } and {@link format } methods would produce."
282
+ },
283
+ "searchParams": {
284
+ "type": "object",
285
+ "properties": {},
286
+ "description": "Gets the `URLSearchParams` object representing the query parameters of the URL. This property is read-only but the `URLSearchParams` object it provides can be used to mutate the URL instance; to replace the entirety of query parameters of the URL, use the {@link search } setter. See `URLSearchParams` documentation for details.\n\nUse care when using `.searchParams` to modify the `URL` because, per the WHATWG specification, the `URLSearchParams` object uses different rules to determine which characters to percent-encode. For instance, the `URL` object will not percent encode the ASCII tilde (`~`) character, while `URLSearchParams` will always encode it:\n\n```js const myUrl = new URL('https://example.org/abc?foo=~bar');\n\nconsole.log(myUrl.search); // prints ?foo=~bar\n\n// Modify the URL via searchParams... myUrl.searchParams.sort();\n\nconsole.log(myUrl.search); // prints ?foo=%7Ebar ```"
287
+ },
288
+ "username": {
289
+ "type": "string",
290
+ "description": "Gets and sets the username portion of the URL.\n\n```js const myURL = new URL('https://abc:xyz@example.com'); console.log(myURL.username); // Prints abc\n\nmyURL.username = '123'; console.log(myURL.href); // Prints https://123:xyz@example.com/ ```\n\nAny invalid URL characters appearing in the value assigned the `username`property will be `percent-encoded`. The selection of which characters to percent-encode may vary somewhat from what the {@link parse } and {@link format } methods would produce."
291
+ }
292
+ },
293
+ "required": [
294
+ "hash",
295
+ "host",
296
+ "hostname",
297
+ "href",
298
+ "origin",
299
+ "password",
300
+ "pathname",
301
+ "port",
302
+ "protocol",
303
+ "search",
304
+ "searchParams",
305
+ "username"
306
+ ],
307
+ "description": "Browser-compatible `URL` class, implemented by following the WHATWG URL Standard. [Examples of parsed URLs](https://url.spec.whatwg.org/#example-url-parsing) may be found in the Standard itself. The `URL` class is also available on the global object.\n\nIn accordance with browser conventions, all properties of `URL` objects are implemented as getters and setters on the class prototype, rather than as data properties on the object itself. Thus, unlike `legacy urlObject` s, using the `delete` keyword on any properties of `URL` objects (e.g. `delete myURL.protocol`, `delete myURL.pathname`, etc) has no effect but will still return `true`."
308
+ }
309
+ ]
310
+ },
311
+ "env": {
312
+ "type": "object",
313
+ "properties": {
314
+ "TZ": {
315
+ "type": "string",
316
+ "description": "Can be used to change the default timezone at runtime"
317
+ }
318
+ }
319
+ },
320
+ "windowsHide": {
321
+ "type": "boolean",
322
+ "default": true
323
+ },
324
+ "argv0": {
325
+ "type": "string"
326
+ },
327
+ "stdio": {
328
+ "$ref": "#/definitions/StdioOptions"
329
+ },
330
+ "shell": {
331
+ "type": [
332
+ "boolean",
333
+ "string"
334
+ ]
335
+ },
336
+ "windowsVerbatimArguments": {
337
+ "type": "boolean"
338
+ },
339
+ "detached": {
340
+ "type": "boolean"
341
+ }
342
+ },
343
+ "description": "Options\n\nBased on https://nodejs.org/api/child_process.html#child_process_child_process_spawn_command_args_options"
344
+ },
345
+ "autoStatus": {
346
+ "type": "boolean",
347
+ "description": "Use the observability of ChildProcess to update status accordingly"
348
+ },
349
+ "openapi": {
350
+ "type": "object",
351
+ "additionalProperties": true
352
+ }
353
+ },
354
+ "required": [
355
+ "command",
356
+ "type"
357
+ ],
358
+ "$schema": "http://json-schema.org/draft-07/schema#",
359
+ "definitions": {
360
+ "SerializationType": {
361
+ "type": "string",
362
+ "enum": [
363
+ "json",
364
+ "advanced"
365
+ ]
366
+ },
367
+ "global.NodeJS.Signals": {
368
+ "type": "string",
369
+ "enum": [
370
+ "SIGABRT",
371
+ "SIGALRM",
372
+ "SIGBUS",
373
+ "SIGCHLD",
374
+ "SIGCONT",
375
+ "SIGFPE",
376
+ "SIGHUP",
377
+ "SIGILL",
378
+ "SIGINT",
379
+ "SIGIO",
380
+ "SIGIOT",
381
+ "SIGKILL",
382
+ "SIGPIPE",
383
+ "SIGPOLL",
384
+ "SIGPROF",
385
+ "SIGPWR",
386
+ "SIGQUIT",
387
+ "SIGSEGV",
388
+ "SIGSTKFLT",
389
+ "SIGSTOP",
390
+ "SIGSYS",
391
+ "SIGTERM",
392
+ "SIGTRAP",
393
+ "SIGTSTP",
394
+ "SIGTTIN",
395
+ "SIGTTOU",
396
+ "SIGUNUSED",
397
+ "SIGURG",
398
+ "SIGUSR1",
399
+ "SIGUSR2",
400
+ "SIGVTALRM",
401
+ "SIGWINCH",
402
+ "SIGXCPU",
403
+ "SIGXFSZ",
404
+ "SIGBREAK",
405
+ "SIGLOST",
406
+ "SIGINFO"
407
+ ]
408
+ },
409
+ "StdioOptions": {
410
+ "anyOf": [
411
+ {
412
+ "$ref": "#/definitions/IOType"
413
+ },
414
+ {
415
+ "type": "array",
416
+ "items": {
417
+ "anyOf": [
418
+ {
419
+ "$ref": "#/definitions/IOType"
420
+ },
421
+ {
422
+ "type": "string",
423
+ "const": "ipc"
424
+ },
425
+ {
426
+ "type": "object",
427
+ "properties": {}
428
+ },
429
+ {
430
+ "type": "number"
431
+ },
432
+ {
433
+ "type": "null"
434
+ },
435
+ {
436
+ "not": {}
437
+ }
438
+ ]
439
+ }
440
+ }
441
+ ]
442
+ },
443
+ "IOType": {
444
+ "type": "string",
445
+ "enum": [
446
+ "overlapped",
447
+ "pipe",
448
+ "ignore",
449
+ "inherit"
450
+ ]
451
+ }
452
+ },
453
+ "title": "LocalRunner"
454
+ }
455
+ }
456
+ }