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.
@@ -6324,13 +6324,21 @@ function createTripsResource(client) {
6324
6324
  const { tripRef, idempotencyKey, signal, travellers, ...rest } = options;
6325
6325
  const body = {
6326
6326
  ...rest,
6327
- travellers: travellers.map((traveller, index) => ({
6328
- ...traveller,
6329
- sourceUpdatedAt: normalizeDateTimeInput(
6330
- traveller.sourceUpdatedAt,
6331
- `travellers[${index}].sourceUpdatedAt`
6332
- )
6333
- }))
6327
+ // `sourceUpdatedAt` is optional on this entry shape. Omitted, the
6328
+ // key is left OFF the body entirely rather than sent as `undefined`
6329
+ // — the server stamps the write itself, and an explicit `undefined`
6330
+ // would serialise as a missing key anyway but read, in this file, as
6331
+ // though a value had been intended.
6332
+ travellers: travellers.map((traveller, index) => {
6333
+ const { sourceUpdatedAt, ...entry } = traveller;
6334
+ return sourceUpdatedAt === void 0 ? entry : {
6335
+ ...entry,
6336
+ sourceUpdatedAt: normalizeDateTimeInput(
6337
+ sourceUpdatedAt,
6338
+ `travellers[${index}].sourceUpdatedAt`
6339
+ )
6340
+ };
6341
+ })
6334
6342
  };
6335
6343
  return client.execute({
6336
6344
  method: "POST",