@ancon/wildcat-utils 1.19.0 → 1.20.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/checkout/getCheckoutItemsMappedByTicketItemStatus.d.ts +15 -0
- package/checkout/getCheckoutItemsMappedByTicketItemStatus.js +1 -0
- package/checkout/getCheckoutItemsMappedByTicketItemStatus.mjs +14 -0
- package/checkout/getCheckoutOrderStatusTexts.d.ts +30 -8
- package/checkout/getCheckoutOrderStatusTexts.js +1 -1
- package/checkout/getCheckoutOrderStatusTexts.mjs +73 -44
- package/checkout/index.js +1 -1
- package/checkout/index.mjs +9 -8
- package/index.js +1 -1
- package/index.mjs +94 -93
- package/package.json +6 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { TicketItemStatus } from '@ancon/wildcat-types';
|
|
2
|
+
declare type CheckoutOrderSummaryItem = {
|
|
3
|
+
id: string;
|
|
4
|
+
ticketItem: {
|
|
5
|
+
status: TicketItemStatus;
|
|
6
|
+
ticketItemId: string;
|
|
7
|
+
};
|
|
8
|
+
};
|
|
9
|
+
declare type MappedItems = {
|
|
10
|
+
all: CheckoutOrderSummaryItem[];
|
|
11
|
+
ready: CheckoutOrderSummaryItem[];
|
|
12
|
+
done: CheckoutOrderSummaryItem[];
|
|
13
|
+
};
|
|
14
|
+
declare function getCheckoutItemsMappedByTicketItemStatus(items: CheckoutOrderSummaryItem[]): MappedItems;
|
|
15
|
+
export default getCheckoutItemsMappedByTicketItemStatus;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("@ancon/wildcat-types");function r(s){return s.reduce((t,e)=>e.ticketItem.status===u.TicketItemStatus.Ready?(t.ready.push(e),t):(e.ticketItem.status===u.TicketItemStatus.Closed&&t.done.push(e),t),{all:s,ready:[],done:[]})}module.exports=r;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { TicketItemStatus as r } from "@ancon/wildcat-types";
|
|
2
|
+
function a(s) {
|
|
3
|
+
return s.reduce(
|
|
4
|
+
(e, t) => t.ticketItem.status === r.Ready ? (e.ready.push(t), e) : (t.ticketItem.status === r.Closed && e.done.push(t), e),
|
|
5
|
+
{
|
|
6
|
+
all: s,
|
|
7
|
+
ready: [],
|
|
8
|
+
done: []
|
|
9
|
+
}
|
|
10
|
+
);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
a as default
|
|
14
|
+
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { CheckoutStatus, OrderFormat, TicketItemStatus, TicketStatus } from '@ancon/wildcat-types';
|
|
2
2
|
declare type CheckoutOrderSummaryItem = {
|
|
3
3
|
id: string;
|
|
4
4
|
ticketItem: {
|
|
@@ -6,13 +6,20 @@ declare type CheckoutOrderSummaryItem = {
|
|
|
6
6
|
ticketItemId: string;
|
|
7
7
|
};
|
|
8
8
|
};
|
|
9
|
-
declare type
|
|
10
|
-
id: string;
|
|
11
|
-
summary: string;
|
|
9
|
+
declare type CheckoutSummary = {
|
|
12
10
|
orderFormat: OrderFormat;
|
|
13
|
-
status: TicketStatus;
|
|
14
11
|
items: CheckoutOrderSummaryItem[];
|
|
15
12
|
};
|
|
13
|
+
declare type Options = {
|
|
14
|
+
useMarkAsPickedUp: boolean;
|
|
15
|
+
pickupTimeUpdated: boolean;
|
|
16
|
+
} & ({
|
|
17
|
+
checkoutStatus: CheckoutStatus;
|
|
18
|
+
ticketStatus?: never;
|
|
19
|
+
} | {
|
|
20
|
+
checkoutStatus?: never;
|
|
21
|
+
ticketStatus: TicketStatus;
|
|
22
|
+
});
|
|
16
23
|
declare type Translation = {
|
|
17
24
|
title: string;
|
|
18
25
|
message?: string;
|
|
@@ -31,8 +38,23 @@ declare enum TranslationKey {
|
|
|
31
38
|
YourOrderHasBeenAcceptedPickupTime = "yourOrderHasBeenAcceptedPickupTime",
|
|
32
39
|
YourOrderIsBeingDelivered = "yourOrderIsBeingDelivered",
|
|
33
40
|
YourOrderIsReady = "yourOrderIsReady",
|
|
34
|
-
DeliveryWasCompleted = "deliveryWasCompleted"
|
|
41
|
+
DeliveryWasCompleted = "deliveryWasCompleted",
|
|
42
|
+
OneItemIsReadyToCollect = "oneItemIsReadyToCollect",
|
|
43
|
+
MultipleItemsAreReadyToCollect = "multipleItemsAreReadyToCollect",
|
|
44
|
+
EnjoyMealWhileOtherItemsBeingPrepared = "enjoyMealWhileOtherItemsBeingPrepared"
|
|
35
45
|
}
|
|
36
|
-
declare type
|
|
37
|
-
|
|
46
|
+
declare type TranslationsWithMeta = {
|
|
47
|
+
[TranslationKey.MultipleItemsAreReadyToCollect]: ({ meta, }: {
|
|
48
|
+
meta: {
|
|
49
|
+
count: number;
|
|
50
|
+
};
|
|
51
|
+
}) => Translation;
|
|
52
|
+
[TranslationKey.EnjoyMealWhileOtherItemsBeingPrepared]: ({ meta, }: {
|
|
53
|
+
meta: {
|
|
54
|
+
count: number;
|
|
55
|
+
};
|
|
56
|
+
}) => Translation;
|
|
57
|
+
};
|
|
58
|
+
declare type TranslatedTexts = Record<Exclude<TranslationKey, keyof TranslationsWithMeta>, () => Translation> & TranslationsWithMeta;
|
|
59
|
+
declare function getOrderStatusTexts(checkout: CheckoutSummary, options: Options, texts?: TranslatedTexts): [Translation, TranslationKey];
|
|
38
60
|
export default getOrderStatusTexts;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const e=require("@ancon/wildcat-types"),
|
|
1
|
+
"use strict";const e=require("@ancon/wildcat-types"),p=require("./getCheckoutItemsMappedByTicketItemStatus.js");function h(r){switch(r){case e.CheckoutStatus.Created:case e.CheckoutStatus.Ready:case e.CheckoutStatus.Processing:case e.CheckoutStatus.Authorized:return"yourOrderIsBeingProcessed";case e.CheckoutStatus.Canceled:return"yourOrderWasCancelled";case e.CheckoutStatus.Received:return"processingPayment";case e.CheckoutStatus.ReadyToCollect:return"yourOrderIsReadyToCollect";default:throw new Error(`Unhandled checkout status "${r}" in getTranslationKeyByCheckoutStatus()`)}}function T(r){switch(r){case e.TicketStatus.Pending:case e.TicketStatus.PendingAccept:return"processingPayment";case e.TicketStatus.Preparing:return"yourOrderIsBeingPrepared";case e.TicketStatus.Ready:return"yourOrderIsReadyToCollect";case e.TicketStatus.Closed:return"yourOrderHasBeenCompleted";case e.TicketStatus.Canceled:return"yourOrderWasCancelled";default:throw new Error(`Unhandled ticket status "${r}" in getTranslationKeyByTicketStatus()`)}}function C({orderFormat:r},{checkoutStatus:i,ticketStatus:n,useMarkAsPickedUp:o,pickupTimeUpdated:a},t){if(o&&t.ready>0)return t.ready<2?["oneItemIsReadyToCollect"]:["multipleItemsAreReadyToCollect",{count:t.ready}];if(o&&t.done>0&&t.done<t.all)return["enjoyMealWhileOtherItemsBeingPrepared",{count:Math.max(0,t.all-t.done-t.ready)}];if(n!=null)return[T(n)];const s=h(i);if(s)return[s];const u=i===e.CheckoutStatus.Captured,c=i===e.CheckoutStatus.InProgress,y=i===e.CheckoutStatus.Canceled,l=r===e.OrderFormat.TableOrder,d=r===e.OrderFormat.Delivery;if(u)return l?["yourOrderWillArriveAtYourTable"]:a&&d?["modifiedDeliveryStartTime"]:a?["modifiedPickUpTime"]:o?["yourOrderHasBeenAcceptedPickupTime"]:["yourOrderHasBeenAcceptedEstimatedTime"];if(c)return a&&d?["modifiedDeliveryStartTime"]:d?["yourOrderIsBeingDelivered"]:a?["modifiedPickUpTime"]:o?["yourOrderHasBeenAcceptedPickupTime"]:["yourOrderHasBeenAcceptedEstimatedTime"];if(y){const m=r===e.OrderFormat.EatIn,g=r===e.OrderFormat.TakeAway;if(m||g)return o?["yourOrderHasBeenCompleted"]:["yourOrderIsReady"];if(d)return["deliveryWasCompleted"];if(l)return o?["yourOrderIsReadyToCollect"]:["yourOrderWillArriveAtYourTable"]}throw new Error("Could not resolve translation key in getTranslationKey()")}const f={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!"}),multipleItemsAreReadyToCollect:()=>({title:"Multiple items are ready to pick up!"}),enjoyMealWhileOtherItemsBeingPrepared:({meta:r})=>({title:"Enjoy your meal while the rest of the items are being prepared!",message:`${r.count} more items are being prepared`})};function O(r,i,n=f){const o=p(r.items),[a,t]=C(r,i,{all:o.all.length,ready:o.ready.length,done:o.done.length}),s=n[a]({meta:t});if(!s)throw new Error("Could not resolve translation in getOrderStatusTexts()");return[s,a]}module.exports=O;
|
|
@@ -1,66 +1,81 @@
|
|
|
1
|
-
import { CheckoutStatus as
|
|
2
|
-
import
|
|
3
|
-
function
|
|
4
|
-
switch (e
|
|
5
|
-
case
|
|
6
|
-
case
|
|
7
|
-
case
|
|
8
|
-
case
|
|
1
|
+
import { CheckoutStatus as o, OrderFormat as u, TicketStatus as n } from "@ancon/wildcat-types";
|
|
2
|
+
import T from "./getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
3
|
+
function h(e) {
|
|
4
|
+
switch (e) {
|
|
5
|
+
case o.Created:
|
|
6
|
+
case o.Ready:
|
|
7
|
+
case o.Processing:
|
|
8
|
+
case o.Authorized:
|
|
9
9
|
return "yourOrderIsBeingProcessed";
|
|
10
|
-
case
|
|
10
|
+
case o.Canceled:
|
|
11
11
|
return "yourOrderWasCancelled";
|
|
12
|
-
case
|
|
12
|
+
case o.Received:
|
|
13
13
|
return "processingPayment";
|
|
14
|
-
case
|
|
14
|
+
case o.ReadyToCollect:
|
|
15
15
|
return "yourOrderIsReadyToCollect";
|
|
16
16
|
default:
|
|
17
17
|
throw new Error(
|
|
18
|
-
`Unhandled checkout status "${e
|
|
18
|
+
`Unhandled checkout status "${e}" in getTranslationKeyByCheckoutStatus()`
|
|
19
19
|
);
|
|
20
20
|
}
|
|
21
21
|
}
|
|
22
|
-
function
|
|
23
|
-
switch (e
|
|
24
|
-
case
|
|
25
|
-
case
|
|
22
|
+
function O(e) {
|
|
23
|
+
switch (e) {
|
|
24
|
+
case n.Pending:
|
|
25
|
+
case n.PendingAccept:
|
|
26
26
|
return "processingPayment";
|
|
27
|
-
case
|
|
27
|
+
case n.Preparing:
|
|
28
28
|
return "yourOrderIsBeingPrepared";
|
|
29
|
-
case
|
|
29
|
+
case n.Ready:
|
|
30
30
|
return "yourOrderIsReadyToCollect";
|
|
31
|
-
case
|
|
31
|
+
case n.Closed:
|
|
32
32
|
return "yourOrderHasBeenCompleted";
|
|
33
|
-
case
|
|
33
|
+
case n.Canceled:
|
|
34
34
|
return "yourOrderWasCancelled";
|
|
35
35
|
default:
|
|
36
36
|
throw new Error(
|
|
37
|
-
`Unhandled ticket status "${e
|
|
37
|
+
`Unhandled ticket status "${e}" in getTranslationKeyByTicketStatus()`
|
|
38
38
|
);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
function
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
function C({ orderFormat: e }, {
|
|
42
|
+
checkoutStatus: a,
|
|
43
|
+
ticketStatus: l,
|
|
44
|
+
useMarkAsPickedUp: t,
|
|
45
|
+
pickupTimeUpdated: i
|
|
46
|
+
}, r) {
|
|
47
|
+
if (t && r.ready > 0)
|
|
48
|
+
return r.ready < 2 ? ["oneItemIsReadyToCollect"] : [
|
|
49
|
+
"multipleItemsAreReadyToCollect",
|
|
50
|
+
{ count: r.ready }
|
|
51
|
+
];
|
|
52
|
+
if (t && r.done > 0 && r.done < r.all)
|
|
53
|
+
return [
|
|
54
|
+
"enjoyMealWhileOtherItemsBeingPrepared",
|
|
55
|
+
{ count: Math.max(0, r.all - r.done - r.ready) }
|
|
56
|
+
];
|
|
57
|
+
if (l != null)
|
|
58
|
+
return [O(l)];
|
|
59
|
+
const s = h(a);
|
|
45
60
|
if (s)
|
|
46
|
-
return s;
|
|
47
|
-
const
|
|
48
|
-
if (
|
|
49
|
-
return
|
|
50
|
-
if (
|
|
51
|
-
return d ? "yourOrderIsBeingDelivered" : "yourOrderHasBeenAcceptedEstimatedTime";
|
|
52
|
-
if (
|
|
53
|
-
const
|
|
54
|
-
if (
|
|
55
|
-
return "yourOrderIsReady";
|
|
61
|
+
return [s];
|
|
62
|
+
const c = a === o.Captured, m = a === o.InProgress, g = a === o.Canceled, y = e === u.TableOrder, d = e === u.Delivery;
|
|
63
|
+
if (c)
|
|
64
|
+
return y ? ["yourOrderWillArriveAtYourTable"] : i && d ? ["modifiedDeliveryStartTime"] : i ? ["modifiedPickUpTime"] : t ? ["yourOrderHasBeenAcceptedPickupTime"] : ["yourOrderHasBeenAcceptedEstimatedTime"];
|
|
65
|
+
if (m)
|
|
66
|
+
return i && d ? ["modifiedDeliveryStartTime"] : d ? ["yourOrderIsBeingDelivered"] : i ? ["modifiedPickUpTime"] : t ? ["yourOrderHasBeenAcceptedPickupTime"] : ["yourOrderHasBeenAcceptedEstimatedTime"];
|
|
67
|
+
if (g) {
|
|
68
|
+
const p = e === u.EatIn, f = e === u.TakeAway;
|
|
69
|
+
if (p || f)
|
|
70
|
+
return t ? ["yourOrderHasBeenCompleted"] : ["yourOrderIsReady"];
|
|
56
71
|
if (d)
|
|
57
|
-
return "deliveryWasCompleted";
|
|
58
|
-
if (
|
|
59
|
-
return "yourOrderWillArriveAtYourTable";
|
|
72
|
+
return ["deliveryWasCompleted"];
|
|
73
|
+
if (y)
|
|
74
|
+
return t ? ["yourOrderIsReadyToCollect"] : ["yourOrderWillArriveAtYourTable"];
|
|
60
75
|
}
|
|
61
76
|
throw new Error("Could not resolve translation key in getTranslationKey()");
|
|
62
77
|
}
|
|
63
|
-
const
|
|
78
|
+
const I = {
|
|
64
79
|
yourOrderIsBeingProcessed: () => ({
|
|
65
80
|
title: "Your order is being processed."
|
|
66
81
|
}),
|
|
@@ -115,14 +130,28 @@ const O = {
|
|
|
115
130
|
deliveryWasCompleted: () => ({
|
|
116
131
|
title: "Your order was completed",
|
|
117
132
|
message: "Enjoy your meal!"
|
|
133
|
+
}),
|
|
134
|
+
oneItemIsReadyToCollect: () => ({
|
|
135
|
+
title: "One item is ready to pick up!"
|
|
136
|
+
}),
|
|
137
|
+
multipleItemsAreReadyToCollect: () => ({
|
|
138
|
+
title: "Multiple items are ready to pick up!"
|
|
139
|
+
}),
|
|
140
|
+
enjoyMealWhileOtherItemsBeingPrepared: ({ meta: e }) => ({
|
|
141
|
+
title: "Enjoy your meal while the rest of the items are being prepared!",
|
|
142
|
+
message: `${e.count} more items are being prepared`
|
|
118
143
|
})
|
|
119
144
|
};
|
|
120
|
-
function
|
|
121
|
-
const
|
|
122
|
-
|
|
145
|
+
function P(e, a, l = I) {
|
|
146
|
+
const t = T(e.items), [i, r] = C(e, a, {
|
|
147
|
+
all: t.all.length,
|
|
148
|
+
ready: t.ready.length,
|
|
149
|
+
done: t.done.length
|
|
150
|
+
}), s = l[i]({ meta: r });
|
|
151
|
+
if (!s)
|
|
123
152
|
throw new Error("Could not resolve translation in getOrderStatusTexts()");
|
|
124
|
-
return [
|
|
153
|
+
return [s, i];
|
|
125
154
|
}
|
|
126
155
|
export {
|
|
127
|
-
|
|
156
|
+
P as default
|
|
128
157
|
};
|
package/checkout/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getCheckoutItemModifications.js"),t=require("./getCheckoutProductName.js"),r=require("./getCheckoutOrderStatusTexts.js"),u=require("./isCheckoutOrderSummary.js");require("@ancon/wildcat-types");require("../currency/getFormattedCurrency.js");require("../currency/getFormattedCurrencyPostfix.js");exports.getCheckoutGroupedModifications=e;exports.getCheckoutProductName=t;exports.getCheckoutOrderStatusTexts=r;exports.isCheckoutOrderSummary=u;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getCheckoutItemModifications.js"),t=require("./getCheckoutProductName.js"),r=require("./getCheckoutOrderStatusTexts.js"),u=require("./isCheckoutOrderSummary.js");require("@ancon/wildcat-types");require("../currency/getFormattedCurrency.js");require("../currency/getFormattedCurrencyPostfix.js");require("./getCheckoutItemsMappedByTicketItemStatus.js");exports.getCheckoutGroupedModifications=e;exports.getCheckoutProductName=t;exports.getCheckoutOrderStatusTexts=r;exports.isCheckoutOrderSummary=u;
|
package/checkout/index.mjs
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { default as
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
1
|
+
import { default as m } from "./getCheckoutItemModifications.mjs";
|
|
2
|
+
import { default as f } from "./getCheckoutProductName.mjs";
|
|
3
|
+
import { default as i } from "./getCheckoutOrderStatusTexts.mjs";
|
|
4
|
+
import { default as c } from "./isCheckoutOrderSummary.mjs";
|
|
5
5
|
import "@ancon/wildcat-types";
|
|
6
6
|
import "../currency/getFormattedCurrency.mjs";
|
|
7
7
|
import "../currency/getFormattedCurrencyPostfix.mjs";
|
|
8
|
+
import "./getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
8
9
|
export {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
10
|
+
m as getCheckoutGroupedModifications,
|
|
11
|
+
i as getCheckoutOrderStatusTexts,
|
|
12
|
+
f as getCheckoutProductName,
|
|
13
|
+
c as isCheckoutOrderSummary
|
|
13
14
|
};
|
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"),r=require("./shared/generateId.js"),i=require("./outlet/getListOutletOpeningHoursTable.js"),n=require("./outlet/getOutletTagInformation.js"),o=require("./outlet/getOutletAvailabilityInfo.js"),u=require("./outlet/getOutletOfflineOrderFormats.js"),s=require("./outlet/getOutletAvailableOrderFormats.js"),a=require("./outlet/getOutletFormattedDistance.js"),c=require("./outlet/isOutletAcceptingPreOrders.js"),l=require("./outlet/getOutletDeliveryFee.js"),g=require("./outlet/getOutletTodayOpeningTimes.js"),d=require("./outlet/getOutletOrderFormats.js"),q=require("./outlet/serviceDateTimesFromOpeningHours.js"),O=require("./versioning/isVersionALessThanB.js"),_=require("./versioning/cleanVersionString.js"),m=require("./api/getUrlAndParams.js"),k=require("./api/getEndpointWithVersion.js"),f=require("./api/generateBackoffWithEqualJitter.js"),h=require("./string/slugify.js"),y=require("./string/truncate.js"),p=require("./color/lighten.js"),P=require("./color/brighten.js"),T=require("./color/darken.js"),F=require("./color/isDarkBackground.js"),v=require("./user/getFullName.js"),S=require("./user/getFullAddressString.js"),D=require("./logger/Logger.js"),I=require("./logger/types.js"),b=require("./logger/sanitizeAsStringDict.js"),A=require("./printing/getPrinterType.js"),V=require("./printing/isValidPrinter.js"),C=require("./printing/isValidNetworkPrinter.js"),L=require("./printing/isValidStarCloudPrinter.js"),W=require("./printing/isTerminalPrinter.js"),B=require("./number/randomIntFromInterval.js"),N=require("./tables/decodeTableQRPayload.js"),M=require("./checkout/getCheckoutItemModifications.js"),E=require("./checkout/getCheckoutProductName.js"),H=require("./checkout/getCheckoutOrderStatusTexts.js"),w=require("./checkout/isCheckoutOrderSummary.js"),x=require("./currency/getFormattedCurrency.js"),z=require("./inventory/isDetailedProductOutOfStock.js"),J=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=t;exports.generateId=r;exports.getListOutletOpeningHoursTable=i;exports.getOutletTagInformation=n.default;exports.getOutletAvailabilityInfo=o.default;exports.getOutletOfflineOrderFormats=u;exports.getOutletAvailableOrderFormats=s;exports.getOutletFormattedDistance=a;exports.isOutletAcceptingPreOrders=c;exports.getOutletDeliveryFee=l;exports.getOutletTodayOpeningTimes=g;exports.getOutletOrderFormats=d;exports.serviceDateTimesFromOpeningHours=q;exports.isVersionALessThanB=O;exports.cleanVersionString=_;exports.getUrlAndParams=m;exports.getEndpointWithVersion=k;exports.generateBackoffWithEqualJitter=f;exports.slugify=h;exports.truncate=y;exports.lighten=p;exports.brighten=P;exports.darken=T;exports.isDarkBackground=F;exports.getFullName=v;exports.getFullAddressString=S;exports.Logger=D;exports.LogLevel=I.LogLevel;exports.sanitizeAsStringDict=b;exports.getPrinterType=A;exports.isValidPrinter=V;exports.isValidNetworkPrinter=C;exports.isValidStarCloudPrinter=L;exports.isTerminalPrinter=W;exports.randomIntFromInterval=B;exports.decodeTableQRPayload=N;exports.getCheckoutGroupedModifications=M;exports.getCheckoutProductName=E;exports.getCheckoutOrderStatusTexts=H;exports.isCheckoutOrderSummary=w;exports.getFormattedCurrency=x;exports.isDetailedProductOutOfStock=z;exports.isDetailedProductVariantOutOfStocks=J;exports.isMenuTreeProductOutOfStock=Q;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/enums.js"),t=require("./shared/isWithinFlag.js"),r=require("./shared/generateId.js"),i=require("./outlet/getListOutletOpeningHoursTable.js"),n=require("./outlet/getOutletTagInformation.js"),o=require("./outlet/getOutletAvailabilityInfo.js"),u=require("./outlet/getOutletOfflineOrderFormats.js"),s=require("./outlet/getOutletAvailableOrderFormats.js"),a=require("./outlet/getOutletFormattedDistance.js"),c=require("./outlet/isOutletAcceptingPreOrders.js"),l=require("./outlet/getOutletDeliveryFee.js"),g=require("./outlet/getOutletTodayOpeningTimes.js"),d=require("./outlet/getOutletOrderFormats.js"),q=require("./outlet/serviceDateTimesFromOpeningHours.js"),O=require("./versioning/isVersionALessThanB.js"),_=require("./versioning/cleanVersionString.js"),m=require("./api/getUrlAndParams.js"),k=require("./api/getEndpointWithVersion.js"),f=require("./api/generateBackoffWithEqualJitter.js"),h=require("./string/slugify.js"),y=require("./string/truncate.js"),p=require("./color/lighten.js"),P=require("./color/brighten.js"),T=require("./color/darken.js"),F=require("./color/isDarkBackground.js"),v=require("./user/getFullName.js"),S=require("./user/getFullAddressString.js"),D=require("./logger/Logger.js"),I=require("./logger/types.js"),b=require("./logger/sanitizeAsStringDict.js"),A=require("./printing/getPrinterType.js"),V=require("./printing/isValidPrinter.js"),C=require("./printing/isValidNetworkPrinter.js"),L=require("./printing/isValidStarCloudPrinter.js"),W=require("./printing/isTerminalPrinter.js"),B=require("./number/randomIntFromInterval.js"),N=require("./tables/decodeTableQRPayload.js"),M=require("./checkout/getCheckoutItemModifications.js"),E=require("./checkout/getCheckoutProductName.js"),H=require("./checkout/getCheckoutOrderStatusTexts.js"),w=require("./checkout/isCheckoutOrderSummary.js"),x=require("./currency/getFormattedCurrency.js"),z=require("./inventory/isDetailedProductOutOfStock.js"),J=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");require("./checkout/getCheckoutItemsMappedByTicketItemStatus.js");exports.DayOfWeek=e.DayOfWeek;exports.IntervalState=e.IntervalState;exports.IntervalType=e.IntervalType;exports.OrderFormat=e.OrderFormat;exports.isWithinFlag=t;exports.generateId=r;exports.getListOutletOpeningHoursTable=i;exports.getOutletTagInformation=n.default;exports.getOutletAvailabilityInfo=o.default;exports.getOutletOfflineOrderFormats=u;exports.getOutletAvailableOrderFormats=s;exports.getOutletFormattedDistance=a;exports.isOutletAcceptingPreOrders=c;exports.getOutletDeliveryFee=l;exports.getOutletTodayOpeningTimes=g;exports.getOutletOrderFormats=d;exports.serviceDateTimesFromOpeningHours=q;exports.isVersionALessThanB=O;exports.cleanVersionString=_;exports.getUrlAndParams=m;exports.getEndpointWithVersion=k;exports.generateBackoffWithEqualJitter=f;exports.slugify=h;exports.truncate=y;exports.lighten=p;exports.brighten=P;exports.darken=T;exports.isDarkBackground=F;exports.getFullName=v;exports.getFullAddressString=S;exports.Logger=D;exports.LogLevel=I.LogLevel;exports.sanitizeAsStringDict=b;exports.getPrinterType=A;exports.isValidPrinter=V;exports.isValidNetworkPrinter=C;exports.isValidStarCloudPrinter=L;exports.isTerminalPrinter=W;exports.randomIntFromInterval=B;exports.decodeTableQRPayload=N;exports.getCheckoutGroupedModifications=M;exports.getCheckoutProductName=E;exports.getCheckoutOrderStatusTexts=H;exports.isCheckoutOrderSummary=w;exports.getFormattedCurrency=x;exports.isDetailedProductOutOfStock=z;exports.isDetailedProductVariantOutOfStocks=J;exports.isMenuTreeProductOutOfStock=Q;
|
package/index.mjs
CHANGED
|
@@ -1,48 +1,48 @@
|
|
|
1
|
-
import { DayOfWeek as
|
|
2
|
-
import { default as
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as
|
|
8
|
-
import { default as
|
|
9
|
-
import { default as
|
|
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
|
|
34
|
-
import { default as
|
|
35
|
-
import { default as
|
|
36
|
-
import { default as
|
|
37
|
-
import { default as
|
|
38
|
-
import { default as
|
|
39
|
-
import { default as
|
|
40
|
-
import { default as
|
|
41
|
-
import { default as
|
|
42
|
-
import { default as
|
|
43
|
-
import { default as
|
|
44
|
-
import { default as
|
|
45
|
-
import { default as
|
|
1
|
+
import { DayOfWeek as g, IntervalState as O, IntervalType as c, OrderFormat as k } from "./shared/enums.mjs";
|
|
2
|
+
import { default as P } from "./shared/isWithinFlag.mjs";
|
|
3
|
+
import { default as h } from "./shared/generateId.mjs";
|
|
4
|
+
import { default as S } from "./outlet/getListOutletOpeningHoursTable.mjs";
|
|
5
|
+
import { default as D } from "./outlet/getOutletTagInformation.mjs";
|
|
6
|
+
import { default as I } from "./outlet/getOutletAvailabilityInfo.mjs";
|
|
7
|
+
import { default as C } from "./outlet/getOutletOfflineOrderFormats.mjs";
|
|
8
|
+
import { default as L } from "./outlet/getOutletAvailableOrderFormats.mjs";
|
|
9
|
+
import { default as B } from "./outlet/getOutletFormattedDistance.mjs";
|
|
10
|
+
import { default as E } from "./outlet/isOutletAcceptingPreOrders.mjs";
|
|
11
|
+
import { default as M } from "./outlet/getOutletDeliveryFee.mjs";
|
|
12
|
+
import { default as w } from "./outlet/getOutletTodayOpeningTimes.mjs";
|
|
13
|
+
import { default as G } from "./outlet/getOutletOrderFormats.mjs";
|
|
14
|
+
import { default as Q } from "./outlet/serviceDateTimesFromOpeningHours.mjs";
|
|
15
|
+
import { default as U } from "./versioning/isVersionALessThanB.mjs";
|
|
16
|
+
import { default as K } from "./versioning/cleanVersionString.mjs";
|
|
17
|
+
import { default as Y } from "./api/getUrlAndParams.mjs";
|
|
18
|
+
import { default as _ } from "./api/getEndpointWithVersion.mjs";
|
|
19
|
+
import { default as tt } from "./api/generateBackoffWithEqualJitter.mjs";
|
|
20
|
+
import { default as rt } from "./string/slugify.mjs";
|
|
21
|
+
import { default as at } from "./string/truncate.mjs";
|
|
22
|
+
import { default as lt } from "./color/lighten.mjs";
|
|
23
|
+
import { default as ut } from "./color/brighten.mjs";
|
|
24
|
+
import { default as mt } from "./color/darken.mjs";
|
|
25
|
+
import { default as pt } from "./color/isDarkBackground.mjs";
|
|
26
|
+
import { default as xt } from "./user/getFullName.mjs";
|
|
27
|
+
import { default as Ot } from "./user/getFullAddressString.mjs";
|
|
28
|
+
import { default as kt } from "./logger/Logger.mjs";
|
|
29
|
+
import { LogLevel as Pt } from "./logger/types.mjs";
|
|
30
|
+
import { default as ht } from "./logger/sanitizeAsStringDict.mjs";
|
|
31
|
+
import { default as St } from "./printing/getPrinterType.mjs";
|
|
32
|
+
import { default as Dt } from "./printing/isValidPrinter.mjs";
|
|
33
|
+
import { default as It } from "./printing/isValidNetworkPrinter.mjs";
|
|
34
|
+
import { default as Ct } from "./printing/isValidStarCloudPrinter.mjs";
|
|
35
|
+
import { default as Lt } from "./printing/isTerminalPrinter.mjs";
|
|
36
|
+
import { default as Bt } from "./number/randomIntFromInterval.mjs";
|
|
37
|
+
import { default as Et } from "./tables/decodeTableQRPayload.mjs";
|
|
38
|
+
import { default as Mt } from "./checkout/getCheckoutItemModifications.mjs";
|
|
39
|
+
import { default as wt } from "./checkout/getCheckoutProductName.mjs";
|
|
40
|
+
import { default as Gt } from "./checkout/getCheckoutOrderStatusTexts.mjs";
|
|
41
|
+
import { default as Qt } from "./checkout/isCheckoutOrderSummary.mjs";
|
|
42
|
+
import { default as Ut } from "./currency/getFormattedCurrency.mjs";
|
|
43
|
+
import { default as Kt } from "./inventory/isDetailedProductOutOfStock.mjs";
|
|
44
|
+
import { default as Yt } from "./inventory/isDetailedProductVariantOutOfStocks.mjs";
|
|
45
|
+
import { default as _t } from "./inventory/isMenuTreeProductOutOfStock.mjs";
|
|
46
46
|
import "moment";
|
|
47
47
|
import "@ancon/wildcat-types";
|
|
48
48
|
import "./outlet/types.mjs";
|
|
@@ -55,53 +55,54 @@ import "compare-versions";
|
|
|
55
55
|
import "tinycolor2";
|
|
56
56
|
import "@ancon/wildcat-printing";
|
|
57
57
|
import "./currency/getFormattedCurrencyPostfix.mjs";
|
|
58
|
+
import "./checkout/getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
58
59
|
export {
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
60
|
+
g as DayOfWeek,
|
|
61
|
+
O as IntervalState,
|
|
62
|
+
c as IntervalType,
|
|
63
|
+
Pt as LogLevel,
|
|
64
|
+
kt as Logger,
|
|
65
|
+
k as OrderFormat,
|
|
66
|
+
ut as brighten,
|
|
67
|
+
K as cleanVersionString,
|
|
68
|
+
mt as darken,
|
|
69
|
+
Et as decodeTableQRPayload,
|
|
70
|
+
tt as generateBackoffWithEqualJitter,
|
|
71
|
+
h as generateId,
|
|
72
|
+
Mt as getCheckoutGroupedModifications,
|
|
73
|
+
Gt as getCheckoutOrderStatusTexts,
|
|
74
|
+
wt as getCheckoutProductName,
|
|
75
|
+
_ as getEndpointWithVersion,
|
|
76
|
+
Ut as getFormattedCurrency,
|
|
77
|
+
Ot as getFullAddressString,
|
|
78
|
+
xt as getFullName,
|
|
79
|
+
S as getListOutletOpeningHoursTable,
|
|
80
|
+
I as getOutletAvailabilityInfo,
|
|
81
|
+
L as getOutletAvailableOrderFormats,
|
|
82
|
+
M as getOutletDeliveryFee,
|
|
83
|
+
B as getOutletFormattedDistance,
|
|
84
|
+
C as getOutletOfflineOrderFormats,
|
|
85
|
+
G as getOutletOrderFormats,
|
|
86
|
+
D as getOutletTagInformation,
|
|
87
|
+
w as getOutletTodayOpeningTimes,
|
|
88
|
+
St as getPrinterType,
|
|
89
|
+
Y as getUrlAndParams,
|
|
90
|
+
Qt as isCheckoutOrderSummary,
|
|
91
|
+
pt as isDarkBackground,
|
|
92
|
+
Kt as isDetailedProductOutOfStock,
|
|
93
|
+
Yt as isDetailedProductVariantOutOfStocks,
|
|
94
|
+
_t as isMenuTreeProductOutOfStock,
|
|
95
|
+
E as isOutletAcceptingPreOrders,
|
|
96
|
+
Lt as isTerminalPrinter,
|
|
97
|
+
It as isValidNetworkPrinter,
|
|
98
|
+
Dt as isValidPrinter,
|
|
99
|
+
Ct as isValidStarCloudPrinter,
|
|
100
|
+
U as isVersionALessThanB,
|
|
101
|
+
P as isWithinFlag,
|
|
102
|
+
lt as lighten,
|
|
103
|
+
Bt as randomIntFromInterval,
|
|
104
|
+
ht as sanitizeAsStringDict,
|
|
105
|
+
Q as serviceDateTimesFromOpeningHours,
|
|
106
|
+
rt as slugify,
|
|
107
|
+
at as truncate
|
|
107
108
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancon/wildcat-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.20.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -31,6 +31,11 @@
|
|
|
31
31
|
"require": "./checkout/getCheckoutItemModifications.js",
|
|
32
32
|
"types": "./checkout/getCheckoutItemModifications.d.ts"
|
|
33
33
|
},
|
|
34
|
+
"./checkout/getCheckoutItemsMappedByTicketItemStatus": {
|
|
35
|
+
"import": "./checkout/getCheckoutItemsMappedByTicketItemStatus.mjs",
|
|
36
|
+
"require": "./checkout/getCheckoutItemsMappedByTicketItemStatus.js",
|
|
37
|
+
"types": "./checkout/getCheckoutItemsMappedByTicketItemStatus.d.ts"
|
|
38
|
+
},
|
|
34
39
|
"./checkout/getCheckoutOrderStatusTexts": {
|
|
35
40
|
"import": "./checkout/getCheckoutOrderStatusTexts.mjs",
|
|
36
41
|
"require": "./checkout/getCheckoutOrderStatusTexts.js",
|