From 40377416da90cdcf1c1991cccd2ec21a9b3085c1 Mon Sep 17 00:00:00 2001 From: Vargha Csongor Date: Fri, 28 Mar 2025 12:33:42 +0100 Subject: [PATCH] restructure pkg and internal --- apps/app/src/lib/api/api.gen.ts | 2710 ++++++++--------- apps/db-adapter/internal/api/person.go | 11 +- .../internal/api/person_and_relationship.go | 7 +- .../db-adapter/internal/api/person_recipes.go | 8 +- .../internal/api/recipe_relationship.go | 9 +- apps/db-adapter/internal/api/recipes.go | 11 +- apps/db-adapter/internal/api/relationship.go | 10 +- apps/db-adapter/internal/api/server.go | 3 +- .../memgraph/create_person.go | 0 .../memgraph/create_relationship.go | 0 .../create_relationship_and_person.go | 0 .../memgraph/create_schema.go | 0 .../memgraph/cypher_verify_string.go | 0 .../memgraph/delete_person.go | 0 .../memgraph/delete_relationship.go | 0 .../memgraph/init_database.go | 0 .../{pkg => internal}/memgraph/model.go | 0 .../{pkg => internal}/memgraph/model_test.go | 0 .../{pkg => internal}/memgraph/queries.go | 0 .../queries/create_constraints.cypher | 0 .../create_directed_relationship.cypher | 0 .../memgraph/queries/create_indexes.cypher | 0 .../memgraph/queries/create_person.cypher | 0 .../queries/create_relationship.cypher | 0 .../create_two_directed_relationships.cypher | 0 .../memgraph/queries/drop_constraints.cypher | 0 .../memgraph/queries/drop_indexes.cypher | 0 .../queries/get_blood_relations_by_id.cypher | 0 .../queries/get_family_tree_by_id.cypher | 0 .../get_limited_blood_relations_by_id.cypher | 0 .../queries/get_person_by_google_id.cypher | 0 .../memgraph/queries/get_person_by_id.cypher | 0 .../memgraph/queries/get_relationship.cypher | 0 .../queries/hard_delete_person_by_id.cypher | 0 .../queries/soft_delete_person_by_id.cypher | 0 .../memgraph/queries/update_person.cypher | 0 .../memgraph/update_person.go | 0 .../memgraph/verify_relationship.go | 0 apps/db-adapter/main.go | 9 +- .../{internal => pkg}/api/generate.go | 0 .../api/oapi-codegen-cfg.yaml | 0 41 files changed, 1391 insertions(+), 1387 deletions(-) rename apps/db-adapter/{pkg => internal}/memgraph/create_person.go (100%) rename apps/db-adapter/{pkg => internal}/memgraph/create_relationship.go (100%) rename apps/db-adapter/{pkg => internal}/memgraph/create_relationship_and_person.go (100%) rename apps/db-adapter/{pkg => internal}/memgraph/create_schema.go (100%) rename apps/db-adapter/{pkg => internal}/memgraph/cypher_verify_string.go (100%) rename apps/db-adapter/{pkg => internal}/memgraph/delete_person.go (100%) rename apps/db-adapter/{pkg => internal}/memgraph/delete_relationship.go (100%) rename apps/db-adapter/{pkg => internal}/memgraph/init_database.go (100%) rename apps/db-adapter/{pkg => internal}/memgraph/model.go (100%) rename apps/db-adapter/{pkg => internal}/memgraph/model_test.go (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries.go (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/create_constraints.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/create_directed_relationship.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/create_indexes.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/create_person.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/create_relationship.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/create_two_directed_relationships.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/drop_constraints.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/drop_indexes.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/get_blood_relations_by_id.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/get_family_tree_by_id.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/get_limited_blood_relations_by_id.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/get_person_by_google_id.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/get_person_by_id.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/get_relationship.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/hard_delete_person_by_id.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/soft_delete_person_by_id.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/queries/update_person.cypher (100%) rename apps/db-adapter/{pkg => internal}/memgraph/update_person.go (100%) rename apps/db-adapter/{pkg => internal}/memgraph/verify_relationship.go (100%) rename apps/db-adapter/{internal => pkg}/api/generate.go (100%) rename apps/db-adapter/{internal => pkg}/api/oapi-codegen-cfg.yaml (100%) diff --git a/apps/app/src/lib/api/api.gen.ts b/apps/app/src/lib/api/api.gen.ts index eccde19..f691849 100644 --- a/apps/app/src/lib/api/api.gen.ts +++ b/apps/app/src/lib/api/api.gen.ts @@ -4,1375 +4,1355 @@ */ 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; - }; - '/person/{id}': { - parameters: { - query?: never; - header?: never; - path?: never; - cookie?: never; - }; - get?: never; - 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; - }; - '/person/{id}/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; - }; - '/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 relationship between two persons */ - get: operations['getRelationship']; - 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/{recipeId}/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; + }; + "/person/{id}": { + parameters: { + query?: never; + header?: never; + path?: never; + cookie?: never; + }; + get?: never; + 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; + }; + "/person/{id}/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; + }; + "/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 relationship between two persons */ + get: operations["getRelationship"]; + 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/{recipeId}/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: { - allow_admin_access?: - | { - id?: number; - name?: string; - }[] - | null; - 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; - /** 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; - others_said?: - | { - id?: number; - name?: string; - relationship?: string; - description?: string; - url?: string | null; - }[] - | 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; - /** Format: date */ - born: string; - mothers_first_name: string; - mothers_last_name: string; - }; - Person: { - id?: number; - labels?: string[]; - type?: string | null; - properties?: components['schemas']['PersonProperties']; - }; - FamilyRelationship: { - verified?: boolean | null; - notes?: string | null; - /** Format: date */ - from?: string | null; - /** Format: date */ - to?: string | null; - }; - Relationship: { - id?: number; - label?: string; - type?: string | null; - start?: number; - end?: number; - properties?: 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; - }; - FamilyTree: { - ancestors?: components['schemas']['OptimizedPersonNode'][]; - prel1?: components['schemas']['Relationship']; - children?: components['schemas']['OptimizedPersonNode'][]; - prel2?: components['schemas']['Relationship']; - spouses?: string; - srel?: components['schemas']['Relationship']; - user?: string; - }; - 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; - labels?: string[]; - properties?: components['schemas']['RecipeProperties']; - }; - Likes: { - id?: number; - label?: string; - start?: string; - end?: string; - properties?: components['schemas']['LikesProperties']; - }; - LikesProperties: { - favourite?: boolean | null; - like_it?: boolean | null; - could_make_it?: boolean | null; - }; - }; - responses: never; - parameters: never; - requestBodies: never; - headers: never; - pathItems: never; + schemas: { + PersonProperties: { + allow_admin_access?: { + id?: number; + name?: string; + }[] | null; + 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; + /** 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; + others_said?: { + id?: number; + name?: string; + relationship?: string; + description?: string; + url?: string | null; + }[] | 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; + /** Format: date */ + born: string; + mothers_first_name: string; + mothers_last_name: string; + }; + Person: { + id?: number; + labels?: string[]; + type?: string | null; + properties?: components["schemas"]["PersonProperties"]; + }; + FamilyRelationship: { + verified?: boolean | null; + notes?: string | null; + /** Format: date */ + from?: string | null; + /** Format: date */ + to?: string | null; + }; + Relationship: { + id?: number; + label?: string; + type?: string | null; + start?: number; + end?: number; + properties?: 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; + }; + FamilyTree: { + ancestors?: components["schemas"]["OptimizedPersonNode"][]; + prel1?: components["schemas"]["Relationship"]; + children?: components["schemas"]["OptimizedPersonNode"][]; + prel2?: components["schemas"]["Relationship"]; + spouses?: string; + srel?: components["schemas"]["Relationship"]; + user?: string; + }; + 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; + labels?: string[]; + properties?: components["schemas"]["RecipeProperties"]; + }; + Likes: { + id?: number; + label?: string; + start?: string; + end?: string; + properties?: components["schemas"]["LikesProperties"]; + }; + LikesProperties: { + favourite?: boolean | null; + like_it?: boolean | null; + could_make_it?: boolean | null; + }; + }; + 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']; - relationship: components['schemas']['FamilyRelationship']; - }; - }; - }; - responses: { - /** @description Person and relationship created */ - 200: { - headers: { - [name: string]: unknown; - }; - content: { - 'application/json': { - person?: components['schemas']['Person']; - relationship?: 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?: never; - 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 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; - }; - }; - }; - }; - }; - 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; - }; - }; - }; - }; - }; - 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; - }; - }; - }; - }; - }; - 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?: never; - path: { - id: number; - }; - 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?: string; - id2?: string; - 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; - }; - }; - }; - }; - }; - 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; - }; - }; - }; - }; - }; - 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: { - recipeId: 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: { - recipeId: 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"]; + relationship: components["schemas"]["FamilyRelationship"]; + }; + }; + }; + responses: { + /** @description Person and relationship created */ + 200: { + headers: { + [name: string]: unknown; + }; + content: { + "application/json": { + person?: components["schemas"]["Person"]; + relationship?: 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?: never; + 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 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; + }; + }; + }; + }; + }; + 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; + }; + }; + }; + }; + }; + 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; + }; + }; + }; + }; + }; + 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?: never; + path: { + id: number; + }; + 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?: string; + id2?: string; + 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; + }; + }; + }; + }; + }; + 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; + }; + }; + }; + }; + }; + 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: { + recipeId: 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: { + recipeId: 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/db-adapter/internal/api/person.go b/apps/db-adapter/internal/api/person.go index 7c52956..5317576 100644 --- a/apps/db-adapter/internal/api/person.go +++ b/apps/db-adapter/internal/api/person.go @@ -1,11 +1,14 @@ package api -import "github.com/gin-gonic/gin" +import ( + "github.com/gin-gonic/gin" + "github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter/pkg/api" +) func (srv *server) CreatePerson(c *gin.Context) {} -func (srv *server) SoftDeletePerson(c *gin.Context, id int, params SoftDeletePersonParams) {} +func (srv *server) SoftDeletePerson(c *gin.Context, id int, params api.SoftDeletePersonParams) {} -func (srv *server) UpdatePerson(c *gin.Context, id int, params UpdatePersonParams) {} +func (srv *server) UpdatePerson(c *gin.Context, id int, params api.UpdatePersonParams) {} -func (srv *server) HardDeletePerson(c *gin.Context, id int, params HardDeletePersonParams) {} +func (srv *server) HardDeletePerson(c *gin.Context, id int, params api.HardDeletePersonParams) {} diff --git a/apps/db-adapter/internal/api/person_and_relationship.go b/apps/db-adapter/internal/api/person_and_relationship.go index d44229d..ee3d625 100644 --- a/apps/db-adapter/internal/api/person_and_relationship.go +++ b/apps/db-adapter/internal/api/person_and_relationship.go @@ -1,6 +1,9 @@ package api -import "github.com/gin-gonic/gin" +import ( + "github.com/gin-gonic/gin" + "github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter/pkg/api" +) -func (srv *server) CreatePersonAndRelationship(c *gin.Context, id int, params CreatePersonAndRelationshipParams) { +func (srv *server) CreatePersonAndRelationship(c *gin.Context, id int, params api.CreatePersonAndRelationshipParams) { } diff --git a/apps/db-adapter/internal/api/person_recipes.go b/apps/db-adapter/internal/api/person_recipes.go index 4ceb0f6..b3faa11 100644 --- a/apps/db-adapter/internal/api/person_recipes.go +++ b/apps/db-adapter/internal/api/person_recipes.go @@ -1,5 +1,9 @@ package api -import "github.com/gin-gonic/gin" +import ( + "github.com/gin-gonic/gin" + "github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter/pkg/api" +) -func (srv *server) GetRecipesByPersonId(c *gin.Context, id int, params GetRecipesByPersonIdParams) {} +func (srv *server) GetRecipesByPersonId(c *gin.Context, id int, params api.GetRecipesByPersonIdParams) { +} diff --git a/apps/db-adapter/internal/api/recipe_relationship.go b/apps/db-adapter/internal/api/recipe_relationship.go index a0e8813..efa9623 100644 --- a/apps/db-adapter/internal/api/recipe_relationship.go +++ b/apps/db-adapter/internal/api/recipe_relationship.go @@ -1,9 +1,12 @@ package api -import "github.com/gin-gonic/gin" +import ( + "github.com/gin-gonic/gin" + "github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter/pkg/api" +) -func (srv *server) DeleteRecipeRelationship(c *gin.Context, recipeId int, params DeleteRecipeRelationshipParams) { +func (srv *server) DeleteRecipeRelationship(c *gin.Context, recipeId int, params api.DeleteRecipeRelationshipParams) { } -func (srv *server) CreateRecipeRelationship(c *gin.Context, recipeId int, params CreateRecipeRelationshipParams) { +func (srv *server) CreateRecipeRelationship(c *gin.Context, recipeId int, params api.CreateRecipeRelationshipParams) { } diff --git a/apps/db-adapter/internal/api/recipes.go b/apps/db-adapter/internal/api/recipes.go index 4f0cb07..a771877 100644 --- a/apps/db-adapter/internal/api/recipes.go +++ b/apps/db-adapter/internal/api/recipes.go @@ -1,9 +1,12 @@ package api -import "github.com/gin-gonic/gin" +import ( + "github.com/gin-gonic/gin" + "github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter/pkg/api" +) -func (srv *server) SoftDeleteRecipe(c *gin.Context, id int, params SoftDeleteRecipeParams) {} +func (srv *server) SoftDeleteRecipe(c *gin.Context, id int, params api.SoftDeleteRecipeParams) {} -func (srv *server) UpdateRecipe(c *gin.Context, id int, params UpdateRecipeParams) {} +func (srv *server) UpdateRecipe(c *gin.Context, id int, params api.UpdateRecipeParams) {} -func (srv *server) HardDeleteRecipe(c *gin.Context, id int, params HardDeleteRecipeParams) {} +func (srv *server) HardDeleteRecipe(c *gin.Context, id int, params api.HardDeleteRecipeParams) {} diff --git a/apps/db-adapter/internal/api/relationship.go b/apps/db-adapter/internal/api/relationship.go index 12579c6..45082f2 100644 --- a/apps/db-adapter/internal/api/relationship.go +++ b/apps/db-adapter/internal/api/relationship.go @@ -1,7 +1,11 @@ package api -import "github.com/gin-gonic/gin" +import ( + "github.com/gin-gonic/gin" + "github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter/pkg/api" +) -func (srv *server) CreateRelationship(c *gin.Context, params CreateRelationshipParams) {} +func (srv *server) CreateRelationship(c *gin.Context, params api.CreateRelationshipParams) {} -func (srv *server) GetRelationship(c *gin.Context, id1 int, id2 int, params GetRelationshipParams) {} +func (srv *server) GetRelationship(c *gin.Context, id1 int, id2 int, params api.GetRelationshipParams) { +} diff --git a/apps/db-adapter/internal/api/server.go b/apps/db-adapter/internal/api/server.go index ecc3c7b..40bbbe8 100644 --- a/apps/db-adapter/internal/api/server.go +++ b/apps/db-adapter/internal/api/server.go @@ -5,6 +5,7 @@ import ( "github.com/gin-gonic/gin" "github.com/neo4j/neo4j-go-driver/v5/neo4j" + "github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter/pkg/api" "github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter/pkg/gin/healthcheck" "go.uber.org/zap" ) @@ -16,7 +17,7 @@ type server struct { logger *zap.Logger } -func New(logger *zap.Logger, drv neo4j.DriverWithContext, healthcheck healthcheck.HealthCheck, databaseOperationTimeoutInMs time.Duration) ServerInterface { +func New(logger *zap.Logger, drv neo4j.DriverWithContext, healthcheck healthcheck.HealthCheck, databaseOperationTimeoutInMs time.Duration) api.ServerInterface { if logger == nil { panic("logger is required") } diff --git a/apps/db-adapter/pkg/memgraph/create_person.go b/apps/db-adapter/internal/memgraph/create_person.go similarity index 100% rename from apps/db-adapter/pkg/memgraph/create_person.go rename to apps/db-adapter/internal/memgraph/create_person.go diff --git a/apps/db-adapter/pkg/memgraph/create_relationship.go b/apps/db-adapter/internal/memgraph/create_relationship.go similarity index 100% rename from apps/db-adapter/pkg/memgraph/create_relationship.go rename to apps/db-adapter/internal/memgraph/create_relationship.go diff --git a/apps/db-adapter/pkg/memgraph/create_relationship_and_person.go b/apps/db-adapter/internal/memgraph/create_relationship_and_person.go similarity index 100% rename from apps/db-adapter/pkg/memgraph/create_relationship_and_person.go rename to apps/db-adapter/internal/memgraph/create_relationship_and_person.go diff --git a/apps/db-adapter/pkg/memgraph/create_schema.go b/apps/db-adapter/internal/memgraph/create_schema.go similarity index 100% rename from apps/db-adapter/pkg/memgraph/create_schema.go rename to apps/db-adapter/internal/memgraph/create_schema.go diff --git a/apps/db-adapter/pkg/memgraph/cypher_verify_string.go b/apps/db-adapter/internal/memgraph/cypher_verify_string.go similarity index 100% rename from apps/db-adapter/pkg/memgraph/cypher_verify_string.go rename to apps/db-adapter/internal/memgraph/cypher_verify_string.go diff --git a/apps/db-adapter/pkg/memgraph/delete_person.go b/apps/db-adapter/internal/memgraph/delete_person.go similarity index 100% rename from apps/db-adapter/pkg/memgraph/delete_person.go rename to apps/db-adapter/internal/memgraph/delete_person.go diff --git a/apps/db-adapter/pkg/memgraph/delete_relationship.go b/apps/db-adapter/internal/memgraph/delete_relationship.go similarity index 100% rename from apps/db-adapter/pkg/memgraph/delete_relationship.go rename to apps/db-adapter/internal/memgraph/delete_relationship.go diff --git a/apps/db-adapter/pkg/memgraph/init_database.go b/apps/db-adapter/internal/memgraph/init_database.go similarity index 100% rename from apps/db-adapter/pkg/memgraph/init_database.go rename to apps/db-adapter/internal/memgraph/init_database.go diff --git a/apps/db-adapter/pkg/memgraph/model.go b/apps/db-adapter/internal/memgraph/model.go similarity index 100% rename from apps/db-adapter/pkg/memgraph/model.go rename to apps/db-adapter/internal/memgraph/model.go diff --git a/apps/db-adapter/pkg/memgraph/model_test.go b/apps/db-adapter/internal/memgraph/model_test.go similarity index 100% rename from apps/db-adapter/pkg/memgraph/model_test.go rename to apps/db-adapter/internal/memgraph/model_test.go diff --git a/apps/db-adapter/pkg/memgraph/queries.go b/apps/db-adapter/internal/memgraph/queries.go similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries.go rename to apps/db-adapter/internal/memgraph/queries.go diff --git a/apps/db-adapter/pkg/memgraph/queries/create_constraints.cypher b/apps/db-adapter/internal/memgraph/queries/create_constraints.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/create_constraints.cypher rename to apps/db-adapter/internal/memgraph/queries/create_constraints.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/create_directed_relationship.cypher b/apps/db-adapter/internal/memgraph/queries/create_directed_relationship.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/create_directed_relationship.cypher rename to apps/db-adapter/internal/memgraph/queries/create_directed_relationship.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/create_indexes.cypher b/apps/db-adapter/internal/memgraph/queries/create_indexes.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/create_indexes.cypher rename to apps/db-adapter/internal/memgraph/queries/create_indexes.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/create_person.cypher b/apps/db-adapter/internal/memgraph/queries/create_person.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/create_person.cypher rename to apps/db-adapter/internal/memgraph/queries/create_person.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/create_relationship.cypher b/apps/db-adapter/internal/memgraph/queries/create_relationship.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/create_relationship.cypher rename to apps/db-adapter/internal/memgraph/queries/create_relationship.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/create_two_directed_relationships.cypher b/apps/db-adapter/internal/memgraph/queries/create_two_directed_relationships.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/create_two_directed_relationships.cypher rename to apps/db-adapter/internal/memgraph/queries/create_two_directed_relationships.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/drop_constraints.cypher b/apps/db-adapter/internal/memgraph/queries/drop_constraints.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/drop_constraints.cypher rename to apps/db-adapter/internal/memgraph/queries/drop_constraints.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/drop_indexes.cypher b/apps/db-adapter/internal/memgraph/queries/drop_indexes.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/drop_indexes.cypher rename to apps/db-adapter/internal/memgraph/queries/drop_indexes.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/get_blood_relations_by_id.cypher b/apps/db-adapter/internal/memgraph/queries/get_blood_relations_by_id.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/get_blood_relations_by_id.cypher rename to apps/db-adapter/internal/memgraph/queries/get_blood_relations_by_id.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/get_family_tree_by_id.cypher b/apps/db-adapter/internal/memgraph/queries/get_family_tree_by_id.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/get_family_tree_by_id.cypher rename to apps/db-adapter/internal/memgraph/queries/get_family_tree_by_id.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/get_limited_blood_relations_by_id.cypher b/apps/db-adapter/internal/memgraph/queries/get_limited_blood_relations_by_id.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/get_limited_blood_relations_by_id.cypher rename to apps/db-adapter/internal/memgraph/queries/get_limited_blood_relations_by_id.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/get_person_by_google_id.cypher b/apps/db-adapter/internal/memgraph/queries/get_person_by_google_id.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/get_person_by_google_id.cypher rename to apps/db-adapter/internal/memgraph/queries/get_person_by_google_id.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/get_person_by_id.cypher b/apps/db-adapter/internal/memgraph/queries/get_person_by_id.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/get_person_by_id.cypher rename to apps/db-adapter/internal/memgraph/queries/get_person_by_id.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/get_relationship.cypher b/apps/db-adapter/internal/memgraph/queries/get_relationship.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/get_relationship.cypher rename to apps/db-adapter/internal/memgraph/queries/get_relationship.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/hard_delete_person_by_id.cypher b/apps/db-adapter/internal/memgraph/queries/hard_delete_person_by_id.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/hard_delete_person_by_id.cypher rename to apps/db-adapter/internal/memgraph/queries/hard_delete_person_by_id.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/soft_delete_person_by_id.cypher b/apps/db-adapter/internal/memgraph/queries/soft_delete_person_by_id.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/soft_delete_person_by_id.cypher rename to apps/db-adapter/internal/memgraph/queries/soft_delete_person_by_id.cypher diff --git a/apps/db-adapter/pkg/memgraph/queries/update_person.cypher b/apps/db-adapter/internal/memgraph/queries/update_person.cypher similarity index 100% rename from apps/db-adapter/pkg/memgraph/queries/update_person.cypher rename to apps/db-adapter/internal/memgraph/queries/update_person.cypher diff --git a/apps/db-adapter/pkg/memgraph/update_person.go b/apps/db-adapter/internal/memgraph/update_person.go similarity index 100% rename from apps/db-adapter/pkg/memgraph/update_person.go rename to apps/db-adapter/internal/memgraph/update_person.go diff --git a/apps/db-adapter/pkg/memgraph/verify_relationship.go b/apps/db-adapter/internal/memgraph/verify_relationship.go similarity index 100% rename from apps/db-adapter/pkg/memgraph/verify_relationship.go rename to apps/db-adapter/internal/memgraph/verify_relationship.go diff --git a/apps/db-adapter/main.go b/apps/db-adapter/main.go index 90e933e..aeff46b 100644 --- a/apps/db-adapter/main.go +++ b/apps/db-adapter/main.go @@ -12,9 +12,10 @@ import ( "github.com/gin-contrib/cors" ginzap "github.com/gin-contrib/zap" "github.com/gin-gonic/gin" - "github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter/internal/api" + apiServer "github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter/internal/api" + "github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter/internal/memgraph" + "github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter/pkg/api" "github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter/pkg/gin/healthcheck" - "github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter/pkg/memgraph" "github.com/spf13/viper" "go.uber.org/zap" @@ -27,6 +28,7 @@ var ( memgraphPass string production bool requestTimeout time.Duration + dbOpTimeout time.Duration ) func init() { @@ -46,6 +48,7 @@ func init() { memgraphPass = viper.GetString("MEMGRAPH_PASS") production = viper.GetBool("PRODUCTION") requestTimeout = time.Duration(viper.GetInt("REQUEST_TIMEOUT")) * time.Second + dbOpTimeout = time.Duration(viper.GetInt("DB_OP_TIMEOUT")) * time.Millisecond } func main() { @@ -76,7 +79,7 @@ func main() { router.Use(ginzap.Ginzap(logger, time.RFC3339, true)) router.Use(ginzap.RecoveryWithZap(logger, true)) - sApi := api.New(logger, memgraphDriver, hc) + sApi := apiServer.New(logger, memgraphDriver, hc, dbOpTimeout) api.RegisterHandlersWithOptions(router, sApi, api.GinServerOptions{}) server := &http.Server{ diff --git a/apps/db-adapter/internal/api/generate.go b/apps/db-adapter/pkg/api/generate.go similarity index 100% rename from apps/db-adapter/internal/api/generate.go rename to apps/db-adapter/pkg/api/generate.go diff --git a/apps/db-adapter/internal/api/oapi-codegen-cfg.yaml b/apps/db-adapter/pkg/api/oapi-codegen-cfg.yaml similarity index 100% rename from apps/db-adapter/internal/api/oapi-codegen-cfg.yaml rename to apps/db-adapter/pkg/api/oapi-codegen-cfg.yaml