@digi-frontend/dgate-api-documentation 2.0.1-test.0 → 2.0.1-test.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/dist/index.cjs +1 -44
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +1 -5
- package/dist/index.d.cts.map +1 -1
- package/dist/index.d.ts +1 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -45
- package/dist/index.js.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -112,7 +112,6 @@ const createStore = (set) => ({
|
|
|
112
112
|
...createEditorSlice(set)
|
|
113
113
|
});
|
|
114
114
|
const useStore = (0, zustand.create)()((0, zustand_middleware.devtools)((0, zustand_middleware_immer.immer)(createStore), { name: "dgate-docs-store" }));
|
|
115
|
-
var store_default = useStore;
|
|
116
115
|
|
|
117
116
|
//#endregion
|
|
118
117
|
//#region src/hooks/useStyle.ts
|
|
@@ -906,41 +905,6 @@ const MainContent = () => {
|
|
|
906
905
|
return wrapSSR(/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", { className: cx("container") }));
|
|
907
906
|
};
|
|
908
907
|
|
|
909
|
-
//#endregion
|
|
910
|
-
//#region src/view/helper/mutate.ts
|
|
911
|
-
const transformOpenApiToDocs = (api) => {
|
|
912
|
-
const groupedPathsByTags = { default: [] };
|
|
913
|
-
const validTags = new Set(api?.tags?.map(({ name }) => name) || []);
|
|
914
|
-
const contextPath = Object.keys(api.paths)[0];
|
|
915
|
-
for (const [path, methods] of Object.entries(api.paths)) for (const [method, methodData] of Object.entries(methods)) {
|
|
916
|
-
const entry = {
|
|
917
|
-
...methodData,
|
|
918
|
-
method: method?.toUpperCase(),
|
|
919
|
-
path
|
|
920
|
-
};
|
|
921
|
-
const resourceTags = methodData.tags ?? [];
|
|
922
|
-
const matchedTags = resourceTags.filter((tag) => validTags.has(tag));
|
|
923
|
-
if (matchedTags.length > 0) matchedTags.forEach((tag) => {
|
|
924
|
-
if (!groupedPathsByTags[tag]) groupedPathsByTags[tag] = [];
|
|
925
|
-
groupedPathsByTags[tag].push({
|
|
926
|
-
...entry,
|
|
927
|
-
id: `endpoint-${(0, nanoid.nanoid)(8)}`
|
|
928
|
-
});
|
|
929
|
-
});
|
|
930
|
-
else groupedPathsByTags.default.push({
|
|
931
|
-
...entry,
|
|
932
|
-
id: `endpoint-${(0, nanoid.nanoid)(8)}`
|
|
933
|
-
});
|
|
934
|
-
}
|
|
935
|
-
return {
|
|
936
|
-
...api.info,
|
|
937
|
-
id: `api-${(0, nanoid.nanoid)(8)}`,
|
|
938
|
-
contextPath,
|
|
939
|
-
tags: groupedPathsByTags,
|
|
940
|
-
servers: api.servers
|
|
941
|
-
};
|
|
942
|
-
};
|
|
943
|
-
|
|
944
908
|
//#endregion
|
|
945
909
|
//#region src/view/layout.tsx
|
|
946
910
|
function ErrorBoundary({ children }) {
|
|
@@ -969,14 +933,7 @@ var ErrorCatcher = class extends react.default.Component {
|
|
|
969
933
|
return this.props.children;
|
|
970
934
|
}
|
|
971
935
|
};
|
|
972
|
-
const DocumentationLayout = (
|
|
973
|
-
const { setOriginalData } = store_default(({ view }) => view);
|
|
974
|
-
const { setTransformedData } = store_default(({ view }) => view);
|
|
975
|
-
(0, react.useEffect)(() => {
|
|
976
|
-
setOriginalData(data);
|
|
977
|
-
const transformedData = data.map(transformOpenApiToDocs);
|
|
978
|
-
setTransformedData(transformedData);
|
|
979
|
-
}, [data]);
|
|
936
|
+
const DocumentationLayout = () => {
|
|
980
937
|
const { cx } = useStyle("DocumentationLayout", (token$1, scope) => ({
|
|
981
938
|
[scope("container")]: {
|
|
982
939
|
display: "flex",
|