@ancon/wildcat-utils 1.26.0 → 1.27.1
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.d.ts +1 -0
- package/index.js +1 -1
- package/index.mjs +85 -81
- package/location/index.d.ts +2 -0
- package/location/index.js +1 -0
- package/location/index.mjs +4 -0
- package/location/isCoordinateWithinBounds.d.ts +6 -0
- package/location/isCoordinateWithinBounds.js +1 -0
- package/location/isCoordinateWithinBounds.mjs +12 -0
- package/package.json +26 -1
- package/product/extractProductsFromMenuTree.d.ts +2 -0
- package/product/extractProductsFromMenuTree.js +1 -0
- package/product/extractProductsFromMenuTree.mjs +15 -0
- package/product/index.d.ts +2 -0
- package/product/index.js +1 -0
- package/product/index.mjs +5 -0
- package/user/getCustomerAddressFromGeocoderResult.d.ts +11 -0
- package/user/getCustomerAddressFromGeocoderResult.js +1 -0
- package/user/getCustomerAddressFromGeocoderResult.mjs +42 -0
- package/user/index.d.ts +2 -1
- package/user/index.js +1 -1
- package/user/index.mjs +6 -4
package/index.d.ts
CHANGED
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./shared/isWithinFlag.js"),t=require("./shared/generateId.js"),i=require("./shared/wait.js"),o=require("./outlet/getListOutletOpeningHoursTable.js"),n=require("./outlet/getOutletTagInformation.js"),u=require("./outlet/getOutletAvailabilityInfo.js"),s=require("./outlet/getOutletOfflineOrderFormats.js"),c=require("./outlet/getOutletAvailableOrderFormats.js"),a=require("./outlet/getOutletFormattedDistance.js"),l=require("./outlet/isOutletAcceptingPreOrders.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./shared/isWithinFlag.js"),t=require("./shared/generateId.js"),i=require("./shared/wait.js"),o=require("./outlet/getListOutletOpeningHoursTable.js"),n=require("./outlet/getOutletTagInformation.js"),u=require("./outlet/getOutletAvailabilityInfo.js"),s=require("./outlet/getOutletOfflineOrderFormats.js"),c=require("./outlet/getOutletAvailableOrderFormats.js"),a=require("./outlet/getOutletFormattedDistance.js"),l=require("./outlet/isOutletAcceptingPreOrders.js"),d=require("./outlet/getOutletDeliveryFee.js"),g=require("./outlet/getOutletTodayOpeningTimes.js"),q=require("./outlet/getOutletOrderFormats.js"),O=require("./outlet/serviceDateTimesFromOpeningHours.js"),_=require("./outlet/getPickerIntervalsForDay.js"),k=require("./outlet/getServiceIntervalRange.js"),m=require("./outlet/getServiceIntervalsForOrderFormat.js"),P=require("./outlet/getOutletFormattedAddress.js"),p=require("./outlet/getPartitionedOutletsList.js"),S=require("./outlet/getOutletPickerTimesForWeek.js"),f=require("./outlet/getOutletOrderPrepTime.js"),F=require("./versioning/isVersionALessThanB.js"),h=require("./versioning/cleanVersionString.js"),y=require("./api/getUrlAndParams.js"),T=require("./api/getEndpointWithVersion.js"),v=require("./api/generateBackoffWithEqualJitter.js"),C=require("./api/isAcceptedResponse.js"),D=require("./api/isNoContentResponse.js"),I=require("./string/slugify.js"),A=require("./string/truncate.js"),R=require("./color/lighten.js"),b=require("./color/brighten.js"),V=require("./color/darken.js"),E=require("./color/isDarkBackground.js"),L=require("./user/getFullName.js"),M=require("./user/getFullAddressString.js"),H=require("./user/getCustomerAddressFromGeocoderResult.js"),N=require("./logger/Logger.js"),B=require("./logger/types.js"),U=require("./logger/sanitizeAsStringDict.js"),W=require("./printing/getPrinterType.js"),w=require("./printing/isValidPrinter.js"),x=require("./printing/isValidNetworkPrinter.js"),G=require("./printing/isValidStarCloudPrinter.js"),z=require("./printing/isTerminalPrinter.js"),J=require("./printing/isCloudPrintModeEnabled.js"),K=require("./number/randomIntFromInterval.js"),Q=require("./tables/decodeTableQRPayload.js"),j=require("./checkout/getCheckoutItemModifications.js"),X=require("./checkout/getCheckoutProductName.js"),e=require("./checkout/getCheckoutOrderStatusTexts.js"),Y=require("./checkout/getCheckoutItemsMappedByTicketItemStatus.js"),Z=require("./checkout/isCheckoutOrderSummary.js"),$=require("./currency/getFormattedCurrency.js"),ee=require("./inventory/isDetailedProductOutOfStock.js"),re=require("./inventory/isDetailedProductVariantOutOfStocks.js"),te=require("./inventory/isMenuTreeProductOutOfStock.js"),ie=require("./inventory/isDetailedProductUpSellsOutOfStock.js"),oe=require("./inventory/isUpSellProductOutStock.js"),ne=require("./inventory/isDetailedProductOutletStockOutOfStock.js"),ue=require("./inventory/getDetailedProductVariantStock.js"),se=require("./signalr/createUseSignalRHook.js"),ce=require("./signalr/SignalR.js"),ae=require("./error/createCodedError.js"),le=require("./error/isCodedError.js"),de=require("./error/isNetworkError.js"),ge=require("./error/isLockedError.js"),qe=require("./hangfire/isHangfireResponse.js"),Oe=require("./hangfire/createHangfirePoller.js"),_e=require("./hangfire/createMakeHangfireRequest.js"),ke=require("./product/extractProductsFromMenuTree.js");require("moment");require("@ancon/wildcat-types");require("./outlet/constants.js");require("./outlet/getOutletCurrentActiveOperatingHour.js");require("./outlet/getMomentFromDateAndTimeString.js");require("./outlet/searchNextOpeningMoment.js");require("lodash");require("./shared/constants.js");require("./time/toMinutes.js");require("./time/getNextTenthMinute.js");require("./outlet/types.js");require("./outlet/getSettingsForOrderFormat.js");require("./outlet/getServiceIntervalStart.js");require("./outlet/getNextTenthMinute.js");require("./outlet/generatePickerTimesForDay.js");require("./outlet/getServiceIntervalEnd.js");require("./outlet/hoursAndMinutesToMinutes.js");require("compare-versions");require("tinycolor2");require("@ancon/wildcat-printing");require("./currency/getFormattedCurrencyPostfix.js");require("react");require("react-redux");require("@microsoft/signalr");require("./index-4a932b99.js");require("./axios-5f25f7ff.js");exports.isWithinFlag=r;exports.generateId=t;exports.wait=i;exports.getListOutletOpeningHoursTable=o;exports.getOutletTagInformation=n.default;exports.getOutletAvailabilityInfo=u.default;exports.getOutletOfflineOrderFormats=s;exports.getOutletAvailableOrderFormats=c;exports.getOutletFormattedDistance=a;exports.isOutletAcceptingPreOrders=l;exports.getOutletDeliveryFee=d;exports.getOutletTodayOpeningTimes=g;exports.getOutletOrderFormats=q;exports.serviceDateTimesFromOpeningHours=O;exports.getPickerIntervalsForDay=_;exports.getServiceIntervalRange=k;exports.getServiceIntervalsForOrderFormat=m;exports.getOutletFormattedAddress=P;exports.getPartitionedOutletsList=p;exports.getOutletPickerTimesForWeek=S;exports.getOutletOrderPreparationTime=f;exports.isVersionALessThanB=F;exports.cleanVersionString=h;exports.getUrlAndParams=y;exports.getEndpointWithVersion=T;exports.generateBackoffWithEqualJitter=v;exports.isAcceptedResponse=C;exports.isNoContentResponse=D;exports.slugify=I;exports.truncate=A;exports.lighten=R;exports.brighten=b;exports.darken=V;exports.isDarkBackground=E;exports.getFullName=L;exports.getFullAddressString=M;exports.getCustomerAddressFromGeocoderResult=H;exports.Logger=N;exports.LogLevel=B.LogLevel;exports.sanitizeAsStringDict=U;exports.getPrinterType=W;exports.isValidPrinter=w;exports.isValidNetworkPrinter=x;exports.isValidStarCloudPrinter=G;exports.isTerminalPrinter=z;exports.isCloudPrintModeEnabled=J;exports.randomIntFromInterval=K;exports.decodeTableQRPayload=Q;exports.getCheckoutGroupedModifications=j;exports.getCheckoutProductName=X;exports.TranslationKey=e.TranslationKey;exports.getCheckoutOrderStatusTexts=e.default;exports.getCheckoutItemsMappedByTicketItemStatus=Y;exports.isCheckoutOrderSummary=Z;exports.getFormattedCurrency=$;exports.isDetailedProductOutOfStock=ee;exports.isDetailedProductVariantOutOfStocks=re;exports.isMenuTreeProductOutOfStock=te;exports.isDetailedProductUpSellsOutOfStock=ie;exports.isUpSellProductOutOfStock=oe;exports.isDetailedProductOutletStockOutOfStock=ne;exports.getDetailedProductVariantStock=ue;exports.createUseSignalRHook=se;exports.SignalR=ce;exports.createCodedError=ae;exports.isCodedError=le;exports.isNetworkError=de;exports.isLockedError=ge;exports.isHangfireResponse=qe;exports.createHangfirePoller=Oe.default;exports.createMakeHangfireRequest=_e;exports.extractProductsFromMenuTree=ke;
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as A } from "./shared/isWithinFlag.mjs";
|
|
2
2
|
import { default as R } from "./shared/generateId.mjs";
|
|
3
3
|
import { default as E } from "./shared/wait.mjs";
|
|
4
4
|
import { default as b } from "./outlet/getListOutletOpeningHoursTable.mjs";
|
|
@@ -6,7 +6,7 @@ import { default as M } from "./outlet/getOutletTagInformation.mjs";
|
|
|
6
6
|
import { default as B } from "./outlet/getOutletAvailabilityInfo.mjs";
|
|
7
7
|
import { default as W } from "./outlet/getOutletOfflineOrderFormats.mjs";
|
|
8
8
|
import { default as q } from "./outlet/getOutletAvailableOrderFormats.mjs";
|
|
9
|
-
import { default as
|
|
9
|
+
import { default as z } from "./outlet/getOutletFormattedDistance.mjs";
|
|
10
10
|
import { default as K } from "./outlet/isOutletAcceptingPreOrders.mjs";
|
|
11
11
|
import { default as j } from "./outlet/getOutletDeliveryFee.mjs";
|
|
12
12
|
import { default as Y } from "./outlet/getOutletTodayOpeningTimes.mjs";
|
|
@@ -16,16 +16,16 @@ import { default as rt } from "./outlet/getPickerIntervalsForDay.mjs";
|
|
|
16
16
|
import { default as at } from "./outlet/getServiceIntervalRange.mjs";
|
|
17
17
|
import { default as st } from "./outlet/getServiceIntervalsForOrderFormat.mjs";
|
|
18
18
|
import { default as dt } from "./outlet/getOutletFormattedAddress.mjs";
|
|
19
|
-
import { default as
|
|
19
|
+
import { default as mt } from "./outlet/getPartitionedOutletsList.mjs";
|
|
20
20
|
import { default as pt } from "./outlet/getOutletPickerTimesForWeek.mjs";
|
|
21
21
|
import { default as nt } from "./outlet/getOutletOrderPrepTime.mjs";
|
|
22
22
|
import { default as ct } from "./versioning/isVersionALessThanB.mjs";
|
|
23
23
|
import { default as kt } from "./versioning/cleanVersionString.mjs";
|
|
24
24
|
import { default as St } from "./api/getUrlAndParams.mjs";
|
|
25
25
|
import { default as Tt } from "./api/getEndpointWithVersion.mjs";
|
|
26
|
-
import { default as
|
|
27
|
-
import { default as
|
|
28
|
-
import { default as
|
|
26
|
+
import { default as ht } from "./api/generateBackoffWithEqualJitter.mjs";
|
|
27
|
+
import { default as yt } from "./api/isAcceptedResponse.mjs";
|
|
28
|
+
import { default as At } from "./api/isNoContentResponse.mjs";
|
|
29
29
|
import { default as Rt } from "./string/slugify.mjs";
|
|
30
30
|
import { default as Et } from "./string/truncate.mjs";
|
|
31
31
|
import { default as bt } from "./color/lighten.mjs";
|
|
@@ -33,40 +33,42 @@ import { default as Mt } from "./color/brighten.mjs";
|
|
|
33
33
|
import { default as Bt } from "./color/darken.mjs";
|
|
34
34
|
import { default as Wt } from "./color/isDarkBackground.mjs";
|
|
35
35
|
import { default as qt } from "./user/getFullName.mjs";
|
|
36
|
-
import { default as
|
|
37
|
-
import { default as Kt } from "./
|
|
38
|
-
import {
|
|
39
|
-
import {
|
|
40
|
-
import { default as _t } from "./
|
|
41
|
-
import { default as te } from "./printing/
|
|
42
|
-
import { default as re } from "./printing/
|
|
43
|
-
import { default as ae } from "./printing/
|
|
44
|
-
import { default as se } from "./printing/
|
|
45
|
-
import { default as de } from "./printing/
|
|
46
|
-
import { default as
|
|
47
|
-
import { default as pe } from "./
|
|
48
|
-
import { default as ne } from "./
|
|
49
|
-
import { default as ce } from "./checkout/
|
|
50
|
-
import {
|
|
51
|
-
import { default as Fe } from "./checkout/
|
|
52
|
-
import { default as
|
|
53
|
-
import { default as
|
|
54
|
-
import { default as De } from "./
|
|
55
|
-
import { default as
|
|
56
|
-
import { default as Ve } from "./inventory/
|
|
57
|
-
import { default as Le } from "./inventory/
|
|
58
|
-
import { default as He } from "./inventory/
|
|
59
|
-
import { default as Ne } from "./inventory/
|
|
60
|
-
import { default as Ue } from "./inventory/
|
|
61
|
-
import { default as we } from "./
|
|
62
|
-
import { default as
|
|
63
|
-
import { default as Je } from "./
|
|
64
|
-
import { default as Qe } from "./error/
|
|
65
|
-
import { default as Xe } from "./error/
|
|
66
|
-
import { default as Ze } from "./error/
|
|
67
|
-
import { default as $e } from "./
|
|
68
|
-
import { default as er } from "./hangfire/
|
|
69
|
-
import { default as or } from "./hangfire/
|
|
36
|
+
import { default as zt } from "./user/getFullAddressString.mjs";
|
|
37
|
+
import { default as Kt } from "./user/getCustomerAddressFromGeocoderResult.mjs";
|
|
38
|
+
import { default as jt } from "./logger/Logger.mjs";
|
|
39
|
+
import { LogLevel as Yt } from "./logger/types.mjs";
|
|
40
|
+
import { default as _t } from "./logger/sanitizeAsStringDict.mjs";
|
|
41
|
+
import { default as te } from "./printing/getPrinterType.mjs";
|
|
42
|
+
import { default as re } from "./printing/isValidPrinter.mjs";
|
|
43
|
+
import { default as ae } from "./printing/isValidNetworkPrinter.mjs";
|
|
44
|
+
import { default as se } from "./printing/isValidStarCloudPrinter.mjs";
|
|
45
|
+
import { default as de } from "./printing/isTerminalPrinter.mjs";
|
|
46
|
+
import { default as me } from "./printing/isCloudPrintModeEnabled.mjs";
|
|
47
|
+
import { default as pe } from "./number/randomIntFromInterval.mjs";
|
|
48
|
+
import { default as ne } from "./tables/decodeTableQRPayload.mjs";
|
|
49
|
+
import { default as ce } from "./checkout/getCheckoutItemModifications.mjs";
|
|
50
|
+
import { default as ke } from "./checkout/getCheckoutProductName.mjs";
|
|
51
|
+
import { TranslationKey as Se, default as Fe } from "./checkout/getCheckoutOrderStatusTexts.mjs";
|
|
52
|
+
import { default as Ce } from "./checkout/getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
53
|
+
import { default as ve } from "./checkout/isCheckoutOrderSummary.mjs";
|
|
54
|
+
import { default as De } from "./currency/getFormattedCurrency.mjs";
|
|
55
|
+
import { default as Ie } from "./inventory/isDetailedProductOutOfStock.mjs";
|
|
56
|
+
import { default as Ve } from "./inventory/isDetailedProductVariantOutOfStocks.mjs";
|
|
57
|
+
import { default as Le } from "./inventory/isMenuTreeProductOutOfStock.mjs";
|
|
58
|
+
import { default as He } from "./inventory/isDetailedProductUpSellsOutOfStock.mjs";
|
|
59
|
+
import { default as Ne } from "./inventory/isUpSellProductOutStock.mjs";
|
|
60
|
+
import { default as Ue } from "./inventory/isDetailedProductOutletStockOutOfStock.mjs";
|
|
61
|
+
import { default as we } from "./inventory/getDetailedProductVariantStock.mjs";
|
|
62
|
+
import { default as Ge } from "./signalr/createUseSignalRHook.mjs";
|
|
63
|
+
import { default as Je } from "./signalr/SignalR.mjs";
|
|
64
|
+
import { default as Qe } from "./error/createCodedError.mjs";
|
|
65
|
+
import { default as Xe } from "./error/isCodedError.mjs";
|
|
66
|
+
import { default as Ze } from "./error/isNetworkError.mjs";
|
|
67
|
+
import { default as $e } from "./error/isLockedError.mjs";
|
|
68
|
+
import { default as er } from "./hangfire/isHangfireResponse.mjs";
|
|
69
|
+
import { default as or } from "./hangfire/createHangfirePoller.mjs";
|
|
70
|
+
import { default as fr } from "./hangfire/createMakeHangfireRequest.mjs";
|
|
71
|
+
import { default as lr } from "./product/extractProductsFromMenuTree.mjs";
|
|
70
72
|
import "moment";
|
|
71
73
|
import "@ancon/wildcat-types";
|
|
72
74
|
import "./outlet/constants.mjs";
|
|
@@ -94,72 +96,74 @@ import "@microsoft/signalr";
|
|
|
94
96
|
import "./index-bc13ec04.mjs";
|
|
95
97
|
import "./axios-aa12e368.mjs";
|
|
96
98
|
export {
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
99
|
+
Yt as LogLevel,
|
|
100
|
+
jt as Logger,
|
|
101
|
+
Je as SignalR,
|
|
102
|
+
Se as TranslationKey,
|
|
101
103
|
Mt as brighten,
|
|
102
104
|
kt as cleanVersionString,
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
105
|
+
Qe as createCodedError,
|
|
106
|
+
or as createHangfirePoller,
|
|
107
|
+
fr as createMakeHangfireRequest,
|
|
108
|
+
Ge as createUseSignalRHook,
|
|
107
109
|
Bt as darken,
|
|
108
|
-
|
|
109
|
-
|
|
110
|
+
ne as decodeTableQRPayload,
|
|
111
|
+
lr as extractProductsFromMenuTree,
|
|
112
|
+
ht as generateBackoffWithEqualJitter,
|
|
110
113
|
R as generateId,
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
ce as getCheckoutGroupedModifications,
|
|
115
|
+
Ce as getCheckoutItemsMappedByTicketItemStatus,
|
|
116
|
+
Fe as getCheckoutOrderStatusTexts,
|
|
117
|
+
ke as getCheckoutProductName,
|
|
118
|
+
Kt as getCustomerAddressFromGeocoderResult,
|
|
119
|
+
we as getDetailedProductVariantStock,
|
|
116
120
|
Tt as getEndpointWithVersion,
|
|
117
|
-
|
|
118
|
-
|
|
121
|
+
De as getFormattedCurrency,
|
|
122
|
+
zt as getFullAddressString,
|
|
119
123
|
qt as getFullName,
|
|
120
124
|
b as getListOutletOpeningHoursTable,
|
|
121
125
|
B as getOutletAvailabilityInfo,
|
|
122
126
|
q as getOutletAvailableOrderFormats,
|
|
123
127
|
j as getOutletDeliveryFee,
|
|
124
128
|
dt as getOutletFormattedAddress,
|
|
125
|
-
|
|
129
|
+
z as getOutletFormattedDistance,
|
|
126
130
|
W as getOutletOfflineOrderFormats,
|
|
127
131
|
_ as getOutletOrderFormats,
|
|
128
132
|
nt as getOutletOrderPreparationTime,
|
|
129
133
|
pt as getOutletPickerTimesForWeek,
|
|
130
134
|
M as getOutletTagInformation,
|
|
131
135
|
Y as getOutletTodayOpeningTimes,
|
|
132
|
-
|
|
136
|
+
mt as getPartitionedOutletsList,
|
|
133
137
|
rt as getPickerIntervalsForDay,
|
|
134
|
-
|
|
138
|
+
te as getPrinterType,
|
|
135
139
|
at as getServiceIntervalRange,
|
|
136
140
|
st as getServiceIntervalsForOrderFormat,
|
|
137
141
|
St as getUrlAndParams,
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
+
yt as isAcceptedResponse,
|
|
143
|
+
ve as isCheckoutOrderSummary,
|
|
144
|
+
me as isCloudPrintModeEnabled,
|
|
145
|
+
Xe as isCodedError,
|
|
142
146
|
Wt as isDarkBackground,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
147
|
+
Ie as isDetailedProductOutOfStock,
|
|
148
|
+
Ue as isDetailedProductOutletStockOutOfStock,
|
|
149
|
+
He as isDetailedProductUpSellsOutOfStock,
|
|
150
|
+
Ve as isDetailedProductVariantOutOfStocks,
|
|
151
|
+
er as isHangfireResponse,
|
|
152
|
+
$e as isLockedError,
|
|
153
|
+
Le as isMenuTreeProductOutOfStock,
|
|
154
|
+
Ze as isNetworkError,
|
|
155
|
+
At as isNoContentResponse,
|
|
152
156
|
K as isOutletAcceptingPreOrders,
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
157
|
+
de as isTerminalPrinter,
|
|
158
|
+
Ne as isUpSellProductOutOfStock,
|
|
159
|
+
ae as isValidNetworkPrinter,
|
|
160
|
+
re as isValidPrinter,
|
|
161
|
+
se as isValidStarCloudPrinter,
|
|
158
162
|
ct as isVersionALessThanB,
|
|
159
|
-
|
|
163
|
+
A as isWithinFlag,
|
|
160
164
|
bt as lighten,
|
|
161
|
-
|
|
162
|
-
|
|
165
|
+
pe as randomIntFromInterval,
|
|
166
|
+
_t as sanitizeAsStringDict,
|
|
163
167
|
tt as serviceDateTimesFromOpeningHours,
|
|
164
168
|
Rt as slugify,
|
|
165
169
|
Et as truncate,
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("./isCoordinateWithinBounds.js");exports.isCoordinateWithinBounds=i.isCoordinateWithinBounds;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});function d(o,e,t){const{latitude:i,longitude:l}=o,a=e.map(n=>({lat:n.latitude,lng:n.longitude})),r=new t.LatLng(i,l),u=new t.Polygon({paths:a});return t.geometry.poly.containsLocation(r,u)}exports.isCoordinateWithinBounds=d;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
function r(o, e, n) {
|
|
2
|
+
const { latitude: i, longitude: l } = o, a = e.map((t) => ({
|
|
3
|
+
lat: t.latitude,
|
|
4
|
+
lng: t.longitude
|
|
5
|
+
})), c = new n.LatLng(i, l), g = new n.Polygon({
|
|
6
|
+
paths: a
|
|
7
|
+
});
|
|
8
|
+
return n.geometry.poly.containsLocation(c, g);
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
r as isCoordinateWithinBounds
|
|
12
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancon/wildcat-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.27.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -196,6 +196,16 @@
|
|
|
196
196
|
"require": "./inventory/isUpSellProductOutStock.js",
|
|
197
197
|
"types": "./inventory/isUpSellProductOutStock.d.ts"
|
|
198
198
|
},
|
|
199
|
+
"./location": {
|
|
200
|
+
"import": "./location/index.mjs",
|
|
201
|
+
"require": "./location/index.js",
|
|
202
|
+
"types": "./location/index.d.ts"
|
|
203
|
+
},
|
|
204
|
+
"./location/isCoordinateWithinBounds": {
|
|
205
|
+
"import": "./location/isCoordinateWithinBounds.mjs",
|
|
206
|
+
"require": "./location/isCoordinateWithinBounds.js",
|
|
207
|
+
"types": "./location/isCoordinateWithinBounds.d.ts"
|
|
208
|
+
},
|
|
199
209
|
"./logger/Logger": {
|
|
200
210
|
"import": "./logger/Logger.mjs",
|
|
201
211
|
"require": "./logger/Logger.js",
|
|
@@ -411,6 +421,16 @@
|
|
|
411
421
|
"require": "./printing/isValidStarCloudPrinter.js",
|
|
412
422
|
"types": "./printing/isValidStarCloudPrinter.d.ts"
|
|
413
423
|
},
|
|
424
|
+
"./product/extractProductsFromMenuTree": {
|
|
425
|
+
"import": "./product/extractProductsFromMenuTree.mjs",
|
|
426
|
+
"require": "./product/extractProductsFromMenuTree.js",
|
|
427
|
+
"types": "./product/extractProductsFromMenuTree.d.ts"
|
|
428
|
+
},
|
|
429
|
+
"./product": {
|
|
430
|
+
"import": "./product/index.mjs",
|
|
431
|
+
"require": "./product/index.js",
|
|
432
|
+
"types": "./product/index.d.ts"
|
|
433
|
+
},
|
|
414
434
|
"./shared/constants": {
|
|
415
435
|
"import": "./shared/constants.mjs",
|
|
416
436
|
"require": "./shared/constants.js",
|
|
@@ -501,6 +521,11 @@
|
|
|
501
521
|
"require": "./time/toMinutes.js",
|
|
502
522
|
"types": "./time/toMinutes.d.ts"
|
|
503
523
|
},
|
|
524
|
+
"./user/getCustomerAddressFromGeocoderResult": {
|
|
525
|
+
"import": "./user/getCustomerAddressFromGeocoderResult.mjs",
|
|
526
|
+
"require": "./user/getCustomerAddressFromGeocoderResult.js",
|
|
527
|
+
"types": "./user/getCustomerAddressFromGeocoderResult.d.ts"
|
|
528
|
+
},
|
|
504
529
|
"./user/getFormattedPhoneNumber": {
|
|
505
530
|
"import": "./user/getFormattedPhoneNumber.mjs",
|
|
506
531
|
"require": "./user/getFormattedPhoneNumber.js",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("@ancon/wildcat-types");function i(r){return r.reduce((t,e)=>{var n;return(n=e.items)!=null&&n.length&&(e.contentType===s.MenuContentType.Product?t.push(...e.items):e.contentType===s.MenuContentType.SubMenu&&e.items.forEach(u=>{t.push(...u.items)})),t},[])}module.exports=i;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { MenuContentType as r } from "@ancon/wildcat-types";
|
|
2
|
+
function c(s) {
|
|
3
|
+
return s.reduce(
|
|
4
|
+
(t, e) => {
|
|
5
|
+
var n;
|
|
6
|
+
return (n = e.items) != null && n.length && (e.contentType === r.Product ? t.push(...e.items) : e.contentType === r.SubMenu && e.items.forEach((u) => {
|
|
7
|
+
t.push(...u.items);
|
|
8
|
+
})), t;
|
|
9
|
+
},
|
|
10
|
+
[]
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
export {
|
|
14
|
+
c as default
|
|
15
|
+
};
|
package/product/index.js
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./extractProductsFromMenuTree.js");require("@ancon/wildcat-types");exports.extractProductsFromMenuTree=e;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { CustomerAddress } from '@ancon/wildcat-types';
|
|
2
|
+
export declare type GoogleAddressComponentType = 'street_number' | 'route' | 'point_of_interest' | 'administrative_area_level_1' | 'country' | 'postal_code' | 'postal_town' | 'locality' | 'administrative_area_level_2';
|
|
3
|
+
export declare type AddressComponentState = {
|
|
4
|
+
city: string;
|
|
5
|
+
streetName: string;
|
|
6
|
+
streetNumber: string;
|
|
7
|
+
state: string;
|
|
8
|
+
zipCode: string;
|
|
9
|
+
country: string;
|
|
10
|
+
};
|
|
11
|
+
export default function getCustomerAddressFromGeocoderResult(geocoderResult: google.maps.GeocoderResult): Pick<CustomerAddress, 'city' | 'country' | 'state' | 'street' | 'zipCode'> | null;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r={postal_town:{key:"city",priority:1},locality:{key:"city",priority:2},administrative_area_level_2:{key:"city",priority:3},point_of_interest:{key:"streetName",priority:1},route:{key:"streetName",priority:2},street_number:{key:"streetNumber",priority:1},administrative_area_level_1:{key:"state",priority:1},country:{key:"country",priority:1},postal_code:{key:"zipCode",priority:1}};function c(i){if(!i)return null;const t=i.address_components.reduce((o,s)=>{let y=-1;return s.types.forEach(e=>{var a,n;((a=r[e])==null?void 0:a.priority)>y&&(o[(n=r[e])==null?void 0:n.key]=s.long_name,y=r[e].priority)}),o},{streetNumber:"",streetName:"",city:"",zipCode:"",state:"",country:""});return{street:[t.streetName,t.streetNumber].filter(Boolean).join(" "),city:t.city,country:t.country,state:t.state,zipCode:t.zipCode}}module.exports=c;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
const r = {
|
|
2
|
+
postal_town: { key: "city", priority: 1 },
|
|
3
|
+
locality: { key: "city", priority: 2 },
|
|
4
|
+
administrative_area_level_2: { key: "city", priority: 3 },
|
|
5
|
+
point_of_interest: { key: "streetName", priority: 1 },
|
|
6
|
+
route: { key: "streetName", priority: 2 },
|
|
7
|
+
street_number: { key: "streetNumber", priority: 1 },
|
|
8
|
+
administrative_area_level_1: { key: "state", priority: 1 },
|
|
9
|
+
country: { key: "country", priority: 1 },
|
|
10
|
+
postal_code: { key: "zipCode", priority: 1 }
|
|
11
|
+
};
|
|
12
|
+
function c(i) {
|
|
13
|
+
if (!i)
|
|
14
|
+
return null;
|
|
15
|
+
const t = i.address_components.reduce(
|
|
16
|
+
(o, y) => {
|
|
17
|
+
let s = -1;
|
|
18
|
+
return y.types.forEach((e) => {
|
|
19
|
+
var a, n;
|
|
20
|
+
((a = r[e]) == null ? void 0 : a.priority) > s && (o[(n = r[e]) == null ? void 0 : n.key] = y.long_name, s = r[e].priority);
|
|
21
|
+
}), o;
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
streetNumber: "",
|
|
25
|
+
streetName: "",
|
|
26
|
+
city: "",
|
|
27
|
+
zipCode: "",
|
|
28
|
+
state: "",
|
|
29
|
+
country: ""
|
|
30
|
+
}
|
|
31
|
+
);
|
|
32
|
+
return {
|
|
33
|
+
street: [t.streetName, t.streetNumber].filter(Boolean).join(" "),
|
|
34
|
+
city: t.city,
|
|
35
|
+
country: t.country,
|
|
36
|
+
state: t.state,
|
|
37
|
+
zipCode: t.zipCode
|
|
38
|
+
};
|
|
39
|
+
}
|
|
40
|
+
export {
|
|
41
|
+
c as default
|
|
42
|
+
};
|
package/user/index.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
import getFullName from './getFullName';
|
|
2
2
|
import getFullAddressString from './getFullAddressString';
|
|
3
|
-
|
|
3
|
+
import getCustomerAddressFromGeocoderResult from './getCustomerAddressFromGeocoderResult';
|
|
4
|
+
export { getFullName, getFullAddressString, getCustomerAddressFromGeocoderResult };
|
package/user/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getFullName.js"),r=require("./getFullAddressString.js");exports.getFullName=e;exports.getFullAddressString=r;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getFullName.js"),r=require("./getFullAddressString.js"),t=require("./getCustomerAddressFromGeocoderResult.js");exports.getFullName=e;exports.getFullAddressString=r;exports.getCustomerAddressFromGeocoderResult=t;
|
package/user/index.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { default as
|
|
1
|
+
import { default as t } from "./getFullName.mjs";
|
|
2
|
+
import { default as s } from "./getFullAddressString.mjs";
|
|
3
|
+
import { default as l } from "./getCustomerAddressFromGeocoderResult.mjs";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
-
|
|
5
|
+
l as getCustomerAddressFromGeocoderResult,
|
|
6
|
+
s as getFullAddressString,
|
|
7
|
+
t as getFullName
|
|
6
8
|
};
|