kaafil-react-uikit 0.3.1 → 0.4.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 +62 -0
- package/dist/admin/index.cjs +565 -387
- package/dist/admin/index.cjs.map +1 -1
- package/dist/admin/index.d.cts +2 -2
- package/dist/admin/index.d.ts +2 -2
- package/dist/admin/index.js +231 -53
- package/dist/admin/index.js.map +1 -1
- package/dist/{chunk-IU2UM5JP.cjs → chunk-2D4Y4LOT.cjs} +88 -48
- package/dist/chunk-2D4Y4LOT.cjs.map +1 -0
- package/dist/{chunk-KW5LH6KV.js → chunk-2JABR4FF.js} +3 -3
- package/dist/{chunk-KW5LH6KV.js.map → chunk-2JABR4FF.js.map} +1 -1
- package/dist/{chunk-YNHOPYBK.cjs → chunk-4LZXDRAD.cjs} +12 -12
- package/dist/{chunk-YNHOPYBK.cjs.map → chunk-4LZXDRAD.cjs.map} +1 -1
- package/dist/{chunk-YU2242AR.js → chunk-5DVTAEQC.js} +5 -5
- package/dist/{chunk-YU2242AR.js.map → chunk-5DVTAEQC.js.map} +1 -1
- package/dist/{chunk-A4Z2YBEF.js → chunk-ABWNV4N4.js} +86 -38
- package/dist/chunk-ABWNV4N4.js.map +1 -0
- package/dist/{chunk-GJ2J3PYN.js → chunk-BUE2GJDN.js} +3 -3
- package/dist/{chunk-GJ2J3PYN.js.map → chunk-BUE2GJDN.js.map} +1 -1
- package/dist/{chunk-UALMCHNW.cjs → chunk-CCJ5XNWY.cjs} +86 -38
- package/dist/chunk-CCJ5XNWY.cjs.map +1 -0
- package/dist/{chunk-VLP323AD.js → chunk-DABF4PUI.js} +3 -3
- package/dist/{chunk-VLP323AD.js.map → chunk-DABF4PUI.js.map} +1 -1
- package/dist/{chunk-HACH2NUM.cjs → chunk-DDSNXKFN.cjs} +9 -9
- package/dist/{chunk-HACH2NUM.cjs.map → chunk-DDSNXKFN.cjs.map} +1 -1
- package/dist/{chunk-ECCQW5LN.cjs → chunk-DUZG6A22.cjs} +4 -4
- package/dist/{chunk-ECCQW5LN.cjs.map → chunk-DUZG6A22.cjs.map} +1 -1
- package/dist/{chunk-JHMN6Q5R.js → chunk-EP4VCID7.js} +92 -47
- package/dist/chunk-EP4VCID7.js.map +1 -0
- package/dist/{chunk-57SUK3GD.cjs → chunk-KDGBJPPZ.cjs} +7 -7
- package/dist/{chunk-57SUK3GD.cjs.map → chunk-KDGBJPPZ.cjs.map} +1 -1
- package/dist/{chunk-BBC5EX5O.cjs → chunk-TPBKRXEB.cjs} +17 -17
- package/dist/{chunk-BBC5EX5O.cjs.map → chunk-TPBKRXEB.cjs.map} +1 -1
- package/dist/{chunk-RWLO6IFX.js → chunk-TV5QTT44.js} +3 -3
- package/dist/{chunk-RWLO6IFX.js.map → chunk-TV5QTT44.js.map} +1 -1
- package/dist/{chunk-RO2RNHQP.js → chunk-VAJ4D7EF.js} +56 -17
- package/dist/chunk-VAJ4D7EF.js.map +1 -0
- package/dist/{chunk-6TI6YQPE.cjs → chunk-XBYLSJOS.cjs} +168 -123
- package/dist/chunk-XBYLSJOS.cjs.map +1 -0
- package/dist/core/index.cjs +124 -121
- package/dist/core/index.cjs.map +1 -1
- package/dist/core/index.d.cts +10 -1
- package/dist/core/index.d.ts +10 -1
- package/dist/core/index.js +20 -19
- package/dist/core/index.js.map +1 -1
- package/dist/index.css +1 -1
- package/dist/manager/index.cjs +239 -239
- package/dist/manager/index.js +6 -6
- package/dist/tokens.json +5013 -0
- package/dist/traveller/index.cjs +46 -40
- package/dist/traveller/index.cjs.map +1 -1
- package/dist/traveller/index.js +16 -10
- package/dist/traveller/index.js.map +1 -1
- package/dist/{useAgencyTrip-BUYSIaC2.d.cts → useAgencyTrip-C1YmfuQq.d.cts} +35 -1
- package/dist/{useAgencyTrip-BzyJB1D9.d.ts → useAgencyTrip-gZB0NILH.d.ts} +35 -1
- package/package.json +4 -3
- package/dist/chunk-6TI6YQPE.cjs.map +0 -1
- package/dist/chunk-A4Z2YBEF.js.map +0 -1
- package/dist/chunk-IU2UM5JP.cjs.map +0 -1
- package/dist/chunk-JHMN6Q5R.js.map +0 -1
- package/dist/chunk-RO2RNHQP.js.map +0 -1
- package/dist/chunk-UALMCHNW.cjs.map +0 -1
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
4
|
-
var
|
|
5
|
-
var
|
|
3
|
+
var chunkXBYLSJOS_cjs = require('./chunk-XBYLSJOS.cjs');
|
|
4
|
+
var chunkDUZG6A22_cjs = require('./chunk-DUZG6A22.cjs');
|
|
5
|
+
var chunkCCJ5XNWY_cjs = require('./chunk-CCJ5XNWY.cjs');
|
|
6
6
|
var react = require('react');
|
|
7
7
|
var client = require('kaafil-js/client');
|
|
8
8
|
|
|
9
9
|
function useAgencyAdminMe() {
|
|
10
|
-
const client =
|
|
10
|
+
const client = chunkCCJ5XNWY_cjs.useKaafilClient();
|
|
11
11
|
const [result, setResult] = react.useState({ status: "loading" });
|
|
12
12
|
react.useEffect(() => {
|
|
13
13
|
let cancelled = false;
|
|
@@ -29,7 +29,7 @@ function useAgencyAdminMe() {
|
|
|
29
29
|
return result;
|
|
30
30
|
}
|
|
31
31
|
function useAgencyChecklistTemplates() {
|
|
32
|
-
const client =
|
|
32
|
+
const client = chunkCCJ5XNWY_cjs.useKaafilClient();
|
|
33
33
|
const [templates, setTemplates] = react.useState([]);
|
|
34
34
|
const [loaded, setLoaded] = react.useState(false);
|
|
35
35
|
const [lastFetchFailed, setLastFetchFailed] = react.useState(false);
|
|
@@ -89,7 +89,7 @@ function useAgencyChecklistTemplates() {
|
|
|
89
89
|
};
|
|
90
90
|
}
|
|
91
91
|
function useAgencyForms() {
|
|
92
|
-
const client =
|
|
92
|
+
const client = chunkCCJ5XNWY_cjs.useKaafilClient();
|
|
93
93
|
const [forms, setForms] = react.useState([]);
|
|
94
94
|
const [loaded, setLoaded] = react.useState(false);
|
|
95
95
|
const [lastFetchFailed, setLastFetchFailed] = react.useState(false);
|
|
@@ -245,7 +245,7 @@ function useAgencyForms() {
|
|
|
245
245
|
};
|
|
246
246
|
}
|
|
247
247
|
function useAgencyJourneyTriggers() {
|
|
248
|
-
const client =
|
|
248
|
+
const client = chunkCCJ5XNWY_cjs.useKaafilClient();
|
|
249
249
|
const [triggers, setTriggers] = react.useState([]);
|
|
250
250
|
const [loaded, setLoaded] = react.useState(false);
|
|
251
251
|
const [lastFetchFailed, setLastFetchFailed] = react.useState(false);
|
|
@@ -273,7 +273,7 @@ function useAgencyJourneyTriggers() {
|
|
|
273
273
|
return { triggers, loaded, lastFetchFailed, refresh, patchTrigger };
|
|
274
274
|
}
|
|
275
275
|
function useAgencyManagerProfile(managerRef) {
|
|
276
|
-
const client =
|
|
276
|
+
const client = chunkCCJ5XNWY_cjs.useKaafilClient();
|
|
277
277
|
const [read, setRead] = react.useState(void 0);
|
|
278
278
|
const [readFailed, setReadFailed] = react.useState(false);
|
|
279
279
|
const refresh = react.useCallback(async () => {
|
|
@@ -291,7 +291,7 @@ function useAgencyManagerProfile(managerRef) {
|
|
|
291
291
|
return { read, readFailed, refresh };
|
|
292
292
|
}
|
|
293
293
|
function useAgencySettings() {
|
|
294
|
-
const client =
|
|
294
|
+
const client = chunkCCJ5XNWY_cjs.useKaafilClient();
|
|
295
295
|
const [document, setDocument] = react.useState(void 0);
|
|
296
296
|
const [loaded, setLoaded] = react.useState(false);
|
|
297
297
|
const [lastFetchFailed, setLastFetchFailed] = react.useState(false);
|
|
@@ -319,7 +319,7 @@ function useAgencySettings() {
|
|
|
319
319
|
return { document, loaded, lastFetchFailed, refresh, patchSettings };
|
|
320
320
|
}
|
|
321
321
|
function useAgencyTrip(tripRef) {
|
|
322
|
-
const client =
|
|
322
|
+
const client = chunkCCJ5XNWY_cjs.useKaafilClient();
|
|
323
323
|
const [read, setRead] = react.useState(void 0);
|
|
324
324
|
const [readFailed, setReadFailed] = react.useState(false);
|
|
325
325
|
const refresh = react.useCallback(async () => {
|
|
@@ -337,9 +337,9 @@ function useAgencyTrip(tripRef) {
|
|
|
337
337
|
return { read, readFailed, refresh };
|
|
338
338
|
}
|
|
339
339
|
var DEFAULT_PAGE_LIMIT = 20;
|
|
340
|
-
var GROUPED_PAGE_LIMIT =
|
|
340
|
+
var GROUPED_PAGE_LIMIT = 100;
|
|
341
341
|
function useAgencyTripManifest(tripRef) {
|
|
342
|
-
const client =
|
|
342
|
+
const client = chunkCCJ5XNWY_cjs.useKaafilClient();
|
|
343
343
|
const [facets, setFacets] = react.useState(void 0);
|
|
344
344
|
const mountedRef = react.useRef(true);
|
|
345
345
|
react.useEffect(() => {
|
|
@@ -370,7 +370,7 @@ function useAgencyTripManifest(tripRef) {
|
|
|
370
370
|
}
|
|
371
371
|
var DEFAULT_PAGE_LIMIT2 = 20;
|
|
372
372
|
function useAgencyTrips() {
|
|
373
|
-
const client =
|
|
373
|
+
const client = chunkCCJ5XNWY_cjs.useKaafilClient();
|
|
374
374
|
const [segmentCounts, setSegmentCounts] = react.useState(
|
|
375
375
|
void 0
|
|
376
376
|
);
|
|
@@ -400,18 +400,18 @@ function useAgencyTrips() {
|
|
|
400
400
|
);
|
|
401
401
|
return { makeTripsFetch, segmentCounts };
|
|
402
402
|
}
|
|
403
|
-
var useBookingsInternal =
|
|
403
|
+
var useBookingsInternal = chunkXBYLSJOS_cjs.createDomainHook("bookings", (tripRef) => {
|
|
404
404
|
const {
|
|
405
405
|
rows: bookings,
|
|
406
406
|
syncedAt,
|
|
407
407
|
refreshLive
|
|
408
|
-
} =
|
|
408
|
+
} = chunkXBYLSJOS_cjs.useSnapshotList(tripRef, "bookings", {
|
|
409
409
|
live: async (liveClient, ref) => {
|
|
410
410
|
const response = await liveClient.bookings.list({ tripRef: ref });
|
|
411
411
|
return { rows: [...response], syncedAt: response.meta.serverTime };
|
|
412
412
|
}
|
|
413
413
|
});
|
|
414
|
-
const vouchersMutation =
|
|
414
|
+
const vouchersMutation = chunkCCJ5XNWY_cjs.useOfflineMutation({
|
|
415
415
|
tripRef,
|
|
416
416
|
enqueue: (engine, input) => engine.enqueue({
|
|
417
417
|
tripRef,
|
|
@@ -448,10 +448,10 @@ function useBookings(tripRef) {
|
|
|
448
448
|
return useBookingsInternal(tripRef);
|
|
449
449
|
}
|
|
450
450
|
function useCapabilityStatuses(tripRef) {
|
|
451
|
-
const { rows, loaded } =
|
|
451
|
+
const { rows, loaded } = chunkCCJ5XNWY_cjs.useCapabilityRows(tripRef);
|
|
452
452
|
const statuses = react.useMemo(() => {
|
|
453
453
|
const map = /* @__PURE__ */ new Map();
|
|
454
|
-
for (const row of rows) map.set(row.capability,
|
|
454
|
+
for (const row of rows) map.set(row.capability, chunkCCJ5XNWY_cjs.deriveCapabilityTriple(row).status);
|
|
455
455
|
return map;
|
|
456
456
|
}, [rows]);
|
|
457
457
|
return { statuses, loaded };
|
|
@@ -469,8 +469,8 @@ var DirectoriesWriteError = class _DirectoriesWriteError extends Error {
|
|
|
469
469
|
}
|
|
470
470
|
};
|
|
471
471
|
function useDirectories(agencyRef) {
|
|
472
|
-
const client =
|
|
473
|
-
const serverTime =
|
|
472
|
+
const client = chunkCCJ5XNWY_cjs.useKaafilClient();
|
|
473
|
+
const serverTime = chunkDUZG6A22_cjs.useServerTime();
|
|
474
474
|
const makeManagersFetch = react.useCallback(
|
|
475
475
|
(filters) => async (cursor) => {
|
|
476
476
|
const page = await client.agencies.managers.listPage({
|
|
@@ -517,7 +517,7 @@ function useDirectories(agencyRef) {
|
|
|
517
517
|
isLead: input.isLead
|
|
518
518
|
});
|
|
519
519
|
} catch (error) {
|
|
520
|
-
throw new DirectoriesWriteError(
|
|
520
|
+
throw new DirectoriesWriteError(chunkXBYLSJOS_cjs.classifyError(error));
|
|
521
521
|
}
|
|
522
522
|
},
|
|
523
523
|
[client]
|
|
@@ -532,7 +532,7 @@ function useDirectories(agencyRef) {
|
|
|
532
532
|
...input.isLead === void 0 ? {} : { isLead: input.isLead }
|
|
533
533
|
});
|
|
534
534
|
} catch (error) {
|
|
535
|
-
throw new DirectoriesWriteError(
|
|
535
|
+
throw new DirectoriesWriteError(chunkXBYLSJOS_cjs.classifyError(error));
|
|
536
536
|
}
|
|
537
537
|
},
|
|
538
538
|
[client]
|
|
@@ -545,7 +545,7 @@ function useDirectories(agencyRef) {
|
|
|
545
545
|
managerRef: input.managerRef
|
|
546
546
|
});
|
|
547
547
|
} catch (error) {
|
|
548
|
-
throw new DirectoriesWriteError(
|
|
548
|
+
throw new DirectoriesWriteError(chunkXBYLSJOS_cjs.classifyError(error));
|
|
549
549
|
}
|
|
550
550
|
},
|
|
551
551
|
[client]
|
|
@@ -581,7 +581,7 @@ function useDirectories(agencyRef) {
|
|
|
581
581
|
if (error instanceof DirectoriesWriteError) {
|
|
582
582
|
throw error;
|
|
583
583
|
}
|
|
584
|
-
throw new DirectoriesWriteError(
|
|
584
|
+
throw new DirectoriesWriteError(chunkXBYLSJOS_cjs.classifyError(error));
|
|
585
585
|
}
|
|
586
586
|
},
|
|
587
587
|
[client, serverTime]
|
|
@@ -597,7 +597,7 @@ function useDirectories(agencyRef) {
|
|
|
597
597
|
externalTravellerId: input.externalTravellerId
|
|
598
598
|
});
|
|
599
599
|
} catch (error) {
|
|
600
|
-
throw new DirectoriesWriteError(
|
|
600
|
+
throw new DirectoriesWriteError(chunkXBYLSJOS_cjs.classifyError(error));
|
|
601
601
|
}
|
|
602
602
|
},
|
|
603
603
|
[client]
|
|
@@ -610,7 +610,7 @@ function useDirectories(agencyRef) {
|
|
|
610
610
|
travellerRef: input.travellerRef
|
|
611
611
|
});
|
|
612
612
|
} catch (error) {
|
|
613
|
-
throw new DirectoriesWriteError(
|
|
613
|
+
throw new DirectoriesWriteError(chunkXBYLSJOS_cjs.classifyError(error));
|
|
614
614
|
}
|
|
615
615
|
},
|
|
616
616
|
[client]
|
|
@@ -625,7 +625,7 @@ function useDirectories(agencyRef) {
|
|
|
625
625
|
travellerRefs: [...input.travellerRefs]
|
|
626
626
|
});
|
|
627
627
|
} catch (error) {
|
|
628
|
-
throw new DirectoriesWriteError(
|
|
628
|
+
throw new DirectoriesWriteError(chunkXBYLSJOS_cjs.classifyError(error));
|
|
629
629
|
}
|
|
630
630
|
},
|
|
631
631
|
[client]
|
|
@@ -642,7 +642,7 @@ function useDirectories(agencyRef) {
|
|
|
642
642
|
...input.travellerRefs !== void 0 ? { travellerRefs: [...input.travellerRefs] } : {}
|
|
643
643
|
});
|
|
644
644
|
} catch (error) {
|
|
645
|
-
throw new DirectoriesWriteError(
|
|
645
|
+
throw new DirectoriesWriteError(chunkXBYLSJOS_cjs.classifyError(error));
|
|
646
646
|
}
|
|
647
647
|
},
|
|
648
648
|
[client]
|
|
@@ -652,7 +652,7 @@ function useDirectories(agencyRef) {
|
|
|
652
652
|
try {
|
|
653
653
|
await client.trips.parties.remove({ tripRef: input.tripRef, partyId: input.partyId });
|
|
654
654
|
} catch (error) {
|
|
655
|
-
throw new DirectoriesWriteError(
|
|
655
|
+
throw new DirectoriesWriteError(chunkXBYLSJOS_cjs.classifyError(error));
|
|
656
656
|
}
|
|
657
657
|
},
|
|
658
658
|
[client]
|
|
@@ -666,7 +666,7 @@ function useDirectories(agencyRef) {
|
|
|
666
666
|
body: input.body
|
|
667
667
|
});
|
|
668
668
|
} catch (error) {
|
|
669
|
-
throw new DirectoriesWriteError(
|
|
669
|
+
throw new DirectoriesWriteError(chunkXBYLSJOS_cjs.classifyError(error));
|
|
670
670
|
}
|
|
671
671
|
},
|
|
672
672
|
[client]
|
|
@@ -691,19 +691,33 @@ function usePaginatedList(fetch, options) {
|
|
|
691
691
|
const [rows, setRows] = react.useState([]);
|
|
692
692
|
const [hasNext, setHasNext] = react.useState(false);
|
|
693
693
|
const [pageIndex, setPageIndex] = react.useState(0);
|
|
694
|
+
const [settled, setSettled] = react.useState(false);
|
|
695
|
+
const [error, setError] = react.useState(void 0);
|
|
694
696
|
const fetchRef = react.useRef(fetch);
|
|
695
697
|
fetchRef.current = fetch;
|
|
698
|
+
const accumulateRef = react.useRef(options?.accumulate === true);
|
|
699
|
+
accumulateRef.current = options?.accumulate === true;
|
|
696
700
|
const cursorsRef = react.useRef([void 0]);
|
|
697
701
|
const loadPage = react.useCallback(async (index) => {
|
|
698
702
|
const cursor = cursorsRef.current[index];
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
|
|
703
|
+
try {
|
|
704
|
+
const result = await fetchRef.current(cursor);
|
|
705
|
+
cursorsRef.current = cursorsRef.current.slice(0, index + 1);
|
|
706
|
+
if (result.nextCursor !== void 0) {
|
|
707
|
+
cursorsRef.current[index + 1] = result.nextCursor;
|
|
708
|
+
}
|
|
709
|
+
setRows(
|
|
710
|
+
(previous) => accumulateRef.current && index > 0 ? [...previous, ...result.rows] : result.rows
|
|
711
|
+
);
|
|
712
|
+
setHasNext(result.nextCursor !== void 0);
|
|
713
|
+
setPageIndex(index);
|
|
714
|
+
setError(void 0);
|
|
715
|
+
} catch (caught) {
|
|
716
|
+
setError(chunkXBYLSJOS_cjs.classifyError(caught));
|
|
717
|
+
setHasNext(false);
|
|
718
|
+
} finally {
|
|
719
|
+
setSettled(true);
|
|
703
720
|
}
|
|
704
|
-
setRows(result.rows);
|
|
705
|
-
setHasNext(result.nextCursor !== void 0);
|
|
706
|
-
setPageIndex(index);
|
|
707
721
|
}, []);
|
|
708
722
|
react.useEffect(() => {
|
|
709
723
|
void loadPage(0);
|
|
@@ -715,12 +729,26 @@ function usePaginatedList(fetch, options) {
|
|
|
715
729
|
await loadPage(pageIndex + 1);
|
|
716
730
|
}, [hasNext, pageIndex, loadPage]);
|
|
717
731
|
const loadPrev = react.useCallback(async () => {
|
|
718
|
-
if (pageIndex === 0) {
|
|
732
|
+
if (pageIndex === 0 || accumulateRef.current) {
|
|
719
733
|
return;
|
|
720
734
|
}
|
|
721
735
|
await loadPage(pageIndex - 1);
|
|
722
736
|
}, [pageIndex, loadPage]);
|
|
723
|
-
return {
|
|
737
|
+
return {
|
|
738
|
+
rows,
|
|
739
|
+
hasNext,
|
|
740
|
+
hasPrev: !accumulateRef.current && pageIndex > 0,
|
|
741
|
+
settled,
|
|
742
|
+
error,
|
|
743
|
+
loadNext,
|
|
744
|
+
loadPrev
|
|
745
|
+
};
|
|
746
|
+
}
|
|
747
|
+
|
|
748
|
+
// src/core/hooks/useResolvedSetting.ts
|
|
749
|
+
function useResolvedSetting(key) {
|
|
750
|
+
const config = chunkCCJ5XNWY_cjs.useRequiredContext(chunkCCJ5XNWY_cjs.ConfigContext, "useResolvedSetting", "ConfigShell");
|
|
751
|
+
return config.resolveSetting(key);
|
|
724
752
|
}
|
|
725
753
|
var SHARE_SECTION_KEYS = [
|
|
726
754
|
"itinerary",
|
|
@@ -750,7 +778,7 @@ var ShareLinkWriteError = class extends Error {
|
|
|
750
778
|
}
|
|
751
779
|
};
|
|
752
780
|
function useShareLinks(tripRef, travellerRef) {
|
|
753
|
-
const client =
|
|
781
|
+
const client = chunkCCJ5XNWY_cjs.useKaafilClient();
|
|
754
782
|
const [links, setLinks] = react.useState(void 0);
|
|
755
783
|
const [readFailed, setReadFailed] = react.useState(false);
|
|
756
784
|
const refresh = react.useCallback(async () => {
|
|
@@ -781,7 +809,7 @@ function useShareLinks(tripRef, travellerRef) {
|
|
|
781
809
|
await refresh();
|
|
782
810
|
return minted;
|
|
783
811
|
} catch (error) {
|
|
784
|
-
throw new ShareLinkWriteError(
|
|
812
|
+
throw new ShareLinkWriteError(chunkXBYLSJOS_cjs.classifyError(error));
|
|
785
813
|
}
|
|
786
814
|
},
|
|
787
815
|
[client, tripRef, refresh]
|
|
@@ -792,7 +820,7 @@ function useShareLinks(tripRef, travellerRef) {
|
|
|
792
820
|
await client.shareTokens.revoke({ id });
|
|
793
821
|
await refresh();
|
|
794
822
|
} catch (error) {
|
|
795
|
-
throw new ShareLinkWriteError(
|
|
823
|
+
throw new ShareLinkWriteError(chunkXBYLSJOS_cjs.classifyError(error));
|
|
796
824
|
}
|
|
797
825
|
},
|
|
798
826
|
[client, refresh]
|
|
@@ -808,7 +836,7 @@ function useShareLinks(tripRef, travellerRef) {
|
|
|
808
836
|
});
|
|
809
837
|
await refresh();
|
|
810
838
|
} catch (error) {
|
|
811
|
-
throw new ShareLinkWriteError(
|
|
839
|
+
throw new ShareLinkWriteError(chunkXBYLSJOS_cjs.classifyError(error));
|
|
812
840
|
}
|
|
813
841
|
},
|
|
814
842
|
[client, refresh]
|
|
@@ -820,15 +848,26 @@ function useShareLinks(tripRef, travellerRef) {
|
|
|
820
848
|
await refresh();
|
|
821
849
|
return minted;
|
|
822
850
|
} catch (error) {
|
|
823
|
-
throw new ShareLinkWriteError(
|
|
851
|
+
throw new ShareLinkWriteError(chunkXBYLSJOS_cjs.classifyError(error));
|
|
824
852
|
}
|
|
825
853
|
},
|
|
826
854
|
[client, refresh]
|
|
827
855
|
);
|
|
828
|
-
|
|
856
|
+
const reveal = react.useCallback(
|
|
857
|
+
async (id) => {
|
|
858
|
+
try {
|
|
859
|
+
const response = await client.shareTokens.reveal({ id });
|
|
860
|
+
return response.token;
|
|
861
|
+
} catch (error) {
|
|
862
|
+
throw new ShareLinkWriteError(chunkXBYLSJOS_cjs.classifyError(error));
|
|
863
|
+
}
|
|
864
|
+
},
|
|
865
|
+
[client]
|
|
866
|
+
);
|
|
867
|
+
return { links, readFailed, refresh, mint, revoke, patch, regenerate, reveal };
|
|
829
868
|
}
|
|
830
869
|
function useTravellerFormResponses(tripRef, travellerRef) {
|
|
831
|
-
const client =
|
|
870
|
+
const client = chunkCCJ5XNWY_cjs.useKaafilClient();
|
|
832
871
|
const [responses, setResponses] = react.useState(
|
|
833
872
|
void 0
|
|
834
873
|
);
|
|
@@ -952,7 +991,8 @@ exports.useBookings = useBookings;
|
|
|
952
991
|
exports.useCapabilityStatuses = useCapabilityStatuses;
|
|
953
992
|
exports.useDirectories = useDirectories;
|
|
954
993
|
exports.usePaginatedList = usePaginatedList;
|
|
994
|
+
exports.useResolvedSetting = useResolvedSetting;
|
|
955
995
|
exports.useShareLinks = useShareLinks;
|
|
956
996
|
exports.useTravellerFormResponses = useTravellerFormResponses;
|
|
957
|
-
//# sourceMappingURL=chunk-
|
|
958
|
-
//# sourceMappingURL=chunk-
|
|
997
|
+
//# sourceMappingURL=chunk-2D4Y4LOT.cjs.map
|
|
998
|
+
//# sourceMappingURL=chunk-2D4Y4LOT.cjs.map
|