@geode/opengeodeweb-front 10.14.0-rc.2 → 10.14.0-rc.3
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.
|
@@ -13,7 +13,7 @@ import { commandExistsSync, waitForReady } from "./scripts.js";
|
|
|
13
13
|
import { executableName, executablePath } from "./path.js";
|
|
14
14
|
import { microservicesMetadatasPath, projectMicroservices } from "./cleanup.js";
|
|
15
15
|
|
|
16
|
-
const DEFAULT_TIMEOUT_SECONDS =
|
|
16
|
+
const DEFAULT_TIMEOUT_SECONDS = 60;
|
|
17
17
|
const MILLISECONDS_PER_SECOND = 1000;
|
|
18
18
|
|
|
19
19
|
function getAvailablePort() {
|
|
@@ -7,7 +7,7 @@ const ERROR_400 = 400;
|
|
|
7
7
|
export function api_fetch(
|
|
8
8
|
microservice,
|
|
9
9
|
{ schema, params },
|
|
10
|
-
{ request_error_function, response_function, response_error_function } = {},
|
|
10
|
+
{ request_error_function, response_function, response_error_function, timeout } = {},
|
|
11
11
|
) {
|
|
12
12
|
const feedbackStore = useFeedbackStore();
|
|
13
13
|
|
|
@@ -36,30 +36,42 @@ export function api_fetch(
|
|
|
36
36
|
if (schema.max_retry) {
|
|
37
37
|
request_options.max_retry = schema.max_retry;
|
|
38
38
|
}
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
39
|
+
|
|
40
|
+
function performFetch() {
|
|
41
|
+
return $fetch(schema.$id, {
|
|
42
|
+
baseURL: microservice.base_url,
|
|
43
|
+
...request_options,
|
|
44
|
+
onRequestError({ error }) {
|
|
45
|
+
microservice.stop_request();
|
|
46
|
+
feedbackStore.add_error(error.code, schema.$id, error.message, error.stack);
|
|
47
|
+
if (request_error_function) {
|
|
48
|
+
request_error_function(error);
|
|
49
|
+
}
|
|
50
|
+
},
|
|
51
|
+
onResponse({ response }) {
|
|
52
|
+
if (response.ok) {
|
|
53
|
+
microservice.stop_request();
|
|
54
|
+
if (response_function) {
|
|
55
|
+
response_function(response._data);
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
},
|
|
59
|
+
onResponseError({ response }) {
|
|
51
60
|
microservice.stop_request();
|
|
52
|
-
|
|
53
|
-
|
|
61
|
+
feedbackStore.add_error(response.status, schema.$id, response.name, response.description);
|
|
62
|
+
if (response_error_function) {
|
|
63
|
+
response_error_function(response);
|
|
54
64
|
}
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
if (timeout !== undefined && timeout > 0) {
|
|
70
|
+
return pTimeout(performCall(), {
|
|
71
|
+
milliseconds: timeout,
|
|
72
|
+
message: `${schema.$id}: Timed out after ${timeout}ms`,
|
|
73
|
+
});
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
return performFetch();
|
|
65
77
|
}
|
|
@@ -4,7 +4,7 @@ import { validate_schema } from "@ogw_front/utils/validate_schema";
|
|
|
4
4
|
|
|
5
5
|
const ERROR_400 = 400;
|
|
6
6
|
|
|
7
|
-
export
|
|
7
|
+
export function viewer_call(
|
|
8
8
|
microservice,
|
|
9
9
|
{ schema, params = {} },
|
|
10
10
|
{ request_error_function, response_function, response_error_function, timeout } = {},
|
|
@@ -50,11 +50,11 @@ export async function viewer_call(
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
if (timeout !== undefined && timeout > 0) {
|
|
53
|
-
return
|
|
53
|
+
return pTimeout(performCall(), {
|
|
54
54
|
milliseconds: timeout,
|
|
55
55
|
message: `${schema.$id}: Timed out after ${timeout}ms`,
|
|
56
56
|
});
|
|
57
57
|
}
|
|
58
58
|
|
|
59
|
-
return
|
|
59
|
+
return performCall();
|
|
60
60
|
}
|
package/nuxt.config.js
CHANGED
|
@@ -5,7 +5,6 @@ import path from "node:path";
|
|
|
5
5
|
import package_json from "./package.json";
|
|
6
6
|
|
|
7
7
|
const __dirname = import.meta.dirname;
|
|
8
|
-
const oneMinute = 60_000;
|
|
9
8
|
|
|
10
9
|
export default defineNuxtConfig({
|
|
11
10
|
runtimeConfig: {
|
|
@@ -38,12 +37,6 @@ export default defineNuxtConfig({
|
|
|
38
37
|
transpile: ["vuetify"],
|
|
39
38
|
},
|
|
40
39
|
|
|
41
|
-
nitro: {
|
|
42
|
-
routeRules: {
|
|
43
|
-
"/api/**": { timeout: oneMinute },
|
|
44
|
-
},
|
|
45
|
-
},
|
|
46
|
-
|
|
47
40
|
vuetify: {
|
|
48
41
|
vuetifyOptions: {
|
|
49
42
|
defaults: {
|
package/package.json
CHANGED