@ancon/wildcat-utils 1.25.1 → 1.25.3
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/checkout/getCheckoutOrderStatusTexts.js +1 -1
- package/checkout/getCheckoutOrderStatusTexts.mjs +30 -31
- package/index.js +1 -1
- package/index.mjs +99 -97
- package/outlet/getOutletFormattedAddress.d.ts +1 -0
- package/outlet/getOutletFormattedAddress.js +1 -0
- package/outlet/getOutletFormattedAddress.mjs +7 -0
- package/outlet/index.d.ts +2 -1
- package/outlet/index.js +1 -1
- package/outlet/index.mjs +6 -4
- package/package.json +6 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@ancon/wildcat-types"),
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@ancon/wildcat-types"),m=require("./getCheckoutItemsMappedByTicketItemStatus.js");var O=(e=>(e.YourOrderIsBeingProcessed="yourOrderIsBeingProcessed",e.YourOrderWasCancelled="yourOrderWasCancelled",e.ProcessingPayment="processingPayment",e.YourOrderIsBeingPrepared="yourOrderIsBeingPrepared",e.YourOrderIsReadyToCollect="yourOrderIsReadyToCollect",e.YourOrderIsBeingDelivered="yourOrderIsBeingDelivered",e.YourOrderHasBeenCompleted="yourOrderHasBeenCompleted",e.YourOrderWillArriveAtYourTable="yourOrderWillArriveAtYourTable",e.ModifiedDeliveryStartTime="modifiedDeliveryStartTime",e.ModifiedPickUpTime="modifiedPickUpTime",e.YourOrderHasBeenAcceptedEstimatedDeliveryStartTime="yourOrderHasBeenAcceptedEstimatedDeliveryStartTime",e.YourOrderIsBeingPreparedEstimatedDeliveryStartTime="yourOrderIsBeingPreparedEstimatedDeliveryStartTime",e.YourOrderHasBeenAcceptedEstimatedTime="yourOrderHasBeenAcceptedEstimatedTime",e.YourOrderHasBeenAcceptedPickupTime="yourOrderHasBeenAcceptedPickupTime",e.DeliveryWasCompleted="deliveryWasCompleted",e.OneItemIsReadyToCollect="oneItemIsReadyToCollect",e.MultipleItemsAreReadyToCollect="multipleItemsAreReadyToCollect",e.EnjoyMealWhileOtherItemsBeingPrepared="enjoyMealWhileOtherItemsBeingPrepared",e))(O||{});function f(e,i){switch(e){case r.CheckoutStatus.Created:case r.CheckoutStatus.Ready:case r.CheckoutStatus.Processing:case r.CheckoutStatus.Authorized:return"yourOrderIsBeingProcessed";case r.CheckoutStatus.Canceled:return"yourOrderWasCancelled";case r.CheckoutStatus.Received:return"processingPayment";case r.CheckoutStatus.ReadyToCollect:return i?"yourOrderIsBeingDelivered":"yourOrderIsReadyToCollect";default:return null}}function C(e){switch(e){case r.TicketStatus.Pending:case r.TicketStatus.PendingAccept:return"yourOrderIsBeingProcessed";case r.TicketStatus.Preparing:return"yourOrderIsBeingPrepared";case r.TicketStatus.Ready:return"yourOrderIsReadyToCollect";case r.TicketStatus.Closed:return"yourOrderHasBeenCompleted";case r.TicketStatus.Canceled:return"yourOrderWasCancelled";default:throw new Error(`Unhandled ticket status "${e}" in getTranslationKeyByTicketStatus()`)}}function T(e,{checkoutStatus:i,ticketStatus:o,customersFetchTableOrders:d}){const a=(e==null?void 0:e.orderFormat)===r.OrderFormat.Delivery,t=(e==null?void 0:e.orderFormat)===r.OrderFormat.TakeAway,l=(e==null?void 0:e.orderFormat)===r.OrderFormat.TableOrder;if(a||t||l&&!d)return!1;const s=i!=null,c=o!=null;if(s){const n=i===r.CheckoutStatus.Captured,u=i===r.CheckoutStatus.InProgress;return n||u}if(c){const n=o===r.TicketStatus.Preparing,u=o===r.TicketStatus.Ready;return n||u}return!1}function I(e,{checkoutStatus:i,ticketStatus:o,customersFetchTableOrders:d,pickupTimeUpdated:a},t){if(t&&T(e,{checkoutStatus:i,ticketStatus:o,customersFetchTableOrders:d})){if(t.ready>0)return t.ready<2?["oneItemIsReadyToCollect"]:["multipleItemsAreReadyToCollect",{count:t.ready}];if(t.done>0&&t.done<t.all)return["enjoyMealWhileOtherItemsBeingPrepared",{count:Math.max(0,t.all-t.done-t.ready)}]}if(o!=null)return[C(o)];const l=(e==null?void 0:e.orderFormat)===r.OrderFormat.Delivery,s=f(i,l);if(s)return[s];const c=i===r.CheckoutStatus.Captured,n=i===r.CheckoutStatus.InProgress,u=i===r.CheckoutStatus.Done,y=(e==null?void 0:e.orderFormat)===r.OrderFormat.EatIn,p=(e==null?void 0:e.orderFormat)===r.OrderFormat.TakeAway,g=(e==null?void 0:e.orderFormat)===r.OrderFormat.TableOrder;if(c)return g&&!d?["yourOrderWillArriveAtYourTable"]:l?a?["modifiedDeliveryStartTime"]:["yourOrderHasBeenAcceptedEstimatedDeliveryStartTime"]:a?["modifiedPickUpTime"]:["yourOrderHasBeenAcceptedPickupTime"];if(n){if(l)return a?["modifiedDeliveryStartTime"]:["yourOrderIsBeingPreparedEstimatedDeliveryStartTime"];if(t&&(y||p)){if(t.ready===t.all)return["yourOrderIsReadyToCollect"];if(t.done===t.all)return["yourOrderHasBeenCompleted"]}if(g){if(t){if(t.ready===t.all)return d?["yourOrderIsReadyToCollect"]:["yourOrderWillArriveAtYourTable"];if(t.done===t.all)return d?["yourOrderHasBeenCompleted"]:["yourOrderWillArriveAtYourTable"]}return a?["modifiedPickUpTime"]:d?["yourOrderIsBeingPrepared"]:["yourOrderWillArriveAtYourTable"]}return a?["modifiedPickUpTime"]:["yourOrderIsBeingPrepared"]}if(u)return y||p?["yourOrderHasBeenCompleted"]:l?["deliveryWasCompleted"]:["yourOrderHasBeenCompleted"];throw new Error("Could not resolve translation key in getTranslationKey()")}const P={yourOrderIsBeingProcessed:()=>({title:"Your order is being processed"}),yourOrderWasCancelled:()=>({title:"Your order was canceled",message:"Sorry. Your order could not go through."}),processingPayment:()=>({title:"Processing payment",message:"Please wait while your payment is being processed"}),yourOrderIsBeingPrepared:()=>({title:"Your order is now being prepared!",message:"We will let you know when it is ready for pickup."}),yourOrderIsReadyToCollect:()=>({title:"Your order is ready to be collected!",message:"Please go ahead and show this screen at the collection point"}),yourOrderIsBeingDelivered:()=>({title:"Your order is being delivered",message:"It will arrive at your door shortly. Enjoy your meal!"}),yourOrderHasBeenCompleted:()=>({title:"Enjoy your meal!",message:"Your order has been completed!"}),yourOrderWillArriveAtYourTable:()=>({title:"Your order has been accepted!",message:"It will arrive at your table shortly"}),modifiedDeliveryStartTime:()=>({title:"Your delivery time was modified",message:"Delivery will start at approximately 00:00."}),modifiedPickUpTime:()=>({title:"Your pickup time was modified",message:"Pickup time: 00:00"}),yourOrderHasBeenAcceptedEstimatedDeliveryStartTime:()=>({title:"Your order has been accepted",message:"Estimated delivery start time: 00:00"}),yourOrderIsBeingPreparedEstimatedDeliveryStartTime:()=>({title:"Your order is now being prepared!",message:"Estimated delivery start time: 00:00"}),yourOrderHasBeenAcceptedEstimatedTime:()=>({title:"Your order has been accepted",message:"Estimated time: 00:00"}),yourOrderHasBeenAcceptedPickupTime:()=>({title:"Your order has been accepted",message:"Pickup time: 00:00"}),deliveryWasCompleted:()=>({title:"Your order was completed",message:"Enjoy your meal!"}),oneItemIsReadyToCollect:()=>({title:"One item is ready to pick up!",message:"Please allow cashier or waiter to confirm that the prepared item has been successfully issued."}),multipleItemsAreReadyToCollect:()=>({title:"Multiple items are ready to pick up!",message:"Please allow cashier or waiter to confirm that the prepared items have been successfully issued."}),enjoyMealWhileOtherItemsBeingPrepared:({meta:e})=>({title:"Enjoy your meal while the rest of the items are being prepared!",message:`${e.count} more items are being prepared`})};function B(e,i){if(i)return;const o=m(e);return{all:o.all.length,ready:o.ready.length,done:o.done.length}}function h(e,i,o=P){const{isSkipTicketStatus:d}=i,a=B((e==null?void 0:e.items)??[],d),[t,l]=I(e,i,a),s=o[t]({key:t,meta:l});if(!s)throw new Error("Could not resolve translation in getOrderStatusTexts()");return[s,t]}exports.TranslationKey=O;exports.default=h;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { OrderFormat as u, CheckoutStatus as o, TicketStatus as s } from "@ancon/wildcat-types";
|
|
2
|
-
import
|
|
3
|
-
var
|
|
4
|
-
function
|
|
2
|
+
import O from "./getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
3
|
+
var I = /* @__PURE__ */ ((e) => (e.YourOrderIsBeingProcessed = "yourOrderIsBeingProcessed", e.YourOrderWasCancelled = "yourOrderWasCancelled", e.ProcessingPayment = "processingPayment", e.YourOrderIsBeingPrepared = "yourOrderIsBeingPrepared", e.YourOrderIsReadyToCollect = "yourOrderIsReadyToCollect", e.YourOrderIsBeingDelivered = "yourOrderIsBeingDelivered", e.YourOrderHasBeenCompleted = "yourOrderHasBeenCompleted", e.YourOrderWillArriveAtYourTable = "yourOrderWillArriveAtYourTable", e.ModifiedDeliveryStartTime = "modifiedDeliveryStartTime", e.ModifiedPickUpTime = "modifiedPickUpTime", e.YourOrderHasBeenAcceptedEstimatedDeliveryStartTime = "yourOrderHasBeenAcceptedEstimatedDeliveryStartTime", e.YourOrderIsBeingPreparedEstimatedDeliveryStartTime = "yourOrderIsBeingPreparedEstimatedDeliveryStartTime", e.YourOrderHasBeenAcceptedEstimatedTime = "yourOrderHasBeenAcceptedEstimatedTime", e.YourOrderHasBeenAcceptedPickupTime = "yourOrderHasBeenAcceptedPickupTime", e.DeliveryWasCompleted = "deliveryWasCompleted", e.OneItemIsReadyToCollect = "oneItemIsReadyToCollect", e.MultipleItemsAreReadyToCollect = "multipleItemsAreReadyToCollect", e.EnjoyMealWhileOtherItemsBeingPrepared = "enjoyMealWhileOtherItemsBeingPrepared", e))(I || {});
|
|
4
|
+
function P(e, t) {
|
|
5
5
|
switch (e) {
|
|
6
6
|
case o.Created:
|
|
7
7
|
case o.Ready:
|
|
@@ -18,7 +18,7 @@ function C(e, t) {
|
|
|
18
18
|
return null;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function C(e) {
|
|
22
22
|
switch (e) {
|
|
23
23
|
case s.Pending:
|
|
24
24
|
case s.PendingAccept:
|
|
@@ -37,16 +37,16 @@ function B(e) {
|
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function B(e, {
|
|
41
41
|
checkoutStatus: t,
|
|
42
42
|
ticketStatus: i,
|
|
43
43
|
customersFetchTableOrders: d
|
|
44
44
|
}) {
|
|
45
|
-
const a = (e == null ? void 0 : e.orderFormat) === u.Delivery,
|
|
46
|
-
if (a ||
|
|
45
|
+
const a = (e == null ? void 0 : e.orderFormat) === u.Delivery, r = (e == null ? void 0 : e.orderFormat) === u.TakeAway, l = (e == null ? void 0 : e.orderFormat) === u.TableOrder;
|
|
46
|
+
if (a || r || l && !d)
|
|
47
47
|
return !1;
|
|
48
|
-
const
|
|
49
|
-
if (
|
|
48
|
+
const n = t != null, p = i != null;
|
|
49
|
+
if (n) {
|
|
50
50
|
const c = t === o.Captured, y = t === o.InProgress;
|
|
51
51
|
return c || y;
|
|
52
52
|
}
|
|
@@ -56,14 +56,13 @@ function T(e, {
|
|
|
56
56
|
}
|
|
57
57
|
return !1;
|
|
58
58
|
}
|
|
59
|
-
function
|
|
59
|
+
function T(e, {
|
|
60
60
|
checkoutStatus: t,
|
|
61
61
|
ticketStatus: i,
|
|
62
62
|
customersFetchTableOrders: d,
|
|
63
|
-
pickupTimeUpdated: a
|
|
64
|
-
isSkipTicketStatus: n
|
|
63
|
+
pickupTimeUpdated: a
|
|
65
64
|
}, r) {
|
|
66
|
-
if (r &&
|
|
65
|
+
if (r && B(e, {
|
|
67
66
|
checkoutStatus: t,
|
|
68
67
|
ticketStatus: i,
|
|
69
68
|
customersFetchTableOrders: d
|
|
@@ -79,18 +78,18 @@ function v(e, {
|
|
|
79
78
|
{ count: Math.max(0, r.all - r.done - r.ready) }
|
|
80
79
|
];
|
|
81
80
|
}
|
|
82
|
-
if (i != null
|
|
83
|
-
return [
|
|
84
|
-
const l = (e == null ? void 0 : e.orderFormat) === u.Delivery,
|
|
81
|
+
if (i != null)
|
|
82
|
+
return [C(i)];
|
|
83
|
+
const l = (e == null ? void 0 : e.orderFormat) === u.Delivery, n = P(
|
|
85
84
|
t,
|
|
86
85
|
l
|
|
87
86
|
);
|
|
87
|
+
if (n)
|
|
88
|
+
return [n];
|
|
89
|
+
const p = t === o.Captured, c = t === o.InProgress, y = t === o.Done, g = (e == null ? void 0 : e.orderFormat) === u.EatIn, f = (e == null ? void 0 : e.orderFormat) === u.TakeAway, m = (e == null ? void 0 : e.orderFormat) === u.TableOrder;
|
|
88
90
|
if (p)
|
|
89
|
-
return [p];
|
|
90
|
-
const c = t === o.Captured, y = t === o.InProgress, O = t === o.Done, g = (e == null ? void 0 : e.orderFormat) === u.EatIn, f = (e == null ? void 0 : e.orderFormat) === u.TakeAway, m = (e == null ? void 0 : e.orderFormat) === u.TableOrder;
|
|
91
|
-
if (c)
|
|
92
91
|
return m && !d ? ["yourOrderWillArriveAtYourTable"] : l ? a ? ["modifiedDeliveryStartTime"] : ["yourOrderHasBeenAcceptedEstimatedDeliveryStartTime"] : a ? ["modifiedPickUpTime"] : ["yourOrderHasBeenAcceptedPickupTime"];
|
|
93
|
-
if (
|
|
92
|
+
if (c) {
|
|
94
93
|
if (l)
|
|
95
94
|
return a ? ["modifiedDeliveryStartTime"] : ["yourOrderIsBeingPreparedEstimatedDeliveryStartTime"];
|
|
96
95
|
if (r && (g || f)) {
|
|
@@ -110,11 +109,11 @@ function v(e, {
|
|
|
110
109
|
}
|
|
111
110
|
return a ? ["modifiedPickUpTime"] : ["yourOrderIsBeingPrepared"];
|
|
112
111
|
}
|
|
113
|
-
if (
|
|
112
|
+
if (y)
|
|
114
113
|
return g || f ? ["yourOrderHasBeenCompleted"] : l ? ["deliveryWasCompleted"] : ["yourOrderHasBeenCompleted"];
|
|
115
114
|
throw new Error("Could not resolve translation key in getTranslationKey()");
|
|
116
115
|
}
|
|
117
|
-
const
|
|
116
|
+
const v = {
|
|
118
117
|
yourOrderIsBeingProcessed: () => ({
|
|
119
118
|
title: "Your order is being processed"
|
|
120
119
|
}),
|
|
@@ -187,26 +186,26 @@ const h = {
|
|
|
187
186
|
message: `${e.count} more items are being prepared`
|
|
188
187
|
})
|
|
189
188
|
};
|
|
190
|
-
function
|
|
189
|
+
function h(e, t) {
|
|
191
190
|
if (t)
|
|
192
191
|
return;
|
|
193
|
-
const i =
|
|
192
|
+
const i = O(e);
|
|
194
193
|
return {
|
|
195
194
|
all: i.all.length,
|
|
196
195
|
ready: i.ready.length,
|
|
197
196
|
done: i.done.length
|
|
198
197
|
};
|
|
199
198
|
}
|
|
200
|
-
function
|
|
201
|
-
const { isSkipTicketStatus: d } = t, a =
|
|
199
|
+
function w(e, t, i = v) {
|
|
200
|
+
const { isSkipTicketStatus: d } = t, a = h(
|
|
202
201
|
(e == null ? void 0 : e.items) ?? [],
|
|
203
202
|
d
|
|
204
|
-
), [
|
|
205
|
-
if (!
|
|
203
|
+
), [r, l] = T(e, t, a), n = i[r]({ key: r, meta: l });
|
|
204
|
+
if (!n)
|
|
206
205
|
throw new Error("Could not resolve translation in getOrderStatusTexts()");
|
|
207
|
-
return [
|
|
206
|
+
return [n, r];
|
|
208
207
|
}
|
|
209
208
|
export {
|
|
210
|
-
|
|
211
|
-
|
|
209
|
+
I as TranslationKey,
|
|
210
|
+
w as default
|
|
212
211
|
};
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/enums.js"),t=require("./shared/isWithinFlag.js"),i=require("./shared/generateId.js"),o=require("./shared/wait.js"),n=require("./outlet/getListOutletOpeningHoursTable.js"),u=require("./outlet/getOutletTagInformation.js"),s=require("./outlet/getOutletAvailabilityInfo.js"),a=require("./outlet/getOutletOfflineOrderFormats.js"),c=require("./outlet/getOutletAvailableOrderFormats.js"),l=require("./outlet/getOutletFormattedDistance.js"),g=require("./outlet/isOutletAcceptingPreOrders.js"),d=require("./outlet/getOutletDeliveryFee.js"),q=require("./outlet/getOutletTodayOpeningTimes.js"),O=require("./outlet/getOutletOrderFormats.js"),_=require("./outlet/serviceDateTimesFromOpeningHours.js"),k=require("./outlet/getPickerIntervalsForDay.js"),m=require("./outlet/getServiceIntervalRange.js"),S=require("./outlet/getServiceIntervalsForOrderFormat.js"),p=require("./versioning/isVersionALessThanB.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/enums.js"),t=require("./shared/isWithinFlag.js"),i=require("./shared/generateId.js"),o=require("./shared/wait.js"),n=require("./outlet/getListOutletOpeningHoursTable.js"),u=require("./outlet/getOutletTagInformation.js"),s=require("./outlet/getOutletAvailabilityInfo.js"),a=require("./outlet/getOutletOfflineOrderFormats.js"),c=require("./outlet/getOutletAvailableOrderFormats.js"),l=require("./outlet/getOutletFormattedDistance.js"),g=require("./outlet/isOutletAcceptingPreOrders.js"),d=require("./outlet/getOutletDeliveryFee.js"),q=require("./outlet/getOutletTodayOpeningTimes.js"),O=require("./outlet/getOutletOrderFormats.js"),_=require("./outlet/serviceDateTimesFromOpeningHours.js"),k=require("./outlet/getPickerIntervalsForDay.js"),m=require("./outlet/getServiceIntervalRange.js"),S=require("./outlet/getServiceIntervalsForOrderFormat.js"),p=require("./outlet/getOutletFormattedAddress.js"),f=require("./versioning/isVersionALessThanB.js"),P=require("./versioning/cleanVersionString.js"),y=require("./api/getUrlAndParams.js"),v=require("./api/getEndpointWithVersion.js"),h=require("./api/generateBackoffWithEqualJitter.js"),F=require("./api/isAcceptedResponse.js"),T=require("./api/isNoContentResponse.js"),I=require("./string/slugify.js"),D=require("./string/truncate.js"),C=require("./color/lighten.js"),A=require("./color/brighten.js"),b=require("./color/darken.js"),R=require("./color/isDarkBackground.js"),V=require("./user/getFullName.js"),E=require("./user/getFullAddressString.js"),H=require("./logger/Logger.js"),L=require("./logger/types.js"),M=require("./logger/sanitizeAsStringDict.js"),N=require("./printing/getPrinterType.js"),B=require("./printing/isValidPrinter.js"),U=require("./printing/isValidNetworkPrinter.js"),W=require("./printing/isValidStarCloudPrinter.js"),w=require("./printing/isTerminalPrinter.js"),x=require("./printing/isCloudPrintModeEnabled.js"),z=require("./number/randomIntFromInterval.js"),J=require("./tables/decodeTableQRPayload.js"),K=require("./checkout/getCheckoutItemModifications.js"),Q=require("./checkout/getCheckoutProductName.js"),r=require("./checkout/getCheckoutOrderStatusTexts.js"),j=require("./checkout/getCheckoutItemsMappedByTicketItemStatus.js"),G=require("./checkout/isCheckoutOrderSummary.js"),X=require("./currency/getFormattedCurrency.js"),Y=require("./inventory/isDetailedProductOutOfStock.js"),Z=require("./inventory/isDetailedProductVariantOutOfStocks.js"),$=require("./inventory/isMenuTreeProductOutOfStock.js"),ee=require("./inventory/isDetailedProductUpSellsOutOfStock.js"),re=require("./inventory/isUpSellProductOutStock.js"),te=require("./inventory/isDetailedProductOutletStockOutOfStock.js"),ie=require("./inventory/getDetailedProductVariantStock.js"),oe=require("./signalr/createUseSignalRHook.js"),ne=require("./signalr/SignalR.js"),ue=require("./error/createCodedError.js"),se=require("./error/isCodedError.js"),ae=require("./error/isNetworkError.js"),ce=require("./error/isLockedError.js"),le=require("./hangfire/isHangfireResponse.js"),ge=require("./hangfire/createHangfirePoller.js"),de=require("./hangfire/createMakeHangfireRequest.js");require("moment");require("@ancon/wildcat-types");require("./outlet/types.js");require("./outlet/constants.js");require("./outlet/getOutletCurrentActiveOperatingHour.js");require("./outlet/getMomentFromDateAndTimeString.js");require("./outlet/searchNextOpeningMoment.js");require("lodash");require("./shared/constants.js");require("./time/toMinutes.js");require("./time/getNextTenthMinute.js");require("compare-versions");require("tinycolor2");require("@ancon/wildcat-printing");require("./currency/getFormattedCurrencyPostfix.js");require("react");require("react-redux");require("@microsoft/signalr");require("./index-4a932b99.js");require("./axios-5f25f7ff.js");exports.DayOfWeek=e.DayOfWeek;exports.IntervalState=e.IntervalState;exports.IntervalType=e.IntervalType;exports.OrderFormat=e.OrderFormat;exports.isWithinFlag=t;exports.generateId=i;exports.wait=o;exports.getListOutletOpeningHoursTable=n;exports.getOutletTagInformation=u.default;exports.getOutletAvailabilityInfo=s.default;exports.getOutletOfflineOrderFormats=a;exports.getOutletAvailableOrderFormats=c;exports.getOutletFormattedDistance=l;exports.isOutletAcceptingPreOrders=g;exports.getOutletDeliveryFee=d;exports.getOutletTodayOpeningTimes=q;exports.getOutletOrderFormats=O;exports.serviceDateTimesFromOpeningHours=_;exports.getPickerIntervalsForDay=k;exports.getServiceIntervalRange=m;exports.getServiceIntervalsForOrderFormat=S;exports.getOutletFormattedAddress=p;exports.isVersionALessThanB=f;exports.cleanVersionString=P;exports.getUrlAndParams=y;exports.getEndpointWithVersion=v;exports.generateBackoffWithEqualJitter=h;exports.isAcceptedResponse=F;exports.isNoContentResponse=T;exports.slugify=I;exports.truncate=D;exports.lighten=C;exports.brighten=A;exports.darken=b;exports.isDarkBackground=R;exports.getFullName=V;exports.getFullAddressString=E;exports.Logger=H;exports.LogLevel=L.LogLevel;exports.sanitizeAsStringDict=M;exports.getPrinterType=N;exports.isValidPrinter=B;exports.isValidNetworkPrinter=U;exports.isValidStarCloudPrinter=W;exports.isTerminalPrinter=w;exports.isCloudPrintModeEnabled=x;exports.randomIntFromInterval=z;exports.decodeTableQRPayload=J;exports.getCheckoutGroupedModifications=K;exports.getCheckoutProductName=Q;exports.TranslationKey=r.TranslationKey;exports.getCheckoutOrderStatusTexts=r.default;exports.getCheckoutItemsMappedByTicketItemStatus=j;exports.isCheckoutOrderSummary=G;exports.getFormattedCurrency=X;exports.isDetailedProductOutOfStock=Y;exports.isDetailedProductVariantOutOfStocks=Z;exports.isMenuTreeProductOutOfStock=$;exports.isDetailedProductUpSellsOutOfStock=ee;exports.isUpSellProductOutOfStock=re;exports.isDetailedProductOutletStockOutOfStock=te;exports.getDetailedProductVariantStock=ie;exports.createUseSignalRHook=oe;exports.SignalR=ne;exports.createCodedError=ue;exports.isCodedError=se;exports.isNetworkError=ae;exports.isLockedError=ce;exports.isHangfireResponse=le;exports.createHangfirePoller=ge.default;exports.createMakeHangfireRequest=de;
|
package/index.mjs
CHANGED
|
@@ -16,54 +16,55 @@ import { default as $ } from "./outlet/serviceDateTimesFromOpeningHours.mjs";
|
|
|
16
16
|
import { default as te } from "./outlet/getPickerIntervalsForDay.mjs";
|
|
17
17
|
import { default as oe } from "./outlet/getServiceIntervalRange.mjs";
|
|
18
18
|
import { default as fe } from "./outlet/getServiceIntervalsForOrderFormat.mjs";
|
|
19
|
-
import { default as le } from "./
|
|
20
|
-
import { default as ue } from "./versioning/
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as xe } from "./api/
|
|
23
|
-
import { default as ge } from "./api/
|
|
24
|
-
import { default as Oe } from "./api/
|
|
25
|
-
import { default as Se } from "./api/
|
|
26
|
-
import { default as Fe } from "./
|
|
27
|
-
import { default as ve } from "./string/
|
|
28
|
-
import { default as De } from "./
|
|
29
|
-
import { default as he } from "./color/
|
|
30
|
-
import { default as Ae } from "./color/
|
|
31
|
-
import { default as Ve } from "./color/
|
|
32
|
-
import { default as be } from "./
|
|
33
|
-
import { default as Le } from "./user/
|
|
34
|
-
import { default as Ne } from "./
|
|
35
|
-
import {
|
|
36
|
-
import {
|
|
37
|
-
import { default as ze } from "./
|
|
38
|
-
import { default as Je } from "./printing/
|
|
39
|
-
import { default as Qe } from "./printing/
|
|
40
|
-
import { default as Xe } from "./printing/
|
|
41
|
-
import { default as Ze } from "./printing/
|
|
42
|
-
import { default as $e } from "./printing/
|
|
43
|
-
import { default as tt } from "./
|
|
44
|
-
import { default as ot } from "./
|
|
45
|
-
import { default as ft } from "./
|
|
46
|
-
import { default as lt } from "./checkout/
|
|
47
|
-
import {
|
|
48
|
-
import { default as pt } from "./checkout/
|
|
49
|
-
import { default as nt } from "./checkout/
|
|
50
|
-
import { default as ct } from "./
|
|
51
|
-
import { default as kt } from "./
|
|
52
|
-
import { default as Pt } from "./inventory/
|
|
53
|
-
import { default as Tt } from "./inventory/
|
|
54
|
-
import { default as yt } from "./inventory/
|
|
55
|
-
import { default as It } from "./inventory/
|
|
56
|
-
import { default as Ct } from "./inventory/
|
|
57
|
-
import { default as Rt } from "./inventory/
|
|
58
|
-
import { default as Et } from "./
|
|
59
|
-
import { default as Ht } from "./signalr/
|
|
60
|
-
import { default as Mt } from "./
|
|
61
|
-
import { default as Bt } from "./error/
|
|
62
|
-
import { default as Wt } from "./error/
|
|
63
|
-
import { default as qt } from "./error/
|
|
64
|
-
import { default as Gt } from "./
|
|
65
|
-
import { default as Kt } from "./hangfire/
|
|
66
|
-
import { default as jt } from "./hangfire/
|
|
19
|
+
import { default as le } from "./outlet/getOutletFormattedAddress.mjs";
|
|
20
|
+
import { default as ue } from "./versioning/isVersionALessThanB.mjs";
|
|
21
|
+
import { default as ie } from "./versioning/cleanVersionString.mjs";
|
|
22
|
+
import { default as xe } from "./api/getUrlAndParams.mjs";
|
|
23
|
+
import { default as ge } from "./api/getEndpointWithVersion.mjs";
|
|
24
|
+
import { default as Oe } from "./api/generateBackoffWithEqualJitter.mjs";
|
|
25
|
+
import { default as Se } from "./api/isAcceptedResponse.mjs";
|
|
26
|
+
import { default as Fe } from "./api/isNoContentResponse.mjs";
|
|
27
|
+
import { default as ve } from "./string/slugify.mjs";
|
|
28
|
+
import { default as De } from "./string/truncate.mjs";
|
|
29
|
+
import { default as he } from "./color/lighten.mjs";
|
|
30
|
+
import { default as Ae } from "./color/brighten.mjs";
|
|
31
|
+
import { default as Ve } from "./color/darken.mjs";
|
|
32
|
+
import { default as be } from "./color/isDarkBackground.mjs";
|
|
33
|
+
import { default as Le } from "./user/getFullName.mjs";
|
|
34
|
+
import { default as Ne } from "./user/getFullAddressString.mjs";
|
|
35
|
+
import { default as Ue } from "./logger/Logger.mjs";
|
|
36
|
+
import { LogLevel as we } from "./logger/types.mjs";
|
|
37
|
+
import { default as ze } from "./logger/sanitizeAsStringDict.mjs";
|
|
38
|
+
import { default as Je } from "./printing/getPrinterType.mjs";
|
|
39
|
+
import { default as Qe } from "./printing/isValidPrinter.mjs";
|
|
40
|
+
import { default as Xe } from "./printing/isValidNetworkPrinter.mjs";
|
|
41
|
+
import { default as Ze } from "./printing/isValidStarCloudPrinter.mjs";
|
|
42
|
+
import { default as $e } from "./printing/isTerminalPrinter.mjs";
|
|
43
|
+
import { default as tt } from "./printing/isCloudPrintModeEnabled.mjs";
|
|
44
|
+
import { default as ot } from "./number/randomIntFromInterval.mjs";
|
|
45
|
+
import { default as ft } from "./tables/decodeTableQRPayload.mjs";
|
|
46
|
+
import { default as lt } from "./checkout/getCheckoutItemModifications.mjs";
|
|
47
|
+
import { default as ut } from "./checkout/getCheckoutProductName.mjs";
|
|
48
|
+
import { TranslationKey as it, default as pt } from "./checkout/getCheckoutOrderStatusTexts.mjs";
|
|
49
|
+
import { default as nt } from "./checkout/getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
50
|
+
import { default as ct } from "./checkout/isCheckoutOrderSummary.mjs";
|
|
51
|
+
import { default as kt } from "./currency/getFormattedCurrency.mjs";
|
|
52
|
+
import { default as Pt } from "./inventory/isDetailedProductOutOfStock.mjs";
|
|
53
|
+
import { default as Tt } from "./inventory/isDetailedProductVariantOutOfStocks.mjs";
|
|
54
|
+
import { default as yt } from "./inventory/isMenuTreeProductOutOfStock.mjs";
|
|
55
|
+
import { default as It } from "./inventory/isDetailedProductUpSellsOutOfStock.mjs";
|
|
56
|
+
import { default as Ct } from "./inventory/isUpSellProductOutStock.mjs";
|
|
57
|
+
import { default as Rt } from "./inventory/isDetailedProductOutletStockOutOfStock.mjs";
|
|
58
|
+
import { default as Et } from "./inventory/getDetailedProductVariantStock.mjs";
|
|
59
|
+
import { default as Ht } from "./signalr/createUseSignalRHook.mjs";
|
|
60
|
+
import { default as Mt } from "./signalr/SignalR.mjs";
|
|
61
|
+
import { default as Bt } from "./error/createCodedError.mjs";
|
|
62
|
+
import { default as Wt } from "./error/isCodedError.mjs";
|
|
63
|
+
import { default as qt } from "./error/isNetworkError.mjs";
|
|
64
|
+
import { default as Gt } from "./error/isLockedError.mjs";
|
|
65
|
+
import { default as Kt } from "./hangfire/isHangfireResponse.mjs";
|
|
66
|
+
import { default as jt } from "./hangfire/createHangfirePoller.mjs";
|
|
67
|
+
import { default as Yt } from "./hangfire/createMakeHangfireRequest.mjs";
|
|
67
68
|
import "moment";
|
|
68
69
|
import "@ancon/wildcat-types";
|
|
69
70
|
import "./outlet/types.mjs";
|
|
@@ -88,71 +89,72 @@ export {
|
|
|
88
89
|
T as DayOfWeek,
|
|
89
90
|
v as IntervalState,
|
|
90
91
|
y as IntervalType,
|
|
91
|
-
|
|
92
|
-
|
|
92
|
+
we as LogLevel,
|
|
93
|
+
Ue as Logger,
|
|
93
94
|
D as OrderFormat,
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
95
|
+
Mt as SignalR,
|
|
96
|
+
it as TranslationKey,
|
|
97
|
+
Ae as brighten,
|
|
98
|
+
ie as cleanVersionString,
|
|
99
|
+
Bt as createCodedError,
|
|
100
|
+
jt as createHangfirePoller,
|
|
101
|
+
Yt as createMakeHangfireRequest,
|
|
102
|
+
Ht as createUseSignalRHook,
|
|
103
|
+
Ve as darken,
|
|
104
|
+
ft as decodeTableQRPayload,
|
|
105
|
+
Oe as generateBackoffWithEqualJitter,
|
|
105
106
|
A as generateId,
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
107
|
+
lt as getCheckoutGroupedModifications,
|
|
108
|
+
nt as getCheckoutItemsMappedByTicketItemStatus,
|
|
109
|
+
pt as getCheckoutOrderStatusTexts,
|
|
110
|
+
ut as getCheckoutProductName,
|
|
111
|
+
Et as getDetailedProductVariantStock,
|
|
112
|
+
ge as getEndpointWithVersion,
|
|
113
|
+
kt as getFormattedCurrency,
|
|
114
|
+
Ne as getFullAddressString,
|
|
115
|
+
Le as getFullName,
|
|
115
116
|
b as getListOutletOpeningHoursTable,
|
|
116
117
|
N as getOutletAvailabilityInfo,
|
|
117
118
|
w as getOutletAvailableOrderFormats,
|
|
118
119
|
Q as getOutletDeliveryFee,
|
|
120
|
+
le as getOutletFormattedAddress,
|
|
119
121
|
z as getOutletFormattedDistance,
|
|
120
122
|
U as getOutletOfflineOrderFormats,
|
|
121
123
|
Z as getOutletOrderFormats,
|
|
122
124
|
L as getOutletTagInformation,
|
|
123
125
|
X as getOutletTodayOpeningTimes,
|
|
124
126
|
te as getPickerIntervalsForDay,
|
|
125
|
-
|
|
127
|
+
Je as getPrinterType,
|
|
126
128
|
oe as getServiceIntervalRange,
|
|
127
129
|
fe as getServiceIntervalsForOrderFormat,
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
130
|
+
xe as getUrlAndParams,
|
|
131
|
+
Se as isAcceptedResponse,
|
|
132
|
+
ct as isCheckoutOrderSummary,
|
|
133
|
+
tt as isCloudPrintModeEnabled,
|
|
134
|
+
Wt as isCodedError,
|
|
135
|
+
be as isDarkBackground,
|
|
136
|
+
Pt as isDetailedProductOutOfStock,
|
|
137
|
+
Rt as isDetailedProductOutletStockOutOfStock,
|
|
138
|
+
It as isDetailedProductUpSellsOutOfStock,
|
|
139
|
+
Tt as isDetailedProductVariantOutOfStocks,
|
|
140
|
+
Kt as isHangfireResponse,
|
|
141
|
+
Gt as isLockedError,
|
|
142
|
+
yt as isMenuTreeProductOutOfStock,
|
|
143
|
+
qt as isNetworkError,
|
|
144
|
+
Fe as isNoContentResponse,
|
|
143
145
|
J as isOutletAcceptingPreOrders,
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
146
|
+
$e as isTerminalPrinter,
|
|
147
|
+
Ct as isUpSellProductOutOfStock,
|
|
148
|
+
Xe as isValidNetworkPrinter,
|
|
149
|
+
Qe as isValidPrinter,
|
|
150
|
+
Ze as isValidStarCloudPrinter,
|
|
151
|
+
ue as isVersionALessThanB,
|
|
150
152
|
h as isWithinFlag,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
153
|
+
he as lighten,
|
|
154
|
+
ot as randomIntFromInterval,
|
|
155
|
+
ze as sanitizeAsStringDict,
|
|
154
156
|
$ as serviceDateTimesFromOpeningHours,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
+
ve as slugify,
|
|
158
|
+
De as truncate,
|
|
157
159
|
V as wait
|
|
158
160
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export default function getOutletFormattedAddress(street: string, city: string, maxCharCount?: number): string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function c(t,s,n=40){const e=t&&(t.length>n?`${t.substr(0,n-3)}...`:t),d=s||"",a=s?`${e},`:e;return`${e?a:""} ${d}`}module.exports=c;
|
package/outlet/index.d.ts
CHANGED
|
@@ -12,4 +12,5 @@ import serviceDateTimesFromOpeningHours from './serviceDateTimesFromOpeningHours
|
|
|
12
12
|
import getPickerIntervalsForDay from './getPickerIntervalsForDay';
|
|
13
13
|
import getServiceIntervalRange from './getServiceIntervalRange';
|
|
14
14
|
import getServiceIntervalsForOrderFormat from './getServiceIntervalsForOrderFormat';
|
|
15
|
-
|
|
15
|
+
import getOutletFormattedAddress from './getOutletFormattedAddress';
|
|
16
|
+
export { getListOutletOpeningHoursTable, getOutletTagInformation, getOutletAvailabilityInfo, getOutletOfflineOrderFormats, getOutletAvailableOrderFormats, getOutletFormattedDistance, isOutletAcceptingPreOrders, getOutletDeliveryFee, getOutletTodayOpeningTimes, getOutletOrderFormats, serviceDateTimesFromOpeningHours, getPickerIntervalsForDay, getServiceIntervalRange, getServiceIntervalsForOrderFormat, getOutletFormattedAddress, };
|
package/outlet/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getListOutletOpeningHoursTable.js"),t=require("./getOutletTagInformation.js"),r=require("./getOutletAvailabilityInfo.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getListOutletOpeningHoursTable.js"),t=require("./getOutletTagInformation.js"),r=require("./getOutletAvailabilityInfo.js"),u=require("./getOutletOfflineOrderFormats.js"),i=require("./getOutletAvailableOrderFormats.js"),o=require("./getOutletFormattedDistance.js"),l=require("./isOutletAcceptingPreOrders.js"),n=require("./getOutletDeliveryFee.js"),s=require("./getOutletTodayOpeningTimes.js"),a=require("./getOutletOrderFormats.js"),O=require("./serviceDateTimesFromOpeningHours.js"),g=require("./getPickerIntervalsForDay.js"),c=require("./getServiceIntervalRange.js"),q=require("./getServiceIntervalsForOrderFormat.js"),d=require("./getOutletFormattedAddress.js");require("moment");require("@ancon/wildcat-types");require("../shared/enums.js");require("../shared/isWithinFlag.js");require("../shared/generateId.js");require("./types.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");require("lodash");require("../shared/constants.js");require("../time/toMinutes.js");require("../time/getNextTenthMinute.js");exports.getListOutletOpeningHoursTable=e;exports.getOutletTagInformation=t.default;exports.getOutletAvailabilityInfo=r.default;exports.getOutletOfflineOrderFormats=u;exports.getOutletAvailableOrderFormats=i;exports.getOutletFormattedDistance=o;exports.isOutletAcceptingPreOrders=l;exports.getOutletDeliveryFee=n;exports.getOutletTodayOpeningTimes=s;exports.getOutletOrderFormats=a;exports.serviceDateTimesFromOpeningHours=O;exports.getPickerIntervalsForDay=g;exports.getServiceIntervalRange=c;exports.getServiceIntervalsForOrderFormat=q;exports.getOutletFormattedAddress=d;
|
package/outlet/index.mjs
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { default as x } from "./getListOutletOpeningHoursTable.mjs";
|
|
2
|
-
import { default as
|
|
2
|
+
import { default as v } from "./getOutletTagInformation.mjs";
|
|
3
3
|
import { default as I } from "./getOutletAvailabilityInfo.mjs";
|
|
4
4
|
import { default as y } from "./getOutletOfflineOrderFormats.mjs";
|
|
5
|
-
import { default as
|
|
5
|
+
import { default as D } from "./getOutletAvailableOrderFormats.mjs";
|
|
6
6
|
import { default as H } from "./getOutletFormattedDistance.mjs";
|
|
7
7
|
import { default as S } from "./isOutletAcceptingPreOrders.mjs";
|
|
8
8
|
import { default as L } from "./getOutletDeliveryFee.mjs";
|
|
@@ -12,6 +12,7 @@ import { default as z } from "./serviceDateTimesFromOpeningHours.mjs";
|
|
|
12
12
|
import { default as C } from "./getPickerIntervalsForDay.mjs";
|
|
13
13
|
import { default as G } from "./getServiceIntervalRange.mjs";
|
|
14
14
|
import { default as K } from "./getServiceIntervalsForOrderFormat.mjs";
|
|
15
|
+
import { default as N } from "./getOutletFormattedAddress.mjs";
|
|
15
16
|
import "moment";
|
|
16
17
|
import "@ancon/wildcat-types";
|
|
17
18
|
import "../shared/enums.mjs";
|
|
@@ -29,12 +30,13 @@ import "../time/getNextTenthMinute.mjs";
|
|
|
29
30
|
export {
|
|
30
31
|
x as getListOutletOpeningHoursTable,
|
|
31
32
|
I as getOutletAvailabilityInfo,
|
|
32
|
-
|
|
33
|
+
D as getOutletAvailableOrderFormats,
|
|
33
34
|
L as getOutletDeliveryFee,
|
|
35
|
+
N as getOutletFormattedAddress,
|
|
34
36
|
H as getOutletFormattedDistance,
|
|
35
37
|
y as getOutletOfflineOrderFormats,
|
|
36
38
|
q as getOutletOrderFormats,
|
|
37
|
-
|
|
39
|
+
v as getOutletTagInformation,
|
|
38
40
|
h as getOutletTodayOpeningTimes,
|
|
39
41
|
C as getPickerIntervalsForDay,
|
|
40
42
|
G as getServiceIntervalRange,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancon/wildcat-utils",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.3",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -261,6 +261,11 @@
|
|
|
261
261
|
"require": "./outlet/getOutletDeliveryFee.js",
|
|
262
262
|
"types": "./outlet/getOutletDeliveryFee.d.ts"
|
|
263
263
|
},
|
|
264
|
+
"./outlet/getOutletFormattedAddress": {
|
|
265
|
+
"import": "./outlet/getOutletFormattedAddress.mjs",
|
|
266
|
+
"require": "./outlet/getOutletFormattedAddress.js",
|
|
267
|
+
"types": "./outlet/getOutletFormattedAddress.d.ts"
|
|
268
|
+
},
|
|
264
269
|
"./outlet/getOutletFormattedDistance": {
|
|
265
270
|
"import": "./outlet/getOutletFormattedDistance.mjs",
|
|
266
271
|
"require": "./outlet/getOutletFormattedDistance.js",
|