@gridsuite/commons-ui 0.86.0 → 0.87.0

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.
@@ -1,9 +1,9 @@
1
1
  import { getRequestParamFromList, backendFetchJson, backendFetch } from "./utils.js";
2
- const PREFIX_DIRECTORY_SERVER_QUERIES = `${"api/gateway"}/directory`;
2
+ const PREFIX_EXPLORE_SERVER_QUERIES = `${"api/gateway"}/explore`;
3
3
  function fetchRootFolders(types) {
4
4
  console.info("Fetching Root Directories");
5
5
  const urlSearchParams = getRequestParamFromList("elementTypes", types).toString();
6
- const fetchRootFoldersUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/root-directories?${urlSearchParams}`;
6
+ const fetchRootFoldersUrl = `${PREFIX_EXPLORE_SERVER_QUERIES}/v1/explore/directories/root-directories?${urlSearchParams}`;
7
7
  return backendFetchJson(fetchRootFoldersUrl, {
8
8
  method: "get",
9
9
  headers: { "Content-Type": "application/json" }
@@ -12,7 +12,7 @@ function fetchRootFolders(types) {
12
12
  function fetchDirectoryContent(directoryUuid, types) {
13
13
  console.info("Fetching Folder content '%s'", directoryUuid);
14
14
  const urlSearchParams = getRequestParamFromList("elementTypes", types).toString();
15
- const fetchDirectoryContentUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/directories/${directoryUuid}/elements${urlSearchParams ? `?${urlSearchParams}` : ""}`;
15
+ const fetchDirectoryContentUrl = `${PREFIX_EXPLORE_SERVER_QUERIES}/v1/explore/directories/${directoryUuid}/elements${urlSearchParams ? `?${urlSearchParams}` : ""}`;
16
16
  return backendFetchJson(fetchDirectoryContentUrl, {
17
17
  method: "get",
18
18
  headers: { "Content-Type": "application/json" }
@@ -20,7 +20,9 @@ function fetchDirectoryContent(directoryUuid, types) {
20
20
  }
21
21
  function fetchDirectoryElementPath(elementUuid) {
22
22
  console.info(`Fetching element '${elementUuid}' and its parents info ...`);
23
- const fetchPathUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/elements/${encodeURIComponent(elementUuid)}/path`;
23
+ const fetchPathUrl = `${PREFIX_EXPLORE_SERVER_QUERIES}/v1/explore/directories/elements/${encodeURIComponent(
24
+ elementUuid
25
+ )}/path`;
24
26
  console.debug(fetchPathUrl);
25
27
  return backendFetchJson(fetchPathUrl, {
26
28
  method: "get",
@@ -29,7 +31,7 @@ function fetchDirectoryElementPath(elementUuid) {
29
31
  }
30
32
  function elementAlreadyExists(directoryUuid, elementName, type) {
31
33
  const elementNameEncoded = encodeURIComponent(elementName);
32
- const existsElementUrl = `${PREFIX_DIRECTORY_SERVER_QUERIES}/v1/directories/${directoryUuid}/elements/${elementNameEncoded}/types/${type}`;
34
+ const existsElementUrl = `${PREFIX_EXPLORE_SERVER_QUERIES}/v1/explore/directories/${directoryUuid}/elements/${elementNameEncoded}/types/${type}`;
33
35
  console.debug(existsElementUrl);
34
36
  return backendFetch(existsElementUrl, { method: "head" }).then(
35
37
  (response) => response.status !== 204
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gridsuite/commons-ui",
3
- "version": "0.86.0",
3
+ "version": "0.87.0",
4
4
  "description": "common react components for gridsuite applications",
5
5
  "engines": {
6
6
  "node": ">=22",