@geode/opengeodeweb-front 10.34.0-rc.12 → 10.34.0-rc.13
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/.build/shared/utils/fetch_raw.js +6 -6
- package/app/composables/clipping_planes_widget.ts +5 -5
- package/app/composables/clipping_planes_widget_entries.ts +6 -8
- package/app/composables/global_attribute_style.ts +1 -1
- package/app/composables/hover_highlight.ts +3 -3
- package/app/composables/project_manager.ts +1 -1
- package/app/composables/responsive_middle_truncate.ts +3 -3
- package/app/composables/stepper_tree.ts +5 -5
- package/app/composables/tree_filter.ts +3 -7
- package/app/composables/tree_keyboard_nav.ts +8 -8
- package/app/composables/tree_scroll.ts +10 -10
- package/app/composables/use_adaptive_styles.ts +1 -1
- package/app/composables/use_overlapping_picker.ts +10 -13
- package/app/composables/virtual_tree.ts +6 -14
- package/app/plugins/auto_store_register.ts +1 -1
- package/app/stores/app.ts +10 -15
- package/app/stores/back.ts +3 -6
- package/app/stores/camera_manager.ts +2 -5
- package/app/stores/data.ts +16 -16
- package/app/stores/data_helpers/collections.ts +6 -14
- package/app/stores/data_helpers/mesh.ts +6 -8
- package/app/stores/data_style.ts +7 -7
- package/app/stores/hybrid_viewer.ts +1 -1
- package/app/stores/infra.ts +15 -21
- package/app/stores/menu.ts +1 -1
- package/app/stores/treeview.ts +7 -7
- package/app/stores/viewer.ts +4 -4
- package/app/utils/attributes.ts +1 -1
- package/app/utils/clipping_planes.ts +12 -17
- package/app/utils/colormap.ts +1 -1
- package/app/utils/default_styles/meshes.ts +5 -5
- package/app/utils/default_styles/models.ts +4 -4
- package/app/utils/extension.ts +6 -10
- package/app/utils/import_workflow.ts +3 -3
- package/app/utils/log.ts +4 -4
- package/internal/stores/data_style/mesh/cells/index.ts +10 -10
- package/internal/stores/data_style/mesh/edges/index.ts +10 -10
- package/internal/stores/data_style/mesh/points/common.ts +5 -6
- package/internal/stores/data_style/mesh/points/index.ts +8 -8
- package/internal/stores/data_style/mesh/polygons/index.ts +10 -10
- package/internal/stores/data_style/mesh/polyhedra/index.ts +9 -11
- package/internal/stores/data_style/state.ts +12 -15
- package/internal/stores/hybrid_viewer/brightness.ts +6 -13
- package/internal/stores/hybrid_viewer/core.ts +1 -1
- package/package.json +1 -1
- package/server/api/microservice/extensions/download.post.ts +1 -1
- package/server/utils/app_config.ts +1 -1
- package/server/utils/cleanup.ts +6 -8
- package/server/utils/microservices.ts +6 -9
- package/server/utils/scripts.ts +2 -2
- package/server/utils/ws_client.ts +5 -9
- package/shared/utils/call_raw.ts +7 -18
- package/shared/utils/call_schema.ts +5 -5
- package/shared/utils/fetch_raw.ts +18 -18
- package/shared/utils/fetch_schema.ts +4 -11
- package/shared/utils/response_handlers/load.ts +1 -1
- package/shared/utils/types.ts +3 -3
- package/shared/utils/validate_schema.ts +1 -4
|
@@ -34,11 +34,11 @@ function rawDataToString(raw: WebSocket.RawData): string {
|
|
|
34
34
|
}
|
|
35
35
|
|
|
36
36
|
interface ServerWsRpcClient {
|
|
37
|
-
call: (rpc: string, params?:
|
|
37
|
+
call: (rpc: string, params?: Record<string, unknown>) => Promise<unknown>;
|
|
38
38
|
close: () => void;
|
|
39
39
|
getConnection: () => {
|
|
40
40
|
getSession: () => {
|
|
41
|
-
call: (rpc: string, params: readonly [
|
|
41
|
+
call: (rpc: string, params: readonly [Record<string, unknown>]) => Promise<unknown>;
|
|
42
42
|
};
|
|
43
43
|
};
|
|
44
44
|
isOpen: () => boolean;
|
|
@@ -100,7 +100,7 @@ function createServerWsRpcClient(baseUrl: string): ServerWsRpcClient {
|
|
|
100
100
|
}
|
|
101
101
|
});
|
|
102
102
|
|
|
103
|
-
socket.on("error", (error:
|
|
103
|
+
socket.on("error", (error: Error) => {
|
|
104
104
|
onErrorCallback?.(error);
|
|
105
105
|
reject(error);
|
|
106
106
|
});
|
|
@@ -114,10 +114,7 @@ function createServerWsRpcClient(baseUrl: string): ServerWsRpcClient {
|
|
|
114
114
|
});
|
|
115
115
|
});
|
|
116
116
|
|
|
117
|
-
async function call(
|
|
118
|
-
rpc: string,
|
|
119
|
-
params: Readonly<Record<string, unknown>> = {},
|
|
120
|
-
): Promise<unknown> {
|
|
117
|
+
async function call(rpc: string, params: Record<string, unknown> = {}): Promise<unknown> {
|
|
121
118
|
await ready;
|
|
122
119
|
const id = uuidv4();
|
|
123
120
|
//oxlint-disable-next-line promise/avoid-new
|
|
@@ -142,8 +139,7 @@ function createServerWsRpcClient(baseUrl: string): ServerWsRpcClient {
|
|
|
142
139
|
function getConnection(): ReturnType<ServerWsRpcClient["getConnection"]> {
|
|
143
140
|
return {
|
|
144
141
|
getSession: () => ({
|
|
145
|
-
call: (rpc: string, [params]: readonly [
|
|
146
|
-
call(rpc, params),
|
|
142
|
+
call: (rpc: string, [params]: readonly [Record<string, unknown>]) => call(rpc, params),
|
|
147
143
|
}),
|
|
148
144
|
};
|
|
149
145
|
}
|
package/shared/utils/call_raw.ts
CHANGED
|
@@ -6,34 +6,27 @@ import pTimeout from "p-timeout";
|
|
|
6
6
|
import type { RequestHandlers } from "./types.js";
|
|
7
7
|
|
|
8
8
|
interface RpcSession {
|
|
9
|
-
readonly call: (
|
|
10
|
-
rpc: string,
|
|
11
|
-
params: readonly [Readonly<Record<string, unknown>>],
|
|
12
|
-
) => Promise<unknown>;
|
|
9
|
+
readonly call: (rpc: string, params: readonly [Record<string, unknown>]) => Promise<unknown>;
|
|
13
10
|
}
|
|
14
11
|
interface RpcConnection {
|
|
15
12
|
readonly getSession: () => RpcSession;
|
|
16
13
|
}
|
|
17
14
|
interface RpcClient {
|
|
18
|
-
readonly call: (rpc: string, params:
|
|
15
|
+
readonly call: (rpc: string, params: Record<string, unknown>) => Promise<unknown>;
|
|
19
16
|
readonly getConnection: () => RpcConnection;
|
|
20
17
|
}
|
|
21
18
|
|
|
22
19
|
interface CallClientOptions {
|
|
23
20
|
rpc: string;
|
|
24
|
-
params?:
|
|
25
|
-
client:
|
|
21
|
+
params?: Record<string, unknown>;
|
|
22
|
+
client: RpcClient;
|
|
26
23
|
}
|
|
27
24
|
|
|
28
25
|
interface CallRawOptions extends CallClientOptions {
|
|
29
26
|
timeout?: number;
|
|
30
27
|
}
|
|
31
28
|
|
|
32
|
-
async function callClient({
|
|
33
|
-
rpc,
|
|
34
|
-
params = {},
|
|
35
|
-
client,
|
|
36
|
-
}: Readonly<CallClientOptions>): Promise<unknown> {
|
|
29
|
+
async function callClient({ rpc, params = {}, client }: CallClientOptions): Promise<unknown> {
|
|
37
30
|
if (globalThis.window !== undefined) {
|
|
38
31
|
const response = await client.getConnection().getSession().call(rpc, [params]);
|
|
39
32
|
return response;
|
|
@@ -43,12 +36,8 @@ async function callClient({
|
|
|
43
36
|
}
|
|
44
37
|
|
|
45
38
|
async function callRaw(
|
|
46
|
-
{ rpc, params = {}, client, timeout }:
|
|
47
|
-
{
|
|
48
|
-
request_error_function,
|
|
49
|
-
response_function,
|
|
50
|
-
response_error_function,
|
|
51
|
-
}: Readonly<RequestHandlers> = {},
|
|
39
|
+
{ rpc, params = {}, client, timeout }: CallRawOptions,
|
|
40
|
+
{ request_error_function, response_function, response_error_function }: RequestHandlers = {},
|
|
52
41
|
): Promise<unknown> {
|
|
53
42
|
async function performCall(): Promise<unknown> {
|
|
54
43
|
try {
|
|
@@ -8,20 +8,20 @@ import { validateSchema } from "./validate_schema.js";
|
|
|
8
8
|
const ERROR_400 = 400;
|
|
9
9
|
|
|
10
10
|
interface CallSchemaOptions {
|
|
11
|
-
schema:
|
|
12
|
-
params?:
|
|
13
|
-
client:
|
|
11
|
+
schema: JsonRpcSchema;
|
|
12
|
+
params?: Record<string, unknown>;
|
|
13
|
+
client: RpcClient;
|
|
14
14
|
timeout?: number;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
async function callSchema(
|
|
18
|
-
{ schema, params = {}, client, timeout }:
|
|
18
|
+
{ schema, params = {}, client, timeout }: CallSchemaOptions,
|
|
19
19
|
{
|
|
20
20
|
request_error_function,
|
|
21
21
|
response_function,
|
|
22
22
|
response_error_function,
|
|
23
23
|
validation_error_function,
|
|
24
|
-
}:
|
|
24
|
+
}: RequestHandlersWithValidation = {},
|
|
25
25
|
): Promise<unknown> {
|
|
26
26
|
const { valid, error: schema_error } = validateSchema(schema, params);
|
|
27
27
|
|
|
@@ -12,14 +12,14 @@ interface FetchRawOptions {
|
|
|
12
12
|
method?: string;
|
|
13
13
|
params?: unknown;
|
|
14
14
|
baseURL?: string;
|
|
15
|
-
headers?:
|
|
15
|
+
headers?: Record<string, string>;
|
|
16
16
|
max_retry?: number;
|
|
17
17
|
timeout?: number;
|
|
18
18
|
expectEvent?: boolean;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function resolveHeaders(
|
|
22
|
-
headers:
|
|
22
|
+
headers: Record<string, string>,
|
|
23
23
|
expectEvent: boolean,
|
|
24
24
|
): Record<string, string> {
|
|
25
25
|
const resolvedHeaders: Record<string, string> = { ...headers };
|
|
@@ -39,7 +39,7 @@ interface PerformFetchOptions extends RequestHandlers {
|
|
|
39
39
|
method?: string;
|
|
40
40
|
params?: unknown;
|
|
41
41
|
baseURL?: string;
|
|
42
|
-
headers:
|
|
42
|
+
headers: Record<string, string>;
|
|
43
43
|
max_retry?: number;
|
|
44
44
|
}
|
|
45
45
|
|
|
@@ -53,29 +53,33 @@ async function performFetch({
|
|
|
53
53
|
request_error_function,
|
|
54
54
|
response_function,
|
|
55
55
|
response_error_function,
|
|
56
|
-
}:
|
|
56
|
+
}: PerformFetchOptions): Promise<unknown> {
|
|
57
57
|
const fetchResult = await $fetch<unknown>(route, {
|
|
58
58
|
baseURL,
|
|
59
59
|
method,
|
|
60
60
|
headers,
|
|
61
61
|
...(hasBody(params) ? { body: params } : {}),
|
|
62
62
|
...(max_retry === undefined ? {} : { retry: max_retry }),
|
|
63
|
-
onRequestError({ error }:
|
|
63
|
+
async onRequestError({ error }: { error: unknown }) {
|
|
64
64
|
if (request_error_function) {
|
|
65
|
-
request_error_function(error);
|
|
65
|
+
await request_error_function(error);
|
|
66
66
|
}
|
|
67
67
|
},
|
|
68
|
-
onResponse({
|
|
68
|
+
async onResponse({
|
|
69
69
|
response,
|
|
70
70
|
// oxlint-disable-next-line eslint/id-length -- mirrors the real ofetch/vitest API field name (`ok`/`fn`)
|
|
71
|
-
}:
|
|
71
|
+
}: {
|
|
72
|
+
response: { ok: boolean; _data?: unknown };
|
|
73
|
+
}) {
|
|
72
74
|
if (response.ok && response_function) {
|
|
73
|
-
|
|
75
|
+
// Ofetch awaits whatever this hook returns; without awaiting here, callers relying on
|
|
76
|
+
// An async response_function (e.g. store patches) race the resolution of this $fetch call.
|
|
77
|
+
await response_function(response._data);
|
|
74
78
|
}
|
|
75
79
|
},
|
|
76
|
-
onResponseError({ response }:
|
|
80
|
+
async onResponseError({ response }: { response: unknown }) {
|
|
77
81
|
if (response_error_function) {
|
|
78
|
-
response_error_function(response);
|
|
82
|
+
await response_error_function(response);
|
|
79
83
|
}
|
|
80
84
|
},
|
|
81
85
|
});
|
|
@@ -92,14 +96,10 @@ async function fetchRaw(
|
|
|
92
96
|
max_retry,
|
|
93
97
|
timeout,
|
|
94
98
|
expectEvent = false,
|
|
95
|
-
}:
|
|
96
|
-
{
|
|
97
|
-
request_error_function,
|
|
98
|
-
response_function,
|
|
99
|
-
response_error_function,
|
|
100
|
-
}: Readonly<RequestHandlers> = {},
|
|
99
|
+
}: FetchRawOptions,
|
|
100
|
+
{ request_error_function, response_function, response_error_function }: RequestHandlers = {},
|
|
101
101
|
): Promise<unknown> {
|
|
102
|
-
const fetchOptions:
|
|
102
|
+
const fetchOptions: PerformFetchOptions = {
|
|
103
103
|
route,
|
|
104
104
|
method,
|
|
105
105
|
params,
|
|
@@ -6,29 +6,22 @@ import { validateSchema } from "./validate_schema.js";
|
|
|
6
6
|
const ERROR_400 = 400;
|
|
7
7
|
|
|
8
8
|
interface FetchSchemaOptions {
|
|
9
|
-
schema:
|
|
9
|
+
schema: JsonRpcSchema & { methods: readonly string[] };
|
|
10
10
|
params?: unknown;
|
|
11
11
|
baseURL?: string;
|
|
12
|
-
headers?:
|
|
12
|
+
headers?: Record<string, string>;
|
|
13
13
|
timeout?: number;
|
|
14
14
|
expectEvent?: boolean;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
async function fetchSchema(
|
|
18
|
-
{
|
|
19
|
-
schema,
|
|
20
|
-
params = {},
|
|
21
|
-
baseURL,
|
|
22
|
-
headers,
|
|
23
|
-
timeout,
|
|
24
|
-
expectEvent = false,
|
|
25
|
-
}: Readonly<FetchSchemaOptions>,
|
|
18
|
+
{ schema, params = {}, baseURL, headers, timeout, expectEvent = false }: FetchSchemaOptions,
|
|
26
19
|
{
|
|
27
20
|
request_error_function,
|
|
28
21
|
response_function,
|
|
29
22
|
response_error_function,
|
|
30
23
|
validation_error_function,
|
|
31
|
-
}:
|
|
24
|
+
}: RequestHandlersWithValidation = {},
|
|
32
25
|
): Promise<unknown> {
|
|
33
26
|
const { valid, error: schema_error } = validateSchema(schema, params);
|
|
34
27
|
|
|
@@ -2,7 +2,7 @@ interface AllowedObject {
|
|
|
2
2
|
readonly is_loadable: number;
|
|
3
3
|
readonly object_priority?: number;
|
|
4
4
|
}
|
|
5
|
-
type AllowedObjectMap =
|
|
5
|
+
type AllowedObjectMap = Record<string, AllowedObject>;
|
|
6
6
|
|
|
7
7
|
function getFileExtension(filename: string): string {
|
|
8
8
|
return filename.slice(filename.lastIndexOf(".") + 1);
|
package/shared/utils/types.ts
CHANGED
|
@@ -14,14 +14,14 @@ interface ValidationError {
|
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
interface RequestHandlers {
|
|
17
|
-
readonly request_error_function?: (error: unknown) => void
|
|
17
|
+
readonly request_error_function?: (error: unknown) => void | Promise<void>;
|
|
18
18
|
// Return value is intentionally untyped: callers commonly return the Promise of a downstream call (e.g. a Dexie `.put()`, which resolves to a primary key) that this code chains/awaits but never inspects the resolved value of.
|
|
19
19
|
readonly response_function?: (response: unknown) => unknown;
|
|
20
|
-
readonly response_error_function?: (response: unknown) => void
|
|
20
|
+
readonly response_error_function?: (response: unknown) => void | Promise<void>;
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
interface RequestHandlersWithValidation extends RequestHandlers {
|
|
24
|
-
readonly validation_error_function?: (error:
|
|
24
|
+
readonly validation_error_function?: (error: ValidationError) => void;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export type { JsonRpcSchema, RequestHandlers, RequestHandlersWithValidation, ValidationError };
|
|
@@ -2,10 +2,7 @@ import Ajv from "ajv";
|
|
|
2
2
|
|
|
3
3
|
import type { JsonRpcSchema } from "./types.js";
|
|
4
4
|
|
|
5
|
-
function validateSchema(
|
|
6
|
-
schema: Readonly<JsonRpcSchema>,
|
|
7
|
-
body: unknown,
|
|
8
|
-
): { valid: boolean; error: string } {
|
|
5
|
+
function validateSchema(schema: JsonRpcSchema, body: unknown): { valid: boolean; error: string } {
|
|
9
6
|
const ajv = new Ajv();
|
|
10
7
|
const list_keywords = ["methods", "route", "max_retry", "rpc"];
|
|
11
8
|
for (const keyword of list_keywords) {
|