mirror of
https://github.com/vcscsvcscs/GenerationsHeritage.git
synced 2025-08-12 22:09:07 +02:00
update api
This commit is contained in:
810
api/openapi.json
810
api/openapi.json
File diff suppressed because it is too large
Load Diff
@@ -1,6 +1,4 @@
|
||||
GOOGLE_CLIENT_ID=""
|
||||
GOOGLE_CLIENT_SECRET=""
|
||||
GOOGLE_CALLBACK_URI="http://localhost:5173/login/google/callback"
|
||||
MEMGRAPH_URI="bolt://localhost:7687"
|
||||
MEMGRAPH_USER="memgraph"
|
||||
MEMGRAPH_PASSWORD="memgraph"
|
||||
DB_ADAPTER=""
|
@@ -473,6 +473,17 @@ export interface operations {
|
||||
"application/json": components["schemas"]["Person"];
|
||||
};
|
||||
};
|
||||
/** @description Bad request */
|
||||
400: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": {
|
||||
msg?: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
softDeletePerson: {
|
||||
@@ -493,6 +504,17 @@ export interface operations {
|
||||
};
|
||||
content?: never;
|
||||
};
|
||||
/** @description Bad request */
|
||||
400: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": {
|
||||
msg?: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
hardDeletePerson: {
|
||||
@@ -513,6 +535,17 @@ export interface operations {
|
||||
};
|
||||
content?: never;
|
||||
};
|
||||
/** @description Bad request */
|
||||
400: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": {
|
||||
msg?: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
getPersonByGoogleId: {
|
||||
@@ -535,6 +568,17 @@ export interface operations {
|
||||
"application/json": components["schemas"]["Person"];
|
||||
};
|
||||
};
|
||||
/** @description Bad request */
|
||||
400: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": {
|
||||
msg?: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
createPersonByGoogleId: {
|
||||
@@ -561,6 +605,17 @@ export interface operations {
|
||||
"application/json": components["schemas"]["Person"];
|
||||
};
|
||||
};
|
||||
/** @description Bad request */
|
||||
400: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": {
|
||||
msg?: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
getFamilyTreeById: {
|
||||
@@ -583,6 +638,17 @@ export interface operations {
|
||||
"application/json": components["schemas"]["FamilyTree"];
|
||||
};
|
||||
};
|
||||
/** @description Bad request */
|
||||
400: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": {
|
||||
msg?: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
createRelationship: {
|
||||
@@ -634,6 +700,17 @@ export interface operations {
|
||||
"application/json": components["schemas"]["Relationship"];
|
||||
};
|
||||
};
|
||||
/** @description Bad request */
|
||||
400: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": {
|
||||
msg?: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
updateRecipe: {
|
||||
@@ -660,6 +737,17 @@ export interface operations {
|
||||
"application/json": components["schemas"]["Recipe"];
|
||||
};
|
||||
};
|
||||
/** @description Bad request */
|
||||
400: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": {
|
||||
msg?: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
softDeleteRecipe: {
|
||||
@@ -680,6 +768,17 @@ export interface operations {
|
||||
};
|
||||
content?: never;
|
||||
};
|
||||
/** @description Bad request */
|
||||
400: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": {
|
||||
msg?: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
hardDeleteRecipe: {
|
||||
@@ -700,6 +799,17 @@ export interface operations {
|
||||
};
|
||||
content?: never;
|
||||
};
|
||||
/** @description Bad request */
|
||||
400: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": {
|
||||
msg?: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
createRecipeRelationship: {
|
||||
@@ -731,6 +841,17 @@ export interface operations {
|
||||
"application/json": components["schemas"]["Likes"];
|
||||
};
|
||||
};
|
||||
/** @description Bad request */
|
||||
400: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": {
|
||||
msg?: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
deleteRecipeRelationship: {
|
||||
@@ -753,6 +874,17 @@ export interface operations {
|
||||
};
|
||||
content?: never;
|
||||
};
|
||||
/** @description Bad request */
|
||||
400: {
|
||||
headers: {
|
||||
[name: string]: unknown;
|
||||
};
|
||||
content: {
|
||||
"application/json": {
|
||||
msg?: string;
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
};
|
||||
}
|
||||
|
0
apps/app/src/lib/server/db-handler/person.ts
Normal file
0
apps/app/src/lib/server/db-handler/person.ts
Normal file
0
apps/app/src/lib/server/db-handler/recipe.ts
Normal file
0
apps/app/src/lib/server/db-handler/recipe.ts
Normal file
@@ -1,11 +0,0 @@
|
||||
import memgraph from 'neo4j-driver';
|
||||
import type { Driver } from 'neo4j-driver';
|
||||
import { MEMGRAPH_URI, MEMGRAPH_USER, MEMGRAPH_PASSWORD } from '$env/static/private';
|
||||
|
||||
export const DB: Driver = memgraph.driver(
|
||||
MEMGRAPH_URI || 'bolt://localhost:7687',
|
||||
memgraph.auth.basic(
|
||||
MEMGRAPH_USER || 'memgraph',
|
||||
MEMGRAPH_PASSWORD || 'memgraph'
|
||||
)
|
||||
);
|
@@ -1,23 +0,0 @@
|
||||
import type { Session, QueryResult } from 'neo4j-driver';
|
||||
import type { Person, PersonProperties } from '$lib/model';
|
||||
import CreatePersonQuery from '$lib/server/queries/create_person.cypher?raw';
|
||||
import UpdatePersonQuery from '$lib/server/queries/update_person.cypher?raw';
|
||||
import GetPersonByGoogleID from '$lib/server/queries/get_person_by_google_id.cypher?raw';
|
||||
|
||||
export function createUser(db: Session, Person: PersonProperties): Promise<QueryResult<Person>> {
|
||||
return db.executeWrite(tx => tx.run<Person>(
|
||||
CreatePersonQuery, { props: Person })
|
||||
);
|
||||
}
|
||||
|
||||
export function updateUser(db: Session, Person: PersonProperties): Promise<QueryResult<Person>> {
|
||||
return db.executeWrite(tx => tx.run<Person>(
|
||||
UpdatePersonQuery, { props: Person })
|
||||
);
|
||||
}
|
||||
|
||||
export function getUserFromGoogleId(db: Session, googleID: string): Promise<QueryResult<Person>> {
|
||||
return db.executeRead(tx => tx.run<Person>(
|
||||
GetPersonByGoogleID, { google_id: googleID })
|
||||
);
|
||||
}
|
3
apps/db-handler/.env.example
Normal file
3
apps/db-handler/.env.example
Normal file
@@ -0,0 +1,3 @@
|
||||
MEMGRAPH_URI="bolt://localhost:7687"
|
||||
MEMGRAPH_USER="memgraph"
|
||||
MEMGRAPH_PASSWORD="memgraph"
|
@@ -1,4 +1,4 @@
|
||||
module github.com/vcscsvcscs/GenerationsHeritage/apps/db-handler
|
||||
module github.com/vcscsvcscs/GenerationsHeritage/apps/db-adapter
|
||||
|
||||
go 1.24
|
||||
|
||||
|
Reference in New Issue
Block a user