@ancon/wildcat-utils 1.20.4 → 1.20.6
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/getCheckoutItemsMappedByTicketItemStatus.d.ts +1 -1
- package/checkout/getCheckoutItemsMappedByTicketItemStatus.js +1 -1
- package/checkout/getCheckoutItemsMappedByTicketItemStatus.mjs +7 -4
- package/checkout/getCheckoutOrderStatusTexts.d.ts +2 -2
- package/checkout/getCheckoutOrderStatusTexts.js +1 -1
- package/checkout/getCheckoutOrderStatusTexts.mjs +20 -16
- package/checkout/index.d.ts +2 -1
- package/checkout/index.js +1 -1
- package/checkout/index.mjs +9 -8
- package/index.js +1 -1
- package/index.mjs +88 -87
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const n=require("@ancon/wildcat-types");function d(s){return s.reduce((t,e)=>{var u,r;return((u=e.ticketItem)==null?void 0:u.status)===n.TicketItemStatus.Ready?(t.ready.push(e),t):(((r=e.ticketItem)==null?void 0:r.status)===n.TicketItemStatus.Closed&&t.done.push(e),t)},{all:s,ready:[],done:[]})}module.exports=d;
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import { TicketItemStatus as
|
|
2
|
-
function
|
|
1
|
+
import { TicketItemStatus as d } from "@ancon/wildcat-types";
|
|
2
|
+
function i(s) {
|
|
3
3
|
return s.reduce(
|
|
4
|
-
(e, t) =>
|
|
4
|
+
(e, t) => {
|
|
5
|
+
var r, u;
|
|
6
|
+
return ((r = t.ticketItem) == null ? void 0 : r.status) === d.Ready ? (e.ready.push(t), e) : (((u = t.ticketItem) == null ? void 0 : u.status) === d.Closed && e.done.push(t), e);
|
|
7
|
+
},
|
|
5
8
|
{
|
|
6
9
|
all: s,
|
|
7
10
|
ready: [],
|
|
@@ -10,5 +13,5 @@ function a(s) {
|
|
|
10
13
|
);
|
|
11
14
|
}
|
|
12
15
|
export {
|
|
13
|
-
|
|
16
|
+
i as default
|
|
14
17
|
};
|
|
@@ -2,7 +2,7 @@ import { CheckoutStatus, OrderFormat, TicketItemStatus, TicketStatus } from '@an
|
|
|
2
2
|
declare type CheckoutOrderSummaryItem = {
|
|
3
3
|
ticketItem: {
|
|
4
4
|
status: TicketItemStatus;
|
|
5
|
-
};
|
|
5
|
+
} | null;
|
|
6
6
|
};
|
|
7
7
|
declare type CheckoutSummary = {
|
|
8
8
|
orderFormat: OrderFormat;
|
|
@@ -58,6 +58,6 @@ declare type TranslationsWithMeta = {
|
|
|
58
58
|
declare type TranslatedTexts = Record<Exclude<TranslationKey, keyof TranslationsWithMeta>, ({ key }: {
|
|
59
59
|
key: TranslationKey;
|
|
60
60
|
}) => Translation> & TranslationsWithMeta;
|
|
61
|
-
declare function getOrderStatusTexts(checkout: CheckoutSummary, options: Options, texts?: TranslatedTexts): [Translation, TranslationKey];
|
|
61
|
+
declare function getOrderStatusTexts(checkout: CheckoutSummary | null | undefined, options: Options, texts?: TranslatedTexts): [Translation, TranslationKey];
|
|
62
62
|
export { TranslationKey };
|
|
63
63
|
export default getOrderStatusTexts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@ancon/wildcat-types"),O=require("./getCheckoutItemsMappedByTicketItemStatus.js");var u=(e=>(e.YourOrderIsBeingProcessed="yourOrderIsBeingProcessed",e.YourOrderWasCancelled="yourOrderWasCancelled",e.ProcessingPayment="processingPayment",e.YourOrderIsBeingPrepared="yourOrderIsBeingPrepared",e.YourOrderIsReadyToCollect="yourOrderIsReadyToCollect",e.YourOrderHasBeenCompleted="yourOrderHasBeenCompleted",e.YourOrderWillArriveAtYourTable="yourOrderWillArriveAtYourTable",e.ModifiedDeliveryStartTime="modifiedDeliveryStartTime",e.ModifiedPickUpTime="modifiedPickUpTime",e.YourOrderHasBeenAcceptedEstimatedTime="yourOrderHasBeenAcceptedEstimatedTime",e.YourOrderHasBeenAcceptedPickupTime="yourOrderHasBeenAcceptedPickupTime",e.YourOrderIsBeingDelivered="yourOrderIsBeingDelivered",e.YourOrderIsReady="yourOrderIsReady",e.DeliveryWasCompleted="deliveryWasCompleted",e.OneItemIsReadyToCollect="oneItemIsReadyToCollect",e.MultipleItemsAreReadyToCollect="multipleItemsAreReadyToCollect",e.EnjoyMealWhileOtherItemsBeingPrepared="enjoyMealWhileOtherItemsBeingPrepared",e))(u||{});function C(e){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"yourOrderIsReadyToCollect";default:return null}}function
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const r=require("@ancon/wildcat-types"),O=require("./getCheckoutItemsMappedByTicketItemStatus.js");var u=(e=>(e.YourOrderIsBeingProcessed="yourOrderIsBeingProcessed",e.YourOrderWasCancelled="yourOrderWasCancelled",e.ProcessingPayment="processingPayment",e.YourOrderIsBeingPrepared="yourOrderIsBeingPrepared",e.YourOrderIsReadyToCollect="yourOrderIsReadyToCollect",e.YourOrderHasBeenCompleted="yourOrderHasBeenCompleted",e.YourOrderWillArriveAtYourTable="yourOrderWillArriveAtYourTable",e.ModifiedDeliveryStartTime="modifiedDeliveryStartTime",e.ModifiedPickUpTime="modifiedPickUpTime",e.YourOrderHasBeenAcceptedEstimatedTime="yourOrderHasBeenAcceptedEstimatedTime",e.YourOrderHasBeenAcceptedPickupTime="yourOrderHasBeenAcceptedPickupTime",e.YourOrderIsBeingDelivered="yourOrderIsBeingDelivered",e.YourOrderIsReady="yourOrderIsReady",e.DeliveryWasCompleted="deliveryWasCompleted",e.OneItemIsReadyToCollect="oneItemIsReadyToCollect",e.MultipleItemsAreReadyToCollect="multipleItemsAreReadyToCollect",e.EnjoyMealWhileOtherItemsBeingPrepared="enjoyMealWhileOtherItemsBeingPrepared",e))(u||{});function C(e){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"yourOrderIsReadyToCollect";default:return null}}function f(e){switch(e){case r.TicketStatus.Pending:case r.TicketStatus.PendingAccept:return"processingPayment";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 I({useMarkAsPickedUp:e,checkoutStatus:o,ticketStatus:s}){const i=o!=null,d=s!=null;if(i){const t=o===r.CheckoutStatus.Captured,a=o===r.CheckoutStatus.InProgress;return e&&(t||a)}if(d){const t=s===r.TicketStatus.Preparing,a=s===r.TicketStatus.Ready;return t||a}return!1}function h(e,{checkoutStatus:o,ticketStatus:s,useMarkAsPickedUp:i,pickupTimeUpdated:d},t){if(I({useMarkAsPickedUp:i,checkoutStatus:o,ticketStatus:s})){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(s!=null)return[f(s)];const a=C(o);if(a)return[a];const c=o===r.CheckoutStatus.Captured,y=o===r.CheckoutStatus.InProgress,p=o===r.CheckoutStatus.Done,n=(e==null?void 0:e.orderFormat)===r.OrderFormat.TableOrder,l=(e==null?void 0:e.orderFormat)===r.OrderFormat.Delivery;if(c)return n?["yourOrderWillArriveAtYourTable"]:d&&l?["modifiedDeliveryStartTime"]:d?["modifiedPickUpTime"]:i?["yourOrderHasBeenAcceptedPickupTime"]:["yourOrderHasBeenAcceptedEstimatedTime"];if(y)return d&&l?["modifiedDeliveryStartTime"]:l?["yourOrderIsBeingDelivered"]:d?["modifiedPickUpTime"]:i?["yourOrderIsBeingPrepared"]:["yourOrderIsBeingPrepared"];if(p){const m=(e==null?void 0:e.orderFormat)===r.OrderFormat.EatIn,g=(e==null?void 0:e.orderFormat)===r.OrderFormat.TakeAway;if(m||g)return i?["yourOrderHasBeenCompleted"]:["yourOrderIsReady"];if(l)return["deliveryWasCompleted"];if(n)return i?["yourOrderIsReadyToCollect"]:["yourOrderWillArriveAtYourTable"]}throw new Error("Could not resolve translation key in getTranslationKey()")}const T={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"}),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"}),yourOrderHasBeenAcceptedEstimatedTime:()=>({title:"Your order has been accepted",message:"Estimated time: 00:00"}),yourOrderHasBeenAcceptedPickupTime:()=>({title:"Your order has been accepted",message:"Pickup time: 00:00"}),yourOrderIsBeingDelivered:()=>({title:"Your order is being delivered",message:"It will arrive at your door shortly. Enjoy your meal!"}),yourOrderIsReady:()=>({title:"Your order is ready",message:"Enjoy your meal!"}),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 P(e,o,s=T){const i=O((e==null?void 0:e.items)??[]),[d,t]=h(e,o,{all:i.all.length,ready:i.ready.length,done:i.done.length}),a=s[d]({key:d,meta:t});if(!a)throw new Error("Could not resolve translation in getOrderStatusTexts()");return[a,d]}exports.TranslationKey=u;exports.default=P;
|
|
@@ -37,7 +37,7 @@ function P(e) {
|
|
|
37
37
|
);
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
|
-
function
|
|
40
|
+
function h({
|
|
41
41
|
useMarkAsPickedUp: e,
|
|
42
42
|
checkoutStatus: o,
|
|
43
43
|
ticketStatus: s
|
|
@@ -53,13 +53,13 @@ function B({
|
|
|
53
53
|
}
|
|
54
54
|
return !1;
|
|
55
55
|
}
|
|
56
|
-
function
|
|
56
|
+
function B(e, {
|
|
57
57
|
checkoutStatus: o,
|
|
58
58
|
ticketStatus: s,
|
|
59
59
|
useMarkAsPickedUp: i,
|
|
60
60
|
pickupTimeUpdated: d
|
|
61
61
|
}, r) {
|
|
62
|
-
if (
|
|
62
|
+
if (h({
|
|
63
63
|
useMarkAsPickedUp: i,
|
|
64
64
|
checkoutStatus: o,
|
|
65
65
|
ticketStatus: s
|
|
@@ -80,23 +80,23 @@ function T({ orderFormat: e }, {
|
|
|
80
80
|
const a = C(o);
|
|
81
81
|
if (a)
|
|
82
82
|
return [a];
|
|
83
|
-
const
|
|
84
|
-
if (
|
|
85
|
-
return
|
|
86
|
-
if (
|
|
83
|
+
const y = o === t.Captured, p = o === t.InProgress, m = o === t.Done, c = (e == null ? void 0 : e.orderFormat) === u.TableOrder, n = (e == null ? void 0 : e.orderFormat) === u.Delivery;
|
|
84
|
+
if (y)
|
|
85
|
+
return c ? ["yourOrderWillArriveAtYourTable"] : d && n ? ["modifiedDeliveryStartTime"] : d ? ["modifiedPickUpTime"] : i ? ["yourOrderHasBeenAcceptedPickupTime"] : ["yourOrderHasBeenAcceptedEstimatedTime"];
|
|
86
|
+
if (p)
|
|
87
87
|
return d && n ? ["modifiedDeliveryStartTime"] : n ? ["yourOrderIsBeingDelivered"] : d ? ["modifiedPickUpTime"] : i ? ["yourOrderIsBeingPrepared"] : ["yourOrderIsBeingPrepared"];
|
|
88
|
-
if (
|
|
89
|
-
const g = e === u.EatIn, O = e === u.TakeAway;
|
|
88
|
+
if (m) {
|
|
89
|
+
const g = (e == null ? void 0 : e.orderFormat) === u.EatIn, O = (e == null ? void 0 : e.orderFormat) === u.TakeAway;
|
|
90
90
|
if (g || O)
|
|
91
91
|
return i ? ["yourOrderHasBeenCompleted"] : ["yourOrderIsReady"];
|
|
92
92
|
if (n)
|
|
93
93
|
return ["deliveryWasCompleted"];
|
|
94
|
-
if (
|
|
94
|
+
if (c)
|
|
95
95
|
return i ? ["yourOrderIsReadyToCollect"] : ["yourOrderWillArriveAtYourTable"];
|
|
96
96
|
}
|
|
97
97
|
throw new Error("Could not resolve translation key in getTranslationKey()");
|
|
98
98
|
}
|
|
99
|
-
const
|
|
99
|
+
const T = {
|
|
100
100
|
yourOrderIsBeingProcessed: () => ({
|
|
101
101
|
title: "Your order is being processed"
|
|
102
102
|
}),
|
|
@@ -153,18 +153,22 @@ const h = {
|
|
|
153
153
|
message: "Enjoy your meal!"
|
|
154
154
|
}),
|
|
155
155
|
oneItemIsReadyToCollect: () => ({
|
|
156
|
-
title: "One item is ready to pick up!"
|
|
156
|
+
title: "One item is ready to pick up!",
|
|
157
|
+
message: "Please allow cashier or waiter to confirm that the prepared item has been successfully issued."
|
|
157
158
|
}),
|
|
158
159
|
multipleItemsAreReadyToCollect: () => ({
|
|
159
|
-
title: "Multiple items are ready to pick up!"
|
|
160
|
+
title: "Multiple items are ready to pick up!",
|
|
161
|
+
message: "Please allow cashier or waiter to confirm that the prepared items have been successfully issued."
|
|
160
162
|
}),
|
|
161
163
|
enjoyMealWhileOtherItemsBeingPrepared: ({ meta: e }) => ({
|
|
162
164
|
title: "Enjoy your meal while the rest of the items are being prepared!",
|
|
163
165
|
message: `${e.count} more items are being prepared`
|
|
164
166
|
})
|
|
165
167
|
};
|
|
166
|
-
function
|
|
167
|
-
const i = f(
|
|
168
|
+
function Y(e, o, s = T) {
|
|
169
|
+
const i = f(
|
|
170
|
+
(e == null ? void 0 : e.items) ?? []
|
|
171
|
+
), [d, r] = B(e, o, {
|
|
168
172
|
all: i.all.length,
|
|
169
173
|
ready: i.ready.length,
|
|
170
174
|
done: i.done.length
|
|
@@ -175,5 +179,5 @@ function w(e, o, s = h) {
|
|
|
175
179
|
}
|
|
176
180
|
export {
|
|
177
181
|
I as TranslationKey,
|
|
178
|
-
|
|
182
|
+
Y as default
|
|
179
183
|
};
|
package/checkout/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import getCheckoutGroupedModifications from './getCheckoutItemModifications';
|
|
2
2
|
import getCheckoutProductName from './getCheckoutProductName';
|
|
3
3
|
import getCheckoutOrderStatusTexts, { TranslationKey } from './getCheckoutOrderStatusTexts';
|
|
4
|
+
import getCheckoutItemsMappedByTicketItemStatus from './getCheckoutItemsMappedByTicketItemStatus';
|
|
4
5
|
import isCheckoutOrderSummary from './isCheckoutOrderSummary';
|
|
5
|
-
export { TranslationKey, getCheckoutGroupedModifications, getCheckoutProductName, getCheckoutOrderStatusTexts, isCheckoutOrderSummary, };
|
|
6
|
+
export { TranslationKey, getCheckoutGroupedModifications, getCheckoutProductName, getCheckoutOrderStatusTexts, getCheckoutItemsMappedByTicketItemStatus, isCheckoutOrderSummary, };
|
package/checkout/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./getCheckoutItemModifications.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./getCheckoutItemModifications.js"),u=require("./getCheckoutProductName.js"),e=require("./getCheckoutOrderStatusTexts.js"),r=require("./getCheckoutItemsMappedByTicketItemStatus.js"),c=require("./isCheckoutOrderSummary.js");require("@ancon/wildcat-types");require("../currency/getFormattedCurrency.js");require("../currency/getFormattedCurrencyPostfix.js");exports.getCheckoutGroupedModifications=t;exports.getCheckoutProductName=u;exports.TranslationKey=e.TranslationKey;exports.getCheckoutOrderStatusTexts=e.default;exports.getCheckoutItemsMappedByTicketItemStatus=r;exports.isCheckoutOrderSummary=c;
|
package/checkout/index.mjs
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { default as
|
|
3
|
-
import { TranslationKey as
|
|
1
|
+
import { default as u } from "./getCheckoutItemModifications.mjs";
|
|
2
|
+
import { default as s } from "./getCheckoutProductName.mjs";
|
|
3
|
+
import { TranslationKey as f, default as p } from "./getCheckoutOrderStatusTexts.mjs";
|
|
4
|
+
import { default as c } from "./getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
4
5
|
import { default as l } from "./isCheckoutOrderSummary.mjs";
|
|
5
6
|
import "@ancon/wildcat-types";
|
|
6
7
|
import "../currency/getFormattedCurrency.mjs";
|
|
7
8
|
import "../currency/getFormattedCurrencyPostfix.mjs";
|
|
8
|
-
import "./getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
9
9
|
export {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
10
|
+
f as TranslationKey,
|
|
11
|
+
u as getCheckoutGroupedModifications,
|
|
12
|
+
c as getCheckoutItemsMappedByTicketItemStatus,
|
|
13
|
+
p as getCheckoutOrderStatusTexts,
|
|
14
|
+
s as getCheckoutProductName,
|
|
14
15
|
l as isCheckoutOrderSummary
|
|
15
16
|
};
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/enums.js"),r=require("./shared/isWithinFlag.js"),i=require("./shared/generateId.js"),n=require("./outlet/getListOutletOpeningHoursTable.js"),o=require("./outlet/getOutletTagInformation.js"),u=require("./outlet/getOutletAvailabilityInfo.js"),s=require("./outlet/getOutletOfflineOrderFormats.js"),a=require("./outlet/getOutletAvailableOrderFormats.js"),c=require("./outlet/getOutletFormattedDistance.js"),l=require("./outlet/isOutletAcceptingPreOrders.js"),g=require("./outlet/getOutletDeliveryFee.js"),d=require("./outlet/getOutletTodayOpeningTimes.js"),q=require("./outlet/getOutletOrderFormats.js"),O=require("./outlet/serviceDateTimesFromOpeningHours.js"),_=require("./versioning/isVersionALessThanB.js"),m=require("./versioning/cleanVersionString.js"),k=require("./api/getUrlAndParams.js"),y=require("./api/getEndpointWithVersion.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/enums.js"),r=require("./shared/isWithinFlag.js"),i=require("./shared/generateId.js"),n=require("./outlet/getListOutletOpeningHoursTable.js"),o=require("./outlet/getOutletTagInformation.js"),u=require("./outlet/getOutletAvailabilityInfo.js"),s=require("./outlet/getOutletOfflineOrderFormats.js"),a=require("./outlet/getOutletAvailableOrderFormats.js"),c=require("./outlet/getOutletFormattedDistance.js"),l=require("./outlet/isOutletAcceptingPreOrders.js"),g=require("./outlet/getOutletDeliveryFee.js"),d=require("./outlet/getOutletTodayOpeningTimes.js"),q=require("./outlet/getOutletOrderFormats.js"),O=require("./outlet/serviceDateTimesFromOpeningHours.js"),_=require("./versioning/isVersionALessThanB.js"),m=require("./versioning/cleanVersionString.js"),k=require("./api/getUrlAndParams.js"),y=require("./api/getEndpointWithVersion.js"),h=require("./api/generateBackoffWithEqualJitter.js"),p=require("./string/slugify.js"),T=require("./string/truncate.js"),f=require("./color/lighten.js"),P=require("./color/brighten.js"),F=require("./color/darken.js"),S=require("./color/isDarkBackground.js"),v=require("./user/getFullName.js"),I=require("./user/getFullAddressString.js"),D=require("./logger/Logger.js"),b=require("./logger/types.js"),A=require("./logger/sanitizeAsStringDict.js"),C=require("./printing/getPrinterType.js"),V=require("./printing/isValidPrinter.js"),L=require("./printing/isValidNetworkPrinter.js"),B=require("./printing/isValidStarCloudPrinter.js"),W=require("./printing/isTerminalPrinter.js"),M=require("./number/randomIntFromInterval.js"),N=require("./tables/decodeTableQRPayload.js"),E=require("./checkout/getCheckoutItemModifications.js"),H=require("./checkout/getCheckoutProductName.js"),t=require("./checkout/getCheckoutOrderStatusTexts.js"),w=require("./checkout/getCheckoutItemsMappedByTicketItemStatus.js"),x=require("./checkout/isCheckoutOrderSummary.js"),z=require("./currency/getFormattedCurrency.js"),J=require("./inventory/isDetailedProductOutOfStock.js"),K=require("./inventory/isDetailedProductVariantOutOfStocks.js"),Q=require("./inventory/isMenuTreeProductOutOfStock.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("compare-versions");require("tinycolor2");require("@ancon/wildcat-printing");require("./currency/getFormattedCurrencyPostfix.js");exports.DayOfWeek=e.DayOfWeek;exports.IntervalState=e.IntervalState;exports.IntervalType=e.IntervalType;exports.OrderFormat=e.OrderFormat;exports.isWithinFlag=r;exports.generateId=i;exports.getListOutletOpeningHoursTable=n;exports.getOutletTagInformation=o.default;exports.getOutletAvailabilityInfo=u.default;exports.getOutletOfflineOrderFormats=s;exports.getOutletAvailableOrderFormats=a;exports.getOutletFormattedDistance=c;exports.isOutletAcceptingPreOrders=l;exports.getOutletDeliveryFee=g;exports.getOutletTodayOpeningTimes=d;exports.getOutletOrderFormats=q;exports.serviceDateTimesFromOpeningHours=O;exports.isVersionALessThanB=_;exports.cleanVersionString=m;exports.getUrlAndParams=k;exports.getEndpointWithVersion=y;exports.generateBackoffWithEqualJitter=h;exports.slugify=p;exports.truncate=T;exports.lighten=f;exports.brighten=P;exports.darken=F;exports.isDarkBackground=S;exports.getFullName=v;exports.getFullAddressString=I;exports.Logger=D;exports.LogLevel=b.LogLevel;exports.sanitizeAsStringDict=A;exports.getPrinterType=C;exports.isValidPrinter=V;exports.isValidNetworkPrinter=L;exports.isValidStarCloudPrinter=B;exports.isTerminalPrinter=W;exports.randomIntFromInterval=M;exports.decodeTableQRPayload=N;exports.getCheckoutGroupedModifications=E;exports.getCheckoutProductName=H;exports.TranslationKey=t.TranslationKey;exports.getCheckoutOrderStatusTexts=t.default;exports.getCheckoutItemsMappedByTicketItemStatus=w;exports.isCheckoutOrderSummary=x;exports.getFormattedCurrency=z;exports.isDetailedProductOutOfStock=J;exports.isDetailedProductVariantOutOfStocks=K;exports.isMenuTreeProductOutOfStock=Q;
|
package/index.mjs
CHANGED
|
@@ -1,48 +1,49 @@
|
|
|
1
|
-
import { DayOfWeek as
|
|
2
|
-
import { default as
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
1
|
+
import { DayOfWeek as x, IntervalState as g, IntervalType as O, OrderFormat as c } from "./shared/enums.mjs";
|
|
2
|
+
import { default as T } from "./shared/isWithinFlag.mjs";
|
|
3
|
+
import { default as F } from "./shared/generateId.mjs";
|
|
4
|
+
import { default as h } from "./outlet/getListOutletOpeningHoursTable.mjs";
|
|
5
|
+
import { default as I } from "./outlet/getOutletTagInformation.mjs";
|
|
6
|
+
import { default as D } from "./outlet/getOutletAvailabilityInfo.mjs";
|
|
7
7
|
import { default as C } from "./outlet/getOutletOfflineOrderFormats.mjs";
|
|
8
|
-
import { default as
|
|
8
|
+
import { default as b } from "./outlet/getOutletAvailableOrderFormats.mjs";
|
|
9
9
|
import { default as B } from "./outlet/getOutletFormattedDistance.mjs";
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as
|
|
17
|
-
import { default as
|
|
18
|
-
import { default as
|
|
19
|
-
import { default as
|
|
20
|
-
import { default as
|
|
21
|
-
import { default as
|
|
22
|
-
import { default as
|
|
23
|
-
import { default as
|
|
24
|
-
import { default as
|
|
25
|
-
import { default as
|
|
26
|
-
import { default as
|
|
27
|
-
import { default as
|
|
28
|
-
import { default as
|
|
29
|
-
import { LogLevel as
|
|
30
|
-
import { default as
|
|
31
|
-
import { default as
|
|
32
|
-
import { default as
|
|
33
|
-
import { default as
|
|
10
|
+
import { default as M } from "./outlet/isOutletAcceptingPreOrders.mjs";
|
|
11
|
+
import { default as E } from "./outlet/getOutletDeliveryFee.mjs";
|
|
12
|
+
import { default as q } from "./outlet/getOutletTodayOpeningTimes.mjs";
|
|
13
|
+
import { default as z } from "./outlet/getOutletOrderFormats.mjs";
|
|
14
|
+
import { default as J } from "./outlet/serviceDateTimesFromOpeningHours.mjs";
|
|
15
|
+
import { default as Q } from "./versioning/isVersionALessThanB.mjs";
|
|
16
|
+
import { default as U } from "./versioning/cleanVersionString.mjs";
|
|
17
|
+
import { default as X } from "./api/getUrlAndParams.mjs";
|
|
18
|
+
import { default as Z } from "./api/getEndpointWithVersion.mjs";
|
|
19
|
+
import { default as $ } from "./api/generateBackoffWithEqualJitter.mjs";
|
|
20
|
+
import { default as et } from "./string/slugify.mjs";
|
|
21
|
+
import { default as ot } from "./string/truncate.mjs";
|
|
22
|
+
import { default as ft } from "./color/lighten.mjs";
|
|
23
|
+
import { default as st } from "./color/brighten.mjs";
|
|
24
|
+
import { default as dt } from "./color/darken.mjs";
|
|
25
|
+
import { default as it } from "./color/isDarkBackground.mjs";
|
|
26
|
+
import { default as nt } from "./user/getFullName.mjs";
|
|
27
|
+
import { default as gt } from "./user/getFullAddressString.mjs";
|
|
28
|
+
import { default as ct } from "./logger/Logger.mjs";
|
|
29
|
+
import { LogLevel as Tt } from "./logger/types.mjs";
|
|
30
|
+
import { default as Ft } from "./logger/sanitizeAsStringDict.mjs";
|
|
31
|
+
import { default as ht } from "./printing/getPrinterType.mjs";
|
|
32
|
+
import { default as It } from "./printing/isValidPrinter.mjs";
|
|
33
|
+
import { default as Dt } from "./printing/isValidNetworkPrinter.mjs";
|
|
34
34
|
import { default as Ct } from "./printing/isValidStarCloudPrinter.mjs";
|
|
35
|
-
import { default as
|
|
35
|
+
import { default as bt } from "./printing/isTerminalPrinter.mjs";
|
|
36
36
|
import { default as Bt } from "./number/randomIntFromInterval.mjs";
|
|
37
|
-
import { default as
|
|
38
|
-
import { default as
|
|
39
|
-
import { default as
|
|
40
|
-
import { TranslationKey as
|
|
41
|
-
import { default as
|
|
42
|
-
import { default as
|
|
43
|
-
import { default as
|
|
44
|
-
import { default as
|
|
45
|
-
import { default as
|
|
37
|
+
import { default as Mt } from "./tables/decodeTableQRPayload.mjs";
|
|
38
|
+
import { default as Et } from "./checkout/getCheckoutItemModifications.mjs";
|
|
39
|
+
import { default as qt } from "./checkout/getCheckoutProductName.mjs";
|
|
40
|
+
import { TranslationKey as zt, default as Gt } from "./checkout/getCheckoutOrderStatusTexts.mjs";
|
|
41
|
+
import { default as Kt } from "./checkout/getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
42
|
+
import { default as Rt } from "./checkout/isCheckoutOrderSummary.mjs";
|
|
43
|
+
import { default as jt } from "./currency/getFormattedCurrency.mjs";
|
|
44
|
+
import { default as Yt } from "./inventory/isDetailedProductOutOfStock.mjs";
|
|
45
|
+
import { default as _t } from "./inventory/isDetailedProductVariantOutOfStocks.mjs";
|
|
46
|
+
import { default as te } from "./inventory/isMenuTreeProductOutOfStock.mjs";
|
|
46
47
|
import "moment";
|
|
47
48
|
import "@ancon/wildcat-types";
|
|
48
49
|
import "./outlet/types.mjs";
|
|
@@ -55,55 +56,55 @@ import "compare-versions";
|
|
|
55
56
|
import "tinycolor2";
|
|
56
57
|
import "@ancon/wildcat-printing";
|
|
57
58
|
import "./currency/getFormattedCurrencyPostfix.mjs";
|
|
58
|
-
import "./checkout/getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
59
59
|
export {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
60
|
+
x as DayOfWeek,
|
|
61
|
+
g as IntervalState,
|
|
62
|
+
O as IntervalType,
|
|
63
|
+
Tt as LogLevel,
|
|
64
|
+
ct as Logger,
|
|
65
|
+
c as OrderFormat,
|
|
66
|
+
zt as TranslationKey,
|
|
67
|
+
st as brighten,
|
|
68
|
+
U as cleanVersionString,
|
|
69
|
+
dt as darken,
|
|
70
|
+
Mt as decodeTableQRPayload,
|
|
71
|
+
$ as generateBackoffWithEqualJitter,
|
|
72
|
+
F as generateId,
|
|
73
|
+
Et as getCheckoutGroupedModifications,
|
|
74
|
+
Kt as getCheckoutItemsMappedByTicketItemStatus,
|
|
75
|
+
Gt as getCheckoutOrderStatusTexts,
|
|
76
|
+
qt as getCheckoutProductName,
|
|
77
|
+
Z as getEndpointWithVersion,
|
|
78
|
+
jt as getFormattedCurrency,
|
|
79
|
+
gt as getFullAddressString,
|
|
80
|
+
nt as getFullName,
|
|
81
|
+
h as getListOutletOpeningHoursTable,
|
|
82
|
+
D as getOutletAvailabilityInfo,
|
|
83
|
+
b as getOutletAvailableOrderFormats,
|
|
84
|
+
E as getOutletDeliveryFee,
|
|
84
85
|
B as getOutletFormattedDistance,
|
|
85
86
|
C as getOutletOfflineOrderFormats,
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
87
|
+
z as getOutletOrderFormats,
|
|
88
|
+
I as getOutletTagInformation,
|
|
89
|
+
q as getOutletTodayOpeningTimes,
|
|
90
|
+
ht as getPrinterType,
|
|
91
|
+
X as getUrlAndParams,
|
|
92
|
+
Rt as isCheckoutOrderSummary,
|
|
93
|
+
it as isDarkBackground,
|
|
94
|
+
Yt as isDetailedProductOutOfStock,
|
|
95
|
+
_t as isDetailedProductVariantOutOfStocks,
|
|
96
|
+
te as isMenuTreeProductOutOfStock,
|
|
97
|
+
M as isOutletAcceptingPreOrders,
|
|
98
|
+
bt as isTerminalPrinter,
|
|
99
|
+
Dt as isValidNetworkPrinter,
|
|
100
|
+
It as isValidPrinter,
|
|
100
101
|
Ct as isValidStarCloudPrinter,
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
Q as isVersionALessThanB,
|
|
103
|
+
T as isWithinFlag,
|
|
104
|
+
ft as lighten,
|
|
104
105
|
Bt as randomIntFromInterval,
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
106
|
+
Ft as sanitizeAsStringDict,
|
|
107
|
+
J as serviceDateTimesFromOpeningHours,
|
|
108
|
+
et as slugify,
|
|
109
|
+
ot as truncate
|
|
109
110
|
};
|