@geode/opengeodeweb-front 10.44.0-rc.2 → 10.44.0-rc.4

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 (160) hide show
  1. package/.build/server/utils/cleanup.js +7 -2
  2. package/.build/server/utils/microservices.js +9 -81
  3. package/.build/server/utils/microservices_process.js +85 -0
  4. package/.build/server/utils/typed_handler.js +5 -1
  5. package/.build/server/utils/ws_client.js +7 -2
  6. package/.build/shared/utils/fetch_raw.js +2 -2
  7. package/.build/shared/utils/parse_boolean.js +2 -1
  8. package/app/components/ClippingPlanes.vue +22 -78
  9. package/app/components/DragAndDrop.vue +16 -79
  10. package/app/components/FileSelector.vue +9 -6
  11. package/app/components/HybridViewerTooltip.vue +8 -2
  12. package/app/components/MissingFilesSelector.vue +10 -6
  13. package/app/components/ObjectSelector.vue +6 -3
  14. package/app/components/Screenshot.vue +9 -2
  15. package/app/components/ThresholdCard.vue +205 -0
  16. package/app/components/ThresholdFilter.vue +81 -216
  17. package/app/components/ViewToolbar.vue +15 -231
  18. package/app/components/Viewer/EdgedCurve/SpecificEdgesColoring.vue +209 -0
  19. package/app/components/Viewer/EdgedCurve/SpecificEdgesOptions.vue +3 -191
  20. package/app/components/Viewer/Generic/Mesh/CellsColoring.vue +228 -0
  21. package/app/components/Viewer/Generic/Mesh/CellsOptions.vue +3 -210
  22. package/app/components/Viewer/Generic/Mesh/EdgesColoring.vue +211 -0
  23. package/app/components/Viewer/Generic/Mesh/EdgesOptions.vue +3 -192
  24. package/app/components/Viewer/Generic/Mesh/PolygonsColoring.vue +234 -0
  25. package/app/components/Viewer/Generic/Mesh/PolygonsOptions.vue +3 -215
  26. package/app/components/Viewer/Generic/Mesh/PolyhedraColoring.vue +221 -0
  27. package/app/components/Viewer/Generic/Mesh/PolyhedraOptions.vue +3 -203
  28. package/app/components/Viewer/Generic/Model/BlocksOptions.vue +7 -5
  29. package/app/components/Viewer/Generic/Model/ComponentPointsOptions.vue +2 -18
  30. package/app/components/Viewer/Generic/Model/CornerComponentOptions.vue +145 -0
  31. package/app/components/Viewer/Generic/Model/CornersOptions.vue +13 -292
  32. package/app/components/Viewer/Generic/Model/CornersTypeOptions.vue +173 -0
  33. package/app/components/Viewer/Generic/Model/LineComponentOptions.vue +218 -0
  34. package/app/components/Viewer/Generic/Model/LinesOptions.vue +13 -425
  35. package/app/components/Viewer/Generic/Model/LinesTypeOptions.vue +229 -0
  36. package/app/components/Viewer/Generic/Model/ModelEdgesCard.vue +12 -10
  37. package/app/components/Viewer/Generic/Model/ModelPointsCard.vue +12 -10
  38. package/app/components/Viewer/Generic/Model/SurfacesOptions.vue +9 -5
  39. package/app/components/Viewer/ObjectTree/Base/ComponentRelations.vue +4 -1
  40. package/app/components/Viewer/ObjectTree/Views/GlobalObjects.vue +6 -1
  41. package/app/components/Viewer/Options/AttributeRangeSelector.vue +11 -4
  42. package/app/components/Viewer/Options/AttributeSelector.vue +40 -136
  43. package/app/components/Viewer/Options/ColorPicker.vue +4 -1
  44. package/app/components/Viewer/Options/ColoringTypeSelector.vue +36 -74
  45. package/app/components/Viewer/Options/ColormapQuickPicker.vue +13 -7
  46. package/app/components/Viewer/Options/NoDataColorInfo.vue +56 -0
  47. package/app/components/Viewer/Solid/SpecificPolyhedraColoring.vue +217 -0
  48. package/app/components/Viewer/Solid/SpecificPolyhedraOptions.vue +4 -199
  49. package/app/components/Viewer/Surface/PolygonsColoring.vue +231 -0
  50. package/app/components/Viewer/Surface/PolygonsOptions.vue +3 -213
  51. package/app/components/csv-preview/CsvPreviewer.vue +4 -1
  52. package/app/composables/attribute_coloring_style.ts +8 -2
  53. package/app/composables/attribute_selector.ts +126 -0
  54. package/app/composables/clipping_slices.ts +166 -0
  55. package/app/composables/global_attribute_style.ts +4 -3
  56. package/app/composables/hover_highlight.ts +6 -5
  57. package/app/composables/project_manager.ts +5 -5
  58. package/app/composables/stepper_tree.ts +10 -2
  59. package/app/composables/tree_filter.ts +11 -2
  60. package/app/composables/tree_keyboard_nav.ts +4 -2
  61. package/app/composables/use_overlapping_picker.ts +5 -5
  62. package/app/composables/view_toolbar_options.ts +126 -0
  63. package/app/composables/view_toolbar_tool_options.ts +115 -0
  64. package/app/composables/view_toolbar_tools.ts +108 -0
  65. package/app/composables/virtual_tree.ts +20 -131
  66. package/app/composables/virtual_tree_flatten.ts +86 -0
  67. package/app/composables/virtual_tree_types.ts +81 -0
  68. package/app/stores/app.ts +8 -55
  69. package/app/stores/app_helpers/extension.ts +1 -1
  70. package/app/stores/app_helpers/registry.ts +69 -0
  71. package/app/stores/feedback.ts +2 -2
  72. package/app/stores/hybrid_viewer.ts +1 -1
  73. package/app/stores/menu.ts +1 -124
  74. package/app/stores/menu_helpers/menus_data.ts +127 -0
  75. package/app/stores/treeview.ts +17 -10
  76. package/app/stores/viewer.ts +17 -78
  77. package/app/stores/viewer_helpers/actions.ts +68 -0
  78. package/app/stores/viewer_helpers/request.ts +61 -0
  79. package/app/utils/clipping_planes.ts +4 -131
  80. package/app/utils/clipping_planes_scene.ts +131 -0
  81. package/app/utils/coloring_styles.ts +101 -0
  82. package/app/utils/default_styles/mesh_components.ts +168 -0
  83. package/app/utils/default_styles/meshes.ts +13 -153
  84. package/app/utils/default_styles/model_components.ts +170 -0
  85. package/app/utils/default_styles/models.ts +16 -153
  86. package/app/utils/drag_and_drop.ts +80 -0
  87. package/app/utils/extension.ts +1 -1
  88. package/app/utils/import_workflow.ts +6 -4
  89. package/app/utils/model_component_coloring.ts +46 -0
  90. package/app/utils/threshold.ts +33 -0
  91. package/app/utils/threshold_sources.ts +51 -0
  92. package/app/utils/upload_path.ts +15 -9
  93. package/internal/database/database.ts +4 -1
  94. package/internal/stores/data_style/mesh/cells/cell.ts +27 -150
  95. package/internal/stores/data_style/mesh/cells/cell_attribute.ts +74 -0
  96. package/internal/stores/data_style/mesh/cells/cell_config.ts +152 -0
  97. package/internal/stores/data_style/mesh/cells/vertex.ts +26 -157
  98. package/internal/stores/data_style/mesh/cells/vertex_attribute.ts +80 -0
  99. package/internal/stores/data_style/mesh/cells/vertex_config.ts +152 -0
  100. package/internal/stores/data_style/mesh/edges/edge.ts +27 -150
  101. package/internal/stores/data_style/mesh/edges/edge_attribute.ts +74 -0
  102. package/internal/stores/data_style/mesh/edges/edge_config.ts +152 -0
  103. package/internal/stores/data_style/mesh/edges/vertex.ts +26 -157
  104. package/internal/stores/data_style/mesh/edges/vertex_attribute.ts +80 -0
  105. package/internal/stores/data_style/mesh/edges/vertex_config.ts +152 -0
  106. package/internal/stores/data_style/mesh/points/vertex.ts +26 -157
  107. package/internal/stores/data_style/mesh/points/vertex_attribute.ts +80 -0
  108. package/internal/stores/data_style/mesh/points/vertex_config.ts +152 -0
  109. package/internal/stores/data_style/mesh/polygons/polygon.ts +27 -152
  110. package/internal/stores/data_style/mesh/polygons/polygon_attribute.ts +80 -0
  111. package/internal/stores/data_style/mesh/polygons/polygon_config.ts +148 -0
  112. package/internal/stores/data_style/mesh/polygons/vertex.ts +26 -157
  113. package/internal/stores/data_style/mesh/polygons/vertex_attribute.ts +80 -0
  114. package/internal/stores/data_style/mesh/polygons/vertex_config.ts +152 -0
  115. package/internal/stores/data_style/mesh/polyhedra/polyhedron.ts +27 -160
  116. package/internal/stores/data_style/mesh/polyhedra/polyhedron_attribute.ts +82 -0
  117. package/internal/stores/data_style/mesh/polyhedra/polyhedron_config.ts +157 -0
  118. package/internal/stores/data_style/mesh/polyhedra/vertex.ts +26 -157
  119. package/internal/stores/data_style/mesh/polyhedra/vertex_attribute.ts +80 -0
  120. package/internal/stores/data_style/mesh/polyhedra/vertex_config.ts +152 -0
  121. package/internal/stores/data_style/model/blocks/apply_coloring.ts +173 -0
  122. package/internal/stores/data_style/model/blocks/coloring_groups.ts +18 -0
  123. package/internal/stores/data_style/model/blocks/index.ts +12 -140
  124. package/internal/stores/data_style/model/blocks/polyhedron.ts +14 -10
  125. package/internal/stores/data_style/model/blocks/vertex.ts +14 -10
  126. package/internal/stores/data_style/model/common.ts +10 -119
  127. package/internal/stores/data_style/model/common_mutations.ts +184 -0
  128. package/internal/stores/data_style/model/corners/vertex.ts +14 -10
  129. package/internal/stores/data_style/model/lines/apply_coloring.ts +154 -0
  130. package/internal/stores/data_style/model/lines/coloring_groups.ts +18 -0
  131. package/internal/stores/data_style/model/lines/edge.ts +14 -10
  132. package/internal/stores/data_style/model/lines/index.ts +10 -134
  133. package/internal/stores/data_style/model/lines/vertex.ts +14 -10
  134. package/internal/stores/data_style/model/surfaces/apply_coloring.ts +186 -0
  135. package/internal/stores/data_style/model/surfaces/coloring_groups.ts +18 -0
  136. package/internal/stores/data_style/model/surfaces/index.ts +16 -160
  137. package/internal/stores/data_style/model/surfaces/polygon.ts +14 -10
  138. package/internal/stores/data_style/model/surfaces/vertex.ts +14 -10
  139. package/internal/stores/data_style/model/visibility.ts +3 -156
  140. package/internal/stores/data_style/model/visibility_dispatch.ts +160 -0
  141. package/internal/stores/data_style/state.ts +1 -181
  142. package/internal/stores/data_style/state_shared.ts +191 -0
  143. package/internal/stores/hybrid_viewer/brightness.ts +8 -2
  144. package/internal/stores/hybrid_viewer/camera.ts +7 -161
  145. package/internal/stores/hybrid_viewer/camera_animation.ts +4 -3
  146. package/internal/stores/hybrid_viewer/camera_helpers.ts +120 -0
  147. package/internal/stores/hybrid_viewer/camera_orientation.ts +60 -0
  148. package/internal/stores/hybrid_viewer/filters.ts +54 -11
  149. package/internal/stores/hybrid_viewer/highlight.ts +10 -9
  150. package/internal/stores/hybrid_viewer/ruler.ts +4 -3
  151. package/internal/utils/ws_client.ts +8 -1
  152. package/package.json +2 -2
  153. package/server/api/local/extensions/run.post.ts +6 -4
  154. package/server/utils/cleanup.ts +12 -2
  155. package/server/utils/microservices.ts +10 -102
  156. package/server/utils/microservices_process.ts +127 -0
  157. package/server/utils/typed_handler.ts +8 -1
  158. package/server/utils/ws_client.ts +15 -2
  159. package/shared/utils/fetch_raw.ts +2 -2
  160. package/shared/utils/parse_boolean.ts +4 -1
@@ -1,94 +1,25 @@
1
1
  // Node imports
2
2
  import child_process from "node:child_process";
3
3
  import fs from "node:fs";
4
- import path from "node:path";
5
4
 
6
5
  // Third party imports
7
6
  import back_schemas from "@geode/opengeodeweb-back/opengeodeweb_back_schemas.json" with { type: "json" };
8
7
  import { consola } from "consola";
9
8
 
10
9
  // Local imports
10
+ import {
11
+ DEFAULT_RUN_ARGS,
12
+ MAX_PORT_RETRIES,
13
+ type RunArgs,
14
+ backArgs,
15
+ isPortInUseError,
16
+ runScript,
17
+ waitUntilListening,
18
+ } from "./microservices_process.js";
11
19
  import { type Microservice, microservicesMetadatasPath, projectMicroservices } from "./cleanup.js";
12
- import { type NamedChildProcess, getAvailablePort, waitForReady } from "./scripts.js";
13
20
  import { addNginxLocation, addSupervisorProgram } from "./cloud.js";
14
21
  import { executablePath } from "./path.js";
15
-
16
- interface RunArgs {
17
- projectFolderPath: string;
18
- uploadFolderPath?: string;
19
- [key: string]: unknown;
20
- }
21
-
22
- const MILLISECONDS_PER_SECOND = 1000;
23
- const DEFAULT_TIMEOUT_SECONDS = 120;
24
- const MAX_PORT_RETRIES = 1;
25
- const DEFAULT_RUN_ARGS: RunArgs = { projectFolderPath: "" };
26
- const LISTENING_LOG_PATTERN = /^Listening on https?:\/\/.+:\d+\/?\s*$/mu;
27
-
28
- async function runScript(
29
- execPath: string,
30
- execName: string,
31
- args: readonly string[],
32
- expectedResponse: string,
33
- timeoutSeconds = DEFAULT_TIMEOUT_SECONDS,
34
- ): Promise<NamedChildProcess> {
35
- const command = executablePath(execPath, execName);
36
- consola.debug("runScript", command, args);
37
- const child = child_process.spawn(command, args, {
38
- stdio: ["ignore", "pipe", "pipe"],
39
- }) as NamedChildProcess;
40
- child.name = command.replace(/^.*[\\/]/u, "");
41
- child.on("spawn", () => {
42
- consola.info(`[${child.name}] spawned, pid=${child.pid}`);
43
- });
44
- const controller = new AbortController();
45
- const timer = setTimeout(() => {
46
- controller.abort();
47
- }, timeoutSeconds * MILLISECONDS_PER_SECOND);
48
- if (typeof timer.unref === "function") {
49
- timer.unref();
50
- }
51
- try {
52
- const result = await waitForReady(child, expectedResponse, controller.signal);
53
- clearTimeout(timer);
54
- return result;
55
- } catch (error) {
56
- clearTimeout(timer);
57
- child.kill();
58
- throw error;
59
- }
60
- }
61
-
62
- function isPortInUseError(error: unknown): boolean {
63
- return /EADDRINUSE|address already in use|port already in use/iu.test(String(error));
64
- }
65
-
66
- function backArgs(args: RunArgs, port: number): string[] {
67
- const { projectFolderPath } = args;
68
- if (!projectFolderPath) {
69
- throw new Error("projectFolderPath is required");
70
- }
71
- const uploadFolderPath =
72
- args.uploadFolderPath !== undefined && args.uploadFolderPath !== ""
73
- ? args.uploadFolderPath
74
- : path.join(projectFolderPath, "uploads");
75
- const executableArgs = [
76
- "--port",
77
- String(port),
78
- "--project_folder_path",
79
- projectFolderPath,
80
- "--upload_folder_path",
81
- uploadFolderPath,
82
- "--allowed_origins",
83
- "http://localhost:*",
84
- "--timeout",
85
- "0",
86
- ];
87
- if (process.env.NODE_ENV === undefined || process.env.NODE_ENV === "development") {
88
- executableArgs.push("--debug");
89
- }
90
- return executableArgs;
91
- }
22
+ import { getAvailablePort } from "./scripts.js";
92
23
 
93
24
  async function runBack(
94
25
  execName: string,
@@ -184,29 +115,6 @@ async function runExtension(
184
115
  }
185
116
  throw new Error(`runExtension failed to run ${extensionId}`);
186
117
  }
187
- async function waitUntilListening(
188
- child: child_process.ChildProcessWithoutNullStreams,
189
- ): Promise<void> {
190
- child.stderr.on("data", (data: Buffer) => {
191
- consola.info(`[${child.spawnfile}] STDERR:`, data.toString().trim());
192
- });
193
- child.on("close", (code) => {
194
- consola.info(`[${child.spawnfile}] exited with code ${code}`);
195
- });
196
- // oxlint-disable-next-line typescript/no-unnecessary-condition
197
- for await (const chunk of child.stdout) {
198
- const output = String(chunk);
199
- consola.info(`[${child.spawnfile}] STDOUT:`, output.trim());
200
- if (LISTENING_LOG_PATTERN.test(output)) {
201
- child.stdout.on("data", (data: Buffer) => {
202
- consola.info(`[${child.spawnfile}] STDOUT:`, data.toString().trim());
203
- });
204
- return;
205
- }
206
- }
207
- throw new Error(`${child.spawnfile} exited before becoming ready`);
208
- }
209
-
210
118
  async function runExtensionServer(entryPath: string, attempts = 0): Promise<number> {
211
119
  let port: number | undefined = undefined;
212
120
  try {
@@ -0,0 +1,127 @@
1
+ // Node imports
2
+ import child_process from "node:child_process";
3
+ import path from "node:path";
4
+
5
+ // Third party imports
6
+ import { consola } from "consola";
7
+
8
+ // Local imports
9
+ import { type NamedChildProcess, waitForReady } from "./scripts.js";
10
+ import { executablePath } from "./path.js";
11
+
12
+ interface RunArgs {
13
+ projectFolderPath: string;
14
+ uploadFolderPath?: string;
15
+ [key: string]: unknown;
16
+ }
17
+
18
+ const MILLISECONDS_PER_SECOND = 1000;
19
+ const DEFAULT_TIMEOUT_SECONDS = 120;
20
+ const MAX_PORT_RETRIES = 1;
21
+ const DEFAULT_RUN_ARGS: RunArgs = { projectFolderPath: "" };
22
+ const LISTENING_LOG_PATTERN = /^Listening on https?:\/\/.+:\d+\/?\s*$/mu;
23
+
24
+ async function runScript(
25
+ execPath: string,
26
+ execName: string,
27
+ args: readonly string[],
28
+ expectedResponse: string,
29
+ timeoutSeconds = DEFAULT_TIMEOUT_SECONDS,
30
+ ): Promise<NamedChildProcess> {
31
+ const command = executablePath(execPath, execName);
32
+ consola.debug("runScript", command, args);
33
+ const child = child_process.spawn(command, args, {
34
+ stdio: ["ignore", "pipe", "pipe"],
35
+ }) as NamedChildProcess;
36
+ child.name = command.replace(/^.*[\\/]/u, "");
37
+ child.on("spawn", () => {
38
+ consola.info(`[${child.name}] spawned, pid=${child.pid}`);
39
+ });
40
+ const controller = new AbortController();
41
+ const timer = setTimeout(() => {
42
+ controller.abort();
43
+ }, timeoutSeconds * MILLISECONDS_PER_SECOND);
44
+ if (typeof timer.unref === "function") {
45
+ timer.unref();
46
+ }
47
+ try {
48
+ const result = await waitForReady(child, expectedResponse, controller.signal);
49
+ clearTimeout(timer);
50
+ return result;
51
+ } catch (error) {
52
+ clearTimeout(timer);
53
+ child.kill();
54
+ throw error;
55
+ }
56
+ }
57
+
58
+ function isPortInUseError(error: unknown): boolean {
59
+ return /EADDRINUSE|address already in use|port already in use/iu.test(String(error));
60
+ }
61
+
62
+ function resolveUploadFolderPath(
63
+ projectFolderPath: string,
64
+ uploadFolderPath: string | undefined,
65
+ ): string {
66
+ if (uploadFolderPath !== undefined && uploadFolderPath !== "") {
67
+ return uploadFolderPath;
68
+ }
69
+ return path.join(projectFolderPath, "uploads");
70
+ }
71
+
72
+ function backArgs(args: RunArgs, port: number): string[] {
73
+ const { projectFolderPath } = args;
74
+ if (!projectFolderPath) {
75
+ throw new Error("projectFolderPath is required");
76
+ }
77
+ const uploadFolderPath = resolveUploadFolderPath(projectFolderPath, args.uploadFolderPath);
78
+ const executableArgs = [
79
+ "--port",
80
+ String(port),
81
+ "--project_folder_path",
82
+ projectFolderPath,
83
+ "--upload_folder_path",
84
+ uploadFolderPath,
85
+ "--allowed_origins",
86
+ "http://localhost:*",
87
+ "--timeout",
88
+ "0",
89
+ ];
90
+ if (process.env.NODE_ENV === undefined || process.env.NODE_ENV === "development") {
91
+ executableArgs.push("--debug");
92
+ }
93
+ return executableArgs;
94
+ }
95
+
96
+ async function waitUntilListening(
97
+ child: child_process.ChildProcessWithoutNullStreams,
98
+ ): Promise<void> {
99
+ child.stderr.on("data", (data: Buffer) => {
100
+ consola.info(`[${child.spawnfile}] STDERR:`, data.toString().trim());
101
+ });
102
+ child.on("close", (code) => {
103
+ consola.info(`[${child.spawnfile}] exited with code ${code}`);
104
+ });
105
+ // oxlint-disable-next-line typescript/no-unnecessary-condition
106
+ for await (const chunk of child.stdout) {
107
+ const output = String(chunk);
108
+ consola.info(`[${child.spawnfile}] STDOUT:`, output.trim());
109
+ if (LISTENING_LOG_PATTERN.test(output)) {
110
+ child.stdout.on("data", (data: Buffer) => {
111
+ consola.info(`[${child.spawnfile}] STDOUT:`, data.toString().trim());
112
+ });
113
+ return;
114
+ }
115
+ }
116
+ throw new Error(`${child.spawnfile} exited before becoming ready`);
117
+ }
118
+
119
+ export {
120
+ DEFAULT_RUN_ARGS,
121
+ MAX_PORT_RETRIES,
122
+ backArgs,
123
+ isPortInUseError,
124
+ runScript,
125
+ waitUntilListening,
126
+ };
127
+ export type { RunArgs };
@@ -27,6 +27,13 @@ const INTERNAL_SERVER_ERROR = 500;
27
27
  type RouteSchema = JsonRpcSchema & { readonly response?: object };
28
28
 
29
29
  // Same body as the Flask microservices' errors, so the client reads every error the same way
30
+ function describeError(error: unknown): string {
31
+ if (error instanceof Error) {
32
+ return error.message;
33
+ }
34
+ return String(error);
35
+ }
36
+
30
37
  function toErrorResponse(error: unknown): ErrorResponse {
31
38
  if (isError(error)) {
32
39
  return {
@@ -38,7 +45,7 @@ function toErrorResponse(error: unknown): ErrorResponse {
38
45
  return {
39
46
  code: INTERNAL_SERVER_ERROR,
40
47
  name: "Internal Server Error",
41
- description: error instanceof Error ? error.message : String(error),
48
+ description: describeError(error),
42
49
  };
43
50
  }
44
51
 
@@ -31,7 +31,20 @@ function rawDataToBlob(raw: WebSocket.RawData): Blob {
31
31
  if (raw instanceof ArrayBuffer) {
32
32
  return new Blob([raw]);
33
33
  }
34
- return new Blob([Uint8Array.from(Array.isArray(raw) ? Buffer.concat(raw) : raw)]);
34
+ if (Array.isArray(raw)) {
35
+ return new Blob([Uint8Array.from(Buffer.concat(raw))]);
36
+ }
37
+ return new Blob([Uint8Array.from(raw)]);
38
+ }
39
+
40
+ function findPendingCall(
41
+ pending: ReadonlyMap<string, PendingCall>,
42
+ id: string | undefined,
43
+ ): PendingCall | undefined {
44
+ if (id === undefined) {
45
+ return undefined;
46
+ }
47
+ return pending.get(id);
35
48
  }
36
49
 
37
50
  interface ServerWsRpcClient {
@@ -98,7 +111,7 @@ function createServerWsRpcClient(baseUrl: string): ServerWsRpcClient {
98
111
  return;
99
112
  }
100
113
 
101
- const entry = message.id === undefined ? undefined : pending.get(message.id);
114
+ const entry = findPendingCall(pending, message.id);
102
115
  if (!entry || message.id === undefined) {
103
116
  return;
104
117
  }
@@ -58,8 +58,8 @@ async function performFetch({
58
58
  baseURL,
59
59
  method,
60
60
  headers,
61
- ...(hasBody(params) ? { body: params } : {}),
62
- ...(max_retry === undefined ? {} : { retry: max_retry }),
61
+ ...(hasBody(params) && { body: params }),
62
+ ...(max_retry !== undefined && { retry: max_retry }),
63
63
  async onRequestError({ error }: { error: unknown }) {
64
64
  if (request_error_function) {
65
65
  await request_error_function(error);
@@ -2,7 +2,10 @@ const TRUTHY_VALUES = new Set([true, 1, "1", "true", "yes"]);
2
2
  const FALSY_VALUES = new Set([false, 0, "0", "false", "no"]);
3
3
 
4
4
  function parseBoolean(value: string | number | boolean): boolean {
5
- const normalized = typeof value === "string" ? value.trim().toLowerCase() : value;
5
+ let normalized: string | number | boolean = value;
6
+ if (typeof value === "string") {
7
+ normalized = value.trim().toLowerCase();
8
+ }
6
9
 
7
10
  if (TRUTHY_VALUES.has(normalized)) {
8
11
  return true;