@geowiki/evoland-api-proxy 0.15.0-dev.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js ADDED
@@ -0,0 +1,1587 @@
1
+ "use strict";
2
+ var __create = Object.create;
3
+ var __defProp = Object.defineProperty;
4
+ var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
5
+ var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
7
+ var __hasOwnProp = Object.prototype.hasOwnProperty;
8
+ var __export = (target, all) => {
9
+ for (var name in all)
10
+ __defProp(target, name, { get: all[name], enumerable: true });
11
+ };
12
+ var __copyProps = (to, from, except, desc) => {
13
+ if (from && typeof from === "object" || typeof from === "function") {
14
+ for (let key of __getOwnPropNames(from))
15
+ if (!__hasOwnProp.call(to, key) && key !== except)
16
+ __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
17
+ }
18
+ return to;
19
+ };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
28
+ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
29
+
30
+ // index.ts
31
+ var evoland_api_proxy_exports = {};
32
+ __export(evoland_api_proxy_exports, {
33
+ AiService: () => AiService,
34
+ ApiError: () => ApiError,
35
+ CancelError: () => CancelError,
36
+ CancelablePromise: () => CancelablePromise,
37
+ LocationService: () => LocationService,
38
+ OpenAPI: () => OpenAPI,
39
+ ProjectService: () => ProjectService,
40
+ QuestionService: () => QuestionService,
41
+ StatisticService: () => StatisticService,
42
+ TaskService: () => TaskService,
43
+ TaskStatus: () => TaskStatus,
44
+ TaskType: () => TaskType,
45
+ UserRank: () => UserRank
46
+ });
47
+ module.exports = __toCommonJS(evoland_api_proxy_exports);
48
+
49
+ // core/ApiError.ts
50
+ var ApiError = class extends Error {
51
+ url;
52
+ status;
53
+ statusText;
54
+ body;
55
+ request;
56
+ constructor(request2, response, message) {
57
+ super(message);
58
+ this.name = "ApiError";
59
+ this.url = response.url;
60
+ this.status = response.status;
61
+ this.statusText = response.statusText;
62
+ this.body = response.body;
63
+ this.request = request2;
64
+ }
65
+ };
66
+
67
+ // core/CancelablePromise.ts
68
+ var CancelError = class extends Error {
69
+ constructor(message) {
70
+ super(message);
71
+ this.name = "CancelError";
72
+ }
73
+ get isCancelled() {
74
+ return true;
75
+ }
76
+ };
77
+ var CancelablePromise = class {
78
+ #isResolved;
79
+ #isRejected;
80
+ #isCancelled;
81
+ #cancelHandlers;
82
+ #promise;
83
+ #resolve;
84
+ #reject;
85
+ constructor(executor) {
86
+ this.#isResolved = false;
87
+ this.#isRejected = false;
88
+ this.#isCancelled = false;
89
+ this.#cancelHandlers = [];
90
+ this.#promise = new Promise((resolve2, reject) => {
91
+ this.#resolve = resolve2;
92
+ this.#reject = reject;
93
+ const onResolve = (value) => {
94
+ var _a;
95
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
96
+ return;
97
+ }
98
+ this.#isResolved = true;
99
+ (_a = this.#resolve) == null ? void 0 : _a.call(this, value);
100
+ };
101
+ const onReject = (reason) => {
102
+ var _a;
103
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
104
+ return;
105
+ }
106
+ this.#isRejected = true;
107
+ (_a = this.#reject) == null ? void 0 : _a.call(this, reason);
108
+ };
109
+ const onCancel = (cancelHandler) => {
110
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
111
+ return;
112
+ }
113
+ this.#cancelHandlers.push(cancelHandler);
114
+ };
115
+ Object.defineProperty(onCancel, "isResolved", {
116
+ get: () => this.#isResolved
117
+ });
118
+ Object.defineProperty(onCancel, "isRejected", {
119
+ get: () => this.#isRejected
120
+ });
121
+ Object.defineProperty(onCancel, "isCancelled", {
122
+ get: () => this.#isCancelled
123
+ });
124
+ return executor(onResolve, onReject, onCancel);
125
+ });
126
+ }
127
+ get [Symbol.toStringTag]() {
128
+ return "Cancellable Promise";
129
+ }
130
+ then(onFulfilled, onRejected) {
131
+ return this.#promise.then(onFulfilled, onRejected);
132
+ }
133
+ catch(onRejected) {
134
+ return this.#promise.catch(onRejected);
135
+ }
136
+ finally(onFinally) {
137
+ return this.#promise.finally(onFinally);
138
+ }
139
+ cancel() {
140
+ var _a;
141
+ if (this.#isResolved || this.#isRejected || this.#isCancelled) {
142
+ return;
143
+ }
144
+ this.#isCancelled = true;
145
+ if (this.#cancelHandlers.length) {
146
+ try {
147
+ for (const cancelHandler of this.#cancelHandlers) {
148
+ cancelHandler();
149
+ }
150
+ } catch (error) {
151
+ console.warn("Cancellation threw an error", error);
152
+ return;
153
+ }
154
+ }
155
+ this.#cancelHandlers.length = 0;
156
+ (_a = this.#reject) == null ? void 0 : _a.call(this, new CancelError("Request aborted"));
157
+ }
158
+ get isCancelled() {
159
+ return this.#isCancelled;
160
+ }
161
+ };
162
+
163
+ // core/OpenAPI.ts
164
+ var OpenAPI = {
165
+ BASE: "",
166
+ VERSION: "0.0.0",
167
+ WITH_CREDENTIALS: false,
168
+ CREDENTIALS: "include",
169
+ TOKEN: void 0,
170
+ USERNAME: void 0,
171
+ PASSWORD: void 0,
172
+ HEADERS: void 0,
173
+ ENCODE_PATH: void 0
174
+ };
175
+
176
+ // models/TaskStatus.ts
177
+ var TaskStatus = /* @__PURE__ */ ((TaskStatus2) => {
178
+ TaskStatus2["ASSIGNED"] = "ASSIGNED";
179
+ TaskStatus2["SKIPPED"] = "SKIPPED";
180
+ TaskStatus2["USER_DISCARDED"] = "USER_DISCARDED";
181
+ TaskStatus2["DISCARDED"] = "DISCARDED";
182
+ TaskStatus2["IN_REVIEW"] = "IN_REVIEW";
183
+ TaskStatus2["SUBMITTED"] = "SUBMITTED";
184
+ TaskStatus2["TO_FIX"] = "TO_FIX";
185
+ TaskStatus2["ACCEPTED"] = "ACCEPTED";
186
+ return TaskStatus2;
187
+ })(TaskStatus || {});
188
+
189
+ // models/TaskType.ts
190
+ var TaskType = /* @__PURE__ */ ((TaskType2) => {
191
+ TaskType2["ANNOTATION"] = "ANNOTATION";
192
+ TaskType2["QUESTIONNAIRE"] = "QUESTIONNAIRE";
193
+ return TaskType2;
194
+ })(TaskType || {});
195
+
196
+ // models/UserRank.ts
197
+ var UserRank = /* @__PURE__ */ ((UserRank2) => {
198
+ UserRank2["MEMBER"] = "MEMBER";
199
+ UserRank2["ADMIN"] = "ADMIN";
200
+ UserRank2["OWNER"] = "OWNER";
201
+ return UserRank2;
202
+ })(UserRank || {});
203
+
204
+ // core/request.ts
205
+ var import_axios = __toESM(require("axios"));
206
+ var import_form_data = __toESM(require("form-data"));
207
+ var isDefined = (value) => {
208
+ return value !== void 0 && value !== null;
209
+ };
210
+ var isString = (value) => {
211
+ return typeof value === "string";
212
+ };
213
+ var isStringWithValue = (value) => {
214
+ return isString(value) && value !== "";
215
+ };
216
+ var isBlob = (value) => {
217
+ 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]);
218
+ };
219
+ var isFormData = (value) => {
220
+ return value instanceof import_form_data.default;
221
+ };
222
+ var isSuccess = (status) => {
223
+ return status >= 200 && status < 300;
224
+ };
225
+ var base64 = (str) => {
226
+ try {
227
+ return btoa(str);
228
+ } catch (err) {
229
+ return Buffer.from(str).toString("base64");
230
+ }
231
+ };
232
+ var getQueryString = (params) => {
233
+ const qs = [];
234
+ const append = (key, value) => {
235
+ qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`);
236
+ };
237
+ const process = (key, value) => {
238
+ if (isDefined(value)) {
239
+ if (Array.isArray(value)) {
240
+ value.forEach((v) => {
241
+ process(key, v);
242
+ });
243
+ } else if (typeof value === "object") {
244
+ Object.entries(value).forEach(([k, v]) => {
245
+ process(`${key}[${k}]`, v);
246
+ });
247
+ } else {
248
+ append(key, value);
249
+ }
250
+ }
251
+ };
252
+ Object.entries(params).forEach(([key, value]) => {
253
+ process(key, value);
254
+ });
255
+ if (qs.length > 0) {
256
+ return `?${qs.join("&")}`;
257
+ }
258
+ return "";
259
+ };
260
+ var getUrl = (config, options) => {
261
+ const encoder = config.ENCODE_PATH || encodeURI;
262
+ const path = options.url.replace("{api-version}", config.VERSION).replace(/{(.*?)}/g, (substring, group) => {
263
+ var _a;
264
+ if ((_a = options.path) == null ? void 0 : _a.hasOwnProperty(group)) {
265
+ return encoder(String(options.path[group]));
266
+ }
267
+ return substring;
268
+ });
269
+ const url = `${config.BASE}${path}`;
270
+ if (options.query) {
271
+ return `${url}${getQueryString(options.query)}`;
272
+ }
273
+ return url;
274
+ };
275
+ var getFormData = (options) => {
276
+ if (options.formData) {
277
+ const formData = new import_form_data.default();
278
+ const process = (key, value) => {
279
+ if (isString(value) || isBlob(value)) {
280
+ formData.append(key, value);
281
+ } else {
282
+ formData.append(key, JSON.stringify(value));
283
+ }
284
+ };
285
+ Object.entries(options.formData).filter(([_, value]) => isDefined(value)).forEach(([key, value]) => {
286
+ if (Array.isArray(value)) {
287
+ value.forEach((v) => process(key, v));
288
+ } else {
289
+ process(key, value);
290
+ }
291
+ });
292
+ return formData;
293
+ }
294
+ return void 0;
295
+ };
296
+ var resolve = async (options, resolver) => {
297
+ if (typeof resolver === "function") {
298
+ return resolver(options);
299
+ }
300
+ return resolver;
301
+ };
302
+ var getHeaders = async (config, options, formData) => {
303
+ const token = await resolve(options, config.TOKEN);
304
+ const username = await resolve(options, config.USERNAME);
305
+ const password = await resolve(options, config.PASSWORD);
306
+ const additionalHeaders = await resolve(options, config.HEADERS);
307
+ const formHeaders = typeof (formData == null ? void 0 : formData.getHeaders) === "function" && (formData == null ? void 0 : formData.getHeaders()) || {};
308
+ const headers = Object.entries({
309
+ Accept: "application/json",
310
+ ...additionalHeaders,
311
+ ...options.headers,
312
+ ...formHeaders
313
+ }).filter(([_, value]) => isDefined(value)).reduce(
314
+ (headers2, [key, value]) => ({
315
+ ...headers2,
316
+ [key]: String(value)
317
+ }),
318
+ {}
319
+ );
320
+ if (isStringWithValue(token)) {
321
+ headers["Authorization"] = `Bearer ${token}`;
322
+ }
323
+ if (isStringWithValue(username) && isStringWithValue(password)) {
324
+ const credentials = base64(`${username}:${password}`);
325
+ headers["Authorization"] = `Basic ${credentials}`;
326
+ }
327
+ if (options.body) {
328
+ if (options.mediaType) {
329
+ headers["Content-Type"] = options.mediaType;
330
+ } else if (isBlob(options.body)) {
331
+ headers["Content-Type"] = options.body.type || "application/octet-stream";
332
+ } else if (isString(options.body)) {
333
+ headers["Content-Type"] = "text/plain";
334
+ } else if (!isFormData(options.body)) {
335
+ headers["Content-Type"] = "application/json";
336
+ }
337
+ }
338
+ return headers;
339
+ };
340
+ var getRequestBody = (options) => {
341
+ if (options.body) {
342
+ return options.body;
343
+ }
344
+ return void 0;
345
+ };
346
+ var sendRequest = async (config, options, url, body, formData, headers, onCancel, axiosClient) => {
347
+ const source = import_axios.default.CancelToken.source();
348
+ const requestConfig = {
349
+ url,
350
+ headers,
351
+ data: body ?? formData,
352
+ method: options.method,
353
+ withCredentials: config.WITH_CREDENTIALS,
354
+ cancelToken: source.token
355
+ };
356
+ onCancel(() => source.cancel("The user aborted a request."));
357
+ try {
358
+ return await axiosClient.request(requestConfig);
359
+ } catch (error) {
360
+ const axiosError = error;
361
+ if (axiosError.response) {
362
+ return axiosError.response;
363
+ }
364
+ throw error;
365
+ }
366
+ };
367
+ var getResponseHeader = (response, responseHeader) => {
368
+ if (responseHeader) {
369
+ const content = response.headers[responseHeader];
370
+ if (isString(content)) {
371
+ return content;
372
+ }
373
+ }
374
+ return void 0;
375
+ };
376
+ var getResponseBody = (response) => {
377
+ if (response.status !== 204) {
378
+ return response.data;
379
+ }
380
+ return void 0;
381
+ };
382
+ var catchErrorCodes = (options, result) => {
383
+ const errors = {
384
+ 400: "Bad Request",
385
+ 401: "Unauthorized",
386
+ 403: "Forbidden",
387
+ 404: "Not Found",
388
+ 500: "Internal Server Error",
389
+ 502: "Bad Gateway",
390
+ 503: "Service Unavailable",
391
+ ...options.errors
392
+ };
393
+ const error = errors[result.status];
394
+ if (error) {
395
+ throw new ApiError(options, result, error);
396
+ }
397
+ if (!result.ok) {
398
+ const errorStatus = result.status ?? "unknown";
399
+ const errorStatusText = result.statusText ?? "unknown";
400
+ const errorBody = (() => {
401
+ try {
402
+ return JSON.stringify(result.body, null, 2);
403
+ } catch (e) {
404
+ return void 0;
405
+ }
406
+ })();
407
+ throw new ApiError(
408
+ options,
409
+ result,
410
+ `Generic Error: status: ${errorStatus}; status text: ${errorStatusText}; body: ${errorBody}`
411
+ );
412
+ }
413
+ };
414
+ var request = (config, options, axiosClient = import_axios.default) => {
415
+ return new CancelablePromise(async (resolve2, reject, onCancel) => {
416
+ try {
417
+ const url = getUrl(config, options);
418
+ const formData = getFormData(options);
419
+ const body = getRequestBody(options);
420
+ const headers = await getHeaders(config, options, formData);
421
+ if (!onCancel.isCancelled) {
422
+ const response = await sendRequest(
423
+ config,
424
+ options,
425
+ url,
426
+ body,
427
+ formData,
428
+ headers,
429
+ onCancel,
430
+ axiosClient
431
+ );
432
+ const responseBody = getResponseBody(response);
433
+ const responseHeader = getResponseHeader(
434
+ response,
435
+ options.responseHeader
436
+ );
437
+ const result = {
438
+ url,
439
+ ok: isSuccess(response.status),
440
+ status: response.status,
441
+ statusText: response.statusText,
442
+ body: responseHeader ?? responseBody
443
+ };
444
+ catchErrorCodes(options, result);
445
+ resolve2(result.body);
446
+ }
447
+ } catch (error) {
448
+ reject(error);
449
+ }
450
+ });
451
+ };
452
+
453
+ // services/AiService.ts
454
+ var AiService = class {
455
+ /**
456
+ * Performs an automatic annotation of a location based on provided inputs by user.
457
+ * @param requestBody
458
+ * @returns ActiveLearningResponse Successful Response
459
+ * @throws ApiError
460
+ */
461
+ static performActiveLearningActivelearningPost(requestBody) {
462
+ return request(OpenAPI, {
463
+ method: "POST",
464
+ url: "/activelearning/",
465
+ body: requestBody,
466
+ mediaType: "application/json",
467
+ errors: {
468
+ 422: `Validation Error`
469
+ }
470
+ });
471
+ }
472
+ };
473
+
474
+ // services/LocationService.ts
475
+ var LocationService = class {
476
+ /**
477
+ * From a (lon, lat) coordinate and width and height expressed in meters, obtains a UTM tile of the given width and height for the best possible UTM projection. The user gets back the
478
+ * @param lon
479
+ * @param lat
480
+ * @param width
481
+ * @param height
482
+ * @returns PolygonResponse Successful Response
483
+ * @throws ApiError
484
+ */
485
+ static getPolygonUtmlocationLonLonLatLatWidthWidthHeightHeightGet(lon, lat, width, height) {
486
+ return request(OpenAPI, {
487
+ method: "GET",
488
+ url: "/utmlocation/lon={lon}&lat={lat}&width={width}&height={height}",
489
+ path: {
490
+ "lon": lon,
491
+ "lat": lat,
492
+ "width": width,
493
+ "height": height
494
+ },
495
+ errors: {
496
+ 422: `Validation Error`
497
+ }
498
+ });
499
+ }
500
+ /**
501
+ * From a location id, a project id and a reference date, gets a task response containing information about the location: the polygon with epsg and UTM bounds aligned in the grid. It also gets the task information for the user on that task if a task exists and is assigned to the current user.
502
+ * @param requestBody
503
+ * @returns TaskResponse Successful Response
504
+ * @throws ApiError
505
+ */
506
+ static getLocationGetlocationPost(requestBody) {
507
+ return request(OpenAPI, {
508
+ method: "POST",
509
+ url: "/getlocation/",
510
+ body: requestBody,
511
+ mediaType: "application/json",
512
+ errors: {
513
+ 422: `Validation Error`
514
+ }
515
+ });
516
+ }
517
+ /**
518
+ * Get the composite assets of a specific type from a location. Cannot get submitted annotations.
519
+ * @param requestBody
520
+ * @returns LocationAssetsResponse Successful Response
521
+ * @throws ApiError
522
+ */
523
+ static getLocationAssetsLocationtypeassetsPost(requestBody) {
524
+ return request(OpenAPI, {
525
+ method: "POST",
526
+ url: "/locationtypeassets/",
527
+ body: requestBody,
528
+ mediaType: "application/json",
529
+ errors: {
530
+ 422: `Validation Error`
531
+ }
532
+ });
533
+ }
534
+ /**
535
+ * Get all the assets for a given location.
536
+ * @param requestBody
537
+ * @returns LocationAssetsResponse Successful Response
538
+ * @throws ApiError
539
+ */
540
+ static getAllAssetsLocationassetsPost(requestBody) {
541
+ return request(OpenAPI, {
542
+ method: "POST",
543
+ url: "/locationassets/",
544
+ body: requestBody,
545
+ mediaType: "application/json",
546
+ errors: {
547
+ 422: `Validation Error`
548
+ }
549
+ });
550
+ }
551
+ /**
552
+ * Get a summary of the time series informations for a specific location.
553
+ * @param projectId
554
+ * @param locationId
555
+ * @returns TimeseriesInfoResponse Successful Response
556
+ * @throws ApiError
557
+ */
558
+ static timeseriesInfoTimeseriesassetsProjectIdProjectIdLocationIdLocationIdGet(projectId, locationId) {
559
+ return request(OpenAPI, {
560
+ method: "GET",
561
+ url: "/timeseriesassets/project_id={project_id}&location_id={location_id}",
562
+ path: {
563
+ "project_id": projectId,
564
+ "location_id": locationId
565
+ },
566
+ errors: {
567
+ 422: `Validation Error`
568
+ }
569
+ });
570
+ }
571
+ /**
572
+ * Creates a location from a given lon/lat/width/height and project id. Only the admin and owner users can add a location to a project.
573
+ * @param requestBody
574
+ * @returns LocationCreatedResponse Successful Response
575
+ * @throws ApiError
576
+ */
577
+ static createLocationCreatelocationPost(requestBody) {
578
+ return request(OpenAPI, {
579
+ method: "POST",
580
+ url: "/createlocation/",
581
+ body: requestBody,
582
+ mediaType: "application/json",
583
+ errors: {
584
+ 422: `Validation Error`
585
+ }
586
+ });
587
+ }
588
+ /**
589
+ * Process annotation bytes into tiff
590
+ * @param requestBody
591
+ * @returns any Successful Response
592
+ * @throws ApiError
593
+ */
594
+ static processAnnotationProcessannotationPost(requestBody) {
595
+ return request(OpenAPI, {
596
+ method: "POST",
597
+ url: "/processannotation",
598
+ body: requestBody,
599
+ mediaType: "application/json",
600
+ errors: {
601
+ 422: `Validation Error`
602
+ }
603
+ });
604
+ }
605
+ /**
606
+ * Process byte data into tiff
607
+ * @param requestBody
608
+ * @returns any Successful Response
609
+ * @throws ApiError
610
+ */
611
+ static processRasterProcessrasterPost(requestBody) {
612
+ return request(OpenAPI, {
613
+ method: "POST",
614
+ url: "/processraster",
615
+ body: requestBody,
616
+ mediaType: "application/json",
617
+ errors: {
618
+ 422: `Validation Error`
619
+ }
620
+ });
621
+ }
622
+ /**
623
+ * Accepts a geojson, validates rows, insert in location_task_mapping and returns a json for each row's status
624
+ * @param formData
625
+ * @returns any Successful Response
626
+ * @throws ApiError
627
+ */
628
+ static uploadLocationTaskUploadlocationtaskPost(formData) {
629
+ return request(OpenAPI, {
630
+ method: "POST",
631
+ url: "/uploadlocationtask/",
632
+ formData,
633
+ mediaType: "multipart/form-data",
634
+ errors: {
635
+ 422: `Validation Error`
636
+ }
637
+ });
638
+ }
639
+ /**
640
+ * Bulk Upload Locations
641
+ * Accepts a geojson, validates rows and insert in locations table, returns status of inserted and error row
642
+ * @param formData
643
+ * @returns any Successful Response
644
+ * @throws ApiError
645
+ */
646
+ static bulkUploadLocationsUploadlocationsPost(formData) {
647
+ return request(OpenAPI, {
648
+ method: "POST",
649
+ url: "/uploadlocations/",
650
+ formData,
651
+ mediaType: "multipart/form-data",
652
+ errors: {
653
+ 422: `Validation Error`
654
+ }
655
+ });
656
+ }
657
+ /**
658
+ * Bulk Upload Review Tasks
659
+ * Upload tasks which has been selected for review
660
+ * @param formData
661
+ * @returns any Successful Response
662
+ * @throws ApiError
663
+ */
664
+ static bulkUploadReviewTasksUploadreviewtasksPost(formData) {
665
+ return request(OpenAPI, {
666
+ method: "POST",
667
+ url: "/uploadreviewtasks",
668
+ formData,
669
+ mediaType: "multipart/form-data",
670
+ errors: {
671
+ 422: `Validation Error`
672
+ }
673
+ });
674
+ }
675
+ };
676
+
677
+ // services/ProjectService.ts
678
+ var ProjectService = class {
679
+ /**
680
+ * Read Root
681
+ * @returns AboutResponse Successful Response
682
+ * @throws ApiError
683
+ */
684
+ static readRootGet() {
685
+ return request(OpenAPI, {
686
+ method: "GET",
687
+ url: "/"
688
+ });
689
+ }
690
+ /**
691
+ * Get personal information by decoding the user token (specified inside the Authorization header field).
692
+ * @returns any Successful Response
693
+ * @throws ApiError
694
+ */
695
+ static getUserMeGet() {
696
+ return request(OpenAPI, {
697
+ method: "GET",
698
+ url: "/me/"
699
+ });
700
+ }
701
+ /**
702
+ * Returns the available layers from the WMS service.
703
+ * @returns LayersResponse Successful Response
704
+ * @throws ApiError
705
+ */
706
+ static getAvailableLayersAvailablelayersGet() {
707
+ return request(OpenAPI, {
708
+ method: "GET",
709
+ url: "/availablelayers/"
710
+ });
711
+ }
712
+ /**
713
+ * Return the WC labels codes for a project, with their names and colors.
714
+ * @param projectId
715
+ * @returns LabelsResponse Successful Response
716
+ * @throws ApiError
717
+ */
718
+ static getLabelsLabelsProjectIdProjectIdGet(projectId) {
719
+ return request(OpenAPI, {
720
+ method: "GET",
721
+ url: "/labels/project_id={project_id}",
722
+ path: {
723
+ "project_id": projectId
724
+ },
725
+ errors: {
726
+ 422: `Validation Error`
727
+ }
728
+ });
729
+ }
730
+ /**
731
+ * Return the combinatory (primary/secondary/tertiary) label codes, with their names and colors.
732
+ * @param projectId
733
+ * @returns LabelsResponse Successful Response
734
+ * @throws ApiError
735
+ */
736
+ static getCombinationLabelsCombinationlabelsProjectIdProjectIdGet(projectId) {
737
+ return request(OpenAPI, {
738
+ method: "GET",
739
+ url: "/combinationlabels/project_id={project_id}",
740
+ path: {
741
+ "project_id": projectId
742
+ },
743
+ errors: {
744
+ 422: `Validation Error`
745
+ }
746
+ });
747
+ }
748
+ /**
749
+ * Get the project information from a specific project.
750
+ * @param projectId
751
+ * @returns ProjectDetailElement Successful Response
752
+ * @throws ApiError
753
+ */
754
+ static projectDetailProjectdetailProjectIdProjectIdGet(projectId) {
755
+ return request(OpenAPI, {
756
+ method: "GET",
757
+ url: "/projectdetail/project_id={project_id}",
758
+ path: {
759
+ "project_id": projectId
760
+ },
761
+ errors: {
762
+ 422: `Validation Error`
763
+ }
764
+ });
765
+ }
766
+ /**
767
+ * Get the project information, user statistics from a specific project.
768
+ * @param projectId
769
+ * @returns UserProjectElement Successful Response
770
+ * @throws ApiError
771
+ */
772
+ static projectInfoProjectinfoProjectIdProjectIdGet(projectId) {
773
+ return request(OpenAPI, {
774
+ method: "GET",
775
+ url: "/projectinfo/project_id={project_id}",
776
+ path: {
777
+ "project_id": projectId
778
+ },
779
+ errors: {
780
+ 422: `Validation Error`
781
+ }
782
+ });
783
+ }
784
+ /**
785
+ * Lists all the project that the user is part of. If the user is an administrator, then lists all the projects currently in the datbase, including the deleted projects.
786
+ * @param startidx
787
+ * @param amount
788
+ * @returns ListProjectResponse Successful Response
789
+ * @throws ApiError
790
+ */
791
+ static listProjectsListprojectsStartidxStartidxAmountAmountGet(startidx, amount) {
792
+ return request(OpenAPI, {
793
+ method: "GET",
794
+ url: "/listprojects/startidx={startidx}&amount={amount}",
795
+ path: {
796
+ "startidx": startidx,
797
+ "amount": amount
798
+ },
799
+ errors: {
800
+ 422: `Validation Error`
801
+ }
802
+ });
803
+ }
804
+ /**
805
+ * Creates a project, adding the curent user as owner. Only GeoWiki admins can create a new project.
806
+ * @param requestBody
807
+ * @returns CreateProjectResponse Successful Response
808
+ * @throws ApiError
809
+ */
810
+ static createProjectCreateprojectPost(requestBody) {
811
+ return request(OpenAPI, {
812
+ method: "POST",
813
+ url: "/createproject/",
814
+ body: requestBody,
815
+ mediaType: "application/json",
816
+ errors: {
817
+ 422: `Validation Error`
818
+ }
819
+ });
820
+ }
821
+ /**
822
+ * Get the project result set information for all the location and tasks linked to a project
823
+ * @param projectId
824
+ * @param isGeoJson
825
+ * @returns any Successful Response
826
+ * @throws ApiError
827
+ */
828
+ static projectResultSetProjectresultsetProjectIdProjectIdIsGeoJsonIsGeoJsonGet(projectId, isGeoJson) {
829
+ return request(OpenAPI, {
830
+ method: "GET",
831
+ url: "/projectresultset/project_id={project_id}&is_geo_json={is_geo_json}",
832
+ path: {
833
+ "project_id": projectId,
834
+ "is_geo_json": isGeoJson
835
+ },
836
+ errors: {
837
+ 422: `Validation Error`
838
+ }
839
+ });
840
+ }
841
+ /**
842
+ * Create a new user in the database. Only admins can create a new user.
843
+ * @param requestBody
844
+ * @returns GenericResponse Successful Response
845
+ * @throws ApiError
846
+ */
847
+ static createUserCreateuserPost(requestBody) {
848
+ return request(OpenAPI, {
849
+ method: "POST",
850
+ url: "/createuser/",
851
+ body: requestBody,
852
+ mediaType: "application/json",
853
+ errors: {
854
+ 422: `Validation Error`
855
+ }
856
+ });
857
+ }
858
+ /**
859
+ * Sets the user role in a project. If the user does not exists, then adds it to the project with the target role.
860
+ * @param requestBody
861
+ * @returns GenericResponse Successful Response
862
+ * @throws ApiError
863
+ */
864
+ static setUserRoleSetuserrolePost(requestBody) {
865
+ return request(OpenAPI, {
866
+ method: "POST",
867
+ url: "/setuserrole/",
868
+ body: requestBody,
869
+ mediaType: "application/json",
870
+ errors: {
871
+ 422: `Validation Error`
872
+ }
873
+ });
874
+ }
875
+ /**
876
+ * Sets the user role in a project. If the user does not exists, then adds it to the project with the target role.
877
+ * @param requestBody
878
+ * @returns GenericResponse Successful Response
879
+ * @throws ApiError
880
+ */
881
+ static setUserDetailSetuserdetailPost(requestBody) {
882
+ return request(OpenAPI, {
883
+ method: "POST",
884
+ url: "/setuserdetail/",
885
+ body: requestBody,
886
+ mediaType: "application/json",
887
+ errors: {
888
+ 422: `Validation Error`
889
+ }
890
+ });
891
+ }
892
+ /**
893
+ * Get user role and project
894
+ * @param userId
895
+ * @returns GetUserRoleProjectResponse Successful Response
896
+ * @throws ApiError
897
+ */
898
+ static getUserRoleProjectGetuserroleprojectUserIdUserIdGet(userId) {
899
+ return request(OpenAPI, {
900
+ method: "GET",
901
+ url: "/getuserroleproject/user_id={user_id}",
902
+ path: {
903
+ "user_id": userId
904
+ },
905
+ errors: {
906
+ 422: `Validation Error`
907
+ }
908
+ });
909
+ }
910
+ /**
911
+ * Removes an user from a project.
912
+ * @param requestBody
913
+ * @returns GenericResponse Successful Response
914
+ * @throws ApiError
915
+ */
916
+ static removeUserRemoveuserPost(requestBody) {
917
+ return request(OpenAPI, {
918
+ method: "POST",
919
+ url: "/removeuser/",
920
+ body: requestBody,
921
+ mediaType: "application/json",
922
+ errors: {
923
+ 422: `Validation Error`
924
+ }
925
+ });
926
+ }
927
+ /**
928
+ * Returns a set of locations, or a sets of clusters given a bounding box
929
+ * @param requestBody
930
+ * @returns ListLocationsResponse Successful Response
931
+ * @throws ApiError
932
+ */
933
+ static searchLocationsLocationsPost(requestBody) {
934
+ return request(OpenAPI, {
935
+ method: "POST",
936
+ url: "/locations/",
937
+ body: requestBody,
938
+ mediaType: "application/json",
939
+ errors: {
940
+ 422: `Validation Error`
941
+ }
942
+ });
943
+ }
944
+ /**
945
+ * Returns a summary of locations,groups
946
+ * @param projectId
947
+ * @returns any Successful Response
948
+ * @throws ApiError
949
+ */
950
+ static getLocationsSummaryLocationssummaryProjectIdProjectIdGet(projectId) {
951
+ return request(OpenAPI, {
952
+ method: "GET",
953
+ url: "/locationssummary/project_id={project_id}",
954
+ path: {
955
+ "project_id": projectId
956
+ },
957
+ errors: {
958
+ 422: `Validation Error`
959
+ }
960
+ });
961
+ }
962
+ /**
963
+ * Get the table of tasks of the user if an user is specified.
964
+ * @param locationProjectId
965
+ * @param taskForReview
966
+ * @param id
967
+ * @param orderBy
968
+ * @param search
969
+ * @param status
970
+ * @param statusIn
971
+ * @param dateLte
972
+ * @param dateGte
973
+ * @param pageIdx
974
+ * @param pageSize
975
+ * @param userId
976
+ * @param userUserAlias
977
+ * @param userOrderBy
978
+ * @param locationLocationId
979
+ * @param locationOrderBy
980
+ * @param groupName
981
+ * @param groupOrderBy
982
+ * @returns TaskFilterResponse Successful Response
983
+ * @throws ApiError
984
+ */
985
+ static getTasksTasksGet(locationProjectId, taskForReview, id, orderBy, search, status, statusIn, dateLte, dateGte, pageIdx, pageSize, userId, userUserAlias, userOrderBy, locationLocationId, locationOrderBy, groupName, groupOrderBy) {
986
+ return request(OpenAPI, {
987
+ method: "GET",
988
+ url: "/tasks",
989
+ query: {
990
+ "task_for_review": taskForReview,
991
+ "id": id,
992
+ "order_by": orderBy,
993
+ "search": search,
994
+ "status": status,
995
+ "status__in": statusIn,
996
+ "date__lte": dateLte,
997
+ "date__gte": dateGte,
998
+ "page_idx": pageIdx,
999
+ "page_size": pageSize,
1000
+ "user__id": userId,
1001
+ "user__user_alias": userUserAlias,
1002
+ "user__order_by": userOrderBy,
1003
+ "location__location_id": locationLocationId,
1004
+ "location__order_by": locationOrderBy,
1005
+ "location__project_id": locationProjectId,
1006
+ "group__name": groupName,
1007
+ "group__order_by": groupOrderBy
1008
+ },
1009
+ errors: {
1010
+ 422: `Validation Error`
1011
+ }
1012
+ });
1013
+ }
1014
+ /**
1015
+ * Get a random task for the user, based on the same filter available in the GET /tasks call.
1016
+ * @param locationProjectId
1017
+ * @param taskForReview
1018
+ * @param id
1019
+ * @param orderBy
1020
+ * @param search
1021
+ * @param status
1022
+ * @param statusIn
1023
+ * @param dateLte
1024
+ * @param dateGte
1025
+ * @param pageIdx
1026
+ * @param pageSize
1027
+ * @param userId
1028
+ * @param userUserAlias
1029
+ * @param userOrderBy
1030
+ * @param locationLocationId
1031
+ * @param locationOrderBy
1032
+ * @param groupName
1033
+ * @param groupOrderBy
1034
+ * @returns TaskResponse Successful Response
1035
+ * @throws ApiError
1036
+ */
1037
+ static getRandomTaskRandomtaskGet(locationProjectId, taskForReview, id, orderBy, search, status, statusIn, dateLte, dateGte, pageIdx, pageSize, userId, userUserAlias, userOrderBy, locationLocationId, locationOrderBy, groupName, groupOrderBy) {
1038
+ return request(OpenAPI, {
1039
+ method: "GET",
1040
+ url: "/randomtask",
1041
+ query: {
1042
+ "task_for_review": taskForReview,
1043
+ "id": id,
1044
+ "order_by": orderBy,
1045
+ "search": search,
1046
+ "status": status,
1047
+ "status__in": statusIn,
1048
+ "date__lte": dateLte,
1049
+ "date__gte": dateGte,
1050
+ "page_idx": pageIdx,
1051
+ "page_size": pageSize,
1052
+ "user__id": userId,
1053
+ "user__user_alias": userUserAlias,
1054
+ "user__order_by": userOrderBy,
1055
+ "location__location_id": locationLocationId,
1056
+ "location__order_by": locationOrderBy,
1057
+ "location__project_id": locationProjectId,
1058
+ "group__name": groupName,
1059
+ "group__order_by": groupOrderBy
1060
+ },
1061
+ errors: {
1062
+ 422: `Validation Error`
1063
+ }
1064
+ });
1065
+ }
1066
+ /**
1067
+ * Returns a list of groups available within a project.
1068
+ * @param projectId
1069
+ * @returns ProjectGroupResponse Successful Response
1070
+ * @throws ApiError
1071
+ */
1072
+ static getProjectGroupsProjectgroupsProjectIdProjectIdGet(projectId) {
1073
+ return request(OpenAPI, {
1074
+ method: "GET",
1075
+ url: "/projectgroups/project_id={project_id}",
1076
+ path: {
1077
+ "project_id": projectId
1078
+ },
1079
+ errors: {
1080
+ 422: `Validation Error`
1081
+ }
1082
+ });
1083
+ }
1084
+ /**
1085
+ * Selects an active group for a project.
1086
+ * @param requestBody
1087
+ * @returns GenericResponse Successful Response
1088
+ * @throws ApiError
1089
+ */
1090
+ static selectProjectGroupProjectselectgroupPost(requestBody) {
1091
+ return request(OpenAPI, {
1092
+ method: "POST",
1093
+ url: "/projectselectgroup/",
1094
+ body: requestBody,
1095
+ mediaType: "application/json",
1096
+ errors: {
1097
+ 422: `Validation Error`
1098
+ }
1099
+ });
1100
+ }
1101
+ /**
1102
+ * List all the users within a project.
1103
+ * @param projectId
1104
+ * @returns UserOut Successful Response
1105
+ * @throws ApiError
1106
+ */
1107
+ static projectAllUsersProjectusersProjectIdProjectIdGet(projectId) {
1108
+ return request(OpenAPI, {
1109
+ method: "GET",
1110
+ url: "/projectusers/project_id={project_id}",
1111
+ path: {
1112
+ "project_id": projectId
1113
+ },
1114
+ errors: {
1115
+ 422: `Validation Error`
1116
+ }
1117
+ });
1118
+ }
1119
+ /**
1120
+ * Returns the task information for a specific location. The task returned is the task with the latest update.
1121
+ * @param locationId
1122
+ * @param projectId
1123
+ * @param referenceDate
1124
+ * @returns LocationTaskAnnotationResponse Successful Response
1125
+ * @throws ApiError
1126
+ */
1127
+ static locationLatestTaskLocationtaskLocationIdLocationIdProjectIdProjectIdReferenceDateReferenceDateGet(locationId, projectId, referenceDate) {
1128
+ return request(OpenAPI, {
1129
+ method: "GET",
1130
+ url: "/locationtask/location_id={location_id}&project_id={project_id}&reference_date={reference_date}",
1131
+ path: {
1132
+ "location_id": locationId,
1133
+ "project_id": projectId,
1134
+ "reference_date": referenceDate
1135
+ },
1136
+ errors: {
1137
+ 422: `Validation Error`
1138
+ }
1139
+ });
1140
+ }
1141
+ };
1142
+
1143
+ // services/QuestionService.ts
1144
+ var QuestionService = class {
1145
+ /**
1146
+ * Get Project Questions Answers
1147
+ * get pairs of questions and answers associated with a project
1148
+ * @param projectId
1149
+ * @returns Questionnaire Successful Response
1150
+ * @throws ApiError
1151
+ */
1152
+ static getProjectQuestionsAnswersQuestionsAnswersProjectIdProjectIdGet(projectId) {
1153
+ return request(OpenAPI, {
1154
+ method: "GET",
1155
+ url: "/questions_answers/project_id={project_id}",
1156
+ path: {
1157
+ "project_id": projectId
1158
+ },
1159
+ errors: {
1160
+ 422: `Validation Error`
1161
+ }
1162
+ });
1163
+ }
1164
+ };
1165
+
1166
+ // services/StatisticService.ts
1167
+ var StatisticService = class {
1168
+ /**
1169
+ * Get User Statistics
1170
+ * For each user within a project, get statistics related to the tasks that were updated.
1171
+ * @param projectId
1172
+ * @param endDate
1173
+ * @param startDate
1174
+ * @param isContractualData
1175
+ * @param filterUserId
1176
+ * @returns UserStatisticsResponse Successful Response
1177
+ * @throws ApiError
1178
+ */
1179
+ static getUserStatisticsUserstatisticsProjectIdProjectIdStartDateStartDateEndDateEndDateFilterUserIdFilterUserIdIsContractualDataIsContractualDataGet(projectId, endDate, startDate, isContractualData, filterUserId) {
1180
+ return request(OpenAPI, {
1181
+ method: "GET",
1182
+ url: "/userstatistics/project_id={project_id}&start_date={start_date}&end_date={end_date}&filter_user_id={filter_user_id}&is_contractual_data={is_contractual_data}",
1183
+ path: {
1184
+ "project_id": projectId,
1185
+ "end_date": endDate,
1186
+ "start_date": startDate,
1187
+ "is_contractual_data": isContractualData,
1188
+ "filter_user_id": filterUserId
1189
+ },
1190
+ errors: {
1191
+ 422: `Validation Error`
1192
+ }
1193
+ });
1194
+ }
1195
+ /**
1196
+ * Get User Statistics
1197
+ * For each user within a project, get statistics related to the tasks that were updated.
1198
+ * @param projectId
1199
+ * @param endDate
1200
+ * @param startDate
1201
+ * @param filterUserId
1202
+ * @param isContractualData
1203
+ * @returns UserStatisticsResponse Successful Response
1204
+ * @throws ApiError
1205
+ */
1206
+ static getUserStatisticsUserstatisticsProjectIdProjectIdStartDateStartDateEndDateEndDateFilterUserIdFilterUserIdGet(projectId, endDate, startDate, filterUserId, isContractualData = false) {
1207
+ return request(OpenAPI, {
1208
+ method: "GET",
1209
+ url: "/userstatistics/project_id={project_id}&start_date={start_date}&end_date={end_date}&filter_user_id={filter_user_id}",
1210
+ path: {
1211
+ "project_id": projectId,
1212
+ "end_date": endDate,
1213
+ "start_date": startDate,
1214
+ "filter_user_id": filterUserId
1215
+ },
1216
+ query: {
1217
+ "is_contractual_data": isContractualData
1218
+ },
1219
+ errors: {
1220
+ 422: `Validation Error`
1221
+ }
1222
+ });
1223
+ }
1224
+ /**
1225
+ * Get User Statistics
1226
+ * For each user within a project, get statistics related to the tasks that were updated.
1227
+ * @param projectId
1228
+ * @param endDate
1229
+ * @param startDate
1230
+ * @param isContractualData
1231
+ * @param filterUserId
1232
+ * @returns UserStatisticsResponse Successful Response
1233
+ * @throws ApiError
1234
+ */
1235
+ static getUserStatisticsUserstatisticsProjectIdProjectIdStartDateStartDateEndDateEndDateGet(projectId, endDate, startDate, isContractualData = false, filterUserId) {
1236
+ return request(OpenAPI, {
1237
+ method: "GET",
1238
+ url: "/userstatistics/project_id={project_id}&start_date={start_date}&end_date={end_date}",
1239
+ path: {
1240
+ "project_id": projectId,
1241
+ "end_date": endDate,
1242
+ "start_date": startDate
1243
+ },
1244
+ query: {
1245
+ "is_contractual_data": isContractualData,
1246
+ "filter_user_id": filterUserId
1247
+ },
1248
+ errors: {
1249
+ 422: `Validation Error`
1250
+ }
1251
+ });
1252
+ }
1253
+ };
1254
+
1255
+ // services/TaskService.ts
1256
+ var TaskService = class {
1257
+ /**
1258
+ * Get all the possible task statuses
1259
+ * @returns string Successful Response
1260
+ * @throws ApiError
1261
+ */
1262
+ static getTaskStatusesTaskstatusesGet() {
1263
+ return request(OpenAPI, {
1264
+ method: "GET",
1265
+ url: "/taskstatuses/"
1266
+ });
1267
+ }
1268
+ /**
1269
+ * Get the task information for a specific task id.
1270
+ * @param taskId
1271
+ * @returns TaskResponse Successful Response
1272
+ * @throws ApiError
1273
+ */
1274
+ static getTaskGettaskTaskIdTaskIdGet(taskId) {
1275
+ return request(OpenAPI, {
1276
+ method: "GET",
1277
+ url: "/gettask/task_id={task_id}",
1278
+ path: {
1279
+ "task_id": taskId
1280
+ },
1281
+ errors: {
1282
+ 422: `Validation Error`
1283
+ }
1284
+ });
1285
+ }
1286
+ /**
1287
+ * Create a task for an user for a specific location, if no task exists for that user on that location. Then returns the created/existing task and location info.
1288
+ * @param requestBody
1289
+ * @returns TaskResponse Successful Response
1290
+ * @throws ApiError
1291
+ */
1292
+ static createTaskCreatetaskPost(requestBody) {
1293
+ return request(OpenAPI, {
1294
+ method: "POST",
1295
+ url: "/createtask/",
1296
+ body: requestBody,
1297
+ mediaType: "application/json",
1298
+ errors: {
1299
+ 422: `Validation Error`
1300
+ }
1301
+ });
1302
+ }
1303
+ /**
1304
+ * Returns a new task for an user on a new location. If the user already has a task in the ASSIGNED state, it will be returned.
1305
+ * @param requestBody
1306
+ * @returns TaskResponse Successful Response
1307
+ * @throws ApiError
1308
+ */
1309
+ static getNextLocationNexttaskPost(requestBody) {
1310
+ return request(OpenAPI, {
1311
+ method: "POST",
1312
+ url: "/nexttask/",
1313
+ body: requestBody,
1314
+ mediaType: "application/json",
1315
+ errors: {
1316
+ 422: `Validation Error`
1317
+ }
1318
+ });
1319
+ }
1320
+ /**
1321
+ * Deletes a specific task from the database and the related events. Submitted annotations are kept in the database for the location. Only admin users can delete tasks.
1322
+ * @param requestBody
1323
+ * @returns GenericResponse Successful Response
1324
+ * @throws ApiError
1325
+ */
1326
+ static deleteTaskDeletetaskPost(requestBody) {
1327
+ return request(OpenAPI, {
1328
+ method: "POST",
1329
+ url: "/deletetask/",
1330
+ body: requestBody,
1331
+ mediaType: "application/json",
1332
+ errors: {
1333
+ 422: `Validation Error`
1334
+ }
1335
+ });
1336
+ }
1337
+ /**
1338
+ * Get the latest task annotation for a specific task id.
1339
+ * @param taskId
1340
+ * @returns TaskAnnotationResponse Successful Response
1341
+ * @throws ApiError
1342
+ */
1343
+ static getTaskAnnotationAssetTaskannotationTaskIdTaskIdGet(taskId) {
1344
+ return request(OpenAPI, {
1345
+ method: "GET",
1346
+ url: "/taskannotation/task_id={task_id}",
1347
+ path: {
1348
+ "task_id": taskId
1349
+ },
1350
+ errors: {
1351
+ 422: `Validation Error`
1352
+ }
1353
+ });
1354
+ }
1355
+ /**
1356
+ * Get all the annotations for a specific task id.
1357
+ * @param taskId
1358
+ * @returns LocationAssetsResponse Successful Response
1359
+ * @throws ApiError
1360
+ */
1361
+ static getTaskAnnotationAssetsTaskannotationsTaskIdTaskIdGet(taskId) {
1362
+ return request(OpenAPI, {
1363
+ method: "GET",
1364
+ url: "/taskannotations/task_id={task_id}",
1365
+ path: {
1366
+ "task_id": taskId
1367
+ },
1368
+ errors: {
1369
+ 422: `Validation Error`
1370
+ }
1371
+ });
1372
+ }
1373
+ /**
1374
+ * Saves an annotation for a task.
1375
+ * @param requestBody
1376
+ * @returns GenericResponse Successful Response
1377
+ * @throws ApiError
1378
+ */
1379
+ static saveAnnotationSaveannotationPost(requestBody) {
1380
+ return request(OpenAPI, {
1381
+ method: "POST",
1382
+ url: "/saveannotation/",
1383
+ body: requestBody,
1384
+ mediaType: "application/json",
1385
+ errors: {
1386
+ 422: `Validation Error`
1387
+ }
1388
+ });
1389
+ }
1390
+ /**
1391
+ * Get the saved annotation for a specific task (if it exists).
1392
+ * @param taskId
1393
+ * @returns GetSavedAnnotationResponse Successful Response
1394
+ * @throws ApiError
1395
+ */
1396
+ static getSavedAnnotationGetsavedannotationTaskIdTaskIdGet(taskId) {
1397
+ return request(OpenAPI, {
1398
+ method: "GET",
1399
+ url: "/getsavedannotation/task_id={task_id}",
1400
+ path: {
1401
+ "task_id": taskId
1402
+ },
1403
+ errors: {
1404
+ 422: `Validation Error`
1405
+ }
1406
+ });
1407
+ }
1408
+ /**
1409
+ * Save Questionnaire
1410
+ * Save questionnaire for a task
1411
+ * @param requestBody
1412
+ * @returns GenericResponse Successful Response
1413
+ * @throws ApiError
1414
+ */
1415
+ static saveQuestionnaireSavequestionnairePost(requestBody) {
1416
+ return request(OpenAPI, {
1417
+ method: "POST",
1418
+ url: "/savequestionnaire",
1419
+ body: requestBody,
1420
+ mediaType: "application/json",
1421
+ errors: {
1422
+ 422: `Validation Error`
1423
+ }
1424
+ });
1425
+ }
1426
+ /**
1427
+ * Get change detection details associated with a task
1428
+ * @param taskId
1429
+ * @returns TaskChangeElement Successful Response
1430
+ * @throws ApiError
1431
+ */
1432
+ static getTaskChangeDetailTaskchangedetailsPost(taskId) {
1433
+ return request(OpenAPI, {
1434
+ method: "POST",
1435
+ url: "/taskchangedetails/",
1436
+ query: {
1437
+ "task_id": taskId
1438
+ },
1439
+ errors: {
1440
+ 422: `Validation Error`
1441
+ }
1442
+ });
1443
+ }
1444
+ /**
1445
+ * Get change detection details associated with a task
1446
+ * @param taskId
1447
+ * @returns TaskGeometryElement Successful Response
1448
+ * @throws ApiError
1449
+ */
1450
+ static getTaskGeometryDetailTaskgeometryetailsPost(taskId) {
1451
+ return request(OpenAPI, {
1452
+ method: "POST",
1453
+ url: "/taskgeometryetails/",
1454
+ query: {
1455
+ "task_id": taskId
1456
+ },
1457
+ errors: {
1458
+ 422: `Validation Error`
1459
+ }
1460
+ });
1461
+ }
1462
+ /**
1463
+ * Updates the status of a task. Depending on the previous status, the role of the user and the target status, required required parameters may vary
1464
+ * @param requestBody
1465
+ * @returns UpdateTaskResponse Successful Response
1466
+ * @throws ApiError
1467
+ */
1468
+ static updateTaskUpdatetaskPost(requestBody) {
1469
+ return request(OpenAPI, {
1470
+ method: "POST",
1471
+ url: "/updatetask/",
1472
+ body: requestBody,
1473
+ mediaType: "application/json",
1474
+ errors: {
1475
+ 422: `Validation Error`
1476
+ }
1477
+ });
1478
+ }
1479
+ /**
1480
+ * Adds a comment from an user on a task.
1481
+ * @param requestBody
1482
+ * @returns GenericResponse Successful Response
1483
+ * @throws ApiError
1484
+ */
1485
+ static taskCommentTaskcommentPost(requestBody) {
1486
+ return request(OpenAPI, {
1487
+ method: "POST",
1488
+ url: "/taskcomment/",
1489
+ body: requestBody,
1490
+ mediaType: "application/json",
1491
+ errors: {
1492
+ 422: `Validation Error`
1493
+ }
1494
+ });
1495
+ }
1496
+ /**
1497
+ * Get the events of a task.
1498
+ * @param taskId
1499
+ * @returns TaskEventOut Successful Response
1500
+ * @throws ApiError
1501
+ */
1502
+ static getTaskEventsTaskeventsTaskIdTaskIdGet(taskId) {
1503
+ return request(OpenAPI, {
1504
+ method: "GET",
1505
+ url: "/taskevents/task_id={task_id}",
1506
+ path: {
1507
+ "task_id": taskId
1508
+ },
1509
+ errors: {
1510
+ 422: `Validation Error`
1511
+ }
1512
+ });
1513
+ }
1514
+ /**
1515
+ * Get the latest comments for every task in the provided list. The response will be a list of comments ordered in the same way as the input list. An empty string is returned if no latest comment was found.
1516
+ * @param requestBody
1517
+ * @returns TaskLatestCommentResponse Successful Response
1518
+ * @throws ApiError
1519
+ */
1520
+ static taskLatestComomentsTasklatestcommentPost(requestBody) {
1521
+ return request(OpenAPI, {
1522
+ method: "POST",
1523
+ url: "/tasklatestcomment/",
1524
+ body: requestBody,
1525
+ mediaType: "application/json",
1526
+ errors: {
1527
+ 422: `Validation Error`
1528
+ }
1529
+ });
1530
+ }
1531
+ /**
1532
+ * Get the reference dates for current task on a location from meta_data.The response model will be a list of string
1533
+ * @param locationId
1534
+ * @param projectId
1535
+ * @param assetType
1536
+ * @returns any Successful Response
1537
+ * @throws ApiError
1538
+ */
1539
+ static taskReferenceDatesGettaskreferencedatesProjectIdProjectIdLocationIdLocationIdAssetTypeAssetTypeGet(locationId, projectId, assetType) {
1540
+ return request(OpenAPI, {
1541
+ method: "GET",
1542
+ url: "/gettaskreferencedates/project_id={project_id}&location_id={location_id}&asset_type={asset_type}",
1543
+ path: {
1544
+ "location_id": locationId,
1545
+ "project_id": projectId,
1546
+ "asset_type": assetType
1547
+ },
1548
+ errors: {
1549
+ 422: `Validation Error`
1550
+ }
1551
+ });
1552
+ }
1553
+ /**
1554
+ * returns a list of user provided answers associated with a task
1555
+ * @param taskId
1556
+ * @returns any[] Successful Response
1557
+ * @throws ApiError
1558
+ */
1559
+ static getTaskAnswersTaskanswersTaskIdTaskIdGet(taskId) {
1560
+ return request(OpenAPI, {
1561
+ method: "GET",
1562
+ url: "/taskanswers/task_id={task_id}",
1563
+ path: {
1564
+ "task_id": taskId
1565
+ },
1566
+ errors: {
1567
+ 422: `Validation Error`
1568
+ }
1569
+ });
1570
+ }
1571
+ };
1572
+ // Annotate the CommonJS export names for ESM import in node:
1573
+ 0 && (module.exports = {
1574
+ AiService,
1575
+ ApiError,
1576
+ CancelError,
1577
+ CancelablePromise,
1578
+ LocationService,
1579
+ OpenAPI,
1580
+ ProjectService,
1581
+ QuestionService,
1582
+ StatisticService,
1583
+ TaskService,
1584
+ TaskStatus,
1585
+ TaskType,
1586
+ UserRank
1587
+ });