letsfg 1.0.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/dist/index.js ADDED
@@ -0,0 +1,511 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // src/index.ts
31
+ var index_exports = {};
32
+ __export(index_exports, {
33
+ AuthenticationError: () => AuthenticationError,
34
+ BoostedTravel: () => BoostedTravel,
35
+ BoostedTravelError: () => BoostedTravelError,
36
+ ErrorCategory: () => ErrorCategory,
37
+ ErrorCode: () => ErrorCode,
38
+ LetsFG: () => LetsFG,
39
+ LetsFGError: () => LetsFGError,
40
+ OfferExpiredError: () => OfferExpiredError,
41
+ PaymentRequiredError: () => PaymentRequiredError,
42
+ ValidationError: () => ValidationError,
43
+ cheapestOffer: () => cheapestOffer,
44
+ default: () => index_default,
45
+ getSystemInfo: () => systemInfo,
46
+ localSearch: () => searchLocal,
47
+ offerSummary: () => offerSummary,
48
+ searchLocal: () => searchLocal,
49
+ systemInfo: () => systemInfo
50
+ });
51
+ module.exports = __toCommonJS(index_exports);
52
+ var ErrorCode = {
53
+ // Transient (safe to retry after short delay)
54
+ SUPPLIER_TIMEOUT: "SUPPLIER_TIMEOUT",
55
+ RATE_LIMITED: "RATE_LIMITED",
56
+ SERVICE_UNAVAILABLE: "SERVICE_UNAVAILABLE",
57
+ NETWORK_ERROR: "NETWORK_ERROR",
58
+ // Validation (fix input, then retry)
59
+ INVALID_IATA: "INVALID_IATA",
60
+ INVALID_DATE: "INVALID_DATE",
61
+ INVALID_PASSENGERS: "INVALID_PASSENGERS",
62
+ UNSUPPORTED_ROUTE: "UNSUPPORTED_ROUTE",
63
+ MISSING_PARAMETER: "MISSING_PARAMETER",
64
+ INVALID_PARAMETER: "INVALID_PARAMETER",
65
+ // Business (requires human decision)
66
+ AUTH_INVALID: "AUTH_INVALID",
67
+ PAYMENT_REQUIRED: "PAYMENT_REQUIRED",
68
+ PAYMENT_DECLINED: "PAYMENT_DECLINED",
69
+ OFFER_EXPIRED: "OFFER_EXPIRED",
70
+ OFFER_NOT_UNLOCKED: "OFFER_NOT_UNLOCKED",
71
+ FARE_CHANGED: "FARE_CHANGED",
72
+ ALREADY_BOOKED: "ALREADY_BOOKED",
73
+ BOOKING_FAILED: "BOOKING_FAILED"
74
+ };
75
+ var ErrorCategory = {
76
+ TRANSIENT: "transient",
77
+ VALIDATION: "validation",
78
+ BUSINESS: "business"
79
+ };
80
+ var CODE_TO_CATEGORY = {
81
+ [ErrorCode.SUPPLIER_TIMEOUT]: ErrorCategory.TRANSIENT,
82
+ [ErrorCode.RATE_LIMITED]: ErrorCategory.TRANSIENT,
83
+ [ErrorCode.SERVICE_UNAVAILABLE]: ErrorCategory.TRANSIENT,
84
+ [ErrorCode.NETWORK_ERROR]: ErrorCategory.TRANSIENT,
85
+ [ErrorCode.INVALID_IATA]: ErrorCategory.VALIDATION,
86
+ [ErrorCode.INVALID_DATE]: ErrorCategory.VALIDATION,
87
+ [ErrorCode.INVALID_PASSENGERS]: ErrorCategory.VALIDATION,
88
+ [ErrorCode.UNSUPPORTED_ROUTE]: ErrorCategory.VALIDATION,
89
+ [ErrorCode.MISSING_PARAMETER]: ErrorCategory.VALIDATION,
90
+ [ErrorCode.INVALID_PARAMETER]: ErrorCategory.VALIDATION,
91
+ [ErrorCode.AUTH_INVALID]: ErrorCategory.BUSINESS,
92
+ [ErrorCode.PAYMENT_REQUIRED]: ErrorCategory.BUSINESS,
93
+ [ErrorCode.PAYMENT_DECLINED]: ErrorCategory.BUSINESS,
94
+ [ErrorCode.OFFER_EXPIRED]: ErrorCategory.BUSINESS,
95
+ [ErrorCode.OFFER_NOT_UNLOCKED]: ErrorCategory.BUSINESS,
96
+ [ErrorCode.FARE_CHANGED]: ErrorCategory.BUSINESS,
97
+ [ErrorCode.ALREADY_BOOKED]: ErrorCategory.BUSINESS,
98
+ [ErrorCode.BOOKING_FAILED]: ErrorCategory.BUSINESS
99
+ };
100
+ function inferErrorCode(statusCode, detail) {
101
+ const d = detail.toLowerCase();
102
+ if (statusCode === 401) return ErrorCode.AUTH_INVALID;
103
+ if (statusCode === 402) return d.includes("declined") ? ErrorCode.PAYMENT_DECLINED : ErrorCode.PAYMENT_REQUIRED;
104
+ if (statusCode === 410) return ErrorCode.OFFER_EXPIRED;
105
+ if (statusCode === 422) {
106
+ if (d.includes("iata") || d.includes("airport")) return ErrorCode.INVALID_IATA;
107
+ if (d.includes("date")) return ErrorCode.INVALID_DATE;
108
+ if (d.includes("passenger")) return ErrorCode.INVALID_PASSENGERS;
109
+ if (d.includes("route")) return ErrorCode.UNSUPPORTED_ROUTE;
110
+ return ErrorCode.INVALID_PARAMETER;
111
+ }
112
+ if (statusCode === 429) return ErrorCode.RATE_LIMITED;
113
+ if (statusCode === 503) return ErrorCode.SERVICE_UNAVAILABLE;
114
+ if (statusCode === 504) return ErrorCode.SUPPLIER_TIMEOUT;
115
+ if (statusCode === 409) return ErrorCode.ALREADY_BOOKED;
116
+ return statusCode >= 500 ? ErrorCode.BOOKING_FAILED : ErrorCode.INVALID_PARAMETER;
117
+ }
118
+ var LetsFGError = class extends Error {
119
+ statusCode;
120
+ response;
121
+ errorCode;
122
+ errorCategory;
123
+ isRetryable;
124
+ constructor(message, statusCode = 0, response = {}, errorCode = "") {
125
+ super(message);
126
+ this.name = "LetsFGError";
127
+ this.statusCode = statusCode;
128
+ this.response = response;
129
+ this.errorCode = errorCode || response.error_code || "";
130
+ this.errorCategory = CODE_TO_CATEGORY[this.errorCode] || ErrorCategory.BUSINESS;
131
+ this.isRetryable = this.errorCategory === ErrorCategory.TRANSIENT;
132
+ }
133
+ };
134
+ var AuthenticationError = class extends LetsFGError {
135
+ constructor(message, response = {}) {
136
+ super(message, 401, response, ErrorCode.AUTH_INVALID);
137
+ this.name = "AuthenticationError";
138
+ }
139
+ };
140
+ var PaymentRequiredError = class extends LetsFGError {
141
+ constructor(message, response = {}) {
142
+ const code = message.toLowerCase().includes("declined") ? ErrorCode.PAYMENT_DECLINED : ErrorCode.PAYMENT_REQUIRED;
143
+ super(message, 402, response, code);
144
+ this.name = "PaymentRequiredError";
145
+ }
146
+ };
147
+ var OfferExpiredError = class extends LetsFGError {
148
+ constructor(message, response = {}) {
149
+ super(message, 410, response, ErrorCode.OFFER_EXPIRED);
150
+ this.name = "OfferExpiredError";
151
+ }
152
+ };
153
+ var ValidationError = class extends LetsFGError {
154
+ constructor(message, statusCode = 422, response = {}, errorCode = "") {
155
+ super(message, statusCode, response, errorCode || ErrorCode.INVALID_PARAMETER);
156
+ this.name = "ValidationError";
157
+ }
158
+ };
159
+ function routeStr(route) {
160
+ if (!route.segments.length) return "";
161
+ const codes = [route.segments[0].origin, ...route.segments.map((s) => s.destination)];
162
+ return codes.join(" \u2192 ");
163
+ }
164
+ function durationHuman(seconds) {
165
+ const h = Math.floor(seconds / 3600);
166
+ const m = Math.floor(seconds % 3600 / 60);
167
+ return `${h}h${m.toString().padStart(2, "0")}m`;
168
+ }
169
+ function offerSummary(offer) {
170
+ const route = routeStr(offer.outbound);
171
+ const dur = durationHuman(offer.outbound.total_duration_seconds);
172
+ const airline = offer.owner_airline || offer.airlines[0] || "?";
173
+ return `${offer.currency} ${offer.price.toFixed(2)} | ${airline} | ${route} | ${dur} | ${offer.outbound.stopovers} stop(s)`;
174
+ }
175
+ function cheapestOffer(result) {
176
+ if (!result.offers.length) return null;
177
+ return result.offers.reduce((min, o) => o.price < min.price ? o : min, result.offers[0]);
178
+ }
179
+ async function searchLocal(origin, destination, dateFrom, options = {}) {
180
+ const { spawn } = await import("child_process");
181
+ const params = JSON.stringify({
182
+ origin: origin.toUpperCase(),
183
+ destination: destination.toUpperCase(),
184
+ date_from: dateFrom,
185
+ adults: options.adults ?? 1,
186
+ children: options.children ?? 0,
187
+ currency: options.currency ?? "EUR",
188
+ limit: options.limit ?? 50,
189
+ return_date: options.returnDate,
190
+ cabin_class: options.cabinClass,
191
+ ...options.maxBrowsers != null && { max_browsers: options.maxBrowsers }
192
+ });
193
+ return new Promise((resolve, reject) => {
194
+ const pythonCmd = process.platform === "win32" ? "python" : "python3";
195
+ const child = spawn(pythonCmd, ["-m", "letsfg.local"], {
196
+ stdio: ["pipe", "pipe", "pipe"]
197
+ });
198
+ let stdout = "";
199
+ let stderr = "";
200
+ child.stdout.on("data", (d) => {
201
+ stdout += d.toString();
202
+ });
203
+ child.stderr.on("data", (d) => {
204
+ stderr += d.toString();
205
+ });
206
+ child.on("close", (code) => {
207
+ try {
208
+ const data = JSON.parse(stdout);
209
+ if (data.error) reject(new LetsFGError(data.error));
210
+ else resolve(data);
211
+ } catch {
212
+ reject(new LetsFGError(
213
+ `Python search failed (code ${code}): ${stdout || stderr}
214
+ Make sure LetsFG is installed: pip install letsfg && playwright install chromium`
215
+ ));
216
+ }
217
+ });
218
+ child.on("error", (err) => {
219
+ reject(new LetsFGError(
220
+ `Cannot start Python: ${err.message}
221
+ Install: pip install letsfg && playwright install chromium`
222
+ ));
223
+ });
224
+ child.stdin.write(params);
225
+ child.stdin.end();
226
+ });
227
+ }
228
+ var DEFAULT_BASE_URL = "https://api.letsfg.co";
229
+ var LetsFG = class {
230
+ apiKey;
231
+ baseUrl;
232
+ timeout;
233
+ constructor(config = {}) {
234
+ this.apiKey = config.apiKey || process.env.LETSFG_API_KEY || "";
235
+ this.baseUrl = (config.baseUrl || process.env.LETSFG_BASE_URL || DEFAULT_BASE_URL).replace(/\/$/, "");
236
+ this.timeout = config.timeout || 3e4;
237
+ }
238
+ requireApiKey() {
239
+ if (!this.apiKey) {
240
+ throw new AuthenticationError(
241
+ "API key required for this operation. Set apiKey in config or LETSFG_API_KEY env var.\nNote: searchLocal() works without an API key."
242
+ );
243
+ }
244
+ }
245
+ // ── Core methods ─────────────────────────────────────────────────────
246
+ /**
247
+ * Search for flights — FREE, unlimited.
248
+ *
249
+ * @param origin - IATA code (e.g., "GDN", "LON")
250
+ * @param destination - IATA code (e.g., "BER", "BCN")
251
+ * @param dateFrom - Departure date "YYYY-MM-DD"
252
+ * @param options - Optional search parameters
253
+ */
254
+ async search(origin, destination, dateFrom, options = {}) {
255
+ this.requireApiKey();
256
+ const body = {
257
+ origin: origin.toUpperCase(),
258
+ destination: destination.toUpperCase(),
259
+ date_from: dateFrom,
260
+ adults: options.adults ?? 1,
261
+ children: options.children ?? 0,
262
+ infants: options.infants ?? 0,
263
+ max_stopovers: options.maxStopovers ?? 2,
264
+ currency: options.currency ?? "EUR",
265
+ limit: options.limit ?? 20,
266
+ sort: options.sort ?? "price"
267
+ };
268
+ if (options.returnDate) body.return_from = options.returnDate;
269
+ if (options.cabinClass) body.cabin_class = options.cabinClass;
270
+ return this.post("/api/v1/flights/search", body);
271
+ }
272
+ /**
273
+ * Resolve a city/airport name to IATA codes.
274
+ */
275
+ async resolveLocation(query) {
276
+ this.requireApiKey();
277
+ const data = await this.get(`/api/v1/flights/locations/${encodeURIComponent(query)}`);
278
+ if (Array.isArray(data)) return data;
279
+ if (data && Array.isArray(data.locations)) return data.locations;
280
+ return data ? [data] : [];
281
+ }
282
+ /**
283
+ * Unlock a flight offer — $1 fee.
284
+ * Confirms price, reserves for 30 minutes.
285
+ */
286
+ async unlock(offerId) {
287
+ this.requireApiKey();
288
+ return this.post("/api/v1/bookings/unlock", { offer_id: offerId });
289
+ }
290
+ /**
291
+ * Book a flight — FREE after unlock.
292
+ * Creates a real airline reservation with PNR.
293
+ *
294
+ * Always provide idempotencyKey to prevent double-bookings on retry.
295
+ */
296
+ async book(offerId, passengers, contactEmail, contactPhone = "", idempotencyKey = "") {
297
+ this.requireApiKey();
298
+ const body = {
299
+ offer_id: offerId,
300
+ booking_type: "flight",
301
+ passengers,
302
+ contact_email: contactEmail,
303
+ contact_phone: contactPhone
304
+ };
305
+ if (idempotencyKey) body.idempotency_key = idempotencyKey;
306
+ return this.post("/api/v1/bookings/book", body);
307
+ }
308
+ /**
309
+ * Set up payment method (payment token).
310
+ */
311
+ async setupPayment(token = "tok_visa") {
312
+ this.requireApiKey();
313
+ return this.post("/api/v1/agents/setup-payment", { token });
314
+ }
315
+ /**
316
+ * Start automated checkout — drives to payment page, NEVER submits payment.
317
+ *
318
+ * Requires unlock first ($1 fee). Returns progress with screenshot and
319
+ * booking URL for manual completion.
320
+ *
321
+ * @param offerId - Offer ID from search results
322
+ * @param passengers - Passenger details (use test data for safety)
323
+ * @param checkoutToken - Token from unlock() response
324
+ */
325
+ async startCheckout(offerId, passengers, checkoutToken) {
326
+ this.requireApiKey();
327
+ return this.post("/api/v1/bookings/start-checkout", {
328
+ offer_id: offerId,
329
+ passengers,
330
+ checkout_token: checkoutToken
331
+ });
332
+ }
333
+ /**
334
+ * Start checkout locally via Python (runs on your machine).
335
+ * Requires: pip install letsfg && playwright install chromium
336
+ *
337
+ * @param offer - Full FlightOffer object from search results
338
+ * @param passengers - Passenger details
339
+ * @param checkoutToken - Token from unlock()
340
+ */
341
+ async startCheckoutLocal(offer, passengers, checkoutToken) {
342
+ const { spawn } = await import("child_process");
343
+ const input = JSON.stringify({
344
+ __checkout: true,
345
+ offer,
346
+ passengers,
347
+ checkout_token: checkoutToken,
348
+ api_key: this.apiKey,
349
+ base_url: this.baseUrl
350
+ });
351
+ return new Promise((resolve, reject) => {
352
+ const pythonCmd = process.platform === "win32" ? "python" : "python3";
353
+ const child = spawn(pythonCmd, ["-m", "letsfg.local"], {
354
+ stdio: ["pipe", "pipe", "pipe"],
355
+ timeout: 18e4
356
+ });
357
+ let stdout = "";
358
+ let stderr = "";
359
+ child.stdout.on("data", (d) => {
360
+ stdout += d.toString();
361
+ });
362
+ child.stderr.on("data", (d) => {
363
+ stderr += d.toString();
364
+ });
365
+ child.on("close", (code) => {
366
+ try {
367
+ const data = JSON.parse(stdout);
368
+ if (data.error) reject(new LetsFGError(data.error));
369
+ else resolve(data);
370
+ } catch {
371
+ reject(new LetsFGError(`Checkout failed (code ${code}): ${stdout || stderr}`));
372
+ }
373
+ });
374
+ child.on("error", (err) => {
375
+ reject(new LetsFGError(`Cannot start Python: ${err.message}`));
376
+ });
377
+ child.stdin.write(input);
378
+ child.stdin.end();
379
+ });
380
+ }
381
+ /**
382
+ * Get current agent profile and usage stats.
383
+ */
384
+ async me() {
385
+ this.requireApiKey();
386
+ return this.get("/api/v1/agents/me");
387
+ }
388
+ // ── Static methods ───────────────────────────────────────────────────
389
+ /**
390
+ * Register a new agent — no API key needed.
391
+ */
392
+ static async register(agentName, email, baseUrl, ownerName = "", description = "") {
393
+ const url = (baseUrl || DEFAULT_BASE_URL).replace(/\/$/, "");
394
+ const resp = await fetch(`${url}/api/v1/agents/register`, {
395
+ method: "POST",
396
+ headers: { "Content-Type": "application/json" },
397
+ body: JSON.stringify({
398
+ agent_name: agentName,
399
+ email,
400
+ owner_name: ownerName,
401
+ description
402
+ })
403
+ });
404
+ const data = await resp.json();
405
+ if (!resp.ok) {
406
+ throw new LetsFGError(
407
+ data.detail || `Registration failed (${resp.status})`,
408
+ resp.status,
409
+ data
410
+ );
411
+ }
412
+ return data;
413
+ }
414
+ // ── Internal ────────────────────────────────────────────────────────
415
+ async post(path, body) {
416
+ return this.request(path, {
417
+ method: "POST",
418
+ body: JSON.stringify(body)
419
+ });
420
+ }
421
+ async get(path) {
422
+ return this.request(path, { method: "GET" });
423
+ }
424
+ async request(path, init) {
425
+ const controller = new AbortController();
426
+ const timer = setTimeout(() => controller.abort(), this.timeout);
427
+ try {
428
+ const resp = await fetch(`${this.baseUrl}${path}`, {
429
+ ...init,
430
+ headers: {
431
+ "Content-Type": "application/json",
432
+ "X-API-Key": this.apiKey,
433
+ "User-Agent": "LetsFG-js/0.1.0",
434
+ ...init.headers || {}
435
+ },
436
+ signal: controller.signal
437
+ });
438
+ const data = await resp.json();
439
+ if (!resp.ok) {
440
+ const detail = data.detail || `API error (${resp.status})`;
441
+ const code = data.error_code || inferErrorCode(resp.status, detail);
442
+ if (resp.status === 401) throw new AuthenticationError(detail, data);
443
+ if (resp.status === 402) throw new PaymentRequiredError(detail, data);
444
+ if (resp.status === 410) throw new OfferExpiredError(detail, data);
445
+ if (resp.status === 422) throw new ValidationError(detail, resp.status, data, code);
446
+ throw new LetsFGError(detail, resp.status, data, code);
447
+ }
448
+ return data;
449
+ } finally {
450
+ clearTimeout(timer);
451
+ }
452
+ }
453
+ };
454
+ async function systemInfo() {
455
+ const { spawn } = await import("child_process");
456
+ return new Promise((resolve, reject) => {
457
+ const pythonCmd = process.platform === "win32" ? "python" : "python3";
458
+ const child = spawn(pythonCmd, ["-m", "letsfg.local"], {
459
+ stdio: ["pipe", "pipe", "pipe"]
460
+ });
461
+ let stdout = "";
462
+ let stderr = "";
463
+ child.stdout.on("data", (d) => {
464
+ stdout += d.toString();
465
+ });
466
+ child.stderr.on("data", (d) => {
467
+ stderr += d.toString();
468
+ });
469
+ child.on("close", (code) => {
470
+ try {
471
+ const data = JSON.parse(stdout);
472
+ if (data.error) reject(new LetsFGError(data.error));
473
+ else resolve(data);
474
+ } catch {
475
+ reject(new LetsFGError(
476
+ `Python system-info failed (code ${code}): ${stdout || stderr}`
477
+ ));
478
+ }
479
+ });
480
+ child.on("error", (err) => {
481
+ reject(new LetsFGError(
482
+ `Cannot start Python: ${err.message}
483
+ Install: pip install letsfg`
484
+ ));
485
+ });
486
+ child.stdin.write(JSON.stringify({ __system_info: true }));
487
+ child.stdin.end();
488
+ });
489
+ }
490
+ var index_default = LetsFG;
491
+ var BoostedTravel = LetsFG;
492
+ var BoostedTravelError = LetsFGError;
493
+ // Annotate the CommonJS export names for ESM import in node:
494
+ 0 && (module.exports = {
495
+ AuthenticationError,
496
+ BoostedTravel,
497
+ BoostedTravelError,
498
+ ErrorCategory,
499
+ ErrorCode,
500
+ LetsFG,
501
+ LetsFGError,
502
+ OfferExpiredError,
503
+ PaymentRequiredError,
504
+ ValidationError,
505
+ cheapestOffer,
506
+ getSystemInfo,
507
+ localSearch,
508
+ offerSummary,
509
+ searchLocal,
510
+ systemInfo
511
+ });
package/dist/index.mjs ADDED
@@ -0,0 +1,36 @@
1
+ import {
2
+ AuthenticationError,
3
+ BoostedTravel,
4
+ BoostedTravelError,
5
+ ErrorCategory,
6
+ ErrorCode,
7
+ LetsFG,
8
+ LetsFGError,
9
+ OfferExpiredError,
10
+ PaymentRequiredError,
11
+ ValidationError,
12
+ cheapestOffer,
13
+ index_default,
14
+ offerSummary,
15
+ searchLocal,
16
+ systemInfo
17
+ } from "./chunk-LKAF7U4R.mjs";
18
+ export {
19
+ AuthenticationError,
20
+ BoostedTravel,
21
+ BoostedTravelError,
22
+ ErrorCategory,
23
+ ErrorCode,
24
+ LetsFG,
25
+ LetsFGError,
26
+ OfferExpiredError,
27
+ PaymentRequiredError,
28
+ ValidationError,
29
+ cheapestOffer,
30
+ index_default as default,
31
+ systemInfo as getSystemInfo,
32
+ searchLocal as localSearch,
33
+ offerSummary,
34
+ searchLocal,
35
+ systemInfo
36
+ };
package/package.json ADDED
@@ -0,0 +1,50 @@
1
+ {
2
+ "name": "letsfg",
3
+ "version": "1.0.0",
4
+ "description": "Agent-native flight search & booking. 75 airline connectors run locally + enterprise GDS/NDC APIs. Built for autonomous AI agents.",
5
+ "main": "dist/index.js",
6
+ "module": "dist/index.mjs",
7
+ "types": "dist/index.d.ts",
8
+ "bin": {
9
+ "letsfg": "dist/cli.js"
10
+ },
11
+ "files": [
12
+ "dist/",
13
+ "README.md",
14
+ "LICENSE"
15
+ ],
16
+ "scripts": {
17
+ "build": "tsup src/index.ts src/cli.ts --format cjs,esm --dts --clean",
18
+ "prepublishOnly": "npm run build"
19
+ },
20
+ "keywords": [
21
+ "flights",
22
+ "travel",
23
+ "booking",
24
+ "agent",
25
+ "ai",
26
+ "cli",
27
+ "autonomous",
28
+ "mcp",
29
+ "openai",
30
+ "airline",
31
+ "ndc",
32
+ "search",
33
+ "ndc"
34
+ ],
35
+ "author": "LetsFG",
36
+ "license": "MIT",
37
+ "repository": {
38
+ "type": "git",
39
+ "url": "https://github.com/LetsFG/LetsFG.git"
40
+ },
41
+ "homepage": "https://letsfg.co",
42
+ "devDependencies": {
43
+ "@types/node": "^25.3.3",
44
+ "tsup": "^8.0.0",
45
+ "typescript": "^5.3.0"
46
+ },
47
+ "engines": {
48
+ "node": ">=18.0.0"
49
+ }
50
+ }