@ancon/wildcat-utils 1.25.0 → 1.25.2
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 +65 -63
- package/package.json +6 -1
- package/printing/index.d.ts +2 -1
- package/printing/index.js +1 -1
- package/printing/index.mjs +8 -6
- package/printing/isCloudPrintModeEnabled.d.ts +10 -0
- package/printing/isCloudPrintModeEnabled.js +1 -0
- package/printing/isCloudPrintModeEnabled.mjs +7 -0
|
@@ -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"),
|
|
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"),f=require("./versioning/cleanVersionString.js"),P=require("./api/getUrlAndParams.js"),y=require("./api/getEndpointWithVersion.js"),v=require("./api/generateBackoffWithEqualJitter.js"),h=require("./api/isAcceptedResponse.js"),F=require("./api/isNoContentResponse.js"),T=require("./string/slugify.js"),I=require("./string/truncate.js"),D=require("./color/lighten.js"),C=require("./color/brighten.js"),b=require("./color/darken.js"),A=require("./color/isDarkBackground.js"),R=require("./user/getFullName.js"),V=require("./user/getFullAddressString.js"),E=require("./logger/Logger.js"),H=require("./logger/types.js"),L=require("./logger/sanitizeAsStringDict.js"),M=require("./printing/getPrinterType.js"),N=require("./printing/isValidPrinter.js"),B=require("./printing/isValidNetworkPrinter.js"),U=require("./printing/isValidStarCloudPrinter.js"),W=require("./printing/isTerminalPrinter.js"),w=require("./printing/isCloudPrintModeEnabled.js"),x=require("./number/randomIntFromInterval.js"),z=require("./tables/decodeTableQRPayload.js"),J=require("./checkout/getCheckoutItemModifications.js"),K=require("./checkout/getCheckoutProductName.js"),r=require("./checkout/getCheckoutOrderStatusTexts.js"),Q=require("./checkout/getCheckoutItemsMappedByTicketItemStatus.js"),j=require("./checkout/isCheckoutOrderSummary.js"),G=require("./currency/getFormattedCurrency.js"),X=require("./inventory/isDetailedProductOutOfStock.js"),Y=require("./inventory/isDetailedProductVariantOutOfStocks.js"),Z=require("./inventory/isMenuTreeProductOutOfStock.js"),$=require("./inventory/isDetailedProductUpSellsOutOfStock.js"),ee=require("./inventory/isUpSellProductOutStock.js"),re=require("./inventory/isDetailedProductOutletStockOutOfStock.js"),te=require("./inventory/getDetailedProductVariantStock.js"),ie=require("./signalr/createUseSignalRHook.js"),oe=require("./signalr/SignalR.js"),ne=require("./error/createCodedError.js"),ue=require("./error/isCodedError.js"),se=require("./error/isNetworkError.js"),ae=require("./error/isLockedError.js"),ce=require("./hangfire/isHangfireResponse.js"),le=require("./hangfire/createHangfirePoller.js"),ge=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.isVersionALessThanB=p;exports.cleanVersionString=f;exports.getUrlAndParams=P;exports.getEndpointWithVersion=y;exports.generateBackoffWithEqualJitter=v;exports.isAcceptedResponse=h;exports.isNoContentResponse=F;exports.slugify=T;exports.truncate=I;exports.lighten=D;exports.brighten=C;exports.darken=b;exports.isDarkBackground=A;exports.getFullName=R;exports.getFullAddressString=V;exports.Logger=E;exports.LogLevel=H.LogLevel;exports.sanitizeAsStringDict=L;exports.getPrinterType=M;exports.isValidPrinter=N;exports.isValidNetworkPrinter=B;exports.isValidStarCloudPrinter=U;exports.isTerminalPrinter=W;exports.isCloudPrintModeEnabled=w;exports.randomIntFromInterval=x;exports.decodeTableQRPayload=z;exports.getCheckoutGroupedModifications=J;exports.getCheckoutProductName=K;exports.TranslationKey=r.TranslationKey;exports.getCheckoutOrderStatusTexts=r.default;exports.getCheckoutItemsMappedByTicketItemStatus=Q;exports.isCheckoutOrderSummary=j;exports.getFormattedCurrency=G;exports.isDetailedProductOutOfStock=X;exports.isDetailedProductVariantOutOfStocks=Y;exports.isMenuTreeProductOutOfStock=Z;exports.isDetailedProductUpSellsOutOfStock=$;exports.isUpSellProductOutOfStock=ee;exports.isDetailedProductOutletStockOutOfStock=re;exports.getDetailedProductVariantStock=te;exports.createUseSignalRHook=ie;exports.SignalR=oe;exports.createCodedError=ne;exports.isCodedError=ue;exports.isNetworkError=se;exports.isLockedError=ae;exports.isHangfireResponse=ce;exports.createHangfirePoller=le.default;exports.createMakeHangfireRequest=ge;
|
package/index.mjs
CHANGED
|
@@ -2,9 +2,9 @@ import { DayOfWeek as T, IntervalState as v, IntervalType as y, OrderFormat as D
|
|
|
2
2
|
import { default as h } from "./shared/isWithinFlag.mjs";
|
|
3
3
|
import { default as A } from "./shared/generateId.mjs";
|
|
4
4
|
import { default as V } from "./shared/wait.mjs";
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as
|
|
5
|
+
import { default as b } from "./outlet/getListOutletOpeningHoursTable.mjs";
|
|
6
|
+
import { default as L } from "./outlet/getOutletTagInformation.mjs";
|
|
7
|
+
import { default as N } from "./outlet/getOutletAvailabilityInfo.mjs";
|
|
8
8
|
import { default as U } from "./outlet/getOutletOfflineOrderFormats.mjs";
|
|
9
9
|
import { default as w } from "./outlet/getOutletAvailableOrderFormats.mjs";
|
|
10
10
|
import { default as z } from "./outlet/getOutletFormattedDistance.mjs";
|
|
@@ -18,7 +18,7 @@ import { default as oe } from "./outlet/getServiceIntervalRange.mjs";
|
|
|
18
18
|
import { default as fe } from "./outlet/getServiceIntervalsForOrderFormat.mjs";
|
|
19
19
|
import { default as le } from "./versioning/isVersionALessThanB.mjs";
|
|
20
20
|
import { default as ue } from "./versioning/cleanVersionString.mjs";
|
|
21
|
-
import { default as
|
|
21
|
+
import { default as me } from "./api/getUrlAndParams.mjs";
|
|
22
22
|
import { default as xe } from "./api/getEndpointWithVersion.mjs";
|
|
23
23
|
import { default as ge } from "./api/generateBackoffWithEqualJitter.mjs";
|
|
24
24
|
import { default as Oe } from "./api/isAcceptedResponse.mjs";
|
|
@@ -29,9 +29,9 @@ import { default as De } from "./color/lighten.mjs";
|
|
|
29
29
|
import { default as he } from "./color/brighten.mjs";
|
|
30
30
|
import { default as Ae } from "./color/darken.mjs";
|
|
31
31
|
import { default as Ve } from "./color/isDarkBackground.mjs";
|
|
32
|
-
import { default as
|
|
33
|
-
import { default as
|
|
34
|
-
import { default as
|
|
32
|
+
import { default as be } from "./user/getFullName.mjs";
|
|
33
|
+
import { default as Le } from "./user/getFullAddressString.mjs";
|
|
34
|
+
import { default as Ne } from "./logger/Logger.mjs";
|
|
35
35
|
import { LogLevel as Ue } from "./logger/types.mjs";
|
|
36
36
|
import { default as we } from "./logger/sanitizeAsStringDict.mjs";
|
|
37
37
|
import { default as ze } from "./printing/getPrinterType.mjs";
|
|
@@ -39,30 +39,31 @@ import { default as Je } from "./printing/isValidPrinter.mjs";
|
|
|
39
39
|
import { default as Qe } from "./printing/isValidNetworkPrinter.mjs";
|
|
40
40
|
import { default as Xe } from "./printing/isValidStarCloudPrinter.mjs";
|
|
41
41
|
import { default as Ze } from "./printing/isTerminalPrinter.mjs";
|
|
42
|
-
import { default as $e } from "./
|
|
43
|
-
import { default as tt } from "./
|
|
44
|
-
import { default as ot } from "./
|
|
45
|
-
import { default as ft } from "./checkout/
|
|
46
|
-
import {
|
|
47
|
-
import { default as
|
|
48
|
-
import { default as pt } from "./checkout/
|
|
49
|
-
import { default as nt } from "./
|
|
50
|
-
import { default as ct } from "./
|
|
51
|
-
import { default as kt } from "./inventory/
|
|
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 "./
|
|
58
|
-
import { default as Et } from "./signalr/
|
|
59
|
-
import { default as
|
|
60
|
-
import { default as
|
|
61
|
-
import { default as
|
|
62
|
-
import { default as Wt } from "./error/
|
|
63
|
-
import { default as qt } from "./
|
|
64
|
-
import { default as Gt } from "./hangfire/
|
|
65
|
-
import { default as Kt } from "./hangfire/
|
|
42
|
+
import { default as $e } from "./printing/isCloudPrintModeEnabled.mjs";
|
|
43
|
+
import { default as tt } from "./number/randomIntFromInterval.mjs";
|
|
44
|
+
import { default as ot } from "./tables/decodeTableQRPayload.mjs";
|
|
45
|
+
import { default as ft } from "./checkout/getCheckoutItemModifications.mjs";
|
|
46
|
+
import { default as lt } from "./checkout/getCheckoutProductName.mjs";
|
|
47
|
+
import { TranslationKey as ut, default as it } from "./checkout/getCheckoutOrderStatusTexts.mjs";
|
|
48
|
+
import { default as pt } from "./checkout/getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
49
|
+
import { default as nt } from "./checkout/isCheckoutOrderSummary.mjs";
|
|
50
|
+
import { default as ct } from "./currency/getFormattedCurrency.mjs";
|
|
51
|
+
import { default as kt } from "./inventory/isDetailedProductOutOfStock.mjs";
|
|
52
|
+
import { default as Pt } from "./inventory/isDetailedProductVariantOutOfStocks.mjs";
|
|
53
|
+
import { default as Tt } from "./inventory/isMenuTreeProductOutOfStock.mjs";
|
|
54
|
+
import { default as yt } from "./inventory/isDetailedProductUpSellsOutOfStock.mjs";
|
|
55
|
+
import { default as It } from "./inventory/isUpSellProductOutStock.mjs";
|
|
56
|
+
import { default as Ct } from "./inventory/isDetailedProductOutletStockOutOfStock.mjs";
|
|
57
|
+
import { default as Rt } from "./inventory/getDetailedProductVariantStock.mjs";
|
|
58
|
+
import { default as Et } from "./signalr/createUseSignalRHook.mjs";
|
|
59
|
+
import { default as Ht } from "./signalr/SignalR.mjs";
|
|
60
|
+
import { default as Mt } from "./error/createCodedError.mjs";
|
|
61
|
+
import { default as Bt } from "./error/isCodedError.mjs";
|
|
62
|
+
import { default as Wt } from "./error/isNetworkError.mjs";
|
|
63
|
+
import { default as qt } from "./error/isLockedError.mjs";
|
|
64
|
+
import { default as Gt } from "./hangfire/isHangfireResponse.mjs";
|
|
65
|
+
import { default as Kt } from "./hangfire/createHangfirePoller.mjs";
|
|
66
|
+
import { default as jt } from "./hangfire/createMakeHangfireRequest.mjs";
|
|
66
67
|
import "moment";
|
|
67
68
|
import "@ancon/wildcat-types";
|
|
68
69
|
import "./outlet/types.mjs";
|
|
@@ -88,66 +89,67 @@ export {
|
|
|
88
89
|
v as IntervalState,
|
|
89
90
|
y as IntervalType,
|
|
90
91
|
Ue as LogLevel,
|
|
91
|
-
|
|
92
|
+
Ne as Logger,
|
|
92
93
|
D as OrderFormat,
|
|
93
|
-
|
|
94
|
-
|
|
94
|
+
Ht as SignalR,
|
|
95
|
+
ut as TranslationKey,
|
|
95
96
|
he as brighten,
|
|
96
97
|
ue as cleanVersionString,
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
98
|
+
Mt as createCodedError,
|
|
99
|
+
Kt as createHangfirePoller,
|
|
100
|
+
jt as createMakeHangfireRequest,
|
|
101
|
+
Et as createUseSignalRHook,
|
|
101
102
|
Ae as darken,
|
|
102
|
-
|
|
103
|
+
ot as decodeTableQRPayload,
|
|
103
104
|
ge as generateBackoffWithEqualJitter,
|
|
104
105
|
A as generateId,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
106
|
+
ft as getCheckoutGroupedModifications,
|
|
107
|
+
pt as getCheckoutItemsMappedByTicketItemStatus,
|
|
108
|
+
it as getCheckoutOrderStatusTexts,
|
|
109
|
+
lt as getCheckoutProductName,
|
|
110
|
+
Rt as getDetailedProductVariantStock,
|
|
110
111
|
xe as getEndpointWithVersion,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
112
|
+
ct as getFormattedCurrency,
|
|
113
|
+
Le as getFullAddressString,
|
|
114
|
+
be as getFullName,
|
|
115
|
+
b as getListOutletOpeningHoursTable,
|
|
116
|
+
N as getOutletAvailabilityInfo,
|
|
116
117
|
w as getOutletAvailableOrderFormats,
|
|
117
118
|
Q as getOutletDeliveryFee,
|
|
118
119
|
z as getOutletFormattedDistance,
|
|
119
120
|
U as getOutletOfflineOrderFormats,
|
|
120
121
|
Z as getOutletOrderFormats,
|
|
121
|
-
|
|
122
|
+
L as getOutletTagInformation,
|
|
122
123
|
X as getOutletTodayOpeningTimes,
|
|
123
124
|
te as getPickerIntervalsForDay,
|
|
124
125
|
ze as getPrinterType,
|
|
125
126
|
oe as getServiceIntervalRange,
|
|
126
127
|
fe as getServiceIntervalsForOrderFormat,
|
|
127
|
-
|
|
128
|
+
me as getUrlAndParams,
|
|
128
129
|
Oe as isAcceptedResponse,
|
|
129
|
-
|
|
130
|
-
|
|
130
|
+
nt as isCheckoutOrderSummary,
|
|
131
|
+
$e as isCloudPrintModeEnabled,
|
|
132
|
+
Bt as isCodedError,
|
|
131
133
|
Ve as isDarkBackground,
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
134
|
+
kt as isDetailedProductOutOfStock,
|
|
135
|
+
Ct as isDetailedProductOutletStockOutOfStock,
|
|
136
|
+
yt as isDetailedProductUpSellsOutOfStock,
|
|
137
|
+
Pt as isDetailedProductVariantOutOfStocks,
|
|
138
|
+
Gt as isHangfireResponse,
|
|
139
|
+
qt as isLockedError,
|
|
140
|
+
Tt as isMenuTreeProductOutOfStock,
|
|
141
|
+
Wt as isNetworkError,
|
|
140
142
|
Se as isNoContentResponse,
|
|
141
143
|
J as isOutletAcceptingPreOrders,
|
|
142
144
|
Ze as isTerminalPrinter,
|
|
143
|
-
|
|
145
|
+
It as isUpSellProductOutOfStock,
|
|
144
146
|
Qe as isValidNetworkPrinter,
|
|
145
147
|
Je as isValidPrinter,
|
|
146
148
|
Xe as isValidStarCloudPrinter,
|
|
147
149
|
le as isVersionALessThanB,
|
|
148
150
|
h as isWithinFlag,
|
|
149
151
|
De as lighten,
|
|
150
|
-
|
|
152
|
+
tt as randomIntFromInterval,
|
|
151
153
|
we as sanitizeAsStringDict,
|
|
152
154
|
$ as serviceDateTimesFromOpeningHours,
|
|
153
155
|
Fe as slugify,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancon/wildcat-utils",
|
|
3
|
-
"version": "1.25.
|
|
3
|
+
"version": "1.25.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -336,6 +336,11 @@
|
|
|
336
336
|
"require": "./printing/index.js",
|
|
337
337
|
"types": "./printing/index.d.ts"
|
|
338
338
|
},
|
|
339
|
+
"./printing/isCloudPrintModeEnabled": {
|
|
340
|
+
"import": "./printing/isCloudPrintModeEnabled.mjs",
|
|
341
|
+
"require": "./printing/isCloudPrintModeEnabled.js",
|
|
342
|
+
"types": "./printing/isCloudPrintModeEnabled.d.ts"
|
|
343
|
+
},
|
|
339
344
|
"./printing/isTerminalPrinter": {
|
|
340
345
|
"import": "./printing/isTerminalPrinter.mjs",
|
|
341
346
|
"require": "./printing/isTerminalPrinter.js",
|
package/printing/index.d.ts
CHANGED
|
@@ -3,4 +3,5 @@ import isValidPrinter from './isValidPrinter';
|
|
|
3
3
|
import isValidNetworkPrinter from './isValidNetworkPrinter';
|
|
4
4
|
import isValidStarCloudPrinter from './isValidStarCloudPrinter';
|
|
5
5
|
import isTerminalPrinter from './isTerminalPrinter';
|
|
6
|
-
|
|
6
|
+
import isCloudPrintModeEnabled from './isCloudPrintModeEnabled';
|
|
7
|
+
export { getPrinterType, isValidPrinter, isValidNetworkPrinter, isValidStarCloudPrinter, isTerminalPrinter, isCloudPrintModeEnabled, };
|
package/printing/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./getPrinterType.js"),i=require("./isValidPrinter.js"),e=require("./isValidNetworkPrinter.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./getPrinterType.js"),i=require("./isValidPrinter.js"),e=require("./isValidNetworkPrinter.js"),n=require("./isValidStarCloudPrinter.js"),t=require("./isTerminalPrinter.js"),o=require("./isCloudPrintModeEnabled.js");require("@ancon/wildcat-printing");require("@ancon/wildcat-types");exports.getPrinterType=r;exports.isValidPrinter=i;exports.isValidNetworkPrinter=e;exports.isValidStarCloudPrinter=n;exports.isTerminalPrinter=t;exports.isCloudPrintModeEnabled=o;
|
package/printing/index.mjs
CHANGED
|
@@ -1,14 +1,16 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { default as
|
|
3
|
-
import { default as
|
|
1
|
+
import { default as o } from "./getPrinterType.mjs";
|
|
2
|
+
import { default as d } from "./isValidPrinter.mjs";
|
|
3
|
+
import { default as f } from "./isValidNetworkPrinter.mjs";
|
|
4
4
|
import { default as m } from "./isValidStarCloudPrinter.mjs";
|
|
5
5
|
import { default as n } from "./isTerminalPrinter.mjs";
|
|
6
|
+
import { default as x } from "./isCloudPrintModeEnabled.mjs";
|
|
6
7
|
import "@ancon/wildcat-printing";
|
|
7
8
|
import "@ancon/wildcat-types";
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
+
o as getPrinterType,
|
|
11
|
+
x as isCloudPrintModeEnabled,
|
|
10
12
|
n as isTerminalPrinter,
|
|
11
|
-
|
|
12
|
-
|
|
13
|
+
f as isValidNetworkPrinter,
|
|
14
|
+
d as isValidPrinter,
|
|
13
15
|
m as isValidStarCloudPrinter
|
|
14
16
|
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { type Printer } from '@ancon/wildcat-types';
|
|
2
|
+
/**
|
|
3
|
+
* Check if printer mode is set to Star CloudPRNT
|
|
4
|
+
* @param printer Printer object
|
|
5
|
+
* @returns Whether the printer object is considered to be in Star CloudPRNT mode
|
|
6
|
+
*/
|
|
7
|
+
declare function isCloudPrintModeEnabled(printer: unknown): printer is Printer & {
|
|
8
|
+
macAddress: string;
|
|
9
|
+
};
|
|
10
|
+
export default isCloudPrintModeEnabled;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("@ancon/wildcat-types");function r(t){return(t.mode??e.PrinterMode.Default)===e.PrinterMode.Cloud}module.exports=r;
|