diff --git a/package-lock.json b/package-lock.json index 4264f34..10e6af8 100644 --- a/package-lock.json +++ b/package-lock.json @@ -19,6 +19,7 @@ "styled-components": "^6.0.5" }, "devDependencies": { + "@types/dotenv": "^8.2.0", "@types/express": "^4.17.9", "copyfiles": "^2.4.1", "nodemon": "^2.0.6", @@ -2931,6 +2932,16 @@ "@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": { "version": "8.44.0", "resolved": "https://registry.npmjs.org/@types/eslint/-/eslint-8.44.0.tgz", diff --git a/package.json b/package.json index 386f4c8..9594f4e 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "styled-components": "^6.0.5" }, "devDependencies": { + "@types/dotenv": "^8.2.0", "@types/express": "^4.17.9", "copyfiles": "^2.4.1", "nodemon": "^2.0.6", diff --git a/src/types/collections.ts b/src/types/collections.ts index d9631a4..da5a1b9 100644 --- a/src/types/collections.ts +++ b/src/types/collections.ts @@ -25,14 +25,14 @@ export type ContentFoldersTranslation = { export interface Config { collections: { - 'library-items': LibraryItem; + "library-items": LibraryItem; contents: Content; - 'content-folders': ContentFolder; + "content-folders": ContentFolder; posts: Post; - 'content-thumbnails': ContentThumbnail; - 'library-item-thumbnails': LibraryItemThumbnail; - 'recorder-thumbnails': RecorderThumbnail; - 'post-thumbnails': PostThumbnail; + "content-thumbnails": ContentThumbnail; + "library-item-thumbnails": LibraryItemThumbnail; + "recorder-thumbnails": RecorderThumbnail; + "post-thumbnails": PostThumbnail; files: File; languages: Language; recorders: Recorder; @@ -43,11 +43,6 @@ export interface Config { } export interface LibraryItem { id: string; - /** - * @minItems 2 - * @maxItems 2 - */ - test?: [number, number]; slug: string; thumbnail?: string | LibraryItemThumbnail; pretitle?: string; @@ -62,34 +57,45 @@ export interface LibraryItem { height?: number; thickness?: number; }; - itemType?: 'Textual' | 'Audio' | 'Video' | 'Game' | 'Other'; + itemType?: "Textual" | "Audio" | "Video" | "Game" | "Other"; textual?: { subtype?: | { value: string; - relationTo: 'keys'; + relationTo: "keys"; }[] | { value: Key; - relationTo: 'keys'; + relationTo: "keys"; }[]; languages?: | { value: string; - relationTo: 'languages'; + relationTo: "languages"; }[] | { value: Language; - relationTo: 'languages'; + relationTo: "languages"; }[]; pageCount?: number; - bindingType?: 'Paperback' | 'Hardcover'; - pageOrder?: 'LeftToRight' | 'RightToLeft'; + bindingType?: "Paperback" | "Hardcover"; + pageOrder?: "LeftToRight" | "RightToLeft"; + }; + audio?: { + audioSubtype?: + | { + value: string; + relationTo: "keys"; + }[] + | { + value: Key; + relationTo: "keys"; + }[]; }; releaseDate?: string; updatedAt: string; createdAt: string; - _status?: 'draft' | 'published'; + _status?: "draft" | "published"; } export interface LibraryItemThumbnail { id: string; @@ -132,16 +138,16 @@ export interface Key { id: string; slug: string; type: - | 'Contents' - | 'LibraryAudio' - | 'LibraryVideo' - | 'LibraryTextual' - | 'LibraryGroup' - | 'Library' - | 'Weapons' - | 'GamePlatforms' - | 'Categories' - | 'Wordings'; + | "Contents" + | "LibraryAudio" + | "LibraryVideo" + | "LibraryTextual" + | "LibraryGroup" + | "Library" + | "Weapons" + | "GamePlatforms" + | "Categories" + | "Wordings"; translations?: CategoryTranslations; } export interface Language { @@ -155,15 +161,15 @@ export interface Content { categories?: | { value: string; - relationTo: 'keys'; + relationTo: "keys"; }[] | { value: Key; - relationTo: 'keys'; + relationTo: "keys"; }[]; type?: { value: string | Key; - relationTo: 'keys'; + relationTo: "keys"; }; translations: { language: string | Language; @@ -184,7 +190,7 @@ export interface Content { }[]; updatedAt: string; createdAt: string; - _status?: 'draft' | 'published'; + _status?: "draft" | "published"; } export interface ContentThumbnail { id: string; @@ -258,19 +264,25 @@ export interface TextBlock { }[]; id?: string; blockName?: string; - blockType: 'textBlock'; + blockType: "textBlock"; } export interface Section { content?: (Section_Section | Section_Tabs | TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'section'; + blockType: "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; blockName?: string; - blockType: 'section'; + blockType: "section"; } export interface Section_Section_Section { content?: ( @@ -282,25 +294,25 @@ export interface Section_Section_Section { )[]; id?: string; blockName?: string; - blockType: 'section'; + blockType: "section"; } export interface Section_Section_Section_Section { content?: (Section_Section_Section_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'section'; + blockType: "section"; } export interface Section_Section_Section_Section_Section { content?: (TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'section'; + blockType: "section"; } export interface TranscriptBlock { lines: (LineBlock | CueBlock)[]; id?: string; blockName?: string; - blockType: 'transcriptBlock'; + blockType: "transcriptBlock"; } export interface LineBlock { content: { @@ -308,13 +320,13 @@ export interface LineBlock { }[]; id?: string; blockName?: string; - blockType: 'lineBlock'; + blockType: "lineBlock"; } export interface CueBlock { content: string; id?: string; blockName?: string; - blockType: 'cueBlock'; + blockType: "cueBlock"; } export interface QuoteBlock { from: string; @@ -323,120 +335,120 @@ export interface QuoteBlock { }[]; id?: string; blockName?: string; - blockType: 'quoteBlock'; + blockType: "quoteBlock"; } export interface Section_Section_Section_Tabs { tabs?: Section_Section_Section_Tabs_Tab[]; id?: string; blockName?: string; - blockType: 'tabs'; + blockType: "tabs"; } export interface Section_Section_Section_Tabs_Tab { content?: (Section_Section_Section_Tabs_Tab_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'tab'; + blockType: "tab"; } export interface Section_Section_Section_Tabs_Tab_Section { content?: (TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'section'; + blockType: "section"; } export interface Section_Section_Tabs { tabs?: Section_Section_Tabs_Tab[]; id?: string; blockName?: string; - blockType: 'tabs'; + blockType: "tabs"; } export interface Section_Section_Tabs_Tab { content?: (Section_Section_Tabs_Tab_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'tab'; + blockType: "tab"; } export interface Section_Section_Tabs_Tab_Section { content?: (Section_Section_Tabs_Tab_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'section'; + blockType: "section"; } export interface Section_Section_Tabs_Tab_Section_Section { content?: (TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'section'; + blockType: "section"; } export interface Section_Tabs { tabs?: Section_Tabs_Tab[]; id?: string; blockName?: string; - blockType: 'tabs'; + blockType: "tabs"; } export interface Section_Tabs_Tab { content?: (Section_Tabs_Tab_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'tab'; + blockType: "tab"; } export interface Section_Tabs_Tab_Section { content?: (Section_Tabs_Tab_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'section'; + blockType: "section"; } export interface Section_Tabs_Tab_Section_Section { content?: (Section_Tabs_Tab_Section_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'section'; + blockType: "section"; } export interface Section_Tabs_Tab_Section_Section_Section { content?: (TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'section'; + blockType: "section"; } export interface Tabs { tabs?: Tabs_Tab[]; id?: string; blockName?: string; - blockType: 'tabs'; + blockType: "tabs"; } export interface Tabs_Tab { content?: (Tabs_Tab_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'tab'; + blockType: "tab"; } export interface Tabs_Tab_Section { content?: (Tabs_Tab_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'section'; + blockType: "section"; } export interface Tabs_Tab_Section_Section { content?: (Tabs_Tab_Section_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'section'; + blockType: "section"; } export interface Tabs_Tab_Section_Section_Section { content?: (Tabs_Tab_Section_Section_Section_Section | TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'section'; + blockType: "section"; } export interface Tabs_Tab_Section_Section_Section_Section { content?: (TranscriptBlock | QuoteBlock | TextBlock)[]; id?: string; blockName?: string; - blockType: 'section'; + blockType: "section"; } export interface File { id: string; filename: string; - type: 'LibraryScans' | 'LibrarySoundtracks' | 'ContentVideo' | 'ContentAudio'; + type: "LibraryScans" | "LibrarySoundtracks" | "ContentVideo" | "ContentAudio"; updatedAt: string; createdAt: string; } @@ -447,20 +459,20 @@ export interface ContentFolder { subfolders?: | { value: string; - relationTo: 'content-folders'; + relationTo: "content-folders"; }[] | { value: ContentFolder; - relationTo: 'content-folders'; + relationTo: "content-folders"; }[]; contents?: | { value: string; - relationTo: 'contents'; + relationTo: "contents"; }[] | { value: Content; - relationTo: 'contents'; + relationTo: "contents"; }[]; } export interface Post { @@ -470,20 +482,20 @@ export interface Post { authors: | { value: string; - relationTo: 'recorders'; + relationTo: "recorders"; }[] | { value: Recorder; - relationTo: 'recorders'; + relationTo: "recorders"; }[]; categories?: | { value: string; - relationTo: 'keys'; + relationTo: "keys"; }[] | { value: Key; - relationTo: 'keys'; + relationTo: "keys"; }[]; translations: { language: string | Language; @@ -501,7 +513,7 @@ export interface Post { hidden?: boolean; updatedAt: string; createdAt: string; - _status?: 'draft' | 'published'; + _status?: "draft" | "published"; } export interface PostThumbnail { id: string;