diff --git a/src/app/admin/admin-basket/admin-basket-resolver.service.ts b/src/app/admin/admin-basket/admin-basket-resolver.service.ts index db844bb..1c45253 100644 --- a/src/app/admin/admin-basket/admin-basket-resolver.service.ts +++ b/src/app/admin/admin-basket/admin-basket-resolver.service.ts @@ -3,18 +3,17 @@ import { Router, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/ro import { Observable, forkJoin } from 'rxjs' import { map } from 'rxjs/operators' -import { AdminBasketDataService } from './data.service' -import { AdminBasket } from '../../openapi' +import { AdminBasket, AdminService } from '../../openapi' @Injectable() export class BasketResolver { constructor( private router: Router, - private basketDataService: AdminBasketDataService, + private adminService: AdminService, ) {} resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable { var name = route.paramMap.get('name') - return this.basketDataService.getBasket(name) + return this.adminService.getBasketApiAdminBasketNameGet({name: name}) } } diff --git a/src/app/admin/admin-basket/admin-basket-upload/basket-upload.component.html b/src/app/admin/admin-basket/admin-basket-upload/basket-upload.component.html index 6661f27..12600f9 100644 --- a/src/app/admin/admin-basket/admin-basket-upload/basket-upload.component.html +++ b/src/app/admin/admin-basket/admin-basket-upload/basket-upload.component.html @@ -5,7 +5,7 @@ + [value]="item.id"> {{ item.name }} @@ -15,7 +15,7 @@ + [value]="item.id"> {{ item.name }} @@ -25,7 +25,7 @@ + [value]="item.id"> {{ item.name }} diff --git a/src/app/admin/admin-basket/admin-basket-upload/basket-upload.component.ts b/src/app/admin/admin-basket/admin-basket-upload/basket-upload.component.ts index 5f52291..74dd804 100644 --- a/src/app/admin/admin-basket/admin-basket-upload/basket-upload.component.ts +++ b/src/app/admin/admin-basket/admin-basket-upload/basket-upload.component.ts @@ -1,13 +1,13 @@ import { Component, OnInit, Input, ViewChild, ElementRef, ChangeDetectorRef, ChangeDetectionStrategy, SimpleChanges, OnChanges } from '@angular/core' import { HttpClient } from '@angular/common/http' -import { UntypedFormGroup, UntypedFormControl, Validators } from '@angular/forms' +import { FormGroup, Validators, FormControl } from '@angular/forms' import { MatTableDataSource } from '@angular/material/table' import { AdminDataService } from '../../admin-data.service' import { AdminBasketFile } from '../data.service' -import { AdminBasket } from '../../../openapi' +import { AdminBasket, AdminService } from '../../../openapi' import { MatSnackBar } from '@angular/material/snack-bar' import { HtmlSnackbarComponent } from '../../../custom-snackbar/custom-snackbar.component' @@ -23,6 +23,7 @@ export class AdminBasketUploadComponent implements OnInit, OnChanges { private cdr: ChangeDetectorRef, private http: HttpClient, private snackBar: MatSnackBar, + public adminService: AdminService, ) {} @ViewChild('fileInput') fileInput: ElementRef @@ -31,18 +32,22 @@ export class AdminBasketUploadComponent implements OnInit, OnChanges { //upload_fields = ['store', 'status', 'project', 'surveyor', 'equipment'] - formGroup: UntypedFormGroup = new UntypedFormGroup({}) + formGroup: FormGroup = new FormGroup({}) ngOnInit() { - let dflt = this.adminDataService.surveyMeta.default - this.formGroup = new UntypedFormGroup({ - 'store_misc': new UntypedFormControl(dflt['store_misc'], [Validators.required]), - 'store_line_work': new UntypedFormControl(dflt['store_line_work'], [Validators.required]), - 'status': new UntypedFormControl(dflt.status, [Validators.required]), - 'project': new UntypedFormControl(dflt.project, [Validators.required]), - 'surveyor': new UntypedFormControl(dflt.surveyor, [Validators.required]), - 'equipment': new UntypedFormControl(dflt.equipment, [Validators.required]), - 'autoImport': new UntypedFormControl(true), + const sm = this.adminDataService.surveyMeta + const dflt = sm.default + const dfltProject: number = sm.projects.find(e => e['name'] == dflt.project)?.id + const dfltSurveyor: number = sm.surveyors.find(e => e['name'] == dflt.surveyor)?.id + const dfltEquipment: number = sm.equipments.find(e => e['name'] == dflt.equipment)?.id + this.formGroup = new FormGroup({ + 'store_misc': new FormControl(dflt['store_misc'], [Validators.required]), + 'store_line_work': new FormControl(dflt['store_line_work'], [Validators.required]), + 'status': new FormControl(dflt.status, [Validators.required]), + 'project': new FormControl(dfltProject, [Validators.required]), + 'surveyor': new FormControl(dfltSurveyor, [Validators.required]), + 'equipment': new FormControl(dfltEquipment, [Validators.required]), + 'autoImport': new FormControl(true), }) this.setupRequired() } @@ -65,16 +70,16 @@ export class AdminBasketUploadComponent implements OnInit, OnChanges { } onFileUpload() { - const formData = new FormData() - formData.append('file', this.fileInput.nativeElement.files[0]) - let fg = this.formGroup.getRawValue() - for (let field in fg) { - if (this.basket.uploadFields.indexOf(field) != -1) { - formData.append(field, fg[field]) + this.adminService.uploadBasketFileApiAdminBasketUploadNamePost({ + name: this.basket.name, + equipmentId: this.formGroup.get('equipment').value, + projectId: this.formGroup.get('project').value, + surveyorId: this.formGroup.get('surveyor').value, + autoImport: this.formGroup.get('autoImport').value, + formData: { + file: this.fileInput.nativeElement.files[0] } - } - formData.append('autoImport', this.formGroup.get('autoImport').value) - this.http.post('upload/basket/' + this.basket.name, formData).subscribe( + }).subscribe( resp => { let importResult = resp['import_result'] const importTime = resp['time'] || (importResult && importResult['time']) diff --git a/src/app/admin/admin-basket/basket.component.ts b/src/app/admin/admin-basket/basket.component.ts index 1d46859..2f8b5c3 100644 --- a/src/app/admin/admin-basket/basket.component.ts +++ b/src/app/admin/admin-basket/basket.component.ts @@ -10,8 +10,8 @@ import { MatSort } from '@angular/material/sort' import { MatTableDataSource } from '@angular/material/table' import { AdminDataService } from '../admin-data.service' -import { AdminBasketDataService, AdminBasketFile } from './data.service' -import { AdminBasket } from '../../openapi' +import { AdminBasketFile } from './data.service' +import { AdminBasket, AdminService } from '../../openapi' import { HtmlSnackbarComponent } from '../../custom-snackbar/custom-snackbar.component' @Component({ @@ -23,10 +23,10 @@ import { HtmlSnackbarComponent } from '../../custom-snackbar/custom-snackbar.com export class AdminBasketComponent implements OnInit { constructor( public adminDataService: AdminDataService, - public adminBasketDataService: AdminBasketDataService, private route: ActivatedRoute, private snackBar: MatSnackBar, private cdr: ChangeDetectorRef, + public adminService: AdminService, ) {} basket: AdminBasket @@ -78,7 +78,11 @@ export class AdminBasketComponent implements OnInit { } importItem(item: AdminBasketFile, dryRun: boolean) { - this.adminBasketDataService.importItem(this.basket.name, item.id, dryRun).subscribe( + return this.adminService.importBasketFileApiAdminBasketImportBasketFileIdGet({ + basket: this.basket.name, + fileId: item.id, + dryRun: dryRun + }).subscribe( resp => { this.basket.files.find(row => row.id == item.id).time = new Date(resp.time).toLocaleString() this.snackBar.openFromComponent(HtmlSnackbarComponent, { @@ -91,7 +95,10 @@ export class AdminBasketComponent implements OnInit { } deleteItem(item: AdminBasketFile) { - this.adminBasketDataService.deleteItem(this.basket.name, item.id).subscribe( + return this.adminService.deleteBasketFileApiAdminBasketDeleteBasketFileIdGet({ + basket: this.basket.name, + fileId: item.id + }).subscribe( id => { let dsi = this.dataSource.data.findIndex(fi => fi['id'] == id) this.dataSource.data.splice(dsi, 1) diff --git a/src/app/admin/admin-basket/data.service.ts b/src/app/admin/admin-basket/data.service.ts index ab0832c..a500b31 100644 --- a/src/app/admin/admin-basket/data.service.ts +++ b/src/app/admin/admin-basket/data.service.ts @@ -35,79 +35,4 @@ export class AdminBasketUploadFieldData { public surveyors: string[], public equipments: string[], ) {} -} - -@Injectable() -export class AdminBasketDataService { - constructor( - // private apollo: Apollo, - public adminService: AdminService, - ) {} - - getBaskets(): Observable { - // Get the list a basket names - return this.adminService.getBasketsApiAdminBasketGet() - } - - getBasketUploadFieldData(): Observable { - // Get the list a basket names - console.warn('Migrate Graphql') - return observableOf() - // return this.apollo.query({ - // query: getAdminBasketUploadFieldDataQuery, - // }).pipe(map( - // res => res['data']['admin_basket_upload_field_data'].map( - // (data: object) => new AdminBasketUploadFieldData( - // data['store'], - // data['status'], - // data['project'], - // data['surveyor'], - // data['equipment'], - // ) - // ) - // )) - } - - getBasket(name: string): Observable { - // Get all info and content of a basket - return this.adminService.getBasketApiAdminBasketNameGet({name: name}) - } - - importItem(basket: string, fileId: number, dryRun: boolean=false): Observable { - return this.adminService.importBasketFileApiAdminBasketImportBasketFileIdGet({ - basket: basket, - fileId: fileId, - dryRun: dryRun - }) - console.warn('Migrate Graphql') - return observableOf() - // return this.apollo.mutate({ - // mutation: importAdminBasketItemMutation, - // variables: { - // basket: basket, - // id: id, - // dryRun: dryRun - // } - // }).pipe(map( - // resp => new BasketImportResult( - // resp['data']['importBasketItem']['result']['time'], - // resp['data']['importBasketItem']['result']['message'], - // JSON.parse(resp['data']['importBasketItem']['result']['details']), - // ) - // )) - } - - deleteItem(basket: string, id: number) { - console.warn('Migrate Graphql') - return observableOf() - // return this.apollo.mutate({ - // mutation: deleteAdminBasketItemMutation, - // variables: { - // basket: basket, - // id: id, - // } - // }).pipe(map( - // resp => resp['data']['deleteBasketItem']['result'] - // )) - } } \ No newline at end of file diff --git a/src/app/admin/admin-resolver.service.ts b/src/app/admin/admin-resolver.service.ts index 80ce478..1f8794f 100644 --- a/src/app/admin/admin-resolver.service.ts +++ b/src/app/admin/admin-resolver.service.ts @@ -3,8 +3,7 @@ import { Router, RouterStateSnapshot, ActivatedRouteSnapshot } from '@angular/ro import { Observable, forkJoin } from 'rxjs' import { AdminDataService } from './admin-data.service' -import { AdminBasketDataService } from './admin-basket/data.service' -import { BasketNameOnly, SurveyMeta } from '../openapi' +import { BasketNameOnly, SurveyMeta, AdminService } from '../openapi' @Injectable() @@ -12,7 +11,7 @@ export class AdminResolver { constructor( private router: Router, private dataService: AdminDataService, - private basketDataService: AdminBasketDataService, + private adminService: AdminService, ) {} resolve( @@ -20,7 +19,7 @@ export class AdminResolver { state: RouterStateSnapshot, ): Observable<[BasketNameOnly[], SurveyMeta]> { return forkJoin([ - this.basketDataService.getBaskets(), + this.adminService.getBasketsApiAdminBasketGet(), this.dataService.getSurveyMeta(), ]) } diff --git a/src/app/admin/admin.module.ts b/src/app/admin/admin.module.ts index 75e0d9c..13197b0 100644 --- a/src/app/admin/admin.module.ts +++ b/src/app/admin/admin.module.ts @@ -50,7 +50,6 @@ import { GisafAdminCategoryDialogComponent } from './admin-manage/category/dialo import { AdminDetailModule } from './admin-detail/admin-detail.module' import { AdminManageDataService } from './admin-manage/data.service' import { AdminManageAccessDataService } from './admin-manage/access/access-data.service' -import { AdminBasketDataService } from './admin-basket/data.service'; import { ProjectComponent } from './admin-manage/project/project.component' import { GisafAdminProjectDialogComponent } from './admin-manage/project/dialog.component'; import { AdminIntegrityComponent } from './admin-manage/integrity/integrity.component' @@ -130,7 +129,6 @@ import { PipesModule } from '../pipes.module' AdminDataService, AdminManageDataService, AdminManageAccessDataService, - AdminBasketDataService, WebsocketService, ] }) diff --git a/src/app/openapi/core/OpenAPI.ts b/src/app/openapi/core/OpenAPI.ts index e7a7059..1412b70 100644 --- a/src/app/openapi/core/OpenAPI.ts +++ b/src/app/openapi/core/OpenAPI.ts @@ -1,5 +1,4 @@ import type { HttpResponse } from '@angular/common/http';import type { ApiRequestOptions } from './ApiRequestOptions'; -import type { TResult } from './types'; type Headers = Record; type Middleware = (value: T) => T | Promise; @@ -33,7 +32,6 @@ export type OpenAPIConfig = { 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; @@ -47,7 +45,6 @@ export const OpenAPI: OpenAPIConfig = { ENCODE_PATH: undefined, HEADERS: undefined, PASSWORD: undefined, - RESULT: 'body', TOKEN: undefined, USERNAME: undefined, VERSION: '2023.4.dev63+g52e1d21.d20240408', diff --git a/src/app/openapi/core/request.ts b/src/app/openapi/core/request.ts index 23260de..af88730 100644 --- a/src/app/openapi/core/request.ts +++ b/src/app/openapi/core/request.ts @@ -160,7 +160,7 @@ export const getHeaders = (config: OpenAPIConfig, options: ApiRequestOptions): O export const getRequestBody = (options: ApiRequestOptions): unknown => { if (options.body) { if (options.mediaType?.includes('application/json') || options.mediaType?.includes('+json')) { - return JSON.stringify(options.body) + return JSON.stringify(options.body); } else if (isString(options.body) || isBlob(options.body) || isFormData(options.body)) { return options.body; } else { @@ -290,7 +290,7 @@ export const request = (config: OpenAPIConfig, http: HttpClient, options: Api }), switchMap(async response => { for (const fn of config.interceptors.response._fns) { - response = await fn(response) + response = await fn(response); } const responseBody = getResponseBody(response); const responseHeader = getResponseHeader(response, options.responseHeader); diff --git a/src/app/openapi/core/types.ts b/src/app/openapi/core/types.ts deleted file mode 100644 index 64ecde2..0000000 --- a/src/app/openapi/core/types.ts +++ /dev/null @@ -1,12 +0,0 @@ -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 60ec1d1..4ddb375 100644 --- a/src/app/openapi/index.ts +++ b/src/app/openapi/index.ts @@ -1,8 +1,7 @@ +// This file is auto-generated by @hey-api/openapi-ts export { ApiError } from './core/ApiError'; -export { OpenAPI } from './core/OpenAPI'; -export type { OpenAPIConfig } from './core/OpenAPI'; - -export * from './models' -export * from './schemas' -export * from './services' +export { OpenAPI, type OpenAPIConfig } from './core/OpenAPI'; +export * from './schemas.gen'; +export * from './services.gen'; +export * from './types.gen'; \ No newline at end of file diff --git a/src/app/openapi/schemas.gen.ts b/src/app/openapi/schemas.gen.ts new file mode 100644 index 0000000..d3f9c42 --- /dev/null +++ b/src/app/openapi/schemas.gen.ts @@ -0,0 +1,2834 @@ +// This file is auto-generated by @hey-api/openapi-ts + + +export const $Action = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + roles: { + items: { + type: 'string' + }, + type: 'array', + title: 'Roles' + }, + params: { + items: { + '$ref': '#/components/schemas/ActionParam' + }, + type: 'array', + title: 'Params' + } + }, + type: 'object', + required: ['name', 'roles', 'params'], + title: 'Action' +} as const; + +export const $ActionParam = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + type: { + type: 'string', + title: 'Type' + }, + dflt: { + type: 'string', + title: 'Dflt' + } + }, + type: 'object', + required: ['name', 'type', 'dflt'], + title: 'ActionParam' +} as const; + +export const $ActionResult = { + properties: { + message: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Message' + }, + taggedLayers: { + items: { + '$ref': '#/components/schemas/TaggedLayer' + }, + type: 'array', + title: 'Taggedlayers', + default: [] + } + }, + type: 'object', + title: 'ActionResult' +} as const; + +export const $ActionResults = { + properties: { + name: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Name' + }, + message: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Message' + }, + actionResults: { + items: { + '$ref': '#/components/schemas/ActionResult' + }, + type: 'array', + title: 'Actionresults', + default: [] + } + }, + type: 'object', + title: 'ActionResults' +} as const; + +export const $ActionsResults = { + properties: { + message: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Message' + }, + actionResults: { + items: { + '$ref': '#/components/schemas/ActionResults' + }, + type: 'array', + title: 'Actionresults', + default: [] + } + }, + type: 'object', + title: 'ActionsResults' +} as const; + +export const $ActionsStore = { + properties: { + store: { + type: 'string', + title: 'Store' + }, + actions: { + items: { + '$ref': '#/components/schemas/Action' + }, + type: 'array', + title: 'Actions' + } + }, + type: 'object', + required: ['store', 'actions'], + title: 'ActionsStore' +} as const; + +export const $AdminBasket = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + files: { + items: { + '$ref': '#/components/schemas/FileImport' + }, + type: 'array', + title: 'Files' + }, + columns: { + items: { + type: 'string' + }, + type: 'array', + title: 'Columns' + }, + uploadFields: { + items: { + type: 'string' + }, + type: 'array', + title: 'Uploadfields' + }, + projects: { + items: { + '$ref': '#/components/schemas/Project' + }, + type: 'array', + title: 'Projects', + default: [] + } + }, + type: 'object', + required: ['name', 'files', 'columns', 'uploadFields'], + title: 'AdminBasket' +} as const; + +export const $AdminBasketFile = { + properties: { + id: { + type: 'integer', + title: 'Id' + }, + dir: { + type: 'string', + title: 'Dir' + }, + name: { + type: 'string', + title: 'Name' + }, + url: { + type: 'string', + title: 'Url' + }, + md5: { + type: 'string', + title: 'Md5' + }, + time: { + type: 'string', + format: 'date-time', + title: 'Time' + }, + comment: { + type: 'string', + title: 'Comment' + }, + status: { + type: 'string', + title: 'Status' + }, + store: { + type: 'string', + title: 'Store' + }, + project: { + type: 'string', + title: 'Project' + }, + surveyor: { + type: 'string', + title: 'Surveyor' + }, + equipment: { + type: 'string', + title: 'Equipment' + }, + import_result: { + type: 'string', + title: 'Import Result' + } + }, + type: 'object', + required: ['id', 'dir', 'name', 'url', 'md5', 'time', 'comment', 'status', 'store', 'project', 'surveyor', 'equipment', 'import_result'], + title: 'AdminBasketFile' +} as const; + +export const $Attachment = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + path: { + type: 'string', + title: 'Path' + } + }, + type: 'object', + required: ['name', 'path'], + title: 'Attachment' +} as const; + +export const $BaseMapWithStores = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + stores: { + items: { + type: 'string' + }, + type: 'array', + title: 'Stores' + } + }, + type: 'object', + required: ['name', 'stores'], + title: 'BaseMapWithStores' +} as const; + +export const $BaseStyle = { + properties: { + id: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Id' + }, + name: { + type: 'string', + title: 'Name' + }, + style: { + anyOf: [ + { + type: 'object' + }, + { + type: 'null' + } + ], + title: 'Style' + }, + mbtiles: { + type: 'string', + title: 'Mbtiles' + }, + static_tiles_url: { + type: 'string', + title: 'Static Tiles Url' + }, + enabled: { + type: 'boolean', + title: 'Enabled', + default: true + } + }, + type: 'object', + required: ['name', 'style', 'mbtiles', 'static_tiles_url'], + title: 'BaseStyle' +} as const; + +export const $BasketDefault = { + properties: { + surveyor: { + type: 'string', + title: 'Surveyor', + default: 'Default surveyor' + }, + equipment: { + type: 'string', + title: 'Equipment', + default: 'Default equipment' + }, + project: { + type: 'string', + title: 'Project', + default: 'Default project' + }, + status: { + type: 'string', + title: 'Status', + default: 'E' + }, + store: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Store' + } + }, + additionalProperties: false, + type: 'object', + title: 'BasketDefault' +} as const; + +export const $BasketImportResult = { + properties: { + time: { + type: 'string', + format: 'date-time', + title: 'Time' + }, + message: { + type: 'string', + title: 'Message' + }, + details: { + anyOf: [ + { + additionalProperties: { + anyOf: [ + { + type: 'string' + }, + { + type: 'integer' + }, + { + type: 'number' + }, + { + type: 'boolean' + } + ] + }, + type: 'object' + }, + { + type: 'null' + } + ], + title: 'Details' + } + }, + type: 'object', + required: ['message'], + title: 'BasketImportResult' +} as const; + +export const $BasketNameOnly = { + properties: { + name: { + type: 'string', + title: 'Name' + } + }, + type: 'object', + required: ['name'], + title: 'BasketNameOnly' +} as const; + +export const $Body_execute_tag_action_api_execTagActions_post = { + properties: { + stores: { + items: { + type: 'string' + }, + type: 'array', + title: 'Stores' + }, + ids: { + items: { + items: { + type: 'string' + }, + type: 'array' + }, + type: 'array', + title: 'Ids' + }, + actionNames: { + items: { + type: 'string' + }, + type: 'array', + title: 'Actionnames' + }, + params: { + items: { + anyOf: [ + { + '$ref': '#/components/schemas/ActionParam' + }, + { + type: 'null' + } + ] + }, + type: 'array', + title: 'Params' + }, + formFields: { + items: { + '$ref': '#/components/schemas/FormFieldInput' + }, + type: 'array', + title: 'Formfields' + } + }, + type: 'object', + required: ['stores', 'ids', 'actionNames', 'params', 'formFields'], + title: 'Body_execute_tag_action_api_execTagActions_post' +} as const; + +export const $Body_login_for_access_token_api_token_post = { + properties: { + grant_type: { + anyOf: [ + { + type: 'string', + pattern: 'password' + }, + { + type: 'null' + } + ], + title: 'Grant Type' + }, + username: { + type: 'string', + title: 'Username' + }, + password: { + type: 'string', + title: 'Password' + }, + scope: { + type: 'string', + title: 'Scope', + default: '' + }, + client_id: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Client Id' + }, + client_secret: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Client Secret' + } + }, + type: 'object', + required: ['username', 'password'], + title: 'Body_login_for_access_token_api_token_post' +} as const; + +export const $Body_upload_basket_file_api_admin_basket_upload__name__post = { + properties: { + file: { + type: 'string', + format: 'binary', + title: 'File' + } + }, + type: 'object', + required: ['file'], + title: 'Body_upload_basket_file_api_admin_basket_upload__name__post' +} as const; + +export const $BootstrapData = { + properties: { + version: { + type: 'string', + title: 'Version', + default: '2023.4.dev63+g52e1d21.d20240408' + }, + title: { + type: 'string', + title: 'Title', + default: 'Auroville Geomatics Studio (Me)' + }, + windowTitle: { + type: 'string', + title: 'Windowtitle', + default: 'AV Geomatics Studio (Me)' + }, + map: { + allOf: [ + { + '$ref': '#/components/schemas/Map' + } + ], + default: { + attribution: '© Auroville CSR Geomatics', + bearing: 0, + defaultStatus: ['E'], + lat: 12.007, + lng: 79.8098, + opacity: 0.4, + pitch: 0, + status: ['E', 'F', 'D'], + style: 'No base map', + tagKeys: ['source'], + tileServer: { + baseDir: '/home/phil/gisaf_misc/map', + openMapTilesKey: 'cS3lrAfYXoM4MDooT6aS', + spriteBaseDir: '/home/phil/gisaf_misc/map/sprite', + spriteBaseUrl: 'https://gis.auroville.org.in', + spriteUrl: '/tiles/sprite/sprite', + useRequestUrl: true + }, + zoom: 14 + } + }, + geo: { + allOf: [ + { + '$ref': '#/components/schemas/Geo' + } + ], + default: { + raw_survey: { + spatial_sys_ref: { + author: 'AVSM', + ellps: 'WGS84', + k: 1, + lat_0: 12.01605433, + lon_0: 79.80998934, + no_defs: true, + proj: 'tmerc', + towgs84: '0,0,0,0,0,0,0', + units: 'm', + x_0: 370455.63, + y_0: 1328608.994 + }, + srid: 910001 + }, + simplify_geom_factor: 10000000, + simplify_preserve_topology: false, + srid: 4326, + srid_for_proj: 32644 + } + }, + measures: { + allOf: [ + { + '$ref': '#/components/schemas/Measures' + } + ], + default: { + defaultStore: 'avsm_water.well' + } + }, + redirect: { + type: 'string', + title: 'Redirect', + default: 'http://gis.auroville.org.in' + }, + user: { + anyOf: [ + { + '$ref': '#/components/schemas/UserRead' + }, + { + type: 'null' + } + ] + } + }, + type: 'object', + title: 'BootstrapData' +} as const; + +export const $CategoryGroup = { + properties: { + name: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Name' + }, + major: { + type: 'boolean', + title: 'Major' + }, + long_name: { + type: 'string', + title: 'Long Name' + } + }, + type: 'object', + required: ['major', 'long_name'], + title: 'CategoryGroup' +} as const; + +export const $CategoryRead = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + description: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Description' + }, + group: { + type: 'string', + title: 'Group' + }, + minor_group_1: { + type: 'string', + title: 'Minor Group 1', + default: '----' + }, + minor_group_2: { + type: 'string', + title: 'Minor Group 2', + default: '----' + }, + status: { + type: 'string', + title: 'Status' + }, + custom: { + anyOf: [ + { + type: 'boolean' + }, + { + type: 'null' + } + ], + title: 'Custom' + }, + auto_import: { + type: 'boolean', + title: 'Auto Import', + default: true + }, + gis_type: { + type: 'string', + title: 'Gis Type', + default: 'Point' + }, + long_name: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Long Name' + }, + style: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Style' + }, + symbol: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Symbol' + }, + mapbox_type_custom: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Mapbox Type Custom' + }, + mapbox_paint: { + anyOf: [ + { + additionalProperties: { + anyOf: [ + { + type: 'object' + }, + { + items: {}, + type: 'array' + }, + { + type: 'number' + }, + { + type: 'integer' + }, + { + type: 'string' + } + ] + }, + type: 'object' + }, + { + type: 'null' + } + ], + title: 'Mapbox Paint' + }, + mapbox_layout: { + anyOf: [ + { + additionalProperties: { + anyOf: [ + { + type: 'object' + }, + { + items: {}, + type: 'array' + }, + { + type: 'number' + }, + { + type: 'integer' + }, + { + type: 'string' + } + ] + }, + type: 'object' + }, + { + type: 'null' + } + ], + title: 'Mapbox Layout' + }, + viewable_role: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Viewable Role' + }, + extra: { + anyOf: [ + { + type: 'object' + }, + { + type: 'null' + } + ], + title: 'Extra' + }, + layer_name: { + type: 'string', + title: 'Layer Name', + description: `ISO compliant layer name (see ISO 13567) +:return: str`, + readOnly: true + }, + table_name: { + type: 'string', + title: 'Table Name', + description: `Table name +:return:`, + readOnly: true + }, + raw_survey_table_name: { + type: 'string', + title: 'Raw Survey Table Name', + description: `Table name +:return:`, + readOnly: true + }, + mapbox_type: { + type: 'string', + title: 'Mapbox Type', + readOnly: true + } + }, + type: 'object', + required: ['name', 'description', 'group', 'status', 'custom', 'long_name', 'style', 'symbol', 'mapbox_type_custom', 'mapbox_paint', 'mapbox_layout', 'viewable_role', 'extra', 'layer_name', 'table_name', 'raw_survey_table_name', 'mapbox_type'], + title: 'CategoryRead' +} as const; + +export const $Dashboard = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + group: { + type: 'string', + title: 'Group' + }, + description: { + type: 'string', + title: 'Description' + }, + time: { + anyOf: [ + { + type: 'string', + format: 'date-time' + }, + { + type: 'null' + } + ], + title: 'Time' + }, + html: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Html' + }, + attachment: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Attachment' + }, + dfData: { + items: {}, + type: 'array', + title: 'Dfdata', + default: [] + }, + plotData: { + anyOf: [ + { + items: { + type: 'object' + }, + type: 'array' + }, + { + type: 'null' + } + ], + title: 'Plotdata' + }, + plotLayout: { + anyOf: [ + { + type: 'object' + }, + { + type: 'null' + } + ], + title: 'Plotlayout' + }, + notebook: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Notebook' + }, + expandedPanes: { + anyOf: [ + { + items: { + type: 'string' + }, + type: 'array' + }, + { + type: 'null' + } + ], + title: 'Expandedpanes' + }, + sections: { + anyOf: [ + { + items: { + '$ref': '#/components/schemas/DashboardSection' + }, + type: 'array' + }, + { + type: 'null' + } + ], + title: 'Sections' + } + }, + type: 'object', + required: ['name', 'group', 'description'], + title: 'Dashboard' +} as const; + +export const $DashboardGroup = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + pages: { + items: { + '$ref': '#/components/schemas/DashboardPageMetaData' + }, + type: 'array', + title: 'Pages' + } + }, + type: 'object', + required: ['name', 'pages'], + title: 'DashboardGroup' +} as const; + +export const $DashboardHome = { + properties: { + title: { + type: 'string', + title: 'Title' + }, + content: { + type: 'string', + title: 'Content' + }, + footer: { + type: 'string', + title: 'Footer' + } + }, + type: 'object', + required: ['title', 'content', 'footer'], + title: 'DashboardHome' +} as const; + +export const $DashboardPageMetaData = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + group: { + type: 'string', + title: 'Group' + }, + description: { + type: 'string', + title: 'Description' + }, + viewable_role: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Viewable Role' + } + }, + type: 'object', + required: ['name', 'group', 'description'], + title: 'DashboardPageMetaData' +} as const; + +export const $DashboardSection = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + plot: { + type: 'string', + title: 'Plot' + } + }, + type: 'object', + required: ['name', 'plot'], + title: 'DashboardSection' +} as const; + +export const $DataProvider = { + properties: { + store: { + type: 'string', + title: 'Store' + }, + name: { + type: 'string', + title: 'Name' + }, + values: { + items: { + type: 'string' + }, + type: 'array', + title: 'Values' + } + }, + type: 'object', + required: ['store', 'name', 'values'], + title: 'DataProvider' +} as const; + +export const $Downloader = { + properties: { + roles: { + items: { + type: 'string' + }, + type: 'array', + title: 'Roles', + default: [] + }, + name: { + type: 'string', + title: 'Name' + }, + icon: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Icon' + } + }, + type: 'object', + required: ['name', 'icon'], + title: 'Downloader' +} as const; + +export const $Equipment = { + properties: { + id: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Id' + }, + name: { + type: 'string', + title: 'Name' + } + }, + type: 'object', + required: ['name'], + title: 'Equipment' +} as const; + +export const $FeatureInfo = { + properties: { + id: { + type: 'string', + title: 'Id' + }, + itemName: { + type: 'string', + title: 'Itemname' + }, + geoInfoItems: { + items: { + '$ref': '#/components/schemas/InfoItem' + }, + type: 'array', + title: 'Geoinfoitems', + default: [] + }, + surveyInfoItems: { + items: { + '$ref': '#/components/schemas/InfoItem' + }, + type: 'array', + title: 'Surveyinfoitems', + default: [] + }, + infoItems: { + items: { + '$ref': '#/components/schemas/InfoItem' + }, + type: 'array', + title: 'Infoitems', + default: [] + }, + categorizedInfoItems: { + anyOf: [ + { + items: { + '$ref': '#/components/schemas/InfoCategory' + }, + type: 'array' + }, + { + type: 'null' + } + ], + title: 'Categorizedinfoitems' + }, + tags: { + items: { + '$ref': '#/components/schemas/Tag' + }, + type: 'array', + title: 'Tags', + default: [] + }, + graph: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Graph' + }, + plotParams: { + anyOf: [ + { + '$ref': '#/components/schemas/PlotParams' + }, + { + type: 'null' + } + ] + }, + files: { + items: { + '$ref': '#/components/schemas/Attachment' + }, + type: 'array', + title: 'Files', + default: [] + }, + images: { + items: { + '$ref': '#/components/schemas/Attachment' + }, + type: 'array', + title: 'Images', + default: [] + }, + externalRecordUrl: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Externalrecordurl' + } + }, + type: 'object', + required: ['id', 'itemName'], + title: 'FeatureInfo' +} as const; + +export const $FileImport = { + properties: { + id: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Id' + }, + url: { + type: 'string', + title: 'Url' + }, + dir: { + type: 'string', + title: 'Dir' + }, + name: { + type: 'string', + title: 'Name' + }, + md5: { + type: 'string', + title: 'Md5' + }, + time: { + type: 'string', + format: 'date-time', + title: 'Time' + }, + comment: { + type: 'string', + title: 'Comment' + }, + status: { + type: 'string', + title: 'Status' + }, + store: { + type: 'string', + title: 'Store' + }, + basket: { + type: 'string', + title: 'Basket' + }, + project_id: { + type: 'integer', + title: 'Project Id' + }, + surveyor_id: { + type: 'integer', + title: 'Surveyor Id' + }, + equipment_id: { + type: 'integer', + title: 'Equipment Id' + }, + path: { + type: 'string', + format: 'path', + title: 'Path', + readOnly: true + } + }, + type: 'object', + required: ['url', 'dir', 'name', 'md5', 'time', 'comment', 'status', 'store', 'basket', 'project_id', 'surveyor_id', 'equipment_id', 'path'], + title: 'FileImport', + description: `Files to import or imported in the DB. +Give either url or path.` +} as const; + +export const $FormField = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + type: { + type: 'string', + title: 'Type' + }, + dflt: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Dflt' + }, + value: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Value' + } + }, + type: 'object', + required: ['name', 'type'], + title: 'FormField' +} as const; + +export const $FormFieldInput = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + value: { + type: 'string', + title: 'Value' + } + }, + type: 'object', + required: ['name', 'value'], + title: 'FormFieldInput' +} as const; + +export const $Geo = { + properties: { + raw_survey: { + allOf: [ + { + '$ref': '#/components/schemas/RawSurvey' + } + ], + default: { + spatial_sys_ref: { + author: 'AVSM', + ellps: 'WGS84', + k: 1, + lat_0: 12.01605433, + lon_0: 79.80998934, + no_defs: true, + proj: 'tmerc', + towgs84: '0,0,0,0,0,0,0', + units: 'm', + x_0: 370455.63, + y_0: 1328608.994 + }, + srid: 910001 + } + }, + simplify_geom_factor: { + type: 'integer', + title: 'Simplify Geom Factor', + default: 10000000 + }, + simplify_preserve_topology: { + type: 'boolean', + title: 'Simplify Preserve Topology', + default: false + }, + srid: { + type: 'integer', + title: 'Srid', + default: 4326 + }, + srid_for_proj: { + type: 'integer', + title: 'Srid For Proj', + default: 32644 + } + }, + additionalProperties: false, + type: 'object', + title: 'Geo' +} as const; + +export const $HTTPValidationError = { + properties: { + detail: { + items: { + '$ref': '#/components/schemas/ValidationError' + }, + type: 'array', + title: 'Detail' + } + }, + type: 'object', + title: 'HTTPValidationError' +} as const; + +export const $InfoCategory = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + infoItems: { + items: { + '$ref': '#/components/schemas/InfoItem' + }, + type: 'array', + title: 'Infoitems' + } + }, + type: 'object', + required: ['name', 'infoItems'], + title: 'InfoCategory' +} as const; + +export const $InfoItem = { + properties: { + key: { + type: 'string', + title: 'Key' + }, + value: { + anyOf: [ + { + type: 'string' + }, + { + type: 'number' + }, + { + type: 'integer' + } + ], + title: 'Value' + } + }, + type: 'object', + required: ['key', 'value'], + title: 'InfoItem' +} as const; + +export const $LegendItem = { + properties: { + key: { + type: 'string', + title: 'Key' + }, + value: { + type: 'string', + title: 'Value' + } + }, + type: 'object', + required: ['key', 'value'], + title: 'LegendItem' +} as const; + +export const $Map = { + properties: { + tileServer: { + allOf: [ + { + '$ref': '#/components/schemas/TileServer' + } + ], + default: { + baseDir: '/path/to/mbtiles_files_dir', + spriteBaseDir: '/path/to/mbtiles_sprites_dir', + spriteBaseUrl: 'https://gisaf.example.org', + spriteUrl: '/tiles/sprite/sprite', + useRequestUrl: false + } + }, + zoom: { + type: 'integer', + title: 'Zoom', + default: 14 + }, + pitch: { + type: 'integer', + title: 'Pitch', + default: 45 + }, + lat: { + type: 'number', + title: 'Lat', + default: 12 + }, + lng: { + type: 'number', + title: 'Lng', + default: 79.8106 + }, + bearing: { + type: 'number', + title: 'Bearing', + default: 0 + }, + style: { + type: 'string', + title: 'Style', + default: 'OSM (vector)' + }, + opacity: { + type: 'number', + title: 'Opacity', + default: 1 + }, + attribution: { + type: 'string', + title: 'Attribution', + default: '' + }, + status: { + items: { + type: 'string' + }, + type: 'array', + title: 'Status', + default: ['E', 'F', 'D'] + }, + defaultStatus: { + items: { + type: 'string' + }, + type: 'array', + title: 'Defaultstatus', + default: ['E'] + }, + tagKeys: { + items: { + type: 'string' + }, + type: 'array', + title: 'Tagkeys', + default: ['source'] + } + }, + additionalProperties: false, + type: 'object', + title: 'Map' +} as const; + +export const $MapInitData = { + properties: { + baseStyles: { + items: { + '$ref': '#/components/schemas/BaseStyle' + }, + type: 'array', + title: 'Basestyles', + default: [] + }, + baseMaps: { + items: { + '$ref': '#/components/schemas/BaseMapWithStores' + }, + type: 'array', + title: 'Basemaps', + default: [] + }, + groups: { + items: { + '$ref': '#/components/schemas/CategoryGroup' + }, + type: 'array', + title: 'Groups', + default: [] + }, + stores: { + items: { + '$ref': '#/components/schemas/Store' + }, + type: 'array', + title: 'Stores', + default: [] + } + }, + type: 'object', + title: 'MapInitData' +} as const; + +export const $MaplibreStyle = { + properties: { + paint: { + anyOf: [ + { + additionalProperties: { + anyOf: [ + { + type: 'object' + }, + { + items: {}, + type: 'array' + }, + { + type: 'number' + }, + { + type: 'integer' + }, + { + type: 'string' + } + ] + }, + type: 'object' + }, + { + type: 'null' + } + ], + title: 'Paint' + }, + layout: { + anyOf: [ + { + additionalProperties: { + anyOf: [ + { + type: 'object' + }, + { + items: {}, + type: 'array' + }, + { + type: 'number' + }, + { + type: 'integer' + }, + { + type: 'string' + } + ] + }, + type: 'object' + }, + { + type: 'null' + } + ], + title: 'Layout' + }, + attribution: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Attribution' + } + }, + type: 'object', + title: 'MaplibreStyle' +} as const; + +export const $Measures = { + properties: { + defaultStore: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Defaultstore' + } + }, + additionalProperties: false, + type: 'object', + title: 'Measures' +} as const; + +export const $MeasuresItem = { + properties: { + id: { + type: 'integer', + title: 'Id' + }, + name: { + type: 'string', + title: 'Name' + } + }, + type: 'object', + required: ['id', 'name'], + title: 'MeasuresItem' +} as const; + +export const $ModelAction = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + icon: { + type: 'string', + title: 'Icon' + }, + roles: { + anyOf: [ + { + items: { + type: 'string' + }, + type: 'array' + }, + { + type: 'null' + } + ], + title: 'Roles' + }, + formFields: { + items: { + '$ref': '#/components/schemas/FormField' + }, + type: 'array', + title: 'Formfields' + } + }, + type: 'object', + required: ['name', 'icon', 'formFields'], + title: 'ModelAction' +} as const; + +export const $ModelInfo = { + properties: { + store: { + type: 'string', + title: 'Store' + }, + modelName: { + type: 'string', + title: 'Modelname' + }, + symbol: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Symbol' + }, + values: { + items: { + '$ref': '#/components/schemas/ModelValue' + }, + type: 'array', + title: 'Values', + default: [] + }, + actions: { + items: { + '$ref': '#/components/schemas/ModelAction' + }, + type: 'array', + title: 'Actions', + default: [] + }, + formName: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Formname' + }, + formFields: { + items: { + '$ref': '#/components/schemas/FormField' + }, + type: 'array', + title: 'Formfields', + default: [] + }, + tagPlugins: { + items: { + type: 'string' + }, + type: 'array', + title: 'Tagplugins', + default: [] + }, + tagActions: { + items: { + '$ref': '#/components/schemas/TagActions' + }, + type: 'array', + title: 'Tagactions', + default: [] + }, + downloaders: { + items: { + '$ref': '#/components/schemas/Downloader' + }, + type: 'array', + title: 'Downloaders', + default: [] + }, + legend: { + items: { + '$ref': '#/components/schemas/LegendItem' + }, + type: 'array', + title: 'Legend', + default: [] + } + }, + type: 'object', + required: ['store', 'modelName'], + title: 'ModelInfo' +} as const; + +export const $ModelValue = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + title: { + type: 'string', + title: 'Title' + }, + unit: { + type: 'string', + title: 'Unit' + }, + chartType: { + type: 'string', + title: 'Charttype', + default: 'line' + }, + chartColor: { + type: 'string', + title: 'Chartcolor', + default: 'blue' + } + }, + type: 'object', + required: ['name', 'title', 'unit'], + title: 'ModelValue' +} as const; + +export const $PlotBaseLine = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + value: { + type: 'number', + title: 'Value' + }, + color: { + type: 'string', + title: 'Color' + } + }, + type: 'object', + required: ['name', 'value', 'color'], + title: 'PlotBaseLine' +} as const; + +export const $PlotBgShape = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + valueTop: { + type: 'number', + title: 'Valuetop' + }, + valueBottom: { + type: 'number', + title: 'Valuebottom' + }, + color: { + type: 'string', + title: 'Color' + } + }, + type: 'object', + required: ['name', 'valueTop', 'valueBottom', 'color'], + title: 'PlotBgShape' +} as const; + +export const $PlotParams = { + properties: { + baseLines: { + items: { + '$ref': '#/components/schemas/PlotBaseLine' + }, + type: 'array', + title: 'Baselines', + default: [] + }, + bgShapes: { + items: { + '$ref': '#/components/schemas/PlotBgShape' + }, + type: 'array', + title: 'Bgshapes', + default: [] + }, + barBase: { + anyOf: [ + { + type: 'number' + }, + { + type: 'null' + } + ], + title: 'Barbase' + } + }, + type: 'object', + title: 'PlotParams' +} as const; + +export const $Project = { + properties: { + id: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Id' + }, + name: { + type: 'string', + title: 'Name' + }, + contact_person: { + type: 'string', + title: 'Contact Person' + }, + site: { + type: 'string', + title: 'Site' + }, + date_approved: { + type: 'string', + format: 'date', + title: 'Date Approved' + }, + start_date_planned: { + type: 'string', + format: 'date', + title: 'Start Date Planned' + }, + start_date_effective: { + type: 'string', + format: 'date', + title: 'Start Date Effective' + }, + end_date_planned: { + type: 'string', + format: 'date', + title: 'End Date Planned' + }, + end_date_effective: { + type: 'string', + format: 'date', + title: 'End Date Effective' + } + }, + type: 'object', + required: ['name', 'contact_person', 'site', 'date_approved', 'start_date_planned', 'start_date_effective', 'end_date_planned', 'end_date_effective'], + title: 'Project' +} as const; + +export const $RawSurvey = { + properties: { + spatial_sys_ref: { + allOf: [ + { + '$ref': '#/components/schemas/SpatialSysRef' + } + ], + default: { + author: 'AVSM', + ellps: 'WGS84', + k: 1, + lat_0: 12.01605433, + lon_0: 79.80998934, + no_defs: true, + proj: 'tmerc', + towgs84: '0,0,0,0,0,0,0', + units: 'm', + x_0: 370455.63, + y_0: 1328608.994 + } + }, + srid: { + type: 'integer', + title: 'Srid', + default: 910001 + } + }, + additionalProperties: false, + type: 'object', + title: 'RawSurvey' +} as const; + +export const $RoleRead = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + id: { + type: 'integer', + title: 'Id' + }, + users: { + items: { + '$ref': '#/components/schemas/UserReadNoRoles' + }, + type: 'array', + title: 'Users', + default: [] + } + }, + type: 'object', + required: ['name', 'id'], + title: 'RoleRead' +} as const; + +export const $RoleReadNoUsers = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + id: { + type: 'integer', + title: 'Id' + } + }, + type: 'object', + required: ['name', 'id'], + title: 'RoleReadNoUsers' +} as const; + +export const $SpatialSysRef = { + properties: { + author: { + type: 'string', + title: 'Author', + default: 'AVSM' + }, + ellps: { + type: 'string', + title: 'Ellps', + default: 'WGS84' + }, + k: { + type: 'integer', + title: 'K', + default: 1 + }, + lat_0: { + type: 'number', + title: 'Lat 0', + default: 12.01605433 + }, + lon_0: { + type: 'number', + title: 'Lon 0', + default: 79.80998934 + }, + no_defs: { + type: 'boolean', + title: 'No Defs', + default: true + }, + proj: { + type: 'string', + title: 'Proj', + default: 'tmerc' + }, + towgs84: { + type: 'string', + title: 'Towgs84', + default: '0,0,0,0,0,0,0' + }, + units: { + type: 'string', + title: 'Units', + default: 'm' + }, + x_0: { + type: 'number', + title: 'X 0', + default: 370455.63 + }, + y_0: { + type: 'number', + title: 'Y 0', + default: 1328608.994 + } + }, + additionalProperties: false, + type: 'object', + title: 'SpatialSysRef' +} as const; + +export const $Store = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + category: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Category' + }, + auto_import: { + type: 'boolean', + title: 'Auto Import' + }, + count: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Count' + }, + custom: { + type: 'boolean', + title: 'Custom' + }, + description: { + type: 'string', + title: 'Description' + }, + gis_type: { + type: 'string', + title: 'Gis Type' + }, + group: { + type: 'string', + title: 'Group' + }, + in_menu: { + type: 'boolean', + title: 'In Menu' + }, + is_db: { + type: 'boolean', + title: 'Is Db' + }, + is_line_work: { + type: 'boolean', + title: 'Is Line Work' + }, + is_live: { + type: 'boolean', + title: 'Is Live' + }, + long_name: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Long Name' + }, + type: { + type: 'string', + title: 'Type' + }, + minor_group_1: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Minor Group 1' + }, + minor_group_2: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Minor Group 2' + }, + status: { + type: 'string', + title: 'Status' + }, + style: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Style' + }, + symbol: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Symbol' + }, + title: { + type: 'string', + title: 'Title' + }, + viewable_role: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Viewable Role' + }, + z_index: { + type: 'integer', + title: 'Z Index' + } + }, + type: 'object', + required: ['name', 'auto_import', 'custom', 'description', 'gis_type', 'group', 'in_menu', 'is_db', 'is_line_work', 'is_live', 'long_name', 'type', 'minor_group_1', 'minor_group_2', 'status', 'style', 'symbol', 'title', 'viewable_role', 'z_index'], + title: 'Store' +} as const; + +export const $StoreNameOnly = { + properties: { + name: { + type: 'string', + title: 'Name' + } + }, + type: 'object', + required: ['name'], + title: 'StoreNameOnly' +} as const; + +export const $SurveyMeta = { + properties: { + projects: { + items: { + '$ref': '#/components/schemas/Project' + }, + type: 'array', + title: 'Projects' + }, + surveyors: { + items: { + '$ref': '#/components/schemas/Surveyor' + }, + type: 'array', + title: 'Surveyors' + }, + equipments: { + items: { + '$ref': '#/components/schemas/Equipment' + }, + type: 'array', + title: 'Equipments' + }, + statuses: { + items: { + type: 'string' + }, + type: 'array', + title: 'Statuses' + }, + stores_misc: { + items: { + '$ref': '#/components/schemas/StoreNameOnly' + }, + type: 'array', + title: 'Stores Misc' + }, + stores_line_work: { + items: { + '$ref': '#/components/schemas/StoreNameOnly' + }, + type: 'array', + title: 'Stores Line Work' + }, + default: { + '$ref': '#/components/schemas/BasketDefault' + } + }, + type: 'object', + required: ['projects', 'surveyors', 'equipments', 'statuses', 'stores_misc', 'stores_line_work', 'default'], + title: 'SurveyMeta' +} as const; + +export const $Surveyor = { + properties: { + id: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Id' + }, + name: { + type: 'string', + title: 'Name' + } + }, + type: 'object', + required: ['name'], + title: 'Surveyor' +} as const; + +export const $Tag = { + properties: { + key: { + type: 'string', + title: 'Key' + }, + value: { + type: 'string', + title: 'Value' + } + }, + type: 'object', + required: ['key', 'value'], + title: 'Tag' +} as const; + +export const $TagAction = { + properties: { + name: { + type: 'string', + title: 'Name' + }, + action: { + type: 'string', + title: 'Action' + }, + roles: { + anyOf: [ + { + items: { + type: 'string' + }, + type: 'array' + }, + { + type: 'null' + } + ], + title: 'Roles' + }, + link: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Link' + }, + save: { + type: 'boolean', + title: 'Save', + default: false + } + }, + type: 'object', + required: ['name', 'action'], + title: 'TagAction' +} as const; + +export const $TagActions = { + properties: { + domain: { + type: 'string', + title: 'Domain' + }, + key: { + type: 'string', + title: 'Key' + }, + actions: { + items: { + '$ref': '#/components/schemas/TagAction' + }, + type: 'array', + title: 'Actions' + } + }, + type: 'object', + required: ['domain', 'key', 'actions'], + title: 'TagActions' +} as const; + +export const $TaggedFeature = { + properties: { + id: { + type: 'string', + title: 'Id' + }, + tags: { + '$ref': '#/components/schemas/Tags' + }, + lat: { + type: 'number', + title: 'Lat' + }, + lon: { + type: 'number', + title: 'Lon' + } + }, + type: 'object', + required: ['id', 'tags', 'lat', 'lon'], + title: 'TaggedFeature' +} as const; + +export const $TaggedLayer = { + properties: { + store: { + type: 'string', + title: 'Store' + }, + taggedFeatures: { + items: { + '$ref': '#/components/schemas/TaggedFeature' + }, + type: 'array', + title: 'Taggedfeatures' + } + }, + type: 'object', + required: ['store', 'taggedFeatures'], + title: 'TaggedLayer' +} as const; + +export const $Tags = { + properties: { + id: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Id' + }, + geom: { + type: 'string', + title: 'Geom' + }, + store: { + type: 'string', + title: 'Store' + }, + ref_id: { + type: 'integer', + title: 'Ref Id' + }, + tags: { + type: 'object', + title: 'Tags' + } + }, + type: 'object', + required: ['geom', 'store', 'ref_id', 'tags'], + title: 'Tags' +} as const; + +export const $TileServer = { + properties: { + baseDir: { + type: 'string', + title: 'Basedir', + default: '/path/to/mbtiles_files_dir' + }, + useRequestUrl: { + type: 'boolean', + title: 'Userequesturl', + default: false + }, + spriteBaseDir: { + type: 'string', + title: 'Spritebasedir', + default: '/path/to/mbtiles_sprites_dir' + }, + spriteUrl: { + type: 'string', + title: 'Spriteurl', + default: '/tiles/sprite/sprite' + }, + spriteBaseUrl: { + type: 'string', + title: 'Spritebaseurl', + default: 'https://gisaf.example.org' + }, + openMapTilesKey: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Openmaptileskey' + } + }, + additionalProperties: false, + type: 'object', + title: 'TileServer' +} as const; + +export const $Token = { + properties: { + access_token: { + type: 'string', + title: 'Access Token' + }, + token_type: { + type: 'string', + title: 'Token Type' + } + }, + type: 'object', + required: ['access_token', 'token_type'], + title: 'Token' +} as const; + +export const $UserRead = { + properties: { + username: { + type: 'string', + title: 'Username' + }, + email: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Email' + }, + disabled: { + anyOf: [ + { + type: 'boolean' + }, + { + type: 'null' + } + ], + title: 'Disabled', + default: false + }, + id: { + type: 'integer', + title: 'Id' + }, + roles: { + items: { + '$ref': '#/components/schemas/RoleReadNoUsers' + }, + type: 'array', + title: 'Roles', + default: [] + } + }, + type: 'object', + required: ['username', 'email', 'id'], + title: 'UserRead' +} as const; + +export const $UserReadNoRoles = { + properties: { + username: { + type: 'string', + title: 'Username' + }, + email: { + anyOf: [ + { + type: 'string' + }, + { + type: 'null' + } + ], + title: 'Email' + }, + disabled: { + anyOf: [ + { + type: 'boolean' + }, + { + type: 'null' + } + ], + title: 'Disabled', + default: false + }, + id: { + type: 'integer', + title: 'Id' + } + }, + type: 'object', + required: ['username', 'email', 'id'], + title: 'UserReadNoRoles' +} as const; + +export const $UserRoleLink = { + properties: { + user_id: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'User Id' + }, + role_id: { + anyOf: [ + { + type: 'integer' + }, + { + type: 'null' + } + ], + title: 'Role Id' + } + }, + type: 'object', + title: 'UserRoleLink' +} as const; + +export const $ValidationError = { + properties: { + loc: { + items: { + anyOf: [ + { + type: 'string' + }, + { + type: 'integer' + } + ] + }, + type: 'array', + title: 'Location' + }, + msg: { + type: 'string', + title: 'Message' + }, + type: { + type: 'string', + title: 'Error Type' + } + }, + type: 'object', + required: ['loc', 'msg', 'type'], + title: 'ValidationError' +} as const; \ No newline at end of file diff --git a/src/app/openapi/services.gen.ts b/src/app/openapi/services.gen.ts new file mode 100644 index 0000000..672a588 --- /dev/null +++ b/src/app/openapi/services.gen.ts @@ -0,0 +1,703 @@ +// This file is auto-generated by @hey-api/openapi-ts + + +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 { $OpenApiTs } from './types.gen'; + +@Injectable({ + providedIn: 'root' +}) +export class ApiService { + constructor(public readonly http: HttpClient) { + } + + /** + * Bootstrap + * @returns BootstrapData Successful Response + * @throws ApiError + */ + public bootstrapApiBootstrapGet(): Observable<$OpenApiTs['/api/bootstrap']['get']['res'][200]> { + 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: $OpenApiTs['/api/token']['post']['req']): Observable<$OpenApiTs['/api/token']['post']['res'][200]> { + const { formData } = data; + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/token', + formData, + mediaType: 'application/x-www-form-urlencoded', + errors: { + 404: 'Not found', + 422: 'Validation Error' + } +}); + } + + /** + * Logout + * @returns unknown Successful Response + * @throws ApiError + */ + public logoutApiLogoutGet(): Observable<$OpenApiTs['/api/logout']['get']['res'][200]> { + 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<$OpenApiTs['/api/users']['get']['res'][200]> { + 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<$OpenApiTs['/api/roles']['get']['res'][200]> { + 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<$OpenApiTs['/api/acls']['get']['res'][200]> { + 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<$OpenApiTs['/api/categories']['get']['res'][200]> { + 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<$OpenApiTs['/api/categories_pandas']['get']['res'][200]> { + 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<$OpenApiTs['/api/data-providers']['get']['res'][200]> { + 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: $OpenApiTs['/api/data-provider/{store}']['get']['req']): Observable<$OpenApiTs['/api/data-provider/{store}']['get']['res'][200]> { + 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: $OpenApiTs['/api/{store_name}/values/{value}']['get']['req']): Observable<$OpenApiTs['/api/{store_name}/values/{value}']['get']['res'][200]> { + const { storeName, value, where, resample } = 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<$OpenApiTs['/api/stores']['get']['res'][200]> { + 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<$OpenApiTs['/api/projects']['get']['res'][200]> { + 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<$OpenApiTs['/api/survey_meta']['get']['res'][200]> { + 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: $OpenApiTs['/api/feature-info/{store}/{id}']['get']['req']): Observable<$OpenApiTs['/api/feature-info/{store}/{id}']['get']['res'][200]> { + const { store, id } = 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: $OpenApiTs['/api/model-info/{store}']['get']['req']): Observable<$OpenApiTs['/api/model-info/{store}']['get']['res'][200]> { + 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: $OpenApiTs['/api/plot-params/{store}']['get']['req']): Observable<$OpenApiTs['/api/plot-params/{store}']['get']['res'][200]> { + const { store, id, 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<$OpenApiTs['/api/actions']['get']['res'][200]> { + 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: $OpenApiTs['/api/execTagActions']['post']['req']): Observable<$OpenApiTs['/api/execTagActions']['post']['res'][200]> { + 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' + } +}); + } + +} + +@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: $OpenApiTs['/api/gj/{store_name}']['get']['req']): Observable<$OpenApiTs['/api/gj/{store_name}']['get']['res'][200]> { + const { storeName, ifNoneMatch, simplify, preserveTopology } = 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' + } +}); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class AdminService { + constructor(public readonly http: HttpClient) { + } + + /** + * Get Baskets + * @returns BasketNameOnly Successful Response + * @throws ApiError + */ + public getBasketsApiAdminBasketGet(): Observable<$OpenApiTs['/api/admin/basket']['get']['res'][200]> { + 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: $OpenApiTs['/api/admin/basket/{name}']['get']['req']): Observable<$OpenApiTs['/api/admin/basket/{name}']['get']['res'][200]> { + const { name } = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/admin/basket/{name}', + path: { + name + }, + errors: { + 404: 'Not found', + 422: 'Validation Error' + } +}); + } + + /** + * Upload Basket File + * @returns AdminBasketFile Successful Response + * @throws ApiError + */ + public uploadBasketFileApiAdminBasketUploadNamePost(data: $OpenApiTs['/api/admin/basket/upload/{name}']['post']['req']): Observable<$OpenApiTs['/api/admin/basket/upload/{name}']['post']['res'][200]> { + const { name, formData, projectId, surveyorId, equipmentId, autoImport } = data; + return __request(OpenAPI, this.http, { + method: 'POST', + url: '/api/admin/basket/upload/{name}', + path: { + name + }, + query: { + project_id: projectId, + surveyor_id: surveyorId, + equipment_id: equipmentId, + auto_import: autoImport + }, + formData, + mediaType: 'multipart/form-data', + errors: { + 404: 'Not found', + 422: 'Validation Error' + } +}); + } + + /** + * Download Basket File + * @returns unknown Successful Response + * @throws ApiError + */ + public downloadBasketFileApiAdminBasketDownloadNameFileIdFileNameGet(data: $OpenApiTs['/api/admin/basket/download/{name}/{file_id}/{file_name}']['get']['req']): Observable<$OpenApiTs['/api/admin/basket/download/{name}/{file_id}/{file_name}']['get']['res'][200]> { + const { name, fileId, fileName } = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/admin/basket/download/{name}/{file_id}/{file_name}', + path: { + name, + file_id: fileId, + file_name: fileName + }, + errors: { + 404: 'Not found', + 422: 'Validation Error' + } +}); + } + + /** + * Import Basket File + * @returns BasketImportResult Successful Response + * @throws ApiError + */ + public importBasketFileApiAdminBasketImportBasketFileIdGet(data: $OpenApiTs['/api/admin/basket/import/{basket}/{file_id}']['get']['req']): Observable<$OpenApiTs['/api/admin/basket/import/{basket}/{file_id}']['get']['res'][200]> { + const { basket, fileId, dryRun } = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/admin/basket/import/{basket}/{file_id}', + path: { + basket, + file_id: fileId + }, + query: { + dryRun + }, + errors: { + 404: 'Not found', + 422: 'Validation Error' + } +}); + } + + /** + * Delete Basket File + * @returns unknown Successful Response + * @throws ApiError + */ + public deleteBasketFileApiAdminBasketDeleteBasketFileIdGet(data: $OpenApiTs['/api/admin/basket/delete/{basket}/{file_id}']['get']['req']): Observable<$OpenApiTs['/api/admin/basket/delete/{basket}/{file_id}']['get']['res'][200]> { + const { basket, fileId } = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/admin/basket/delete/{basket}/{file_id}', + path: { + basket, + file_id: fileId + }, + errors: { + 404: 'Not found', + 422: 'Validation Error' + } +}); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class DashboardService { + constructor(public readonly http: HttpClient) { + } + + /** + * Get Groups + * @returns DashboardGroup Successful Response + * @throws ApiError + */ + public getGroupsApiDashboardGroupsGet(): Observable<$OpenApiTs['/api/dashboard/groups']['get']['res'][200]> { + 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<$OpenApiTs['/api/dashboard/home']['get']['res'][200]> { + 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: $OpenApiTs['/api/dashboard/page/{group}/{name}']['get']['req']): Observable<$OpenApiTs['/api/dashboard/page/{group}/{name}']['get']['res'][200]> { + 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' + } +}); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class MapService { + constructor(public readonly http: HttpClient) { + } + + /** + * Get Init Data + * @returns MapInitData Successful Response + * @throws ApiError + */ + public getInitDataApiMapInitDataGet(): Observable<$OpenApiTs['/api/map/init-data']['get']['res'][200]> { + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/map/init-data' +}); + } + + /** + * Get Base Style + * @returns BaseStyle Successful Response + * @throws ApiError + */ + public getBaseStyleApiMapBaseStyleNameGet(data: $OpenApiTs['/api/map/base_style/{name}']['get']['req']): Observable<$OpenApiTs['/api/map/base_style/{name}']['get']['res'][200]> { + 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: $OpenApiTs['/api/map/layer_style/{store}']['get']['req']): Observable<$OpenApiTs['/api/map/layer_style/{store}']['get']['res'][200]> { + const { store } = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/map/layer_style/{store}', + path: { + store + }, + errors: { + 422: 'Validation Error' + } +}); + } + +} + +@Injectable({ + providedIn: 'root' +}) +export class DownloadService { + constructor(public readonly http: HttpClient) { + } + + /** + * Download Csv + * @returns unknown Successful Response + * @throws ApiError + */ + public downloadCsvApiDownloadCsvStoreModelIdValueResampleGet(data: $OpenApiTs['/api/download/csv/{store}/{model_id}/{value}/{resample}']['get']['req']): Observable<$OpenApiTs['/api/download/csv/{store}/{model_id}/{value}/{resample}']['get']['res'][200]> { + const { store, modelId, value, resample } = 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' + } +}); + } + + /** + * Execute Action + * Download the result of an action + * @returns unknown Successful Response + * @throws ApiError + */ + public executeActionApiDownloadPluginNameStoreIdGet(data: $OpenApiTs['/api/download/plugin/{name}/{store}/{id}']['get']['req']): Observable<$OpenApiTs['/api/download/plugin/{name}/{store}/{id}']['get']['res'][200]> { + const { name, store, id } = data; + return __request(OpenAPI, this.http, { + method: 'GET', + url: '/api/download/plugin/{name}/{store}/{id}', + path: { + name, + store, + id + }, + errors: { + 404: 'Not found', + 422: 'Validation Error' + } +}); + } + +} \ No newline at end of file diff --git a/src/app/openapi/types.gen.ts b/src/app/openapi/types.gen.ts new file mode 100644 index 0000000..6aaa1f3 --- /dev/null +++ b/src/app/openapi/types.gen.ts @@ -0,0 +1,1000 @@ +// This file is auto-generated by @hey-api/openapi-ts + + +export type Action = { + name: string; + roles: Array<(string)>; + 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<(string)>; + uploadFields: Array<(string)>; + projects?: Array; +}; + +export type AdminBasketFile = { + id: number; + dir: string; + name: string; + url: string; + md5: string; + time: string; + comment: string; + status: string; + store: string; + project: string; + surveyor: string; + equipment: string; + import_result: string; +}; + +export type Attachment = { + name: string; + path: string; +}; + +export type BaseMapWithStores = { + name: string; + stores: Array<(string)>; +}; + +export type BaseStyle = { + id?: number | null; + name: string; + style: { + [key: string]: unknown; +} | 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 BasketImportResult = { + time?: string; + message: string; + details?: { + [key: string]: (string | number | boolean); +} | null; +}; + +export type BasketNameOnly = { + name: string; +}; + +export type Body_execute_tag_action_api_execTagActions_post = { + stores: Array<(string)>; + ids: Array>; + actionNames: Array<(string)>; + params: Array<(ActionParam | null)>; + 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 Body_upload_basket_file_api_admin_basket_upload__name__post = { + file: (Blob | File); +}; + +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: { + [key: string]: ({ + [key: string]: unknown; +} | Array | number | string); +} | null; + mapbox_layout: { + [key: string]: ({ + [key: string]: unknown; +} | Array | number | string); +} | null; + viewable_role: string | null; + extra: { + [key: string]: unknown; +} | 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<{ + [key: string]: unknown; +}> | null; + plotLayout?: { + [key: string]: unknown; +} | null; + notebook?: string | null; + expandedPanes?: Array<(string)> | 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<(string)>; +}; + +export type Downloader = { + roles?: Array<(string)>; + 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; + 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; + readonly path: string; +}; + +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<(string)>; + defaultStatus?: Array<(string)>; + tagKeys?: Array<(string)>; +}; + +export type MapInitData = { + baseStyles?: Array; + baseMaps?: Array; + groups?: Array; + stores?: Array; +}; + +export type MaplibreStyle = { + paint?: { + [key: string]: ({ + [key: string]: unknown; +} | Array | number | string); +} | null; + layout?: { + [key: string]: ({ + [key: string]: unknown; +} | 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<(string)> | null; + formFields: Array; +}; + +export type ModelInfo = { + store: string; + modelName: string; + symbol?: string | null; + values?: Array; + actions?: Array; + formName?: string | null; + formFields?: Array; + tagPlugins?: Array<(string)>; + 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<(string)>; + 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<(string)> | 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: { + [key: string]: unknown; + }; +}; + +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<(string | number)>; + msg: string; + type: string; +}; + +export type $OpenApiTs = { + '/api/bootstrap': { + get: { + res: { + /** + * Successful Response + */ + 200: BootstrapData; + }; + }; + }; + '/api/token': { + post: { + req: { + formData: Body_login_for_access_token_api_token_post; + }; + res: { + /** + * Successful Response + */ + 200: Token; + }; + }; + }; + '/api/logout': { + get: { + res: { + /** + * Successful Response + */ + 200: unknown; + }; + }; + }; + '/api/users': { + get: { + res: { + /** + * Successful Response + */ + 200: Array; + }; + }; + }; + '/api/roles': { + get: { + res: { + /** + * Successful Response + */ + 200: Array; + }; + }; + }; + '/api/acls': { + get: { + res: { + /** + * Successful Response + */ + 200: Array; + }; + }; + }; + '/api/categories': { + get: { + res: { + /** + * Successful Response + */ + 200: Array; + }; + }; + }; + '/api/categories_pandas': { + get: { + res: { + /** + * Successful Response + */ + 200: Array; + }; + }; + }; + '/api/data-providers': { + get: { + res: { + /** + * Successful Response + */ + 200: Array; + }; + }; + }; + '/api/data-provider/{store}': { + get: { + req: { + store: string; + }; + res: { + /** + * Successful Response + */ + 200: Array; + }; + }; + }; + '/api/{store_name}/values/{value}': { + get: { + req: { + resample?: string | null; + storeName: string; + value: string; + where: string; + }; + res: { + /** + * Successful Response + */ + 200: unknown; + }; + }; + }; + '/api/stores': { + get: { + res: { + /** + * Successful Response + */ + 200: Array; + }; + }; + }; + '/api/projects': { + get: { + res: { + /** + * Successful Response + */ + 200: Array; + }; + }; + }; + '/api/survey_meta': { + get: { + res: { + /** + * Successful Response + */ + 200: SurveyMeta; + }; + }; + }; + '/api/feature-info/{store}/{id}': { + get: { + req: { + id: string; + store: string; + }; + res: { + /** + * Successful Response + */ + 200: FeatureInfo | null; + }; + }; + }; + '/api/model-info/{store}': { + get: { + req: { + store: string; + }; + res: { + /** + * Successful Response + */ + 200: ModelInfo; + }; + }; + }; + '/api/plot-params/{store}': { + get: { + req: { + id: string; + store: string; + value: string; + }; + res: { + /** + * Successful Response + */ + 200: PlotParams; + }; + }; + }; + '/api/actions': { + get: { + res: { + /** + * Successful Response + */ + 200: Array; + }; + }; + }; + '/api/execTagActions': { + post: { + req: { + requestBody: Body_execute_tag_action_api_execTagActions_post; + }; + res: { + /** + * Successful Response + */ + 200: ActionsResults; + }; + }; + }; + '/api/gj/{store_name}': { + get: { + req: { + ifNoneMatch?: string | null; + preserveTopology?: boolean | null; + simplify?: number | null; + storeName: unknown; + }; + res: { + /** + * Successful Response + */ + 200: unknown; + }; + }; + }; + '/api/admin/basket': { + get: { + res: { + /** + * Successful Response + */ + 200: Array; + }; + }; + }; + '/api/admin/basket/{name}': { + get: { + req: { + name: string; + }; + res: { + /** + * Successful Response + */ + 200: AdminBasket; + }; + }; + }; + '/api/admin/basket/upload/{name}': { + post: { + req: { + autoImport?: boolean; + equipmentId?: number | null; + formData: Body_upload_basket_file_api_admin_basket_upload__name__post; + name: string; + projectId?: number | null; + surveyorId?: number | null; + }; + res: { + /** + * Successful Response + */ + 200: AdminBasketFile; + }; + }; + }; + '/api/admin/basket/download/{name}/{file_id}/{file_name}': { + get: { + req: { + fileId: number; + fileName: string; + name: string; + }; + res: { + /** + * Successful Response + */ + 200: unknown; + }; + }; + }; + '/api/admin/basket/import/{basket}/{file_id}': { + get: { + req: { + basket: string; + dryRun?: boolean; + fileId: number; + }; + res: { + /** + * Successful Response + */ + 200: BasketImportResult; + }; + }; + }; + '/api/admin/basket/delete/{basket}/{file_id}': { + get: { + req: { + basket: string; + fileId: number; + }; + res: { + /** + * Successful Response + */ + 200: unknown; + }; + }; + }; + '/api/dashboard/groups': { + get: { + res: { + /** + * Successful Response + */ + 200: Array; + }; + }; + }; + '/api/dashboard/home': { + get: { + res: { + /** + * Successful Response + */ + 200: DashboardHome; + }; + }; + }; + '/api/dashboard/page/{group}/{name}': { + get: { + req: { + group: string; + name: string; + }; + res: { + /** + * Successful Response + */ + 200: Dashboard; + }; + }; + }; + '/api/map/init-data': { + get: { + res: { + /** + * Successful Response + */ + 200: MapInitData; + }; + }; + }; + '/api/map/base_style/{name}': { + get: { + req: { + name: string; + }; + res: { + /** + * Successful Response + */ + 200: BaseStyle; + }; + }; + }; + '/api/map/layer_style/{store}': { + get: { + req: { + store: string; + }; + res: { + /** + * Successful Response + */ + 200: MaplibreStyle | null; + }; + }; + }; + '/api/download/csv/{store}/{model_id}/{value}/{resample}': { + get: { + req: { + modelId: number; + resample: string; + store: string; + value: string; + }; + res: { + /** + * Successful Response + */ + 200: unknown; + }; + }; + }; + '/api/download/plugin/{name}/{store}/{id}': { + get: { + req: { + id: number; + name: string; + store: string; + }; + res: { + /** + * Successful Response + */ + 200: unknown; + }; + }; + }; +}; \ No newline at end of file