@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.
Files changed (28) hide show
  1. package/import/dcInitConfig.json +1 -1
  2. package/import/olympe.dm/datamodel/00_bootstrap.newInst.json +1 -1
  3. package/import/olympe.dm/datamodel/00_bootstrap.newRel.json +1 -1
  4. package/import/olympe.dm/datamodel/01_primitives.newInst.json +1 -1
  5. package/import/olympe.dm/datamodel/01_primitives.newRel.json +1 -1
  6. package/import/olympe.dm/datamodel/02_permissions.newInst.json +1 -1
  7. package/import/olympe.dm/datamodel/02_permissions.newRel.json +1 -1
  8. package/import/olympe.dm/datamodel/03_file.newInst.json +1 -1
  9. package/import/olympe.dm/datamodel/03_file.newRel.json +1 -1
  10. package/import/olympe.dm/datamodel/04_modules.newInst.json +1 -1
  11. package/import/olympe.dm/datamodel/04_modules.newRel.json +1 -1
  12. package/import/olympe.dm/datamodel/05_permission_schema.newInst.json +1 -1
  13. package/import/olympe.dm/datamodel/05_permission_schema.newRel.json +1 -1
  14. package/import/olympe.dm/datamodel/05_permission_schema.updateInst.json +1 -1
  15. package/import/olympe.dm/datamodel/06_structure.newInst.json +1 -1
  16. package/import/olympe.dm/datamodel/06_structure.newRel.json +1 -1
  17. package/import/olympe.sc/datamodel/00_primordial.newInst.json +1 -1
  18. package/import/olympe.sc/datamodel/00_primordial.newRel.json +1 -1
  19. package/import/olympe.sc/datamodel/01_language.newInst.json +1 -1
  20. package/import/olympe.sc/datamodel/01_language.newRel.json +1 -1
  21. package/import/olympe.sc/datamodel/02_bricks.newInst.json +1 -1
  22. package/import/olympe.sc/datamodel/02_bricks.newRel.json +1 -1
  23. package/index.js +765 -832
  24. package/package.json +7 -10
  25. package/types/base.d.ts +22 -2
  26. package/types/cloud.d.ts +478 -50
  27. package/types/runtime.d.ts +6 -6
  28. package/types/utils.d.ts +47 -3
package/package.json CHANGED
@@ -1,19 +1,16 @@
1
1
  {
2
2
  "name": "@olympeio/runtime-node",
3
- "version": "9.3.0",
3
+ "version": "9.4.0",
4
4
  "description": "Olympe Node Runtime Environment",
5
5
  "types": "types/index.d.ts",
6
6
  "dependencies": {
7
- "ws": "~8.2.3",
8
- "bufferutil": "~4.0.5",
9
- "utf-8-validate": "~5.0.7",
10
- "cross-blob": "~2.0.0",
7
+ "ws": "~8.11.0",
8
+ "bufferutil": "~4.0.7",
9
+ "utf-8-validate": "~5.0.10",
11
10
  "lowdb": "~1.0.0",
12
- "rxjs": "7.5.4",
13
- "knex": "1.0.3",
14
- "pg": "8.7.3",
15
- "fastify": "~3.27.0",
16
- "fastify-cors": "~6.0.2"
11
+ "rxjs": "7.8.0",
12
+ "fastify": "~3.29.4",
13
+ "@fastify/cors": "~7.0.0"
17
14
  },
18
15
  "dcInitConfig": "import/dcInitConfig.json",
19
16
  "author": "Olympe S.A. <dev@olympe.ch>",
package/types/base.d.ts CHANGED
@@ -1,6 +1,6 @@
1
1
  // @ts-ignore
2
2
  import Observable from 'rxjs';
3
- import {PropertyModel, Query, QueryResult, QuerySingle} from "./cloud";
3
+ import {PropertyModel, Query, QueryResult, QuerySingle, Source} from "./cloud";
4
4
 
5
5
  // **********************************
6
6
  // Primitives
@@ -101,6 +101,11 @@ export abstract class Context {
101
101
  * @param id the id of the callback to unregister
102
102
  */
103
103
  offClear(id: string): void;
104
+
105
+ /**
106
+ * Whether the context is destroyed.
107
+ */
108
+ isDestroyed(): boolean;
104
109
  }
105
110
 
106
111
  /**
@@ -155,6 +160,16 @@ export abstract class CloudObject implements HasTag {
155
160
  * @return `CloudObject` specified by the tag
156
161
  */
157
162
  static get<T extends CloudObject>(tag: Tag): T;
163
+
164
+ /**
165
+ * Checks whether a `CloudObject` exists or not.
166
+ *
167
+ * @static
168
+ * @param tag tag of the `CloudObject`
169
+ * @return `true` if `tag` is valid and references a CloudObject.
170
+ */
171
+ static exists(tag: Tag): boolean;
172
+
158
173
  /**
159
174
  * Create an instance of the specified data type (or `model`)
160
175
  * in the local datacloud (not persisted) with the specified property values.
@@ -166,7 +181,7 @@ export abstract class CloudObject implements HasTag {
166
181
  * @param source
167
182
  * @return newly created `CloudObject`
168
183
  */
169
- static createWith<T>(this: Class<T>, properties: Map<Tag, any>, model?: Tag, source?: string): T;
184
+ static createWith<T>(this: Class<T>, properties: Map<Tag, any>, model?: Tag, source?: Source): T;
170
185
 
171
186
  /**
172
187
  * Get this `CloudObject` class as a `CloudObject` instance.
@@ -204,6 +219,11 @@ export abstract class CloudObject implements HasTag {
204
219
  */
205
220
  getModel(): CloudObject;
206
221
 
222
+ /**
223
+ * Return the source id that owns this cloud object.
224
+ */
225
+ getSource(): Source;
226
+
207
227
  /**
208
228
  * Create and return a query starting from this instance
209
229
  *