@olympeio/runtime-node 8.7.0 → 9.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/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 -0
- package/import/olympe.sc/datamodel/02_bricks.newRel.json +1 -0
- package/index.js +792 -666
- package/package.json +7 -3
- package/types/base.d.ts +116 -0
- package/types/cloud.d.ts +303 -0
- package/types/index.d.ts +5 -0
- package/types/legacy.d.ts +281 -0
- package/types/runtime.d.ts +281 -0
- package/types/utils.d.ts +290 -0
- package/import/olympe.sc/datamodel/logic/01_functions.newInst.json +0 -1
- package/import/olympe.sc/datamodel/logic/01_functions.newRel.json +0 -1
- package/import/olympe.sc/datamodel/logic/02_actions.newInst.json +0 -1
- package/import/olympe.sc/datamodel/logic/02_actions.newRel.json +0 -1
- package/index.d.ts +0 -1174
package/index.d.ts
DELETED
|
@@ -1,1174 +0,0 @@
|
|
|
1
|
-
// @ts-ignore
|
|
2
|
-
import { Observable } from "rxjs";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* A client used to call remote services.
|
|
6
|
-
*/
|
|
7
|
-
export class ServiceClient {
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Send a request to a {@link CallService}.
|
|
11
|
-
*
|
|
12
|
-
* @param serviceId the service id
|
|
13
|
-
* @param payload the message payload, optional
|
|
14
|
-
* @return a Promise that completes when the call has been executed
|
|
15
|
-
*/
|
|
16
|
-
static call(serviceId: string, payload?: Object): Promise<void>;
|
|
17
|
-
|
|
18
|
-
/**
|
|
19
|
-
* Get a value from a {@link GetService}.
|
|
20
|
-
*
|
|
21
|
-
* @param serviceId the service id
|
|
22
|
-
* @param payload the message payload
|
|
23
|
-
* @return a Promise wrapping the resulting value
|
|
24
|
-
*/
|
|
25
|
-
static get(serviceId: string, payload: Object): Promise<Object>;
|
|
26
|
-
|
|
27
|
-
/**
|
|
28
|
-
* Observe values emitted by a {@link SubscribeService}.
|
|
29
|
-
*
|
|
30
|
-
* @param serviceId the service id
|
|
31
|
-
* @param payload the message payload, optional
|
|
32
|
-
* @return an Observable emitting values
|
|
33
|
-
*/
|
|
34
|
-
static observe(serviceId: string, payload?: Object): Observable<Object>;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
/**
|
|
38
|
-
* A message consumed by a service.
|
|
39
|
-
*/
|
|
40
|
-
export class ServiceMessage {
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Get the requesting client's user tag.
|
|
44
|
-
*
|
|
45
|
-
* @return the user tag
|
|
46
|
-
*/
|
|
47
|
-
userTag(): Promise<string>;
|
|
48
|
-
|
|
49
|
-
/**
|
|
50
|
-
* Get the request body.
|
|
51
|
-
*
|
|
52
|
-
* @return the request body
|
|
53
|
-
*/
|
|
54
|
-
body(): Object;
|
|
55
|
-
|
|
56
|
-
/**
|
|
57
|
-
* Send an ack as response.
|
|
58
|
-
*
|
|
59
|
-
* @return a Promise that completes once the ack is sent
|
|
60
|
-
*/
|
|
61
|
-
ack(): Promise<void>;
|
|
62
|
-
|
|
63
|
-
/**
|
|
64
|
-
* Send a reply message.
|
|
65
|
-
*
|
|
66
|
-
* @param payload the payload of the reply
|
|
67
|
-
* @return a Promise that completes once the reply is sent
|
|
68
|
-
*/
|
|
69
|
-
reply(payload: Object): Promise<void>;
|
|
70
|
-
|
|
71
|
-
/**
|
|
72
|
-
* Send an error message.
|
|
73
|
-
*
|
|
74
|
-
* @param error the error to send
|
|
75
|
-
* @return a Promise that completes once the error is sent
|
|
76
|
-
*/
|
|
77
|
-
fail(error: Error): Promise<void>;
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
/**
|
|
81
|
-
* A service that processes requests.
|
|
82
|
-
*/
|
|
83
|
-
export abstract class Service {
|
|
84
|
-
|
|
85
|
-
/**
|
|
86
|
-
* Create a new instance of the service.
|
|
87
|
-
*
|
|
88
|
-
* @param serviceId the service id
|
|
89
|
-
*/
|
|
90
|
-
constructor(serviceId: string);
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* Start the service.
|
|
94
|
-
*/
|
|
95
|
-
start(): Promise<void>;
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Listen to incoming requests.
|
|
99
|
-
*/
|
|
100
|
-
listen(): Observable<ServiceMessage>;
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* Stop the service.
|
|
104
|
-
*/
|
|
105
|
-
stop(): Promise<void>;
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
/**
|
|
109
|
-
* A service that retrieves a value upon request.
|
|
110
|
-
*/
|
|
111
|
-
export class GetService extends Service { }
|
|
112
|
-
|
|
113
|
-
/**
|
|
114
|
-
* A service that executes remote procedures.
|
|
115
|
-
*/
|
|
116
|
-
export class CallService extends Service { }
|
|
117
|
-
|
|
118
|
-
/**
|
|
119
|
-
* A service that allows clients to subscribe to updates.
|
|
120
|
-
*/
|
|
121
|
-
export class SubscribeService extends Service {
|
|
122
|
-
|
|
123
|
-
/**
|
|
124
|
-
* Send a new notification to subscribers.
|
|
125
|
-
*
|
|
126
|
-
* @param payload the payload of the notification
|
|
127
|
-
* @return a Promise that completes once the notification is sent
|
|
128
|
-
*/
|
|
129
|
-
notify(payload: Object): Promise<void>;
|
|
130
|
-
}
|
|
131
|
-
|
|
132
|
-
/**
|
|
133
|
-
* List of general properties keys used by the runtime engine to set specific values on BrickContexts
|
|
134
|
-
*/
|
|
135
|
-
export enum GlobalProperties {
|
|
136
|
-
TRANSACTION = '__transaction',
|
|
137
|
-
PRODUCTION = '__production',
|
|
138
|
-
EDITION = '__editionMode'
|
|
139
|
-
}
|
|
140
|
-
|
|
141
|
-
/**
|
|
142
|
-
* The context of a brick is the object that contains the brick state, controls the brick lifecycle and provides
|
|
143
|
-
* an API to observe and set values of this brick's properties.
|
|
144
|
-
*/
|
|
145
|
-
export class BrickContext {
|
|
146
|
-
|
|
147
|
-
/**
|
|
148
|
-
* Register a callback to execute when the context is destroyed. Return the callback id.
|
|
149
|
-
*
|
|
150
|
-
* @param callback the callback function
|
|
151
|
-
* @return the callback id
|
|
152
|
-
*/
|
|
153
|
-
onDestroy(callback: () => void): string;
|
|
154
|
-
|
|
155
|
-
/**
|
|
156
|
-
* Remove a previously registered callback with {@link BrickContext#onDestroy} method using its id.
|
|
157
|
-
*
|
|
158
|
-
* @param id the id of the callback to unregister
|
|
159
|
-
*/
|
|
160
|
-
offDestroy(id: string): void;
|
|
161
|
-
|
|
162
|
-
/**
|
|
163
|
-
* Register a callback to execute every time the context is cleared.
|
|
164
|
-
* This happens every time the brick is refreshed with new inputs and during the brick destruction.
|
|
165
|
-
* Return the callback id.
|
|
166
|
-
*
|
|
167
|
-
* @param callback the callback function
|
|
168
|
-
* @return the callback id
|
|
169
|
-
*/
|
|
170
|
-
onClear(callback: () => void): string;
|
|
171
|
-
|
|
172
|
-
/**
|
|
173
|
-
* Remove a previously registered callback with {@link BrickContext#onClear} method using its id.
|
|
174
|
-
*
|
|
175
|
-
* @param id the id of the callback to unregister
|
|
176
|
-
*/
|
|
177
|
-
offClear(id: string): void;
|
|
178
|
-
|
|
179
|
-
/**
|
|
180
|
-
* Destroy the current context. It destroys all children context attached to this one and clear their values.
|
|
181
|
-
* The context cannot be reused after calling this function.
|
|
182
|
-
*/
|
|
183
|
-
destroy(): void;
|
|
184
|
-
|
|
185
|
-
/**
|
|
186
|
-
* Clear the current context: detach and destroys all children context.
|
|
187
|
-
* The context can be reused.
|
|
188
|
-
*/
|
|
189
|
-
clear(): void;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Set the specified property value and propagate the update to anyone observing it.
|
|
193
|
-
*
|
|
194
|
-
* @param key the property or key string
|
|
195
|
-
* @param value the new value to set
|
|
196
|
-
* @return this
|
|
197
|
-
*/
|
|
198
|
-
set<T>(key: PropertyDescriptor<T> | string, value: any): this;
|
|
199
|
-
|
|
200
|
-
/**
|
|
201
|
-
* Trigger the specified event and propagate the update to anyone observing it.
|
|
202
|
-
*
|
|
203
|
-
* @param key the event or key event
|
|
204
|
-
* @return this
|
|
205
|
-
*/
|
|
206
|
-
trigger<T>(key: PropertyDescriptor<T> | string): this;
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* Clear the value of the specified property and propagate that event.
|
|
210
|
-
*
|
|
211
|
-
* @param key the property or key string
|
|
212
|
-
*/
|
|
213
|
-
remove<T>(key: PropertyDescriptor<T> | string);
|
|
214
|
-
|
|
215
|
-
/**
|
|
216
|
-
* Return the current value of the specified property. If there is currently no value, return null.
|
|
217
|
-
*
|
|
218
|
-
* @param key the property or key string
|
|
219
|
-
* @return the current value
|
|
220
|
-
*/
|
|
221
|
-
get<T>(key: PropertyDescriptor<T> | string): T | null;
|
|
222
|
-
|
|
223
|
-
/**
|
|
224
|
-
* Returns a boolean indicating whether a property has a value or not.
|
|
225
|
-
*
|
|
226
|
-
* @param key the property or key string
|
|
227
|
-
* @param global [=false] whether or not the method checks parent contexts
|
|
228
|
-
* @return whether `property` has a value or not
|
|
229
|
-
*/
|
|
230
|
-
has<T>(key: PropertyDescriptor<T> | string, global?: boolean): boolean;
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Return an observable to subscribe to value updates of the specified property.
|
|
234
|
-
* If `waitForValue` is set to FALSE (TRUE by default), the first value received by the observable is null
|
|
235
|
-
* if there is no value at subscription time.
|
|
236
|
-
* If `global` is set to TRUE (FALSE by default), it observes values coming from other contexts accessible from the current one.
|
|
237
|
-
*
|
|
238
|
-
* @param key the property or key string
|
|
239
|
-
* @param waitForValue [=true] whether or not the observable wait for a first value to get a value.
|
|
240
|
-
* @param global [=false] whether or not listen to a value coming from other contexts.
|
|
241
|
-
* @return the observable
|
|
242
|
-
*/
|
|
243
|
-
observe<T>(key: PropertyDescriptor<T> | string, waitForValue?: boolean, global?: boolean): Observable<T>;
|
|
244
|
-
|
|
245
|
-
/**
|
|
246
|
-
* Subscribe to the specified observable and set its values to the context with the provided key.
|
|
247
|
-
*
|
|
248
|
-
* @param key the key used to set the values coming from the observable
|
|
249
|
-
* @param observable the observable providing values
|
|
250
|
-
* @return this context
|
|
251
|
-
*/
|
|
252
|
-
repeat<T>(key: PropertyDescriptor<T> | string, observable:Observable<T>): this;
|
|
253
|
-
|
|
254
|
-
/**
|
|
255
|
-
* Run a runnable property and returns its context.
|
|
256
|
-
*
|
|
257
|
-
* @param property the runnable property or the runnable itself
|
|
258
|
-
* @return the child context or null if the runner was not found
|
|
259
|
-
*/
|
|
260
|
-
runner<T>(property: PropertyDescriptor<T> | string | Brick): BrickContext | null;
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* Wait for the property to get a new value, wrapped in a promise.
|
|
264
|
-
*
|
|
265
|
-
* @param property the property
|
|
266
|
-
* @param nullable whether or not the observable accept null values (when a value is removed from the context). False by default.
|
|
267
|
-
* @param global [=false] whether or not the method checks parent contexts
|
|
268
|
-
* @return a promise of the next value of property
|
|
269
|
-
*/
|
|
270
|
-
waitFor<T>(property: PropertyDescriptor<T> | string, nullable?: boolean, global?: boolean): Promise<T>;
|
|
271
|
-
|
|
272
|
-
/**
|
|
273
|
-
* Set the parent element for visual brick to be rendered.
|
|
274
|
-
*
|
|
275
|
-
* @param parent the parent container
|
|
276
|
-
* @return this
|
|
277
|
-
*/
|
|
278
|
-
setParentElement(parent: Element): this;
|
|
279
|
-
|
|
280
|
-
/**
|
|
281
|
-
* Create and return a new context, child of the current one.
|
|
282
|
-
* Mainly used to run other bricks within the current one (e.g.: the iterator of the brick For Each).
|
|
283
|
-
*
|
|
284
|
-
* @param debugName a name to give to the context for debugging purpose.
|
|
285
|
-
*/
|
|
286
|
-
createChild(debugName?: string): BrickContext;
|
|
287
|
-
|
|
288
|
-
/**
|
|
289
|
-
* Return the context with the specified id if accessible (in the hierarchy) from this context.
|
|
290
|
-
* Otherwise, return null.
|
|
291
|
-
*
|
|
292
|
-
* @param id the context id we want to retrieve
|
|
293
|
-
*/
|
|
294
|
-
getOtherContext(id: string): BrickContext | null;
|
|
295
|
-
|
|
296
|
-
/**
|
|
297
|
-
* Listen to the creation of the context with the specified id.
|
|
298
|
-
* Executes the callback when that context becomes accessible by this current context.
|
|
299
|
-
* Return a function to unregister the listener.
|
|
300
|
-
*
|
|
301
|
-
* @param id the context id, which corresponds to the tag of the brick to be retrieved.
|
|
302
|
-
* @param callback the function to execute when the specified brick context is available
|
|
303
|
-
*/
|
|
304
|
-
onContext(id: string, callback: ($: BrickContext) => void): () => void;
|
|
305
|
-
|
|
306
|
-
/**
|
|
307
|
-
* Return the parent context if it exists.
|
|
308
|
-
*/
|
|
309
|
-
getParent(): BrickContext | null;
|
|
310
|
-
|
|
311
|
-
/**
|
|
312
|
-
* Return the closest transaction from this context :
|
|
313
|
-
* - look in its own transaction stack
|
|
314
|
-
* - look in the transaction stack of its parents, recursively
|
|
315
|
-
* - creates a new isolated transaction if no one is found.
|
|
316
|
-
*
|
|
317
|
-
* @return the transaction
|
|
318
|
-
*/
|
|
319
|
-
getTransaction(): Transaction;
|
|
320
|
-
|
|
321
|
-
/**
|
|
322
|
-
* Get the last transaction from the stack of this context and releases it :
|
|
323
|
-
* - if the transaction is isolated, then executes it
|
|
324
|
-
* - otherwise, directly call the callback.
|
|
325
|
-
*
|
|
326
|
-
* The callback is called with 3 parameters:
|
|
327
|
-
* - whether the transaction has been executed or not (boolean)
|
|
328
|
-
* - whether the transaction succeed (always true if not executed) (boolean)
|
|
329
|
-
* - when the transaction failed, the associated error message (string), null otherwise.
|
|
330
|
-
*
|
|
331
|
-
* @param callback the callback function
|
|
332
|
-
*/
|
|
333
|
-
releaseTransaction(callback: (executed: boolean, success: boolean, errMsg?: string) => void);
|
|
334
|
-
|
|
335
|
-
/**
|
|
336
|
-
* Push the specified transaction on the transaction stack of this context.
|
|
337
|
-
* This is essentially used for:
|
|
338
|
-
* - Aggregate multiple operations on the same transaction with the [Begin]--[End] bricks from DRAW.
|
|
339
|
-
* - Push a transaction from a hardcoded brick in CODE and aggregate operations on it from softcoded functions.
|
|
340
|
-
*
|
|
341
|
-
* @param transaction the transaction to push on the stack
|
|
342
|
-
*/
|
|
343
|
-
pushTransaction(transaction: Transaction);
|
|
344
|
-
|
|
345
|
-
/**
|
|
346
|
-
* Remove and return the last added transaction from this context stack.
|
|
347
|
-
* If there is no transaction on the stack, return null.
|
|
348
|
-
*
|
|
349
|
-
* @return the transaction if exists
|
|
350
|
-
*/
|
|
351
|
-
popTransaction(): Transaction | null;
|
|
352
|
-
}
|
|
353
|
-
|
|
354
|
-
/**
|
|
355
|
-
* @deprecated use {@link BrickContext} instead
|
|
356
|
-
*/
|
|
357
|
-
export class Context extends BrickContext { }
|
|
358
|
-
|
|
359
|
-
/**
|
|
360
|
-
* Context of UI bricks with methods to get and observe properties.
|
|
361
|
-
* @deprecated use {@link BrickContext} instead and override render method of VisualBrick.
|
|
362
|
-
*/
|
|
363
|
-
export class UIContext extends BrickContext {
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* Return a Property to get, update and observe its value
|
|
367
|
-
*
|
|
368
|
-
* @deprecated use {@link BrickContext#get} instead
|
|
369
|
-
* @param name The property name
|
|
370
|
-
*/
|
|
371
|
-
getProperty<T>(name: string): Property<T> | null;
|
|
372
|
-
|
|
373
|
-
/**
|
|
374
|
-
* Return an Event to trigger or observe
|
|
375
|
-
*
|
|
376
|
-
* @deprecated use {@link BrickContext#trigger} instead
|
|
377
|
-
* @param name The event name
|
|
378
|
-
*/
|
|
379
|
-
getEvent(name: string): Event | null;
|
|
380
|
-
|
|
381
|
-
/**
|
|
382
|
-
* Observe multiple properties simultaneously.
|
|
383
|
-
*
|
|
384
|
-
* @deprecated use {@link BrickContext#observe} with the RXJS operator combineLatestWith.
|
|
385
|
-
* @param properties list of properties to observe simultaneously
|
|
386
|
-
*/
|
|
387
|
-
observeMany(...properties: string[]): Observable<any[]>;
|
|
388
|
-
}
|
|
389
|
-
|
|
390
|
-
/**
|
|
391
|
-
* A property descriptor is an object that refers to the definition of a property
|
|
392
|
-
*/
|
|
393
|
-
declare interface PropertyDescriptor<T> {
|
|
394
|
-
/**
|
|
395
|
-
* Get the property tag
|
|
396
|
-
*
|
|
397
|
-
* @return property tag
|
|
398
|
-
*/
|
|
399
|
-
getTag(): string;
|
|
400
|
-
}
|
|
401
|
-
|
|
402
|
-
/**
|
|
403
|
-
* A property allows a brick or a data object to store and provide a value under a specific identifier.
|
|
404
|
-
*
|
|
405
|
-
* @deprecated
|
|
406
|
-
*/
|
|
407
|
-
declare interface Property<T> extends PropertyDescriptor<T> {
|
|
408
|
-
|
|
409
|
-
/**
|
|
410
|
-
* Get the property current value
|
|
411
|
-
* @return property value
|
|
412
|
-
*/
|
|
413
|
-
get(): T | null;
|
|
414
|
-
|
|
415
|
-
/**
|
|
416
|
-
* Get a RxJS observable to subscribe to changes of the property value.
|
|
417
|
-
* @return observable on the property value
|
|
418
|
-
*/
|
|
419
|
-
observe(): Observable<T>;
|
|
420
|
-
|
|
421
|
-
/**
|
|
422
|
-
* Update the property value.
|
|
423
|
-
*
|
|
424
|
-
* @param value the property value
|
|
425
|
-
*/
|
|
426
|
-
set(value: T);
|
|
427
|
-
}
|
|
428
|
-
|
|
429
|
-
/**
|
|
430
|
-
* Special brick property type that can be triggered.
|
|
431
|
-
*
|
|
432
|
-
* @deprecated
|
|
433
|
-
*/
|
|
434
|
-
declare interface Event extends Property<number> {
|
|
435
|
-
|
|
436
|
-
/**
|
|
437
|
-
* Trigger the event.
|
|
438
|
-
*/
|
|
439
|
-
trigger();
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
/**
|
|
443
|
-
* The entry of a brick is a static object linked to the brick class itself that is used to make the link between the
|
|
444
|
-
* code and the database. It stores tags linked to a specific brick :
|
|
445
|
-
* - tag of the brick itself
|
|
446
|
-
* - tags of properties that can be used as constants.
|
|
447
|
-
*/
|
|
448
|
-
declare interface Entry {
|
|
449
|
-
|
|
450
|
-
/**
|
|
451
|
-
* Register a property on the brick with the specified tag.
|
|
452
|
-
*
|
|
453
|
-
* @param tag
|
|
454
|
-
* @return the property descriptor
|
|
455
|
-
*/
|
|
456
|
-
addProperty<T>(tag: string): PropertyDescriptor<T>;
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* Register a new relation type with the specified tag and direction
|
|
460
|
-
*
|
|
461
|
-
* @param tag
|
|
462
|
-
* @param direction
|
|
463
|
-
*/
|
|
464
|
-
addRelation(tag: string, direction: Direction): transformers.Related<any, any>;
|
|
465
|
-
}
|
|
466
|
-
|
|
467
|
-
/**
|
|
468
|
-
* A brick is a modular piece of software. Bricks can be combined with each other to build a program.
|
|
469
|
-
* Its lifecycle has 3 phases:
|
|
470
|
-
* - initialisation: called whenever the brick is instantiated by its parent executor.
|
|
471
|
-
* - updates: called whenever all the inputs of a brick have a value (default behaviour). This behaviour can be modified by overriding `configCoreUpdate`.
|
|
472
|
-
* - destruction: when the parent executor starts to destroy itself, the brick destroys itself too.
|
|
473
|
-
*
|
|
474
|
-
* A headless brick that executes its core code every time an input gets a value.
|
|
475
|
-
*/
|
|
476
|
-
export class Brick {
|
|
477
|
-
|
|
478
|
-
/**
|
|
479
|
-
* Static reference to the entry of that brick.
|
|
480
|
-
*/
|
|
481
|
-
public static readonly entry: Entry;
|
|
482
|
-
|
|
483
|
-
/**
|
|
484
|
-
* Return the list of inputs tags as an ordered array.
|
|
485
|
-
*/
|
|
486
|
-
readonly getInputs: () => string[];
|
|
487
|
-
|
|
488
|
-
/**
|
|
489
|
-
* Return the list of outputs tags as an ordered array
|
|
490
|
-
*/
|
|
491
|
-
readonly getOutputs: () => string[];
|
|
492
|
-
|
|
493
|
-
/**
|
|
494
|
-
* Run the brick itself using the specified context.
|
|
495
|
-
*
|
|
496
|
-
* @param $ the brick context
|
|
497
|
-
*/
|
|
498
|
-
run($: BrickContext);
|
|
499
|
-
|
|
500
|
-
/**
|
|
501
|
-
* Setup the brick and its context to listen to pipes and updates for its inputs and properties.
|
|
502
|
-
* Typically used as the first instruction of the {@link Brick#run run} method.
|
|
503
|
-
*
|
|
504
|
-
* @param $ the brick context.
|
|
505
|
-
*/
|
|
506
|
-
protected setup($: BrickContext);
|
|
507
|
-
|
|
508
|
-
/**
|
|
509
|
-
* Called when the brick starts its lifecycle and gets initialized.
|
|
510
|
-
*
|
|
511
|
-
* @param $ the brick context
|
|
512
|
-
*/
|
|
513
|
-
protected init($: BrickContext);
|
|
514
|
-
|
|
515
|
-
/**
|
|
516
|
-
* Called when the brick ends its lifecycle and gets destroyed.
|
|
517
|
-
*
|
|
518
|
-
* @param $ the brick context
|
|
519
|
-
*/
|
|
520
|
-
protected destroy($: BrickContext);
|
|
521
|
-
|
|
522
|
-
/**
|
|
523
|
-
* Called every time the context is cleared.
|
|
524
|
-
*
|
|
525
|
-
* @param $ the brick context
|
|
526
|
-
*/
|
|
527
|
-
protected clear($: BrickContext);
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* Called whenever the conditions to update the brick are satisfied (as defined by method `configCoreUpdate`).
|
|
531
|
-
* By default, a function updates whenever an input gets a new value, but only if all inputs have a value.
|
|
532
|
-
*
|
|
533
|
-
* @param $ the brick context
|
|
534
|
-
* @param inputs array of input values
|
|
535
|
-
* @param outputs array of output setter functions. A setter updates a specific output value of the brick.
|
|
536
|
-
*/
|
|
537
|
-
protected update($: BrickContext, inputs: Array<any>, outputs: Array<(value: any) => void>): void;
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* Observe the context to define when the brick `update` method should be called.
|
|
541
|
-
*
|
|
542
|
-
* @param $ the brick context
|
|
543
|
-
* @return an observable that emit a value anytime the brick `update` method should be called.
|
|
544
|
-
*/
|
|
545
|
-
protected setupExecution($: BrickContext): Observable<Array<any>>;
|
|
546
|
-
|
|
547
|
-
/**
|
|
548
|
-
* Execute the `onUpdate` class method. The `clear` callback destroys the context of the previous update and invalidates previous inputs.
|
|
549
|
-
* Override this method to change the function brick default behaviour.
|
|
550
|
-
*
|
|
551
|
-
* @deprecated
|
|
552
|
-
* @param $ the brick context
|
|
553
|
-
* @param runUpdate the function to call to update the brick
|
|
554
|
-
* @param clear the function to clear previous run
|
|
555
|
-
*/
|
|
556
|
-
protected setupUpdate($: BrickContext, runUpdate: (inputs: any[]) => void, clear: () => void);
|
|
557
|
-
|
|
558
|
-
/**
|
|
559
|
-
* @deprecated use {@link BrickContext#init} instead
|
|
560
|
-
* @param $ the brick context
|
|
561
|
-
*/
|
|
562
|
-
protected onInit($: BrickContext): void;
|
|
563
|
-
|
|
564
|
-
/**
|
|
565
|
-
* @deprecated use {@link BrickContext#init} instead
|
|
566
|
-
* @param $ the brick context
|
|
567
|
-
* @param inputs array of input values
|
|
568
|
-
* @param outputs array of output setter functions.
|
|
569
|
-
*/
|
|
570
|
-
protected onUpdate($: BrickContext, inputs: Array<any>, outputs: Array<(value: any) => void>): void;
|
|
571
|
-
|
|
572
|
-
/**
|
|
573
|
-
* @deprecated use {@link BrickContext#init} instead
|
|
574
|
-
* @param $ the brick context
|
|
575
|
-
*/
|
|
576
|
-
protected onDestroy($: BrickContext): void;
|
|
577
|
-
}
|
|
578
|
-
|
|
579
|
-
/**
|
|
580
|
-
* A headless brick whose update is triggered by an event (control flow). Unlike a `FunctionBrick`, an `ActionBrick` updates on each incoming event, even if an input still has no value.
|
|
581
|
-
* An `ActionBrick` also provides a specific output to forward the control flow (event).
|
|
582
|
-
*/
|
|
583
|
-
export class ActionBrick extends Brick { }
|
|
584
|
-
|
|
585
|
-
/**
|
|
586
|
-
* A UI Brick aims to display something on the screen of a UI application.
|
|
587
|
-
*/
|
|
588
|
-
export class VisualBrick extends Brick {
|
|
589
|
-
|
|
590
|
-
/**
|
|
591
|
-
* Return the list of properties tags as an ordered array
|
|
592
|
-
*/
|
|
593
|
-
readonly getProperties: () => string[];
|
|
594
|
-
|
|
595
|
-
/**
|
|
596
|
-
* Render an element for the given `context`.
|
|
597
|
-
* Can return `null` if no element is rendered.
|
|
598
|
-
*
|
|
599
|
-
* @param $ the brick context
|
|
600
|
-
* @param properties property values that have been s
|
|
601
|
-
* @return the rendered element
|
|
602
|
-
*/
|
|
603
|
-
protected render($: BrickContext, properties: any[]): Element | null;
|
|
604
|
-
|
|
605
|
-
/**
|
|
606
|
-
* Attach the `element` rendered by `render()` to its `parent` (in the DOM).
|
|
607
|
-
* Must return the function to clear the parent from that element.
|
|
608
|
-
* That function is called just before the next call to updateParent.
|
|
609
|
-
*
|
|
610
|
-
* If the `render()` method returns null, only the clear function of previous call to `updateParent()` will be called.
|
|
611
|
-
*
|
|
612
|
-
* @param parent the parent element
|
|
613
|
-
* @param element the element to attach
|
|
614
|
-
* @return the function to clear the element from its parent.
|
|
615
|
-
*/
|
|
616
|
-
protected updateParent(parent: Element, element: Element): () => void;
|
|
617
|
-
|
|
618
|
-
/**
|
|
619
|
-
* Called when the DOM Element associated to that brick has been added to the document and is ready to be drawn.
|
|
620
|
-
*
|
|
621
|
-
* @deprecated override {@link VisualBrick#render} and {@link VisualBrick#updateParent} instead.
|
|
622
|
-
* @param $ the brick context
|
|
623
|
-
* @param domElement the associated DOM Element
|
|
624
|
-
*/
|
|
625
|
-
protected draw($: BrickContext, domElement: Element);
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
/**
|
|
629
|
-
* @deprecated use {@link VisualBrick} instead
|
|
630
|
-
*/
|
|
631
|
-
export class UIBrick extends VisualBrick { }
|
|
632
|
-
|
|
633
|
-
/**
|
|
634
|
-
* Static function that must be called for every brick used in an application.
|
|
635
|
-
* It registers the brick code in the registry with the specified tag and return the Entry for that brick.
|
|
636
|
-
*
|
|
637
|
-
* @param tag the brick unique id
|
|
638
|
-
* @param brick the brick class
|
|
639
|
-
* @param args Extra arguments
|
|
640
|
-
*/
|
|
641
|
-
export function registerBrick(tag: string, brick: new () => Brick, ...args: any): Entry;
|
|
642
|
-
|
|
643
|
-
export class Config {
|
|
644
|
-
/**
|
|
645
|
-
* Returns the value associated to the specified parameter id. Returns undefined if the parameter does not exist.
|
|
646
|
-
*
|
|
647
|
-
* @param id the parameter id.
|
|
648
|
-
*/
|
|
649
|
-
static getParameter(id: string): any | undefined;
|
|
650
|
-
}
|
|
651
|
-
|
|
652
|
-
declare type SRPData = {
|
|
653
|
-
username: string,
|
|
654
|
-
login: string
|
|
655
|
-
salt: string,
|
|
656
|
-
verifier: string
|
|
657
|
-
}
|
|
658
|
-
|
|
659
|
-
declare enum AuthState {
|
|
660
|
-
INIT = 'init',
|
|
661
|
-
DISCONNECTED = 'disconnected',
|
|
662
|
-
GUEST = 'guest',
|
|
663
|
-
AUTHENTICATING = 'authenticating',
|
|
664
|
-
ERROR = 'error',
|
|
665
|
-
AUTHENTICATED = 'authenticated'
|
|
666
|
-
}
|
|
667
|
-
|
|
668
|
-
/**
|
|
669
|
-
* A static class that gathers all the required methods to handle the authentication and sessions with Olympe.
|
|
670
|
-
*/
|
|
671
|
-
export class Auth {
|
|
672
|
-
|
|
673
|
-
/**
|
|
674
|
-
* Based on the username and password, it generates a salt and verifier to configure a SRP user
|
|
675
|
-
*
|
|
676
|
-
* @param username
|
|
677
|
-
* @param password
|
|
678
|
-
*/
|
|
679
|
-
static generateSRPData(username: string, password: string): SRPData;
|
|
680
|
-
|
|
681
|
-
/**
|
|
682
|
-
* Return the current state of the authentication manager
|
|
683
|
-
*/
|
|
684
|
-
static getState(): AuthState;
|
|
685
|
-
|
|
686
|
-
/**
|
|
687
|
-
* Return the token currently used to identify the current session.
|
|
688
|
-
*/
|
|
689
|
-
static getToken(): string;
|
|
690
|
-
|
|
691
|
-
/**
|
|
692
|
-
* Return the IDP token (zipped & base64 encoded XML) for the current user.
|
|
693
|
-
*/
|
|
694
|
-
static getIDPToken(): string;
|
|
695
|
-
|
|
696
|
-
/**
|
|
697
|
-
* Return the tag of the current authenticated user.
|
|
698
|
-
*/
|
|
699
|
-
static getCurrentUser(): string
|
|
700
|
-
|
|
701
|
-
/**
|
|
702
|
-
* Retrieve the user tag associated to the specified token
|
|
703
|
-
*
|
|
704
|
-
* @param token
|
|
705
|
-
*/
|
|
706
|
-
static getUserFromToken(token: string): Promise<string>;
|
|
707
|
-
|
|
708
|
-
/**
|
|
709
|
-
* Refresh the session token to keep it alive.
|
|
710
|
-
*/
|
|
711
|
-
static sendKeepAlive();
|
|
712
|
-
|
|
713
|
-
/**
|
|
714
|
-
* Try to login using SRP protocol with the specified username and password.
|
|
715
|
-
* Returns a promise resolved when logged in or that catches an error if refused.
|
|
716
|
-
*
|
|
717
|
-
* @throws {Error} If the provider's configuration is incorrect.
|
|
718
|
-
* @param username the username
|
|
719
|
-
* @param password the password
|
|
720
|
-
*/
|
|
721
|
-
static loginSRP(username: string, password: string): Promise<void>;
|
|
722
|
-
|
|
723
|
-
/**
|
|
724
|
-
* Try to login using SAML protocol with the specified username and password.
|
|
725
|
-
* Returns a promise resolved when logged in or that catches an error if refused.
|
|
726
|
-
*
|
|
727
|
-
* @throws {Error} If the provider's configuration is incorrect.
|
|
728
|
-
*/
|
|
729
|
-
static loginSAML(): Promise<void>;
|
|
730
|
-
|
|
731
|
-
/**
|
|
732
|
-
* Try to login using the specified token for the user.
|
|
733
|
-
* Returns a promise resolved when logged in or that catches an error if the token is not valid.
|
|
734
|
-
*
|
|
735
|
-
* @param username the username
|
|
736
|
-
* @param token the token
|
|
737
|
-
*/
|
|
738
|
-
static loginToken(username: string, token: string): Promise<void>;
|
|
739
|
-
|
|
740
|
-
/**
|
|
741
|
-
* Try to login using the configured OpenID Provider.
|
|
742
|
-
* Returns a promise resolved when logged in or that catches an error if the login is not valid.
|
|
743
|
-
* @throws {Error} If the provider's configuration is incorrect.
|
|
744
|
-
*/
|
|
745
|
-
static loginOpenID(): Promise<void>;
|
|
746
|
-
|
|
747
|
-
/**
|
|
748
|
-
* Log out the current user and invalidate its session token.
|
|
749
|
-
* It returns a promise resolved when the operation is done.
|
|
750
|
-
*/
|
|
751
|
-
static logout(): Promise<void>;
|
|
752
|
-
}
|
|
753
|
-
|
|
754
|
-
/**
|
|
755
|
-
* Error type used to propagate errors through flows between bricks.
|
|
756
|
-
*/
|
|
757
|
-
export class ErrorFlow {
|
|
758
|
-
/**
|
|
759
|
-
* Create a new Error object to be sent in an error flow
|
|
760
|
-
*
|
|
761
|
-
* @param message the error message
|
|
762
|
-
* @param code the code associated to the error
|
|
763
|
-
*/
|
|
764
|
-
static create(message: string, code: number): ErrorFlow;
|
|
765
|
-
|
|
766
|
-
/**
|
|
767
|
-
* Return the message of this error
|
|
768
|
-
*/
|
|
769
|
-
getMessage(): string;
|
|
770
|
-
|
|
771
|
-
/**
|
|
772
|
-
* Return the code associated to this error
|
|
773
|
-
*/
|
|
774
|
-
getCode(): number;
|
|
775
|
-
}
|
|
776
|
-
|
|
777
|
-
/* ======================
|
|
778
|
-
DATACLOUD
|
|
779
|
-
====================== */
|
|
780
|
-
|
|
781
|
-
export interface Relation<O extends Sync, D extends Sync> extends HasInstanceTag {
|
|
782
|
-
getTag(): string;
|
|
783
|
-
getDirection(): Direction;
|
|
784
|
-
getInverse(): Relation<D, O>;
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
export class StringPrimitive extends Sync {
|
|
788
|
-
static valueProp: PropertyDescriptor<string>;
|
|
789
|
-
}
|
|
790
|
-
|
|
791
|
-
export class NumberPrimitive extends Sync {
|
|
792
|
-
static valueProp: PropertyDescriptor<number>;
|
|
793
|
-
}
|
|
794
|
-
|
|
795
|
-
export class BooleanPrimitive extends Sync {
|
|
796
|
-
static valueProp: PropertyDescriptor<boolean>;
|
|
797
|
-
}
|
|
798
|
-
|
|
799
|
-
export class DatetimePrimitive extends Sync {
|
|
800
|
-
static valueProp: PropertyDescriptor<Date>;
|
|
801
|
-
}
|
|
802
|
-
|
|
803
|
-
export class ColorPrimitive extends Sync {
|
|
804
|
-
static valueProp: PropertyDescriptor<Color>;
|
|
805
|
-
}
|
|
806
|
-
|
|
807
|
-
export class Enum extends Sync {
|
|
808
|
-
create(transaction: Transaction, name?: string): string;
|
|
809
|
-
getValues(): ListDef;
|
|
810
|
-
}
|
|
811
|
-
|
|
812
|
-
export class EnumValue extends StringPrimitive {
|
|
813
|
-
static create(transaction: Transaction, enumModel: InstanceTag, value: string, name?: string, rank?: number): string;
|
|
814
|
-
|
|
815
|
-
static nameProp: PropertyDescriptor<string>;
|
|
816
|
-
static valueProp: PropertyDescriptor<string>;
|
|
817
|
-
static rankProp: PropertyDescriptor<number>;
|
|
818
|
-
}
|
|
819
|
-
|
|
820
|
-
export class File extends Sync {
|
|
821
|
-
static nameProp: PropertyDescriptor<string>;
|
|
822
|
-
static creationDateProp: PropertyDescriptor<Date>;
|
|
823
|
-
static modificationDateProp: PropertyDescriptor<Date>;
|
|
824
|
-
static mimeTypeProp: PropertyDescriptor<string>;
|
|
825
|
-
static urlProp: PropertyDescriptor<string>;
|
|
826
|
-
|
|
827
|
-
static createFile(model: InstanceTag, transaction: Transaction, name: string, content: ArrayBuffer, mimeType?: string, tag?: string): string;
|
|
828
|
-
static createFileFromURL(model: InstanceTag, transaction: Transaction, name: string, url: string, mimeType?: string, tag?: string): string;
|
|
829
|
-
|
|
830
|
-
getContentAsBinary(onSuccess: (content: ArrayBuffer) => void, onFailure?: (string) => void);
|
|
831
|
-
getContentAsString(onSuccess: (content: string) => void, onFailure?: (string) => void);
|
|
832
|
-
getContentUrl(onSuccess: (content: string) => void, onFailure?: () => void);
|
|
833
|
-
saveAs(name: string);
|
|
834
|
-
}
|
|
835
|
-
|
|
836
|
-
export class User extends Sync {
|
|
837
|
-
static loginProp: PropertyDescriptor<string>;
|
|
838
|
-
static saltProp: PropertyDescriptor<string>;
|
|
839
|
-
static verifierProp: PropertyDescriptor<string>;
|
|
840
|
-
static SAMLNameIdProp: PropertyDescriptor<string>;
|
|
841
|
-
}
|
|
842
|
-
|
|
843
|
-
export class BusinessObject extends Sync {
|
|
844
|
-
static nameProp: PropertyDescriptor<string>;
|
|
845
|
-
static instanceRel: Relation<Sync, Sync>;
|
|
846
|
-
static modelRel: Relation<Sync, Sync>;
|
|
847
|
-
static containsRel: Relation<Sync, Sync>;
|
|
848
|
-
static extendRel: Relation<Sync, Sync>;
|
|
849
|
-
static extendedByRel: Relation<Sync, Sync>;
|
|
850
|
-
static propertyRel: Relation<Sync, PropertyPrimitive>;
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
export class PropertyPrimitive extends Sync {
|
|
854
|
-
static definingModelRel: Relation<PropertyPrimitive, BusinessObject>;
|
|
855
|
-
static typeRel: Relation<PropertyPrimitive, Sync>;
|
|
856
|
-
}
|
|
857
|
-
|
|
858
|
-
export class RelationPrimitive extends Sync {
|
|
859
|
-
static originModelRel: Relation<BusinessObject, RelationPrimitive>;
|
|
860
|
-
static destinationModelRel: Relation<RelationPrimitive, BusinessObject>;
|
|
861
|
-
}
|
|
862
|
-
|
|
863
|
-
export class Color {
|
|
864
|
-
static create(r: number, g: number, b: number, a?: number): Color;
|
|
865
|
-
|
|
866
|
-
getRed(): number;
|
|
867
|
-
getGreen(): number;
|
|
868
|
-
getBlue(): number;
|
|
869
|
-
getAlpha(): number;
|
|
870
|
-
toRGBString(): string;
|
|
871
|
-
toHexString(): string;
|
|
872
|
-
equals(obj): boolean;
|
|
873
|
-
}
|
|
874
|
-
|
|
875
|
-
/** @deprecated */
|
|
876
|
-
export class Parameter {
|
|
877
|
-
constructor(id: string);
|
|
878
|
-
}
|
|
879
|
-
|
|
880
|
-
/** @deprecated */
|
|
881
|
-
interface HasInstanceTag {
|
|
882
|
-
getTag(): string;
|
|
883
|
-
}
|
|
884
|
-
|
|
885
|
-
export type InstanceTag = HasInstanceTag | string | (new () => Sync) | Entry;
|
|
886
|
-
|
|
887
|
-
/** @deprecated */
|
|
888
|
-
export function instanceToTag(instance: InstanceTag): string;
|
|
889
|
-
/** @deprecated */
|
|
890
|
-
export function onDestroy(callback: () => void): string;
|
|
891
|
-
/** @deprecated */
|
|
892
|
-
export function offDestroy(id: string);
|
|
893
|
-
/** @deprecated */
|
|
894
|
-
export function registerSync(tag: string, brick: new () => Sync, ...args: any): Entry;
|
|
895
|
-
|
|
896
|
-
/** @deprecated */
|
|
897
|
-
export class Sync implements HasInstanceTag {
|
|
898
|
-
static getInstance(instance: InstanceTag): Sync;
|
|
899
|
-
static getInstancesOf(model: InstanceTag): ListDef;
|
|
900
|
-
|
|
901
|
-
getTag(): string;
|
|
902
|
-
getModel(): Sync;
|
|
903
|
-
getModelTag(): string;
|
|
904
|
-
getName(): string;
|
|
905
|
-
observeProperty<T>(property: Property<T>): Observable<T>;
|
|
906
|
-
getProperty<T>(property: Property<T>): T | null;
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
/** @deprecated */
|
|
910
|
-
export class DBView {
|
|
911
|
-
static get(): DBView;
|
|
912
|
-
|
|
913
|
-
exist(tag: InstanceTag): boolean;
|
|
914
|
-
name(tag: InstanceTag): string;
|
|
915
|
-
model(tag: InstanceTag): string | null;
|
|
916
|
-
extension(tag: InstanceTag): string | null;
|
|
917
|
-
isModel(tag: InstanceTag): boolean;
|
|
918
|
-
instanceOf(tag: InstanceTag, modelTag: InstanceTag): boolean;
|
|
919
|
-
isPersisted(tag: InstanceTag): boolean;
|
|
920
|
-
getProperty<T>(tag: InstanceTag, property: Property<T>, ownOnly: boolean): T | null;
|
|
921
|
-
// @ts-ignore
|
|
922
|
-
getProperties(tag: InstanceTag, ownOnly: boolean): Map<string, any>;
|
|
923
|
-
getRelated(tag: InstanceTag, relation: Relation<any, any>): string[];
|
|
924
|
-
isRelated(tag: InstanceTag, relation: Relation<any, any>, related: InstanceTag): boolean;
|
|
925
|
-
getMultiRelated(startTag: InstanceTag, relations: Relation<any, any>[]): string[];
|
|
926
|
-
getUniqueRelated(tag: InstanceTag, relation: Relation<any, any>): string | null;
|
|
927
|
-
getRecursiveRelated(startTag: InstanceTag, relation: Relation<any, any>, endTag: InstanceTag): string[];
|
|
928
|
-
findRecursive(startTag: InstanceTag, relation: Relation<any, any>, predicate: (string) => boolean): string | null;
|
|
929
|
-
findRelated(startTag: InstanceTag, relations: Relation<any, any>[], predicate: (string) => boolean): string | null;
|
|
930
|
-
findAllRelated(startTag: InstanceTag, relations: Relation<any, any>[], predicate: (string) => boolean): string[];
|
|
931
|
-
getExtendedModels(modelTag: InstanceTag, endTag?: InstanceTag): string[];
|
|
932
|
-
isExtending(modelTag: InstanceTag, extendedTag: InstanceTag): boolean;
|
|
933
|
-
getInstances(modelTag: InstanceTag): string[];
|
|
934
|
-
}
|
|
935
|
-
|
|
936
|
-
/** @deprecated */
|
|
937
|
-
export class ListDef {
|
|
938
|
-
constructor(root: InstanceTag, transformers?: Transformer | Transformer[]);
|
|
939
|
-
getBaseTag(): string;
|
|
940
|
-
onReady(callback: (list: ListDef) => void): string;
|
|
941
|
-
offReady(id: string);
|
|
942
|
-
observeFirst(): Observable<Sync>;
|
|
943
|
-
observeAt(rank: number): Observable<Sync>;
|
|
944
|
-
getCurrentAt(rank: number): Sync | null;
|
|
945
|
-
observeRank(id: string): Observable<number>;
|
|
946
|
-
getCurrentRank(id: string): number | null;
|
|
947
|
-
observeSize(): Observable<number>;
|
|
948
|
-
getCurrentSize(): number;
|
|
949
|
-
forEach(onAdd: (item: Sync, index: string, list: ListDef) => void, onRemove: (itemTag: string) => void);
|
|
950
|
-
forEachCurrentValue(callback: (item: Sync, index: string, list: ListDef) => void);
|
|
951
|
-
transform(...transformers: Transformer[]): ListDef;
|
|
952
|
-
union(otherListDef: ListDef): ListDef;
|
|
953
|
-
filter(predicate: Predicate): ListDef;
|
|
954
|
-
}
|
|
955
|
-
|
|
956
|
-
/** @deprecated */
|
|
957
|
-
export enum Direction {
|
|
958
|
-
DESTINATION, ORIGIN
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
/** @deprecated */
|
|
962
|
-
export enum FollowRule {
|
|
963
|
-
NONE, DUMP, DELETE, RUNTIME
|
|
964
|
-
}
|
|
965
|
-
|
|
966
|
-
/* *************************
|
|
967
|
-
Transformers
|
|
968
|
-
************************* */
|
|
969
|
-
declare abstract class Transformer { }
|
|
970
|
-
|
|
971
|
-
export namespace transformers {
|
|
972
|
-
/** @deprecated */
|
|
973
|
-
export class Related<O extends Sync, D extends Sync> extends Transformer implements Relation<O, D> {
|
|
974
|
-
constructor(relation: InstanceTag, direction: Direction);
|
|
975
|
-
getTag(): string;
|
|
976
|
-
getDirection(): Direction;
|
|
977
|
-
getInverse(): transformers.Related<D, O>;
|
|
978
|
-
}
|
|
979
|
-
|
|
980
|
-
/** @deprecated */
|
|
981
|
-
export class RecursiveRelated extends Transformer {
|
|
982
|
-
constructor(relation: InstanceTag, direction: Direction, minHops: number, maxHops: number);
|
|
983
|
-
}
|
|
984
|
-
|
|
985
|
-
/** @deprecated */
|
|
986
|
-
export class Distinct extends Transformer {
|
|
987
|
-
constructor();
|
|
988
|
-
}
|
|
989
|
-
|
|
990
|
-
/** @deprecated */
|
|
991
|
-
export class Filter extends Transformer {
|
|
992
|
-
constructor(predicate: Predicate);
|
|
993
|
-
}
|
|
994
|
-
|
|
995
|
-
/** @deprecated */
|
|
996
|
-
export class Limit extends Transformer {
|
|
997
|
-
constructor(limit: number, offset: number);
|
|
998
|
-
}
|
|
999
|
-
|
|
1000
|
-
/** @deprecated */
|
|
1001
|
-
export class Sort extends Transformer {
|
|
1002
|
-
constructor(comparator: Comparator, ascending?: boolean);
|
|
1003
|
-
}
|
|
1004
|
-
|
|
1005
|
-
/** @deprecated */
|
|
1006
|
-
export class Union extends Transformer {
|
|
1007
|
-
constructor(base: ListDef | InstanceTag, ...transformers: Transformer[]);
|
|
1008
|
-
}
|
|
1009
|
-
}
|
|
1010
|
-
|
|
1011
|
-
/* *************************
|
|
1012
|
-
Predicates
|
|
1013
|
-
************************* */
|
|
1014
|
-
/** @deprecated */
|
|
1015
|
-
export abstract class Predicate {
|
|
1016
|
-
static create(predicate: (object: Sync) => Observable<boolean>): Predicate;
|
|
1017
|
-
}
|
|
1018
|
-
|
|
1019
|
-
export namespace predicates {
|
|
1020
|
-
/** @deprecated */
|
|
1021
|
-
export class And extends Predicate {
|
|
1022
|
-
constructor(...predicates: Predicate[]);
|
|
1023
|
-
}
|
|
1024
|
-
|
|
1025
|
-
/** @deprecated */
|
|
1026
|
-
export class Or extends Predicate {
|
|
1027
|
-
constructor(...predicates: Predicate[]);
|
|
1028
|
-
}
|
|
1029
|
-
|
|
1030
|
-
/** @deprecated */
|
|
1031
|
-
export class Not extends Predicate {
|
|
1032
|
-
constructor(predicate: Predicate);
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
/** @deprecated */
|
|
1036
|
-
export class Equals extends Predicate {
|
|
1037
|
-
constructor(left: ValueDef, right: ValueDef);
|
|
1038
|
-
}
|
|
1039
|
-
|
|
1040
|
-
/** @deprecated */
|
|
1041
|
-
export class Contains extends Predicate {
|
|
1042
|
-
constructor(source: ValueDef, value: ValueDef);
|
|
1043
|
-
}
|
|
1044
|
-
|
|
1045
|
-
/** @deprecated */
|
|
1046
|
-
export class Greater extends Predicate {
|
|
1047
|
-
constructor(left: ValueDef, right: ValueDef);
|
|
1048
|
-
}
|
|
1049
|
-
|
|
1050
|
-
/** @deprecated */
|
|
1051
|
-
export class Smaller extends Predicate {
|
|
1052
|
-
constructor(left: ValueDef, right: ValueDef);
|
|
1053
|
-
}
|
|
1054
|
-
|
|
1055
|
-
/** @deprecated */
|
|
1056
|
-
export class HasRelated extends Predicate {
|
|
1057
|
-
constructor(relations: InstanceTag[], directions: Direction[], tag?: InstanceTag);
|
|
1058
|
-
}
|
|
1059
|
-
|
|
1060
|
-
/** @deprecated */
|
|
1061
|
-
export class InstanceOf extends Predicate {
|
|
1062
|
-
constructor(models: InstanceTag[]);
|
|
1063
|
-
}
|
|
1064
|
-
|
|
1065
|
-
/** @deprecated */
|
|
1066
|
-
export class Regex extends Predicate {
|
|
1067
|
-
constructor(source: ValueDef, regex: string, caseSensitive?: boolean);
|
|
1068
|
-
}
|
|
1069
|
-
}
|
|
1070
|
-
|
|
1071
|
-
/* *************************
|
|
1072
|
-
ValueDefs
|
|
1073
|
-
************************* */
|
|
1074
|
-
declare abstract class ValueDef { }
|
|
1075
|
-
|
|
1076
|
-
/** @deprecated */
|
|
1077
|
-
export namespace valuedefs {
|
|
1078
|
-
/** @deprecated */
|
|
1079
|
-
export class BooleanProperty extends ValueDef {
|
|
1080
|
-
constructor(property: Property<boolean>, transformers?: Transformer[], baseTag?: string);
|
|
1081
|
-
}
|
|
1082
|
-
|
|
1083
|
-
/** @deprecated */
|
|
1084
|
-
export class DateTimeProperty extends ValueDef {
|
|
1085
|
-
constructor(property: Property<Date>, transformers?: Transformer[], baseTag?: string);
|
|
1086
|
-
}
|
|
1087
|
-
|
|
1088
|
-
/** @deprecated */
|
|
1089
|
-
export class NumberProperty extends ValueDef {
|
|
1090
|
-
constructor(property: Property<number>, transformers?: Transformer[], baseTag?: string);
|
|
1091
|
-
}
|
|
1092
|
-
|
|
1093
|
-
/** @deprecated */
|
|
1094
|
-
export class StringProperty extends ValueDef {
|
|
1095
|
-
constructor(property: Property<string>, transformers?: Transformer[], baseTag?: string);
|
|
1096
|
-
}
|
|
1097
|
-
|
|
1098
|
-
/** @deprecated */
|
|
1099
|
-
export class Tag extends ValueDef {
|
|
1100
|
-
constructor();
|
|
1101
|
-
}
|
|
1102
|
-
|
|
1103
|
-
/** @deprecated */
|
|
1104
|
-
export class Constant extends ValueDef {
|
|
1105
|
-
constructor(value: any);
|
|
1106
|
-
}
|
|
1107
|
-
}
|
|
1108
|
-
|
|
1109
|
-
/* *************************
|
|
1110
|
-
Comparator
|
|
1111
|
-
************************* */
|
|
1112
|
-
/** @deprecated */
|
|
1113
|
-
export abstract class Comparator {
|
|
1114
|
-
static create(comparator: (object1: Sync, object2: Sync) => Observable<number>): Comparator;
|
|
1115
|
-
}
|
|
1116
|
-
|
|
1117
|
-
export namespace comparators {
|
|
1118
|
-
/** @deprecated */
|
|
1119
|
-
export class Number extends Comparator {
|
|
1120
|
-
constructor(value: ValueDef);
|
|
1121
|
-
}
|
|
1122
|
-
|
|
1123
|
-
/** @deprecated */
|
|
1124
|
-
export class String extends Comparator {
|
|
1125
|
-
constructor(value: ValueDef);
|
|
1126
|
-
}
|
|
1127
|
-
|
|
1128
|
-
/** @deprecated */
|
|
1129
|
-
export class DateTime extends Comparator {
|
|
1130
|
-
constructor(value: ValueDef);
|
|
1131
|
-
}
|
|
1132
|
-
}
|
|
1133
|
-
|
|
1134
|
-
interface Operation { }
|
|
1135
|
-
|
|
1136
|
-
export class BurstTransaction {
|
|
1137
|
-
constructor();
|
|
1138
|
-
push(object: InstanceTag, values: Observable<Map<string, any>>);
|
|
1139
|
-
complete(): Promise<void>;
|
|
1140
|
-
}
|
|
1141
|
-
|
|
1142
|
-
/** @deprecated */
|
|
1143
|
-
export class Transaction implements Operation {
|
|
1144
|
-
constructor();
|
|
1145
|
-
|
|
1146
|
-
getId(): string;
|
|
1147
|
-
addOperation(operation: Operation): Operation;
|
|
1148
|
-
persist(persist: boolean): this;
|
|
1149
|
-
create(model: InstanceTag, tag?: string): CreateInstance;
|
|
1150
|
-
persistInstance(tag: InstanceTag, persist?: boolean): CreateInstance;
|
|
1151
|
-
delete(tag: InstanceTag, followRule?: FollowRule);
|
|
1152
|
-
update<T>(instance: InstanceTag, property?: Property<T>, value?: T): UpdateInstance;
|
|
1153
|
-
createRelation(relation: InstanceTag, from: InstanceTag, to: InstanceTag);
|
|
1154
|
-
deleteRelation(relation: InstanceTag, from: InstanceTag, to: InstanceTag);
|
|
1155
|
-
deleteAllRelations(relation: Relation<any, any>, origin: InstanceTag);
|
|
1156
|
-
afterExecution(callback: (success: boolean, message?: string) => void);
|
|
1157
|
-
execute(callback: (success: boolean, message?: string) => void);
|
|
1158
|
-
executeAsLarge(callback: (success: boolean, message?: string) => void);
|
|
1159
|
-
}
|
|
1160
|
-
|
|
1161
|
-
/** @deprecated */
|
|
1162
|
-
export class CreateInstance implements Operation, HasInstanceTag {
|
|
1163
|
-
getTag(): string;
|
|
1164
|
-
getModelTag(): string;
|
|
1165
|
-
setProperty<T>(property: Property<T>, value: T): this;
|
|
1166
|
-
persist(persist: boolean): this;
|
|
1167
|
-
localSource();
|
|
1168
|
-
}
|
|
1169
|
-
|
|
1170
|
-
/** @deprecated */
|
|
1171
|
-
export class UpdateInstance implements Operation, HasInstanceTag {
|
|
1172
|
-
getTag(): string;
|
|
1173
|
-
setProperty<T>(property: Property<T>, value: T): this;
|
|
1174
|
-
}
|