Added home folders
This commit is contained in:
parent
2a5b67607d
commit
90d885ba2b
|
@ -1,6 +1,5 @@
|
||||||
import { CollectionGroups, Collections } from "../../constants";
|
import { CollectionGroups, Collections } from "../../constants";
|
||||||
import { iconField } from "../../fields/iconField/iconField";
|
import { iconField } from "../../fields/iconField/iconField";
|
||||||
import { imageField } from "../../fields/imageField/imageField";
|
|
||||||
import { rowField } from "../../fields/rowField/rowField";
|
import { rowField } from "../../fields/rowField/rowField";
|
||||||
import { slugField } from "../../fields/slugField/slugField";
|
import { slugField } from "../../fields/slugField/slugField";
|
||||||
import { translatedFields } from "../../fields/translatedFields/translatedFields";
|
import { translatedFields } from "../../fields/translatedFields/translatedFields";
|
||||||
|
@ -19,8 +18,6 @@ const fields = {
|
||||||
sectionsTranslations: "translations",
|
sectionsTranslations: "translations",
|
||||||
sectionsTranslationsName: "name",
|
sectionsTranslationsName: "name",
|
||||||
files: "files",
|
files: "files",
|
||||||
darkThumbnail: "darkThumbnail",
|
|
||||||
lightThumbnail: "lightThumbnail",
|
|
||||||
icon: "icon",
|
icon: "icon",
|
||||||
} as const satisfies Record<string, string>;
|
} as const satisfies Record<string, string>;
|
||||||
|
|
||||||
|
@ -38,10 +35,6 @@ export const Folders = buildCollectionConfig({
|
||||||
endpoints: [getRootFoldersEndpoint, getBySlugEndpoint],
|
endpoints: [getRootFoldersEndpoint, getBySlugEndpoint],
|
||||||
fields: [
|
fields: [
|
||||||
rowField([slugField({ name: fields.slug }), iconField({ name: fields.icon })]),
|
rowField([slugField({ name: fields.slug }), iconField({ name: fields.icon })]),
|
||||||
rowField([
|
|
||||||
imageField({ name: fields.lightThumbnail, relationTo: Collections.FoldersThumbnails }),
|
|
||||||
imageField({ name: fields.darkThumbnail, relationTo: Collections.FoldersThumbnails }),
|
|
||||||
]),
|
|
||||||
translatedFields({
|
translatedFields({
|
||||||
name: fields.translations,
|
name: fields.translations,
|
||||||
admin: { useAsTitle: fields.translationsName },
|
admin: { useAsTitle: fields.translationsName },
|
||||||
|
|
|
@ -2,7 +2,7 @@ import { Collections } from "../../../constants";
|
||||||
import { createGetByEndpoint } from "../../../endpoints/createGetByEndpoint";
|
import { createGetByEndpoint } from "../../../endpoints/createGetByEndpoint";
|
||||||
import { EndpointFolder, EndpointFolderPreview } from "../../../sdk";
|
import { EndpointFolder, EndpointFolderPreview } from "../../../sdk";
|
||||||
import { Folder, Language } from "../../../types/collections";
|
import { Folder, Language } from "../../../types/collections";
|
||||||
import { isDefined, isPayloadType, isValidPayloadImage } from "../../../utils/asserts";
|
import { isDefined, isPayloadType } from "../../../utils/asserts";
|
||||||
import { convertCollectibleToPreview } from "../../Collectibles/endpoints/getBySlugEndpoint";
|
import { convertCollectibleToPreview } from "../../Collectibles/endpoints/getBySlugEndpoint";
|
||||||
import { convertPageToPreview } from "../../Pages/endpoints/getBySlugEndpoint";
|
import { convertPageToPreview } from "../../Pages/endpoints/getBySlugEndpoint";
|
||||||
|
|
||||||
|
@ -44,13 +44,12 @@ export const getBySlugEndpoint = createGetByEndpoint(
|
||||||
}
|
}
|
||||||
}) ?? [],
|
}) ?? [],
|
||||||
};
|
};
|
||||||
}, 3
|
},
|
||||||
|
3
|
||||||
);
|
);
|
||||||
|
|
||||||
export const convertFolderToPreview = ({
|
export const convertFolderToPreview = ({
|
||||||
slug,
|
slug,
|
||||||
darkThumbnail,
|
|
||||||
lightThumbnail,
|
|
||||||
translations,
|
translations,
|
||||||
icon,
|
icon,
|
||||||
}: Folder): EndpointFolderPreview => {
|
}: Folder): EndpointFolderPreview => {
|
||||||
|
@ -63,8 +62,6 @@ export const convertFolderToPreview = ({
|
||||||
name,
|
name,
|
||||||
...(description ? { description } : {}),
|
...(description ? { description } : {}),
|
||||||
})) ?? [],
|
})) ?? [],
|
||||||
darkThumbnail: isValidPayloadImage(darkThumbnail) ? darkThumbnail : undefined,
|
|
||||||
lightThumbnail: isValidPayloadImage(lightThumbnail) ? lightThumbnail : undefined,
|
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -1,22 +0,0 @@
|
||||||
import { Collections } from "../../constants";
|
|
||||||
import { buildImageCollectionConfig } from "../../utils/imageCollectionConfig";
|
|
||||||
|
|
||||||
const fields = {
|
|
||||||
filename: "filename",
|
|
||||||
mimeType: "mimeType",
|
|
||||||
filesize: "filesize",
|
|
||||||
updatedAt: "updatedAt",
|
|
||||||
} as const satisfies Record<string, string>;
|
|
||||||
|
|
||||||
export const FoldersThumbnails = buildImageCollectionConfig({
|
|
||||||
slug: Collections.FoldersThumbnails,
|
|
||||||
labels: {
|
|
||||||
singular: "Folders Thumbnail",
|
|
||||||
plural: "Folders Thumbnails",
|
|
||||||
},
|
|
||||||
admin: { defaultColumns: [fields.filename, fields.updatedAt] },
|
|
||||||
upload: {
|
|
||||||
imageSizes: [],
|
|
||||||
},
|
|
||||||
fields: [],
|
|
||||||
});
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
import { GlobalConfig } from "payload/types";
|
||||||
|
import { mustBeAdmin } from "../../accesses/collections/mustBeAdmin";
|
||||||
|
import { CollectionGroups, Collections } from "../../constants";
|
||||||
|
import { imageField } from "../../fields/imageField/imageField";
|
||||||
|
import { rowField } from "../../fields/rowField/rowField";
|
||||||
|
import { getAllEndpoint } from "./endpoints/getAllEndpoint";
|
||||||
|
|
||||||
|
const fields = {
|
||||||
|
folders: "folders",
|
||||||
|
darkThumbnail: "darkThumbnail",
|
||||||
|
lightThumbnail: "lightThumbnail",
|
||||||
|
folder: "folder",
|
||||||
|
icon: "icon",
|
||||||
|
} as const satisfies Record<string, string>;
|
||||||
|
|
||||||
|
export const HomeFolders: GlobalConfig = {
|
||||||
|
slug: Collections.HomeFolders,
|
||||||
|
typescript: { interface: "HomeFolder" },
|
||||||
|
admin: {
|
||||||
|
group: CollectionGroups.Meta,
|
||||||
|
},
|
||||||
|
access: { update: mustBeAdmin },
|
||||||
|
endpoints: [getAllEndpoint],
|
||||||
|
fields: [
|
||||||
|
{
|
||||||
|
name: fields.folders,
|
||||||
|
admin: {
|
||||||
|
description:
|
||||||
|
"These will be the folders displayed on the home page, under the Library section.",
|
||||||
|
},
|
||||||
|
type: "array",
|
||||||
|
fields: [
|
||||||
|
rowField([
|
||||||
|
imageField({ name: fields.lightThumbnail, relationTo: Collections.Images }),
|
||||||
|
imageField({ name: fields.darkThumbnail, relationTo: Collections.Images }),
|
||||||
|
{
|
||||||
|
name: fields.folder,
|
||||||
|
type: "relationship",
|
||||||
|
relationTo: Collections.Folders,
|
||||||
|
required: true,
|
||||||
|
},
|
||||||
|
]),
|
||||||
|
],
|
||||||
|
},
|
||||||
|
],
|
||||||
|
};
|
|
@ -0,0 +1,47 @@
|
||||||
|
import payload from "payload";
|
||||||
|
import { Collections } from "../../../constants";
|
||||||
|
import { EndpointHomeFolder } from "../../../sdk";
|
||||||
|
import { Folder } from "../../../types/collections";
|
||||||
|
import { CollectionEndpoint } from "../../../types/payload";
|
||||||
|
import { isPayloadType, isValidPayloadImage } from "../../../utils/asserts";
|
||||||
|
import { convertFolderToPreview } from "../../Folders/endpoints/getBySlugEndpoint";
|
||||||
|
|
||||||
|
export const getAllEndpoint: CollectionEndpoint = {
|
||||||
|
method: "get",
|
||||||
|
path: "/all",
|
||||||
|
handler: async (req, res) => {
|
||||||
|
if (!req.user) {
|
||||||
|
return res.status(403).send({
|
||||||
|
errors: [
|
||||||
|
{
|
||||||
|
message: "You are not allowed to perform this action.",
|
||||||
|
},
|
||||||
|
],
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
const homeFolders = await payload.findGlobal({
|
||||||
|
slug: Collections.HomeFolders,
|
||||||
|
});
|
||||||
|
|
||||||
|
const result =
|
||||||
|
homeFolders.folders?.flatMap<EndpointHomeFolder>(
|
||||||
|
({ folder, darkThumbnail, lightThumbnail }) => {
|
||||||
|
if (!isPayloadType(folder)) return [];
|
||||||
|
if (isEmptyFolder(folder)) return [];
|
||||||
|
return [
|
||||||
|
{
|
||||||
|
...(isValidPayloadImage(darkThumbnail) ? { darkThumbnail } : {}),
|
||||||
|
...(isValidPayloadImage(lightThumbnail) ? { lightThumbnail } : {}),
|
||||||
|
...convertFolderToPreview(folder),
|
||||||
|
},
|
||||||
|
];
|
||||||
|
}
|
||||||
|
) ?? [];
|
||||||
|
|
||||||
|
res.status(200).json(result);
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
const isEmptyFolder = ({ sections, files }: Folder): boolean =>
|
||||||
|
(!files || files.length === 0) && (!sections || sections.length === 0);
|
|
@ -20,7 +20,6 @@ export enum Collections {
|
||||||
VideosChannels = "videos-channels",
|
VideosChannels = "videos-channels",
|
||||||
Videos = "videos",
|
Videos = "videos",
|
||||||
Folders = "folders",
|
Folders = "folders",
|
||||||
FoldersThumbnails = "folders-thumbnails",
|
|
||||||
Tags = "tags",
|
Tags = "tags",
|
||||||
TagsGroups = "tags-groups",
|
TagsGroups = "tags-groups",
|
||||||
Images = "images",
|
Images = "images",
|
||||||
|
@ -28,6 +27,7 @@ export enum Collections {
|
||||||
Collectibles = "collectibles",
|
Collectibles = "collectibles",
|
||||||
GenericContents = "generic-contents",
|
GenericContents = "generic-contents",
|
||||||
BackgroundImages = "background-images",
|
BackgroundImages = "background-images",
|
||||||
|
HomeFolders = "home-folders",
|
||||||
}
|
}
|
||||||
|
|
||||||
export enum CollectionGroups {
|
export enum CollectionGroups {
|
||||||
|
|
|
@ -8,8 +8,8 @@ import { ChronologyItems } from "./collections/ChronologyItems/ChronologyItems";
|
||||||
import { Collectibles } from "./collections/Collectibles/Collectibles";
|
import { Collectibles } from "./collections/Collectibles/Collectibles";
|
||||||
import { Currencies } from "./collections/Currencies/Currencies";
|
import { Currencies } from "./collections/Currencies/Currencies";
|
||||||
import { Folders } from "./collections/Folders/Folders";
|
import { Folders } from "./collections/Folders/Folders";
|
||||||
import { FoldersThumbnails } from "./collections/FoldersThumbnails/FoldersThumbnails";
|
|
||||||
import { GenericContents } from "./collections/GenericContents/GenericContents";
|
import { GenericContents } from "./collections/GenericContents/GenericContents";
|
||||||
|
import { HomeFolders } from "./collections/HomeFolders/HomeFolders";
|
||||||
import { Images } from "./collections/Images/Images";
|
import { Images } from "./collections/Images/Images";
|
||||||
import { Languages } from "./collections/Languages/Languages";
|
import { Languages } from "./collections/Languages/Languages";
|
||||||
import { Notes } from "./collections/Notes/Notes";
|
import { Notes } from "./collections/Notes/Notes";
|
||||||
|
@ -41,30 +41,31 @@ export default buildConfig({
|
||||||
},
|
},
|
||||||
editor: createEditor({}),
|
editor: createEditor({}),
|
||||||
collections: [
|
collections: [
|
||||||
Folders,
|
|
||||||
FoldersThumbnails,
|
|
||||||
Pages,
|
Pages,
|
||||||
|
Collectibles,
|
||||||
|
Folders,
|
||||||
ChronologyItems,
|
ChronologyItems,
|
||||||
ChronologyEras,
|
ChronologyEras,
|
||||||
RecordersThumbnails,
|
|
||||||
Notes,
|
Notes,
|
||||||
|
|
||||||
|
Images,
|
||||||
|
BackgroundImages,
|
||||||
|
RecordersThumbnails,
|
||||||
Videos,
|
Videos,
|
||||||
VideosChannels,
|
VideosChannels,
|
||||||
Languages,
|
|
||||||
Currencies,
|
|
||||||
Recorders,
|
|
||||||
Tags,
|
Tags,
|
||||||
TagsGroups,
|
TagsGroups,
|
||||||
Images,
|
Recorders,
|
||||||
|
Languages,
|
||||||
|
Currencies,
|
||||||
Wordings,
|
Wordings,
|
||||||
Collectibles,
|
|
||||||
GenericContents,
|
GenericContents,
|
||||||
BackgroundImages,
|
|
||||||
],
|
],
|
||||||
db: mongooseAdapter({
|
db: mongooseAdapter({
|
||||||
url: process.env.MONGODB_URI ?? "mongodb://mongo:27017/payload",
|
url: process.env.MONGODB_URI ?? "mongodb://mongo:27017/payload",
|
||||||
}),
|
}),
|
||||||
globals: [],
|
globals: [HomeFolders],
|
||||||
telemetry: false,
|
telemetry: false,
|
||||||
typescript: {
|
typescript: {
|
||||||
outputFile: path.resolve(__dirname, "types/collections.ts"),
|
outputFile: path.resolve(__dirname, "types/collections.ts"),
|
||||||
|
|
19
src/sdk.ts
19
src/sdk.ts
|
@ -126,6 +126,16 @@ export type EndpointEra = {
|
||||||
}[];
|
}[];
|
||||||
};
|
};
|
||||||
|
|
||||||
|
export type EndpointFolderPreview = {
|
||||||
|
slug: string;
|
||||||
|
icon?: string;
|
||||||
|
translations: {
|
||||||
|
language: string;
|
||||||
|
name: string;
|
||||||
|
description?: RichTextContent;
|
||||||
|
}[];
|
||||||
|
};
|
||||||
|
|
||||||
export type EndpointFolder = EndpointFolderPreview & {
|
export type EndpointFolder = EndpointFolderPreview & {
|
||||||
sections:
|
sections:
|
||||||
| { type: "single"; subfolders: EndpointFolderPreview[] }
|
| { type: "single"; subfolders: EndpointFolderPreview[] }
|
||||||
|
@ -148,14 +158,7 @@ export type EndpointFolder = EndpointFolderPreview & {
|
||||||
)[];
|
)[];
|
||||||
};
|
};
|
||||||
|
|
||||||
export type EndpointFolderPreview = {
|
export type EndpointHomeFolder = EndpointFolderPreview & {
|
||||||
slug: string;
|
|
||||||
icon?: string;
|
|
||||||
translations: {
|
|
||||||
language: string;
|
|
||||||
name: string;
|
|
||||||
description?: RichTextContent;
|
|
||||||
}[];
|
|
||||||
lightThumbnail?: PayloadImage;
|
lightThumbnail?: PayloadImage;
|
||||||
darkThumbnail?: PayloadImage;
|
darkThumbnail?: PayloadImage;
|
||||||
};
|
};
|
||||||
|
|
|
@ -43,29 +43,244 @@ export type CategoryTranslations = {
|
||||||
|
|
||||||
export interface Config {
|
export interface Config {
|
||||||
collections: {
|
collections: {
|
||||||
folders: Folder;
|
|
||||||
'folders-thumbnails': FoldersThumbnail;
|
|
||||||
pages: Page;
|
pages: Page;
|
||||||
|
collectibles: Collectible;
|
||||||
|
folders: Folder;
|
||||||
'chronology-items': ChronologyItem;
|
'chronology-items': ChronologyItem;
|
||||||
'chronology-eras': ChronologyEra;
|
'chronology-eras': ChronologyEra;
|
||||||
'recorders-thumbnails': RecordersThumbnail;
|
|
||||||
notes: Note;
|
notes: Note;
|
||||||
|
images: Image;
|
||||||
|
'background-images': BackgroundImage;
|
||||||
|
'recorders-thumbnails': RecordersThumbnail;
|
||||||
videos: Video;
|
videos: Video;
|
||||||
'videos-channels': VideosChannel;
|
'videos-channels': VideosChannel;
|
||||||
languages: Language;
|
|
||||||
currencies: Currency;
|
|
||||||
recorders: Recorder;
|
|
||||||
tags: Tag;
|
tags: Tag;
|
||||||
'tags-groups': TagsGroup;
|
'tags-groups': TagsGroup;
|
||||||
images: Image;
|
recorders: Recorder;
|
||||||
|
languages: Language;
|
||||||
|
currencies: Currency;
|
||||||
wordings: Wording;
|
wordings: Wording;
|
||||||
collectibles: Collectible;
|
|
||||||
'generic-contents': GenericContent;
|
'generic-contents': GenericContent;
|
||||||
'background-images': BackgroundImage;
|
|
||||||
'payload-preferences': PayloadPreference;
|
'payload-preferences': PayloadPreference;
|
||||||
'payload-migrations': PayloadMigration;
|
'payload-migrations': PayloadMigration;
|
||||||
};
|
};
|
||||||
globals: {};
|
globals: {
|
||||||
|
'home-folders': HomeFolder;
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
* via the `definition` "pages".
|
||||||
|
*/
|
||||||
|
export interface Page {
|
||||||
|
id: string;
|
||||||
|
slug: string;
|
||||||
|
type: 'Content' | 'Post' | 'Generic';
|
||||||
|
thumbnail?: string | Image | null;
|
||||||
|
backgroundImage?: string | BackgroundImage | null;
|
||||||
|
tags?: (string | Tag)[] | null;
|
||||||
|
authors?: (string | Recorder)[] | null;
|
||||||
|
translations: {
|
||||||
|
language: string | Language;
|
||||||
|
sourceLanguage: string | Language;
|
||||||
|
pretitle?: string | null;
|
||||||
|
title: string;
|
||||||
|
subtitle?: string | null;
|
||||||
|
summary?: {
|
||||||
|
root: {
|
||||||
|
children: {
|
||||||
|
type: string;
|
||||||
|
version: number;
|
||||||
|
[k: string]: unknown;
|
||||||
|
}[];
|
||||||
|
direction: ('ltr' | 'rtl') | null;
|
||||||
|
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
|
||||||
|
indent: number;
|
||||||
|
type: string;
|
||||||
|
version: number;
|
||||||
|
};
|
||||||
|
[k: string]: unknown;
|
||||||
|
} | null;
|
||||||
|
content: {
|
||||||
|
root: {
|
||||||
|
children: {
|
||||||
|
type: string;
|
||||||
|
version: number;
|
||||||
|
[k: string]: unknown;
|
||||||
|
}[];
|
||||||
|
direction: ('ltr' | 'rtl') | null;
|
||||||
|
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
|
||||||
|
indent: number;
|
||||||
|
type: string;
|
||||||
|
version: number;
|
||||||
|
};
|
||||||
|
[k: string]: unknown;
|
||||||
|
};
|
||||||
|
transcribers?: (string | Recorder)[] | null;
|
||||||
|
translators?: (string | Recorder)[] | null;
|
||||||
|
proofreaders?: (string | Recorder)[] | null;
|
||||||
|
id?: string | null;
|
||||||
|
}[];
|
||||||
|
folders?: (string | Folder)[] | null;
|
||||||
|
collectibles?: (string | Collectible)[] | null;
|
||||||
|
updatedBy: string | Recorder;
|
||||||
|
updatedAt: string;
|
||||||
|
createdAt: string;
|
||||||
|
_status?: ('draft' | 'published') | null;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
* via the `definition` "images".
|
||||||
|
*/
|
||||||
|
export interface Image {
|
||||||
|
id: string;
|
||||||
|
updatedAt: string;
|
||||||
|
createdAt: string;
|
||||||
|
url?: string | null;
|
||||||
|
filename?: string | null;
|
||||||
|
mimeType?: string | null;
|
||||||
|
filesize?: number | null;
|
||||||
|
width?: number | null;
|
||||||
|
height?: number | null;
|
||||||
|
sizes?: {
|
||||||
|
thumb?: {
|
||||||
|
url?: string | null;
|
||||||
|
width?: number | null;
|
||||||
|
height?: number | null;
|
||||||
|
mimeType?: string | null;
|
||||||
|
filesize?: number | null;
|
||||||
|
filename?: string | null;
|
||||||
|
};
|
||||||
|
og?: {
|
||||||
|
url?: string | null;
|
||||||
|
width?: number | null;
|
||||||
|
height?: number | null;
|
||||||
|
mimeType?: string | null;
|
||||||
|
filesize?: number | null;
|
||||||
|
filename?: string | null;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
* via the `definition` "background-images".
|
||||||
|
*/
|
||||||
|
export interface BackgroundImage {
|
||||||
|
id: string;
|
||||||
|
updatedAt: string;
|
||||||
|
createdAt: string;
|
||||||
|
url?: string | null;
|
||||||
|
filename?: string | null;
|
||||||
|
mimeType?: string | null;
|
||||||
|
filesize?: number | null;
|
||||||
|
width?: number | null;
|
||||||
|
height?: number | null;
|
||||||
|
sizes?: {
|
||||||
|
thumb?: {
|
||||||
|
url?: string | null;
|
||||||
|
width?: number | null;
|
||||||
|
height?: number | null;
|
||||||
|
mimeType?: string | null;
|
||||||
|
filesize?: number | null;
|
||||||
|
filename?: string | null;
|
||||||
|
};
|
||||||
|
};
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
* via the `definition` "tags".
|
||||||
|
*/
|
||||||
|
export interface Tag {
|
||||||
|
id: string;
|
||||||
|
name?: string | null;
|
||||||
|
slug: string;
|
||||||
|
translations: {
|
||||||
|
language: string | Language;
|
||||||
|
name: string;
|
||||||
|
id?: string | null;
|
||||||
|
}[];
|
||||||
|
group: string | TagsGroup;
|
||||||
|
updatedAt: string;
|
||||||
|
createdAt: string;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
* via the `definition` "languages".
|
||||||
|
*/
|
||||||
|
export interface Language {
|
||||||
|
id: string;
|
||||||
|
name: string;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
* via the `definition` "tags-groups".
|
||||||
|
*/
|
||||||
|
export interface TagsGroup {
|
||||||
|
id: string;
|
||||||
|
slug: string;
|
||||||
|
icon?: string | null;
|
||||||
|
translations: {
|
||||||
|
language: string | Language;
|
||||||
|
name: string;
|
||||||
|
id?: string | null;
|
||||||
|
}[];
|
||||||
|
updatedAt: string;
|
||||||
|
createdAt: string;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
* via the `definition` "recorders".
|
||||||
|
*/
|
||||||
|
export interface Recorder {
|
||||||
|
id: string;
|
||||||
|
username: string;
|
||||||
|
avatar?: string | RecordersThumbnail | null;
|
||||||
|
languages?: (string | Language)[] | null;
|
||||||
|
biographies?: RecorderBiographies;
|
||||||
|
role?: ('Admin' | 'Recorder' | 'Api')[] | null;
|
||||||
|
anonymize: boolean;
|
||||||
|
email: string;
|
||||||
|
resetPasswordToken?: string | null;
|
||||||
|
resetPasswordExpiration?: string | null;
|
||||||
|
salt?: string | null;
|
||||||
|
hash?: string | null;
|
||||||
|
loginAttempts?: number | null;
|
||||||
|
lockUntil?: string | null;
|
||||||
|
password?: string | null;
|
||||||
|
}
|
||||||
|
/**
|
||||||
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
* via the `definition` "recorders-thumbnails".
|
||||||
|
*/
|
||||||
|
export interface RecordersThumbnail {
|
||||||
|
id: string;
|
||||||
|
recorder?: (string | null) | Recorder;
|
||||||
|
updatedAt: string;
|
||||||
|
createdAt: string;
|
||||||
|
url?: string | null;
|
||||||
|
filename?: string | null;
|
||||||
|
mimeType?: string | null;
|
||||||
|
filesize?: number | null;
|
||||||
|
width?: number | null;
|
||||||
|
height?: number | null;
|
||||||
|
sizes?: {
|
||||||
|
thumb?: {
|
||||||
|
url?: string | null;
|
||||||
|
width?: number | null;
|
||||||
|
height?: number | null;
|
||||||
|
mimeType?: string | null;
|
||||||
|
filesize?: number | null;
|
||||||
|
filename?: string | null;
|
||||||
|
};
|
||||||
|
square?: {
|
||||||
|
url?: string | null;
|
||||||
|
width?: number | null;
|
||||||
|
height?: number | null;
|
||||||
|
mimeType?: string | null;
|
||||||
|
filesize?: number | null;
|
||||||
|
filename?: string | null;
|
||||||
|
};
|
||||||
|
};
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
@ -75,30 +290,26 @@ export interface Folder {
|
||||||
id: string;
|
id: string;
|
||||||
slug: string;
|
slug: string;
|
||||||
icon?: string | null;
|
icon?: string | null;
|
||||||
lightThumbnail?: string | FoldersThumbnail | null;
|
translations: {
|
||||||
darkThumbnail?: string | FoldersThumbnail | null;
|
language: string | Language;
|
||||||
translations?:
|
name: string;
|
||||||
| {
|
description?: {
|
||||||
language: string | Language;
|
root: {
|
||||||
name: string;
|
children: {
|
||||||
description?: {
|
type: string;
|
||||||
root: {
|
version: number;
|
||||||
children: {
|
|
||||||
type: string;
|
|
||||||
version: number;
|
|
||||||
[k: string]: unknown;
|
|
||||||
}[];
|
|
||||||
direction: ('ltr' | 'rtl') | null;
|
|
||||||
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
|
|
||||||
indent: number;
|
|
||||||
type: string;
|
|
||||||
version: number;
|
|
||||||
};
|
|
||||||
[k: string]: unknown;
|
[k: string]: unknown;
|
||||||
} | null;
|
}[];
|
||||||
id?: string | null;
|
direction: ('ltr' | 'rtl') | null;
|
||||||
}[]
|
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
|
||||||
| null;
|
indent: number;
|
||||||
|
type: string;
|
||||||
|
version: number;
|
||||||
|
};
|
||||||
|
[k: string]: unknown;
|
||||||
|
} | null;
|
||||||
|
id?: string | null;
|
||||||
|
}[];
|
||||||
sections?:
|
sections?:
|
||||||
| {
|
| {
|
||||||
translations?:
|
translations?:
|
||||||
|
@ -127,39 +338,6 @@ export interface Folder {
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
|
||||||
* via the `definition` "folders-thumbnails".
|
|
||||||
*/
|
|
||||||
export interface FoldersThumbnail {
|
|
||||||
id: string;
|
|
||||||
updatedAt: string;
|
|
||||||
createdAt: string;
|
|
||||||
url?: string | null;
|
|
||||||
filename?: string | null;
|
|
||||||
mimeType?: string | null;
|
|
||||||
filesize?: number | null;
|
|
||||||
width?: number | null;
|
|
||||||
height?: number | null;
|
|
||||||
sizes?: {
|
|
||||||
thumb?: {
|
|
||||||
url?: string | null;
|
|
||||||
width?: number | null;
|
|
||||||
height?: number | null;
|
|
||||||
mimeType?: string | null;
|
|
||||||
filesize?: number | null;
|
|
||||||
filename?: string | null;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
|
||||||
* via the `definition` "languages".
|
|
||||||
*/
|
|
||||||
export interface Language {
|
|
||||||
id: string;
|
|
||||||
name: string;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
* via the `definition` "collectibles".
|
* via the `definition` "collectibles".
|
||||||
|
@ -345,152 +523,6 @@ export interface Collectible {
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
_status?: ('draft' | 'published') | null;
|
_status?: ('draft' | 'published') | null;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
|
||||||
* via the `definition` "images".
|
|
||||||
*/
|
|
||||||
export interface Image {
|
|
||||||
id: string;
|
|
||||||
updatedAt: string;
|
|
||||||
createdAt: string;
|
|
||||||
url?: string | null;
|
|
||||||
filename?: string | null;
|
|
||||||
mimeType?: string | null;
|
|
||||||
filesize?: number | null;
|
|
||||||
width?: number | null;
|
|
||||||
height?: number | null;
|
|
||||||
sizes?: {
|
|
||||||
thumb?: {
|
|
||||||
url?: string | null;
|
|
||||||
width?: number | null;
|
|
||||||
height?: number | null;
|
|
||||||
mimeType?: string | null;
|
|
||||||
filesize?: number | null;
|
|
||||||
filename?: string | null;
|
|
||||||
};
|
|
||||||
og?: {
|
|
||||||
url?: string | null;
|
|
||||||
width?: number | null;
|
|
||||||
height?: number | null;
|
|
||||||
mimeType?: string | null;
|
|
||||||
filesize?: number | null;
|
|
||||||
filename?: string | null;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
|
||||||
* via the `definition` "tags".
|
|
||||||
*/
|
|
||||||
export interface Tag {
|
|
||||||
id: string;
|
|
||||||
name?: string | null;
|
|
||||||
slug: string;
|
|
||||||
translations: {
|
|
||||||
language: string | Language;
|
|
||||||
name: string;
|
|
||||||
id?: string | null;
|
|
||||||
}[];
|
|
||||||
group: string | TagsGroup;
|
|
||||||
updatedAt: string;
|
|
||||||
createdAt: string;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
|
||||||
* via the `definition` "tags-groups".
|
|
||||||
*/
|
|
||||||
export interface TagsGroup {
|
|
||||||
id: string;
|
|
||||||
slug: string;
|
|
||||||
icon?: string | null;
|
|
||||||
translations: {
|
|
||||||
language: string | Language;
|
|
||||||
name: string;
|
|
||||||
id?: string | null;
|
|
||||||
}[];
|
|
||||||
updatedAt: string;
|
|
||||||
createdAt: string;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
|
||||||
* via the `definition` "background-images".
|
|
||||||
*/
|
|
||||||
export interface BackgroundImage {
|
|
||||||
id: string;
|
|
||||||
updatedAt: string;
|
|
||||||
createdAt: string;
|
|
||||||
url?: string | null;
|
|
||||||
filename?: string | null;
|
|
||||||
mimeType?: string | null;
|
|
||||||
filesize?: number | null;
|
|
||||||
width?: number | null;
|
|
||||||
height?: number | null;
|
|
||||||
sizes?: {
|
|
||||||
thumb?: {
|
|
||||||
url?: string | null;
|
|
||||||
width?: number | null;
|
|
||||||
height?: number | null;
|
|
||||||
mimeType?: string | null;
|
|
||||||
filesize?: number | null;
|
|
||||||
filename?: string | null;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
|
||||||
* via the `definition` "recorders".
|
|
||||||
*/
|
|
||||||
export interface Recorder {
|
|
||||||
id: string;
|
|
||||||
username: string;
|
|
||||||
avatar?: string | RecordersThumbnail | null;
|
|
||||||
languages?: (string | Language)[] | null;
|
|
||||||
biographies?: RecorderBiographies;
|
|
||||||
role?: ('Admin' | 'Recorder' | 'Api')[] | null;
|
|
||||||
anonymize: boolean;
|
|
||||||
email: string;
|
|
||||||
resetPasswordToken?: string | null;
|
|
||||||
resetPasswordExpiration?: string | null;
|
|
||||||
salt?: string | null;
|
|
||||||
hash?: string | null;
|
|
||||||
loginAttempts?: number | null;
|
|
||||||
lockUntil?: string | null;
|
|
||||||
password?: string | null;
|
|
||||||
}
|
|
||||||
/**
|
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
|
||||||
* via the `definition` "recorders-thumbnails".
|
|
||||||
*/
|
|
||||||
export interface RecordersThumbnail {
|
|
||||||
id: string;
|
|
||||||
recorder?: (string | null) | Recorder;
|
|
||||||
updatedAt: string;
|
|
||||||
createdAt: string;
|
|
||||||
url?: string | null;
|
|
||||||
filename?: string | null;
|
|
||||||
mimeType?: string | null;
|
|
||||||
filesize?: number | null;
|
|
||||||
width?: number | null;
|
|
||||||
height?: number | null;
|
|
||||||
sizes?: {
|
|
||||||
thumb?: {
|
|
||||||
url?: string | null;
|
|
||||||
width?: number | null;
|
|
||||||
height?: number | null;
|
|
||||||
mimeType?: string | null;
|
|
||||||
filesize?: number | null;
|
|
||||||
filename?: string | null;
|
|
||||||
};
|
|
||||||
square?: {
|
|
||||||
url?: string | null;
|
|
||||||
width?: number | null;
|
|
||||||
height?: number | null;
|
|
||||||
mimeType?: string | null;
|
|
||||||
filesize?: number | null;
|
|
||||||
filename?: string | null;
|
|
||||||
};
|
|
||||||
};
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
* via the `definition` "currencies".
|
* via the `definition` "currencies".
|
||||||
|
@ -498,66 +530,6 @@ export interface RecordersThumbnail {
|
||||||
export interface Currency {
|
export interface Currency {
|
||||||
id: string;
|
id: string;
|
||||||
}
|
}
|
||||||
/**
|
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
|
||||||
* via the `definition` "pages".
|
|
||||||
*/
|
|
||||||
export interface Page {
|
|
||||||
id: string;
|
|
||||||
slug: string;
|
|
||||||
type: 'Content' | 'Post' | 'Generic';
|
|
||||||
thumbnail?: string | Image | null;
|
|
||||||
backgroundImage?: string | BackgroundImage | null;
|
|
||||||
tags?: (string | Tag)[] | null;
|
|
||||||
authors?: (string | Recorder)[] | null;
|
|
||||||
translations: {
|
|
||||||
language: string | Language;
|
|
||||||
sourceLanguage: string | Language;
|
|
||||||
pretitle?: string | null;
|
|
||||||
title: string;
|
|
||||||
subtitle?: string | null;
|
|
||||||
summary?: {
|
|
||||||
root: {
|
|
||||||
children: {
|
|
||||||
type: string;
|
|
||||||
version: number;
|
|
||||||
[k: string]: unknown;
|
|
||||||
}[];
|
|
||||||
direction: ('ltr' | 'rtl') | null;
|
|
||||||
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
|
|
||||||
indent: number;
|
|
||||||
type: string;
|
|
||||||
version: number;
|
|
||||||
};
|
|
||||||
[k: string]: unknown;
|
|
||||||
} | null;
|
|
||||||
content: {
|
|
||||||
root: {
|
|
||||||
children: {
|
|
||||||
type: string;
|
|
||||||
version: number;
|
|
||||||
[k: string]: unknown;
|
|
||||||
}[];
|
|
||||||
direction: ('ltr' | 'rtl') | null;
|
|
||||||
format: 'left' | 'start' | 'center' | 'right' | 'end' | 'justify' | '';
|
|
||||||
indent: number;
|
|
||||||
type: string;
|
|
||||||
version: number;
|
|
||||||
};
|
|
||||||
[k: string]: unknown;
|
|
||||||
};
|
|
||||||
transcribers?: (string | Recorder)[] | null;
|
|
||||||
translators?: (string | Recorder)[] | null;
|
|
||||||
proofreaders?: (string | Recorder)[] | null;
|
|
||||||
id?: string | null;
|
|
||||||
}[];
|
|
||||||
folders?: (string | Folder)[] | null;
|
|
||||||
collectibles?: (string | Collectible)[] | null;
|
|
||||||
updatedBy: string | Recorder;
|
|
||||||
updatedAt: string;
|
|
||||||
createdAt: string;
|
|
||||||
_status?: ('draft' | 'published') | null;
|
|
||||||
}
|
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
* via the `definition` "generic-contents".
|
* via the `definition` "generic-contents".
|
||||||
|
@ -762,6 +734,23 @@ export interface PayloadMigration {
|
||||||
updatedAt: string;
|
updatedAt: string;
|
||||||
createdAt: string;
|
createdAt: string;
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
|
* via the `definition` "home-folders".
|
||||||
|
*/
|
||||||
|
export interface HomeFolder {
|
||||||
|
id: string;
|
||||||
|
folders?:
|
||||||
|
| {
|
||||||
|
lightThumbnail?: string | Image | null;
|
||||||
|
darkThumbnail?: string | Image | null;
|
||||||
|
folder: string | Folder;
|
||||||
|
id?: string | null;
|
||||||
|
}[]
|
||||||
|
| null;
|
||||||
|
updatedAt?: string | null;
|
||||||
|
createdAt?: string | null;
|
||||||
|
}
|
||||||
/**
|
/**
|
||||||
* This interface was referenced by `Config`'s JSON-Schema
|
* This interface was referenced by `Config`'s JSON-Schema
|
||||||
* via the `definition` "LineBlock".
|
* via the `definition` "LineBlock".
|
||||||
|
|
Loading…
Reference in New Issue