google-fli 0.1.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/LICENSE +21 -0
- package/README.md +158 -0
- package/dist/core/airports.d.ts +31 -0
- package/dist/core/airports.d.ts.map +1 -0
- package/dist/core/airports.js +168 -0
- package/dist/core/airports.js.map +1 -0
- package/dist/core/builders.d.ts +30 -0
- package/dist/core/builders.d.ts.map +1 -0
- package/dist/core/builders.js +113 -0
- package/dist/core/builders.js.map +1 -0
- package/dist/core/currency.d.ts +21 -0
- package/dist/core/currency.d.ts.map +1 -0
- package/dist/core/currency.js +172 -0
- package/dist/core/currency.js.map +1 -0
- package/dist/core/dates.d.ts +22 -0
- package/dist/core/dates.d.ts.map +1 -0
- package/dist/core/dates.js +41 -0
- package/dist/core/dates.js.map +1 -0
- package/dist/core/index.d.ts +7 -0
- package/dist/core/index.d.ts.map +1 -0
- package/dist/core/index.js +7 -0
- package/dist/core/index.js.map +1 -0
- package/dist/core/links.d.ts +39 -0
- package/dist/core/links.d.ts.map +1 -0
- package/dist/core/links.js +53 -0
- package/dist/core/links.js.map +1 -0
- package/dist/core/parsers.d.ts +34 -0
- package/dist/core/parsers.d.ts.map +1 -0
- package/dist/core/parsers.js +161 -0
- package/dist/core/parsers.js.map +1 -0
- package/dist/index.d.ts +30 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/models/airline.d.ts +1120 -0
- package/dist/models/airline.d.ts.map +1 -0
- package/dist/models/airline.js +2224 -0
- package/dist/models/airline.js.map +1 -0
- package/dist/models/airport.d.ts +7899 -0
- package/dist/models/airport.d.ts.map +1 -0
- package/dist/models/airport.js +15782 -0
- package/dist/models/airport.js.map +1 -0
- package/dist/models/google-flights/base.d.ts +232 -0
- package/dist/models/google-flights/base.d.ts.map +1 -0
- package/dist/models/google-flights/base.js +188 -0
- package/dist/models/google-flights/base.js.map +1 -0
- package/dist/models/google-flights/dates.d.ts +51 -0
- package/dist/models/google-flights/dates.d.ts.map +1 -0
- package/dist/models/google-flights/dates.js +222 -0
- package/dist/models/google-flights/dates.js.map +1 -0
- package/dist/models/google-flights/flights.d.ts +57 -0
- package/dist/models/google-flights/flights.d.ts.map +1 -0
- package/dist/models/google-flights/flights.js +224 -0
- package/dist/models/google-flights/flights.js.map +1 -0
- package/dist/models/google-flights/index.d.ts +4 -0
- package/dist/models/google-flights/index.d.ts.map +1 -0
- package/dist/models/google-flights/index.js +4 -0
- package/dist/models/google-flights/index.js.map +1 -0
- package/dist/models/index.d.ts +4 -0
- package/dist/models/index.d.ts.map +1 -0
- package/dist/models/index.js +4 -0
- package/dist/models/index.js.map +1 -0
- package/dist/search/client.d.ts +66 -0
- package/dist/search/client.d.ts.map +1 -0
- package/dist/search/client.js +205 -0
- package/dist/search/client.js.map +1 -0
- package/dist/search/concurrency.d.ts +45 -0
- package/dist/search/concurrency.d.ts.map +1 -0
- package/dist/search/concurrency.js +148 -0
- package/dist/search/concurrency.js.map +1 -0
- package/dist/search/dates.d.ts +33 -0
- package/dist/search/dates.d.ts.map +1 -0
- package/dist/search/dates.js +159 -0
- package/dist/search/dates.js.map +1 -0
- package/dist/search/decoders.d.ts +22 -0
- package/dist/search/decoders.d.ts.map +1 -0
- package/dist/search/decoders.js +333 -0
- package/dist/search/decoders.js.map +1 -0
- package/dist/search/exceptions.d.ts +21 -0
- package/dist/search/exceptions.d.ts.map +1 -0
- package/dist/search/exceptions.js +37 -0
- package/dist/search/exceptions.js.map +1 -0
- package/dist/search/flights.d.ts +57 -0
- package/dist/search/flights.d.ts.map +1 -0
- package/dist/search/flights.js +298 -0
- package/dist/search/flights.js.map +1 -0
- package/dist/search/helpers.d.ts +10 -0
- package/dist/search/helpers.d.ts.map +1 -0
- package/dist/search/helpers.js +30 -0
- package/dist/search/helpers.js.map +1 -0
- package/dist/search/index.d.ts +10 -0
- package/dist/search/index.d.ts.map +1 -0
- package/dist/search/index.js +10 -0
- package/dist/search/index.js.map +1 -0
- package/dist/search/proto.d.ts +69 -0
- package/dist/search/proto.d.ts.map +1 -0
- package/dist/search/proto.js +355 -0
- package/dist/search/proto.js.map +1 -0
- package/dist/search/urls.d.ts +9 -0
- package/dist/search/urls.d.ts.map +1 -0
- package/dist/search/urls.js +9 -0
- package/dist/search/urls.js.map +1 -0
- package/dist/search/wire.d.ts +14 -0
- package/dist/search/wire.d.ts.map +1 -0
- package/dist/search/wire.js +120 -0
- package/dist/search/wire.js.map +1 -0
- package/package.json +91 -0
|
@@ -0,0 +1,355 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal protobuf encoder for the GetBookingResults token.
|
|
3
|
+
*
|
|
4
|
+
* 1:1 port of fli/search/_proto.py — preserves the byte-perfect
|
|
5
|
+
* reproduction of a captured live booking token.
|
|
6
|
+
*/
|
|
7
|
+
import { Buffer } from "node:buffer";
|
|
8
|
+
function concatBytes(...parts) {
|
|
9
|
+
let total = 0;
|
|
10
|
+
for (const p of parts)
|
|
11
|
+
total += p.length;
|
|
12
|
+
const out = new Uint8Array(total);
|
|
13
|
+
let off = 0;
|
|
14
|
+
for (const p of parts) {
|
|
15
|
+
out.set(p, off);
|
|
16
|
+
off += p.length;
|
|
17
|
+
}
|
|
18
|
+
return out;
|
|
19
|
+
}
|
|
20
|
+
function varint(value) {
|
|
21
|
+
if (value < 0)
|
|
22
|
+
throw new Error("varint encoder takes non-negative ints only");
|
|
23
|
+
const bytes = [];
|
|
24
|
+
let v = value;
|
|
25
|
+
while (true) {
|
|
26
|
+
const byte = v & 0x7f;
|
|
27
|
+
v >>>= 7;
|
|
28
|
+
if (v > 0) {
|
|
29
|
+
bytes.push(byte | 0x80);
|
|
30
|
+
}
|
|
31
|
+
else {
|
|
32
|
+
bytes.push(byte);
|
|
33
|
+
break;
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
return new Uint8Array(bytes);
|
|
37
|
+
}
|
|
38
|
+
function tag(field, wire) {
|
|
39
|
+
return varint((field << 3) | wire);
|
|
40
|
+
}
|
|
41
|
+
function lengthDelim(field, payload) {
|
|
42
|
+
return concatBytes(tag(field, 2), varint(payload.length), payload);
|
|
43
|
+
}
|
|
44
|
+
function varintField(field, value) {
|
|
45
|
+
return concatBytes(tag(field, 0), varint(value));
|
|
46
|
+
}
|
|
47
|
+
function base64Encode(bytes) {
|
|
48
|
+
if (typeof Buffer !== "undefined") {
|
|
49
|
+
return Buffer.from(bytes).toString("base64");
|
|
50
|
+
}
|
|
51
|
+
let binary = "";
|
|
52
|
+
for (let i = 0; i < bytes.length; i++)
|
|
53
|
+
binary += String.fromCharCode(bytes[i]);
|
|
54
|
+
return btoa(binary);
|
|
55
|
+
}
|
|
56
|
+
function base64UrlsafeDecode(token) {
|
|
57
|
+
const padLen = (4 - (token.length % 4)) % 4;
|
|
58
|
+
const padded = token + "=".repeat(padLen);
|
|
59
|
+
const standard = padded.replace(/-/g, "+").replace(/_/g, "/");
|
|
60
|
+
if (typeof Buffer !== "undefined") {
|
|
61
|
+
return new Uint8Array(Buffer.from(standard, "base64"));
|
|
62
|
+
}
|
|
63
|
+
const bin = atob(standard);
|
|
64
|
+
const out = new Uint8Array(bin.length);
|
|
65
|
+
for (let i = 0; i < bin.length; i++)
|
|
66
|
+
out[i] = bin.charCodeAt(i);
|
|
67
|
+
return out;
|
|
68
|
+
}
|
|
69
|
+
const utf8 = new TextEncoder();
|
|
70
|
+
const utf8Decoder = new TextDecoder("utf-8", { fatal: false });
|
|
71
|
+
/**
|
|
72
|
+
* Construct the GetBookingResults outer[0][1] token.
|
|
73
|
+
*
|
|
74
|
+
* @returns base64-encoded protobuf token.
|
|
75
|
+
* @throws Error when any string argument is empty or price_cents is negative.
|
|
76
|
+
*/
|
|
77
|
+
export function buildBookingToken(args) {
|
|
78
|
+
const { sessionId, airlineCode, flightNumber, legIndex, priceCents } = args;
|
|
79
|
+
const currency = args.currency ?? "USD";
|
|
80
|
+
if (priceCents < 0)
|
|
81
|
+
throw new Error("price_cents must be non-negative");
|
|
82
|
+
if (!sessionId)
|
|
83
|
+
throw new Error("session_id must be non-empty");
|
|
84
|
+
if (!airlineCode)
|
|
85
|
+
throw new Error("airline_code must be non-empty");
|
|
86
|
+
if (!flightNumber)
|
|
87
|
+
throw new Error("flight_number must be non-empty");
|
|
88
|
+
if (!currency)
|
|
89
|
+
throw new Error("currency must be non-empty");
|
|
90
|
+
const nested = concatBytes(varintField(1, priceCents), varintField(2, 2), lengthDelim(3, utf8.encode(currency)));
|
|
91
|
+
const payload = concatBytes(lengthDelim(1, utf8.encode(sessionId)), lengthDelim(2, utf8.encode(`${airlineCode}${flightNumber}#${legIndex}`)), lengthDelim(3, nested), varintField(7, 28), varintField(14, priceCents));
|
|
92
|
+
return base64Encode(payload);
|
|
93
|
+
}
|
|
94
|
+
/** Varint reader; returns `[value, newOffset]`.
|
|
95
|
+
*
|
|
96
|
+
* Uses `+= chunk * 2**shift` instead of `|= chunk << shift` because
|
|
97
|
+
* JavaScript's bitwise operators coerce to signed 32-bit integers, so
|
|
98
|
+
* `<<` past bit 30 corrupts the result. Numbers stay accurate up to
|
|
99
|
+
* `Number.MAX_SAFE_INTEGER` (2^53 − 1), which is plenty for prices and
|
|
100
|
+
* field tags but stops short of the full protobuf 64-bit varint range.
|
|
101
|
+
*/
|
|
102
|
+
export function _readVarint(buf, off) {
|
|
103
|
+
let value = 0;
|
|
104
|
+
let shift = 0;
|
|
105
|
+
let offset = off;
|
|
106
|
+
while (true) {
|
|
107
|
+
const byte = buf[offset];
|
|
108
|
+
if (byte === undefined)
|
|
109
|
+
throw new RangeError(`Truncated varint at offset ${offset}`);
|
|
110
|
+
offset++;
|
|
111
|
+
value += (byte & 0x7f) * 2 ** shift;
|
|
112
|
+
if ((byte & 0x80) === 0) {
|
|
113
|
+
if (!Number.isSafeInteger(value)) {
|
|
114
|
+
throw new Error("Varint exceeds Number.MAX_SAFE_INTEGER");
|
|
115
|
+
}
|
|
116
|
+
return [value, offset];
|
|
117
|
+
}
|
|
118
|
+
shift += 7;
|
|
119
|
+
if (shift >= 64)
|
|
120
|
+
throw new Error("Varint is too large to decode");
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
/** Decode a booking token (round-trip helper used by tests). */
|
|
124
|
+
export function decodeBookingToken(token) {
|
|
125
|
+
const raw = base64UrlsafeDecode(token);
|
|
126
|
+
const result = {};
|
|
127
|
+
let offset = 0;
|
|
128
|
+
while (offset < raw.length) {
|
|
129
|
+
const [tagVal, afterTag] = _readVarint(raw, offset);
|
|
130
|
+
offset = afterTag;
|
|
131
|
+
const field = tagVal >> 3;
|
|
132
|
+
const wire = tagVal & 0x07;
|
|
133
|
+
if (wire === 0) {
|
|
134
|
+
const [val, afterVal] = _readVarint(raw, offset);
|
|
135
|
+
offset = afterVal;
|
|
136
|
+
result[`field_${field}`] = val;
|
|
137
|
+
}
|
|
138
|
+
else if (wire === 2) {
|
|
139
|
+
const [length, afterLen] = _readVarint(raw, offset);
|
|
140
|
+
offset = afterLen;
|
|
141
|
+
const data = raw.subarray(offset, offset + length);
|
|
142
|
+
offset += length;
|
|
143
|
+
// Try printable ASCII string.
|
|
144
|
+
let ascii = "";
|
|
145
|
+
let printable = true;
|
|
146
|
+
for (let i = 0; i < data.length; i++) {
|
|
147
|
+
const c = data[i];
|
|
148
|
+
if (c < 0x20 || c > 0x7e) {
|
|
149
|
+
printable = false;
|
|
150
|
+
break;
|
|
151
|
+
}
|
|
152
|
+
ascii += String.fromCharCode(c);
|
|
153
|
+
}
|
|
154
|
+
if (printable && data.length > 0) {
|
|
155
|
+
result[`field_${field}`] = ascii;
|
|
156
|
+
continue;
|
|
157
|
+
}
|
|
158
|
+
// Otherwise try nested message.
|
|
159
|
+
try {
|
|
160
|
+
const nested = {};
|
|
161
|
+
let noff = 0;
|
|
162
|
+
let bailedOut = false;
|
|
163
|
+
while (noff < data.length) {
|
|
164
|
+
const [ntag, afterNtag] = _readVarint(data, noff);
|
|
165
|
+
noff = afterNtag;
|
|
166
|
+
const nfield = ntag >> 3;
|
|
167
|
+
const nwire = ntag & 0x07;
|
|
168
|
+
if (nwire === 0) {
|
|
169
|
+
const [v, afterV] = _readVarint(data, noff);
|
|
170
|
+
noff = afterV;
|
|
171
|
+
nested[`field_${nfield}`] = v;
|
|
172
|
+
}
|
|
173
|
+
else if (nwire === 2) {
|
|
174
|
+
const [nl, afterNl] = _readVarint(data, noff);
|
|
175
|
+
noff = afterNl;
|
|
176
|
+
const slice = data.subarray(noff, noff + nl);
|
|
177
|
+
nested[`field_${nfield}`] = utf8Decoder.decode(slice);
|
|
178
|
+
noff += nl;
|
|
179
|
+
}
|
|
180
|
+
else {
|
|
181
|
+
bailedOut = true;
|
|
182
|
+
break;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
if (bailedOut)
|
|
186
|
+
throw new Error("nested parse bailed");
|
|
187
|
+
result[`field_${field}`] = nested;
|
|
188
|
+
}
|
|
189
|
+
catch {
|
|
190
|
+
// Not a nested message — store as hex.
|
|
191
|
+
let hex = "";
|
|
192
|
+
for (let i = 0; i < data.length; i++) {
|
|
193
|
+
hex += data[i].toString(16).padStart(2, "0");
|
|
194
|
+
}
|
|
195
|
+
result[`field_${field}`] = hex;
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
else {
|
|
199
|
+
throw new Error(`unsupported wire type ${wire} at offset ${offset}`);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
return result;
|
|
203
|
+
}
|
|
204
|
+
/** Extract the booking token from a `tfu` URL parameter (or full URL). */
|
|
205
|
+
export function extractBookingTokenFromTfu(tfu) {
|
|
206
|
+
let value = tfu;
|
|
207
|
+
if (value.includes("tfu=")) {
|
|
208
|
+
let parsed;
|
|
209
|
+
try {
|
|
210
|
+
parsed = new URL(value);
|
|
211
|
+
}
|
|
212
|
+
catch (e) {
|
|
213
|
+
throw new Error(`tfu input is not a parseable URL: ${e.message}`);
|
|
214
|
+
}
|
|
215
|
+
const fromUrl = parsed.searchParams.get("tfu");
|
|
216
|
+
if (!fromUrl)
|
|
217
|
+
throw new Error("URL has no `tfu` query parameter");
|
|
218
|
+
value = fromUrl;
|
|
219
|
+
}
|
|
220
|
+
let raw;
|
|
221
|
+
try {
|
|
222
|
+
raw = base64UrlsafeDecode(value);
|
|
223
|
+
}
|
|
224
|
+
catch (e) {
|
|
225
|
+
throw new Error(`tfu is not valid base64: ${e.message}`);
|
|
226
|
+
}
|
|
227
|
+
let off = 0;
|
|
228
|
+
while (off < raw.length) {
|
|
229
|
+
const [tagVal, afterTag] = _readVarint(raw, off);
|
|
230
|
+
off = afterTag;
|
|
231
|
+
const field = tagVal >> 3;
|
|
232
|
+
const wire = tagVal & 0x07;
|
|
233
|
+
if (wire === 0) {
|
|
234
|
+
const [, afterVal] = _readVarint(raw, off);
|
|
235
|
+
off = afterVal;
|
|
236
|
+
}
|
|
237
|
+
else if (wire === 2) {
|
|
238
|
+
const [length, afterLen] = _readVarint(raw, off);
|
|
239
|
+
off = afterLen;
|
|
240
|
+
const data = raw.subarray(off, off + length);
|
|
241
|
+
off += length;
|
|
242
|
+
if (field === 1) {
|
|
243
|
+
// Decode as ASCII (the inner field is itself base64 text).
|
|
244
|
+
let ascii = "";
|
|
245
|
+
for (let i = 0; i < data.length; i++) {
|
|
246
|
+
const c = data[i];
|
|
247
|
+
if (c > 0x7e)
|
|
248
|
+
throw new Error("tfu field 1 is not ASCII");
|
|
249
|
+
ascii += String.fromCharCode(c);
|
|
250
|
+
}
|
|
251
|
+
// Re-normalise to the standard base64 alphabet so the downstream parser accepts it.
|
|
252
|
+
return ascii.trim().replace(/=+$/, "");
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
else if (wire === 5) {
|
|
256
|
+
off += 4;
|
|
257
|
+
}
|
|
258
|
+
else if (wire === 1) {
|
|
259
|
+
off += 8;
|
|
260
|
+
}
|
|
261
|
+
else {
|
|
262
|
+
throw new Error(`unsupported wire type ${wire} at offset ${off}`);
|
|
263
|
+
}
|
|
264
|
+
}
|
|
265
|
+
throw new Error("tfu protobuf has no field 1 (booking token)");
|
|
266
|
+
}
|
|
267
|
+
/** Extract the booking session id from a `tfu` parameter. */
|
|
268
|
+
export function extractSessionIdFromTfu(tfu) {
|
|
269
|
+
const inner = extractBookingTokenFromTfu(tfu);
|
|
270
|
+
const decoded = decodeBookingToken(inner);
|
|
271
|
+
const session = decoded.field_1;
|
|
272
|
+
if (typeof session !== "string") {
|
|
273
|
+
throw new Error("inner booking token has no field 1 (session id)");
|
|
274
|
+
}
|
|
275
|
+
return session;
|
|
276
|
+
}
|
|
277
|
+
// ---------------------------------------------------------------------------
|
|
278
|
+
// Deep-link URL parameter builder (tfs)
|
|
279
|
+
// ---------------------------------------------------------------------------
|
|
280
|
+
/**
|
|
281
|
+
* Encode a non-negative BigInt as a protobuf varint.
|
|
282
|
+
*
|
|
283
|
+
* The `number`-based {@link varint} cannot represent values above
|
|
284
|
+
* `Number.MAX_SAFE_INTEGER`; the `tfs` token's f16 field is max-uint64, so it
|
|
285
|
+
* needs a BigInt encoder.
|
|
286
|
+
*/
|
|
287
|
+
function varintBig(value) {
|
|
288
|
+
if (value < 0n)
|
|
289
|
+
throw new Error("varint encoder takes non-negative ints only");
|
|
290
|
+
const bytes = [];
|
|
291
|
+
let v = value;
|
|
292
|
+
while (true) {
|
|
293
|
+
const byte = Number(v & 0x7fn);
|
|
294
|
+
v >>= 7n;
|
|
295
|
+
if (v > 0n) {
|
|
296
|
+
bytes.push(byte | 0x80);
|
|
297
|
+
}
|
|
298
|
+
else {
|
|
299
|
+
bytes.push(byte);
|
|
300
|
+
break;
|
|
301
|
+
}
|
|
302
|
+
}
|
|
303
|
+
return new Uint8Array(bytes);
|
|
304
|
+
}
|
|
305
|
+
/**
|
|
306
|
+
* Encode bytes as URL-safe base64 without `=` padding.
|
|
307
|
+
*
|
|
308
|
+
* The `tfs` query parameter uses the urlsafe alphabet (`-`/`_`) with padding
|
|
309
|
+
* stripped.
|
|
310
|
+
*/
|
|
311
|
+
function toUrlsafeB64(bytes) {
|
|
312
|
+
if (typeof Buffer !== "undefined") {
|
|
313
|
+
return Buffer.from(bytes).toString("base64url");
|
|
314
|
+
}
|
|
315
|
+
return base64Encode(bytes).replace(/\+/g, "-").replace(/\//g, "_").replace(/=+$/, "");
|
|
316
|
+
}
|
|
317
|
+
/**
|
|
318
|
+
* Build the `tfs` query parameter for a Google Flights deep-link URL.
|
|
319
|
+
*
|
|
320
|
+
* The `tfs` token encodes the complete itinerary — one segment per travel
|
|
321
|
+
* direction, each segment containing one leg per physical flight. It is
|
|
322
|
+
* deterministic (no session id required) and can be constructed purely from
|
|
323
|
+
* search-result data.
|
|
324
|
+
*
|
|
325
|
+
* 1:1 port of fli/search/_proto.py::build_tfs_token.
|
|
326
|
+
*
|
|
327
|
+
* @throws Error when `segments` is empty or any segment has no legs.
|
|
328
|
+
*/
|
|
329
|
+
export function buildTfsToken(segments, options = {}) {
|
|
330
|
+
const isOneWay = options.isOneWay ?? true;
|
|
331
|
+
if (segments.length === 0)
|
|
332
|
+
throw new Error("segments must be non-empty");
|
|
333
|
+
for (let i = 0; i < segments.length; i++) {
|
|
334
|
+
const seg = segments[i];
|
|
335
|
+
if (!seg || seg.length === 0)
|
|
336
|
+
throw new Error(`segment ${i} has no legs`);
|
|
337
|
+
}
|
|
338
|
+
let segmentProtos = new Uint8Array(0);
|
|
339
|
+
for (const seg of segments) {
|
|
340
|
+
let legsProto = new Uint8Array(0);
|
|
341
|
+
for (const leg of seg) {
|
|
342
|
+
const legProto = concatBytes(lengthDelim(1, utf8.encode(leg.origin)), lengthDelim(2, utf8.encode(leg.depDate)), lengthDelim(3, utf8.encode(leg.dest)), lengthDelim(5, utf8.encode(leg.airline)), lengthDelim(6, utf8.encode(leg.flightNumber)));
|
|
343
|
+
legsProto = concatBytes(legsProto, lengthDelim(4, legProto));
|
|
344
|
+
}
|
|
345
|
+
const first = seg[0];
|
|
346
|
+
const last = seg[seg.length - 1];
|
|
347
|
+
const segProto = concatBytes(lengthDelim(2, utf8.encode(first.depDate)), legsProto, lengthDelim(13, concatBytes(varintField(1, 1), lengthDelim(2, utf8.encode(first.origin)))), lengthDelim(14, concatBytes(varintField(1, 1), lengthDelim(2, utf8.encode(last.dest)))));
|
|
348
|
+
segmentProtos = concatBytes(segmentProtos, lengthDelim(3, segProto));
|
|
349
|
+
}
|
|
350
|
+
const MAX_U64 = (1n << 64n) - 1n;
|
|
351
|
+
const f19 = isOneWay ? 2 : 1;
|
|
352
|
+
const payload = concatBytes(varintField(1, 28), varintField(2, 2), segmentProtos, varintField(8, 1), varintField(9, 1), varintField(14, 1), lengthDelim(16, concatBytes(tag(1, 0), varintBig(MAX_U64))), varintField(19, f19));
|
|
353
|
+
return toUrlsafeB64(payload);
|
|
354
|
+
}
|
|
355
|
+
//# sourceMappingURL=proto.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"proto.js","sourceRoot":"","sources":["../../src/search/proto.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,SAAS,WAAW,CAAC,GAAG,KAAmB;IACzC,IAAI,KAAK,GAAG,CAAC,CAAC;IACd,KAAK,MAAM,CAAC,IAAI,KAAK;QAAE,KAAK,IAAI,CAAC,CAAC,MAAM,CAAC;IACzC,MAAM,GAAG,GAAG,IAAI,UAAU,CAAC,KAAK,CAAC,CAAC;IAClC,IAAI,GAAG,GAAG,CAAC,CAAC;IACZ,KAAK,MAAM,CAAC,IAAI,KAAK,EAAE,CAAC;QACtB,GAAG,CAAC,GAAG,CAAC,CAAC,EAAE,GAAG,CAAC,CAAC;QAChB,GAAG,IAAI,CAAC,CAAC,MAAM,CAAC;IAClB,CAAC;IACD,OAAO,GAAG,CAAC;AACb,CAAC;AAED,SAAS,MAAM,CAAC,KAAa;IAC3B,IAAI,KAAK,GAAG,CAAC;QAAE,MAAM,IAAI,KAAK,CAAC,6CAA6C,CAAC,CAAC;IAC9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EAAE,QAAQ,CAAC,CAAC,CAAC;IACvE,CAAC;IAED,MAAM,OAAO,GAAG,CAAC,EAAE,IAAI,GAAG,CAAC,GAAG,EAAE,CAAC;IACjC,MAAM,GAAG,GAAG,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAE7B,MAAM,OAAO,GAAG,WAAW,CACzB,WAAW,CAAC,CAAC,EAAE,EAAE,CAAC,EAClB,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,EACjB,aAAa,EACb,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,EACjB,WAAW,CAAC,CAAC,EAAE,CAAC,CAAC,EACjB,WAAW,CAAC,EAAE,EAAE,CAAC,CAAC,EAClB,WAAW,CAAC,EAAE,EAAE,WAAW,CAAC,GAAG,CAAC,CAAC,EAAE,CAAC,CAAC,EAAE,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAC3D,WAAW,CAAC,EAAE,EAAE,GAAG,CAAC,CACrB,CAAC;IACF,OAAO,YAAY,CAAC,OAAO,CAAC,CAAC;AAC/B,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL helpers for the FlightsFrontendService RPCs.
|
|
3
|
+
*
|
|
4
|
+
* The implementation lives in `core/links.ts` so the same helper can build the
|
|
5
|
+
* public-facing Google Flights deep links. Re-exported here to keep
|
|
6
|
+
* `search/urls.ts` stable for existing importers.
|
|
7
|
+
*/
|
|
8
|
+
export { withLocaleParams } from "../core/links.ts";
|
|
9
|
+
//# sourceMappingURL=urls.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urls.d.ts","sourceRoot":"","sources":["../../src/search/urls.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* URL helpers for the FlightsFrontendService RPCs.
|
|
3
|
+
*
|
|
4
|
+
* The implementation lives in `core/links.ts` so the same helper can build the
|
|
5
|
+
* public-facing Google Flights deep links. Re-exported here to keep
|
|
6
|
+
* `search/urls.ts` stable for existing importers.
|
|
7
|
+
*/
|
|
8
|
+
export { withLocaleParams } from "../core/links.js";
|
|
9
|
+
//# sourceMappingURL=urls.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"urls.js","sourceRoot":"","sources":["../../src/search/urls.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAEH,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parser for Google Flights' FlightsFrontendService wire format.
|
|
3
|
+
*
|
|
4
|
+
* 1:1 port of fli/search/_wire.py — handles both the legacy single-chunk
|
|
5
|
+
* JSONP shape and the multi-chunk format used by GetBookingResults.
|
|
6
|
+
*
|
|
7
|
+
* Important quirk: the length headers count UTF-8 BYTES, not characters,
|
|
8
|
+
* so the parser operates on `Uint8Array` rather than the JS string.
|
|
9
|
+
*/
|
|
10
|
+
/** Yield the inner JSON of every `wrb.fr` chunk in `body`. */
|
|
11
|
+
export declare function iterWrbChunks(body: string | Uint8Array): Generator<unknown>;
|
|
12
|
+
/** Return the inner JSON of the first `wrb.fr` chunk, or `null`. */
|
|
13
|
+
export declare function parseFirstWrbPayload(body: string | Uint8Array): unknown;
|
|
14
|
+
//# sourceMappingURL=wire.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire.d.ts","sourceRoot":"","sources":["../../src/search/wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAoDH,8DAA8D;AAC9D,wBAAiB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,SAAS,CAAC,OAAO,CAAC,CA4C5E;AAED,oEAAoE;AACpE,wBAAgB,oBAAoB,CAAC,IAAI,EAAE,MAAM,GAAG,UAAU,GAAG,OAAO,CAKvE"}
|
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Parser for Google Flights' FlightsFrontendService wire format.
|
|
3
|
+
*
|
|
4
|
+
* 1:1 port of fli/search/_wire.py — handles both the legacy single-chunk
|
|
5
|
+
* JSONP shape and the multi-chunk format used by GetBookingResults.
|
|
6
|
+
*
|
|
7
|
+
* Important quirk: the length headers count UTF-8 BYTES, not characters,
|
|
8
|
+
* so the parser operates on `Uint8Array` rather than the JS string.
|
|
9
|
+
*/
|
|
10
|
+
const PREFIX = ")]}'";
|
|
11
|
+
const PREFIX_BYTES = new TextEncoder().encode(PREFIX);
|
|
12
|
+
const decoder = new TextDecoder("utf-8", { fatal: false });
|
|
13
|
+
function toBytes(body) {
|
|
14
|
+
if (body instanceof Uint8Array)
|
|
15
|
+
return body;
|
|
16
|
+
return new TextEncoder().encode(body);
|
|
17
|
+
}
|
|
18
|
+
function lstrip(buf) {
|
|
19
|
+
let i = 0;
|
|
20
|
+
while (i < buf.length) {
|
|
21
|
+
const b = buf[i];
|
|
22
|
+
if (b !== 0x20 && b !== 0x09 && b !== 0x0a && b !== 0x0d)
|
|
23
|
+
break;
|
|
24
|
+
i++;
|
|
25
|
+
}
|
|
26
|
+
return buf.subarray(i);
|
|
27
|
+
}
|
|
28
|
+
function startsWith(buf, prefix) {
|
|
29
|
+
if (buf.length < prefix.length)
|
|
30
|
+
return false;
|
|
31
|
+
for (let i = 0; i < prefix.length; i++) {
|
|
32
|
+
if (buf[i] !== prefix[i])
|
|
33
|
+
return false;
|
|
34
|
+
}
|
|
35
|
+
return true;
|
|
36
|
+
}
|
|
37
|
+
function indexOfByte(buf, byte, from = 0) {
|
|
38
|
+
for (let i = from; i < buf.length; i++) {
|
|
39
|
+
if (buf[i] === byte)
|
|
40
|
+
return i;
|
|
41
|
+
}
|
|
42
|
+
return -1;
|
|
43
|
+
}
|
|
44
|
+
function* chunksFromOuter(outer) {
|
|
45
|
+
if (!Array.isArray(outer))
|
|
46
|
+
return;
|
|
47
|
+
for (const row of outer) {
|
|
48
|
+
if (!Array.isArray(row) || row.length < 3)
|
|
49
|
+
continue;
|
|
50
|
+
if (row[0] !== "wrb.fr")
|
|
51
|
+
continue;
|
|
52
|
+
const inner = row[2];
|
|
53
|
+
if (typeof inner !== "string" || inner.length === 0)
|
|
54
|
+
continue;
|
|
55
|
+
try {
|
|
56
|
+
yield JSON.parse(inner);
|
|
57
|
+
}
|
|
58
|
+
catch {
|
|
59
|
+
// Skip malformed inner JSON.
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
/** Yield the inner JSON of every `wrb.fr` chunk in `body`. */
|
|
64
|
+
export function* iterWrbChunks(body) {
|
|
65
|
+
let raw = toBytes(body);
|
|
66
|
+
raw = lstrip(raw);
|
|
67
|
+
if (startsWith(raw, PREFIX_BYTES)) {
|
|
68
|
+
raw = raw.subarray(PREFIX_BYTES.length);
|
|
69
|
+
}
|
|
70
|
+
raw = lstrip(raw);
|
|
71
|
+
if (raw.length === 0)
|
|
72
|
+
return;
|
|
73
|
+
// Fast path: legacy single-chunk responses with no length headers.
|
|
74
|
+
const first = raw[0];
|
|
75
|
+
if (first === undefined || first < 0x30 || first > 0x39) {
|
|
76
|
+
try {
|
|
77
|
+
const outer = JSON.parse(decoder.decode(raw));
|
|
78
|
+
yield* chunksFromOuter(outer);
|
|
79
|
+
}
|
|
80
|
+
catch {
|
|
81
|
+
// Discard malformed body.
|
|
82
|
+
}
|
|
83
|
+
return;
|
|
84
|
+
}
|
|
85
|
+
let cursor = 0;
|
|
86
|
+
while (cursor < raw.length) {
|
|
87
|
+
const end = indexOfByte(raw, 0x0a, cursor);
|
|
88
|
+
if (end === -1)
|
|
89
|
+
break;
|
|
90
|
+
const headerText = decoder.decode(raw.subarray(cursor, end));
|
|
91
|
+
// Python's `int(...)` raises on `"12abc"`; `Number.parseInt` returns 12,
|
|
92
|
+
// which would slip the parser into garbage chunk offsets. Require a pure
|
|
93
|
+
// decimal header to keep wire-format strictness in sync.
|
|
94
|
+
if (!/^[0-9]+$/.test(headerText))
|
|
95
|
+
break;
|
|
96
|
+
const length = Number.parseInt(headerText, 10);
|
|
97
|
+
if (!Number.isFinite(length))
|
|
98
|
+
break;
|
|
99
|
+
cursor = end + 1;
|
|
100
|
+
const chunkBytes = Math.max(length - 1, 0);
|
|
101
|
+
const payload = raw.subarray(cursor, cursor + chunkBytes);
|
|
102
|
+
cursor += chunkBytes;
|
|
103
|
+
try {
|
|
104
|
+
const trimmed = decoder.decode(payload).trim();
|
|
105
|
+
const outer = JSON.parse(trimmed);
|
|
106
|
+
yield* chunksFromOuter(outer);
|
|
107
|
+
}
|
|
108
|
+
catch {
|
|
109
|
+
// Discard malformed chunks.
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
/** Return the inner JSON of the first `wrb.fr` chunk, or `null`. */
|
|
114
|
+
export function parseFirstWrbPayload(body) {
|
|
115
|
+
for (const chunk of iterWrbChunks(body)) {
|
|
116
|
+
return chunk;
|
|
117
|
+
}
|
|
118
|
+
return null;
|
|
119
|
+
}
|
|
120
|
+
//# sourceMappingURL=wire.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"wire.js","sourceRoot":"","sources":["../../src/search/wire.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,MAAM,MAAM,GAAG,MAAM,CAAC;AACtB,MAAM,YAAY,GAAG,IAAI,WAAW,EAAE,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC;AAEtD,MAAM,OAAO,GAAG,IAAI,WAAW,CAAC,OAAO,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC;AAE3D,SAAS,OAAO,CAAC,IAAyB;IACxC,IAAI,IAAI,YAAY,UAAU;QAAE,OAAO,IAAI,CAAC;IAC5C,OAAO,IAAI,WAAW,EAAE,CAAC,MAAM,CA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AAyB;IAC5D,KAAK,MAAM,KAAK,IAAI,aAAa,CAAC,IAAI,CAAC,EAAE,CAAC;QACxC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "google-fli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "Programmatic access to Google Flights data — TypeScript client with direct API interaction, no scraping, no LLM.",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.js",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"default": "./dist/index.js"
|
|
14
|
+
},
|
|
15
|
+
"./models": {
|
|
16
|
+
"types": "./dist/models/index.d.ts",
|
|
17
|
+
"import": "./dist/models/index.js",
|
|
18
|
+
"default": "./dist/models/index.js"
|
|
19
|
+
},
|
|
20
|
+
"./core": {
|
|
21
|
+
"types": "./dist/core/index.d.ts",
|
|
22
|
+
"import": "./dist/core/index.js",
|
|
23
|
+
"default": "./dist/core/index.js"
|
|
24
|
+
},
|
|
25
|
+
"./search": {
|
|
26
|
+
"types": "./dist/search/index.d.ts",
|
|
27
|
+
"import": "./dist/search/index.js",
|
|
28
|
+
"default": "./dist/search/index.js"
|
|
29
|
+
}
|
|
30
|
+
},
|
|
31
|
+
"files": [
|
|
32
|
+
"dist",
|
|
33
|
+
"README.md",
|
|
34
|
+
"LICENSE"
|
|
35
|
+
],
|
|
36
|
+
"sideEffects": false,
|
|
37
|
+
"scripts": {
|
|
38
|
+
"build": "rm -rf dist && tsc -p tsconfig.build.json",
|
|
39
|
+
"typecheck": "tsc --noEmit",
|
|
40
|
+
"format": "biome format --write .",
|
|
41
|
+
"format:check": "biome format .",
|
|
42
|
+
"lint": "biome check . && oxlint .",
|
|
43
|
+
"lint:fix": "biome check --write . && oxlint --fix .",
|
|
44
|
+
"test": "bun test tests/models tests/core tests/search tests/integration",
|
|
45
|
+
"test:all": "bun test",
|
|
46
|
+
"test:e2e": "FLI_E2E=1 bun test tests/e2e",
|
|
47
|
+
"test:watch": "bun test --watch tests/models tests/core tests/search tests/integration",
|
|
48
|
+
"test:coverage": "bun test --coverage tests/models tests/core tests/search tests/integration",
|
|
49
|
+
"test:ci": "bun test --coverage --coverage-reporter=text --coverage-reporter=lcov --reporter=junit --reporter-outfile=./junit.xml tests/models tests/core tests/search tests/integration",
|
|
50
|
+
"generate:enums": "bun run scripts/generate-enums.ts",
|
|
51
|
+
"ci": "pnpm format:check && pnpm lint && pnpm typecheck && pnpm test",
|
|
52
|
+
"prepublishOnly": "pnpm build"
|
|
53
|
+
},
|
|
54
|
+
"packageManager": "pnpm@11.8.0",
|
|
55
|
+
"keywords": [
|
|
56
|
+
"flights",
|
|
57
|
+
"google-flights",
|
|
58
|
+
"travel",
|
|
59
|
+
"api",
|
|
60
|
+
"flight-search",
|
|
61
|
+
"typescript"
|
|
62
|
+
],
|
|
63
|
+
"author": "John Roma <john@anthood.com>",
|
|
64
|
+
"license": "MIT",
|
|
65
|
+
"repository": {
|
|
66
|
+
"type": "git",
|
|
67
|
+
"url": "git+https://github.com/johnroma/google-fli.git"
|
|
68
|
+
},
|
|
69
|
+
"homepage": "https://github.com/johnroma/google-fli#readme",
|
|
70
|
+
"bugs": {
|
|
71
|
+
"url": "https://github.com/johnroma/google-fli/issues"
|
|
72
|
+
},
|
|
73
|
+
"publishConfig": {
|
|
74
|
+
"access": "public",
|
|
75
|
+
"provenance": true
|
|
76
|
+
},
|
|
77
|
+
"engines": {
|
|
78
|
+
"node": ">=20.0.0",
|
|
79
|
+
"pnpm": ">=9.0.0"
|
|
80
|
+
},
|
|
81
|
+
"dependencies": {
|
|
82
|
+
"zod": "^4.4.3"
|
|
83
|
+
},
|
|
84
|
+
"devDependencies": {
|
|
85
|
+
"@biomejs/biome": "^2.4.15",
|
|
86
|
+
"@types/bun": "^1.1.14",
|
|
87
|
+
"@types/node": "^25.9.1",
|
|
88
|
+
"oxlint": "^1.66.0",
|
|
89
|
+
"typescript": "^6.0.3"
|
|
90
|
+
}
|
|
91
|
+
}
|