Precommit

This commit is contained in:
DrMint 2023-07-22 20:34:58 +02:00
parent b436967b3e
commit b7bc1f17c4
3 changed files with 96 additions and 72 deletions

11
package-lock.json generated
View File

@ -19,6 +19,7 @@
"styled-components": "^6.0.5" "styled-components": "^6.0.5"
}, },
"devDependencies": { "devDependencies": {
"@types/dotenv": "^8.2.0",
"@types/express": "^4.17.9", "@types/express": "^4.17.9",
"copyfiles": "^2.4.1", "copyfiles": "^2.4.1",
"nodemon": "^2.0.6", "nodemon": "^2.0.6",
@ -2931,6 +2932,16 @@
"@types/node": "*" "@types/node": "*"
} }
}, },
"node_modules/@types/dotenv": {
"version": "8.2.0",
"resolved": "https://registry.npmjs.org/@types/dotenv/-/dotenv-8.2.0.tgz",
"integrity": "sha512-ylSC9GhfRH7m1EUXBXofhgx4lUWmFeQDINW5oLuS+gxWdfUeW4zJdeVTYVkexEW+e2VUvlZR2kGnGGipAWR7kw==",
"deprecated": "This is a stub types definition. dotenv provides its own type definitions, so you do not need this installed.",
"dev": true,
"dependencies": {
"dotenv": "*"
}
},
"node_modules/@types/eslint": { "node_modules/@types/eslint": {
"version": "8.44.0", "version": "8.44.0",
"resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.0.tgz", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.0.tgz",

View File

@ -28,6 +28,7 @@
"styled-components": "^6.0.5" "styled-components": "^6.0.5"
}, },
"devDependencies": { "devDependencies": {
"@types/dotenv": "^8.2.0",
"@types/express": "^4.17.9", "@types/express": "^4.17.9",
"copyfiles": "^2.4.1", "copyfiles": "^2.4.1",
"nodemon": "^2.0.6", "nodemon": "^2.0.6",

View File

@ -25,14 +25,14 @@ export type ContentFoldersTranslation = {
export interface Config { export interface Config {
collections: { collections: {
'library-items': LibraryItem; "library-items": LibraryItem;
contents: Content; contents: Content;
'content-folders': ContentFolder; "content-folders": ContentFolder;
posts: Post; posts: Post;
'content-thumbnails': ContentThumbnail; "content-thumbnails": ContentThumbnail;
'library-item-thumbnails': LibraryItemThumbnail; "library-item-thumbnails": LibraryItemThumbnail;
'recorder-thumbnails': RecorderThumbnail; "recorder-thumbnails": RecorderThumbnail;
'post-thumbnails': PostThumbnail; "post-thumbnails": PostThumbnail;
files: File; files: File;
languages: Language; languages: Language;
recorders: Recorder; recorders: Recorder;
@ -43,11 +43,6 @@ export interface Config {
} }
export interface LibraryItem { export interface LibraryItem {
id: string; id: string;
/**
* @minItems 2
* @maxItems 2
*/
test?: [number, number];
slug: string; slug: string;
thumbnail?: string | LibraryItemThumbnail; thumbnail?: string | LibraryItemThumbnail;
pretitle?: string; pretitle?: string;
@ -62,34 +57,45 @@ export interface LibraryItem {
height?: number; height?: number;
thickness?: number; thickness?: number;
}; };
itemType?: 'Textual' | 'Audio' | 'Video' | 'Game' | 'Other'; itemType?: "Textual" | "Audio" | "Video" | "Game" | "Other";
textual?: { textual?: {
subtype?: subtype?:
| { | {
value: string; value: string;
relationTo: 'keys'; relationTo: "keys";
}[] }[]
| { | {
value: Key; value: Key;
relationTo: 'keys'; relationTo: "keys";
}[]; }[];
languages?: languages?:
| { | {
value: string; value: string;
relationTo: 'languages'; relationTo: "languages";
}[] }[]
| { | {
value: Language; value: Language;
relationTo: 'languages'; relationTo: "languages";
}[]; }[];
pageCount?: number; pageCount?: number;
bindingType?: 'Paperback' | 'Hardcover'; bindingType?: "Paperback" | "Hardcover";
pageOrder?: 'LeftToRight' | 'RightToLeft'; pageOrder?: "LeftToRight" | "RightToLeft";
};
audio?: {
audioSubtype?:
| {
value: string;
relationTo: "keys";
}[]
| {
value: Key;
relationTo: "keys";
}[];
}; };
releaseDate?: string; releaseDate?: string;
updatedAt: string; updatedAt: string;
createdAt: string; createdAt: string;
_status?: 'draft' | 'published'; _status?: "draft" | "published";
} }
export interface LibraryItemThumbnail { export interface LibraryItemThumbnail {
id: string; id: string;
@ -132,16 +138,16 @@ export interface Key {
id: string; id: string;
slug: string; slug: string;
type: type:
| 'Contents' | "Contents"
| 'LibraryAudio' | "LibraryAudio"
| 'LibraryVideo' | "LibraryVideo"
| 'LibraryTextual' | "LibraryTextual"
| 'LibraryGroup' | "LibraryGroup"
| 'Library' | "Library"
| 'Weapons' | "Weapons"
| 'GamePlatforms' | "GamePlatforms"
| 'Categories' | "Categories"
| 'Wordings'; | "Wordings";
translations?: CategoryTranslations; translations?: CategoryTranslations;
} }
export interface Language { export interface Language {
@ -155,15 +161,15 @@ export interface Content {
categories?: categories?:
| { | {
value: string; value: string;
relationTo: 'keys'; relationTo: "keys";
}[] }[]
| { | {
value: Key; value: Key;
relationTo: 'keys'; relationTo: "keys";
}[]; }[];
type?: { type?: {
value: string | Key; value: string | Key;
relationTo: 'keys'; relationTo: "keys";
}; };
translations: { translations: {
language: string | Language; language: string | Language;
@ -184,7 +190,7 @@ export interface Content {
}[]; }[];
updatedAt: string; updatedAt: string;
createdAt: string; createdAt: string;
_status?: 'draft' | 'published'; _status?: "draft" | "published";
} }
export interface ContentThumbnail { export interface ContentThumbnail {
id: string; id: string;
@ -258,19 +264,25 @@ export interface TextBlock {
}[]; }[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'textBlock'; blockType: "textBlock";
} }
export interface Section { export interface Section {
content?: (Section_Section | Section_Tabs | TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (Section_Section | Section_Tabs | TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'section'; blockType: "section";
} }
export interface Section_Section { export interface Section_Section {
content?: (Section_Section_Section | Section_Section_Tabs | TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (
| Section_Section_Section
| Section_Section_Tabs
| TranscriptBlock
| QuoteBlock
| TextBlock
)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'section'; blockType: "section";
} }
export interface Section_Section_Section { export interface Section_Section_Section {
content?: ( content?: (
@ -282,25 +294,25 @@ export interface Section_Section_Section {
)[]; )[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'section'; blockType: "section";
} }
export interface Section_Section_Section_Section { export interface Section_Section_Section_Section {
content?: (Section_Section_Section_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (Section_Section_Section_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'section'; blockType: "section";
} }
export interface Section_Section_Section_Section_Section { export interface Section_Section_Section_Section_Section {
content?: (TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'section'; blockType: "section";
} }
export interface TranscriptBlock { export interface TranscriptBlock {
lines: (LineBlock | CueBlock)[]; lines: (LineBlock | CueBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'transcriptBlock'; blockType: "transcriptBlock";
} }
export interface LineBlock { export interface LineBlock {
content: { content: {
@ -308,13 +320,13 @@ export interface LineBlock {
}[]; }[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'lineBlock'; blockType: "lineBlock";
} }
export interface CueBlock { export interface CueBlock {
content: string; content: string;
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'cueBlock'; blockType: "cueBlock";
} }
export interface QuoteBlock { export interface QuoteBlock {
from: string; from: string;
@ -323,120 +335,120 @@ export interface QuoteBlock {
}[]; }[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'quoteBlock'; blockType: "quoteBlock";
} }
export interface Section_Section_Section_Tabs { export interface Section_Section_Section_Tabs {
tabs?: Section_Section_Section_Tabs_Tab[]; tabs?: Section_Section_Section_Tabs_Tab[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'tabs'; blockType: "tabs";
} }
export interface Section_Section_Section_Tabs_Tab { export interface Section_Section_Section_Tabs_Tab {
content?: (Section_Section_Section_Tabs_Tab_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (Section_Section_Section_Tabs_Tab_Section | TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'tab'; blockType: "tab";
} }
export interface Section_Section_Section_Tabs_Tab_Section { export interface Section_Section_Section_Tabs_Tab_Section {
content?: (TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'section'; blockType: "section";
} }
export interface Section_Section_Tabs { export interface Section_Section_Tabs {
tabs?: Section_Section_Tabs_Tab[]; tabs?: Section_Section_Tabs_Tab[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'tabs'; blockType: "tabs";
} }
export interface Section_Section_Tabs_Tab { export interface Section_Section_Tabs_Tab {
content?: (Section_Section_Tabs_Tab_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (Section_Section_Tabs_Tab_Section | TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'tab'; blockType: "tab";
} }
export interface Section_Section_Tabs_Tab_Section { export interface Section_Section_Tabs_Tab_Section {
content?: (Section_Section_Tabs_Tab_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (Section_Section_Tabs_Tab_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'section'; blockType: "section";
} }
export interface Section_Section_Tabs_Tab_Section_Section { export interface Section_Section_Tabs_Tab_Section_Section {
content?: (TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'section'; blockType: "section";
} }
export interface Section_Tabs { export interface Section_Tabs {
tabs?: Section_Tabs_Tab[]; tabs?: Section_Tabs_Tab[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'tabs'; blockType: "tabs";
} }
export interface Section_Tabs_Tab { export interface Section_Tabs_Tab {
content?: (Section_Tabs_Tab_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (Section_Tabs_Tab_Section | TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'tab'; blockType: "tab";
} }
export interface Section_Tabs_Tab_Section { export interface Section_Tabs_Tab_Section {
content?: (Section_Tabs_Tab_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (Section_Tabs_Tab_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'section'; blockType: "section";
} }
export interface Section_Tabs_Tab_Section_Section { export interface Section_Tabs_Tab_Section_Section {
content?: (Section_Tabs_Tab_Section_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (Section_Tabs_Tab_Section_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'section'; blockType: "section";
} }
export interface Section_Tabs_Tab_Section_Section_Section { export interface Section_Tabs_Tab_Section_Section_Section {
content?: (TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'section'; blockType: "section";
} }
export interface Tabs { export interface Tabs {
tabs?: Tabs_Tab[]; tabs?: Tabs_Tab[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'tabs'; blockType: "tabs";
} }
export interface Tabs_Tab { export interface Tabs_Tab {
content?: (Tabs_Tab_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (Tabs_Tab_Section | TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'tab'; blockType: "tab";
} }
export interface Tabs_Tab_Section { export interface Tabs_Tab_Section {
content?: (Tabs_Tab_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (Tabs_Tab_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'section'; blockType: "section";
} }
export interface Tabs_Tab_Section_Section { export interface Tabs_Tab_Section_Section {
content?: (Tabs_Tab_Section_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (Tabs_Tab_Section_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'section'; blockType: "section";
} }
export interface Tabs_Tab_Section_Section_Section { export interface Tabs_Tab_Section_Section_Section {
content?: (Tabs_Tab_Section_Section_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (Tabs_Tab_Section_Section_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'section'; blockType: "section";
} }
export interface Tabs_Tab_Section_Section_Section_Section { export interface Tabs_Tab_Section_Section_Section_Section {
content?: (TranscriptBlock | QuoteBlock | TextBlock)[]; content?: (TranscriptBlock | QuoteBlock | TextBlock)[];
id?: string; id?: string;
blockName?: string; blockName?: string;
blockType: 'section'; blockType: "section";
} }
export interface File { export interface File {
id: string; id: string;
filename: string; filename: string;
type: 'LibraryScans' | 'LibrarySoundtracks' | 'ContentVideo' | 'ContentAudio'; type: "LibraryScans" | "LibrarySoundtracks" | "ContentVideo" | "ContentAudio";
updatedAt: string; updatedAt: string;
createdAt: string; createdAt: string;
} }
@ -447,20 +459,20 @@ export interface ContentFolder {
subfolders?: subfolders?:
| { | {
value: string; value: string;
relationTo: 'content-folders'; relationTo: "content-folders";
}[] }[]
| { | {
value: ContentFolder; value: ContentFolder;
relationTo: 'content-folders'; relationTo: "content-folders";
}[]; }[];
contents?: contents?:
| { | {
value: string; value: string;
relationTo: 'contents'; relationTo: "contents";
}[] }[]
| { | {
value: Content; value: Content;
relationTo: 'contents'; relationTo: "contents";
}[]; }[];
} }
export interface Post { export interface Post {
@ -470,20 +482,20 @@ export interface Post {
authors: authors:
| { | {
value: string; value: string;
relationTo: 'recorders'; relationTo: "recorders";
}[] }[]
| { | {
value: Recorder; value: Recorder;
relationTo: 'recorders'; relationTo: "recorders";
}[]; }[];
categories?: categories?:
| { | {
value: string; value: string;
relationTo: 'keys'; relationTo: "keys";
}[] }[]
| { | {
value: Key; value: Key;
relationTo: 'keys'; relationTo: "keys";
}[]; }[];
translations: { translations: {
language: string | Language; language: string | Language;
@ -501,7 +513,7 @@ export interface Post {
hidden?: boolean; hidden?: boolean;
updatedAt: string; updatedAt: string;
createdAt: string; createdAt: string;
_status?: 'draft' | 'published'; _status?: "draft" | "published";
} }
export interface PostThumbnail { export interface PostThumbnail {
id: string; id: string;