aves-sdk 1.9.0 → 2.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 CHANGED
@@ -5,6 +5,36 @@ 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
+ ## [2.0.1] - 2026-08-05
9
+
10
+ ### Changed
11
+
12
+ - Omit source maps from the published package; `files` now ships only
13
+ `dist/index.mjs` and `dist/index.d.mts`.
14
+
15
+ ## [2.0.0] - 2026-08-05
16
+
17
+ ### Changed
18
+
19
+ - **Breaking:** flat operation aliases were removed; use namespaced domain clients only.
20
+ - **Breaking:** enum-typed fields now reject arbitrary strings at compile time.
21
+ - **Breaking:** `AvesError.status` retains AVES casing and `AvesError.code` is `number | undefined`.
22
+ - **Breaking:** master-record responses reflect the actual API payload, including server-only fields; `dynamicFields` is an array.
23
+ - Fixed AVES language codes (`01` Italian, `02` English), raw warning text preservation, and the `PaymentDetail` `@PaumentNote` wire spelling.
24
+
25
+ ### Migration
26
+
27
+ | Change | Symptom on upgrade | Fix |
28
+ | ------ | ------------------ | --- |
29
+ | Flat aliases removed | Runtime `TypeError` | Insert the domain namespace: `client.search` → `client.master.search` |
30
+ | Enum types narrowed | Compile errors for enum fields receiving `string` | Use exported enum objects or unions |
31
+ | `AvesError.status` casing | `err.status === "error"` no longer matches | Compare with `RsStatusValue` (`"OK"`, `"ERROR"`, `"WARNING"`, `"TIMEOUT"`) |
32
+ | `AvesError.code` | Absent codes are `undefined`, not `0` | Check for `undefined` |
33
+ | `MasterRecordDetailResponse` corrected | Type gains server-only fields | Remove local re-declarations |
34
+ | `dynamicFields` is an array | Single-object assignment fails | Wrap the field in an array |
35
+
36
+ ---
37
+
8
38
  ## [1.9.0] - 2026-08-03
9
39
 
10
40
  ### Changed
package/README.md CHANGED
@@ -27,7 +27,7 @@ const client = new AvesClient({
27
27
  timeoutMs: 30_000, // optional
28
28
  });
29
29
 
30
- const result = await client.search({
30
+ const result = await client.master.search({
31
31
  searchType: 'CODE',
32
32
  recordCode: '508558',
33
33
  });
@@ -41,20 +41,17 @@ if (result.success) {
41
41
 
42
42
  ## Client shape
43
43
 
44
- `AvesClient` is a facade over domain clients. **Prefer namespaces.** Flat methods are auto-bound from domain prototypes (no hand-maintained forwarders).
44
+ `AvesClient` is a facade over domain clients. Operations are namespaced by domain.
45
45
 
46
46
  ```typescript
47
- // canonical
48
47
  await client.booking.createBooking(params);
49
48
  await client.packages.searchPackages(params);
50
49
  await client.master.search({ searchType: 'CODE', recordCode: '508558' });
51
-
52
- // flat compat (same implementations)
53
- await client.createBooking(params);
54
- await client.searchPackages(params);
55
- await client.search({ searchType: 'CODE', recordCode: '508558' });
56
50
  ```
57
51
 
52
+ Migration from 1.x: insert the appropriate domain namespace (for example,
53
+ `client.search` → `client.master.search`). See the [2.0.0 migration notes](./CHANGELOG.md).
54
+
58
55
  | Namespace | Methods |
59
56
  | --------- | ------- |
60
57
  | `master` | `search`, `upsertRecord` |
@@ -105,7 +102,7 @@ type Result<T, E> =
105
102
 
106
103
  ## Master records
107
104
 
108
- ### `search(params)` / `client.master.search`
105
+ ### `client.master.search(params)`
109
106
 
110
107
  | `searchType` | Required fields |
111
108
  | ------------ | --------------- |
@@ -124,18 +121,18 @@ const byCode = await client.master.search({
124
121
  recordCode: '508558',
125
122
  });
126
123
 
127
- const byEmail = await client.search({
124
+ const byEmail = await client.master.search({
128
125
  searchType: 'EMAIL',
129
126
  email: 'user@example.com',
130
127
  });
131
128
  ```
132
129
 
133
- ### `upsertRecord(record)` / `client.master.upsertRecord`
130
+ ### `client.master.upsertRecord(record)`
134
131
 
135
132
  `insertCriteria`: `'S'` always insert · `'N'` skip if exists · `'T'` update all (default) · `'M'` secondary fields only.
136
133
 
137
134
  ```typescript
138
- const result = await client.upsertRecord({
135
+ const result = await client.master.upsertRecord({
139
136
  name: 'Jane Smith',
140
137
  email: 'jane@example.com',
141
138
  languageCode: '02',
@@ -353,7 +350,7 @@ if (detail.success) console.log(detail.data.pCode, detail.data.serviceList?.[0])
353
350
  ```typescript
354
351
  import { AvesClient, AvesError } from 'aves-sdk';
355
352
 
356
- const result = await client.search({
353
+ const result = await client.master.search({
357
354
  searchType: 'CODE',
358
355
  recordCode: '508558',
359
356
  });
@@ -413,18 +410,19 @@ Editing CreateBooking shapes does not affect SearchFile or AvesSearch.
413
410
  | `MasterRecordsClient` | search / upsert |
414
411
  | `BookingClient` | booking file ops + search practices |
415
412
  | `PackageCatalogClient` | package/program catalog |
416
- | `client/types.ts` | `AvesClientDeps` / `AvesClientFlat` |
417
- | `client/flat-aliases.ts` | bind flat compat methods from domain prototypes |
413
+ | `client/types.ts` | `AvesClientDeps` |
418
414
  | `src/xml/` | XML root helpers + JSON ↔ XML |
419
415
 
420
- Flat aliases (`client.createBooking`, …) are attached in the constructor — add a domain method once and both surfaces work.
421
-
422
416
  Outbound path: validate → `createApiSchema` / `toWireBody` → `invokeOp` → XML POST.
423
417
 
424
418
  ---
425
419
 
426
420
  ## Types
427
421
 
422
+ Operations are available only through `client.master`, `client.booking`, and
423
+ `client.packages`; flat aliases were removed in 2.0.0. See the
424
+ [migration notes](./CHANGELOG.md) when upgrading.
425
+
428
426
  ```typescript
429
427
  import type {
430
428
  AvesClientOptions,