From 9802513d8e43a58af7750872f3958f7b746f20ff Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Tue, 29 Apr 2025 17:10:06 +0200 Subject: [PATCH] lint things, add sidebar --- .vscode/launch.json | 2 +- apps/app/messages/en.json | 3 +- apps/app/messages/hu.json | 4 +- apps/app/package.json | 2 +- apps/app/src/hooks.server.ts | 2 +- apps/app/src/lib/api/api.gen.ts | 4482 ++++++++--------- apps/app/src/lib/graph/PersonMenu.svelte | 17 +- apps/app/src/lib/graph/layout.ts | 2 +- apps/app/src/lib/graph/model.ts | 2 + ...ch_family_tree.ts => parse_family_tree.ts} | 0 apps/app/src/lib/profile/create/Modal.svelte | 16 +- apps/app/src/lib/sidebar/hamburgerIcon.svelte | 34 + apps/app/src/lib/sidebar/sideBar.svelte | 12 + apps/app/src/lib/switchToLanguage.test.ts | 5 +- apps/app/src/routes/+layout.svelte | 4 + apps/app/src/routes/+page.server.ts | 3 +- apps/app/src/routes/+page.svelte | 94 +- .../app/src/routes/api/family_tree/+server.ts | 2 +- .../person_and_relationship/[ID]/+server.ts | 2 +- .../internal/api/person_family_tree.go | 1 + 20 files changed, 2374 insertions(+), 2315 deletions(-) rename apps/app/src/lib/graph/{fetch_family_tree.ts => parse_family_tree.ts} (100%) create mode 100644 apps/app/src/lib/sidebar/hamburgerIcon.svelte create mode 100644 apps/app/src/lib/sidebar/sideBar.svelte diff --git a/.vscode/launch.json b/.vscode/launch.json index 7c3173f..c3484ac 100644 --- a/.vscode/launch.json +++ b/.vscode/launch.json @@ -11,7 +11,7 @@ "mode": "debug", "program": "${workspaceFolder}/apps/db-adapter/main.go", "env": { - "HTTP_PORT": ":8080", + "HTTP_PORT": ":5237", "MEMGRAPH_URI": "bolt://127.0.0.1:7687", "MEMGRAPH_USER": "memgraph", "MEMGRAPH_PASSWORD": "memgraph" diff --git a/apps/app/messages/en.json b/apps/app/messages/en.json index d81a2d8..2a36af4 100644 --- a/apps/app/messages/en.json +++ b/apps/app/messages/en.json @@ -158,5 +158,6 @@ "welcome": "Welcome to Generations Heritage", "yes": "Yes", "zip_code": "Zip Code", - "add_life_event": "Add life-event" + "add_life_event": "Add life-event", + "deleted_profiles": "Deleted profiles" } diff --git a/apps/app/messages/hu.json b/apps/app/messages/hu.json index 689c43a..78615eb 100644 --- a/apps/app/messages/hu.json +++ b/apps/app/messages/hu.json @@ -156,5 +156,7 @@ "welcome": "Üdvözöljük a Generációk Öröksége oldalán", "yes": "Igen", "zip_code": "Irányítószám", - "add_life_event": "Életesemény hozzadása" + "add_life_event": "Életesemény hozzadása", + "deleted_profiles": "Törölt profilok", + "managed_profiles": "Adminisztrált profilok" } diff --git a/apps/app/package.json b/apps/app/package.json index 33bf53f..736a328 100644 --- a/apps/app/package.json +++ b/apps/app/package.json @@ -69,4 +69,4 @@ "openapi-fetch": "^0.13.5", "pikaday": "^1.8.2" } -} +} \ No newline at end of file diff --git a/apps/app/src/hooks.server.ts b/apps/app/src/hooks.server.ts index 92ef6de..26b685a 100644 --- a/apps/app/src/hooks.server.ts +++ b/apps/app/src/hooks.server.ts @@ -27,7 +27,7 @@ const authHandle: Handle = async ({ event, resolve }) => { if (session !== null) { setSessionTokenCookie(event, token, session.expiresAt); } else { - console.log('Session token is invalid'); + console.error('Session token is invalid'); deleteSessionTokenCookie(event); } diff --git a/apps/app/src/lib/api/api.gen.ts b/apps/app/src/lib/api/api.gen.ts index e692ac7..e060bf8 100644 --- a/apps/app/src/lib/api/api.gen.ts +++ b/apps/app/src/lib/api/api.gen.ts @@ -4,2259 +4,2243 @@ */ export interface paths { - '/health': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Check the health of the server */ - get: operations['healthCheck']; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - '/person_and_relationship/{id}': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a person and relationship */ - post: operations['createPersonAndRelationship']; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - '/person': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a new person */ - post: operations['createPerson']; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - '/comment/{id}': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get comments on person's profile by ID */ - get: operations['GetCommentsOnPerson']; - put?: never; - /** Comment on person's profile by ID */ - post: operations['commentOnPerson']; - /** Comment on person's profile by ID */ - delete: operations['deleteCommentOnPerson']; - options?: never; - head?: never; - /** Edit comment on person's profile by ID */ - patch: operations['editComment']; - trace?: never; - }; - '/person/{id}': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get a person by ID */ - get: operations['getPersonById']; - put?: never; - post?: never; - /** Soft delete a person by ID */ - delete: operations['softDeletePerson']; - options?: never; - head?: never; - /** Update a person by ID */ - patch: operations['updatePerson']; - trace?: never; - }; - '/person/{id}/hard-delete': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** Hard delete a person by ID */ - delete: operations['hardDeletePerson']; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - '/person/google/{google_id}': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get a person by Google ID */ - get: operations['getPersonByGoogleId']; - put?: never; - /** Create a new person by Google ID */ - post: operations['createPersonByGoogleId']; - delete?: never; - options?: never; - head?: never; - /** Create a new person by Google ID with invite code */ - patch: operations['createPersonByGoogleIdAndInviteCode']; - trace?: never; - }; - '/family-tree': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get family tree by person ID */ - get: operations['getFamilyTreeById']; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - '/family-tree-with-spouses': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get family tree by person ID with spouses included */ - get: operations['getFamilyTreeWithSpousesById']; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - '/person/{id}/recipes': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get recipes by person ID */ - get: operations['getRecipesByPersonId']; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - '/relationship': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a relationship between two persons */ - post: operations['createRelationship']; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - '/relationship/{id1}/{id2}': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get relationships between two persons */ - get: operations['getRelationship']; - put?: never; - post?: never; - /** Delete relationship between two persons */ - delete: operations['deleteRelationship']; - options?: never; - head?: never; - /** Update a relationship between two persons */ - patch: operations['updateRelationship']; - trace?: never; - }; - '/admin/{id1}': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get profile Admins */ - get: operations['getProfileAdmins']; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - '/admin/{id1}/{id2}': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get admin relationship between two persons */ - get: operations['getAdminRelationship']; - put?: never; - /** Create admin relationship between two persons */ - post: operations['createAdminRelationship']; - /** Delete admin relationship between two persons */ - delete: operations['deleteAdminRelationship']; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - '/managed_profiles': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - /** Get managed profiles */ - get: operations['getManagedProfiles']; - put?: never; - post?: never; - delete?: never; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - '/recipe/{id}': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** Soft delete a recipe by ID */ - delete: operations['softDeleteRecipe']; - options?: never; - head?: never; - /** Update a recipe by ID */ - patch: operations['updateRecipe']; - trace?: never; - }; - '/recipe/{id}/hard-delete': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - post?: never; - /** Hard delete a recipe by ID */ - delete: operations['hardDeleteRecipe']; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; - '/recipe/{id}/relationship': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - put?: never; - /** Create a relationship with an existing recipe */ - post: operations['createRecipeRelationship']; - /** Delete a relationship with a recipe */ - delete: operations['deleteRecipeRelationship']; - options?: never; - head?: never; - patch?: never; - trace?: never; - }; + "/health": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Check the health of the server */ + get: operations["healthCheck"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/person_and_relationship/{id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a person and relationship */ + post: operations["createPersonAndRelationship"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/person": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a new person */ + post: operations["createPerson"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/comment/{id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get comments on person's profile by ID */ + get: operations["GetCommentsOnPerson"]; + put?: never; + /** Comment on person's profile by ID */ + post: operations["commentOnPerson"]; + /** Comment on person's profile by ID */ + delete: operations["deleteCommentOnPerson"]; + options?: never; + head?: never; + /** Edit comment on person's profile by ID */ + patch: operations["editComment"]; + trace?: never; + }; + "/person/{id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a person by ID */ + get: operations["getPersonById"]; + put?: never; + post?: never; + /** Soft delete a person by ID */ + delete: operations["softDeletePerson"]; + options?: never; + head?: never; + /** Update a person by ID */ + patch: operations["updatePerson"]; + trace?: never; + }; + "/person/{id}/hard-delete": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** Hard delete a person by ID */ + delete: operations["hardDeletePerson"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/person/google/{google_id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get a person by Google ID */ + get: operations["getPersonByGoogleId"]; + put?: never; + /** Create a new person by Google ID */ + post: operations["createPersonByGoogleId"]; + delete?: never; + options?: never; + head?: never; + /** Create a new person by Google ID with invite code */ + patch: operations["createPersonByGoogleIdAndInviteCode"]; + trace?: never; + }; + "/family-tree": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get family tree by person ID */ + get: operations["getFamilyTreeById"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/family-tree-with-spouses": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get family tree by person ID with spouses included */ + get: operations["getFamilyTreeWithSpousesById"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/person/{id}/recipes": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get recipes by person ID */ + get: operations["getRecipesByPersonId"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/relationship": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a relationship between two persons */ + post: operations["createRelationship"]; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/relationship/{id1}/{id2}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get relationships between two persons */ + get: operations["getRelationship"]; + put?: never; + post?: never; + /** Delete relationship between two persons */ + delete: operations["deleteRelationship"]; + options?: never; + head?: never; + /** Update a relationship between two persons */ + patch: operations["updateRelationship"]; + trace?: never; + }; + "/admin/{id1}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get profile Admins */ + get: operations["getProfileAdmins"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/admin/{id1}/{id2}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get admin relationship between two persons */ + get: operations["getAdminRelationship"]; + put?: never; + /** Create admin relationship between two persons */ + post: operations["createAdminRelationship"]; + /** Delete admin relationship between two persons */ + delete: operations["deleteAdminRelationship"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/managed_profiles": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + /** Get managed profiles */ + get: operations["getManagedProfiles"]; + put?: never; + post?: never; + delete?: never; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/recipe/{id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** Soft delete a recipe by ID */ + delete: operations["softDeleteRecipe"]; + options?: never; + head?: never; + /** Update a recipe by ID */ + patch: operations["updateRecipe"]; + trace?: never; + }; + "/recipe/{id}/hard-delete": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + post?: never; + /** Hard delete a recipe by ID */ + delete: operations["hardDeleteRecipe"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; + "/recipe/{id}/relationship": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + put?: never; + /** Create a relationship with an existing recipe */ + post: operations["createRecipeRelationship"]; + /** Delete a relationship with a recipe */ + delete: operations["deleteRecipeRelationship"]; + options?: never; + head?: never; + patch?: never; + trace?: never; + }; } export type webhooks = Record; export interface components { - schemas: { - PersonProperties: { - invite_code?: string | null; - google_id?: string | null; - first_name?: string | null; - middle_name?: string | null; - last_name?: string | null; - titles?: string[] | null; - suffixes?: string[] | null; - extra_names?: string[] | null; - aliases?: string[] | null; - mothers_first_name?: string | null; - mothers_last_name?: string | null; - /** @enum {string|null} */ - biological_sex?: 'male' | 'female' | 'intersex' | 'unknown' | 'other' | null; - /** Format: date */ - born?: string | null; - place_of_birth?: string | null; - /** Format: date */ - died?: string | null; - place_of_death?: string | null; - life_events?: - | { - /** Format: date */ - from?: string; - /** Format: date */ - to?: string; - description?: string; - }[] - | null; - occupations?: string[] | null; - occupation_to_display?: string | null; - limit?: number | null; - photos?: - | { - url?: string; - description?: string; - /** Format: date */ - date?: string; - name?: string; - }[] - | null; - videos?: - | { - url?: string; - description?: string; - /** Format: date */ - date?: string; - name?: string; - }[] - | null; - audios?: - | { - url?: string; - description?: string; - /** Format: date */ - date?: string; - name?: string; - }[] - | null; - profile_picture?: string | null; - verified?: boolean | null; - email?: string | null; - phone?: string | null; - residence?: { - city?: string; - country?: string; - zip_code?: string; - address_line_1?: string; - address_line_2?: string; - } | null; - religion?: string | null; - baptized?: string | null; - ideologies?: string[] | null; - blood_type?: string | null; - allergies?: string[] | null; - medications?: - | { - name?: string; - description?: string | null; - components?: string | null; - dosage?: string | null; - /** Format: date */ - from?: string | null; - /** Format: date */ - to?: string | null; - }[] - | null; - medical_conditions?: Record[] | null; - height?: number | null; - weight?: number | null; - hair_colour?: string | null; - skin_colour?: string | null; - eye_colour?: string | null; - sports?: string[] | null; - hobbies?: string[] | null; - interests?: string[] | null; - languages?: - | { - language?: string; - level?: string | null; - }[] - | null; - notes?: - | { - /** Format: date */ - date?: string | null; - title?: string | null; - note?: string; - url?: string | null; - }[] - | null; - }; - PersonRegistration: { - first_name: string; - last_name: string; - /** Format: email */ - email?: string | null; - limit: number; - /** @enum {string} */ - biological_sex?: 'male' | 'female' | 'intersex' | 'unknown' | 'other'; - /** Format: date */ - born: string; - mothers_first_name: string; - mothers_last_name: string; - }; - Person: { - Id?: number; - ElementId?: string; - Labels?: string[]; - Props?: components['schemas']['PersonProperties']; - }; - FamilyRelationship: { - verified?: boolean | null; - notes?: string | null; - /** Format: date */ - from?: string | null; - /** Format: date */ - to?: string | null; - }; - Relationship: { - id?: number; - type?: string | null; - label?: string | null; - start?: number; - end?: number; - properties?: components['schemas']['FamilyRelationship']; - }; - dbtypeRelationship: { - Id?: number; - ElementId?: string; - Type?: string | null; - StartId?: number; - StartElementId?: string; - EndId?: number; - EndElementId?: string; - Props?: components['schemas']['FamilyRelationship']; - }; - OptimizedPersonNode: { - id?: number; - labels?: string[]; - type?: string | null; - first_name?: string; - middle_name?: string; - last_name?: string; - /** Format: date */ - born?: string; - /** Format: date */ - died?: string | null; - /** @enum {string|null} */ - biological_sex?: 'male' | 'female' | 'intersex' | 'unknown' | 'other' | null; - profile_picture?: string | null; - }; - FamilyTree: { - people?: components['schemas']['OptimizedPersonNode'][]; - relationships?: components['schemas']['dbtypeRelationship'][]; - }; - RecipeProperties: { - name?: string | null; - origin?: string | null; - allow_admin_access?: { - id?: number; - name?: string; - }[]; - category?: string | null; - /** Format: date */ - first_recorded?: string | null; - description?: string | null; - ingredients?: string[] | null; - instructions?: string[] | null; - photo?: string | null; - notes?: string | null; - others_said?: - | { - id?: number; - name?: string; - said?: string; - }[] - | null; - }; - Recipe: { - Id?: number; - ElementId?: string; - Labels?: string[]; - Props?: components['schemas']['RecipeProperties']; - }; - Likes: { - Id?: number; - Type?: string; - StartId?: number; - StartElementId?: string; - EndId?: number; - EndElementId?: string; - Props?: components['schemas']['LikesProperties']; - }; - LikesProperties: { - favourite?: boolean | null; - like_it?: boolean | null; - could_make_it?: boolean | null; - }; - Admin: { - id?: number; - first_name?: string; - adminSince?: number; - last_name?: string; - EndId?: number; - EndElementId?: string; - Props?: { - added?: number; - }; - }; - AdminRelationship: { - Id?: number; - Type?: string; - StartId?: number; - StartElementId?: string; - EndId?: number; - EndElementId?: string; - Props?: { - added?: number; - }; - }; - Comment: { - id?: number | null; - start?: number | null; - end?: number | null; - type?: string | null; - label?: string | null; - props?: components['schemas']['Message']; - }; - Message: { - message?: string; - /** Format: date-time */ - edited?: string | null; - /** Format: date-time */ - sent_at?: string; - }; - Messages: { - people?: components['schemas']['OptimizedPersonNode'][]; - comments?: components['schemas']['Comment'][]; - }; - }; - responses: never; - parameters: never; - requestBodies: never; - headers: never; - pathItems: never; + schemas: { + PersonProperties: { + invite_code?: string | null; + google_id?: string | null; + first_name?: string | null; + middle_name?: string | null; + last_name?: string | null; + titles?: string[] | null; + suffixes?: string[] | null; + extra_names?: string[] | null; + aliases?: string[] | null; + mothers_first_name?: string | null; + mothers_last_name?: string | null; + /** @enum {string|null} */ + biological_sex?: "male" | "female" | "intersex" | "unknown" | "other" | null; + /** Format: date */ + born?: string | null; + place_of_birth?: string | null; + /** Format: date */ + died?: string | null; + place_of_death?: string | null; + life_events?: { + /** Format: date */ + from?: string; + /** Format: date */ + to?: string; + description?: string; + }[] | null; + occupations?: string[] | null; + occupation_to_display?: string | null; + limit?: number | null; + photos?: { + url?: string; + description?: string; + /** Format: date */ + date?: string; + name?: string; + }[] | null; + videos?: { + url?: string; + description?: string; + /** Format: date */ + date?: string; + name?: string; + }[] | null; + audios?: { + url?: string; + description?: string; + /** Format: date */ + date?: string; + name?: string; + }[] | null; + profile_picture?: string | null; + verified?: boolean | null; + email?: string | null; + phone?: string | null; + residence?: { + city?: string; + country?: string; + zip_code?: string; + address_line_1?: string; + address_line_2?: string; + } | null; + religion?: string | null; + baptized?: string | null; + ideologies?: string[] | null; + blood_type?: string | null; + allergies?: string[] | null; + medications?: { + name?: string; + description?: string | null; + components?: string | null; + dosage?: string | null; + /** Format: date */ + from?: string | null; + /** Format: date */ + to?: string | null; + }[] | null; + medical_conditions?: Record[] | null; + height?: number | null; + weight?: number | null; + hair_colour?: string | null; + skin_colour?: string | null; + eye_colour?: string | null; + sports?: string[] | null; + hobbies?: string[] | null; + interests?: string[] | null; + languages?: { + language?: string; + level?: string | null; + }[] | null; + notes?: { + /** Format: date */ + date?: string | null; + title?: string | null; + note?: string; + url?: string | null; + }[] | null; + }; + PersonRegistration: { + first_name: string; + last_name: string; + /** Format: email */ + email?: string | null; + limit: number; + /** @enum {string} */ + biological_sex?: "male" | "female" | "intersex" | "unknown" | "other"; + /** Format: date */ + born: string; + mothers_first_name: string; + mothers_last_name: string; + }; + Person: { + Id?: number; + ElementId?: string; + Labels?: string[]; + Props?: components["schemas"]["PersonProperties"]; + }; + FamilyRelationship: { + verified?: boolean | null; + notes?: string | null; + /** Format: date */ + from?: string | null; + /** Format: date */ + to?: string | null; + }; + Relationship: { + id?: number; + type?: string | null; + label?: string | null; + start?: number; + end?: number; + properties?: components["schemas"]["FamilyRelationship"]; + }; + dbtypeRelationship: { + Id?: number; + ElementId?: string; + Type?: string | null; + StartId?: number; + StartElementId?: string; + EndId?: number; + EndElementId?: string; + Props?: components["schemas"]["FamilyRelationship"]; + }; + OptimizedPersonNode: { + id?: number; + labels?: string[]; + type?: string | null; + first_name?: string; + middle_name?: string; + last_name?: string; + /** Format: date */ + born?: string; + /** Format: date */ + died?: string | null; + /** @enum {string|null} */ + biological_sex?: "male" | "female" | "intersex" | "unknown" | "other" | null; + profile_picture?: string | null; + }; + FamilyTree: { + people?: components["schemas"]["OptimizedPersonNode"][]; + relationships?: components["schemas"]["dbtypeRelationship"][]; + }; + RecipeProperties: { + name?: string | null; + origin?: string | null; + allow_admin_access?: { + id?: number; + name?: string; + }[]; + category?: string | null; + /** Format: date */ + first_recorded?: string | null; + description?: string | null; + ingredients?: string[] | null; + instructions?: string[] | null; + photo?: string | null; + notes?: string | null; + others_said?: { + id?: number; + name?: string; + said?: string; + }[] | null; + }; + Recipe: { + Id?: number; + ElementId?: string; + Labels?: string[]; + Props?: components["schemas"]["RecipeProperties"]; + }; + Likes: { + Id?: number; + Type?: string; + StartId?: number; + StartElementId?: string; + EndId?: number; + EndElementId?: string; + Props?: components["schemas"]["LikesProperties"]; + }; + LikesProperties: { + favourite?: boolean | null; + like_it?: boolean | null; + could_make_it?: boolean | null; + }; + Admin: { + id?: number; + first_name?: string; + adminSince?: number; + last_name?: string; + EndId?: number; + EndElementId?: string; + Props?: { + added?: number; + }; + }; + AdminRelationship: { + Id?: number; + Type?: string; + StartId?: number; + StartElementId?: string; + EndId?: number; + EndElementId?: string; + Props?: { + added?: number; + }; + }; + Comment: { + id?: number | null; + start?: number | null; + end?: number | null; + type?: string | null; + label?: string | null; + props?: components["schemas"]["Message"]; + }; + Message: { + message?: string; + /** Format: date-time */ + edited?: string | null; + /** Format: date-time */ + sent_at?: string; + }; + Messages: { + people?: components["schemas"]["OptimizedPersonNode"][]; + comments?: components["schemas"]["Comment"][]; + }; + }; + responses: never; + parameters: never; + requestBodies: never; + headers: never; + pathItems: never; } export type $defs = Record; export interface operations { - healthCheck: { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Server is healthy */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Server is unhealthy */ - 503: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - createPersonAndRelationship: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id: number; - }; - cookie?: never; - }; - requestBody: { - content: { - 'application/json': { - person: components['schemas']['PersonRegistration']; - /** @enum {string} */ - type?: 'child' | 'parent' | 'spouse' | 'sibling'; - relationship: components['schemas']['FamilyRelationship']; - }; - }; - }; - responses: { - /** @description Person and relationship created */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - person?: components['schemas']['Person']; - relationships?: components['schemas']['Relationship'][]; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - createPerson: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - 'application/json': components['schemas']['PersonRegistration']; - }; - }; - responses: { - /** @description Person created */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['Person']; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - GetCommentsOnPerson: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Comments */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['Messages']; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - commentOnPerson: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id: number; - }; - cookie?: never; - }; - requestBody: { - content: { - 'application/json': components['schemas']['Message']; - }; - }; - responses: { - /** @description Message updated */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['Messages']; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - deleteCommentOnPerson: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Deleted comment */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - editComment: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id: number; - }; - cookie?: never; - }; - requestBody: { - content: { - 'application/json': components['schemas']['Message']; - }; - }; - responses: { - /** @description Comment updated */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['Messages']; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - getPersonById: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Person retrieved */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['Person']; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - softDeletePerson: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Person soft deleted */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - updatePerson: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id: number; - }; - cookie?: never; - }; - requestBody: { - content: { - 'application/json': components['schemas']['PersonProperties']; - }; - }; - responses: { - /** @description Person updated */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['Person']; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - hardDeletePerson: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Person hard deleted */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - getPersonByGoogleId: { - parameters: { - query?: never; - header?: never; - path: { - google_id: string; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Person retrieved */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['Person']; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - createPersonByGoogleId: { - parameters: { - query?: never; - header?: never; - path: { - google_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - 'application/json': components['schemas']['PersonRegistration']; - }; - }; - responses: { - /** @description Person created */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['Person']; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - createPersonByGoogleIdAndInviteCode: { - parameters: { - query?: never; - header?: never; - path: { - google_id: string; - }; - cookie?: never; - }; - requestBody: { - content: { - 'application/json': { - invite_code: string; - person: components['schemas']['PersonRegistration']; - }; - }; - }; - responses: { - /** @description Person created */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['Person']; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - getFamilyTreeById: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Family tree retrieved */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['FamilyTree']; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - getFamilyTreeWithSpousesById: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Family tree retrieved */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['FamilyTree']; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - getRecipesByPersonId: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Recipes retrieved */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - recipeRelations?: components['schemas']['Likes'][]; - recipes?: components['schemas']['Recipe'][]; - }; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - createRelationship: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path?: never; - cookie?: never; - }; - requestBody: { - content: { - 'application/json': { - id1?: number; - id2?: number; - /** @enum {string} */ - type?: 'child' | 'parent' | 'spouse' | 'sibling'; - relationship?: components['schemas']['FamilyRelationship']; - }; - }; - }; - responses: { - /** @description Relationships created */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['dbtypeRelationship'][]; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - getRelationship: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id1: number; - id2: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Relationship retrieved */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['Relationship']; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - deleteRelationship: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id1: number; - id2: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Relationship deleted */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - updateRelationship: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id1: number; - id2: number; - }; - cookie?: never; - }; - requestBody: { - content: { - 'application/json': { - relationship?: components['schemas']['FamilyRelationship']; - }; - }; - }; - responses: { - /** @description Relationship created */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['Relationship']; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - getProfileAdmins: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id1: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Admins retrieved */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - admins?: components['schemas']['Admin'][]; - }; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - getAdminRelationship: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id1: number; - id2: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Admin retrieved */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['AdminRelationship']; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - createAdminRelationship: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id1: number; - id2: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Admin created */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['AdminRelationship']; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - deleteAdminRelationship: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id1: number; - id2: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Admin deleted */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - getManagedProfiles: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path?: never; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Managed Profiles retrieved */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - admins?: components['schemas']['Admin'][]; - }; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - softDeleteRecipe: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Recipe soft deleted */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - updateRecipe: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id: number; - }; - cookie?: never; - }; - requestBody: { - content: { - 'application/json': components['schemas']['RecipeProperties']; - }; - }; - responses: { - /** @description Recipe updated */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['Recipe']; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - hardDeleteRecipe: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Recipe hard deleted */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - createRecipeRelationship: { - parameters: { - query?: never; - header: { - 'X-User-ID': number; - }; - path: { - id: number; - }; - cookie?: never; - }; - requestBody: { - content: { - 'application/json': { - id: number; - relationship: { - schema?: components['schemas']['LikesProperties']; - }; - }; - }; - }; - responses: { - /** @description Relationship with recipe created */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': components['schemas']['Likes']; - }; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; - deleteRecipeRelationship: { - parameters: { - query: { - personId: number; - }; - header: { - 'X-User-ID': number; - }; - path: { - id: number; - }; - cookie?: never; - }; - requestBody?: never; - responses: { - /** @description Relationship with recipe deleted */ - 200: { - headers: { - [name: string]: unknown; - }; - content?: never; - }; - /** @description Bad request */ - 400: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Unauthorized */ - 401: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - /** @description Internal server error */ - 500: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - msg?: string; - }; - }; - }; - }; - }; + healthCheck: { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Server is healthy */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Server is unhealthy */ + 503: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + createPersonAndRelationship: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + person: components["schemas"]["PersonRegistration"]; + /** @enum {string} */ + type?: "child" | "parent" | "spouse" | "sibling"; + relationship: components["schemas"]["FamilyRelationship"]; + }; + }; + }; + responses: { + /** @description Person and relationship created */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + person?: components["schemas"]["Person"]; + relationships?: components["schemas"]["Relationship"][]; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + createPerson: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["PersonRegistration"]; + }; + }; + responses: { + /** @description Person created */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Person"]; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + GetCommentsOnPerson: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Comments */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Messages"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + commentOnPerson: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["Message"]; + }; + }; + responses: { + /** @description Message updated */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Messages"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + deleteCommentOnPerson: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Deleted comment */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + editComment: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["Message"]; + }; + }; + responses: { + /** @description Comment updated */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Messages"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + getPersonById: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Person retrieved */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Person"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + softDeletePerson: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Person soft deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + updatePerson: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["PersonProperties"]; + }; + }; + responses: { + /** @description Person updated */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Person"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + hardDeletePerson: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Person hard deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + getPersonByGoogleId: { + parameters: { + query?: never; + header?: never; + path: { + google_id: string; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Person retrieved */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Person"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + createPersonByGoogleId: { + parameters: { + query?: never; + header?: never; + path: { + google_id: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["PersonRegistration"]; + }; + }; + responses: { + /** @description Person created */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Person"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + createPersonByGoogleIdAndInviteCode: { + parameters: { + query?: never; + header?: never; + path: { + google_id: string; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + invite_code: string; + person: components["schemas"]["PersonRegistration"]; + }; + }; + }; + responses: { + /** @description Person created */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Person"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + getFamilyTreeById: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Family tree retrieved */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["FamilyTree"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + getFamilyTreeWithSpousesById: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Family tree retrieved */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["FamilyTree"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + getRecipesByPersonId: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Recipes retrieved */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + recipeRelations?: components["schemas"]["Likes"][]; + recipes?: components["schemas"]["Recipe"][]; + }; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + createRelationship: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path?: never; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + id1?: number; + id2?: number; + /** @enum {string} */ + type?: "child" | "parent" | "spouse" | "sibling"; + relationship?: components["schemas"]["FamilyRelationship"]; + }; + }; + }; + responses: { + /** @description Relationships created */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["dbtypeRelationship"][]; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + getRelationship: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id1: number; + id2: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Relationship retrieved */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Relationship"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + deleteRelationship: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id1: number; + id2: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Relationship deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + updateRelationship: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id1: number; + id2: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + relationship?: components["schemas"]["FamilyRelationship"]; + }; + }; + }; + responses: { + /** @description Relationship created */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Relationship"]; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + getProfileAdmins: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id1: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Admins retrieved */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + admins?: components["schemas"]["Admin"][]; + }; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + getAdminRelationship: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id1: number; + id2: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Admin retrieved */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["AdminRelationship"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + createAdminRelationship: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id1: number; + id2: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Admin created */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["AdminRelationship"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + deleteAdminRelationship: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id1: number; + id2: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Admin deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + getManagedProfiles: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path?: never; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Managed Profiles retrieved */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + admins?: components["schemas"]["Admin"][]; + }; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + softDeleteRecipe: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Recipe soft deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + updateRecipe: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": components["schemas"]["RecipeProperties"]; + }; + }; + responses: { + /** @description Recipe updated */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Recipe"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + hardDeleteRecipe: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Recipe hard deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + createRecipeRelationship: { + parameters: { + query?: never; + header: { + "X-User-ID": number; + }; + path: { + id: number; + }; + cookie?: never; + }; + requestBody: { + content: { + "application/json": { + id: number; + relationship: { + schema?: components["schemas"]["LikesProperties"]; + }; + }; + }; + }; + responses: { + /** @description Relationship with recipe created */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": components["schemas"]["Likes"]; + }; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; + deleteRecipeRelationship: { + parameters: { + query: { + personId: number; + }; + header: { + "X-User-ID": number; + }; + path: { + id: number; + }; + cookie?: never; + }; + requestBody?: never; + responses: { + /** @description Relationship with recipe deleted */ + 200: { + headers: { + [name: string]: unknown; + }; + content?: never; + }; + /** @description Bad request */ + 400: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Unauthorized */ + 401: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + /** @description Internal server error */ + 500: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + msg?: string; + }; + }; + }; + }; + }; } diff --git a/apps/app/src/lib/graph/PersonMenu.svelte b/apps/app/src/lib/graph/PersonMenu.svelte index fb4848f..622eb74 100644 --- a/apps/app/src/lib/graph/PersonMenu.svelte +++ b/apps/app/src/lib/graph/PersonMenu.svelte @@ -7,6 +7,8 @@ add_administrator } from '$lib/paraglide/messages'; + export let id: string; + export let XUserId: string; export let top: number | undefined; export let left: number | undefined; export let right: number | undefined; @@ -18,6 +20,7 @@ export let addAdmin: (() => void) | undefined; let contextMenu: HTMLDivElement; + let isAdmin: boolean = false; onMount(() => { if (top) { contextMenu.style.top = `${top}px`; @@ -31,6 +34,16 @@ if (bottom) { contextMenu.style.bottom = `${bottom}px`; } + fetch(`/api/admin/${id}/${XUserId}` + ).then((response) => { + if(response.status === 200){ + isAdmin = true; + }else { + isAdmin = false + } + }).catch((error) => { + console.error('Error fetching admin status:', error); + }); }); @@ -51,7 +64,9 @@ - + {#if (Number(XUserId) !== Number(id)) && isAdmin} + + {/if}