Mograte from openapi-typescript-codegen to @hey-api/openapi-ts

Back to options using openapi (default of openapi-ts)
This commit is contained in:
phil 2024-04-03 11:19:57 +05:30
parent 263defc7ba
commit bba056105a
94 changed files with 3983 additions and 2096 deletions

146
package-lock.json generated
View file

@ -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",

View file

@ -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"
}
}
}

View file

@ -170,11 +170,13 @@ export class ActionsService {
formFields?: FormFieldInput[]
): Observable<ActionsResults> {
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
}
})
}
}

View file

@ -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)

View file

@ -36,7 +36,7 @@ export class DataService {
}
getList(store: string): Observable<MeasuresItem[]> {
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<HttpResponse<Object>> {
): Observable<unknown> {
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
}
)
}
}

View file

@ -34,7 +34,7 @@ export class GeoJsonService {
}
getStyle(store: string): Observable<MaplibreStyle> {
return this.mapService.getLayerStyleApiMapLayerStyleStoreGet(store)
return this.mapService.getLayerStyleApiMapLayerStyleStoreGet({store: store})
}
getAll(url: string, store: string, params?: object): Observable<MapboxDataAndStyle> {

View file

@ -151,7 +151,7 @@ export class AdminBasketDataService {
getBasket(name: string): Observable<AdminBasket> {
// 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({

View file

@ -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'

View file

@ -12,9 +12,9 @@ export class DashboardPageResolver {
) {}
resolve(route: ActivatedRouteSnapshot, state: RouterStateSnapshot): Observable<Dashboard> {
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')
})
}
}

View file

@ -466,7 +466,7 @@ export class InfoDataService {
public taggedLayers$ = this.taggedLayers.asObservable()
getModelInfo(store: string): Observable<ModelInfo> {
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<PlotParams> {
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<FeatureInfo> {
return this.api.getFeatureInfoApiFeatureInfoStoreIdGet(store, id)
return this.api.getFeatureInfoApiFeatureInfoStoreIdGet({store: store, id: id})
// return this.apollo.query({
// query: getFeatureInfoQuery,
// variables: {

View file

@ -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)

View file

@ -89,7 +89,7 @@ export class MapDataService {
// }
getBaseStyle(styleName: string): Observable<BaseStyle> {
return this.mapService.getBaseStyleApiMapBaseStyleNameGet(styleName).pipe(map(
return this.mapService.getBaseStyleApiMapBaseStyleNameGet({name: styleName}).pipe(map(
data => new BaseStyle(data.name, <any>data.style)
))
}

View file

@ -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;
}
}

View file

@ -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<string, any>;
readonly cookies?: Record<string, any>;
readonly headers?: Record<string, any>;
readonly query?: Record<string, any>;
readonly formData?: Record<string, any>;
readonly body?: any;
readonly mediaType?: string;
readonly responseHeader?: string;
readonly errors?: Record<number, string>;
};
readonly method: 'GET' | 'PUT' | 'POST' | 'DELETE' | 'OPTIONS' | 'HEAD' | 'PATCH';
readonly url: string;
readonly path?: Record<string, unknown>;
readonly cookies?: Record<string, unknown>;
readonly headers?: Record<string, unknown>;
readonly query?: Record<string, unknown>;
readonly formData?: Record<string, unknown>;
readonly body?: any;
readonly mediaType?: string;
readonly responseHeader?: string;
readonly errors?: Record<number, string>;
};

View file

@ -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<TData = any> = {
readonly body: TData;
readonly ok: boolean;
readonly status: number;
readonly statusText: string;
readonly url: string;
};

View file

@ -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<T> implements Promise<T> {
#isResolved: boolean;
#isRejected: boolean;
#isCancelled: boolean;
readonly #cancelHandlers: (() => void)[];
readonly #promise: Promise<T>;
#resolve?: (value: T | PromiseLike<T>) => void;
#reject?: (reason?: any) => void;
constructor(
executor: (
resolve: (value: T | PromiseLike<T>) => void,
reject: (reason?: any) => void,
onCancel: OnCancel
) => void
) {
this.#isResolved = false;
this.#isRejected = false;
this.#isCancelled = false;
this.#cancelHandlers = [];
this.#promise = new Promise<T>((resolve, reject) => {
this.#resolve = resolve;
this.#reject = reject;
const onResolve = (value: T | PromiseLike<T>): 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<TResult1 = T, TResult2 = never>(
onFulfilled?: ((value: T) => TResult1 | PromiseLike<TResult1>) | null,
onRejected?: ((reason: any) => TResult2 | PromiseLike<TResult2>) | null
): Promise<TResult1 | TResult2> {
return this.#promise.then(onFulfilled, onRejected);
}
public catch<TResult = never>(
onRejected?: ((reason: any) => TResult | PromiseLike<TResult>) | null
): Promise<T | TResult> {
return this.#promise.catch(onRejected);
}
public finally(onFinally?: (() => void) | null): Promise<T> {
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;
}
}

View file

@ -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<T> = (options: ApiRequestOptions) => Promise<T>;
type Headers = Record<string, string>;
type Middleware<T> = (value: T) => T | Promise<T>;
type Resolver<T> = (options: ApiRequestOptions) => Promise<T>;
export class Interceptors<T> {
_fns: Middleware<T>[];
constructor() {
this._fns = [];
}
eject(fn: Middleware<T>) {
const index = this._fns.indexOf(fn);
if (index !== -1) {
this._fns = [
...this._fns.slice(0, index),
...this._fns.slice(index + 1),
];
}
}
use(fn: Middleware<T>) {
this._fns = [...this._fns, fn];
}
}
export type OpenAPIConfig = {
BASE: string;
VERSION: string;
WITH_CREDENTIALS: boolean;
CREDENTIALS: 'include' | 'omit' | 'same-origin';
TOKEN?: string | Resolver<string> | undefined;
USERNAME?: string | Resolver<string> | undefined;
PASSWORD?: string | Resolver<string> | undefined;
HEADERS?: Headers | Resolver<Headers> | undefined;
ENCODE_PATH?: ((path: string) => string) | undefined;
BASE: string;
CREDENTIALS: 'include' | 'omit' | 'same-origin';
ENCODE_PATH?: ((path: string) => string) | undefined;
HEADERS?: Headers | Resolver<Headers> | undefined;
PASSWORD?: string | Resolver<string> | undefined;
RESULT?: TResult;
TOKEN?: string | Resolver<string> | undefined;
USERNAME?: string | Resolver<string> | undefined;
VERSION: string;
WITH_CREDENTIALS: boolean;
interceptors: {response: Interceptors<HttpResponse<any>>;};
};
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(),
},
};

View file

@ -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 = <T>(value: T | null | undefined): value is Exclude<T, null | undefined> => {
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, any>): string => {
const qs: string[] = [];
export const getQueryString = (params: Record<string, unknown>): 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<T> = (options: ApiRequestOptions) => Promise<T>;
export const resolve = async <T>(options: ApiRequestOptions, resolver?: T | Resolver<T>): Promise<T | undefined> => {
if (typeof resolver === 'function') {
return (resolver as Resolver<T>)(options);
}
return resolver;
if (typeof resolver === 'function') {
return (resolver as Resolver<T>)(options);
}
return resolver;
};
export const getHeaders = (config: OpenAPIConfig, options: ApiRequestOptions): Observable<HttpHeaders> => {
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<string, string>);
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<string, string>);
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 = <T>(
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<HttpResponse<T>> => {
return http.request<T>(options.method, url, {
headers,
body: body ?? formData,
withCredentials: config.WITH_CREDENTIALS,
observe: 'response',
});
return http.request<T>(options.method, url, {
headers,
body: body ?? formData,
withCredentials: config.WITH_CREDENTIALS,
observe: 'response',
});
};
export const getResponseHeader = <T>(response: HttpResponse<T>, 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 = <T>(response: HttpResponse<T>): 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<number, string> = {
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<number, string> = {
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 = <T>(config: OpenAPIConfig, http: HttpClient, options: ApiRequestOptions): Observable<T> => {
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<T>(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<T>(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);
}),
);
};

View file

@ -0,0 +1,12 @@
import type { ApiResult } from './ApiResult';
export type TResult = 'body' | 'raw';
export type TApiResponse<T extends TResult, TData> =
Exclude<T, 'raw'> extends never
? ApiResult<TData>
: ApiResult<TData>['body'];
export type TConfig<T extends TResult> = {
_result?: T;
};

View file

@ -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'

652
src/app/openapi/models.ts Normal file
View file

@ -0,0 +1,652 @@
export type Action = {
name: string;
roles: Array<string>;
params: Array<ActionParam>;
};
export type ActionParam = {
name: string;
type: string;
dflt: string;
};
export type ActionResult = {
message?: string | null;
taggedLayers?: Array<TaggedLayer>;
};
export type ActionResults = {
name?: string | null;
message?: string | null;
actionResults?: Array<ActionResult>;
};
export type ActionsResults = {
message?: string | null;
actionResults?: Array<ActionResults>;
};
export type ActionsStore = {
store: string;
actions: Array<Action>;
};
export type AdminBasket = {
name: string;
files: Array<FileImport>;
columns: Array<string>;
uploadFields: Array<string>;
projects?: Array<Project>;
};
export type Attachment = {
name: string;
path: string;
};
export type BaseMapWithStores = {
name: string;
stores: Array<string>;
};
export type BaseStyle = {
id?: number | null;
name: string;
style: Record<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 BasketNameOnly = {
name: string;
};
export type Body_execute_tag_action_api_execTagActions_post = {
stores: Array<string>;
ids: Array<Array<string>>;
actionNames: Array<string>;
params: Array<ActionParam | null>;
formFields: Array<FormFieldInput>;
};
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<string, (Record<string, unknown> | Array<unknown> | number | string)> | null;
mapbox_layout: Record<string, (Record<string, unknown> | Array<unknown> | number | string)> | null;
viewable_role: string | null;
extra: Record<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<unknown>;
plotData?: Array<Record<string, unknown>> | null;
plotLayout?: Record<string, unknown> | null;
notebook?: string | null;
expandedPanes?: Array<string> | null;
sections?: Array<DashboardSection> | null;
};
export type DashboardGroup = {
name: string;
pages: Array<DashboardPageMetaData>;
};
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<InfoItem>;
surveyInfoItems?: Array<InfoItem>;
infoItems?: Array<InfoItem>;
categorizedInfoItems?: Array<InfoCategory> | null;
tags?: Array<Tag>;
graph?: string | null;
plotParams?: PlotParams | null;
files?: Array<Attachment>;
images?: Array<Attachment>;
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<ValidationError>;
};
export type InfoCategory = {
name: string;
infoItems: Array<InfoItem>;
};
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<BaseStyle>;
baseMaps?: Array<BaseMapWithStores>;
groups?: Array<CategoryGroup>;
stores?: Array<Store>;
};
export type MaplibreStyle = {
paint?: Record<string, (Record<string, unknown> | Array<unknown> | number | string)> | null;
layout?: Record<string, (Record<string, unknown> | Array<unknown> | 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<FormField>;
};
export type ModelInfo = {
store: string;
modelName: string;
symbol?: string | null;
values?: Array<ModelValue>;
actions?: Array<ModelAction>;
formName?: string | null;
formFields?: Array<FormField>;
tagPlugins?: Array<string>;
tagActions?: Array<TagActions>;
downloaders?: Array<Downloader>;
legend?: Array<LegendItem>;
};
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<PlotBaseLine>;
bgShapes?: Array<PlotBgShape>;
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<UserReadNoRoles>;
};
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<Project>;
surveyors: Array<Surveyor>;
equipments: Array<Equipment>;
statuses: Array<string>;
stores_misc: Array<StoreNameOnly>;
stores_line_work: Array<StoreNameOnly>;
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<TagAction>;
};
export type TaggedFeature = {
id: string;
tags: Tags;
lat: number;
lon: number;
};
export type TaggedLayer = {
store: string;
taggedFeatures: Array<TaggedFeature>;
};
export type Tags = {
id?: number | null;
geom: string;
store: string;
ref_id: number;
tags: Record<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<RoleReadNoUsers>;
};
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;
};

View file

@ -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<string>;
params: Array<ActionParam>;
};

View file

@ -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;
};

View file

@ -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<TaggedLayer>;
};

View file

@ -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<ActionResult>;
};

View file

@ -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<ActionResults>;
};

View file

@ -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<Action>;
};

View file

@ -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<FileImport>;
columns: Array<string>;
uploadFields: Array<string>;
projects?: Array<Project>;
};

View file

@ -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;
};

View file

@ -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<string>;
};

View file

@ -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<string, any> | null);
mbtiles: string;
static_tiles_url: string;
enabled?: boolean;
};

View file

@ -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);
};

View file

@ -1,8 +0,0 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type BasketNameOnly = {
name: string;
};

View file

@ -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<string>;
ids: Array<Array<string>>;
actionNames: Array<string>;
params: Array<(ActionParam | null)>;
formFields: Array<FormFieldInput>;
};

View file

@ -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);
};

View file

@ -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);
};

View file

@ -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;
};

View file

@ -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<string, (Record<string, any> | number | string)> | null);
mapbox_layout: (Record<string, (Record<string, any> | number | string)> | null);
viewable_role: (string | null);
extra: (Record<string, any> | 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;
};

View file

@ -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<any>;
plotData?: null;
plotLayout?: (Record<string, any> | null);
notebook?: (string | null);
expandedPanes?: (Array<string> | null);
sections?: (Array<DashboardSection> | null);
};

View file

@ -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<DashboardPageMetaData>;
};

View file

@ -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;
};

View file

@ -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);
};

View file

@ -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;
};

View file

@ -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<string>;
};

View file

@ -1,10 +0,0 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type Downloader = {
roles?: Array<string>;
name: string;
icon?: (string | null);
};

View file

@ -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;
};

View file

@ -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<InfoItem>;
surveyInfoItems?: Array<InfoItem>;
infoItems?: Array<InfoItem>;
categorizedInfoItems?: (Array<InfoCategory> | null);
tags?: Array<Tag>;
graph?: (string | null);
plotParams?: (PlotParams | null);
files?: Array<Attachment>;
images?: Array<Attachment>;
externalRecordUrl?: (string | null);
};

View file

@ -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;
};

View file

@ -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);
};

View file

@ -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;
};

View file

@ -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;
};

View file

@ -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<ValidationError>;
};

View file

@ -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<InfoItem>;
};

View file

@ -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);
};

View file

@ -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;
};

View file

@ -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<string>;
defaultStatus?: Array<string>;
tagKeys?: Array<string>;
};

View file

@ -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<BaseStyle>;
baseMaps?: Array<BaseMapWithStores>;
groups?: Array<CategoryGroup>;
stores?: Array<Store>;
};

View file

@ -1,10 +0,0 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type MaplibreStyle = {
paint?: (Record<string, (Record<string, any> | number | string)> | null);
layout?: (Record<string, (Record<string, any> | number | string)> | null);
attribution?: (string | null);
};

View file

@ -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);
};

View file

@ -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;
};

View file

@ -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<string> | null);
formFields: Array<FormField>;
};

View file

@ -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<ModelValue>;
actions?: Array<ModelAction>;
formName?: (string | null);
formFields?: Array<FormField>;
tagPlugins?: Array<string>;
tagActions?: Array<TagActions>;
downloaders?: Array<Downloader>;
legend?: Array<LegendItem>;
};

View file

@ -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;
};

View file

@ -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;
};

View file

@ -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;
};

View file

@ -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<PlotBaseLine>;
bgShapes?: Array<PlotBgShape>;
barBase?: (number | null);
};

View file

@ -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;
};

View file

@ -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;
};

View file

@ -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<UserReadNoRoles>;
};

View file

@ -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;
};

View file

@ -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;
};

View file

@ -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;
};

View file

@ -1,8 +0,0 @@
/* generated using openapi-typescript-codegen -- do no edit */
/* istanbul ignore file */
/* tslint:disable */
/* eslint-disable */
export type StoreNameOnly = {
name: string;
};

View file

@ -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<Project>;
surveyors: Array<Surveyor>;
equipments: Array<Equipment>;
statuses: Array<string>;
stores_misc: Array<StoreNameOnly>;
stores_line_work: Array<StoreNameOnly>;
default: BasketDefault;
};

View file

@ -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;
};

View file

@ -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;
};

View file

@ -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<string> | null);
link?: (string | null);
save?: boolean;
};

View file

@ -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<TagAction>;
};

View file

@ -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;
};

View file

@ -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<TaggedFeature>;
};

View file

@ -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<string, any>;
};

View file

@ -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);
};

View file

@ -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;
};

View file

@ -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<RoleReadNoUsers>;
};

View file

@ -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;
};

View file

@ -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);
};

View file

@ -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;
};

2206
src/app/openapi/schemas.ts Normal file

File diff suppressed because it is too large Load diff

683
src/app/openapi/services.ts Normal file
View file

@ -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<BootstrapData> {
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<Token> {
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<unknown> {
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<Array<UserRead>> {
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<Array<RoleRead>> {
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<Array<UserRoleLink>> {
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<Array<CategoryRead>> {
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<Array<CategoryRead>> {
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<Array<DataProvider>> {
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<Array<MeasuresItem>> {
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<unknown> {
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<Array<Store>> {
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<Array<Project>> {
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<SurveyMeta> {
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<FeatureInfo | null> {
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<ModelInfo> {
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<PlotParams> {
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<Array<ActionsStore>> {
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<ActionsResults> {
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<unknown> {
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<Array<BasketNameOnly>> {
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<AdminBasket> {
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<Array<DashboardGroup>> {
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<DashboardHome> {
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<Dashboard> {
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<MapInitData> {
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<BaseStyle> {
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<MaplibreStyle | null> {
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<unknown> {
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`,
},
});
}
}

View file

@ -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<Array<BasketNameOnly>> {
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<AdminBasket> {
return __request(OpenAPI, this.http, {
method: 'GET',
url: '/api/admin/basket/{name}',
path: {
'name': name,
},
errors: {
404: `Not found`,
422: `Validation Error`,
},
});
}
}

View file

@ -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<BootstrapData> {
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<Token> {
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<any> {
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<Array<UserRead>> {
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<Array<RoleRead>> {
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<Array<UserRoleLink>> {
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<Array<CategoryRead>> {
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<Array<CategoryRead>> {
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<Array<DataProvider>> {
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<Array<MeasuresItem>> {
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<any> {
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<Array<Store>> {
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<Array<Project>> {
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<SurveyMeta> {
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<ModelInfo> {
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<PlotParams> {
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<Array<ActionsStore>> {
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<ActionsResults> {
return __request(OpenAPI, this.http, {
method: 'POST',
url: '/api/execTagActions',
body: requestBody,
mediaType: 'application/json',
errors: {
404: `Not found`,
422: `Validation Error`,
},
});
}
}

View file

@ -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<Array<DashboardGroup>> {
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<DashboardHome> {
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<Dashboard> {
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`,
},
});
}
}

View file

@ -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<any> {
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`,
},
});
}
}

View file

@ -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<MapInitData> {
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<BaseStyle> {
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`,
},
});
}
}