@digi-frontend/dgate-api-documentation 4.0.7 → 4.0.8

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/dist/index.cjs CHANGED
@@ -41,7 +41,6 @@ let react_syntax_highlighter_dist_esm_languages_hljs_json_js = require("react-sy
41
41
  react_syntax_highlighter_dist_esm_languages_hljs_json_js = __toESM(react_syntax_highlighter_dist_esm_languages_hljs_json_js, 1);
42
42
  let react_syntax_highlighter_dist_esm_styles_hljs_index_js = require("react-syntax-highlighter/dist/esm/styles/hljs/index.js");
43
43
  react_syntax_highlighter_dist_esm_styles_hljs_index_js = __toESM(react_syntax_highlighter_dist_esm_styles_hljs_index_js, 1);
44
- let nanoid = require("nanoid");
45
44
  //#region src/store/slices/view.ts
46
45
  const createViewSlice = (set) => ({ view: {
47
46
  selectedNodeKey: null,
@@ -8859,6 +8858,15 @@ function CodeboxSidebar$1() {
8859
8858
  }
8860
8859
  //#endregion
8861
8860
  //#region src/view/helper/mutate.ts
8861
+ /**
8862
+ * Simple deterministic string hash (djb2 variant).
8863
+ * Produces a stable, short base-36 hash for the same input.
8864
+ */
8865
+ const stableHash = (input) => {
8866
+ let hash = 5381;
8867
+ for (let i = 0; i < input.length; i++) hash = (hash << 5) + hash + input.charCodeAt(i);
8868
+ return (hash >>> 0).toString(36);
8869
+ };
8862
8870
  const resolveSchema = (schema, components) => {
8863
8871
  if (!schema) return void 0;
8864
8872
  if (!schema.$ref) return schema;
@@ -8921,14 +8929,14 @@ const transformOpenApiToDocs = (api) => {
8921
8929
  if (!groupedPathsByTags[tag]) groupedPathsByTags[tag] = [];
8922
8930
  groupedPathsByTags[tag].push({
8923
8931
  ...entry,
8924
- id: `endpoint-${(0, nanoid.nanoid)(8)}`
8932
+ id: `endpoint-${stableHash(entry.method + "-" + entry.path)}`
8925
8933
  });
8926
8934
  });
8927
8935
  else {
8928
8936
  if (!groupedPathsByTags.default) groupedPathsByTags.default = [];
8929
8937
  groupedPathsByTags.default.push({
8930
8938
  ...entry,
8931
- id: `endpoint-${(0, nanoid.nanoid)(8)}`
8939
+ id: `endpoint-${stableHash(entry.method + "-" + entry.path)}`
8932
8940
  });
8933
8941
  }
8934
8942
  }
@@ -8942,7 +8950,7 @@ const transformOpenApiToDocs = (api) => {
8942
8950
  }, {});
8943
8951
  return {
8944
8952
  ...api.info,
8945
- id: `api-${(0, nanoid.nanoid)(8)}`,
8953
+ id: `api-${contextPath ?? "unknown"}`,
8946
8954
  contextPath,
8947
8955
  tags: sortedGroupedPathsByTags,
8948
8956
  servers: api.servers,