feat(SW-66, SW-348): search functionality and ui
This commit is contained in:
@@ -0,0 +1,5 @@
|
||||
import { CardsGrid } from "@/types/trpc/routers/contentstack/blocks"
|
||||
|
||||
export interface CardsGridProps extends Pick<CardsGrid, "cards_grid"> {
|
||||
firstItem?: boolean
|
||||
}
|
||||
@@ -0,0 +1,20 @@
|
||||
import type { DynamicContent } from "@/types/trpc/routers/contentstack/blocks"
|
||||
|
||||
interface PartialDynamicContent
|
||||
extends Pick<DynamicContent, "dynamic_content"> {}
|
||||
|
||||
export interface DynamicContentProps extends PartialDynamicContent {
|
||||
firstItem: boolean
|
||||
}
|
||||
|
||||
export interface HowItWorksProps extends PartialDynamicContent {
|
||||
firstItem: boolean
|
||||
}
|
||||
|
||||
export interface LoyaltyLevelsProps extends PartialDynamicContent {
|
||||
firstItem: boolean
|
||||
}
|
||||
|
||||
export interface OverviewTableProps extends PartialDynamicContent {
|
||||
firstItem: boolean
|
||||
}
|
||||
@@ -0,0 +1,9 @@
|
||||
import type { Block as AccountPageBlock } from "@/types/trpc/routers/contentstack/accountPage"
|
||||
import type { Block as ContentPageBlock } from "@/types/trpc/routers/contentstack/contentPage"
|
||||
import type { Block as LoyaltyPageBlock } from "@/types/trpc/routers/contentstack/loyaltyPage"
|
||||
|
||||
export type Blocks = AccountPageBlock | ContentPageBlock | LoyaltyPageBlock
|
||||
|
||||
export interface BlocksProps {
|
||||
blocks: Blocks[]
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
import type { TextCols } from "@/types/trpc/routers/contentstack/blocks"
|
||||
|
||||
export interface TextColProps extends Pick<TextCols, "text_cols"> { }
|
||||
@@ -1,109 +0,0 @@
|
||||
import { Lang } from "@/constants/languages"
|
||||
import { membershipLevels } from "@/constants/membershipLevels"
|
||||
|
||||
import type { IntlFormatters } from "@formatjs/intl"
|
||||
|
||||
import {
|
||||
Block,
|
||||
CardsGrid,
|
||||
DynamicContent,
|
||||
TextCols,
|
||||
} from "@/types/trpc/routers/contentstack/contentPage"
|
||||
|
||||
export type BlocksProps = {
|
||||
blocks: Block[]
|
||||
}
|
||||
|
||||
export type CardsGridProps = Pick<CardsGrid, "cards_grid"> & {
|
||||
firstItem?: boolean
|
||||
}
|
||||
|
||||
export type TextColsProps = {
|
||||
textCols: TextCols["text_cols"]
|
||||
}
|
||||
|
||||
export type DynamicContentProps = {
|
||||
dynamicContent: DynamicContent["dynamic_content"]
|
||||
firstItem: boolean
|
||||
}
|
||||
|
||||
export type DynamicComponentProps = {
|
||||
component: DynamicContent["dynamic_content"]["component"]
|
||||
}
|
||||
|
||||
type BenefitTitle = { title: string }
|
||||
|
||||
export type Level = {
|
||||
level: membershipLevels
|
||||
name: string
|
||||
requiredPoints: number
|
||||
requiredNights?: number
|
||||
benefits: BenefitTitle[]
|
||||
}
|
||||
|
||||
export type LevelCardProps = {
|
||||
formatMessage: IntlFormatters["formatMessage"]
|
||||
lang: Lang
|
||||
level: Level
|
||||
}
|
||||
|
||||
export type BenefitCardProps = {
|
||||
comparedValues: BenefitValueInformation[]
|
||||
title: string
|
||||
description: string
|
||||
}
|
||||
|
||||
type BenefitValueInformation = {
|
||||
unlocked: boolean
|
||||
value?: string
|
||||
valueDetails?: string
|
||||
}
|
||||
|
||||
export type Benefit = {
|
||||
name: string
|
||||
description: string
|
||||
unlocked: boolean
|
||||
value?: string
|
||||
valueDetails?: string
|
||||
}
|
||||
|
||||
export type ComparisonLevel = {
|
||||
level: membershipLevels
|
||||
name: string
|
||||
description: string
|
||||
requirement: string
|
||||
icon: string
|
||||
benefits: Benefit[]
|
||||
}
|
||||
|
||||
export type BenefitListProps = {
|
||||
levels: ComparisonLevel[]
|
||||
}
|
||||
|
||||
export type BenefitValueProps = {
|
||||
benefit: BenefitValueInformation
|
||||
}
|
||||
|
||||
export type MobileColumnHeaderProps = {
|
||||
column: "A" | "B"
|
||||
}
|
||||
|
||||
export type DesktopSelectColumns = {
|
||||
column: MobileColumnHeaderProps["column"] | "C"
|
||||
}
|
||||
|
||||
export type LargeTableProps = {
|
||||
levels: ComparisonLevel[]
|
||||
activeLevel: membershipLevels | null
|
||||
Select?: (column: DesktopSelectColumns) => JSX.Element | null
|
||||
}
|
||||
|
||||
export type BenefitTableHeaderProps = {
|
||||
name: string
|
||||
description: string
|
||||
}
|
||||
|
||||
export type LevelSummaryProps = {
|
||||
level: ComparisonLevel
|
||||
showDescription?: boolean
|
||||
}
|
||||
@@ -1,42 +0,0 @@
|
||||
import { Typename } from "@/types/requests/utils/typename"
|
||||
import { JoinLoyaltyContact } from "@/types/trpc/routers/contentstack/contentPage"
|
||||
|
||||
export enum ContentBlocksTypenameEnum {
|
||||
ContentPageBlocksContent = "ContentPageBlocksContent",
|
||||
ContentPageBlocksShortcuts = "ContentPageBlocksShortcuts",
|
||||
ContentPageBlocksCardsGrid = "ContentPageBlocksCardsGrid",
|
||||
ContentPageBlocksDynamicContent = "ContentPageBlocksDynamicContent",
|
||||
ContentPageBlocksTextCols = "ContentPageBlocksTextCols",
|
||||
}
|
||||
|
||||
export enum CardsGridEnum {
|
||||
LoyaltyCard = "LoyaltyCard",
|
||||
Card = "Card",
|
||||
}
|
||||
|
||||
export enum DynamicContentComponentEnum {
|
||||
loyalty_levels = "loyalty_levels",
|
||||
how_it_works = "how_it_works",
|
||||
overview_table = "overview_table",
|
||||
}
|
||||
|
||||
export enum SidebarTypenameEnum {
|
||||
ContentPageSidebarJoinLoyaltyContact = "ContentPageSidebarJoinLoyaltyContact",
|
||||
ContentPageSidebarContent = "ContentPageSidebarContent",
|
||||
ContentPageSidebarDynamicContent = "ContentPageSidebarDynamicContent",
|
||||
}
|
||||
|
||||
export type SidebarTypename = keyof typeof SidebarTypenameEnum
|
||||
|
||||
export enum JoinLoyaltyContactTypenameEnum {
|
||||
ContentPageSidebarJoinLoyaltyContactBlockContactContact = "ContentPageSidebarJoinLoyaltyContactBlockContactContact",
|
||||
}
|
||||
|
||||
export type JoinLoyaltyContactContact = Typename<
|
||||
JoinLoyaltyContact["join_loyalty_contact"],
|
||||
JoinLoyaltyContactTypenameEnum.ContentPageSidebarJoinLoyaltyContactBlockContactContact
|
||||
>
|
||||
|
||||
export enum SidebarDynamicComponentEnum {
|
||||
my_pages_navigation = "my_pages_navigation",
|
||||
}
|
||||
@@ -1,22 +0,0 @@
|
||||
import { ContactFields } from "@/server/routers/contentstack/base/output"
|
||||
|
||||
import {
|
||||
JoinLoyaltyContact,
|
||||
Sidebar,
|
||||
} from "@/types/trpc/routers/contentstack/contentPage"
|
||||
|
||||
export type SidebarProps = {
|
||||
blocks: Sidebar[]
|
||||
}
|
||||
|
||||
export type JoinLoyaltyContactProps = {
|
||||
block: JoinLoyaltyContact["join_loyalty_contact"]
|
||||
}
|
||||
|
||||
export type ContactProps = {
|
||||
contactBlock: JoinLoyaltyContact["join_loyalty_contact"]["contact"]
|
||||
}
|
||||
|
||||
export type ContactRowProps = {
|
||||
contact: ContactFields
|
||||
}
|
||||
@@ -3,7 +3,7 @@ import type { Node } from "@/types/requests/utils/edges"
|
||||
import type { RTENode } from "../rte/node"
|
||||
import type { RenderOptions } from "../rte/option"
|
||||
|
||||
export type JsonToHtmlProps = {
|
||||
export type DeprecatedJsonToHtmlProps = {
|
||||
embeds: Node<Embeds>[]
|
||||
nodes: RTENode[]
|
||||
renderOptions?: RenderOptions
|
||||
@@ -0,0 +1,55 @@
|
||||
import type { Location, Locations } from "@/types/trpc/routers/hotel/locations"
|
||||
|
||||
export interface BookingWidgetFormProps {
|
||||
locations: Locations
|
||||
}
|
||||
|
||||
export interface BookingWidgetFormContentProps {
|
||||
locations: Locations
|
||||
}
|
||||
|
||||
export enum ActionType {
|
||||
CLEAR_HISTORY_LOCATIONS = "CLEAR_HISTORY_LOCATIONS",
|
||||
CLEAR_SEARCH_LOCATIONS = "CLEAR_SEARCH_LOCATIONS",
|
||||
SEARCH_LOCATIONS = "SEARCH_LOCATIONS",
|
||||
SELECT_ITEM = "SELECT_ITEM",
|
||||
}
|
||||
|
||||
interface ClearHistoryLocationsAction {
|
||||
type: ActionType.CLEAR_HISTORY_LOCATIONS
|
||||
}
|
||||
|
||||
interface ClearSearchLocationsAction {
|
||||
type: ActionType.CLEAR_SEARCH_LOCATIONS
|
||||
}
|
||||
|
||||
interface SearchLocationsAction {
|
||||
payload: {
|
||||
search: string
|
||||
}
|
||||
type: ActionType.SEARCH_LOCATIONS
|
||||
}
|
||||
|
||||
interface SetItemAction {
|
||||
payload: {
|
||||
location: Location
|
||||
searchHistory: Locations
|
||||
}
|
||||
type: ActionType.SELECT_ITEM
|
||||
}
|
||||
|
||||
export type Action =
|
||||
| ClearHistoryLocationsAction
|
||||
| ClearSearchLocationsAction
|
||||
| SearchLocationsAction
|
||||
| SetItemAction
|
||||
|
||||
export interface State {
|
||||
defaultLocations: Locations
|
||||
locations: Locations
|
||||
search: string
|
||||
searchData: Location | undefined
|
||||
searchHistory: Locations | null
|
||||
}
|
||||
|
||||
export interface InitState extends Pick<State, "defaultLocations"> {}
|
||||
@@ -1,3 +0,0 @@
|
||||
export enum HotelBlocksTypenameEnum {
|
||||
HotelPageContentUpcomingActivitiesCard = "HotelPageContentUpcomingActivitiesCard",
|
||||
}
|
||||
@@ -1,43 +0,0 @@
|
||||
import { Typename } from "@/types/requests/utils/typename"
|
||||
import type { JoinLoyaltyContact } from "@/server/routers/contentstack/loyaltyPage/output"
|
||||
|
||||
export enum JoinLoyaltyContactTypenameEnum {
|
||||
LoyaltyPageSidebarJoinLoyaltyContactBlockContactContact = "LoyaltyPageSidebarJoinLoyaltyContactBlockContactContact",
|
||||
}
|
||||
|
||||
export type JoinLoyaltyContactContact = Typename<
|
||||
JoinLoyaltyContact["join_loyalty_contact"],
|
||||
JoinLoyaltyContactTypenameEnum.LoyaltyPageSidebarJoinLoyaltyContactBlockContactContact
|
||||
>
|
||||
|
||||
export enum SidebarTypenameEnum {
|
||||
LoyaltyPageSidebarJoinLoyaltyContact = "LoyaltyPageSidebarJoinLoyaltyContact",
|
||||
LoyaltyPageSidebarContent = "LoyaltyPageSidebarContent",
|
||||
LoyaltyPageSidebarDynamicContent = "LoyaltyPageSidebarDynamicContent",
|
||||
}
|
||||
|
||||
export type SidebarTypename = keyof typeof SidebarTypenameEnum
|
||||
|
||||
export enum LoyaltySidebarDynamicComponentEnum {
|
||||
my_pages_navigation = "my_pages_navigation",
|
||||
}
|
||||
|
||||
export enum LoyaltyComponentEnum {
|
||||
loyalty_levels = "loyalty_levels",
|
||||
how_it_works = "how_it_works",
|
||||
overview_table = "overview_table",
|
||||
}
|
||||
|
||||
export type LoyaltyComponent = keyof typeof LoyaltyComponentEnum
|
||||
|
||||
export enum LoyaltyBlocksTypenameEnum {
|
||||
LoyaltyPageBlocksDynamicContent = "LoyaltyPageBlocksDynamicContent",
|
||||
LoyaltyPageBlocksContent = "LoyaltyPageBlocksContent",
|
||||
LoyaltyPageBlocksShortcuts = "LoyaltyPageBlocksShortcuts",
|
||||
LoyaltyPageBlocksCardsGrid = "LoyaltyPageBlocksCardsGrid",
|
||||
}
|
||||
|
||||
export enum LoyaltyCardsGridEnum {
|
||||
LoyaltyCard = "LoyaltyCard",
|
||||
Card = "Card",
|
||||
}
|
||||
@@ -1,23 +0,0 @@
|
||||
import { ContactFields } from "@/server/routers/contentstack/base/output"
|
||||
import {
|
||||
JoinLoyaltyContact,
|
||||
Sidebar,
|
||||
} from "@/server/routers/contentstack/loyaltyPage/output"
|
||||
|
||||
import { LangParams } from "@/types/params"
|
||||
|
||||
export type SidebarProps = {
|
||||
blocks: Sidebar[]
|
||||
}
|
||||
|
||||
export type JoinLoyaltyContactProps = {
|
||||
block: JoinLoyaltyContact["join_loyalty_contact"]
|
||||
}
|
||||
|
||||
export type ContactProps = {
|
||||
contactBlock: JoinLoyaltyContact["join_loyalty_contact"]["contact"]
|
||||
}
|
||||
|
||||
export type ContactRowProps = {
|
||||
contact: ContactFields
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { getMetaDataSchema } from "@/server/routers/contentstack/metadata/output"
|
||||
import { getMetaDataSchema } from "@/server/routers/contentstack/schemas/metadata"
|
||||
|
||||
export interface MetaData extends z.infer<typeof getMetaDataSchema> {}
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
import { User } from "@/types/user"
|
||||
|
||||
export interface FriendProps
|
||||
extends React.PropsWithChildren<Pick<User, "membership" | "name">> {}
|
||||
@@ -0,0 +1,10 @@
|
||||
import { VariantProps } from "class-variance-authority"
|
||||
|
||||
import { membershipNumberVariants } from "@/components/Blocks/DynamicContent/Overview/Friend/MembershipNumber/membershipNumberVariants"
|
||||
|
||||
import type { User } from "@/types/user"
|
||||
|
||||
export interface MembershipNumberProps
|
||||
extends Omit<React.HTMLAttributes<HTMLDivElement>, "color">,
|
||||
VariantProps<typeof membershipNumberVariants>,
|
||||
Pick<User, "membership"> {}
|
||||
@@ -1,22 +1,20 @@
|
||||
import { AccountPageContentItem } from "@/server/routers/contentstack/accountPage/output"
|
||||
import { z } from "zod"
|
||||
|
||||
import { DynamicContentComponents } from "@/types/components/myPages/myPage/enums"
|
||||
import { blocksSchema } from "@/server/routers/contentstack/accountPage/output"
|
||||
|
||||
export type AccountPageContentProps = {
|
||||
component: DynamicContentComponents
|
||||
props: {
|
||||
title: string | null
|
||||
subtitle: string | null
|
||||
link?: { href: string; text: string }
|
||||
}
|
||||
}
|
||||
import { DynamicContent } from "@/types/trpc/routers/contentstack/blocks"
|
||||
|
||||
export type AccountPageComponentProps = {
|
||||
export interface AccountPageContentProps
|
||||
extends Pick<DynamicContent, "dynamic_content"> {}
|
||||
|
||||
export interface AccountPageComponentProps {
|
||||
title: string | null
|
||||
subtitle: string | null
|
||||
link?: { href: string; text: string }
|
||||
}
|
||||
|
||||
type Content = z.output<typeof blocksSchema>
|
||||
|
||||
export type ContentProps = {
|
||||
content: AccountPageContentItem[]
|
||||
content: Content[]
|
||||
}
|
||||
|
||||
@@ -1,6 +0,0 @@
|
||||
import type { User } from "@/types/user"
|
||||
|
||||
export type ChallengesProps = {
|
||||
journeys: User["journeys"]
|
||||
victories: User["victories"]
|
||||
}
|
||||
@@ -1,4 +1,4 @@
|
||||
import { awardPointsVariants } from "@/components/MyPages/Blocks/Points/EarnAndBurn/AwardPoints/awardPointsVariants"
|
||||
import { awardPointsVariants } from "@/components/Blocks/DynamicContent/Points/EarnAndBurn/AwardPoints/awardPointsVariants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
|
||||
|
||||
@@ -1,32 +0,0 @@
|
||||
export enum DynamicContentComponents {
|
||||
membership_overview = "membership_overview",
|
||||
points_overview = "points_overview",
|
||||
soonest_stays = "soonest_stays",
|
||||
previous_stays = "previous_stays",
|
||||
upcoming_stays = "upcoming_stays",
|
||||
current_benefits = "current_benefits",
|
||||
next_benefits = "next_benefits",
|
||||
my_points = "my_points",
|
||||
expiring_points = "expiring_points",
|
||||
earn_and_burn = "earn_and_burn",
|
||||
}
|
||||
|
||||
export enum ContentEntries {
|
||||
AccountPageContentDynamicContent = "AccountPageContentDynamicContent",
|
||||
AccountPageContentShortcuts = "AccountPageContentShortcuts",
|
||||
AccountPageContentTextContent = "AccountPageContentTextContent",
|
||||
}
|
||||
|
||||
export enum RewardTransactionTypes {
|
||||
stay = "stay",
|
||||
rewardNight = "rewardnight",
|
||||
enrollment = "enrollment",
|
||||
expired = "expired",
|
||||
redgift = "redgift",
|
||||
ancillary = "ancillary",
|
||||
pointShop = "pointshop",
|
||||
tui_points = "tui_points",
|
||||
mastercard_points = "mastercard_points",
|
||||
stayAdj = "stay/adj",
|
||||
othersAdj = "others/adj",
|
||||
}
|
||||
@@ -1,12 +1,5 @@
|
||||
export type ShortcutsProps = {
|
||||
import type { Shortcut } from "@/types/trpc/routers/contentstack/blocks"
|
||||
|
||||
export interface ShortcutsProps extends Shortcut {
|
||||
firstItem?: boolean
|
||||
openInNewTab?: boolean
|
||||
shortcuts: {
|
||||
url: string
|
||||
title: string
|
||||
openInNewTab?: boolean
|
||||
text?: string
|
||||
}[]
|
||||
subtitle: string | null
|
||||
title: string | null
|
||||
}
|
||||
|
||||
@@ -1,4 +1,3 @@
|
||||
import type { Lang } from "@/constants/languages"
|
||||
import type { UserQueryRouter } from "../user"
|
||||
|
||||
export type PreviousStaysResponse = Awaited<
|
||||
|
||||
@@ -1,38 +1,15 @@
|
||||
import { Lang } from "@/constants/languages"
|
||||
import { membershipLevels } from "@/constants/membershipLevels"
|
||||
import {
|
||||
Block,
|
||||
CardsGrid,
|
||||
DynamicContent,
|
||||
RteBlockContent,
|
||||
} from "@/server/routers/contentstack/loyaltyPage/output"
|
||||
|
||||
import { MembershipLevel } from "@/utils/user"
|
||||
|
||||
import type { IntlFormatters } from "@formatjs/intl"
|
||||
|
||||
export type BlocksProps = {
|
||||
blocks: Block[]
|
||||
}
|
||||
|
||||
export type DynamicContentProps = {
|
||||
dynamicContent: DynamicContent["dynamic_content"]
|
||||
firstItem: boolean
|
||||
}
|
||||
|
||||
export type DynamicComponentProps = {
|
||||
component: DynamicContent["dynamic_content"]["component"]
|
||||
}
|
||||
|
||||
export type CardsGridProps = Pick<CardsGrid, "cards_grid"> & {
|
||||
firstItem?: boolean
|
||||
}
|
||||
|
||||
export type Content = { content: RteBlockContent["content"]["content"] }
|
||||
|
||||
type BenefitTitle = { title: string }
|
||||
|
||||
export type OverviewTableProps = { activeMembership: MembershipLevel | null }
|
||||
export type OverviewTableClientProps = {
|
||||
activeMembership: MembershipLevel | null
|
||||
}
|
||||
|
||||
export type Level = {
|
||||
level: membershipLevels
|
||||
@@ -0,0 +1,54 @@
|
||||
import { dialogVariants } from "@/components/Forms/BookingWidget/FormContent/Search/SearchList/Dialog/variants"
|
||||
|
||||
import type { VariantProps } from "class-variance-authority"
|
||||
import type { PropGetters } from "downshift"
|
||||
|
||||
import type { Location, Locations } from "../trpc/routers/hotel/locations"
|
||||
|
||||
export interface SearchProps {
|
||||
locations: Locations
|
||||
}
|
||||
|
||||
type HighlightedIndex = number | null
|
||||
|
||||
export interface SearchListProps {
|
||||
getItemProps: PropGetters<unknown>["getItemProps"]
|
||||
getMenuProps: PropGetters<unknown>["getMenuProps"]
|
||||
isOpen: boolean
|
||||
highlightedIndex: HighlightedIndex
|
||||
locations: Locations
|
||||
search: string
|
||||
searchHistory: Locations | null
|
||||
}
|
||||
|
||||
export interface ListProps {
|
||||
getItemProps: PropGetters<unknown>["getItemProps"]
|
||||
highlightedIndex: HighlightedIndex
|
||||
initialIndex?: number
|
||||
label?: string
|
||||
locations: Locations
|
||||
}
|
||||
|
||||
export interface ListItemProps {
|
||||
getItemProps: PropGetters<unknown>["getItemProps"]
|
||||
highlightedIndex: HighlightedIndex
|
||||
index: number
|
||||
location: Location
|
||||
}
|
||||
|
||||
export interface DialogProps
|
||||
extends React.PropsWithChildren,
|
||||
VariantProps<typeof dialogVariants> {
|
||||
className?: string
|
||||
getMenuProps: PropGetters<unknown>["getMenuProps"]
|
||||
}
|
||||
|
||||
export interface ErrorDialogProps extends React.PropsWithChildren {
|
||||
getMenuProps: PropGetters<unknown>["getMenuProps"]
|
||||
}
|
||||
|
||||
export interface ClearSearchButtonProps {
|
||||
getItemProps: PropGetters<unknown>["getItemProps"]
|
||||
highlightedIndex: HighlightedIndex
|
||||
index: number
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import type { SidebarBlock as ContentPageSidebarBlock } from "@/types/trpc/routers/contentstack/contentPage"
|
||||
import type { SidebarBlock as LoyaltyPageSidebarBlock } from "@/types/trpc/routers/contentstack/loyaltyPage"
|
||||
|
||||
export type Blocks = ContentPageSidebarBlock | LoyaltyPageSidebarBlock
|
||||
|
||||
export interface SidebarProps {
|
||||
blocks: Blocks[]
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
import type {
|
||||
Contacts,
|
||||
JoinLoyaltyContact,
|
||||
} from "@/types/trpc/routers/contentstack/sidebar"
|
||||
import type { ContactFields } from "@/server/routers/contentstack/base/output"
|
||||
|
||||
export interface JoinLoyaltyContactProps {
|
||||
block: JoinLoyaltyContact["join_loyalty_contact"]
|
||||
}
|
||||
|
||||
export interface ContactProps {
|
||||
contactBlock: Contacts
|
||||
}
|
||||
|
||||
export interface ContactRowProps {
|
||||
contact: ContactFields
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import type { ZodDiscriminatedUnionOption, ZodError } from "zod"
|
||||
|
||||
export interface DiscriminatedUnionError {
|
||||
error: ZodError<unknown>
|
||||
}
|
||||
|
||||
export interface Option extends ZodDiscriminatedUnionOption<"__typename"> {}
|
||||
@@ -0,0 +1,9 @@
|
||||
export namespace AccountPageEnum {
|
||||
export namespace ContentStack {
|
||||
export const enum blocks {
|
||||
DynamicContent = "AccountPageContentDynamicContent",
|
||||
ShortCuts = "AccountPageContentShortcuts",
|
||||
TextContent = "AccountPageContentTextContent",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export namespace BlocksEnums {
|
||||
export const enum block {
|
||||
CardsGrid = "CardsGrid",
|
||||
Content = "Content",
|
||||
DynamicContent = "DynamicContent",
|
||||
Shortcuts = "Shortcuts",
|
||||
TextCols = "TextCols",
|
||||
TextContent = "TextContent",
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,6 @@
|
||||
export namespace CardsGridEnum {
|
||||
export const enum cards {
|
||||
Card = "Card",
|
||||
LoyaltyCard = "LoyaltyCard",
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
export namespace ContentEnum {
|
||||
export const enum blocks {
|
||||
AccountPage = "AccountPage",
|
||||
ContentPage = "ContentPage",
|
||||
HotelPage = "HotelPage",
|
||||
ImageContainer = "ImageContainer",
|
||||
LoyaltyPage = "LoyaltyPage",
|
||||
SysAsset = "SysAsset",
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,17 @@
|
||||
export namespace ContentPageEnum {
|
||||
export namespace ContentStack {
|
||||
export const enum blocks {
|
||||
CardsGrid = "ContentPageBlocksCardsGrid",
|
||||
Content = "ContentPageBlocksContent",
|
||||
DynamicContent = "ContentPageBlocksDynamicContent",
|
||||
Shortcuts = "ContentPageBlocksShortcuts",
|
||||
TextCols = "ContentPageBlocksTextCols",
|
||||
}
|
||||
|
||||
export const enum sidebar {
|
||||
Content = "ContentPageSidebarContent",
|
||||
DynamicContent = "ContentPageSidebarDynamicContent",
|
||||
JoinLoyaltyContact = "ContentPageSidebarJoinLoyaltyContact",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,45 @@
|
||||
export namespace DynamicContentEnum {
|
||||
export namespace Blocks {
|
||||
export const enum components {
|
||||
current_benefits = "current_benefits",
|
||||
earn_and_burn = "earn_and_burn",
|
||||
expiring_points = "expiring_points",
|
||||
how_it_works = "how_it_works",
|
||||
loyalty_levels = "loyalty_levels",
|
||||
membership_overview = "membership_overview",
|
||||
my_points = "my_points",
|
||||
next_benefits = "next_benefits",
|
||||
overview_table = "overview_table",
|
||||
points_overview = "points_overview",
|
||||
previous_stays = "previous_stays",
|
||||
soonest_stays = "soonest_stays",
|
||||
upcoming_stays = "upcoming_stays",
|
||||
}
|
||||
|
||||
/** Type needed to satisfy zod enum type */
|
||||
export const enums: [components, ...components[]] = [
|
||||
components.current_benefits,
|
||||
components.earn_and_burn,
|
||||
components.expiring_points,
|
||||
components.how_it_works,
|
||||
components.loyalty_levels,
|
||||
components.membership_overview,
|
||||
components.my_points,
|
||||
components.next_benefits,
|
||||
components.overview_table,
|
||||
components.points_overview,
|
||||
components.previous_stays,
|
||||
components.soonest_stays,
|
||||
components.upcoming_stays,
|
||||
]
|
||||
}
|
||||
|
||||
export namespace Sidebar {
|
||||
export const enum components {
|
||||
my_pages_navigation = "my_pages_navigation",
|
||||
}
|
||||
|
||||
/** Type needed to satisfy zod enum type */
|
||||
export const enums: [string, ...string[]] = [components.my_pages_navigation]
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export namespace HotelPageEnum {
|
||||
export namespace ContentStack {
|
||||
export const enum blocks {
|
||||
ActivitiesCard = "HotelPageContentUpcomingActivitiesCard",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,11 @@
|
||||
export namespace JoinLoyaltyContactEnums {
|
||||
export namespace ContentStack {
|
||||
export const enum contact {
|
||||
ContentPage = "ContentPageSidebarJoinLoyaltyContactBlockContactContact",
|
||||
LoyaltyPage = "LoyaltyPageSidebarJoinLoyaltyContactBlockContactContact",
|
||||
}
|
||||
}
|
||||
export const enum contact {
|
||||
Contact = "Contact",
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,16 @@
|
||||
export namespace LoyaltyPageEnum {
|
||||
export namespace ContentStack {
|
||||
export const enum blocks {
|
||||
CardsGrid = "LoyaltyPageBlocksCardsGrid",
|
||||
Content = "LoyaltyPageBlocksContent",
|
||||
DynamicContent = "LoyaltyPageBlocksDynamicContent",
|
||||
Shortcuts = "LoyaltyPageBlocksShortcuts",
|
||||
}
|
||||
|
||||
export const enum sidebar {
|
||||
Content = "LoyaltyPageSidebarContent",
|
||||
DynamicContent = "LoyaltyPageSidebarDynamicContent",
|
||||
JoinLoyaltyContact = "LoyaltyPageSidebarJoinLoyaltyContact",
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
export namespace SidebarEnums {
|
||||
export const enum blocks {
|
||||
Content = "Content",
|
||||
DynamicContent = "DynamicContent",
|
||||
JoinLoyaltyContact = "JoinLoyaltyContact",
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,15 @@
|
||||
export namespace Transactions {
|
||||
export const enum rewardType {
|
||||
stay = "stay",
|
||||
rewardNight = "rewardnight",
|
||||
enrollment = "enrollment",
|
||||
expired = "expired",
|
||||
redgift = "redgift",
|
||||
ancillary = "ancillary",
|
||||
pointShop = "pointshop",
|
||||
tui_points = "tui_points",
|
||||
mastercard_points = "mastercard_points",
|
||||
stayAdj = "stay/adj",
|
||||
othersAdj = "others/adj",
|
||||
}
|
||||
}
|
||||
+3
-3
@@ -1,10 +1,10 @@
|
||||
export type Image = {
|
||||
description?: string
|
||||
export interface Image {
|
||||
description?: string | null
|
||||
dimension: {
|
||||
height: number
|
||||
width: number
|
||||
}
|
||||
metadata: JSON | null
|
||||
metadata?: JSON | null
|
||||
system: {
|
||||
uid: string
|
||||
}
|
||||
|
||||
+15
-12
@@ -1,20 +1,23 @@
|
||||
import { EmbedEnum } from "./utils/embeds"
|
||||
import { PageLink } from "./utils/pageLink"
|
||||
import { Typename } from "./utils/typename"
|
||||
import { PageLink, PageLinkWithOriginalUrl } from "./utils/pageLink"
|
||||
import { TypenameInterface } from "./utils/typename"
|
||||
|
||||
import type { ImageContainer } from "./imageContainer"
|
||||
import type { SysAsset } from "./utils/asset"
|
||||
|
||||
type PageLinkWithOriginalUrl = PageLink & {
|
||||
web: { original_url?: string | null }
|
||||
}
|
||||
type ContentPage = Typename<PageLinkWithOriginalUrl, EmbedEnum.ContentPage>
|
||||
type LoyaltyPage = Typename<PageLinkWithOriginalUrl, EmbedEnum.LoyaltyPage>
|
||||
type AccountPage = Typename<PageLinkWithOriginalUrl, EmbedEnum.AccountPage>
|
||||
interface AccountPage
|
||||
extends TypenameInterface<EmbedEnum.AccountPage>,
|
||||
PageLink {}
|
||||
interface ContentPage
|
||||
extends TypenameInterface<EmbedEnum.ContentPage>,
|
||||
PageLinkWithOriginalUrl {}
|
||||
interface LoyaltyPage
|
||||
extends TypenameInterface<EmbedEnum.LoyaltyPage>,
|
||||
PageLinkWithOriginalUrl {}
|
||||
|
||||
export type Embeds =
|
||||
| SysAsset
|
||||
| ImageContainer
|
||||
| ContentPage
|
||||
| LoyaltyPage
|
||||
| AccountPage
|
||||
| ContentPage
|
||||
| ImageContainer
|
||||
| LoyaltyPage
|
||||
| SysAsset
|
||||
|
||||
@@ -1,14 +1,12 @@
|
||||
import { ImageVaultAssetResponse } from "../components/imageVault"
|
||||
import { EmbedEnum } from "./utils/embeds"
|
||||
import { Typename } from "./utils/typename"
|
||||
|
||||
export type ImageContainer = Typename<
|
||||
{
|
||||
image_left: ImageVaultAssetResponse
|
||||
image_right: ImageVaultAssetResponse
|
||||
system: {
|
||||
uid: string
|
||||
}
|
||||
},
|
||||
EmbedEnum.ImageContainer
|
||||
>
|
||||
import type { ImageVaultAssetResponse } from "../components/imageVault"
|
||||
import type { System } from "./system"
|
||||
import type { TypenameInterface } from "./utils/typename"
|
||||
|
||||
export interface ImageContainer
|
||||
extends TypenameInterface<EmbedEnum.ImageContainer>,
|
||||
System {
|
||||
image_left?: ImageVaultAssetResponse
|
||||
image_right?: ImageVaultAssetResponse
|
||||
}
|
||||
|
||||
@@ -13,7 +13,10 @@ export type LanguageSwitcherData = {
|
||||
}
|
||||
|
||||
type LanguageResult = {
|
||||
items: { web?: { original_url?: string | null }; url: string }[]
|
||||
web?: {
|
||||
original_url?: string | null
|
||||
}
|
||||
url: string
|
||||
}
|
||||
|
||||
export type LanguageSwitcherQueryDataRaw = {
|
||||
|
||||
@@ -1,6 +1,9 @@
|
||||
import { Lang } from "@/constants/languages"
|
||||
|
||||
export interface System {
|
||||
system: {
|
||||
content_type_uid: string
|
||||
locale: Lang
|
||||
uid: string
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,7 @@
|
||||
import type { Image } from "@/types/image"
|
||||
import type { EmbedEnum } from "./embeds"
|
||||
import type { Typename } from "./typename"
|
||||
import type { TypenameInterface } from "./typename"
|
||||
|
||||
export type SysAsset = Typename<Image, EmbedEnum.SysAsset>
|
||||
export interface SysAsset
|
||||
extends TypenameInterface<EmbedEnum.SysAsset>,
|
||||
Image {}
|
||||
|
||||
@@ -1,14 +1,18 @@
|
||||
import type { Lang } from "@/constants/languages"
|
||||
import { z } from "zod"
|
||||
|
||||
import {
|
||||
extendedPageLinkSchema,
|
||||
pageLinkSchema,
|
||||
} from "@/server/routers/contentstack/schemas/pageLinks"
|
||||
|
||||
import type { EmbedEnum } from "./embeds"
|
||||
import type { Typename } from "./typename"
|
||||
import type { TypenameInterface } from "./typename"
|
||||
|
||||
export type PageLink = {
|
||||
system: {
|
||||
uid: string
|
||||
locale: Lang
|
||||
}
|
||||
title: string
|
||||
url: string
|
||||
}
|
||||
export interface PageLink extends z.output<typeof pageLinkSchema> {}
|
||||
|
||||
export type PageLinkType = Typename<PageLink, EmbedEnum.CurrentBlocksPage>
|
||||
export interface PageLinkWithOriginalUrl
|
||||
extends z.output<typeof extendedPageLinkSchema> {}
|
||||
|
||||
export interface PageLinkType
|
||||
extends TypenameInterface<EmbedEnum.CurrentBlocksPage>,
|
||||
PageLink {}
|
||||
|
||||
+7
-6
@@ -1,4 +1,7 @@
|
||||
import { ImageVaultAssetResponse } from "../components/imageVault"
|
||||
import {
|
||||
ImageVaultAsset,
|
||||
ImageVaultAssetResponse,
|
||||
} from "../components/imageVault"
|
||||
import { RTEItemTypeEnum } from "./enums"
|
||||
|
||||
import type { Lang } from "@/constants/languages"
|
||||
@@ -39,10 +42,8 @@ export interface RTELinkAttrs extends Attributes {
|
||||
type: RTEItemTypeEnum.entry
|
||||
}
|
||||
|
||||
export interface RTEImageVaultAttrs
|
||||
extends Attributes,
|
||||
ImageVaultAssetResponse {
|
||||
export type RTEImageVaultAttrs = Attributes & {
|
||||
height: string
|
||||
width: string
|
||||
style: string[]
|
||||
}
|
||||
width: string
|
||||
} & (ImageVaultAssetResponse | ImageVaultAsset)
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
import { RTETypeEnum } from "./enums"
|
||||
|
||||
import type { EmbedByUid } from "../components/jsontohtml"
|
||||
import type { EmbedByUid } from "../components/deprecatedjsontohtml"
|
||||
import type {
|
||||
Attributes,
|
||||
RTEAnchorAttrs,
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
import type { Node } from "@/types/requests/utils/edges"
|
||||
import type { Embeds } from "@/types/trpc/routers/utils/embeds"
|
||||
import type { RTENode } from "./rte/node"
|
||||
import type { RenderOptions } from "./rte/option"
|
||||
|
||||
export type JsonToHtmlProps = {
|
||||
embeds: Node<Embeds>[]
|
||||
nodes: RTENode[]
|
||||
renderOptions?: RenderOptions
|
||||
}
|
||||
|
||||
export type EmbedByUid = Record<string, Node<Embeds>>
|
||||
@@ -0,0 +1,46 @@
|
||||
import { ImageVaultAsset } from "../../components/imageVault"
|
||||
import { RTEItemTypeEnum } from "./enums"
|
||||
|
||||
import type { Lang } from "@/constants/languages"
|
||||
import type { EmbedTypesEnum, RTEItemType } from "./enums"
|
||||
|
||||
export interface Attributes {
|
||||
[key: string]: any
|
||||
"class-name"?: string
|
||||
type: RTEItemType
|
||||
}
|
||||
|
||||
export interface RTEAssetAttrs extends Attributes {
|
||||
alt: string
|
||||
"asset-alt": string
|
||||
"asset-link": string
|
||||
"asset-name": string
|
||||
"asset-type": "image/png" | "image/jpg" | "image/jpeg"
|
||||
"asset-uid": string
|
||||
"display-type": EmbedTypesEnum.display
|
||||
"content-type-uid": "sys_assets"
|
||||
inline: false
|
||||
type: RTEItemTypeEnum.asset
|
||||
}
|
||||
|
||||
export interface RTEAnchorAttrs extends Attributes {
|
||||
target: string
|
||||
url: string
|
||||
}
|
||||
|
||||
export interface RTELinkAttrs extends Attributes {
|
||||
"display-type": EmbedTypesEnum.link
|
||||
"class-name": string
|
||||
"content-type-uid": string
|
||||
"entry-uid": string
|
||||
locale: Lang
|
||||
href: string
|
||||
target: HTMLAnchorElement["target"]
|
||||
type: RTEItemTypeEnum.entry
|
||||
}
|
||||
|
||||
export interface RTEImageVaultAttrs extends Attributes, ImageVaultAsset {
|
||||
height: string
|
||||
style: string[]
|
||||
width: string
|
||||
}
|
||||
@@ -0,0 +1,64 @@
|
||||
export enum EmbedTypesEnum {
|
||||
block = "block",
|
||||
display = "display",
|
||||
download = "download",
|
||||
inline = "inline",
|
||||
link = "link",
|
||||
}
|
||||
|
||||
export type EmbedTypes = keyof typeof EmbedTypesEnum
|
||||
|
||||
/** Copied from https://github.com/contentstack/contentstack-utils-javascript/blob/master/src/nodes/node-type.ts */
|
||||
export enum RTETypeEnum {
|
||||
a = "a",
|
||||
blockquote = "blockquote",
|
||||
code = "code",
|
||||
doc = "doc",
|
||||
embed = "embed",
|
||||
h1 = "h1",
|
||||
h2 = "h2",
|
||||
h3 = "h3",
|
||||
h4 = "h4",
|
||||
h5 = "h5",
|
||||
h6 = "h6",
|
||||
hr = "hr",
|
||||
img = "img",
|
||||
li = "li",
|
||||
ol = "ol",
|
||||
p = "p",
|
||||
reference = "reference",
|
||||
table = "table",
|
||||
tbody = "tbody",
|
||||
td = "td",
|
||||
text = "text",
|
||||
tfoot = "tfoot",
|
||||
th = "th",
|
||||
thead = "thead",
|
||||
tr = "tr",
|
||||
ul = "ul",
|
||||
ImageVault = "ImageVault",
|
||||
fragment = "fragment",
|
||||
}
|
||||
|
||||
export type RTEType = keyof typeof RTETypeEnum
|
||||
|
||||
export enum RTEItemTypeEnum {
|
||||
asset = "asset",
|
||||
entry = "entry",
|
||||
}
|
||||
|
||||
export type RTEItemType = keyof typeof RTEItemTypeEnum
|
||||
|
||||
export enum AvailableParagraphFormatEnum {
|
||||
"script-1" = "script-1",
|
||||
"script-2" = "script-2",
|
||||
"footnote" = "footnote",
|
||||
"caption" = "caption",
|
||||
"subtitle-1" = "subtitle-1",
|
||||
"subtitle-2" = "subtitle-2",
|
||||
}
|
||||
|
||||
export enum AvailableULFormatEnum {
|
||||
"heart" = "heart",
|
||||
"check" = "check",
|
||||
}
|
||||
@@ -0,0 +1,97 @@
|
||||
import { RTETypeEnum } from "./enums"
|
||||
|
||||
import type { EmbedByUid } from "../jsontohtml"
|
||||
import type {
|
||||
Attributes,
|
||||
RTEAnchorAttrs,
|
||||
RTEAssetAttrs,
|
||||
RTEImageVaultAttrs,
|
||||
RTELinkAttrs,
|
||||
} from "./attrs"
|
||||
import type { RenderOptions } from "./option"
|
||||
|
||||
export interface RTEDefaultNode {
|
||||
attrs: Attributes
|
||||
children: RTENode[]
|
||||
type: RTETypeEnum
|
||||
uid: string
|
||||
}
|
||||
|
||||
export interface RTELinkNode {
|
||||
attrs: Attributes
|
||||
children: RTENode[]
|
||||
type: RTETypeEnum
|
||||
uid: string
|
||||
}
|
||||
|
||||
export interface RTEReferenceAssetNode extends RTEDefaultNode {
|
||||
attrs: RTEAssetAttrs
|
||||
}
|
||||
|
||||
export interface RTEAnchorNode extends RTEDefaultNode {
|
||||
attrs: RTEAnchorAttrs
|
||||
type: RTETypeEnum.a
|
||||
}
|
||||
|
||||
export interface RTEReferenceLinkNode extends RTEDefaultNode {
|
||||
attrs: RTELinkAttrs
|
||||
}
|
||||
|
||||
export interface RTEImageVaultNode extends RTEDefaultNode {
|
||||
attrs: RTEImageVaultAttrs
|
||||
type: RTETypeEnum.ImageVault
|
||||
}
|
||||
|
||||
export enum RTEMarkType {
|
||||
bold = "bold",
|
||||
break = "break",
|
||||
classnameOrId = "classnameOrId",
|
||||
inlineCode = "inlineCode",
|
||||
italic = "italic",
|
||||
strikethrough = "strikethrough",
|
||||
subscript = "subscript",
|
||||
superscript = "superscript",
|
||||
underline = "underline",
|
||||
}
|
||||
|
||||
type RTETextNodeOptionalKeys = {
|
||||
[key in RTEMarkType]?: boolean
|
||||
}
|
||||
|
||||
export type RTETextNode = RTETextNodeOptionalKeys & {
|
||||
classname?: string
|
||||
id?: string
|
||||
text: string
|
||||
}
|
||||
|
||||
export type RTERegularNode = RTEDefaultNode | RTEAnchorNode | RTEImageVaultNode
|
||||
|
||||
export type RTEImageNode = RTEDefaultNode | RTEImageVaultNode
|
||||
|
||||
export type RTEReferenceNode = RTEAnchorNode
|
||||
|
||||
export type RTENode = RTERegularNode | RTEReferenceNode | RTETextNode
|
||||
|
||||
export type RTERenderMark = (
|
||||
children: React.ReactNode,
|
||||
classname?: string,
|
||||
id?: string
|
||||
) => JSX.Element
|
||||
|
||||
export interface RTEDocument extends RTEDefaultNode {
|
||||
type: RTETypeEnum.doc
|
||||
_version: number
|
||||
}
|
||||
|
||||
export type RTERenderOptionComponent = (
|
||||
node: RTERegularNode,
|
||||
embeds: EmbedByUid,
|
||||
next: RTENext,
|
||||
fullRenderOptions: RenderOptions
|
||||
) => React.ReactNode
|
||||
|
||||
export type RTENext = (
|
||||
nodes: RTENode[],
|
||||
embeds: EmbedByUid,
|
||||
fullRenderOptions: RenderOptions
|
||||
) => string
|
||||
@@ -0,0 +1,5 @@
|
||||
import type { RTERenderMark, RTERenderOptionComponent } from "./node"
|
||||
|
||||
export type RenderOptions = {
|
||||
[type: string]: RTERenderOptionComponent | RTERenderMark
|
||||
}
|
||||
@@ -0,0 +1,27 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import {
|
||||
accountPageMetadataSchema,
|
||||
accountPageRefsSchema,
|
||||
accountPageSchema,
|
||||
blocksSchema,
|
||||
} from "@/server/routers/contentstack/accountPage/output"
|
||||
|
||||
export interface GetAccountPageRefsSchema
|
||||
extends z.input<typeof accountPageRefsSchema> {}
|
||||
|
||||
export interface AccountPageRefs
|
||||
extends z.output<typeof accountPageRefsSchema> {}
|
||||
|
||||
export interface GetAccountPageSchema
|
||||
extends z.input<typeof accountPageSchema> {}
|
||||
|
||||
export interface AccountPage extends z.output<typeof accountPageSchema> {}
|
||||
|
||||
export interface GetAccountpageMetadata
|
||||
extends z.output<typeof accountPageMetadataSchema> {}
|
||||
|
||||
export interface AccountPageMetadata
|
||||
extends z.output<typeof accountPageMetadataSchema> {}
|
||||
|
||||
export type Block = z.output<typeof blocksSchema>
|
||||
@@ -0,0 +1,16 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { cardsGridSchema } from "@/server/routers/contentstack/schemas/blocks/cardsGrid"
|
||||
import { contentSchema } from "@/server/routers/contentstack/schemas/blocks/content"
|
||||
import { dynamicContentSchema } from "@/server/routers/contentstack/schemas/blocks/dynamicContent"
|
||||
import { shortcutsSchema } from "@/server/routers/contentstack/schemas/blocks/shortcuts"
|
||||
|
||||
import { textColsSchema } from "@/server/routers/contentstack/schemas/blocks/textCols"
|
||||
|
||||
export interface CardsGrid extends z.output<typeof cardsGridSchema> { }
|
||||
export interface Content extends z.output<typeof contentSchema> { }
|
||||
export interface DynamicContent extends z.output<typeof dynamicContentSchema> { }
|
||||
export interface Shortcuts extends z.output<typeof shortcutsSchema> { }
|
||||
export type Shortcut = Shortcuts["shortcuts"]
|
||||
export interface TextCols extends z.output<typeof textColsSchema> { }
|
||||
|
||||
@@ -1,103 +1,23 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import {
|
||||
cardBlock,
|
||||
contentPageBlockTextContent,
|
||||
contentPageCards,
|
||||
contentPageDynamicContent,
|
||||
contentPageJoinLoyaltyContact,
|
||||
contentPageShortcuts,
|
||||
contentPageSidebarDynamicContent,
|
||||
contentPageSidebarTextContent,
|
||||
contentPageTextCols,
|
||||
loyaltyCardBlock,
|
||||
validateContentPageRefsSchema,
|
||||
validateContentPageSchema,
|
||||
blocksSchema,
|
||||
contentPageRefsSchema,
|
||||
contentPageSchema,
|
||||
sidebarSchema,
|
||||
} from "@/server/routers/contentstack/contentPage/output"
|
||||
|
||||
import { ImageVaultAsset } from "@/types/components/imageVault"
|
||||
import { Embeds } from "@/types/requests/embeds"
|
||||
import { EdgesWithTotalCount } from "@/types/requests/utils/edges"
|
||||
import { RTEDocument } from "@/types/rte/node"
|
||||
export interface GetContentPageRefsSchema
|
||||
extends z.input<typeof contentPageRefsSchema> { }
|
||||
|
||||
export type ContentPageDataRaw = z.infer<typeof validateContentPageSchema>
|
||||
export interface ContentPageRefs
|
||||
extends z.output<typeof contentPageRefsSchema> { }
|
||||
|
||||
type ContentPageRaw = ContentPageDataRaw["content_page"]
|
||||
export interface GetContentPageSchema
|
||||
extends z.input<typeof contentPageSchema> { }
|
||||
|
||||
export type ContentPage = Omit<
|
||||
ContentPageRaw,
|
||||
"blocks" | "hero_image" | "sidebar"
|
||||
> & {
|
||||
heroImage?: ImageVaultAsset
|
||||
blocks: Block[]
|
||||
sidebar: Sidebar[]
|
||||
}
|
||||
export interface ContentPage extends z.output<typeof contentPageSchema> { }
|
||||
|
||||
export type ContentPageRefsDataRaw = z.infer<
|
||||
typeof validateContentPageRefsSchema
|
||||
>
|
||||
export type Block = z.output<typeof blocksSchema>
|
||||
|
||||
type SidebarContentRaw = z.infer<typeof contentPageSidebarTextContent>
|
||||
type SideBarDynamicContent = z.infer<typeof contentPageSidebarDynamicContent>
|
||||
export type JoinLoyaltyContact = z.infer<typeof contentPageJoinLoyaltyContact>
|
||||
export type RteSidebarContent = Omit<SidebarContentRaw, "content"> & {
|
||||
content: {
|
||||
content: {
|
||||
json: RTEDocument
|
||||
embedded_itemsConnection: EdgesWithTotalCount<Embeds>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type Sidebar =
|
||||
| JoinLoyaltyContact
|
||||
| RteSidebarContent
|
||||
| SideBarDynamicContent
|
||||
|
||||
export type DynamicContent = z.infer<typeof contentPageDynamicContent>
|
||||
|
||||
type BlockContentRaw = z.infer<typeof contentPageBlockTextContent>
|
||||
export interface RteBlockContent extends BlockContentRaw {
|
||||
content: {
|
||||
content: {
|
||||
json: RTEDocument
|
||||
embedded_itemsConnection: EdgesWithTotalCount<Embeds>
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export type Shortcuts = z.infer<typeof contentPageShortcuts>
|
||||
|
||||
type LoyaltyCardRaw = z.infer<typeof loyaltyCardBlock>
|
||||
type LoyaltyCard = Omit<LoyaltyCardRaw, "image"> & {
|
||||
image?: ImageVaultAsset
|
||||
}
|
||||
type CardRaw = z.infer<typeof cardBlock>
|
||||
type Card = Omit<CardRaw, "background_image"> & {
|
||||
backgroundImage?: ImageVaultAsset
|
||||
}
|
||||
type CardsGridRaw = z.infer<typeof contentPageCards>
|
||||
export type CardsGrid = Omit<CardsGridRaw, "cards"> & {
|
||||
cards: (LoyaltyCard | Card)[]
|
||||
}
|
||||
export type CardsRaw = CardsGrid["cards_grid"]["cards"][number]
|
||||
|
||||
type TextColsRaw = z.infer<typeof contentPageTextCols>
|
||||
export interface TextCols extends TextColsRaw {
|
||||
textCols: {
|
||||
columns: {
|
||||
title: string
|
||||
text: {
|
||||
json: RTEDocument
|
||||
embedded_itemsConnection: EdgesWithTotalCount<Embeds>
|
||||
}
|
||||
}[]
|
||||
}
|
||||
}
|
||||
|
||||
export type Block =
|
||||
| RteBlockContent
|
||||
| Shortcuts
|
||||
| CardsGrid
|
||||
| DynamicContent
|
||||
| TextCols
|
||||
export type SidebarBlock = z.output<typeof sidebarSchema>
|
||||
|
||||
@@ -0,0 +1,15 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import {
|
||||
contentBlock,
|
||||
hotelPageSchema,
|
||||
} from "@/server/routers/contentstack/hotelPage/output"
|
||||
import { activitiesCard } from "@/server/routers/contentstack/schemas/blocks/activitiesCard"
|
||||
|
||||
// Will be extended once we introduce more functionality to our entries.
|
||||
export interface GetHotelPageData extends z.input<typeof hotelPageSchema> {}
|
||||
export interface HotelPage extends z.output<typeof hotelPageSchema> {}
|
||||
|
||||
export interface ActivitiesCard extends z.output<typeof activitiesCard> {}
|
||||
export type ActivityCard = ActivitiesCard["upcoming_activities_card"]
|
||||
export interface ContentBlock extends z.output<typeof contentBlock> {}
|
||||
@@ -0,0 +1,23 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import {
|
||||
blocksSchema,
|
||||
loyaltyPageRefsSchema,
|
||||
loyaltyPageSchema,
|
||||
sidebarSchema,
|
||||
} from "@/server/routers/contentstack/loyaltyPage/output"
|
||||
|
||||
export interface GetLoyaltyPageRefsSchema
|
||||
extends z.input<typeof loyaltyPageRefsSchema> {}
|
||||
|
||||
export interface LoyaltyPageRefs
|
||||
extends z.output<typeof loyaltyPageRefsSchema> {}
|
||||
|
||||
export interface GetLoyaltyPageSchema
|
||||
extends z.input<typeof loyaltyPageSchema> {}
|
||||
|
||||
export interface LoyaltyPage extends z.output<typeof loyaltyPageSchema> {}
|
||||
|
||||
export type Block = z.output<typeof blocksSchema>
|
||||
|
||||
export type SidebarBlock = z.output<typeof sidebarSchema>
|
||||
@@ -0,0 +1,12 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { joinLoyaltyContactSidebarSchema } from "@/server/routers/contentstack/loyaltyPage/output"
|
||||
import { contactSchema } from "@/server/routers/contentstack/schemas/sidebar/joinLoyaltyContact"
|
||||
|
||||
export interface JoinLoyaltyContact
|
||||
extends z.output<typeof joinLoyaltyContactSidebarSchema> {}
|
||||
type ContactsSchema = z.output<typeof contactSchema>
|
||||
export type Contacts = ContactsSchema["contact"]
|
||||
export interface Contact {
|
||||
contact: NonNullable<Contacts[number]>
|
||||
}
|
||||
@@ -0,0 +1,8 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { apiLocationsSchema } from "@/server/routers/hotels/output"
|
||||
|
||||
export interface LocationSchema extends z.output<typeof apiLocationsSchema> {}
|
||||
|
||||
export type Locations = LocationSchema["data"]
|
||||
export type Location = Locations[number]
|
||||
@@ -0,0 +1,5 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { contentEmbedsSchema } from "@/server/routers/contentstack/schemas/blocks/contentEmbeds"
|
||||
|
||||
export type Embeds = z.output<typeof contentEmbedsSchema>
|
||||
+6
-23
@@ -1,32 +1,15 @@
|
||||
import { z } from "zod"
|
||||
|
||||
import { creditCardSchema, getUserSchema } from "@/server/routers/user/output"
|
||||
|
||||
type Journey = {
|
||||
tag: string
|
||||
title: string
|
||||
}
|
||||
|
||||
type ShortcutLink = {
|
||||
href: string
|
||||
title: string
|
||||
}
|
||||
|
||||
type Victory = {
|
||||
tag: string
|
||||
title: string
|
||||
}
|
||||
import { creditCardSchema, getUserSchema, membershipSchema } from "@/server/routers/user/output"
|
||||
|
||||
/**
|
||||
* All extended field needs to be added by API team to response or
|
||||
* we have to get the values from elsewhere
|
||||
*/
|
||||
export interface User extends z.infer<typeof getUserSchema> {
|
||||
name: string
|
||||
journeys: Journey[]
|
||||
nights: number
|
||||
shortcuts: ShortcutLink[]
|
||||
victories: Victory[]
|
||||
}
|
||||
export interface User extends z.output<typeof getUserSchema> { }
|
||||
|
||||
export type CreditCard = z.output<typeof creditCardSchema>
|
||||
|
||||
export interface Membership extends z.output<typeof membershipSchema> { }
|
||||
|
||||
export type Memberships = Membership[]
|
||||
|
||||
Reference in New Issue
Block a user