@ancon/wildcat-utils 1.29.4 → 1.30.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/error/createCodedError.d.ts +1 -1
- package/error/index.d.ts +3 -2
- package/error/index.js +1 -1
- package/error/index.mjs +6 -4
- package/error/serializeError.d.ts +26 -0
- package/error/serializeError.js +1 -0
- package/error/serializeError.mjs +39 -0
- package/index.js +1 -1
- package/index.mjs +137 -133
- package/package.json +11 -1
- package/user/getStructuredCustomerAddress.d.ts +10 -0
- package/user/getStructuredCustomerAddress.js +1 -0
- package/user/getStructuredCustomerAddress.mjs +23 -0
- package/user/index.d.ts +2 -1
- package/user/index.js +1 -1
- package/user/index.mjs +9 -7
|
@@ -2,7 +2,7 @@ import { ErrorCode } from '@ancon/wildcat-types';
|
|
|
2
2
|
/** Client-side generated error */
|
|
3
3
|
declare type CodedError = {
|
|
4
4
|
code: ErrorCode;
|
|
5
|
-
message
|
|
5
|
+
message: string;
|
|
6
6
|
additionalData: Record<string, unknown>;
|
|
7
7
|
};
|
|
8
8
|
/** Create a new client-side generated error */
|
package/error/index.d.ts
CHANGED
|
@@ -2,5 +2,6 @@ import createCodedError, { CodedError } from './createCodedError';
|
|
|
2
2
|
import isCodedError from './isCodedError';
|
|
3
3
|
import isNetworkError from './isNetworkError';
|
|
4
4
|
import isLockedError from './isLockedError';
|
|
5
|
-
|
|
6
|
-
export {
|
|
5
|
+
import serializeError, { SerializedAxiosError, SerializedCodedError, SerializedGenericError } from './serializeError';
|
|
6
|
+
export type { CodedError, SerializedAxiosError, SerializedCodedError, SerializedGenericError, };
|
|
7
|
+
export { createCodedError, isCodedError, isNetworkError, isLockedError, serializeError, };
|
package/error/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./createCodedError.js"),e=require("./isCodedError.js"),o=require("./isNetworkError.js"),i=require("./isLockedError.js");require("../index-4a932b99.js");require("../axios-5f25f7ff.js");exports.createCodedError=r;exports.isCodedError=e;exports.isNetworkError=o;exports.isLockedError=i;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./createCodedError.js"),e=require("./isCodedError.js"),o=require("./isNetworkError.js"),i=require("./isLockedError.js"),s=require("./serializeError.js");require("../index-4a932b99.js");require("../axios-5f25f7ff.js");exports.createCodedError=r;exports.isCodedError=e;exports.isNetworkError=o;exports.isLockedError=i;exports.serializeError=s;
|
package/error/index.mjs
CHANGED
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
import { default as a } from "./createCodedError.mjs";
|
|
2
2
|
import { default as f } from "./isCodedError.mjs";
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
3
|
+
import { default as i } from "./isNetworkError.mjs";
|
|
4
|
+
import { default as p } from "./isLockedError.mjs";
|
|
5
|
+
import { default as u } from "./serializeError.mjs";
|
|
5
6
|
import "../index-bc13ec04.mjs";
|
|
6
7
|
import "../axios-aa12e368.mjs";
|
|
7
8
|
export {
|
|
8
9
|
a as createCodedError,
|
|
9
10
|
f as isCodedError,
|
|
10
|
-
|
|
11
|
-
|
|
11
|
+
p as isLockedError,
|
|
12
|
+
i as isNetworkError,
|
|
13
|
+
u as serializeError
|
|
12
14
|
};
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AxiosError } from 'axios';
|
|
2
|
+
import { ErrorCode } from '@ancon/wildcat-types';
|
|
3
|
+
import { CodedError } from './createCodedError';
|
|
4
|
+
declare type SerializedAxiosError = {
|
|
5
|
+
message: string;
|
|
6
|
+
code?: string;
|
|
7
|
+
response?: {
|
|
8
|
+
status?: number;
|
|
9
|
+
statusText?: string;
|
|
10
|
+
};
|
|
11
|
+
};
|
|
12
|
+
declare type SerializedCodedError = {
|
|
13
|
+
code: ErrorCode;
|
|
14
|
+
message: string;
|
|
15
|
+
additionalData?: Record<string, unknown>;
|
|
16
|
+
};
|
|
17
|
+
declare type SerializedGenericError = {
|
|
18
|
+
message: string;
|
|
19
|
+
};
|
|
20
|
+
declare function serializeError(error: AxiosError): SerializedAxiosError;
|
|
21
|
+
declare function serializeError(error: CodedError): SerializedCodedError;
|
|
22
|
+
declare function serializeError(error: Error | {
|
|
23
|
+
message: string;
|
|
24
|
+
}): SerializedGenericError;
|
|
25
|
+
export type { SerializedAxiosError, SerializedCodedError, SerializedGenericError, };
|
|
26
|
+
export default serializeError;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const t=require("../index-4a932b99.js"),a=require("./isCodedError.js");require("../axios-5f25f7ff.js");function n(e){var s,i;return{message:e.message,code:e.code,response:{status:(s=e.response)==null?void 0:s.status,statusText:(i=e.response)==null?void 0:i.statusText}}}function u(e){return{message:e.message,code:e.code,additionalData:e.additionalData}}function o(e){return{message:e.message}}function d(e){var s;if(t.isAxiosError(e))return n(e);if(a(e)&&e.message)return u(e);if(e instanceof Error||(s=e==null?void 0:e.message)!=null&&s.length)return o(e);throw new Error("Failed to serialize error")}module.exports=d;
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import { i } from "../index-bc13ec04.mjs";
|
|
2
|
+
import a from "./isCodedError.mjs";
|
|
3
|
+
import "../axios-aa12e368.mjs";
|
|
4
|
+
function n(s) {
|
|
5
|
+
var e, t;
|
|
6
|
+
return {
|
|
7
|
+
message: s.message,
|
|
8
|
+
code: s.code,
|
|
9
|
+
response: {
|
|
10
|
+
status: (e = s.response) == null ? void 0 : e.status,
|
|
11
|
+
statusText: (t = s.response) == null ? void 0 : t.statusText
|
|
12
|
+
}
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
function o(s) {
|
|
16
|
+
return {
|
|
17
|
+
message: s.message,
|
|
18
|
+
code: s.code,
|
|
19
|
+
additionalData: s.additionalData
|
|
20
|
+
};
|
|
21
|
+
}
|
|
22
|
+
function u(s) {
|
|
23
|
+
return {
|
|
24
|
+
message: s.message
|
|
25
|
+
};
|
|
26
|
+
}
|
|
27
|
+
function c(s) {
|
|
28
|
+
var e;
|
|
29
|
+
if (i(s))
|
|
30
|
+
return n(s);
|
|
31
|
+
if (a(s) && s.message)
|
|
32
|
+
return o(s);
|
|
33
|
+
if (s instanceof Error || (e = s == null ? void 0 : s.message) != null && e.length)
|
|
34
|
+
return u(s);
|
|
35
|
+
throw new Error("Failed to serialize error");
|
|
36
|
+
}
|
|
37
|
+
export {
|
|
38
|
+
c as default
|
|
39
|
+
};
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const
|
|
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"),u=require("./outlet/getOutletTagInformation.js"),n=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"),_=require("./outlet/serviceDateTimesFromOpeningHours.js"),O=require("./outlet/getPickerIntervalsForDay.js"),m=require("./outlet/getServiceIntervalRange.js"),k=require("./outlet/getServiceIntervalsForOrderFormat.js"),h=require("./outlet/getOutletFormattedAddress.js"),p=require("./outlet/getPartitionedOutletsList.js"),P=require("./outlet/getOutletPickerTimesForWeek.js"),S=require("./outlet/getOutletOrderPrepTime.js"),f=require("./versioning/isVersionALessThanB.js"),C=require("./versioning/cleanVersionString.js"),F=require("./api/getUrlAndParams.js"),T=require("./api/getEndpointWithVersion.js"),y=require("./api/generateBackoffWithEqualJitter.js"),v=require("./api/isAcceptedResponse.js"),I=require("./api/isNoContentResponse.js"),A=require("./string/slugify.js"),D=require("./string/truncate.js"),R=require("./color/lighten.js"),b=require("./color/brighten.js"),E=require("./color/darken.js"),V=require("./color/isDarkBackground.js"),L=require("./user/getFullName.js"),M=require("./user/getFullAddressString.js"),H=require("./user/getCustomerAddressFromGeocoderResult.js"),N=require("./user/getFormattedPhoneNumber.js"),B=require("./user/getStructuredCustomerAddress.js"),U=require("./logger/Logger.js"),W=require("./logger/types.js"),G=require("./logger/sanitizeAsStringDict.js"),w=require("./printing/getPrinterType.js"),x=require("./printing/isValidPrinter.js"),z=require("./printing/isValidNetworkPrinter.js"),J=require("./printing/isValidStarCloudPrinter.js"),K=require("./printing/isTerminalPrinter.js"),Q=require("./printing/isCloudPrintModeEnabled.js"),j=require("./number/randomIntFromInterval.js"),X=require("./tables/decodeTableQRPayload.js"),Y=require("./checkout/getCheckoutItemModifications.js"),Z=require("./checkout/getCheckoutProductName.js"),e=require("./checkout/getCheckoutOrderStatusTexts.js"),$=require("./checkout/getCheckoutItemsMappedByTicketItemStatus.js"),ee=require("./checkout/isCheckoutOrderSummary.js"),re=require("./checkout/buildCheckoutRequestItem.js"),te=require("./checkout/getCheckoutGrandTotalAmount.js"),ie=require("./checkout/getCheckoutRequestItemFromCheckoutItem.js"),oe=require("./checkout/isCheckoutItemsAreEqual.js"),ue=require("./currency/getFormattedCurrency.js"),ne=require("./inventory/isDetailedProductOutOfStock.js"),se=require("./inventory/isDetailedProductVariantOutOfStocks.js"),ce=require("./inventory/isMenuTreeProductOutOfStock.js"),ae=require("./inventory/isDetailedProductUpSellsOutOfStock.js"),le=require("./inventory/isUpSellProductOutStock.js"),de=require("./inventory/isDetailedProductOutletStockOutOfStock.js"),ge=require("./inventory/getDetailedProductVariantStock.js"),qe=require("./signalr/createUseSignalRHook.js"),_e=require("./signalr/SignalR.js"),Oe=require("./error/createCodedError.js"),me=require("./error/isCodedError.js"),ke=require("./error/isNetworkError.js"),he=require("./error/isLockedError.js"),pe=require("./error/serializeError.js"),Pe=require("./hangfire/isHangfireResponse.js"),Se=require("./hangfire/createHangfirePoller.js"),fe=require("./hangfire/createMakeHangfireRequest.js"),Ce=require("./product/extractProductsFromMenuTree.js"),Fe=require("./product/calculateIngredientsCost.js"),Te=require("./product/calculateAddonGroupCost.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("google-libphonenumber");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=u.default;exports.getOutletAvailabilityInfo=n.default;exports.getOutletOfflineOrderFormats=s;exports.getOutletAvailableOrderFormats=c;exports.getOutletFormattedDistance=a;exports.isOutletAcceptingPreOrders=l;exports.getOutletDeliveryFee=d;exports.getOutletTodayOpeningTimes=g;exports.getOutletOrderFormats=q;exports.serviceDateTimesFromOpeningHours=_;exports.getPickerIntervalsForDay=O;exports.getServiceIntervalRange=m;exports.getServiceIntervalsForOrderFormat=k;exports.getOutletFormattedAddress=h;exports.getPartitionedOutletsList=p;exports.getOutletPickerTimesForWeek=P;exports.getOutletOrderPreparationTime=S;exports.isVersionALessThanB=f;exports.cleanVersionString=C;exports.getUrlAndParams=F;exports.getEndpointWithVersion=T;exports.generateBackoffWithEqualJitter=y;exports.isAcceptedResponse=v;exports.isNoContentResponse=I;exports.slugify=A;exports.truncate=D;exports.lighten=R;exports.brighten=b;exports.darken=E;exports.isDarkBackground=V;exports.getFullName=L;exports.getFullAddressString=M;exports.getCustomerAddressFromGeocoderResult=H;exports.getFormattedPhoneNumber=N;exports.getStructuredCustomerAddress=B;exports.Logger=U;exports.LogLevel=W.LogLevel;exports.sanitizeAsStringDict=G;exports.getPrinterType=w;exports.isValidPrinter=x;exports.isValidNetworkPrinter=z;exports.isValidStarCloudPrinter=J;exports.isTerminalPrinter=K;exports.isCloudPrintModeEnabled=Q;exports.randomIntFromInterval=j;exports.decodeTableQRPayload=X;exports.getCheckoutGroupedModifications=Y;exports.getCheckoutProductName=Z;exports.TranslationKey=e.TranslationKey;exports.getCheckoutOrderStatusTexts=e.default;exports.getCheckoutItemsMappedByTicketItemStatus=$;exports.isCheckoutOrderSummary=ee;exports.buildCheckoutRequestItem=re;exports.getCheckoutGrandTotalAmount=te;exports.getCheckoutRequestItemFromCheckoutItem=ie;exports.isCheckoutItemsAreEqual=oe;exports.getFormattedCurrency=ue;exports.isDetailedProductOutOfStock=ne;exports.isDetailedProductVariantOutOfStocks=se;exports.isMenuTreeProductOutOfStock=ce;exports.isDetailedProductUpSellsOutOfStock=ae;exports.isUpSellProductOutOfStock=le;exports.isDetailedProductOutletStockOutOfStock=de;exports.getDetailedProductVariantStock=ge;exports.createUseSignalRHook=qe;exports.SignalR=_e;exports.createCodedError=Oe;exports.isCodedError=me;exports.isNetworkError=ke;exports.isLockedError=he;exports.serializeError=pe;exports.isHangfireResponse=Pe;exports.createHangfirePoller=Se.default;exports.createMakeHangfireRequest=fe;exports.extractProductsFromMenuTree=Ce;exports.calculateIngredientsCost=Fe;exports.calculateAddonGroupsCost=Te;
|
package/index.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { default as D } from "./shared/isWithinFlag.mjs";
|
|
2
|
-
import { default as
|
|
2
|
+
import { default as E } from "./shared/generateId.mjs";
|
|
3
3
|
import { default as V } from "./shared/wait.mjs";
|
|
4
4
|
import { default as H } from "./outlet/getListOutletOpeningHoursTable.mjs";
|
|
5
5
|
import { default as N } from "./outlet/getOutletTagInformation.mjs";
|
|
@@ -11,71 +11,73 @@ import { default as Q } from "./outlet/isOutletAcceptingPreOrders.mjs";
|
|
|
11
11
|
import { default as X } from "./outlet/getOutletDeliveryFee.mjs";
|
|
12
12
|
import { default as Z } from "./outlet/getOutletTodayOpeningTimes.mjs";
|
|
13
13
|
import { default as $ } from "./outlet/getOutletOrderFormats.mjs";
|
|
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 { default 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 {
|
|
41
|
-
import {
|
|
42
|
-
import { default as
|
|
43
|
-
import { default as
|
|
44
|
-
import { default as
|
|
45
|
-
import { default as
|
|
46
|
-
import { default as
|
|
47
|
-
import { default as
|
|
48
|
-
import { default as
|
|
49
|
-
import { default as
|
|
50
|
-
import { default as
|
|
51
|
-
import { default as
|
|
52
|
-
import {
|
|
53
|
-
import { default as
|
|
54
|
-
import { default as
|
|
55
|
-
import { default as
|
|
56
|
-
import { default as
|
|
57
|
-
import { default as
|
|
58
|
-
import { default as
|
|
59
|
-
import { default as
|
|
60
|
-
import { default as
|
|
61
|
-
import { default as
|
|
62
|
-
import { default as
|
|
63
|
-
import { default as
|
|
64
|
-
import { default as
|
|
65
|
-
import { default as
|
|
66
|
-
import { default as
|
|
67
|
-
import { default as
|
|
68
|
-
import { default as rr } from "./signalr/
|
|
69
|
-
import { default as ar } from "./
|
|
70
|
-
import { default as sr } from "./error/
|
|
71
|
-
import { default as lr } from "./error/
|
|
72
|
-
import { default as mr } from "./error/
|
|
73
|
-
import { default as pr } from "./
|
|
74
|
-
import { default as nr } from "./
|
|
75
|
-
import { default as gr } from "./hangfire/
|
|
76
|
-
import { default as kr } from "./
|
|
77
|
-
import { default as Sr } from "./
|
|
78
|
-
import { default as
|
|
14
|
+
import { default as te } from "./outlet/serviceDateTimesFromOpeningHours.mjs";
|
|
15
|
+
import { default as oe } from "./outlet/getPickerIntervalsForDay.mjs";
|
|
16
|
+
import { default as fe } from "./outlet/getServiceIntervalRange.mjs";
|
|
17
|
+
import { default as ue } from "./outlet/getServiceIntervalsForOrderFormat.mjs";
|
|
18
|
+
import { default as de } from "./outlet/getOutletFormattedAddress.mjs";
|
|
19
|
+
import { default as ie } from "./outlet/getPartitionedOutletsList.mjs";
|
|
20
|
+
import { default as xe } from "./outlet/getOutletPickerTimesForWeek.mjs";
|
|
21
|
+
import { default as ce } from "./outlet/getOutletOrderPrepTime.mjs";
|
|
22
|
+
import { default as Oe } from "./versioning/isVersionALessThanB.mjs";
|
|
23
|
+
import { default as Pe } from "./versioning/cleanVersionString.mjs";
|
|
24
|
+
import { default as Ce } from "./api/getUrlAndParams.mjs";
|
|
25
|
+
import { default as he } from "./api/getEndpointWithVersion.mjs";
|
|
26
|
+
import { default as Ie } from "./api/generateBackoffWithEqualJitter.mjs";
|
|
27
|
+
import { default as ve } from "./api/isAcceptedResponse.mjs";
|
|
28
|
+
import { default as De } from "./api/isNoContentResponse.mjs";
|
|
29
|
+
import { default as Ee } from "./string/slugify.mjs";
|
|
30
|
+
import { default as Ve } from "./string/truncate.mjs";
|
|
31
|
+
import { default as He } from "./color/lighten.mjs";
|
|
32
|
+
import { default as Ne } from "./color/brighten.mjs";
|
|
33
|
+
import { default as Be } from "./color/darken.mjs";
|
|
34
|
+
import { default as Ue } from "./color/isDarkBackground.mjs";
|
|
35
|
+
import { default as we } from "./user/getFullName.mjs";
|
|
36
|
+
import { default as Je } from "./user/getFullAddressString.mjs";
|
|
37
|
+
import { default as Qe } from "./user/getCustomerAddressFromGeocoderResult.mjs";
|
|
38
|
+
import { default as Xe } from "./user/getFormattedPhoneNumber.mjs";
|
|
39
|
+
import { default as Ze } from "./user/getStructuredCustomerAddress.mjs";
|
|
40
|
+
import { default as $e } from "./logger/Logger.mjs";
|
|
41
|
+
import { LogLevel as tt } from "./logger/types.mjs";
|
|
42
|
+
import { default as ot } from "./logger/sanitizeAsStringDict.mjs";
|
|
43
|
+
import { default as ft } from "./printing/getPrinterType.mjs";
|
|
44
|
+
import { default as ut } from "./printing/isValidPrinter.mjs";
|
|
45
|
+
import { default as dt } from "./printing/isValidNetworkPrinter.mjs";
|
|
46
|
+
import { default as it } from "./printing/isValidStarCloudPrinter.mjs";
|
|
47
|
+
import { default as xt } from "./printing/isTerminalPrinter.mjs";
|
|
48
|
+
import { default as ct } from "./printing/isCloudPrintModeEnabled.mjs";
|
|
49
|
+
import { default as Ot } from "./number/randomIntFromInterval.mjs";
|
|
50
|
+
import { default as Pt } from "./tables/decodeTableQRPayload.mjs";
|
|
51
|
+
import { default as Ct } from "./checkout/getCheckoutItemModifications.mjs";
|
|
52
|
+
import { default as ht } from "./checkout/getCheckoutProductName.mjs";
|
|
53
|
+
import { TranslationKey as It, default as At } from "./checkout/getCheckoutOrderStatusTexts.mjs";
|
|
54
|
+
import { default as yt } from "./checkout/getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
55
|
+
import { default as Rt } from "./checkout/isCheckoutOrderSummary.mjs";
|
|
56
|
+
import { default as bt } from "./checkout/buildCheckoutRequestItem.mjs";
|
|
57
|
+
import { default as Lt } from "./checkout/getCheckoutGrandTotalAmount.mjs";
|
|
58
|
+
import { default as Mt } from "./checkout/getCheckoutRequestItemFromCheckoutItem.mjs";
|
|
59
|
+
import { default as qt } from "./checkout/isCheckoutItemsAreEqual.mjs";
|
|
60
|
+
import { default as Gt } from "./currency/getFormattedCurrency.mjs";
|
|
61
|
+
import { default as Wt } from "./inventory/isDetailedProductOutOfStock.mjs";
|
|
62
|
+
import { default as zt } from "./inventory/isDetailedProductVariantOutOfStocks.mjs";
|
|
63
|
+
import { default as Kt } from "./inventory/isMenuTreeProductOutOfStock.mjs";
|
|
64
|
+
import { default as jt } from "./inventory/isDetailedProductUpSellsOutOfStock.mjs";
|
|
65
|
+
import { default as Yt } from "./inventory/isUpSellProductOutStock.mjs";
|
|
66
|
+
import { default as _t } from "./inventory/isDetailedProductOutletStockOutOfStock.mjs";
|
|
67
|
+
import { default as er } from "./inventory/getDetailedProductVariantStock.mjs";
|
|
68
|
+
import { default as rr } from "./signalr/createUseSignalRHook.mjs";
|
|
69
|
+
import { default as ar } from "./signalr/SignalR.mjs";
|
|
70
|
+
import { default as sr } from "./error/createCodedError.mjs";
|
|
71
|
+
import { default as lr } from "./error/isCodedError.mjs";
|
|
72
|
+
import { default as mr } from "./error/isNetworkError.mjs";
|
|
73
|
+
import { default as pr } from "./error/isLockedError.mjs";
|
|
74
|
+
import { default as nr } from "./error/serializeError.mjs";
|
|
75
|
+
import { default as gr } from "./hangfire/isHangfireResponse.mjs";
|
|
76
|
+
import { default as kr } from "./hangfire/createHangfirePoller.mjs";
|
|
77
|
+
import { default as Sr } from "./hangfire/createMakeHangfireRequest.mjs";
|
|
78
|
+
import { default as Fr } from "./product/extractProductsFromMenuTree.mjs";
|
|
79
|
+
import { default as Tr } from "./product/calculateIngredientsCost.mjs";
|
|
80
|
+
import { default as Ar } from "./product/calculateAddonGroupCost.mjs";
|
|
79
81
|
import "moment";
|
|
80
82
|
import "@ancon/wildcat-types";
|
|
81
83
|
import "./outlet/constants.mjs";
|
|
@@ -104,83 +106,85 @@ import "@microsoft/signalr";
|
|
|
104
106
|
import "./index-bc13ec04.mjs";
|
|
105
107
|
import "./axios-aa12e368.mjs";
|
|
106
108
|
export {
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
109
|
+
tt as LogLevel,
|
|
110
|
+
$e as Logger,
|
|
111
|
+
ar as SignalR,
|
|
112
|
+
It as TranslationKey,
|
|
113
|
+
Ne as brighten,
|
|
114
|
+
bt as buildCheckoutRequestItem,
|
|
115
|
+
Ar as calculateAddonGroupsCost,
|
|
116
|
+
Tr as calculateIngredientsCost,
|
|
117
|
+
Pe as cleanVersionString,
|
|
118
|
+
sr as createCodedError,
|
|
119
|
+
kr as createHangfirePoller,
|
|
120
|
+
Sr as createMakeHangfireRequest,
|
|
121
|
+
rr as createUseSignalRHook,
|
|
122
|
+
Be as darken,
|
|
123
|
+
Pt as decodeTableQRPayload,
|
|
124
|
+
Fr as extractProductsFromMenuTree,
|
|
125
|
+
Ie as generateBackoffWithEqualJitter,
|
|
126
|
+
E as generateId,
|
|
127
|
+
Lt as getCheckoutGrandTotalAmount,
|
|
128
|
+
Ct as getCheckoutGroupedModifications,
|
|
129
|
+
yt as getCheckoutItemsMappedByTicketItemStatus,
|
|
130
|
+
At as getCheckoutOrderStatusTexts,
|
|
131
|
+
ht as getCheckoutProductName,
|
|
132
|
+
Mt as getCheckoutRequestItemFromCheckoutItem,
|
|
133
|
+
Qe as getCustomerAddressFromGeocoderResult,
|
|
134
|
+
er as getDetailedProductVariantStock,
|
|
135
|
+
he as getEndpointWithVersion,
|
|
136
|
+
Gt as getFormattedCurrency,
|
|
137
|
+
Xe as getFormattedPhoneNumber,
|
|
138
|
+
Je as getFullAddressString,
|
|
139
|
+
we as getFullName,
|
|
138
140
|
H as getListOutletOpeningHoursTable,
|
|
139
141
|
B as getOutletAvailabilityInfo,
|
|
140
142
|
w as getOutletAvailableOrderFormats,
|
|
141
143
|
X as getOutletDeliveryFee,
|
|
142
|
-
|
|
144
|
+
de as getOutletFormattedAddress,
|
|
143
145
|
J as getOutletFormattedDistance,
|
|
144
146
|
U as getOutletOfflineOrderFormats,
|
|
145
147
|
$ as getOutletOrderFormats,
|
|
146
|
-
|
|
147
|
-
|
|
148
|
+
ce as getOutletOrderPreparationTime,
|
|
149
|
+
xe as getOutletPickerTimesForWeek,
|
|
148
150
|
N as getOutletTagInformation,
|
|
149
151
|
Z as getOutletTodayOpeningTimes,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
152
|
+
ie as getPartitionedOutletsList,
|
|
153
|
+
oe as getPickerIntervalsForDay,
|
|
154
|
+
ft as getPrinterType,
|
|
155
|
+
fe as getServiceIntervalRange,
|
|
156
|
+
ue as getServiceIntervalsForOrderFormat,
|
|
157
|
+
Ze as getStructuredCustomerAddress,
|
|
158
|
+
Ce as getUrlAndParams,
|
|
159
|
+
ve as isAcceptedResponse,
|
|
160
|
+
qt as isCheckoutItemsAreEqual,
|
|
161
|
+
Rt as isCheckoutOrderSummary,
|
|
162
|
+
ct as isCloudPrintModeEnabled,
|
|
163
|
+
lr as isCodedError,
|
|
164
|
+
Ue as isDarkBackground,
|
|
165
|
+
Wt as isDetailedProductOutOfStock,
|
|
166
|
+
_t as isDetailedProductOutletStockOutOfStock,
|
|
167
|
+
jt as isDetailedProductUpSellsOutOfStock,
|
|
168
|
+
zt as isDetailedProductVariantOutOfStocks,
|
|
169
|
+
gr as isHangfireResponse,
|
|
170
|
+
pr as isLockedError,
|
|
171
|
+
Kt as isMenuTreeProductOutOfStock,
|
|
172
|
+
mr as isNetworkError,
|
|
173
|
+
De as isNoContentResponse,
|
|
171
174
|
Q as isOutletAcceptingPreOrders,
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
175
|
+
xt as isTerminalPrinter,
|
|
176
|
+
Yt as isUpSellProductOutOfStock,
|
|
177
|
+
dt as isValidNetworkPrinter,
|
|
178
|
+
ut as isValidPrinter,
|
|
179
|
+
it as isValidStarCloudPrinter,
|
|
180
|
+
Oe as isVersionALessThanB,
|
|
178
181
|
D as isWithinFlag,
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
182
|
+
He as lighten,
|
|
183
|
+
Ot as randomIntFromInterval,
|
|
184
|
+
ot as sanitizeAsStringDict,
|
|
185
|
+
nr as serializeError,
|
|
186
|
+
te as serviceDateTimesFromOpeningHours,
|
|
187
|
+
Ee as slugify,
|
|
188
|
+
Ve as truncate,
|
|
185
189
|
V as wait
|
|
186
190
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancon/wildcat-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.30.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -156,6 +156,11 @@
|
|
|
156
156
|
"require": "./error/isNetworkError.js",
|
|
157
157
|
"types": "./error/isNetworkError.d.ts"
|
|
158
158
|
},
|
|
159
|
+
"./error/serializeError": {
|
|
160
|
+
"import": "./error/serializeError.mjs",
|
|
161
|
+
"require": "./error/serializeError.js",
|
|
162
|
+
"types": "./error/serializeError.d.ts"
|
|
163
|
+
},
|
|
159
164
|
"./hangfire/createHangfirePoller": {
|
|
160
165
|
"import": "./hangfire/createHangfirePoller.mjs",
|
|
161
166
|
"require": "./hangfire/createHangfirePoller.js",
|
|
@@ -581,6 +586,11 @@
|
|
|
581
586
|
"require": "./user/getFullName.js",
|
|
582
587
|
"types": "./user/getFullName.d.ts"
|
|
583
588
|
},
|
|
589
|
+
"./user/getStructuredCustomerAddress": {
|
|
590
|
+
"import": "./user/getStructuredCustomerAddress.mjs",
|
|
591
|
+
"require": "./user/getStructuredCustomerAddress.js",
|
|
592
|
+
"types": "./user/getStructuredCustomerAddress.d.ts"
|
|
593
|
+
},
|
|
584
594
|
"./user": {
|
|
585
595
|
"import": "./user/index.mjs",
|
|
586
596
|
"require": "./user/index.js",
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CustomerAddress } from '@ancon/wildcat-types';
|
|
2
|
+
declare type CustomerAddressLine = {
|
|
3
|
+
line1: string;
|
|
4
|
+
line2: string;
|
|
5
|
+
};
|
|
6
|
+
/**
|
|
7
|
+
* Returns a structured address object with two lines for UI display
|
|
8
|
+
*/
|
|
9
|
+
export default function getStructuredCustomerAddress(address?: CustomerAddress | null): CustomerAddressLine;
|
|
10
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";function i(e){return e.filter(Boolean).join(", ")||""}function l(e){if(e){const{street:r,city:o,state:s,zipCode:c,country:u}=e,t=i([r||"",o||""]),n=i([s||"",c||"",u||""]);return{line1:t||n,line2:t?n:""}}return{line1:"",line2:""}}module.exports=l;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
function i(e) {
|
|
2
|
+
return e.filter(Boolean).join(", ") || "";
|
|
3
|
+
}
|
|
4
|
+
function l(e) {
|
|
5
|
+
if (e) {
|
|
6
|
+
const { street: r, city: o, state: s, zipCode: u, country: c } = e, t = i([r || "", o || ""]), n = i([
|
|
7
|
+
s || "",
|
|
8
|
+
u || "",
|
|
9
|
+
c || ""
|
|
10
|
+
]);
|
|
11
|
+
return {
|
|
12
|
+
line1: t || n,
|
|
13
|
+
line2: t ? n : ""
|
|
14
|
+
};
|
|
15
|
+
}
|
|
16
|
+
return {
|
|
17
|
+
line1: "",
|
|
18
|
+
line2: ""
|
|
19
|
+
};
|
|
20
|
+
}
|
|
21
|
+
export {
|
|
22
|
+
l as default
|
|
23
|
+
};
|
package/user/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ import getFullName from './getFullName';
|
|
|
2
2
|
import getFullAddressString from './getFullAddressString';
|
|
3
3
|
import getCustomerAddressFromGeocoderResult from './getCustomerAddressFromGeocoderResult';
|
|
4
4
|
import getFormattedPhoneNumber from './getFormattedPhoneNumber';
|
|
5
|
-
|
|
5
|
+
import getStructuredCustomerAddress from './getStructuredCustomerAddress';
|
|
6
|
+
export { getFullName, getFullAddressString, getCustomerAddressFromGeocoderResult, getFormattedPhoneNumber, getStructuredCustomerAddress, };
|
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"),t=require("./getCustomerAddressFromGeocoderResult.js"),s=require("./getFormattedPhoneNumber.js");require("google-libphonenumber");exports.getFullName=e;exports.getFullAddressString=r;exports.getCustomerAddressFromGeocoderResult=t;exports.getFormattedPhoneNumber=s;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./getFullName.js"),r=require("./getFullAddressString.js"),t=require("./getCustomerAddressFromGeocoderResult.js"),s=require("./getFormattedPhoneNumber.js"),u=require("./getStructuredCustomerAddress.js");require("google-libphonenumber");exports.getFullName=e;exports.getFullAddressString=r;exports.getCustomerAddressFromGeocoderResult=t;exports.getFormattedPhoneNumber=s;exports.getStructuredCustomerAddress=u;
|
package/user/index.mjs
CHANGED
|
@@ -1,11 +1,13 @@
|
|
|
1
1
|
import { default as o } from "./getFullName.mjs";
|
|
2
|
-
import { default as
|
|
3
|
-
import { default as
|
|
4
|
-
import { default as
|
|
2
|
+
import { default as s } from "./getFullAddressString.mjs";
|
|
3
|
+
import { default as a } from "./getCustomerAddressFromGeocoderResult.mjs";
|
|
4
|
+
import { default as f } from "./getFormattedPhoneNumber.mjs";
|
|
5
|
+
import { default as g } from "./getStructuredCustomerAddress.mjs";
|
|
5
6
|
import "google-libphonenumber";
|
|
6
7
|
export {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
o as getFullName
|
|
8
|
+
a as getCustomerAddressFromGeocoderResult,
|
|
9
|
+
f as getFormattedPhoneNumber,
|
|
10
|
+
s as getFullAddressString,
|
|
11
|
+
o as getFullName,
|
|
12
|
+
g as getStructuredCustomerAddress
|
|
11
13
|
};
|