@jsm-mit/tigi-sharded-package 0.5.0 → 0.5.1
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/declarations/coordinator/coordinator.did +111 -21
- package/declarations/coordinator/coordinator.did.d.ts +181 -20
- package/declarations/coordinator/coordinator.did.js +76 -20
- package/declarations/core/core.did +107 -44
- package/declarations/core/core.did.d.ts +98 -42
- package/declarations/core/core.did.js +86 -41
- package/declarations/tigi-simulator/tigi-simulator.did +16 -9
- package/declarations/tigi-simulator/tigi-simulator.did.d.ts +21 -9
- package/declarations/tigi-simulator/tigi-simulator.did.js +21 -15
- package/package.json +3 -3
|
@@ -206,9 +206,10 @@ type RequestClosed = record {
|
|
|
206
206
|
driverKey : text;
|
|
207
207
|
reason : CloseReason;
|
|
208
208
|
};
|
|
209
|
-
type Result = variant { Ok :
|
|
210
|
-
type Result_1 = variant { Ok; Err : SimulatorError };
|
|
211
|
-
type Result_2 = variant { Ok
|
|
209
|
+
type Result = variant { Ok : opt SpawnPlace; Err : SimulatorError };
|
|
210
|
+
type Result_1 = variant { Ok : vec RouteTaskView; Err : SimulatorError };
|
|
211
|
+
type Result_2 = variant { Ok; Err : SimulatorError };
|
|
212
|
+
type Result_3 = variant { Ok : SpawnResult; Err : SimulatorError };
|
|
212
213
|
// `variant { ok : RideView; err : ProtocolError }`.
|
|
213
214
|
type RideAnswer = variant { ok : RideView; err : ProtocolError };
|
|
214
215
|
type RideOrder = record {
|
|
@@ -296,6 +297,8 @@ type SpawnArgs = record {
|
|
|
296
297
|
// None = 12.
|
|
297
298
|
count : opt nat8;
|
|
298
299
|
};
|
|
300
|
+
// S-N15: the centre of the last `spawnDrivers` and its time.
|
|
301
|
+
type SpawnPlace = record { center : Geo; atNs : nat64 };
|
|
299
302
|
type SpawnResult = record {
|
|
300
303
|
// Why some were not registered.
|
|
301
304
|
problems : vec text;
|
|
@@ -312,12 +315,16 @@ type SpeedUpArgs = record {
|
|
|
312
315
|
service : (InitArgs) -> {
|
|
313
316
|
// S-14 (KK-33): the rider cancels before `inProgress`, once.
|
|
314
317
|
cancelRide : (RideRef) -> (ProtocolAnswer);
|
|
318
|
+
// S-N15: where testers last asked for drivers — the router moves the automat driver
|
|
319
|
+
// canister near it (TIGI-DRIVER-MODES). None until the first search after an install or
|
|
320
|
+
// an upgrade.
|
|
321
|
+
getLastSpawn : () -> (Result) query;
|
|
315
322
|
getLicence : (RideRef) -> (LicenceAnswer) query;
|
|
316
323
|
getRide : (RideRef) -> (RideAnswer) query;
|
|
317
324
|
// S-N14 (P-19): the line of the ride for its rider, while the ride is active.
|
|
318
325
|
getRideRoute : (RideRef) -> (RouteAnswer) query;
|
|
319
|
-
// S-N13: the quote requests that wait for a route (at most
|
|
320
|
-
getRouteTasks : () -> (
|
|
326
|
+
// S-N13: the quote requests that wait for a route (at most 10 s each), the oldest first.
|
|
327
|
+
getRouteTasks : () -> (Result_1) query;
|
|
321
328
|
getStatus : () -> (SimulatorStatus) query;
|
|
322
329
|
http_request : (HttpRequest) -> (HttpResponse) query;
|
|
323
330
|
protocolVersion : () -> (nat32) query;
|
|
@@ -330,13 +337,13 @@ service : (InitArgs) -> {
|
|
|
330
337
|
rideOrder : (RideOrder) -> (ProtocolAnswer);
|
|
331
338
|
// S-N13: the core only (an admin's `setSimulatorRouter`): the one principal that routes the
|
|
332
339
|
// virtual drivers' quotes, like a driver's front; none = the straight line again.
|
|
333
|
-
setRouter : (SetRouterArgs) -> (
|
|
340
|
+
setRouter : (SetRouterArgs) -> (Result_2);
|
|
334
341
|
// S-15: ×10 for one request (`requestId`), not the whole canister.
|
|
335
|
-
setSpeedUp : (SpeedUpArgs) -> (
|
|
342
|
+
setSpeedUp : (SpeedUpArgs) -> (Result_2);
|
|
336
343
|
// S-2, S-3: virtual drivers around a point, each registered in the worker of its cell
|
|
337
344
|
// with `validUntilNs` (30 min) instead of a pulse.
|
|
338
|
-
spawnDrivers : (SpawnArgs) -> (
|
|
345
|
+
spawnDrivers : (SpawnArgs) -> (Result_3);
|
|
339
346
|
// S-N13: the router's route for one virtual driver — metres, seconds, the line. The quote
|
|
340
347
|
// goes with it at its moment (S-8), or at once when that moment has passed.
|
|
341
|
-
submitRoute : (SimRouteResult) -> (
|
|
348
|
+
submitRoute : (SimRouteResult) -> (Result_2);
|
|
342
349
|
}
|
|
@@ -288,11 +288,13 @@ export interface RequestClosed {
|
|
|
288
288
|
'driverKey' : string,
|
|
289
289
|
'reason' : CloseReason,
|
|
290
290
|
}
|
|
291
|
-
export type Result = { 'Ok' :
|
|
291
|
+
export type Result = { 'Ok' : [] | [SpawnPlace] } |
|
|
292
292
|
{ 'Err' : SimulatorError };
|
|
293
|
-
export type Result_1 = { 'Ok' :
|
|
293
|
+
export type Result_1 = { 'Ok' : Array<RouteTaskView> } |
|
|
294
294
|
{ 'Err' : SimulatorError };
|
|
295
|
-
export type Result_2 = { 'Ok' :
|
|
295
|
+
export type Result_2 = { 'Ok' : null } |
|
|
296
|
+
{ 'Err' : SimulatorError };
|
|
297
|
+
export type Result_3 = { 'Ok' : SpawnResult } |
|
|
296
298
|
{ 'Err' : SimulatorError };
|
|
297
299
|
/**
|
|
298
300
|
* `variant { ok : RideView; err : ProtocolError }`.
|
|
@@ -409,6 +411,10 @@ export interface SpawnArgs {
|
|
|
409
411
|
*/
|
|
410
412
|
'count' : [] | [number],
|
|
411
413
|
}
|
|
414
|
+
/**
|
|
415
|
+
* S-N15: the centre of the last `spawnDrivers` and its time.
|
|
416
|
+
*/
|
|
417
|
+
export interface SpawnPlace { 'center' : Geo, 'atNs' : bigint }
|
|
412
418
|
export interface SpawnResult {
|
|
413
419
|
/**
|
|
414
420
|
* Why some were not registered.
|
|
@@ -433,6 +439,12 @@ export interface _SERVICE {
|
|
|
433
439
|
* S-14 (KK-33): the rider cancels before `inProgress`, once.
|
|
434
440
|
*/
|
|
435
441
|
'cancelRide' : ActorMethod<[RideRef], ProtocolAnswer>,
|
|
442
|
+
/**
|
|
443
|
+
* S-N15: where testers last asked for drivers — the router moves the automat driver
|
|
444
|
+
* canister near it (TIGI-DRIVER-MODES). None until the first search after an install or
|
|
445
|
+
* an upgrade.
|
|
446
|
+
*/
|
|
447
|
+
'getLastSpawn' : ActorMethod<[], Result>,
|
|
436
448
|
'getLicence' : ActorMethod<[RideRef], LicenceAnswer>,
|
|
437
449
|
'getRide' : ActorMethod<[RideRef], RideAnswer>,
|
|
438
450
|
/**
|
|
@@ -440,9 +452,9 @@ export interface _SERVICE {
|
|
|
440
452
|
*/
|
|
441
453
|
'getRideRoute' : ActorMethod<[RideRef], RouteAnswer>,
|
|
442
454
|
/**
|
|
443
|
-
* S-N13: the quote requests that wait for a route (at most
|
|
455
|
+
* S-N13: the quote requests that wait for a route (at most 10 s each), the oldest first.
|
|
444
456
|
*/
|
|
445
|
-
'getRouteTasks' : ActorMethod<[],
|
|
457
|
+
'getRouteTasks' : ActorMethod<[], Result_1>,
|
|
446
458
|
'getStatus' : ActorMethod<[], SimulatorStatus>,
|
|
447
459
|
'http_request' : ActorMethod<[HttpRequest], HttpResponse>,
|
|
448
460
|
'protocolVersion' : ActorMethod<[], number>,
|
|
@@ -463,21 +475,21 @@ export interface _SERVICE {
|
|
|
463
475
|
* S-N13: the core only (an admin's `setSimulatorRouter`): the one principal that routes the
|
|
464
476
|
* virtual drivers' quotes, like a driver's front; none = the straight line again.
|
|
465
477
|
*/
|
|
466
|
-
'setRouter' : ActorMethod<[SetRouterArgs],
|
|
478
|
+
'setRouter' : ActorMethod<[SetRouterArgs], Result_2>,
|
|
467
479
|
/**
|
|
468
480
|
* S-15: ×10 for one request (`requestId`), not the whole canister.
|
|
469
481
|
*/
|
|
470
|
-
'setSpeedUp' : ActorMethod<[SpeedUpArgs],
|
|
482
|
+
'setSpeedUp' : ActorMethod<[SpeedUpArgs], Result_2>,
|
|
471
483
|
/**
|
|
472
484
|
* S-2, S-3: virtual drivers around a point, each registered in the worker of its cell
|
|
473
485
|
* with `validUntilNs` (30 min) instead of a pulse.
|
|
474
486
|
*/
|
|
475
|
-
'spawnDrivers' : ActorMethod<[SpawnArgs],
|
|
487
|
+
'spawnDrivers' : ActorMethod<[SpawnArgs], Result_3>,
|
|
476
488
|
/**
|
|
477
489
|
* S-N13: the router's route for one virtual driver — metres, seconds, the line. The quote
|
|
478
490
|
* goes with it at its moment (S-8), or at once when that moment has passed.
|
|
479
491
|
*/
|
|
480
|
-
'submitRoute' : ActorMethod<[SimRouteResult],
|
|
492
|
+
'submitRoute' : ActorMethod<[SimRouteResult], Result_2>,
|
|
481
493
|
}
|
|
482
494
|
export declare const idlFactory: IDL.InterfaceFactory;
|
|
483
495
|
export declare const init: (args: { IDL: typeof IDL }) => IDL.Type[];
|
|
@@ -28,6 +28,18 @@ export const idlFactory = ({ IDL }) => {
|
|
|
28
28
|
'ok' : IDL.Null,
|
|
29
29
|
'err' : ProtocolError,
|
|
30
30
|
});
|
|
31
|
+
const Geo = IDL.Record({ 'lat' : IDL.Float64, 'lng' : IDL.Float64 });
|
|
32
|
+
const SpawnPlace = IDL.Record({ 'center' : Geo, 'atNs' : IDL.Nat64 });
|
|
33
|
+
const SimulatorError = IDL.Variant({
|
|
34
|
+
'RemoteCanisterError' : IDL.Text,
|
|
35
|
+
'NotFound' : IDL.Null,
|
|
36
|
+
'NotAuthorized' : IDL.Text,
|
|
37
|
+
'InvalidData' : IDL.Text,
|
|
38
|
+
});
|
|
39
|
+
const Result = IDL.Variant({
|
|
40
|
+
'Ok' : IDL.Opt(SpawnPlace),
|
|
41
|
+
'Err' : SimulatorError,
|
|
42
|
+
});
|
|
31
43
|
const Licence = IDL.Record({
|
|
32
44
|
'mimeType' : IDL.Text,
|
|
33
45
|
'image' : IDL.Vec(IDL.Nat8),
|
|
@@ -59,7 +71,6 @@ export const idlFactory = ({ IDL }) => {
|
|
|
59
71
|
'carPhotoCount' : IDL.Nat8,
|
|
60
72
|
'hasLicencePhoto' : IDL.Bool,
|
|
61
73
|
});
|
|
62
|
-
const Geo = IDL.Record({ 'lat' : IDL.Float64, 'lng' : IDL.Float64 });
|
|
63
74
|
const RideView = IDL.Record({
|
|
64
75
|
'status' : RideStatus,
|
|
65
76
|
'requestId' : IDL.Text,
|
|
@@ -80,13 +91,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
80
91
|
'pickup' : Geo,
|
|
81
92
|
'driverKey' : IDL.Text,
|
|
82
93
|
});
|
|
83
|
-
const
|
|
84
|
-
'RemoteCanisterError' : IDL.Text,
|
|
85
|
-
'NotFound' : IDL.Null,
|
|
86
|
-
'NotAuthorized' : IDL.Text,
|
|
87
|
-
'InvalidData' : IDL.Text,
|
|
88
|
-
});
|
|
89
|
-
const Result = IDL.Variant({
|
|
94
|
+
const Result_1 = IDL.Variant({
|
|
90
95
|
'Ok' : IDL.Vec(RouteTaskView),
|
|
91
96
|
'Err' : SimulatorError,
|
|
92
97
|
});
|
|
@@ -150,7 +155,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
150
155
|
'rider' : IDL.Principal,
|
|
151
156
|
});
|
|
152
157
|
const SetRouterArgs = IDL.Record({ 'router' : IDL.Opt(IDL.Principal) });
|
|
153
|
-
const
|
|
158
|
+
const Result_2 = IDL.Variant({ 'Ok' : IDL.Null, 'Err' : SimulatorError });
|
|
154
159
|
const SpeedUpArgs = IDL.Record({
|
|
155
160
|
'requestId' : IDL.Text,
|
|
156
161
|
'factor' : IDL.Nat8,
|
|
@@ -162,7 +167,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
162
167
|
'registered' : IDL.Nat32,
|
|
163
168
|
'validUntilNs' : IDL.Nat64,
|
|
164
169
|
});
|
|
165
|
-
const
|
|
170
|
+
const Result_3 = IDL.Variant({ 'Ok' : SpawnResult, 'Err' : SimulatorError });
|
|
166
171
|
const SimRouteResult = IDL.Record({
|
|
167
172
|
'requestId' : IDL.Text,
|
|
168
173
|
'rideMeters' : IDL.Nat32,
|
|
@@ -174,20 +179,21 @@ export const idlFactory = ({ IDL }) => {
|
|
|
174
179
|
});
|
|
175
180
|
return IDL.Service({
|
|
176
181
|
'cancelRide' : IDL.Func([RideRef], [ProtocolAnswer], []),
|
|
182
|
+
'getLastSpawn' : IDL.Func([], [Result], ['query']),
|
|
177
183
|
'getLicence' : IDL.Func([RideRef], [LicenceAnswer], ['query']),
|
|
178
184
|
'getRide' : IDL.Func([RideRef], [RideAnswer], ['query']),
|
|
179
185
|
'getRideRoute' : IDL.Func([RideRef], [RouteAnswer], ['query']),
|
|
180
|
-
'getRouteTasks' : IDL.Func([], [
|
|
186
|
+
'getRouteTasks' : IDL.Func([], [Result_1], ['query']),
|
|
181
187
|
'getStatus' : IDL.Func([], [SimulatorStatus], ['query']),
|
|
182
188
|
'http_request' : IDL.Func([HttpRequest], [HttpResponse], ['query']),
|
|
183
189
|
'protocolVersion' : IDL.Func([], [IDL.Nat32], ['query']),
|
|
184
190
|
'quoteRequest' : IDL.Func([QuoteRequest], [ProtocolAnswer], []),
|
|
185
191
|
'requestClosed' : IDL.Func([RequestClosed], [], []),
|
|
186
192
|
'rideOrder' : IDL.Func([RideOrder], [ProtocolAnswer], []),
|
|
187
|
-
'setRouter' : IDL.Func([SetRouterArgs], [
|
|
188
|
-
'setSpeedUp' : IDL.Func([SpeedUpArgs], [
|
|
189
|
-
'spawnDrivers' : IDL.Func([SpawnArgs], [
|
|
190
|
-
'submitRoute' : IDL.Func([SimRouteResult], [
|
|
193
|
+
'setRouter' : IDL.Func([SetRouterArgs], [Result_2], []),
|
|
194
|
+
'setSpeedUp' : IDL.Func([SpeedUpArgs], [Result_2], []),
|
|
195
|
+
'spawnDrivers' : IDL.Func([SpawnArgs], [Result_3], []),
|
|
196
|
+
'submitRoute' : IDL.Func([SimRouteResult], [Result_2], []),
|
|
191
197
|
});
|
|
192
198
|
};
|
|
193
199
|
export const init = ({ IDL }) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsm-mit/tigi-sharded-package",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.1",
|
|
4
4
|
"description": "The one package of the Tigi network group: takes the coordinator's id and hides the coordinator, the core and the workers — for a consumer the group is one canister; plus the rider's few driver-canister endpoints (U-14).",
|
|
5
5
|
"homepage": "https://github.com/JSM-Tigi/tigi-sharded/tree/master/package#readme",
|
|
6
6
|
"repository": {
|
|
@@ -59,11 +59,11 @@
|
|
|
59
59
|
"tigiSharded": {
|
|
60
60
|
"repo": "tigi-sharded",
|
|
61
61
|
"repoUrl": "https://github.com/JSM-Tigi/tigi-sharded",
|
|
62
|
-
"commit": "
|
|
62
|
+
"commit": "fefe2d99f4164fb2a2c96c58770e8e1f19676396"
|
|
63
63
|
},
|
|
64
64
|
"tigiDriverRust": {
|
|
65
65
|
"repo": "tigi-driver-rust",
|
|
66
66
|
"repoUrl": "https://github.com/JSM-Tigi/tigi-driver-rust",
|
|
67
|
-
"commit": "
|
|
67
|
+
"commit": "f0450d338cc446941c93753979ac63ac1ffc909b"
|
|
68
68
|
}
|
|
69
69
|
}
|