@ancon/wildcat-utils 1.17.1 → 1.17.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/index.js +1 -1
- package/index.mjs +74 -55
- package/outlet/constants.d.ts +5 -0
- package/outlet/constants.js +1 -0
- package/outlet/constants.mjs +13 -0
- package/outlet/getMomentFromDateAndTimeString.d.ts +3 -0
- package/outlet/getMomentFromDateAndTimeString.js +1 -0
- package/outlet/getMomentFromDateAndTimeString.mjs +17 -0
- package/outlet/getOutletAvailabilityInfo.d.ts +14 -0
- package/outlet/getOutletAvailabilityInfo.js +1 -0
- package/outlet/getOutletAvailabilityInfo.mjs +39 -0
- package/outlet/getOutletAvailableOrderFormats.d.ts +7 -0
- package/outlet/getOutletAvailableOrderFormats.js +1 -0
- package/outlet/getOutletAvailableOrderFormats.mjs +8 -0
- package/outlet/getOutletCurrentActiveOperatingHour.d.ts +5 -0
- package/outlet/getOutletCurrentActiveOperatingHour.js +1 -0
- package/outlet/getOutletCurrentActiveOperatingHour.mjs +28 -0
- package/outlet/getOutletDeliveryFee.d.ts +3 -0
- package/outlet/getOutletDeliveryFee.js +1 -0
- package/outlet/getOutletDeliveryFee.mjs +9 -0
- package/outlet/getOutletFormattedDistance.d.ts +8 -0
- package/outlet/getOutletFormattedDistance.js +1 -0
- package/outlet/getOutletFormattedDistance.mjs +10 -0
- package/outlet/getOutletOfflineOrderFormats.d.ts +3 -0
- package/outlet/getOutletOfflineOrderFormats.js +1 -0
- package/outlet/getOutletOfflineOrderFormats.mjs +14 -0
- package/outlet/getOutletTagInformation.d.ts +16 -0
- package/outlet/getOutletTagInformation.js +1 -0
- package/outlet/getOutletTagInformation.mjs +114 -0
- package/outlet/index.d.ts +8 -1
- package/outlet/index.js +1 -1
- package/outlet/index.mjs +21 -2
- package/outlet/isOutletAcceptingPreOrders.d.ts +3 -0
- package/outlet/isOutletAcceptingPreOrders.js +1 -0
- package/outlet/isOutletAcceptingPreOrders.mjs +8 -0
- package/outlet/searchNextOpeningMoment.d.ts +13 -0
- package/outlet/searchNextOpeningMoment.js +1 -0
- package/outlet/searchNextOpeningMoment.mjs +74 -0
- package/outlet/types.d.ts +22 -1
- package/outlet/types.js +1 -1
- package/outlet/types.mjs +4 -1
- package/package.json +56 -1
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"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./shared/enums.js"),r=require("./shared/isWithinFlag.js"),t=require("./shared/generateId.js"),i=require("./outlet/getListOutletOpeningHoursTable.js"),n=require("./outlet/getOutletTagInformation.js"),o=require("./outlet/getOutletAvailabilityInfo.js"),s=require("./outlet/getOutletOfflineOrderFormats.js"),u=require("./outlet/getOutletAvailableOrderFormats.js"),l=require("./outlet/getOutletFormattedDistance.js"),a=require("./outlet/isOutletAcceptingPreOrders.js"),g=require("./outlet/getOutletDeliveryFee.js"),c=require("./versioning/isVersionALessThanB.js"),q=require("./versioning/cleanVersionString.js"),d=require("./api/getUrlAndParams.js"),_=require("./api/getEndpointWithVersion.js"),O=require("./api/generateBackoffWithEqualJitter.js"),m=require("./string/slugify.js"),p=require("./string/truncate.js"),f=require("./color/lighten.js"),F=require("./color/brighten.js"),v=require("./color/darken.js"),h=require("./color/isDarkBackground.js"),y=require("./user/getFullName.js"),P=require("./user/getFullAddressString.js"),A=require("./logger/Logger.js"),I=require("./logger/types.js"),T=require("./logger/sanitizeAsStringDict.js"),k=require("./printing/getPrinterType.js"),S=require("./printing/isValidPrinter.js"),V=require("./printing/isValidNetworkPrinter.js"),b=require("./printing/isValidStarCloudPrinter.js"),D=require("./printing/isTerminalPrinter.js"),L=require("./number/randomIntFromInterval.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("compare-versions");require("tinycolor2");require("@ancon/wildcat-printing");exports.DayOfWeek=e.DayOfWeek;exports.IntervalState=e.IntervalState;exports.IntervalType=e.IntervalType;exports.OrderFormat=e.OrderFormat;exports.isWithinFlag=r;exports.generateId=t;exports.getListOutletOpeningHoursTable=i;exports.getOutletTagInformation=n.default;exports.getOutletAvailabilityInfo=o.default;exports.getOutletOfflineOrderFormats=s;exports.getOutletAvailableOrderFormats=u;exports.getOutletFormattedDistance=l;exports.isOutletAcceptingPreOrders=a;exports.getOutletDeliveryFee=g;exports.isVersionALessThanB=c;exports.cleanVersionString=q;exports.getUrlAndParams=d;exports.getEndpointWithVersion=_;exports.generateBackoffWithEqualJitter=O;exports.slugify=m;exports.truncate=p;exports.lighten=f;exports.brighten=F;exports.darken=v;exports.isDarkBackground=h;exports.getFullName=y;exports.getFullAddressString=P;exports.Logger=A;exports.LogLevel=I.LogLevel;exports.sanitizeAsStringDict=T;exports.getPrinterType=k;exports.isValidPrinter=S;exports.isValidNetworkPrinter=V;exports.isValidStarCloudPrinter=b;exports.isTerminalPrinter=D;exports.randomIntFromInterval=L;
|
package/index.mjs
CHANGED
|
@@ -1,62 +1,81 @@
|
|
|
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 {
|
|
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 {
|
|
1
|
+
import { DayOfWeek as u, IntervalState as n, IntervalType as x, OrderFormat as g } from "./shared/enums.mjs";
|
|
2
|
+
import { default as F } from "./shared/isWithinFlag.mjs";
|
|
3
|
+
import { default as v } from "./shared/generateId.mjs";
|
|
4
|
+
import { default as I } from "./outlet/getListOutletOpeningHoursTable.mjs";
|
|
5
|
+
import { default as h } from "./outlet/getOutletTagInformation.mjs";
|
|
6
|
+
import { default as y } from "./outlet/getOutletAvailabilityInfo.mjs";
|
|
7
|
+
import { default as V } 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 B } from "./outlet/isOutletAcceptingPreOrders.mjs";
|
|
11
|
+
import { default as N } from "./outlet/getOutletDeliveryFee.mjs";
|
|
12
|
+
import { default as w } from "./versioning/isVersionALessThanB.mjs";
|
|
13
|
+
import { default as C } from "./versioning/cleanVersionString.mjs";
|
|
14
|
+
import { default as J } from "./api/getUrlAndParams.mjs";
|
|
15
|
+
import { default as j } from "./api/getEndpointWithVersion.mjs";
|
|
16
|
+
import { default as K } from "./api/generateBackoffWithEqualJitter.mjs";
|
|
17
|
+
import { default as Q } from "./string/slugify.mjs";
|
|
18
|
+
import { default as X } from "./string/truncate.mjs";
|
|
19
|
+
import { default as Z } from "./color/lighten.mjs";
|
|
20
|
+
import { default as $ } from "./color/brighten.mjs";
|
|
21
|
+
import { default as et } from "./color/darken.mjs";
|
|
22
|
+
import { default as at } from "./color/isDarkBackground.mjs";
|
|
23
|
+
import { default as ft } from "./user/getFullName.mjs";
|
|
24
|
+
import { default as it } from "./user/getFullAddressString.mjs";
|
|
25
|
+
import { default as mt } from "./logger/Logger.mjs";
|
|
26
|
+
import { LogLevel as pt } from "./logger/types.mjs";
|
|
27
|
+
import { default as nt } from "./logger/sanitizeAsStringDict.mjs";
|
|
28
|
+
import { default as gt } from "./printing/getPrinterType.mjs";
|
|
29
|
+
import { default as Ft } from "./printing/isValidPrinter.mjs";
|
|
30
|
+
import { default as vt } from "./printing/isValidNetworkPrinter.mjs";
|
|
31
|
+
import { default as It } from "./printing/isValidStarCloudPrinter.mjs";
|
|
32
|
+
import { default as ht } from "./printing/isTerminalPrinter.mjs";
|
|
33
|
+
import { default as yt } from "./number/randomIntFromInterval.mjs";
|
|
27
34
|
import "moment";
|
|
28
35
|
import "@ancon/wildcat-types";
|
|
36
|
+
import "./outlet/types.mjs";
|
|
37
|
+
import "./outlet/constants.mjs";
|
|
38
|
+
import "./outlet/getOutletCurrentActiveOperatingHour.mjs";
|
|
39
|
+
import "./outlet/getMomentFromDateAndTimeString.mjs";
|
|
40
|
+
import "./outlet/searchNextOpeningMoment.mjs";
|
|
29
41
|
import "compare-versions";
|
|
30
42
|
import "tinycolor2";
|
|
31
43
|
import "@ancon/wildcat-printing";
|
|
32
44
|
export {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
45
|
+
u as DayOfWeek,
|
|
46
|
+
n as IntervalState,
|
|
47
|
+
x as IntervalType,
|
|
48
|
+
pt as LogLevel,
|
|
49
|
+
mt as Logger,
|
|
50
|
+
g as OrderFormat,
|
|
51
|
+
$ as brighten,
|
|
52
|
+
C as cleanVersionString,
|
|
53
|
+
et as darken,
|
|
54
|
+
K as generateBackoffWithEqualJitter,
|
|
55
|
+
v as generateId,
|
|
56
|
+
j as getEndpointWithVersion,
|
|
57
|
+
it as getFullAddressString,
|
|
58
|
+
ft as getFullName,
|
|
59
|
+
I as getListOutletOpeningHoursTable,
|
|
60
|
+
y as getOutletAvailabilityInfo,
|
|
61
|
+
L as getOutletAvailableOrderFormats,
|
|
62
|
+
N as getOutletDeliveryFee,
|
|
63
|
+
b as getOutletFormattedDistance,
|
|
64
|
+
V as getOutletOfflineOrderFormats,
|
|
65
|
+
h as getOutletTagInformation,
|
|
66
|
+
gt as getPrinterType,
|
|
67
|
+
J as getUrlAndParams,
|
|
68
|
+
at as isDarkBackground,
|
|
69
|
+
B as isOutletAcceptingPreOrders,
|
|
70
|
+
ht as isTerminalPrinter,
|
|
71
|
+
vt as isValidNetworkPrinter,
|
|
72
|
+
Ft as isValidPrinter,
|
|
73
|
+
It as isValidStarCloudPrinter,
|
|
74
|
+
w as isVersionALessThanB,
|
|
75
|
+
F as isWithinFlag,
|
|
76
|
+
Z as lighten,
|
|
77
|
+
yt as randomIntFromInterval,
|
|
78
|
+
nt as sanitizeAsStringDict,
|
|
79
|
+
Q as slugify,
|
|
80
|
+
X as truncate
|
|
62
81
|
};
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { OrderFormat } from '@ancon/wildcat-types';
|
|
2
|
+
export declare const OnlineOrderFormatsArray: OrderFormat[];
|
|
3
|
+
export declare const OutletMapKeyFormatter = "YYYY-MM-DD";
|
|
4
|
+
export declare const OutletTimelineDayCount = 7;
|
|
5
|
+
export declare const OutletClosingLabelThreshold = 60;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("@ancon/wildcat-types"),r=[e.OrderFormat.EatIn,e.OrderFormat.TakeAway,e.OrderFormat.Delivery,e.OrderFormat.TableOrder],t="YYYY-MM-DD",a=7,o=60;exports.OnlineOrderFormatsArray=r;exports.OutletClosingLabelThreshold=o;exports.OutletMapKeyFormatter=t;exports.OutletTimelineDayCount=a;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { OrderFormat as e } from "@ancon/wildcat-types";
|
|
2
|
+
const r = [
|
|
3
|
+
e.EatIn,
|
|
4
|
+
e.TakeAway,
|
|
5
|
+
e.Delivery,
|
|
6
|
+
e.TableOrder
|
|
7
|
+
], o = "YYYY-MM-DD", a = 7, l = 60;
|
|
8
|
+
export {
|
|
9
|
+
r as OnlineOrderFormatsArray,
|
|
10
|
+
l as OutletClosingLabelThreshold,
|
|
11
|
+
o as OutletMapKeyFormatter,
|
|
12
|
+
a as OutletTimelineDayCount
|
|
13
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const u=require("moment");function m(t){const[e,r,n]=t.split(":");return u().utc(!1).startOf("day").set({hour:Number(e),minute:Number(r),second:Number(n),millisecond:0})}function s(t,e){const[r,n,o]=t.split("-");return m(e).year(Number(r)).month(Number(n)-1).date(Number(o))}module.exports=s;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import o from "moment";
|
|
2
|
+
function u(t) {
|
|
3
|
+
const [e, r, n] = t.split(":");
|
|
4
|
+
return o().utc(!1).startOf("day").set({
|
|
5
|
+
hour: Number(e),
|
|
6
|
+
minute: Number(r),
|
|
7
|
+
second: Number(n),
|
|
8
|
+
millisecond: 0
|
|
9
|
+
});
|
|
10
|
+
}
|
|
11
|
+
function a(t, e) {
|
|
12
|
+
const [r, n, m] = t.split("-");
|
|
13
|
+
return u(e).year(Number(r)).month(Number(n) - 1).date(Number(m));
|
|
14
|
+
}
|
|
15
|
+
export {
|
|
16
|
+
a as default
|
|
17
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Moment } from 'moment';
|
|
2
|
+
import { OutletState } from '@ancon/wildcat-types';
|
|
3
|
+
import { OutletTagInformation } from './types';
|
|
4
|
+
export declare enum OutletAvailabilityDay {
|
|
5
|
+
Today = 0,
|
|
6
|
+
Tomorrow = 1
|
|
7
|
+
}
|
|
8
|
+
export declare type OutletAvailability = {
|
|
9
|
+
time: string;
|
|
10
|
+
state: OutletState;
|
|
11
|
+
day?: OutletAvailabilityDay;
|
|
12
|
+
};
|
|
13
|
+
declare function getOutletAvailabilityInfo(tagInformation: OutletTagInformation, nowMoment: Moment, overrideShowLabelAlways?: boolean): OutletAvailability | null;
|
|
14
|
+
export default getOutletAvailabilityInfo;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const f=require("moment"),l=require("@ancon/wildcat-types"),r=60;var c=(e=>(e[e.Today=0]="Today",e[e.Tomorrow=1]="Tomorrow",e))(c||{});function o(e,t,d=!1){let s=null;if(e.openNow&&e.closingTime!==null)(e.closingTime.diff(t,"minutes")<r||d)&&(s={time:e.closingTime.utcOffset(t.utcOffset()).format("LT"),state:l.OutletState.Closed});else if(!e.openNow&&e.openingTime)if(e.openingTime.isSame(t,"d"))s={time:f(e.openingTime).utcOffset(t.utcOffset()).calendar(),state:l.OutletState.Open};else{const u=f().add(1,"day").utcOffset(t.utcOffset()),i=f(e.openingTime).utcOffset(t.utcOffset());i.isSame(u,"d")?s={time:i.format("LT"),state:l.OutletState.Open,day:1}:i.isAfter(t.clone().add(1,"week"))?s={time:i.format("D MMMM LT"),state:l.OutletState.Open}:i&&(s={time:i.format("ddd LT"),state:l.OutletState.Open})}return s}exports.OutletAvailabilityDay=c;exports.default=o;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import d from "moment";
|
|
2
|
+
import { OutletState as i } from "@ancon/wildcat-types";
|
|
3
|
+
const l = 60;
|
|
4
|
+
var o = /* @__PURE__ */ ((e) => (e[e.Today = 0] = "Today", e[e.Tomorrow = 1] = "Tomorrow", e))(o || {});
|
|
5
|
+
function T(e, t, m = !1) {
|
|
6
|
+
let s = null;
|
|
7
|
+
if (e.openNow && e.closingTime !== null)
|
|
8
|
+
(e.closingTime.diff(t, "minutes") < l || m) && (s = {
|
|
9
|
+
time: e.closingTime.utcOffset(t.utcOffset()).format("LT"),
|
|
10
|
+
state: i.Closed
|
|
11
|
+
});
|
|
12
|
+
else if (!e.openNow && e.openingTime)
|
|
13
|
+
if (e.openingTime.isSame(t, "d"))
|
|
14
|
+
s = {
|
|
15
|
+
time: d(e.openingTime).utcOffset(t.utcOffset()).calendar(),
|
|
16
|
+
state: i.Open
|
|
17
|
+
};
|
|
18
|
+
else {
|
|
19
|
+
const c = d().add(1, "day").utcOffset(t.utcOffset()), f = d(e.openingTime).utcOffset(
|
|
20
|
+
t.utcOffset()
|
|
21
|
+
);
|
|
22
|
+
f.isSame(c, "d") ? s = {
|
|
23
|
+
time: f.format("LT"),
|
|
24
|
+
state: i.Open,
|
|
25
|
+
day: 1
|
|
26
|
+
} : f.isAfter(t.clone().add(1, "week")) ? s = {
|
|
27
|
+
time: f.format("D MMMM LT"),
|
|
28
|
+
state: i.Open
|
|
29
|
+
} : f && (s = {
|
|
30
|
+
time: f.format("ddd LT"),
|
|
31
|
+
state: i.Open
|
|
32
|
+
});
|
|
33
|
+
}
|
|
34
|
+
return s;
|
|
35
|
+
}
|
|
36
|
+
export {
|
|
37
|
+
o as OutletAvailabilityDay,
|
|
38
|
+
T as default
|
|
39
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Takes an order format flag an returns all the included order formats
|
|
3
|
+
* @param {number} orderFormat - flag of orderFormat
|
|
4
|
+
* @returns {array} - Returns an array with all the orderFormats
|
|
5
|
+
*/
|
|
6
|
+
declare function getOutletAvailableOrderFormats(orderFormat: number): import("@ancon/wildcat-types").OrderFormat[];
|
|
7
|
+
export default getOutletAvailableOrderFormats;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const e=require("./constants.js");require("@ancon/wildcat-types");function n(r){return e.OnlineOrderFormatsArray.filter(t=>(t&r)!==0)}module.exports=n;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Moment } from 'moment';
|
|
2
|
+
import { ServiceDateTimeInterval } from '@ancon/wildcat-types';
|
|
3
|
+
import { OperatingHourMappedValue } from './types';
|
|
4
|
+
declare function getOutletCurrentActiveOperatingHour(dateKey: string, mappedOperatingHours: OperatingHourMappedValue, relevantMoment: Moment): ServiceDateTimeInterval | null;
|
|
5
|
+
export default getOutletCurrentActiveOperatingHour;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const a=require("@ancon/wildcat-types"),l=require("./getMomentFromDateAndTimeString.js");require("moment");function m(s,e,u){if(e.exception){const{exception:t}=e;if(t.type===a.OutletState.Open){const[n,r]=t.duration.split(":").map(Number),i=l(s,t.start),o=i.clone().add(n,"hours").add(r,"minutes");if(u.isBetween(i,o))return e.exception}}else for(let t=0;t<e.intervals.length;t+=1){const n=e.intervals[t],[r,i]=n.duration.split(":").map(Number),o=l(s,n.start),c=o.clone().add(r,"hours").add(i,"minutes");if(u.isBetween(o,c))return n}return null}module.exports=m;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { OutletState as m } from "@ancon/wildcat-types";
|
|
2
|
+
import u from "./getMomentFromDateAndTimeString.mjs";
|
|
3
|
+
import "moment";
|
|
4
|
+
function v(s, n, l) {
|
|
5
|
+
if (n.exception) {
|
|
6
|
+
const { exception: t } = n;
|
|
7
|
+
if (t.type === m.Open) {
|
|
8
|
+
const [e, r] = t.duration.split(":").map(Number), i = u(
|
|
9
|
+
s,
|
|
10
|
+
t.start
|
|
11
|
+
), o = i.clone().add(e, "hours").add(r, "minutes");
|
|
12
|
+
if (l.isBetween(i, o))
|
|
13
|
+
return n.exception;
|
|
14
|
+
}
|
|
15
|
+
} else
|
|
16
|
+
for (let t = 0; t < n.intervals.length; t += 1) {
|
|
17
|
+
const e = n.intervals[t], [r, i] = e.duration.split(":").map(Number), o = u(
|
|
18
|
+
s,
|
|
19
|
+
e.start
|
|
20
|
+
), c = o.clone().add(r, "hours").add(i, "minutes");
|
|
21
|
+
if (l.isBetween(o, c))
|
|
22
|
+
return e;
|
|
23
|
+
}
|
|
24
|
+
return null;
|
|
25
|
+
}
|
|
26
|
+
export {
|
|
27
|
+
v as default
|
|
28
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("@ancon/wildcat-types");function i(e){return e?e.find(t=>(t.type&r.OrderFormat.Delivery)===r.OrderFormat.Delivery):null}module.exports=i;
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Formats the distance number obtained from API,to a displayable string
|
|
3
|
+
* @param {number} distanceInMetres The numeric distance value
|
|
4
|
+
*
|
|
5
|
+
* @return {string} Formatted distance string
|
|
6
|
+
*/
|
|
7
|
+
declare function getOutletFormattedDistance(distanceInMetres?: number): string;
|
|
8
|
+
export default getOutletFormattedDistance;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function o(m=0){if(m>1e3){const u=m/1e3;return Number.isInteger(u)?`${m} m`:`${m.toFixed(2)} km`}return Number.isInteger(m)?`${m} m`:`${m.toFixed(2)} m`}module.exports=o;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("./getOutletAvailableOrderFormats.js");require("./constants.js");require("@ancon/wildcat-types");function o(u,s){const i=n(u);return s.reduce((r,t)=>(t.acceptingPreOrders&&i.forEach(e=>{(t.orderFormat&e)===e&&(r.includes(e)||r.push(e))}),r),[])}module.exports=o;
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import u from "./getOutletAvailableOrderFormats.mjs";
|
|
2
|
+
import "./constants.mjs";
|
|
3
|
+
import "@ancon/wildcat-types";
|
|
4
|
+
function d(o, f) {
|
|
5
|
+
const i = u(
|
|
6
|
+
o
|
|
7
|
+
);
|
|
8
|
+
return f.reduce((e, t) => (t.acceptingPreOrders && i.forEach((r) => {
|
|
9
|
+
(t.orderFormat & r) === r && (e.includes(r) || e.push(r));
|
|
10
|
+
}), e), []);
|
|
11
|
+
}
|
|
12
|
+
export {
|
|
13
|
+
d as default
|
|
14
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ServiceDateTimeInterval } from '@ancon/wildcat-types';
|
|
2
|
+
import { Moment } from 'moment';
|
|
3
|
+
import { OutletTagInformation } from './types';
|
|
4
|
+
export declare const DaysOfWeekMap: {
|
|
5
|
+
0: number;
|
|
6
|
+
1: number;
|
|
7
|
+
2: number;
|
|
8
|
+
3: number;
|
|
9
|
+
4: number;
|
|
10
|
+
5: number;
|
|
11
|
+
6: number;
|
|
12
|
+
7: number;
|
|
13
|
+
};
|
|
14
|
+
declare function getOutletTagInformation(operatingHours: ServiceDateTimeInterval[], open: boolean, // Derived by the `state` given by the server
|
|
15
|
+
specificTime: Moment, currentTime: Moment): OutletTagInformation;
|
|
16
|
+
export default getOutletTagInformation;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperties(exports,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}});const u=require("moment"),x=require("./types.js"),d=require("./constants.js"),D=require("./getOutletCurrentActiveOperatingHour.js"),g=require("./getMomentFromDateAndTimeString.js"),v=require("./searchNextOpeningMoment.js");require("@ancon/wildcat-types");const O={0:127,1:1,2:2,3:4,4:8,5:16,6:32,7:64};function k(n,e){const a=n.isSame(e,"d"),o={[e.format(d.OutletMapKeyFormatter)]:{intervals:[],exception:null,metadata:{dayOfWeek:O[e.isoWeekday()]}}};for(let r=a?1:0;r<d.OutletTimelineDayCount;r+=1){const s=u(n).add(r,"d");o[s.format(d.OutletMapKeyFormatter)]={intervals:[],exception:null,metadata:{dayOfWeek:O[s.isoWeekday()]}}}return o}function S(n,e){const a=u().utcOffset(),t=u(e.fromDate).utc(!1).subtract(a,"minutes"),o=u(e.toDate).utc(!1).subtract(a,"minutes");if(!t.isSame(o,"d"))Object.keys(n).forEach(s=>{const i=u(s);if(i.isSame(t,"d")||i.isSame(o,"d")||i.isBetween(t,o)){const c=n[s],l=c.exception?c.exception.position:0;e.position>l&&(c.exception=e)}});else{const s=t.format(d.OutletMapKeyFormatter),i=n[s];if(i){const m=i.exception?i.exception.position:0;e.position>m&&(i.exception=e)}}}function W(n,e){Object.keys(n).forEach(a=>{const t=n[a],{dayOfWeek:o}=t.metadata,{dayOfWeek:r}=e;(o&r)===o&&t.intervals.push(e)})}function E(n,e,a){const t=k(e,a);return n.forEach(o=>{o.type===x.OperatingHourType.Exception?S(t,o):W(t,o)}),t}function M(n,e,a,t){const o=E(n,a,t),r=t.format(d.OutletMapKeyFormatter),s=D(r,o[r],t)!==null,i=e;let m=null,c=null;if(e){const l=a.format(d.OutletMapKeyFormatter),p=D(l,o[l],a);if(p){const[f,y]=p.duration.split(":").map(Number);c=g(l,p.start),m=c.clone().add(f,"hours").add(y,"minutes")}}else c=v(o,a);if(!e&&!c){const l=n.filter(f=>f.state&&u(f.toDate).isAfter(a)),[p]=l.sort((f,y)=>t.valueOf()-(u(f.toDate).valueOf()-u(y.toDate).valueOf()));if(p)return M(n,e,u(p.toDate),t)}return{closingTime:m,openingTime:c,openDuringSpecifiedTime:i,openNow:s}}exports.DaysOfWeekMap=O;exports.default=M;
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import p from "moment";
|
|
2
|
+
import { OperatingHourType as x } from "./types.mjs";
|
|
3
|
+
import { OutletMapKeyFormatter as d, OutletTimelineDayCount as g } from "./constants.mjs";
|
|
4
|
+
import O from "./getOutletCurrentActiveOperatingHour.mjs";
|
|
5
|
+
import k from "./getMomentFromDateAndTimeString.mjs";
|
|
6
|
+
import v from "./searchNextOpeningMoment.mjs";
|
|
7
|
+
import "@ancon/wildcat-types";
|
|
8
|
+
const D = {
|
|
9
|
+
0: 127,
|
|
10
|
+
1: 1,
|
|
11
|
+
2: 2,
|
|
12
|
+
3: 4,
|
|
13
|
+
4: 8,
|
|
14
|
+
5: 16,
|
|
15
|
+
6: 32,
|
|
16
|
+
7: 64
|
|
17
|
+
};
|
|
18
|
+
function M(n, t) {
|
|
19
|
+
const a = n.isSame(t, "d"), o = {
|
|
20
|
+
[t.format(d)]: {
|
|
21
|
+
intervals: [],
|
|
22
|
+
exception: null,
|
|
23
|
+
metadata: { dayOfWeek: D[t.isoWeekday()] }
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
for (let r = a ? 1 : 0; r < g; r += 1) {
|
|
27
|
+
const s = p(n).add(r, "d");
|
|
28
|
+
o[s.format(d)] = {
|
|
29
|
+
intervals: [],
|
|
30
|
+
exception: null,
|
|
31
|
+
metadata: { dayOfWeek: D[s.isoWeekday()] }
|
|
32
|
+
};
|
|
33
|
+
}
|
|
34
|
+
return o;
|
|
35
|
+
}
|
|
36
|
+
function S(n, t) {
|
|
37
|
+
const a = p().utcOffset(), e = p(t.fromDate).utc(!1).subtract(a, "minutes"), o = p(t.toDate).utc(!1).subtract(a, "minutes");
|
|
38
|
+
if (!e.isSame(
|
|
39
|
+
o,
|
|
40
|
+
"d"
|
|
41
|
+
))
|
|
42
|
+
Object.keys(n).forEach((s) => {
|
|
43
|
+
const i = p(s);
|
|
44
|
+
if (i.isSame(e, "d") || i.isSame(o, "d") || i.isBetween(e, o)) {
|
|
45
|
+
const c = n[s], f = c.exception ? c.exception.position : 0;
|
|
46
|
+
t.position > f && (c.exception = t);
|
|
47
|
+
}
|
|
48
|
+
});
|
|
49
|
+
else {
|
|
50
|
+
const s = e.format(d), i = n[s];
|
|
51
|
+
if (i) {
|
|
52
|
+
const u = i.exception ? i.exception.position : 0;
|
|
53
|
+
t.position > u && (i.exception = t);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
function W(n, t) {
|
|
58
|
+
Object.keys(n).forEach((a) => {
|
|
59
|
+
const e = n[a], { dayOfWeek: o } = e.metadata, { dayOfWeek: r } = t;
|
|
60
|
+
(o & r) === o && e.intervals.push(t);
|
|
61
|
+
});
|
|
62
|
+
}
|
|
63
|
+
function E(n, t, a) {
|
|
64
|
+
const e = M(t, a);
|
|
65
|
+
return n.forEach((o) => {
|
|
66
|
+
o.type === x.Exception ? S(e, o) : W(e, o);
|
|
67
|
+
}), e;
|
|
68
|
+
}
|
|
69
|
+
function I(n, t, a, e) {
|
|
70
|
+
const o = E(
|
|
71
|
+
n,
|
|
72
|
+
a,
|
|
73
|
+
e
|
|
74
|
+
), r = e.format(d), s = O(
|
|
75
|
+
r,
|
|
76
|
+
o[r],
|
|
77
|
+
e
|
|
78
|
+
) !== null, i = t;
|
|
79
|
+
let u = null, c = null;
|
|
80
|
+
if (t) {
|
|
81
|
+
const f = a.format(d), l = O(
|
|
82
|
+
f,
|
|
83
|
+
o[f],
|
|
84
|
+
a
|
|
85
|
+
);
|
|
86
|
+
if (l) {
|
|
87
|
+
const [m, y] = l.duration.split(":").map(Number);
|
|
88
|
+
c = k(
|
|
89
|
+
f,
|
|
90
|
+
l.start
|
|
91
|
+
), u = c.clone().add(m, "hours").add(y, "minutes");
|
|
92
|
+
}
|
|
93
|
+
} else
|
|
94
|
+
c = v(o, a);
|
|
95
|
+
if (!t && !c) {
|
|
96
|
+
const f = n.filter(
|
|
97
|
+
(m) => m.state && p(m.toDate).isAfter(a)
|
|
98
|
+
), [l] = f.sort(
|
|
99
|
+
(m, y) => e.valueOf() - (p(m.toDate).valueOf() - p(y.toDate).valueOf())
|
|
100
|
+
);
|
|
101
|
+
if (l)
|
|
102
|
+
return I(
|
|
103
|
+
n,
|
|
104
|
+
t,
|
|
105
|
+
p(l.toDate),
|
|
106
|
+
e
|
|
107
|
+
);
|
|
108
|
+
}
|
|
109
|
+
return { closingTime: u, openingTime: c, openDuringSpecifiedTime: i, openNow: s };
|
|
110
|
+
}
|
|
111
|
+
export {
|
|
112
|
+
D as DaysOfWeekMap,
|
|
113
|
+
I as default
|
|
114
|
+
};
|
package/outlet/index.d.ts
CHANGED
|
@@ -1,2 +1,9 @@
|
|
|
1
1
|
import getListOutletOpeningHoursTable from './getListOutletOpeningHoursTable';
|
|
2
|
-
|
|
2
|
+
import getOutletTagInformation from './getOutletTagInformation';
|
|
3
|
+
import getOutletAvailabilityInfo from './getOutletAvailabilityInfo';
|
|
4
|
+
import getOutletOfflineOrderFormats from './getOutletOfflineOrderFormats';
|
|
5
|
+
import getOutletAvailableOrderFormats from './getOutletAvailableOrderFormats';
|
|
6
|
+
import getOutletFormattedDistance from './getOutletFormattedDistance';
|
|
7
|
+
import isOutletAcceptingPreOrders from './isOutletAcceptingPreOrders';
|
|
8
|
+
import getOutletDeliveryFee from './getOutletDeliveryFee';
|
|
9
|
+
export { getListOutletOpeningHoursTable, getOutletTagInformation, getOutletAvailabilityInfo, getOutletOfflineOrderFormats, getOutletAvailableOrderFormats, getOutletFormattedDistance, isOutletAcceptingPreOrders, getOutletDeliveryFee, };
|
package/outlet/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getListOutletOpeningHoursTable.js");require("moment");require("@ancon/wildcat-types");require("../shared/enums.js");require("../shared/isWithinFlag.js");require("../shared/generateId.js");exports.getListOutletOpeningHoursTable=e;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getListOutletOpeningHoursTable.js"),t=require("./getOutletTagInformation.js"),r=require("./getOutletAvailabilityInfo.js"),u=require("./getOutletOfflineOrderFormats.js"),i=require("./getOutletAvailableOrderFormats.js"),l=require("./getOutletFormattedDistance.js"),o=require("./isOutletAcceptingPreOrders.js"),O=require("./getOutletDeliveryFee.js");require("moment");require("@ancon/wildcat-types");require("../shared/enums.js");require("../shared/isWithinFlag.js");require("../shared/generateId.js");require("./types.js");require("./constants.js");require("./getOutletCurrentActiveOperatingHour.js");require("./getMomentFromDateAndTimeString.js");require("./searchNextOpeningMoment.js");exports.getListOutletOpeningHoursTable=e;exports.getOutletTagInformation=t.default;exports.getOutletAvailabilityInfo=r.default;exports.getOutletOfflineOrderFormats=u;exports.getOutletAvailableOrderFormats=i;exports.getOutletFormattedDistance=l;exports.isOutletAcceptingPreOrders=o;exports.getOutletDeliveryFee=O;
|
package/outlet/index.mjs
CHANGED
|
@@ -1,9 +1,28 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as O } from "./getListOutletOpeningHoursTable.mjs";
|
|
2
|
+
import { default as g } from "./getOutletTagInformation.mjs";
|
|
3
|
+
import { default as x } from "./getOutletAvailabilityInfo.mjs";
|
|
4
|
+
import { default as b } from "./getOutletOfflineOrderFormats.mjs";
|
|
5
|
+
import { default as v } from "./getOutletAvailableOrderFormats.mjs";
|
|
6
|
+
import { default as y } from "./getOutletFormattedDistance.mjs";
|
|
7
|
+
import { default as I } from "./isOutletAcceptingPreOrders.mjs";
|
|
8
|
+
import { default as H } from "./getOutletDeliveryFee.mjs";
|
|
2
9
|
import "moment";
|
|
3
10
|
import "@ancon/wildcat-types";
|
|
4
11
|
import "../shared/enums.mjs";
|
|
5
12
|
import "../shared/isWithinFlag.mjs";
|
|
6
13
|
import "../shared/generateId.mjs";
|
|
14
|
+
import "./types.mjs";
|
|
15
|
+
import "./constants.mjs";
|
|
16
|
+
import "./getOutletCurrentActiveOperatingHour.mjs";
|
|
17
|
+
import "./getMomentFromDateAndTimeString.mjs";
|
|
18
|
+
import "./searchNextOpeningMoment.mjs";
|
|
7
19
|
export {
|
|
8
|
-
|
|
20
|
+
O as getListOutletOpeningHoursTable,
|
|
21
|
+
x as getOutletAvailabilityInfo,
|
|
22
|
+
v as getOutletAvailableOrderFormats,
|
|
23
|
+
H as getOutletDeliveryFee,
|
|
24
|
+
y as getOutletFormattedDistance,
|
|
25
|
+
b as getOutletOfflineOrderFormats,
|
|
26
|
+
g as getOutletTagInformation,
|
|
27
|
+
I as isOutletAcceptingPreOrders
|
|
9
28
|
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function t(e){return e.some(r=>r.acceptingPreOrders===!0)}module.exports=t;
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { Moment } from 'moment';
|
|
2
|
+
import { OperatingHourFormattedMap } from './types';
|
|
3
|
+
/**
|
|
4
|
+
* Search for an active (open) operating hour.
|
|
5
|
+
* This will only be called on outlets that are not open at the given time
|
|
6
|
+
*
|
|
7
|
+
* @param {OperatingHourFormattedMap} operatingHourMap The map of formatted intervals and exceptions indexed against the date
|
|
8
|
+
* @param {Moment} relevantMoment The relevant moment to compare
|
|
9
|
+
*
|
|
10
|
+
* @return {Moment}
|
|
11
|
+
*/
|
|
12
|
+
declare function searchNextOpeningMoment(operatingHourMap: OperatingHourFormattedMap, relevantMoment: Moment): Moment | null;
|
|
13
|
+
export default searchNextOpeningMoment;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const f=require("moment"),O=require("@ancon/wildcat-types"),c=require("./constants.js"),a=require("./getMomentFromDateAndTimeString.js");function m(i){const[t]=i.split(":").map(Number)??[];return t??0}function y(i){let t=null;const{intervals:r,exception:e}=i;if(e){const{state:o}=e;o||(t=e)}else{const o=r.sort((n,l)=>m(n.start)-m(l.start)),[s]=o;return s}return t}function p(i,t,r){var o,s;const e=[];if(t.exception){if(t.exception.state===O.OutletState.Open){const n=a(i,t.exception.start);r.isBefore(n)&&e.push({interval:t.exception,moment:n})}}else for(let n=0;n<t.intervals.length;n+=1){const l=t.intervals[n],u=a(i,l.start);r.isBefore(u)&&e.push({interval:l,moment:u})}return e.length<2?((o=e[0])==null?void 0:o.interval)??null:((s=e.sort((n,l)=>n.moment-r-(l.moment-r))[0])==null?void 0:s.interval)??null}function g(i,t){let r=null;const e=f(t).format(c.OutletMapKeyFormatter),o=p(e,i[e],t);if(o&&(r=a(e,o.start)),!r)for(let s=1;s<c.OutletTimelineDayCount;s+=1){const n=f(t).add(s,"d").format(c.OutletMapKeyFormatter),l=i[n],u=y(l);if(u){r=a(n,u.start);break}}return r}module.exports=g;
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
import f from "moment";
|
|
2
|
+
import { OutletState as p } from "@ancon/wildcat-types";
|
|
3
|
+
import { OutletMapKeyFormatter as m, OutletTimelineDayCount as O } from "./constants.mjs";
|
|
4
|
+
import a from "./getMomentFromDateAndTimeString.mjs";
|
|
5
|
+
function c(o) {
|
|
6
|
+
const [t] = o.split(":").map(Number) ?? [];
|
|
7
|
+
return t ?? 0;
|
|
8
|
+
}
|
|
9
|
+
function g(o) {
|
|
10
|
+
let t = null;
|
|
11
|
+
const { intervals: i, exception: e } = o;
|
|
12
|
+
if (e) {
|
|
13
|
+
const { state: r } = e;
|
|
14
|
+
r || (t = e);
|
|
15
|
+
} else {
|
|
16
|
+
const r = i.sort(
|
|
17
|
+
(n, l) => c(n.start) - c(l.start)
|
|
18
|
+
), [s] = r;
|
|
19
|
+
return s;
|
|
20
|
+
}
|
|
21
|
+
return t;
|
|
22
|
+
}
|
|
23
|
+
function x(o, t, i) {
|
|
24
|
+
var r, s;
|
|
25
|
+
const e = [];
|
|
26
|
+
if (t.exception) {
|
|
27
|
+
if (t.exception.state === p.Open) {
|
|
28
|
+
const n = a(
|
|
29
|
+
o,
|
|
30
|
+
t.exception.start
|
|
31
|
+
);
|
|
32
|
+
i.isBefore(n) && e.push({
|
|
33
|
+
interval: t.exception,
|
|
34
|
+
moment: n
|
|
35
|
+
});
|
|
36
|
+
}
|
|
37
|
+
} else
|
|
38
|
+
for (let n = 0; n < t.intervals.length; n += 1) {
|
|
39
|
+
const l = t.intervals[n], u = a(
|
|
40
|
+
o,
|
|
41
|
+
l.start
|
|
42
|
+
);
|
|
43
|
+
i.isBefore(u) && e.push({ interval: l, moment: u });
|
|
44
|
+
}
|
|
45
|
+
return e.length < 2 ? ((r = e[0]) == null ? void 0 : r.interval) ?? null : ((s = e.sort(
|
|
46
|
+
(n, l) => n.moment - i - (l.moment - i)
|
|
47
|
+
)[0]) == null ? void 0 : s.interval) ?? null;
|
|
48
|
+
}
|
|
49
|
+
function d(o, t) {
|
|
50
|
+
let i = null;
|
|
51
|
+
const e = f(t).format(m), r = x(
|
|
52
|
+
e,
|
|
53
|
+
o[e],
|
|
54
|
+
t
|
|
55
|
+
);
|
|
56
|
+
if (r && (i = a(
|
|
57
|
+
e,
|
|
58
|
+
r.start
|
|
59
|
+
)), !i)
|
|
60
|
+
for (let s = 1; s < O; s += 1) {
|
|
61
|
+
const n = f(t).add(s, "d").format(m), l = o[n], u = g(l);
|
|
62
|
+
if (u) {
|
|
63
|
+
i = a(
|
|
64
|
+
n,
|
|
65
|
+
u.start
|
|
66
|
+
);
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
return i;
|
|
71
|
+
}
|
|
72
|
+
export {
|
|
73
|
+
d as default
|
|
74
|
+
};
|
package/outlet/types.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
import { OrderFormat } from '@ancon/wildcat-types';
|
|
1
|
+
import { OrderFormat, ServiceDateTimeInterval } from '@ancon/wildcat-types';
|
|
2
|
+
import { Moment } from 'moment';
|
|
2
3
|
import { DayOfWeek, IntervalState, IntervalType } from '../shared';
|
|
3
4
|
/** HH:mm:ss */
|
|
4
5
|
export declare type IntervalTimestamp = string;
|
|
@@ -25,3 +26,23 @@ export declare type ListOutlet = {
|
|
|
25
26
|
export declare type DetailedOutlet = {
|
|
26
27
|
openingHours: Interval[];
|
|
27
28
|
};
|
|
29
|
+
export declare enum OperatingHourType {
|
|
30
|
+
Interval = 0,
|
|
31
|
+
Exception = 1
|
|
32
|
+
}
|
|
33
|
+
export declare type OperatingHourMappedValue = {
|
|
34
|
+
intervals: Array<ServiceDateTimeInterval>;
|
|
35
|
+
exception?: ServiceDateTimeInterval;
|
|
36
|
+
metadata: {
|
|
37
|
+
dayOfWeek: number;
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
export declare type OperatingHourFormattedMap = {
|
|
41
|
+
[key: string]: OperatingHourMappedValue;
|
|
42
|
+
};
|
|
43
|
+
export declare type OutletTagInformation = {
|
|
44
|
+
closingTime: Moment | null;
|
|
45
|
+
openingTime: Moment | null;
|
|
46
|
+
openDuringSpecifiedTime: boolean;
|
|
47
|
+
openNow: boolean;
|
|
48
|
+
};
|
package/outlet/types.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});var e=(t=>(t[t.Interval=0]="Interval",t[t.Exception=1]="Exception",t))(e||{});exports.OperatingHourType=e;
|
package/outlet/types.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancon/wildcat-utils",
|
|
3
|
-
"version": "1.17.
|
|
3
|
+
"version": "1.17.2",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -86,16 +86,71 @@
|
|
|
86
86
|
"require": "./number/randomIntFromInterval.js",
|
|
87
87
|
"types": "./number/randomIntFromInterval.d.ts"
|
|
88
88
|
},
|
|
89
|
+
"./outlet/constants": {
|
|
90
|
+
"import": "./outlet/constants.mjs",
|
|
91
|
+
"require": "./outlet/constants.js",
|
|
92
|
+
"types": "./outlet/constants.d.ts"
|
|
93
|
+
},
|
|
89
94
|
"./outlet/getListOutletOpeningHoursTable": {
|
|
90
95
|
"import": "./outlet/getListOutletOpeningHoursTable.mjs",
|
|
91
96
|
"require": "./outlet/getListOutletOpeningHoursTable.js",
|
|
92
97
|
"types": "./outlet/getListOutletOpeningHoursTable.d.ts"
|
|
93
98
|
},
|
|
99
|
+
"./outlet/getMomentFromDateAndTimeString": {
|
|
100
|
+
"import": "./outlet/getMomentFromDateAndTimeString.mjs",
|
|
101
|
+
"require": "./outlet/getMomentFromDateAndTimeString.js",
|
|
102
|
+
"types": "./outlet/getMomentFromDateAndTimeString.d.ts"
|
|
103
|
+
},
|
|
104
|
+
"./outlet/getOutletAvailabilityInfo": {
|
|
105
|
+
"import": "./outlet/getOutletAvailabilityInfo.mjs",
|
|
106
|
+
"require": "./outlet/getOutletAvailabilityInfo.js",
|
|
107
|
+
"types": "./outlet/getOutletAvailabilityInfo.d.ts"
|
|
108
|
+
},
|
|
109
|
+
"./outlet/getOutletAvailableOrderFormats": {
|
|
110
|
+
"import": "./outlet/getOutletAvailableOrderFormats.mjs",
|
|
111
|
+
"require": "./outlet/getOutletAvailableOrderFormats.js",
|
|
112
|
+
"types": "./outlet/getOutletAvailableOrderFormats.d.ts"
|
|
113
|
+
},
|
|
114
|
+
"./outlet/getOutletCurrentActiveOperatingHour": {
|
|
115
|
+
"import": "./outlet/getOutletCurrentActiveOperatingHour.mjs",
|
|
116
|
+
"require": "./outlet/getOutletCurrentActiveOperatingHour.js",
|
|
117
|
+
"types": "./outlet/getOutletCurrentActiveOperatingHour.d.ts"
|
|
118
|
+
},
|
|
119
|
+
"./outlet/getOutletDeliveryFee": {
|
|
120
|
+
"import": "./outlet/getOutletDeliveryFee.mjs",
|
|
121
|
+
"require": "./outlet/getOutletDeliveryFee.js",
|
|
122
|
+
"types": "./outlet/getOutletDeliveryFee.d.ts"
|
|
123
|
+
},
|
|
124
|
+
"./outlet/getOutletFormattedDistance": {
|
|
125
|
+
"import": "./outlet/getOutletFormattedDistance.mjs",
|
|
126
|
+
"require": "./outlet/getOutletFormattedDistance.js",
|
|
127
|
+
"types": "./outlet/getOutletFormattedDistance.d.ts"
|
|
128
|
+
},
|
|
129
|
+
"./outlet/getOutletOfflineOrderFormats": {
|
|
130
|
+
"import": "./outlet/getOutletOfflineOrderFormats.mjs",
|
|
131
|
+
"require": "./outlet/getOutletOfflineOrderFormats.js",
|
|
132
|
+
"types": "./outlet/getOutletOfflineOrderFormats.d.ts"
|
|
133
|
+
},
|
|
134
|
+
"./outlet/getOutletTagInformation": {
|
|
135
|
+
"import": "./outlet/getOutletTagInformation.mjs",
|
|
136
|
+
"require": "./outlet/getOutletTagInformation.js",
|
|
137
|
+
"types": "./outlet/getOutletTagInformation.d.ts"
|
|
138
|
+
},
|
|
94
139
|
"./outlet": {
|
|
95
140
|
"import": "./outlet/index.mjs",
|
|
96
141
|
"require": "./outlet/index.js",
|
|
97
142
|
"types": "./outlet/index.d.ts"
|
|
98
143
|
},
|
|
144
|
+
"./outlet/isOutletAcceptingPreOrders": {
|
|
145
|
+
"import": "./outlet/isOutletAcceptingPreOrders.mjs",
|
|
146
|
+
"require": "./outlet/isOutletAcceptingPreOrders.js",
|
|
147
|
+
"types": "./outlet/isOutletAcceptingPreOrders.d.ts"
|
|
148
|
+
},
|
|
149
|
+
"./outlet/searchNextOpeningMoment": {
|
|
150
|
+
"import": "./outlet/searchNextOpeningMoment.mjs",
|
|
151
|
+
"require": "./outlet/searchNextOpeningMoment.js",
|
|
152
|
+
"types": "./outlet/searchNextOpeningMoment.d.ts"
|
|
153
|
+
},
|
|
99
154
|
"./outlet/types": {
|
|
100
155
|
"import": "./outlet/types.mjs",
|
|
101
156
|
"require": "./outlet/types.js",
|