@jsm-mit/tigi-sharded-package 0.4.0 → 0.5.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.
@@ -66,6 +66,10 @@ export interface DriverFeeAccountView {
66
66
  'paidTotal' : bigint,
67
67
  'lastFee' : [] | [FeeRecord],
68
68
  }
69
+ export interface DriverRatingArgs {
70
+ 'driverKey' : string,
71
+ 'canister' : Principal,
72
+ }
69
73
  export interface DriverRoomView {
70
74
  'recipient' : Principal,
71
75
  'driverKey' : string,
@@ -138,6 +142,7 @@ export interface FeeUsage {
138
142
  'registrations' : bigint,
139
143
  'rides' : bigint,
140
144
  }
145
+ export interface Geo { 'lat' : number, 'lng' : number }
141
146
  export interface InitArgs {
142
147
  'mode' : Mode,
143
148
  'admins' : Array<Principal>,
@@ -170,6 +175,10 @@ export interface Profile {
170
175
  }
171
176
  export interface ProfileEntry { 'principal' : Principal, 'name' : string }
172
177
  export interface ProfilesArgs { 'principals' : Array<Principal> }
178
+ export interface RateRideArgs { 'requestId' : string, 'stars' : number }
179
+ export type RateRideOutcome = { 'notRatable' : string } |
180
+ { 'rated' : null } |
181
+ { 'alreadyRated' : null };
173
182
  export interface Rating { 'sum' : bigint, 'count' : bigint }
174
183
  export interface RatingEntry {
175
184
  'requestId' : string,
@@ -186,21 +195,24 @@ export interface ReleasedWasm {
186
195
  'size' : bigint,
187
196
  'releasedAtNs' : bigint,
188
197
  }
198
+ export interface RequestIdArgs { 'requestId' : string }
189
199
  export type Result = { 'ok' : bigint } |
190
200
  { 'err' : Error };
191
201
  export type Result_1 = { 'ok' : Uint8Array | number[] } |
192
202
  { 'err' : Error };
193
- export type Result_10 = { 'ok' : Array<DriverFeeAccountView> } |
203
+ export type Result_10 = { 'ok' : Array<DriverRoomView> } |
194
204
  { 'err' : Error };
195
- export type Result_11 = { 'ok' : DriverCanistersPage } |
205
+ export type Result_11 = { 'ok' : Array<DriverFeeAccountView> } |
196
206
  { 'err' : Error };
197
- export type Result_12 = { 'ok' : Array<Block> } |
207
+ export type Result_12 = { 'ok' : DriverCanistersPage } |
198
208
  { 'err' : Error };
199
- export type Result_13 = { 'ok' : LeaseAnswer } |
209
+ export type Result_13 = { 'ok' : Array<Block> } |
200
210
  { 'err' : Error };
201
- export type Result_14 = { 'ok' : RideBatchResult } |
211
+ export type Result_14 = { 'ok' : LeaseAnswer } |
202
212
  { 'err' : Error };
203
- export type Result_15 = {
213
+ export type Result_15 = { 'ok' : RideBatchResult } |
214
+ { 'err' : Error };
215
+ export type Result_16 = {
204
216
  'ok' : {
205
217
  'subjects' : bigint,
206
218
  'headSeq' : bigint,
@@ -209,54 +221,56 @@ export type Result_15 = {
209
221
  }
210
222
  } |
211
223
  { 'err' : Error };
212
- export type Result_16 = { 'ok' : Wiring } |
213
- { 'err' : Error };
214
- export type Result_17 = { 'ok' : Array<ProfileEntry> } |
224
+ export type Result_17 = { 'ok' : Wiring } |
215
225
  { 'err' : Error };
216
- export type Result_18 = { 'ok' : RidesPage } |
226
+ export type Result_18 = { 'ok' : Array<ProfileEntry> } |
217
227
  { 'err' : Error };
218
- export type Result_19 = { 'ok' : [] | [Rating] } |
228
+ export type Result_19 = { 'ok' : RidesPage } |
219
229
  { 'err' : Error };
220
230
  export type Result_2 = { 'ok' : boolean } |
221
231
  { 'err' : Error };
222
- export type Result_20 = { 'ok' : DriverCanister } |
232
+ export type Result_20 = { 'ok' : RideView } |
223
233
  { 'err' : Error };
224
- export type Result_21 = { 'ok' : FeeStatus } |
234
+ export type Result_21 = { 'ok' : [] | [Rating] } |
225
235
  { 'err' : Error };
226
- export type Result_22 = { 'ok' : FactoryStatus } |
236
+ export type Result_22 = { 'ok' : DriverCanister } |
227
237
  { 'err' : Error };
228
- export type Result_23 = { 'ok' : [] | [RolloutView] } |
238
+ export type Result_23 = { 'ok' : FeeStatus } |
229
239
  { 'err' : Error };
230
- export type Result_24 = { 'ok' : FeeBill } |
240
+ export type Result_24 = { 'ok' : FactoryStatus } |
231
241
  { 'err' : Error };
232
- export type Result_25 = { 'ok' : DriverFeeAccountView } |
242
+ export type Result_25 = { 'ok' : [] | [RolloutView] } |
233
243
  { 'err' : Error };
234
- export type Result_26 = { 'ok' : ChatRoomsStatus } |
244
+ export type Result_26 = { 'ok' : FeeBill } |
235
245
  { 'err' : Error };
236
- export type Result_27 = { 'ok' : Array<Principal> } |
246
+ export type Result_27 = { 'ok' : DriverFeeAccountView } |
237
247
  { 'err' : Error };
238
- export type Result_28 = { 'ok' : Principal } |
248
+ export type Result_28 = { 'ok' : ChatRoomsStatus } |
239
249
  { 'err' : Error };
240
- export type Result_29 = { 'ok' : WasmInfo } |
250
+ export type Result_29 = { 'ok' : Array<Principal> } |
241
251
  { 'err' : Error };
242
252
  export type Result_3 = { 'ok' : RolloutView } |
243
253
  { 'err' : Error };
254
+ export type Result_30 = { 'ok' : Principal } |
255
+ { 'err' : Error };
256
+ export type Result_31 = { 'ok' : WasmInfo } |
257
+ { 'err' : Error };
244
258
  export type Result_4 = { 'ok' : Profile } |
245
259
  { 'err' : Error };
246
260
  export type Result_5 = { 'ok' : FeeRates } |
247
261
  { 'err' : Error };
248
262
  export type Result_6 = { 'ok' : ChatConfig } |
249
263
  { 'err' : Error };
250
- export type Result_7 = { 'ok' : FeePaid } |
264
+ export type Result_7 = { 'ok' : RateRideOutcome } |
251
265
  { 'err' : Error };
252
- export type Result_8 = { 'ok' : ClaimCode } |
266
+ export type Result_8 = { 'ok' : FeePaid } |
253
267
  { 'err' : Error };
254
- export type Result_9 = { 'ok' : Array<DriverRoomView> } |
268
+ export type Result_9 = { 'ok' : ClaimCode } |
255
269
  { 'err' : Error };
256
270
  export interface RideBatch {
257
271
  'ratings' : Array<RatingEntry>,
258
272
  'usage' : [] | [UsageBatch],
259
- 'rides' : Array<RideEntry>,
273
+ 'rides' : Array<RideEntryIn>,
260
274
  }
261
275
  export interface RideBatchResult {
262
276
  'duplicates' : bigint,
@@ -267,18 +281,33 @@ export interface RideBatchResult {
267
281
  export type RideEnd = { 'completed' : null } |
268
282
  { 'cancelledByRider' : null } |
269
283
  { 'cancelledByDriver' : null };
270
- export interface RideEntry {
284
+ export interface RideEntryIn {
271
285
  'end' : RideEnd,
286
+ 'destination' : [] | [Geo],
272
287
  'requestId' : string,
273
288
  'endedAtNs' : bigint,
289
+ 'pickup' : [] | [Geo],
274
290
  'driverKey' : string,
275
291
  'driverCanister' : Principal,
276
292
  'price' : [] | [Money],
277
293
  'rider' : Principal,
278
294
  }
295
+ export interface RideView {
296
+ 'end' : RideEnd,
297
+ 'destination' : [] | [Geo],
298
+ 'requestId' : string,
299
+ 'endedAtNs' : bigint,
300
+ 'ratable' : [] | [boolean],
301
+ 'pickup' : [] | [Geo],
302
+ 'driverKey' : string,
303
+ 'driverCanister' : Principal,
304
+ 'price' : [] | [Money],
305
+ 'rider' : Principal,
306
+ 'myRating' : [] | [number],
307
+ }
279
308
  export interface RidesPage {
280
309
  'nextBeforeIndex' : [] | [bigint],
281
- 'rides' : Array<RideEntry>,
310
+ 'rides' : Array<RideView>,
282
311
  }
283
312
  export interface RidesPageArgs {
284
313
  'beforeIndex' : [] | [bigint],
@@ -317,7 +346,7 @@ export interface TigiCore {
317
346
  /**
318
347
  * / Admins: a canister the core controls joins the demo pool (U-35).
319
348
  */
320
- 'addPoolCanister' : ActorMethod<[CanisterArgs], Result_20>,
349
+ 'addPoolCanister' : ActorMethod<[CanisterArgs], Result_22>,
321
350
  /**
322
351
  * / Admins: a driver canister, or one driver in it (`driverKey`), is blocked; the workers
323
352
  * / drop it at once (WO-2).
@@ -332,30 +361,30 @@ export interface TigiCore {
332
361
  * / over the demo canister with the code of the link. Single use, 15 min; every refusal
333
362
  * / answers the same NotAuthorized. The room of the canister gets the caller (C-15).
334
363
  */
335
- 'claimDriverCanister' : ActorMethod<[ClaimArgs], Result_20>,
364
+ 'claimDriverCanister' : ActorMethod<[ClaimArgs], Result_22>,
336
365
  'clearLogs' : ActorMethod<[], undefined>,
337
366
  /**
338
367
  * / Admins: the chunks become THE module of their kind. A new driver wasm is released
339
368
  * / (F-11) and its hash goes to the workers.
340
369
  */
341
- 'commitDriverWasm' : ActorMethod<[WasmCommitArgs], Result_29>,
370
+ 'commitDriverWasm' : ActorMethod<[WasmCommitArgs], Result_31>,
342
371
  /**
343
372
  * / Admins, localTest: an empty canister from the core's cycles joins the demo pool.
344
373
  */
345
- 'createLocalPoolCanister' : ActorMethod<[], Result_20>,
374
+ 'createLocalPoolCanister' : ActorMethod<[], Result_22>,
346
375
  /**
347
376
  * / F-2 … F-4, F-10: the caller's own driver canister (localTest: from the core's cycles).
348
377
  */
349
- 'createMyDriverCanister' : ActorMethod<[], Result_20>,
378
+ 'createMyDriverCanister' : ActorMethod<[], Result_22>,
350
379
  /**
351
380
  * / Admins: the simulator, created once (F-18).
352
381
  */
353
- 'ensureSimulator' : ActorMethod<[], Result_28>,
382
+ 'ensureSimulator' : ActorMethod<[], Result_30>,
354
383
  /**
355
384
  * / F-8: 15 min more for the holder of a demo canister.
356
385
  */
357
- 'extendDemoLease' : ActorMethod<[], Result_20>,
358
- 'getAdmins' : ActorMethod<[], Result_27>,
386
+ 'extendDemoLease' : ActorMethod<[], Result_22>,
387
+ 'getAdmins' : ActorMethod<[], Result_29>,
359
388
  /**
360
389
  * / For the fronts (through the package): where the chat of this environment is. Null =
361
390
  * / no chat here yet. The room of a driver is `ChatRoomFunctions.driverRoomId`.
@@ -364,7 +393,7 @@ export interface TigiCore {
364
393
  /**
365
394
  * / Admins: how far the driver rooms are (C-15).
366
395
  */
367
- 'getChatRoomsStatus' : ActorMethod<[], Result_26>,
396
+ 'getChatRoomsStatus' : ActorMethod<[], Result_28>,
368
397
  /**
369
398
  * / WO-1, WO-2: what the core knows of a canister — for the workers and anybody.
370
399
  */
@@ -372,38 +401,50 @@ export interface TigiCore {
372
401
  /**
373
402
  * / Admins: the account of one driver canister (C-17 … C-20).
374
403
  */
375
- 'getDriverFeeAccount' : ActorMethod<[CanisterArgs], Result_25>,
404
+ 'getDriverFeeAccount' : ActorMethod<[CanisterArgs], Result_27>,
376
405
  /**
377
406
  * / C-19: a driver canister of the registry asks for its bill — the events since its
378
407
  * / last settlement, priced on the fee's day. Called by the canister at its first
379
408
  * / "Przyjmuję zlecenia" of a day. A pool canister owes nothing (C-18).
380
409
  */
381
- 'getDriverFeeBill' : ActorMethod<[], Result_24>,
382
- 'getDriverRollout' : ActorMethod<[], Result_23>,
383
- 'getFactoryStatus' : ActorMethod<[], Result_22>,
410
+ 'getDriverFeeBill' : ActorMethod<[], Result_26>,
411
+ /**
412
+ * / Admins (stage 7): the aggregated rating of one driver (sum and count of stars; null =
413
+ * / no rating yet) — the value the workers get through the outbox (C-6).
414
+ */
415
+ 'getDriverRating' : ActorMethod<[DriverRatingArgs], Result_21>,
416
+ 'getDriverRollout' : ActorMethod<[], Result_25>,
417
+ 'getFactoryStatus' : ActorMethod<[], Result_24>,
384
418
  /**
385
419
  * / C-22: the rates, the day, the multiplier cached, the totals.
386
420
  */
387
- 'getFeeStatus' : ActorMethod<[], Result_21>,
421
+ 'getFeeStatus' : ActorMethod<[], Result_23>,
388
422
  'getLogs' : ActorMethod<[], string>,
389
423
  /**
390
424
  * / The caller's own canister, or the demo canister the caller holds now.
391
425
  */
392
- 'getMyDriverCanister' : ActorMethod<[], Result_20>,
426
+ 'getMyDriverCanister' : ActorMethod<[], Result_22>,
393
427
  'getMyProfile' : ActorMethod<[], Result_4>,
394
428
  /**
395
429
  * / C-16, PF-4: the caller's own rating as a rider (sum and count of stars; null = no
396
430
  * / rating yet). Ratings reach the core in the workers' batches, up to a minute late.
397
431
  */
398
- 'getMyRating' : ActorMethod<[], Result_19>,
432
+ 'getMyRating' : ActorMethod<[], Result_21>,
433
+ /**
434
+ * / C-8 (KU-4, stage 7): one line of the caller's history by its requestId — for the
435
+ * / details screen after a reload and to show the rating after `rateMyRide`. Another
436
+ * / rider's ride → `NotAuthorized`; not in the core (yet, K-9) → `NotFound`.
437
+ */
438
+ 'getMyRide' : ActorMethod<[RequestIdArgs], Result_20>,
399
439
  /**
400
- * / C-8: the caller's rides, newest first.
440
+ * / C-8: the caller's rides, newest first, with the places (KU-4) and whether the driver
441
+ * / can still be rated (KU-5, C-23).
401
442
  */
402
- 'getMyRides' : ActorMethod<[RidesPageArgs], Result_18>,
443
+ 'getMyRides' : ActorMethod<[RidesPageArgs], Result_19>,
403
444
  /**
404
445
  * / C-3: the names of up to MAX_PROFILES_PER_CALL principals; unknown ones are left out.
405
446
  */
406
- 'getProfiles' : ActorMethod<[ProfilesArgs], Result_17>,
447
+ 'getProfiles' : ActorMethod<[ProfilesArgs], Result_18>,
407
448
  /**
408
449
  * / F-11: the driver wasms released so far, oldest first.
409
450
  */
@@ -415,11 +456,11 @@ export interface TigiCore {
415
456
  /**
416
457
  * / Admins: the coordinator, the workers confirmed so far, the mode.
417
458
  */
418
- 'getWiring' : ActorMethod<[], Result_16>,
459
+ 'getWiring' : ActorMethod<[], Result_17>,
419
460
  /**
420
461
  * / Admins: how far the outbox to the workers is (C-6, C-7).
421
462
  */
422
- 'getWorkerOutbox' : ActorMethod<[], Result_15>,
463
+ 'getWorkerOutbox' : ActorMethod<[], Result_16>,
423
464
  /**
424
465
  * / Workers of the group: the core asks the coordinator once and remembers the worker,
425
466
  * / which then gets the network state through the outbox. A worker calls it once after
@@ -431,7 +472,7 @@ export interface TigiCore {
431
472
  * / Idempotent: a known requestId and a counted rating count once. Invalid entries are
432
473
  * / rejected and logged; the worker drops the whole batch after an ok.
433
474
  */
434
- 'ingestRideBatch' : ActorMethod<[RideBatch], Result_14>,
475
+ 'ingestRideBatch' : ActorMethod<[RideBatch], Result_15>,
435
476
  /**
436
477
  * / C-14: the accounts gate of the chat (U-43). The chat core asks this group's
437
478
  * / coordinator WHERE (`accountsCanisterFor` → this core) and asks here: true = an
@@ -442,28 +483,36 @@ export interface TigiCore {
442
483
  * / F-5 … F-7: a demo canister for 15 min (outside prod). A fresh lease comes with a
443
484
  * / one-time claim code (F-20, U-45).
444
485
  */
445
- 'leaseDemoDriverCanister' : ActorMethod<[], Result_13>,
446
- 'listBlocks' : ActorMethod<[PageArgs], Result_12>,
447
- 'listDriverCanisters' : ActorMethod<[PageArgs], Result_11>,
486
+ 'leaseDemoDriverCanister' : ActorMethod<[], Result_14>,
487
+ 'listBlocks' : ActorMethod<[PageArgs], Result_13>,
488
+ 'listDriverCanisters' : ActorMethod<[PageArgs], Result_12>,
448
489
  /**
449
490
  * / Admins: the accounts, 100 a page at most.
450
491
  */
451
- 'listDriverFeeAccounts' : ActorMethod<[PageArgs], Result_10>,
492
+ 'listDriverFeeAccounts' : ActorMethod<[PageArgs], Result_11>,
452
493
  /**
453
494
  * / Admins: the driver rooms as the core wants them, 100 a page at most.
454
495
  */
455
- 'listDriverRooms' : ActorMethod<[PageArgs], Result_9>,
496
+ 'listDriverRooms' : ActorMethod<[PageArgs], Result_10>,
456
497
  /**
457
498
  * / F-20: a fresh claim code for the caller's running demo lease; the old one stops
458
499
  * / working.
459
500
  */
460
- 'newClaimCode' : ActorMethod<[], Result_8>,
501
+ 'newClaimCode' : ActorMethod<[], Result_9>,
461
502
  /**
462
503
  * / C-20: the driver canister pays the bill of `day` with the cycles attached to this
463
504
  * / call. The core takes exactly the bill (the rest goes back), or nothing when less is
464
505
  * / attached (`FEE_SHORT`); a day paid already answers `accepted = 0`.
465
506
  */
466
- 'payDriverFee' : ActorMethod<[FeePayArgs], Result_7>,
507
+ 'payDriverFee' : ActorMethod<[FeePayArgs], Result_8>,
508
+ /**
509
+ * / C-23 (KU-5, stage 7): the rider rates the driver of a finished ride from the history.
510
+ * / Only the ride's rider; a completed ride within 24 h of its end (K-8); once per ride
511
+ * / over both paths — a live rating through the worker and this one count once together
512
+ * / (the first to reach the core). The driver's aggregate goes to the workers as a
513
+ * / batch's does (C-6). Counted in the caller's `#account` pool.
514
+ */
515
+ 'rateMyRide' : ActorMethod<[RateRideArgs], Result_7>,
467
516
  'removeAdmin' : ActorMethod<[PrincipalArgs], Result_2>,
468
517
  'resumeDriverRollout' : ActorMethod<[], Result_3>,
469
518
  /**
@@ -61,7 +61,7 @@ export const idlFactory = ({ IDL }) => {
61
61
  'installedAtNs' : IDL.Opt(IDL.Int),
62
62
  'leaseUntilNs' : IDL.Opt(IDL.Int),
63
63
  });
64
- const Result_20 = IDL.Variant({ 'ok' : DriverCanister, 'err' : Error });
64
+ const Result_22 = IDL.Variant({ 'ok' : DriverCanister, 'err' : Error });
65
65
  const BlockDriverArgs = IDL.Record({
66
66
  'driverKey' : IDL.Opt(IDL.Text),
67
67
  'canister' : IDL.Principal,
@@ -87,9 +87,9 @@ export const idlFactory = ({ IDL }) => {
87
87
  'size' : IDL.Nat,
88
88
  'committedAtNs' : IDL.Int,
89
89
  });
90
- const Result_29 = IDL.Variant({ 'ok' : WasmInfo, 'err' : Error });
91
- const Result_28 = IDL.Variant({ 'ok' : IDL.Principal, 'err' : Error });
92
- const Result_27 = IDL.Variant({
90
+ const Result_31 = IDL.Variant({ 'ok' : WasmInfo, 'err' : Error });
91
+ const Result_30 = IDL.Variant({ 'ok' : IDL.Principal, 'err' : Error });
92
+ const Result_29 = IDL.Variant({
93
93
  'ok' : IDL.Vec(IDL.Principal),
94
94
  'err' : Error,
95
95
  });
@@ -105,7 +105,7 @@ export const idlFactory = ({ IDL }) => {
105
105
  'pendingSinceNs' : IDL.Opt(IDL.Int),
106
106
  'rooms' : IDL.Nat,
107
107
  });
108
- const Result_26 = IDL.Variant({ 'ok' : ChatRoomsStatus, 'err' : Error });
108
+ const Result_28 = IDL.Variant({ 'ok' : ChatRoomsStatus, 'err' : Error });
109
109
  const DriverCanisterStatus = IDL.Record({
110
110
  'moduleHash' : IDL.Opt(IDL.Vec(IDL.Nat8)),
111
111
  'blocked' : IDL.Bool,
@@ -142,9 +142,15 @@ export const idlFactory = ({ IDL }) => {
142
142
  'paidTotal' : IDL.Nat,
143
143
  'lastFee' : IDL.Opt(FeeRecord),
144
144
  });
145
- const Result_25 = IDL.Variant({ 'ok' : DriverFeeAccountView, 'err' : Error });
146
- const Result_24 = IDL.Variant({ 'ok' : FeeBill, 'err' : Error });
147
- const Result_23 = IDL.Variant({ 'ok' : IDL.Opt(RolloutView), 'err' : Error });
145
+ const Result_27 = IDL.Variant({ 'ok' : DriverFeeAccountView, 'err' : Error });
146
+ const Result_26 = IDL.Variant({ 'ok' : FeeBill, 'err' : Error });
147
+ const DriverRatingArgs = IDL.Record({
148
+ 'driverKey' : IDL.Text,
149
+ 'canister' : IDL.Principal,
150
+ });
151
+ const Rating = IDL.Record({ 'sum' : IDL.Nat, 'count' : IDL.Nat });
152
+ const Result_21 = IDL.Variant({ 'ok' : IDL.Opt(Rating), 'err' : Error });
153
+ const Result_25 = IDL.Variant({ 'ok' : IDL.Opt(RolloutView), 'err' : Error });
148
154
  const FactoryStatus = IDL.Record({
149
155
  'simulator' : IDL.Opt(IDL.Principal),
150
156
  'mode' : Mode,
@@ -156,7 +162,7 @@ export const idlFactory = ({ IDL }) => {
156
162
  'driverWasm' : IDL.Opt(WasmInfo),
157
163
  'registered' : IDL.Nat,
158
164
  });
159
- const Result_22 = IDL.Variant({ 'ok' : FactoryStatus, 'err' : Error });
165
+ const Result_24 = IDL.Variant({ 'ok' : FactoryStatus, 'err' : Error });
160
166
  const FeeStatus = IDL.Record({
161
167
  'multiplier' : IDL.Opt(
162
168
  IDL.Record({ 'day' : IDL.Nat, 'permille' : IDL.Nat })
@@ -169,45 +175,50 @@ export const idlFactory = ({ IDL }) => {
169
175
  'paidTotal' : IDL.Nat,
170
176
  'rates' : FeeRates,
171
177
  });
172
- const Result_21 = IDL.Variant({ 'ok' : FeeStatus, 'err' : Error });
178
+ const Result_23 = IDL.Variant({ 'ok' : FeeStatus, 'err' : Error });
173
179
  const Profile = IDL.Record({
174
180
  'updatedAtNs' : IDL.Int,
175
181
  'name' : IDL.Text,
176
182
  'createdAtNs' : IDL.Int,
177
183
  });
178
184
  const Result_4 = IDL.Variant({ 'ok' : Profile, 'err' : Error });
179
- const Rating = IDL.Record({ 'sum' : IDL.Nat, 'count' : IDL.Nat });
180
- const Result_19 = IDL.Variant({ 'ok' : IDL.Opt(Rating), 'err' : Error });
181
- const RidesPageArgs = IDL.Record({
182
- 'beforeIndex' : IDL.Opt(IDL.Nat),
183
- 'limit' : IDL.Nat,
184
- });
185
+ const RequestIdArgs = IDL.Record({ 'requestId' : IDL.Text });
185
186
  const RideEnd = IDL.Variant({
186
187
  'completed' : IDL.Null,
187
188
  'cancelledByRider' : IDL.Null,
188
189
  'cancelledByDriver' : IDL.Null,
189
190
  });
191
+ const Geo = IDL.Record({ 'lat' : IDL.Float64, 'lng' : IDL.Float64 });
190
192
  const Money = IDL.Record({ 'currency' : IDL.Text, 'amount' : IDL.Nat64 });
191
- const RideEntry = IDL.Record({
193
+ const RideView = IDL.Record({
192
194
  'end' : RideEnd,
195
+ 'destination' : IDL.Opt(Geo),
193
196
  'requestId' : IDL.Text,
194
197
  'endedAtNs' : IDL.Nat64,
198
+ 'ratable' : IDL.Opt(IDL.Bool),
199
+ 'pickup' : IDL.Opt(Geo),
195
200
  'driverKey' : IDL.Text,
196
201
  'driverCanister' : IDL.Principal,
197
202
  'price' : IDL.Opt(Money),
198
203
  'rider' : IDL.Principal,
204
+ 'myRating' : IDL.Opt(IDL.Nat8),
205
+ });
206
+ const Result_20 = IDL.Variant({ 'ok' : RideView, 'err' : Error });
207
+ const RidesPageArgs = IDL.Record({
208
+ 'beforeIndex' : IDL.Opt(IDL.Nat),
209
+ 'limit' : IDL.Nat,
199
210
  });
200
211
  const RidesPage = IDL.Record({
201
212
  'nextBeforeIndex' : IDL.Opt(IDL.Nat),
202
- 'rides' : IDL.Vec(RideEntry),
213
+ 'rides' : IDL.Vec(RideView),
203
214
  });
204
- const Result_18 = IDL.Variant({ 'ok' : RidesPage, 'err' : Error });
215
+ const Result_19 = IDL.Variant({ 'ok' : RidesPage, 'err' : Error });
205
216
  const ProfilesArgs = IDL.Record({ 'principals' : IDL.Vec(IDL.Principal) });
206
217
  const ProfileEntry = IDL.Record({
207
218
  'principal' : IDL.Principal,
208
219
  'name' : IDL.Text,
209
220
  });
210
- const Result_17 = IDL.Variant({
221
+ const Result_18 = IDL.Variant({
211
222
  'ok' : IDL.Vec(ProfileEntry),
212
223
  'err' : Error,
213
224
  });
@@ -221,8 +232,8 @@ export const idlFactory = ({ IDL }) => {
221
232
  'knownWorkers' : IDL.Vec(IDL.Principal),
222
233
  'coordinator' : IDL.Opt(IDL.Principal),
223
234
  });
224
- const Result_16 = IDL.Variant({ 'ok' : Wiring, 'err' : Error });
225
- const Result_15 = IDL.Variant({
235
+ const Result_17 = IDL.Variant({ 'ok' : Wiring, 'err' : Error });
236
+ const Result_16 = IDL.Variant({
226
237
  'ok' : IDL.Record({
227
238
  'subjects' : IDL.Nat,
228
239
  'headSeq' : IDL.Nat64,
@@ -253,10 +264,21 @@ export const idlFactory = ({ IDL }) => {
253
264
  'entries' : IDL.Vec(DriverUsage),
254
265
  'batchId' : IDL.Nat64,
255
266
  });
267
+ const RideEntryIn = IDL.Record({
268
+ 'end' : RideEnd,
269
+ 'destination' : IDL.Opt(Geo),
270
+ 'requestId' : IDL.Text,
271
+ 'endedAtNs' : IDL.Nat64,
272
+ 'pickup' : IDL.Opt(Geo),
273
+ 'driverKey' : IDL.Text,
274
+ 'driverCanister' : IDL.Principal,
275
+ 'price' : IDL.Opt(Money),
276
+ 'rider' : IDL.Principal,
277
+ });
256
278
  const RideBatch = IDL.Record({
257
279
  'ratings' : IDL.Vec(RatingEntry),
258
280
  'usage' : IDL.Opt(UsageBatch),
259
- 'rides' : IDL.Vec(RideEntry),
281
+ 'rides' : IDL.Vec(RideEntryIn),
260
282
  });
261
283
  const RideBatchResult = IDL.Record({
262
284
  'duplicates' : IDL.Nat,
@@ -264,7 +286,7 @@ export const idlFactory = ({ IDL }) => {
264
286
  'rejected' : IDL.Nat,
265
287
  'ratingsCounted' : IDL.Nat,
266
288
  });
267
- const Result_14 = IDL.Variant({ 'ok' : RideBatchResult, 'err' : Error });
289
+ const Result_15 = IDL.Variant({ 'ok' : RideBatchResult, 'err' : Error });
268
290
  const ClaimCode = IDL.Record({
269
291
  'expiresAtNs' : IDL.Int,
270
292
  'code' : IDL.Text,
@@ -285,7 +307,7 @@ export const idlFactory = ({ IDL }) => {
285
307
  'busy' : IDL.Record({ 'untilNs' : IDL.Int }),
286
308
  'leased' : LeasedCanister,
287
309
  });
288
- const Result_13 = IDL.Variant({ 'ok' : LeaseAnswer, 'err' : Error });
310
+ const Result_14 = IDL.Variant({ 'ok' : LeaseAnswer, 'err' : Error });
289
311
  const PageArgs = IDL.Record({ 'offset' : IDL.Nat, 'limit' : IDL.Nat });
290
312
  const BlockTarget = IDL.Variant({
291
313
  'driverCanister' : IDL.Principal,
@@ -301,13 +323,13 @@ export const idlFactory = ({ IDL }) => {
301
323
  'target' : BlockTarget,
302
324
  'reason' : IDL.Text,
303
325
  });
304
- const Result_12 = IDL.Variant({ 'ok' : IDL.Vec(Block), 'err' : Error });
326
+ const Result_13 = IDL.Variant({ 'ok' : IDL.Vec(Block), 'err' : Error });
305
327
  const DriverCanistersPage = IDL.Record({
306
328
  'total' : IDL.Nat,
307
329
  'canisters' : IDL.Vec(DriverCanister),
308
330
  });
309
- const Result_11 = IDL.Variant({ 'ok' : DriverCanistersPage, 'err' : Error });
310
- const Result_10 = IDL.Variant({
331
+ const Result_12 = IDL.Variant({ 'ok' : DriverCanistersPage, 'err' : Error });
332
+ const Result_11 = IDL.Variant({
311
333
  'ok' : IDL.Vec(DriverFeeAccountView),
312
334
  'err' : Error,
313
335
  });
@@ -319,18 +341,28 @@ export const idlFactory = ({ IDL }) => {
319
341
  'roomId' : IDL.Text,
320
342
  'synced' : IDL.Bool,
321
343
  });
322
- const Result_9 = IDL.Variant({
344
+ const Result_10 = IDL.Variant({
323
345
  'ok' : IDL.Vec(DriverRoomView),
324
346
  'err' : Error,
325
347
  });
326
- const Result_8 = IDL.Variant({ 'ok' : ClaimCode, 'err' : Error });
348
+ const Result_9 = IDL.Variant({ 'ok' : ClaimCode, 'err' : Error });
327
349
  const FeePayArgs = IDL.Record({ 'day' : IDL.Nat });
328
350
  const FeePaid = IDL.Record({
329
351
  'day' : IDL.Nat,
330
352
  'accepted' : IDL.Nat,
331
353
  'amount' : IDL.Nat,
332
354
  });
333
- const Result_7 = IDL.Variant({ 'ok' : FeePaid, 'err' : Error });
355
+ const Result_8 = IDL.Variant({ 'ok' : FeePaid, 'err' : Error });
356
+ const RateRideArgs = IDL.Record({
357
+ 'requestId' : IDL.Text,
358
+ 'stars' : IDL.Nat8,
359
+ });
360
+ const RateRideOutcome = IDL.Variant({
361
+ 'notRatable' : IDL.Text,
362
+ 'rated' : IDL.Null,
363
+ 'alreadyRated' : IDL.Null,
364
+ });
365
+ const Result_7 = IDL.Variant({ 'ok' : RateRideOutcome, 'err' : Error });
334
366
  const Result_6 = IDL.Variant({ 'ok' : ChatConfig, 'err' : Error });
335
367
  const ClaimTtlArgs = IDL.Record({ 'seconds' : IDL.Nat });
336
368
  const Result = IDL.Variant({ 'ok' : IDL.Nat, 'err' : Error });
@@ -352,49 +384,52 @@ export const idlFactory = ({ IDL }) => {
352
384
  const TigiCore = IDL.Service({
353
385
  'abortDriverRollout' : IDL.Func([], [Result_3], []),
354
386
  'addAdmin' : IDL.Func([PrincipalArgs], [Result_2], []),
355
- 'addPoolCanister' : IDL.Func([CanisterArgs], [Result_20], []),
387
+ 'addPoolCanister' : IDL.Func([CanisterArgs], [Result_22], []),
356
388
  'blockDriver' : IDL.Func([BlockDriverArgs], [Result_2], []),
357
389
  'blockRider' : IDL.Func([BlockRiderArgs], [Result_2], []),
358
- 'claimDriverCanister' : IDL.Func([ClaimArgs], [Result_20], []),
390
+ 'claimDriverCanister' : IDL.Func([ClaimArgs], [Result_22], []),
359
391
  'clearLogs' : IDL.Func([], [], []),
360
- 'commitDriverWasm' : IDL.Func([WasmCommitArgs], [Result_29], []),
361
- 'createLocalPoolCanister' : IDL.Func([], [Result_20], []),
362
- 'createMyDriverCanister' : IDL.Func([], [Result_20], []),
363
- 'ensureSimulator' : IDL.Func([], [Result_28], []),
364
- 'extendDemoLease' : IDL.Func([], [Result_20], []),
365
- 'getAdmins' : IDL.Func([], [Result_27], ['query']),
392
+ 'commitDriverWasm' : IDL.Func([WasmCommitArgs], [Result_31], []),
393
+ 'createLocalPoolCanister' : IDL.Func([], [Result_22], []),
394
+ 'createMyDriverCanister' : IDL.Func([], [Result_22], []),
395
+ 'ensureSimulator' : IDL.Func([], [Result_30], []),
396
+ 'extendDemoLease' : IDL.Func([], [Result_22], []),
397
+ 'getAdmins' : IDL.Func([], [Result_29], ['query']),
366
398
  'getChatConfig' : IDL.Func([], [IDL.Opt(ChatConfig)], ['query']),
367
- 'getChatRoomsStatus' : IDL.Func([], [Result_26], ['query']),
399
+ 'getChatRoomsStatus' : IDL.Func([], [Result_28], ['query']),
368
400
  'getDriverCanisterStatus' : IDL.Func(
369
401
  [CanisterArgs],
370
402
  [DriverCanisterStatus],
371
403
  ['query'],
372
404
  ),
373
- 'getDriverFeeAccount' : IDL.Func([CanisterArgs], [Result_25], ['query']),
374
- 'getDriverFeeBill' : IDL.Func([], [Result_24], []),
375
- 'getDriverRollout' : IDL.Func([], [Result_23], ['query']),
376
- 'getFactoryStatus' : IDL.Func([], [Result_22], ['query']),
377
- 'getFeeStatus' : IDL.Func([], [Result_21], ['query']),
405
+ 'getDriverFeeAccount' : IDL.Func([CanisterArgs], [Result_27], ['query']),
406
+ 'getDriverFeeBill' : IDL.Func([], [Result_26], []),
407
+ 'getDriverRating' : IDL.Func([DriverRatingArgs], [Result_21], ['query']),
408
+ 'getDriverRollout' : IDL.Func([], [Result_25], ['query']),
409
+ 'getFactoryStatus' : IDL.Func([], [Result_24], ['query']),
410
+ 'getFeeStatus' : IDL.Func([], [Result_23], ['query']),
378
411
  'getLogs' : IDL.Func([], [IDL.Text], ['query']),
379
- 'getMyDriverCanister' : IDL.Func([], [Result_20], ['query']),
412
+ 'getMyDriverCanister' : IDL.Func([], [Result_22], ['query']),
380
413
  'getMyProfile' : IDL.Func([], [Result_4], ['query']),
381
- 'getMyRating' : IDL.Func([], [Result_19], ['query']),
382
- 'getMyRides' : IDL.Func([RidesPageArgs], [Result_18], ['query']),
383
- 'getProfiles' : IDL.Func([ProfilesArgs], [Result_17], ['query']),
414
+ 'getMyRating' : IDL.Func([], [Result_21], ['query']),
415
+ 'getMyRide' : IDL.Func([RequestIdArgs], [Result_20], ['query']),
416
+ 'getMyRides' : IDL.Func([RidesPageArgs], [Result_19], ['query']),
417
+ 'getProfiles' : IDL.Func([ProfilesArgs], [Result_18], ['query']),
384
418
  'getReleasedDriverWasms' : IDL.Func([], [IDL.Vec(ReleasedWasm)], ['query']),
385
419
  'getSimulator' : IDL.Func([], [IDL.Opt(IDL.Principal)], ['query']),
386
- 'getWiring' : IDL.Func([], [Result_16], ['query']),
387
- 'getWorkerOutbox' : IDL.Func([], [Result_15], ['query']),
420
+ 'getWiring' : IDL.Func([], [Result_17], ['query']),
421
+ 'getWorkerOutbox' : IDL.Func([], [Result_16], ['query']),
388
422
  'helloFromWorker' : IDL.Func([], [Result_2], []),
389
- 'ingestRideBatch' : IDL.Func([RideBatch], [Result_14], []),
423
+ 'ingestRideBatch' : IDL.Func([RideBatch], [Result_15], []),
390
424
  'isUser' : IDL.Func([IDL.Principal], [IDL.Bool], ['query']),
391
- 'leaseDemoDriverCanister' : IDL.Func([], [Result_13], []),
392
- 'listBlocks' : IDL.Func([PageArgs], [Result_12], ['query']),
393
- 'listDriverCanisters' : IDL.Func([PageArgs], [Result_11], ['query']),
394
- 'listDriverFeeAccounts' : IDL.Func([PageArgs], [Result_10], ['query']),
395
- 'listDriverRooms' : IDL.Func([PageArgs], [Result_9], ['query']),
396
- 'newClaimCode' : IDL.Func([], [Result_8], []),
397
- 'payDriverFee' : IDL.Func([FeePayArgs], [Result_7], []),
425
+ 'leaseDemoDriverCanister' : IDL.Func([], [Result_14], []),
426
+ 'listBlocks' : IDL.Func([PageArgs], [Result_13], ['query']),
427
+ 'listDriverCanisters' : IDL.Func([PageArgs], [Result_12], ['query']),
428
+ 'listDriverFeeAccounts' : IDL.Func([PageArgs], [Result_11], ['query']),
429
+ 'listDriverRooms' : IDL.Func([PageArgs], [Result_10], ['query']),
430
+ 'newClaimCode' : IDL.Func([], [Result_9], []),
431
+ 'payDriverFee' : IDL.Func([FeePayArgs], [Result_8], []),
432
+ 'rateMyRide' : IDL.Func([RateRideArgs], [Result_7], []),
398
433
  'removeAdmin' : IDL.Func([PrincipalArgs], [Result_2], []),
399
434
  'resumeDriverRollout' : IDL.Func([], [Result_3], []),
400
435
  'setChatConfig' : IDL.Func([ChatConfig], [Result_6], []),