Clone starter

This commit is contained in:
2024-03-07 15:31:41 +01:00
commit 1b7ee20d05
87 changed files with 17015 additions and 0 deletions

2
apps/api/types/index.ts Normal file
View File

@ -0,0 +1,2 @@
export * from "./payload";
export * from "./rich-text-export";

200
apps/api/types/payload.ts Normal file
View File

@ -0,0 +1,200 @@
/* tslint:disable */
/* eslint-disable */
/**
* This file was automatically generated by Payload.
* DO NOT MODIFY IT BY HAND. Instead, modify your source Payload config,
* and re-run `payload generate:types` to regenerate this file.
*/
export interface Config {
collections: {
categories: Category;
contents: Content;
layouts: Layout;
media: Media;
pages: Page;
tags: Tag;
users: User;
};
globals: {};
}
export interface Category {
id: string;
name: string;
slug: string;
}
export interface Content {
id: string;
name: string;
slug?: string;
description?: string;
blocks?: (Menu | PageContent | PageList | SiteTitle)[];
updatedAt: string;
createdAt: string;
}
export interface Menu {
type: 'default';
menus?: {
mainMenu: MainMenu;
id?: string;
}[];
id?: string;
blockName?: string;
blockType: 'menu';
}
export interface MainMenu {
type?: 'reference' | 'custom' | 'none';
newTab?: boolean;
reference: {
value: string | Page;
relationTo: 'pages';
};
url: string;
label: string;
subMenu?: {
link: Link;
id?: string;
}[];
}
export interface Page {
id: string;
title: string;
slug: string;
author?: string | User;
publishedDate?: string;
categories?: string[] | Category[];
tags?: string[] | Tag[];
status?: 'Draft' | 'Published';
layout?: string | Layout;
content?: {
[k: string]: unknown;
}[];
meta?: {
title?: string;
description?: string;
image?: string | Media;
};
updatedAt: string;
createdAt: string;
}
export interface User {
id: string;
name?: string;
updatedAt: string;
createdAt: string;
email: string;
resetPasswordToken?: string;
resetPasswordExpiration?: string;
salt?: string;
hash?: string;
loginAttempts?: number;
lockUntil?: string;
password?: string;
}
export interface Tag {
id: string;
name: string;
slug: string;
}
export interface Layout {
id: string;
name: string;
slug?: string;
description?: string;
header?: {
blocks?: (ReusableContent | Menu | SiteTitle)[];
};
body?: {
blocks?: (ReusableContent | PageContent | PageList)[];
};
footer?: {
blocks?: ReusableContent[];
};
updatedAt: string;
createdAt: string;
}
export interface ReusableContent {
reference?: {
value: string | Content;
relationTo: 'contents';
};
id?: string;
blockName?: string;
blockType: 'reusableContent';
}
export interface SiteTitle {
siteName: string;
id?: string;
blockName?: string;
blockType: 'siteTitle';
}
export interface PageContent {
description?: string;
id?: string;
blockName?: string;
blockType: 'pageContent';
}
export interface PageList {
numberOfItems?: number;
filterByCategories?:
| {
value: string;
relationTo: 'categories';
}[]
| {
value: Category;
relationTo: 'categories';
}[];
filterByTags?:
| {
value: string;
relationTo: 'tags';
}[]
| {
value: Tag;
relationTo: 'tags';
}[];
sortBy?: 'title' | 'createdAt' | 'updatedAt' | '-title' | '-createdAt' | '-updatedAt';
id?: string;
blockName?: string;
blockType: 'pageList';
}
export interface Media {
id: string;
updatedAt: string;
createdAt: string;
url?: string;
filename?: string;
mimeType?: string;
filesize?: number;
width?: number;
height?: number;
sizes?: {
thumbnail?: {
url?: string;
width?: number;
height?: number;
mimeType?: string;
filesize?: number;
filename?: string;
};
sixteenByNineMedium?: {
url?: string;
width?: number;
height?: number;
mimeType?: string;
filesize?: number;
filename?: string;
};
};
}
export interface Link {
type?: 'reference' | 'custom';
newTab?: boolean;
reference: {
value: string | Page;
relationTo: 'pages';
};
url: string;
label: string;
}

View File

@ -0,0 +1,22 @@
import type {
RichTextElement,
RichTextLeaf,
} from "payload/dist/fields/config/types";
import type { RichTextCustomElement, RichTextCustomLeaf } from "payload/types";
type DefaultRichTextLeaf = Exclude<RichTextLeaf, RichTextCustomLeaf>;
export type FormattedText = {
[key in DefaultRichTextLeaf]?: boolean;
} & {
text: string;
};
type DefaultRichTextElement =
| Exclude<RichTextElement, RichTextCustomElement>
| "li"
| "quote";
export type FormattedElement = {
type: DefaultRichTextElement;
url?: string;
children: FormattedText[];
};