@olympeio/runtime-node 9.3.0 → 9.4.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/dcInitConfig.json +1 -1
- package/import/olympe.dm/datamodel/00_bootstrap.newInst.json +1 -1
- package/import/olympe.dm/datamodel/00_bootstrap.newRel.json +1 -1
- package/import/olympe.dm/datamodel/01_primitives.newInst.json +1 -1
- package/import/olympe.dm/datamodel/01_primitives.newRel.json +1 -1
- package/import/olympe.dm/datamodel/02_permissions.newInst.json +1 -1
- package/import/olympe.dm/datamodel/02_permissions.newRel.json +1 -1
- package/import/olympe.dm/datamodel/03_file.newInst.json +1 -1
- package/import/olympe.dm/datamodel/03_file.newRel.json +1 -1
- package/import/olympe.dm/datamodel/04_modules.newInst.json +1 -1
- package/import/olympe.dm/datamodel/04_modules.newRel.json +1 -1
- package/import/olympe.dm/datamodel/05_permission_schema.newInst.json +1 -1
- package/import/olympe.dm/datamodel/05_permission_schema.newRel.json +1 -1
- 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.dm/datamodel/06_structure.newRel.json +1 -1
- package/import/olympe.sc/datamodel/00_primordial.newInst.json +1 -1
- package/import/olympe.sc/datamodel/00_primordial.newRel.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/02_bricks.newInst.json +1 -1
- package/import/olympe.sc/datamodel/02_bricks.newRel.json +1 -1
- package/index.js +765 -832
- package/package.json +7 -10
- package/types/base.d.ts +22 -2
- package/types/cloud.d.ts +478 -50
- package/types/runtime.d.ts +6 -6
- package/types/utils.d.ts +47 -3
package/types/runtime.d.ts
CHANGED
|
@@ -3,8 +3,7 @@
|
|
|
3
3
|
// **********************************
|
|
4
4
|
// @ts-ignore
|
|
5
5
|
import Observable from 'rxjs';
|
|
6
|
-
import {CloudObject, Context, Property} from "./base";
|
|
7
|
-
import {Entry} from "./legacy";
|
|
6
|
+
import {CloudObject, Context, Property, Tag} from "./base";
|
|
8
7
|
|
|
9
8
|
/**
|
|
10
9
|
* Label of global properties used by convention through bricks and applications.
|
|
@@ -15,7 +14,7 @@ import {Entry} from "./legacy";
|
|
|
15
14
|
* The brick "Begin Transaction" push a transaction inside the context so it can be reused by other bricks before the "End Transaction" brick.
|
|
16
15
|
*/
|
|
17
16
|
export enum GlobalProperties {
|
|
18
|
-
|
|
17
|
+
EDITION = '__editionMode',
|
|
19
18
|
PRODUCTION = '__production',
|
|
20
19
|
TRANSACTION = '__transaction'
|
|
21
20
|
}
|
|
@@ -165,13 +164,15 @@ export abstract class Brick extends CloudObject {
|
|
|
165
164
|
|
|
166
165
|
/**
|
|
167
166
|
* Return the list of inputs tags as an ordered array.
|
|
167
|
+
* @const
|
|
168
168
|
*/
|
|
169
|
-
|
|
169
|
+
getInputs(): string[];
|
|
170
170
|
|
|
171
171
|
/**
|
|
172
172
|
* Return the list of outputs tags as an ordered array
|
|
173
|
+
* @const
|
|
173
174
|
*/
|
|
174
|
-
|
|
175
|
+
getOutputs(): string[];
|
|
175
176
|
|
|
176
177
|
/**
|
|
177
178
|
* Run the brick itself using the specified context.
|
|
@@ -285,4 +286,3 @@ export abstract class VisualBrick extends Brick {
|
|
|
285
286
|
*/
|
|
286
287
|
protected draw($: BrickContext, domElement: Element);
|
|
287
288
|
}
|
|
288
|
-
|
package/types/utils.d.ts
CHANGED
|
@@ -129,6 +129,20 @@ export class ServiceRequest {
|
|
|
129
129
|
fail(error: Error): Promise<void>;
|
|
130
130
|
}
|
|
131
131
|
|
|
132
|
+
interface ServiceConfig {
|
|
133
|
+
/**
|
|
134
|
+
* After how much time (in ms) the message must be considered as timeout by the service.
|
|
135
|
+
*/
|
|
136
|
+
timeout?: number
|
|
137
|
+
}
|
|
138
|
+
|
|
139
|
+
interface SubscriptionServiceConfig extends ServiceConfig {
|
|
140
|
+
/**
|
|
141
|
+
* A callback to be called in case the subscription to the service is re-sent to the service (eg: after a reconnection).
|
|
142
|
+
*/
|
|
143
|
+
onRetry?: () => void;
|
|
144
|
+
}
|
|
145
|
+
|
|
132
146
|
/**
|
|
133
147
|
* A service that processes requests coming from other VMs connected to the data cloud.
|
|
134
148
|
*/
|
|
@@ -166,18 +180,20 @@ export class Service {
|
|
|
166
180
|
*
|
|
167
181
|
* @param service the service id
|
|
168
182
|
* @param payload the message payload, optional
|
|
183
|
+
* @param config optional parameters for the message
|
|
169
184
|
* @return a Promise that completes when the call has been executed
|
|
170
185
|
*/
|
|
171
|
-
static send(service: string, payload?: Object): Promise<void>;
|
|
186
|
+
static send(service: string, payload?: Object, config?: ServiceConfig): Promise<void>;
|
|
172
187
|
|
|
173
188
|
/**
|
|
174
189
|
* Send a request to a {@apilink Service} and wait for a reply with a payload..
|
|
175
190
|
*
|
|
176
191
|
* @param service the service id
|
|
177
192
|
* @param payload the message payload
|
|
193
|
+
* @param config optional parameters for the message
|
|
178
194
|
* @return a Promise wrapping the resulting value
|
|
179
195
|
*/
|
|
180
|
-
static get(service: string, payload: Object): Promise<Object>;
|
|
196
|
+
static get(service: string, payload: Object, config?: ServiceConfig): Promise<Object>;
|
|
181
197
|
|
|
182
198
|
/**
|
|
183
199
|
* Send a request to a {@apilink Service} and subscribe to notifications published from that service.
|
|
@@ -185,17 +201,43 @@ export class Service {
|
|
|
185
201
|
* @param service the service id
|
|
186
202
|
* @param context the context used to link its lifecycle to this subscription
|
|
187
203
|
* @param payload the message payload, optional
|
|
204
|
+
* @param config optional parameters for the message
|
|
188
205
|
* @return an Observable emitting notifications
|
|
189
206
|
*/
|
|
190
|
-
static observe(service: string, context: Context, payload?: Object): Observable<Object>;
|
|
207
|
+
static observe(service: string, context: Context, payload?: Object, config?: SubscriptionServiceConfig): Observable<Object>;
|
|
191
208
|
}
|
|
192
209
|
|
|
193
210
|
// -- Authentication --
|
|
211
|
+
|
|
212
|
+
declare type UserToken = {
|
|
213
|
+
user: string, // The username
|
|
214
|
+
userTag: string, // Tag of the User in the datacloud
|
|
215
|
+
nonce: string, // Nonce that identify the user in the auth service of Olympe
|
|
216
|
+
protocol: AuthProtocol, // The protocol used to authenticate the user
|
|
217
|
+
idpName: string, // The name of the IDP used to authenticate the user
|
|
218
|
+
payload: Object // The raw payload sent by the IDP (ie: JWT for 0Auth2 or SAML response or empty for SP)
|
|
219
|
+
}
|
|
220
|
+
|
|
221
|
+
declare enum AuthProtocol {
|
|
222
|
+
SAML = 'saml',
|
|
223
|
+
OAUTH2 = 'oauth2',
|
|
224
|
+
SRP = 'srp'
|
|
225
|
+
}
|
|
226
|
+
|
|
194
227
|
/**
|
|
195
228
|
* A static class that gathers all the required methods to handle the authentication and sessions with Olympe.
|
|
196
229
|
*/
|
|
197
230
|
export class Auth {
|
|
198
231
|
|
|
232
|
+
/**
|
|
233
|
+
* Returns the full token of the current user. It contains:
|
|
234
|
+
* - the username, the unique ID of the user for the IDP used
|
|
235
|
+
* - the tag of the user in the datacloud
|
|
236
|
+
* - the protocol and IDP used
|
|
237
|
+
* - the raw payload sent by the IDP (eg: JWT for OAuth2 or SAML response).
|
|
238
|
+
*/
|
|
239
|
+
static getUserToken(): UserToken;
|
|
240
|
+
|
|
199
241
|
/**
|
|
200
242
|
* Based on the username and password, it generates a salt and verifier to configure a SRP user
|
|
201
243
|
*
|
|
@@ -212,12 +254,14 @@ export class Auth {
|
|
|
212
254
|
|
|
213
255
|
/**
|
|
214
256
|
* Return the token currently used to identify the current session.
|
|
257
|
+
* @deprecated see {@apilink Auth.getUserToken}
|
|
215
258
|
* @return The current token
|
|
216
259
|
*/
|
|
217
260
|
static getToken(): string;
|
|
218
261
|
|
|
219
262
|
/**
|
|
220
263
|
* Return the IDP token (zipped & base64 encoded XML) for the current user.
|
|
264
|
+
* @deprecated use {@apilink Auth.getUserToken} instead
|
|
221
265
|
* @return The current IDP token
|
|
222
266
|
*/
|
|
223
267
|
static getIDPToken(): string;
|