@olympeio/runtime-node 9.4.0 → 9.4.2
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/index.js +753 -747
- package/package.json +2 -2
- package/types/cloud.d.ts +8 -8
- package/types/utils.d.ts +39 -2
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@olympeio/runtime-node",
|
|
3
|
-
"version": "9.4.
|
|
3
|
+
"version": "9.4.2",
|
|
4
4
|
"description": "Olympe Node Runtime Environment",
|
|
5
5
|
"types": "types/index.d.ts",
|
|
6
6
|
"dependencies": {
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"bufferutil": "~4.0.7",
|
|
9
9
|
"utf-8-validate": "~5.0.10",
|
|
10
10
|
"lowdb": "~1.0.0",
|
|
11
|
-
"rxjs": "7.8.
|
|
11
|
+
"rxjs": "7.8.1",
|
|
12
12
|
"fastify": "~3.29.4",
|
|
13
13
|
"@fastify/cors": "~7.0.0"
|
|
14
14
|
},
|
package/types/cloud.d.ts
CHANGED
|
@@ -1013,13 +1013,13 @@ export class Query<T extends CloudObject, R> {
|
|
|
1013
1013
|
*
|
|
1014
1014
|
* Example:
|
|
1015
1015
|
* const people = [
|
|
1016
|
-
* { name: "Alice", children: ["Bob", "Carol"], siblings: ["David"] },
|
|
1017
|
-
* { name: "Bob", children: ["Emily"], siblings: ["Alice", "Carol", "David"] },
|
|
1018
|
-
* { name: "Carol", children: ["Frank"], siblings: ["Alice", "Bob", "David"] },
|
|
1019
|
-
* { name: "David", children: ["Greg"], siblings: ["Alice", "Bob", "Carol"] },
|
|
1020
|
-
* { name: "Emily", children: [], siblings: [] },
|
|
1021
|
-
* { name: "Frank", children: [], siblings: [] },
|
|
1022
|
-
* { name: "Greg", children: [], siblings: [] }
|
|
1016
|
+
* \{ name: "Alice", children: ["Bob", "Carol"], siblings: ["David"] \},
|
|
1017
|
+
* \{ name: "Bob", children: ["Emily"], siblings: ["Alice", "Carol", "David"] \},
|
|
1018
|
+
* \{ name: "Carol", children: ["Frank"], siblings: ["Alice", "Bob", "David"] \},
|
|
1019
|
+
* \{ name: "David", children: ["Greg"], siblings: ["Alice", "Bob", "Carol"] \},
|
|
1020
|
+
* \{ name: "Emily", children: [], siblings: [] \},
|
|
1021
|
+
* \{ name: "Frank", children: [], siblings: [] \},
|
|
1022
|
+
* \{ name: "Greg", children: [], siblings: [] \}
|
|
1023
1023
|
* ];
|
|
1024
1024
|
*
|
|
1025
1025
|
* // Create a new query starting from Alice
|
|
@@ -1032,7 +1032,7 @@ export class Query<T extends CloudObject, R> {
|
|
|
1032
1032
|
* const aliceSiblingsQuery = aliceChildrenQuery.back().follow("siblings").andReturn();
|
|
1033
1033
|
*
|
|
1034
1034
|
* // Execute the query, the output is:
|
|
1035
|
-
* Output: [ { sibling: 'David', child: 'Bob' }, { sibling: 'David', child: 'Carol' } ]
|
|
1035
|
+
* Output: [ \{ sibling: 'David', child: 'Bob' \}, \{ sibling: 'David', child: 'Carol' \} ]
|
|
1036
1036
|
* @param times
|
|
1037
1037
|
* @return {!Query}
|
|
1038
1038
|
*/
|
package/types/utils.d.ts
CHANGED
|
@@ -78,6 +78,17 @@ export class ErrorFlow {
|
|
|
78
78
|
getCode(): number;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
+
/**
|
|
82
|
+
* Types of requests that can be received in a Service.
|
|
83
|
+
* This is used to know what method call on the request to answer the requester.
|
|
84
|
+
*/
|
|
85
|
+
export type ServiceRequestType = {
|
|
86
|
+
PUBLISH,
|
|
87
|
+
SEND,
|
|
88
|
+
GET,
|
|
89
|
+
SUBSCRIBE
|
|
90
|
+
};
|
|
91
|
+
|
|
81
92
|
/**
|
|
82
93
|
* A request consumed by a service.
|
|
83
94
|
*/
|
|
@@ -90,6 +101,13 @@ export class ServiceRequest {
|
|
|
90
101
|
*/
|
|
91
102
|
userTag(): Promise<string>;
|
|
92
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Return the type of this Service Request
|
|
106
|
+
*
|
|
107
|
+
* @return the type of this request.
|
|
108
|
+
*/
|
|
109
|
+
requestType(): ServiceRequestType;
|
|
110
|
+
|
|
93
111
|
/**
|
|
94
112
|
* Get the request body.
|
|
95
113
|
*
|
|
@@ -114,11 +132,13 @@ export class ServiceRequest {
|
|
|
114
132
|
|
|
115
133
|
/**
|
|
116
134
|
* Send the topic where the requester should listen to get notifications. Used for OBSERVE requests.
|
|
135
|
+
* The string returned by the Promise is the id of that subscription. It can be used in parallel with
|
|
136
|
+
* the {@apilink Service.setUnsubscriptionHandler} method of the service to execute instructions when a subscription is removed.
|
|
117
137
|
*
|
|
118
138
|
* @param topic the topic where the client should
|
|
119
|
-
* @return a Promise that completes once the
|
|
139
|
+
* @return a Promise that completes once the consumer has started to the listen to notifications. The
|
|
120
140
|
*/
|
|
121
|
-
notifyOn(topic: string): Promise<
|
|
141
|
+
notifyOn(topic: string): Promise<string>;
|
|
122
142
|
|
|
123
143
|
/**
|
|
124
144
|
* Reply to the request with and error.
|
|
@@ -162,6 +182,16 @@ export class Service {
|
|
|
162
182
|
*/
|
|
163
183
|
listen(): Observable<ServiceRequest>;
|
|
164
184
|
|
|
185
|
+
/**
|
|
186
|
+
* Set a function to be executed each time a subscription to that service is closed.
|
|
187
|
+
* The function receives the subscription id that has been closed.
|
|
188
|
+
* The subscription id is the one that has been set and returned by the {@apilink ServiceRequest.notifyOn} method.
|
|
189
|
+
*
|
|
190
|
+
* @param handler the handler function to be executed when a subscription is closed.
|
|
191
|
+
* @return this Service instance.
|
|
192
|
+
*/
|
|
193
|
+
setUnsubscriptionHandler(handler: (subId: string) => void): this
|
|
194
|
+
|
|
165
195
|
/**
|
|
166
196
|
* Stop the service.
|
|
167
197
|
*/
|
|
@@ -266,6 +296,13 @@ export class Auth {
|
|
|
266
296
|
*/
|
|
267
297
|
static getIDPToken(): string;
|
|
268
298
|
|
|
299
|
+
/**
|
|
300
|
+
* Refresh the expiration time for the current authentication token
|
|
301
|
+
*
|
|
302
|
+
* @return Promise success when the refresh is done
|
|
303
|
+
*/
|
|
304
|
+
static refreshToken(): Promise<void>;
|
|
305
|
+
|
|
269
306
|
/**
|
|
270
307
|
* Returns an `Observable` that is updated each time the user tag changes.
|
|
271
308
|
* @param context The brick context
|