@open-tender/utils 0.1.89 → 0.1.91
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/dist/cjs/utils/checkout.d.ts +4 -0
- package/dist/cjs/utils/errors.d.ts +2 -2
- package/dist/cjs/utils/favorites.d.ts +1 -1
- package/dist/cjs/utils/favorites.js +2 -2
- package/dist/esm/utils/checkout.d.ts +4 -0
- package/dist/esm/utils/errors.d.ts +2 -2
- package/dist/esm/utils/favorites.d.ts +1 -1
- package/dist/esm/utils/favorites.js +2 -2
- package/package.json +1 -1
|
@@ -38,6 +38,10 @@ export declare const updateTenders: (tenders: CheckoutTenders, total: Money) =>
|
|
|
38
38
|
revenue_centers: number[];
|
|
39
39
|
service_type: import("@open-tender/types").ServiceType | null;
|
|
40
40
|
tender_type: import("@open-tender/types").TenderType;
|
|
41
|
+
} | {
|
|
42
|
+
amount: string;
|
|
43
|
+
tender_type: import("@open-tender/types").TenderType;
|
|
44
|
+
token: any;
|
|
41
45
|
})[] | null;
|
|
42
46
|
export declare const makeTenderName: (tender: OrderTender) => string;
|
|
43
47
|
export declare const makeCheckoutTenderName: (tender: CheckoutTender) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CheckoutError, CheckoutErrorParams, RequestError } from '@open-tender/types';
|
|
1
|
+
import { CheckoutError, CheckoutErrorMessages, CheckoutErrorParams, RequestError } from '@open-tender/types';
|
|
2
2
|
export declare const handleRespError: (err: RequestError) => {
|
|
3
3
|
title: string;
|
|
4
4
|
detail: string | undefined;
|
|
@@ -11,7 +11,7 @@ export declare const handleRespError: (err: RequestError) => {
|
|
|
11
11
|
export declare const processError: (msg: string | null) => string;
|
|
12
12
|
export declare const handleFormErrors: (params: Record<string, string | null>) => Record<string, string>;
|
|
13
13
|
export declare const makeFormErrors: (error: RequestError) => Record<string, string>;
|
|
14
|
-
export declare const handleCheckoutError: (error: CheckoutError) =>
|
|
14
|
+
export declare const handleCheckoutError: (error: CheckoutError) => CheckoutErrorMessages;
|
|
15
15
|
export declare const makeCheckError: (params: CheckoutErrorParams) => CheckoutError;
|
|
16
16
|
export declare const errMessages: {
|
|
17
17
|
unknown: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DisplayItems, Favorites, MenuCategories, MenuItem, MenuItems, SoldOut } from '@open-tender/types';
|
|
2
2
|
export declare const makeMenuItemLookup: (categories: MenuCategories) => any;
|
|
3
|
-
export declare const makeFeatured: (categories: MenuCategories) =>
|
|
3
|
+
export declare const makeFeatured: (categories: MenuCategories) => MenuItem[];
|
|
4
4
|
export declare const makeMenuGroupsLookup: (menuItem: MenuItem) => any;
|
|
5
5
|
export declare const makeRecents: (recents: DisplayItems, itemLookup: Record<string, MenuItem>, soldOut: SoldOut) => MenuItems;
|
|
6
6
|
export declare const makeFavorites: (favorites: Favorites, itemLookup: Record<string, MenuItem>, soldOut: SoldOut) => MenuItems;
|
|
@@ -16,10 +16,10 @@ const makeFeatured = (categories) => {
|
|
|
16
16
|
return [...arr, cat, ...(cat.children || [])];
|
|
17
17
|
}, []);
|
|
18
18
|
const featured = flatCategories.reduce((arr, category) => {
|
|
19
|
-
const items = category.items.filter(
|
|
19
|
+
const items = category.items.filter(i => i.featured_position);
|
|
20
20
|
return [...arr, ...items];
|
|
21
21
|
}, []);
|
|
22
|
-
return featured.sort((a, b) => a.featured_position - b.featured_position);
|
|
22
|
+
return featured.sort((a, b) => { var _a, _b; return ((_a = a.featured_position) !== null && _a !== void 0 ? _a : 0) - ((_b = b.featured_position) !== null && _b !== void 0 ? _b : 0); });
|
|
23
23
|
};
|
|
24
24
|
exports.makeFeatured = makeFeatured;
|
|
25
25
|
const makeMenuGroupsLookup = (menuItem) => {
|
|
@@ -38,6 +38,10 @@ export declare const updateTenders: (tenders: CheckoutTenders, total: Money) =>
|
|
|
38
38
|
revenue_centers: number[];
|
|
39
39
|
service_type: import("@open-tender/types").ServiceType | null;
|
|
40
40
|
tender_type: import("@open-tender/types").TenderType;
|
|
41
|
+
} | {
|
|
42
|
+
amount: string;
|
|
43
|
+
tender_type: import("@open-tender/types").TenderType;
|
|
44
|
+
token: any;
|
|
41
45
|
})[] | null;
|
|
42
46
|
export declare const makeTenderName: (tender: OrderTender) => string;
|
|
43
47
|
export declare const makeCheckoutTenderName: (tender: CheckoutTender) => string;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CheckoutError, CheckoutErrorParams, RequestError } from '@open-tender/types';
|
|
1
|
+
import { CheckoutError, CheckoutErrorMessages, CheckoutErrorParams, RequestError } from '@open-tender/types';
|
|
2
2
|
export declare const handleRespError: (err: RequestError) => {
|
|
3
3
|
title: string;
|
|
4
4
|
detail: string | undefined;
|
|
@@ -11,7 +11,7 @@ export declare const handleRespError: (err: RequestError) => {
|
|
|
11
11
|
export declare const processError: (msg: string | null) => string;
|
|
12
12
|
export declare const handleFormErrors: (params: Record<string, string | null>) => Record<string, string>;
|
|
13
13
|
export declare const makeFormErrors: (error: RequestError) => Record<string, string>;
|
|
14
|
-
export declare const handleCheckoutError: (error: CheckoutError) =>
|
|
14
|
+
export declare const handleCheckoutError: (error: CheckoutError) => CheckoutErrorMessages;
|
|
15
15
|
export declare const makeCheckError: (params: CheckoutErrorParams) => CheckoutError;
|
|
16
16
|
export declare const errMessages: {
|
|
17
17
|
unknown: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { DisplayItems, Favorites, MenuCategories, MenuItem, MenuItems, SoldOut } from '@open-tender/types';
|
|
2
2
|
export declare const makeMenuItemLookup: (categories: MenuCategories) => any;
|
|
3
|
-
export declare const makeFeatured: (categories: MenuCategories) =>
|
|
3
|
+
export declare const makeFeatured: (categories: MenuCategories) => MenuItem[];
|
|
4
4
|
export declare const makeMenuGroupsLookup: (menuItem: MenuItem) => any;
|
|
5
5
|
export declare const makeRecents: (recents: DisplayItems, itemLookup: Record<string, MenuItem>, soldOut: SoldOut) => MenuItems;
|
|
6
6
|
export declare const makeFavorites: (favorites: Favorites, itemLookup: Record<string, MenuItem>, soldOut: SoldOut) => MenuItems;
|
|
@@ -12,10 +12,10 @@ export const makeFeatured = (categories) => {
|
|
|
12
12
|
return [...arr, cat, ...(cat.children || [])];
|
|
13
13
|
}, []);
|
|
14
14
|
const featured = flatCategories.reduce((arr, category) => {
|
|
15
|
-
const items = category.items.filter(
|
|
15
|
+
const items = category.items.filter(i => i.featured_position);
|
|
16
16
|
return [...arr, ...items];
|
|
17
17
|
}, []);
|
|
18
|
-
return featured.sort((a, b) => a.featured_position - b.featured_position);
|
|
18
|
+
return featured.sort((a, b) => { var _a, _b; return ((_a = a.featured_position) !== null && _a !== void 0 ? _a : 0) - ((_b = b.featured_position) !== null && _b !== void 0 ? _b : 0); });
|
|
19
19
|
};
|
|
20
20
|
export const makeMenuGroupsLookup = (menuItem) => {
|
|
21
21
|
if (!menuItem.option_groups)
|
package/package.json
CHANGED