@jsm-mit/tigi-sharded-package 0.11.0 → 0.12.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 +7 -0
- package/declarations/tigi-driver/tigi-driver.did.d.ts +3 -0
- package/declarations/tigi-driver/tigi-driver.did.js +1 -0
- package/declarations/tigi-simulator/tigi-simulator.did +2 -0
- package/declarations/tigi-simulator/tigi-simulator.did.d.ts +4 -0
- package/declarations/tigi-simulator/tigi-simulator.did.js +1 -0
- package/declarations/worker/worker.did +3 -0
- package/declarations/worker/worker.did.d.ts +3 -0
- package/declarations/worker/worker.did.js +3 -0
- package/dist/actors/rides-actor.js +2 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/interfaces.d.ts +21 -3
- package/dist/interfaces.d.ts.map +1 -1
- package/dist/mappers.d.ts +6 -0
- package/dist/mappers.d.ts.map +1 -1
- package/dist/mappers.js +24 -3
- package/package.json +3 -3
|
@@ -116,6 +116,8 @@ type RegisterDriver = record {
|
|
|
116
116
|
card : DriverCard;
|
|
117
117
|
cardVersion : nat32; // the worker keeps the newest card
|
|
118
118
|
validUntilNs : opt nat64; // simulator only: no pulse needed until then (U-25)
|
|
119
|
+
freeAtNs : opt nat64; // P-23: on a ride that ends by then (≤ 5 min + 2 min of margin)
|
|
120
|
+
// — asked for rides "as soon as possible" as a queued next ride
|
|
119
121
|
};
|
|
120
122
|
|
|
121
123
|
// The route the driver's front got from its provider, in the same query that priced the
|
|
@@ -139,6 +141,9 @@ type Quote = record {
|
|
|
139
141
|
validUntilNs : nat64; // 60 s (U-39)
|
|
140
142
|
routeLine : opt RouteLine; // P-17: the line of the offer; none from an old canister
|
|
141
143
|
driverPosition : opt Geo; // P-18: exact, the start of the route — the pin of the offer
|
|
144
|
+
freeAtNs : opt nat64; // P-23: the driver ends a ride by then; `etaToPickupSec` counts
|
|
145
|
+
// from now and holds the rest of that ride; no pin, no
|
|
146
|
+
// `routeLine.toPickup` ("") — they would show the other rider's B
|
|
142
147
|
};
|
|
143
148
|
|
|
144
149
|
type QuoteDecline = record { requestId : RequestId; driverKey : DriverKey };
|
|
@@ -183,6 +188,8 @@ type RideView = record {
|
|
|
183
188
|
price : Money;
|
|
184
189
|
cardAccepted : opt bool; // P-20: the driver takes cards; absent = no
|
|
185
190
|
cardPayment : opt CardPaymentView; // P-20: once the rider started one
|
|
191
|
+
freeAtNs : opt nat64; // P-23: a queued ride — the driver ends the previous one by then;
|
|
192
|
+
// meanwhile no `driverPosition`
|
|
186
193
|
};
|
|
187
194
|
|
|
188
195
|
// P-20: the rider's card payment of a ride — Stripe Checkout on the driver's own account.
|
|
@@ -68,6 +68,7 @@ export type ProtocolError = { 'expired' : null } |
|
|
|
68
68
|
{ 'unsupportedVersion' : number } |
|
|
69
69
|
{ 'notMyArea' : null };
|
|
70
70
|
export interface Quote {
|
|
71
|
+
'freeAtNs' : [] | [bigint],
|
|
71
72
|
'requestId' : RequestId,
|
|
72
73
|
'rideMeters' : number,
|
|
73
74
|
'rideSec' : number,
|
|
@@ -104,6 +105,7 @@ export interface RegisterBase {
|
|
|
104
105
|
'driverKey' : DriverKey,
|
|
105
106
|
}
|
|
106
107
|
export interface RegisterDriver {
|
|
108
|
+
'freeAtNs' : [] | [bigint],
|
|
107
109
|
'card' : DriverCard,
|
|
108
110
|
'cardVersion' : number,
|
|
109
111
|
'geohash' : Geohash,
|
|
@@ -146,6 +148,7 @@ export interface RideStatusChange {
|
|
|
146
148
|
'driverKey' : DriverKey,
|
|
147
149
|
}
|
|
148
150
|
export interface RideView {
|
|
151
|
+
'freeAtNs' : [] | [bigint],
|
|
149
152
|
'status' : RideStatus,
|
|
150
153
|
'requestId' : RequestId,
|
|
151
154
|
'positionAtNs' : [] | [bigint],
|
|
@@ -58,6 +58,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
58
58
|
});
|
|
59
59
|
const Geo = IDL.Record({ 'lat' : IDL.Float64, 'lng' : IDL.Float64 });
|
|
60
60
|
const RideView = IDL.Record({
|
|
61
|
+
'freeAtNs' : IDL.Opt(IDL.Nat64),
|
|
61
62
|
'status' : RideStatus,
|
|
62
63
|
'requestId' : RequestId,
|
|
63
64
|
'positionAtNs' : IDL.Opt(IDL.Nat64),
|
|
@@ -269,6 +269,8 @@ type RideStatus = variant {
|
|
|
269
269
|
inProgress;
|
|
270
270
|
};
|
|
271
271
|
type RideView = record {
|
|
272
|
+
// P-23: a queued ride — the driver ends the previous one by then; no position meanwhile.
|
|
273
|
+
freeAtNs : opt nat64;
|
|
272
274
|
status : RideStatus;
|
|
273
275
|
requestId : text;
|
|
274
276
|
positionAtNs : opt nat64;
|
|
@@ -389,6 +389,10 @@ export type RideStatus = { 'completed' : CompletedStatus } |
|
|
|
389
389
|
{ 'cancelledByDriver' : CancelledByDriverStatus } |
|
|
390
390
|
{ 'inProgress' : null };
|
|
391
391
|
export interface RideView {
|
|
392
|
+
/**
|
|
393
|
+
* P-23: a queued ride — the driver ends the previous one by then; no position meanwhile.
|
|
394
|
+
*/
|
|
395
|
+
'freeAtNs' : [] | [bigint],
|
|
392
396
|
'status' : RideStatus,
|
|
393
397
|
'requestId' : string,
|
|
394
398
|
'positionAtNs' : [] | [bigint],
|
|
@@ -295,6 +295,7 @@ type RegisterDriver =
|
|
|
295
295
|
card: DriverCard;
|
|
296
296
|
cardVersion: nat32;
|
|
297
297
|
driverKey: DriverKey;
|
|
298
|
+
freeAtNs: opt nat64;
|
|
298
299
|
geohash: Geohash;
|
|
299
300
|
validUntilNs: opt nat64;
|
|
300
301
|
};
|
|
@@ -320,6 +321,7 @@ type Quote =
|
|
|
320
321
|
driverKey: DriverKey;
|
|
321
322
|
driverPosition: opt Geo;
|
|
322
323
|
etaToPickupSec: nat32;
|
|
324
|
+
freeAtNs: opt nat64;
|
|
323
325
|
price: Money;
|
|
324
326
|
requestId: RequestId;
|
|
325
327
|
rideMeters: nat32;
|
|
@@ -368,6 +370,7 @@ type OfferView =
|
|
|
368
370
|
driverPosition: opt Geo;
|
|
369
371
|
driverRating: opt nat16;
|
|
370
372
|
etaToPickupSec: nat32;
|
|
373
|
+
freeAtNs: opt nat64;
|
|
371
374
|
pinGeohash: text;
|
|
372
375
|
price: Money;
|
|
373
376
|
receivedNs: nat64;
|
|
@@ -132,6 +132,7 @@ export interface OfferRef {
|
|
|
132
132
|
'driverCanister' : Principal,
|
|
133
133
|
}
|
|
134
134
|
export interface OfferView {
|
|
135
|
+
'freeAtNs' : [] | [bigint],
|
|
135
136
|
'rideMeters' : number,
|
|
136
137
|
'driverRating' : [] | [number],
|
|
137
138
|
'card' : DriverCard,
|
|
@@ -165,6 +166,7 @@ export type ProtocolError = { 'expired' : null } |
|
|
|
165
166
|
export type ProtocolResult = { 'ok' : null } |
|
|
166
167
|
{ 'err' : ProtocolError };
|
|
167
168
|
export interface Quote {
|
|
169
|
+
'freeAtNs' : [] | [bigint],
|
|
168
170
|
'requestId' : RequestId,
|
|
169
171
|
'rideMeters' : number,
|
|
170
172
|
'rideSec' : number,
|
|
@@ -188,6 +190,7 @@ export interface RegisterBase {
|
|
|
188
190
|
'driverKey' : DriverKey,
|
|
189
191
|
}
|
|
190
192
|
export interface RegisterDriver {
|
|
193
|
+
'freeAtNs' : [] | [bigint],
|
|
191
194
|
'card' : DriverCard,
|
|
192
195
|
'cardVersion' : number,
|
|
193
196
|
'geohash' : Geohash,
|
|
@@ -177,6 +177,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
177
177
|
const Money = IDL.Record({ 'currency' : IDL.Text, 'amount' : IDL.Nat64 });
|
|
178
178
|
const Geo = IDL.Record({ 'lat' : IDL.Float64, 'lng' : IDL.Float64 });
|
|
179
179
|
const OfferView = IDL.Record({
|
|
180
|
+
'freeAtNs' : IDL.Opt(IDL.Nat64),
|
|
180
181
|
'rideMeters' : IDL.Nat32,
|
|
181
182
|
'driverRating' : IDL.Opt(IDL.Nat16),
|
|
182
183
|
'card' : DriverCard,
|
|
@@ -313,6 +314,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
313
314
|
'driverKey' : DriverKey,
|
|
314
315
|
});
|
|
315
316
|
const RegisterDriver = IDL.Record({
|
|
317
|
+
'freeAtNs' : IDL.Opt(IDL.Nat64),
|
|
316
318
|
'card' : DriverCard,
|
|
317
319
|
'cardVersion' : IDL.Nat32,
|
|
318
320
|
'geohash' : Geohash,
|
|
@@ -351,6 +353,7 @@ export const idlFactory = ({ IDL }) => {
|
|
|
351
353
|
'version' : IDL.Nat64,
|
|
352
354
|
});
|
|
353
355
|
const Quote = IDL.Record({
|
|
356
|
+
'freeAtNs' : IDL.Opt(IDL.Nat64),
|
|
354
357
|
'requestId' : RequestId,
|
|
355
358
|
'rideMeters' : IDL.Nat32,
|
|
356
359
|
'rideSec' : IDL.Nat32,
|
|
@@ -703,6 +703,8 @@ async function getRideOfAsyncUnsafe(identity, options, driver, requestId) {
|
|
|
703
703
|
driverPosition: ride.driverPosition[0],
|
|
704
704
|
positionAtMs: ride.positionAtNs[0] === undefined ? undefined : msOf(ride.positionAtNs[0]),
|
|
705
705
|
etaToPickupSec: ride.etaToPickupSec[0],
|
|
706
|
+
// K-N10 (P-23): a queued ride.
|
|
707
|
+
...(ride.freeAtNs?.[0] === undefined ? {} : { freeAtMs: msOf(ride.freeAtNs[0]) }),
|
|
706
708
|
price: moneyOf(ride.price),
|
|
707
709
|
cardAccepted: ride.cardAccepted?.[0] === true,
|
|
708
710
|
cardPayment: ride.cardPayment?.[0] === undefined ? undefined : cardPaymentOf(ride.cardPayment[0]),
|
package/dist/index.d.ts
CHANGED
|
@@ -6,5 +6,6 @@ export { TestManagerActor, SIMULATED_DRIVERS } from "./actors/test-manager-actor
|
|
|
6
6
|
export { DriverCanistersActor, CLAIM_FRAGMENT_KEY, MAX_CLAIM_CODE_CHARS, claimCodeOfHash, claimLinkOf } from "./actors/driver-canisters-actor.js";
|
|
7
7
|
export { ChatPlacesActor, CHAT_CONFIG_TTL_MS, DRIVER_ROOM_PREFIX, MAX_ROOM_ID_CHARS, driverRoomId } from "./chat.js";
|
|
8
8
|
export { cellsWithin, decodeGeohashCenter, decodePolyline, distanceMeters, encodeGeohash } from "./geo.js";
|
|
9
|
+
export { etaToPickupNowSec } from "./mappers.js";
|
|
9
10
|
export type * from "./interfaces.js";
|
|
10
11
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAYA,OAAO,EACH,YAAY,EACZ,sBAAsB,EACtB,aAAa,EACb,UAAU,EACV,sBAAsB,EACtB,oBAAoB,EACpB,aAAa,EACb,KAAK,YAAY,EACjB,KAAK,QAAQ,GAChB,MAAM,2BAA2B,CAAC;AACnC,OAAO,EACH,UAAU,EACV,WAAW,EACX,YAAY,EACZ,eAAe,EACf,eAAe,EACf,YAAY,EACZ,iBAAiB,EACjB,oBAAoB,EACpB,kBAAkB,EAClB,cAAc,EACd,KAAK,eAAe,GACvB,MAAM,yBAAyB,CAAC;AACjC,OAAO,EACH,aAAa,EACb,gBAAgB,EAChB,sBAAsB,EACtB,sBAAsB,EACtB,iBAAiB,EACjB,uBAAuB,EACvB,KAAK,kBAAkB,EACvB,KAAK,cAAc,EACnB,KAAK,iBAAiB,GACzB,MAAM,4BAA4B,CAAC;AACpC,OAAO,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,4BAA4B,CAAC;AACvE,OAAO,EAAE,gBAAgB,EAAE,iBAAiB,EAAE,MAAM,gCAAgC,CAAC;AACrF,OAAO,EAAE,oBAAoB,EAAE,kBAAkB,EAAE,oBAAoB,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAClJ,OAAO,EAAE,eAAe,EAAE,kBAAkB,EAAE,kBAAkB,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,WAAW,CAA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AAiB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -17,3 +17,4 @@ export { TestManagerActor, SIMULATED_DRIVERS } from "./actors/test-manager-actor
|
|
|
17
17
|
export { DriverCanistersActor, CLAIM_FRAGMENT_KEY, MAX_CLAIM_CODE_CHARS, claimCodeOfHash, claimLinkOf } from "./actors/driver-canisters-actor.js";
|
|
18
18
|
export { ChatPlacesActor, CHAT_CONFIG_TTL_MS, DRIVER_ROOM_PREFIX, MAX_ROOM_ID_CHARS, driverRoomId } from "./chat.js";
|
|
19
19
|
export { cellsWithin, decodeGeohashCenter, decodePolyline, distanceMeters, encodeGeohash } from "./geo.js";
|
|
20
|
+
export { etaToPickupNowSec } from "./mappers.js";
|
package/dist/interfaces.d.ts
CHANGED
|
@@ -39,12 +39,24 @@ export interface OfferView {
|
|
|
39
39
|
/**
|
|
40
40
|
* ZO-22 (2026-10-24, route line): the driver's EXACT position at the offer (P-18) — or,
|
|
41
41
|
* from an old driver canister or after an upgrade of its worker, the centre of the
|
|
42
|
-
* driver's geohash7 cell (~150 m, U-40); `pinExact` tells which.
|
|
42
|
+
* driver's geohash7 cell (~150 m, U-40); `pinExact` tells which. ZO-N26 (P-23): none for
|
|
43
|
+
* a driver finishing a ride (`freeAtMs`) — the pin would show the other rider's B.
|
|
43
44
|
*/
|
|
44
|
-
pin
|
|
45
|
+
pin?: Geo;
|
|
45
46
|
pinExact: boolean;
|
|
46
47
|
pinGeohash: string;
|
|
48
|
+
/**
|
|
49
|
+
* Seconds to the pickup from the offer's time (`validUntilMs` − 60 s). For a driver
|
|
50
|
+
* finishing a ride it holds the rest of that ride: see `etaToPickupNowSec`.
|
|
51
|
+
*/
|
|
47
52
|
etaToPickupSec: number;
|
|
53
|
+
/**
|
|
54
|
+
* ZO-N26 (P-23): the driver finishes another ride by then (with 2 min of margin) and
|
|
55
|
+
* comes after it — show "kończy kurs" and count `etaToPickupNowSec` down.
|
|
56
|
+
*/
|
|
57
|
+
freeAtMs?: number;
|
|
58
|
+
/** ZO-N26: the drive from the end of that ride to the pickup (the rest of the eta). */
|
|
59
|
+
toPickupAfterFreeSec?: number;
|
|
48
60
|
toPickupMeters: number;
|
|
49
61
|
rideMeters: number;
|
|
50
62
|
rideSec: number;
|
|
@@ -61,7 +73,8 @@ export interface OfferView {
|
|
|
61
73
|
/**
|
|
62
74
|
* P-17 (2026-10-24, route line): the driver's route in two legs, to draw on the map — the
|
|
63
75
|
* line from the driver's exact position to the pickup (A), and the ride A → B. Never prices
|
|
64
|
-
* anything: the driver gave it.
|
|
76
|
+
* anything: the driver gave it. P-23: `toPickup` is empty for a driver finishing a ride (no
|
|
77
|
+
* leg from the other rider's B).
|
|
65
78
|
*/
|
|
66
79
|
export interface RouteLineView {
|
|
67
80
|
toPickup: Geo[];
|
|
@@ -127,6 +140,11 @@ export interface RideView {
|
|
|
127
140
|
driverPosition?: Geo;
|
|
128
141
|
positionAtMs?: number;
|
|
129
142
|
etaToPickupSec?: number;
|
|
143
|
+
/**
|
|
144
|
+
* K-N10 (P-23): a queued ride — the driver ends the previous one by then; meanwhile no
|
|
145
|
+
* `driverPosition`, and `etaToPickupSec` holds the rest of that ride and the drive.
|
|
146
|
+
*/
|
|
147
|
+
freeAtMs?: number;
|
|
130
148
|
price: Money;
|
|
131
149
|
/** P-20: the driver takes cards — show "Zapłać kartą" once the ride is `inProgress`. False for an older driver canister. */
|
|
132
150
|
cardAccepted: boolean;
|
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,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,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,MAAM,WAAW,aAAa;IAC1B,UAAU,EAAE,MAAM,CAAC;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,WAAW,EAAE,MAAM,CAAC;CACvB;AAED,qFAAqF;AACrF,MAAM,MAAM,aAAa,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,QAAQ,EAAE,kBAAkB,CAAC;IAAC,KAAK,CAAC,EAAE,aAAa,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,CAAC"}
|
package/dist/mappers.d.ts
CHANGED
|
@@ -48,9 +48,15 @@ export declare function rateOutcomeOf(answer: CandidRateRideOutcome | {
|
|
|
48
48
|
}): RateRideOutcome | undefined;
|
|
49
49
|
export declare function driverOfOfferId(offerId: string): DriverRef;
|
|
50
50
|
export declare function offerOf(offer: CandidOfferView, simulator: string | undefined, host?: string): OfferView;
|
|
51
|
+
/**
|
|
52
|
+
* ZO-N26 (P-23): the seconds to the pickup now — for a driver finishing a ride, the rest of
|
|
53
|
+
* that ride counts down to 0, then the drive after it stays; otherwise the offer's eta.
|
|
54
|
+
*/
|
|
55
|
+
export declare function etaToPickupNowSec(offer: Pick<OfferView, "etaToPickupSec" | "freeAtMs" | "toPickupAfterFreeSec">, nowMs: number): number;
|
|
51
56
|
/**
|
|
52
57
|
* P-17: the line as the rider draws it — both legs decoded; undefined when a leg is not an
|
|
53
58
|
* encoded polyline or has fewer than two points (the driver gave it: drawn, never trusted).
|
|
59
|
+
* P-23: an empty `toPickup` (a driver finishing a ride) is no leg — `toPickup: []`.
|
|
54
60
|
*/
|
|
55
61
|
export declare function routeLineOf(line: RouteLine): RouteLineView | undefined;
|
|
56
62
|
/** U-42: the order new offers join the list in — by arrival, then a fixed tie-break. */
|
package/dist/mappers.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"mappers.d.ts","sourceRoot":"","sources":["../src/mappers.ts"],"names":[],"mappings":"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C,MAAM,CAAC,CAAA;CAAE,EAAE,IAAI,EAAE,GAAG,CAAC,MAAM,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,EAAE,OAAO,EAAE;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,KAAK,EAAE,MAAM,GAAG;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,CAAC,CAAA;CAAE,EAAE,CActM;AAID;;;GAGG;AACH,wBAAgB,WAAW,CAAC,MAAM,EAAE,QAAQ,GAAG,SAAS,EAAE,IAAI,EAAE,QAAQ,GAAG,QAAQ,CAalF"}
|
package/dist/mappers.js
CHANGED
|
@@ -140,14 +140,19 @@ export function offerOf(offer, simulator, host) {
|
|
|
140
140
|
// ZO-22: the exact position when the worker has it (none from an old worker: `[]`).
|
|
141
141
|
const exact = offer.driverPosition[0];
|
|
142
142
|
const pinExact = exact !== undefined && isValidGeo(exact);
|
|
143
|
+
// ZO-N26 (P-23): a driver finishing a ride — no pin, the eta in two parts.
|
|
144
|
+
const freeAtNs = offer.freeAtNs?.[0];
|
|
145
|
+
const freeAtMs = freeAtNs === undefined ? undefined : msOf(freeAtNs);
|
|
146
|
+
const pin = pinExact ? { lat: exact.lat, lng: exact.lng } : freeAtMs !== undefined ? undefined : (decodeGeohashCenter(offer.pinGeohash) ?? { lat: 0, lng: 0 });
|
|
143
147
|
return {
|
|
144
148
|
offerId: offerIdOf(canister, offer.driverKey),
|
|
145
149
|
card: cardOf(offer.card, canister, host),
|
|
146
150
|
driverRating: offer.driverRating[0] === undefined ? undefined : offer.driverRating[0] / 100,
|
|
147
|
-
pin
|
|
151
|
+
...(pin === undefined ? {} : { pin }),
|
|
148
152
|
pinExact,
|
|
149
153
|
pinGeohash: offer.pinGeohash,
|
|
150
154
|
etaToPickupSec: offer.etaToPickupSec,
|
|
155
|
+
...(freeAtMs === undefined ? {} : { freeAtMs, toPickupAfterFreeSec: afterFreeSec(offer.etaToPickupSec, freeAtMs, msOf(offer.validUntilNs) - OFFER_VALID_MS) }),
|
|
151
156
|
toPickupMeters: offer.toPickupMeters,
|
|
152
157
|
rideMeters: offer.rideMeters,
|
|
153
158
|
rideSec: offer.rideSec,
|
|
@@ -158,14 +163,30 @@ export function offerOf(offer, simulator, host) {
|
|
|
158
163
|
simulated: simulator !== undefined && canister === simulator,
|
|
159
164
|
};
|
|
160
165
|
}
|
|
166
|
+
/** P-23: an offer is valid this long from its time (U-39). */
|
|
167
|
+
const OFFER_VALID_MS = 60_000;
|
|
168
|
+
/** ZO-N26: the drive after the other ride — the eta at `quotedAtMs` less that ride's rest. */
|
|
169
|
+
function afterFreeSec(etaSec, freeAtMs, quotedAtMs) {
|
|
170
|
+
return Math.max(0, etaSec - Math.ceil(Math.max(0, freeAtMs - quotedAtMs) / 1000));
|
|
171
|
+
}
|
|
172
|
+
/**
|
|
173
|
+
* ZO-N26 (P-23): the seconds to the pickup now — for a driver finishing a ride, the rest of
|
|
174
|
+
* that ride counts down to 0, then the drive after it stays; otherwise the offer's eta.
|
|
175
|
+
*/
|
|
176
|
+
export function etaToPickupNowSec(offer, nowMs) {
|
|
177
|
+
if (offer.freeAtMs === undefined || offer.toPickupAfterFreeSec === undefined)
|
|
178
|
+
return offer.etaToPickupSec;
|
|
179
|
+
return Math.ceil(Math.max(0, offer.freeAtMs - nowMs) / 1000) + offer.toPickupAfterFreeSec;
|
|
180
|
+
}
|
|
161
181
|
/**
|
|
162
182
|
* P-17: the line as the rider draws it — both legs decoded; undefined when a leg is not an
|
|
163
183
|
* encoded polyline or has fewer than two points (the driver gave it: drawn, never trusted).
|
|
184
|
+
* P-23: an empty `toPickup` (a driver finishing a ride) is no leg — `toPickup: []`.
|
|
164
185
|
*/
|
|
165
186
|
export function routeLineOf(line) {
|
|
166
|
-
const toPickup = decodePolyline(line.toPickup);
|
|
187
|
+
const toPickup = line.toPickup === "" ? [] : decodePolyline(line.toPickup);
|
|
167
188
|
const ride = decodePolyline(line.ride);
|
|
168
|
-
if (toPickup === undefined || ride === undefined || toPickup.length < 2 || ride.length < 2)
|
|
189
|
+
if (toPickup === undefined || ride === undefined || (toPickup.length < 2 && line.toPickup !== "") || ride.length < 2)
|
|
169
190
|
return undefined;
|
|
170
191
|
return { toPickup, ride };
|
|
171
192
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@jsm-mit/tigi-sharded-package",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.12.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": {
|
|
@@ -60,11 +60,11 @@
|
|
|
60
60
|
"tigiSharded": {
|
|
61
61
|
"repo": "tigi-sharded",
|
|
62
62
|
"repoUrl": "https://github.com/JSM-Tigi/tigi-sharded",
|
|
63
|
-
"commit": "
|
|
63
|
+
"commit": "c2bb281e890aa5c4b47cb3d6f5ad33c6aa511b21"
|
|
64
64
|
},
|
|
65
65
|
"tigiDriverRust": {
|
|
66
66
|
"repo": "tigi-driver-rust",
|
|
67
67
|
"repoUrl": "https://github.com/JSM-Tigi/tigi-driver-rust",
|
|
68
|
-
"commit": "
|
|
68
|
+
"commit": "794ef65f7d17a78fc24d239c63f1a580afb2b491"
|
|
69
69
|
}
|
|
70
70
|
}
|