From 05916bd80392f588651acd5a9f2406b64b7b067c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakob=20Gr=C3=B8tan=20Gregusson?= <55840686+Jakobgg1243@users.noreply.github.com> Date: Mon, 19 Feb 2024 14:13:01 +0100 Subject: [PATCH] fix(frontend): :bug: Use blockrenderclient on blogs and put the first paragraph as preview (#84) * fix(frontend): :bug: Use blockrenderclient on blogs and put the first paragraph as preview Also added displaying of images on the blog posts * refactor(frontend): :recycle: fix prettier Co-authored-by: Lucas lucastran1107@gmail.com --- frontend/src/app/blog/[articleSlug]/page.tsx | 42 +- frontend/src/app/blog/page.tsx | 67 +- frontend/src/types/strapi.ts | 2081 +++++++++++++++--- 3 files changed, 1888 insertions(+), 302 deletions(-) diff --git a/frontend/src/app/blog/[articleSlug]/page.tsx b/frontend/src/app/blog/[articleSlug]/page.tsx index 7a5e247..2ee4516 100644 --- a/frontend/src/app/blog/[articleSlug]/page.tsx +++ b/frontend/src/app/blog/[articleSlug]/page.tsx @@ -1,10 +1,8 @@ export const runtime = "edge"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; -import { - BlocksRenderer, - type BlocksContent, -} from "@strapi/blocks-react-renderer"; +import { BlocksContent } from "@strapi/blocks-react-renderer"; +import BlockRendererClient from "@/components/BlockRendererClient"; import { gql } from "@/__generated__/gql"; import { getClient } from "@/lib/ApolloClient"; const HOST_URL = process.env.HOST_URL; @@ -82,6 +80,7 @@ export default async function Page({ const authorName = article?.attributes?.author?.data?.attributes?.name; const datePublished = article?.attributes?.datePublished; + const content: BlocksContent = article?.attributes?.body ?? []; return ( <> @@ -89,29 +88,30 @@ export default async function Page({

{article?.attributes?.title}

-

- {article?.attributes?.subtitle}{" "} -

- -
- - - - {// Get initials from author name - authorName - ?.split(" ") - .map((name) => name[0]) - .join("")} - - + {avatarURL && ( + + + + {// Get initials from author name + authorName + ?.split(" ") + .map((name) => name[0]) + .join("")} + + + )}

{authorName}

{datePublished}

+

+ {article?.attributes?.subtitle}{" "} +

+
+ +
); diff --git a/frontend/src/app/blog/page.tsx b/frontend/src/app/blog/page.tsx index c1b705f..00f5ec3 100644 --- a/frontend/src/app/blog/page.tsx +++ b/frontend/src/app/blog/page.tsx @@ -2,16 +2,17 @@ export const runtime = "edge"; import { Card, CardContent, - CardDescription, CardFooter, CardHeader, CardTitle, } from "@/components/ui/card"; import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"; import Link from "next/link"; -import { BlocksContent, BlocksRenderer } from "@strapi/blocks-react-renderer"; +import { BlocksContent } from "@strapi/blocks-react-renderer"; +import BlockRendererClient from "@/components/BlockRendererClient"; import { getClient } from "@/lib/ApolloClient"; import { gql } from "@/__generated__/gql"; +import Image from "next/image"; const HOST_URL = process.env.HOST_URL; const GET_ARTICLES = gql(` @@ -69,13 +70,13 @@ export default async function BlogPage() { } return ( -
-

Blog

+
+

Blog

News and other short stories about our activities are shown here.

-
+
{graphqlData.data.articles.data.map((article) => { let avatarURL = article?.attributes?.author?.data?.attributes?.avatar @@ -88,8 +89,22 @@ export default async function BlogPage() { const authorName = article?.attributes?.author?.data?.attributes?.name; const datePublished = article?.attributes?.datePublished; + let coverImage = + article?.attributes?.coverImage?.data?.attributes?.url; + if (HOST_URL && coverImage != undefined) { + coverImage = HOST_URL + coverImage; + } + let content: BlocksContent = + article?.attributes?.body ?? []; + + for (const block of content) { + if (block.type === "paragraph") { + content = [block]; + break; + } + } return ( - + - - {article?.attributes?.subtitle} - - + {coverImage && ( + {coverImage} + )} +
- - - - {// Get initials from author name - authorName - ?.split(" ") - .map((name) => name[0]) - .join("")} - - + {avatarURL && ( + + + + {// Get initials from author name + authorName + ?.split(" ") + .map((name) => name[0]) + .join("")} + + + )}

{authorName}

{datePublished}

diff --git a/frontend/src/types/strapi.ts b/frontend/src/types/strapi.ts index 54e21b6..8fd1877 100644 --- a/frontend/src/types/strapi.ts +++ b/frontend/src/types/strapi.ts @@ -22,6 +22,33 @@ export interface paths { put: operations["put/authors/{id}"]; delete: operations["delete/authors/{id}"]; }; + "/partners": { + get: operations["get/partners"]; + post: operations["post/partners"]; + }; + "/partners/{id}": { + get: operations["get/partners/{id}"]; + put: operations["put/partners/{id}"]; + delete: operations["delete/partners/{id}"]; + }; + "/people": { + get: operations["get/people"]; + post: operations["post/people"]; + }; + "/people/{id}": { + get: operations["get/people/{id}"]; + put: operations["put/people/{id}"]; + delete: operations["delete/people/{id}"]; + }; + "/ph-d-projects": { + get: operations["get/ph-d-projects"]; + post: operations["post/ph-d-projects"]; + }; + "/ph-d-projects/{id}": { + get: operations["get/ph-d-projects/{id}"]; + put: operations["put/ph-d-projects/{id}"]; + delete: operations["delete/ph-d-projects/{id}"]; + }; "/upload": { /** @description Upload files */ post: { @@ -1456,253 +1483,1546 @@ export interface components { data?: components["schemas"]["AuthorResponseDataObject"]; meta?: Record; }; - UploadFile: { - id?: number; - name?: string; - alternativeText?: string; - caption?: string; - /** Format: integer */ - width?: number; - /** Format: integer */ - height?: number; - formats?: number; - hash?: string; - ext?: string; - mime?: string; - /** Format: double */ - size?: number; - url?: string; - previewUrl?: string; - provider?: string; - provider_metadata?: Record; - /** Format: date-time */ - createdAt?: string; - /** Format: date-time */ - updatedAt?: string; - }; - "Users-Permissions-Role": { - id?: number; - name?: string; - description?: string; - type?: string; - /** Format: date-time */ - createdAt?: string; - /** Format: date-time */ - updatedAt?: string; - }; - "Users-Permissions-User": { - /** @example 1 */ - id?: number; - /** @example foo.bar */ - username?: string; - /** @example foo.bar@strapi.io */ - email?: string; - /** @example local */ - provider?: string; - /** @example true */ - confirmed?: boolean; - /** @example false */ - blocked?: boolean; - /** - * Format: date-time - * @example 2022-06-02T08:32:06.258Z - */ - createdAt?: string; - /** - * Format: date-time - * @example 2022-06-02T08:32:06.267Z - */ - updatedAt?: string; - }; - "Users-Permissions-UserRegistration": { - /** @example eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c */ - jwt?: string; - user?: components["schemas"]["Users-Permissions-User"]; - }; - "Users-Permissions-PermissionsTree": { - [key: string]: { - /** @description every controller of the api */ - controllers?: { - [key: string]: { - [key: string]: { - enabled?: boolean; - policy?: string; - }; - }; - }; - }; - }; - }; - responses: never; - parameters: never; - requestBodies: { - "Users-Permissions-RoleRequest": { - content: { - /** - * @example { - * "name": "foo", - * "description": "role foo", - * "permissions": { - * "api::content-type.content-type": { - * "controllers": { - * "controllerA": { - * "find": { - * "enabled": true - * } - * } - * } - * } - * } - * } - */ - "application/json": { - name?: string; - description?: string; - type?: string; - permissions?: components["schemas"]["Users-Permissions-PermissionsTree"]; - }; - }; - }; - }; - headers: never; - pathItems: never; -} - -export type $defs = Record; - -export type external = Record; - -export interface operations { - "get/articles": { - parameters: { - query?: { - /** @description Sort by attributes ascending (asc) or descending (desc) */ - sort?: string; - /** @description Return page/pageSize (default: true) */ - "pagination[withCount]"?: boolean; - /** @description Page number (default: 0) */ - "pagination[page]"?: number; - /** @description Page size (default: 25) */ - "pagination[pageSize]"?: number; - /** @description Offset value (default: 0) */ - "pagination[start]"?: number; - /** @description Number of entities to return (default: 25) */ - "pagination[limit]"?: number; - /** @description Fields to return (ex: title,author) */ - fields?: string; - /** @description Relations to return */ - populate?: string; - /** @description Filters to apply */ - filters?: Record; - /** @description Locale to apply */ - locale?: string; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["ArticleListResponse"]; - }; - }; - /** @description Bad Request */ - 400: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - /** @description Unauthorized */ - 401: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - /** @description Forbidden */ - 403: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - /** @description Not Found */ - 404: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - /** @description Internal Server Error */ - 500: { - content: { - "application/json": components["schemas"]["Error"]; - }; + PartnerRequest: { + data: { + partnerName: string; + logoUrl?: string; + /** @example string or id */ + logoImage?: number | string; + websiteUrl?: string; }; }; - }; - "post/articles": { - requestBody: { - content: { - "application/json": components["schemas"]["ArticleRequest"]; - }; + PartnerListResponseDataItem: { + id?: number; + attributes?: components["schemas"]["Partner"]; }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["ArticleResponse"]; - }; - }; - /** @description Bad Request */ - 400: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - /** @description Unauthorized */ - 401: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - /** @description Forbidden */ - 403: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - /** @description Not Found */ - 404: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - /** @description Internal Server Error */ - 500: { - content: { - "application/json": components["schemas"]["Error"]; + PartnerListResponse: { + data?: components["schemas"]["PartnerListResponseDataItem"][]; + meta?: { + pagination?: { + page?: number; + pageSize?: number; + pageCount?: number; + total?: number; }; }; }; - }; - "get/articles/{id}": { - parameters: { - path: { - id: number; - }; - }; - responses: { - /** @description OK */ - 200: { - content: { - "application/json": components["schemas"]["ArticleResponse"]; - }; - }; - /** @description Bad Request */ - 400: { - content: { - "application/json": components["schemas"]["Error"]; - }; - }; - /** @description Unauthorized */ - 401: { + Partner: { + partnerName: string; + logoUrl?: string; + logoImage?: { + data?: { + id?: number; + attributes?: { + name?: string; + alternativeText?: string; + caption?: string; + width?: number; + height?: number; + formats?: unknown; + hash?: string; + ext?: string; + mime?: string; + /** Format: float */ + size?: number; + url?: string; + previewUrl?: string; + provider?: string; + provider_metadata?: unknown; + related?: { + data?: { + id?: number; + attributes?: Record; + }[]; + }; + folder?: { + data?: { + id?: number; + attributes?: { + name?: string; + pathId?: number; + parent?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + children?: { + data?: { + id?: number; + attributes?: Record; + }[]; + }; + files?: { + data?: { + id?: number; + attributes?: { + name?: string; + alternativeText?: string; + caption?: string; + width?: number; + height?: number; + formats?: unknown; + hash?: string; + ext?: string; + mime?: string; + /** Format: float */ + size?: number; + url?: string; + previewUrl?: string; + provider?: string; + provider_metadata?: unknown; + related?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }[]; + }; + folder?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + folderPath?: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: { + firstname?: string; + lastname?: string; + username?: string; + /** Format: email */ + email?: string; + resetPasswordToken?: string; + registrationToken?: string; + isActive?: boolean; + roles?: { + data?: { + id?: number; + attributes?: { + name?: string; + code?: string; + description?: string; + users?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }[]; + }; + permissions?: { + data?: { + id?: number; + attributes?: { + action?: string; + actionParameters?: unknown; + subject?: string; + properties?: unknown; + conditions?: unknown; + role?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + }; + }[]; + }; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + }; + }[]; + }; + blocked?: boolean; + preferedLanguage?: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + }; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + }; + }[]; + }; + path?: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + }; + }; + }; + folderPath?: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + }; + }; + }; + websiteUrl?: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + /** Format: date-time */ + publishedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + }; + PartnerResponseDataObject: { + id?: number; + attributes?: components["schemas"]["Partner"]; + }; + PartnerResponse: { + data?: components["schemas"]["PartnerResponseDataObject"]; + meta?: Record; + }; + PersonRequest: { + data: { + name: string; + workTitle?: string; + employeeLink?: string; + /** @example string or id */ + profilePicture?: number | string; + profilePictureURL?: string; + /** @enum {string} */ + role: + | "Researchers" + | "PhD candidates" + | "Engineers" + | "Contact us"; + }; + }; + PersonListResponseDataItem: { + id?: number; + attributes?: components["schemas"]["Person"]; + }; + PersonListResponse: { + data?: components["schemas"]["PersonListResponseDataItem"][]; + meta?: { + pagination?: { + page?: number; + pageSize?: number; + pageCount?: number; + total?: number; + }; + }; + }; + Person: { + name: string; + workTitle?: string; + employeeLink?: string; + profilePicture?: { + data?: { + id?: number; + attributes?: { + name?: string; + alternativeText?: string; + caption?: string; + width?: number; + height?: number; + formats?: unknown; + hash?: string; + ext?: string; + mime?: string; + /** Format: float */ + size?: number; + url?: string; + previewUrl?: string; + provider?: string; + provider_metadata?: unknown; + related?: { + data?: { + id?: number; + attributes?: Record; + }[]; + }; + folder?: { + data?: { + id?: number; + attributes?: { + name?: string; + pathId?: number; + parent?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + children?: { + data?: { + id?: number; + attributes?: Record; + }[]; + }; + files?: { + data?: { + id?: number; + attributes?: { + name?: string; + alternativeText?: string; + caption?: string; + width?: number; + height?: number; + formats?: unknown; + hash?: string; + ext?: string; + mime?: string; + /** Format: float */ + size?: number; + url?: string; + previewUrl?: string; + provider?: string; + provider_metadata?: unknown; + related?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }[]; + }; + folder?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + folderPath?: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: { + firstname?: string; + lastname?: string; + username?: string; + /** Format: email */ + email?: string; + resetPasswordToken?: string; + registrationToken?: string; + isActive?: boolean; + roles?: { + data?: { + id?: number; + attributes?: { + name?: string; + code?: string; + description?: string; + users?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }[]; + }; + permissions?: { + data?: { + id?: number; + attributes?: { + action?: string; + actionParameters?: unknown; + subject?: string; + properties?: unknown; + conditions?: unknown; + role?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + }; + }[]; + }; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + }; + }[]; + }; + blocked?: boolean; + preferedLanguage?: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + }; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + }; + }[]; + }; + path?: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + }; + }; + }; + folderPath?: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + }; + }; + }; + profilePictureURL?: string; + /** @enum {string} */ + role: "Researchers" | "PhD candidates" | "Engineers" | "Contact us"; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + /** Format: date-time */ + publishedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + }; + PersonResponseDataObject: { + id?: number; + attributes?: components["schemas"]["Person"]; + }; + PersonResponse: { + data?: components["schemas"]["PersonResponseDataObject"]; + meta?: Record; + }; + PhDProjectRequest: { + data: { + name: string; + title?: string; + keywords?: string; + }; + }; + PhDProjectListResponseDataItem: { + id?: number; + attributes?: components["schemas"]["PhDProject"]; + }; + PhDProjectListResponse: { + data?: components["schemas"]["PhDProjectListResponseDataItem"][]; + meta?: { + pagination?: { + page?: number; + pageSize?: number; + pageCount?: number; + total?: number; + }; + }; + }; + PhDProject: { + name: string; + title?: string; + keywords?: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + /** Format: date-time */ + publishedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: { + firstname?: string; + lastname?: string; + username?: string; + /** Format: email */ + email?: string; + resetPasswordToken?: string; + registrationToken?: string; + isActive?: boolean; + roles?: { + data?: { + id?: number; + attributes?: { + name?: string; + code?: string; + description?: string; + users?: { + data?: { + id?: number; + attributes?: Record; + }[]; + }; + permissions?: { + data?: { + id?: number; + attributes?: { + action?: string; + actionParameters?: unknown; + subject?: string; + properties?: unknown; + conditions?: unknown; + role?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record< + string, + never + >; + }; + }; + }; + }[]; + }; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + }; + }[]; + }; + blocked?: boolean; + preferedLanguage?: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + createdBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + }; + }; + }; + updatedBy?: { + data?: { + id?: number; + attributes?: Record; + }; + }; + }; + PhDProjectResponseDataObject: { + id?: number; + attributes?: components["schemas"]["PhDProject"]; + }; + PhDProjectResponse: { + data?: components["schemas"]["PhDProjectResponseDataObject"]; + meta?: Record; + }; + UploadFile: { + id?: number; + name?: string; + alternativeText?: string; + caption?: string; + /** Format: integer */ + width?: number; + /** Format: integer */ + height?: number; + formats?: number; + hash?: string; + ext?: string; + mime?: string; + /** Format: double */ + size?: number; + url?: string; + previewUrl?: string; + provider?: string; + provider_metadata?: Record; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + }; + "Users-Permissions-Role": { + id?: number; + name?: string; + description?: string; + type?: string; + /** Format: date-time */ + createdAt?: string; + /** Format: date-time */ + updatedAt?: string; + }; + "Users-Permissions-User": { + /** @example 1 */ + id?: number; + /** @example foo.bar */ + username?: string; + /** @example foo.bar@strapi.io */ + email?: string; + /** @example local */ + provider?: string; + /** @example true */ + confirmed?: boolean; + /** @example false */ + blocked?: boolean; + /** + * Format: date-time + * @example 2022-06-02T08:32:06.258Z + */ + createdAt?: string; + /** + * Format: date-time + * @example 2022-06-02T08:32:06.267Z + */ + updatedAt?: string; + }; + "Users-Permissions-UserRegistration": { + /** @example eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJzdWIiOiIxMjM0NTY3ODkwIiwibmFtZSI6IkpvaG4gRG9lIiwiaWF0IjoxNTE2MjM5MDIyfQ.SflKxwRJSMeKKF2QT4fwpMeJf36POk6yJV_adQssw5c */ + jwt?: string; + user?: components["schemas"]["Users-Permissions-User"]; + }; + "Users-Permissions-PermissionsTree": { + [key: string]: { + /** @description every controller of the api */ + controllers?: { + [key: string]: { + [key: string]: { + enabled?: boolean; + policy?: string; + }; + }; + }; + }; + }; + }; + responses: never; + parameters: never; + requestBodies: { + "Users-Permissions-RoleRequest": { + content: { + /** + * @example { + * "name": "foo", + * "description": "role foo", + * "permissions": { + * "api::content-type.content-type": { + * "controllers": { + * "controllerA": { + * "find": { + * "enabled": true + * } + * } + * } + * } + * } + * } + */ + "application/json": { + name?: string; + description?: string; + type?: string; + permissions?: components["schemas"]["Users-Permissions-PermissionsTree"]; + }; + }; + }; + }; + headers: never; + pathItems: never; +} + +export type $defs = Record; + +export type external = Record; + +export interface operations { + "get/articles": { + parameters: { + query?: { + /** @description Sort by attributes ascending (asc) or descending (desc) */ + sort?: string; + /** @description Return page/pageSize (default: true) */ + "pagination[withCount]"?: boolean; + /** @description Page number (default: 0) */ + "pagination[page]"?: number; + /** @description Page size (default: 25) */ + "pagination[pageSize]"?: number; + /** @description Offset value (default: 0) */ + "pagination[start]"?: number; + /** @description Number of entities to return (default: 25) */ + "pagination[limit]"?: number; + /** @description Fields to return (ex: title,author) */ + fields?: string; + /** @description Relations to return */ + populate?: string; + /** @description Filters to apply */ + filters?: Record; + /** @description Locale to apply */ + locale?: string; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["ArticleListResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "post/articles": { + requestBody: { + content: { + "application/json": components["schemas"]["ArticleRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["ArticleResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "get/articles/{id}": { + parameters: { + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["ArticleResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "put/articles/{id}": { + parameters: { + path: { + id: number; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["ArticleRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["ArticleResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "delete/articles/{id}": { + parameters: { + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": number; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "get/authors": { + parameters: { + query?: { + /** @description Sort by attributes ascending (asc) or descending (desc) */ + sort?: string; + /** @description Return page/pageSize (default: true) */ + "pagination[withCount]"?: boolean; + /** @description Page number (default: 0) */ + "pagination[page]"?: number; + /** @description Page size (default: 25) */ + "pagination[pageSize]"?: number; + /** @description Offset value (default: 0) */ + "pagination[start]"?: number; + /** @description Number of entities to return (default: 25) */ + "pagination[limit]"?: number; + /** @description Fields to return (ex: title,author) */ + fields?: string; + /** @description Relations to return */ + populate?: string; + /** @description Filters to apply */ + filters?: Record; + /** @description Locale to apply */ + locale?: string; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["AuthorListResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "post/authors": { + requestBody: { + content: { + "application/json": components["schemas"]["AuthorRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["AuthorResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "get/authors/{id}": { + parameters: { + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["AuthorResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "put/authors/{id}": { + parameters: { + path: { + id: number; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["AuthorRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["AuthorResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "delete/authors/{id}": { + parameters: { + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": number; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "get/partners": { + parameters: { + query?: { + /** @description Sort by attributes ascending (asc) or descending (desc) */ + sort?: string; + /** @description Return page/pageSize (default: true) */ + "pagination[withCount]"?: boolean; + /** @description Page number (default: 0) */ + "pagination[page]"?: number; + /** @description Page size (default: 25) */ + "pagination[pageSize]"?: number; + /** @description Offset value (default: 0) */ + "pagination[start]"?: number; + /** @description Number of entities to return (default: 25) */ + "pagination[limit]"?: number; + /** @description Fields to return (ex: title,author) */ + fields?: string; + /** @description Relations to return */ + populate?: string; + /** @description Filters to apply */ + filters?: Record; + /** @description Locale to apply */ + locale?: string; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["PartnerListResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "post/partners": { + requestBody: { + content: { + "application/json": components["schemas"]["PartnerRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["PartnerResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "get/partners/{id}": { + parameters: { + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["PartnerResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { content: { "application/json": components["schemas"]["Error"]; }; @@ -1727,7 +3047,7 @@ export interface operations { }; }; }; - "put/articles/{id}": { + "put/partners/{id}": { parameters: { path: { id: number; @@ -1735,14 +3055,14 @@ export interface operations { }; requestBody: { content: { - "application/json": components["schemas"]["ArticleRequest"]; + "application/json": components["schemas"]["PartnerRequest"]; }; }; responses: { /** @description OK */ 200: { content: { - "application/json": components["schemas"]["ArticleResponse"]; + "application/json": components["schemas"]["PartnerResponse"]; }; }; /** @description Bad Request */ @@ -1777,7 +3097,7 @@ export interface operations { }; }; }; - "delete/articles/{id}": { + "delete/partners/{id}": { parameters: { path: { id: number; @@ -1822,7 +3142,7 @@ export interface operations { }; }; }; - "get/authors": { + "get/people": { parameters: { query?: { /** @description Sort by attributes ascending (asc) or descending (desc) */ @@ -1851,7 +3171,7 @@ export interface operations { /** @description OK */ 200: { content: { - "application/json": components["schemas"]["AuthorListResponse"]; + "application/json": components["schemas"]["PersonListResponse"]; }; }; /** @description Bad Request */ @@ -1886,17 +3206,17 @@ export interface operations { }; }; }; - "post/authors": { + "post/people": { requestBody: { content: { - "application/json": components["schemas"]["AuthorRequest"]; + "application/json": components["schemas"]["PersonRequest"]; }; }; responses: { /** @description OK */ 200: { content: { - "application/json": components["schemas"]["AuthorResponse"]; + "application/json": components["schemas"]["PersonResponse"]; }; }; /** @description Bad Request */ @@ -1931,7 +3251,7 @@ export interface operations { }; }; }; - "get/authors/{id}": { + "get/people/{id}": { parameters: { path: { id: number; @@ -1941,7 +3261,7 @@ export interface operations { /** @description OK */ 200: { content: { - "application/json": components["schemas"]["AuthorResponse"]; + "application/json": components["schemas"]["PersonResponse"]; }; }; /** @description Bad Request */ @@ -1976,7 +3296,7 @@ export interface operations { }; }; }; - "put/authors/{id}": { + "put/people/{id}": { parameters: { path: { id: number; @@ -1984,14 +3304,14 @@ export interface operations { }; requestBody: { content: { - "application/json": components["schemas"]["AuthorRequest"]; + "application/json": components["schemas"]["PersonRequest"]; }; }; responses: { /** @description OK */ 200: { content: { - "application/json": components["schemas"]["AuthorResponse"]; + "application/json": components["schemas"]["PersonResponse"]; }; }; /** @description Bad Request */ @@ -2026,7 +3346,256 @@ export interface operations { }; }; }; - "delete/authors/{id}": { + "delete/people/{id}": { + parameters: { + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": number; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "get/ph-d-projects": { + parameters: { + query?: { + /** @description Sort by attributes ascending (asc) or descending (desc) */ + sort?: string; + /** @description Return page/pageSize (default: true) */ + "pagination[withCount]"?: boolean; + /** @description Page number (default: 0) */ + "pagination[page]"?: number; + /** @description Page size (default: 25) */ + "pagination[pageSize]"?: number; + /** @description Offset value (default: 0) */ + "pagination[start]"?: number; + /** @description Number of entities to return (default: 25) */ + "pagination[limit]"?: number; + /** @description Fields to return (ex: title,author) */ + fields?: string; + /** @description Relations to return */ + populate?: string; + /** @description Filters to apply */ + filters?: Record; + /** @description Locale to apply */ + locale?: string; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["PhDProjectListResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "post/ph-d-projects": { + requestBody: { + content: { + "application/json": components["schemas"]["PhDProjectRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["PhDProjectResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "get/ph-d-projects/{id}": { + parameters: { + path: { + id: number; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["PhDProjectResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "put/ph-d-projects/{id}": { + parameters: { + path: { + id: number; + }; + }; + requestBody: { + content: { + "application/json": components["schemas"]["PhDProjectRequest"]; + }; + }; + responses: { + /** @description OK */ + 200: { + content: { + "application/json": components["schemas"]["PhDProjectResponse"]; + }; + }; + /** @description Bad Request */ + 400: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Unauthorized */ + 401: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Forbidden */ + 403: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Not Found */ + 404: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + /** @description Internal Server Error */ + 500: { + content: { + "application/json": components["schemas"]["Error"]; + }; + }; + }; + }; + "delete/ph-d-projects/{id}": { parameters: { path: { id: number;