kaafil-js 0.7.0 → 0.9.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.
@@ -287,6 +287,7 @@ var OPERATION_SECURITY = {
287
287
  exportCloseoutPack: ["managerAuth", "apiKeyAuth", "agencyAdminAuth"],
288
288
  exportFormResponses: ["apiKeyAuth", "managerAuth", "agencyAdminAuth"],
289
289
  exportTraveller: ["apiKeyAuth"],
290
+ generatePlatformPartnerBill: ["platformAdminAuth"],
290
291
  getAgencyAdminMe: ["agencyAdminAuth"],
291
292
  getAgencySettings: ["consoleAuth"],
292
293
  getAgencySettingsSelf: ["apiKeyAuth", "agencyAdminAuth"],
@@ -311,6 +312,7 @@ var OPERATION_SECURITY = {
311
312
  inspectConsoleInvite: [],
312
313
  inspectPlatformAdminInvite: [],
313
314
  issueFloat: ["managerAuth", "apiKeyAuth", "agencyAdminAuth"],
315
+ issuePlatformPartnerBill: ["platformAdminAuth"],
314
316
  linkExpenseReceipt: ["managerAuth", "apiKeyAuth", "agencyAdminAuth"],
315
317
  linkSeatingManager: ["managerAuth", "apiKeyAuth", "agencyAdminAuth"],
316
318
  listAgencies: ["consoleAuth"],
@@ -336,6 +338,7 @@ var OPERATION_SECURITY = {
336
338
  listMessagesConsole: ["consoleAuth"],
337
339
  listMessageTemplates: ["apiKeyAuth"],
338
340
  listMyConsoleSessions: ["consoleAuth"],
341
+ listOwnBills: ["consoleAuth"],
339
342
  listOwnManagerTrips: ["managerAuth"],
340
343
  listParties: ["managerAuth", "agencyAdminAuth", "apiKeyAuth"],
341
344
  listPickupStops: ["managerAuth", "agencyAdminAuth", "apiKeyAuth"],
@@ -343,6 +346,7 @@ var OPERATION_SECURITY = {
343
346
  listPlatformAudit: ["platformAdminAuth"],
344
347
  listPlatformIncidents: ["platformAdminAuth"],
345
348
  listPlatformPartnerApiKeys: ["platformAdminAuth"],
349
+ listPlatformPartnerBills: ["platformAdminAuth"],
346
350
  listPlatformPartnerConsoleUsers: ["platformAdminAuth"],
347
351
  listPlatformPartners: ["platformAdminAuth"],
348
352
  listPlatformPlanTiers: ["platformAdminAuth"],
@@ -406,6 +410,7 @@ var OPERATION_SECURITY = {
406
410
  pushTripBalances: ["managerAuth", "apiKeyAuth", "agencyAdminAuth"],
407
411
  putCommsConfig: ["apiKeyAuth"],
408
412
  putCommsConfigConsole: ["consoleAuth"],
413
+ putPlatformPartnerBillingConfig: ["platformAdminAuth"],
409
414
  putPlatformPartnerPlan: ["platformAdminAuth"],
410
415
  readAgencyEntitlement: ["consoleAuth"],
411
416
  readAgencyFeedbackSummary: ["agencyAdminAuth", "apiKeyAuth"],
@@ -438,8 +443,14 @@ var OPERATION_SECURITY = {
438
443
  readManagerFileView: ["managerAuth", "apiKeyAuth", "agencyAdminAuth"],
439
444
  readManagerToday: ["apiKeyAuth", "managerAuth", "agencyAdminAuth"],
440
445
  readManifestByPickup: ["managerAuth", "agencyAdminAuth", "apiKeyAuth"],
446
+ readOwnBill: ["consoleAuth"],
447
+ readOwnBillEstimate: ["consoleAuth"],
448
+ readOwnBillPdf: ["consoleAuth"],
441
449
  readPlan: ["consoleAuth"],
442
450
  readPlatformPartner: ["platformAdminAuth"],
451
+ readPlatformPartnerBill: ["platformAdminAuth"],
452
+ readPlatformPartnerBillingConfig: ["platformAdminAuth"],
453
+ readPlatformPartnerBillPdf: ["platformAdminAuth"],
443
454
  readRoomingBoard: ["managerAuth", "agencyAdminAuth", "apiKeyAuth"],
444
455
  readRoomingRoom: ["managerAuth", "agencyAdminAuth", "apiKeyAuth"],
445
456
  readSeatingBoard: ["managerAuth", "agencyAdminAuth", "apiKeyAuth"],
@@ -509,7 +520,9 @@ var OPERATION_SECURITY = {
509
520
  sendCommsTestMessage: ["apiKeyAuth"],
510
521
  sendCommsTestMessageConsole: ["consoleAuth"],
511
522
  sendMessage: ["apiKeyAuth"],
523
+ setPlatformPartnerBillDiscount: ["platformAdminAuth"],
512
524
  setPlatformPartnerStatus: ["platformAdminAuth"],
525
+ settlePlatformPartnerBill: ["platformAdminAuth"],
513
526
  shareListForms: ["shareAuth"],
514
527
  shareRenderForm: ["shareAuth"],
515
528
  shareSaveForm: ["shareAuth"],
@@ -536,6 +549,7 @@ var OPERATION_SECURITY = {
536
549
  upsertVendor: ["apiKeyAuth", "agencyAdminAuth"],
537
550
  voidCollection: ["managerAuth", "apiKeyAuth", "agencyAdminAuth"],
538
551
  voidExpense: ["managerAuth", "apiKeyAuth", "agencyAdminAuth"],
552
+ voidPlatformPartnerBill: ["platformAdminAuth"],
539
553
  withdrawExpenseClaim: ["managerAuth", "apiKeyAuth"]
540
554
  };
541
555
  var OPERATION_ACCEPTS_IDEMPOTENCY_KEY = {
@@ -616,6 +630,7 @@ var OPERATION_ACCEPTS_IDEMPOTENCY_KEY = {
616
630
  exportCloseoutPack: false,
617
631
  exportFormResponses: false,
618
632
  exportTraveller: false,
633
+ generatePlatformPartnerBill: true,
619
634
  getAgencyAdminMe: false,
620
635
  getAgencySettings: false,
621
636
  getAgencySettingsSelf: false,
@@ -640,6 +655,7 @@ var OPERATION_ACCEPTS_IDEMPOTENCY_KEY = {
640
655
  inspectConsoleInvite: false,
641
656
  inspectPlatformAdminInvite: false,
642
657
  issueFloat: true,
658
+ issuePlatformPartnerBill: true,
643
659
  linkExpenseReceipt: true,
644
660
  linkSeatingManager: true,
645
661
  listAgencies: false,
@@ -665,6 +681,7 @@ var OPERATION_ACCEPTS_IDEMPOTENCY_KEY = {
665
681
  listMessagesConsole: false,
666
682
  listMessageTemplates: false,
667
683
  listMyConsoleSessions: false,
684
+ listOwnBills: false,
668
685
  listOwnManagerTrips: false,
669
686
  listParties: false,
670
687
  listPickupStops: false,
@@ -672,6 +689,7 @@ var OPERATION_ACCEPTS_IDEMPOTENCY_KEY = {
672
689
  listPlatformAudit: false,
673
690
  listPlatformIncidents: false,
674
691
  listPlatformPartnerApiKeys: false,
692
+ listPlatformPartnerBills: false,
675
693
  listPlatformPartnerConsoleUsers: false,
676
694
  listPlatformPartners: false,
677
695
  listPlatformPlanTiers: false,
@@ -735,6 +753,7 @@ var OPERATION_ACCEPTS_IDEMPOTENCY_KEY = {
735
753
  pushTripBalances: true,
736
754
  putCommsConfig: false,
737
755
  putCommsConfigConsole: false,
756
+ putPlatformPartnerBillingConfig: true,
738
757
  putPlatformPartnerPlan: false,
739
758
  readAgencyEntitlement: false,
740
759
  readAgencyFeedbackSummary: false,
@@ -767,8 +786,14 @@ var OPERATION_ACCEPTS_IDEMPOTENCY_KEY = {
767
786
  readManagerFileView: false,
768
787
  readManagerToday: false,
769
788
  readManifestByPickup: false,
789
+ readOwnBill: false,
790
+ readOwnBillEstimate: false,
791
+ readOwnBillPdf: false,
770
792
  readPlan: false,
771
793
  readPlatformPartner: false,
794
+ readPlatformPartnerBill: false,
795
+ readPlatformPartnerBillingConfig: false,
796
+ readPlatformPartnerBillPdf: false,
772
797
  readRoomingBoard: false,
773
798
  readRoomingRoom: false,
774
799
  readSeatingBoard: false,
@@ -838,7 +863,9 @@ var OPERATION_ACCEPTS_IDEMPOTENCY_KEY = {
838
863
  sendCommsTestMessage: true,
839
864
  sendCommsTestMessageConsole: true,
840
865
  sendMessage: true,
866
+ setPlatformPartnerBillDiscount: true,
841
867
  setPlatformPartnerStatus: false,
868
+ settlePlatformPartnerBill: true,
842
869
  shareListForms: false,
843
870
  shareRenderForm: false,
844
871
  shareSaveForm: true,
@@ -865,6 +892,7 @@ var OPERATION_ACCEPTS_IDEMPOTENCY_KEY = {
865
892
  upsertVendor: true,
866
893
  voidCollection: false,
867
894
  voidExpense: false,
895
+ voidPlatformPartnerBill: true,
868
896
  withdrawExpenseClaim: false
869
897
  };
870
898
 
@@ -2877,6 +2905,9 @@ function createDrainer(options) {
2877
2905
  remaining: report.remaining,
2878
2906
  usedBatchTransport: report.usedBatchTransport
2879
2907
  });
2908
+ if (report.applied > 0) {
2909
+ options.onLanesApplied?.(report.lanes);
2910
+ }
2880
2911
  return report;
2881
2912
  }
2882
2913
  let kickTimer;
@@ -3600,22 +3631,45 @@ function createOfflineEngine(options) {
3600
3631
  ...options.share.monotonic !== void 0 ? { monotonic: options.share.monotonic } : {}
3601
3632
  });
3602
3633
  }
3634
+ const pull = createPullCoordinator({
3635
+ snapshot,
3636
+ transport: options.transport,
3637
+ events,
3638
+ onServerTime
3639
+ });
3603
3640
  const drainer = createDrainer({
3604
3641
  outbox,
3605
3642
  snapshot,
3606
3643
  transport: options.transport,
3607
3644
  events,
3608
3645
  onServerTime,
3646
+ /*
3647
+ * A DRAIN IS FOLLOWED BY A PULL, for the lanes it actually changed.
3648
+ *
3649
+ * Not every write rebases the snapshot: one enqueued without an
3650
+ * `entity`/`optimistic` pairing — deliberately, wherever the response
3651
+ * carries server-assigned fields a client cannot compute — reaches the
3652
+ * server and leaves the local snapshot untouched. Nothing used to close
3653
+ * that gap, so a host reading a snapshot-backed list saw its own
3654
+ * successful write missing from it until something reopened the screen.
3655
+ *
3656
+ * Failures are swallowed on purpose. This is a background reconcile behind
3657
+ * a write that has already succeeded; a pull that cannot reach the server
3658
+ * changes nothing the caller needs to hear about, and `pullTrip` has
3659
+ * already emitted whatever the host subscribes to. Rethrowing here would
3660
+ * surface a sync failure as if the WRITE had failed, which is the one
3661
+ * reading of it that is untrue.
3662
+ */
3663
+ onLanesApplied: (lanes) => {
3664
+ for (const tripRef of lanes) {
3665
+ void pull.pullTrip({ tripRef }).catch(() => {
3666
+ });
3667
+ }
3668
+ },
3609
3669
  ...options.conflictResolver !== void 0 ? { conflictResolver: options.conflictResolver } : {},
3610
3670
  ...options.now !== void 0 ? { now: options.now } : {},
3611
3671
  ...options.random !== void 0 ? { random: options.random } : {}
3612
3672
  });
3613
- const pull = createPullCoordinator({
3614
- snapshot,
3615
- transport: options.transport,
3616
- events,
3617
- onServerTime
3618
- });
3619
3673
  const blobs = options.blob === void 0 ? void 0 : createBlobLane({
3620
3674
  storage: options.storage,
3621
3675
  keyPrefix,
@@ -6766,7 +6820,6 @@ var RoomingHeuristicKey = {
6766
6820
  Couples: "couples",
6767
6821
  Parties: "parties",
6768
6822
  Gender: "gender",
6769
- Diet: "diet",
6770
6823
  SpreadSolos: "spreadSolos",
6771
6824
  PartyGenderPolicy: "partyGenderPolicy",
6772
6825
  SameBus: "sameBus"
@@ -6835,7 +6888,6 @@ var HEURISTIC_SEVERITY = Object.freeze({
6835
6888
  couples: "warn",
6836
6889
  parties: "split",
6837
6890
  gender: "never",
6838
- diet: "info",
6839
6891
  spreadSolos: "info",
6840
6892
  partyGenderPolicy: "info",
6841
6893
  sameBus: "info"