kaafil-react-uikit 0.1.0 → 0.3.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/admin/index.cjs +342 -342
- package/dist/admin/index.js +5 -5
- package/dist/{chunk-YHOQRKDJ.cjs → chunk-57SUK3GD.cjs} +7 -7
- package/dist/{chunk-YHOQRKDJ.cjs.map → chunk-57SUK3GD.cjs.map} +1 -1
- package/dist/{chunk-2SRBJ4H7.js → chunk-A4Z2YBEF.js} +19 -5
- package/dist/chunk-A4Z2YBEF.js.map +1 -0
- package/dist/{chunk-2MWTLYVP.cjs → chunk-BBC5EX5O.cjs} +17 -17
- package/dist/{chunk-2MWTLYVP.cjs.map → chunk-BBC5EX5O.cjs.map} +1 -1
- package/dist/{chunk-W5PG3IUJ.cjs → chunk-ECCQW5LN.cjs} +7 -4
- package/dist/chunk-ECCQW5LN.cjs.map +1 -0
- package/dist/{chunk-M2D6CZK2.cjs → chunk-FVK7HMQ5.cjs} +37 -37
- package/dist/{chunk-M2D6CZK2.cjs.map → chunk-FVK7HMQ5.cjs.map} +1 -1
- package/dist/{chunk-PYETPKTT.js → chunk-GJ2J3PYN.js} +3 -3
- package/dist/{chunk-PYETPKTT.js.map → chunk-GJ2J3PYN.js.map} +1 -1
- package/dist/{chunk-TF3GCIDK.cjs → chunk-HACH2NUM.cjs} +24 -13
- package/dist/chunk-HACH2NUM.cjs.map +1 -0
- package/dist/{chunk-PDQVVJCS.js → chunk-KW5LH6KV.js} +3 -3
- package/dist/{chunk-PDQVVJCS.js.map → chunk-KW5LH6KV.js.map} +1 -1
- package/dist/{chunk-WS2DKREI.cjs → chunk-MNUCVVIE.cjs} +168 -97
- package/dist/chunk-MNUCVVIE.cjs.map +1 -0
- package/dist/{chunk-CURTZGHY.js → chunk-RWLO6IFX.js} +19 -8
- package/dist/chunk-RWLO6IFX.js.map +1 -0
- package/dist/{chunk-V36WWMTF.cjs → chunk-UALMCHNW.cjs} +19 -5
- package/dist/chunk-UALMCHNW.cjs.map +1 -0
- package/dist/{chunk-JMWXQTE3.js → chunk-VLP323AD.js} +6 -3
- package/dist/chunk-VLP323AD.js.map +1 -0
- package/dist/{chunk-7WXE5SUS.js → chunk-WTTGPWMR.js} +92 -21
- package/dist/chunk-WTTGPWMR.js.map +1 -0
- package/dist/{chunk-PCDEJHWL.cjs → chunk-YNHOPYBK.cjs} +12 -12
- package/dist/{chunk-PCDEJHWL.cjs.map → chunk-YNHOPYBK.cjs.map} +1 -1
- package/dist/{chunk-FFXGZZGJ.js → chunk-YTSYRLGS.js} +5 -5
- package/dist/{chunk-FFXGZZGJ.js.map → chunk-YTSYRLGS.js.map} +1 -1
- package/dist/{chunk-E42K6UMM.js → chunk-YU2242AR.js} +5 -5
- package/dist/{chunk-E42K6UMM.js.map → chunk-YU2242AR.js.map} +1 -1
- package/dist/core/index.cjs +113 -113
- package/dist/core/index.js +11 -11
- package/dist/manager/index.cjs +239 -239
- package/dist/manager/index.js +6 -6
- package/dist/traveller/index.cjs +35 -35
- package/dist/traveller/index.js +5 -5
- package/package.json +2 -2
- package/dist/chunk-2SRBJ4H7.js.map +0 -1
- package/dist/chunk-7WXE5SUS.js.map +0 -1
- package/dist/chunk-CURTZGHY.js.map +0 -1
- package/dist/chunk-JMWXQTE3.js.map +0 -1
- package/dist/chunk-TF3GCIDK.cjs.map +0 -1
- package/dist/chunk-V36WWMTF.cjs.map +0 -1
- package/dist/chunk-W5PG3IUJ.cjs.map +0 -1
- package/dist/chunk-WS2DKREI.cjs.map +0 -1
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var chunkUALMCHNW_cjs = require('./chunk-UALMCHNW.cjs');
|
|
4
4
|
var client = require('kaafil-js/client');
|
|
5
5
|
var react = require('react');
|
|
6
6
|
|
|
@@ -99,8 +99,8 @@ function ensureTripPulled(engine, tripRef) {
|
|
|
99
99
|
|
|
100
100
|
// src/core/hooks/useSnapshotList.ts
|
|
101
101
|
function useSnapshotList(tripRef, listName, options) {
|
|
102
|
-
const engine = react.useContext(
|
|
103
|
-
const client = react.useContext(
|
|
102
|
+
const engine = react.useContext(chunkUALMCHNW_cjs.OfflineEngineContext);
|
|
103
|
+
const client = react.useContext(chunkUALMCHNW_cjs.KaafilClientContext);
|
|
104
104
|
const [rows, setRows] = react.useState(
|
|
105
105
|
() => engine === null ? [] : engine.snapshot.list(tripRef, listName)
|
|
106
106
|
);
|
|
@@ -161,15 +161,15 @@ function useSnapshotList(tripRef, listName, options) {
|
|
|
161
161
|
// src/core/internal/createDomainHook.ts
|
|
162
162
|
function createDomainHook(moduleKey, build) {
|
|
163
163
|
return function useDomainHook(tripRef) {
|
|
164
|
-
const { rows, loaded } =
|
|
164
|
+
const { rows, loaded } = chunkUALMCHNW_cjs.useCapabilityRows(tripRef);
|
|
165
165
|
const ready = build(tripRef);
|
|
166
166
|
if (!loaded) {
|
|
167
167
|
return { status: "loading" };
|
|
168
168
|
}
|
|
169
169
|
const row = rows.find((candidate) => candidate.capability === moduleKey);
|
|
170
|
-
const triple = row === void 0 ?
|
|
170
|
+
const triple = row === void 0 ? chunkUALMCHNW_cjs.UNKNOWN_CAPABILITY_TRIPLE : chunkUALMCHNW_cjs.deriveCapabilityTriple(row);
|
|
171
171
|
if (triple.status !== "lit") {
|
|
172
|
-
const reason =
|
|
172
|
+
const reason = chunkUALMCHNW_cjs.darkReasonFor(triple);
|
|
173
173
|
return { status: "dark", reason };
|
|
174
174
|
}
|
|
175
175
|
return { status: "ready", ...ready };
|
|
@@ -177,29 +177,46 @@ function createDomainHook(moduleKey, build) {
|
|
|
177
177
|
}
|
|
178
178
|
|
|
179
179
|
// src/core/hooks/useChecklists.ts
|
|
180
|
+
function appendPendingRows(fromAggregate, fromSnapshot) {
|
|
181
|
+
if (fromSnapshot.length === 0) {
|
|
182
|
+
return fromAggregate;
|
|
183
|
+
}
|
|
184
|
+
const known = new Set(fromAggregate.map((row) => row.id));
|
|
185
|
+
const pending = fromSnapshot.filter((row) => !known.has(row.id));
|
|
186
|
+
return pending.length === 0 ? fromAggregate : [...fromAggregate, ...pending];
|
|
187
|
+
}
|
|
180
188
|
var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
181
|
-
const client$1 =
|
|
182
|
-
const engine = react.useContext(
|
|
189
|
+
const client$1 = chunkUALMCHNW_cjs.useKaafilClient();
|
|
190
|
+
const engine = react.useContext(chunkUALMCHNW_cjs.OfflineEngineContext);
|
|
183
191
|
const { rows: snapshotItems, syncedAt } = useSnapshotList(
|
|
184
192
|
tripRef,
|
|
185
193
|
"checklist"
|
|
186
194
|
);
|
|
187
|
-
const
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
195
|
+
const aggregateCacheKey = `checklists.read:${tripRef}`;
|
|
196
|
+
const [aggregate, setAggregate] = react.useState(() => {
|
|
197
|
+
const cached = engine?.reads.get(
|
|
198
|
+
aggregateCacheKey
|
|
199
|
+
);
|
|
200
|
+
if (cached !== void 0) {
|
|
201
|
+
return { ...cached.value, loaded: true, lastFetchFailed: false };
|
|
202
|
+
}
|
|
203
|
+
return {
|
|
204
|
+
title: void 0,
|
|
205
|
+
subtitle: void 0,
|
|
206
|
+
progress: void 0,
|
|
207
|
+
hasOpenMandatoryByPhase: void 0,
|
|
208
|
+
sections: [],
|
|
209
|
+
items: [],
|
|
210
|
+
availableTemplates: [],
|
|
211
|
+
loaded: false,
|
|
212
|
+
lastFetchFailed: false,
|
|
213
|
+
fetchedAt: void 0
|
|
214
|
+
};
|
|
198
215
|
});
|
|
199
216
|
const refreshAggregate = react.useCallback(async () => {
|
|
200
217
|
try {
|
|
201
218
|
const response = await client$1.checklists.read({ tripRef });
|
|
202
|
-
|
|
219
|
+
const value = {
|
|
203
220
|
title: response.title,
|
|
204
221
|
subtitle: response.subtitle,
|
|
205
222
|
progress: response.progress,
|
|
@@ -207,14 +224,21 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
207
224
|
sections: response.sections,
|
|
208
225
|
items: response.items,
|
|
209
226
|
availableTemplates: response.availableTemplates,
|
|
210
|
-
loaded: true,
|
|
211
|
-
lastFetchFailed: false,
|
|
212
227
|
fetchedAt: response.meta.serverTime
|
|
228
|
+
};
|
|
229
|
+
void engine?.reads.set(aggregateCacheKey, value, response.meta.serverTime).catch(() => {
|
|
213
230
|
});
|
|
231
|
+
setAggregate({ ...value, loaded: true, lastFetchFailed: false });
|
|
214
232
|
} catch {
|
|
215
|
-
setAggregate((previous) =>
|
|
233
|
+
setAggregate((previous) => {
|
|
234
|
+
if (previous.loaded) {
|
|
235
|
+
return { ...previous, lastFetchFailed: true };
|
|
236
|
+
}
|
|
237
|
+
const cached = engine?.reads.get(aggregateCacheKey);
|
|
238
|
+
return cached === void 0 ? { ...previous, lastFetchFailed: true } : { ...cached.value, loaded: true, lastFetchFailed: true };
|
|
239
|
+
});
|
|
216
240
|
}
|
|
217
|
-
}, [client$1, tripRef]);
|
|
241
|
+
}, [client$1, tripRef, engine, aggregateCacheKey]);
|
|
218
242
|
react.useEffect(() => {
|
|
219
243
|
void refreshAggregate();
|
|
220
244
|
}, [refreshAggregate]);
|
|
@@ -227,14 +251,61 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
227
251
|
void refreshAggregate();
|
|
228
252
|
});
|
|
229
253
|
}, [engine, refreshAggregate]);
|
|
230
|
-
const addItemMutation =
|
|
254
|
+
const addItemMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
231
255
|
tripRef,
|
|
232
256
|
enqueue: (engine2, input) => engine2.enqueue({
|
|
233
257
|
tripRef,
|
|
234
258
|
method: client.SyncOpMethod.Post,
|
|
235
259
|
path: `/api/v1/trips/${tripRef}/checklist/items`,
|
|
236
260
|
operationId: "addChecklistItem",
|
|
237
|
-
body: input
|
|
261
|
+
body: input,
|
|
262
|
+
// ── THE OPTIMISTIC CREATE ──────────────────────────────────────
|
|
263
|
+
// Without this the item a manager adds out of signal does not
|
|
264
|
+
// appear until it syncs. It was queued, durable and landed on
|
|
265
|
+
// reconnect the whole time — and from where the manager is
|
|
266
|
+
// standing, work that does not show up is work that was lost, so
|
|
267
|
+
// they add it again.
|
|
268
|
+
//
|
|
269
|
+
// `creates` makes the ENGINE mint the row's temporary id (this
|
|
270
|
+
// hook never invents identifiers) and swap it for the server's
|
|
271
|
+
// canonical row the moment the write lands, in one
|
|
272
|
+
// `snapshot.updated`, so the item is never rendered twice.
|
|
273
|
+
creates: true,
|
|
274
|
+
entity: { listName: "checklist" },
|
|
275
|
+
// Shaped as a real `ChecklistItemDeltaRow` so the board renders it
|
|
276
|
+
// through the same path as every other row rather than a special
|
|
277
|
+
// "pending" branch. `id` is a placeholder the engine replaces with
|
|
278
|
+
// the id it mints; `version: 0` cannot beat any server row in the
|
|
279
|
+
// snapshot's version-guarded merge.
|
|
280
|
+
//
|
|
281
|
+
// The write addresses a section by its `sectionKey`, but the board
|
|
282
|
+
// groups rows by `sectionId`, so the id is resolved from the sections
|
|
283
|
+
// this hook already holds. Adding to a section that does not exist
|
|
284
|
+
// yet resolves to `''` and the row sits ungrouped until the write
|
|
285
|
+
// lands — correct rather than clever: inventing a section id would
|
|
286
|
+
// put the item under a heading that does not exist.
|
|
287
|
+
optimistic: {
|
|
288
|
+
id: "pending",
|
|
289
|
+
version: 0,
|
|
290
|
+
sectionId: aggregate.sections.find((section) => section.key === input.sectionKey)?.id ?? "",
|
|
291
|
+
key: input.key ?? null,
|
|
292
|
+
title: input.title,
|
|
293
|
+
subLine: null,
|
|
294
|
+
status: "OPEN",
|
|
295
|
+
// `=== true`, never `?? false` (hard rule #5): an omitted
|
|
296
|
+
// `mandatory` is the SERVER's default to apply, not this hook's to
|
|
297
|
+
// guess. The optimistic row shows it unstarred for the moment it
|
|
298
|
+
// takes the write to land, and the canonical row replaces it.
|
|
299
|
+
isMandatory: input.mandatory === true,
|
|
300
|
+
gate: null,
|
|
301
|
+
dayOffset: null,
|
|
302
|
+
sortOrder: Number.MAX_SAFE_INTEGER,
|
|
303
|
+
completedByManagerId: null,
|
|
304
|
+
performedByKind: null,
|
|
305
|
+
performedById: null,
|
|
306
|
+
completedAt: null,
|
|
307
|
+
updatedAt: null
|
|
308
|
+
}
|
|
238
309
|
}),
|
|
239
310
|
// ── THE DESK LANE ─────────────────────────────────────────────────
|
|
240
311
|
// All five checklist writes take the admin triple, and a desk console
|
|
@@ -246,7 +317,7 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
246
317
|
// lane for exactly that reason.
|
|
247
318
|
direct: (liveClient, input) => liveClient.checklists.items.add({ tripRef, ...input })
|
|
248
319
|
});
|
|
249
|
-
const patchItemMutation =
|
|
320
|
+
const patchItemMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
250
321
|
tripRef,
|
|
251
322
|
enqueue: (engine2, input) => {
|
|
252
323
|
const { itemId, version, ...body } = input;
|
|
@@ -261,7 +332,7 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
261
332
|
},
|
|
262
333
|
direct: (liveClient, input) => liveClient.checklists.items.patch({ tripRef, ...input })
|
|
263
334
|
});
|
|
264
|
-
const removeItemMutation =
|
|
335
|
+
const removeItemMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
265
336
|
tripRef,
|
|
266
337
|
enqueue: (engine2, input) => {
|
|
267
338
|
const { itemId, version } = input;
|
|
@@ -275,7 +346,7 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
275
346
|
},
|
|
276
347
|
direct: (liveClient, input) => liveClient.checklists.items.remove({ tripRef, ...input })
|
|
277
348
|
});
|
|
278
|
-
const toggleItemMutation =
|
|
349
|
+
const toggleItemMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
279
350
|
tripRef,
|
|
280
351
|
enqueue: (engine2, input) => {
|
|
281
352
|
const { itemId, ...body } = input;
|
|
@@ -291,7 +362,7 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
291
362
|
},
|
|
292
363
|
direct: (liveClient, input) => liveClient.checklists.items.toggle({ tripRef, ...input })
|
|
293
364
|
});
|
|
294
|
-
const pullTemplateMutation =
|
|
365
|
+
const pullTemplateMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
295
366
|
tripRef,
|
|
296
367
|
enqueue: (engine2, input) => engine2.enqueue({
|
|
297
368
|
tripRef,
|
|
@@ -376,7 +447,7 @@ var useChecklistsInternal = createDomainHook("checklists", (tripRef) => {
|
|
|
376
447
|
(input) => client$1.checklists.agencyTemplates.publish(input),
|
|
377
448
|
[client$1]
|
|
378
449
|
);
|
|
379
|
-
const items = syncedAt === void 0 ? aggregate.items : snapshotItems;
|
|
450
|
+
const items = syncedAt === void 0 ? appendPendingRows(aggregate.items, snapshotItems) : snapshotItems;
|
|
380
451
|
return {
|
|
381
452
|
items,
|
|
382
453
|
syncedAt,
|
|
@@ -398,7 +469,7 @@ function useChecklists(tripRef) {
|
|
|
398
469
|
return useChecklistsInternal(tripRef);
|
|
399
470
|
}
|
|
400
471
|
var useCloseoutInternal = createDomainHook("closing-day", (tripRef) => {
|
|
401
|
-
const client =
|
|
472
|
+
const client = chunkUALMCHNW_cjs.useKaafilClient();
|
|
402
473
|
const [aggregate, setAggregate] = react.useState(void 0);
|
|
403
474
|
const [loaded, setLoaded] = react.useState(false);
|
|
404
475
|
const [lastFetchFailed, setLastFetchFailed] = react.useState(false);
|
|
@@ -470,7 +541,7 @@ function useCloseout(tripRef) {
|
|
|
470
541
|
return useCloseoutInternal(tripRef);
|
|
471
542
|
}
|
|
472
543
|
var useCollectionsInternal = createDomainHook("collections", (tripRef) => {
|
|
473
|
-
const client$1 =
|
|
544
|
+
const client$1 = chunkUALMCHNW_cjs.useKaafilClient();
|
|
474
545
|
const {
|
|
475
546
|
rows: collections,
|
|
476
547
|
syncedAt,
|
|
@@ -507,7 +578,7 @@ var useCollectionsInternal = createDomainHook("collections", (tripRef) => {
|
|
|
507
578
|
react.useEffect(() => {
|
|
508
579
|
void refreshEligible(eligibleStatus);
|
|
509
580
|
}, [refreshEligible, eligibleStatus]);
|
|
510
|
-
const recordMutation =
|
|
581
|
+
const recordMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
511
582
|
tripRef,
|
|
512
583
|
enqueue: (engine, input) => engine.enqueue({
|
|
513
584
|
tripRef,
|
|
@@ -534,7 +605,7 @@ var useCollectionsInternal = createDomainHook("collections", (tripRef) => {
|
|
|
534
605
|
},
|
|
535
606
|
[recordMutate, refreshEligible]
|
|
536
607
|
);
|
|
537
|
-
const voidMutation =
|
|
608
|
+
const voidMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
538
609
|
tripRef,
|
|
539
610
|
enqueue: (engine, input) => {
|
|
540
611
|
const { collectionId, version, ...body } = input;
|
|
@@ -578,7 +649,7 @@ function useCollections(tripRef) {
|
|
|
578
649
|
return useCollectionsInternal(tripRef);
|
|
579
650
|
}
|
|
580
651
|
var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
581
|
-
const client$1 =
|
|
652
|
+
const client$1 = chunkUALMCHNW_cjs.useKaafilClient();
|
|
582
653
|
const {
|
|
583
654
|
rows: expenses,
|
|
584
655
|
syncedAt,
|
|
@@ -607,7 +678,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
607
678
|
react.useEffect(() => {
|
|
608
679
|
void refreshTotals();
|
|
609
680
|
}, [refreshTotals]);
|
|
610
|
-
const logMutation =
|
|
681
|
+
const logMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
611
682
|
tripRef,
|
|
612
683
|
enqueue: (engine, input) => engine.enqueue({
|
|
613
684
|
tripRef,
|
|
@@ -628,7 +699,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
628
699
|
// reimbursement, and an admin has no business standing in for them.
|
|
629
700
|
direct: (liveClient, input) => liveClient.expenses.log({ tripRef, ...input })
|
|
630
701
|
});
|
|
631
|
-
const linkReceiptMutation =
|
|
702
|
+
const linkReceiptMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
632
703
|
tripRef,
|
|
633
704
|
enqueue: (engine, input) => {
|
|
634
705
|
const { expenseId, ...body } = input;
|
|
@@ -651,7 +722,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
651
722
|
// Widening it would mean either breaking rule #4 or making the key
|
|
652
723
|
// optional on the wire, neither of which belongs in a UIKit pass.
|
|
653
724
|
});
|
|
654
|
-
const voidMutation =
|
|
725
|
+
const voidMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
655
726
|
tripRef,
|
|
656
727
|
enqueue: (engine, input) => {
|
|
657
728
|
const { expenseId, version, ...body } = input;
|
|
@@ -666,7 +737,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
666
737
|
},
|
|
667
738
|
direct: (liveClient, input) => liveClient.expenses.void({ tripRef, ...input })
|
|
668
739
|
});
|
|
669
|
-
const submitClaimMutation =
|
|
740
|
+
const submitClaimMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
670
741
|
tripRef,
|
|
671
742
|
enqueue: (engine, input) => {
|
|
672
743
|
const { expenseId } = input;
|
|
@@ -679,7 +750,7 @@ var useExpensesInternal = createDomainHook("expenses", (tripRef) => {
|
|
|
679
750
|
});
|
|
680
751
|
}
|
|
681
752
|
});
|
|
682
|
-
const withdrawClaimMutation =
|
|
753
|
+
const withdrawClaimMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
683
754
|
tripRef,
|
|
684
755
|
enqueue: (engine, input) => {
|
|
685
756
|
const { expenseId, version } = input;
|
|
@@ -721,7 +792,7 @@ function useExpenses(tripRef) {
|
|
|
721
792
|
}
|
|
722
793
|
var DEFAULT_MAX_ATTEMPTS = 3;
|
|
723
794
|
function useFiles(context) {
|
|
724
|
-
const client =
|
|
795
|
+
const client = chunkUALMCHNW_cjs.useKaafilClient();
|
|
725
796
|
const { tripRef } = context;
|
|
726
797
|
const request = react.useCallback(
|
|
727
798
|
(input) => client.files.request({ ...input, tripRef }),
|
|
@@ -793,7 +864,7 @@ function useFiles(context) {
|
|
|
793
864
|
return { request, confirm, meta, url, list, managerView, upload };
|
|
794
865
|
}
|
|
795
866
|
var useFloatInternal = createDomainHook("float", (tripRef) => {
|
|
796
|
-
const client$1 =
|
|
867
|
+
const client$1 = chunkUALMCHNW_cjs.useKaafilClient();
|
|
797
868
|
const { rows: movements, syncedAt } = useSnapshotList(tripRef, "float");
|
|
798
869
|
const [summaryRows, setSummaryRows] = react.useState([]);
|
|
799
870
|
const [summaryLoaded, setSummaryLoaded] = react.useState(false);
|
|
@@ -813,7 +884,7 @@ var useFloatInternal = createDomainHook("float", (tripRef) => {
|
|
|
813
884
|
react.useEffect(() => {
|
|
814
885
|
void refreshSummary();
|
|
815
886
|
}, [refreshSummary]);
|
|
816
|
-
const issueMutation =
|
|
887
|
+
const issueMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
817
888
|
tripRef,
|
|
818
889
|
enqueue: (engine, input) => engine.enqueue({
|
|
819
890
|
tripRef,
|
|
@@ -831,7 +902,7 @@ var useFloatInternal = createDomainHook("float", (tripRef) => {
|
|
|
831
902
|
// transport at all.
|
|
832
903
|
direct: (liveClient, input) => liveClient.float.issue({ tripRef, ...input })
|
|
833
904
|
});
|
|
834
|
-
const returnMutation =
|
|
905
|
+
const returnMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
835
906
|
tripRef,
|
|
836
907
|
enqueue: (engine, input) => engine.enqueue({
|
|
837
908
|
tripRef,
|
|
@@ -842,7 +913,7 @@ var useFloatInternal = createDomainHook("float", (tripRef) => {
|
|
|
842
913
|
}),
|
|
843
914
|
direct: (liveClient, input) => liveClient.float.return({ tripRef, ...input })
|
|
844
915
|
});
|
|
845
|
-
const adjustMutation =
|
|
916
|
+
const adjustMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
846
917
|
tripRef,
|
|
847
918
|
enqueue: (engine, input) => engine.enqueue({
|
|
848
919
|
tripRef,
|
|
@@ -905,8 +976,8 @@ function useFloat(tripRef) {
|
|
|
905
976
|
}
|
|
906
977
|
var FORM_FIELD_KIND_SINGLE_BOOLEAN = "CHECKBOX";
|
|
907
978
|
var useFormsInternal = createDomainHook("forms", (tripRef) => {
|
|
908
|
-
const client$1 =
|
|
909
|
-
const engine = react.useContext(
|
|
979
|
+
const client$1 = chunkUALMCHNW_cjs.useKaafilClient();
|
|
980
|
+
const engine = react.useContext(chunkUALMCHNW_cjs.OfflineEngineContext);
|
|
910
981
|
const [forms, setForms] = react.useState([]);
|
|
911
982
|
const [syncedAt, setSyncedAt] = react.useState(void 0);
|
|
912
983
|
const refreshForms = react.useCallback(async () => {
|
|
@@ -951,7 +1022,7 @@ var useFormsInternal = createDomainHook("forms", (tripRef) => {
|
|
|
951
1022
|
},
|
|
952
1023
|
[client$1, tripRef]
|
|
953
1024
|
);
|
|
954
|
-
const submitMutation =
|
|
1025
|
+
const submitMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
955
1026
|
tripRef,
|
|
956
1027
|
enqueue: (engine2, input) => {
|
|
957
1028
|
const { formId, ...body } = input;
|
|
@@ -1121,7 +1192,7 @@ function isLiveItineraryItem(row) {
|
|
|
1121
1192
|
return !("_tombstone" in row);
|
|
1122
1193
|
}
|
|
1123
1194
|
function useItinerary(tripRef) {
|
|
1124
|
-
const client$1 =
|
|
1195
|
+
const client$1 = chunkUALMCHNW_cjs.useKaafilClient();
|
|
1125
1196
|
const [trip, setTrip] = react.useState(void 0);
|
|
1126
1197
|
const [initialDayIso, setInitialDayIso] = react.useState(void 0);
|
|
1127
1198
|
const [canAddItems, setCanAddItems] = react.useState(false);
|
|
@@ -1166,7 +1237,7 @@ function useItinerary(tripRef) {
|
|
|
1166
1237
|
},
|
|
1167
1238
|
[client$1, tripRef]
|
|
1168
1239
|
);
|
|
1169
|
-
const patchDayMutation =
|
|
1240
|
+
const patchDayMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1170
1241
|
tripRef,
|
|
1171
1242
|
enqueue: (engine, input) => {
|
|
1172
1243
|
const { dayIndex, version, ...body } = input;
|
|
@@ -1190,7 +1261,7 @@ function useItinerary(tripRef) {
|
|
|
1190
1261
|
},
|
|
1191
1262
|
[patchDayMutate, refresh]
|
|
1192
1263
|
);
|
|
1193
|
-
const addItemMutation =
|
|
1264
|
+
const addItemMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1194
1265
|
tripRef,
|
|
1195
1266
|
enqueue: (engine, input) => engine.enqueue({
|
|
1196
1267
|
tripRef,
|
|
@@ -1210,7 +1281,7 @@ function useItinerary(tripRef) {
|
|
|
1210
1281
|
},
|
|
1211
1282
|
[addItemMutate, refresh]
|
|
1212
1283
|
);
|
|
1213
|
-
const patchItemMutation =
|
|
1284
|
+
const patchItemMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1214
1285
|
tripRef,
|
|
1215
1286
|
enqueue: (engine, input) => {
|
|
1216
1287
|
const { itemId, version, ...body } = input;
|
|
@@ -1234,7 +1305,7 @@ function useItinerary(tripRef) {
|
|
|
1234
1305
|
},
|
|
1235
1306
|
[patchItemMutate, refresh]
|
|
1236
1307
|
);
|
|
1237
|
-
const removeItemMutation =
|
|
1308
|
+
const removeItemMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1238
1309
|
tripRef,
|
|
1239
1310
|
enqueue: (engine, input) => {
|
|
1240
1311
|
const { itemId, version } = input;
|
|
@@ -1257,7 +1328,7 @@ function useItinerary(tripRef) {
|
|
|
1257
1328
|
},
|
|
1258
1329
|
[removeItemMutate, refresh]
|
|
1259
1330
|
);
|
|
1260
|
-
const reorderItemMutation =
|
|
1331
|
+
const reorderItemMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1261
1332
|
tripRef,
|
|
1262
1333
|
enqueue: (engine, input) => {
|
|
1263
1334
|
const { itemId, ...body } = input;
|
|
@@ -1310,12 +1381,12 @@ function useItinerary(tripRef) {
|
|
|
1310
1381
|
};
|
|
1311
1382
|
}
|
|
1312
1383
|
function useManagers(tripRef) {
|
|
1313
|
-
const client =
|
|
1314
|
-
const persona =
|
|
1384
|
+
const client = chunkUALMCHNW_cjs.useKaafilClient();
|
|
1385
|
+
const persona = chunkUALMCHNW_cjs.usePersona();
|
|
1315
1386
|
const [result, setResult] = react.useState({ status: "loading" });
|
|
1316
1387
|
react.useEffect(() => {
|
|
1317
1388
|
if (persona === "share") {
|
|
1318
|
-
if (
|
|
1389
|
+
if (chunkUALMCHNW_cjs.isDevelopment()) {
|
|
1319
1390
|
throw new Error(
|
|
1320
1391
|
"useManagers() was called from a share session \u2014 it is manager/agencyAdmin only."
|
|
1321
1392
|
);
|
|
@@ -1340,7 +1411,7 @@ function useManagers(tripRef) {
|
|
|
1340
1411
|
return result;
|
|
1341
1412
|
}
|
|
1342
1413
|
function useManagerToday(tripRef) {
|
|
1343
|
-
const client =
|
|
1414
|
+
const client = chunkUALMCHNW_cjs.useKaafilClient();
|
|
1344
1415
|
const [result, setResult] = react.useState({ status: "loading" });
|
|
1345
1416
|
react.useEffect(() => {
|
|
1346
1417
|
let cancelled = false;
|
|
@@ -1366,7 +1437,7 @@ function isLiveParty(row) {
|
|
|
1366
1437
|
return !("_tombstone" in row);
|
|
1367
1438
|
}
|
|
1368
1439
|
function useParties(tripRef) {
|
|
1369
|
-
const client$1 =
|
|
1440
|
+
const client$1 = chunkUALMCHNW_cjs.useKaafilClient();
|
|
1370
1441
|
const [rows, setRows] = react.useState([]);
|
|
1371
1442
|
const [listLoaded, setListLoaded] = react.useState(false);
|
|
1372
1443
|
const [listFetchFailed, setListFetchFailed] = react.useState(false);
|
|
@@ -1406,7 +1477,7 @@ function useParties(tripRef) {
|
|
|
1406
1477
|
react.useEffect(() => {
|
|
1407
1478
|
void refreshRoster();
|
|
1408
1479
|
}, [refreshRoster]);
|
|
1409
|
-
const addMutation =
|
|
1480
|
+
const addMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1410
1481
|
tripRef,
|
|
1411
1482
|
enqueue: (engine, input) => engine.enqueue({
|
|
1412
1483
|
tripRef,
|
|
@@ -1416,7 +1487,7 @@ function useParties(tripRef) {
|
|
|
1416
1487
|
body: input
|
|
1417
1488
|
})
|
|
1418
1489
|
});
|
|
1419
|
-
const patchMutation =
|
|
1490
|
+
const patchMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1420
1491
|
tripRef,
|
|
1421
1492
|
enqueue: (engine, input) => {
|
|
1422
1493
|
const { partyId, version, ...body } = input;
|
|
@@ -1430,7 +1501,7 @@ function useParties(tripRef) {
|
|
|
1430
1501
|
});
|
|
1431
1502
|
}
|
|
1432
1503
|
});
|
|
1433
|
-
const removeMutation =
|
|
1504
|
+
const removeMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1434
1505
|
tripRef,
|
|
1435
1506
|
enqueue: (engine, input) => {
|
|
1436
1507
|
const { partyId } = input;
|
|
@@ -1507,7 +1578,7 @@ function useParties(tripRef) {
|
|
|
1507
1578
|
};
|
|
1508
1579
|
}
|
|
1509
1580
|
var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
1510
|
-
const client$1 =
|
|
1581
|
+
const client$1 = chunkUALMCHNW_cjs.useKaafilClient();
|
|
1511
1582
|
const {
|
|
1512
1583
|
rows: stops,
|
|
1513
1584
|
syncedAt,
|
|
@@ -1518,7 +1589,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1518
1589
|
return { rows: response, syncedAt: response.meta.serverTime };
|
|
1519
1590
|
}
|
|
1520
1591
|
});
|
|
1521
|
-
const createMutation =
|
|
1592
|
+
const createMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1522
1593
|
tripRef,
|
|
1523
1594
|
enqueue: (engine, input) => engine.enqueue({
|
|
1524
1595
|
tripRef,
|
|
@@ -1537,7 +1608,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1537
1608
|
// before it left the process. See this file's own persona note.
|
|
1538
1609
|
direct: (liveClient, input) => liveClient.pickups.create({ tripRef, ...input })
|
|
1539
1610
|
});
|
|
1540
|
-
const patchMutation =
|
|
1611
|
+
const patchMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1541
1612
|
tripRef,
|
|
1542
1613
|
enqueue: (engine, input) => {
|
|
1543
1614
|
const { pointId, version, ...body } = input;
|
|
@@ -1552,7 +1623,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1552
1623
|
},
|
|
1553
1624
|
direct: (liveClient, input) => liveClient.pickups.patch({ tripRef, ...input })
|
|
1554
1625
|
});
|
|
1555
|
-
const removeMutation =
|
|
1626
|
+
const removeMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1556
1627
|
tripRef,
|
|
1557
1628
|
enqueue: (engine, input) => {
|
|
1558
1629
|
const { pointId, version, force } = input;
|
|
@@ -1567,7 +1638,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1567
1638
|
},
|
|
1568
1639
|
direct: (liveClient, input) => liveClient.pickups.remove({ tripRef, ...input })
|
|
1569
1640
|
});
|
|
1570
|
-
const reorderMutation =
|
|
1641
|
+
const reorderMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1571
1642
|
tripRef,
|
|
1572
1643
|
enqueue: (engine, input) => engine.enqueue({
|
|
1573
1644
|
tripRef,
|
|
@@ -1578,7 +1649,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1578
1649
|
}),
|
|
1579
1650
|
direct: (liveClient, input) => liveClient.pickups.reorder({ tripRef, ...input })
|
|
1580
1651
|
});
|
|
1581
|
-
const assignMutation =
|
|
1652
|
+
const assignMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1582
1653
|
tripRef,
|
|
1583
1654
|
enqueue: (engine, input) => {
|
|
1584
1655
|
const { pointId, ...body } = input;
|
|
@@ -1592,7 +1663,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1592
1663
|
},
|
|
1593
1664
|
direct: (liveClient, input) => liveClient.pickups.assign({ tripRef, ...input })
|
|
1594
1665
|
});
|
|
1595
|
-
const boardMutation =
|
|
1666
|
+
const boardMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1596
1667
|
tripRef,
|
|
1597
1668
|
enqueue: (engine, input) => {
|
|
1598
1669
|
const { pointId, ...body } = input;
|
|
@@ -1605,7 +1676,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1605
1676
|
});
|
|
1606
1677
|
}
|
|
1607
1678
|
});
|
|
1608
|
-
const correctBoardStatusMutation =
|
|
1679
|
+
const correctBoardStatusMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1609
1680
|
tripRef,
|
|
1610
1681
|
enqueue: (engine, input) => {
|
|
1611
1682
|
const { pointId, travellerId, ...body } = input;
|
|
@@ -1622,7 +1693,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1622
1693
|
// still get none, because they are `managerAuth`-only.
|
|
1623
1694
|
direct: (liveClient, input) => liveClient.pickups.correctBoardStatus({ tripRef, ...input })
|
|
1624
1695
|
});
|
|
1625
|
-
const closeMutation =
|
|
1696
|
+
const closeMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1626
1697
|
tripRef,
|
|
1627
1698
|
enqueue: (engine, input) => {
|
|
1628
1699
|
const { pointId, ...body } = input;
|
|
@@ -1635,7 +1706,7 @@ var usePickupsInternal = createDomainHook("pickup-points", (tripRef) => {
|
|
|
1635
1706
|
});
|
|
1636
1707
|
}
|
|
1637
1708
|
});
|
|
1638
|
-
const reopenMutation =
|
|
1709
|
+
const reopenMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1639
1710
|
tripRef,
|
|
1640
1711
|
enqueue: (engine, input) => {
|
|
1641
1712
|
const { pointId } = input;
|
|
@@ -1676,7 +1747,7 @@ function usePickups(tripRef) {
|
|
|
1676
1747
|
return usePickupsInternal(tripRef);
|
|
1677
1748
|
}
|
|
1678
1749
|
var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
1679
|
-
const client$1 =
|
|
1750
|
+
const client$1 = chunkUALMCHNW_cjs.useKaafilClient();
|
|
1680
1751
|
const {
|
|
1681
1752
|
rows: rooms,
|
|
1682
1753
|
syncedAt: roomsSyncedAt,
|
|
@@ -1700,7 +1771,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1700
1771
|
const refreshLive = react.useCallback(async () => {
|
|
1701
1772
|
await Promise.all([refreshRoomsLive(), refreshWindowsLive()]);
|
|
1702
1773
|
}, [refreshRoomsLive, refreshWindowsLive]);
|
|
1703
|
-
const assignMutation =
|
|
1774
|
+
const assignMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1704
1775
|
tripRef,
|
|
1705
1776
|
enqueue: (engine, input) => engine.enqueue({
|
|
1706
1777
|
tripRef,
|
|
@@ -1755,7 +1826,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1755
1826
|
},
|
|
1756
1827
|
[assignMutate, refreshUnassignedPool]
|
|
1757
1828
|
);
|
|
1758
|
-
const createWindowMutation =
|
|
1829
|
+
const createWindowMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1759
1830
|
tripRef,
|
|
1760
1831
|
enqueue: (engine, input) => engine.enqueue({
|
|
1761
1832
|
tripRef,
|
|
@@ -1766,7 +1837,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1766
1837
|
}),
|
|
1767
1838
|
direct: (liveClient, input) => liveClient.rooming.stayWindows.create({ tripRef, ...input })
|
|
1768
1839
|
});
|
|
1769
|
-
const patchWindowMutation =
|
|
1840
|
+
const patchWindowMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1770
1841
|
tripRef,
|
|
1771
1842
|
enqueue: (engine, input) => {
|
|
1772
1843
|
const { windowId, version, ...body } = input;
|
|
@@ -1781,7 +1852,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1781
1852
|
},
|
|
1782
1853
|
direct: (liveClient, input) => liveClient.rooming.stayWindows.patch({ tripRef, ...input })
|
|
1783
1854
|
});
|
|
1784
|
-
const removeWindowMutation =
|
|
1855
|
+
const removeWindowMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1785
1856
|
tripRef,
|
|
1786
1857
|
enqueue: (engine, input) => {
|
|
1787
1858
|
const { windowId, version, force } = input;
|
|
@@ -1796,7 +1867,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1796
1867
|
},
|
|
1797
1868
|
direct: (liveClient, input) => liveClient.rooming.stayWindows.remove({ tripRef, ...input })
|
|
1798
1869
|
});
|
|
1799
|
-
const createRoomMutation =
|
|
1870
|
+
const createRoomMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1800
1871
|
tripRef,
|
|
1801
1872
|
enqueue: (engine, input) => engine.enqueue({
|
|
1802
1873
|
tripRef,
|
|
@@ -1807,7 +1878,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1807
1878
|
}),
|
|
1808
1879
|
direct: (liveClient, input) => liveClient.rooming.rooms.create({ tripRef, ...input })
|
|
1809
1880
|
});
|
|
1810
|
-
const patchRoomMutation =
|
|
1881
|
+
const patchRoomMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1811
1882
|
tripRef,
|
|
1812
1883
|
enqueue: (engine, input) => {
|
|
1813
1884
|
const { roomId, version, ...body } = input;
|
|
@@ -1822,7 +1893,7 @@ var useRoomingInternal = createDomainHook("rooming", (tripRef) => {
|
|
|
1822
1893
|
},
|
|
1823
1894
|
direct: (liveClient, input) => liveClient.rooming.rooms.patch({ tripRef, ...input })
|
|
1824
1895
|
});
|
|
1825
|
-
const removeRoomMutation =
|
|
1896
|
+
const removeRoomMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1826
1897
|
tripRef,
|
|
1827
1898
|
enqueue: (engine, input) => {
|
|
1828
1899
|
const { roomId, version, force } = input;
|
|
@@ -1868,7 +1939,7 @@ function useRooming(tripRef) {
|
|
|
1868
1939
|
return useRoomingInternal(tripRef);
|
|
1869
1940
|
}
|
|
1870
1941
|
var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
1871
|
-
const client$1 =
|
|
1942
|
+
const client$1 = chunkUALMCHNW_cjs.useKaafilClient();
|
|
1872
1943
|
const {
|
|
1873
1944
|
rows: vehicles,
|
|
1874
1945
|
syncedAt,
|
|
@@ -1879,7 +1950,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
1879
1950
|
return { rows: response.vehicles, syncedAt: response.meta.serverTime };
|
|
1880
1951
|
}
|
|
1881
1952
|
});
|
|
1882
|
-
const assignMutation =
|
|
1953
|
+
const assignMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1883
1954
|
tripRef,
|
|
1884
1955
|
enqueue: (engine, input) => engine.enqueue({
|
|
1885
1956
|
tripRef,
|
|
@@ -1927,7 +1998,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
1927
1998
|
},
|
|
1928
1999
|
[assignMutate, refreshUnassignedPool]
|
|
1929
2000
|
);
|
|
1930
|
-
const createVehicleMutation =
|
|
2001
|
+
const createVehicleMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1931
2002
|
tripRef,
|
|
1932
2003
|
enqueue: (engine, input) => engine.enqueue({
|
|
1933
2004
|
tripRef,
|
|
@@ -1938,7 +2009,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
1938
2009
|
}),
|
|
1939
2010
|
direct: (liveClient, input) => liveClient.seating.vehicles.create({ tripRef, ...input })
|
|
1940
2011
|
});
|
|
1941
|
-
const patchVehicleMutation =
|
|
2012
|
+
const patchVehicleMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1942
2013
|
tripRef,
|
|
1943
2014
|
enqueue: (engine, input) => {
|
|
1944
2015
|
const { vehicleId, version, ...body } = input;
|
|
@@ -1953,7 +2024,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
1953
2024
|
},
|
|
1954
2025
|
direct: (liveClient, input) => liveClient.seating.vehicles.patch({ tripRef, ...input })
|
|
1955
2026
|
});
|
|
1956
|
-
const removeVehicleMutation =
|
|
2027
|
+
const removeVehicleMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1957
2028
|
tripRef,
|
|
1958
2029
|
enqueue: (engine, input) => {
|
|
1959
2030
|
const { vehicleId, version } = input;
|
|
@@ -1995,7 +2066,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
1995
2066
|
},
|
|
1996
2067
|
[patchVehicleMutate, vehicles]
|
|
1997
2068
|
);
|
|
1998
|
-
const linkManagerMutation =
|
|
2069
|
+
const linkManagerMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
1999
2070
|
tripRef,
|
|
2000
2071
|
enqueue: (engine, input) => {
|
|
2001
2072
|
const { vehicleId, ...body } = input;
|
|
@@ -2009,7 +2080,7 @@ var useSeatingInternal = createDomainHook("transport-seating", (tripRef) => {
|
|
|
2009
2080
|
},
|
|
2010
2081
|
direct: (liveClient, input) => liveClient.seating.vehicles.manager.link({ tripRef, ...input })
|
|
2011
2082
|
});
|
|
2012
|
-
const unlinkManagerMutation =
|
|
2083
|
+
const unlinkManagerMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
2013
2084
|
tripRef,
|
|
2014
2085
|
enqueue: (engine, input) => {
|
|
2015
2086
|
const { vehicleId, version } = input;
|
|
@@ -2052,7 +2123,7 @@ function useSeating(tripRef) {
|
|
|
2052
2123
|
return useSeatingInternal(tripRef);
|
|
2053
2124
|
}
|
|
2054
2125
|
function useTravellerProfile(tripRef, travellerRef) {
|
|
2055
|
-
const client$1 =
|
|
2126
|
+
const client$1 = chunkUALMCHNW_cjs.useKaafilClient();
|
|
2056
2127
|
const [read, setRead] = react.useState(void 0);
|
|
2057
2128
|
const [readFailed, setReadFailed] = react.useState(false);
|
|
2058
2129
|
const refresh = react.useCallback(async () => {
|
|
@@ -2067,8 +2138,8 @@ function useTravellerProfile(tripRef, travellerRef) {
|
|
|
2067
2138
|
react.useEffect(() => {
|
|
2068
2139
|
void refresh();
|
|
2069
2140
|
}, [refresh]);
|
|
2070
|
-
|
|
2071
|
-
const noteMutation =
|
|
2141
|
+
chunkUALMCHNW_cjs.useOfflineEvent("sync.drained", refresh);
|
|
2142
|
+
const noteMutation = chunkUALMCHNW_cjs.useOfflineMutation({
|
|
2072
2143
|
tripRef,
|
|
2073
2144
|
enqueue: (engine, input) => engine.enqueue({
|
|
2074
2145
|
tripRef,
|
|
@@ -2090,8 +2161,8 @@ function useTravellerProfile(tripRef, travellerRef) {
|
|
|
2090
2161
|
return { read, readFailed, refresh, addNote };
|
|
2091
2162
|
}
|
|
2092
2163
|
function useVendors(tripRef, agencyRef) {
|
|
2093
|
-
const client =
|
|
2094
|
-
const { rows, loaded: capabilitiesLoaded } =
|
|
2164
|
+
const client = chunkUALMCHNW_cjs.useKaafilClient();
|
|
2165
|
+
const { rows, loaded: capabilitiesLoaded } = chunkUALMCHNW_cjs.useCapabilityRows(tripRef);
|
|
2095
2166
|
const [vendors, setVendors] = react.useState([]);
|
|
2096
2167
|
const [listLoaded, setListLoaded] = react.useState(false);
|
|
2097
2168
|
const [lastFetchFailed, setLastFetchFailed] = react.useState(false);
|
|
@@ -2120,9 +2191,9 @@ function useVendors(tripRef, agencyRef) {
|
|
|
2120
2191
|
return { status: "loading" };
|
|
2121
2192
|
}
|
|
2122
2193
|
const row = rows.find((candidate) => candidate.capability === "vendors");
|
|
2123
|
-
const triple = row === void 0 ?
|
|
2194
|
+
const triple = row === void 0 ? chunkUALMCHNW_cjs.UNKNOWN_CAPABILITY_TRIPLE : chunkUALMCHNW_cjs.deriveCapabilityTriple(row);
|
|
2124
2195
|
if (triple.status !== "lit") {
|
|
2125
|
-
const reason =
|
|
2196
|
+
const reason = chunkUALMCHNW_cjs.darkReasonFor(triple);
|
|
2126
2197
|
return { status: "dark", reason };
|
|
2127
2198
|
}
|
|
2128
2199
|
if (!listLoaded && lastFetchFailed) {
|
|
@@ -2191,5 +2262,5 @@ exports.useSeating = useSeating;
|
|
|
2191
2262
|
exports.useSnapshotList = useSnapshotList;
|
|
2192
2263
|
exports.useTravellerProfile = useTravellerProfile;
|
|
2193
2264
|
exports.useVendors = useVendors;
|
|
2194
|
-
//# sourceMappingURL=chunk-
|
|
2195
|
-
//# sourceMappingURL=chunk-
|
|
2265
|
+
//# sourceMappingURL=chunk-MNUCVVIE.cjs.map
|
|
2266
|
+
//# sourceMappingURL=chunk-MNUCVVIE.cjs.map
|