aves-sdk 1.8.0 → 1.9.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/CHANGELOG.md CHANGED
@@ -5,6 +5,26 @@ All notable changes to this project are documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [1.9.0] - 2026-08-03
9
+
10
+ ### Changed
11
+
12
+ - **Breaking:** `upsertRecord` spreads `masterRecordDetail` into `data` — `result.data.recordCode`
13
+ - **Breaking:** booking create/mod/status spreads `bookingFileDetail` into `data` — `result.data.bookingFileCode`
14
+ - **Breaking:** `getPackageDetail` spreads `packageDetail` into `data` — `result.data.pCode`
15
+ - **Breaking:** response `*List` fields are flat Detail arrays (no inner `*Detail` wrapper) — e.g. `data.packageList?.[0]`, `data.masterRecordList`, `data.bookingFileList`, `data.bookedServiceList`
16
+ - **Breaking:** nested booking/catalog lists unwrapped the same way (`passengerList`, `serviceList`, `paxPriceList`, …)
17
+ - Input aliases: `customerRecordCode` ↔ `customerDetail`; `bookingFileStatus` / `fileStatus` as string or `{ value }`; `paxAssociated: string[]`; mod `selectedPackageList` ↔ `selectedPackageDetail`
18
+
19
+ ### Added
20
+
21
+ - Response helpers: `listDetailApiSchema`, `flattenResponseDetail`, `createFlattenedResponseSchema`, `createListResponseSchema`
22
+ - Request helpers: `createApiSchema`, `valueFieldSchema`, `coalesceCustomerRecordCode`, `coalesceListHead`, `coalesceWireAliases`
23
+ - Shared primitives: `LanguageCodeSchema`, `StringishSchema`, `DateRangeSchema`, `StatusOnlyResponseSchema`, `createWireSchemaPair`
24
+ - `yarn typecheck` script (`tsc --noEmit`)
25
+
26
+ ---
27
+
8
28
  ## [1.8.0] - 2026-08-03
9
29
 
10
30
  ### Added
package/README.md CHANGED
@@ -143,7 +143,7 @@ const result = await client.upsertRecord({
143
143
  });
144
144
 
145
145
  if (result.success) {
146
- console.log(result.data.masterRecordDetail?.recordCode);
146
+ console.log(result.data.recordCode);
147
147
  }
148
148
  ```
149
149
 
@@ -168,8 +168,8 @@ if (result.success) {
168
168
 
169
169
  ```typescript
170
170
  const created = await client.booking.createBooking({
171
- customerDetail: { recordCode: '138311' },
172
- bookingFileStatus: { value: 'QUOTATION' },
171
+ customerRecordCode: '138311', // or customerDetail: { recordCode: '138311' }
172
+ bookingFileStatus: 'QUOTATION', // or { value: 'QUOTATION', expiredDate? }
173
173
  startDate: '2015-01-22T00:00:00',
174
174
  endDate: '2015-01-25T00:00:00',
175
175
  selectedServiceList: [
@@ -182,7 +182,7 @@ const created = await client.booking.createBooking({
182
182
  endDate: '2015-01-25T00:00:00',
183
183
  qty: '1',
184
184
  pax: '2',
185
- paxAssociated: [],
185
+ paxAssociated: [], // or string[] like ['001','002']
186
186
  avesSession: '1',
187
187
  },
188
188
  ],
@@ -198,7 +198,8 @@ const created = await client.booking.createBooking({
198
198
  });
199
199
 
200
200
  if (created.success) {
201
- console.log(created.data.bookingFileDetail?.bookingFileCode);
201
+ console.log(created.data.bookingFileCode);
202
+ console.log(created.data.bookedServiceList?.[0]?.serviceStatus);
202
203
  }
203
204
  ```
204
205
 
@@ -273,7 +274,7 @@ await client.booking.modBookingHeader({
273
274
  await client.booking.setBookingStatus({
274
275
  customerRecordCode: '000170',
275
276
  bookingFileCode: '14/000081',
276
- fileStatus: { value: 'CANCELED' },
277
+ fileStatus: 'CANCELED', // or { value: 'CANCELED' }
277
278
  });
278
279
 
279
280
  await client.booking.setBookingServiceStatus({
@@ -340,6 +341,9 @@ const detail = await client.packages.getPackageDetail({
340
341
  });
341
342
 
342
343
  await client.packages.commitPackage({ packageCode: '14/PACKAGE001' });
344
+
345
+ if (packages.success) console.log(packages.data.packageList?.[0]?.pCode);
346
+ if (detail.success) console.log(detail.data.pCode, detail.data.serviceList?.[0]);
343
347
  ```
344
348
 
345
349
  ---
@@ -375,9 +379,11 @@ You do not handle XML attribute prefixes yourself. Attr vs element is decided by
375
379
  One outbound path for all ops:
376
380
 
377
381
  1. Valibot validates camelCase input
378
- 2. `createApiSchema(schema, shape, wrap?)` → `toWireBody` (optional list wrap + empty `paxAssociated` normalize + `camelToPascalKeys`)
382
+ 2. `createApiSchema(schema, shape, wrap?)` → `toWireBody` (optional list wrap + `paxAssociated` string[]/empty normalize + `camelToPascalKeys`)
379
383
  3. `AvesTransport.invokeOp` adds `RqHeader`, optional `bodyKey` nest, POSTs XML
380
384
 
385
+ Inbound: `createResponseSchema` / `createFlattenedResponseSchema` / `createListResponseSchema` → camelCase + optional detail spread or typed list RS; `listDetailApiSchema` unwraps wire `*List`/`*Detail` to flat arrays; `coalesceWireAliases` normalizes dialect attrs. Input aliases: `valueFieldSchema`, `coalesceCustomerRecordCode`, `coalesceListHead`. Shared primitives: `LanguageCodeSchema`, `StringishSchema`, `DateRangeSchema`, `StatusOnlyResponseSchema`.
386
+
381
387
  Element-only roots use `elementOnlyWire` (`{}`). Master upsert nests under `bodyKey: "MasterRecordDetail"`; master search and booking spread fields at the RQ root.
382
388
 
383
389
  ### Request shapes (one family per op)