@digi-frontend/dgate-api-documentation 4.1.3 → 4.1.6
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 +315 -212
- package/dist/index.cjs.map +1 -1
- package/dist/index.mjs +315 -212
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -104,8 +104,10 @@ const useStore = (0, zustand.create)()((0, zustand_middleware.devtools)((0, zust
|
|
|
104
104
|
//#region src/hooks/useStyle.ts
|
|
105
105
|
function useStyle(componentName, stylesFn) {
|
|
106
106
|
const { token, theme, hashId } = antd.theme.useToken();
|
|
107
|
-
const
|
|
108
|
-
const
|
|
107
|
+
const tokenKey = token._tokenKey;
|
|
108
|
+
const themeId = tokenKey ? `tk-${tokenKey.slice(-6)}` : "tk-default";
|
|
109
|
+
const scope = (className) => `.${hashId}.${themeId}.${componentName}-${className}`;
|
|
110
|
+
const cx = (...classes) => classes.map((cls) => `${componentName}-${cls} ${hashId} ${themeId}`).join(" ");
|
|
109
111
|
return {
|
|
110
112
|
wrapSSR: (0, _ant_design_cssinjs.useStyleRegister)({
|
|
111
113
|
theme,
|
|
@@ -1260,7 +1262,7 @@ const ApiCard = ({ api, viewStyle }) => {
|
|
|
1260
1262
|
border: `1px solid ${token.colorBorderSecondary}`,
|
|
1261
1263
|
minWidth: "6.25rem",
|
|
1262
1264
|
maxWidth: "fit-content",
|
|
1263
|
-
svg: { path: { fill:
|
|
1265
|
+
svg: { path: { fill: "#4D75D9" } }
|
|
1264
1266
|
},
|
|
1265
1267
|
[scope("list-title")]: {
|
|
1266
1268
|
color: token.colorTextHeading,
|
|
@@ -1308,7 +1310,7 @@ const ApiCard = ({ api, viewStyle }) => {
|
|
|
1308
1310
|
flexDirection: "row",
|
|
1309
1311
|
borderRadius: token.borderRadiusSM,
|
|
1310
1312
|
border: `1px solid ${token.colorBorderSecondary}`,
|
|
1311
|
-
svg: { path: { fill:
|
|
1313
|
+
svg: { path: { fill: "#4D75D9" } }
|
|
1312
1314
|
},
|
|
1313
1315
|
[scope("grid-path-name")]: {
|
|
1314
1316
|
color: token.colorText,
|
|
@@ -2153,7 +2155,7 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2153
2155
|
},
|
|
2154
2156
|
[scope("mobileWrapper")]: {
|
|
2155
2157
|
flexDirection: "column",
|
|
2156
|
-
gap:
|
|
2158
|
+
gap: 16
|
|
2157
2159
|
},
|
|
2158
2160
|
[scope("mobileTopRow")]: {
|
|
2159
2161
|
width: "100%",
|
|
@@ -2228,14 +2230,14 @@ const ApiDocumentationBar = ({ apiName, mode, onModeChange, onReset, onSave, has
|
|
|
2228
2230
|
[scope("actions")]: {
|
|
2229
2231
|
display: "flex",
|
|
2230
2232
|
alignItems: "center",
|
|
2231
|
-
gap:
|
|
2233
|
+
gap: 16,
|
|
2232
2234
|
flex: 1,
|
|
2233
2235
|
justifyContent: "flex-end"
|
|
2234
2236
|
},
|
|
2235
2237
|
[scope("mobileActions")]: {
|
|
2236
2238
|
display: "flex",
|
|
2237
2239
|
alignItems: "center",
|
|
2238
|
-
gap:
|
|
2240
|
+
gap: 16,
|
|
2239
2241
|
justifyContent: "flex-end"
|
|
2240
2242
|
}
|
|
2241
2243
|
}));
|
|
@@ -2632,42 +2634,6 @@ const EditTag = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
|
2632
2634
|
]
|
|
2633
2635
|
});
|
|
2634
2636
|
//#endregion
|
|
2635
|
-
//#region src/assets/info-circle.tsx
|
|
2636
|
-
const InfoCircle = (props) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("svg", {
|
|
2637
|
-
width: "24",
|
|
2638
|
-
height: "24",
|
|
2639
|
-
viewBox: "0 0 24 24",
|
|
2640
|
-
fill: "none",
|
|
2641
|
-
xmlns: "http://www.w3.org/2000/svg",
|
|
2642
|
-
...props,
|
|
2643
|
-
children: [
|
|
2644
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
2645
|
-
d: "M12 22C17.5 22 22 17.5 22 12C22 6.5 17.5 2 12 2C6.5 2 2 6.5 2 12C2 17.5 6.5 22 12 22Z",
|
|
2646
|
-
stroke: "black",
|
|
2647
|
-
strokeOpacity: "0.45",
|
|
2648
|
-
strokeWidth: "1.5",
|
|
2649
|
-
strokeLinecap: "round",
|
|
2650
|
-
strokeLinejoin: "round"
|
|
2651
|
-
}),
|
|
2652
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
2653
|
-
d: "M12 8V13",
|
|
2654
|
-
stroke: "black",
|
|
2655
|
-
strokeOpacity: "0.45",
|
|
2656
|
-
strokeWidth: "1.5",
|
|
2657
|
-
strokeLinecap: "round",
|
|
2658
|
-
strokeLinejoin: "round"
|
|
2659
|
-
}),
|
|
2660
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("path", {
|
|
2661
|
-
d: "M11.9946 16H12.0036",
|
|
2662
|
-
stroke: "black",
|
|
2663
|
-
strokeOpacity: "0.45",
|
|
2664
|
-
strokeWidth: "1.5",
|
|
2665
|
-
strokeLinecap: "round",
|
|
2666
|
-
strokeLinejoin: "round"
|
|
2667
|
-
})
|
|
2668
|
-
]
|
|
2669
|
-
});
|
|
2670
|
-
//#endregion
|
|
2671
2637
|
//#region src/hooks/useDebounce.ts
|
|
2672
2638
|
function useDebounce(value, delay = 500) {
|
|
2673
2639
|
const [debouncedValue, setDebouncedValue] = (0, react.useState)(value);
|
|
@@ -2685,42 +2651,42 @@ function useDebounce(value, delay = 500) {
|
|
|
2685
2651
|
//#region src/view/components/ApiPage/components/AddParameterDrawer.tsx
|
|
2686
2652
|
const PARAM_IN_OPTIONS = [
|
|
2687
2653
|
{
|
|
2688
|
-
label: "
|
|
2654
|
+
label: "QUERY",
|
|
2689
2655
|
value: "query"
|
|
2690
2656
|
},
|
|
2691
2657
|
{
|
|
2692
|
-
label: "
|
|
2658
|
+
label: "HEADER",
|
|
2693
2659
|
value: "header"
|
|
2694
2660
|
},
|
|
2695
2661
|
{
|
|
2696
|
-
label: "
|
|
2662
|
+
label: "PATH",
|
|
2697
2663
|
value: "path"
|
|
2698
2664
|
}
|
|
2699
2665
|
];
|
|
2700
2666
|
const RESPONSE_PARAM_IN_OPTIONS = PARAM_IN_OPTIONS.filter((o) => o.value === "header");
|
|
2701
2667
|
const PARAM_TYPE_OPTIONS = [
|
|
2702
2668
|
{
|
|
2703
|
-
label: "
|
|
2669
|
+
label: "STRING",
|
|
2704
2670
|
value: "string"
|
|
2705
2671
|
},
|
|
2706
2672
|
{
|
|
2707
|
-
label: "
|
|
2673
|
+
label: "NUMBER",
|
|
2708
2674
|
value: "number"
|
|
2709
2675
|
},
|
|
2710
2676
|
{
|
|
2711
|
-
label: "
|
|
2677
|
+
label: "INTEGER",
|
|
2712
2678
|
value: "integer"
|
|
2713
2679
|
},
|
|
2714
2680
|
{
|
|
2715
|
-
label: "
|
|
2681
|
+
label: "BOOLEAN",
|
|
2716
2682
|
value: "boolean"
|
|
2717
2683
|
},
|
|
2718
2684
|
{
|
|
2719
|
-
label: "
|
|
2685
|
+
label: "ARRAY",
|
|
2720
2686
|
value: "array"
|
|
2721
2687
|
},
|
|
2722
2688
|
{
|
|
2723
|
-
label: "
|
|
2689
|
+
label: "OBJECT",
|
|
2724
2690
|
value: "object"
|
|
2725
2691
|
}
|
|
2726
2692
|
];
|
|
@@ -3248,14 +3214,9 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3248
3214
|
children: [
|
|
3249
3215
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
3250
3216
|
className: cx("modalHead"),
|
|
3251
|
-
children: [/* @__PURE__ */ (0, react_jsx_runtime.
|
|
3217
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
3252
3218
|
className: cx("modalTitle"),
|
|
3253
|
-
children:
|
|
3254
|
-
mode === "edit" ? "Edit" : "Add",
|
|
3255
|
-
" Parameter to ",
|
|
3256
|
-
endpointName,
|
|
3257
|
-
" endpoint"
|
|
3258
|
-
]
|
|
3219
|
+
children: mode === "edit" ? `Edit ${paramName} parameter` : `Add Parameter to ${endpointName} endpoint`
|
|
3259
3220
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)("button", {
|
|
3260
3221
|
className: cx("modalCloseBtn"),
|
|
3261
3222
|
onClick: () => setConfirmModalOpen(false),
|
|
@@ -3272,10 +3233,9 @@ const AddParameterDrawer = ({ open, onClose, onAdd, onEdit, mode = "add", initia
|
|
|
3272
3233
|
mode === "edit" ? "edit" : "add",
|
|
3273
3234
|
" ",
|
|
3274
3235
|
paramName,
|
|
3275
|
-
" parameter
|
|
3276
|
-
" ",
|
|
3277
|
-
|
|
3278
|
-
" endpoint?"
|
|
3236
|
+
" parameter",
|
|
3237
|
+
mode === "add" ? ` to ${endpointName} endpoint` : "",
|
|
3238
|
+
"?"
|
|
3279
3239
|
]
|
|
3280
3240
|
})
|
|
3281
3241
|
}),
|
|
@@ -3333,7 +3293,7 @@ const buildViewParamRows = (params) => params.map((p, idx) => ({
|
|
|
3333
3293
|
description: p.description ?? "",
|
|
3334
3294
|
enum: p.enum ?? []
|
|
3335
3295
|
}));
|
|
3336
|
-
const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse, endpointNames, endpointDescs, endpointTags, availableTags, onEndpointNameChange, onEndpointDescChange, onEndpointTagsChange, endpointParams, onAddParameter, onEditParameter, onDeleteParameter, endpointResponseParams, onAddResponseParameter, onEditResponseParameter, onDeleteResponseParameter, onRequestContentChange, onResponseContentChange, requestBodySchemas, responseBodySchemas, mode = "edit", selectedEndpointKey }) => {
|
|
3296
|
+
const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse, endpointNames, endpointDescs, endpointTags, availableTags, onEndpointNameChange, onEndpointDescChange, onEndpointTagsChange, endpointParams, onAddParameter, onEditParameter, onDeleteParameter, endpointResponseParams, onAddResponseParameter, onEditResponseParameter, onDeleteResponseParameter, onRequestContentChange, onResponseContentChange, resetKey, requestBodySchemas, responseBodySchemas, mode = "edit", selectedEndpointKey }) => {
|
|
3337
3297
|
const [expandedId, setExpandedId] = (0, react$1.useState)(null);
|
|
3338
3298
|
const [activeTab, setActiveTab] = (0, react$1.useState)("general");
|
|
3339
3299
|
(0, react$1.useEffect)(() => {
|
|
@@ -3385,6 +3345,30 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3385
3345
|
const debouncedResponseSearches = useDebounce(responseSearches);
|
|
3386
3346
|
const [editableRequestContent, setEditableRequestContent] = (0, react$1.useState)({});
|
|
3387
3347
|
const [editableResponseContent, setEditableResponseContent] = (0, react$1.useState)({});
|
|
3348
|
+
(0, react$1.useEffect)(() => {
|
|
3349
|
+
openRequestPanels.forEach((epId) => {
|
|
3350
|
+
const val = requestBodySchemas?.[epId];
|
|
3351
|
+
const json = val ? JSON.stringify(val, null, 2) : "";
|
|
3352
|
+
setEditableRequestContent((prev) => ({
|
|
3353
|
+
...prev,
|
|
3354
|
+
[epId]: json
|
|
3355
|
+
}));
|
|
3356
|
+
});
|
|
3357
|
+
openResponsePanels.forEach((epId) => {
|
|
3358
|
+
const val = responseBodySchemas?.[epId];
|
|
3359
|
+
const json = val ? JSON.stringify(val, null, 2) : "";
|
|
3360
|
+
setEditableResponseContent((prev) => ({
|
|
3361
|
+
...prev,
|
|
3362
|
+
[epId]: json
|
|
3363
|
+
}));
|
|
3364
|
+
});
|
|
3365
|
+
}, [
|
|
3366
|
+
resetKey,
|
|
3367
|
+
openRequestPanels,
|
|
3368
|
+
openResponsePanels,
|
|
3369
|
+
requestBodySchemas,
|
|
3370
|
+
responseBodySchemas
|
|
3371
|
+
]);
|
|
3388
3372
|
(0, react$1.useEffect)(() => {
|
|
3389
3373
|
if (!openRequestPanels.size) return;
|
|
3390
3374
|
openRequestPanels.forEach((epId) => {
|
|
@@ -3450,10 +3434,29 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3450
3434
|
flexDirection: "column",
|
|
3451
3435
|
width: "100%",
|
|
3452
3436
|
flexShrink: 0,
|
|
3437
|
+
flex: 1,
|
|
3438
|
+
minHeight: 0,
|
|
3439
|
+
"& .ant-tabs": {
|
|
3440
|
+
height: "100%",
|
|
3441
|
+
display: "flex",
|
|
3442
|
+
flexDirection: "column"
|
|
3443
|
+
},
|
|
3453
3444
|
"& .ant-tabs-content-holder": {
|
|
3445
|
+
flex: 1,
|
|
3446
|
+
display: "flex",
|
|
3447
|
+
flexDirection: "column",
|
|
3454
3448
|
background: token.colorBgElevated,
|
|
3455
3449
|
borderRadius: token.borderRadiusLG,
|
|
3456
3450
|
padding: `${token.paddingLG}px ${token.paddingLG}px 48px`
|
|
3451
|
+
},
|
|
3452
|
+
"& .ant-tabs-content": {
|
|
3453
|
+
flex: 1,
|
|
3454
|
+
minHeight: 0
|
|
3455
|
+
},
|
|
3456
|
+
"& .ant-tabs-tabpane-active": {
|
|
3457
|
+
height: "100%",
|
|
3458
|
+
display: "flex",
|
|
3459
|
+
flexDirection: "column"
|
|
3457
3460
|
}
|
|
3458
3461
|
},
|
|
3459
3462
|
[scope("head")]: {
|
|
@@ -3556,7 +3559,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3556
3559
|
display: "flex",
|
|
3557
3560
|
alignItems: "center",
|
|
3558
3561
|
justifyContent: "space-between",
|
|
3559
|
-
paddingBottom:
|
|
3562
|
+
paddingBottom: "18.5px",
|
|
3560
3563
|
borderBottom: `1px solid ${token.colorBorder}`,
|
|
3561
3564
|
width: "100%"
|
|
3562
3565
|
},
|
|
@@ -3631,7 +3634,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3631
3634
|
alignItems: "center",
|
|
3632
3635
|
justifyContent: "space-between",
|
|
3633
3636
|
width: "100%",
|
|
3634
|
-
padding: `12px
|
|
3637
|
+
padding: `12px 0px`,
|
|
3635
3638
|
borderBottom: `1px solid ${token.colorBorderSecondary}`,
|
|
3636
3639
|
background: token.colorBgContainer,
|
|
3637
3640
|
"&:last-child": { borderBottom: "none" }
|
|
@@ -3664,6 +3667,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3664
3667
|
whiteSpace: "nowrap",
|
|
3665
3668
|
maxWidth: 160
|
|
3666
3669
|
},
|
|
3670
|
+
[scope("param-detail-value-name")]: {
|
|
3671
|
+
overflow: "hidden",
|
|
3672
|
+
textOverflow: "ellipsis",
|
|
3673
|
+
whiteSpace: "nowrap",
|
|
3674
|
+
maxWidth: 200,
|
|
3675
|
+
display: "block"
|
|
3676
|
+
},
|
|
3667
3677
|
[scope("param-enum-container")]: {
|
|
3668
3678
|
display: "inline-flex",
|
|
3669
3679
|
flexDirection: "row",
|
|
@@ -3802,7 +3812,6 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3802
3812
|
alignItems: "center",
|
|
3803
3813
|
position: "relative",
|
|
3804
3814
|
paddingTop: 20,
|
|
3805
|
-
paddingBottom: 8,
|
|
3806
3815
|
paddingLeft: 24,
|
|
3807
3816
|
paddingRight: 24,
|
|
3808
3817
|
width: "100%"
|
|
@@ -3828,7 +3837,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3828
3837
|
border: "none",
|
|
3829
3838
|
background: "transparent",
|
|
3830
3839
|
padding: 0,
|
|
3831
|
-
color: token.
|
|
3840
|
+
color: token.colorTextTertiary,
|
|
3832
3841
|
fontSize: 16,
|
|
3833
3842
|
lineHeight: 1,
|
|
3834
3843
|
"&:hover": {
|
|
@@ -3841,7 +3850,6 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3841
3850
|
alignItems: "center",
|
|
3842
3851
|
paddingLeft: 24,
|
|
3843
3852
|
paddingRight: 24,
|
|
3844
|
-
paddingBottom: 12,
|
|
3845
3853
|
height: 56,
|
|
3846
3854
|
width: "100%"
|
|
3847
3855
|
},
|
|
@@ -3968,6 +3976,8 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
3968
3976
|
alignItems: "center",
|
|
3969
3977
|
justifyContent: "center",
|
|
3970
3978
|
width: "100%",
|
|
3979
|
+
flex: 1,
|
|
3980
|
+
minHeight: 0,
|
|
3971
3981
|
"& .ant-empty": {
|
|
3972
3982
|
margin: 0,
|
|
3973
3983
|
display: "flex",
|
|
@@ -4063,9 +4073,21 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4063
4073
|
title: "Parameter",
|
|
4064
4074
|
key: "parameter",
|
|
4065
4075
|
render: (_, row) => /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
4066
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4067
|
-
|
|
4068
|
-
|
|
4076
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tooltip, {
|
|
4077
|
+
title: row.name,
|
|
4078
|
+
placement: "bottom",
|
|
4079
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4080
|
+
className: cx("view-param-name"),
|
|
4081
|
+
style: {
|
|
4082
|
+
display: "inline-block",
|
|
4083
|
+
maxWidth: 200,
|
|
4084
|
+
overflow: "hidden",
|
|
4085
|
+
textOverflow: "ellipsis",
|
|
4086
|
+
whiteSpace: "nowrap",
|
|
4087
|
+
verticalAlign: "bottom"
|
|
4088
|
+
},
|
|
4089
|
+
children: row.name
|
|
4090
|
+
})
|
|
4069
4091
|
}),
|
|
4070
4092
|
row.type && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4071
4093
|
className: cx("view-param-type"),
|
|
@@ -4083,9 +4105,21 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4083
4105
|
{
|
|
4084
4106
|
title: "Description",
|
|
4085
4107
|
key: "description",
|
|
4086
|
-
render: (_, row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4087
|
-
|
|
4088
|
-
|
|
4108
|
+
render: (_, row) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tooltip, {
|
|
4109
|
+
title: row.description || "--",
|
|
4110
|
+
placement: "bottom",
|
|
4111
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4112
|
+
className: cx("view-param-desc"),
|
|
4113
|
+
style: {
|
|
4114
|
+
display: "inline-block",
|
|
4115
|
+
maxWidth: 200,
|
|
4116
|
+
overflow: "hidden",
|
|
4117
|
+
textOverflow: "ellipsis",
|
|
4118
|
+
whiteSpace: "nowrap",
|
|
4119
|
+
verticalAlign: "bottom"
|
|
4120
|
+
},
|
|
4121
|
+
children: row.description || "--"
|
|
4122
|
+
})
|
|
4089
4123
|
})
|
|
4090
4124
|
},
|
|
4091
4125
|
{
|
|
@@ -4264,6 +4298,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4264
4298
|
ghost: true,
|
|
4265
4299
|
type: "primary",
|
|
4266
4300
|
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}),
|
|
4301
|
+
style: {
|
|
4302
|
+
height: 32,
|
|
4303
|
+
paddingInline: 8
|
|
4304
|
+
},
|
|
4267
4305
|
onClick: () => {
|
|
4268
4306
|
setDrawerSource("request");
|
|
4269
4307
|
setParamDrawerMode("add");
|
|
@@ -4300,6 +4338,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4300
4338
|
ghost: true,
|
|
4301
4339
|
type: "primary",
|
|
4302
4340
|
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}),
|
|
4341
|
+
style: {
|
|
4342
|
+
height: 32,
|
|
4343
|
+
paddingInline: 8
|
|
4344
|
+
},
|
|
4303
4345
|
onClick: () => {
|
|
4304
4346
|
setDrawerSource("request");
|
|
4305
4347
|
setParamDrawerMode("add");
|
|
@@ -4381,9 +4423,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4381
4423
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4382
4424
|
className: cx("param-detail-label"),
|
|
4383
4425
|
children: "Parameter Name"
|
|
4384
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4385
|
-
|
|
4386
|
-
|
|
4426
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tooltip, {
|
|
4427
|
+
title: param.name,
|
|
4428
|
+
placement: "bottom",
|
|
4429
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4430
|
+
className: cx("param-detail-value", "param-detail-value-name"),
|
|
4431
|
+
children: param.name
|
|
4432
|
+
})
|
|
4387
4433
|
})]
|
|
4388
4434
|
}), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
4389
4435
|
className: cx("param-detail-cell"),
|
|
@@ -4459,9 +4505,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4459
4505
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4460
4506
|
className: cx("param-detail-label"),
|
|
4461
4507
|
children: "Parameter Name"
|
|
4462
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4463
|
-
|
|
4464
|
-
|
|
4508
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tooltip, {
|
|
4509
|
+
title: param.name,
|
|
4510
|
+
placement: "bottom",
|
|
4511
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4512
|
+
className: cx("param-detail-value", "param-detail-value-name"),
|
|
4513
|
+
children: param.name
|
|
4514
|
+
})
|
|
4465
4515
|
})]
|
|
4466
4516
|
}),
|
|
4467
4517
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -4500,7 +4550,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4500
4550
|
margin: 0,
|
|
4501
4551
|
paddingLeft: 16
|
|
4502
4552
|
},
|
|
4503
|
-
children: param.enum.map((e) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: e }, e))
|
|
4553
|
+
children: param.enum.slice(1).map((e) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: e }, e))
|
|
4504
4554
|
}),
|
|
4505
4555
|
placement: "bottom",
|
|
4506
4556
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
@@ -4528,9 +4578,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4528
4578
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4529
4579
|
className: cx("param-detail-label"),
|
|
4530
4580
|
children: "Description"
|
|
4531
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4532
|
-
|
|
4533
|
-
|
|
4581
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tooltip, {
|
|
4582
|
+
title: param.description || "—",
|
|
4583
|
+
placement: "bottom",
|
|
4584
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4585
|
+
className: cx("param-detail-value", "param-detail-value--ellipsis"),
|
|
4586
|
+
children: param.description || "—"
|
|
4587
|
+
})
|
|
4534
4588
|
})]
|
|
4535
4589
|
})
|
|
4536
4590
|
]
|
|
@@ -4683,6 +4737,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4683
4737
|
ghost: true,
|
|
4684
4738
|
type: "primary",
|
|
4685
4739
|
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}),
|
|
4740
|
+
style: {
|
|
4741
|
+
height: 32,
|
|
4742
|
+
paddingInline: 8
|
|
4743
|
+
},
|
|
4686
4744
|
onClick: () => {
|
|
4687
4745
|
setDrawerSource("response");
|
|
4688
4746
|
setParamDrawerMode("add");
|
|
@@ -4773,6 +4831,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4773
4831
|
ghost: true,
|
|
4774
4832
|
type: "primary",
|
|
4775
4833
|
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}),
|
|
4834
|
+
style: {
|
|
4835
|
+
height: 32,
|
|
4836
|
+
paddingInline: 8
|
|
4837
|
+
},
|
|
4776
4838
|
onClick: () => {
|
|
4777
4839
|
setDrawerSource("response");
|
|
4778
4840
|
setParamDrawerMode("add");
|
|
@@ -4932,9 +4994,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4932
4994
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
4933
4995
|
className: cx("param-detail-label"),
|
|
4934
4996
|
children: "Parameter Name"
|
|
4935
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
4936
|
-
|
|
4937
|
-
|
|
4997
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tooltip, {
|
|
4998
|
+
title: param.name,
|
|
4999
|
+
placement: "bottom",
|
|
5000
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5001
|
+
className: cx("param-detail-value", "param-detail-value-name"),
|
|
5002
|
+
children: param.name
|
|
5003
|
+
})
|
|
4938
5004
|
})]
|
|
4939
5005
|
}),
|
|
4940
5006
|
/* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
@@ -4973,7 +5039,7 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
4973
5039
|
margin: 0,
|
|
4974
5040
|
paddingLeft: 16
|
|
4975
5041
|
},
|
|
4976
|
-
children: param.enum.map((e) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: e }, e))
|
|
5042
|
+
children: param.enum.slice(1).map((e) => /* @__PURE__ */ (0, react_jsx_runtime.jsx)("li", { children: e }, e))
|
|
4977
5043
|
}),
|
|
4978
5044
|
placement: "bottom",
|
|
4979
5045
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
@@ -5001,9 +5067,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
5001
5067
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5002
5068
|
className: cx("param-detail-label"),
|
|
5003
5069
|
children: "Description"
|
|
5004
|
-
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(
|
|
5005
|
-
|
|
5006
|
-
|
|
5070
|
+
}), /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tooltip, {
|
|
5071
|
+
title: param.description || "—",
|
|
5072
|
+
placement: "bottom",
|
|
5073
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5074
|
+
className: cx("param-detail-value", "param-detail-value--ellipsis"),
|
|
5075
|
+
children: param.description || "—"
|
|
5076
|
+
})
|
|
5007
5077
|
})]
|
|
5008
5078
|
})
|
|
5009
5079
|
]
|
|
@@ -5066,20 +5136,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
5066
5136
|
className: cx("param-row", openResponsePanels.has(ep.id) ? "param-row--open" : ""),
|
|
5067
5137
|
style: { marginTop: token.margin },
|
|
5068
5138
|
onClick: () => toggleResponsePanel(ep.id),
|
|
5069
|
-
children: [
|
|
5070
|
-
|
|
5071
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
5072
|
-
style: {
|
|
5073
|
-
children:
|
|
5074
|
-
|
|
5075
|
-
|
|
5076
|
-
})]
|
|
5077
|
-
}),
|
|
5078
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoCircle, { style: {
|
|
5079
|
-
width: 24,
|
|
5080
|
-
height: 24
|
|
5081
|
-
} })
|
|
5082
|
-
]
|
|
5139
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.DownOutlined, { className: cx("param-row-icon", openResponsePanels.has(ep.id) ? "param-row-icon--open" : "") }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
5140
|
+
style: { fontSize: token.fontSize },
|
|
5141
|
+
children: ["Response ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
5142
|
+
style: { color: token.colorError },
|
|
5143
|
+
children: "*"
|
|
5144
|
+
})]
|
|
5145
|
+
})]
|
|
5083
5146
|
}),
|
|
5084
5147
|
openResponsePanels.has(ep.id) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
5085
5148
|
className: cx("code-panel"),
|
|
@@ -5530,6 +5593,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
5530
5593
|
ghost: true,
|
|
5531
5594
|
type: "primary",
|
|
5532
5595
|
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}),
|
|
5596
|
+
style: {
|
|
5597
|
+
height: 32,
|
|
5598
|
+
paddingInline: 8
|
|
5599
|
+
},
|
|
5533
5600
|
onClick: () => {
|
|
5534
5601
|
setDrawerSource("request");
|
|
5535
5602
|
setParamDrawerMode("add");
|
|
@@ -5566,6 +5633,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
5566
5633
|
ghost: true,
|
|
5567
5634
|
type: "primary",
|
|
5568
5635
|
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}),
|
|
5636
|
+
style: {
|
|
5637
|
+
height: 32,
|
|
5638
|
+
paddingInline: 8
|
|
5639
|
+
},
|
|
5569
5640
|
onClick: () => {
|
|
5570
5641
|
setDrawerSource("request");
|
|
5571
5642
|
setParamDrawerMode("add");
|
|
@@ -5947,6 +6018,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
5947
6018
|
ghost: true,
|
|
5948
6019
|
type: "primary",
|
|
5949
6020
|
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}),
|
|
6021
|
+
style: {
|
|
6022
|
+
height: 32,
|
|
6023
|
+
paddingInline: 8
|
|
6024
|
+
},
|
|
5950
6025
|
onClick: () => {
|
|
5951
6026
|
setDrawerSource("response");
|
|
5952
6027
|
setParamDrawerMode("add");
|
|
@@ -6037,6 +6112,10 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
6037
6112
|
ghost: true,
|
|
6038
6113
|
type: "primary",
|
|
6039
6114
|
icon: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.PlusOutlined, {}),
|
|
6115
|
+
style: {
|
|
6116
|
+
height: 32,
|
|
6117
|
+
paddingInline: 8
|
|
6118
|
+
},
|
|
6040
6119
|
onClick: () => {
|
|
6041
6120
|
setDrawerSource("response");
|
|
6042
6121
|
setParamDrawerMode("add");
|
|
@@ -6330,20 +6409,13 @@ const EndpointsSection = ({ endpointsByTag, collapsed = false, onToggleCollapse,
|
|
|
6330
6409
|
className: cx("param-row", openResponsePanels.has(ep.id) ? "param-row--open" : ""),
|
|
6331
6410
|
style: { marginTop: token.margin },
|
|
6332
6411
|
onClick: () => toggleResponsePanel(ep.id),
|
|
6333
|
-
children: [
|
|
6334
|
-
|
|
6335
|
-
/* @__PURE__ */ (0, react_jsx_runtime.
|
|
6336
|
-
style: {
|
|
6337
|
-
children:
|
|
6338
|
-
|
|
6339
|
-
|
|
6340
|
-
})]
|
|
6341
|
-
}),
|
|
6342
|
-
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(InfoCircle, { style: {
|
|
6343
|
-
width: 24,
|
|
6344
|
-
height: 24
|
|
6345
|
-
} })
|
|
6346
|
-
]
|
|
6412
|
+
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.DownOutlined, { className: cx("param-row-icon", openResponsePanels.has(ep.id) ? "param-row-icon--open" : "") }), /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
6413
|
+
style: { fontSize: token.fontSize },
|
|
6414
|
+
children: ["Response ", /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
6415
|
+
style: { color: token.colorError },
|
|
6416
|
+
children: "*"
|
|
6417
|
+
})]
|
|
6418
|
+
})]
|
|
6347
6419
|
}),
|
|
6348
6420
|
openResponsePanels.has(ep.id) && /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|
|
6349
6421
|
className: cx("code-panel"),
|
|
@@ -7546,7 +7618,8 @@ const EditModeSidebar = ({ selectedItem, onSelectItem, endpoints, hasGeneralErro
|
|
|
7546
7618
|
[scope("badge")]: {
|
|
7547
7619
|
minWidth: "3.75rem",
|
|
7548
7620
|
textAlign: "center",
|
|
7549
|
-
border: "none"
|
|
7621
|
+
border: "none",
|
|
7622
|
+
fontSize: 14
|
|
7550
7623
|
},
|
|
7551
7624
|
[scope("path")]: {
|
|
7552
7625
|
fontSize: token.fontSize,
|
|
@@ -8225,37 +8298,28 @@ const buildRequestData = (params, token) => [...params].sort((a, b) => a.require
|
|
|
8225
8298
|
if (p.schema?.type === "array" && p.schema?.items?.type) typeLabel = `${p.schema.type}_${p.schema.items.type}`;
|
|
8226
8299
|
return {
|
|
8227
8300
|
key: index,
|
|
8228
|
-
param: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
8229
|
-
|
|
8230
|
-
|
|
8231
|
-
|
|
8232
|
-
|
|
8233
|
-
|
|
8234
|
-
|
|
8235
|
-
|
|
8236
|
-
|
|
8237
|
-
|
|
8238
|
-
|
|
8239
|
-
|
|
8240
|
-
|
|
8241
|
-
|
|
8242
|
-
|
|
8243
|
-
|
|
8244
|
-
|
|
8245
|
-
|
|
8246
|
-
|
|
8247
|
-
|
|
8248
|
-
|
|
8249
|
-
})
|
|
8250
|
-
const buildHeaderData = (headers, token) => {
|
|
8251
|
-
if (!headers) return [];
|
|
8252
|
-
return Object.entries(headers).sort(([, a], [, b]) => a.required === b.required ? 0 : a.required ? -1 : 1).map(([name, header], idx) => {
|
|
8253
|
-
let typeLabel = header.schema?.type;
|
|
8254
|
-
if (header.schema?.type === "array" && header.schema?.items?.type) typeLabel = `${header.schema.type}_${header.schema.items.type}`;
|
|
8255
|
-
return {
|
|
8256
|
-
key: idx,
|
|
8257
|
-
param: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
8258
|
-
name,
|
|
8301
|
+
param: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
8302
|
+
style: {
|
|
8303
|
+
display: "flex",
|
|
8304
|
+
alignItems: "center",
|
|
8305
|
+
gap: 4
|
|
8306
|
+
},
|
|
8307
|
+
children: [
|
|
8308
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tooltip, {
|
|
8309
|
+
title: p.name,
|
|
8310
|
+
placement: "bottom",
|
|
8311
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8312
|
+
style: {
|
|
8313
|
+
display: "inline-block",
|
|
8314
|
+
maxWidth: 200,
|
|
8315
|
+
overflow: "hidden",
|
|
8316
|
+
textOverflow: "ellipsis",
|
|
8317
|
+
whiteSpace: "nowrap",
|
|
8318
|
+
verticalAlign: "bottom"
|
|
8319
|
+
},
|
|
8320
|
+
children: p.name
|
|
8321
|
+
})
|
|
8322
|
+
}),
|
|
8259
8323
|
typeLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8260
8324
|
style: {
|
|
8261
8325
|
color: token.colorTextTertiary,
|
|
@@ -8264,50 +8328,84 @@ const buildHeaderData = (headers, token) => {
|
|
|
8264
8328
|
},
|
|
8265
8329
|
children: typeLabel
|
|
8266
8330
|
}),
|
|
8267
|
-
|
|
8331
|
+
p.required ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8268
8332
|
style: { color: token.colorError },
|
|
8269
8333
|
children: "*"
|
|
8270
8334
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8271
8335
|
style: { color: token.colorSuccess },
|
|
8272
8336
|
children: "Optional"
|
|
8273
8337
|
})
|
|
8274
|
-
]
|
|
8338
|
+
]
|
|
8339
|
+
}),
|
|
8340
|
+
desc: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tooltip, {
|
|
8341
|
+
title: p.description || "--",
|
|
8342
|
+
placement: "bottom",
|
|
8343
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8344
|
+
style: {
|
|
8345
|
+
display: "inline-block",
|
|
8346
|
+
maxWidth: 300,
|
|
8347
|
+
overflow: "hidden",
|
|
8348
|
+
textOverflow: "ellipsis",
|
|
8349
|
+
whiteSpace: "nowrap",
|
|
8350
|
+
verticalAlign: "bottom"
|
|
8351
|
+
},
|
|
8352
|
+
children: p.description || "--"
|
|
8353
|
+
})
|
|
8354
|
+
}),
|
|
8355
|
+
enum: p.schema?.enum ? renderEnumTags(p.schema.enum, token) : "--"
|
|
8356
|
+
};
|
|
8357
|
+
});
|
|
8358
|
+
const buildHeaderData = (headers, token) => {
|
|
8359
|
+
if (!headers) return [];
|
|
8360
|
+
return Object.entries(headers).sort(([, a], [, b]) => a.required === b.required ? 0 : a.required ? -1 : 1).map(([name, header], idx) => {
|
|
8361
|
+
let typeLabel = header.schema?.type;
|
|
8362
|
+
if (header.schema?.type === "array" && header.schema?.items?.type) typeLabel = `${header.schema.type}_${header.schema.items.type}`;
|
|
8363
|
+
return {
|
|
8364
|
+
key: idx,
|
|
8365
|
+
param: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", {
|
|
8366
|
+
style: {
|
|
8367
|
+
display: "flex",
|
|
8368
|
+
alignItems: "center",
|
|
8369
|
+
gap: 4
|
|
8370
|
+
},
|
|
8371
|
+
children: [
|
|
8372
|
+
/* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Tooltip, {
|
|
8373
|
+
title: name,
|
|
8374
|
+
placement: "bottom",
|
|
8375
|
+
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8376
|
+
style: {
|
|
8377
|
+
display: "inline-block",
|
|
8378
|
+
maxWidth: 200,
|
|
8379
|
+
overflow: "hidden",
|
|
8380
|
+
textOverflow: "ellipsis",
|
|
8381
|
+
whiteSpace: "nowrap",
|
|
8382
|
+
verticalAlign: "bottom"
|
|
8383
|
+
},
|
|
8384
|
+
children: name
|
|
8385
|
+
})
|
|
8386
|
+
}),
|
|
8387
|
+
typeLabel && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8388
|
+
style: {
|
|
8389
|
+
color: token.colorTextTertiary,
|
|
8390
|
+
marginLeft: "0.25rem",
|
|
8391
|
+
marginRight: "0.25rem"
|
|
8392
|
+
},
|
|
8393
|
+
children: typeLabel
|
|
8394
|
+
}),
|
|
8395
|
+
header.required ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8396
|
+
style: { color: token.colorError },
|
|
8397
|
+
children: "*"
|
|
8398
|
+
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8399
|
+
style: { color: token.colorSuccess },
|
|
8400
|
+
children: "Optional"
|
|
8401
|
+
})
|
|
8402
|
+
]
|
|
8403
|
+
}, idx),
|
|
8275
8404
|
desc: header.description || "--",
|
|
8276
8405
|
enum: header.schema?.enum ? renderEnumTags(header.schema.enum, token) : "--"
|
|
8277
8406
|
};
|
|
8278
8407
|
});
|
|
8279
8408
|
};
|
|
8280
|
-
const buildRequestBodyData = (requestBody, token) => {
|
|
8281
|
-
if (!requestBody?.content) return [];
|
|
8282
|
-
const contentType = Object.keys(requestBody.content)[0];
|
|
8283
|
-
const schema = requestBody.content[contentType]?.schema;
|
|
8284
|
-
if (!schema) return [];
|
|
8285
|
-
const properties = schema.properties ?? {};
|
|
8286
|
-
const required = schema.required ?? [];
|
|
8287
|
-
return Object.entries(properties).map(([name, prop], idx) => ({
|
|
8288
|
-
key: idx,
|
|
8289
|
-
param: /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("span", { children: [
|
|
8290
|
-
name,
|
|
8291
|
-
prop.type && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8292
|
-
style: {
|
|
8293
|
-
color: token.colorTextTertiary,
|
|
8294
|
-
marginLeft: "0.25rem",
|
|
8295
|
-
marginRight: "0.25rem"
|
|
8296
|
-
},
|
|
8297
|
-
children: prop.type
|
|
8298
|
-
}),
|
|
8299
|
-
required.includes(name) ? /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8300
|
-
style: { color: token.colorError },
|
|
8301
|
-
children: "*"
|
|
8302
|
-
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsx)("span", {
|
|
8303
|
-
style: { color: token.colorSuccess },
|
|
8304
|
-
children: "Optional"
|
|
8305
|
-
})
|
|
8306
|
-
] }),
|
|
8307
|
-
desc: prop.description || "--",
|
|
8308
|
-
enum: prop.enum ? renderEnumTags(prop.enum, token) : "--"
|
|
8309
|
-
}));
|
|
8310
|
-
};
|
|
8311
8409
|
const EndpointPage = () => {
|
|
8312
8410
|
const { selectedEndpoint, selectedApi, selectedStatusCode, setSelectedNodeKey, setFocusedContent, setFocusedTag, setActiveRequestTab } = useStore(({ view }) => view);
|
|
8313
8411
|
const [activeTabKey, setActiveTabKey] = (0, react$1.useState)("header");
|
|
@@ -8356,7 +8454,6 @@ const EndpointPage = () => {
|
|
|
8356
8454
|
const headerParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "header") || [], token);
|
|
8357
8455
|
const pathParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "path") || [], token);
|
|
8358
8456
|
const queryParams = buildRequestData(selectedEndpoint?.parameters?.filter((p) => p.in === "query") || [], token);
|
|
8359
|
-
const requestBodyData = buildRequestBodyData(selectedEndpoint?.requestBody, token);
|
|
8360
8457
|
const requestTabs = [
|
|
8361
8458
|
{
|
|
8362
8459
|
key: "header",
|
|
@@ -8393,19 +8490,7 @@ const EndpointPage = () => {
|
|
|
8393
8490
|
size: "small",
|
|
8394
8491
|
rowClassName: (_, idx) => cx(idx % 2 === 0 ? "row-even" : "row-odd")
|
|
8395
8492
|
})
|
|
8396
|
-
}
|
|
8397
|
-
...requestBodyData.length > 0 ? [{
|
|
8398
|
-
key: "requestBody",
|
|
8399
|
-
label: "Request Body",
|
|
8400
|
-
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(antd.Table, {
|
|
8401
|
-
columns: requestColumns,
|
|
8402
|
-
dataSource: requestBodyData,
|
|
8403
|
-
pagination: false,
|
|
8404
|
-
bordered: true,
|
|
8405
|
-
size: "small",
|
|
8406
|
-
rowClassName: (_, idx) => cx(idx % 2 === 0 ? "row-even" : "row-odd")
|
|
8407
|
-
})
|
|
8408
|
-
}] : []
|
|
8493
|
+
}
|
|
8409
8494
|
].filter((t) => t !== null);
|
|
8410
8495
|
(0, react$1.useEffect)(() => {
|
|
8411
8496
|
const firstKey = requestTabs[0]?.key ?? "header";
|
|
@@ -9110,9 +9195,10 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
|
|
|
9110
9195
|
gap: token.marginLG,
|
|
9111
9196
|
height: "100%"
|
|
9112
9197
|
},
|
|
9113
|
-
[scope("section")]: {
|
|
9114
|
-
|
|
9115
|
-
|
|
9198
|
+
[scope("section")]: { flexShrink: 0 },
|
|
9199
|
+
[scope("section-grow")]: {
|
|
9200
|
+
flex: 1,
|
|
9201
|
+
minHeight: 0
|
|
9116
9202
|
},
|
|
9117
9203
|
[scope("docs-layout")]: {
|
|
9118
9204
|
display: "flex",
|
|
@@ -9295,7 +9381,7 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
|
|
|
9295
9381
|
const result = {};
|
|
9296
9382
|
Object.entries(rawFile.paths).forEach(([path, methods]) => {
|
|
9297
9383
|
Object.entries(methods).forEach(([method, operation]) => {
|
|
9298
|
-
const schema = operation.requestBody?.content?.["application/json"]?.
|
|
9384
|
+
const schema = operation.requestBody?.content?.["application/json"]?.example;
|
|
9299
9385
|
const epId = pathMethodToId[`${path}||${method}`];
|
|
9300
9386
|
if (epId && schema) result[epId] = schema;
|
|
9301
9387
|
});
|
|
@@ -9348,6 +9434,14 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
|
|
|
9348
9434
|
}
|
|
9349
9435
|
if (JSON.stringify(endpointParams) !== JSON.stringify(initialEndpointParams)) return true;
|
|
9350
9436
|
if (JSON.stringify(endpointResponseParams) !== JSON.stringify(initialEndpointResponseParams)) return true;
|
|
9437
|
+
if (JSON.stringify(endpointRequestBody) !== JSON.stringify(initialEndpointRequestBody)) {
|
|
9438
|
+
console.log("hasChanges: endpointRequestBody changed", {
|
|
9439
|
+
endpointRequestBody,
|
|
9440
|
+
initialEndpointRequestBody
|
|
9441
|
+
});
|
|
9442
|
+
return true;
|
|
9443
|
+
}
|
|
9444
|
+
if (JSON.stringify(endpointResponseBody) !== JSON.stringify(initialEndpointResponseBody)) return true;
|
|
9351
9445
|
return false;
|
|
9352
9446
|
}, [
|
|
9353
9447
|
selectedApi,
|
|
@@ -9362,7 +9456,11 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
|
|
|
9362
9456
|
endpointParams,
|
|
9363
9457
|
endpointResponseParams,
|
|
9364
9458
|
initialEndpointParams,
|
|
9365
|
-
initialEndpointResponseParams
|
|
9459
|
+
initialEndpointResponseParams,
|
|
9460
|
+
endpointRequestBody,
|
|
9461
|
+
initialEndpointRequestBody,
|
|
9462
|
+
endpointResponseBody,
|
|
9463
|
+
initialEndpointResponseBody
|
|
9366
9464
|
]);
|
|
9367
9465
|
(0, react$1.useEffect)(() => {
|
|
9368
9466
|
setBannerVisible(hasChanges);
|
|
@@ -9481,6 +9579,8 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
|
|
|
9481
9579
|
setEndpointTags({});
|
|
9482
9580
|
setEndpointParams(initialEndpointParams);
|
|
9483
9581
|
setEndpointResponseParams(initialEndpointResponseParams);
|
|
9582
|
+
setEndpointRequestBody(initialEndpointRequestBody);
|
|
9583
|
+
setEndpointResponseBody(initialEndpointResponseBody);
|
|
9484
9584
|
setLocalTags(tagMetadata);
|
|
9485
9585
|
setResetKey((prev) => prev + 1);
|
|
9486
9586
|
messageApi.success("Changes have been reset successfully.");
|
|
@@ -9570,7 +9670,7 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
|
|
|
9570
9670
|
if (!methodObjAny.requestBody) methodObjAny.requestBody = {};
|
|
9571
9671
|
const rb = methodObjAny.requestBody;
|
|
9572
9672
|
if (!rb.content) rb.content = {};
|
|
9573
|
-
rb.content["application/json"] = { schema };
|
|
9673
|
+
rb.content["application/json"] = { example: schema };
|
|
9574
9674
|
});
|
|
9575
9675
|
Object.entries(endpointResponseBody).forEach(([id, schema]) => {
|
|
9576
9676
|
const loc = idToPathMethod[id];
|
|
@@ -9747,15 +9847,16 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
|
|
|
9747
9847
|
display: "flex",
|
|
9748
9848
|
alignItems: "center",
|
|
9749
9849
|
gap: 8,
|
|
9750
|
-
padding: "8px 12px",
|
|
9850
|
+
padding: mode === "view" ? "8px 12px" : "0 12px",
|
|
9751
9851
|
border: "none",
|
|
9752
9852
|
cursor: "pointer",
|
|
9753
|
-
borderRadius: 8,
|
|
9853
|
+
borderRadius: mode === "view" ? 8 : 12,
|
|
9754
9854
|
fontFamily: token.fontFamily,
|
|
9755
9855
|
background: mode === "view" ? token.colorBgContainer : "transparent",
|
|
9756
9856
|
boxShadow: mode === "view" ? "0px 2px 4px -2px rgba(17,12,34,0.12)" : "none",
|
|
9757
9857
|
fontWeight: mode === "view" ? 700 : 400,
|
|
9758
|
-
fontSize:
|
|
9858
|
+
fontSize: token.fontSize,
|
|
9859
|
+
lineHeight: "22px",
|
|
9759
9860
|
color: token.colorText
|
|
9760
9861
|
},
|
|
9761
9862
|
children: [/* @__PURE__ */ (0, react_jsx_runtime.jsx)(_ant_design_icons.EyeOutlined, { style: { fontSize: 18 } }), "View"]
|
|
@@ -9857,10 +9958,11 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
|
|
|
9857
9958
|
})
|
|
9858
9959
|
}),
|
|
9859
9960
|
/* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
9860
|
-
className: cx("section"),
|
|
9961
|
+
className: cx("section", "section-grow"),
|
|
9861
9962
|
children: /* @__PURE__ */ (0, react_jsx_runtime.jsx)(EndpointsSection, {
|
|
9862
9963
|
mode,
|
|
9863
9964
|
endpointsByTag: getEndpointsByTag(),
|
|
9965
|
+
resetKey,
|
|
9864
9966
|
collapsed: endpointsCollapsed,
|
|
9865
9967
|
onToggleCollapse: () => setEndpointsCollapsed((c) => !c),
|
|
9866
9968
|
endpointNames,
|
|
@@ -9954,7 +10056,7 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
|
|
|
9954
10056
|
},
|
|
9955
10057
|
requestBodySchemas: endpointRequestBody,
|
|
9956
10058
|
responseBodySchemas: endpointResponseBody
|
|
9957
|
-
}
|
|
10059
|
+
})
|
|
9958
10060
|
})
|
|
9959
10061
|
] }) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)(react_jsx_runtime.Fragment, { children: [
|
|
9960
10062
|
selectedEditItem.type === "errors" && errorBox && /* @__PURE__ */ (0, react_jsx_runtime.jsx)("div", {
|
|
@@ -10114,8 +10216,9 @@ const ConsoleDocumentationLayout = ({ data, preSelectedApi, handleVisitLandingPa
|
|
|
10114
10216
|
} catch {}
|
|
10115
10217
|
},
|
|
10116
10218
|
requestBodySchemas: endpointRequestBody,
|
|
10117
|
-
responseBodySchemas: endpointResponseBody
|
|
10118
|
-
|
|
10219
|
+
responseBodySchemas: endpointResponseBody,
|
|
10220
|
+
resetKey
|
|
10221
|
+
})
|
|
10119
10222
|
] })
|
|
10120
10223
|
})]
|
|
10121
10224
|
}) : /* @__PURE__ */ (0, react_jsx_runtime.jsxs)("div", {
|