@bowlos/reservations 0.30.0 → 0.31.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
@@ -804,6 +804,32 @@ function listPublicMemberships(client, args) {
804
804
  function listGameCards(client, args) {
805
805
  return client.call("listPublicGameCards", args);
806
806
  }
807
+ function listRetailPricing(client, args) {
808
+ return client.call("listRetailPricing", args);
809
+ }
810
+
811
+ // src/packages.ts
812
+ function usesPerWeekdayStartTimes(pkg) {
813
+ return !!pkg.startTimesByWeekday && pkg.startTimesByWeekday.length > 0;
814
+ }
815
+ function weekdayForDateISO(dateISO) {
816
+ const [y, m, d] = dateISO.split("-").map(Number);
817
+ return new Date(Date.UTC(y, m - 1, d)).getUTCDay();
818
+ }
819
+ function resolvePackageStartTimesForWeekday(pkg, dayOfWeek) {
820
+ if (pkg.startTimesByWeekday && pkg.startTimesByWeekday.length > 0) {
821
+ const entry = pkg.startTimesByWeekday.find((e) => e.dayOfWeek === dayOfWeek);
822
+ if (!entry || entry.startTimes.length === 0) return [];
823
+ return [...entry.startTimes].sort((a, b) => a - b);
824
+ }
825
+ if (pkg.applicabilityDays && pkg.applicabilityDays.length > 0 && !pkg.applicabilityDays.includes(dayOfWeek)) {
826
+ return [];
827
+ }
828
+ if (pkg.allowedStartTimes && pkg.allowedStartTimes.length > 0) {
829
+ return [...pkg.allowedStartTimes].sort((a, b) => a - b);
830
+ }
831
+ return null;
832
+ }
807
833
 
808
834
  exports.BOWLOS_ERROR_CODES = BOWLOS_ERROR_CODES;
809
835
  exports.BowlosApiError = BowlosApiError;
@@ -857,6 +883,7 @@ exports.listGameCards = listGameCards;
857
883
  exports.listPackages = listPackages;
858
884
  exports.listProducts = listProducts;
859
885
  exports.listPublicMemberships = listPublicMemberships;
886
+ exports.listRetailPricing = listRetailPricing;
860
887
  exports.listStartTimes = listStartTimes;
861
888
  exports.localStorageTokenStore = localStorageTokenStore;
862
889
  exports.previewEventOrderCancellation = previewEventOrderCancellation;
@@ -868,6 +895,9 @@ exports.previewMembershipSubscription = previewMembershipSubscription;
868
895
  exports.previewPackage = previewPackage;
869
896
  exports.previewPackageOrderCancellation = previewPackageOrderCancellation;
870
897
  exports.previewReservationCancellation = previewReservationCancellation;
898
+ exports.resolvePackageStartTimesForWeekday = resolvePackageStartTimesForWeekday;
871
899
  exports.runDoctor = runDoctor;
900
+ exports.usesPerWeekdayStartTimes = usesPerWeekdayStartTimes;
901
+ exports.weekdayForDateISO = weekdayForDateISO;
872
902
  //# sourceMappingURL=index.cjs.map
873
903
  //# sourceMappingURL=index.cjs.map