Skip to content

Commit

Permalink
Pose query retrieval (#127)
Browse files Browse the repository at this point in the history
Co-authored-by: Ralph Gasser <[email protected]>
Co-authored-by: silvanheller <[email protected]>
Co-authored-by: Luca Rossetto <[email protected]>
  • Loading branch information
4 people authored Apr 26, 2022
1 parent ebaa5d8 commit 7b7e0be
Show file tree
Hide file tree
Showing 87 changed files with 11,467 additions and 4,557 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ src/app/core/openapi/**

# IDEs and editors
/.idea
.angular
.project
.classpath
.c9/
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,13 @@ Run `ng build` to build the project. The build artifacts will be stored in the `
Note: this section is only relevant if you've made changes to the Cineast API and need to udpate the OpenAPI bindings.

In order to update / generate the OpenApi stubs and data model, run the following command while [Cineast](https://github.com/vitrivr/cineast) is running and
having the OpenApi serving enabled (config option `"enableLiveDoc": "true"` )
having the OpenApi serving enabled (config option `"enableRestLiveDoc": "true"` )

`npm run gen-api`
`npm run gen-local-api`

This is an alias for the full-fledged command:

`openapi-generator generate -g typescript-angular -i http://localhost:4567/openapi-specs -o openapi/cineast --skip-validate-spec --additional-properties npmName=@cineast-openapi/api,snapshot=true,ngVersion=11.0.7`
`openapi-generator-cli generate -g typescript-angular -i http://localhost:4567/openapi-specs -o openapi/cineast --skip-validate-spec --additional-properties npmName=@cineast-openapi/api,snapshot=true,ngVersion=13.0.0`

The assumption for this snippet is, that the Cineast is running on localhost using port 4567. Adjust according to your needs.

Expand Down
124 changes: 65 additions & 59 deletions openapi/cineast/.openapi-generator/FILES
Original file line number Diff line number Diff line change
@@ -1,59 +1,65 @@
.gitignore
README.md
api.module.ts
api\api.ts
api\default.service.ts
api\metadata.service.ts
api\misc.service.ts
api\object.service.ts
api\segment.service.ts
api\segments.service.ts
api\session.service.ts
api\status.service.ts
api\tag.service.ts
configuration.ts
encoder.ts
git_push.sh
index.ts
model\abstractMetadataFilterDescriptor.ts
model\columnSpecification.ts
model\credentials.ts
model\distinctElementsResult.ts
model\extractionContainerMessage.ts
model\extractionItemContainer.ts
model\featuresAllCategoriesQueryResult.ts
model\featuresByCategoryQueryResult.ts
model\featuresByEntityQueryResult.ts
model\featuresTextCategoryQueryResult.ts
model\idList.ts
model\mediaObjectDescriptor.ts
model\mediaObjectMetadataDescriptor.ts
model\mediaObjectMetadataQueryResult.ts
model\mediaObjectQueryResult.ts
model\mediaSegmentDescriptor.ts
model\mediaSegmentMetadataDescriptor.ts
model\mediaSegmentMetadataQueryResult.ts
model\mediaSegmentQueryResult.ts
model\metadataDomainFilter.ts
model\metadataKeyFilter.ts
model\optionallyFilteredIdList.ts
model\ping.ts
model\queryComponent.ts
model\queryConfig.ts
model\queryTerm.ts
model\selectResult.ts
model\selectSpecification.ts
model\sessionState.ts
model\similarityQuery.ts
model\similarityQueryResult.ts
model\similarityQueryResultBatch.ts
model\startSessionMessage.ts
model\stringDoublePair.ts
model\tag.ts
model\tagIDsForElementQueryResult.ts
model\tagsQueryResult.ts
model\models.ts
ng-package.json
package.json
tsconfig.json
variables.ts
.gitignore
README.md
api.module.ts
api/api.ts
api/default.service.ts
api/metadata.service.ts
api/misc.service.ts
api/object.service.ts
api/segment.service.ts
api/segments.service.ts
api/session.service.ts
api/status.service.ts
api/tag.service.ts
configuration.ts
encoder.ts
git_push.sh
index.ts
model/abstractMetadataFilterDescriptor.ts
model/columnSpecification.ts
model/credentials.ts
model/distinctElementsResult.ts
model/extractionContainerMessage.ts
model/extractionItemContainer.ts
model/featuresAllCategoriesQueryResult.ts
model/featuresByCategoryQueryResult.ts
model/featuresByEntityQueryResult.ts
model/featuresTextCategoryQueryResult.ts
model/idList.ts
model/mediaObjectDescriptor.ts
model/mediaObjectMetadataDescriptor.ts
model/mediaObjectMetadataQueryResult.ts
model/mediaObjectQueryResult.ts
model/mediaSegmentDescriptor.ts
model/mediaSegmentMetadataDescriptor.ts
model/mediaSegmentMetadataQueryResult.ts
model/mediaSegmentQueryResult.ts
model/metadataAccessSpecification.ts
model/metadataDomainFilter.ts
model/metadataKeyFilter.ts
model/models.ts
model/optionallyFilteredIdList.ts
model/ping.ts
model/queryConfig.ts
model/queryStage.ts
model/queryTerm.ts
model/selectResult.ts
model/selectSpecification.ts
model/sessionState.ts
model/similarityQuery.ts
model/similarityQueryResult.ts
model/similarityQueryResultBatch.ts
model/stagedSimilarityQuery.ts
model/startSessionMessage.ts
model/stringDoublePair.ts
model/tag.ts
model/tagIDsForElementQueryResult.ts
model/tagsQueryResult.ts
model/temporalObject.ts
model/temporalQuery.ts
model/temporalQueryConfig.ts
model/temporalQueryResult.ts
ng-package.json
package.json
tsconfig.json
variables.ts
2 changes: 1 addition & 1 deletion openapi/cineast/.openapi-generator/VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
5.0.0-beta
5.4.0
12 changes: 6 additions & 6 deletions openapi/cineast/README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## @cineast-openapi/api@v1-SNAPSHOT.202111151700
## @cineast-openapi/api@v1-SNAPSHOT.202204250811

### Building

Expand All @@ -19,7 +19,7 @@ Navigate to the folder of your consuming project and run one of next commands.
_published:_

```
npm install @cineast-openapi/api@v1-SNAPSHOT.202111151700 --save
npm install @cineast-openapi/api@v1-SNAPSHOT.202204250811 --save
```

_without publishing (not recommended):_
Expand Down Expand Up @@ -75,7 +75,7 @@ export class AppModule {}
// configuring providers
import { ApiModule, Configuration, ConfigurationParameters } from '@cineast-openapi/api';
export function apiConfigFactory (): Configuration => {
export function apiConfigFactory (): Configuration {
const params: ConfigurationParameters = {
// set configuration parameters here.
}
Expand Down Expand Up @@ -120,7 +120,7 @@ export class AppModule {}
import { DefaultApi } from '@cineast-openapi/api';
export class AppComponent {
constructor(private apiGateway: DefaultApi) { }
constructor(private apiGateway: DefaultApi) { }
}
```

Expand Down Expand Up @@ -152,7 +152,7 @@ export class AppModule {


### Set service base path
If different than the generated base path, during app bootstrap, you can provide the base path to your service.
If different than the generated base path, during app bootstrap, you can provide the base path to your service.

```
import { BASE_PATH } from '@cineast-openapi/api';
Expand Down Expand Up @@ -200,4 +200,4 @@ import { environment } from '../environments/environment';
bootstrap: [ AppComponent ]
})
export class AppModule { }
```
```
88 changes: 57 additions & 31 deletions openapi/cineast/api/default.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,13 @@

import { Inject, Injectable, Optional } from '@angular/core';
import { HttpClient, HttpHeaders, HttpParams,
HttpResponse, HttpEvent, HttpParameterCodec } from '@angular/common/http';
HttpResponse, HttpEvent, HttpParameterCodec, HttpContext
} from '@angular/common/http';
import { CustomHttpParameterCodec } from '../encoder';
import { Observable } from 'rxjs';


// @ts-ignore
import { BASE_PATH, COLLECTION_FORMATS } from '../variables';
import { Configuration } from '../configuration';

Expand Down Expand Up @@ -89,38 +91,50 @@ export class DefaultService {
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getObjectsWithId(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable<any>;
public getObjectsWithId(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable<HttpResponse<any>>;
public getObjectsWithId(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable<HttpEvent<any>>;
public getObjectsWithId(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable<any> {
public getObjectsWithId(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable<any>;
public getObjectsWithId(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable<HttpResponse<any>>;
public getObjectsWithId(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable<HttpEvent<any>>;
public getObjectsWithId(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getObjectsWithId.');
}

let headers = this.defaultHeaders;
let localVarHeaders = this.defaultHeaders;

let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (httpHeaderAcceptSelected === undefined) {
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = [
];
httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (httpHeaderAcceptSelected !== undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}

let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}


let responseType: 'text' | 'json' = 'json';
if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) {
responseType = 'text';
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}

return this.httpClient.get<any>(`${this.configuration.basePath}/objects/${encodeURIComponent(String(id))}`,
{
responseType: <any>responseType,
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: headers,
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
}
Expand All @@ -133,38 +147,50 @@ export class DefaultService {
* @param observe set whether or not to return the data Observable as the body, response or events. defaults to returning the body.
* @param reportProgress flag to report request and response progress.
*/
public getThumbnailsWithId(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable<any>;
public getThumbnailsWithId(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable<HttpResponse<any>>;
public getThumbnailsWithId(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined}): Observable<HttpEvent<any>>;
public getThumbnailsWithId(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined}): Observable<any> {
public getThumbnailsWithId(id: string, observe?: 'body', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable<any>;
public getThumbnailsWithId(id: string, observe?: 'response', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable<HttpResponse<any>>;
public getThumbnailsWithId(id: string, observe?: 'events', reportProgress?: boolean, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable<HttpEvent<any>>;
public getThumbnailsWithId(id: string, observe: any = 'body', reportProgress: boolean = false, options?: {httpHeaderAccept?: undefined, context?: HttpContext}): Observable<any> {
if (id === null || id === undefined) {
throw new Error('Required parameter id was null or undefined when calling getThumbnailsWithId.');
}

let headers = this.defaultHeaders;
let localVarHeaders = this.defaultHeaders;

let httpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (httpHeaderAcceptSelected === undefined) {
let localVarHttpHeaderAcceptSelected: string | undefined = options && options.httpHeaderAccept;
if (localVarHttpHeaderAcceptSelected === undefined) {
// to determine the Accept header
const httpHeaderAccepts: string[] = [
];
httpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
localVarHttpHeaderAcceptSelected = this.configuration.selectHeaderAccept(httpHeaderAccepts);
}
if (httpHeaderAcceptSelected !== undefined) {
headers = headers.set('Accept', httpHeaderAcceptSelected);
if (localVarHttpHeaderAcceptSelected !== undefined) {
localVarHeaders = localVarHeaders.set('Accept', localVarHttpHeaderAcceptSelected);
}

let localVarHttpContext: HttpContext | undefined = options && options.context;
if (localVarHttpContext === undefined) {
localVarHttpContext = new HttpContext();
}


let responseType: 'text' | 'json' = 'json';
if(httpHeaderAcceptSelected && httpHeaderAcceptSelected.startsWith('text')) {
responseType = 'text';
let responseType_: 'text' | 'json' | 'blob' = 'json';
if (localVarHttpHeaderAcceptSelected) {
if (localVarHttpHeaderAcceptSelected.startsWith('text')) {
responseType_ = 'text';
} else if (this.configuration.isJsonMime(localVarHttpHeaderAcceptSelected)) {
responseType_ = 'json';
} else {
responseType_ = 'blob';
}
}

return this.httpClient.get<any>(`${this.configuration.basePath}/thumbnails/${encodeURIComponent(String(id))}`,
{
responseType: <any>responseType,
context: localVarHttpContext,
responseType: <any>responseType_,
withCredentials: this.configuration.withCredentials,
headers: headers,
headers: localVarHeaders,
observe: observe,
reportProgress: reportProgress
}
Expand Down
Loading

0 comments on commit 7b7e0be

Please sign in to comment.