@olympeio/runtime-node 9.2.2 → 9.3.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/05_permission_schema.updateInst.json +1 -1
- package/import/olympe.dm/datamodel/06_structure.newInst.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/index.js +820 -808
- package/package.json +1 -1
- package/types/base.d.ts +33 -30
- package/types/cloud.d.ts +48 -48
- package/types/legacy.d.ts +9 -9
- package/types/runtime.d.ts +9 -9
- package/types/utils.d.ts +36 -6
package/types/runtime.d.ts
CHANGED
|
@@ -25,7 +25,7 @@ export class BrickContext extends Context {
|
|
|
25
25
|
* Returns a boolean indicating whether a property has a value or not.
|
|
26
26
|
*
|
|
27
27
|
* @param key the property or key string
|
|
28
|
-
* @param global [=false] whether
|
|
28
|
+
* @param global [=false] whether the method checks parent contexts
|
|
29
29
|
* @return whether `property` has a value or not
|
|
30
30
|
*/
|
|
31
31
|
has<T>(key: string | Property<T>, global?: boolean): boolean;
|
|
@@ -34,7 +34,7 @@ export class BrickContext extends Context {
|
|
|
34
34
|
* Return the current value of the specified property. If there is currently no value, return null.
|
|
35
35
|
*
|
|
36
36
|
* @param key the property or key string
|
|
37
|
-
* @param global [=false] whether
|
|
37
|
+
* @param global [=false] whether the method checks parent contexts
|
|
38
38
|
* @return the current value
|
|
39
39
|
*/
|
|
40
40
|
get<T>(key: string | Property<T>, global?: boolean): T | null;
|
|
@@ -46,8 +46,8 @@ export class BrickContext extends Context {
|
|
|
46
46
|
* If `global` is set to TRUE (FALSE by default), it observes values coming from other contexts accessible from the current one.
|
|
47
47
|
*
|
|
48
48
|
* @param key the property or key string
|
|
49
|
-
* @param waitForValue [=true] whether
|
|
50
|
-
* @param global [=false] whether
|
|
49
|
+
* @param waitForValue [=true] whether the observable should wait for a first value to get a value.
|
|
50
|
+
* @param global [=false] whether to listen to a value coming from other contexts.
|
|
51
51
|
* @return the observable
|
|
52
52
|
*/
|
|
53
53
|
observe<T>(key: string | Property<T>, waitForValue?: boolean, global?: boolean): Observable<T>;
|
|
@@ -56,7 +56,7 @@ export class BrickContext extends Context {
|
|
|
56
56
|
* Wait for the property to get a new value, wrapped in a promise.
|
|
57
57
|
*
|
|
58
58
|
* @param key the property
|
|
59
|
-
* @param global [=false] whether
|
|
59
|
+
* @param global [=false] whether the method checks parent contexts
|
|
60
60
|
* @return a promise of the next value of property
|
|
61
61
|
*/
|
|
62
62
|
waitFor<T>(key: string | Property<T>, global?: boolean): Promise<T>;
|
|
@@ -220,13 +220,13 @@ export abstract class Brick extends CloudObject {
|
|
|
220
220
|
protected destroy($: BrickContext): void;
|
|
221
221
|
|
|
222
222
|
/**
|
|
223
|
-
* @deprecated use {@
|
|
223
|
+
* @deprecated use {@apilink Brick.init} instead
|
|
224
224
|
* @param $ the brick context
|
|
225
225
|
*/
|
|
226
226
|
protected onInit($: BrickContext): void;
|
|
227
227
|
|
|
228
228
|
/**
|
|
229
|
-
* @deprecated use {@
|
|
229
|
+
* @deprecated use {@apilink Brick.update} instead
|
|
230
230
|
* @param $ the brick context
|
|
231
231
|
* @param inputs array of input values
|
|
232
232
|
* @param outputs array of output setter functions.
|
|
@@ -234,7 +234,7 @@ export abstract class Brick extends CloudObject {
|
|
|
234
234
|
protected onUpdate($: BrickContext, inputs: Array<any>, outputs: Array<(value: any) => void>): void;
|
|
235
235
|
|
|
236
236
|
/**
|
|
237
|
-
* @deprecated use {@
|
|
237
|
+
* @deprecated use {@apilink Brick.destroy} instead
|
|
238
238
|
* @param $ the brick context
|
|
239
239
|
*/
|
|
240
240
|
protected onDestroy($: BrickContext): void;
|
|
@@ -279,7 +279,7 @@ export abstract class VisualBrick extends Brick {
|
|
|
279
279
|
/**
|
|
280
280
|
* Called when the DOM Element associated to that brick has been added to the document and is ready to be drawn.
|
|
281
281
|
*
|
|
282
|
-
* @deprecated override {@
|
|
282
|
+
* @deprecated override {@apilink VisualBrick.render} and {@apilink VisualBrick.updateParent} instead.
|
|
283
283
|
* @param $ the brick context
|
|
284
284
|
* @param domElement the associated DOM Element
|
|
285
285
|
*/
|
package/types/utils.d.ts
CHANGED
|
@@ -17,6 +17,31 @@ export class Config {
|
|
|
17
17
|
static getParameter(id: string): unknown | undefined;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
|
+
// Health check and shutdown
|
|
21
|
+
export class Process {
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Static method to register a callback that is used to check the health status of the process.
|
|
25
|
+
* This is typically used by kubernetes environment to maintain backend healthy
|
|
26
|
+
*
|
|
27
|
+
* The callback must return a Promise which returns a string as valid message.
|
|
28
|
+
* The process is considered by the runtime as unhealthy if the promise is rejected.
|
|
29
|
+
*
|
|
30
|
+
* @param callback the callback executed each time the runtime check the health of the process.
|
|
31
|
+
*/
|
|
32
|
+
static onHealthCheck(callback: () => Promise<string>): () => void;
|
|
33
|
+
|
|
34
|
+
/**
|
|
35
|
+
* Static method to register a callback called by the runtime when it receives the signal to be terminated.
|
|
36
|
+
* This is typically used to graceful shutdown some connections or drivers to external processes.
|
|
37
|
+
*
|
|
38
|
+
* The callback must return a Promise which is resolved when the shutdown process is done.
|
|
39
|
+
*
|
|
40
|
+
* @param callback the callback executed when the runtime terminates.
|
|
41
|
+
*/
|
|
42
|
+
static onShutdown(callback: () => Promise<void>): () => void;
|
|
43
|
+
}
|
|
44
|
+
|
|
20
45
|
// -- Primitive types classes --
|
|
21
46
|
export class Color {
|
|
22
47
|
static create(r: number, g: number, b: number, a?: number): Color;
|
|
@@ -137,7 +162,7 @@ export class Service {
|
|
|
137
162
|
static publish(service: string, payload: Object): Promise<void>;
|
|
138
163
|
|
|
139
164
|
/**
|
|
140
|
-
* Send a request to a {@
|
|
165
|
+
* Send a request to a {@apilink Service} and wait for an ack.
|
|
141
166
|
*
|
|
142
167
|
* @param service the service id
|
|
143
168
|
* @param payload the message payload, optional
|
|
@@ -146,7 +171,7 @@ export class Service {
|
|
|
146
171
|
static send(service: string, payload?: Object): Promise<void>;
|
|
147
172
|
|
|
148
173
|
/**
|
|
149
|
-
* Send a request to a {@
|
|
174
|
+
* Send a request to a {@apilink Service} and wait for a reply with a payload..
|
|
150
175
|
*
|
|
151
176
|
* @param service the service id
|
|
152
177
|
* @param payload the message payload
|
|
@@ -155,7 +180,7 @@ export class Service {
|
|
|
155
180
|
static get(service: string, payload: Object): Promise<Object>;
|
|
156
181
|
|
|
157
182
|
/**
|
|
158
|
-
* Send a request to a {@
|
|
183
|
+
* Send a request to a {@apilink Service} and subscribe to notifications published from that service.
|
|
159
184
|
*
|
|
160
185
|
* @param service the service id
|
|
161
186
|
* @param context the context used to link its lifecycle to this subscription
|
|
@@ -181,27 +206,32 @@ export class Auth {
|
|
|
181
206
|
|
|
182
207
|
/**
|
|
183
208
|
* Return the current state of the authentication manager
|
|
209
|
+
* @return the current state
|
|
184
210
|
*/
|
|
185
211
|
static getState(): AuthState;
|
|
186
212
|
|
|
187
213
|
/**
|
|
188
214
|
* Return the token currently used to identify the current session.
|
|
215
|
+
* @return The current token
|
|
189
216
|
*/
|
|
190
217
|
static getToken(): string;
|
|
191
218
|
|
|
192
219
|
/**
|
|
193
220
|
* Return the IDP token (zipped & base64 encoded XML) for the current user.
|
|
221
|
+
* @return The current IDP token
|
|
194
222
|
*/
|
|
195
223
|
static getIDPToken(): string;
|
|
196
224
|
|
|
197
225
|
/**
|
|
198
|
-
* Returns an Observable that is updated each time the user tag changes.
|
|
226
|
+
* Returns an `Observable` that is updated each time the user tag changes.
|
|
199
227
|
* @param context The brick context
|
|
228
|
+
* @return An `Observable`
|
|
200
229
|
*/
|
|
201
230
|
static observeUser(context: Context): Observable<string>
|
|
202
231
|
|
|
203
232
|
/**
|
|
204
233
|
* Return the tag of the current authenticated user.
|
|
234
|
+
* @return The tag of the current user
|
|
205
235
|
*/
|
|
206
236
|
static getCurrentUser(): string
|
|
207
237
|
|
|
@@ -240,7 +270,7 @@ export class Auth {
|
|
|
240
270
|
* Try to login using SAML protocol with the specified username and password.
|
|
241
271
|
* Returns a promise resolved when logged in or that catches an error if refused.
|
|
242
272
|
*
|
|
243
|
-
* @deprecated use {@
|
|
273
|
+
* @deprecated use {@apilink Auth.loginSSO} instead
|
|
244
274
|
* @throws {Error} If the provider's configuration is incorrect.
|
|
245
275
|
*/
|
|
246
276
|
static loginSAML(): Promise<void>;
|
|
@@ -249,7 +279,7 @@ export class Auth {
|
|
|
249
279
|
* Try to login using the configured OpenID Provider.
|
|
250
280
|
* Returns a promise resolved when logged in or that catches an error if the login is not valid.
|
|
251
281
|
*
|
|
252
|
-
* @deprecated use {@
|
|
282
|
+
* @deprecated use {@apilink Auth.loginSSO} instead
|
|
253
283
|
* @throws {Error} If the provider's configuration is incorrect.
|
|
254
284
|
*/
|
|
255
285
|
static loginOpenID(): Promise<void>;
|