@antlur/backstage 1.12.15 → 1.13.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/dist/cli/actions/sync-blocks.d.ts.map +1 -1
- package/dist/cli/actions/sync-blocks.js +1 -0
- package/dist/cli/cli.js +0 -0
- package/dist/client.d.ts +6 -0
- package/dist/client.d.ts.map +1 -1
- package/dist/client.js +9 -0
- package/dist/endpoints/blocks.d.ts +5 -3
- package/dist/endpoints/blocks.d.ts.map +1 -1
- package/dist/endpoints/frontstage.d.ts +9 -0
- package/dist/endpoints/frontstage.d.ts.map +1 -0
- package/dist/endpoints/frontstage.js +32 -0
- package/dist/endpoints/layouts.d.ts +5 -3
- package/dist/endpoints/layouts.d.ts.map +1 -1
- package/dist/endpoints/media.d.ts +5 -0
- package/dist/endpoints/media.d.ts.map +1 -1
- package/dist/endpoints/media.js +12 -0
- package/dist/endpoints/modules.d.ts +7 -0
- package/dist/endpoints/modules.d.ts.map +1 -0
- package/dist/endpoints/modules.js +11 -0
- package/dist/endpoints/navigation.d.ts +14 -1
- package/dist/endpoints/navigation.d.ts.map +1 -1
- package/dist/endpoints/navigation.js +22 -2
- package/dist/endpoints/reviews.d.ts +18 -0
- package/dist/endpoints/reviews.d.ts.map +1 -0
- package/dist/endpoints/reviews.js +30 -0
- package/dist/endpoints/website.d.ts +2 -0
- package/dist/endpoints/website.d.ts.map +1 -1
- package/dist/endpoints/website.js +14 -3
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +3 -0
- package/dist/studio/define-block.d.ts +2 -0
- package/dist/studio/define-block.d.ts.map +1 -1
- package/dist/studio/types/block.d.ts +9 -0
- package/dist/studio/types/block.d.ts.map +1 -1
- package/dist/types/account-block.d.ts +17 -1
- package/dist/types/account-block.d.ts.map +1 -1
- package/dist/types/account-layout.d.ts +29 -9
- package/dist/types/account-layout.d.ts.map +1 -1
- package/dist/types/account-module.d.ts +26 -0
- package/dist/types/account-module.d.ts.map +1 -0
- package/dist/types/account-module.js +12 -0
- package/dist/types/frontstage.d.ts +213 -0
- package/dist/types/frontstage.d.ts.map +1 -0
- package/dist/types/frontstage.js +1 -0
- package/dist/types/index.d.ts +4 -0
- package/dist/types/index.d.ts.map +1 -1
- package/dist/types/index.js +1 -1
- package/dist/types/location.d.ts +1 -0
- package/dist/types/location.d.ts.map +1 -1
- package/dist/types/review.d.ts +17 -0
- package/dist/types/review.d.ts.map +1 -0
- package/dist/types/review.js +1 -0
- package/dist/util/special-hours.d.ts +1 -1
- package/dist/util/special-hours.d.ts.map +1 -1
- package/dist/util/special-hours.js +8 -7
- package/package.json +1 -1
- package/readme.md +14 -0
- package/src/cli/actions/sync-blocks.ts +1 -0
- package/src/client.ts +9 -0
- package/src/endpoints/blocks.ts +5 -3
- package/src/endpoints/frontstage.ts +50 -0
- package/src/endpoints/layouts.ts +5 -3
- package/src/endpoints/media.ts +20 -1
- package/src/endpoints/modules.ts +14 -0
- package/src/endpoints/navigation.ts +35 -4
- package/src/endpoints/reviews.ts +57 -0
- package/src/endpoints/website.ts +15 -3
- package/src/index.ts +3 -0
- package/src/studio/define-block.ts +2 -0
- package/src/studio/types/block.ts +10 -0
- package/src/types/account-block.ts +22 -1
- package/src/types/account-layout.ts +32 -9
- package/src/types/account-module.ts +38 -0
- package/src/types/frontstage.ts +254 -0
- package/src/types/index.ts +4 -0
- package/src/types/location.ts +1 -0
- package/src/types/review.ts +16 -0
- package/src/util/special-hours.ts +10 -6
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export interface Review {
|
|
2
|
+
id: number;
|
|
3
|
+
account_id: string;
|
|
4
|
+
location_id: string | null;
|
|
5
|
+
external_id: string;
|
|
6
|
+
source: string;
|
|
7
|
+
author_name: string;
|
|
8
|
+
author_avatar: string | null;
|
|
9
|
+
rating: number;
|
|
10
|
+
text: string | null;
|
|
11
|
+
url: string | null;
|
|
12
|
+
responded_at: string | null;
|
|
13
|
+
published_at: string | null;
|
|
14
|
+
created_at: string;
|
|
15
|
+
updated_at: string;
|
|
16
|
+
}
|
|
@@ -1,16 +1,20 @@
|
|
|
1
1
|
import type { Location } from "../types";
|
|
2
2
|
import { DateTime } from "luxon";
|
|
3
3
|
|
|
4
|
-
export function getSpecialHoursFromLocation(location: Location): any[] {
|
|
4
|
+
export function getSpecialHoursFromLocation(location: Location, noticeDays?: number): any[] {
|
|
5
5
|
if (!location.special_hours) return [];
|
|
6
6
|
|
|
7
|
-
|
|
8
|
-
const
|
|
9
|
-
if (location.timezone) now.setZone(location.timezone);
|
|
7
|
+
const now = (location.timezone ? DateTime.now().setZone(location.timezone) : DateTime.now()).startOf("day");
|
|
8
|
+
const lastVisibleDate = typeof noticeDays === "number" ? now.plus({ days: Math.max(0, noticeDays) }) : null;
|
|
10
9
|
|
|
11
10
|
const specialHours = location.special_hours.filter((specialHour) => {
|
|
12
|
-
const specialHourDate = DateTime.fromISO(specialHour.date);
|
|
13
|
-
|
|
11
|
+
const specialHourDate = DateTime.fromISO(specialHour.date, { zone: location.timezone || undefined }).startOf("day");
|
|
12
|
+
|
|
13
|
+
if (specialHourDate < now) {
|
|
14
|
+
return false;
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
return lastVisibleDate ? specialHourDate <= lastVisibleDate : true;
|
|
14
18
|
});
|
|
15
19
|
|
|
16
20
|
// sort by date
|