From 7d738c7bd6997bd5cdeefd49d67fe3ca0ce5fbc6 Mon Sep 17 00:00:00 2001 From: Martin Desrumaux Date: Tue, 12 May 2020 18:13:33 +0200 Subject: [PATCH] feat: Upgrade to openapi-generator 4.3.1 + remove openapi-v2 converter --- .openapi-generator/VERSION | 2 +- Makefile | 28 +- generator/README.md | 87 +- generator/openapi-v2.yml | 2194 --------------------- generator/{openapi-v3.yml => openapi.yml} | 63 + package.json | 2 +- src/apis/TimesideApi.ts | 209 +- src/models/Analysis.ts | 30 +- src/models/AnalysisTrack.ts | 34 +- src/models/Annotation.ts | 32 +- src/models/AnnotationTrack.ts | 48 +- src/models/AnnotationTrackAnnotations.ts | 28 +- src/models/AuthToken.ts | 10 +- src/models/Experience.ts | 34 +- src/models/Item.ts | 106 +- src/models/ItemAudioUrl.ts | 7 + src/models/ItemList.ts | 40 +- src/models/ItemWaveform.ts | 12 +- src/models/ItemWaveformWaveform.ts | 28 +- src/models/Preset.ts | 14 +- src/models/Processor.ts | 10 +- src/models/Provider.ts | 14 +- src/models/Result.ts | 85 +- src/models/Selection.ts | 34 +- src/models/SubProcessor.ts | 80 + src/models/Task.ts | 54 +- src/models/TokenObtainPair.ts | 8 +- src/models/User.ts | 18 +- src/models/index.ts | 1 + src/runtime.ts | 4 +- 30 files changed, 651 insertions(+), 2665 deletions(-) delete mode 100644 generator/openapi-v2.yml rename generator/{openapi-v3.yml => openapi.yml} (96%) create mode 100644 src/models/SubProcessor.ts diff --git a/.openapi-generator/VERSION b/.openapi-generator/VERSION index 8191138..ecedc98 100644 --- a/.openapi-generator/VERSION +++ b/.openapi-generator/VERSION @@ -1 +1 @@ -4.3.0 \ No newline at end of file +4.3.1 \ No newline at end of file diff --git a/Makefile b/Makefile index 62c5446..1ee55ad 100644 --- a/Makefile +++ b/Makefile @@ -1,9 +1,8 @@ generator-dir := generator generator-config := $(addprefix $(generator-dir)/,typescript-fetch.config.yaml) -spec-openapi-v3 := $(addprefix ${generator-dir}/,openapi-v3.yml) -spec-openapi-v2 := $(addprefix ${generator-dir}/,openapi-v2.yml) +spec-openapi := $(addprefix ${generator-dir}/,openapi.yml) api-dest := . -API_URL = https://wasabi.telemeta.org/timeside/api/ +OPEN_API_URL = https://sandbox.wasabi.telemeta.org/timeside/api/schema/ all: install api @@ -13,31 +12,18 @@ ifeq (, $(shell which docker)) $(error No "docker" in PATH, consider doing apt install docker) endif -# Check api-spec-converter -ifeq (, $(shell which api-spec-converter)) - $(error No "api-spec-converter" in PATH, consider doing "sudo npm install -g api-spec-converter") -endif - # Log dependencies' version - api-spec-converter --version docker --version -$(spec-openapi-v3): - curl --fail $(API_URL)openapi.yml -o $(spec-openapi-v3) - -$(spec-openapi-v2): $(spec-openapi-v3) - api-spec-converter \ - --from=openapi_3 \ - --to=swagger_2 \ - --syntax=yaml \ - --order=alpha $(spec-openapi-v3) > $(spec-openapi-v2) +$(spec-openapi): + curl --fail $(OPEN_API_URL) -o $(spec-openapi) -api: $(spec-openapi-v2) +api: $(spec-openapi) docker run --rm \ -v ${PWD}:/local \ --user "$$(id -u):$$(id -g)" \ - openapitools/openapi-generator-cli:v4.3.0 generate \ - -i /local/$(spec-openapi-v2) \ + openapitools/openapi-generator-cli:v4.3.1 generate \ + -i /local/$(spec-openapi) \ -g typescript-fetch \ -c /local/$(generator-config) \ -o /local/$(api-dest) diff --git a/generator/README.md b/generator/README.md index ed2d89d..2353ba3 100644 --- a/generator/README.md +++ b/generator/README.md @@ -93,88 +93,11 @@ and it works ! However, we don't use Angular, so we'll have to find another solu For more information on this generator and why they forked swagger-codegen, see https://github.com/OpenAPITools/openapi-generator/blob/master/docs/qna.md -As of today, the last version is [4.2.2](https://hub.docker.com/r/openapitools/openapi-generator-cli/tags) +As of today, the last version is [4.3.1](https://hub.docker.com/r/openapitools/openapi-generator-cli/tags) ``` -docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.2.2 generate \ - -i /local/openapi-schema.yaml \ - -g typescript-fetch \ - -o /local/openapi-generator-timeside-ts-fetch -``` - -But the specification fails to validate with the following errors: - -``` -Exception in thread "main" org.openapitools.codegen.SpecValidationException: There were issues with the specification. The option can be disabled via validateSpec (Maven/Gradle) or --skip-validate-spec (CLI). - | Error count: 43, Warning count: 0 -Errors: - -attribute paths.'/timeside/api/selections/{uuid}/'(patch).requestBody.content.schema is not of type `object` - -attribute paths.'/timeside/api/experiences/'(post).requestBody.content.schema is not of type `object` - -attribute paths.'/timeside/api/providers/'(post).requestBody.content.schema is not of type `object` - -attribute paths.'/timeside/api/results/'(post).requestBody.content.schema is not of type `object` - -attribute paths.'/timeside/api/tasks/{uuid}/'(patch).requestBody.content.schema is not of type `object` - -attribute paths.'/timeside/api/annotation_tracks/{uuid}/'(patch).requestBody.content.schema is not of type `object` - -attribute paths.'/timeside/api/experiences/{uuid}/'(put).requestBody.content.schema is not of type `object` - .... -``` - -I tried to validate the file with https://apitools.dev/swagger-parser/online/ and it pass the validation. - -We can skip the validation with the `--skip-validate-spec` parameter but this will generate a non-compilable codebase (the `models` directory is imported in index.ts but it does not exist). - -### Convert specs from OpenAPI v3.0 to OpenAPI v2.0 - -We can use the following tool to convert the specification from OpenAPI v3.0 to Swagger v2.0 : https://github.com/LucyBot-Inc/api-spec-converter - -Install with: -``` -sudo npm install -g api-spec-converter -``` - -And convert it with: -``` -api-spec-converter \ - --from=openapi_3 \ - --to=swagger_2 \ - --syntax=yaml \ - --order=alpha openapi-schema.yaml > openapiv2-schema.yml -``` - -Note : During this conversion, we may lost some data because OpenAPI v3.0 specs include more information than Swagger v2.0 like : -- Added support for multiple root URLs. -- Added support for content type negotiation. -- Extended JSON Schema support to include `oneOf`, `anyOf` and `not` support. -- Added a callback mechanism to describe Webhooks. - -For more informations, see https://blog.runscope.com/posts/tutorial-upgrading-swagger-2-api-definition-to-openapi-3 - - -### Try again with swagger-codegen v2.X using OpenAPI v2 specs - -Using swagger-codegen-cli -``` -docker run --rm -v ${PWD}:/local swaggerapi/swagger-codegen-cli:2.4.10 generate \ - -i /local/openapiv2-schema.yml \ - -l typescript-fetch \ - -o /local/swagger-codegen-timeside-ts-fetch -``` - -It works ! - -However, the generated code is not fully compatible with Typescript 3.6+. To make it work we need to: -- Install portable-fetch (npm install --save portable-fetch) -- Replace portable-fetch import : `import * as portableFetch from 'portable-fetch'` with `import portableFetch from 'portable-fetch'` -- Replace `GlobalFetch` type with `WindowOrWorkerGlobalScope['fetch']` -- Make an optional constructor call optional -- Give a default value for the name property of `RequiredError` -- Ask eslint to ignore the directory of the project - -### Try again with openapi-generator usign OpenAPI v2 specs - -Using openapi-generator -``` -docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.2.2 generate \ - -i /local/openapiv2-schema.yml \ +docker run --rm -v ${PWD}:/local openapitools/openapi-generator-cli:v4.3.1 generate \ + -i /local/openapi-schema.yml \ -g typescript-fetch \ -o /local/openapi-generator-timeside-ts-fetch ``` @@ -201,7 +124,3 @@ The generated build is better than the one generated by swagger-codegen because - Compile successfully without any manual changes So, `openapi-generator` seems to be the best option right now. - -### Note for maintainer - -In future months / years, OpenAPI v3.0 may be better supported by codegen tools. You may want to give another try to generate the client without converting it to OpenAPI v2.0. diff --git a/generator/openapi-v2.yml b/generator/openapi-v2.yml deleted file mode 100644 index 4a1435d..0000000 --- a/generator/openapi-v2.yml +++ /dev/null @@ -1,2194 +0,0 @@ -basePath: / -definitions: - Analysis: - properties: - description: - type: string - parameters_schema: - type: object - preset: - type: string - sub_processor: - type: string - title: - maxLength: 512 - type: string - url: - readOnly: true - type: string - uuid: - format: uuid - readOnly: true - type: string - required: - - preset - - sub_processor - - parameters_schema - type: object - AnalysisTrack: - properties: - analysis: - type: string - description: - type: string - item: - type: string - parameters_default: - readOnly: true - type: string - parameters_schema: - readOnly: true - type: string - parametrizable: - readOnly: true - type: string - result_url: - readOnly: true - type: string - title: - maxLength: 512 - type: string - url: - readOnly: true - type: string - uuid: - format: uuid - readOnly: true - type: string - required: - - analysis - - item - type: object - Annotation: - properties: - description: - type: string - start_time: - type: number - stop_time: - type: number - title: - maxLength: 512 - type: string - track: - type: string - url: - readOnly: true - type: string - uuid: - format: uuid - readOnly: true - type: string - required: - - track - - stop_time - type: object - AnnotationTrack: - properties: - annotations: - items: - properties: - description: - type: string - start_time: - type: number - stop_time: - type: number - title: - maxLength: 512 - type: string - url: - readOnly: true - type: string - uuid: - format: uuid - readOnly: true - type: string - required: - - stop_time - type: object - readOnly: true - type: array - author: - type: string - x-nullable: true - description: - type: string - is_public: - type: boolean - item: - type: string - overlapping: - type: boolean - title: - maxLength: 512 - type: string - url: - readOnly: true - type: string - uuid: - format: uuid - readOnly: true - type: string - required: - - item - type: object - AuthToken: - properties: - password: - type: string - token: - readOnly: true - type: string - username: - type: string - required: - - username - - password - type: object - Experience: - properties: - author: - type: string - x-nullable: true - is_public: - type: boolean - presets: - items: - type: string - type: array - title: - maxLength: 512 - type: string - url: - readOnly: true - type: string - uuid: - format: uuid - readOnly: true - type: string - type: object - Item: - properties: - analysis_tracks: - items: - type: string - readOnly: true - type: array - annotation_tracks: - items: - type: string - readOnly: true - type: array - audio_duration: - description: Duration of audio track. - readOnly: true - type: number - audio_url: - properties: - mp3: - format: uri - pattern: "^(?:[a-z0-9\\.\\-\\+]*)://(?:[^\\s:@/]+(?::[^\\s:@/]*)?@)?(?:(?:25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|[0-1]?\\d?\\d)){3}|\\[[0-9a-f:\\.]+\\]|([a-z¡-\uFFFF0-9](?:[a-z¡-\uFFFF0-9-]{0,61}[a-z¡-\uFFFF0-9])?(?:\\.(?!-)[a-z¡-\uFFFF0-9-]{1,63}(?- - Takes a set of user credentials and returns an access and refresh JSON - web - - token pair to prove the authentication of those credentials. - operationId: createTokenObtainPair - parameters: - - in: body - name: body - schema: - $ref: '#/definitions/TokenObtainPair' - produces: - - application/json - responses: - '201': - description: '' - schema: - $ref: '#/definitions/TokenObtainPair' - tags: - - timeside - /timeside/api/token/refresh/: - post: - consumes: - - application/json - - application/x-www-form-urlencoded - - multipart/form-data - description: |- - Takes a refresh type JSON web token and returns an access type JSON web - token if the refresh token is valid. - operationId: createTokenRefresh - parameters: - - in: body - name: body - schema: - $ref: '#/definitions/TokenRefresh' - produces: - - application/json - responses: - '201': - description: '' - schema: - $ref: '#/definitions/TokenRefresh' - tags: - - timeside - /timeside/api/token/verify/: - post: - consumes: - - application/json - - application/x-www-form-urlencoded - - multipart/form-data - description: |- - Takes a token and indicates if it is valid. This view provides no - information about a token's fitness for a particular use. - operationId: createTokenVerify - parameters: - - in: body - name: body - schema: - $ref: '#/definitions/TokenVerify' - produces: - - application/json - responses: - '201': - description: '' - schema: - $ref: '#/definitions/TokenVerify' - tags: - - timeside - /timeside/api/users/: - get: - description: Users of the API able to share data. - operationId: listUsers - parameters: [] - produces: - - application/json - responses: - '200': - description: '' - schema: - items: - $ref: '#/definitions/User' - type: array - tags: - - timeside - '/timeside/api/users/{username}/': - get: - description: Users of the API able to share data. - operationId: retrieveUser - parameters: - - description: >- - Required. 150 characters or fewer. Letters, digits and @/./+/-/_ - only. - in: path - name: username - required: true - type: string - produces: - - application/json - responses: - '200': - description: '' - schema: - $ref: '#/definitions/User' - tags: - - timeside -schemes: - - https -swagger: '2.0' -x-components: {} - diff --git a/generator/openapi-v3.yml b/generator/openapi.yml similarity index 96% rename from generator/openapi-v3.yml rename to generator/openapi.yml index f5325c2..3e6a500 100644 --- a/generator/openapi-v3.yml +++ b/generator/openapi.yml @@ -453,6 +453,42 @@ paths: description: '' tags: - timeside + /timeside/api/subprocessors/: + get: + operationId: listSubProcessors + description: Link between a processor depending on another. + parameters: [] + responses: + '200': + content: + application/json: + schema: + type: array + items: + $ref: '#/components/schemas/SubProcessor' + description: '' + tags: + - timeside + /timeside/api/subprocessors/{sub_processor_id}/: + get: + operationId: retrieveSubProcessor + description: Link between a processor depending on another. + parameters: + - name: sub_processor_id + in: path + required: true + description: '' + schema: + type: string + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/SubProcessor' + description: '' + tags: + - timeside /timeside/api/presets/: get: operationId: listPresets @@ -1795,6 +1831,16 @@ components: 0-9])?(?:\\.(?!-)[a-z\xA1-\uFFFF0-9-]{1,63}(? AnalysisFromJSON(jsonValue)); @@ -395,7 +406,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: AnalysisTrackToJSON(requestParameters.body), + body: AnalysisTrackToJSON(requestParameters.analysisTrack), }); return new runtime.JSONApiResponse(response, (jsonValue) => AnalysisTrackFromJSON(jsonValue)); @@ -422,7 +433,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: AnnotationToJSON(requestParameters.body), + body: AnnotationToJSON(requestParameters.annotation), }); return new runtime.JSONApiResponse(response, (jsonValue) => AnnotationFromJSON(jsonValue)); @@ -449,7 +460,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: AnnotationTrackToJSON(requestParameters.body), + body: AnnotationTrackToJSON(requestParameters.annotationTrack), }); return new runtime.JSONApiResponse(response, (jsonValue) => AnnotationTrackFromJSON(jsonValue)); @@ -501,6 +512,10 @@ export class TimesideApi extends runtime.BaseAPI { formParams.append('password', requestParameters.password as any); } + if (requestParameters.token !== undefined) { + formParams.append('token', requestParameters.token as any); + } + const response = await this.request({ path: `/timeside/api-token-auth/`, method: 'POST', @@ -534,7 +549,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: ExperienceToJSON(requestParameters.body), + body: ExperienceToJSON(requestParameters.experience), }); return new runtime.JSONApiResponse(response, (jsonValue) => ExperienceFromJSON(jsonValue)); @@ -562,7 +577,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: ItemToJSON(requestParameters.body), + body: ItemToJSON(requestParameters.item), }); return new runtime.JSONApiResponse(response, (jsonValue) => ItemFromJSON(jsonValue)); @@ -590,7 +605,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: PresetToJSON(requestParameters.body), + body: PresetToJSON(requestParameters.preset), }); return new runtime.JSONApiResponse(response, (jsonValue) => PresetFromJSON(jsonValue)); @@ -619,7 +634,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: SelectionToJSON(requestParameters.body), + body: SelectionToJSON(requestParameters.selection), }); return new runtime.JSONApiResponse(response, (jsonValue) => SelectionFromJSON(jsonValue)); @@ -648,7 +663,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: TaskToJSON(requestParameters.body), + body: TaskToJSON(requestParameters.task), }); return new runtime.JSONApiResponse(response, (jsonValue) => TaskFromJSON(jsonValue)); @@ -677,7 +692,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: TokenObtainPairToJSON(requestParameters.body), + body: TokenObtainPairToJSON(requestParameters.tokenObtainPair), }); return new runtime.JSONApiResponse(response, (jsonValue) => TokenObtainPairFromJSON(jsonValue)); @@ -706,7 +721,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: TokenRefreshToJSON(requestParameters.body), + body: TokenRefreshToJSON(requestParameters.tokenRefresh), }); return new runtime.JSONApiResponse(response, (jsonValue) => TokenRefreshFromJSON(jsonValue)); @@ -735,7 +750,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: TokenVerifyToJSON(requestParameters.body), + body: TokenVerifyToJSON(requestParameters.tokenVerify), }); return new runtime.JSONApiResponse(response, (jsonValue) => TokenVerifyFromJSON(jsonValue)); @@ -1102,7 +1117,7 @@ export class TimesideApi extends runtime.BaseAPI { /** */ - async listCsrfTokensRaw(): Promise>> { + async listCsrfTokensRaw(): Promise>> { const queryParameters: runtime.HTTPQuery = {}; const headerParameters: runtime.HTTPHeaders = {}; @@ -1114,12 +1129,12 @@ export class TimesideApi extends runtime.BaseAPI { query: queryParameters, }); - return new runtime.JSONApiResponse(response); + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(AnyTypeFromJSON)); } /** */ - async listCsrfTokens(): Promise> { + async listCsrfTokens(): Promise> { const response = await this.listCsrfTokensRaw(); return await response.value(); } @@ -1312,6 +1327,32 @@ export class TimesideApi extends runtime.BaseAPI { return await response.value(); } + /** + * Link between a processor depending on another. + */ + async listSubProcessorsRaw(): Promise>> { + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/timeside/api/subprocessors/`, + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => jsonValue.map(SubProcessorFromJSON)); + } + + /** + * Link between a processor depending on another. + */ + async listSubProcessors(): Promise> { + const response = await this.listSubProcessorsRaw(); + return await response.value(); + } + /** * Experience applied to a selection or a single item. */ @@ -1470,7 +1511,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PATCH', headers: headerParameters, query: queryParameters, - body: AnalysisToJSON(requestParameters.body), + body: AnalysisToJSON(requestParameters.analysis), }); return new runtime.JSONApiResponse(response, (jsonValue) => AnalysisFromJSON(jsonValue)); @@ -1501,7 +1542,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PATCH', headers: headerParameters, query: queryParameters, - body: AnalysisTrackToJSON(requestParameters.body), + body: AnalysisTrackToJSON(requestParameters.analysisTrack), }); return new runtime.JSONApiResponse(response, (jsonValue) => AnalysisTrackFromJSON(jsonValue)); @@ -1532,7 +1573,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PATCH', headers: headerParameters, query: queryParameters, - body: AnnotationToJSON(requestParameters.body), + body: AnnotationToJSON(requestParameters.annotation), }); return new runtime.JSONApiResponse(response, (jsonValue) => AnnotationFromJSON(jsonValue)); @@ -1563,7 +1604,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PATCH', headers: headerParameters, query: queryParameters, - body: AnnotationTrackToJSON(requestParameters.body), + body: AnnotationTrackToJSON(requestParameters.annotationTrack), }); return new runtime.JSONApiResponse(response, (jsonValue) => AnnotationTrackFromJSON(jsonValue)); @@ -1595,7 +1636,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PATCH', headers: headerParameters, query: queryParameters, - body: ExperienceToJSON(requestParameters.body), + body: ExperienceToJSON(requestParameters.experience), }); return new runtime.JSONApiResponse(response, (jsonValue) => ExperienceFromJSON(jsonValue)); @@ -1631,7 +1672,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PATCH', headers: headerParameters, query: queryParameters, - body: ItemToJSON(requestParameters.body), + body: ItemToJSON(requestParameters.item), }); return new runtime.JSONApiResponse(response, (jsonValue) => ItemFromJSON(jsonValue)); @@ -1663,7 +1704,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PATCH', headers: headerParameters, query: queryParameters, - body: PresetToJSON(requestParameters.body), + body: PresetToJSON(requestParameters.preset), }); return new runtime.JSONApiResponse(response, (jsonValue) => PresetFromJSON(jsonValue)); @@ -1696,7 +1737,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PATCH', headers: headerParameters, query: queryParameters, - body: SelectionToJSON(requestParameters.body), + body: SelectionToJSON(requestParameters.selection), }); return new runtime.JSONApiResponse(response, (jsonValue) => SelectionFromJSON(jsonValue)); @@ -1729,7 +1770,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PATCH', headers: headerParameters, query: queryParameters, - body: TaskToJSON(requestParameters.body), + body: TaskToJSON(requestParameters.task), }); return new runtime.JSONApiResponse(response, (jsonValue) => TaskFromJSON(jsonValue)); @@ -2086,7 +2127,7 @@ export class TimesideApi extends runtime.BaseAPI { /** * PNG rendering of 2D numerical data (example: a spectrogram). */ - async retrieveResultVisualizationRaw(requestParameters: RetrieveResultVisualizationRequest): Promise> { + async retrieveResultVisualizationRaw(requestParameters: RetrieveResultVisualizationRequest): Promise> { if (requestParameters.uuid === null || requestParameters.uuid === undefined) { throw new runtime.RequiredError('uuid','Required parameter requestParameters.uuid was null or undefined when calling retrieveResultVisualization.'); } @@ -2102,13 +2143,13 @@ export class TimesideApi extends runtime.BaseAPI { query: queryParameters, }); - return new runtime.JSONApiResponse(response); + return new runtime.JSONApiResponse(response, (jsonValue) => AnyTypeFromJSON(jsonValue)); } /** * PNG rendering of 2D numerical data (example: a spectrogram). */ - async retrieveResultVisualization(requestParameters: RetrieveResultVisualizationRequest): Promise { + async retrieveResultVisualization(requestParameters: RetrieveResultVisualizationRequest): Promise { const response = await this.retrieveResultVisualizationRaw(requestParameters); return await response.value(); } @@ -2143,6 +2184,36 @@ export class TimesideApi extends runtime.BaseAPI { return await response.value(); } + /** + * Link between a processor depending on another. + */ + async retrieveSubProcessorRaw(requestParameters: RetrieveSubProcessorRequest): Promise> { + if (requestParameters.subProcessorId === null || requestParameters.subProcessorId === undefined) { + throw new runtime.RequiredError('subProcessorId','Required parameter requestParameters.subProcessorId was null or undefined when calling retrieveSubProcessor.'); + } + + const queryParameters: runtime.HTTPQuery = {}; + + const headerParameters: runtime.HTTPHeaders = {}; + + const response = await this.request({ + path: `/timeside/api/subprocessors/{sub_processor_id}/`.replace(`{${"sub_processor_id"}}`, encodeURIComponent(String(requestParameters.subProcessorId))), + method: 'GET', + headers: headerParameters, + query: queryParameters, + }); + + return new runtime.JSONApiResponse(response, (jsonValue) => SubProcessorFromJSON(jsonValue)); + } + + /** + * Link between a processor depending on another. + */ + async retrieveSubProcessor(requestParameters: RetrieveSubProcessorRequest): Promise { + const response = await this.retrieveSubProcessorRaw(requestParameters); + return await response.value(); + } + /** * Experience applied to a selection or a single item. */ @@ -2221,7 +2292,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'POST', headers: headerParameters, query: queryParameters, - body: AnalysisTrackToJSON(requestParameters.body), + body: AnalysisTrackToJSON(requestParameters.analysisTrack), }); return new runtime.JSONApiResponse(response, (jsonValue) => AnalysisTrackFromJSON(jsonValue)); @@ -2252,7 +2323,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: AnalysisToJSON(requestParameters.body), + body: AnalysisToJSON(requestParameters.analysis), }); return new runtime.JSONApiResponse(response, (jsonValue) => AnalysisFromJSON(jsonValue)); @@ -2283,7 +2354,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: AnalysisTrackToJSON(requestParameters.body), + body: AnalysisTrackToJSON(requestParameters.analysisTrack), }); return new runtime.JSONApiResponse(response, (jsonValue) => AnalysisTrackFromJSON(jsonValue)); @@ -2314,7 +2385,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: AnnotationToJSON(requestParameters.body), + body: AnnotationToJSON(requestParameters.annotation), }); return new runtime.JSONApiResponse(response, (jsonValue) => AnnotationFromJSON(jsonValue)); @@ -2345,7 +2416,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: AnnotationTrackToJSON(requestParameters.body), + body: AnnotationTrackToJSON(requestParameters.annotationTrack), }); return new runtime.JSONApiResponse(response, (jsonValue) => AnnotationTrackFromJSON(jsonValue)); @@ -2377,7 +2448,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: ExperienceToJSON(requestParameters.body), + body: ExperienceToJSON(requestParameters.experience), }); return new runtime.JSONApiResponse(response, (jsonValue) => ExperienceFromJSON(jsonValue)); @@ -2413,7 +2484,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: ItemToJSON(requestParameters.body), + body: ItemToJSON(requestParameters.item), }); return new runtime.JSONApiResponse(response, (jsonValue) => ItemFromJSON(jsonValue)); @@ -2445,7 +2516,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: PresetToJSON(requestParameters.body), + body: PresetToJSON(requestParameters.preset), }); return new runtime.JSONApiResponse(response, (jsonValue) => PresetFromJSON(jsonValue)); @@ -2478,7 +2549,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: SelectionToJSON(requestParameters.body), + body: SelectionToJSON(requestParameters.selection), }); return new runtime.JSONApiResponse(response, (jsonValue) => SelectionFromJSON(jsonValue)); @@ -2511,7 +2582,7 @@ export class TimesideApi extends runtime.BaseAPI { method: 'PUT', headers: headerParameters, query: queryParameters, - body: TaskToJSON(requestParameters.body), + body: TaskToJSON(requestParameters.task), }); return new runtime.JSONApiResponse(response, (jsonValue) => TaskFromJSON(jsonValue)); diff --git a/src/models/Analysis.ts b/src/models/Analysis.ts index 2e85094..cb12cc5 100644 --- a/src/models/Analysis.ts +++ b/src/models/Analysis.ts @@ -24,43 +24,43 @@ export interface Analysis { * @type {string} * @memberof Analysis */ - description?: string; + readonly url?: string; /** * - * @type {object} + * @type {string} * @memberof Analysis */ - parametersSchema: object; + readonly uuid?: string; /** * * @type {string} * @memberof Analysis */ - preset: string; + title?: string; /** * * @type {string} * @memberof Analysis */ - subProcessor: string; + description?: string; /** * * @type {string} * @memberof Analysis */ - title?: string; + preset: string; /** * * @type {string} * @memberof Analysis */ - readonly url?: string; + subProcessor: string; /** * - * @type {string} + * @type {object} * @memberof Analysis */ - readonly uuid?: string; + parametersSchema: object; } export function AnalysisFromJSON(json: any): Analysis { @@ -73,13 +73,13 @@ export function AnalysisFromJSONTyped(json: any, ignoreDiscriminator: boolean): } return { + 'url': !exists(json, 'url') ? undefined : json['url'], + 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'title': !exists(json, 'title') ? undefined : json['title'], 'description': !exists(json, 'description') ? undefined : json['description'], - 'parametersSchema': json['parameters_schema'], 'preset': json['preset'], 'subProcessor': json['sub_processor'], - 'title': !exists(json, 'title') ? undefined : json['title'], - 'url': !exists(json, 'url') ? undefined : json['url'], - 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'parametersSchema': json['parameters_schema'], }; } @@ -92,11 +92,11 @@ export function AnalysisToJSON(value?: Analysis | null): any { } return { + 'title': value.title, 'description': value.description, - 'parameters_schema': value.parametersSchema, 'preset': value.preset, 'sub_processor': value.subProcessor, - 'title': value.title, + 'parameters_schema': value.parametersSchema, }; } diff --git a/src/models/AnalysisTrack.ts b/src/models/AnalysisTrack.ts index 173f1c9..1470706 100644 --- a/src/models/AnalysisTrack.ts +++ b/src/models/AnalysisTrack.ts @@ -24,37 +24,37 @@ export interface AnalysisTrack { * @type {string} * @memberof AnalysisTrack */ - analysis: string; + readonly url?: string; /** * * @type {string} * @memberof AnalysisTrack */ - description?: string; + readonly uuid?: string; /** * * @type {string} * @memberof AnalysisTrack */ - item: string; + title?: string; /** * * @type {string} * @memberof AnalysisTrack */ - readonly parametersDefault?: string; + description?: string; /** * * @type {string} * @memberof AnalysisTrack */ - readonly parametersSchema?: string; + analysis: string; /** * * @type {string} * @memberof AnalysisTrack */ - readonly parametrizable?: string; + item: string; /** * * @type {string} @@ -66,19 +66,19 @@ export interface AnalysisTrack { * @type {string} * @memberof AnalysisTrack */ - title?: string; + readonly parametersSchema?: string; /** * * @type {string} * @memberof AnalysisTrack */ - readonly url?: string; + readonly parametersDefault?: string; /** * * @type {string} * @memberof AnalysisTrack */ - readonly uuid?: string; + readonly parametrizable?: string; } export function AnalysisTrackFromJSON(json: any): AnalysisTrack { @@ -91,16 +91,16 @@ export function AnalysisTrackFromJSONTyped(json: any, ignoreDiscriminator: boole } return { - 'analysis': json['analysis'], + 'url': !exists(json, 'url') ? undefined : json['url'], + 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'title': !exists(json, 'title') ? undefined : json['title'], 'description': !exists(json, 'description') ? undefined : json['description'], + 'analysis': json['analysis'], 'item': json['item'], - 'parametersDefault': !exists(json, 'parameters_default') ? undefined : json['parameters_default'], + 'resultUrl': !exists(json, 'result_url') ? undefined : json['result_url'], 'parametersSchema': !exists(json, 'parameters_schema') ? undefined : json['parameters_schema'], + 'parametersDefault': !exists(json, 'parameters_default') ? undefined : json['parameters_default'], 'parametrizable': !exists(json, 'parametrizable') ? undefined : json['parametrizable'], - 'resultUrl': !exists(json, 'result_url') ? undefined : json['result_url'], - 'title': !exists(json, 'title') ? undefined : json['title'], - 'url': !exists(json, 'url') ? undefined : json['url'], - 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], }; } @@ -113,10 +113,10 @@ export function AnalysisTrackToJSON(value?: AnalysisTrack | null): any { } return { - 'analysis': value.analysis, + 'title': value.title, 'description': value.description, + 'analysis': value.analysis, 'item': value.item, - 'title': value.title, }; } diff --git a/src/models/Annotation.ts b/src/models/Annotation.ts index a23f8bc..d9c0e4f 100644 --- a/src/models/Annotation.ts +++ b/src/models/Annotation.ts @@ -24,19 +24,19 @@ export interface Annotation { * @type {string} * @memberof Annotation */ - description?: string; + readonly url?: string; /** * - * @type {number} + * @type {string} * @memberof Annotation */ - startTime?: number; + readonly uuid?: string; /** * - * @type {number} + * @type {string} * @memberof Annotation */ - stopTime: number; + track: string; /** * * @type {string} @@ -48,19 +48,19 @@ export interface Annotation { * @type {string} * @memberof Annotation */ - track: string; + description?: string; /** * - * @type {string} + * @type {number} * @memberof Annotation */ - readonly url?: string; + startTime?: number; /** * - * @type {string} + * @type {number} * @memberof Annotation */ - readonly uuid?: string; + stopTime: number; } export function AnnotationFromJSON(json: any): Annotation { @@ -73,13 +73,13 @@ export function AnnotationFromJSONTyped(json: any, ignoreDiscriminator: boolean) } return { + 'url': !exists(json, 'url') ? undefined : json['url'], + 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'track': json['track'], + 'title': !exists(json, 'title') ? undefined : json['title'], 'description': !exists(json, 'description') ? undefined : json['description'], 'startTime': !exists(json, 'start_time') ? undefined : json['start_time'], 'stopTime': json['stop_time'], - 'title': !exists(json, 'title') ? undefined : json['title'], - 'track': json['track'], - 'url': !exists(json, 'url') ? undefined : json['url'], - 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], }; } @@ -92,11 +92,11 @@ export function AnnotationToJSON(value?: Annotation | null): any { } return { + 'track': value.track, + 'title': value.title, 'description': value.description, 'start_time': value.startTime, 'stop_time': value.stopTime, - 'title': value.title, - 'track': value.track, }; } diff --git a/src/models/AnnotationTrack.ts b/src/models/AnnotationTrack.ts index a2302d7..499f9cc 100644 --- a/src/models/AnnotationTrack.ts +++ b/src/models/AnnotationTrack.ts @@ -28,58 +28,58 @@ import { export interface AnnotationTrack { /** * - * @type {Array} + * @type {string} * @memberof AnnotationTrack */ - readonly annotations?: Array; + readonly url?: string; /** * * @type {string} * @memberof AnnotationTrack */ - author?: string | null; + readonly uuid?: string; /** * * @type {string} * @memberof AnnotationTrack */ - description?: string; + item: string; /** * - * @type {boolean} + * @type {string} * @memberof AnnotationTrack */ - isPublic?: boolean; + title?: string; /** * * @type {string} * @memberof AnnotationTrack */ - item: string; + description?: string; /** * - * @type {boolean} + * @type {string} * @memberof AnnotationTrack */ - overlapping?: boolean; + author?: string | null; /** * - * @type {string} + * @type {boolean} * @memberof AnnotationTrack */ - title?: string; + isPublic?: boolean; /** * - * @type {string} + * @type {boolean} * @memberof AnnotationTrack */ - readonly url?: string; + overlapping?: boolean; /** * - * @type {string} + * @type {Array} * @memberof AnnotationTrack */ - readonly uuid?: string; + readonly annotations?: Array; } export function AnnotationTrackFromJSON(json: any): AnnotationTrack { @@ -92,15 +92,15 @@ export function AnnotationTrackFromJSONTyped(json: any, ignoreDiscriminator: boo } return { - 'annotations': !exists(json, 'annotations') ? undefined : ((json['annotations'] as Array).map(AnnotationTrackAnnotationsFromJSON)), - 'author': !exists(json, 'author') ? undefined : json['author'], + 'url': !exists(json, 'url') ? undefined : json['url'], + 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'item': json['item'], + 'title': !exists(json, 'title') ? undefined : json['title'], 'description': !exists(json, 'description') ? undefined : json['description'], + 'author': !exists(json, 'author') ? undefined : json['author'], 'isPublic': !exists(json, 'is_public') ? undefined : json['is_public'], - 'item': json['item'], 'overlapping': !exists(json, 'overlapping') ? undefined : json['overlapping'], - 'title': !exists(json, 'title') ? undefined : json['title'], - 'url': !exists(json, 'url') ? undefined : json['url'], - 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'annotations': !exists(json, 'annotations') ? undefined : ((json['annotations'] as Array).map(AnnotationTrackAnnotationsFromJSON)), }; } @@ -113,12 +113,12 @@ export function AnnotationTrackToJSON(value?: AnnotationTrack | null): any { } return { - 'author': value.author, + 'item': value.item, + 'title': value.title, 'description': value.description, + 'author': value.author, 'is_public': value.isPublic, - 'item': value.item, 'overlapping': value.overlapping, - 'title': value.title, }; } diff --git a/src/models/AnnotationTrackAnnotations.ts b/src/models/AnnotationTrackAnnotations.ts index 0f7d750..749b931 100644 --- a/src/models/AnnotationTrackAnnotations.ts +++ b/src/models/AnnotationTrackAnnotations.ts @@ -24,37 +24,37 @@ export interface AnnotationTrackAnnotations { * @type {string} * @memberof AnnotationTrackAnnotations */ - description?: string; + readonly url?: string; /** * - * @type {number} + * @type {string} * @memberof AnnotationTrackAnnotations */ - startTime?: number; + readonly uuid?: string; /** * - * @type {number} + * @type {string} * @memberof AnnotationTrackAnnotations */ - stopTime: number; + title?: string; /** * * @type {string} * @memberof AnnotationTrackAnnotations */ - title?: string; + description?: string; /** * - * @type {string} + * @type {number} * @memberof AnnotationTrackAnnotations */ - readonly url?: string; + startTime?: number; /** * - * @type {string} + * @type {number} * @memberof AnnotationTrackAnnotations */ - readonly uuid?: string; + stopTime: number; } export function AnnotationTrackAnnotationsFromJSON(json: any): AnnotationTrackAnnotations { @@ -67,12 +67,12 @@ export function AnnotationTrackAnnotationsFromJSONTyped(json: any, ignoreDiscrim } return { + 'url': !exists(json, 'url') ? undefined : json['url'], + 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'title': !exists(json, 'title') ? undefined : json['title'], 'description': !exists(json, 'description') ? undefined : json['description'], 'startTime': !exists(json, 'start_time') ? undefined : json['start_time'], 'stopTime': json['stop_time'], - 'title': !exists(json, 'title') ? undefined : json['title'], - 'url': !exists(json, 'url') ? undefined : json['url'], - 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], }; } @@ -85,10 +85,10 @@ export function AnnotationTrackAnnotationsToJSON(value?: AnnotationTrackAnnotati } return { + 'title': value.title, 'description': value.description, 'start_time': value.startTime, 'stop_time': value.stopTime, - 'title': value.title, }; } diff --git a/src/models/AuthToken.ts b/src/models/AuthToken.ts index f7f71a0..567e8a8 100644 --- a/src/models/AuthToken.ts +++ b/src/models/AuthToken.ts @@ -24,19 +24,19 @@ export interface AuthToken { * @type {string} * @memberof AuthToken */ - password: string; + username: string; /** * * @type {string} * @memberof AuthToken */ - readonly token?: string; + password: string; /** * * @type {string} * @memberof AuthToken */ - username: string; + readonly token?: string; } export function AuthTokenFromJSON(json: any): AuthToken { @@ -49,9 +49,9 @@ export function AuthTokenFromJSONTyped(json: any, ignoreDiscriminator: boolean): } return { + 'username': json['username'], 'password': json['password'], 'token': !exists(json, 'token') ? undefined : json['token'], - 'username': json['username'], }; } @@ -64,8 +64,8 @@ export function AuthTokenToJSON(value?: AuthToken | null): any { } return { - 'password': value.password, 'username': value.username, + 'password': value.password, }; } diff --git a/src/models/Experience.ts b/src/models/Experience.ts index 8917fd4..3136ab9 100644 --- a/src/models/Experience.ts +++ b/src/models/Experience.ts @@ -24,37 +24,37 @@ export interface Experience { * @type {string} * @memberof Experience */ - author?: string | null; + title?: string; /** * - * @type {boolean} + * @type {string} * @memberof Experience */ - isPublic?: boolean; + readonly uuid?: string; /** * - * @type {Array} + * @type {string} * @memberof Experience */ - presets?: Array; + readonly url?: string; /** * - * @type {string} + * @type {Array} * @memberof Experience */ - title?: string; + presets?: Array; /** * - * @type {string} + * @type {boolean} * @memberof Experience */ - readonly url?: string; + isPublic?: boolean; /** * * @type {string} * @memberof Experience */ - readonly uuid?: string; + author?: string | null; } export function ExperienceFromJSON(json: any): Experience { @@ -67,12 +67,12 @@ export function ExperienceFromJSONTyped(json: any, ignoreDiscriminator: boolean) } return { - 'author': !exists(json, 'author') ? undefined : json['author'], - 'isPublic': !exists(json, 'is_public') ? undefined : json['is_public'], - 'presets': !exists(json, 'presets') ? undefined : json['presets'], 'title': !exists(json, 'title') ? undefined : json['title'], - 'url': !exists(json, 'url') ? undefined : json['url'], 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'url': !exists(json, 'url') ? undefined : json['url'], + 'presets': !exists(json, 'presets') ? undefined : json['presets'], + 'isPublic': !exists(json, 'is_public') ? undefined : json['is_public'], + 'author': !exists(json, 'author') ? undefined : json['author'], }; } @@ -85,10 +85,10 @@ export function ExperienceToJSON(value?: Experience | null): any { } return { - 'author': value.author, - 'is_public': value.isPublic, - 'presets': value.presets, 'title': value.title, + 'presets': value.presets, + 'is_public': value.isPublic, + 'author': value.author, }; } diff --git a/src/models/Item.ts b/src/models/Item.ts index a6ceb20..e49cf0b 100644 --- a/src/models/Item.ts +++ b/src/models/Item.ts @@ -28,28 +28,28 @@ import { export interface Item { /** * - * @type {Array} + * @type {string} * @memberof Item */ - readonly analysisTracks?: Array; + readonly uuid?: string; /** * - * @type {Array} + * @type {string} * @memberof Item */ - readonly annotationTracks?: Array; + readonly url?: string; /** - * Duration of audio track. - * @type {number} + * + * @type {string} * @memberof Item */ - readonly audioDuration?: number; + readonly playerUrl?: string; /** * - * @type {ItemAudioUrl} + * @type {string} * @memberof Item */ - audioUrl?: ItemAudioUrl; + title?: string; /** * * @type {string} @@ -57,17 +57,17 @@ export interface Item { */ description?: string; /** - * Provider\'s id of the audio source. e.g. for Deezer preview: 4763165 e.g. for YouTube: oRdxUFDoQe0 - * @type {string} + * Audio file to process. + * @type {Blob} * @memberof Item */ - externalId?: string; + sourceFile?: Blob; /** - * Provider\'s URI of the audio source. e.g. for Deezer preview: http://www.deezer.com/track/4763165 e.g. for YouTube: https://www.youtube.com/watch?v=oRdxUFDoQe0 + * URL of a streamable audio source to process. * @type {string} * @memberof Item */ - externalUri?: string; + sourceUrl?: string; /** * * @type {string} @@ -76,52 +76,60 @@ export interface Item { mimeType?: string; /** * - * @type {string} + * @type {ItemAudioUrl} * @memberof Item */ - readonly playerUrl?: string; + audioUrl?: ItemAudioUrl; /** - * Audio provider (e.g. Deezer, Youtube, etc.) - * @type {string} + * Duration of audio track. + * @type {number} * @memberof Item */ - provider?: string | null; + readonly audioDuration?: number; /** - * Audio file to process. - * @type {Blob} + * Provider's URI of the audio source. + * + * e.g. for Deezer preview: http://www.deezer.com/track/4763165 + * + * e.g. for YouTube: https://www.youtube.com/watch?v=oRdxUFDoQe0 + * @type {string} * @memberof Item */ - sourceFile?: Blob; + externalUri?: string; /** - * URL of a streamable audio source to process. + * Provider's id of the audio source. + * + * e.g. for Deezer preview: 4763165 + * + * e.g. for YouTube: oRdxUFDoQe0 * @type {string} * @memberof Item */ - sourceUrl?: string; + externalId?: string; /** * * @type {string} * @memberof Item */ - title?: string; + readonly waveformUrl?: string; /** * - * @type {string} + * @type {Array} * @memberof Item */ - readonly url?: string; + readonly annotationTracks?: Array; /** * - * @type {string} + * @type {Array} * @memberof Item */ - readonly uuid?: string; + readonly analysisTracks?: Array; /** - * + * Audio provider (e.g. Deezer, Youtube, etc.) * @type {string} * @memberof Item */ - readonly waveformUrl?: string; + provider?: string | null; } export function ItemFromJSON(json: any): Item { @@ -134,22 +142,22 @@ export function ItemFromJSONTyped(json: any, ignoreDiscriminator: boolean): Item } return { - 'analysisTracks': !exists(json, 'analysis_tracks') ? undefined : json['analysis_tracks'], - 'annotationTracks': !exists(json, 'annotation_tracks') ? undefined : json['annotation_tracks'], - 'audioDuration': !exists(json, 'audio_duration') ? undefined : json['audio_duration'], - 'audioUrl': !exists(json, 'audio_url') ? undefined : ItemAudioUrlFromJSON(json['audio_url']), - 'description': !exists(json, 'description') ? undefined : json['description'], - 'externalId': !exists(json, 'external_id') ? undefined : json['external_id'], - 'externalUri': !exists(json, 'external_uri') ? undefined : json['external_uri'], - 'mimeType': !exists(json, 'mime_type') ? undefined : json['mime_type'], + 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'url': !exists(json, 'url') ? undefined : json['url'], 'playerUrl': !exists(json, 'player_url') ? undefined : json['player_url'], - 'provider': !exists(json, 'provider') ? undefined : json['provider'], + 'title': !exists(json, 'title') ? undefined : json['title'], + 'description': !exists(json, 'description') ? undefined : json['description'], 'sourceFile': !exists(json, 'source_file') ? undefined : json['source_file'], 'sourceUrl': !exists(json, 'source_url') ? undefined : json['source_url'], - 'title': !exists(json, 'title') ? undefined : json['title'], - 'url': !exists(json, 'url') ? undefined : json['url'], - 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'mimeType': !exists(json, 'mime_type') ? undefined : json['mime_type'], + 'audioUrl': !exists(json, 'audio_url') ? undefined : ItemAudioUrlFromJSON(json['audio_url']), + 'audioDuration': !exists(json, 'audio_duration') ? undefined : json['audio_duration'], + 'externalUri': !exists(json, 'external_uri') ? undefined : json['external_uri'], + 'externalId': !exists(json, 'external_id') ? undefined : json['external_id'], 'waveformUrl': !exists(json, 'waveform_url') ? undefined : json['waveform_url'], + 'annotationTracks': !exists(json, 'annotation_tracks') ? undefined : json['annotation_tracks'], + 'analysisTracks': !exists(json, 'analysis_tracks') ? undefined : json['analysis_tracks'], + 'provider': !exists(json, 'provider') ? undefined : json['provider'], }; } @@ -162,15 +170,15 @@ export function ItemToJSON(value?: Item | null): any { } return { - 'audio_url': ItemAudioUrlToJSON(value.audioUrl), + 'title': value.title, 'description': value.description, - 'external_id': value.externalId, - 'external_uri': value.externalUri, - 'mime_type': value.mimeType, - 'provider': value.provider, 'source_file': value.sourceFile, 'source_url': value.sourceUrl, - 'title': value.title, + 'mime_type': value.mimeType, + 'audio_url': ItemAudioUrlToJSON(value.audioUrl), + 'external_uri': value.externalUri, + 'external_id': value.externalId, + 'provider': value.provider, }; } diff --git a/src/models/ItemAudioUrl.ts b/src/models/ItemAudioUrl.ts index f8ca738..9fa1fb3 100644 --- a/src/models/ItemAudioUrl.ts +++ b/src/models/ItemAudioUrl.ts @@ -31,6 +31,12 @@ export interface ItemAudioUrl { * @memberof ItemAudioUrl */ readonly ogg?: string; + /** + * + * @type {string} + * @memberof ItemAudioUrl + */ + readonly flac?: string; } export function ItemAudioUrlFromJSON(json: any): ItemAudioUrl { @@ -45,6 +51,7 @@ export function ItemAudioUrlFromJSONTyped(json: any, ignoreDiscriminator: boolea 'mp3': !exists(json, 'mp3') ? undefined : json['mp3'], 'ogg': !exists(json, 'ogg') ? undefined : json['ogg'], + 'flac': !exists(json, 'flac') ? undefined : json['flac'], }; } diff --git a/src/models/ItemList.ts b/src/models/ItemList.ts index e3ecc20..bcf25c4 100644 --- a/src/models/ItemList.ts +++ b/src/models/ItemList.ts @@ -24,49 +24,49 @@ export interface ItemList { * @type {string} * @memberof ItemList */ - description?: string; + readonly uuid?: string; /** * * @type {string} * @memberof ItemList */ - mimeType?: string; + readonly url?: string; /** * * @type {string} * @memberof ItemList */ - readonly playerUrl?: string; + title?: string; /** - * Audio file to process. - * @type {Blob} + * + * @type {string} * @memberof ItemList */ - sourceFile?: Blob; + description?: string; /** - * URL of a streamable audio source to process. + * * @type {string} * @memberof ItemList */ - sourceUrl?: string; + readonly playerUrl?: string; /** - * - * @type {string} + * Audio file to process. + * @type {Blob} * @memberof ItemList */ - title?: string; + sourceFile?: Blob; /** - * + * URL of a streamable audio source to process. * @type {string} * @memberof ItemList */ - readonly url?: string; + sourceUrl?: string; /** * * @type {string} * @memberof ItemList */ - readonly uuid?: string; + mimeType?: string; } export function ItemListFromJSON(json: any): ItemList { @@ -79,14 +79,14 @@ export function ItemListFromJSONTyped(json: any, ignoreDiscriminator: boolean): } return { + 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'url': !exists(json, 'url') ? undefined : json['url'], + 'title': !exists(json, 'title') ? undefined : json['title'], 'description': !exists(json, 'description') ? undefined : json['description'], - 'mimeType': !exists(json, 'mime_type') ? undefined : json['mime_type'], 'playerUrl': !exists(json, 'player_url') ? undefined : json['player_url'], 'sourceFile': !exists(json, 'source_file') ? undefined : json['source_file'], 'sourceUrl': !exists(json, 'source_url') ? undefined : json['source_url'], - 'title': !exists(json, 'title') ? undefined : json['title'], - 'url': !exists(json, 'url') ? undefined : json['url'], - 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'mimeType': !exists(json, 'mime_type') ? undefined : json['mime_type'], }; } @@ -99,11 +99,11 @@ export function ItemListToJSON(value?: ItemList | null): any { } return { + 'title': value.title, 'description': value.description, - 'mime_type': value.mimeType, 'source_file': value.sourceFile, 'source_url': value.sourceUrl, - 'title': value.title, + 'mime_type': value.mimeType, }; } diff --git a/src/models/ItemWaveform.ts b/src/models/ItemWaveform.ts index 27cc6ec..b2bb399 100644 --- a/src/models/ItemWaveform.ts +++ b/src/models/ItemWaveform.ts @@ -40,22 +40,22 @@ export interface ItemWaveform { title?: string; /** * - * @type {ItemWaveformWaveform} + * @type {string} * @memberof ItemWaveform */ - waveform?: ItemWaveformWaveform; + readonly waveformUrl?: string; /** * - * @type {string} + * @type {ItemWaveformWaveform} * @memberof ItemWaveform */ - readonly waveformImageUrl?: string; + waveform?: ItemWaveformWaveform; /** * * @type {string} * @memberof ItemWaveform */ - readonly waveformUrl?: string; + readonly waveformImageUrl?: string; } export function ItemWaveformFromJSON(json: any): ItemWaveform { @@ -70,9 +70,9 @@ export function ItemWaveformFromJSONTyped(json: any, ignoreDiscriminator: boolea 'itemUrl': !exists(json, 'item_url') ? undefined : json['item_url'], 'title': !exists(json, 'title') ? undefined : json['title'], + 'waveformUrl': !exists(json, 'waveform_url') ? undefined : json['waveform_url'], 'waveform': !exists(json, 'waveform') ? undefined : ItemWaveformWaveformFromJSON(json['waveform']), 'waveformImageUrl': !exists(json, 'waveform_image_url') ? undefined : json['waveform_image_url'], - 'waveformUrl': !exists(json, 'waveform_url') ? undefined : json['waveform_url'], }; } diff --git a/src/models/ItemWaveformWaveform.ts b/src/models/ItemWaveformWaveform.ts index acc5114..f161f7d 100644 --- a/src/models/ItemWaveformWaveform.ts +++ b/src/models/ItemWaveformWaveform.ts @@ -21,16 +21,16 @@ import { exists, mapValues } from '../runtime'; export interface ItemWaveformWaveform { /** * - * @type {Array} + * @type {number} * @memberof ItemWaveformWaveform */ - max: Array; + start?: number; /** * - * @type {Array} + * @type {number} * @memberof ItemWaveformWaveform */ - min: Array; + stop?: number; /** * * @type {number} @@ -39,16 +39,16 @@ export interface ItemWaveformWaveform { nbPixels: number; /** * - * @type {number} + * @type {Array} * @memberof ItemWaveformWaveform */ - start?: number; + min: Array; /** * - * @type {number} + * @type {Array} * @memberof ItemWaveformWaveform */ - stop?: number; + max: Array; /** * * @type {Array} @@ -67,11 +67,11 @@ export function ItemWaveformWaveformFromJSONTyped(json: any, ignoreDiscriminator } return { - 'max': json['max'], - 'min': json['min'], - 'nbPixels': json['nb_pixels'], 'start': !exists(json, 'start') ? undefined : json['start'], 'stop': !exists(json, 'stop') ? undefined : json['stop'], + 'nbPixels': json['nb_pixels'], + 'min': json['min'], + 'max': json['max'], 'time': json['time'], }; } @@ -85,11 +85,11 @@ export function ItemWaveformWaveformToJSON(value?: ItemWaveformWaveform | null): } return { - 'max': value.max, - 'min': value.min, - 'nb_pixels': value.nbPixels, 'start': value.start, 'stop': value.stop, + 'nb_pixels': value.nbPixels, + 'min': value.min, + 'max': value.max, 'time': value.time, }; } diff --git a/src/models/Preset.ts b/src/models/Preset.ts index 4b9537f..3f02562 100644 --- a/src/models/Preset.ts +++ b/src/models/Preset.ts @@ -24,25 +24,25 @@ export interface Preset { * @type {string} * @memberof Preset */ - parameters?: string; + readonly url?: string; /** * * @type {string} * @memberof Preset */ - processor?: string | null; + readonly uuid?: string; /** * * @type {string} * @memberof Preset */ - readonly url?: string; + processor?: string | null; /** * * @type {string} * @memberof Preset */ - readonly uuid?: string; + parameters?: string; } export function PresetFromJSON(json: any): Preset { @@ -55,10 +55,10 @@ export function PresetFromJSONTyped(json: any, ignoreDiscriminator: boolean): Pr } return { - 'parameters': !exists(json, 'parameters') ? undefined : json['parameters'], - 'processor': !exists(json, 'processor') ? undefined : json['processor'], 'url': !exists(json, 'url') ? undefined : json['url'], 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'processor': !exists(json, 'processor') ? undefined : json['processor'], + 'parameters': !exists(json, 'parameters') ? undefined : json['parameters'], }; } @@ -71,8 +71,8 @@ export function PresetToJSON(value?: Preset | null): any { } return { - 'parameters': value.parameters, 'processor': value.processor, + 'parameters': value.parameters, }; } diff --git a/src/models/Processor.ts b/src/models/Processor.ts index 20ceccf..b00b4dd 100644 --- a/src/models/Processor.ts +++ b/src/models/Processor.ts @@ -30,25 +30,25 @@ export interface Processor { * @type {string} * @memberof Processor */ - readonly parametersSchema?: string; + pid: ProcessorPidEnum; /** * * @type {string} * @memberof Processor */ - pid: ProcessorPidEnum; + readonly url?: string; /** * * @type {string} * @memberof Processor */ - readonly url?: string; + version?: string; /** * * @type {string} * @memberof Processor */ - version?: string; + readonly parametersSchema?: string; } export function ProcessorFromJSON(json: any): Processor { @@ -62,10 +62,10 @@ export function ProcessorFromJSONTyped(json: any, ignoreDiscriminator: boolean): return { 'name': !exists(json, 'name') ? undefined : json['name'], - 'parametersSchema': !exists(json, 'parameters_schema') ? undefined : json['parameters_schema'], 'pid': json['pid'], 'url': !exists(json, 'url') ? undefined : json['url'], 'version': !exists(json, 'version') ? undefined : json['version'], + 'parametersSchema': !exists(json, 'parameters_schema') ? undefined : json['parameters_schema'], }; } diff --git a/src/models/Provider.ts b/src/models/Provider.ts index affcfef..8c33b2f 100644 --- a/src/models/Provider.ts +++ b/src/models/Provider.ts @@ -25,18 +25,18 @@ export interface Provider { * @memberof Provider */ pid?: string; - /** - * Whether or not the audio is freely available from the provider. - * @type {boolean} - * @memberof Provider - */ - sourceAccess?: boolean; /** * * @type {string} * @memberof Provider */ readonly uuid?: string; + /** + * Whether or not the audio is freely available from the provider. + * @type {boolean} + * @memberof Provider + */ + sourceAccess?: boolean; } export function ProviderFromJSON(json: any): Provider { @@ -50,8 +50,8 @@ export function ProviderFromJSONTyped(json: any, ignoreDiscriminator: boolean): return { 'pid': !exists(json, 'pid') ? undefined : json['pid'], - 'sourceAccess': !exists(json, 'source_access') ? undefined : json['source_access'], 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'sourceAccess': !exists(json, 'source_access') ? undefined : json['source_access'], }; } diff --git a/src/models/Result.ts b/src/models/Result.ts index 96531bd..9a72655 100644 --- a/src/models/Result.ts +++ b/src/models/Result.ts @@ -20,17 +20,17 @@ import { exists, mapValues } from '../runtime'; */ export interface Result { /** - * Non numerical result stored in a file (image, transcoded audio, etc.) - * @type {Blob} + * + * @type {string} * @memberof Result */ - file?: Blob; + readonly uuid?: string; /** - * Numerical result of the processing stored in an hdf5 file. - * @type {Blob} + * + * @type {string} * @memberof Result */ - hdf5?: Blob; + readonly url?: string; /** * Item on which a preset has been applied. * @type {string} @@ -38,41 +38,52 @@ export interface Result { */ item?: string | null; /** - * + * Preset applied on an item. * @type {string} * @memberof Result */ - mimeType?: string; + preset?: string | null; /** - * Preset applied on an item. - * @type {string} + * Status of the task giving the result: + * + * failed: 0 + * + * draft: 1 + * + * pending: 2 + * + * running: 3 + * + * done: 4 + * @type {number} * @memberof Result */ - preset?: string | null; + status?: ResultStatusEnum; /** - * Duration of the result computing. + * * @type {string} * @memberof Result */ - runTime?: string | null; + mimeType?: string; /** - * Status of the task giving the result: failed: 0 draft: 1 pending: 2 running: 3 done: 4 - * @type {number} + * Numerical result of the processing stored in an hdf5 file. + * @type {Blob} * @memberof Result */ - status?: number; + hdf5?: Blob; /** - * - * @type {string} + * Non numerical result stored in a file + * (image, transcoded audio, etc.) + * @type {Blob} * @memberof Result */ - readonly url?: string; + file?: Blob; /** - * + * Duration of the result computing. * @type {string} * @memberof Result */ - readonly uuid?: string; + runTime?: string | null; } export function ResultFromJSON(json: any): Result { @@ -85,15 +96,15 @@ export function ResultFromJSONTyped(json: any, ignoreDiscriminator: boolean): Re } return { - 'file': !exists(json, 'file') ? undefined : json['file'], - 'hdf5': !exists(json, 'hdf5') ? undefined : json['hdf5'], + 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'url': !exists(json, 'url') ? undefined : json['url'], 'item': !exists(json, 'item') ? undefined : json['item'], - 'mimeType': !exists(json, 'mime_type') ? undefined : json['mime_type'], 'preset': !exists(json, 'preset') ? undefined : json['preset'], - 'runTime': !exists(json, 'run_time') ? undefined : json['run_time'], 'status': !exists(json, 'status') ? undefined : json['status'], - 'url': !exists(json, 'url') ? undefined : json['url'], - 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'mimeType': !exists(json, 'mime_type') ? undefined : json['mime_type'], + 'hdf5': !exists(json, 'hdf5') ? undefined : json['hdf5'], + 'file': !exists(json, 'file') ? undefined : json['file'], + 'runTime': !exists(json, 'run_time') ? undefined : json['run_time'], }; } @@ -106,14 +117,26 @@ export function ResultToJSON(value?: Result | null): any { } return { - 'file': value.file, - 'hdf5': value.hdf5, 'item': value.item, - 'mime_type': value.mimeType, 'preset': value.preset, - 'run_time': value.runTime, 'status': value.status, + 'mime_type': value.mimeType, + 'hdf5': value.hdf5, + 'file': value.file, + 'run_time': value.runTime, }; } +/** +* @export +* @enum {string} +*/ +export enum ResultStatusEnum { + NUMBER_0 = 0, + NUMBER_1 = 1, + NUMBER_2 = 2, + NUMBER_3 = 3, + NUMBER_4 = 4 +} + diff --git a/src/models/Selection.ts b/src/models/Selection.ts index 27eeca9..755fd8c 100644 --- a/src/models/Selection.ts +++ b/src/models/Selection.ts @@ -24,37 +24,37 @@ export interface Selection { * @type {string} * @memberof Selection */ - author?: string | null; + readonly title?: string; /** * - * @type {Array} + * @type {string} * @memberof Selection */ - items?: Array; + readonly uuid?: string; /** - * Include other selections in an selection. - * @type {Array} + * + * @type {string} * @memberof Selection */ - selections?: Array; + readonly url?: string; /** * - * @type {string} + * @type {Array} * @memberof Selection */ - readonly title?: string; + items?: Array; /** - * - * @type {string} + * Include other selections in an selection. + * @type {Array} * @memberof Selection */ - readonly url?: string; + selections?: Array; /** * * @type {string} * @memberof Selection */ - readonly uuid?: string; + author?: string | null; } export function SelectionFromJSON(json: any): Selection { @@ -67,12 +67,12 @@ export function SelectionFromJSONTyped(json: any, ignoreDiscriminator: boolean): } return { - 'author': !exists(json, 'author') ? undefined : json['author'], - 'items': !exists(json, 'items') ? undefined : json['items'], - 'selections': !exists(json, 'selections') ? undefined : json['selections'], 'title': !exists(json, 'title') ? undefined : json['title'], - 'url': !exists(json, 'url') ? undefined : json['url'], 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'url': !exists(json, 'url') ? undefined : json['url'], + 'items': !exists(json, 'items') ? undefined : json['items'], + 'selections': !exists(json, 'selections') ? undefined : json['selections'], + 'author': !exists(json, 'author') ? undefined : json['author'], }; } @@ -85,9 +85,9 @@ export function SelectionToJSON(value?: Selection | null): any { } return { - 'author': value.author, 'items': value.items, 'selections': value.selections, + 'author': value.author, }; } diff --git a/src/models/SubProcessor.ts b/src/models/SubProcessor.ts new file mode 100644 index 0000000..ac015fb --- /dev/null +++ b/src/models/SubProcessor.ts @@ -0,0 +1,80 @@ +/* tslint:disable */ +/* eslint-disable */ +/** + * TimeSide API + * RESTful API of TimeSide, a scalable audio processing framework. + * + * The version of the OpenAPI document: 1.0.0 + * + * + * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech). + * https://openapi-generator.tech + * Do not edit the class manually. + */ + +import { exists, mapValues } from '../runtime'; +/** + * + * @export + * @interface SubProcessor + */ +export interface SubProcessor { + /** + * + * @type {string} + * @memberof SubProcessor + */ + readonly url?: string; + /** + * + * @type {string} + * @memberof SubProcessor + */ + name?: string; + /** + * + * @type {string} + * @memberof SubProcessor + */ + processor?: string | null; + /** + * + * @type {string} + * @memberof SubProcessor + */ + subProcessorId: string; +} + +export function SubProcessorFromJSON(json: any): SubProcessor { + return SubProcessorFromJSONTyped(json, false); +} + +export function SubProcessorFromJSONTyped(json: any, ignoreDiscriminator: boolean): SubProcessor { + if ((json === undefined) || (json === null)) { + return json; + } + return { + + 'url': !exists(json, 'url') ? undefined : json['url'], + 'name': !exists(json, 'name') ? undefined : json['name'], + 'processor': !exists(json, 'processor') ? undefined : json['processor'], + 'subProcessorId': json['sub_processor_id'], + }; +} + +export function SubProcessorToJSON(value?: SubProcessor | null): any { + if (value === undefined) { + return undefined; + } + if (value === null) { + return null; + } + return { + + 'name': value.name, + 'processor': value.processor, + 'sub_processor_id': value.subProcessorId, + }; +} + + diff --git a/src/models/Task.ts b/src/models/Task.ts index b453aa6..1f94e2d 100644 --- a/src/models/Task.ts +++ b/src/models/Task.ts @@ -24,19 +24,19 @@ export interface Task { * @type {string} * @memberof Task */ - author?: string | null; + readonly url?: string; /** - * Experience prossessed in the task. + * * @type {string} * @memberof Task */ - experience?: string | null; + readonly uuid?: string; /** - * Single item prossessed in the task. + * Experience prossessed in the task. * @type {string} * @memberof Task */ - item?: string | null; + experience?: string | null; /** * Selection prossessed in the task. * @type {string} @@ -44,23 +44,33 @@ export interface Task { */ selection?: string | null; /** - * Task\'s status: failed: 0 draft: 1 pending: 2 running: 3 done: 4 + * Task's status: + * + * failed: 0 + * + * draft: 1 + * + * pending: 2 + * + * running: 3 + * + * done: 4 * @type {number} * @memberof Task */ - status?: number; + status?: TaskStatusEnum; /** * * @type {string} * @memberof Task */ - readonly url?: string; + author?: string | null; /** - * + * Single item prossessed in the task. * @type {string} * @memberof Task */ - readonly uuid?: string; + item?: string | null; } export function TaskFromJSON(json: any): Task { @@ -73,13 +83,13 @@ export function TaskFromJSONTyped(json: any, ignoreDiscriminator: boolean): Task } return { - 'author': !exists(json, 'author') ? undefined : json['author'], + 'url': !exists(json, 'url') ? undefined : json['url'], + 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], 'experience': !exists(json, 'experience') ? undefined : json['experience'], - 'item': !exists(json, 'item') ? undefined : json['item'], 'selection': !exists(json, 'selection') ? undefined : json['selection'], 'status': !exists(json, 'status') ? undefined : json['status'], - 'url': !exists(json, 'url') ? undefined : json['url'], - 'uuid': !exists(json, 'uuid') ? undefined : json['uuid'], + 'author': !exists(json, 'author') ? undefined : json['author'], + 'item': !exists(json, 'item') ? undefined : json['item'], }; } @@ -92,12 +102,24 @@ export function TaskToJSON(value?: Task | null): any { } return { - 'author': value.author, 'experience': value.experience, - 'item': value.item, 'selection': value.selection, 'status': value.status, + 'author': value.author, + 'item': value.item, }; } +/** +* @export +* @enum {string} +*/ +export enum TaskStatusEnum { + NUMBER_0 = 0, + NUMBER_1 = 1, + NUMBER_2 = 2, + NUMBER_3 = 3, + NUMBER_4 = 4 +} + diff --git a/src/models/TokenObtainPair.ts b/src/models/TokenObtainPair.ts index 45ce0d8..1492387 100644 --- a/src/models/TokenObtainPair.ts +++ b/src/models/TokenObtainPair.ts @@ -24,13 +24,13 @@ export interface TokenObtainPair { * @type {string} * @memberof TokenObtainPair */ - password: string; + username: string; /** * * @type {string} * @memberof TokenObtainPair */ - username: string; + password: string; } export function TokenObtainPairFromJSON(json: any): TokenObtainPair { @@ -43,8 +43,8 @@ export function TokenObtainPairFromJSONTyped(json: any, ignoreDiscriminator: boo } return { - 'password': json['password'], 'username': json['username'], + 'password': json['password'], }; } @@ -57,8 +57,8 @@ export function TokenObtainPairToJSON(value?: TokenObtainPair | null): any { } return { - 'password': value.password, 'username': value.username, + 'password': value.password, }; } diff --git a/src/models/User.ts b/src/models/User.ts index 537810d..d275525 100644 --- a/src/models/User.ts +++ b/src/models/User.ts @@ -24,25 +24,25 @@ export interface User { * @type {string} * @memberof User */ - firstName?: string; + readonly url?: string; /** - * + * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. * @type {string} * @memberof User */ - lastName?: string; + username: string; /** * * @type {string} * @memberof User */ - readonly url?: string; + firstName?: string; /** - * Required. 150 characters or fewer. Letters, digits and @/./+/-/_ only. + * * @type {string} * @memberof User */ - username: string; + lastName?: string; } export function UserFromJSON(json: any): User { @@ -55,10 +55,10 @@ export function UserFromJSONTyped(json: any, ignoreDiscriminator: boolean): User } return { - 'firstName': !exists(json, 'first_name') ? undefined : json['first_name'], - 'lastName': !exists(json, 'last_name') ? undefined : json['last_name'], 'url': !exists(json, 'url') ? undefined : json['url'], 'username': json['username'], + 'firstName': !exists(json, 'first_name') ? undefined : json['first_name'], + 'lastName': !exists(json, 'last_name') ? undefined : json['last_name'], }; } @@ -71,9 +71,9 @@ export function UserToJSON(value?: User | null): any { } return { + 'username': value.username, 'first_name': value.firstName, 'last_name': value.lastName, - 'username': value.username, }; } diff --git a/src/models/index.ts b/src/models/index.ts index 37a4397..361d911 100644 --- a/src/models/index.ts +++ b/src/models/index.ts @@ -16,6 +16,7 @@ export * from './ProcessorList'; export * from './Provider'; export * from './Result'; export * from './Selection'; +export * from './SubProcessor'; export * from './Task'; export * from './TokenObtainPair'; export * from './TokenRefresh'; diff --git a/src/runtime.ts b/src/runtime.ts index 8966e43..d3566cb 100644 --- a/src/runtime.ts +++ b/src/runtime.ts @@ -61,7 +61,7 @@ export class BaseAPI { // do not handle correctly sometimes. url += '?' + this.configuration.queryParamsStringify(context.query); } - const body = (context.body instanceof FormData || context.body instanceof URLSearchParams || isBlob(context.body)) + const body = ((typeof FormData !== "undefined" && context.body instanceof FormData) || context.body instanceof URLSearchParams || isBlob(context.body)) ? context.body : JSON.stringify(context.body); @@ -193,7 +193,7 @@ export class Configuration { } export type Json = any; -export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS'; +export type HTTPMethod = 'GET' | 'POST' | 'PUT' | 'PATCH' | 'DELETE' | 'OPTIONS' | 'HEAD'; export type HTTPHeaders = { [key: string]: string }; export type HTTPQuery = { [key: string]: string | number | null | boolean | Array | HTTPQuery }; export type HTTPBody = Json | FormData | URLSearchParams;