@geode/opengeodeweb-front 10.35.0-rc.6 → 10.36.0-rc.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/.build/opengeodeweb_front_schemas.js +200 -21
- package/.build/server/utils/typed_handler.js +63 -0
- package/.build/shared/utils/validate_schema.js +2 -1
- package/app/components/CrsSelector.vue +5 -5
- package/app/components/ExtensionSelector.vue +6 -12
- package/app/components/FileSelector.vue +2 -4
- package/app/components/MissingFilesSelector.vue +1 -1
- package/app/components/ObjectSelector.vue +1 -1
- package/app/components/ThresholdFilter.vue +1 -1
- package/app/components/Viewer/Generic/Model/BlocksOptions.vue +1 -1
- package/app/components/Viewer/Generic/Model/CornersOptions.vue +1 -1
- package/app/components/Viewer/Generic/Model/LinesOptions.vue +1 -1
- package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +1 -1
- package/app/components/Viewer/Options/ColoringTypeSelector.vue +1 -1
- package/app/components/Viewer/Options/TextureItem.vue +5 -7
- package/app/composables/global_attribute_style.ts +1 -1
- package/app/composables/project_manager.ts +1 -1
- package/app/stores/app.ts +19 -17
- package/app/stores/back.ts +27 -21
- package/app/stores/cloud.ts +1 -1
- package/app/stores/infra.ts +1 -1
- package/app/stores/viewer.ts +4 -6
- package/app/utils/extension.ts +4 -4
- package/app/utils/import_workflow.ts +1 -1
- package/internal/utils/api_fetch.ts +9 -8
- package/opengeodeweb_front_schemas.json +252 -19
- package/opengeodeweb_front_typed_schemas.d.ts +225 -0
- package/opengeodeweb_front_typed_schemas.js +4 -0
- package/package.json +4 -2
- package/server/api/cloud/extensions/run.post.ts +9 -21
- package/server/api/cloud/extensions/schemas/run.json +42 -3
- package/server/api/local/app/kill.post.ts +4 -2
- package/server/api/local/app/project_folder_path.post.ts +6 -22
- package/server/api/local/app/run_back.post.ts +8 -23
- package/server/api/local/app/run_viewer.post.ts +8 -23
- package/server/api/local/app/schemas/kill.json +7 -1
- package/server/api/local/app/schemas/project_folder_path.json +19 -2
- package/server/api/local/app/schemas/run_back.json +31 -4
- package/server/api/local/app/schemas/run_viewer.json +31 -4
- package/server/api/local/extensions/kill.post.ts +8 -23
- package/server/api/local/extensions/run.post.ts +8 -22
- package/server/api/local/extensions/schemas/kill.json +20 -4
- package/server/api/local/extensions/schemas/run.json +42 -3
- package/server/api/local/extensions/schemas/upload.json +11 -1
- package/server/api/local/extensions/upload.put.ts +37 -29
- package/server/api/microservice/app/get_is_app_ready.get.ts +7 -13
- package/server/api/microservice/app/schemas/get_is_app_ready.json +14 -1
- package/server/api/microservice/app/schemas/set_app_base_url.json +17 -2
- package/server/api/microservice/app/schemas/set_back_base_url.json +17 -2
- package/server/api/microservice/app/schemas/set_is_app_ready.json +17 -2
- package/server/api/microservice/app/schemas/set_viewer_base_url.json +17 -2
- package/server/api/microservice/app/set_app_base_url.post.ts +8 -17
- package/server/api/microservice/app/set_back_base_url.post.ts +8 -16
- package/server/api/microservice/app/set_is_app_ready.post.ts +8 -17
- package/server/api/microservice/app/set_viewer_base_url.post.ts +8 -16
- package/server/api/microservice/extensions/download.post.ts +8 -21
- package/server/api/microservice/extensions/schemas/download.json +21 -4
- package/server/utils/typed_handler.ts +114 -0
- package/shared/utils/types.ts +18 -3
- package/shared/utils/validate_schema.ts +1 -1
|
@@ -10,7 +10,36 @@ var api = {
|
|
|
10
10
|
"projectName": { "type": "string" }
|
|
11
11
|
},
|
|
12
12
|
"required": ["projectFolderPath", "projectName"],
|
|
13
|
-
"additionalProperties": false
|
|
13
|
+
"additionalProperties": false,
|
|
14
|
+
"response": {
|
|
15
|
+
"type": "object",
|
|
16
|
+
"properties": {
|
|
17
|
+
"statusCode": { "type": "integer" },
|
|
18
|
+
"extensionsArray": {
|
|
19
|
+
"type": "array",
|
|
20
|
+
"items": {
|
|
21
|
+
"type": "object",
|
|
22
|
+
"properties": {
|
|
23
|
+
"id": { "type": "string" },
|
|
24
|
+
"name": { "type": "string" },
|
|
25
|
+
"version": { "type": "string" },
|
|
26
|
+
"frontendContent": { "type": "string" },
|
|
27
|
+
"port": { "type": "integer" }
|
|
28
|
+
},
|
|
29
|
+
"required": [
|
|
30
|
+
"id",
|
|
31
|
+
"name",
|
|
32
|
+
"version",
|
|
33
|
+
"frontendContent",
|
|
34
|
+
"port"
|
|
35
|
+
],
|
|
36
|
+
"additionalProperties": false
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
},
|
|
40
|
+
"required": ["statusCode", "extensionsArray"],
|
|
41
|
+
"additionalProperties": false
|
|
42
|
+
}
|
|
14
43
|
} } },
|
|
15
44
|
"local": {
|
|
16
45
|
"app": {
|
|
@@ -21,10 +50,29 @@ var api = {
|
|
|
21
50
|
"type": "object",
|
|
22
51
|
"properties": {
|
|
23
52
|
"COMMAND_VIEWER": { "type": "string" },
|
|
24
|
-
"NUXT_ROOT_PATH": { "type": "string" }
|
|
53
|
+
"NUXT_ROOT_PATH": { "type": "string" },
|
|
54
|
+
"args": {
|
|
55
|
+
"type": "object",
|
|
56
|
+
"properties": { "projectFolderPath": { "type": "string" } },
|
|
57
|
+
"required": ["projectFolderPath"],
|
|
58
|
+
"additionalProperties": true
|
|
59
|
+
}
|
|
25
60
|
},
|
|
26
|
-
"required": [
|
|
27
|
-
|
|
61
|
+
"required": [
|
|
62
|
+
"COMMAND_VIEWER",
|
|
63
|
+
"NUXT_ROOT_PATH",
|
|
64
|
+
"args"
|
|
65
|
+
],
|
|
66
|
+
"additionalProperties": true,
|
|
67
|
+
"response": {
|
|
68
|
+
"type": "object",
|
|
69
|
+
"properties": {
|
|
70
|
+
"statusCode": { "type": "integer" },
|
|
71
|
+
"port": { "type": "integer" }
|
|
72
|
+
},
|
|
73
|
+
"required": ["statusCode", "port"],
|
|
74
|
+
"additionalProperties": false
|
|
75
|
+
}
|
|
28
76
|
},
|
|
29
77
|
"run_back": {
|
|
30
78
|
"$id": "api/local/app/run_back",
|
|
@@ -33,10 +81,29 @@ var api = {
|
|
|
33
81
|
"type": "object",
|
|
34
82
|
"properties": {
|
|
35
83
|
"COMMAND_BACK": { "type": "string" },
|
|
36
|
-
"NUXT_ROOT_PATH": { "type": "string" }
|
|
84
|
+
"NUXT_ROOT_PATH": { "type": "string" },
|
|
85
|
+
"args": {
|
|
86
|
+
"type": "object",
|
|
87
|
+
"properties": { "projectFolderPath": { "type": "string" } },
|
|
88
|
+
"required": ["projectFolderPath"],
|
|
89
|
+
"additionalProperties": true
|
|
90
|
+
}
|
|
37
91
|
},
|
|
38
|
-
"required": [
|
|
39
|
-
|
|
92
|
+
"required": [
|
|
93
|
+
"COMMAND_BACK",
|
|
94
|
+
"NUXT_ROOT_PATH",
|
|
95
|
+
"args"
|
|
96
|
+
],
|
|
97
|
+
"additionalProperties": true,
|
|
98
|
+
"response": {
|
|
99
|
+
"type": "object",
|
|
100
|
+
"properties": {
|
|
101
|
+
"statusCode": { "type": "integer" },
|
|
102
|
+
"port": { "type": "integer" }
|
|
103
|
+
},
|
|
104
|
+
"required": ["statusCode", "port"],
|
|
105
|
+
"additionalProperties": false
|
|
106
|
+
}
|
|
40
107
|
},
|
|
41
108
|
"project_folder_path": {
|
|
42
109
|
"$id": "api/local/app/project_folder_path",
|
|
@@ -45,7 +112,16 @@ var api = {
|
|
|
45
112
|
"type": "object",
|
|
46
113
|
"properties": { "PROJECT": { "type": "string" } },
|
|
47
114
|
"required": ["PROJECT"],
|
|
48
|
-
"additionalProperties": true
|
|
115
|
+
"additionalProperties": true,
|
|
116
|
+
"response": {
|
|
117
|
+
"type": "object",
|
|
118
|
+
"properties": {
|
|
119
|
+
"statusCode": { "type": "integer" },
|
|
120
|
+
"projectFolderPath": { "type": "string" }
|
|
121
|
+
},
|
|
122
|
+
"required": ["statusCode", "projectFolderPath"],
|
|
123
|
+
"additionalProperties": false
|
|
124
|
+
}
|
|
49
125
|
},
|
|
50
126
|
"kill": {
|
|
51
127
|
"$id": "api/local/app/kill",
|
|
@@ -54,7 +130,13 @@ var api = {
|
|
|
54
130
|
"type": "object",
|
|
55
131
|
"properties": {},
|
|
56
132
|
"required": [],
|
|
57
|
-
"additionalProperties": false
|
|
133
|
+
"additionalProperties": false,
|
|
134
|
+
"response": {
|
|
135
|
+
"type": "object",
|
|
136
|
+
"properties": {},
|
|
137
|
+
"required": [],
|
|
138
|
+
"additionalProperties": false
|
|
139
|
+
}
|
|
58
140
|
}
|
|
59
141
|
},
|
|
60
142
|
"extensions": {
|
|
@@ -67,7 +149,13 @@ var api = {
|
|
|
67
149
|
"type": "string",
|
|
68
150
|
"minLength": 1
|
|
69
151
|
} },
|
|
70
|
-
"additionalProperties": false
|
|
152
|
+
"additionalProperties": false,
|
|
153
|
+
"response": {
|
|
154
|
+
"type": "object",
|
|
155
|
+
"properties": { "statusCode": { "type": "integer" } },
|
|
156
|
+
"required": ["statusCode"],
|
|
157
|
+
"additionalProperties": false
|
|
158
|
+
}
|
|
71
159
|
},
|
|
72
160
|
"run": {
|
|
73
161
|
"$id": "api/local/extensions/run",
|
|
@@ -79,7 +167,36 @@ var api = {
|
|
|
79
167
|
"projectName": { "type": "string" }
|
|
80
168
|
},
|
|
81
169
|
"required": ["projectFolderPath", "projectName"],
|
|
82
|
-
"additionalProperties": false
|
|
170
|
+
"additionalProperties": false,
|
|
171
|
+
"response": {
|
|
172
|
+
"type": "object",
|
|
173
|
+
"properties": {
|
|
174
|
+
"statusCode": { "type": "integer" },
|
|
175
|
+
"extensionsArray": {
|
|
176
|
+
"type": "array",
|
|
177
|
+
"items": {
|
|
178
|
+
"type": "object",
|
|
179
|
+
"properties": {
|
|
180
|
+
"id": { "type": "string" },
|
|
181
|
+
"name": { "type": "string" },
|
|
182
|
+
"version": { "type": "string" },
|
|
183
|
+
"frontendContent": { "type": "string" },
|
|
184
|
+
"port": { "type": "integer" }
|
|
185
|
+
},
|
|
186
|
+
"required": [
|
|
187
|
+
"id",
|
|
188
|
+
"name",
|
|
189
|
+
"version",
|
|
190
|
+
"frontendContent",
|
|
191
|
+
"port"
|
|
192
|
+
],
|
|
193
|
+
"additionalProperties": false
|
|
194
|
+
}
|
|
195
|
+
}
|
|
196
|
+
},
|
|
197
|
+
"required": ["statusCode", "extensionsArray"],
|
|
198
|
+
"additionalProperties": false
|
|
199
|
+
}
|
|
83
200
|
},
|
|
84
201
|
"kill": {
|
|
85
202
|
"$id": "api/local/extensions/kill",
|
|
@@ -96,7 +213,13 @@ var api = {
|
|
|
96
213
|
"projectFolderPath",
|
|
97
214
|
"projectName"
|
|
98
215
|
],
|
|
99
|
-
"additionalProperties": false
|
|
216
|
+
"additionalProperties": false,
|
|
217
|
+
"response": {
|
|
218
|
+
"type": "object",
|
|
219
|
+
"properties": { "statusCode": { "type": "integer" } },
|
|
220
|
+
"required": ["statusCode"],
|
|
221
|
+
"additionalProperties": false
|
|
222
|
+
}
|
|
100
223
|
}
|
|
101
224
|
}
|
|
102
225
|
},
|
|
@@ -109,7 +232,16 @@ var api = {
|
|
|
109
232
|
"type": "object",
|
|
110
233
|
"properties": { "baseUrl": { "type": "string" } },
|
|
111
234
|
"required": ["baseUrl"],
|
|
112
|
-
"additionalProperties": false
|
|
235
|
+
"additionalProperties": false,
|
|
236
|
+
"response": {
|
|
237
|
+
"type": "object",
|
|
238
|
+
"properties": {
|
|
239
|
+
"statusCode": { "type": "integer" },
|
|
240
|
+
"baseUrl": { "type": "string" }
|
|
241
|
+
},
|
|
242
|
+
"required": ["statusCode", "baseUrl"],
|
|
243
|
+
"additionalProperties": false
|
|
244
|
+
}
|
|
113
245
|
},
|
|
114
246
|
"set_is_app_ready": {
|
|
115
247
|
"$id": "api/microservice/app/set_is_app_ready",
|
|
@@ -118,7 +250,16 @@ var api = {
|
|
|
118
250
|
"type": "object",
|
|
119
251
|
"properties": { "isReady": { "type": "boolean" } },
|
|
120
252
|
"required": ["isReady"],
|
|
121
|
-
"additionalProperties": false
|
|
253
|
+
"additionalProperties": false,
|
|
254
|
+
"response": {
|
|
255
|
+
"type": "object",
|
|
256
|
+
"properties": {
|
|
257
|
+
"statusCode": { "type": "integer" },
|
|
258
|
+
"isReady": { "type": "boolean" }
|
|
259
|
+
},
|
|
260
|
+
"required": ["statusCode", "isReady"],
|
|
261
|
+
"additionalProperties": false
|
|
262
|
+
}
|
|
122
263
|
},
|
|
123
264
|
"set_back_base_url": {
|
|
124
265
|
"$id": "api/microservice/app/set_back_base_url",
|
|
@@ -127,7 +268,16 @@ var api = {
|
|
|
127
268
|
"type": "object",
|
|
128
269
|
"properties": { "baseUrl": { "type": "string" } },
|
|
129
270
|
"required": ["baseUrl"],
|
|
130
|
-
"additionalProperties": false
|
|
271
|
+
"additionalProperties": false,
|
|
272
|
+
"response": {
|
|
273
|
+
"type": "object",
|
|
274
|
+
"properties": {
|
|
275
|
+
"statusCode": { "type": "integer" },
|
|
276
|
+
"baseUrl": { "type": "string" }
|
|
277
|
+
},
|
|
278
|
+
"required": ["statusCode", "baseUrl"],
|
|
279
|
+
"additionalProperties": false
|
|
280
|
+
}
|
|
131
281
|
},
|
|
132
282
|
"set_app_base_url": {
|
|
133
283
|
"$id": "api/microservice/app/set_app_base_url",
|
|
@@ -136,7 +286,16 @@ var api = {
|
|
|
136
286
|
"type": "object",
|
|
137
287
|
"properties": { "baseUrl": { "type": "string" } },
|
|
138
288
|
"required": ["baseUrl"],
|
|
139
|
-
"additionalProperties": false
|
|
289
|
+
"additionalProperties": false,
|
|
290
|
+
"response": {
|
|
291
|
+
"type": "object",
|
|
292
|
+
"properties": {
|
|
293
|
+
"statusCode": { "type": "integer" },
|
|
294
|
+
"baseUrl": { "type": "string" }
|
|
295
|
+
},
|
|
296
|
+
"required": ["statusCode", "baseUrl"],
|
|
297
|
+
"additionalProperties": false
|
|
298
|
+
}
|
|
140
299
|
},
|
|
141
300
|
"get_is_app_ready": {
|
|
142
301
|
"$id": "api/microservice/app/get_is_app_ready",
|
|
@@ -145,7 +304,16 @@ var api = {
|
|
|
145
304
|
"type": "object",
|
|
146
305
|
"properties": {},
|
|
147
306
|
"required": [],
|
|
148
|
-
"additionalProperties": false
|
|
307
|
+
"additionalProperties": false,
|
|
308
|
+
"response": {
|
|
309
|
+
"type": "object",
|
|
310
|
+
"properties": {
|
|
311
|
+
"statusCode": { "type": "integer" },
|
|
312
|
+
"isReady": { "type": "boolean" }
|
|
313
|
+
},
|
|
314
|
+
"required": ["statusCode", "isReady"],
|
|
315
|
+
"additionalProperties": false
|
|
316
|
+
}
|
|
149
317
|
}
|
|
150
318
|
},
|
|
151
319
|
"extensions": { "download": {
|
|
@@ -154,11 +322,22 @@ var api = {
|
|
|
154
322
|
"methods": ["POST"],
|
|
155
323
|
"type": "object",
|
|
156
324
|
"properties": {
|
|
157
|
-
"
|
|
158
|
-
"
|
|
325
|
+
"projectName": { "type": "string" },
|
|
326
|
+
"url": { "type": "string" },
|
|
327
|
+
"extensionFileName": { "type": "string" }
|
|
159
328
|
},
|
|
160
|
-
"required": [
|
|
161
|
-
|
|
329
|
+
"required": [
|
|
330
|
+
"projectName",
|
|
331
|
+
"url",
|
|
332
|
+
"extensionFileName"
|
|
333
|
+
],
|
|
334
|
+
"additionalProperties": false,
|
|
335
|
+
"response": {
|
|
336
|
+
"type": "object",
|
|
337
|
+
"properties": { "statusCode": { "type": "integer" } },
|
|
338
|
+
"required": ["statusCode"],
|
|
339
|
+
"additionalProperties": false
|
|
340
|
+
}
|
|
162
341
|
} }
|
|
163
342
|
}
|
|
164
343
|
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { validateSchema } from "../../shared/utils/validate_schema.js";
|
|
2
|
+
import { consola } from "consola";
|
|
3
|
+
import Ajv from "ajv";
|
|
4
|
+
import { createError, defineEventHandler, getQuery, isError, readBody, setResponseStatus } from "h3";
|
|
5
|
+
//#region server/utils/typed_handler.ts
|
|
6
|
+
const BAD_REQUEST = 400;
|
|
7
|
+
const INTERNAL_SERVER_ERROR = 500;
|
|
8
|
+
function toErrorResponse(error) {
|
|
9
|
+
if (isError(error)) return {
|
|
10
|
+
code: error.statusCode,
|
|
11
|
+
name: error.statusMessage ?? "Error",
|
|
12
|
+
description: error.message
|
|
13
|
+
};
|
|
14
|
+
return {
|
|
15
|
+
code: INTERNAL_SERVER_ERROR,
|
|
16
|
+
name: "Internal Server Error",
|
|
17
|
+
description: error instanceof Error ? error.message : String(error)
|
|
18
|
+
};
|
|
19
|
+
}
|
|
20
|
+
function sendError(event, schema, error) {
|
|
21
|
+
consola.error(`[${schema.$id}]`, error);
|
|
22
|
+
const errorResponse = toErrorResponse(error);
|
|
23
|
+
setResponseStatus(event, errorResponse.code, errorResponse.name);
|
|
24
|
+
return errorResponse;
|
|
25
|
+
}
|
|
26
|
+
async function readParams(event) {
|
|
27
|
+
if (event.method === "GET" || event.method === "HEAD") return getQuery(event);
|
|
28
|
+
return await readBody(event) ?? {};
|
|
29
|
+
}
|
|
30
|
+
function checkResponse(schema, payload) {
|
|
31
|
+
if (process.env.NODE_ENV === "production" || schema.response === void 0) return;
|
|
32
|
+
const ajv = new Ajv();
|
|
33
|
+
if (!ajv.validate(schema.response, payload)) throw new Error(`${schema.$id} response does not match its schema: ${ajv.errorsText()}`);
|
|
34
|
+
}
|
|
35
|
+
function defineTypedEventHandler(schema, handler) {
|
|
36
|
+
return defineEventHandler(async (event) => {
|
|
37
|
+
try {
|
|
38
|
+
const params = await readParams(event);
|
|
39
|
+
const { valid, error } = validateSchema(schema, params);
|
|
40
|
+
if (!valid) throw createError({
|
|
41
|
+
statusCode: BAD_REQUEST,
|
|
42
|
+
statusMessage: "Bad Request",
|
|
43
|
+
message: error
|
|
44
|
+
});
|
|
45
|
+
const response = await handler(params, event);
|
|
46
|
+
checkResponse(schema, response);
|
|
47
|
+
return response;
|
|
48
|
+
} catch (error) {
|
|
49
|
+
return sendError(event, schema, error);
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
}
|
|
53
|
+
function defineRawEventHandler(schema, handler) {
|
|
54
|
+
return defineEventHandler(async (event) => {
|
|
55
|
+
try {
|
|
56
|
+
return await handler(event);
|
|
57
|
+
} catch (error) {
|
|
58
|
+
return sendError(event, schema, error);
|
|
59
|
+
}
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
//#endregion
|
|
63
|
+
export { defineRawEventHandler, defineTypedEventHandler };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import schemas from "@geode/opengeodeweb-back/
|
|
2
|
+
import schemas, { type CRSList } from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
3
3
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
4
4
|
|
|
5
5
|
const schema = schemas.opengeodeweb_back.geographic_coordinate_systems;
|
|
@@ -21,14 +21,14 @@ const { geodeObjectType, keyToUpdate } = defineProps<Props>();
|
|
|
21
21
|
|
|
22
22
|
const search = ref<string>("");
|
|
23
23
|
const data_table_loading = ref<boolean>(false);
|
|
24
|
-
const crs_list = ref<
|
|
24
|
+
const crs_list = ref<CRSList[]>([]);
|
|
25
25
|
const selected_crs = ref<unknown[]>([]);
|
|
26
26
|
const toggle_loading = useToggle(data_table_loading);
|
|
27
27
|
const backStore = useBackStore();
|
|
28
28
|
|
|
29
29
|
function get_selected_crs(crs_code: unknown): unknown {
|
|
30
30
|
for (const crs of crs_list.value) {
|
|
31
|
-
if (crs
|
|
31
|
+
if (crs.code === crs_code) {
|
|
32
32
|
return crs;
|
|
33
33
|
}
|
|
34
34
|
}
|
|
@@ -49,8 +49,8 @@ async function get_crs_table(): void {
|
|
|
49
49
|
await backStore.request(
|
|
50
50
|
{ schema, params },
|
|
51
51
|
{
|
|
52
|
-
response_function: (response
|
|
53
|
-
crs_list.value =
|
|
52
|
+
response_function: (response) => {
|
|
53
|
+
crs_list.value = response.crs_list;
|
|
54
54
|
},
|
|
55
55
|
},
|
|
56
56
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import schemas from "@geode/opengeodeweb-back/
|
|
2
|
+
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
3
3
|
|
|
4
4
|
import FetchingData from "@ogw_front/components/FetchingData.vue";
|
|
5
5
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
@@ -28,15 +28,11 @@ async function get_output_file_extensions(): Promise<void> {
|
|
|
28
28
|
toggle_loading();
|
|
29
29
|
geode_objects_and_output_extensions.value = {};
|
|
30
30
|
const backStore = useBackStore();
|
|
31
|
-
const values: Record<string,
|
|
32
|
-
filenames.map(async (filename): Promise<Record<string,
|
|
31
|
+
const values: Record<string, Record<string, boolean>>[] = await Promise.all(
|
|
32
|
+
filenames.map(async (filename): Promise<Record<string, Record<string, boolean>>> => {
|
|
33
33
|
const params = { geode_object_type: geodeObjectType, filename };
|
|
34
34
|
const response = await backStore.request({ schema, params });
|
|
35
|
-
return
|
|
36
|
-
response as {
|
|
37
|
-
geode_objects_and_output_extensions: Record<string, OutputExtensions>;
|
|
38
|
-
}
|
|
39
|
-
).geode_objects_and_output_extensions;
|
|
35
|
+
return response.geode_objects_and_output_extensions;
|
|
40
36
|
}),
|
|
41
37
|
);
|
|
42
38
|
const all_keys = [...new Set(values.flatMap((value) => Object.keys(value)))];
|
|
@@ -49,10 +45,8 @@ async function get_output_file_extensions(): Promise<void> {
|
|
|
49
45
|
if (!extensions) {
|
|
50
46
|
continue;
|
|
51
47
|
}
|
|
52
|
-
for (const extension of Object.
|
|
53
|
-
final_object[key][extension] = {
|
|
54
|
-
is_saveable: extensions[extension].is_saveable,
|
|
55
|
-
};
|
|
48
|
+
for (const [extension, is_saveable] of Object.entries(extensions)) {
|
|
49
|
+
final_object[key][extension] = { is_saveable };
|
|
56
50
|
}
|
|
57
51
|
}
|
|
58
52
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import schemas from "@geode/opengeodeweb-back/
|
|
2
|
+
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
3
3
|
|
|
4
4
|
import FetchingData from "@ogw_front/components/FetchingData.vue";
|
|
5
5
|
import FileUploader from "@ogw_front/components/FileUploader.vue";
|
|
@@ -55,9 +55,7 @@ function files_uploaded_event(value: unknown[]): void {
|
|
|
55
55
|
async function get_allowed_files(): Promise<void> {
|
|
56
56
|
toggle_loading();
|
|
57
57
|
const backStore = useBackStore();
|
|
58
|
-
const response =
|
|
59
|
-
extensions: string[];
|
|
60
|
-
};
|
|
58
|
+
const response = await backStore.request({ schema });
|
|
61
59
|
accept.value = response.extensions.map((extension) => `.${extension}`).join(",");
|
|
62
60
|
toggle_loading();
|
|
63
61
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
|
-
import schemas from "@geode/opengeodeweb-back/
|
|
2
|
+
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
3
3
|
|
|
4
4
|
import FetchingData from "@ogw_front/components/FetchingData.vue";
|
|
5
5
|
import FileUploader from "@ogw_front/components/FileUploader.vue";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import FetchingData from "@ogw_front/components/FetchingData.vue";
|
|
3
3
|
import { geode_objects } from "@ogw_front/assets/geode_objects";
|
|
4
4
|
import { resolveAllowedObjects } from "@ogw_shared/utils/response_handlers/load.js";
|
|
5
|
-
import schemas from "@geode/opengeodeweb-back/
|
|
5
|
+
import schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
6
6
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
7
7
|
|
|
8
8
|
// Mirrors the (unexported) shape produced by shared/utils/response_handlers/load.ts.
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
import type { JsonRpcSchema } from "@ogw_shared/utils/types.js";
|
|
8
8
|
import ToolPanel from "@ogw_front/components/ToolPanel.vue";
|
|
9
9
|
import ViewerOptionsAttributeRangeSelector from "@ogw_front/components/Viewer/Options/AttributeRangeSelector.vue";
|
|
10
|
-
import back_schemas from "@geode/opengeodeweb-back/
|
|
10
|
+
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
11
11
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
12
12
|
import { useDataStore } from "@ogw_front/stores/data";
|
|
13
13
|
import { useDebounceFn } from "@vueuse/core";
|
|
@@ -4,7 +4,7 @@ import OptionsSection from "@ogw_front/components/Viewer/Options/OptionsSection.
|
|
|
4
4
|
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
5
5
|
import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
|
|
6
6
|
import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
|
|
7
|
-
import back_schemas from "@geode/opengeodeweb-back/
|
|
7
|
+
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
8
8
|
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
9
9
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ import OptionsSection from "@ogw_front/components/Viewer/Options/OptionsSection.
|
|
|
4
4
|
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
5
5
|
import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
|
|
6
6
|
import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
|
|
7
|
-
import back_schemas from "@geode/opengeodeweb-back/
|
|
7
|
+
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
8
8
|
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
9
9
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ import OptionsSection from "@ogw_front/components/Viewer/Options/OptionsSection.
|
|
|
4
4
|
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
5
5
|
import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
|
|
6
6
|
import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
|
|
7
|
-
import back_schemas from "@geode/opengeodeweb-back/
|
|
7
|
+
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
8
8
|
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
9
9
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ import OptionsSection from "@ogw_front/components/Viewer/Options/OptionsSection.
|
|
|
4
4
|
import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
5
5
|
import ViewerOptionsColoringTypeSelector from "@ogw_front/components/Viewer/Options/ColoringTypeSelector.vue";
|
|
6
6
|
import VisibilitySwitch from "@ogw_front/components/Viewer/Options/VisibilitySwitch.vue";
|
|
7
|
-
import back_schemas from "@geode/opengeodeweb-back/
|
|
7
|
+
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
8
8
|
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
9
9
|
import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
|
|
10
10
|
|
|
@@ -4,7 +4,7 @@ import type { RGBAColor } from "@ogw_front/utils/default_styles/constants";
|
|
|
4
4
|
import ViewerOptionsAttributeSelector from "@ogw_front/components/Viewer/Options/AttributeSelector.vue";
|
|
5
5
|
import ViewerOptionsColorPicker from "@ogw_front/components/Viewer/Options/ColorPicker.vue";
|
|
6
6
|
import ViewerOptionsTexturesSelector from "@ogw_front/components/Viewer/Options/TexturesSelector.vue";
|
|
7
|
-
import back_schemas from "@geode/opengeodeweb-back/
|
|
7
|
+
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
8
8
|
|
|
9
9
|
interface Texture {
|
|
10
10
|
id: string;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
<script setup lang="ts">
|
|
2
2
|
import FileUploader from "@ogw_front/components/FileUploader.vue";
|
|
3
|
-
import back_schemas from "@geode/opengeodeweb-back/
|
|
3
|
+
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
4
4
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
5
5
|
|
|
6
6
|
// Mirrors FileUploader's own (unexported) UploadFile type.
|
|
@@ -46,10 +46,8 @@ function getTextureCoordinates(): void {
|
|
|
46
46
|
backStore.request(
|
|
47
47
|
{ schema, params },
|
|
48
48
|
{
|
|
49
|
-
response_function: (response
|
|
50
|
-
textureCoordinates.value =
|
|
51
|
-
response as { texture_coordinates: string[] }
|
|
52
|
-
).texture_coordinates;
|
|
49
|
+
response_function: (response) => {
|
|
50
|
+
textureCoordinates.value = response.texture_coordinates;
|
|
53
51
|
},
|
|
54
52
|
},
|
|
55
53
|
);
|
|
@@ -69,8 +67,8 @@ async function files_uploaded_event(value: UploadFile[]): Promise<void> {
|
|
|
69
67
|
await backStore.request(
|
|
70
68
|
{ schema, params },
|
|
71
69
|
{
|
|
72
|
-
response_function: (response
|
|
73
|
-
textureId.value =
|
|
70
|
+
response_function: (response) => {
|
|
71
|
+
textureId.value = response.id;
|
|
74
72
|
},
|
|
75
73
|
},
|
|
76
74
|
);
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { JsonRpcSchema } from "@ogw_shared/utils/types";
|
|
2
|
-
import back_schemas from "@geode/opengeodeweb-back/
|
|
2
|
+
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
3
3
|
import { getAttributeRange } from "@ogw_front/utils/attributes";
|
|
4
4
|
import { useBackStore } from "@ogw_front/stores/back";
|
|
5
5
|
import { useDataStyleStore } from "@ogw_front/stores/data_style";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import back_schemas from "@geode/opengeodeweb-back/
|
|
1
|
+
import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_typed_schemas.js";
|
|
2
2
|
import fileDownload from "js-file-download";
|
|
3
3
|
import viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
|
|
4
4
|
|