diff --git a/package-lock.json b/package-lock.json index 9662078..2bc07b6 100644 --- a/package-lock.json +++ b/package-lock.json @@ -38,6 +38,7 @@ "@angular/cli": "^17.3.0", "@angular/compiler-cli": "^17.3.0", "@angular/language-service": "^17.3.0", + "@hey-api/openapi-ts": "^0.34.0", "@types/geojson": "^7946.0.14", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "^2.0.2", @@ -52,7 +53,6 @@ "karma-cli": "^2.0.0", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~4.0.0", - "openapi-typescript-codegen": "^0.27.0", "protractor": "~7.0.0", "source-map-explorer": "^2.5.3", "ts-node": "^10.9.2", @@ -735,16 +735,14 @@ } }, "node_modules/@apidevtools/json-schema-ref-parser": { - "version": "10.1.0", - "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-10.1.0.tgz", - "integrity": "sha512-3e+viyMuXdrcK8v5pvP+SDoAQ77FH6OyRmuK48SZKmdHJRFm87RsSs8qm6kP39a/pOPURByJw+OXzQIqcfmKtA==", + "version": "11.5.4", + "resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-11.5.4.tgz", + "integrity": "sha512-o2fsypTGU0WxRxbax8zQoHiIB4dyrkwYfcm8TxZ+bx9pCzcWZbQtiMqpgBvWA/nJ2TrGjK5adCLfTH8wUeU/Wg==", "dev": true, "dependencies": { "@jsdevtools/ono": "^7.1.3", - "@types/json-schema": "^7.0.11", - "@types/lodash.clonedeep": "^4.5.7", - "js-yaml": "^4.1.0", - "lodash.clonedeep": "^4.5.0" + "@types/json-schema": "^7.0.15", + "js-yaml": "^4.1.0" }, "engines": { "node": ">= 16" @@ -2913,6 +2911,45 @@ "node": ">=12" } }, + "node_modules/@hey-api/openapi-ts": { + "version": "0.34.0", + "resolved": "https://registry.npmjs.org/@hey-api/openapi-ts/-/openapi-ts-0.34.0.tgz", + "integrity": "sha512-Q/fgZ9moh7HRKlWbkVTjNez2QSgKbRgpwbAT8DXWl8XfUVRoEc3pAhRLJ4aZOOP3RYGQHIIbiU9lRrsLTf0NIg==", + "dev": true, + "dependencies": { + "@apidevtools/json-schema-ref-parser": "11.5.4", + "camelcase": "8.0.0", + "commander": "12.0.0", + "handlebars": "4.7.8" + }, + "bin": { + "openapi-ts": "bin/index.js" + }, + "engines": { + "node": "^18.0.0 || >=20.0.0" + } + }, + "node_modules/@hey-api/openapi-ts/node_modules/camelcase": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-8.0.0.tgz", + "integrity": "sha512-8WB3Jcas3swSvjIeA2yvCJ+Miyz5l1ZmB6HFb9R1317dt9LCQoswg/BGrmAmkWVEszSrrg4RwmO46qIm2OEnSA==", + "dev": true, + "engines": { + "node": ">=16" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/@hey-api/openapi-ts/node_modules/commander": { + "version": "12.0.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-12.0.0.tgz", + "integrity": "sha512-MwVNWlYjDTtOjX5PiD7o5pK0UrFU/OYgcJfjjK4RaHZETNtjJqrZa9Y9ds88+A+f+d5lv+561eZ+yCKoS3gbAA==", + "dev": true, + "engines": { + "node": ">=18" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -4814,21 +4851,6 @@ "integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==", "dev": true }, - "node_modules/@types/lodash": { - "version": "4.14.202", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.202.tgz", - "integrity": "sha512-OvlIYQK9tNneDlS0VN54LLd5uiPCBOp7gS5Z0f1mjoJYBrtStzgmJBxONW3U6OZqdtNzZPmn9BS/7WI7BFFcFQ==", - "dev": true - }, - "node_modules/@types/lodash.clonedeep": { - "version": "4.5.9", - "resolved": "https://registry.npmjs.org/@types/lodash.clonedeep/-/lodash.clonedeep-4.5.9.tgz", - "integrity": "sha512-19429mWC+FyaAhOLzsS8kZUsI+/GmBAQ0HFiCPsKGU+7pBXOQWhyrY6xNNDwUSX8SMZMJvuFVMF9O5dQOlQK9Q==", - "dev": true, - "dependencies": { - "@types/lodash": "*" - } - }, "node_modules/@types/mapbox__point-geometry": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/@types/mapbox__point-geometry/-/mapbox__point-geometry-0.1.4.tgz", @@ -8170,20 +8192,6 @@ "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", "dev": true }, - "node_modules/fs-extra": { - "version": "11.2.0", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", - "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", - "dev": true, - "dependencies": { - "graceful-fs": "^4.2.0", - "jsonfile": "^6.0.1", - "universalify": "^2.0.0" - }, - "engines": { - "node": ">=14.14" - } - }, "node_modules/fs-minipass": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-3.0.3.tgz", @@ -9816,18 +9824,6 @@ "integrity": "sha512-AilxAyFOAcK5wA1+LeaySVBrHsGQvUFCDWXKpZjzaL0PqW+xfBOttn8GNtWKFWqneyMZj41MWF9Kl6iPWLwgOA==", "dev": true }, - "node_modules/jsonfile": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", - "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", - "dev": true, - "dependencies": { - "universalify": "^2.0.0" - }, - "optionalDependencies": { - "graceful-fs": "^4.1.6" - } - }, "node_modules/jsonparse": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/jsonparse/-/jsonparse-1.3.1.tgz", @@ -10258,12 +10254,6 @@ "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", "dev": true }, - "node_modules/lodash.clonedeep": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", - "integrity": "sha512-H5ZhCF25riFd9uB5UCkVKo61m3S/xZk1x4wA6yp/L3RFP6Z/eHH1ymQcGLo7J3GMPfm0V/7m1tryHuGVxpqEBQ==", - "dev": true - }, "node_modules/lodash.debounce": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/lodash.debounce/-/lodash.debounce-4.0.8.tgz", @@ -11373,43 +11363,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/openapi-typescript-codegen": { - "version": "0.27.0", - "resolved": "https://registry.npmjs.org/openapi-typescript-codegen/-/openapi-typescript-codegen-0.27.0.tgz", - "integrity": "sha512-QyQEod/vuel3zfnTRC3GgmYsqLPSBzB2OL4ojMYjO9hJmfYW02T+7tbQWEnuqWdhh2KSOBf3L8h59vLStr6vwA==", - "dev": true, - "dependencies": { - "@apidevtools/json-schema-ref-parser": "^10.1.0", - "camelcase": "^6.3.0", - "commander": "^11.1.0", - "fs-extra": "^11.2.0", - "handlebars": "^4.7.8" - }, - "bin": { - "openapi": "bin/index.js" - } - }, - "node_modules/openapi-typescript-codegen/node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "dev": true, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/openapi-typescript-codegen/node_modules/commander": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-11.1.0.tgz", - "integrity": "sha512-yPVavfyCcRhmorC7rWlkHn15b4wDVgVmBA7kV4QVBsF7kv/9TKJAbAXVTxvTnwP8HHKjRCJDClKbciiYS7p0DQ==", - "dev": true, - "engines": { - "node": ">=16" - } - }, "node_modules/ora": { "version": "5.4.1", "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", @@ -14992,15 +14945,6 @@ "node": "^14.17.0 || ^16.13.0 || >=18.0.0" } }, - "node_modules/universalify": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", - "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", - "dev": true, - "engines": { - "node": ">= 10.0.0" - } - }, "node_modules/unpipe": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", diff --git a/package.json b/package.json index 9544738..7e18165 100644 --- a/package.json +++ b/package.json @@ -17,7 +17,7 @@ "test": "ng test", "lint": "ng lint", "e2e": "ng e2e", - "generate-client": "openapi --input http://127.0.0.1:5000/openapi.json --output ./src/app/openapi --client angular --useUnionTypes", + "openapi-ts": "openapi-ts -i http://127.0.0.1:5000/openapi.json -o src/app/openapi --client angular", "source-map-explorer": "source-map-explorer dist/*.js" }, "licenses": [ @@ -57,6 +57,7 @@ "@angular/cli": "^17.3.0", "@angular/compiler-cli": "^17.3.0", "@angular/language-service": "^17.3.0", + "@hey-api/openapi-ts": "^0.34.0", "@types/geojson": "^7946.0.14", "@types/jasmine": "~3.6.0", "@types/jasminewd2": "^2.0.2", @@ -71,7 +72,6 @@ "karma-cli": "^2.0.0", "karma-coverage-istanbul-reporter": "~3.0.2", "karma-jasmine": "~4.0.0", - "openapi-typescript-codegen": "^0.27.0", "protractor": "~7.0.0", "source-map-explorer": "^2.5.3", "ts-node": "^10.9.2", @@ -79,4 +79,4 @@ "tslint": "~6.1.0", "typescript": "~5.3.3" } -} \ No newline at end of file +} diff --git a/src/app/_services/actions.service.ts b/src/app/_services/actions.service.ts index 0d72d28..8542e8e 100644 --- a/src/app/_services/actions.service.ts +++ b/src/app/_services/actions.service.ts @@ -170,11 +170,13 @@ export class ActionsService { formFields?: FormFieldInput[] ): Observable { return this.apiService.executeTagActionApiExecTagActionsPost({ - "stores": stores, - "ids": ids, - "actionNames": actionNames, - "params": params, - "formFields": formFields + "requestBody": { + "stores": stores, + "ids": ids, + "actionNames": actionNames, + "params": params, + "formFields": formFields + } }) } } diff --git a/src/app/_services/authentication.service.ts b/src/app/_services/authentication.service.ts index 96bf1cb..6ad2b4b 100644 --- a/src/app/_services/authentication.service.ts +++ b/src/app/_services/authentication.service.ts @@ -59,8 +59,10 @@ export class AuthenticationService { // formData.set('username', userName) // formData.set('password', password) return this.api.loginForAccessTokenApiTokenPost({ - username: username, - password: password + "formData": { + username: username, + password: password + } }).pipe(map( token => { localStorage.setItem('token', token.access_token) diff --git a/src/app/_services/data.service.ts b/src/app/_services/data.service.ts index 87e2a32..9370a9b 100644 --- a/src/app/_services/data.service.ts +++ b/src/app/_services/data.service.ts @@ -36,7 +36,7 @@ export class DataService { } getList(store: string): Observable { - return this.api.getModelListApiDataProviderStoreGet(store) + return this.api.getModelListApiDataProviderStoreGet({store: store}) } getValues( @@ -47,7 +47,7 @@ export class DataService { format: string = 'json', rangeFrom?: string, rangeTo?: string - ): Observable> { + ): Observable { let p = {} let s = {} p[store] = id @@ -62,7 +62,12 @@ export class DataService { // .set('format', format) // FIXME: add the name of the value to fetch return this.api.getModelValuesApiStoreNameValuesValueGet( - store, value, JSON.stringify(p), sampling + { + storeName: store, + value: value, + where: JSON.stringify(p), + resample: sampling + } ) } } diff --git a/src/app/_services/geojson.service.ts b/src/app/_services/geojson.service.ts index 6f0c373..6b5929a 100644 --- a/src/app/_services/geojson.service.ts +++ b/src/app/_services/geojson.service.ts @@ -34,7 +34,7 @@ export class GeoJsonService { } getStyle(store: string): Observable { - return this.mapService.getLayerStyleApiMapLayerStyleStoreGet(store) + return this.mapService.getLayerStyleApiMapLayerStyleStoreGet({store: store}) } getAll(url: string, store: string, params?: object): Observable { diff --git a/src/app/admin/admin-basket/data.service.ts b/src/app/admin/admin-basket/data.service.ts index c69ad22..c6a3fec 100644 --- a/src/app/admin/admin-basket/data.service.ts +++ b/src/app/admin/admin-basket/data.service.ts @@ -151,7 +151,7 @@ export class AdminBasketDataService { getBasket(name: string): Observable { // Get all info and content of a basket - return this.adminService.getBasketApiAdminBasketNameGet(name) + return this.adminService.getBasketApiAdminBasketNameGet({name: name}) console.warn('Migrate Graphql') return observableOf() // return this.apollo.query({ diff --git a/src/app/app.module.ts b/src/app/app.module.ts index 13529ec..47f8615 100644 --- a/src/app/app.module.ts +++ b/src/app/app.module.ts @@ -21,11 +21,11 @@ import { ModelDataService } from './_services/apollo.service' import { ActionsService } from './_services/actions.service' import { ConfigService } from './_services/config.service' -import { ApiService } from './openapi/services/ApiService' -import { AdminService } from './openapi/services/AdminService' -import { DashboardService } from './openapi/services/DashboardService' -import { GeoapiService } from './openapi/services/GeoapiService' -import { MapService } from './openapi/services/MapService' +import { ApiService } from './openapi/services' +import { AdminService } from './openapi/services' +import { DashboardService } from './openapi/services' +import { GeoapiService } from './openapi/services' +import { MapService } from './openapi/services' import { httpInterceptorProviders } from './_helpers/http.interceptor' import { HtmlSnackbarComponent } from './custom-snackbar/custom-snackbar.component' diff --git a/src/app/dashboard/dashboard-page/dashboard-page-resolver.service.ts b/src/app/dashboard/dashboard-page/dashboard-page-resolver.service.ts index fb698a6..8991e04 100644 --- a/src/app/dashboard/dashboard-page/dashboard-page-resolver.service.ts +++ b/src/app/dashboard/dashboard-page/dashboard-page-resolver.service.ts @@ -12,9 +12,9 @@ export class DashboardPageResolver { ) {} resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { - return this.dashboardService.getDashboardPageApiDashboardPageGroupNameGet( - route.paramMap.get('group'), - route.paramMap.get('name') - ) + return this.dashboardService.getDashboardPageApiDashboardPageGroupNameGet({ + group: route.paramMap.get('group'), + name: route.paramMap.get('name') + }) } } diff --git a/src/app/info/info-data.service.ts b/src/app/info/info-data.service.ts index 13db5e9..7243043 100644 --- a/src/app/info/info-data.service.ts +++ b/src/app/info/info-data.service.ts @@ -466,7 +466,7 @@ export class InfoDataService { public taggedLayers$ = this.taggedLayers.asObservable() getModelInfo(store: string): Observable { - return this.api.getModelInfoApiModelInfoStoreGet(store) + return this.api.getModelInfoApiModelInfoStoreGet({store: store}) console.warn('Migrate Graphql') return observableOf() // return this.apollo.query({ @@ -555,7 +555,7 @@ export class InfoDataService { } getPlotParams(store: string, id: string, value: string): Observable { - return this.api.getPlotParamsApiPlotParamsStoreGet(store, id, value) + return this.api.getPlotParamsApiPlotParamsStoreGet({store: store, id: id, value: value}) console.warn('Migrate Graphql') return observableOf() // return this.apollo.query({ @@ -588,7 +588,7 @@ export class InfoDataService { } getFeatureInfo(store: string, id: string): Observable { - return this.api.getFeatureInfoApiFeatureInfoStoreIdGet(store, id) + return this.api.getFeatureInfoApiFeatureInfoStoreIdGet({store: store, id: id}) // return this.apollo.query({ // query: getFeatureInfoQuery, // variables: { diff --git a/src/app/info/info-plot/plot.component.ts b/src/app/info/info-plot/plot.component.ts index a33c463..9d609f8 100644 --- a/src/app/info/info-plot/plot.component.ts +++ b/src/app/info/info-plot/plot.component.ts @@ -12,7 +12,7 @@ import { PlotlyComponent, PlotlyService } from 'angular-plotly.js' import { DataService } from '../../_services/data.service' import { FullInfo, InfoDataService, PlotDataParams } from '../info-data.service' -import { PlotParams } from '../../openapi' +import { DownloadService, PlotParams } from '../../openapi' @Component({ selector: 'gisaf-info-plot', @@ -107,6 +107,7 @@ export class InfoPlotComponent implements OnInit, AfterViewInit { public plotly: PlotlyService, public snackBar: MatSnackBar, private cdr: ChangeDetectorRef, + public downloadService: DownloadService, ) {} ngOnInit() { @@ -310,7 +311,20 @@ export class InfoPlotComponent implements OnInit, AfterViewInit { } download() { - window.open('/download/csv/' + this.source.modelInfo.store + + // XXX: Ideally we should use openapi calls, but it's more simple to use window.open + // this.downloadService.downloadCsvApiDownloadCsvStoreModelIdValueResampleGet({ + // store: this.source.modelInfo.store, + // modelId: +this.source.featureInfo.id, + // value: this.value, + // resample: this.resampling + // }).subscribe( + // data => { + // const blob = new Blob(data, { type: 'text/csv'}) + // const blobUrl = URL.createObjectURL(blob) + // window.open(blobUrl) + // } + // ) + window.open('/api/download/csv/' + this.source.modelInfo.store + '/' + this.source.featureInfo.id + '/' + this.value + '/' + this.resampling) diff --git a/src/app/map/map-data.service.ts b/src/app/map/map-data.service.ts index e65d0d2..35f3aa8 100644 --- a/src/app/map/map-data.service.ts +++ b/src/app/map/map-data.service.ts @@ -89,7 +89,7 @@ export class MapDataService { // } getBaseStyle(styleName: string): Observable { - return this.mapService.getBaseStyleApiMapBaseStyleNameGet(styleName).pipe(map( + return this.mapService.getBaseStyleApiMapBaseStyleNameGet({name: styleName}).pipe(map( data => new BaseStyle(data.name, data.style) )) } diff --git a/src/app/openapi/core/ApiError.ts b/src/app/openapi/core/ApiError.ts index d6b8fcc..36675d2 100644 --- a/src/app/openapi/core/ApiError.ts +++ b/src/app/openapi/core/ApiError.ts @@ -1,25 +1,21 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import type { ApiRequestOptions } from './ApiRequestOptions'; import type { ApiResult } from './ApiResult'; export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: any; - public readonly request: ApiRequestOptions; + public readonly url: string; + public readonly status: number; + public readonly statusText: string; + public readonly body: unknown; + public readonly request: ApiRequestOptions; - constructor(request: ApiRequestOptions, response: ApiResult, message: string) { - super(message); + constructor(request: ApiRequestOptions, response: ApiResult, message: string) { + super(message); - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} + this.name = 'ApiError'; + this.url = response.url; + this.status = response.status; + this.statusText = response.statusText; + this.body = response.body; + this.request = request; + } +} \ No newline at end of file diff --git a/src/app/openapi/core/ApiRequestOptions.ts b/src/app/openapi/core/ApiRequestOptions.ts index c19adcc..8f8d4d1 100644 --- a/src/app/openapi/core/ApiRequestOptions.ts +++ b/src/app/openapi/core/ApiRequestOptions.ts @@ -1,17 +1,13 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ export type ApiRequestOptions = { - readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH'; - readonly url: string; - readonly path?: Record; - readonly cookies?: Record; - readonly headers?: Record; - readonly query?: Record; - readonly formData?: Record; - readonly body?: any; - readonly mediaType?: string; - readonly responseHeader?: string; - readonly errors?: Record; -}; + readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH'; + readonly url: string; + readonly path?: Record; + readonly cookies?: Record; + readonly headers?: Record; + readonly query?: Record; + readonly formData?: Record; + readonly body?: any; + readonly mediaType?: string; + readonly responseHeader?: string; + readonly errors?: Record; +}; \ No newline at end of file diff --git a/src/app/openapi/core/ApiResult.ts b/src/app/openapi/core/ApiResult.ts index ad8fef2..4c58e39 100644 --- a/src/app/openapi/core/ApiResult.ts +++ b/src/app/openapi/core/ApiResult.ts @@ -1,11 +1,7 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ApiResult = { - readonly url: string; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly body: any; -}; +export type ApiResult = { + readonly body: TData; + readonly ok: boolean; + readonly status: number; + readonly statusText: string; + readonly url: string; +}; \ No newline at end of file diff --git a/src/app/openapi/core/CancelablePromise.ts b/src/app/openapi/core/CancelablePromise.ts deleted file mode 100644 index eb02246..0000000 --- a/src/app/openapi/core/CancelablePromise.ts +++ /dev/null @@ -1,131 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export class CancelError extends Error { - - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - #isResolved: boolean; - #isRejected: boolean; - #isCancelled: boolean; - readonly #cancelHandlers: (() => void)[]; - readonly #promise: Promise; - #resolve?: (value: T | PromiseLike) => void; - #reject?: (reason?: any) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: any) => void, - onCancel: OnCancel - ) => void - ) { - this.#isResolved = false; - this.#isRejected = false; - this.#isCancelled = false; - this.#cancelHandlers = []; - this.#promise = new Promise((resolve, reject) => { - this.#resolve = resolve; - this.#reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#isResolved = true; - if (this.#resolve) this.#resolve(value); - }; - - const onReject = (reason?: any): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#isRejected = true; - if (this.#reject) this.#reject(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this.#isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this.#isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this.#isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - get [Symbol.toStringTag]() { - return "Cancellable Promise"; - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: any) => TResult2 | PromiseLike) | null - ): Promise { - return this.#promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: any) => TResult | PromiseLike) | null - ): Promise { - return this.#promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this.#promise.finally(onFinally); - } - - public cancel(): void { - if (this.#isResolved || this.#isRejected || this.#isCancelled) { - return; - } - this.#isCancelled = true; - if (this.#cancelHandlers.length) { - try { - for (const cancelHandler of this.#cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this.#cancelHandlers.length = 0; - if (this.#reject) this.#reject(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this.#isCancelled; - } -} diff --git a/src/app/openapi/core/OpenAPI.ts b/src/app/openapi/core/OpenAPI.ts index adb4d21..1321323 100644 --- a/src/app/openapi/core/OpenAPI.ts +++ b/src/app/openapi/core/OpenAPI.ts @@ -1,32 +1,57 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { HttpResponse } from '@angular/common/http';import type { ApiRequestOptions } from './ApiRequestOptions'; +import type { TResult } from './types'; -type Resolver = (options: ApiRequestOptions) => Promise; type Headers = Record; +type Middleware = (value: T) => T | Promise; +type Resolver = (options: ApiRequestOptions) => Promise; + +export class Interceptors { + _fns: Middleware[]; + + constructor() { + this._fns = []; + } + + eject(fn: Middleware) { + const index = this._fns.indexOf(fn); + if (index !== -1) { + this._fns = [ + ...this._fns.slice(0, index), + ...this._fns.slice(index + 1), + ]; + } + } + + use(fn: Middleware) { + this._fns = [...this._fns, fn]; + } +} export type OpenAPIConfig = { - BASE: string; - VERSION: string; - WITH_CREDENTIALS: boolean; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - TOKEN?: string | Resolver | undefined; - USERNAME?: string | Resolver | undefined; - PASSWORD?: string | Resolver | undefined; - HEADERS?: Headers | Resolver | undefined; - ENCODE_PATH?: ((path: string) => string) | undefined; + BASE: string; + CREDENTIALS: 'include' | 'omit' | 'same-origin'; + ENCODE_PATH?: ((path: string) => string) | undefined; + HEADERS?: Headers | Resolver | undefined; + PASSWORD?: string | Resolver | undefined; + RESULT?: TResult; + TOKEN?: string | Resolver | undefined; + USERNAME?: string | Resolver | undefined; + VERSION: string; + WITH_CREDENTIALS: boolean; + interceptors: {response: Interceptors>;}; }; export const OpenAPI: OpenAPIConfig = { - BASE: '', - VERSION: '2023.4.dev56+g775030d.d20240325', - WITH_CREDENTIALS: false, - CREDENTIALS: 'include', - TOKEN: undefined, - USERNAME: undefined, - PASSWORD: undefined, - HEADERS: undefined, - ENCODE_PATH: undefined, -}; + BASE: '', + CREDENTIALS: 'include', + ENCODE_PATH: undefined, + HEADERS: undefined, + PASSWORD: undefined, + RESULT: 'body', + TOKEN: undefined, + USERNAME: undefined, + VERSION: '2023.4.dev56+g775030d.d20240325', + WITH_CREDENTIALS: false, + interceptors: {response: new Interceptors(), + }, +}; \ No newline at end of file diff --git a/src/app/openapi/core/request.ts b/src/app/openapi/core/request.ts index b1fcfc0..23260de 100644 --- a/src/app/openapi/core/request.ts +++ b/src/app/openapi/core/request.ts @@ -1,7 +1,3 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ import { HttpClient, HttpHeaders } from '@angular/common/http'; import type { HttpResponse, HttpErrorResponse } from '@angular/common/http'; import { forkJoin, of, throwError } from 'rxjs'; @@ -13,257 +9,266 @@ import type { ApiRequestOptions } from './ApiRequestOptions'; import type { ApiResult } from './ApiResult'; import type { OpenAPIConfig } from './OpenAPI'; -export const isDefined = (value: T | null | undefined): value is Exclude => { - return value !== undefined && value !== null; +export const isString = (value: unknown): value is string => { + return typeof value === 'string'; }; -export const isString = (value: any): value is string => { - return typeof value === 'string'; -}; - -export const isStringWithValue = (value: any): value is string => { - return isString(value) && value !== ''; +export const isStringWithValue = (value: unknown): value is string => { + return isString(value) && value !== ''; }; export const isBlob = (value: any): value is Blob => { - return ( - typeof value === 'object' && - typeof value.type === 'string' && - typeof value.stream === 'function' && - typeof value.arrayBuffer === 'function' && - typeof value.constructor === 'function' && - typeof value.constructor.name === 'string' && - /^(Blob|File)$/.test(value.constructor.name) && - /^(Blob|File)$/.test(value[Symbol.toStringTag]) - ); + return value instanceof Blob; }; -export const isFormData = (value: any): value is FormData => { - return value instanceof FormData; +export const isFormData = (value: unknown): value is FormData => { + return value instanceof FormData; }; export const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } + try { + return btoa(str); + } catch (err) { + // @ts-ignore + return Buffer.from(str).toString('base64'); + } }; -export const getQueryString = (params: Record): string => { - const qs: string[] = []; +export const getQueryString = (params: Record): string => { + const qs: string[] = []; - const append = (key: string, value: any) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; + const append = (key: string, value: unknown) => { + qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); + }; - const process = (key: string, value: any) => { - if (isDefined(value)) { - if (Array.isArray(value)) { - value.forEach(v => { - process(key, v); - }); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => { - process(`${key}[${k}]`, v); - }); - } else { - append(key, value); - } - } - }; + const encodePair = (key: string, value: unknown) => { + if (value === undefined || value === null) { + return; + } - Object.entries(params).forEach(([key, value]) => { - process(key, value); - }); + if (Array.isArray(value)) { + value.forEach(v => encodePair(key, v)); + } else if (typeof value === 'object') { + Object.entries(value).forEach(([k, v]) => encodePair(`${key}[${k}]`, v)); + } else { + append(key, value); + } + }; - if (qs.length > 0) { - return `?${qs.join('&')}`; - } + Object.entries(params).forEach(([key, value]) => encodePair(key, value)); - return ''; + return qs.length ? `?${qs.join('&')}` : ''; }; const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; + const encoder = config.ENCODE_PATH || encodeURI; - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); + const path = options.url + .replace('{api-version}', config.VERSION) + .replace(/{(.*?)}/g, (substring: string, group: string) => { + if (options.path?.hasOwnProperty(group)) { + return encoder(String(options.path[group])); + } + return substring; + }); - const url = `${config.BASE}${path}`; - if (options.query) { - return `${url}${getQueryString(options.query)}`; - } - return url; + const url = config.BASE + path; + return options.query ? url + getQueryString(options.query) : url; }; export const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); + if (options.formData) { + const formData = new FormData(); - const process = (key: string, value: any) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; + const process = (key: string, value: unknown) => { + if (isString(value) || isBlob(value)) { + formData.append(key, value); + } else { + formData.append(key, JSON.stringify(value)); + } + }; - Object.entries(options.formData) - .filter(([_, value]) => isDefined(value)) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); + Object.entries(options.formData) + .filter(([, value]) => value !== undefined && value !== null) + .forEach(([key, value]) => { + if (Array.isArray(value)) { + value.forEach(v => process(key, v)); + } else { + process(key, value); + } + }); - return formData; - } - return undefined; + return formData; + } + return undefined; }; type Resolver = (options: ApiRequestOptions) => Promise; export const resolve = async (options: ApiRequestOptions, resolver?: T | Resolver): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; + if (typeof resolver === 'function') { + return (resolver as Resolver)(options); + } + return resolver; }; export const getHeaders = (config: OpenAPIConfig, options: ApiRequestOptions): Observable => { - return forkJoin({ - token: resolve(options, config.TOKEN), - username: resolve(options, config.USERNAME), - password: resolve(options, config.PASSWORD), - additionalHeaders: resolve(options, config.HEADERS), - }).pipe( - map(({ token, username, password, additionalHeaders }) => { - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([_, value]) => isDefined(value)) - .reduce((headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), {} as Record); + return forkJoin({ + token: resolve(options, config.TOKEN), + username: resolve(options, config.USERNAME), + password: resolve(options, config.PASSWORD), + additionalHeaders: resolve(options, config.HEADERS), + }).pipe( + map(({ token, username, password, additionalHeaders }) => { + const headers = Object.entries({ + Accept: 'application/json', + ...additionalHeaders, + ...options.headers, + }) + .filter(([, value]) => value !== undefined && value !== null) + .reduce((headers, [key, value]) => ({ + ...headers, + [key]: String(value), + }), {} as Record); - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } + if (isStringWithValue(token)) { + headers['Authorization'] = `Bearer ${token}`; + } - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } + if (isStringWithValue(username) && isStringWithValue(password)) { + const credentials = base64(`${username}:${password}`); + headers['Authorization'] = `Basic ${credentials}`; + } - if (options.body) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } + if (options.body !== undefined) { + if (options.mediaType) { + headers['Content-Type'] = options.mediaType; + } else if (isBlob(options.body)) { + headers['Content-Type'] = options.body.type || 'application/octet-stream'; + } else if (isString(options.body)) { + headers['Content-Type'] = 'text/plain'; + } else if (!isFormData(options.body)) { + headers['Content-Type'] = 'application/json'; + } + } - return new HttpHeaders(headers); - }), - ); + return new HttpHeaders(headers); + }), + ); }; -export const getRequestBody = (options: ApiRequestOptions): any => { - if (options.body) { - if (options.mediaType?.includes('/json')) { - return JSON.stringify(options.body) - } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; +export const getRequestBody = (options: ApiRequestOptions): unknown => { + if (options.body) { + if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { + return JSON.stringify(options.body) + } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { + return options.body; + } else { + return JSON.stringify(options.body); + } + } + return undefined; }; export const sendRequest = ( - config: OpenAPIConfig, - options: ApiRequestOptions, - http: HttpClient, - url: string, - body: any, - formData: FormData | undefined, - headers: HttpHeaders + config: OpenAPIConfig, + options: ApiRequestOptions, + http: HttpClient, + url: string, + body: unknown, + formData: FormData | undefined, + headers: HttpHeaders ): Observable> => { - return http.request(options.method, url, { - headers, - body: body ?? formData, - withCredentials: config.WITH_CREDENTIALS, - observe: 'response', - }); + return http.request(options.method, url, { + headers, + body: body ?? formData, + withCredentials: config.WITH_CREDENTIALS, + observe: 'response', + }); }; export const getResponseHeader = (response: HttpResponse, responseHeader?: string): string | undefined => { - if (responseHeader) { - const value = response.headers.get(responseHeader); - if (isString(value)) { - return value; - } - } - return undefined; + if (responseHeader) { + const value = response.headers.get(responseHeader); + if (isString(value)) { + return value; + } + } + return undefined; }; export const getResponseBody = (response: HttpResponse): T | undefined => { - if (response.status !== 204 && response.body !== null) { - return response.body; - } - return undefined; + if (response.status !== 204 && response.body !== null) { + return response.body; + } + return undefined; }; export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 403: 'Forbidden', - 404: 'Not Found', - 500: 'Internal Server Error', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - ...options.errors, - } + const errors: Record = { + 400: 'Bad Request', + 401: 'Unauthorized', + 402: 'Payment Required', + 403: 'Forbidden', + 404: 'Not Found', + 405: 'Method Not Allowed', + 406: 'Not Acceptable', + 407: 'Proxy Authentication Required', + 408: 'Request Timeout', + 409: 'Conflict', + 410: 'Gone', + 411: 'Length Required', + 412: 'Precondition Failed', + 413: 'Payload Too Large', + 414: 'URI Too Long', + 415: 'Unsupported Media Type', + 416: 'Range Not Satisfiable', + 417: 'Expectation Failed', + 418: 'Im a teapot', + 421: 'Misdirected Request', + 422: 'Unprocessable Content', + 423: 'Locked', + 424: 'Failed Dependency', + 425: 'Too Early', + 426: 'Upgrade Required', + 428: 'Precondition Required', + 429: 'Too Many Requests', + 431: 'Request Header Fields Too Large', + 451: 'Unavailable For Legal Reasons', + 500: 'Internal Server Error', + 501: 'Not Implemented', + 502: 'Bad Gateway', + 503: 'Service Unavailable', + 504: 'Gateway Timeout', + 505: 'HTTP Version Not Supported', + 506: 'Variant Also Negotiates', + 507: 'Insufficient Storage', + 508: 'Loop Detected', + 510: 'Not Extended', + 511: 'Network Authentication Required', + ...options.errors, + } - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } + const error = errors[result.status]; + if (error) { + throw new ApiError(options, result, error); + } - if (!result.ok) { - const errorStatus = result.status ?? 'unknown'; - const errorStatusText = result.statusText ?? 'unknown'; - const errorBody = (() => { - try { - return JSON.stringify(result.body, null, 2); - } catch (e) { - return undefined; - } - })(); + if (!result.ok) { + const errorStatus = result.status ?? 'unknown'; + const errorStatusText = result.statusText ?? 'unknown'; + const errorBody = (() => { + try { + return JSON.stringify(result.body, null, 2); + } catch (e) { + return undefined; + } + })(); - throw new ApiError(options, result, - `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` - ); - } + throw new ApiError(options, result, + `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}` + ); + } }; /** @@ -275,43 +280,46 @@ export const catchErrorCodes = (options: ApiRequestOptions, result: ApiResult): * @throws ApiError */ export const request = (config: OpenAPIConfig, http: HttpClient, options: ApiRequestOptions): Observable => { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); + const url = getUrl(config, options); + const formData = getFormData(options); + const body = getRequestBody(options); - return getHeaders(config, options).pipe( - switchMap(headers => { - return sendRequest(config, options, http, url, formData, body, headers); - }), - map(response => { - const responseBody = getResponseBody(response); - const responseHeader = getResponseHeader(response, options.responseHeader); - return { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? responseBody, - } as ApiResult; - }), - catchError((error: HttpErrorResponse) => { - if (!error.status) { - return throwError(error); - } - return of({ - url, - ok: error.ok, - status: error.status, - statusText: error.statusText, - body: error.error ?? error.statusText, - } as ApiResult); - }), - map(result => { - catchErrorCodes(options, result); - return result.body as T; - }), - catchError((error: ApiError) => { - return throwError(error); - }), - ); -}; + return getHeaders(config, options).pipe( + switchMap(headers => { + return sendRequest(config, options, http, url, body, formData, headers); + }), + switchMap(async response => { + for (const fn of config.interceptors.response._fns) { + response = await fn(response) + } + const responseBody = getResponseBody(response); + const responseHeader = getResponseHeader(response, options.responseHeader); + return { + url, + ok: response.ok, + status: response.status, + statusText: response.statusText, + body: responseHeader ?? responseBody, + } as ApiResult; + }), + catchError((error: HttpErrorResponse) => { + if (!error.status) { + return throwError(() => error); + } + return of({ + url, + ok: error.ok, + status: error.status, + statusText: error.statusText, + body: error.error ?? error.statusText, + } as ApiResult); + }), + map(result => { + catchErrorCodes(options, result); + return result.body as T; + }), + catchError((error: ApiError) => { + return throwError(() => error); + }), + ); +}; \ No newline at end of file diff --git a/src/app/openapi/core/types.ts b/src/app/openapi/core/types.ts new file mode 100644 index 0000000..64ecde2 --- /dev/null +++ b/src/app/openapi/core/types.ts @@ -0,0 +1,12 @@ +import type { ApiResult } from './ApiResult'; + +export type TResult = 'body' | 'raw'; + +export type TApiResponse = + Exclude extends never + ? ApiResult + : ApiResult['body']; + +export type TConfig = { + _result?: T; +}; \ No newline at end of file diff --git a/src/app/openapi/index.ts b/src/app/openapi/index.ts index f157e92..60ec1d1 100644 --- a/src/app/openapi/index.ts +++ b/src/app/openapi/index.ts @@ -1,81 +1,8 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ + export { ApiError } from './core/ApiError'; -export { CancelablePromise, CancelError } from './core/CancelablePromise'; export { OpenAPI } from './core/OpenAPI'; export type { OpenAPIConfig } from './core/OpenAPI'; -export type { Action } from './models/Action'; -export type { ActionParam } from './models/ActionParam'; -export type { ActionResult } from './models/ActionResult'; -export type { ActionResults } from './models/ActionResults'; -export type { ActionsResults } from './models/ActionsResults'; -export type { ActionsStore } from './models/ActionsStore'; -export type { AdminBasket } from './models/AdminBasket'; -export type { Attachment } from './models/Attachment'; -export type { BaseMapWithStores } from './models/BaseMapWithStores'; -export type { BaseStyle } from './models/BaseStyle'; -export type { BasketDefault } from './models/BasketDefault'; -export type { BasketNameOnly } from './models/BasketNameOnly'; -export type { Body_execute_tag_action_api_execTagActions_post } from './models/Body_execute_tag_action_api_execTagActions_post'; -export type { Body_login_for_access_token_api_token_post } from './models/Body_login_for_access_token_api_token_post'; -export type { BootstrapData } from './models/BootstrapData'; -export type { CategoryGroup } from './models/CategoryGroup'; -export type { CategoryRead } from './models/CategoryRead'; -export type { Dashboard } from './models/Dashboard'; -export type { DashboardGroup } from './models/DashboardGroup'; -export type { DashboardHome } from './models/DashboardHome'; -export type { DashboardPageMetaData } from './models/DashboardPageMetaData'; -export type { DashboardSection } from './models/DashboardSection'; -export type { DataProvider } from './models/DataProvider'; -export type { Downloader } from './models/Downloader'; -export type { Equipment } from './models/Equipment'; -export type { FeatureInfo } from './models/FeatureInfo'; -export type { FileImport } from './models/FileImport'; -export type { FormField } from './models/FormField'; -export type { FormFieldInput } from './models/FormFieldInput'; -export type { Geo } from './models/Geo'; -export type { HTTPValidationError } from './models/HTTPValidationError'; -export type { InfoCategory } from './models/InfoCategory'; -export type { InfoItem } from './models/InfoItem'; -export type { LegendItem } from './models/LegendItem'; -export type { Map } from './models/Map'; -export type { MapInitData } from './models/MapInitData'; -export type { MaplibreStyle } from './models/MaplibreStyle'; -export type { Measures } from './models/Measures'; -export type { MeasuresItem } from './models/MeasuresItem'; -export type { ModelAction } from './models/ModelAction'; -export type { ModelInfo } from './models/ModelInfo'; -export type { ModelValue } from './models/ModelValue'; -export type { PlotBaseLine } from './models/PlotBaseLine'; -export type { PlotBgShape } from './models/PlotBgShape'; -export type { PlotParams } from './models/PlotParams'; -export type { Project } from './models/Project'; -export type { RawSurvey } from './models/RawSurvey'; -export type { RoleRead } from './models/RoleRead'; -export type { RoleReadNoUsers } from './models/RoleReadNoUsers'; -export type { SpatialSysRef } from './models/SpatialSysRef'; -export type { Store } from './models/Store'; -export type { StoreNameOnly } from './models/StoreNameOnly'; -export type { SurveyMeta } from './models/SurveyMeta'; -export type { Surveyor } from './models/Surveyor'; -export type { Tag } from './models/Tag'; -export type { TagAction } from './models/TagAction'; -export type { TagActions } from './models/TagActions'; -export type { TaggedFeature } from './models/TaggedFeature'; -export type { TaggedLayer } from './models/TaggedLayer'; -export type { Tags } from './models/Tags'; -export type { TileServer } from './models/TileServer'; -export type { Token } from './models/Token'; -export type { UserRead } from './models/UserRead'; -export type { UserReadNoRoles } from './models/UserReadNoRoles'; -export type { UserRoleLink } from './models/UserRoleLink'; -export type { ValidationError } from './models/ValidationError'; - -export { AdminService } from './services/AdminService'; -export { ApiService } from './services/ApiService'; -export { DashboardService } from './services/DashboardService'; -export { GeoapiService } from './services/GeoapiService'; -export { MapService } from './services/MapService'; +export * from './models' +export * from './schemas' +export * from './services' diff --git a/src/app/openapi/models.ts b/src/app/openapi/models.ts new file mode 100644 index 0000000..5bd7cad --- /dev/null +++ b/src/app/openapi/models.ts @@ -0,0 +1,652 @@ +export type Action = { + name: string; + roles: Array; + params: Array; +}; + + + +export type ActionParam = { + name: string; + type: string; + dflt: string; +}; + + + +export type ActionResult = { + message?: string | null; + taggedLayers?: Array; +}; + + + +export type ActionResults = { + name?: string | null; + message?: string | null; + actionResults?: Array; +}; + + + +export type ActionsResults = { + message?: string | null; + actionResults?: Array; +}; + + + +export type ActionsStore = { + store: string; + actions: Array; +}; + + + +export type AdminBasket = { + name: string; + files: Array; + columns: Array; + uploadFields: Array; + projects?: Array; +}; + + + +export type Attachment = { + name: string; + path: string; +}; + + + +export type BaseMapWithStores = { + name: string; + stores: Array; +}; + + + +export type BaseStyle = { + id?: number | null; + name: string; + style: Record | null; + mbtiles: string; + static_tiles_url: string; + enabled?: boolean; +}; + + + +export type BasketDefault = { + surveyor?: string; + equipment?: string; + project?: string; + status?: string; + store?: string | null; +}; + + + +export type BasketNameOnly = { + name: string; +}; + + + +export type Body_execute_tag_action_api_execTagActions_post = { + stores: Array; + ids: Array>; + actionNames: Array; + params: Array; + formFields: Array; +}; + + + +export type Body_login_for_access_token_api_token_post = { + grant_type?: string | null; + username: string; + password: string; + scope?: string; + client_id?: string | null; + client_secret?: string | null; +}; + + + +export type BootstrapData = { + version?: string; + title?: string; + windowTitle?: string; + map?: Map; + geo?: Geo; + measures?: Measures; + redirect?: string; + user?: UserRead | null; +}; + + + +export type CategoryGroup = { + name?: string | null; + major: boolean; + long_name: string; +}; + + + +export type CategoryRead = { + name: string; + description: string | null; + group: string; + minor_group_1?: string; + minor_group_2?: string; + status: string; + custom: boolean | null; + auto_import?: boolean; + gis_type?: string; + long_name: string | null; + style: string | null; + symbol: string | null; + mapbox_type_custom: string | null; + mapbox_paint: Record | Array | number | string)> | null; + mapbox_layout: Record | Array | number | string)> | null; + viewable_role: string | null; + extra: Record | null; + /** + * ISO compliant layer name (see ISO 13567) + * :return: str + */ + readonly layer_name: string; + /** + * Table name + * :return: + */ + readonly table_name: string; + /** + * Table name + * :return: + */ + readonly raw_survey_table_name: string; + readonly mapbox_type: string; +}; + + + +export type Dashboard = { + name: string; + group: string; + description: string; + time?: string | null; + html?: string | null; + attachment?: string | null; + dfData?: Array; + plotData?: Array> | null; + plotLayout?: Record | null; + notebook?: string | null; + expandedPanes?: Array | null; + sections?: Array | null; +}; + + + +export type DashboardGroup = { + name: string; + pages: Array; +}; + + + +export type DashboardHome = { + title: string; + content: string; + footer: string; +}; + + + +export type DashboardPageMetaData = { + name: string; + group: string; + description: string; + viewable_role?: string | null; +}; + + + +export type DashboardSection = { + name: string; + plot: string; +}; + + + +export type DataProvider = { + store: string; + name: string; + values: Array; +}; + + + +export type Downloader = { + roles?: Array; + name: string; + icon?: string | null; +}; + + + +export type Equipment = { + id?: number | null; + name: string; +}; + + + +export type FeatureInfo = { + id: string; + itemName: string; + geoInfoItems?: Array; + surveyInfoItems?: Array; + infoItems?: Array; + categorizedInfoItems?: Array | null; + tags?: Array; + graph?: string | null; + plotParams?: PlotParams | null; + files?: Array; + images?: Array; + externalRecordUrl?: string | null; +}; + + + +/** + * Files to import or imported in the DB. + * Give either url or path. + */ +export type FileImport = { + id?: number | null; + url: string; + path: string; + dir: string; + name: string; + md5: string; + time: string; + comment: string; + status: string; + store: string; + basket: string; + project_id: number; + surveyor_id: number; + equipment_id: number; +}; + + + +export type FormField = { + name: string; + type: string; + dflt?: string | null; + value?: string | null; +}; + + + +export type FormFieldInput = { + name: string; + value: string; +}; + + + +export type Geo = { + raw_survey?: RawSurvey; + simplify_geom_factor?: number; + simplify_preserve_topology?: boolean; + srid?: number; + srid_for_proj?: number; +}; + + + +export type HTTPValidationError = { + detail?: Array; +}; + + + +export type InfoCategory = { + name: string; + infoItems: Array; +}; + + + +export type InfoItem = { + key: string; + value: (string | number); +}; + + + +export type LegendItem = { + key: string; + value: string; +}; + + + +export type Map = { + tileServer?: TileServer; + zoom?: number; + pitch?: number; + lat?: number; + lng?: number; + bearing?: number; + style?: string; + opacity?: number; + attribution?: string; + status?: Array; + defaultStatus?: Array; + tagKeys?: Array; +}; + + + +export type MapInitData = { + baseStyles?: Array; + baseMaps?: Array; + groups?: Array; + stores?: Array; +}; + + + +export type MaplibreStyle = { + paint?: Record | Array | number | string)> | null; + layout?: Record | Array | number | string)> | null; + attribution?: string | null; +}; + + + +export type Measures = { + defaultStore?: string | null; +}; + + + +export type MeasuresItem = { + id: number; + name: string; +}; + + + +export type ModelAction = { + name: string; + icon: string; + roles?: Array | null; + formFields: Array; +}; + + + +export type ModelInfo = { + store: string; + modelName: string; + symbol?: string | null; + values?: Array; + actions?: Array; + formName?: string | null; + formFields?: Array; + tagPlugins?: Array; + tagActions?: Array; + downloaders?: Array; + legend?: Array; +}; + + + +export type ModelValue = { + name: string; + title: string; + unit: string; + chartType?: string; + chartColor?: string; +}; + + + +export type PlotBaseLine = { + name: string; + value: number; + color: string; +}; + + + +export type PlotBgShape = { + name: string; + valueTop: number; + valueBottom: number; + color: string; +}; + + + +export type PlotParams = { + baseLines?: Array; + bgShapes?: Array; + barBase?: number | null; +}; + + + +export type Project = { + id?: number | null; + name: string; + contact_person: string; + site: string; + date_approved: string; + start_date_planned: string; + start_date_effective: string; + end_date_planned: string; + end_date_effective: string; +}; + + + +export type RawSurvey = { + spatial_sys_ref?: SpatialSysRef; + srid?: number; +}; + + + +export type RoleRead = { + name: string; + id: number; + users?: Array; +}; + + + +export type RoleReadNoUsers = { + name: string; + id: number; +}; + + + +export type SpatialSysRef = { + author?: string; + ellps?: string; + k?: number; + lat_0?: number; + lon_0?: number; + no_defs?: boolean; + proj?: string; + towgs84?: string; + units?: string; + x_0?: number; + y_0?: number; +}; + + + +export type Store = { + name: string; + category?: string | null; + auto_import: boolean; + count?: number | null; + custom: boolean; + description: string; + gis_type: string; + group: string; + in_menu: boolean; + is_db: boolean; + is_line_work: boolean; + is_live: boolean; + long_name: string | null; + type: string; + minor_group_1: string | null; + minor_group_2: string | null; + status: string; + style: string | null; + symbol: string | null; + title: string; + viewable_role: string | null; + z_index: number; +}; + + + +export type StoreNameOnly = { + name: string; +}; + + + +export type SurveyMeta = { + projects: Array; + surveyors: Array; + equipments: Array; + statuses: Array; + stores_misc: Array; + stores_line_work: Array; + default: BasketDefault; +}; + + + +export type Surveyor = { + id?: number | null; + name: string; +}; + + + +export type Tag = { + key: string; + value: string; +}; + + + +export type TagAction = { + name: string; + action: string; + roles?: Array | null; + link?: string | null; + save?: boolean; +}; + + + +export type TagActions = { + domain: string; + key: string; + actions: Array; +}; + + + +export type TaggedFeature = { + id: string; + tags: Tags; + lat: number; + lon: number; +}; + + + +export type TaggedLayer = { + store: string; + taggedFeatures: Array; +}; + + + +export type Tags = { + id?: number | null; + geom: string; + store: string; + ref_id: number; + tags: Record; +}; + + + +export type TileServer = { + baseDir?: string; + useRequestUrl?: boolean; + spriteBaseDir?: string; + spriteUrl?: string; + spriteBaseUrl?: string; + openMapTilesKey?: string | null; +}; + + + +export type Token = { + access_token: string; + token_type: string; +}; + + + +export type UserRead = { + username: string; + email: string | null; + disabled?: boolean | null; + id: number; + roles?: Array; +}; + + + +export type UserReadNoRoles = { + username: string; + email: string | null; + disabled?: boolean | null; + id: number; +}; + + + +export type UserRoleLink = { + user_id?: number | null; + role_id?: number | null; +}; + + + +export type ValidationError = { + loc: Array; + msg: string; + type: string; +}; + diff --git a/src/app/openapi/models/Action.ts b/src/app/openapi/models/Action.ts deleted file mode 100644 index 6a1cf4a..0000000 --- a/src/app/openapi/models/Action.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ActionParam } from './ActionParam'; -export type Action = { - name: string; - roles: Array; - params: Array; -}; - diff --git a/src/app/openapi/models/ActionParam.ts b/src/app/openapi/models/ActionParam.ts deleted file mode 100644 index 3373a72..0000000 --- a/src/app/openapi/models/ActionParam.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ActionParam = { - name: string; - type: string; - dflt: string; -}; - diff --git a/src/app/openapi/models/ActionResult.ts b/src/app/openapi/models/ActionResult.ts deleted file mode 100644 index 413f4e9..0000000 --- a/src/app/openapi/models/ActionResult.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { TaggedLayer } from './TaggedLayer'; -export type ActionResult = { - message?: (string | null); - taggedLayers?: Array; -}; - diff --git a/src/app/openapi/models/ActionResults.ts b/src/app/openapi/models/ActionResults.ts deleted file mode 100644 index 6559132..0000000 --- a/src/app/openapi/models/ActionResults.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ActionResult } from './ActionResult'; -export type ActionResults = { - name?: (string | null); - message?: (string | null); - actionResults?: Array; -}; - diff --git a/src/app/openapi/models/ActionsResults.ts b/src/app/openapi/models/ActionsResults.ts deleted file mode 100644 index 001b1d6..0000000 --- a/src/app/openapi/models/ActionsResults.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ActionResults } from './ActionResults'; -export type ActionsResults = { - message?: (string | null); - actionResults?: Array; -}; - diff --git a/src/app/openapi/models/ActionsStore.ts b/src/app/openapi/models/ActionsStore.ts deleted file mode 100644 index 1ec663d..0000000 --- a/src/app/openapi/models/ActionsStore.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Action } from './Action'; -export type ActionsStore = { - store: string; - actions: Array; -}; - diff --git a/src/app/openapi/models/AdminBasket.ts b/src/app/openapi/models/AdminBasket.ts deleted file mode 100644 index b467abe..0000000 --- a/src/app/openapi/models/AdminBasket.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { FileImport } from './FileImport'; -import type { Project } from './Project'; -export type AdminBasket = { - name: string; - files: Array; - columns: Array; - uploadFields: Array; - projects?: Array; -}; - diff --git a/src/app/openapi/models/Attachment.ts b/src/app/openapi/models/Attachment.ts deleted file mode 100644 index 6a1b54c..0000000 --- a/src/app/openapi/models/Attachment.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Attachment = { - name: string; - path: string; -}; - diff --git a/src/app/openapi/models/BaseMapWithStores.ts b/src/app/openapi/models/BaseMapWithStores.ts deleted file mode 100644 index 1fa5688..0000000 --- a/src/app/openapi/models/BaseMapWithStores.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type BaseMapWithStores = { - name: string; - stores: Array; -}; - diff --git a/src/app/openapi/models/BaseStyle.ts b/src/app/openapi/models/BaseStyle.ts deleted file mode 100644 index 834ce44..0000000 --- a/src/app/openapi/models/BaseStyle.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type BaseStyle = { - id?: (number | null); - name: string; - style: (Record | null); - mbtiles: string; - static_tiles_url: string; - enabled?: boolean; -}; - diff --git a/src/app/openapi/models/BasketDefault.ts b/src/app/openapi/models/BasketDefault.ts deleted file mode 100644 index f3d6708..0000000 --- a/src/app/openapi/models/BasketDefault.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type BasketDefault = { - surveyor?: string; - equipment?: string; - project?: string; - status?: string; - store?: (string | null); -}; - diff --git a/src/app/openapi/models/BasketNameOnly.ts b/src/app/openapi/models/BasketNameOnly.ts deleted file mode 100644 index 43bd16d..0000000 --- a/src/app/openapi/models/BasketNameOnly.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type BasketNameOnly = { - name: string; -}; - diff --git a/src/app/openapi/models/Body_execute_tag_action_api_execTagActions_post.ts b/src/app/openapi/models/Body_execute_tag_action_api_execTagActions_post.ts deleted file mode 100644 index 0e09627..0000000 --- a/src/app/openapi/models/Body_execute_tag_action_api_execTagActions_post.ts +++ /dev/null @@ -1,14 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ActionParam } from './ActionParam'; -import type { FormFieldInput } from './FormFieldInput'; -export type Body_execute_tag_action_api_execTagActions_post = { - stores: Array; - ids: Array>; - actionNames: Array; - params: Array<(ActionParam | null)>; - formFields: Array; -}; - diff --git a/src/app/openapi/models/Body_login_for_access_token_api_token_post.ts b/src/app/openapi/models/Body_login_for_access_token_api_token_post.ts deleted file mode 100644 index 9827843..0000000 --- a/src/app/openapi/models/Body_login_for_access_token_api_token_post.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Body_login_for_access_token_api_token_post = { - grant_type?: (string | null); - username: string; - password: string; - scope?: string; - client_id?: (string | null); - client_secret?: (string | null); -}; - diff --git a/src/app/openapi/models/BootstrapData.ts b/src/app/openapi/models/BootstrapData.ts deleted file mode 100644 index d033cee..0000000 --- a/src/app/openapi/models/BootstrapData.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Geo } from './Geo'; -import type { Map } from './Map'; -import type { Measures } from './Measures'; -import type { UserRead } from './UserRead'; -export type BootstrapData = { - version?: string; - title?: string; - windowTitle?: string; - map?: Map; - geo?: Geo; - measures?: Measures; - redirect?: string; - user?: (UserRead | null); -}; - diff --git a/src/app/openapi/models/CategoryGroup.ts b/src/app/openapi/models/CategoryGroup.ts deleted file mode 100644 index 1a8ee5b..0000000 --- a/src/app/openapi/models/CategoryGroup.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type CategoryGroup = { - name?: (string | null); - major: boolean; - long_name: string; -}; - diff --git a/src/app/openapi/models/CategoryRead.ts b/src/app/openapi/models/CategoryRead.ts deleted file mode 100644 index eca36c9..0000000 --- a/src/app/openapi/models/CategoryRead.ts +++ /dev/null @@ -1,40 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type CategoryRead = { - name: string; - description: (string | null); - group: string; - minor_group_1?: string; - minor_group_2?: string; - status: string; - custom: (boolean | null); - auto_import?: boolean; - gis_type?: string; - long_name: (string | null); - style: (string | null); - symbol: (string | null); - mapbox_type_custom: (string | null); - mapbox_paint: (Record | number | string)> | null); - mapbox_layout: (Record | number | string)> | null); - viewable_role: (string | null); - extra: (Record | null); - /** - * ISO compliant layer name (see ISO 13567) - * :return: str - */ - readonly layer_name: string; - /** - * Table name - * :return: - */ - readonly table_name: string; - /** - * Table name - * :return: - */ - readonly raw_survey_table_name: string; - readonly mapbox_type: string; -}; - diff --git a/src/app/openapi/models/Dashboard.ts b/src/app/openapi/models/Dashboard.ts deleted file mode 100644 index 7b62095..0000000 --- a/src/app/openapi/models/Dashboard.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { DashboardSection } from './DashboardSection'; -export type Dashboard = { - name: string; - group: string; - description: string; - time?: (string | null); - html?: (string | null); - attachment?: (string | null); - dfData?: Array; - plotData?: null; - plotLayout?: (Record | null); - notebook?: (string | null); - expandedPanes?: (Array | null); - sections?: (Array | null); -}; - diff --git a/src/app/openapi/models/DashboardGroup.ts b/src/app/openapi/models/DashboardGroup.ts deleted file mode 100644 index f2d1348..0000000 --- a/src/app/openapi/models/DashboardGroup.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { DashboardPageMetaData } from './DashboardPageMetaData'; -export type DashboardGroup = { - name: string; - pages: Array; -}; - diff --git a/src/app/openapi/models/DashboardHome.ts b/src/app/openapi/models/DashboardHome.ts deleted file mode 100644 index 5df3801..0000000 --- a/src/app/openapi/models/DashboardHome.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DashboardHome = { - title: string; - content: string; - footer: string; -}; - diff --git a/src/app/openapi/models/DashboardPageMetaData.ts b/src/app/openapi/models/DashboardPageMetaData.ts deleted file mode 100644 index 4056fa2..0000000 --- a/src/app/openapi/models/DashboardPageMetaData.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DashboardPageMetaData = { - name: string; - group: string; - description: string; - viewable_role?: (string | null); -}; - diff --git a/src/app/openapi/models/DashboardSection.ts b/src/app/openapi/models/DashboardSection.ts deleted file mode 100644 index 04392a9..0000000 --- a/src/app/openapi/models/DashboardSection.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DashboardSection = { - name: string; - plot: string; -}; - diff --git a/src/app/openapi/models/DataProvider.ts b/src/app/openapi/models/DataProvider.ts deleted file mode 100644 index 8fb5ecb..0000000 --- a/src/app/openapi/models/DataProvider.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type DataProvider = { - store: string; - name: string; - values: Array; -}; - diff --git a/src/app/openapi/models/Downloader.ts b/src/app/openapi/models/Downloader.ts deleted file mode 100644 index f6479f3..0000000 --- a/src/app/openapi/models/Downloader.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Downloader = { - roles?: Array; - name: string; - icon?: (string | null); -}; - diff --git a/src/app/openapi/models/Equipment.ts b/src/app/openapi/models/Equipment.ts deleted file mode 100644 index 557cd7c..0000000 --- a/src/app/openapi/models/Equipment.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Equipment = { - id?: (number | null); - name: string; -}; - diff --git a/src/app/openapi/models/FeatureInfo.ts b/src/app/openapi/models/FeatureInfo.ts deleted file mode 100644 index 29fec46..0000000 --- a/src/app/openapi/models/FeatureInfo.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Attachment } from './Attachment'; -import type { InfoCategory } from './InfoCategory'; -import type { InfoItem } from './InfoItem'; -import type { PlotParams } from './PlotParams'; -import type { Tag } from './Tag'; -export type FeatureInfo = { - id: string; - itemName: string; - geoInfoItems?: Array; - surveyInfoItems?: Array; - infoItems?: Array; - categorizedInfoItems?: (Array | null); - tags?: Array; - graph?: (string | null); - plotParams?: (PlotParams | null); - files?: Array; - images?: Array; - externalRecordUrl?: (string | null); -}; - diff --git a/src/app/openapi/models/FileImport.ts b/src/app/openapi/models/FileImport.ts deleted file mode 100644 index b14de23..0000000 --- a/src/app/openapi/models/FileImport.ts +++ /dev/null @@ -1,25 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -/** - * Files to import or imported in the DB. - * Give either url or path. - */ -export type FileImport = { - id?: (number | null); - url: string; - path: string; - dir: string; - name: string; - md5: string; - time: string; - comment: string; - status: string; - store: string; - basket: string; - project_id: number; - surveyor_id: number; - equipment_id: number; -}; - diff --git a/src/app/openapi/models/FormField.ts b/src/app/openapi/models/FormField.ts deleted file mode 100644 index d4e89f2..0000000 --- a/src/app/openapi/models/FormField.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type FormField = { - name: string; - type: string; - dflt?: (string | null); - value?: (string | null); -}; - diff --git a/src/app/openapi/models/FormFieldInput.ts b/src/app/openapi/models/FormFieldInput.ts deleted file mode 100644 index 65cef1d..0000000 --- a/src/app/openapi/models/FormFieldInput.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type FormFieldInput = { - name: string; - value: string; -}; - diff --git a/src/app/openapi/models/Geo.ts b/src/app/openapi/models/Geo.ts deleted file mode 100644 index fab74de..0000000 --- a/src/app/openapi/models/Geo.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { RawSurvey } from './RawSurvey'; -export type Geo = { - raw_survey?: RawSurvey; - simplify_geom_factor?: number; - simplify_preserve_topology?: boolean; - srid?: number; - srid_for_proj?: number; -}; - diff --git a/src/app/openapi/models/HTTPValidationError.ts b/src/app/openapi/models/HTTPValidationError.ts deleted file mode 100644 index 892e425..0000000 --- a/src/app/openapi/models/HTTPValidationError.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ValidationError } from './ValidationError'; -export type HTTPValidationError = { - detail?: Array; -}; - diff --git a/src/app/openapi/models/InfoCategory.ts b/src/app/openapi/models/InfoCategory.ts deleted file mode 100644 index 3e5a6d3..0000000 --- a/src/app/openapi/models/InfoCategory.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { InfoItem } from './InfoItem'; -export type InfoCategory = { - name: string; - infoItems: Array; -}; - diff --git a/src/app/openapi/models/InfoItem.ts b/src/app/openapi/models/InfoItem.ts deleted file mode 100644 index dcf0cdb..0000000 --- a/src/app/openapi/models/InfoItem.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type InfoItem = { - key: string; - value: (string | number); -}; - diff --git a/src/app/openapi/models/LegendItem.ts b/src/app/openapi/models/LegendItem.ts deleted file mode 100644 index d31cc43..0000000 --- a/src/app/openapi/models/LegendItem.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type LegendItem = { - key: string; - value: string; -}; - diff --git a/src/app/openapi/models/Map.ts b/src/app/openapi/models/Map.ts deleted file mode 100644 index d212c0b..0000000 --- a/src/app/openapi/models/Map.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { TileServer } from './TileServer'; -export type Map = { - tileServer?: TileServer; - zoom?: number; - pitch?: number; - lat?: number; - lng?: number; - bearing?: number; - style?: string; - opacity?: number; - attribution?: string; - status?: Array; - defaultStatus?: Array; - tagKeys?: Array; -}; - diff --git a/src/app/openapi/models/MapInitData.ts b/src/app/openapi/models/MapInitData.ts deleted file mode 100644 index bfbdbda..0000000 --- a/src/app/openapi/models/MapInitData.ts +++ /dev/null @@ -1,15 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { BaseMapWithStores } from './BaseMapWithStores'; -import type { BaseStyle } from './BaseStyle'; -import type { CategoryGroup } from './CategoryGroup'; -import type { Store } from './Store'; -export type MapInitData = { - baseStyles?: Array; - baseMaps?: Array; - groups?: Array; - stores?: Array; -}; - diff --git a/src/app/openapi/models/MaplibreStyle.ts b/src/app/openapi/models/MaplibreStyle.ts deleted file mode 100644 index a49cdbe..0000000 --- a/src/app/openapi/models/MaplibreStyle.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type MaplibreStyle = { - paint?: (Record | number | string)> | null); - layout?: (Record | number | string)> | null); - attribution?: (string | null); -}; - diff --git a/src/app/openapi/models/Measures.ts b/src/app/openapi/models/Measures.ts deleted file mode 100644 index ef29887..0000000 --- a/src/app/openapi/models/Measures.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Measures = { - defaultStore?: (string | null); -}; - diff --git a/src/app/openapi/models/MeasuresItem.ts b/src/app/openapi/models/MeasuresItem.ts deleted file mode 100644 index ec95b9c..0000000 --- a/src/app/openapi/models/MeasuresItem.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type MeasuresItem = { - id: number; - name: string; -}; - diff --git a/src/app/openapi/models/ModelAction.ts b/src/app/openapi/models/ModelAction.ts deleted file mode 100644 index 6adf12d..0000000 --- a/src/app/openapi/models/ModelAction.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { FormField } from './FormField'; -export type ModelAction = { - name: string; - icon: string; - roles?: (Array | null); - formFields: Array; -}; - diff --git a/src/app/openapi/models/ModelInfo.ts b/src/app/openapi/models/ModelInfo.ts deleted file mode 100644 index 68b60d2..0000000 --- a/src/app/openapi/models/ModelInfo.ts +++ /dev/null @@ -1,24 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Downloader } from './Downloader'; -import type { FormField } from './FormField'; -import type { LegendItem } from './LegendItem'; -import type { ModelAction } from './ModelAction'; -import type { ModelValue } from './ModelValue'; -import type { TagActions } from './TagActions'; -export type ModelInfo = { - store: string; - modelName: string; - symbol?: (string | null); - values?: Array; - actions?: Array; - formName?: (string | null); - formFields?: Array; - tagPlugins?: Array; - tagActions?: Array; - downloaders?: Array; - legend?: Array; -}; - diff --git a/src/app/openapi/models/ModelValue.ts b/src/app/openapi/models/ModelValue.ts deleted file mode 100644 index 5584334..0000000 --- a/src/app/openapi/models/ModelValue.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ModelValue = { - name: string; - title: string; - unit: string; - chartType?: string; - chartColor?: string; -}; - diff --git a/src/app/openapi/models/PlotBaseLine.ts b/src/app/openapi/models/PlotBaseLine.ts deleted file mode 100644 index fd06164..0000000 --- a/src/app/openapi/models/PlotBaseLine.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type PlotBaseLine = { - name: string; - value: number; - color: string; -}; - diff --git a/src/app/openapi/models/PlotBgShape.ts b/src/app/openapi/models/PlotBgShape.ts deleted file mode 100644 index c1737d0..0000000 --- a/src/app/openapi/models/PlotBgShape.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type PlotBgShape = { - name: string; - valueTop: number; - valueBottom: number; - color: string; -}; - diff --git a/src/app/openapi/models/PlotParams.ts b/src/app/openapi/models/PlotParams.ts deleted file mode 100644 index a149d0e..0000000 --- a/src/app/openapi/models/PlotParams.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { PlotBaseLine } from './PlotBaseLine'; -import type { PlotBgShape } from './PlotBgShape'; -export type PlotParams = { - baseLines?: Array; - bgShapes?: Array; - barBase?: (number | null); -}; - diff --git a/src/app/openapi/models/Project.ts b/src/app/openapi/models/Project.ts deleted file mode 100644 index e24bf39..0000000 --- a/src/app/openapi/models/Project.ts +++ /dev/null @@ -1,16 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Project = { - id?: (number | null); - name: string; - contact_person: string; - site: string; - date_approved: string; - start_date_planned: string; - start_date_effective: string; - end_date_planned: string; - end_date_effective: string; -}; - diff --git a/src/app/openapi/models/RawSurvey.ts b/src/app/openapi/models/RawSurvey.ts deleted file mode 100644 index 53249f3..0000000 --- a/src/app/openapi/models/RawSurvey.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { SpatialSysRef } from './SpatialSysRef'; -export type RawSurvey = { - spatial_sys_ref?: SpatialSysRef; - srid?: number; -}; - diff --git a/src/app/openapi/models/RoleRead.ts b/src/app/openapi/models/RoleRead.ts deleted file mode 100644 index 9df5469..0000000 --- a/src/app/openapi/models/RoleRead.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { UserReadNoRoles } from './UserReadNoRoles'; -export type RoleRead = { - name: string; - id: number; - users?: Array; -}; - diff --git a/src/app/openapi/models/RoleReadNoUsers.ts b/src/app/openapi/models/RoleReadNoUsers.ts deleted file mode 100644 index a038eee..0000000 --- a/src/app/openapi/models/RoleReadNoUsers.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type RoleReadNoUsers = { - name: string; - id: number; -}; - diff --git a/src/app/openapi/models/SpatialSysRef.ts b/src/app/openapi/models/SpatialSysRef.ts deleted file mode 100644 index adb9dab..0000000 --- a/src/app/openapi/models/SpatialSysRef.ts +++ /dev/null @@ -1,18 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type SpatialSysRef = { - author?: string; - ellps?: string; - 'k'?: number; - lat_0?: number; - lon_0?: number; - no_defs?: boolean; - proj?: string; - towgs84?: string; - units?: string; - x_0?: number; - y_0?: number; -}; - diff --git a/src/app/openapi/models/Store.ts b/src/app/openapi/models/Store.ts deleted file mode 100644 index 8b12cc9..0000000 --- a/src/app/openapi/models/Store.ts +++ /dev/null @@ -1,29 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Store = { - name: string; - category?: (string | null); - auto_import: boolean; - count?: (number | null); - custom: boolean; - description: string; - gis_type: string; - group: string; - in_menu: boolean; - is_db: boolean; - is_line_work: boolean; - is_live: boolean; - long_name: (string | null); - type: string; - minor_group_1: (string | null); - minor_group_2: (string | null); - status: string; - style: (string | null); - symbol: (string | null); - title: string; - viewable_role: (string | null); - z_index: number; -}; - diff --git a/src/app/openapi/models/StoreNameOnly.ts b/src/app/openapi/models/StoreNameOnly.ts deleted file mode 100644 index c24296c..0000000 --- a/src/app/openapi/models/StoreNameOnly.ts +++ /dev/null @@ -1,8 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type StoreNameOnly = { - name: string; -}; - diff --git a/src/app/openapi/models/SurveyMeta.ts b/src/app/openapi/models/SurveyMeta.ts deleted file mode 100644 index b741f3b..0000000 --- a/src/app/openapi/models/SurveyMeta.ts +++ /dev/null @@ -1,19 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { BasketDefault } from './BasketDefault'; -import type { Equipment } from './Equipment'; -import type { Project } from './Project'; -import type { StoreNameOnly } from './StoreNameOnly'; -import type { Surveyor } from './Surveyor'; -export type SurveyMeta = { - projects: Array; - surveyors: Array; - equipments: Array; - statuses: Array; - stores_misc: Array; - stores_line_work: Array; - default: BasketDefault; -}; - diff --git a/src/app/openapi/models/Surveyor.ts b/src/app/openapi/models/Surveyor.ts deleted file mode 100644 index 6668237..0000000 --- a/src/app/openapi/models/Surveyor.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Surveyor = { - id?: (number | null); - name: string; -}; - diff --git a/src/app/openapi/models/Tag.ts b/src/app/openapi/models/Tag.ts deleted file mode 100644 index 200aeed..0000000 --- a/src/app/openapi/models/Tag.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Tag = { - key: string; - value: string; -}; - diff --git a/src/app/openapi/models/TagAction.ts b/src/app/openapi/models/TagAction.ts deleted file mode 100644 index c1bc8ff..0000000 --- a/src/app/openapi/models/TagAction.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type TagAction = { - name: string; - action: string; - roles?: (Array | null); - link?: (string | null); - save?: boolean; -}; - diff --git a/src/app/openapi/models/TagActions.ts b/src/app/openapi/models/TagActions.ts deleted file mode 100644 index d744863..0000000 --- a/src/app/openapi/models/TagActions.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { TagAction } from './TagAction'; -export type TagActions = { - domain: string; - key: string; - actions: Array; -}; - diff --git a/src/app/openapi/models/TaggedFeature.ts b/src/app/openapi/models/TaggedFeature.ts deleted file mode 100644 index e0e6f7b..0000000 --- a/src/app/openapi/models/TaggedFeature.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { Tags } from './Tags'; -export type TaggedFeature = { - id: string; - tags: Tags; - lat: number; - lon: number; -}; - diff --git a/src/app/openapi/models/TaggedLayer.ts b/src/app/openapi/models/TaggedLayer.ts deleted file mode 100644 index 84eb3db..0000000 --- a/src/app/openapi/models/TaggedLayer.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { TaggedFeature } from './TaggedFeature'; -export type TaggedLayer = { - store: string; - taggedFeatures: Array; -}; - diff --git a/src/app/openapi/models/Tags.ts b/src/app/openapi/models/Tags.ts deleted file mode 100644 index d50840c..0000000 --- a/src/app/openapi/models/Tags.ts +++ /dev/null @@ -1,12 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Tags = { - id?: (number | null); - geom: string; - store: string; - ref_id: number; - tags: Record; -}; - diff --git a/src/app/openapi/models/TileServer.ts b/src/app/openapi/models/TileServer.ts deleted file mode 100644 index f82569f..0000000 --- a/src/app/openapi/models/TileServer.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type TileServer = { - baseDir?: string; - useRequestUrl?: boolean; - spriteBaseDir?: string; - spriteUrl?: string; - spriteBaseUrl?: string; - openMapTilesKey?: (string | null); -}; - diff --git a/src/app/openapi/models/Token.ts b/src/app/openapi/models/Token.ts deleted file mode 100644 index ec896be..0000000 --- a/src/app/openapi/models/Token.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type Token = { - access_token: string; - token_type: string; -}; - diff --git a/src/app/openapi/models/UserRead.ts b/src/app/openapi/models/UserRead.ts deleted file mode 100644 index 26fdf59..0000000 --- a/src/app/openapi/models/UserRead.ts +++ /dev/null @@ -1,13 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { RoleReadNoUsers } from './RoleReadNoUsers'; -export type UserRead = { - username: string; - email: (string | null); - disabled?: (boolean | null); - id: number; - roles?: Array; -}; - diff --git a/src/app/openapi/models/UserReadNoRoles.ts b/src/app/openapi/models/UserReadNoRoles.ts deleted file mode 100644 index 1663284..0000000 --- a/src/app/openapi/models/UserReadNoRoles.ts +++ /dev/null @@ -1,11 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type UserReadNoRoles = { - username: string; - email: (string | null); - disabled?: (boolean | null); - id: number; -}; - diff --git a/src/app/openapi/models/UserRoleLink.ts b/src/app/openapi/models/UserRoleLink.ts deleted file mode 100644 index 595e65f..0000000 --- a/src/app/openapi/models/UserRoleLink.ts +++ /dev/null @@ -1,9 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type UserRoleLink = { - user_id?: (number | null); - role_id?: (number | null); -}; - diff --git a/src/app/openapi/models/ValidationError.ts b/src/app/openapi/models/ValidationError.ts deleted file mode 100644 index f2ff49a..0000000 --- a/src/app/openapi/models/ValidationError.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ValidationError = { - loc: Array<(string | number)>; - msg: string; - type: string; -}; - diff --git a/src/app/openapi/schemas.ts b/src/app/openapi/schemas.ts new file mode 100644 index 0000000..11fbdd6 --- /dev/null +++ b/src/app/openapi/schemas.ts @@ -0,0 +1,2206 @@ +export const $Action = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + roles: { + type: 'array', + contains: { + type: 'string', +}, + isRequired: true, +}, + params: { + type: 'array', + contains: { + type: 'ActionParam', + }, + isRequired: true, +}, + }, +} as const; + +export const $ActionParam = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + type: { + type: 'string', + isRequired: true, +}, + dflt: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $ActionResult = { + properties: { + message: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + taggedLayers: { + type: 'array', + contains: { + type: 'TaggedLayer', + }, + default: [], +}, + }, +} as const; + +export const $ActionResults = { + properties: { + name: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + message: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + actionResults: { + type: 'array', + contains: { + type: 'ActionResult', + }, + default: [], +}, + }, +} as const; + +export const $ActionsResults = { + properties: { + message: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + actionResults: { + type: 'array', + contains: { + type: 'ActionResults', + }, + default: [], +}, + }, +} as const; + +export const $ActionsStore = { + properties: { + store: { + type: 'string', + isRequired: true, +}, + actions: { + type: 'array', + contains: { + type: 'Action', + }, + isRequired: true, +}, + }, +} as const; + +export const $AdminBasket = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + files: { + type: 'array', + contains: { + type: 'FileImport', + }, + isRequired: true, +}, + columns: { + type: 'array', + contains: { + type: 'string', +}, + isRequired: true, +}, + uploadFields: { + type: 'array', + contains: { + type: 'string', +}, + isRequired: true, +}, + projects: { + type: 'array', + contains: { + type: 'Project', + }, + default: [], +}, + }, +} as const; + +export const $Attachment = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + path: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $BaseMapWithStores = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + stores: { + type: 'array', + contains: { + type: 'string', +}, + isRequired: true, +}, + }, +} as const; + +export const $BaseStyle = { + properties: { + id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + name: { + type: 'string', + isRequired: true, +}, + style: { + type: 'any-of', + contains: [{ + type: 'dictionary', + contains: { + properties: { + }, +}, +}, { + type: 'null', +}], + isRequired: true, +}, + mbtiles: { + type: 'string', + isRequired: true, +}, + static_tiles_url: { + type: 'string', + isRequired: true, +}, + enabled: { + type: 'boolean', + default: true, +}, + }, +} as const; + +export const $BasketDefault = { + properties: { + surveyor: { + type: 'string', + default: 'Default surveyor', +}, + equipment: { + type: 'string', + default: 'Default equipment', +}, + project: { + type: 'string', + default: 'Default project', +}, + status: { + type: 'string', + default: 'E', +}, + store: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $BasketNameOnly = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $Body_execute_tag_action_api_execTagActions_post = { + properties: { + stores: { + type: 'array', + contains: { + type: 'string', +}, + isRequired: true, +}, + ids: { + type: 'array', + contains: { + type: 'array', + contains: { + type: 'string', +}, +}, + isRequired: true, +}, + actionNames: { + type: 'array', + contains: { + type: 'string', +}, + isRequired: true, +}, + params: { + type: 'array', + contains: { + type: 'any-of', + contains: [{ + type: 'ActionParam', +}, { + type: 'null', +}], +}, + isRequired: true, +}, + formFields: { + type: 'array', + contains: { + type: 'FormFieldInput', + }, + isRequired: true, +}, + }, +} as const; + +export const $Body_login_for_access_token_api_token_post = { + properties: { + grant_type: { + type: 'any-of', + contains: [{ + type: 'string', + pattern: 'password', +}, { + type: 'null', +}], +}, + username: { + type: 'string', + isRequired: true, +}, + password: { + type: 'string', + isRequired: true, +}, + scope: { + type: 'string', + default: '', +}, + client_id: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + client_secret: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $BootstrapData = { + properties: { + version: { + type: 'string', + default: '2023.4.dev56+g775030d.d20240325', +}, + title: { + type: 'string', + default: 'Auroville Geomatics Studio (Me)', +}, + windowTitle: { + type: 'string', + default: 'AV Geomatics Studio (Me)', +}, + map: { + type: 'all-of', + contains: [{ + type: 'Map', +}], +}, + geo: { + type: 'all-of', + contains: [{ + type: 'Geo', +}], +}, + measures: { + type: 'all-of', + contains: [{ + type: 'Measures', +}], +}, + redirect: { + type: 'string', + default: 'http://gis.auroville.org.in', +}, + user: { + type: 'any-of', + contains: [{ + type: 'UserRead', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $CategoryGroup = { + properties: { + name: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + major: { + type: 'boolean', + isRequired: true, +}, + long_name: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $CategoryRead = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + description: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], + isRequired: true, +}, + group: { + type: 'string', + isRequired: true, +}, + minor_group_1: { + type: 'string', + default: '----', +}, + minor_group_2: { + type: 'string', + default: '----', +}, + status: { + type: 'string', + isRequired: true, +}, + custom: { + type: 'any-of', + contains: [{ + type: 'boolean', +}, { + type: 'null', +}], + isRequired: true, +}, + auto_import: { + type: 'boolean', + default: true, +}, + gis_type: { + type: 'string', + default: 'Point', +}, + long_name: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], + isRequired: true, +}, + style: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], + isRequired: true, +}, + symbol: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], + isRequired: true, +}, + mapbox_type_custom: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], + isRequired: true, +}, + mapbox_paint: { + type: 'any-of', + contains: [{ + type: 'dictionary', + contains: { + type: 'any-of', + contains: [{ + type: 'dictionary', + contains: { + properties: { + }, +}, +}, { + type: 'array', + contains: { + properties: { + }, +}, +}, { + type: 'number', +}, { + type: 'number', +}, { + type: 'string', +}], +}, +}, { + type: 'null', +}], + isRequired: true, +}, + mapbox_layout: { + type: 'any-of', + contains: [{ + type: 'dictionary', + contains: { + type: 'any-of', + contains: [{ + type: 'dictionary', + contains: { + properties: { + }, +}, +}, { + type: 'array', + contains: { + properties: { + }, +}, +}, { + type: 'number', +}, { + type: 'number', +}, { + type: 'string', +}], +}, +}, { + type: 'null', +}], + isRequired: true, +}, + viewable_role: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], + isRequired: true, +}, + extra: { + type: 'any-of', + contains: [{ + type: 'dictionary', + contains: { + properties: { + }, +}, +}, { + type: 'null', +}], + isRequired: true, +}, + layer_name: { + type: 'string', + description: `ISO compliant layer name (see ISO 13567) +:return: str`, + isReadOnly: true, + isRequired: true, +}, + table_name: { + type: 'string', + description: `Table name +:return:`, + isReadOnly: true, + isRequired: true, +}, + raw_survey_table_name: { + type: 'string', + description: `Table name +:return:`, + isReadOnly: true, + isRequired: true, +}, + mapbox_type: { + type: 'string', + isReadOnly: true, + isRequired: true, +}, + }, +} as const; + +export const $Dashboard = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + group: { + type: 'string', + isRequired: true, +}, + description: { + type: 'string', + isRequired: true, +}, + time: { + type: 'any-of', + contains: [{ + type: 'string', + format: 'date-time', +}, { + type: 'null', +}], +}, + html: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + attachment: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + dfData: { + type: 'array', + contains: { + properties: { + }, +}, + default: [], +}, + plotData: { + type: 'any-of', + contains: [{ + type: 'array', + contains: { + type: 'dictionary', + contains: { + properties: { + }, +}, +}, +}, { + type: 'null', +}], +}, + plotLayout: { + type: 'any-of', + contains: [{ + type: 'dictionary', + contains: { + properties: { + }, +}, +}, { + type: 'null', +}], +}, + notebook: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + expandedPanes: { + type: 'any-of', + contains: [{ + type: 'array', + contains: { + type: 'string', +}, +}, { + type: 'null', +}], +}, + sections: { + type: 'any-of', + contains: [{ + type: 'array', + contains: { + type: 'DashboardSection', + }, +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $DashboardGroup = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + pages: { + type: 'array', + contains: { + type: 'DashboardPageMetaData', + }, + isRequired: true, +}, + }, +} as const; + +export const $DashboardHome = { + properties: { + title: { + type: 'string', + isRequired: true, +}, + content: { + type: 'string', + isRequired: true, +}, + footer: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $DashboardPageMetaData = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + group: { + type: 'string', + isRequired: true, +}, + description: { + type: 'string', + isRequired: true, +}, + viewable_role: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $DashboardSection = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + plot: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $DataProvider = { + properties: { + store: { + type: 'string', + isRequired: true, +}, + name: { + type: 'string', + isRequired: true, +}, + values: { + type: 'array', + contains: { + type: 'string', +}, + isRequired: true, +}, + }, +} as const; + +export const $Downloader = { + properties: { + roles: { + type: 'array', + contains: { + type: 'string', +}, + default: [], +}, + name: { + type: 'string', + isRequired: true, +}, + icon: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $Equipment = { + properties: { + id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + name: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $FeatureInfo = { + properties: { + id: { + type: 'string', + isRequired: true, +}, + itemName: { + type: 'string', + isRequired: true, +}, + geoInfoItems: { + type: 'array', + contains: { + type: 'InfoItem', + }, + default: [], +}, + surveyInfoItems: { + type: 'array', + contains: { + type: 'InfoItem', + }, + default: [], +}, + infoItems: { + type: 'array', + contains: { + type: 'InfoItem', + }, + default: [], +}, + categorizedInfoItems: { + type: 'any-of', + contains: [{ + type: 'array', + contains: { + type: 'InfoCategory', + }, +}, { + type: 'null', +}], +}, + tags: { + type: 'array', + contains: { + type: 'Tag', + }, + default: [], +}, + graph: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + plotParams: { + type: 'any-of', + contains: [{ + type: 'PlotParams', +}, { + type: 'null', +}], +}, + files: { + type: 'array', + contains: { + type: 'Attachment', + }, + default: [], +}, + images: { + type: 'array', + contains: { + type: 'Attachment', + }, + default: [], +}, + externalRecordUrl: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $FileImport = { + description: `Files to import or imported in the DB. +Give either url or path.`, + properties: { + id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + url: { + type: 'string', + isRequired: true, +}, + path: { + type: 'string', + isRequired: true, +}, + dir: { + type: 'string', + isRequired: true, +}, + name: { + type: 'string', + isRequired: true, +}, + md5: { + type: 'string', + isRequired: true, +}, + time: { + type: 'string', + isRequired: true, + format: 'date-time', +}, + comment: { + type: 'string', + isRequired: true, +}, + status: { + type: 'string', + isRequired: true, +}, + store: { + type: 'string', + isRequired: true, +}, + basket: { + type: 'string', + isRequired: true, +}, + project_id: { + type: 'number', + isRequired: true, +}, + surveyor_id: { + type: 'number', + isRequired: true, +}, + equipment_id: { + type: 'number', + isRequired: true, +}, + }, +} as const; + +export const $FormField = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + type: { + type: 'string', + isRequired: true, +}, + dflt: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + value: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $FormFieldInput = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + value: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $Geo = { + properties: { + raw_survey: { + type: 'all-of', + contains: [{ + type: 'RawSurvey', +}], +}, + simplify_geom_factor: { + type: 'number', + default: 10000000, +}, + simplify_preserve_topology: { + type: 'boolean', + default: false, +}, + srid: { + type: 'number', + default: 4326, +}, + srid_for_proj: { + type: 'number', + default: 32644, +}, + }, +} as const; + +export const $HTTPValidationError = { + properties: { + detail: { + type: 'array', + contains: { + type: 'ValidationError', + }, +}, + }, +} as const; + +export const $InfoCategory = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + infoItems: { + type: 'array', + contains: { + type: 'InfoItem', + }, + isRequired: true, +}, + }, +} as const; + +export const $InfoItem = { + properties: { + key: { + type: 'string', + isRequired: true, +}, + value: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'number', +}, { + type: 'number', +}], + isRequired: true, +}, + }, +} as const; + +export const $LegendItem = { + properties: { + key: { + type: 'string', + isRequired: true, +}, + value: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $Map = { + properties: { + tileServer: { + type: 'all-of', + contains: [{ + type: 'TileServer', +}], +}, + zoom: { + type: 'number', + default: 14, +}, + pitch: { + type: 'number', + default: 45, +}, + lat: { + type: 'number', + default: 12, +}, + lng: { + type: 'number', + default: 79.8106, +}, + bearing: { + type: 'number', + default: 0, +}, + style: { + type: 'string', + default: 'OSM (vector)', +}, + opacity: { + type: 'number', + default: 1, +}, + attribution: { + type: 'string', + default: '', +}, + status: { + type: 'array', + contains: { + type: 'string', +}, + default: [ + "E", + "F", + "D" +], +}, + defaultStatus: { + type: 'array', + contains: { + type: 'string', +}, + default: [ + "E" +], +}, + tagKeys: { + type: 'array', + contains: { + type: 'string', +}, + default: [ + "source" +], +}, + }, +} as const; + +export const $MapInitData = { + properties: { + baseStyles: { + type: 'array', + contains: { + type: 'BaseStyle', + }, + default: [], +}, + baseMaps: { + type: 'array', + contains: { + type: 'BaseMapWithStores', + }, + default: [], +}, + groups: { + type: 'array', + contains: { + type: 'CategoryGroup', + }, + default: [], +}, + stores: { + type: 'array', + contains: { + type: 'Store', + }, + default: [], +}, + }, +} as const; + +export const $MaplibreStyle = { + properties: { + paint: { + type: 'any-of', + contains: [{ + type: 'dictionary', + contains: { + type: 'any-of', + contains: [{ + type: 'dictionary', + contains: { + properties: { + }, +}, +}, { + type: 'array', + contains: { + properties: { + }, +}, +}, { + type: 'number', +}, { + type: 'number', +}, { + type: 'string', +}], +}, +}, { + type: 'null', +}], +}, + layout: { + type: 'any-of', + contains: [{ + type: 'dictionary', + contains: { + type: 'any-of', + contains: [{ + type: 'dictionary', + contains: { + properties: { + }, +}, +}, { + type: 'array', + contains: { + properties: { + }, +}, +}, { + type: 'number', +}, { + type: 'number', +}, { + type: 'string', +}], +}, +}, { + type: 'null', +}], +}, + attribution: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $Measures = { + properties: { + defaultStore: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $MeasuresItem = { + properties: { + id: { + type: 'number', + isRequired: true, +}, + name: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $ModelAction = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + icon: { + type: 'string', + isRequired: true, +}, + roles: { + type: 'any-of', + contains: [{ + type: 'array', + contains: { + type: 'string', +}, +}, { + type: 'null', +}], +}, + formFields: { + type: 'array', + contains: { + type: 'FormField', + }, + isRequired: true, +}, + }, +} as const; + +export const $ModelInfo = { + properties: { + store: { + type: 'string', + isRequired: true, +}, + modelName: { + type: 'string', + isRequired: true, +}, + symbol: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + values: { + type: 'array', + contains: { + type: 'ModelValue', + }, + default: [], +}, + actions: { + type: 'array', + contains: { + type: 'ModelAction', + }, + default: [], +}, + formName: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + formFields: { + type: 'array', + contains: { + type: 'FormField', + }, + default: [], +}, + tagPlugins: { + type: 'array', + contains: { + type: 'string', +}, + default: [], +}, + tagActions: { + type: 'array', + contains: { + type: 'TagActions', + }, + default: [], +}, + downloaders: { + type: 'array', + contains: { + type: 'Downloader', + }, + default: [], +}, + legend: { + type: 'array', + contains: { + type: 'LegendItem', + }, + default: [], +}, + }, +} as const; + +export const $ModelValue = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + title: { + type: 'string', + isRequired: true, +}, + unit: { + type: 'string', + isRequired: true, +}, + chartType: { + type: 'string', + default: 'line', +}, + chartColor: { + type: 'string', + default: 'blue', +}, + }, +} as const; + +export const $PlotBaseLine = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + value: { + type: 'number', + isRequired: true, +}, + color: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $PlotBgShape = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + valueTop: { + type: 'number', + isRequired: true, +}, + valueBottom: { + type: 'number', + isRequired: true, +}, + color: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $PlotParams = { + properties: { + baseLines: { + type: 'array', + contains: { + type: 'PlotBaseLine', + }, + default: [], +}, + bgShapes: { + type: 'array', + contains: { + type: 'PlotBgShape', + }, + default: [], +}, + barBase: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $Project = { + properties: { + id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + name: { + type: 'string', + isRequired: true, +}, + contact_person: { + type: 'string', + isRequired: true, +}, + site: { + type: 'string', + isRequired: true, +}, + date_approved: { + type: 'string', + isRequired: true, + format: 'date', +}, + start_date_planned: { + type: 'string', + isRequired: true, + format: 'date', +}, + start_date_effective: { + type: 'string', + isRequired: true, + format: 'date', +}, + end_date_planned: { + type: 'string', + isRequired: true, + format: 'date', +}, + end_date_effective: { + type: 'string', + isRequired: true, + format: 'date', +}, + }, +} as const; + +export const $RawSurvey = { + properties: { + spatial_sys_ref: { + type: 'all-of', + contains: [{ + type: 'SpatialSysRef', +}], +}, + srid: { + type: 'number', + default: 910001, +}, + }, +} as const; + +export const $RoleRead = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + id: { + type: 'number', + isRequired: true, +}, + users: { + type: 'array', + contains: { + type: 'UserReadNoRoles', + }, + default: [], +}, + }, +} as const; + +export const $RoleReadNoUsers = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + id: { + type: 'number', + isRequired: true, +}, + }, +} as const; + +export const $SpatialSysRef = { + properties: { + author: { + type: 'string', + default: 'AVSM', +}, + ellps: { + type: 'string', + default: 'WGS84', +}, + k: { + type: 'number', + default: 1, +}, + lat_0: { + type: 'number', + default: 12.01605433, +}, + lon_0: { + type: 'number', + default: 79.80998934, +}, + no_defs: { + type: 'boolean', + default: true, +}, + proj: { + type: 'string', + default: 'tmerc', +}, + towgs84: { + type: 'string', + default: '0,0,0,0,0,0,0', +}, + units: { + type: 'string', + default: 'm', +}, + x_0: { + type: 'number', + default: 370455.63, +}, + y_0: { + type: 'number', + default: 1328608.994, +}, + }, +} as const; + +export const $Store = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + category: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + auto_import: { + type: 'boolean', + isRequired: true, +}, + count: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + custom: { + type: 'boolean', + isRequired: true, +}, + description: { + type: 'string', + isRequired: true, +}, + gis_type: { + type: 'string', + isRequired: true, +}, + group: { + type: 'string', + isRequired: true, +}, + in_menu: { + type: 'boolean', + isRequired: true, +}, + is_db: { + type: 'boolean', + isRequired: true, +}, + is_line_work: { + type: 'boolean', + isRequired: true, +}, + is_live: { + type: 'boolean', + isRequired: true, +}, + long_name: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], + isRequired: true, +}, + type: { + type: 'string', + isRequired: true, +}, + minor_group_1: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], + isRequired: true, +}, + minor_group_2: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], + isRequired: true, +}, + status: { + type: 'string', + isRequired: true, +}, + style: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], + isRequired: true, +}, + symbol: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], + isRequired: true, +}, + title: { + type: 'string', + isRequired: true, +}, + viewable_role: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], + isRequired: true, +}, + z_index: { + type: 'number', + isRequired: true, +}, + }, +} as const; + +export const $StoreNameOnly = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $SurveyMeta = { + properties: { + projects: { + type: 'array', + contains: { + type: 'Project', + }, + isRequired: true, +}, + surveyors: { + type: 'array', + contains: { + type: 'Surveyor', + }, + isRequired: true, +}, + equipments: { + type: 'array', + contains: { + type: 'Equipment', + }, + isRequired: true, +}, + statuses: { + type: 'array', + contains: { + type: 'string', +}, + isRequired: true, +}, + stores_misc: { + type: 'array', + contains: { + type: 'StoreNameOnly', + }, + isRequired: true, +}, + stores_line_work: { + type: 'array', + contains: { + type: 'StoreNameOnly', + }, + isRequired: true, +}, + default: { + type: 'BasketDefault', + isRequired: true, +}, + }, +} as const; + +export const $Surveyor = { + properties: { + id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + name: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $Tag = { + properties: { + key: { + type: 'string', + isRequired: true, +}, + value: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $TagAction = { + properties: { + name: { + type: 'string', + isRequired: true, +}, + action: { + type: 'string', + isRequired: true, +}, + roles: { + type: 'any-of', + contains: [{ + type: 'array', + contains: { + type: 'string', +}, +}, { + type: 'null', +}], +}, + link: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + save: { + type: 'boolean', + default: false, +}, + }, +} as const; + +export const $TagActions = { + properties: { + domain: { + type: 'string', + isRequired: true, +}, + key: { + type: 'string', + isRequired: true, +}, + actions: { + type: 'array', + contains: { + type: 'TagAction', + }, + isRequired: true, +}, + }, +} as const; + +export const $TaggedFeature = { + properties: { + id: { + type: 'string', + isRequired: true, +}, + tags: { + type: 'Tags', + isRequired: true, +}, + lat: { + type: 'number', + isRequired: true, +}, + lon: { + type: 'number', + isRequired: true, +}, + }, +} as const; + +export const $TaggedLayer = { + properties: { + store: { + type: 'string', + isRequired: true, +}, + taggedFeatures: { + type: 'array', + contains: { + type: 'TaggedFeature', + }, + isRequired: true, +}, + }, +} as const; + +export const $Tags = { + properties: { + id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + geom: { + type: 'string', + isRequired: true, +}, + store: { + type: 'string', + isRequired: true, +}, + ref_id: { + type: 'number', + isRequired: true, +}, + tags: { + type: 'dictionary', + contains: { + properties: { + }, +}, + isRequired: true, +}, + }, +} as const; + +export const $TileServer = { + properties: { + baseDir: { + type: 'string', + default: '/path/to/mbtiles_files_dir', +}, + useRequestUrl: { + type: 'boolean', + default: false, +}, + spriteBaseDir: { + type: 'string', + default: '/path/to/mbtiles_sprites_dir', +}, + spriteUrl: { + type: 'string', + default: '/tiles/sprite/sprite', +}, + spriteBaseUrl: { + type: 'string', + default: 'https://gisaf.example.org', +}, + openMapTilesKey: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $Token = { + properties: { + access_token: { + type: 'string', + isRequired: true, +}, + token_type: { + type: 'string', + isRequired: true, +}, + }, +} as const; + +export const $UserRead = { + properties: { + username: { + type: 'string', + isRequired: true, +}, + email: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], + isRequired: true, +}, + disabled: { + type: 'any-of', + contains: [{ + type: 'boolean', +}, { + type: 'null', +}], +}, + id: { + type: 'number', + isRequired: true, +}, + roles: { + type: 'array', + contains: { + type: 'RoleReadNoUsers', + }, + default: [], +}, + }, +} as const; + +export const $UserReadNoRoles = { + properties: { + username: { + type: 'string', + isRequired: true, +}, + email: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'null', +}], + isRequired: true, +}, + disabled: { + type: 'any-of', + contains: [{ + type: 'boolean', +}, { + type: 'null', +}], +}, + id: { + type: 'number', + isRequired: true, +}, + }, +} as const; + +export const $UserRoleLink = { + properties: { + user_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + role_id: { + type: 'any-of', + contains: [{ + type: 'number', +}, { + type: 'null', +}], +}, + }, +} as const; + +export const $ValidationError = { + properties: { + loc: { + type: 'array', + contains: { + type: 'any-of', + contains: [{ + type: 'string', +}, { + type: 'number', +}], +}, + isRequired: true, +}, + msg: { + type: 'string', + isRequired: true, +}, + type: { + type: 'string', + isRequired: true, +}, + }, +} as const; \ No newline at end of file diff --git a/src/app/openapi/services.ts b/src/app/openapi/services.ts new file mode 100644 index 0000000..5e7e9ae --- /dev/null +++ b/src/app/openapi/services.ts @@ -0,0 +1,683 @@ +import { Injectable } from '@angular/core'; +import { HttpClient } from '@angular/common/http'; +import type { Observable } from 'rxjs'; +import { OpenAPI } from './core/OpenAPI'; +import { request as __request } from './core/request'; + +import type { ActionsResults,ActionsStore,Body_execute_tag_action_api_execTagActions_post,Body_login_for_access_token_api_token_post,BootstrapData,CategoryRead,DataProvider,FeatureInfo,MeasuresItem,ModelInfo,PlotParams,Project,RoleRead,Store,SurveyMeta,Token,UserRead,UserRoleLink,AdminBasket,BasketNameOnly,Dashboard,DashboardGroup,DashboardHome,BaseStyle,MapInitData,MaplibreStyle } from './models'; + +export type TDataLoginForAccessTokenApiTokenPost = { + formData: Body_login_for_access_token_api_token_post + + } +export type TDataGetModelListApiDataProviderStoreGet = { + store: string + + } +export type TDataGetModelValuesApiStoreNameValuesValueGet = { + resample?: string | null +storeName: string +value: string +where: string + + } +export type TDataGetFeatureInfoApiFeatureInfoStoreIdGet = { + id: string +store: string + + } +export type TDataGetModelInfoApiModelInfoStoreGet = { + store: string + + } +export type TDataGetPlotParamsApiPlotParamsStoreGet = { + id: string +store: string +value: string + + } +export type TDataExecuteTagActionApiExecTagActionsPost = { + requestBody: Body_execute_tag_action_api_execTagActions_post + + } + +@Injectable({ + providedIn: 'root', +}) +export class ApiService { + + constructor(public readonly http: HttpClient) {} + + /** + * Bootstrap + * @returns BootstrapData Successful Response + * @throws ApiError + */ + public bootstrapApiBootstrapGet(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/bootstrap', + errors: { + 404: `Not found`, + }, + }); + } + + /** + * Login For Access Token + * @returns Token Successful Response + * @throws ApiError + */ + public loginForAccessTokenApiTokenPost(data: TDataLoginForAccessTokenApiTokenPost): Observable { + const { +formData, +} = data; + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/token', + formData: formData, + mediaType: 'application/x-www-form-urlencoded', + errors: { + 404: `Not found`, + 422: `Validation Error`, + }, + }); + } + + /** + * Logout + * @returns unknown Successful Response + * @throws ApiError + */ + public logoutApiLogoutGet(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/logout', + errors: { + 404: `Not found`, + }, + }); + } + + /** + * Get Users + * @returns UserRead Successful Response + * @throws ApiError + */ + public getUsersApiUsersGet(): Observable> { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/users', + errors: { + 404: `Not found`, + }, + }); + } + + /** + * Get Roles + * @returns RoleRead Successful Response + * @throws ApiError + */ + public getRolesApiRolesGet(): Observable> { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/roles', + errors: { + 404: `Not found`, + }, + }); + } + + /** + * Get Acls + * New: ACLs returned as UserRoleLink + * @returns UserRoleLink Successful Response + * @throws ApiError + */ + public getAclsApiAclsGet(): Observable> { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/acls', + errors: { + 404: `Not found`, + }, + }); + } + + /** + * Get Categories + * @returns CategoryRead Successful Response + * @throws ApiError + */ + public getCategoriesApiCategoriesGet(): Observable> { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/categories', + errors: { + 404: `Not found`, + }, + }); + } + + /** + * Get Categories P + * @returns CategoryRead Successful Response + * @throws ApiError + */ + public getCategoriesPApiCategoriesPandasGet(): Observable> { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/categories_pandas', + errors: { + 404: `Not found`, + }, + }); + } + + /** + * List Data Providers + * Return a list of data providers, for use with the api (graphs, etc) + * :return: + * @returns DataProvider Successful Response + * @throws ApiError + */ + public listDataProvidersApiDataProvidersGet(): Observable> { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/data-providers', + errors: { + 404: `Not found`, + }, + }); + } + + /** + * Get Model List + * Json REST store API compatible with Flask Potion and Angular + * Get the list of items (used for making the list of items in measures) + * Filter only items with at least one measure + * @returns MeasuresItem Successful Response + * @throws ApiError + */ + public getModelListApiDataProviderStoreGet(data: TDataGetModelListApiDataProviderStoreGet): Observable> { + const { +store, +} = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/data-provider/{store}', + path: { + store + }, + errors: { + 404: `Not found`, + 422: `Validation Error`, + }, + }); + } + + /** + * Get Model Values + * Get values + * @returns unknown Successful Response + * @throws ApiError + */ + public getModelValuesApiStoreNameValuesValueGet(data: TDataGetModelValuesApiStoreNameValuesValueGet): Observable { + const { +resample, +storeName, +value, +where, +} = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/{store_name}/values/{value}', + path: { + store_name: storeName, value + }, + query: { + where, resample + }, + errors: { + 404: `Not found`, + 422: `Validation Error`, + }, + }); + } + + /** + * Get Stores + * @returns Store Successful Response + * @throws ApiError + */ + public getStoresApiStoresGet(): Observable> { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/stores', + errors: { + 404: `Not found`, + }, + }); + } + + /** + * Get Projects + * @returns Project Successful Response + * @throws ApiError + */ + public getProjectsApiProjectsGet(): Observable> { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/projects', + errors: { + 404: `Not found`, + }, + }); + } + + /** + * Get Survey Meta + * @returns SurveyMeta Successful Response + * @throws ApiError + */ + public getSurveyMetaApiSurveyMetaGet(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/survey_meta', + errors: { + 404: `Not found`, + }, + }); + } + + /** + * Get Feature Info + * @returns unknown Successful Response + * @throws ApiError + */ + public getFeatureInfoApiFeatureInfoStoreIdGet(data: TDataGetFeatureInfoApiFeatureInfoStoreIdGet): Observable { + const { +id, +store, +} = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/feature-info/{store}/{id}', + path: { + store, id + }, + errors: { + 404: `Not found`, + 422: `Validation Error`, + }, + }); + } + + /** + * Get Model Info + * @returns ModelInfo Successful Response + * @throws ApiError + */ + public getModelInfoApiModelInfoStoreGet(data: TDataGetModelInfoApiModelInfoStoreGet): Observable { + const { +store, +} = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/model-info/{store}', + path: { + store + }, + errors: { + 404: `Not found`, + 422: `Validation Error`, + }, + }); + } + + /** + * Get Plot Params + * @returns PlotParams Successful Response + * @throws ApiError + */ + public getPlotParamsApiPlotParamsStoreGet(data: TDataGetPlotParamsApiPlotParamsStoreGet): Observable { + const { +id, +store, +value, +} = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/plot-params/{store}', + path: { + store + }, + query: { + id, value + }, + errors: { + 404: `Not found`, + 422: `Validation Error`, + }, + }); + } + + /** + * Get Actions + * @returns ActionsStore Successful Response + * @throws ApiError + */ + public getActionsApiActionsGet(): Observable> { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/actions', + errors: { + 404: `Not found`, + }, + }); + } + + /** + * Execute Tag Action + * @returns ActionsResults Successful Response + * @throws ApiError + */ + public executeTagActionApiExecTagActionsPost(data: TDataExecuteTagActionApiExecTagActionsPost): Observable { + const { +requestBody, +} = data; + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/execTagActions', + body: requestBody, + mediaType: 'application/json', + errors: { + 404: `Not found`, + 422: `Validation Error`, + }, + }); + } + +} + +export type TDataGetGeojsonApiGjStoreNameGet = { + ifNoneMatch?: string | null +preserveTopology?: boolean | null +simplify?: number | null +storeName: unknown + + } + +@Injectable({ + providedIn: 'root', +}) +export class GeoapiService { + + constructor(public readonly http: HttpClient) {} + + /** + * Get Geojson + * Some REST stores coded manually (route prefixed with "gj": geojson). + * :param store_name: name of the model + * :return: json + * @returns unknown Successful Response + * @throws ApiError + */ + public getGeojsonApiGjStoreNameGet(data: TDataGetGeojsonApiGjStoreNameGet): Observable { + const { +ifNoneMatch, +preserveTopology, +simplify, +storeName, +} = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/gj/{store_name}', + path: { + store_name: storeName + }, + headers: { + 'If-None-Match': ifNoneMatch, simplify, preserveTopology + }, + errors: { + 404: `Not found`, + 422: `Validation Error`, + }, + }); + } + +} + +export type TDataGetBasketApiAdminBasketNameGet = { + name: string + + } + +@Injectable({ + providedIn: 'root', +}) +export class AdminService { + + constructor(public readonly http: HttpClient) {} + + /** + * Get Baskets + * @returns BasketNameOnly Successful Response + * @throws ApiError + */ + public getBasketsApiAdminBasketGet(): Observable> { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/admin/basket', + errors: { + 404: `Not found`, + }, + }); + } + + /** + * Get Basket + * @returns AdminBasket Successful Response + * @throws ApiError + */ + public getBasketApiAdminBasketNameGet(data: TDataGetBasketApiAdminBasketNameGet): Observable { + const { +name, +} = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/admin/basket/{name}', + path: { + name + }, + errors: { + 404: `Not found`, + 422: `Validation Error`, + }, + }); + } + +} + +export type TDataGetDashboardPageApiDashboardPageGroupNameGet = { + group: string +name: string + + } + +@Injectable({ + providedIn: 'root', +}) +export class DashboardService { + + constructor(public readonly http: HttpClient) {} + + /** + * Get Groups + * @returns DashboardGroup Successful Response + * @throws ApiError + */ + public getGroupsApiDashboardGroupsGet(): Observable> { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/dashboard/groups', + errors: { + 404: `Not found`, + }, + }); + } + + /** + * Get Home + * @returns DashboardHome Successful Response + * @throws ApiError + */ + public getHomeApiDashboardHomeGet(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/dashboard/home', + errors: { + 404: `Not found`, + }, + }); + } + + /** + * Get Dashboard Page + * @returns Dashboard Successful Response + * @throws ApiError + */ + public getDashboardPageApiDashboardPageGroupNameGet(data: TDataGetDashboardPageApiDashboardPageGroupNameGet): Observable { + const { +group, +name, +} = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/dashboard/page/{group}/{name}', + path: { + group, name + }, + errors: { + 404: `Not found`, + 422: `Validation Error`, + }, + }); + } + +} + +export type TDataGetBaseStyleApiMapBaseStyleNameGet = { + name: string + + } +export type TDataGetLayerStyleApiMapLayerStyleStoreGet = { + store: string + + } + +@Injectable({ + providedIn: 'root', +}) +export class MapService { + + constructor(public readonly http: HttpClient) {} + + /** + * Get Init Data + * @returns MapInitData Successful Response + * @throws ApiError + */ + public getInitDataApiMapInitDataGet(): Observable { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/map/init-data', + }); + } + + /** + * Get Base Style + * @returns BaseStyle Successful Response + * @throws ApiError + */ + public getBaseStyleApiMapBaseStyleNameGet(data: TDataGetBaseStyleApiMapBaseStyleNameGet): Observable { + const { +name, +} = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/map/base_style/{name}', + path: { + name + }, + errors: { + 422: `Validation Error`, + }, + }); + } + + /** + * Get Layer Style + * @returns unknown Successful Response + * @throws ApiError + */ + public getLayerStyleApiMapLayerStyleStoreGet(data: TDataGetLayerStyleApiMapLayerStyleStoreGet): Observable { + const { +store, +} = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/map/layer_style/{store}', + path: { + store + }, + errors: { + 422: `Validation Error`, + }, + }); + } + +} + +export type TDataDownloadCsvApiDownloadCsvStoreModelIdValueResampleGet = { + modelId: number +resample: string +store: string +value: string + + } + +@Injectable({ + providedIn: 'root', +}) +export class DownloadService { + + constructor(public readonly http: HttpClient) {} + + /** + * Download Csv + * @returns unknown Successful Response + * @throws ApiError + */ + public downloadCsvApiDownloadCsvStoreModelIdValueResampleGet(data: TDataDownloadCsvApiDownloadCsvStoreModelIdValueResampleGet): Observable { + const { +modelId, +resample, +store, +value, +} = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/download/csv/{store}/{model_id}/{value}/{resample}', + path: { + store, model_id: modelId, value, resample + }, + errors: { + 404: `Not found`, + 422: `Validation Error`, + }, + }); + } + +} \ No newline at end of file diff --git a/src/app/openapi/services/AdminService.ts b/src/app/openapi/services/AdminService.ts deleted file mode 100644 index 4d29ee0..0000000 --- a/src/app/openapi/services/AdminService.ts +++ /dev/null @@ -1,52 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import type { Observable } from 'rxjs'; -import type { AdminBasket } from '../models/AdminBasket'; -import type { BasketNameOnly } from '../models/BasketNameOnly'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; -@Injectable({ - providedIn: 'root', -}) -export class AdminService { - constructor(public readonly http: HttpClient) {} - /** - * Get Baskets - * @returns BasketNameOnly Successful Response - * @throws ApiError - */ - public getBasketsApiAdminBasketGet(): Observable> { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/admin/basket', - errors: { - 404: `Not found`, - }, - }); - } - /** - * Get Basket - * @param name - * @returns AdminBasket Successful Response - * @throws ApiError - */ - public getBasketApiAdminBasketNameGet( - name: string, - ): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/admin/basket/{name}', - path: { - 'name': name, - }, - errors: { - 404: `Not found`, - 422: `Validation Error`, - }, - }); - } -} diff --git a/src/app/openapi/services/ApiService.ts b/src/app/openapi/services/ApiService.ts deleted file mode 100644 index 4a71b06..0000000 --- a/src/app/openapi/services/ApiService.ts +++ /dev/null @@ -1,375 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import type { Observable } from 'rxjs'; -import type { ActionsResults } from '../models/ActionsResults'; -import type { ActionsStore } from '../models/ActionsStore'; -import type { Body_execute_tag_action_api_execTagActions_post } from '../models/Body_execute_tag_action_api_execTagActions_post'; -import type { Body_login_for_access_token_api_token_post } from '../models/Body_login_for_access_token_api_token_post'; -import type { BootstrapData } from '../models/BootstrapData'; -import type { CategoryRead } from '../models/CategoryRead'; -import type { DataProvider } from '../models/DataProvider'; -import type { FeatureInfo } from '../models/FeatureInfo'; -import type { MeasuresItem } from '../models/MeasuresItem'; -import type { ModelInfo } from '../models/ModelInfo'; -import type { PlotParams } from '../models/PlotParams'; -import type { Project } from '../models/Project'; -import type { RoleRead } from '../models/RoleRead'; -import type { Store } from '../models/Store'; -import type { SurveyMeta } from '../models/SurveyMeta'; -import type { Token } from '../models/Token'; -import type { UserRead } from '../models/UserRead'; -import type { UserRoleLink } from '../models/UserRoleLink'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; -@Injectable({ - providedIn: 'root', -}) -export class ApiService { - constructor(public readonly http: HttpClient) {} - /** - * Bootstrap - * @returns BootstrapData Successful Response - * @throws ApiError - */ - public bootstrapApiBootstrapGet(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/bootstrap', - errors: { - 404: `Not found`, - }, - }); - } - /** - * Login For Access Token - * @param formData - * @returns Token Successful Response - * @throws ApiError - */ - public loginForAccessTokenApiTokenPost( - formData: Body_login_for_access_token_api_token_post, - ): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/token', - formData: formData, - mediaType: 'application/x-www-form-urlencoded', - errors: { - 404: `Not found`, - 422: `Validation Error`, - }, - }); - } - /** - * Logout - * @returns any Successful Response - * @throws ApiError - */ - public logoutApiLogoutGet(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/logout', - errors: { - 404: `Not found`, - }, - }); - } - /** - * Get Users - * @returns UserRead Successful Response - * @throws ApiError - */ - public getUsersApiUsersGet(): Observable> { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/users', - errors: { - 404: `Not found`, - }, - }); - } - /** - * Get Roles - * @returns RoleRead Successful Response - * @throws ApiError - */ - public getRolesApiRolesGet(): Observable> { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/roles', - errors: { - 404: `Not found`, - }, - }); - } - /** - * Get Acls - * New: ACLs returned as UserRoleLink - * @returns UserRoleLink Successful Response - * @throws ApiError - */ - public getAclsApiAclsGet(): Observable> { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/acls', - errors: { - 404: `Not found`, - }, - }); - } - /** - * Get Categories - * @returns CategoryRead Successful Response - * @throws ApiError - */ - public getCategoriesApiCategoriesGet(): Observable> { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/categories', - errors: { - 404: `Not found`, - }, - }); - } - /** - * Get Categories P - * @returns CategoryRead Successful Response - * @throws ApiError - */ - public getCategoriesPApiCategoriesPandasGet(): Observable> { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/categories_pandas', - errors: { - 404: `Not found`, - }, - }); - } - /** - * List Data Providers - * Return a list of data providers, for use with the api (graphs, etc) - * :return: - * @returns DataProvider Successful Response - * @throws ApiError - */ - public listDataProvidersApiDataProvidersGet(): Observable> { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/data-providers', - errors: { - 404: `Not found`, - }, - }); - } - /** - * Get Model List - * Json REST store API compatible with Flask Potion and Angular - * Get the list of items (used for making the list of items in measures) - * Filter only items with at least one measure - * @param store - * @returns MeasuresItem Successful Response - * @throws ApiError - */ - public getModelListApiDataProviderStoreGet( - store: string, - ): Observable> { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/data-provider/{store}', - path: { - 'store': store, - }, - errors: { - 404: `Not found`, - 422: `Validation Error`, - }, - }); - } - /** - * Get Model Values - * Get values - * @param storeName - * @param value - * @param where - * @param resample - * @returns any Successful Response - * @throws ApiError - */ - public getModelValuesApiStoreNameValuesValueGet( - storeName: string, - value: string, - where: string, - resample?: (string | null), - ): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/{store_name}/values/{value}', - path: { - 'store_name': storeName, - 'value': value, - }, - query: { - 'where': where, - 'resample': resample, - }, - errors: { - 404: `Not found`, - 422: `Validation Error`, - }, - }); - } - /** - * Get Stores - * @returns Store Successful Response - * @throws ApiError - */ - public getStoresApiStoresGet(): Observable> { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/stores', - errors: { - 404: `Not found`, - }, - }); - } - /** - * Get Projects - * @returns Project Successful Response - * @throws ApiError - */ - public getProjectsApiProjectsGet(): Observable> { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/projects', - errors: { - 404: `Not found`, - }, - }); - } - /** - * Get Survey Meta - * @returns SurveyMeta Successful Response - * @throws ApiError - */ - public getSurveyMetaApiSurveyMetaGet(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/survey_meta', - errors: { - 404: `Not found`, - }, - }); - } - /** - * Get Feature Info - * @param store - * @param id - * @returns any Successful Response - * @throws ApiError - */ - public getFeatureInfoApiFeatureInfoStoreIdGet( - store: string, - id: string, - ): Observable<(FeatureInfo | null)> { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/feature-info/{store}/{id}', - path: { - 'store': store, - 'id': id, - }, - errors: { - 404: `Not found`, - 422: `Validation Error`, - }, - }); - } - /** - * Get Model Info - * @param store - * @returns ModelInfo Successful Response - * @throws ApiError - */ - public getModelInfoApiModelInfoStoreGet( - store: string, - ): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/model-info/{store}', - path: { - 'store': store, - }, - errors: { - 404: `Not found`, - 422: `Validation Error`, - }, - }); - } - /** - * Get Plot Params - * @param store - * @param id - * @param value - * @returns PlotParams Successful Response - * @throws ApiError - */ - public getPlotParamsApiPlotParamsStoreGet( - store: string, - id: string, - value: string, - ): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/plot-params/{store}', - path: { - 'store': store, - }, - query: { - 'id': id, - 'value': value, - }, - errors: { - 404: `Not found`, - 422: `Validation Error`, - }, - }); - } - /** - * Get Actions - * @returns ActionsStore Successful Response - * @throws ApiError - */ - public getActionsApiActionsGet(): Observable> { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/actions', - errors: { - 404: `Not found`, - }, - }); - } - /** - * Execute Tag Action - * @param requestBody - * @returns ActionsResults Successful Response - * @throws ApiError - */ - public executeTagActionApiExecTagActionsPost( - requestBody: Body_execute_tag_action_api_execTagActions_post, - ): Observable { - return __request(OpenAPI, this.http, { - method: 'POST', - url: '/api/execTagActions', - body: requestBody, - mediaType: 'application/json', - errors: { - 404: `Not found`, - 422: `Validation Error`, - }, - }); - } -} diff --git a/src/app/openapi/services/DashboardService.ts b/src/app/openapi/services/DashboardService.ts deleted file mode 100644 index 80f875f..0000000 --- a/src/app/openapi/services/DashboardService.ts +++ /dev/null @@ -1,70 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import type { Observable } from 'rxjs'; -import type { Dashboard } from '../models/Dashboard'; -import type { DashboardGroup } from '../models/DashboardGroup'; -import type { DashboardHome } from '../models/DashboardHome'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; -@Injectable({ - providedIn: 'root', -}) -export class DashboardService { - constructor(public readonly http: HttpClient) {} - /** - * Get Groups - * @returns DashboardGroup Successful Response - * @throws ApiError - */ - public getGroupsApiDashboardGroupsGet(): Observable> { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/dashboard/groups', - errors: { - 404: `Not found`, - }, - }); - } - /** - * Get Home - * @returns DashboardHome Successful Response - * @throws ApiError - */ - public getHomeApiDashboardHomeGet(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/dashboard/home', - errors: { - 404: `Not found`, - }, - }); - } - /** - * Get Dashboard Page - * @param group - * @param name - * @returns Dashboard Successful Response - * @throws ApiError - */ - public getDashboardPageApiDashboardPageGroupNameGet( - group: string, - name: string, - ): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/dashboard/page/{group}/{name}', - path: { - 'group': group, - 'name': name, - }, - errors: { - 404: `Not found`, - 422: `Validation Error`, - }, - }); - } -} diff --git a/src/app/openapi/services/GeoapiService.ts b/src/app/openapi/services/GeoapiService.ts deleted file mode 100644 index a2a5f01..0000000 --- a/src/app/openapi/services/GeoapiService.ts +++ /dev/null @@ -1,50 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import type { Observable } from 'rxjs'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; -@Injectable({ - providedIn: 'root', -}) -export class GeoapiService { - constructor(public readonly http: HttpClient) {} - /** - * Get Geojson - * Some REST stores coded manually (route prefixed with "gj": geojson). - * :param store_name: name of the model - * :return: json - * @param storeName - * @param ifNoneMatch - * @param simplify - * @param preserveTopology - * @returns any Successful Response - * @throws ApiError - */ - public getGeojsonApiGjStoreNameGet( - storeName: any, - ifNoneMatch?: (string | null), - simplify?: (number | null), - preserveTopology?: (boolean | null), - ): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/gj/{store_name}', - path: { - 'store_name': storeName, - }, - headers: { - 'If-None-Match': ifNoneMatch, - 'simplify': simplify, - 'preserveTopology': preserveTopology, - }, - errors: { - 404: `Not found`, - 422: `Validation Error`, - }, - }); - } -} diff --git a/src/app/openapi/services/MapService.ts b/src/app/openapi/services/MapService.ts deleted file mode 100644 index 4bd6f15..0000000 --- a/src/app/openapi/services/MapService.ts +++ /dev/null @@ -1,69 +0,0 @@ -/* generated using openapi-typescript-codegen -- do no edit */ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import { Injectable } from '@angular/core'; -import { HttpClient } from '@angular/common/http'; -import type { Observable } from 'rxjs'; -import type { BaseStyle } from '../models/BaseStyle'; -import type { MapInitData } from '../models/MapInitData'; -import type { MaplibreStyle } from '../models/MaplibreStyle'; -import { OpenAPI } from '../core/OpenAPI'; -import { request as __request } from '../core/request'; -@Injectable({ - providedIn: 'root', -}) -export class MapService { - constructor(public readonly http: HttpClient) {} - /** - * Get Init Data - * @returns MapInitData Successful Response - * @throws ApiError - */ - public getInitDataApiMapInitDataGet(): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/map/init-data', - }); - } - /** - * Get Base Style - * @param name - * @returns BaseStyle Successful Response - * @throws ApiError - */ - public getBaseStyleApiMapBaseStyleNameGet( - name: string, - ): Observable { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/map/base_style/{name}', - path: { - 'name': name, - }, - errors: { - 422: `Validation Error`, - }, - }); - } - /** - * Get Layer Style - * @param store - * @returns any Successful Response - * @throws ApiError - */ - public getLayerStyleApiMapLayerStyleStoreGet( - store: string, - ): Observable<(MaplibreStyle | null)> { - return __request(OpenAPI, this.http, { - method: 'GET', - url: '/api/map/layer_style/{store}', - path: { - 'store': store, - }, - errors: { - 422: `Validation Error`, - }, - }); - } -}