@geode/opengeodeweb-front 10.30.3-rc.1 → 10.31.0-rc.2

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.
Files changed (29) hide show
  1. package/app/components/ShrinkFilter.vue +172 -0
  2. package/app/components/ViewToolbar.vue +12 -0
  3. package/app/stores/app.js +4 -12
  4. package/app/stores/back.js +3 -11
  5. package/app/stores/cloud.js +3 -10
  6. package/app/stores/hybrid_viewer.js +17 -16
  7. package/app/stores/viewer.js +6 -12
  8. package/app/utils/extension.js +7 -43
  9. package/internal/stores/hybrid_viewer.js +38 -3
  10. package/opengeodeweb_front_schemas.json +230 -0
  11. package/package.json +6 -1
  12. package/server/api/cloud/extensions/schemas/run.json +11 -0
  13. package/server/api/local/app/schemas/kill.json +8 -0
  14. package/server/api/local/app/schemas/project_folder_path.json +8 -0
  15. package/server/api/local/app/schemas/run_back.json +11 -0
  16. package/server/api/local/app/schemas/run_viewer.json +11 -0
  17. package/server/api/local/extensions/schemas/kill.json +12 -0
  18. package/server/api/local/extensions/schemas/run.json +11 -0
  19. package/server/api/local/extensions/schemas/upload.json +12 -0
  20. package/server/api/microservice/app/schemas/get_is_app_ready.json +8 -0
  21. package/server/api/microservice/app/schemas/set_app_base_url.json +10 -0
  22. package/server/api/microservice/app/schemas/set_back_base_url.json +10 -0
  23. package/server/api/microservice/app/schemas/set_is_app_ready.json +10 -0
  24. package/server/api/microservice/app/schemas/set_viewer_base_url.json +10 -0
  25. package/server/api/microservice/extensions/schemas/download.json +11 -0
  26. package/server/api/serverless/run_cloud.post.js +1 -1
  27. package/server/api/serverless/schemas/run_cloud.json +10 -0
  28. package/shared/scripts.js +7 -48
  29. package/microservices.json +0 -3
@@ -0,0 +1,172 @@
1
+ <script setup>
2
+ import ToolPanel from "@ogw_front/components/ToolPanel";
3
+ import { useDataStore } from "@ogw_front/stores/data";
4
+ import { useDebounceFn } from "@vueuse/core";
5
+ import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
6
+
7
+ const DEFAULT_SHRINK_VALUE = 0.8;
8
+ const MAX_SHRINK_VALUE = 1;
9
+ const DEBOUNCE_DELAY = 100;
10
+
11
+ const show = defineModel("show", { type: Boolean, default: false });
12
+ const dataStore = useDataStore();
13
+ const hybridViewerStore = useHybridViewerStore();
14
+ const targetAllVisible = ref(true);
15
+ const selectedDatasetIds = ref([]);
16
+ const shrinkFactor = ref(DEFAULT_SHRINK_VALUE);
17
+
18
+ const allItems = dataStore.refAllItems();
19
+ const availableDatasets = computed(() =>
20
+ allItems.value.map((item) => ({ title: item.name || item.id, value: item.id })),
21
+ );
22
+
23
+ const debouncedApply = useDebounceFn(() => applyShrink(), DEBOUNCE_DELAY);
24
+
25
+ async function applyShrink() {
26
+ const allIds = allItems.value.map((item) => item.id);
27
+ if (allIds.length === 0) {
28
+ return;
29
+ }
30
+ const targetIds = targetAllVisible.value ? allIds : selectedDatasetIds.value;
31
+ const untargetedIds = allIds.filter((id) => !targetIds.includes(id));
32
+
33
+ if (targetIds.length > 0) {
34
+ await hybridViewerStore.setShrink(targetIds, Number(shrinkFactor.value));
35
+ }
36
+ if (untargetedIds.length > 0) {
37
+ await hybridViewerStore.setShrink(untargetedIds, MAX_SHRINK_VALUE);
38
+ }
39
+ }
40
+
41
+ async function resetShrink() {
42
+ shrinkFactor.value = DEFAULT_SHRINK_VALUE;
43
+ await applyShrink();
44
+ }
45
+
46
+ async function removeShrink() {
47
+ shrinkFactor.value = MAX_SHRINK_VALUE;
48
+ const allIds = allItems.value.map((item) => item.id);
49
+ if (allIds.length > 0) {
50
+ await hybridViewerStore.setShrink(allIds, MAX_SHRINK_VALUE);
51
+ }
52
+ }
53
+
54
+ watch(shrinkFactor, () => {
55
+ debouncedApply();
56
+ });
57
+
58
+ watch(show, (visible) => {
59
+ if (visible) {
60
+ applyShrink();
61
+ }
62
+ });
63
+
64
+ watch(
65
+ [targetAllVisible, selectedDatasetIds],
66
+ () => {
67
+ if (show.value) {
68
+ applyShrink();
69
+ }
70
+ },
71
+ { deep: true },
72
+ );
73
+
74
+ watch(allItems, () => {
75
+ if (show.value) {
76
+ applyShrink();
77
+ }
78
+ });
79
+
80
+ watch(
81
+ () => Object.values(hybridViewerStore.hybridDb).filter((entry) => entry && entry.actor).length,
82
+ (actorCount) => {
83
+ if (show.value && actorCount > 0) {
84
+ applyShrink();
85
+ }
86
+ },
87
+ );
88
+ </script>
89
+
90
+ <template>
91
+ <ToolPanel v-model="show" title="Shrink Filter" :width="340" :click-outside="false">
92
+ <v-card-text class="pa-3 max-panel-height overflow-y-auto overflow-x-hidden">
93
+ <v-switch
94
+ v-model="targetAllVisible"
95
+ data-testid="shrinkTargetAllVisibleSwitch"
96
+ label="Apply to all visible datasets"
97
+ color="primary"
98
+ density="compact"
99
+ hide-details
100
+ class="mb-2 text-caption"
101
+ />
102
+
103
+ <v-select
104
+ v-if="!targetAllVisible"
105
+ v-model="selectedDatasetIds"
106
+ data-testid="shrinkSelectedDatasetsSelect"
107
+ :items="availableDatasets"
108
+ label="Select datasets"
109
+ multiple
110
+ chips
111
+ closable-chips
112
+ variant="outlined"
113
+ density="compact"
114
+ hide-details
115
+ class="mb-3 text-caption"
116
+ />
117
+
118
+ <v-divider class="my-3" />
119
+
120
+ <div class="d-flex align-center justify-space-between mb-1">
121
+ <span class="text-caption font-weight-bold">Shrink Factor</span>
122
+ <span class="text-caption text-primary font-weight-bold">
123
+ {{ (shrinkFactor * 100).toFixed(0) }}% ({{ shrinkFactor.toFixed(2) }})
124
+ </span>
125
+ </div>
126
+
127
+ <v-slider
128
+ v-model="shrinkFactor"
129
+ data-testid="shrinkFactorSlider"
130
+ min="0.0"
131
+ max="1.0"
132
+ step="0.01"
133
+ color="primary"
134
+ track-color="grey-lighten-2"
135
+ density="compact"
136
+ hide-details
137
+ class="my-2 px-1"
138
+ />
139
+ </v-card-text>
140
+
141
+ <template #actions>
142
+ <v-card-actions class="justify-space-between px-3 pb-3 pt-0">
143
+ <v-btn
144
+ data-testid="removeShrinkButton"
145
+ variant="text"
146
+ size="small"
147
+ color="error"
148
+ class="text-caption text-none"
149
+ @click="removeShrink"
150
+ >
151
+ Remove Shrink
152
+ </v-btn>
153
+ <v-btn
154
+ data-testid="resetShrinkButton"
155
+ variant="tonal"
156
+ size="small"
157
+ color="secondary"
158
+ class="text-caption text-none"
159
+ @click="resetShrink"
160
+ >
161
+ Reset
162
+ </v-btn>
163
+ </v-card-actions>
164
+ </template>
165
+ </ToolPanel>
166
+ </template>
167
+
168
+ <style scoped>
169
+ .max-panel-height {
170
+ max-height: 520px;
171
+ }
172
+ </style>
@@ -5,6 +5,7 @@ import CameraManager from "@ogw_front/components/CameraManager";
5
5
  import CameraOrientation from "@ogw_front/components/CameraOrientation";
6
6
  import ClippingPlanes from "@ogw_front/components/ClippingPlanes";
7
7
  import Screenshot from "@ogw_front/components/Screenshot";
8
+ import ShrinkFilter from "@ogw_front/components/ShrinkFilter";
8
9
  import ZScaling from "@ogw_front/components/ZScaling";
9
10
  import schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
10
11
  import { useHybridViewerStore } from "@ogw_front/stores/hybrid_viewer";
@@ -17,6 +18,7 @@ const show_camera_manager = ref(false);
17
18
  const showCameraOrientation = ref(false);
18
19
  const showZScaling = ref(false);
19
20
  const showClippingPlanes = ref(false);
21
+ const showShrinkFilter = ref(false);
20
22
  const grid_scale = ref(false);
21
23
  const zScale = ref(hybridViewerStore.zScale);
22
24
 
@@ -162,6 +164,15 @@ const camera_options = computed(() => [
162
164
  showClippingPlanes.value = !showClippingPlanes.value;
163
165
  },
164
166
  },
167
+ {
168
+ testId: "shrinkFilterButton",
169
+ tooltip: "Shrink Filter",
170
+ icon: "mdi-arrow-collapse-all",
171
+ color: showShrinkFilter.value ? "primary" : undefined,
172
+ action: () => {
173
+ showShrinkFilter.value = !showShrinkFilter.value;
174
+ },
175
+ },
165
176
  ]);
166
177
  </script>
167
178
 
@@ -235,6 +246,7 @@ const camera_options = computed(() => [
235
246
  @apply="handleZScalingClose"
236
247
  />
237
248
  <ClippingPlanes v-model:show="showClippingPlanes" />
249
+ <ShrinkFilter v-model:show="showShrinkFilter" />
238
250
  </template>
239
251
 
240
252
  <style module>
package/app/stores/app.js CHANGED
@@ -6,6 +6,8 @@ import { killExtension } from "@ogw_front/utils/extension.js";
6
6
  import { upload_file } from "@ogw_internal/utils/upload_file.js";
7
7
  import { useInfraStore } from "@ogw_front/stores/infra";
8
8
 
9
+ import opengeodeweb_front_schemas from "@geode/opengeodeweb-front/opengeodeweb_front_schemas.json" with { type: "json" };
10
+
9
11
  // oxlint-disable-next-line max-lines-per-function, max-statements
10
12
  export const useAppStore = defineStore("app", () => {
11
13
  const stores = [];
@@ -227,11 +229,8 @@ export const useAppStore = defineStore("app", () => {
227
229
  }
228
230
 
229
231
  function upload(file, callbacks = {}) {
230
- const schema = {
231
- $id: "/api/local/extensions/upload",
232
- methods: ["OPTIONS", "PUT"],
233
- };
234
232
  const store = useAppStore();
233
+ const schema = opengeodeweb_front_schemas.api.local.extensions.upload;
235
234
  const { PROJECT: projectName } = useRuntimeConfig().public;
236
235
  const params = { projectName };
237
236
  return upload_file(
@@ -278,14 +277,7 @@ export const useAppStore = defineStore("app", () => {
278
277
 
279
278
  function createProjectFolder() {
280
279
  const { PROJECT } = useRuntimeConfig().public;
281
- const schema = {
282
- $id: "/api/local/app/project_folder_path",
283
- methods: ["POST"],
284
- type: "object",
285
- properties: { PROJECT: { type: "string" } },
286
- required: ["PROJECT"],
287
- additionalProperties: true,
288
- };
280
+ const schema = opengeodeweb_front_schemas.api.local.app.project_folder_path;
289
281
  const params = { PROJECT };
290
282
  return request(
291
283
  { schema, params },
@@ -7,6 +7,8 @@ import { useAppStore } from "@ogw_front/stores/app";
7
7
  import { useFeedbackStore } from "@ogw_front/stores/feedback";
8
8
  import { useInfraStore } from "@ogw_front/stores/infra";
9
9
 
10
+ import opengeodeweb_front_schemas from "@geode/opengeodeweb-front/opengeodeweb_front_schemas.json" with { type: "json" };
11
+
10
12
  const MILLISECONDS_IN_SECOND = 1000;
11
13
  const DEFAULT_PING_INTERVAL_SECONDS = 10;
12
14
 
@@ -74,17 +76,7 @@ export const useBackStore = defineStore("back", {
74
76
  console.log("[GEODE] Launching back microservice...", { args });
75
77
  const appStore = useAppStore();
76
78
  const { COMMAND_BACK, NUXT_ROOT_PATH } = useRuntimeConfig().public;
77
- const schema = {
78
- $id: "/api/local/app/run_back",
79
- methods: ["POST"],
80
- type: "object",
81
- properties: {
82
- COMMAND_BACK: { type: "string" },
83
- NUXT_ROOT_PATH: { type: "string" },
84
- },
85
- required: ["COMMAND_BACK", "NUXT_ROOT_PATH"],
86
- additionalProperties: true,
87
- };
79
+ const schema = opengeodeweb_front_schemas.api.local.app.run_back;
88
80
  const params = { COMMAND_BACK, NUXT_ROOT_PATH, args };
89
81
 
90
82
  console.log("[GEODE] params", params);
@@ -5,6 +5,8 @@ import { useAppStore } from "./app";
5
5
  import { useFeedbackStore } from "./feedback";
6
6
  import { useInfraStore } from "./infra";
7
7
 
8
+ import opengeodeweb_front_schemas from "@geode/opengeodeweb-front/opengeodeweb_front_schemas.json" with { type: "json" };
9
+
8
10
  export const useCloudStore = defineStore("cloud", {
9
11
  state: () => ({
10
12
  status: Status.NOT_CONNECTED,
@@ -13,16 +15,7 @@ export const useCloudStore = defineStore("cloud", {
13
15
  launch(email) {
14
16
  this.status = Status.CONNECTING;
15
17
  console.log("[CLOUD] Launching cloud backend...");
16
- const schema = {
17
- $id: "/api/serverless/run_cloud",
18
- methods: ["POST"],
19
- type: "object",
20
- properties: {
21
- email: { type: "string" },
22
- },
23
- required: ["email"],
24
- additionalProperties: true,
25
- };
18
+ const schema = opengeodeweb_front_schemas.api.serverless.run_cloud;
26
19
  const params = { email };
27
20
  console.log("[CLOUD] params", params);
28
21
  const appStore = useAppStore();
@@ -21,7 +21,10 @@ import {
21
21
  performClearHoverHighlight,
22
22
  performClickPicking,
23
23
  performRemoveItem,
24
+ performResize,
25
+ performSetClippingPlanes,
24
26
  performSetContainer,
27
+ performSetShrink,
25
28
  performSetVisibility,
26
29
  performSetZScaling,
27
30
  } from "@ogw_internal/stores/hybrid_viewer";
@@ -138,10 +141,11 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
138
141
  }
139
142
 
140
143
  async function setClippingPlanes(ids, planes) {
141
- const schema = viewer_schemas.opengeodeweb_viewer.viewer.clipping_planes;
142
- const params = { ids, planes };
143
- await viewerStore.request({ schema, params });
144
- await remoteRender();
144
+ await performSetClippingPlanes(ids, planes, { viewerStore, viewer_schemas, remoteRender });
145
+ }
146
+
147
+ async function setShrink(ids, shrink_factor) {
148
+ await performSetShrink(ids, shrink_factor, { viewerStore, viewer_schemas, remoteRender });
145
149
  }
146
150
 
147
151
  function resetCamera() {
@@ -266,18 +270,14 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
266
270
  }
267
271
 
268
272
  async function resize(width, height) {
269
- if (viewerStore.status !== Status.CONNECTED || status.value !== Status.CREATED) {
270
- return;
271
- }
272
- const webGLRenderWindow = genericRenderWindow.value.getApiSpecificRenderWindow();
273
- const canvas = webGLRenderWindow.getCanvas();
274
- canvas.width = width;
275
- canvas.height = height;
276
- await nextTick();
277
- webGLRenderWindow.setSize(width, height);
278
- viewStream.setSize(width, height);
279
- genericRenderWindow.value.getRenderWindow().render();
280
- remoteRender();
273
+ await performResize(width, height, {
274
+ viewerStore,
275
+ status,
276
+ Status,
277
+ genericRenderWindow: genericRenderWindow.value,
278
+ viewStream,
279
+ remoteRender,
280
+ });
281
281
  }
282
282
 
283
283
  function getAverageBrightness(rect) {
@@ -315,6 +315,7 @@ export const useHybridViewerStore = defineStore("hybridViewer", () => {
315
315
  setVisibility,
316
316
  setZScaling,
317
317
  setClippingPlanes,
318
+ setShrink,
318
319
  syncRemoteCamera,
319
320
  setCamera,
320
321
  initHybridViewer,
@@ -5,7 +5,9 @@ import _ from "lodash";
5
5
  import "@kitware/vtk.js/Rendering/OpenGL/Profiles/Geometry";
6
6
  import SmartConnect from "wslink/src/SmartConnect";
7
7
  import { connectImageStream } from "@kitware/vtk.js/Rendering/Misc/RemoteView";
8
- import schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json";
8
+
9
+ import opengeodeweb_front_schemas from "@geode/opengeodeweb-front/opengeodeweb_front_schemas.json" with { type: "json" };
10
+ import opengeodeweb_viewer_schemas from "@geode/opengeodeweb-viewer/opengeodeweb_viewer_schemas.json" with { type: "json" };
9
11
 
10
12
  // Local imports
11
13
  import {
@@ -57,7 +59,7 @@ export const useViewerStore = defineStore(
57
59
  }
58
60
 
59
61
  async function set_picked_point(x, y) {
60
- const schema = schemas.opengeodeweb_viewer.viewer.get_point_position;
62
+ const schema = opengeodeweb_viewer_schemas.opengeodeweb_viewer.viewer.get_point_position;
61
63
  const params = { x: Math.round(x), y: Math.round(y) };
62
64
  const response = await request({ schema, params });
63
65
  const { x: world_x, y: world_y, z: world_z } = response;
@@ -101,7 +103,7 @@ export const useViewerStore = defineStore(
101
103
  });
102
104
  connectImageStream(client.value.getConnection().getSession());
103
105
  client.value.endBusy();
104
- const schema = schemas.opengeodeweb_viewer.viewer.reset_visualization;
106
+ const schema = opengeodeweb_viewer_schemas.opengeodeweb_viewer.viewer.reset_visualization;
105
107
  const timeout = undefined;
106
108
  await request({ schema, timeout });
107
109
  status.value = Status.CONNECTED;
@@ -126,15 +128,7 @@ export const useViewerStore = defineStore(
126
128
  const appStore = useAppStore();
127
129
 
128
130
  const { COMMAND_VIEWER, NUXT_ROOT_PATH } = useRuntimeConfig().public;
129
- const schema = {
130
- $id: "/api/local/app/run_viewer",
131
- methods: ["POST"],
132
- type: "object",
133
- properties: { COMMAND_VIEWER: { type: "string" }, NUXT_ROOT_PATH: { type: "string" } },
134
- required: ["COMMAND_VIEWER", "NUXT_ROOT_PATH"],
135
- additionalProperties: true,
136
- };
137
-
131
+ const schema = opengeodeweb_front_schemas.api.local.app.run_viewer;
138
132
  const params = { COMMAND_VIEWER, NUXT_ROOT_PATH, args };
139
133
  console.log("[VIEWER] params", params);
140
134
 
@@ -8,6 +8,8 @@ import { isCloudMode } from "@ogw_front/utils/stores";
8
8
  import { useAppStore } from "@ogw_front/stores/app";
9
9
  import { useInfraStore } from "@ogw_front/stores/infra";
10
10
 
11
+ import opengeodeweb_front_schemas from "@geode/opengeodeweb-front/opengeodeweb_front_schemas.json" with { type: "json" };
12
+
11
13
  async function importExtensionFile(file) {
12
14
  await uploadExtension(file);
13
15
  return registerRunningExtensions();
@@ -83,21 +85,8 @@ async function uploadExtension(file) {
83
85
  function downloadExtension({ url, extensionFileName }) {
84
86
  const appStore = useAppStore();
85
87
  const { PROJECT: projectName } = useRuntimeConfig().public;
88
+ const schema = opengeodeweb_front_schemas.api.microservice.extensions.download;
86
89
  const params = { projectName, url, extensionFileName };
87
-
88
- const schema = {
89
- $id: "/api/microservice/extensions/download",
90
- methods: ["POST"],
91
- type: "object",
92
- properties: {
93
- extensionFileName: { type: "string" },
94
- projectName: { type: "string" },
95
- url: { type: "string" },
96
- },
97
- required: ["extensionFileName", "projectName", "url"],
98
- additionalProperties: false,
99
- };
100
-
101
90
  return appStore.request({ schema, params });
102
91
  }
103
92
 
@@ -105,20 +94,10 @@ function runExtensions() {
105
94
  const appStore = useAppStore();
106
95
  const { projectFolderPath } = appStore;
107
96
  const { PROJECT: projectName } = useRuntimeConfig().public;
97
+ const schema = isCloudMode()
98
+ ? opengeodeweb_front_schemas.api.cloud.extensions.run
99
+ : opengeodeweb_front_schemas.api.local.extensions.run;
108
100
  const params = { projectFolderPath, projectName };
109
- const endpoint = isCloudMode() ? "cloud" : "local";
110
- const schema = {
111
- $id: `/api/${endpoint}/extensions/run`,
112
- methods: ["POST"],
113
- type: "object",
114
- properties: {
115
- projectFolderPath: { type: "string" },
116
- projectName: { type: "string" },
117
- },
118
- required: ["projectFolderPath", "projectName"],
119
- additionalProperties: false,
120
- };
121
-
122
101
  return appStore.request({ schema, params });
123
102
  }
124
103
 
@@ -126,23 +105,8 @@ function killExtension(extensionId) {
126
105
  const appStore = useAppStore();
127
106
  const { projectFolderPath } = appStore;
128
107
  const { PROJECT: projectName } = useRuntimeConfig().public;
108
+ const schema = opengeodeweb_front_schemas.api.local.extensions.kill;
129
109
  const params = { extensionId, projectFolderPath, projectName };
130
-
131
- console.log(`[AppStore] Killing extension: ${extensionId}`, { params });
132
-
133
- const schema = {
134
- $id: "/api/local/extensions/kill",
135
- methods: ["POST"],
136
- type: "object",
137
- properties: {
138
- extensionId: { type: "string" },
139
- projectFolderPath: { type: "string" },
140
- projectName: { type: "string" },
141
- },
142
- required: ["extensionId", "projectFolderPath", "projectName"],
143
- additionalProperties: false,
144
- };
145
-
146
110
  return appStore.request({ schema, params });
147
111
  }
148
112
 
@@ -252,14 +252,49 @@ function performClear(options) {
252
252
  }
253
253
  }
254
254
 
255
+ async function performSetClippingPlanes(ids, planes, options) {
256
+ const { viewerStore, viewer_schemas, remoteRender } = options;
257
+ const schema = viewer_schemas.opengeodeweb_viewer.viewer.clipping_planes;
258
+ const params = { ids, planes };
259
+ await viewerStore.request({ schema, params });
260
+ await remoteRender();
261
+ }
262
+
263
+ async function performSetShrink(ids, shrink_factor, options) {
264
+ const { viewerStore, viewer_schemas, remoteRender } = options;
265
+ const schema = viewer_schemas.opengeodeweb_viewer.viewer.shrink;
266
+ const params = { ids, shrink_factor };
267
+ await viewerStore.request({ schema, params });
268
+ await remoteRender();
269
+ }
270
+
271
+ async function performResize(width, height, options) {
272
+ const { viewerStore, status, Status, genericRenderWindow, viewStream, remoteRender } = options;
273
+ if (viewerStore.status !== Status.CONNECTED || status.value !== Status.CREATED) {
274
+ return;
275
+ }
276
+ const webGLRenderWindow = genericRenderWindow.getApiSpecificRenderWindow();
277
+ const canvas = webGLRenderWindow.getCanvas();
278
+ canvas.width = width;
279
+ canvas.height = height;
280
+ await nextTick();
281
+ webGLRenderWindow.setSize(width, height);
282
+ viewStream.setSize(width, height);
283
+ genericRenderWindow.getRenderWindow().render();
284
+ remoteRender();
285
+ }
286
+
255
287
  export {
256
288
  performAddItem,
289
+ performClear,
257
290
  performClearHoverHighlight,
258
291
  performClickPicking,
259
292
  performHoverHighlight,
260
- performSetContainer,
261
- performSetZScaling,
262
293
  performRemoveItem,
294
+ performResize,
295
+ performSetClippingPlanes,
296
+ performSetContainer,
297
+ performSetShrink,
263
298
  performSetVisibility,
264
- performClear,
299
+ performSetZScaling,
265
300
  };
@@ -0,0 +1,230 @@
1
+ {
2
+ "api": {
3
+ "cloud": {
4
+ "extensions": {
5
+ "run": {
6
+ "$id": "api/cloud/extensions/run",
7
+ "route": "/run",
8
+ "methods": ["POST"],
9
+ "type": "object",
10
+ "properties": {
11
+ "projectFolderPath": {
12
+ "type": "string"
13
+ },
14
+ "projectName": {
15
+ "type": "string"
16
+ }
17
+ },
18
+ "required": ["projectFolderPath", "projectName"],
19
+ "additionalProperties": false
20
+ }
21
+ }
22
+ },
23
+ "local": {
24
+ "app": {
25
+ "run_viewer": {
26
+ "$id": "api/local/app/run_viewer",
27
+ "route": "/run_viewer",
28
+ "methods": ["POST"],
29
+ "type": "object",
30
+ "properties": {
31
+ "COMMAND_VIEWER": {
32
+ "type": "string"
33
+ },
34
+ "NUXT_ROOT_PATH": {
35
+ "type": "string"
36
+ }
37
+ },
38
+ "required": ["COMMAND_VIEWER", "NUXT_ROOT_PATH"],
39
+ "additionalProperties": true
40
+ },
41
+ "run_back": {
42
+ "$id": "api/local/app/run_back",
43
+ "route": "/run_back",
44
+ "methods": ["POST"],
45
+ "type": "object",
46
+ "properties": {
47
+ "COMMAND_BACK": {
48
+ "type": "string"
49
+ },
50
+ "NUXT_ROOT_PATH": {
51
+ "type": "string"
52
+ }
53
+ },
54
+ "required": ["COMMAND_BACK", "NUXT_ROOT_PATH"],
55
+ "additionalProperties": true
56
+ },
57
+ "project_folder_path": {
58
+ "$id": "api/local/app/project_folder_path",
59
+ "route": "/project_folder_path",
60
+ "methods": ["POST"],
61
+ "type": "object",
62
+ "properties": {
63
+ "PROJECT": {
64
+ "type": "string"
65
+ }
66
+ },
67
+ "required": ["PROJECT"],
68
+ "additionalProperties": true
69
+ },
70
+ "kill": {
71
+ "$id": "api/local/app/kill",
72
+ "route": "/kill",
73
+ "methods": ["POST"],
74
+ "type": "object",
75
+ "properties": {},
76
+ "required": [],
77
+ "additionalProperties": false
78
+ }
79
+ },
80
+ "extensions": {
81
+ "upload": {
82
+ "$id": "api/local/extensions/upload",
83
+ "route": "/upload",
84
+ "methods": ["OPTIONS", "PUT"],
85
+ "type": "object",
86
+ "properties": {
87
+ "filename": {
88
+ "type": "string",
89
+ "minLength": 1
90
+ }
91
+ },
92
+ "additionalProperties": false
93
+ },
94
+ "run": {
95
+ "$id": "api/local/extensions/run",
96
+ "route": "/run",
97
+ "methods": ["POST"],
98
+ "type": "object",
99
+ "properties": {
100
+ "projectFolderPath": {
101
+ "type": "string"
102
+ },
103
+ "projectName": {
104
+ "type": "string"
105
+ }
106
+ },
107
+ "required": ["projectFolderPath", "projectName"],
108
+ "additionalProperties": false
109
+ },
110
+ "kill": {
111
+ "$id": "api/local/extensions/kill",
112
+ "route": "/kill",
113
+ "methods": ["POST"],
114
+ "type": "object",
115
+ "properties": {
116
+ "extensionId": {
117
+ "type": "string"
118
+ },
119
+ "projectFolderPath": {
120
+ "type": "string"
121
+ },
122
+ "projectName": {
123
+ "type": "string"
124
+ }
125
+ },
126
+ "required": ["extensionId", "projectFolderPath", "projectName"],
127
+ "additionalProperties": false
128
+ }
129
+ }
130
+ },
131
+ "microservice": {
132
+ "app": {
133
+ "set_viewer_base_url": {
134
+ "$id": "api/microservice/app/set_viewer_base_url",
135
+ "route": "/set_viewer_base_url",
136
+ "methods": ["POST"],
137
+ "type": "object",
138
+ "properties": {
139
+ "baseUrl": {
140
+ "type": "string"
141
+ }
142
+ },
143
+ "required": ["baseUrl"],
144
+ "additionalProperties": false
145
+ },
146
+ "set_is_app_ready": {
147
+ "$id": "api/microservice/app/set_is_app_ready",
148
+ "route": "/set_is_app_ready",
149
+ "methods": ["POST"],
150
+ "type": "object",
151
+ "properties": {
152
+ "isReady": {
153
+ "type": "boolean"
154
+ }
155
+ },
156
+ "required": ["isReady"],
157
+ "additionalProperties": false
158
+ },
159
+ "set_back_base_url": {
160
+ "$id": "api/microservice/app/set_back_base_url",
161
+ "route": "/set_back_base_url",
162
+ "methods": ["POST"],
163
+ "type": "object",
164
+ "properties": {
165
+ "baseUrl": {
166
+ "type": "string"
167
+ }
168
+ },
169
+ "required": ["baseUrl"],
170
+ "additionalProperties": false
171
+ },
172
+ "set_app_base_url": {
173
+ "$id": "api/microservice/app/set_app_base_url",
174
+ "route": "/set_app_base_url",
175
+ "methods": ["POST"],
176
+ "type": "object",
177
+ "properties": {
178
+ "baseUrl": {
179
+ "type": "string"
180
+ }
181
+ },
182
+ "required": ["baseUrl"],
183
+ "additionalProperties": false
184
+ },
185
+ "get_is_app_ready": {
186
+ "$id": "api/microservice/app/api/microservice/app/get_is_app_ready",
187
+ "route": "/api/microservice/app/get_is_app_ready",
188
+ "methods": ["GET"],
189
+ "type": "object",
190
+ "properties": {},
191
+ "required": [],
192
+ "additionalProperties": false
193
+ }
194
+ },
195
+ "extensions": {
196
+ "download": {
197
+ "$id": "api/microservice/extensions/download",
198
+ "route": "/download",
199
+ "methods": ["POST"],
200
+ "type": "object",
201
+ "properties": {
202
+ "extension": {
203
+ "type": "string"
204
+ },
205
+ "platform": {
206
+ "type": "string"
207
+ }
208
+ },
209
+ "required": ["extension", "platform"],
210
+ "additionalProperties": false
211
+ }
212
+ }
213
+ },
214
+ "serverless": {
215
+ "run_cloud": {
216
+ "$id": "api/serverless/run_cloud",
217
+ "route": "/run_cloud",
218
+ "methods": ["POST"],
219
+ "type": "object",
220
+ "properties": {
221
+ "email": {
222
+ "type": "string"
223
+ }
224
+ },
225
+ "required": ["email"],
226
+ "additionalProperties": false
227
+ }
228
+ }
229
+ }
230
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@geode/opengeodeweb-front",
3
- "version": "10.30.3-rc.1",
3
+ "version": "10.31.0-rc.2",
4
4
  "description": "OpenSource Vue/Nuxt/Pinia/Vuetify framework for web applications",
5
5
  "homepage": "https://github.com/Geode-solutions/OpenGeodeWeb-Front",
6
6
  "bugs": {
@@ -18,6 +18,10 @@
18
18
  },
19
19
  "type": "module",
20
20
  "main": "./nuxt.config.js",
21
+ "exports": {
22
+ ".": "./nuxt.config.js",
23
+ "./*": "./*"
24
+ },
21
25
  "publishConfig": {
22
26
  "access": "public"
23
27
  },
@@ -26,6 +30,7 @@
26
30
  "build:back": "npx opengeodeweb-microservice-pyinstaller ../OpenGeodeWeb-Back",
27
31
  "build:viewer": "npx opengeodeweb-microservice-pyinstaller ../OpenGeodeWeb-Viewer",
28
32
  "build:microservices": "concurrently \"npm run build:back\" \"npm run build:viewer\"",
33
+ "json": "npx opengeodeweb-microservice-generate --startDir server/api --key route --separator / --prefix api",
29
34
  "test": "npm run test:unit",
30
35
  "tests": "vitest --config ./tests/vitest.config.js",
31
36
  "test:unit": "npm run tests -- --project unit",
@@ -0,0 +1,11 @@
1
+ {
2
+ "route": "/run",
3
+ "methods": ["POST"],
4
+ "type": "object",
5
+ "properties": {
6
+ "projectFolderPath": { "type": "string" },
7
+ "projectName": { "type": "string" }
8
+ },
9
+ "required": ["projectFolderPath", "projectName"],
10
+ "additionalProperties": false
11
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "route": "/kill",
3
+ "methods": ["POST"],
4
+ "type": "object",
5
+ "properties": {},
6
+ "required": [],
7
+ "additionalProperties": false
8
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "route": "/project_folder_path",
3
+ "methods": ["POST"],
4
+ "type": "object",
5
+ "properties": { "PROJECT": { "type": "string" } },
6
+ "required": ["PROJECT"],
7
+ "additionalProperties": true
8
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "route": "/run_back",
3
+ "methods": ["POST"],
4
+ "type": "object",
5
+ "properties": {
6
+ "COMMAND_BACK": { "type": "string" },
7
+ "NUXT_ROOT_PATH": { "type": "string" }
8
+ },
9
+ "required": ["COMMAND_BACK", "NUXT_ROOT_PATH"],
10
+ "additionalProperties": true
11
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "route": "/run_viewer",
3
+ "methods": ["POST"],
4
+ "type": "object",
5
+ "properties": {
6
+ "COMMAND_VIEWER": { "type": "string" },
7
+ "NUXT_ROOT_PATH": { "type": "string" }
8
+ },
9
+ "required": ["COMMAND_VIEWER", "NUXT_ROOT_PATH"],
10
+ "additionalProperties": true
11
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "route": "/kill",
3
+ "methods": ["POST"],
4
+ "type": "object",
5
+ "properties": {
6
+ "extensionId": { "type": "string" },
7
+ "projectFolderPath": { "type": "string" },
8
+ "projectName": { "type": "string" }
9
+ },
10
+ "required": ["extensionId", "projectFolderPath", "projectName"],
11
+ "additionalProperties": false
12
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "route": "/run",
3
+ "methods": ["POST"],
4
+ "type": "object",
5
+ "properties": {
6
+ "projectFolderPath": { "type": "string" },
7
+ "projectName": { "type": "string" }
8
+ },
9
+ "required": ["projectFolderPath", "projectName"],
10
+ "additionalProperties": false
11
+ }
@@ -0,0 +1,12 @@
1
+ {
2
+ "route": "/upload",
3
+ "methods": ["OPTIONS", "PUT"],
4
+ "type": "object",
5
+ "properties": {
6
+ "filename": {
7
+ "type": "string",
8
+ "minLength": 1
9
+ }
10
+ },
11
+ "additionalProperties": false
12
+ }
@@ -0,0 +1,8 @@
1
+ {
2
+ "route": "/api/microservice/app/get_is_app_ready",
3
+ "methods": ["GET"],
4
+ "type": "object",
5
+ "properties": {},
6
+ "required": [],
7
+ "additionalProperties": false
8
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "route": "/set_app_base_url",
3
+ "methods": ["POST"],
4
+ "type": "object",
5
+ "properties": {
6
+ "baseUrl": { "type": "string" }
7
+ },
8
+ "required": ["baseUrl"],
9
+ "additionalProperties": false
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "route": "/set_back_base_url",
3
+ "methods": ["POST"],
4
+ "type": "object",
5
+ "properties": {
6
+ "baseUrl": { "type": "string" }
7
+ },
8
+ "required": ["baseUrl"],
9
+ "additionalProperties": false
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "route": "/set_is_app_ready",
3
+ "methods": ["POST"],
4
+ "type": "object",
5
+ "properties": {
6
+ "isReady": { "type": "boolean" }
7
+ },
8
+ "required": ["isReady"],
9
+ "additionalProperties": false
10
+ }
@@ -0,0 +1,10 @@
1
+ {
2
+ "route": "/set_viewer_base_url",
3
+ "methods": ["POST"],
4
+ "type": "object",
5
+ "properties": {
6
+ "baseUrl": { "type": "string" }
7
+ },
8
+ "required": ["baseUrl"],
9
+ "additionalProperties": false
10
+ }
@@ -0,0 +1,11 @@
1
+ {
2
+ "route": "/download",
3
+ "methods": ["POST"],
4
+ "type": "object",
5
+ "properties": {
6
+ "extension": { "type": "string" },
7
+ "platform": { "type": "string" }
8
+ },
9
+ "required": ["extension", "platform"],
10
+ "additionalProperties": false
11
+ }
@@ -6,7 +6,7 @@ import { GoogleAuth } from "google-auth-library";
6
6
  import { ServicesClient } from "@google-cloud/run";
7
7
 
8
8
  // Local imports
9
- import { artifactImage, requestConfig } from "@geode/opengeodeweb-front/server/utils/cloud";
9
+ import { artifactImage, requestConfig } from "@geode/opengeodeweb-front/server/utils/cloud.js";
10
10
 
11
11
  export default defineEventHandler(async (event) => {
12
12
  try {
@@ -0,0 +1,10 @@
1
+ {
2
+ "route": "/run_cloud",
3
+ "methods": ["POST"],
4
+ "type": "object",
5
+ "properties": {
6
+ "email": { "type": "string" }
7
+ },
8
+ "required": ["email"],
9
+ "additionalProperties": false
10
+ }
package/shared/scripts.js CHANGED
@@ -5,80 +5,39 @@
5
5
  // Local imports
6
6
  import { fetchSchema } from "./utils/fetch_schema.js";
7
7
 
8
+ import opengeodeweb_front_schemas from "@geode/opengeodeweb-front/opengeodeweb_front_schemas.json" with { type: "json" };
9
+
8
10
  function setAppBaseUrl(appBaseUrl) {
9
11
  console.log("[API] setAppBaseUrl", appBaseUrl);
10
- const schema = {
11
- $id: "/api/microservice/app/set_app_base_url",
12
- methods: ["POST"],
13
- type: "object",
14
- properties: {
15
- baseUrl: { type: "string" },
16
- },
17
- required: ["baseUrl"],
18
- additionalProperties: false,
19
- };
12
+ const schema = opengeodeweb_front_schemas.api.microservice.app.set_app_base_url;
20
13
  const params = { baseUrl: appBaseUrl };
21
14
  return fetchSchema({ schema, params, baseURL: appBaseUrl });
22
15
  }
23
16
 
24
17
  function setBackBaseUrl(appBaseUrl, backBaseUrl) {
25
18
  console.log("[API] setBackBaseUrl", appBaseUrl, backBaseUrl);
26
- const schema = {
27
- $id: "/api/microservice/app/set_back_base_url",
28
- methods: ["POST"],
29
- type: "object",
30
- properties: {
31
- baseUrl: { type: "string" },
32
- },
33
- required: ["baseUrl"],
34
- additionalProperties: false,
35
- };
19
+ const schema = opengeodeweb_front_schemas.api.microservice.app.set_back_base_url;
36
20
  const params = { baseUrl: backBaseUrl };
37
21
  return fetchSchema({ schema, params, baseURL: appBaseUrl });
38
22
  }
39
23
 
40
24
  function setViewerBaseUrl(appBaseUrl, viewerBaseUrl) {
41
25
  console.log("[API] setViewerBaseUrl", appBaseUrl, viewerBaseUrl);
42
- const schema = {
43
- $id: "/api/microservice/app/set_viewer_base_url",
44
- methods: ["POST"],
45
- type: "object",
46
- properties: {
47
- baseUrl: { type: "string" },
48
- },
49
- required: ["baseUrl"],
50
- additionalProperties: false,
51
- };
26
+ const schema = opengeodeweb_front_schemas.api.microservice.app.set_viewer_base_url;
52
27
  const params = { baseUrl: viewerBaseUrl };
53
28
  return fetchSchema({ schema, params, baseURL: appBaseUrl });
54
29
  }
55
30
 
56
31
  function setIsAppReady(appBaseUrl, isReady) {
57
32
  console.log("[API] setIsAppReady", isReady);
58
- const schema = {
59
- $id: "/api/microservice/app/set_is_app_ready",
60
- methods: ["POST"],
61
- type: "object",
62
- properties: {
63
- isReady: { type: "boolean" },
64
- },
65
- required: ["isReady"],
66
- additionalProperties: false,
67
- };
33
+ const schema = opengeodeweb_front_schemas.api.microservice.app.set_is_app_ready;
68
34
  const params = { isReady };
69
35
  return fetchSchema({ schema, params, baseURL: appBaseUrl });
70
36
  }
71
37
 
72
38
  function getIsAppReady(appBaseUrl) {
73
39
  console.log("[API] getIsAppReady");
74
- const schema = {
75
- $id: "/api/microservice/app/get_is_app_ready",
76
- methods: ["GET"],
77
- type: "object",
78
- properties: {},
79
- required: [],
80
- additionalProperties: false,
81
- };
40
+ const schema = opengeodeweb_front_schemas.api.microservice.app.get_is_app_ready;
82
41
  return fetchSchema({ schema, baseURL: appBaseUrl });
83
42
  }
84
43
 
@@ -1,3 +0,0 @@
1
- {
2
- "microservices": []
3
- }