@jsm-mit/tigi-sharded-package 0.17.0 → 0.18.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/declarations/tigi-driver/tigi-driver.did +15 -1
- package/declarations/tigi-driver/tigi-driver.did.d.ts +28 -0
- package/declarations/tigi-driver/tigi-driver.did.js +24 -0
- package/declarations/tigi-simulator/tigi-simulator.did +25 -2
- package/declarations/tigi-simulator/tigi-simulator.did.d.ts +33 -4
- package/declarations/tigi-simulator/tigi-simulator.did.js +24 -0
- package/declarations/worker/worker.did +39 -2
- package/declarations/worker/worker.did.d.ts +34 -2
- package/declarations/worker/worker.did.js +36 -2
- package/dist/actors/scheduled-ride.js +2 -2
- package/dist/interfaces.d.ts +11 -0
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/mappers.d.ts +11 -3
- package/dist/mappers.d.ts.map +1 -1
- package/dist/mappers.js +17 -2
- package/package.json +3 -3
|
@@ -33,15 +33,29 @@ type CarrierKind = variant {
|
|
|
33
33
|
other : text;
|
|
34
34
|
};
|
|
35
35
|
|
|
36
|
+
// D-42 (DRIVER-FLEET): the colour of a car as a code; the fronts translate it.
|
|
37
|
+
type CarColour = variant {
|
|
38
|
+
white; black; silver; grey; blue; navy; red; maroon; green; yellow; orange; brown;
|
|
39
|
+
beige; gold; purple; other;
|
|
40
|
+
};
|
|
41
|
+
|
|
42
|
+
// D-42: the car apart — the offer shows each field (WO-N13).
|
|
43
|
+
type CarInfo = record {
|
|
44
|
+
name : text; // make and model, ≤ 120 characters
|
|
45
|
+
plate : text; // ≤ 16 characters
|
|
46
|
+
colour : opt CarColour;
|
|
47
|
+
};
|
|
48
|
+
|
|
36
49
|
// What the network shows of a driver in an offer (public). Photos are served by the
|
|
37
50
|
// driver canister itself over HTTP: `/photos/<driverKey>/<index>` (U-11).
|
|
38
51
|
type DriverCard = record {
|
|
39
52
|
driverKey : DriverKey;
|
|
40
53
|
name : text;
|
|
41
54
|
carrierKind : CarrierKind;
|
|
42
|
-
carDescription : text; // e.g. "Toyota Corolla
|
|
55
|
+
carDescription : text; // e.g. "Toyota Corolla · WX 12345" (also for fronts without `car`)
|
|
43
56
|
carPhotoCount : nat8; // ≤ 6
|
|
44
57
|
hasLicencePhoto : bool;
|
|
58
|
+
car : opt CarInfo; // D-42; none from a driver canister before the fleet
|
|
45
59
|
};
|
|
46
60
|
|
|
47
61
|
type ProtocolError = variant {
|
|
@@ -6,6 +6,33 @@ import type { IDL } from '@icp-sdk/core/candid';
|
|
|
6
6
|
* P-22: a booking of a ride at a chosen time (the driver's "Jadę" / giving it up).
|
|
7
7
|
*/
|
|
8
8
|
export interface BookingRef { 'requestId' : RequestId, 'driverKey' : DriverKey }
|
|
9
|
+
/**
|
|
10
|
+
* D-42 (DRIVER-FLEET): the colour of a car as a code; the fronts translate it.
|
|
11
|
+
*/
|
|
12
|
+
export type CarColour = { 'red' : null } |
|
|
13
|
+
{ 'other' : null } |
|
|
14
|
+
{ 'blue' : null } |
|
|
15
|
+
{ 'gold' : null } |
|
|
16
|
+
{ 'grey' : null } |
|
|
17
|
+
{ 'orange' : null } |
|
|
18
|
+
{ 'navy' : null } |
|
|
19
|
+
{ 'purple' : null } |
|
|
20
|
+
{ 'green' : null } |
|
|
21
|
+
{ 'beige' : null } |
|
|
22
|
+
{ 'black' : null } |
|
|
23
|
+
{ 'silver' : null } |
|
|
24
|
+
{ 'brown' : null } |
|
|
25
|
+
{ 'maroon' : null } |
|
|
26
|
+
{ 'white' : null } |
|
|
27
|
+
{ 'yellow' : null };
|
|
28
|
+
/**
|
|
29
|
+
* D-42: the car apart — the offer shows each field (WO-N13).
|
|
30
|
+
*/
|
|
31
|
+
export interface CarInfo {
|
|
32
|
+
'name' : string,
|
|
33
|
+
'plate' : string,
|
|
34
|
+
'colour' : [] | [CarColour],
|
|
35
|
+
}
|
|
9
36
|
export interface CardPaymentArgs {
|
|
10
37
|
'returnUrl' : string,
|
|
11
38
|
'requestId' : RequestId,
|
|
@@ -38,6 +65,7 @@ export type CloseReason = { 'offerRejected' : null } |
|
|
|
38
65
|
* driver canister itself over HTTP: `/photos/<driverKey>/<index>` (U-11).
|
|
39
66
|
*/
|
|
40
67
|
export interface DriverCard {
|
|
68
|
+
'car' : [] | [CarInfo],
|
|
41
69
|
'carDescription' : string,
|
|
42
70
|
'name' : string,
|
|
43
71
|
'carrierKind' : CarrierKind,
|
|
@@ -42,6 +42,29 @@ export const idlFactory = ({ IDL }) => {
|
|
|
42
42
|
'cancelledByDriver' : IDL.Record({ 'reason' : IDL.Text }),
|
|
43
43
|
'inProgress' : IDL.Null,
|
|
44
44
|
});
|
|
45
|
+
const CarColour = IDL.Variant({
|
|
46
|
+
'red' : IDL.Null,
|
|
47
|
+
'other' : IDL.Null,
|
|
48
|
+
'blue' : IDL.Null,
|
|
49
|
+
'gold' : IDL.Null,
|
|
50
|
+
'grey' : IDL.Null,
|
|
51
|
+
'orange' : IDL.Null,
|
|
52
|
+
'navy' : IDL.Null,
|
|
53
|
+
'purple' : IDL.Null,
|
|
54
|
+
'green' : IDL.Null,
|
|
55
|
+
'beige' : IDL.Null,
|
|
56
|
+
'black' : IDL.Null,
|
|
57
|
+
'silver' : IDL.Null,
|
|
58
|
+
'brown' : IDL.Null,
|
|
59
|
+
'maroon' : IDL.Null,
|
|
60
|
+
'white' : IDL.Null,
|
|
61
|
+
'yellow' : IDL.Null,
|
|
62
|
+
});
|
|
63
|
+
const CarInfo = IDL.Record({
|
|
64
|
+
'name' : IDL.Text,
|
|
65
|
+
'plate' : IDL.Text,
|
|
66
|
+
'colour' : IDL.Opt(CarColour),
|
|
67
|
+
});
|
|
45
68
|
const CarrierKind = IDL.Variant({
|
|
46
69
|
'other' : IDL.Text,
|
|
47
70
|
'taxi' : IDL.Null,
|
|
@@ -49,6 +72,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
49
72
|
'privateDriver' : IDL.Null,
|
|
50
73
|
});
|
|
51
74
|
const DriverCard = IDL.Record({
|
|
75
|
+
'car' : IDL.Opt(CarInfo),
|
|
52
76
|
'carDescription' : IDL.Text,
|
|
53
77
|
'name' : IDL.Text,
|
|
54
78
|
'carrierKind' : CarrierKind,
|
|
@@ -1,4 +1,27 @@
|
|
|
1
1
|
type CancelledByDriverStatus = record { reason : text };
|
|
2
|
+
// What the network shows of a driver in an offer (public). Photos are served by the driver
|
|
3
|
+
// canister itself over HTTP: `/photos/<driverKey>/<index>` (U-11).
|
|
4
|
+
// D-42 (DRIVER-FLEET): the colour of a car as a code; the fronts translate it.
|
|
5
|
+
type CarColour = variant {
|
|
6
|
+
red;
|
|
7
|
+
other;
|
|
8
|
+
blue;
|
|
9
|
+
gold;
|
|
10
|
+
grey;
|
|
11
|
+
orange;
|
|
12
|
+
navy;
|
|
13
|
+
purple;
|
|
14
|
+
green;
|
|
15
|
+
beige;
|
|
16
|
+
black;
|
|
17
|
+
silver;
|
|
18
|
+
brown;
|
|
19
|
+
maroon;
|
|
20
|
+
white;
|
|
21
|
+
yellow;
|
|
22
|
+
};
|
|
23
|
+
// D-42: the car apart — make and model, plate, colour (the offer shows each, WO-N13).
|
|
24
|
+
type CarInfo = record { name : text; plate : text; colour : opt CarColour };
|
|
2
25
|
// `variant { ok : CardPaymentView; err : ProtocolError }`.
|
|
3
26
|
type CardPaymentAnswer = variant { ok : CardPaymentView; err : ProtocolError };
|
|
4
27
|
// P-20: `startCardPayment` — the rider's front gives the page Stripe sends the rider back to.
|
|
@@ -43,9 +66,9 @@ type CloseReason = variant {
|
|
|
43
66
|
orderExpired;
|
|
44
67
|
};
|
|
45
68
|
type CompletedStatus = record { price : Money };
|
|
46
|
-
// What the network shows of a driver in an offer (public). Photos are served by the driver
|
|
47
|
-
// canister itself over HTTP: `/photos/<driverKey>/<index>` (U-11).
|
|
48
69
|
type DriverCard = record {
|
|
70
|
+
// D-42: the car apart; none before the fleet.
|
|
71
|
+
car : opt CarInfo;
|
|
49
72
|
carDescription : text;
|
|
50
73
|
name : text;
|
|
51
74
|
carrierKind : CarrierKind;
|
|
@@ -3,6 +3,35 @@ import type { ActorMethod } from '@icp-sdk/core/agent';
|
|
|
3
3
|
import type { IDL } from '@icp-sdk/core/candid';
|
|
4
4
|
|
|
5
5
|
export interface CancelledByDriverStatus { 'reason' : string }
|
|
6
|
+
/**
|
|
7
|
+
* What the network shows of a driver in an offer (public). Photos are served by the driver
|
|
8
|
+
* canister itself over HTTP: `/photos/<driverKey>/<index>` (U-11).
|
|
9
|
+
* D-42 (DRIVER-FLEET): the colour of a car as a code; the fronts translate it.
|
|
10
|
+
*/
|
|
11
|
+
export type CarColour = { 'red' : null } |
|
|
12
|
+
{ 'other' : null } |
|
|
13
|
+
{ 'blue' : null } |
|
|
14
|
+
{ 'gold' : null } |
|
|
15
|
+
{ 'grey' : null } |
|
|
16
|
+
{ 'orange' : null } |
|
|
17
|
+
{ 'navy' : null } |
|
|
18
|
+
{ 'purple' : null } |
|
|
19
|
+
{ 'green' : null } |
|
|
20
|
+
{ 'beige' : null } |
|
|
21
|
+
{ 'black' : null } |
|
|
22
|
+
{ 'silver' : null } |
|
|
23
|
+
{ 'brown' : null } |
|
|
24
|
+
{ 'maroon' : null } |
|
|
25
|
+
{ 'white' : null } |
|
|
26
|
+
{ 'yellow' : null };
|
|
27
|
+
/**
|
|
28
|
+
* D-42: the car apart — make and model, plate, colour (the offer shows each, WO-N13).
|
|
29
|
+
*/
|
|
30
|
+
export interface CarInfo {
|
|
31
|
+
'name' : string,
|
|
32
|
+
'plate' : string,
|
|
33
|
+
'colour' : [] | [CarColour],
|
|
34
|
+
}
|
|
6
35
|
/**
|
|
7
36
|
* `variant { ok : CardPaymentView; err : ProtocolError }`.
|
|
8
37
|
*/
|
|
@@ -82,11 +111,11 @@ export type CloseReason = {
|
|
|
82
111
|
'orderExpired' : null
|
|
83
112
|
};
|
|
84
113
|
export interface CompletedStatus { 'price' : Money }
|
|
85
|
-
/**
|
|
86
|
-
* What the network shows of a driver in an offer (public). Photos are served by the driver
|
|
87
|
-
* canister itself over HTTP: `/photos/<driverKey>/<index>` (U-11).
|
|
88
|
-
*/
|
|
89
114
|
export interface DriverCard {
|
|
115
|
+
/**
|
|
116
|
+
* D-42: the car apart; none before the fleet.
|
|
117
|
+
*/
|
|
118
|
+
'car' : [] | [CarInfo],
|
|
90
119
|
'carDescription' : string,
|
|
91
120
|
'name' : string,
|
|
92
121
|
'carrierKind' : CarrierKind,
|
|
@@ -74,6 +74,29 @@ export const idlFactory = ({ IDL }) => {
|
|
|
74
74
|
'cancelledByDriver' : CancelledByDriverStatus,
|
|
75
75
|
'inProgress' : IDL.Null,
|
|
76
76
|
});
|
|
77
|
+
const CarColour = IDL.Variant({
|
|
78
|
+
'red' : IDL.Null,
|
|
79
|
+
'other' : IDL.Null,
|
|
80
|
+
'blue' : IDL.Null,
|
|
81
|
+
'gold' : IDL.Null,
|
|
82
|
+
'grey' : IDL.Null,
|
|
83
|
+
'orange' : IDL.Null,
|
|
84
|
+
'navy' : IDL.Null,
|
|
85
|
+
'purple' : IDL.Null,
|
|
86
|
+
'green' : IDL.Null,
|
|
87
|
+
'beige' : IDL.Null,
|
|
88
|
+
'black' : IDL.Null,
|
|
89
|
+
'silver' : IDL.Null,
|
|
90
|
+
'brown' : IDL.Null,
|
|
91
|
+
'maroon' : IDL.Null,
|
|
92
|
+
'white' : IDL.Null,
|
|
93
|
+
'yellow' : IDL.Null,
|
|
94
|
+
});
|
|
95
|
+
const CarInfo = IDL.Record({
|
|
96
|
+
'name' : IDL.Text,
|
|
97
|
+
'plate' : IDL.Text,
|
|
98
|
+
'colour' : IDL.Opt(CarColour),
|
|
99
|
+
});
|
|
77
100
|
const CarrierKind = IDL.Variant({
|
|
78
101
|
'other' : IDL.Text,
|
|
79
102
|
'taxi' : IDL.Null,
|
|
@@ -81,6 +104,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
81
104
|
'privateDriver' : IDL.Null,
|
|
82
105
|
});
|
|
83
106
|
const DriverCard = IDL.Record({
|
|
107
|
+
'car' : IDL.Opt(CarInfo),
|
|
84
108
|
'carDescription' : IDL.Text,
|
|
85
109
|
'name' : IDL.Text,
|
|
86
110
|
'carrierKind' : CarrierKind,
|
|
@@ -132,6 +132,7 @@ type ScheduledStateView =
|
|
|
132
132
|
variant {
|
|
133
133
|
booked:
|
|
134
134
|
record {
|
|
135
|
+
car: opt CarInfo;
|
|
135
136
|
card: DriverCard;
|
|
136
137
|
driverCanister: principal;
|
|
137
138
|
driverKey: DriverKey;
|
|
@@ -292,7 +293,7 @@ type RequestId = text;
|
|
|
292
293
|
type RegisterDriver =
|
|
293
294
|
record {
|
|
294
295
|
available: bool;
|
|
295
|
-
card:
|
|
296
|
+
card: DriverCardIn;
|
|
296
297
|
cardVersion: nat32;
|
|
297
298
|
driverKey: DriverKey;
|
|
298
299
|
freeAtNs: opt nat64;
|
|
@@ -301,7 +302,7 @@ type RegisterDriver =
|
|
|
301
302
|
};
|
|
302
303
|
type RegisterBase =
|
|
303
304
|
record {
|
|
304
|
-
card:
|
|
305
|
+
card: DriverCardIn;
|
|
305
306
|
cardVersion: nat32;
|
|
306
307
|
driverKey: DriverKey;
|
|
307
308
|
geohash: Geohash;
|
|
@@ -364,6 +365,7 @@ type OrderAnswer =
|
|
|
364
365
|
};
|
|
365
366
|
type OfferView =
|
|
366
367
|
record {
|
|
368
|
+
car: opt CarInfo;
|
|
367
369
|
card: DriverCard;
|
|
368
370
|
driverCanister: principal;
|
|
369
371
|
driverKey: DriverKey;
|
|
@@ -460,6 +462,16 @@ type Error =
|
|
|
460
462
|
logsJson: text;
|
|
461
463
|
};
|
|
462
464
|
type DriverKey = text;
|
|
465
|
+
type DriverCardIn =
|
|
466
|
+
record {
|
|
467
|
+
car: opt CarInfo;
|
|
468
|
+
carDescription: text;
|
|
469
|
+
carPhotoCount: nat8;
|
|
470
|
+
carrierKind: CarrierKind;
|
|
471
|
+
driverKey: DriverKey;
|
|
472
|
+
hasLicencePhoto: bool;
|
|
473
|
+
name: text;
|
|
474
|
+
};
|
|
463
475
|
type DriverCard =
|
|
464
476
|
record {
|
|
465
477
|
carDescription: text;
|
|
@@ -553,6 +565,31 @@ type CarrierKind =
|
|
|
553
565
|
rideHailing;
|
|
554
566
|
taxi;
|
|
555
567
|
};
|
|
568
|
+
type CarInfo =
|
|
569
|
+
record {
|
|
570
|
+
colour: opt CarColour;
|
|
571
|
+
name: text;
|
|
572
|
+
plate: text;
|
|
573
|
+
};
|
|
574
|
+
type CarColour =
|
|
575
|
+
variant {
|
|
576
|
+
beige;
|
|
577
|
+
black;
|
|
578
|
+
blue;
|
|
579
|
+
brown;
|
|
580
|
+
gold;
|
|
581
|
+
green;
|
|
582
|
+
grey;
|
|
583
|
+
maroon;
|
|
584
|
+
navy;
|
|
585
|
+
orange;
|
|
586
|
+
other;
|
|
587
|
+
purple;
|
|
588
|
+
red;
|
|
589
|
+
silver;
|
|
590
|
+
white;
|
|
591
|
+
yellow;
|
|
592
|
+
};
|
|
556
593
|
type BookingRef =
|
|
557
594
|
record {
|
|
558
595
|
driverKey: DriverKey;
|
|
@@ -4,6 +4,27 @@ import type { IDL } from '@icp-sdk/core/candid';
|
|
|
4
4
|
|
|
5
5
|
export interface AreaMap { 'entries' : Array<PrefixEntry>, 'version' : bigint }
|
|
6
6
|
export interface BookingRef { 'requestId' : RequestId, 'driverKey' : DriverKey }
|
|
7
|
+
export type CarColour = { 'red' : null } |
|
|
8
|
+
{ 'other' : null } |
|
|
9
|
+
{ 'blue' : null } |
|
|
10
|
+
{ 'gold' : null } |
|
|
11
|
+
{ 'grey' : null } |
|
|
12
|
+
{ 'orange' : null } |
|
|
13
|
+
{ 'navy' : null } |
|
|
14
|
+
{ 'purple' : null } |
|
|
15
|
+
{ 'green' : null } |
|
|
16
|
+
{ 'beige' : null } |
|
|
17
|
+
{ 'black' : null } |
|
|
18
|
+
{ 'silver' : null } |
|
|
19
|
+
{ 'brown' : null } |
|
|
20
|
+
{ 'maroon' : null } |
|
|
21
|
+
{ 'white' : null } |
|
|
22
|
+
{ 'yellow' : null };
|
|
23
|
+
export interface CarInfo {
|
|
24
|
+
'name' : string,
|
|
25
|
+
'plate' : string,
|
|
26
|
+
'colour' : [] | [CarColour],
|
|
27
|
+
}
|
|
7
28
|
export type CarrierKind = { 'other' : string } |
|
|
8
29
|
{ 'taxi' : null } |
|
|
9
30
|
{ 'rideHailing' : null } |
|
|
@@ -75,6 +96,15 @@ export interface DriverCard {
|
|
|
75
96
|
'carPhotoCount' : number,
|
|
76
97
|
'hasLicencePhoto' : boolean,
|
|
77
98
|
}
|
|
99
|
+
export interface DriverCardIn {
|
|
100
|
+
'car' : [] | [CarInfo],
|
|
101
|
+
'carDescription' : string,
|
|
102
|
+
'name' : string,
|
|
103
|
+
'carrierKind' : CarrierKind,
|
|
104
|
+
'driverKey' : DriverKey,
|
|
105
|
+
'carPhotoCount' : number,
|
|
106
|
+
'hasLicencePhoto' : boolean,
|
|
107
|
+
}
|
|
78
108
|
export type DriverKey = string;
|
|
79
109
|
export interface Error { 'details' : ErrorDetails, 'logsJson' : string }
|
|
80
110
|
export type ErrorDetails = { 'InterCanisterConnectionError' : null } |
|
|
@@ -132,6 +162,7 @@ export interface OfferRef {
|
|
|
132
162
|
'driverCanister' : Principal,
|
|
133
163
|
}
|
|
134
164
|
export interface OfferView {
|
|
165
|
+
'car' : [] | [CarInfo],
|
|
135
166
|
'freeAtNs' : [] | [bigint],
|
|
136
167
|
'rideMeters' : number,
|
|
137
168
|
'driverRating' : [] | [number],
|
|
@@ -184,14 +215,14 @@ export interface QuoteDecline {
|
|
|
184
215
|
}
|
|
185
216
|
export interface RateDriverArgs { 'requestId' : RequestId, 'stars' : number }
|
|
186
217
|
export interface RegisterBase {
|
|
187
|
-
'card' :
|
|
218
|
+
'card' : DriverCardIn,
|
|
188
219
|
'cardVersion' : number,
|
|
189
220
|
'geohash' : Geohash,
|
|
190
221
|
'driverKey' : DriverKey,
|
|
191
222
|
}
|
|
192
223
|
export interface RegisterDriver {
|
|
193
224
|
'freeAtNs' : [] | [bigint],
|
|
194
|
-
'card' :
|
|
225
|
+
'card' : DriverCardIn,
|
|
195
226
|
'cardVersion' : number,
|
|
196
227
|
'geohash' : Geohash,
|
|
197
228
|
'available' : boolean,
|
|
@@ -292,6 +323,7 @@ export type ScheduledStateView = { 'rescue' : { 'reason' : RescueReason } } |
|
|
|
292
323
|
{ 'started' : { 'driverKey' : DriverKey, 'driverCanister' : Principal } } |
|
|
293
324
|
{
|
|
294
325
|
'booked' : {
|
|
326
|
+
'car' : [] | [CarInfo],
|
|
295
327
|
'driverRating' : [] | [number],
|
|
296
328
|
'card' : DriverCard,
|
|
297
329
|
'driverKey' : DriverKey,
|
|
@@ -160,6 +160,29 @@ export const idlFactory = ({ IDL }) => {
|
|
|
160
160
|
const Result_7 = IDL.Variant({ 'ok' : RouteLine, 'err' : Error });
|
|
161
161
|
const PrefixCount = IDL.Record({ 'load' : IDL.Nat, 'prefix' : IDL.Text });
|
|
162
162
|
const Result_6 = IDL.Variant({ 'ok' : IDL.Vec(PrefixCount), 'err' : Error });
|
|
163
|
+
const CarColour = IDL.Variant({
|
|
164
|
+
'red' : IDL.Null,
|
|
165
|
+
'other' : IDL.Null,
|
|
166
|
+
'blue' : IDL.Null,
|
|
167
|
+
'gold' : IDL.Null,
|
|
168
|
+
'grey' : IDL.Null,
|
|
169
|
+
'orange' : IDL.Null,
|
|
170
|
+
'navy' : IDL.Null,
|
|
171
|
+
'purple' : IDL.Null,
|
|
172
|
+
'green' : IDL.Null,
|
|
173
|
+
'beige' : IDL.Null,
|
|
174
|
+
'black' : IDL.Null,
|
|
175
|
+
'silver' : IDL.Null,
|
|
176
|
+
'brown' : IDL.Null,
|
|
177
|
+
'maroon' : IDL.Null,
|
|
178
|
+
'white' : IDL.Null,
|
|
179
|
+
'yellow' : IDL.Null,
|
|
180
|
+
});
|
|
181
|
+
const CarInfo = IDL.Record({
|
|
182
|
+
'name' : IDL.Text,
|
|
183
|
+
'plate' : IDL.Text,
|
|
184
|
+
'colour' : IDL.Opt(CarColour),
|
|
185
|
+
});
|
|
163
186
|
const CarrierKind = IDL.Variant({
|
|
164
187
|
'other' : IDL.Text,
|
|
165
188
|
'taxi' : IDL.Null,
|
|
@@ -177,6 +200,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
177
200
|
const Money = IDL.Record({ 'currency' : IDL.Text, 'amount' : IDL.Nat64 });
|
|
178
201
|
const Geo = IDL.Record({ 'lat' : IDL.Float64, 'lng' : IDL.Float64 });
|
|
179
202
|
const OfferView = IDL.Record({
|
|
203
|
+
'car' : IDL.Opt(CarInfo),
|
|
180
204
|
'freeAtNs' : IDL.Opt(IDL.Nat64),
|
|
181
205
|
'rideMeters' : IDL.Nat32,
|
|
182
206
|
'driverRating' : IDL.Opt(IDL.Nat16),
|
|
@@ -241,6 +265,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
241
265
|
'driverCanister' : IDL.Principal,
|
|
242
266
|
}),
|
|
243
267
|
'booked' : IDL.Record({
|
|
268
|
+
'car' : IDL.Opt(CarInfo),
|
|
244
269
|
'driverRating' : IDL.Opt(IDL.Nat16),
|
|
245
270
|
'card' : DriverCard,
|
|
246
271
|
'driverKey' : DriverKey,
|
|
@@ -306,16 +331,25 @@ export const idlFactory = ({ IDL }) => {
|
|
|
306
331
|
'stars' : IDL.Nat8,
|
|
307
332
|
'driverKey' : DriverKey,
|
|
308
333
|
});
|
|
334
|
+
const DriverCardIn = IDL.Record({
|
|
335
|
+
'car' : IDL.Opt(CarInfo),
|
|
336
|
+
'carDescription' : IDL.Text,
|
|
337
|
+
'name' : IDL.Text,
|
|
338
|
+
'carrierKind' : CarrierKind,
|
|
339
|
+
'driverKey' : DriverKey,
|
|
340
|
+
'carPhotoCount' : IDL.Nat8,
|
|
341
|
+
'hasLicencePhoto' : IDL.Bool,
|
|
342
|
+
});
|
|
309
343
|
const Geohash = IDL.Text;
|
|
310
344
|
const RegisterBase = IDL.Record({
|
|
311
|
-
'card' :
|
|
345
|
+
'card' : DriverCardIn,
|
|
312
346
|
'cardVersion' : IDL.Nat32,
|
|
313
347
|
'geohash' : Geohash,
|
|
314
348
|
'driverKey' : DriverKey,
|
|
315
349
|
});
|
|
316
350
|
const RegisterDriver = IDL.Record({
|
|
317
351
|
'freeAtNs' : IDL.Opt(IDL.Nat64),
|
|
318
|
-
'card' :
|
|
352
|
+
'card' : DriverCardIn,
|
|
319
353
|
'cardVersion' : IDL.Nat32,
|
|
320
354
|
'geohash' : Geohash,
|
|
321
355
|
'available' : IDL.Bool,
|
|
@@ -97,7 +97,7 @@ export class ScheduledRide {
|
|
|
97
97
|
const rating = offer.driverRating[0];
|
|
98
98
|
offers.push({
|
|
99
99
|
offerId,
|
|
100
|
-
card: cardOf(offer.card, canister, this.options.host),
|
|
100
|
+
card: cardOf(offer.card, canister, this.options.host, offer.car),
|
|
101
101
|
...(rating === undefined ? {} : { driverRating: rating / 100 }),
|
|
102
102
|
rideMeters: offer.rideMeters,
|
|
103
103
|
rideSec: offer.rideSec,
|
|
@@ -131,7 +131,7 @@ export class ScheduledRide {
|
|
|
131
131
|
snapshot.nextStageMs = msOf(next);
|
|
132
132
|
if ("booked" in state) {
|
|
133
133
|
const rating = state.booked.driverRating[0];
|
|
134
|
-
snapshot.booked = { card: cardOf(state.booked.card, state.booked.driverCanister.toText(), this.options.host), ...(rating === undefined ? {} : { driverRating: rating / 100 }), price: moneyOf(state.booked.price) };
|
|
134
|
+
snapshot.booked = { card: cardOf(state.booked.card, state.booked.driverCanister.toText(), this.options.host, state.booked.car), ...(rating === undefined ? {} : { driverRating: rating / 100 }), price: moneyOf(state.booked.price) };
|
|
135
135
|
}
|
|
136
136
|
if ("rescue" in state)
|
|
137
137
|
snapshot.rescue = Object.keys(state.rescue.reason)[0];
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -8,14 +8,25 @@ export interface Money {
|
|
|
8
8
|
}
|
|
9
9
|
export type CarrierKind = "privateDriver" | "taxi" | "rideHailing" | "other";
|
|
10
10
|
/** The public card of a driver (P-12), with the URLs of its car photos (P-7). */
|
|
11
|
+
/** D-42 (DRIVER-FLEET): the colour of a car as a code; the front translates it. */
|
|
12
|
+
export type CarColour = "white" | "black" | "silver" | "grey" | "blue" | "navy" | "red" | "maroon" | "green" | "yellow" | "orange" | "brown" | "beige" | "gold" | "purple" | "other";
|
|
13
|
+
/** D-42: a car apart — make and model, plate, colour. */
|
|
14
|
+
export interface CarView {
|
|
15
|
+
name: string;
|
|
16
|
+
plate: string;
|
|
17
|
+
colour?: CarColour;
|
|
18
|
+
}
|
|
11
19
|
export interface DriverCardView {
|
|
12
20
|
name: string;
|
|
13
21
|
carrierKind: CarrierKind;
|
|
14
22
|
/** The driver's own words when `carrierKind` is "other". */
|
|
15
23
|
carrierOther?: string;
|
|
24
|
+
/** One text for fronts that do not show `car` (with a fleet car: "make and model · plate"). */
|
|
16
25
|
carDescription: string;
|
|
17
26
|
carPhotoUrls: string[];
|
|
18
27
|
hasLicencePhoto: boolean;
|
|
28
|
+
/** WO-N13 (D-42): the car apart; none from a driver canister before the fleet. */
|
|
29
|
+
car?: CarView;
|
|
19
30
|
}
|
|
20
31
|
/**
|
|
21
32
|
* Why an offer left the rider's list (U-42, ZO-11a). The entry keeps its place, so the front
|
package/dist/interfaces.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../src/interfaces.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,YAAY,EAAE,GAAG,EAAE,MAAM,UAAU,CAAC;AAEpC,wEAAwE;AACxE,MAAM,WAAW,KAAK;IAClB,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,WAAW,GAAG,eAAe,GAAG,MAAM,GAAG,aAAa,GAAG,OAAO,CAAC;AA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AE,WAAW,CAAC;CACrB"}
|
package/dist/mappers.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import type { CarrierKind as CandidCarrierKind, DriverCard, Money as CandidMoney, RideStatus, RouteLine } from "../declarations/tigi-driver/tigi-driver.did.js";
|
|
1
|
+
import type { CarInfo as CandidCarInfo, CarrierKind as CandidCarrierKind, DriverCard, Money as CandidMoney, RideStatus, RouteLine } from "../declarations/tigi-driver/tigi-driver.did.js";
|
|
2
2
|
import type { OfferView as CandidOfferView, RequestView as CandidRequestView } from "../declarations/worker/worker.did.js";
|
|
3
3
|
import type { RateRideOutcome as CandidRateRideOutcome, RideView as CandidHistoryRide } from "../declarations/core/core.did.js";
|
|
4
|
-
import type { CarrierKind, CloseReason, DriverCardView, Money, OfferView, RateRideOutcome, RequestPhase, RideHistoryEntry, RideStatusView, RideView, RouteLineView } from "./interfaces.js";
|
|
4
|
+
import type { CarView, CarrierKind, CloseReason, DriverCardView, Money, OfferView, RateRideOutcome, RequestPhase, RideHistoryEntry, RideStatusView, RideView, RouteLineView } from "./interfaces.js";
|
|
5
5
|
export declare const NS_PER_MS = 1000000n;
|
|
6
6
|
export declare function msOf(ns: bigint): number;
|
|
7
7
|
export declare function moneyOf(money: CandidMoney): Money;
|
|
@@ -14,7 +14,15 @@ export declare function carrierOf(kind: CandidCarrierKind): {
|
|
|
14
14
|
* driver canister. An empty driverKey is `_` (a path cannot hold `//` everywhere).
|
|
15
15
|
*/
|
|
16
16
|
export declare function photoUrl(driverCanister: string, driverKey: string, index: number, host?: string): string;
|
|
17
|
-
|
|
17
|
+
/** WO-N13 (D-42): the car apart; the colour as its code (the front translates it). */
|
|
18
|
+
export declare function carOf(car: CandidCarInfo): CarView;
|
|
19
|
+
/**
|
|
20
|
+
* The card a rider sees. `car`: the car the worker keeps apart (an offer); without it, the
|
|
21
|
+
* card's own (a ride, from the driver canister). Old canisters send none.
|
|
22
|
+
*/
|
|
23
|
+
export declare function cardOf(card: Omit<DriverCard, "car"> & {
|
|
24
|
+
car?: [] | [CandidCarInfo];
|
|
25
|
+
}, driverCanister: string, host?: string, car?: [] | [CandidCarInfo]): DriverCardView;
|
|
18
26
|
export declare function rideStatusOf(status: RideStatus): RideStatusView;
|
|
19
27
|
export declare function closeReasonOf(reason: {
|
|
20
28
|
offerRejected: null;
|
package/dist/mappers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../src/mappers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,WAAW,IAAI,iBAAiB,EAAE,UAAU,EAAE,KAAK,IAAI,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;
|
|
1
|
+
{"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../src/mappers.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,IAAI,aAAa,EAAE,WAAW,IAAI,iBAAiB,EAAE,UAAU,EAAE,KAAK,IAAI,WAAW,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,gDAAgD,CAAC;AAC1L,OAAO,KAAK,EAAE,SAAS,IAAI,eAAe,EAAE,WAAW,IAAI,iBAAiB,EAAE,MAAM,sCAAsC,CAAC;AAC3H,OAAO,KAAK,EAAE,eAAe,IAAI,qBAAqB,EAAE,QAAQ,IAAI,iBAAiB,EAAE,MAAM,kCAAkC,CAAC;AAEhI,OAAO,KAAK,EAAa,OAAO,EAAE,WAAW,EAAE,WAAW,EAAE,cAAc,EAAE,KAAK,EAAE,SAAS,EAAE,eAAe,EAAE,YAAY,EAAW,gBAAgB,EAAkB,cAAc,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,iBAAiB,CAAC;AAGzO,eAAO,MAAM,SAAS,WAAa,CAAC;AAEpC,wBAAgB,IAAI,CAAC,EAAE,EAAE,MAAM,GAAG,MAAM,CAEvC;AAED,wBAAgB,OAAO,CAAC,KAAK,EAAE,WAAW,G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AQ,GAAG,SAAS,EAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAalF"}
|
package/dist/mappers.js
CHANGED
|
@@ -28,14 +28,29 @@ export function photoUrl(driverCanister, driverKey, index, host = MAINNET_HOST)
|
|
|
28
28
|
const origin = isLocalHost(host) ? `${url.protocol}//${driverCanister}.localhost${url.port ? `:${url.port}` : ""}` : `${url.protocol}//${driverCanister}.${url.host}`;
|
|
29
29
|
return `${origin}/photos/${key}/${index}`;
|
|
30
30
|
}
|
|
31
|
-
|
|
31
|
+
/** WO-N13 (D-42): the car apart; the colour as its code (the front translates it). */
|
|
32
|
+
export function carOf(car) {
|
|
33
|
+
const colour = car.colour[0];
|
|
34
|
+
return {
|
|
35
|
+
name: car.name,
|
|
36
|
+
plate: car.plate,
|
|
37
|
+
...(colour === undefined ? {} : { colour: Object.keys(colour)[0] }),
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* The card a rider sees. `car`: the car the worker keeps apart (an offer); without it, the
|
|
42
|
+
* card's own (a ride, from the driver canister). Old canisters send none.
|
|
43
|
+
*/
|
|
44
|
+
export function cardOf(card, driverCanister, host, car) {
|
|
32
45
|
const photos = Math.min(6, card.carPhotoCount);
|
|
46
|
+
const info = (car ?? card.car)?.[0];
|
|
33
47
|
return {
|
|
34
48
|
name: card.name,
|
|
35
49
|
...carrierOf(card.carrierKind),
|
|
36
50
|
carDescription: card.carDescription,
|
|
37
51
|
carPhotoUrls: Array.from({ length: photos }, (_, index) => photoUrl(driverCanister, card.driverKey, index, host)),
|
|
38
52
|
hasLicencePhoto: card.hasLicencePhoto,
|
|
53
|
+
...(info === undefined ? {} : { car: carOf(info) }),
|
|
39
54
|
};
|
|
40
55
|
}
|
|
41
56
|
export function rideStatusOf(status) {
|
|
@@ -146,7 +161,7 @@ export function offerOf(offer, simulator, host) {
|
|
|
146
161
|
const pin = pinExact ? { lat: exact.lat, lng: exact.lng } : freeAtMs !== undefined ? undefined : (decodeGeohashCenter(offer.pinGeohash) ?? { lat: 0, lng: 0 });
|
|
147
162
|
return {
|
|
148
163
|
offerId: offerIdOf(canister, offer.driverKey),
|
|
149
|
-
card: cardOf(offer.card, canister, host),
|
|
164
|
+
card: cardOf(offer.card, canister, host, offer.car),
|
|
150
165
|
driverRating: offer.driverRating[0] === undefined ? undefined : offer.driverRating[0] / 100,
|
|
151
166
|
...(pin === undefined ? {} : { pin }),
|
|
152
167
|
pinExact,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsm-mit/tigi-sharded-package",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.18.0",
|
|
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": {
|
|
@@ -61,11 +61,11 @@
|
|
|
61
61
|
"tigiSharded": {
|
|
62
62
|
"repo": "tigi-sharded",
|
|
63
63
|
"repoUrl": "https://github.com/JSM-Tigi/tigi-sharded",
|
|
64
|
-
"commit": "
|
|
64
|
+
"commit": "97624ea87ce0f31368ec29dadd91686177adb99e"
|
|
65
65
|
},
|
|
66
66
|
"tigiDriverRust": {
|
|
67
67
|
"repo": "tigi-driver-rust",
|
|
68
68
|
"repoUrl": "https://github.com/JSM-Tigi/tigi-driver-rust",
|
|
69
|
-
"commit": "
|
|
69
|
+
"commit": "ad07a52fd72aa3a3bc815621b2f095dcaa760663"
|
|
70
70
|
}
|
|
71
71
|
}
|