kaafil-js 0.4.0 → 0.5.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/dist/index.cjs CHANGED
@@ -4710,13 +4710,21 @@ function createTripsResource(client) {
4710
4710
  const { tripRef, idempotencyKey, signal, travellers, ...rest } = options;
4711
4711
  const body = {
4712
4712
  ...rest,
4713
- travellers: travellers.map((traveller, index) => ({
4714
- ...traveller,
4715
- sourceUpdatedAt: normalizeDateTimeInput(
4716
- traveller.sourceUpdatedAt,
4717
- `travellers[${index}].sourceUpdatedAt`
4718
- )
4719
- }))
4713
+ // `sourceUpdatedAt` is optional on this entry shape. Omitted, the
4714
+ // key is left OFF the body entirely rather than sent as `undefined`
4715
+ // — the server stamps the write itself, and an explicit `undefined`
4716
+ // would serialise as a missing key anyway but read, in this file, as
4717
+ // though a value had been intended.
4718
+ travellers: travellers.map((traveller, index) => {
4719
+ const { sourceUpdatedAt, ...entry } = traveller;
4720
+ return sourceUpdatedAt === void 0 ? entry : {
4721
+ ...entry,
4722
+ sourceUpdatedAt: normalizeDateTimeInput(
4723
+ sourceUpdatedAt,
4724
+ `travellers[${index}].sourceUpdatedAt`
4725
+ )
4726
+ };
4727
+ })
4720
4728
  };
4721
4729
  return client.execute({
4722
4730
  method: "POST",