aves-sdk 1.7.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 +35 -0
- package/README.md +46 -49
- package/dist/index.d.mts +6564 -3145
- package/dist/index.mjs +1 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
package/CHANGELOG.md
CHANGED
|
@@ -5,6 +5,41 @@ 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
|
+
|
|
28
|
+
## [1.8.0] - 2026-08-03
|
|
29
|
+
|
|
30
|
+
### Added
|
|
31
|
+
|
|
32
|
+
- Exportable shared object enums (`PaxQtyCriteria`, `AvesSearchType`, `PaymentType`, `InsertCriteria`, booking/master statuses, etc.) and matching `*Schema` picklists
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- **Breaking:** `searchPackages` / `searchTopServices` payload is flat (no `baseSearch` nest)
|
|
37
|
+
- Defaults: `avesSearchType` (`PACKAGE` / `SERVICE` by method), `paxQty` ← `passengerList.length`, `paxQtyCriteria` ← `GREATER_OR_EQUAL`
|
|
38
|
+
- `languageCode` optional when set on `AvesClient` options
|
|
39
|
+
- Schemas use shared object enums instead of inline string unions
|
|
40
|
+
|
|
41
|
+
---
|
|
42
|
+
|
|
8
43
|
## [1.7.0] - 2026-08-03
|
|
9
44
|
|
|
10
45
|
### 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.
|
|
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.
|
|
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({
|
|
@@ -303,32 +304,29 @@ There is **no** Create Package API in AVES XML 1.8.0. Search, detail, and commit
|
|
|
303
304
|
|
|
304
305
|
| Method | Purpose |
|
|
305
306
|
| ------ | ------- |
|
|
306
|
-
| `searchPackages` | Search programs (`avesSearchType
|
|
307
|
-
| `searchTopServices` | Search TOP services (`avesSearchType
|
|
307
|
+
| `searchPackages` | Search programs (defaults `avesSearchType: 'PACKAGE'`) |
|
|
308
|
+
| `searchTopServices` | Search TOP services (defaults `avesSearchType: 'SERVICE'`) |
|
|
308
309
|
| `getPackageDetail` | Package base info + service list |
|
|
309
310
|
| `commitPackage` | Publish existing package (`packageCode` only) |
|
|
310
311
|
|
|
312
|
+
`paxQty` defaults to `passengerList.length`; `paxQtyCriteria` defaults to `GREATER_OR_EQUAL`. `languageCode` can be omitted when set on `AvesClient` options.
|
|
313
|
+
|
|
311
314
|
```typescript
|
|
312
315
|
const packages = await client.packages.searchPackages({
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
],
|
|
328
|
-
},
|
|
329
|
-
avesSearchType: 'PACKAGE',
|
|
330
|
-
paxQty: '1',
|
|
331
|
-
paxQtyCriteria: 'GREATER_OR_EQUAL',
|
|
316
|
+
customerRecordCode: '138311',
|
|
317
|
+
languageCode: '01',
|
|
318
|
+
currencyCode: 'EUR',
|
|
319
|
+
startDate: '2014-12-27T00:00:00',
|
|
320
|
+
endDate: '2015-01-03T00:00:00',
|
|
321
|
+
passengerList: [
|
|
322
|
+
{
|
|
323
|
+
rph: '001',
|
|
324
|
+
roomRph: '001',
|
|
325
|
+
name: 'ADULTI 001',
|
|
326
|
+
categoryCode: 'AD',
|
|
327
|
+
sex: 'M',
|
|
328
|
+
},
|
|
329
|
+
],
|
|
332
330
|
servOrPackCode: '2014MDE0000010',
|
|
333
331
|
});
|
|
334
332
|
|
|
@@ -343,6 +341,9 @@ const detail = await client.packages.getPackageDetail({
|
|
|
343
341
|
});
|
|
344
342
|
|
|
345
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]);
|
|
346
347
|
```
|
|
347
348
|
|
|
348
349
|
---
|
|
@@ -378,9 +379,11 @@ You do not handle XML attribute prefixes yourself. Attr vs element is decided by
|
|
|
378
379
|
One outbound path for all ops:
|
|
379
380
|
|
|
380
381
|
1. Valibot validates camelCase input
|
|
381
|
-
2. `createApiSchema(schema, shape, wrap?)` → `toWireBody` (optional list wrap +
|
|
382
|
+
2. `createApiSchema(schema, shape, wrap?)` → `toWireBody` (optional list wrap + `paxAssociated` string[]/empty normalize + `camelToPascalKeys`)
|
|
382
383
|
3. `AvesTransport.invokeOp` adds `RqHeader`, optional `bodyKey` nest, POSTs XML
|
|
383
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
|
+
|
|
384
387
|
Element-only roots use `elementOnlyWire` (`{}`). Master upsert nests under `bodyKey: "MasterRecordDetail"`; master search and booking spread fields at the RQ root.
|
|
385
388
|
|
|
386
389
|
### Request shapes (one family per op)
|
|
@@ -426,28 +429,9 @@ Outbound path: validate → `createApiSchema` / `toWireBody` → `invokeOp` →
|
|
|
426
429
|
import type {
|
|
427
430
|
AvesClientOptions,
|
|
428
431
|
AvesClientDeps,
|
|
429
|
-
SearchMasterRecord,
|
|
430
|
-
SearchMasterRecordRS,
|
|
431
|
-
MasterRecordDetail,
|
|
432
|
-
ManageMasterRecordRS,
|
|
433
|
-
BookingFileRQ,
|
|
434
|
-
BookingFileRS,
|
|
435
|
-
ModFileServicesRQ,
|
|
436
|
-
ModFileHeaderRQ,
|
|
437
|
-
CancelFileRQ,
|
|
438
|
-
SetFileStatusRQ,
|
|
439
|
-
SetFileServiceStatusRQ,
|
|
440
|
-
FilePaymentListRQ,
|
|
441
|
-
BookingStatusOnlyRS,
|
|
442
|
-
SearchBookingFileRQ,
|
|
443
|
-
SearchBookingFileRS,
|
|
444
432
|
AvesSearchRQ,
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
PackageDetailRQ,
|
|
448
|
-
PackageDetailRS,
|
|
449
|
-
CommitPackageRQ,
|
|
450
|
-
CommitPackageRS,
|
|
433
|
+
BookingFileRQ,
|
|
434
|
+
SearchMasterRecord,
|
|
451
435
|
} from 'aves-sdk';
|
|
452
436
|
|
|
453
437
|
import {
|
|
@@ -457,7 +441,20 @@ import {
|
|
|
457
441
|
BookingClient,
|
|
458
442
|
PackageCatalogClient,
|
|
459
443
|
AvesError,
|
|
444
|
+
// object enums
|
|
445
|
+
AvesSearchType,
|
|
446
|
+
BookingFileStatus,
|
|
447
|
+
InsertCriteria,
|
|
448
|
+
PassengerCategory,
|
|
449
|
+
PaxQtyCriteria,
|
|
450
|
+
PaymentType,
|
|
451
|
+
SearchMasterType,
|
|
460
452
|
} from 'aves-sdk';
|
|
453
|
+
|
|
454
|
+
PaxQtyCriteria.GREATER_OR_EQUAL
|
|
455
|
+
AvesSearchType.PACKAGE
|
|
456
|
+
PaymentType.B
|
|
457
|
+
InsertCriteria.T
|
|
461
458
|
```
|
|
462
459
|
|
|
463
460
|
## License
|