@olympeio/runtime-node 9.8.1 → 9.9.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/import/olympe.dm/datamodel/.Primordial.newInst.json +1 -1
- package/import/olympe.dm/datamodel/05_permission_schema.updateInst.json +1 -1
- package/import/olympe.sc/datamodel/01_language.newInst.json +1 -1
- package/import/olympe.sc/datamodel/01_language.newRel.json +1 -1
- package/import/olympe.sc/datamodel/03_draw_metadata.newInst.json +1 -1
- package/import/olympe.sc/datamodel/03_draw_metadata.newRel.json +1 -1
- package/index.js +904 -899
- package/package.json +6 -6
- package/types/runtime.d.ts +2 -1
- package/types/utils.d.ts +19 -2
package/package.json
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olympeio/runtime-node",
|
|
3
|
-
"version": "9.
|
|
3
|
+
"version": "9.9.0",
|
|
4
4
|
"description": "Olympe Node Runtime Environment",
|
|
5
5
|
"types": "types/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
7
|
-
"ws": "~8.
|
|
8
|
-
"bufferutil": "~4.0.
|
|
9
|
-
"utf-8-validate": "~
|
|
10
|
-
"rxjs": "7.8.1",
|
|
11
|
-
"fastify": "~4.
|
|
7
|
+
"ws": "~8.18.0",
|
|
8
|
+
"bufferutil": "~4.0.8",
|
|
9
|
+
"utf-8-validate": "~6.0.4",
|
|
10
|
+
"rxjs": "~7.8.1",
|
|
11
|
+
"fastify": "~4.28.1"
|
|
12
12
|
},
|
|
13
13
|
"codeAsData": "import",
|
|
14
14
|
"author": "Olympe S.A. <dev@olympe.ch>",
|
package/types/runtime.d.ts
CHANGED
|
@@ -144,11 +144,12 @@ export class BrickContext extends Context {
|
|
|
144
144
|
|
|
145
145
|
/**
|
|
146
146
|
* Return the closest parent of a given type
|
|
147
|
+
* If no context of the specified type is found from the hierarchy, returns the root context.
|
|
147
148
|
*
|
|
148
149
|
* @param selector the context selector
|
|
149
150
|
* @param selector.modelTag tag of the "type" of context you want to find in the parent tree
|
|
150
151
|
*/
|
|
151
|
-
getClosest(selector: {modelTag: InstanceOrTag}): BrickContext
|
|
152
|
+
getClosest(selector: {modelTag: InstanceOrTag}): BrickContext;
|
|
152
153
|
|
|
153
154
|
/**
|
|
154
155
|
* Listen to the creation of the context with the specified id.
|
package/types/utils.d.ts
CHANGED
|
@@ -19,6 +19,18 @@ export class Config {
|
|
|
19
19
|
static getParameter(id: string): unknown | undefined;
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Types of probe that can be used to check the health of the process:
|
|
24
|
+
* - LIVENESS: used to check if the process is alive
|
|
25
|
+
* - READINESS: used to check if the process is ready to operate
|
|
26
|
+
* - ALL: used to check both liveness and readiness
|
|
27
|
+
*/
|
|
28
|
+
export enum ProbeType {
|
|
29
|
+
LIVENESS = 'liveness',
|
|
30
|
+
READINESS = 'readiness',
|
|
31
|
+
ALL = 'all'
|
|
32
|
+
}
|
|
33
|
+
|
|
22
34
|
// Health check and shutdown
|
|
23
35
|
export class Process {
|
|
24
36
|
|
|
@@ -29,10 +41,15 @@ export class Process {
|
|
|
29
41
|
* The callback must return a Promise which returns a string as valid message.
|
|
30
42
|
* The process is considered by the runtime as unhealthy if the promise is rejected.
|
|
31
43
|
*
|
|
44
|
+
* The options parameter can be used to specify the type of probe to register:
|
|
45
|
+
* - LIVENESS: used to check if the process is alive
|
|
46
|
+
* - READINESS: used to check if the process is ready to operate
|
|
47
|
+
* - ALL: used to check both liveness and readiness
|
|
48
|
+
*
|
|
32
49
|
* @param callback the callback executed each time the runtime check the health of the process.
|
|
33
|
-
* @param
|
|
50
|
+
* @param options options to specify the type of probe to register
|
|
34
51
|
*/
|
|
35
|
-
static onHealthCheck(callback: () => Promise<string>,
|
|
52
|
+
static onHealthCheck(callback: () => Promise<string>, options?: {type: ProbeType}): () => void;
|
|
36
53
|
|
|
37
54
|
/**
|
|
38
55
|
* Static method to register a callback called by the runtime when it receives the signal to be terminated.
|