Add rest api (#2757)

* Add a wildcard get route

* Call api from api

* Add a query formatter

* Use headers to authenticate

* Handle findMany query

* Add limit, orderBy and lastCursor parameters

* Add filter parameters

* Remove singular object name from valid requests

* Update order_by format

* Add depth parameter

* Make /api/objects/ID requests work

* Fix filter

* Add INTERNAL_SERVER_URL env variable

* Remove useless comment

* Change bath api url to 'rest'

* Fix limit parser

* Handle full filter version

* Improve handle full filter version

* Continue rest api

* Add and(...) default behaviour on filters

* Add tests

* Handle 'not' conjunction for filters

* Check filter query

* Format values with field metadata item type

* Handle nested filtering

* Update parsing method

* Check nested fields

* Add delete query

* Add create query

* Rename methods

* Add update query

* Update get one object request

* Fix error handling

* Code review returns
This commit is contained in:
martmull
2023-12-01 16:26:39 +01:00
committed by GitHub
parent f405b77cea
commit 97f154ef2c
9 changed files with 872 additions and 1 deletions

View File

@ -50,6 +50,10 @@ export class EnvironmentService {
return this.configService.get<string>('FRONT_BASE_URL')!;
}
getLocalServerUrl(): string {
return this.configService.get<string>('LOCAL_SERVER_URL')!;
}
getAccessTokenSecret(): string {
return this.configService.get<string>('ACCESS_TOKEN_SECRET')!;
}

View File

@ -59,6 +59,10 @@ export class EnvironmentVariables {
@IsUrl({ require_tld: false })
FRONT_BASE_URL: string;
// Server internal URL
@IsUrl({ require_tld: false })
LOCAL_SERVER_URL: string;
// Json Web Token
@IsString()
ACCESS_TOKEN_SECRET: string;