@ancon/wildcat-utils 1.29.5 → 1.30.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/checkout/checkoutHasWallet.d.ts +2 -0
- package/checkout/checkoutHasWallet.js +1 -0
- package/checkout/checkoutHasWallet.mjs +12 -0
- package/checkout/getWalletMetaFromCheckout.d.ts +4 -0
- package/checkout/getWalletMetaFromCheckout.js +1 -0
- package/checkout/getWalletMetaFromCheckout.mjs +19 -0
- package/checkout/index.d.ts +3 -1
- package/checkout/index.js +1 -1
- package/checkout/index.mjs +14 -10
- 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 +147 -141
- package/package.json +16 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const s=require("@ancon/wildcat-types");function p(e){return!!(e!=null&&e.items.some(t=>{var r;return((r=t.product)==null?void 0:r.productType)===s.ProductType.PrepaidWallet}))}module.exports=p;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { ProductType as p } from "@ancon/wildcat-types";
|
|
2
|
+
function d(r) {
|
|
3
|
+
return !!(r != null && r.items.some(
|
|
4
|
+
(e) => {
|
|
5
|
+
var t;
|
|
6
|
+
return ((t = e.product) == null ? void 0 : t.productType) === p.PrepaidWallet;
|
|
7
|
+
}
|
|
8
|
+
));
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
d as default
|
|
12
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("@ancon/wildcat-types");function a(e){var i;const d=(i=e.items)==null?void 0:i.find(t=>{var r;return((r=t.product)==null?void 0:r.productType)===n.ProductType.PrepaidWallet});if(d){const t=e==null?void 0:e.metaData.find(r=>r.checkoutItemId===d.id);return t==null?void 0:t.metaData}}module.exports=a;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { ProductType as i } from "@ancon/wildcat-types";
|
|
2
|
+
function n(r) {
|
|
3
|
+
var a;
|
|
4
|
+
const d = (a = r.items) == null ? void 0 : a.find(
|
|
5
|
+
(t) => {
|
|
6
|
+
var e;
|
|
7
|
+
return ((e = t.product) == null ? void 0 : e.productType) === i.PrepaidWallet;
|
|
8
|
+
}
|
|
9
|
+
);
|
|
10
|
+
if (d) {
|
|
11
|
+
const t = r == null ? void 0 : r.metaData.find(
|
|
12
|
+
(e) => e.checkoutItemId === d.id
|
|
13
|
+
);
|
|
14
|
+
return t == null ? void 0 : t.metaData;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export {
|
|
18
|
+
n as default
|
|
19
|
+
};
|
package/checkout/index.d.ts
CHANGED
|
@@ -7,4 +7,6 @@ import buildCheckoutRequestItem from './buildCheckoutRequestItem';
|
|
|
7
7
|
import getCheckoutGrandTotalAmount from './getCheckoutGrandTotalAmount';
|
|
8
8
|
import getCheckoutRequestItemFromCheckoutItem from './getCheckoutRequestItemFromCheckoutItem';
|
|
9
9
|
import isCheckoutItemsAreEqual from './isCheckoutItemsAreEqual';
|
|
10
|
-
|
|
10
|
+
import checkoutHasWallet from './checkoutHasWallet';
|
|
11
|
+
import getWalletMetaFromCheckout from './getWalletMetaFromCheckout';
|
|
12
|
+
export { TranslationKey, getCheckoutGroupedModifications, getCheckoutProductName, getCheckoutOrderStatusTexts, getCheckoutItemsMappedByTicketItemStatus, isCheckoutOrderSummary, buildCheckoutRequestItem, getCheckoutGrandTotalAmount, getCheckoutRequestItemFromCheckoutItem, isCheckoutItemsAreEqual, checkoutHasWallet, getWalletMetaFromCheckout, };
|
package/checkout/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./getCheckoutItemModifications.js"),u=require("./getCheckoutProductName.js"),e=require("./getCheckoutOrderStatusTexts.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./getCheckoutItemModifications.js"),u=require("./getCheckoutProductName.js"),e=require("./getCheckoutOrderStatusTexts.js"),c=require("./getCheckoutItemsMappedByTicketItemStatus.js"),o=require("./isCheckoutOrderSummary.js"),r=require("./buildCheckoutRequestItem.js"),k=require("./getCheckoutGrandTotalAmount.js"),s=require("./getCheckoutRequestItemFromCheckoutItem.js"),h=require("./isCheckoutItemsAreEqual.js"),a=require("./checkoutHasWallet.js"),i=require("./getWalletMetaFromCheckout.js");require("@ancon/wildcat-types");require("../currency/getFormattedCurrency.js");require("../currency/getFormattedCurrencyPostfix.js");exports.getCheckoutGroupedModifications=t;exports.getCheckoutProductName=u;exports.TranslationKey=e.TranslationKey;exports.getCheckoutOrderStatusTexts=e.default;exports.getCheckoutItemsMappedByTicketItemStatus=c;exports.isCheckoutOrderSummary=o;exports.buildCheckoutRequestItem=r;exports.getCheckoutGrandTotalAmount=k;exports.getCheckoutRequestItemFromCheckoutItem=s;exports.isCheckoutItemsAreEqual=h;exports.checkoutHasWallet=a;exports.getWalletMetaFromCheckout=i;
|
package/checkout/index.mjs
CHANGED
|
@@ -1,24 +1,28 @@
|
|
|
1
1
|
import { default as u } from "./getCheckoutItemModifications.mjs";
|
|
2
|
-
import { default as
|
|
3
|
-
import { TranslationKey as d, default as
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as
|
|
6
|
-
import { default as
|
|
2
|
+
import { default as f } from "./getCheckoutProductName.mjs";
|
|
3
|
+
import { TranslationKey as d, default as l } from "./getCheckoutOrderStatusTexts.mjs";
|
|
4
|
+
import { default as c } from "./getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
5
|
+
import { default as h } from "./isCheckoutOrderSummary.mjs";
|
|
6
|
+
import { default as i } from "./buildCheckoutRequestItem.mjs";
|
|
7
7
|
import { default as g } from "./getCheckoutGrandTotalAmount.mjs";
|
|
8
8
|
import { default as n } from "./getCheckoutRequestItemFromCheckoutItem.mjs";
|
|
9
9
|
import { default as q } from "./isCheckoutItemsAreEqual.mjs";
|
|
10
|
+
import { default as M } from "./checkoutHasWallet.mjs";
|
|
11
|
+
import { default as A } from "./getWalletMetaFromCheckout.mjs";
|
|
10
12
|
import "@ancon/wildcat-types";
|
|
11
13
|
import "../currency/getFormattedCurrency.mjs";
|
|
12
14
|
import "../currency/getFormattedCurrencyPostfix.mjs";
|
|
13
15
|
export {
|
|
14
16
|
d as TranslationKey,
|
|
15
|
-
|
|
17
|
+
i as buildCheckoutRequestItem,
|
|
18
|
+
M as checkoutHasWallet,
|
|
16
19
|
g as getCheckoutGrandTotalAmount,
|
|
17
20
|
u as getCheckoutGroupedModifications,
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
+
c as getCheckoutItemsMappedByTicketItemStatus,
|
|
22
|
+
l as getCheckoutOrderStatusTexts,
|
|
23
|
+
f as getCheckoutProductName,
|
|
21
24
|
n as getCheckoutRequestItemFromCheckoutItem,
|
|
25
|
+
A as getWalletMetaFromCheckout,
|
|
22
26
|
q as isCheckoutItemsAreEqual,
|
|
23
|
-
|
|
27
|
+
h as isCheckoutOrderSummary
|
|
24
28
|
};
|
|
@@ -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 t=require("./shared/isWithinFlag.js"),r=require("./shared/generateId.js"),i=require("./shared/wait.js"),o=require("./outlet/getListOutletOpeningHoursTable.js"),u=require("./outlet/getOutletTagInformation.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./shared/isWithinFlag.js"),r=require("./shared/generateId.js"),i=require("./shared/wait.js"),o=require("./outlet/getListOutletOpeningHoursTable.js"),u=require("./outlet/getOutletTagInformation.js"),s=require("./outlet/getOutletAvailabilityInfo.js"),n=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"),k=require("./outlet/getServiceIntervalRange.js"),m=require("./outlet/getServiceIntervalsForOrderFormat.js"),h=require("./outlet/getOutletFormattedAddress.js"),p=require("./outlet/getPartitionedOutletsList.js"),P=require("./outlet/getOutletPickerTimesForWeek.js"),S=require("./outlet/getOutletOrderPrepTime.js"),C=require("./versioning/isVersionALessThanB.js"),F=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"),M=require("./user/getFullName.js"),H=require("./user/getFullAddressString.js"),L=require("./user/getCustomerAddressFromGeocoderResult.js"),N=require("./user/getFormattedPhoneNumber.js"),W=require("./user/getStructuredCustomerAddress.js"),B=require("./logger/Logger.js"),U=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"),te=require("./checkout/buildCheckoutRequestItem.js"),re=require("./checkout/getCheckoutGrandTotalAmount.js"),ie=require("./checkout/getCheckoutRequestItemFromCheckoutItem.js"),oe=require("./checkout/isCheckoutItemsAreEqual.js"),ue=require("./checkout/checkoutHasWallet.js"),se=require("./checkout/getWalletMetaFromCheckout.js"),ne=require("./currency/getFormattedCurrency.js"),ce=require("./inventory/isDetailedProductOutOfStock.js"),ae=require("./inventory/isDetailedProductVariantOutOfStocks.js"),le=require("./inventory/isMenuTreeProductOutOfStock.js"),de=require("./inventory/isDetailedProductUpSellsOutOfStock.js"),ge=require("./inventory/isUpSellProductOutStock.js"),qe=require("./inventory/isDetailedProductOutletStockOutOfStock.js"),_e=require("./inventory/getDetailedProductVariantStock.js"),Oe=require("./signalr/createUseSignalRHook.js"),ke=require("./signalr/SignalR.js"),me=require("./error/createCodedError.js"),he=require("./error/isCodedError.js"),pe=require("./error/isNetworkError.js"),Pe=require("./error/isLockedError.js"),Se=require("./error/serializeError.js"),Ce=require("./hangfire/isHangfireResponse.js"),Fe=require("./hangfire/createHangfirePoller.js"),fe=require("./hangfire/createMakeHangfireRequest.js"),Te=require("./product/extractProductsFromMenuTree.js"),ye=require("./product/calculateIngredientsCost.js"),ve=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=t;exports.generateId=r;exports.wait=i;exports.getListOutletOpeningHoursTable=o;exports.getOutletTagInformation=u.default;exports.getOutletAvailabilityInfo=s.default;exports.getOutletOfflineOrderFormats=n;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=k;exports.getServiceIntervalsForOrderFormat=m;exports.getOutletFormattedAddress=h;exports.getPartitionedOutletsList=p;exports.getOutletPickerTimesForWeek=P;exports.getOutletOrderPreparationTime=S;exports.isVersionALessThanB=C;exports.cleanVersionString=F;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=M;exports.getFullAddressString=H;exports.getCustomerAddressFromGeocoderResult=L;exports.getFormattedPhoneNumber=N;exports.getStructuredCustomerAddress=W;exports.Logger=B;exports.LogLevel=U.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=te;exports.getCheckoutGrandTotalAmount=re;exports.getCheckoutRequestItemFromCheckoutItem=ie;exports.isCheckoutItemsAreEqual=oe;exports.checkoutHasWallet=ue;exports.getWalletMetaFromCheckout=se;exports.getFormattedCurrency=ne;exports.isDetailedProductOutOfStock=ce;exports.isDetailedProductVariantOutOfStocks=ae;exports.isMenuTreeProductOutOfStock=le;exports.isDetailedProductUpSellsOutOfStock=de;exports.isUpSellProductOutOfStock=ge;exports.isDetailedProductOutletStockOutOfStock=qe;exports.getDetailedProductVariantStock=_e;exports.createUseSignalRHook=Oe;exports.SignalR=ke;exports.createCodedError=me;exports.isCodedError=he;exports.isNetworkError=pe;exports.isLockedError=Pe;exports.serializeError=Se;exports.isHangfireResponse=Ce;exports.createHangfirePoller=Fe.default;exports.createMakeHangfireRequest=fe;exports.extractProductsFromMenuTree=Te;exports.calculateIngredientsCost=ye;exports.calculateAddonGroupsCost=ve;
|
package/index.mjs
CHANGED
|
@@ -1,82 +1,85 @@
|
|
|
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
|
-
import { default as
|
|
4
|
+
import { default as L } from "./outlet/getListOutletOpeningHoursTable.mjs";
|
|
5
5
|
import { default as N } from "./outlet/getOutletTagInformation.mjs";
|
|
6
|
-
import { default as
|
|
7
|
-
import { default as
|
|
6
|
+
import { default as q } from "./outlet/getOutletAvailabilityInfo.mjs";
|
|
7
|
+
import { default as G } from "./outlet/getOutletOfflineOrderFormats.mjs";
|
|
8
8
|
import { default as w } from "./outlet/getOutletAvailableOrderFormats.mjs";
|
|
9
9
|
import { default as J } from "./outlet/getOutletFormattedDistance.mjs";
|
|
10
10
|
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 { default as $
|
|
41
|
-
import { LogLevel as
|
|
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 { default as
|
|
53
|
-
import { TranslationKey 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 "./
|
|
69
|
-
import { default as ar } from "./
|
|
70
|
-
import { default as sr } from "./
|
|
71
|
-
import { default as
|
|
72
|
-
import { default as mr } from "./error/
|
|
73
|
-
import { default as pr } from "./error/
|
|
74
|
-
import { default as nr } from "./
|
|
75
|
-
import { default as gr } from "./
|
|
76
|
-
import { default as kr } from "./
|
|
77
|
-
import { default as Sr } from "./
|
|
78
|
-
import { default as Fr } from "./
|
|
79
|
-
import { default as Tr } from "./
|
|
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 Le } from "./color/lighten.mjs";
|
|
32
|
+
import { default as Ne } from "./color/brighten.mjs";
|
|
33
|
+
import { default as qe } from "./color/darken.mjs";
|
|
34
|
+
import { default as Ge } 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 Ht } from "./checkout/getCheckoutGrandTotalAmount.mjs";
|
|
58
|
+
import { default as Mt } from "./checkout/getCheckoutRequestItemFromCheckoutItem.mjs";
|
|
59
|
+
import { default as Wt } from "./checkout/isCheckoutItemsAreEqual.mjs";
|
|
60
|
+
import { default as Bt } from "./checkout/checkoutHasWallet.mjs";
|
|
61
|
+
import { default as Ut } from "./checkout/getWalletMetaFromCheckout.mjs";
|
|
62
|
+
import { default as zt } from "./currency/getFormattedCurrency.mjs";
|
|
63
|
+
import { default as Kt } from "./inventory/isDetailedProductOutOfStock.mjs";
|
|
64
|
+
import { default as jt } from "./inventory/isDetailedProductVariantOutOfStocks.mjs";
|
|
65
|
+
import { default as Yt } from "./inventory/isMenuTreeProductOutOfStock.mjs";
|
|
66
|
+
import { default as _t } from "./inventory/isDetailedProductUpSellsOutOfStock.mjs";
|
|
67
|
+
import { default as er } from "./inventory/isUpSellProductOutStock.mjs";
|
|
68
|
+
import { default as rr } from "./inventory/isDetailedProductOutletStockOutOfStock.mjs";
|
|
69
|
+
import { default as ar } from "./inventory/getDetailedProductVariantStock.mjs";
|
|
70
|
+
import { default as sr } from "./signalr/createUseSignalRHook.mjs";
|
|
71
|
+
import { default as lr } from "./signalr/SignalR.mjs";
|
|
72
|
+
import { default as mr } from "./error/createCodedError.mjs";
|
|
73
|
+
import { default as pr } from "./error/isCodedError.mjs";
|
|
74
|
+
import { default as nr } from "./error/isNetworkError.mjs";
|
|
75
|
+
import { default as gr } from "./error/isLockedError.mjs";
|
|
76
|
+
import { default as kr } from "./error/serializeError.mjs";
|
|
77
|
+
import { default as Sr } from "./hangfire/isHangfireResponse.mjs";
|
|
78
|
+
import { default as Fr } from "./hangfire/createHangfirePoller.mjs";
|
|
79
|
+
import { default as Tr } from "./hangfire/createMakeHangfireRequest.mjs";
|
|
80
|
+
import { default as Ar } from "./product/extractProductsFromMenuTree.mjs";
|
|
81
|
+
import { default as yr } from "./product/calculateIngredientsCost.mjs";
|
|
82
|
+
import { default as Rr } from "./product/calculateAddonGroupCost.mjs";
|
|
80
83
|
import "moment";
|
|
81
84
|
import "@ancon/wildcat-types";
|
|
82
85
|
import "./outlet/constants.mjs";
|
|
@@ -105,84 +108,87 @@ import "@microsoft/signalr";
|
|
|
105
108
|
import "./index-bc13ec04.mjs";
|
|
106
109
|
import "./axios-aa12e368.mjs";
|
|
107
110
|
export {
|
|
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
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
111
|
+
tt as LogLevel,
|
|
112
|
+
$e as Logger,
|
|
113
|
+
lr as SignalR,
|
|
114
|
+
It as TranslationKey,
|
|
115
|
+
Ne as brighten,
|
|
116
|
+
bt as buildCheckoutRequestItem,
|
|
117
|
+
Rr as calculateAddonGroupsCost,
|
|
118
|
+
yr as calculateIngredientsCost,
|
|
119
|
+
Bt as checkoutHasWallet,
|
|
120
|
+
Pe as cleanVersionString,
|
|
121
|
+
mr as createCodedError,
|
|
122
|
+
Fr as createHangfirePoller,
|
|
123
|
+
Tr as createMakeHangfireRequest,
|
|
124
|
+
sr as createUseSignalRHook,
|
|
125
|
+
qe as darken,
|
|
126
|
+
Pt as decodeTableQRPayload,
|
|
127
|
+
Ar as extractProductsFromMenuTree,
|
|
128
|
+
Ie as generateBackoffWithEqualJitter,
|
|
129
|
+
E as generateId,
|
|
130
|
+
Ht as getCheckoutGrandTotalAmount,
|
|
131
|
+
Ct as getCheckoutGroupedModifications,
|
|
132
|
+
yt as getCheckoutItemsMappedByTicketItemStatus,
|
|
133
|
+
At as getCheckoutOrderStatusTexts,
|
|
134
|
+
ht as getCheckoutProductName,
|
|
135
|
+
Mt as getCheckoutRequestItemFromCheckoutItem,
|
|
136
|
+
Qe as getCustomerAddressFromGeocoderResult,
|
|
137
|
+
ar as getDetailedProductVariantStock,
|
|
138
|
+
he as getEndpointWithVersion,
|
|
139
|
+
zt as getFormattedCurrency,
|
|
140
|
+
Xe as getFormattedPhoneNumber,
|
|
141
|
+
Je as getFullAddressString,
|
|
142
|
+
we as getFullName,
|
|
143
|
+
L as getListOutletOpeningHoursTable,
|
|
144
|
+
q as getOutletAvailabilityInfo,
|
|
141
145
|
w as getOutletAvailableOrderFormats,
|
|
142
146
|
X as getOutletDeliveryFee,
|
|
143
|
-
|
|
147
|
+
de as getOutletFormattedAddress,
|
|
144
148
|
J as getOutletFormattedDistance,
|
|
145
|
-
|
|
149
|
+
G as getOutletOfflineOrderFormats,
|
|
146
150
|
$ as getOutletOrderFormats,
|
|
147
|
-
|
|
148
|
-
|
|
151
|
+
ce as getOutletOrderPreparationTime,
|
|
152
|
+
xe as getOutletPickerTimesForWeek,
|
|
149
153
|
N as getOutletTagInformation,
|
|
150
154
|
Z as getOutletTodayOpeningTimes,
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
155
|
+
ie as getPartitionedOutletsList,
|
|
156
|
+
oe as getPickerIntervalsForDay,
|
|
157
|
+
ft as getPrinterType,
|
|
158
|
+
fe as getServiceIntervalRange,
|
|
159
|
+
ue as getServiceIntervalsForOrderFormat,
|
|
160
|
+
Ze as getStructuredCustomerAddress,
|
|
161
|
+
Ce as getUrlAndParams,
|
|
162
|
+
Ut as getWalletMetaFromCheckout,
|
|
163
|
+
ve as isAcceptedResponse,
|
|
164
|
+
Wt as isCheckoutItemsAreEqual,
|
|
165
|
+
Rt as isCheckoutOrderSummary,
|
|
166
|
+
ct as isCloudPrintModeEnabled,
|
|
167
|
+
pr as isCodedError,
|
|
168
|
+
Ge as isDarkBackground,
|
|
169
|
+
Kt as isDetailedProductOutOfStock,
|
|
170
|
+
rr as isDetailedProductOutletStockOutOfStock,
|
|
171
|
+
_t as isDetailedProductUpSellsOutOfStock,
|
|
172
|
+
jt as isDetailedProductVariantOutOfStocks,
|
|
173
|
+
Sr as isHangfireResponse,
|
|
174
|
+
gr as isLockedError,
|
|
175
|
+
Yt as isMenuTreeProductOutOfStock,
|
|
176
|
+
nr as isNetworkError,
|
|
177
|
+
De as isNoContentResponse,
|
|
173
178
|
Q as isOutletAcceptingPreOrders,
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
179
|
+
xt as isTerminalPrinter,
|
|
180
|
+
er as isUpSellProductOutOfStock,
|
|
181
|
+
dt as isValidNetworkPrinter,
|
|
182
|
+
ut as isValidPrinter,
|
|
183
|
+
it as isValidStarCloudPrinter,
|
|
184
|
+
Oe as isVersionALessThanB,
|
|
180
185
|
D as isWithinFlag,
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
186
|
+
Le as lighten,
|
|
187
|
+
Ot as randomIntFromInterval,
|
|
188
|
+
ot as sanitizeAsStringDict,
|
|
189
|
+
kr as serializeError,
|
|
190
|
+
te as serviceDateTimesFromOpeningHours,
|
|
191
|
+
Ee as slugify,
|
|
192
|
+
Ve as truncate,
|
|
187
193
|
V as wait
|
|
188
194
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancon/wildcat-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.30.1",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -41,6 +41,11 @@
|
|
|
41
41
|
"require": "./checkout/buildCheckoutRequestItem.js",
|
|
42
42
|
"types": "./checkout/buildCheckoutRequestItem.d.ts"
|
|
43
43
|
},
|
|
44
|
+
"./checkout/checkoutHasWallet": {
|
|
45
|
+
"import": "./checkout/checkoutHasWallet.mjs",
|
|
46
|
+
"require": "./checkout/checkoutHasWallet.js",
|
|
47
|
+
"types": "./checkout/checkoutHasWallet.d.ts"
|
|
48
|
+
},
|
|
44
49
|
"./checkout/getCheckoutGrandTotalAmount": {
|
|
45
50
|
"import": "./checkout/getCheckoutGrandTotalAmount.mjs",
|
|
46
51
|
"require": "./checkout/getCheckoutGrandTotalAmount.js",
|
|
@@ -71,6 +76,11 @@
|
|
|
71
76
|
"require": "./checkout/getCheckoutRequestItemFromCheckoutItem.js",
|
|
72
77
|
"types": "./checkout/getCheckoutRequestItemFromCheckoutItem.d.ts"
|
|
73
78
|
},
|
|
79
|
+
"./checkout/getWalletMetaFromCheckout": {
|
|
80
|
+
"import": "./checkout/getWalletMetaFromCheckout.mjs",
|
|
81
|
+
"require": "./checkout/getWalletMetaFromCheckout.js",
|
|
82
|
+
"types": "./checkout/getWalletMetaFromCheckout.d.ts"
|
|
83
|
+
},
|
|
74
84
|
"./checkout": {
|
|
75
85
|
"import": "./checkout/index.mjs",
|
|
76
86
|
"require": "./checkout/index.js",
|
|
@@ -156,6 +166,11 @@
|
|
|
156
166
|
"require": "./error/isNetworkError.js",
|
|
157
167
|
"types": "./error/isNetworkError.d.ts"
|
|
158
168
|
},
|
|
169
|
+
"./error/serializeError": {
|
|
170
|
+
"import": "./error/serializeError.mjs",
|
|
171
|
+
"require": "./error/serializeError.js",
|
|
172
|
+
"types": "./error/serializeError.d.ts"
|
|
173
|
+
},
|
|
159
174
|
"./hangfire/createHangfirePoller": {
|
|
160
175
|
"import": "./hangfire/createHangfirePoller.mjs",
|
|
161
176
|
"require": "./hangfire/createHangfirePoller.js",
|