@ancon/wildcat-utils 1.37.2 → 1.38.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/checkout/index.d.ts +1 -2
- package/checkout/index.js +1 -1
- package/checkout/index.mjs +26 -29
- package/checkout/isCheckoutAlreadyPaidStatus.js +1 -1
- package/checkout/isCheckoutAlreadyPaidStatus.mjs +5 -6
- package/index.js +1 -1
- package/index.mjs +83 -83
- package/outlet/getOutletActiveOpeningInterval.d.ts +11 -0
- package/outlet/getOutletActiveOpeningInterval.js +1 -0
- package/outlet/getOutletActiveOpeningInterval.mjs +45 -0
- package/package.json +16 -6
- package/string/getRandomAlphaNumericCode.d.ts +7 -0
- package/string/getRandomAlphaNumericCode.js +1 -0
- package/string/getRandomAlphaNumericCode.mjs +12 -0
- package/string/index.d.ts +2 -1
- package/string/index.js +1 -1
- package/string/index.mjs +4 -2
- package/time/getPrevNthMinute.d.ts +14 -0
- package/time/getPrevNthMinute.js +1 -0
- package/time/getPrevNthMinute.mjs +9 -0
- package/time/index.d.ts +2 -1
- package/time/index.js +1 -1
- package/time/index.mjs +6 -4
- package/checkout/isCheckoutAlreadyPaidError.d.ts +0 -6
- package/checkout/isCheckoutAlreadyPaidError.js +0 -1
- package/checkout/isCheckoutAlreadyPaidError.mjs +0 -21
package/checkout/index.d.ts
CHANGED
|
@@ -12,7 +12,6 @@ import getWalletMetaFromCheckout from './getWalletMetaFromCheckout';
|
|
|
12
12
|
import isPreOrderServiceTime from './isPreOrderServiceTime';
|
|
13
13
|
import isPreOrderCheckout from './isPreOrderCheckout';
|
|
14
14
|
import isUpdatingCheckoutAllowed from './isUpdatingCheckoutAllowed';
|
|
15
|
-
import isCheckoutAlreadyPaidError from './isCheckoutAlreadyPaidError';
|
|
16
15
|
import isCheckoutAlreadyPaidStatus from './isCheckoutAlreadyPaidStatus';
|
|
17
16
|
import getCheckoutPaymentErrorTranslationTexts, { CheckoutPaymentErrorTranslationKey } from './getCheckoutPaymentErrorTranslationTexts';
|
|
18
|
-
export { TranslationKey, getCheckoutGroupedModifications, getCheckoutProductName, getCheckoutOrderStatusTexts, getCheckoutItemsMappedByTicketItemStatus, isCheckoutOrderSummary, buildCheckoutRequestItem, getCheckoutGrandTotalAmount, getCheckoutRequestItemFromCheckoutItem, isCheckoutItemsAreEqual, checkoutHasWallet, getWalletMetaFromCheckout, isPreOrderCheckout, isPreOrderServiceTime, isUpdatingCheckoutAllowed,
|
|
17
|
+
export { TranslationKey, getCheckoutGroupedModifications, getCheckoutProductName, getCheckoutOrderStatusTexts, getCheckoutItemsMappedByTicketItemStatus, isCheckoutOrderSummary, buildCheckoutRequestItem, getCheckoutGrandTotalAmount, getCheckoutRequestItemFromCheckoutItem, isCheckoutItemsAreEqual, checkoutHasWallet, getWalletMetaFromCheckout, isPreOrderCheckout, isPreOrderServiceTime, isUpdatingCheckoutAllowed, isCheckoutAlreadyPaidStatus, CheckoutPaymentErrorTranslationKey, getCheckoutPaymentErrorTranslationTexts, };
|
package/checkout/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./getCheckoutItemModifications.js"),u=require("./getCheckoutProductName.js"),e=require("./getCheckoutOrderStatusTexts.js"),o=require("./getCheckoutItemsMappedByTicketItemStatus.js"),c=require("./isCheckoutOrderSummary.js"),i=require("./buildCheckoutRequestItem.js"),s=require("./getCheckoutGrandTotalAmount.js"),a=require("./getCheckoutRequestItemFromCheckoutItem.js"),k=require("./isCheckoutItemsAreEqual.js"),h=require("./checkoutHasWallet.js"),n=require("./getWalletMetaFromCheckout.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./getCheckoutItemModifications.js"),u=require("./getCheckoutProductName.js"),e=require("./getCheckoutOrderStatusTexts.js"),o=require("./getCheckoutItemsMappedByTicketItemStatus.js"),c=require("./isCheckoutOrderSummary.js"),i=require("./buildCheckoutRequestItem.js"),s=require("./getCheckoutGrandTotalAmount.js"),a=require("./getCheckoutRequestItemFromCheckoutItem.js"),k=require("./isCheckoutItemsAreEqual.js"),h=require("./checkoutHasWallet.js"),n=require("./getWalletMetaFromCheckout.js"),m=require("./isPreOrderServiceTime.js"),C=require("./isPreOrderCheckout.js"),d=require("./isUpdatingCheckoutAllowed.js"),l=require("./isCheckoutAlreadyPaidStatus.js"),t=require("./getCheckoutPaymentErrorTranslationTexts.js");require("@ancon/wildcat-types");require("../currency/getFormattedCurrency.js");require("../currency/getFormattedCurrencyPostfix.js");require("../_baseIsEqual-a66350f1.js");require("../isObjectLike-0cc89d64.js");require("axios");require("../error/isSerializedAPIError.js");exports.getCheckoutGroupedModifications=r;exports.getCheckoutProductName=u;exports.TranslationKey=e.TranslationKey;exports.getCheckoutOrderStatusTexts=e.default;exports.getCheckoutItemsMappedByTicketItemStatus=o;exports.isCheckoutOrderSummary=c;exports.buildCheckoutRequestItem=i;exports.getCheckoutGrandTotalAmount=s;exports.getCheckoutRequestItemFromCheckoutItem=a;exports.isCheckoutItemsAreEqual=k;exports.checkoutHasWallet=h;exports.getWalletMetaFromCheckout=n;exports.isPreOrderServiceTime=m;exports.isPreOrderCheckout=C;exports.isUpdatingCheckoutAllowed=d;exports.isCheckoutAlreadyPaidStatus=l;exports.CheckoutPaymentErrorTranslationKey=t.CheckoutPaymentErrorTranslationKey;exports.getCheckoutPaymentErrorTranslationTexts=t.default;
|
package/checkout/index.mjs
CHANGED
|
@@ -1,46 +1,43 @@
|
|
|
1
|
-
import { default as
|
|
2
|
-
import { default as
|
|
3
|
-
import { TranslationKey as
|
|
4
|
-
import { default as
|
|
5
|
-
import { default as
|
|
1
|
+
import { default as d } from "./getCheckoutItemModifications.mjs";
|
|
2
|
+
import { default as p } from "./getCheckoutProductName.mjs";
|
|
3
|
+
import { TranslationKey as c, default as k } from "./getCheckoutOrderStatusTexts.mjs";
|
|
4
|
+
import { default as h } from "./getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
5
|
+
import { default as n } from "./isCheckoutOrderSummary.mjs";
|
|
6
6
|
import { default as T } from "./buildCheckoutRequestItem.mjs";
|
|
7
7
|
import { default as I } from "./getCheckoutGrandTotalAmount.mjs";
|
|
8
8
|
import { default as S } from "./getCheckoutRequestItemFromCheckoutItem.mjs";
|
|
9
9
|
import { default as O } from "./isCheckoutItemsAreEqual.mjs";
|
|
10
|
-
import { default as
|
|
11
|
-
import { default as
|
|
12
|
-
import { default as
|
|
13
|
-
import { default as
|
|
14
|
-
import { default as
|
|
15
|
-
import { default as
|
|
16
|
-
import { default as U } from "./
|
|
17
|
-
import { CheckoutPaymentErrorTranslationKey as z, default as D } from "./getCheckoutPaymentErrorTranslationTexts.mjs";
|
|
10
|
+
import { default as E } from "./checkoutHasWallet.mjs";
|
|
11
|
+
import { default as F } from "./getWalletMetaFromCheckout.mjs";
|
|
12
|
+
import { default as K } from "./isPreOrderServiceTime.mjs";
|
|
13
|
+
import { default as W } from "./isPreOrderCheckout.mjs";
|
|
14
|
+
import { default as v } from "./isUpdatingCheckoutAllowed.mjs";
|
|
15
|
+
import { default as B } from "./isCheckoutAlreadyPaidStatus.mjs";
|
|
16
|
+
import { CheckoutPaymentErrorTranslationKey as N, default as U } from "./getCheckoutPaymentErrorTranslationTexts.mjs";
|
|
18
17
|
import "@ancon/wildcat-types";
|
|
19
18
|
import "../currency/getFormattedCurrency.mjs";
|
|
20
19
|
import "../currency/getFormattedCurrencyPostfix.mjs";
|
|
21
20
|
import "../_baseIsEqual-f66441d7.mjs";
|
|
22
21
|
import "../isObjectLike-7895e9dd.mjs";
|
|
23
22
|
import "axios";
|
|
24
|
-
import "../error/isAPIError.mjs";
|
|
25
23
|
import "../error/isSerializedAPIError.mjs";
|
|
26
24
|
export {
|
|
27
|
-
|
|
28
|
-
|
|
25
|
+
N as CheckoutPaymentErrorTranslationKey,
|
|
26
|
+
c as TranslationKey,
|
|
29
27
|
T as buildCheckoutRequestItem,
|
|
30
|
-
|
|
28
|
+
E as checkoutHasWallet,
|
|
31
29
|
I as getCheckoutGrandTotalAmount,
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
30
|
+
d as getCheckoutGroupedModifications,
|
|
31
|
+
h as getCheckoutItemsMappedByTicketItemStatus,
|
|
32
|
+
k as getCheckoutOrderStatusTexts,
|
|
33
|
+
U as getCheckoutPaymentErrorTranslationTexts,
|
|
34
|
+
p as getCheckoutProductName,
|
|
37
35
|
S as getCheckoutRequestItemFromCheckoutItem,
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
U as isCheckoutAlreadyPaidStatus,
|
|
36
|
+
F as getWalletMetaFromCheckout,
|
|
37
|
+
B as isCheckoutAlreadyPaidStatus,
|
|
41
38
|
O as isCheckoutItemsAreEqual,
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
39
|
+
n as isCheckoutOrderSummary,
|
|
40
|
+
W as isPreOrderCheckout,
|
|
41
|
+
K as isPreOrderServiceTime,
|
|
42
|
+
v as isUpdatingCheckoutAllowed
|
|
46
43
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const t=require("@ancon/wildcat-types");function s(e){throw new Error(`Unhandled checkout status: ${e}`)}function a(e){switch(e==null?void 0:e.status){case t.CheckoutStatus.Error:case t.CheckoutStatus.Canceled:
|
|
1
|
+
"use strict";const t=require("@ancon/wildcat-types");function s(e){throw new Error(`Unhandled checkout status: ${e}`)}function a(e){switch(e==null?void 0:e.status){case t.CheckoutStatus.Error:case t.CheckoutStatus.Canceled:case t.CheckoutStatus.Authorized:case t.CheckoutStatus.Captured:case t.CheckoutStatus.InProgress:case t.CheckoutStatus.Done:case t.CheckoutStatus.ReadyToCollect:return!0;case t.CheckoutStatus.Created:case t.CheckoutStatus.Ready:case t.CheckoutStatus.Processing:case t.CheckoutStatus.Received:return!1;default:return s(e==null?void 0:e.status)}}module.exports=a;
|
|
@@ -6,18 +6,17 @@ function t(a) {
|
|
|
6
6
|
switch (a == null ? void 0 : a.status) {
|
|
7
7
|
case e.Error:
|
|
8
8
|
case e.Canceled:
|
|
9
|
-
return !0;
|
|
10
|
-
case e.Created:
|
|
11
|
-
case e.Ready:
|
|
12
|
-
case e.Processing:
|
|
13
|
-
return !1;
|
|
14
9
|
case e.Authorized:
|
|
15
10
|
case e.Captured:
|
|
16
11
|
case e.InProgress:
|
|
17
12
|
case e.Done:
|
|
18
|
-
case e.Received:
|
|
19
13
|
case e.ReadyToCollect:
|
|
20
14
|
return !0;
|
|
15
|
+
case e.Created:
|
|
16
|
+
case e.Ready:
|
|
17
|
+
case e.Processing:
|
|
18
|
+
case e.Received:
|
|
19
|
+
return !1;
|
|
21
20
|
default:
|
|
22
21
|
return s(a == null ? void 0 : a.status);
|
|
23
22
|
}
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./shared/isWithinFlag.js"),o=require("./shared/generateId.js"),i=require("./shared/wait.js"),u=require("./outlet/getListOutletOpeningHoursTable.js"),s=require("./outlet/getOutletTagInformation.js"),n=require("./outlet/getOutletAvailabilityInfo.js"),c=require("./outlet/getOutletOfflineOrderFormats.js"),a=require("./outlet/getOutletAvailableOrderFormats.js"),l=require("./outlet/getOutletFormattedDistance.js"),d=require("./outlet/isOutletAcceptingPreOrders.js"),g=require("./outlet/getOutletDeliveryFee.js"),q=require("./outlet/getOutletTodayOpeningTimes.js"),_=require("./outlet/getOutletOrderFormats.js"),
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("./shared/isWithinFlag.js"),o=require("./shared/generateId.js"),i=require("./shared/wait.js"),u=require("./outlet/getListOutletOpeningHoursTable.js"),s=require("./outlet/getOutletTagInformation.js"),n=require("./outlet/getOutletAvailabilityInfo.js"),c=require("./outlet/getOutletOfflineOrderFormats.js"),a=require("./outlet/getOutletAvailableOrderFormats.js"),l=require("./outlet/getOutletFormattedDistance.js"),d=require("./outlet/isOutletAcceptingPreOrders.js"),g=require("./outlet/getOutletDeliveryFee.js"),q=require("./outlet/getOutletTodayOpeningTimes.js"),_=require("./outlet/getOutletOrderFormats.js"),O=require("./outlet/serviceDateTimesFromOpeningHours.js"),m=require("./outlet/getPickerIntervalsForDay.js"),k=require("./outlet/getServiceIntervalRange.js"),h=require("./outlet/getServiceIntervalsForOrderFormat.js"),C=require("./outlet/getOutletFormattedAddress.js"),P=require("./outlet/getPartitionedOutletsList.js"),p=require("./outlet/getOutletPickerTimesForWeek.js"),S=require("./outlet/getOutletOrderPrepTime.js"),T=require("./outlet/getStructuredOutletAddress.js"),F=require("./outlet/getOutletNextOpeningTimeText.js"),f=require("./outlet/getOutletCurrentClosingTimeText.js"),y=require("./outlet/getOutletNextReadyToOrderTime.js"),A=require("./versioning/isVersionALessThanB.js"),I=require("./versioning/cleanVersionString.js"),v=require("./api/getUrlAndParams.js"),E=require("./api/getEndpointWithVersion.js"),R=require("./api/generateBackoffWithEqualJitter.js"),D=require("./api/isAcceptedResponse.js"),b=require("./api/isNoContentResponse.js"),N=require("./string/slugify.js"),V=require("./string/truncate.js"),M=require("./string/getRandomAlphaNumericCode.js"),x=require("./color/lighten.js"),H=require("./color/brighten.js"),L=require("./color/darken.js"),W=require("./color/isDarkBackground.js"),B=require("./user/getFullName.js"),U=require("./user/getFullAddressString.js"),G=require("./user/getCustomerAddressFromGeocoderResult.js"),w=require("./user/getFormattedPhoneNumber.js"),z=require("./user/getStructuredCustomerAddress.js"),K=require("./logger/Logger.js"),J=require("./logger/types.js"),Q=require("./logger/sanitizeAsStringDict.js"),j=require("./logger/pascalCaseFormatter.js"),X=require("./printing/getPrinterType.js"),Y=require("./printing/isValidPrinter.js"),Z=require("./printing/isValidNetworkPrinter.js"),$=require("./printing/isValidStarCloudPrinter.js"),ee=require("./printing/isTerminalPrinter.js"),re=require("./printing/isCloudPrintModeEnabled.js"),te=require("./number/randomIntFromInterval.js"),oe=require("./tables/decodeTableQRPayload.js"),ie=require("./checkout/getCheckoutItemModifications.js"),ue=require("./checkout/getCheckoutProductName.js"),e=require("./checkout/getCheckoutOrderStatusTexts.js"),se=require("./checkout/getCheckoutItemsMappedByTicketItemStatus.js"),ne=require("./checkout/isCheckoutOrderSummary.js"),ce=require("./checkout/buildCheckoutRequestItem.js"),ae=require("./checkout/getCheckoutGrandTotalAmount.js"),le=require("./checkout/getCheckoutRequestItemFromCheckoutItem.js"),de=require("./checkout/isCheckoutItemsAreEqual.js"),ge=require("./checkout/checkoutHasWallet.js"),qe=require("./checkout/getWalletMetaFromCheckout.js"),_e=require("./checkout/isPreOrderServiceTime.js"),Oe=require("./checkout/isPreOrderCheckout.js"),me=require("./checkout/isUpdatingCheckoutAllowed.js"),ke=require("./checkout/isCheckoutAlreadyPaidStatus.js"),r=require("./checkout/getCheckoutPaymentErrorTranslationTexts.js"),he=require("./currency/getFormattedCurrency.js"),Ce=require("./inventory/isDetailedProductOutOfStock.js"),Pe=require("./inventory/isDetailedProductVariantOutOfStocks.js"),pe=require("./inventory/isMenuTreeProductOutOfStock.js"),Se=require("./inventory/isDetailedProductUpSellsOutOfStock.js"),Te=require("./inventory/isUpSellProductOutStock.js"),Fe=require("./inventory/isDetailedProductOutletStockOutOfStock.js"),fe=require("./inventory/getDetailedProductVariantStock.js"),ye=require("./signalr/createUseSignalRHook.js"),Ae=require("./signalr/SignalR.js"),Ie=require("./error/createCodedError.js"),ve=require("./error/isCodedError.js"),Ee=require("./error/isNetworkError.js"),Re=require("./error/isLockedError.js"),De=require("./error/isNotFoundError.js"),be=require("./error/isAPIError.js"),Ne=require("./error/isSerializedAPIError.js"),Ve=require("./error/isSerializedCodedError.js"),Me=require("./error/serializeError.js"),xe=require("./error/getErrorCode.js"),He=require("./hangfire/isHangfireResponse.js"),Le=require("./hangfire/createHangfirePoller.js"),We=require("./hangfire/createMakeHangfireRequest.js"),Be=require("./product/extractProductsFromMenuTree.js"),Ue=require("./product/calculateIngredientsCost.js"),Ge=require("./product/calculateAddonGroupCost.js"),we=require("./product/getAddonGroupInfoBySettings.js");require("moment");require("@ancon/wildcat-types");require("./outlet/constants.js");require("./outlet/getOutletCurrentActiveOperatingHour.js");require("./outlet/getMomentFromDateAndTimeString.js");require("./outlet/searchNextOpeningMoment.js");require("./_baseIsEqual-a66350f1.js");require("./isObjectLike-0cc89d64.js");require("./toString-c005c116.js");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("axios");require("./currency/getFormattedCurrencyPostfix.js");require("react");require("react-redux");require("@microsoft/signalr");exports.isWithinFlag=t;exports.generateId=o;exports.wait=i;exports.getListOutletOpeningHoursTable=u;exports.getOutletTagInformation=s.default;exports.getOutletAvailabilityInfo=n.default;exports.getOutletOfflineOrderFormats=c;exports.getOutletAvailableOrderFormats=a;exports.getOutletFormattedDistance=l;exports.isOutletAcceptingPreOrders=d;exports.getOutletDeliveryFee=g;exports.getOutletTodayOpeningTimes=q;exports.getOutletOrderFormats=_;exports.serviceDateTimesFromOpeningHours=O;exports.getPickerIntervalsForDay=m;exports.getServiceIntervalRange=k;exports.getServiceIntervalsForOrderFormat=h;exports.getOutletFormattedAddress=C;exports.getPartitionedOutletsList=P;exports.getOutletPickerTimesForWeek=p;exports.getOutletOrderPreparationTime=S;exports.getStructuredOutletAddress=T;exports.getOutletNextOpeningTimeText=F;exports.getOutletCurrentClosingTimeText=f;exports.getOutletNextReadyToOrderTime=y;exports.isVersionALessThanB=A;exports.cleanVersionString=I;exports.getUrlAndParams=v;exports.getEndpointWithVersion=E;exports.generateBackoffWithEqualJitter=R;exports.isAcceptedResponse=D;exports.isNoContentResponse=b;exports.slugify=N;exports.truncate=V;exports.getRandomAlphaNumericCode=M;exports.lighten=x;exports.brighten=H;exports.darken=L;exports.isDarkBackground=W;exports.getFullName=B;exports.getFullAddressString=U;exports.getCustomerAddressFromGeocoderResult=G;exports.getFormattedPhoneNumber=w;exports.getStructuredCustomerAddress=z;exports.Logger=K;exports.LogLevel=J.LogLevel;exports.sanitizeAsStringDict=Q;exports.pascalCaseFormatter=j;exports.getPrinterType=X;exports.isValidPrinter=Y;exports.isValidNetworkPrinter=Z;exports.isValidStarCloudPrinter=$;exports.isTerminalPrinter=ee;exports.isCloudPrintModeEnabled=re;exports.randomIntFromInterval=te;exports.decodeTableQRPayload=oe;exports.getCheckoutGroupedModifications=ie;exports.getCheckoutProductName=ue;exports.TranslationKey=e.TranslationKey;exports.getCheckoutOrderStatusTexts=e.default;exports.getCheckoutItemsMappedByTicketItemStatus=se;exports.isCheckoutOrderSummary=ne;exports.buildCheckoutRequestItem=ce;exports.getCheckoutGrandTotalAmount=ae;exports.getCheckoutRequestItemFromCheckoutItem=le;exports.isCheckoutItemsAreEqual=de;exports.checkoutHasWallet=ge;exports.getWalletMetaFromCheckout=qe;exports.isPreOrderServiceTime=_e;exports.isPreOrderCheckout=Oe;exports.isUpdatingCheckoutAllowed=me;exports.isCheckoutAlreadyPaidStatus=ke;exports.CheckoutPaymentErrorTranslationKey=r.CheckoutPaymentErrorTranslationKey;exports.getCheckoutPaymentErrorTranslationTexts=r.default;exports.getFormattedCurrency=he;exports.isDetailedProductOutOfStock=Ce;exports.isDetailedProductVariantOutOfStocks=Pe;exports.isMenuTreeProductOutOfStock=pe;exports.isDetailedProductUpSellsOutOfStock=Se;exports.isUpSellProductOutOfStock=Te;exports.isDetailedProductOutletStockOutOfStock=Fe;exports.getDetailedProductVariantStock=fe;exports.createUseSignalRHook=ye;exports.SignalR=Ae;exports.createCodedError=Ie;exports.isCodedError=ve;exports.isNetworkError=Ee;exports.isLockedError=Re;exports.isNotFoundError=De;exports.isAPIError=be;exports.isSerializedAPIError=Ne;exports.isSerializedCodedError=Ve;exports.serializeError=Me;exports.getErrorCode=xe;exports.isHangfireResponse=He;exports.createHangfirePoller=Le.default;exports.createMakeHangfireRequest=We;exports.extractProductsFromMenuTree=Be;exports.calculateIngredientsCost=Ue;exports.calculateAddonGroupsCost=Ge;exports.getAddonGroupInfoBySettings=we.default;
|
package/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as v } from "./shared/isWithinFlag.mjs";
|
|
2
2
|
import { default as N } from "./shared/generateId.mjs";
|
|
3
3
|
import { default as V } from "./shared/wait.mjs";
|
|
4
4
|
import { default as L } from "./outlet/getListOutletOpeningHoursTable.mjs";
|
|
@@ -23,51 +23,51 @@ import { default as ke } from "./outlet/getStructuredOutletAddress.mjs";
|
|
|
23
23
|
import { default as Pe } from "./outlet/getOutletNextOpeningTimeText.mjs";
|
|
24
24
|
import { default as Te } from "./outlet/getOutletCurrentClosingTimeText.mjs";
|
|
25
25
|
import { default as Fe } from "./outlet/getOutletNextReadyToOrderTime.mjs";
|
|
26
|
-
import { default as
|
|
26
|
+
import { default as Ie } from "./versioning/isVersionALessThanB.mjs";
|
|
27
27
|
import { default as Ee } from "./versioning/cleanVersionString.mjs";
|
|
28
|
-
import { default as
|
|
28
|
+
import { default as ve } from "./api/getUrlAndParams.mjs";
|
|
29
29
|
import { default as Ne } from "./api/getEndpointWithVersion.mjs";
|
|
30
30
|
import { default as Ve } from "./api/generateBackoffWithEqualJitter.mjs";
|
|
31
31
|
import { default as Le } from "./api/isAcceptedResponse.mjs";
|
|
32
32
|
import { default as We } from "./api/isNoContentResponse.mjs";
|
|
33
33
|
import { default as Be } from "./string/slugify.mjs";
|
|
34
34
|
import { default as Ue } from "./string/truncate.mjs";
|
|
35
|
-
import { default as ze } from "./
|
|
36
|
-
import { default as Je } from "./color/
|
|
37
|
-
import { default as je } from "./color/
|
|
38
|
-
import { default as Ye } from "./color/
|
|
39
|
-
import { default as _e } from "./
|
|
40
|
-
import { default as et } from "./user/
|
|
41
|
-
import { default as rt } from "./user/
|
|
42
|
-
import { default as at } from "./user/
|
|
43
|
-
import { default as st } from "./user/
|
|
44
|
-
import { default as dt } from "./
|
|
45
|
-
import {
|
|
46
|
-
import {
|
|
47
|
-
import { default as nt } from "./logger/
|
|
48
|
-
import { default as gt } from "./
|
|
49
|
-
import { default as kt } from "./printing/
|
|
50
|
-
import { default as Pt } from "./printing/
|
|
51
|
-
import { default as Tt } from "./printing/
|
|
52
|
-
import { default as Ft } from "./printing/
|
|
53
|
-
import { default as
|
|
54
|
-
import { default as Et } from "./
|
|
55
|
-
import { default as
|
|
56
|
-
import { default as Nt } from "./
|
|
57
|
-
import { default as Vt } from "./checkout/
|
|
58
|
-
import {
|
|
59
|
-
import { default as qt } from "./checkout/
|
|
60
|
-
import { default as Gt } from "./checkout/
|
|
61
|
-
import { default as wt } from "./checkout/
|
|
62
|
-
import { default as Kt } from "./checkout/
|
|
63
|
-
import { default as Qt } from "./checkout/
|
|
64
|
-
import { default as Xt } from "./checkout/
|
|
65
|
-
import { default as Zt } from "./checkout/
|
|
66
|
-
import { default as $t } from "./checkout/
|
|
67
|
-
import { default as tr } from "./checkout/
|
|
68
|
-
import { default as or } from "./checkout/
|
|
69
|
-
import { default as fr } from "./checkout/
|
|
70
|
-
import { default as ur } from "./checkout/
|
|
35
|
+
import { default as ze } from "./string/getRandomAlphaNumericCode.mjs";
|
|
36
|
+
import { default as Je } from "./color/lighten.mjs";
|
|
37
|
+
import { default as je } from "./color/brighten.mjs";
|
|
38
|
+
import { default as Ye } from "./color/darken.mjs";
|
|
39
|
+
import { default as _e } from "./color/isDarkBackground.mjs";
|
|
40
|
+
import { default as et } from "./user/getFullName.mjs";
|
|
41
|
+
import { default as rt } from "./user/getFullAddressString.mjs";
|
|
42
|
+
import { default as at } from "./user/getCustomerAddressFromGeocoderResult.mjs";
|
|
43
|
+
import { default as st } from "./user/getFormattedPhoneNumber.mjs";
|
|
44
|
+
import { default as dt } from "./user/getStructuredCustomerAddress.mjs";
|
|
45
|
+
import { default as mt } from "./logger/Logger.mjs";
|
|
46
|
+
import { LogLevel as pt } from "./logger/types.mjs";
|
|
47
|
+
import { default as nt } from "./logger/sanitizeAsStringDict.mjs";
|
|
48
|
+
import { default as gt } from "./logger/pascalCaseFormatter.mjs";
|
|
49
|
+
import { default as kt } from "./printing/getPrinterType.mjs";
|
|
50
|
+
import { default as Pt } from "./printing/isValidPrinter.mjs";
|
|
51
|
+
import { default as Tt } from "./printing/isValidNetworkPrinter.mjs";
|
|
52
|
+
import { default as Ft } from "./printing/isValidStarCloudPrinter.mjs";
|
|
53
|
+
import { default as It } from "./printing/isTerminalPrinter.mjs";
|
|
54
|
+
import { default as Et } from "./printing/isCloudPrintModeEnabled.mjs";
|
|
55
|
+
import { default as vt } from "./number/randomIntFromInterval.mjs";
|
|
56
|
+
import { default as Nt } from "./tables/decodeTableQRPayload.mjs";
|
|
57
|
+
import { default as Vt } from "./checkout/getCheckoutItemModifications.mjs";
|
|
58
|
+
import { default as Lt } from "./checkout/getCheckoutProductName.mjs";
|
|
59
|
+
import { TranslationKey as Wt, default as qt } from "./checkout/getCheckoutOrderStatusTexts.mjs";
|
|
60
|
+
import { default as Gt } from "./checkout/getCheckoutItemsMappedByTicketItemStatus.mjs";
|
|
61
|
+
import { default as wt } from "./checkout/isCheckoutOrderSummary.mjs";
|
|
62
|
+
import { default as Kt } from "./checkout/buildCheckoutRequestItem.mjs";
|
|
63
|
+
import { default as Qt } from "./checkout/getCheckoutGrandTotalAmount.mjs";
|
|
64
|
+
import { default as Xt } from "./checkout/getCheckoutRequestItemFromCheckoutItem.mjs";
|
|
65
|
+
import { default as Zt } from "./checkout/isCheckoutItemsAreEqual.mjs";
|
|
66
|
+
import { default as $t } from "./checkout/checkoutHasWallet.mjs";
|
|
67
|
+
import { default as tr } from "./checkout/getWalletMetaFromCheckout.mjs";
|
|
68
|
+
import { default as or } from "./checkout/isPreOrderServiceTime.mjs";
|
|
69
|
+
import { default as fr } from "./checkout/isPreOrderCheckout.mjs";
|
|
70
|
+
import { default as ur } from "./checkout/isUpdatingCheckoutAllowed.mjs";
|
|
71
71
|
import { default as lr } from "./checkout/isCheckoutAlreadyPaidStatus.mjs";
|
|
72
72
|
import { CheckoutPaymentErrorTranslationKey as ir, default as pr } from "./checkout/getCheckoutPaymentErrorTranslationTexts.mjs";
|
|
73
73
|
import { default as nr } from "./currency/getFormattedCurrency.mjs";
|
|
@@ -76,9 +76,9 @@ import { default as kr } from "./inventory/isDetailedProductVariantOutOfStocks.m
|
|
|
76
76
|
import { default as Pr } from "./inventory/isMenuTreeProductOutOfStock.mjs";
|
|
77
77
|
import { default as Tr } from "./inventory/isDetailedProductUpSellsOutOfStock.mjs";
|
|
78
78
|
import { default as Fr } from "./inventory/isUpSellProductOutStock.mjs";
|
|
79
|
-
import { default as
|
|
79
|
+
import { default as Ir } from "./inventory/isDetailedProductOutletStockOutOfStock.mjs";
|
|
80
80
|
import { default as Er } from "./inventory/getDetailedProductVariantStock.mjs";
|
|
81
|
-
import { default as
|
|
81
|
+
import { default as vr } from "./signalr/createUseSignalRHook.mjs";
|
|
82
82
|
import { default as Nr } from "./signalr/SignalR.mjs";
|
|
83
83
|
import { default as Vr } from "./error/createCodedError.mjs";
|
|
84
84
|
import { default as Lr } from "./error/isCodedError.mjs";
|
|
@@ -127,41 +127,41 @@ import "react-redux";
|
|
|
127
127
|
import "@microsoft/signalr";
|
|
128
128
|
export {
|
|
129
129
|
ir as CheckoutPaymentErrorTranslationKey,
|
|
130
|
-
|
|
131
|
-
|
|
130
|
+
pt as LogLevel,
|
|
131
|
+
mt as Logger,
|
|
132
132
|
Nr as SignalR,
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
133
|
+
Wt as TranslationKey,
|
|
134
|
+
je as brighten,
|
|
135
|
+
Kt as buildCheckoutRequestItem,
|
|
136
136
|
io as calculateAddonGroupsCost,
|
|
137
137
|
lo as calculateIngredientsCost,
|
|
138
|
-
|
|
138
|
+
$t as checkoutHasWallet,
|
|
139
139
|
Ee as cleanVersionString,
|
|
140
140
|
Vr as createCodedError,
|
|
141
141
|
ro as createHangfirePoller,
|
|
142
142
|
ao as createMakeHangfireRequest,
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
143
|
+
vr as createUseSignalRHook,
|
|
144
|
+
Ye as darken,
|
|
145
|
+
Nt as decodeTableQRPayload,
|
|
146
146
|
so as extractProductsFromMenuTree,
|
|
147
147
|
Ve as generateBackoffWithEqualJitter,
|
|
148
148
|
N as generateId,
|
|
149
149
|
xo as getAddonGroupInfoBySettings,
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
150
|
+
Qt as getCheckoutGrandTotalAmount,
|
|
151
|
+
Vt as getCheckoutGroupedModifications,
|
|
152
|
+
Gt as getCheckoutItemsMappedByTicketItemStatus,
|
|
153
|
+
qt as getCheckoutOrderStatusTexts,
|
|
154
154
|
pr as getCheckoutPaymentErrorTranslationTexts,
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
155
|
+
Lt as getCheckoutProductName,
|
|
156
|
+
Xt as getCheckoutRequestItemFromCheckoutItem,
|
|
157
|
+
at as getCustomerAddressFromGeocoderResult,
|
|
158
158
|
Er as getDetailedProductVariantStock,
|
|
159
159
|
Ne as getEndpointWithVersion,
|
|
160
160
|
_r as getErrorCode,
|
|
161
161
|
nr as getFormattedCurrency,
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
162
|
+
st as getFormattedPhoneNumber,
|
|
163
|
+
rt as getFullAddressString,
|
|
164
|
+
et as getFullName,
|
|
165
165
|
L as getListOutletOpeningHoursTable,
|
|
166
166
|
B as getOutletAvailabilityInfo,
|
|
167
167
|
z as getOutletAvailableOrderFormats,
|
|
@@ -179,24 +179,24 @@ export {
|
|
|
179
179
|
_ as getOutletTodayOpeningTimes,
|
|
180
180
|
pe as getPartitionedOutletsList,
|
|
181
181
|
ae as getPickerIntervalsForDay,
|
|
182
|
-
|
|
182
|
+
kt as getPrinterType,
|
|
183
|
+
ze as getRandomAlphaNumericCode,
|
|
183
184
|
se as getServiceIntervalRange,
|
|
184
185
|
de as getServiceIntervalsForOrderFormat,
|
|
185
|
-
|
|
186
|
+
dt as getStructuredCustomerAddress,
|
|
186
187
|
ke as getStructuredOutletAddress,
|
|
187
|
-
|
|
188
|
-
|
|
188
|
+
ve as getUrlAndParams,
|
|
189
|
+
tr as getWalletMetaFromCheckout,
|
|
189
190
|
zr as isAPIError,
|
|
190
191
|
Le as isAcceptedResponse,
|
|
191
|
-
ur as isCheckoutAlreadyPaidError,
|
|
192
192
|
lr as isCheckoutAlreadyPaidStatus,
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
193
|
+
Zt as isCheckoutItemsAreEqual,
|
|
194
|
+
wt as isCheckoutOrderSummary,
|
|
195
|
+
Et as isCloudPrintModeEnabled,
|
|
196
196
|
Lr as isCodedError,
|
|
197
|
-
|
|
197
|
+
_e as isDarkBackground,
|
|
198
198
|
gr as isDetailedProductOutOfStock,
|
|
199
|
-
|
|
199
|
+
Ir as isDetailedProductOutletStockOutOfStock,
|
|
200
200
|
Tr as isDetailedProductUpSellsOutOfStock,
|
|
201
201
|
kr as isDetailedProductVariantOutOfStocks,
|
|
202
202
|
eo as isHangfireResponse,
|
|
@@ -206,22 +206,22 @@ export {
|
|
|
206
206
|
We as isNoContentResponse,
|
|
207
207
|
Ur as isNotFoundError,
|
|
208
208
|
j as isOutletAcceptingPreOrders,
|
|
209
|
-
|
|
210
|
-
|
|
209
|
+
fr as isPreOrderCheckout,
|
|
210
|
+
or as isPreOrderServiceTime,
|
|
211
211
|
Jr as isSerializedAPIError,
|
|
212
212
|
jr as isSerializedCodedError,
|
|
213
|
-
|
|
213
|
+
It as isTerminalPrinter,
|
|
214
214
|
Fr as isUpSellProductOutOfStock,
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
215
|
+
ur as isUpdatingCheckoutAllowed,
|
|
216
|
+
Tt as isValidNetworkPrinter,
|
|
217
|
+
Pt as isValidPrinter,
|
|
218
|
+
Ft as isValidStarCloudPrinter,
|
|
219
|
+
Ie as isVersionALessThanB,
|
|
220
|
+
v as isWithinFlag,
|
|
221
|
+
Je as lighten,
|
|
222
|
+
gt as pascalCaseFormatter,
|
|
223
|
+
vt as randomIntFromInterval,
|
|
224
|
+
nt as sanitizeAsStringDict,
|
|
225
225
|
Yr as serializeError,
|
|
226
226
|
re as serviceDateTimesFromOpeningHours,
|
|
227
227
|
Be as slugify,
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { OpeningHours, OrderFormat } from '@ancon/wildcat-types';
|
|
2
|
+
import { Moment } from 'moment';
|
|
3
|
+
/**
|
|
4
|
+
* Get the active opening interval for the given outlet opening hours, date and order format
|
|
5
|
+
*
|
|
6
|
+
* @param date - The date to check
|
|
7
|
+
* @param openingHours - The outlet opening hours
|
|
8
|
+
* @param orderFormat - The order format to check
|
|
9
|
+
* @returns The active opening interval or undefined if no interval is active for the given date and order format
|
|
10
|
+
*/
|
|
11
|
+
export default function getOutletActiveOpeningInterval(date: Moment, openingHours: OpeningHours[], orderFormat: OrderFormat): OpeningHours | undefined;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n=require("@ancon/wildcat-types"),p=require("moment"),l=require("../shared/constants.js");function y(r,c,i){const a=c.reduce((t,e)=>{if((e.orderFormat&i)===i)switch(e.type){case n.IntervalType.Exception:{const s=p(e.periodFrom),f=p(e.periodTo);r.isBetween(s,f,"day","[]")&&(e.state===n.IntervalState.Closed?t.closedExceptions.push(e):t.openExceptions.push(e))}break;case n.IntervalType.Interval:default:(e.dayOfWeek===n.DayOfWeek.Everyday||e.dayOfWeek===l.DaysOfWeekMap[r.isoWeekday()])&&t.openIntervals.push(e);break}return t},{closedExceptions:[],openExceptions:[],openIntervals:[]}),{closedExceptions:d,openExceptions:o,openIntervals:u}=a;if(!d.length){if(o.length){if(o.length>1){const[t]=o.sort((e,s)=>e.position-s.position);return t}return o[0]}return u[0]}}module.exports=y;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import { DayOfWeek as l, IntervalType as r, IntervalState as m } from "@ancon/wildcat-types";
|
|
2
|
+
import i from "moment";
|
|
3
|
+
import { DaysOfWeekMap as y } from "../shared/constants.mjs";
|
|
4
|
+
function k(s, f, p) {
|
|
5
|
+
const c = f.reduce(
|
|
6
|
+
(o, e) => {
|
|
7
|
+
if ((e.orderFormat & p) === p)
|
|
8
|
+
switch (e.type) {
|
|
9
|
+
case r.Exception:
|
|
10
|
+
{
|
|
11
|
+
const n = i(e.periodFrom), u = i(e.periodTo);
|
|
12
|
+
s.isBetween(n, u, "day", "[]") && (e.state === m.Closed ? o.closedExceptions.push(e) : o.openExceptions.push(e));
|
|
13
|
+
}
|
|
14
|
+
break;
|
|
15
|
+
case r.Interval:
|
|
16
|
+
default:
|
|
17
|
+
// Every day in the week
|
|
18
|
+
(e.dayOfWeek === l.Everyday || // Specific day in the week
|
|
19
|
+
e.dayOfWeek === y[s.isoWeekday()]) && o.openIntervals.push(e);
|
|
20
|
+
break;
|
|
21
|
+
}
|
|
22
|
+
return o;
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
closedExceptions: [],
|
|
26
|
+
openExceptions: [],
|
|
27
|
+
openIntervals: []
|
|
28
|
+
}
|
|
29
|
+
), { closedExceptions: d, openExceptions: t, openIntervals: a } = c;
|
|
30
|
+
if (!d.length) {
|
|
31
|
+
if (t.length) {
|
|
32
|
+
if (t.length > 1) {
|
|
33
|
+
const [o] = t.sort(
|
|
34
|
+
(e, n) => e.position - n.position
|
|
35
|
+
);
|
|
36
|
+
return o;
|
|
37
|
+
}
|
|
38
|
+
return t[0];
|
|
39
|
+
}
|
|
40
|
+
return a[0];
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
export {
|
|
44
|
+
k as default
|
|
45
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancon/wildcat-utils",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.38.0",
|
|
4
4
|
"private": false,
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"module": "index.mjs",
|
|
@@ -116,11 +116,6 @@
|
|
|
116
116
|
"require": "./checkout/index.js",
|
|
117
117
|
"types": "./checkout/index.d.ts"
|
|
118
118
|
},
|
|
119
|
-
"./checkout/isCheckoutAlreadyPaidError": {
|
|
120
|
-
"import": "./checkout/isCheckoutAlreadyPaidError.mjs",
|
|
121
|
-
"require": "./checkout/isCheckoutAlreadyPaidError.js",
|
|
122
|
-
"types": "./checkout/isCheckoutAlreadyPaidError.d.ts"
|
|
123
|
-
},
|
|
124
119
|
"./checkout/isCheckoutAlreadyPaidStatus": {
|
|
125
120
|
"import": "./checkout/isCheckoutAlreadyPaidStatus.mjs",
|
|
126
121
|
"require": "./checkout/isCheckoutAlreadyPaidStatus.js",
|
|
@@ -391,6 +386,11 @@
|
|
|
391
386
|
"require": "./outlet/getNextTenthMinute.js",
|
|
392
387
|
"types": "./outlet/getNextTenthMinute.d.ts"
|
|
393
388
|
},
|
|
389
|
+
"./outlet/getOutletActiveOpeningInterval": {
|
|
390
|
+
"import": "./outlet/getOutletActiveOpeningInterval.mjs",
|
|
391
|
+
"require": "./outlet/getOutletActiveOpeningInterval.js",
|
|
392
|
+
"types": "./outlet/getOutletActiveOpeningInterval.d.ts"
|
|
393
|
+
},
|
|
394
394
|
"./outlet/getOutletAvailabilityInfo": {
|
|
395
395
|
"import": "./outlet/getOutletAvailabilityInfo.mjs",
|
|
396
396
|
"require": "./outlet/getOutletAvailabilityInfo.js",
|
|
@@ -646,6 +646,11 @@
|
|
|
646
646
|
"require": "./signalr/types.js",
|
|
647
647
|
"types": "./signalr/types.d.ts"
|
|
648
648
|
},
|
|
649
|
+
"./string/getRandomAlphaNumericCode": {
|
|
650
|
+
"import": "./string/getRandomAlphaNumericCode.mjs",
|
|
651
|
+
"require": "./string/getRandomAlphaNumericCode.js",
|
|
652
|
+
"types": "./string/getRandomAlphaNumericCode.d.ts"
|
|
653
|
+
},
|
|
649
654
|
"./string": {
|
|
650
655
|
"import": "./string/index.mjs",
|
|
651
656
|
"require": "./string/index.js",
|
|
@@ -676,6 +681,11 @@
|
|
|
676
681
|
"require": "./time/getNextTenthMinute.js",
|
|
677
682
|
"types": "./time/getNextTenthMinute.d.ts"
|
|
678
683
|
},
|
|
684
|
+
"./time/getPrevNthMinute": {
|
|
685
|
+
"import": "./time/getPrevNthMinute.mjs",
|
|
686
|
+
"require": "./time/getPrevNthMinute.js",
|
|
687
|
+
"types": "./time/getPrevNthMinute.d.ts"
|
|
688
|
+
},
|
|
679
689
|
"./time/getTimeSpanParts": {
|
|
680
690
|
"import": "./time/getTimeSpanParts.mjs",
|
|
681
691
|
"require": "./time/getTimeSpanParts.js",
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const n="0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";function a(o=8){let t="";for(let e=0;e<o;e+=1){const r=Math.floor(Math.random()*n.length);t+=n[r]}return t}module.exports=a;
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
const n = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ";
|
|
2
|
+
function r(o = 8) {
|
|
3
|
+
let t = "";
|
|
4
|
+
for (let e = 0; e < o; e += 1) {
|
|
5
|
+
const a = Math.floor(Math.random() * n.length);
|
|
6
|
+
t += n[a];
|
|
7
|
+
}
|
|
8
|
+
return t;
|
|
9
|
+
}
|
|
10
|
+
export {
|
|
11
|
+
r as default
|
|
12
|
+
};
|
package/string/index.d.ts
CHANGED
package/string/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 e=require("./slugify.js"),t=require("./truncate.js"),r=require("./getRandomAlphaNumericCode.js");exports.slugify=e;exports.truncate=t;exports.getRandomAlphaNumericCode=r;
|
package/string/index.mjs
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as t } from "./slugify.mjs";
|
|
2
2
|
import { default as r } from "./truncate.mjs";
|
|
3
|
+
import { default as u } from "./getRandomAlphaNumericCode.mjs";
|
|
3
4
|
export {
|
|
4
|
-
|
|
5
|
+
u as getRandomAlphaNumericCode,
|
|
6
|
+
t as slugify,
|
|
5
7
|
r as truncate
|
|
6
8
|
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Moment } from 'moment';
|
|
2
|
+
/**
|
|
3
|
+
* Returns the previous Nth minute from the given moment object
|
|
4
|
+
*
|
|
5
|
+
* @param momentObject - Moment object to get the previous Nth minute from (defaults to now)
|
|
6
|
+
* @param n - The Nth minute to get (defaults to 10)
|
|
7
|
+
* @returns - The previous Nth minute to the given moment object
|
|
8
|
+
*
|
|
9
|
+
* @example
|
|
10
|
+
* getPrevNthMinute(moment('2023-01-01 12:38:40'), 5) // 35
|
|
11
|
+
* getPrevNthMinute(moment('2023-01-01 12:31:02')) // 30
|
|
12
|
+
* getPrevNthMinute(moment('2023-01-01 12:30:00'), 20) // 20
|
|
13
|
+
*/
|
|
14
|
+
export default function getPrevNthMinute(momentObject?: Moment, n?: number): number;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";const r=require("moment");function n(e,t=10){if(t<=0)throw new Error("n must be greater than 0");return Math.floor((e??r()).minutes()/t)*t}module.exports=n;
|
package/time/index.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import toMinutes from './toMinutes';
|
|
2
2
|
import getNextTenthMinute from './getNextTenthMinute';
|
|
3
|
+
import getPrevNthMinute from './getPrevNthMinute';
|
|
3
4
|
import getTimeSpanParts from './getTimeSpanParts';
|
|
4
|
-
export { toMinutes, getNextTenthMinute, getTimeSpanParts };
|
|
5
|
+
export { toMinutes, getNextTenthMinute, getTimeSpanParts, getPrevNthMinute };
|
package/time/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./toMinutes.js"),t=require("./getNextTenthMinute.js"),i=require("./getTimeSpanParts.js");require("moment");exports.toMinutes=e;exports.getNextTenthMinute=t;exports.
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./toMinutes.js"),t=require("./getNextTenthMinute.js"),i=require("./getPrevNthMinute.js"),r=require("./getTimeSpanParts.js");require("moment");exports.toMinutes=e;exports.getNextTenthMinute=t;exports.getPrevNthMinute=i;exports.getTimeSpanParts=r;
|
package/time/index.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
|
-
import { default as
|
|
1
|
+
import { default as a } from "./toMinutes.mjs";
|
|
2
2
|
import { default as f } from "./getNextTenthMinute.mjs";
|
|
3
|
-
import { default as
|
|
3
|
+
import { default as m } from "./getPrevNthMinute.mjs";
|
|
4
|
+
import { default as s } from "./getTimeSpanParts.mjs";
|
|
4
5
|
import "moment";
|
|
5
6
|
export {
|
|
6
7
|
f as getNextTenthMinute,
|
|
7
|
-
|
|
8
|
-
|
|
8
|
+
m as getPrevNthMinute,
|
|
9
|
+
s as getTimeSpanParts,
|
|
10
|
+
a as toMinutes
|
|
9
11
|
};
|
|
@@ -1,6 +0,0 @@
|
|
|
1
|
-
import { APIError } from '@ancon/wildcat-types';
|
|
2
|
-
import { SerializedAPIError } from '../error';
|
|
3
|
-
declare function isCheckoutAlreadyPaidError(error: APIError): boolean;
|
|
4
|
-
declare function isCheckoutAlreadyPaidError(error: SerializedAPIError): boolean;
|
|
5
|
-
declare function isCheckoutAlreadyPaidError(error: unknown): boolean;
|
|
6
|
-
export default isCheckoutAlreadyPaidError;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
"use strict";const r=require("@ancon/wildcat-types");require("axios");const s=require("../error/isAPIError.js"),u=require("../error/isSerializedAPIError.js");function i(e){var t,o;if(!u(e)&&!s(e))return!1;switch((o=(t=e==null?void 0:e.response)==null?void 0:t.data)==null?void 0:o.errorCode){case r.ErrorCode.AuthorizeCheckoutAuthorized:case r.ErrorCode.AuthorizeCheckoutCaptured:case r.ErrorCode.PaymentCheckoutAlreadyInProgress:case r.ErrorCode.PaymentActionPaymentNotFound:return!0;default:return!1}}module.exports=i;
|
|
@@ -1,21 +0,0 @@
|
|
|
1
|
-
import { ErrorCode as t } from "@ancon/wildcat-types";
|
|
2
|
-
import "axios";
|
|
3
|
-
import a from "../error/isAPIError.mjs";
|
|
4
|
-
import i from "../error/isSerializedAPIError.mjs";
|
|
5
|
-
function c(e) {
|
|
6
|
-
var o, r;
|
|
7
|
-
if (!i(e) && !a(e))
|
|
8
|
-
return !1;
|
|
9
|
-
switch ((r = (o = e == null ? void 0 : e.response) == null ? void 0 : o.data) == null ? void 0 : r.errorCode) {
|
|
10
|
-
case t.AuthorizeCheckoutAuthorized:
|
|
11
|
-
case t.AuthorizeCheckoutCaptured:
|
|
12
|
-
case t.PaymentCheckoutAlreadyInProgress:
|
|
13
|
-
case t.PaymentActionPaymentNotFound:
|
|
14
|
-
return !0;
|
|
15
|
-
default:
|
|
16
|
-
return !1;
|
|
17
|
-
}
|
|
18
|
-
}
|
|
19
|
-
export {
|
|
20
|
-
c as default
|
|
21
|
-
};
|