aves-sdk 3.1.0 → 4.0.1
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 +94 -1
- package/README.md +229 -40
- package/dist/CHANGELOG.md +409 -0
- package/dist/index.d.mts +76 -33
- package/dist/index.mjs +1 -1
- package/package.json +2 -1
|
@@ -0,0 +1,409 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to this project are documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [4.0.1] - 2026-08-06
|
|
9
|
+
|
|
10
|
+
### Added
|
|
11
|
+
|
|
12
|
+
- Copy `CHANGELOG.md` into `dist/` on build (`tsdown` `copy`) and include `dist/CHANGELOG.md` in published `files`.
|
|
13
|
+
|
|
14
|
+
## [4.0.0] - 2026-08-06
|
|
15
|
+
|
|
16
|
+
### Added
|
|
17
|
+
|
|
18
|
+
- `OpBodyKey` object enum (`MasterRecordDetail`) for RQ payload nest keys; typed on `AVES_OPS` / envelope.
|
|
19
|
+
- `AvesOp` object enum (+ `AvesOpSchema`) for `invokeOp` keys; domains use `AvesOp.create` instead of string literals.
|
|
20
|
+
|
|
21
|
+
### Changed
|
|
22
|
+
|
|
23
|
+
- **Breaking:** Domain method names no longer repeat the namespace / AVES verb soup. `AVES_OPS` keys follow the same short names (with `searchBookings` / `searchPackages` where `search` would collide).
|
|
24
|
+
|
|
25
|
+
| Namespace | 3.x | 4.x |
|
|
26
|
+
| --------- | --- | --- |
|
|
27
|
+
| `master` | `upsertRecord` | `upsert` |
|
|
28
|
+
| `booking` | `createBooking` | `create` |
|
|
29
|
+
| `booking` | `modBookingServices` | `updateServices` |
|
|
30
|
+
| `booking` | `modBookingHeader` | `updateHeader` |
|
|
31
|
+
| `booking` | `cancelBooking` | `cancel` |
|
|
32
|
+
| `booking` | `setBookingStatus` | `setStatus` |
|
|
33
|
+
| `booking` | `setBookingServiceStatus` | `setServiceStatus` |
|
|
34
|
+
| `booking` | `insertFilePaymentList` | `addPayments` |
|
|
35
|
+
| `booking` | `searchBookingFiles` | `search` |
|
|
36
|
+
| `packages` | `searchPackages` | `search` |
|
|
37
|
+
| `packages` | `searchTopServices` | `searchServices` |
|
|
38
|
+
| `packages` | `getPackageDetail` | `get` |
|
|
39
|
+
| `packages` | `commitPackage` | `commit` |
|
|
40
|
+
|
|
41
|
+
`master.search` is unchanged. Endpoint URLs and XML roots are unchanged.
|
|
42
|
+
|
|
43
|
+
### Migration (1.x / 3.x → 4.x)
|
|
44
|
+
|
|
45
|
+
Jump straight to 4.x for September apps: apply the 3.x facade + `master.search` flat-array notes, then rename methods per the table above (no compatibility aliases).
|
|
46
|
+
|
|
47
|
+
```ts
|
|
48
|
+
// 3.x
|
|
49
|
+
await client.booking.createBooking(params);
|
|
50
|
+
await client.packages.searchPackages(params);
|
|
51
|
+
await client.master.upsertRecord(record);
|
|
52
|
+
|
|
53
|
+
// 4.x
|
|
54
|
+
await client.booking.create(params);
|
|
55
|
+
await client.packages.search(params);
|
|
56
|
+
await client.master.upsert(record);
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## [3.1.1] - 2026-08-06
|
|
60
|
+
|
|
61
|
+
### Added
|
|
62
|
+
|
|
63
|
+
- Concise facade aliases for common I/O properties: `customerCode`, `bookingCode`, `services`, `passengers`, `packageCode`, `serviceCode`, `quantity`, `session`, and related fields.
|
|
64
|
+
- Schema-owned dual keys via `facadeObject` / `coalesceAliases` (same pattern as `coalesceCustomerRecordCode`).
|
|
65
|
+
- Simplified public type aliases including `BookingInput`, `Booking`, `MasterRecord`, `PackageInput`, and `Package`.
|
|
66
|
+
- `AVES_OPS` registry + `invokeOp(op, params)` with external `OpParams` / `OpResult` typings.
|
|
67
|
+
- Full facade alias property map in README (outbound `publicKeyAliases` + inbound scoped maps).
|
|
68
|
+
- 2.x → 3.x migration notes for `master.search` (flat array success payload).
|
|
69
|
+
|
|
70
|
+
### Changed
|
|
71
|
+
|
|
72
|
+
- Facade names are accepted on Valibot input schemas and coalesced to AVES camelCase before wire encoding. Success payloads also expose concise compatibility aliases.
|
|
73
|
+
- Internal transport split: `HttpClient`, `buildOpEnvelope`, `readAvesResponse`, `createRqHeader`; `toAvesError` lives in `error.ts`. Public `invokeOp` API unchanged.
|
|
74
|
+
- Hot-path micro-opts: cached endpoint URLs, shared XML POST headers, frozen cached `RqHeader`, single `AVES_OPS` lookup per `invokeOp`.
|
|
75
|
+
- Cap HTTP error body reads via `readTextCapped` (drain stream, keep ≤ `MAX_ERROR_BODY`).
|
|
76
|
+
- WeakMap cache for `itemShape` / `encodeShapeFor` on static WireShape refs.
|
|
77
|
+
- `toWireBody` single shape-driven walk (list wrap + pax normalize + wire keys).
|
|
78
|
+
- Zero-copy `withPublicAliases` via hardened lazy Proxy (WeakMap identity, proto-pollution blocked).
|
|
79
|
+
- ADR 0001 Phase 2a: `createResponseSchema` camelizes Valibot output **in place** (`pascalToCamelKeysInPlace`) — no second deep-copy. See [`docs/adr/0001-validate-during-camelize.md`](docs/adr/0001-validate-during-camelize.md).
|
|
80
|
+
- Performance harness: `yarn test:bench` (Vitest bench) and `AVES_PERF=1 yarn test:perf` (relative hot-path asserts).
|
|
81
|
+
|
|
82
|
+
## [3.0.0] - 2026-08-06
|
|
83
|
+
|
|
84
|
+
### Changed
|
|
85
|
+
|
|
86
|
+
- **Breaking:** `master.search` success payload is now `MasterRecordDetailResponse[]` — always a flat array (`[]`, one element, or many). No `rsStatus` wrapper on success (non-OK AVES status remains `result.error`). Replaces the prior `{ rsStatus, masterRecordList }` shape.
|
|
87
|
+
|
|
88
|
+
### Migration (2.x → 3.x)
|
|
89
|
+
|
|
90
|
+
Only `master.search` success shape changed. Other domain methods and error/`Result` contracts are unchanged from 2.x.
|
|
91
|
+
|
|
92
|
+
| Change | Symptom on upgrade | Fix |
|
|
93
|
+
| ------ | ------------------ | --- |
|
|
94
|
+
| `master.search` success is a flat array | `result.data.masterRecordList` / `result.data.rsStatus` are `undefined`; types fail | Use `result.data` as `MasterRecordDetailResponse[]` (e.g. `const [record] = result.data` or `result.data.map(...)`) |
|
|
95
|
+
| Looking for `rsStatus` on success | Always missing when `result.success` | Keep using `result.error` for non-OK AVES / HTTP failures (`error.kind`, `error.status`, `error.code`) |
|
|
96
|
+
| Empty search | May have expected a missing list or wrapper | Success with no hits is `result.data === []` |
|
|
97
|
+
|
|
98
|
+
**Before (2.x):**
|
|
99
|
+
|
|
100
|
+
```ts
|
|
101
|
+
const result = await client.master.search({
|
|
102
|
+
searchType: "CODE",
|
|
103
|
+
recordCode: "508558",
|
|
104
|
+
});
|
|
105
|
+
if (result.success) {
|
|
106
|
+
const records = result.data.masterRecordList ?? [];
|
|
107
|
+
console.log(result.data.rsStatus.status, records[0]?.recordCode);
|
|
108
|
+
}
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
**After (3.x):**
|
|
112
|
+
|
|
113
|
+
```ts
|
|
114
|
+
const result = await client.master.search({
|
|
115
|
+
searchType: "CODE",
|
|
116
|
+
recordCode: "508558",
|
|
117
|
+
});
|
|
118
|
+
if (result.success) {
|
|
119
|
+
const [record] = result.data; // MasterRecordDetailResponse[]
|
|
120
|
+
console.log(record?.recordCode);
|
|
121
|
+
} else {
|
|
122
|
+
console.error(result.error.kind, result.error.status, result.error.message);
|
|
123
|
+
}
|
|
124
|
+
```
|
|
125
|
+
|
|
126
|
+
3.1.x on top of 3.0 is additive (facade aliases / internal transport). No further breaking migration from 3.0 → 3.1.1.
|
|
127
|
+
|
|
128
|
+
## [2.0.1] - 2026-08-05
|
|
129
|
+
|
|
130
|
+
### Changed
|
|
131
|
+
|
|
132
|
+
- Omit source maps from the published package; `files` now ships only
|
|
133
|
+
`dist/index.mjs` and `dist/index.d.mts`.
|
|
134
|
+
|
|
135
|
+
## [2.0.0] - 2026-08-05
|
|
136
|
+
|
|
137
|
+
### Changed
|
|
138
|
+
|
|
139
|
+
- **Breaking:** flat operation aliases were removed; use namespaced domain clients only.
|
|
140
|
+
- **Breaking:** enum-typed fields now reject arbitrary strings at compile time.
|
|
141
|
+
- **Breaking:** `AvesError.status` retains AVES casing and `AvesError.code` is `number | undefined`.
|
|
142
|
+
- **Breaking:** master-record responses reflect the actual API payload, including server-only fields; `dynamicFields` is an array.
|
|
143
|
+
- Fixed AVES language codes (`01` Italian, `02` English), raw warning text preservation, and the `PaymentDetail` `@PaumentNote` wire spelling.
|
|
144
|
+
|
|
145
|
+
### Migration
|
|
146
|
+
|
|
147
|
+
| Change | Symptom on upgrade | Fix |
|
|
148
|
+
| ------ | ------------------ | --- |
|
|
149
|
+
| Flat aliases removed | Runtime `TypeError` | Insert the domain namespace: `client.search` → `client.master.search` |
|
|
150
|
+
| Enum types narrowed | Compile errors for enum fields receiving `string` | Use exported enum objects or unions |
|
|
151
|
+
| `AvesError.status` casing | `err.status === "error"` no longer matches | Compare with `RsStatusValue` (`"OK"`, `"ERROR"`, `"WARNING"`, `"TIMEOUT"`) |
|
|
152
|
+
| `AvesError.code` | Absent codes are `undefined`, not `0` | Check for `undefined` |
|
|
153
|
+
| `MasterRecordDetailResponse` corrected | Type gains server-only fields | Remove local re-declarations |
|
|
154
|
+
| `dynamicFields` is an array | Single-object assignment fails | Wrap the field in an array |
|
|
155
|
+
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
## [1.9.0] - 2026-08-03
|
|
159
|
+
|
|
160
|
+
### Changed
|
|
161
|
+
|
|
162
|
+
- **Breaking:** `upsertRecord` spreads `masterRecordDetail` into `data` — `result.data.recordCode`
|
|
163
|
+
- **Breaking:** booking create/mod/status spreads `bookingFileDetail` into `data` — `result.data.bookingFileCode`
|
|
164
|
+
- **Breaking:** `getPackageDetail` spreads `packageDetail` into `data` — `result.data.pCode`
|
|
165
|
+
- **Breaking:** response `*List` fields are flat Detail arrays (no inner `*Detail` wrapper) — e.g. `data.packageList?.[0]`, `data.masterRecordList`, `data.bookingFileList`, `data.bookedServiceList`
|
|
166
|
+
- **Breaking:** nested booking/catalog lists unwrapped the same way (`passengerList`, `serviceList`, `paxPriceList`, …)
|
|
167
|
+
- Input aliases: `customerRecordCode` ↔ `customerDetail`; `bookingFileStatus` / `fileStatus` as string or `{ value }`; `paxAssociated: string[]`; mod `selectedPackageList` ↔ `selectedPackageDetail`
|
|
168
|
+
|
|
169
|
+
### Added
|
|
170
|
+
|
|
171
|
+
- Response helpers: `listDetailApiSchema`, `flattenResponseDetail`, `createFlattenedResponseSchema`, `createListResponseSchema`
|
|
172
|
+
- Request helpers: `createApiSchema`, `valueFieldSchema`, `coalesceCustomerRecordCode`, `coalesceListHead`, `coalesceWireAliases`
|
|
173
|
+
- Shared primitives: `LanguageCodeSchema`, `StringishSchema`, `DateRangeSchema`, `StatusOnlyResponseSchema`, `createWireSchemaPair`
|
|
174
|
+
- `yarn typecheck` script (`tsc --noEmit`)
|
|
175
|
+
|
|
176
|
+
---
|
|
177
|
+
|
|
178
|
+
## [1.8.0] - 2026-08-03
|
|
179
|
+
|
|
180
|
+
### Added
|
|
181
|
+
|
|
182
|
+
- Exportable shared object enums (`PaxQtyCriteria`, `AvesSearchType`, `PaymentType`, `InsertCriteria`, booking/master statuses, etc.) and matching `*Schema` picklists
|
|
183
|
+
|
|
184
|
+
### Changed
|
|
185
|
+
|
|
186
|
+
- **Breaking:** `searchPackages` / `searchTopServices` payload is flat (no `baseSearch` nest)
|
|
187
|
+
- Defaults: `avesSearchType` (`PACKAGE` / `SERVICE` by method), `paxQty` ← `passengerList.length`, `paxQtyCriteria` ← `GREATER_OR_EQUAL`
|
|
188
|
+
- `languageCode` optional when set on `AvesClient` options
|
|
189
|
+
- Schemas use shared object enums instead of inline string unions
|
|
190
|
+
|
|
191
|
+
---
|
|
192
|
+
|
|
193
|
+
## [1.7.0] - 2026-08-03
|
|
194
|
+
|
|
195
|
+
### Added
|
|
196
|
+
|
|
197
|
+
- Package / Program catalog APIs: `searchPackages`, `searchTopServices`, `getPackageDetail`, `commitPackage`
|
|
198
|
+
- `searchBookingFiles` (`FILE_CODE` | `PAX_NAME` | `PACKAGE_CODE` | `OTHER`)
|
|
199
|
+
- Domain clients with DI: `AvesTransport`, `MasterRecordsClient`, `BookingClient`, `PackageCatalogClient`, `AvesClientDeps`
|
|
200
|
+
- Per-request `WireShape` model (`src/utils/wire-shapes.ts`)
|
|
201
|
+
- Flat method aliases auto-bound from domain prototypes (`client/flat-aliases.ts`)
|
|
202
|
+
|
|
203
|
+
### Changed
|
|
204
|
+
|
|
205
|
+
- `AvesClient` is a thin facade; prefer `client.booking.*` / `client.packages.*` / `client.master.*`
|
|
206
|
+
- Single outbound wire path: `createApiSchema` / `toWireBody` / `invokeOp` (optional `bodyKey`)
|
|
207
|
+
- XML helpers moved to `src/xml/`
|
|
208
|
+
- Master search/upsert routed through `invokeOp`
|
|
209
|
+
|
|
210
|
+
### Fixed
|
|
211
|
+
|
|
212
|
+
- InsertFilePaymentList root `paymentUser` emitted as `@PaymentUser` (not a child element)
|
|
213
|
+
|
|
214
|
+
### Removed
|
|
215
|
+
|
|
216
|
+
- Global `ATTRIBUTE_FIELDS` registry
|
|
217
|
+
- Versioned docs under `docs/` from git (`docs/` gitignored)
|
|
218
|
+
|
|
219
|
+
---
|
|
220
|
+
|
|
221
|
+
## [1.6.0] - 2026-07-29
|
|
222
|
+
|
|
223
|
+
### Changed
|
|
224
|
+
|
|
225
|
+
- **Breaking:** booking `*List` SDK inputs are flat `Detail[]`; SDK wraps to AVES List/Detail XML
|
|
226
|
+
- Shared `PaymentTypeSchema` across booking ops
|
|
227
|
+
- README refreshed for constructor, `Result` / `AvesError`, and flat list examples
|
|
228
|
+
- Documented additional package managers in README
|
|
229
|
+
|
|
230
|
+
---
|
|
231
|
+
|
|
232
|
+
## [1.5.1] - 2026-07-29
|
|
233
|
+
|
|
234
|
+
### Changed
|
|
235
|
+
|
|
236
|
+
- Added `fast-xml-builder` dependency
|
|
237
|
+
- Dependency / `tsdown` config maintenance
|
|
238
|
+
|
|
239
|
+
---
|
|
240
|
+
|
|
241
|
+
## [1.5.0] - 2026-07-29
|
|
242
|
+
|
|
243
|
+
### Added
|
|
244
|
+
|
|
245
|
+
- `insertFilePaymentList` (InsertFilePaymentList) for payment registration
|
|
246
|
+
- Tighter `invokeOp` schema inference
|
|
247
|
+
- Booking ops documentation updates
|
|
248
|
+
|
|
249
|
+
---
|
|
250
|
+
|
|
251
|
+
## [1.4.0] - 2026-07-29
|
|
252
|
+
|
|
253
|
+
### Added
|
|
254
|
+
|
|
255
|
+
- Booking ops: ModBookingFileServices, ModBookingFileHeader, CancelBookingFile, SetStatus / SetStatusService
|
|
256
|
+
- Shared transforms and typed BOOKEDFILE responses
|
|
257
|
+
- Unit coverage for booking ops
|
|
258
|
+
|
|
259
|
+
### Changed
|
|
260
|
+
|
|
261
|
+
- Dependency updates
|
|
262
|
+
|
|
263
|
+
---
|
|
264
|
+
|
|
265
|
+
## [1.3.4] - 2026-03-09
|
|
266
|
+
|
|
267
|
+
### Added
|
|
268
|
+
|
|
269
|
+
- Create-booking related input schemas: financial deadlines, payments, selected packages/services, notes, passengers
|
|
270
|
+
|
|
271
|
+
### Fixed
|
|
272
|
+
|
|
273
|
+
- Union formatting in `SelectedServiceListInputSchema`
|
|
274
|
+
|
|
275
|
+
### Changed
|
|
276
|
+
|
|
277
|
+
- Error handling via `isOk`
|
|
278
|
+
- Schema / quote standardization across client and types
|
|
279
|
+
|
|
280
|
+
---
|
|
281
|
+
|
|
282
|
+
## [1.3.3] - 2026-02-26
|
|
283
|
+
|
|
284
|
+
### Fixed
|
|
285
|
+
|
|
286
|
+
- `package.json` packaging fix
|
|
287
|
+
|
|
288
|
+
---
|
|
289
|
+
|
|
290
|
+
## [1.3.2] - 2026-02-10
|
|
291
|
+
|
|
292
|
+
### Added
|
|
293
|
+
|
|
294
|
+
- `createBooking` (CreateBookingFile) with tests
|
|
295
|
+
- Migrated bundler from `tsup` to `tsdown`
|
|
296
|
+
|
|
297
|
+
### Changed
|
|
298
|
+
|
|
299
|
+
- Package configuration updates
|
|
300
|
+
|
|
301
|
+
---
|
|
302
|
+
|
|
303
|
+
## [1.3.1] - 2026-02-01
|
|
304
|
+
|
|
305
|
+
### Changed
|
|
306
|
+
|
|
307
|
+
- Error-handling path formatting simplified
|
|
308
|
+
- String-quote standardization
|
|
309
|
+
|
|
310
|
+
---
|
|
311
|
+
|
|
312
|
+
## [1.3.0] - 2026-02-01
|
|
313
|
+
|
|
314
|
+
### Added
|
|
315
|
+
|
|
316
|
+
- Biome linting
|
|
317
|
+
- Undici-based mock improvements in tests
|
|
318
|
+
- Additional master-record properties and attribute-schema refactor
|
|
319
|
+
- Broader test coverage
|
|
320
|
+
|
|
321
|
+
### Changed
|
|
322
|
+
|
|
323
|
+
- Consolidated XML root element definitions and utilities
|
|
324
|
+
|
|
325
|
+
---
|
|
326
|
+
|
|
327
|
+
## [1.2.16] - 2026-01-27
|
|
328
|
+
|
|
329
|
+
### Changed
|
|
330
|
+
|
|
331
|
+
- Removed unnecessary `as any` casts
|
|
332
|
+
|
|
333
|
+
---
|
|
334
|
+
|
|
335
|
+
## [1.2.15] - 2026-01-27
|
|
336
|
+
|
|
337
|
+
### Fixed
|
|
338
|
+
|
|
339
|
+
- XML / validation follow-up fixes
|
|
340
|
+
|
|
341
|
+
---
|
|
342
|
+
|
|
343
|
+
## [1.2.14] - 2026-01-27
|
|
344
|
+
|
|
345
|
+
### Changed
|
|
346
|
+
|
|
347
|
+
- XML ↔ JSON conversion and validation schema improvements
|
|
348
|
+
|
|
349
|
+
---
|
|
350
|
+
|
|
351
|
+
## [1.2.13] - 2026-01-27
|
|
352
|
+
|
|
353
|
+
### Added
|
|
354
|
+
|
|
355
|
+
- Request timeout handling with clear timeout vs other errors
|
|
356
|
+
- `isAbortError` utility
|
|
357
|
+
|
|
358
|
+
### Changed
|
|
359
|
+
|
|
360
|
+
- `AvesClientOptions` moved to `types.ts`
|
|
361
|
+
- Request method uses Valibot `BaseSchema` more consistently
|
|
362
|
+
- Upsert response schema and error detail improvements
|
|
363
|
+
- `recordCode` length validation tests
|
|
364
|
+
|
|
365
|
+
---
|
|
366
|
+
|
|
367
|
+
## [1.2.12] - 2026-01-26
|
|
368
|
+
|
|
369
|
+
### Added
|
|
370
|
+
|
|
371
|
+
- Export `AvesClientOptions` for external usage
|
|
372
|
+
- Mapped profiling record support
|
|
373
|
+
|
|
374
|
+
### Changed
|
|
375
|
+
|
|
376
|
+
- Restructured `AvesError` handling and client initialization
|
|
377
|
+
- Optional `insertCriteria` on upsert flow
|
|
378
|
+
|
|
379
|
+
### Fixed
|
|
380
|
+
|
|
381
|
+
- Misc client fixes
|
|
382
|
+
|
|
383
|
+
---
|
|
384
|
+
|
|
385
|
+
## [1.2.11] - 2026-01-21
|
|
386
|
+
|
|
387
|
+
### Fixed
|
|
388
|
+
|
|
389
|
+
- Error code handling uses numeric values instead of strings
|
|
390
|
+
|
|
391
|
+
---
|
|
392
|
+
|
|
393
|
+
## [1.0.3] - 2025-10-04
|
|
394
|
+
|
|
395
|
+
Early tagged releases (`v1.0.0` … `v1.0.3`) from the initial NestJS-oriented AVES SDK work. Detailed commit notes for those tags are limited in the current branch history.
|
|
396
|
+
|
|
397
|
+
### Added
|
|
398
|
+
|
|
399
|
+
- Initial AVES SDK implementation with XML/REST interfaces (2025-10-03)
|
|
400
|
+
|
|
401
|
+
---
|
|
402
|
+
|
|
403
|
+
## Links
|
|
404
|
+
|
|
405
|
+
- [npm](https://www.npmjs.com/package/aves-sdk)
|
|
406
|
+
- [GitHub](https://github.com/simoneguglielmi/aves-sdk)
|
|
407
|
+
- Tags: [v1.0.0](https://github.com/simoneguglielmi/aves-sdk/releases/tag/v1.0.0) … [v1.0.3](https://github.com/simoneguglielmi/aves-sdk/releases/tag/v1.0.3)
|
|
408
|
+
|
|
409
|
+
> Git tags after `v1.0.3` were not present when this file was generated; version sections follow `package.json` bumps and commit messages.
|
package/dist/index.d.mts
CHANGED
|
@@ -26,6 +26,12 @@ declare const RsStatusValueSchema: import("valibot").PicklistSchema<EnumValue<{
|
|
|
26
26
|
readonly WARNING: "WARNING";
|
|
27
27
|
readonly TIMEOUT: "TIMEOUT";
|
|
28
28
|
}>[], undefined>;
|
|
29
|
+
/** Nest key when an op wraps the API body under a Detail element (vs spread at RQ root). */
|
|
30
|
+
declare const OpBodyKey: {
|
|
31
|
+
readonly MasterRecordDetail: "MasterRecordDetail";
|
|
32
|
+
};
|
|
33
|
+
type OpBodyKey = EnumValue<typeof OpBodyKey>;
|
|
34
|
+
declare const OpBodyKeySchema: import("valibot").PicklistSchema<"MasterRecordDetail"[], undefined>;
|
|
29
35
|
declare const SearchMasterType: {
|
|
30
36
|
readonly CODE: "CODE";
|
|
31
37
|
readonly NAME: "NAME";
|
|
@@ -11247,7 +11253,7 @@ declare const MasterRecordDetailResponseSchema: v.SchemaWithPipe<readonly [Omit<
|
|
|
11247
11253
|
/**
|
|
11248
11254
|
* Flat AvesSearchRQ body (camelCase) — shared by SearchAvesPackages / SearchTopServices.
|
|
11249
11255
|
* BaseSearch fields live at the root; wire transform nests them under `BaseSearch`.
|
|
11250
|
-
* `
|
|
11256
|
+
* `packages.search` / `packages.searchServices` default `avesSearchType`; `paxQty` defaults to
|
|
11251
11257
|
* `passengerList.length`; `paxQtyCriteria` defaults to `GREATER_OR_EQUAL`.
|
|
11252
11258
|
* `languageCode` may come from `AvesClient` options when omitted.
|
|
11253
11259
|
*/
|
|
@@ -16497,7 +16503,7 @@ type DynamicFields = InferInput<typeof DynamicFieldsInputSchema>;
|
|
|
16497
16503
|
/**
|
|
16498
16504
|
* Master record detail for creating or updating customer, supplier, or general records.
|
|
16499
16505
|
*
|
|
16500
|
-
* This is the primary input type for the `
|
|
16506
|
+
* This is the primary input type for the `upsert` method.
|
|
16501
16507
|
*
|
|
16502
16508
|
* @property recordCode - 6-character unique identifier (auto-generated if not provided)
|
|
16503
16509
|
* @property insertCriteria - Duplicate handling strategy:
|
|
@@ -16632,7 +16638,7 @@ type SearchMasterRecordRS = MasterRecordDetailResponse[];
|
|
|
16632
16638
|
* @property MasterRecordDetail - Record data to insert or update
|
|
16633
16639
|
*
|
|
16634
16640
|
* @internal This type is primarily for internal SDK use. Use {@link MasterRecordDetail}
|
|
16635
|
-
* as the input type for `client.master.
|
|
16641
|
+
* as the input type for `client.master.upsert()`.
|
|
16636
16642
|
*/
|
|
16637
16643
|
type ManageMasterRecordRequest = InferInput<typeof ManageMasterRecordRequestSchema>;
|
|
16638
16644
|
/**
|
|
@@ -16644,7 +16650,7 @@ type ManageMasterRecordRequest = InferInput<typeof ManageMasterRecordRequestSche
|
|
|
16644
16650
|
*
|
|
16645
16651
|
* @example
|
|
16646
16652
|
* ```typescript
|
|
16647
|
-
* const result = await client.master.
|
|
16653
|
+
* const result = await client.master.upsert({
|
|
16648
16654
|
* languageCode: '02',
|
|
16649
16655
|
* name: 'New Customer',
|
|
16650
16656
|
* insertCriteria: 'N',
|
|
@@ -16877,11 +16883,49 @@ type OpConfig<TIn, TApiBody extends Record<string, unknown>, TOut extends {
|
|
|
16877
16883
|
responseRoot: string;
|
|
16878
16884
|
apiSchema: BaseSchema<TIn, TApiBody, BaseIssue<unknown>>;
|
|
16879
16885
|
responseSchema: BaseSchema<unknown, TOut, BaseIssue<unknown>>;
|
|
16880
|
-
bodyKey?:
|
|
16886
|
+
bodyKey?: OpBodyKey;
|
|
16881
16887
|
};
|
|
16888
|
+
/**
|
|
16889
|
+
* Object enum of `invokeOp` / `AVES_OPS` keys.
|
|
16890
|
+
* Prefer `AvesOp.create` over string literals in domain clients.
|
|
16891
|
+
*/
|
|
16892
|
+
declare const AvesOp: {
|
|
16893
|
+
readonly search: "search";
|
|
16894
|
+
readonly upsert: "upsert";
|
|
16895
|
+
readonly create: "create";
|
|
16896
|
+
readonly updateServices: "updateServices";
|
|
16897
|
+
readonly updateHeader: "updateHeader";
|
|
16898
|
+
readonly cancel: "cancel";
|
|
16899
|
+
readonly setStatus: "setStatus";
|
|
16900
|
+
readonly setServiceStatus: "setServiceStatus";
|
|
16901
|
+
readonly addPayments: "addPayments";
|
|
16902
|
+
readonly searchBookings: "searchBookings";
|
|
16903
|
+
readonly searchPackages: "searchPackages";
|
|
16904
|
+
readonly searchServices: "searchServices";
|
|
16905
|
+
readonly get: "get";
|
|
16906
|
+
readonly commit: "commit";
|
|
16907
|
+
};
|
|
16908
|
+
type AvesOp = EnumValue<typeof AvesOp>;
|
|
16909
|
+
declare const AvesOpSchema: import("valibot").PicklistSchema<EnumValue<{
|
|
16910
|
+
readonly search: "search";
|
|
16911
|
+
readonly upsert: "upsert";
|
|
16912
|
+
readonly create: "create";
|
|
16913
|
+
readonly updateServices: "updateServices";
|
|
16914
|
+
readonly updateHeader: "updateHeader";
|
|
16915
|
+
readonly cancel: "cancel";
|
|
16916
|
+
readonly setStatus: "setStatus";
|
|
16917
|
+
readonly setServiceStatus: "setServiceStatus";
|
|
16918
|
+
readonly addPayments: "addPayments";
|
|
16919
|
+
readonly searchBookings: "searchBookings";
|
|
16920
|
+
readonly searchPackages: "searchPackages";
|
|
16921
|
+
readonly searchServices: "searchServices";
|
|
16922
|
+
readonly get: "get";
|
|
16923
|
+
readonly commit: "commit";
|
|
16924
|
+
}>[], undefined>;
|
|
16882
16925
|
/**
|
|
16883
16926
|
* Static descriptor per AVES operation: endpoint, XML roots, schemas, optional body nest.
|
|
16884
|
-
* Domains call `invokeOp(
|
|
16927
|
+
* Domains call `invokeOp(AvesOp.*, params)` — keys match public method names where unique;
|
|
16928
|
+
* collisions across namespaces use a short domain qualifier (`searchBookings`, `searchPackages`).
|
|
16885
16929
|
*/
|
|
16886
16930
|
declare const AVES_OPS: {
|
|
16887
16931
|
readonly search: OpConfig<{
|
|
@@ -17095,7 +17139,7 @@ declare const AVES_OPS: {
|
|
|
17095
17139
|
warnings: string | undefined;
|
|
17096
17140
|
};
|
|
17097
17141
|
}>;
|
|
17098
|
-
readonly
|
|
17142
|
+
readonly upsert: OpConfig<{
|
|
17099
17143
|
recordCode?: string | undefined;
|
|
17100
17144
|
insertCriteria?: EnumValue<{
|
|
17101
17145
|
readonly S: "S";
|
|
@@ -17605,7 +17649,7 @@ declare const AVES_OPS: {
|
|
|
17605
17649
|
vatCode?: string | undefined;
|
|
17606
17650
|
zipCode?: string | undefined;
|
|
17607
17651
|
}>;
|
|
17608
|
-
readonly
|
|
17652
|
+
readonly create: OpConfig<{
|
|
17609
17653
|
createDate?: string | undefined;
|
|
17610
17654
|
bookingFileRefCode?: string | undefined;
|
|
17611
17655
|
travelAgentCode?: string | undefined;
|
|
@@ -19639,7 +19683,7 @@ declare const AVES_OPS: {
|
|
|
19639
19683
|
travelAgencyEmail?: string | undefined;
|
|
19640
19684
|
travelAgencyName?: string | undefined;
|
|
19641
19685
|
}>;
|
|
19642
|
-
readonly
|
|
19686
|
+
readonly updateServices: OpConfig<{
|
|
19643
19687
|
customerRecordCode: string;
|
|
19644
19688
|
bookingFileCode: string;
|
|
19645
19689
|
currencyCode?: string | undefined;
|
|
@@ -20752,7 +20796,7 @@ declare const AVES_OPS: {
|
|
|
20752
20796
|
travelAgencyEmail?: string | undefined;
|
|
20753
20797
|
travelAgencyName?: string | undefined;
|
|
20754
20798
|
}>;
|
|
20755
|
-
readonly
|
|
20799
|
+
readonly updateHeader: OpConfig<{
|
|
20756
20800
|
customerRecordCode: string;
|
|
20757
20801
|
bookingFileCode: string;
|
|
20758
20802
|
bookingFileStartDate: string;
|
|
@@ -21014,7 +21058,7 @@ declare const AVES_OPS: {
|
|
|
21014
21058
|
warnings: string | undefined;
|
|
21015
21059
|
};
|
|
21016
21060
|
}>;
|
|
21017
|
-
readonly
|
|
21061
|
+
readonly cancel: OpConfig<{
|
|
21018
21062
|
customerRecordCode: string;
|
|
21019
21063
|
bookingFileCode: string;
|
|
21020
21064
|
} & {
|
|
@@ -21036,7 +21080,7 @@ declare const AVES_OPS: {
|
|
|
21036
21080
|
warnings: string | undefined;
|
|
21037
21081
|
};
|
|
21038
21082
|
}>;
|
|
21039
|
-
readonly
|
|
21083
|
+
readonly setStatus: OpConfig<{
|
|
21040
21084
|
customerRecordCode: string;
|
|
21041
21085
|
bookingFileCode: string;
|
|
21042
21086
|
fileStatus: {
|
|
@@ -21543,7 +21587,7 @@ declare const AVES_OPS: {
|
|
|
21543
21587
|
travelAgencyEmail?: string | undefined;
|
|
21544
21588
|
travelAgencyName?: string | undefined;
|
|
21545
21589
|
}>;
|
|
21546
|
-
readonly
|
|
21590
|
+
readonly setServiceStatus: OpConfig<{
|
|
21547
21591
|
customerRecordCode: string;
|
|
21548
21592
|
bookingFileCode: string;
|
|
21549
21593
|
bookingServiceRef: string;
|
|
@@ -21871,7 +21915,7 @@ declare const AVES_OPS: {
|
|
|
21871
21915
|
travelAgencyEmail?: string | undefined;
|
|
21872
21916
|
travelAgencyName?: string | undefined;
|
|
21873
21917
|
}>;
|
|
21874
|
-
readonly
|
|
21918
|
+
readonly addPayments: OpConfig<{
|
|
21875
21919
|
bookingFileCode?: string | undefined;
|
|
21876
21920
|
bookingFileRefCode?: string | undefined;
|
|
21877
21921
|
paymentUser?: string | undefined;
|
|
@@ -21991,7 +22035,7 @@ declare const AVES_OPS: {
|
|
|
21991
22035
|
warnings: string | undefined;
|
|
21992
22036
|
};
|
|
21993
22037
|
}>;
|
|
21994
|
-
readonly
|
|
22038
|
+
readonly searchBookings: OpConfig<({
|
|
21995
22039
|
customerRecordCode: string;
|
|
21996
22040
|
customerPromoterCode?: string | undefined;
|
|
21997
22041
|
getSupplierInfo?: "false" | "true" | boolean | undefined;
|
|
@@ -22765,7 +22809,7 @@ declare const AVES_OPS: {
|
|
|
22765
22809
|
warnings: string | undefined;
|
|
22766
22810
|
};
|
|
22767
22811
|
}>;
|
|
22768
|
-
readonly
|
|
22812
|
+
readonly searchServices: OpConfig<{
|
|
22769
22813
|
customerRecordCode: string;
|
|
22770
22814
|
languageCode?: string | undefined;
|
|
22771
22815
|
currencyCode?: string | undefined;
|
|
@@ -23166,7 +23210,7 @@ declare const AVES_OPS: {
|
|
|
23166
23210
|
toServiceType?: string | undefined;
|
|
23167
23211
|
}[] | undefined;
|
|
23168
23212
|
}>;
|
|
23169
|
-
readonly
|
|
23213
|
+
readonly get: OpConfig<{
|
|
23170
23214
|
customerRecordCode: string;
|
|
23171
23215
|
languageCode?: string | undefined;
|
|
23172
23216
|
currencyCode?: string | undefined;
|
|
@@ -23467,7 +23511,7 @@ declare const AVES_OPS: {
|
|
|
23467
23511
|
startDate?: string | undefined;
|
|
23468
23512
|
startValidation?: string | undefined;
|
|
23469
23513
|
}>;
|
|
23470
|
-
readonly
|
|
23514
|
+
readonly commit: OpConfig<{
|
|
23471
23515
|
packageCode: string;
|
|
23472
23516
|
}, {
|
|
23473
23517
|
PackageCode: string;
|
|
@@ -23485,7 +23529,6 @@ declare const AVES_OPS: {
|
|
|
23485
23529
|
};
|
|
23486
23530
|
}>;
|
|
23487
23531
|
};
|
|
23488
|
-
type AvesOp = keyof typeof AVES_OPS;
|
|
23489
23532
|
/** Runtime input accepted by an op's API schema (facade + AVES dual keys). */
|
|
23490
23533
|
type OpParams<K extends AvesOp> = InferInput<(typeof AVES_OPS)[K]["apiSchema"]>;
|
|
23491
23534
|
/** Parsed success payload for an op (before facade aliases). */
|
|
@@ -23520,21 +23563,21 @@ declare class BookingClient {
|
|
|
23520
23563
|
private readonly transport;
|
|
23521
23564
|
constructor(transport: AvesTransport);
|
|
23522
23565
|
/** Create a booking file (CreateBookingFile). */
|
|
23523
|
-
|
|
23566
|
+
create(params: BookingFileRQ): Promise<Result<FacadeOutput<BookingFileRS>, AvesError>>;
|
|
23524
23567
|
/** Add/replace services, assign package, delete/nullify cost items. */
|
|
23525
|
-
|
|
23568
|
+
updateServices(params: ModFileServicesRQ): Promise<Result<FacadeOutput<BookingFileDetailRS>, AvesError>>;
|
|
23526
23569
|
/** Header only (pax, notes, billing) — no costs. */
|
|
23527
|
-
|
|
23570
|
+
updateHeader(params: ModFileHeaderRQ): Promise<Result<FacadeOutput<BookingStatusOnlyRS>, AvesError>>;
|
|
23528
23571
|
/** Delete a booking file (CancelBookingFile). */
|
|
23529
|
-
|
|
23572
|
+
cancel(params: CancelFileRQ): Promise<Result<FacadeOutput<BookingStatusOnlyRS>, AvesError>>;
|
|
23530
23573
|
/** Change booking file status (incl. CANCELED / NULLIFIED). */
|
|
23531
|
-
|
|
23574
|
+
setStatus(params: SetFileStatusRQ): Promise<Result<FacadeOutput<BookingFileDetailRS>, AvesError>>;
|
|
23532
23575
|
/** Nullify a single booked service line. */
|
|
23533
|
-
|
|
23576
|
+
setServiceStatus(params: SetFileServiceStatusRQ): Promise<Result<FacadeOutput<BookingFileDetailRS>, AvesError>>;
|
|
23534
23577
|
/** Register one or more payments on a booking file. */
|
|
23535
|
-
|
|
23578
|
+
addPayments(params: FilePaymentListRQ): Promise<Result<FacadeOutput<BookingStatusOnlyRS>, AvesError>>;
|
|
23536
23579
|
/** Search booking files, incl. by PACKAGE_CODE. */
|
|
23537
|
-
|
|
23580
|
+
search(params: SearchBookingFileRQ): Promise<Result<FacadeOutput<SearchBookingFileRS>, AvesError>>;
|
|
23538
23581
|
}
|
|
23539
23582
|
//#endregion
|
|
23540
23583
|
//#region src/client/master-records.d.ts
|
|
@@ -23544,7 +23587,7 @@ declare class MasterRecordsClient {
|
|
|
23544
23587
|
/** Search master records. Success returns a flat array (empty when no matches). */
|
|
23545
23588
|
search(params: SearchMasterRecord): Promise<Result<FacadeOutput<SearchMasterRecordRS>, AvesError>>;
|
|
23546
23589
|
/** Insert or update a master record. */
|
|
23547
|
-
|
|
23590
|
+
upsert(record: MasterRecordDetail): Promise<Result<FacadeOutput<ManageMasterRecordRS>, AvesError>>;
|
|
23548
23591
|
}
|
|
23549
23592
|
//#endregion
|
|
23550
23593
|
//#region src/client/packages.d.ts
|
|
@@ -23553,13 +23596,13 @@ declare class PackageCatalogClient {
|
|
|
23553
23596
|
private readonly transport;
|
|
23554
23597
|
constructor(transport: AvesTransport);
|
|
23555
23598
|
/** Search packages / programs. Defaults `avesSearchType` to `PACKAGE`. */
|
|
23556
|
-
|
|
23599
|
+
search(params: AvesSearchRQ): Promise<Result<FacadeOutput<SearchPackageRS>, AvesError>>;
|
|
23557
23600
|
/** Search TOP services. Defaults `avesSearchType` to `SERVICE`. */
|
|
23558
|
-
|
|
23601
|
+
searchServices(params: AvesSearchRQ): Promise<Result<FacadeOutput<SearchServicesRS>, AvesError>>;
|
|
23559
23602
|
/** Package / program detail + service list. */
|
|
23560
|
-
|
|
23603
|
+
get(params: PackageDetailRQ): Promise<Result<FacadeOutput<PackageDetailRS>, AvesError>>;
|
|
23561
23604
|
/** Publish an existing package. Does not create packages. */
|
|
23562
|
-
|
|
23605
|
+
commit(params: CommitPackageRQ): Promise<Result<FacadeOutput<CommitPackageRS>, AvesError>>;
|
|
23563
23606
|
}
|
|
23564
23607
|
//#endregion
|
|
23565
23608
|
//#region src/client/types.d.ts
|
|
@@ -23580,4 +23623,4 @@ declare class AvesClient {
|
|
|
23580
23623
|
constructor(options: AvesClientOptions, deps?: AvesClientDeps);
|
|
23581
23624
|
}
|
|
23582
23625
|
//#endregion
|
|
23583
|
-
export { type AccountPolicies, AvesClient, type AvesClientDeps, type AvesClientOptions, AvesError,
|
|
23626
|
+
export { type AccountPolicies, AvesClient, type AvesClientDeps, type AvesClientOptions, AvesError, AvesOp, AvesOpSchema, type AvesSearchRQ, AvesSearchType, AvesSearchTypeSchema, AvesServiceType, AvesServiceTypeSchema, AvesTransport, BookedServiceStatus, BookedServiceStatusSchema, type Booking, type BookingCancelInput, BookingClient, type BookingFileDetailRS, type BookingFileRQ, type BookingFileRS, BookingFileStatus, BookingFileStatusSchema, BookingFileStatusWire, BookingFileStatusWireSchema, type BookingHeaderInput, type BookingInput, type BookingSearchInput, type BookingSearchResult, type BookingStatusInput, type BookingStatusOnlyRS, type CancelFileRQ, CancelOperationType, CancelOperationTypeSchema, CarrierType, CarrierTypeSchema, type CatalogSearchInput, type CommitInput, type CommitPackageRQ, type CommitPackageRS, CostPriceType, CostPriceTypeSchema, CustomerPaymentType, CustomerPaymentTypeSchema, DestinationType, DestinationTypeSchema, DocumentType, DocumentTypeSchema, type DynamicFields, type FilePaymentListRQ, FilePaymentOperationType, FilePaymentOperationTypeSchema, type FinancialDetail, Gender, GenderSchema, GroupingPaxPolicy, GroupingPaxPolicySchema, type IdDocumentDetail, InsertCriteria, InsertCriteriaSchema, MakeDocumentTo, MakeDocumentToSchema, type ManageMasterRecordRS, type ManageMasterRecordRequest, MasterPaymentType, MasterPaymentTypeSchema, type MasterRecord, type MasterRecordDetail, type MasterRecordDetailResponse, type MasterRecordInput, MasterRecordsClient, type MasterSearchInput, type MasterSearchResult, type ModFileHeaderRQ, type ModFileServicesRQ, OpBodyKey, OpBodyKeySchema, type OpParams, type OpResult, type OperationStatus, OptionedExpirePolicy, OptionedExpirePolicySchema, type Package, PackageCatalogClient, type PackageDetailRQ, type PackageDetailRS, type PackageInput, type PackageSearchResult, PassengerCategory, PassengerCategorySchema, PaxQtyCriteria, PaxQtyCriteriaSchema, type PaymentInput, PaymentType, PaymentTypeSchema, RecordStatus, RecordStatusSchema, RecordType, RecordTypeSchema, type RqHeader, type RsStatus, RsStatusValue, RsStatusValueSchema, type SearchBookingFileRQ, type SearchBookingFileRS, SearchBookingFileType, SearchBookingFileTypeSchema, type SearchMasterRecord, type SearchMasterRecordRS, SearchMasterType, SearchMasterTypeSchema, type SearchPackageRS, type SearchServicesRS, ServiceRefType, ServiceRefTypeSchema, type ServiceSearchResult, type ServiceStatusInput, type ServiceUpdateInput, type SetFileServiceStatusRQ, type SetFileStatusRQ, SetFileStatusValue, SetFileStatusValueSchema, ToServiceType, ToServiceTypeSchema, TypeDownloadFile, TypeDownloadFileSchema };
|