sabre-client 0.2.1 → 0.2.2

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 CHANGED
@@ -251,6 +251,35 @@ var SabreError = class extends Error {
251
251
  }
252
252
  };
253
253
 
254
+ // src/trip-management/reservation.ts
255
+ var Reservation = class {
256
+ /**
257
+ * Reservation
258
+ *
259
+ * La API para crear un registro de nombre de pasajero es una API
260
+ * orquestada que integra varias funciones y operaciones en una sola llamada.
261
+ *
262
+ * Esta API permite crear un registro de nombre de pasajero (PNR),
263
+ * incluyendo segmentos aéreos, en una sola llamada.
264
+ *
265
+ * @param sabre Sabre Client Reference
266
+ */
267
+ constructor(sabre) {
268
+ this.sabre = sabre;
269
+ }
270
+ /**
271
+ * Cree una reserva completa de contenido aéreo, hotel y automóvil de alquiler, todo dentro de una sola solicitud.
272
+ *
273
+ * payload - Contiene elementos obligatorios y opcionales para realizar una solicitud de reserva.
274
+ * @param payload CreatePassengerNameRecordOptions
275
+ * @returns {Promise<CreatePassengerNameRecordResponseSuccess>}
276
+ */
277
+ create(payload) {
278
+ const path = "/v2.5.0/passenger/records?mode=create";
279
+ return this.sabre.post(path, payload);
280
+ }
281
+ };
282
+
254
283
  // src/sabre.ts
255
284
  var Sabre = class {
256
285
  constructor(options = {}) {
@@ -282,6 +311,7 @@ var Sabre = class {
282
311
  flightTickets = new FlightTickets(this);
283
312
  search = new Search(this);
284
313
  ticketing = new Ticketing(this);
314
+ reservation = new Reservation(this);
285
315
  setAuthorization(token) {
286
316
  this.headers.set("Authorization", `Bearer ${token}`);
287
317
  this.headers.set("Content-Type", "application/json");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sabre-client",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
4
4
  "description": "Sabre Node.js SDK",
5
5
  "keywords": [
6
6
  "sabre",
@@ -42,7 +42,9 @@
42
42
  "test": "jest --passWithNoTests",
43
43
  "test:watch": "jest --watch",
44
44
  "lint": "eslint . --ext .ts --report-unused-disable-directives --max-warnings 0",
45
- "type-check": "tsc --noEmit"
45
+ "type-check": "tsc --noEmit",
46
+ "example:auth-atk": "node --env-file=.env --import=tsx examples/auth-atk.ts",
47
+ "example:search-shop": "node --env-file=.env --import=tsx examples/search-shop.ts"
46
48
  },
47
49
  "devDependencies": {
48
50
  "@eslint/js": "^9.38.0",
@@ -53,6 +55,7 @@
53
55
  "ts-jest": "^29.4.5",
54
56
  "ts-node": "^10.9.2",
55
57
  "tsup": "^8.5.0",
58
+ "tsx": "^4.20.6",
56
59
  "typescript": "^5.9.3",
57
60
  "typescript-eslint": "^8.46.1"
58
61
  }