expresso-swagger 0.0.3 → 0.0.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.
- package/README.md +1 -1
- package/dist/lib/core/types.d.ts +2 -2
- package/dist/lib/index.js +30 -30
- package/dist/lib/index.mjs +30 -30
- package/dist/ui/assets/{index-DoriwYNb.js → index-B_Gv6IOQ.js} +7 -7
- package/dist/ui/assets/index-DTF2HIcR.css +1 -0
- package/dist/ui/index.html +2 -2
- package/package.json +1 -1
- package/dist/ui/assets/index-CYUE9YCk.css +0 -1
package/README.md
CHANGED
package/dist/lib/core/types.d.ts
CHANGED
|
@@ -16,12 +16,12 @@ export interface EndpointConfig {
|
|
|
16
16
|
method: HttpMethod;
|
|
17
17
|
baseUrl?: string;
|
|
18
18
|
group?: string;
|
|
19
|
-
|
|
19
|
+
name?: string;
|
|
20
20
|
description?: string;
|
|
21
21
|
tags?: string[];
|
|
22
22
|
params?: Record<string, ParamDefinition>;
|
|
23
23
|
query?: Record<string, ParamDefinition>;
|
|
24
|
-
body?: any
|
|
24
|
+
body?: string | Record<string, any>;
|
|
25
25
|
responses: Record<number | string, EndpointResponse>;
|
|
26
26
|
}
|
|
27
27
|
export interface ExpressoSwaggerInfo {
|
package/dist/lib/index.js
CHANGED
|
@@ -11778,7 +11778,7 @@ var require_lucide_react = __commonJS({
|
|
|
11778
11778
|
}
|
|
11779
11779
|
]
|
|
11780
11780
|
];
|
|
11781
|
-
var
|
|
11781
|
+
var Play = createLucideIcon("play", __iconNode$8e);
|
|
11782
11782
|
var __iconNode$8d = [
|
|
11783
11783
|
["path", { d: "M9 2v6", key: "17ngun" }],
|
|
11784
11784
|
["path", { d: "M15 2v6", key: "s7yy2p" }],
|
|
@@ -18035,7 +18035,7 @@ var require_lucide_react = __commonJS({
|
|
|
18035
18035
|
Plane,
|
|
18036
18036
|
PlaneLanding,
|
|
18037
18037
|
PlaneTakeoff,
|
|
18038
|
-
Play
|
|
18038
|
+
Play,
|
|
18039
18039
|
Plug,
|
|
18040
18040
|
Plug2,
|
|
18041
18041
|
PlugZap,
|
|
@@ -22062,7 +22062,7 @@ var require_lucide_react = __commonJS({
|
|
|
22062
22062
|
exports2.LucidePlane = Plane;
|
|
22063
22063
|
exports2.LucidePlaneLanding = PlaneLanding;
|
|
22064
22064
|
exports2.LucidePlaneTakeoff = PlaneTakeoff;
|
|
22065
|
-
exports2.LucidePlay =
|
|
22065
|
+
exports2.LucidePlay = Play;
|
|
22066
22066
|
exports2.LucidePlayCircle = CirclePlay;
|
|
22067
22067
|
exports2.LucidePlaySquare = SquarePlay;
|
|
22068
22068
|
exports2.LucidePlug = Plug;
|
|
@@ -23188,10 +23188,10 @@ var require_lucide_react = __commonJS({
|
|
|
23188
23188
|
exports2.PlaneLandingIcon = PlaneLanding;
|
|
23189
23189
|
exports2.PlaneTakeoff = PlaneTakeoff;
|
|
23190
23190
|
exports2.PlaneTakeoffIcon = PlaneTakeoff;
|
|
23191
|
-
exports2.Play =
|
|
23191
|
+
exports2.Play = Play;
|
|
23192
23192
|
exports2.PlayCircle = CirclePlay;
|
|
23193
23193
|
exports2.PlayCircleIcon = CirclePlay;
|
|
23194
|
-
exports2.PlayIcon =
|
|
23194
|
+
exports2.PlayIcon = Play;
|
|
23195
23195
|
exports2.PlaySquare = SquarePlay;
|
|
23196
23196
|
exports2.PlaySquareIcon = SquarePlay;
|
|
23197
23197
|
exports2.Plug = Plug;
|
|
@@ -24410,8 +24410,7 @@ var ExpressoSwagger = class {
|
|
|
24410
24410
|
};
|
|
24411
24411
|
|
|
24412
24412
|
// src/ui/index.tsx
|
|
24413
|
-
var
|
|
24414
|
-
var import_lucide_react = __toESM(require_lucide_react());
|
|
24413
|
+
var import_axios = __toESM(require("axios"));
|
|
24415
24414
|
|
|
24416
24415
|
// node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs
|
|
24417
24416
|
var import_jsx_runtime3 = require("react/jsx-runtime");
|
|
@@ -24442,7 +24441,7 @@ var useIsomorphicLayoutEffect = isBrowser ? import_react3.useLayoutEffect : impo
|
|
|
24442
24441
|
|
|
24443
24442
|
// node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs
|
|
24444
24443
|
var import_jsx_runtime2 = require("react/jsx-runtime");
|
|
24445
|
-
var
|
|
24444
|
+
var React4 = __toESM(require("react"), 1);
|
|
24446
24445
|
var import_react7 = require("react");
|
|
24447
24446
|
|
|
24448
24447
|
// node_modules/framer-motion/dist/es/context/PresenceContext.mjs
|
|
@@ -30867,7 +30866,7 @@ var HTMLProjectionNode = createProjectionNode({
|
|
|
30867
30866
|
});
|
|
30868
30867
|
|
|
30869
30868
|
// node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs
|
|
30870
|
-
var
|
|
30869
|
+
var React3 = __toESM(require("react"), 1);
|
|
30871
30870
|
var import_react6 = require("react");
|
|
30872
30871
|
|
|
30873
30872
|
// node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs
|
|
@@ -30879,7 +30878,7 @@ var MotionConfigContext = (0, import_react5.createContext)({
|
|
|
30879
30878
|
});
|
|
30880
30879
|
|
|
30881
30880
|
// node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs
|
|
30882
|
-
var
|
|
30881
|
+
var React2 = __toESM(require("react"), 1);
|
|
30883
30882
|
function setRef(ref, value) {
|
|
30884
30883
|
if (typeof ref === "function") {
|
|
30885
30884
|
return ref(value);
|
|
@@ -30912,11 +30911,11 @@ function composeRefs(...refs) {
|
|
|
30912
30911
|
};
|
|
30913
30912
|
}
|
|
30914
30913
|
function useComposedRefs(...refs) {
|
|
30915
|
-
return
|
|
30914
|
+
return React2.useCallback(composeRefs(...refs), refs);
|
|
30916
30915
|
}
|
|
30917
30916
|
|
|
30918
30917
|
// node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs
|
|
30919
|
-
var PopChildMeasure = class extends
|
|
30918
|
+
var PopChildMeasure = class extends React3.Component {
|
|
30920
30919
|
getSnapshotBeforeUpdate(prevProps) {
|
|
30921
30920
|
const element = this.props.childRef.current;
|
|
30922
30921
|
if (element && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) {
|
|
@@ -30985,7 +30984,7 @@ function PopChild({ children, isPresent, anchorX, anchorY, root, pop }) {
|
|
|
30985
30984
|
}
|
|
30986
30985
|
};
|
|
30987
30986
|
}, [isPresent]);
|
|
30988
|
-
return (0, import_jsx_runtime.jsx)(PopChildMeasure, { isPresent, childRef: ref, sizeRef: size, pop, children: pop === false ? children :
|
|
30987
|
+
return (0, import_jsx_runtime.jsx)(PopChildMeasure, { isPresent, childRef: ref, sizeRef: size, pop, children: pop === false ? children : React3.cloneElement(children, { ref: composedRef }) });
|
|
30989
30988
|
}
|
|
30990
30989
|
|
|
30991
30990
|
// node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs
|
|
@@ -31020,7 +31019,7 @@ var PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, pre
|
|
|
31020
31019
|
(0, import_react7.useMemo)(() => {
|
|
31021
31020
|
presenceChildren.forEach((_, key) => presenceChildren.set(key, false));
|
|
31022
31021
|
}, [isPresent]);
|
|
31023
|
-
|
|
31022
|
+
React4.useEffect(() => {
|
|
31024
31023
|
!isPresent && !presenceChildren.size && onExitComplete && onExitComplete();
|
|
31025
31024
|
}, [isPresent]);
|
|
31026
31025
|
children = (0, import_jsx_runtime2.jsx)(PopChild, { pop: mode === "popLayout", isPresent, anchorX, anchorY, root, children });
|
|
@@ -32943,7 +32942,8 @@ var featureBundle = {
|
|
|
32943
32942
|
var motion = /* @__PURE__ */ createMotionProxy(featureBundle, createDomVisualElement);
|
|
32944
32943
|
|
|
32945
32944
|
// src/ui/index.tsx
|
|
32946
|
-
var
|
|
32945
|
+
var import_lucide_react = __toESM(require_lucide_react());
|
|
32946
|
+
var import_react24 = require("react");
|
|
32947
32947
|
var methodColors = {
|
|
32948
32948
|
GET: { bg: "bg-sky-500/10", text: "text-sky-500", border: "border-sky-500/20" },
|
|
32949
32949
|
POST: { bg: "bg-emerald-500/10", text: "text-emerald-500", border: "border-emerald-500/20" },
|
|
@@ -32954,17 +32954,17 @@ var methodColors = {
|
|
|
32954
32954
|
};
|
|
32955
32955
|
var SidebarItem = ({ method, title, active, onClick }) => {
|
|
32956
32956
|
const colors = methodColors[method] || methodColors.DEFAULT;
|
|
32957
|
-
return /* @__PURE__ */
|
|
32957
|
+
return /* @__PURE__ */ React.createElement(
|
|
32958
32958
|
"button",
|
|
32959
32959
|
{
|
|
32960
32960
|
onClick,
|
|
32961
32961
|
className: `w-full flex items-center px-4 py-2 text-[13px] font-medium transition-all duration-200 rounded-lg group text-left ${active ? "bg-white dark:bg-slate-800 shadow-sm border border-slate-200 dark:border-slate-700" : "text-slate-600 hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-slate-800 border border-transparent"}`
|
|
32962
32962
|
},
|
|
32963
|
-
/* @__PURE__ */
|
|
32964
|
-
/* @__PURE__ */
|
|
32963
|
+
/* @__PURE__ */ React.createElement("span", { className: `font-black mr-3 text-[9px] w-12 py-1 rounded-md text-center shrink-0 border ${colors.bg} ${colors.text} ${colors.border} uppercase tracking-tighter` }, method),
|
|
32964
|
+
/* @__PURE__ */ React.createElement("span", { className: `truncate ${active ? "text-primary-500 font-bold" : ""}` }, title)
|
|
32965
32965
|
);
|
|
32966
32966
|
};
|
|
32967
|
-
var InputField = ({ label, value, onChange, placeholder, type = "text", description }) => /* @__PURE__ */
|
|
32967
|
+
var InputField = ({ label, value, onChange, placeholder, type = "text", description }) => /* @__PURE__ */ React.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between px-1" }, /* @__PURE__ */ React.createElement("label", { className: "text-[10px] font-bold uppercase tracking-wider text-slate-500" }, label), description && /* @__PURE__ */ React.createElement("span", { className: "text-[9px] text-slate-400 italic max-w-[150px] truncate" }, description)), /* @__PURE__ */ React.createElement(
|
|
32968
32968
|
"input",
|
|
32969
32969
|
{
|
|
32970
32970
|
type,
|
|
@@ -32977,15 +32977,15 @@ var InputField = ({ label, value, onChange, placeholder, type = "text", descript
|
|
|
32977
32977
|
var SchemaPreview = ({ data, title }) => {
|
|
32978
32978
|
const [isOpen, setIsOpen] = (0, import_react24.useState)(false);
|
|
32979
32979
|
if (!data) return null;
|
|
32980
|
-
return /* @__PURE__ */
|
|
32980
|
+
return /* @__PURE__ */ React.createElement("div", { className: "mt-4 border border-slate-200 dark:border-slate-800 rounded-xl overflow-hidden bg-white dark:bg-slate-900/30" }, /* @__PURE__ */ React.createElement(
|
|
32981
32981
|
"button",
|
|
32982
32982
|
{
|
|
32983
32983
|
onClick: () => setIsOpen(!isOpen),
|
|
32984
32984
|
className: "w-full flex items-center justify-between px-4 py-2 bg-slate-50 dark:bg-slate-900/50 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors"
|
|
32985
32985
|
},
|
|
32986
|
-
/* @__PURE__ */
|
|
32987
|
-
isOpen ? /* @__PURE__ */
|
|
32988
|
-
), /* @__PURE__ */
|
|
32986
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-2 text-[11px] font-bold text-slate-500 uppercase tracking-widest" }, /* @__PURE__ */ React.createElement(import_lucide_react.Code, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React.createElement("span", null, "Schema: ", title)),
|
|
32987
|
+
isOpen ? /* @__PURE__ */ React.createElement(import_lucide_react.ChevronDown, { className: "w-4 h-4 text-slate-400" }) : /* @__PURE__ */ React.createElement(import_lucide_react.ChevronRight, { className: "w-4 h-4 text-slate-400" })
|
|
32988
|
+
), /* @__PURE__ */ React.createElement(AnimatePresence, null, isOpen && /* @__PURE__ */ React.createElement(
|
|
32989
32989
|
motion.div,
|
|
32990
32990
|
{
|
|
32991
32991
|
initial: { height: 0, opacity: 0 },
|
|
@@ -32993,7 +32993,7 @@ var SchemaPreview = ({ data, title }) => {
|
|
|
32993
32993
|
exit: { height: 0, opacity: 0 },
|
|
32994
32994
|
className: "overflow-hidden"
|
|
32995
32995
|
},
|
|
32996
|
-
/* @__PURE__ */
|
|
32996
|
+
/* @__PURE__ */ React.createElement("pre", { className: "p-4 text-[12px] font-mono text-primary-600 dark:text-primary-400 overflow-x-auto bg-slate-50/50 dark:bg-slate-950/20" }, JSON.stringify(data, null, 4))
|
|
32997
32997
|
)));
|
|
32998
32998
|
};
|
|
32999
32999
|
var ExpressoSwaggerUI = ({ document: initialDocument, url }) => {
|
|
@@ -33053,7 +33053,7 @@ var ExpressoSwaggerUI = ({ document: initialDocument, url }) => {
|
|
|
33053
33053
|
const term = searchTerm.toLowerCase();
|
|
33054
33054
|
return document2.endpoints.reduce((acc, endpoint) => {
|
|
33055
33055
|
const group = endpoint.group || "Default";
|
|
33056
|
-
const matchesSearch = endpoint.path.toLowerCase().includes(term) || endpoint.
|
|
33056
|
+
const matchesSearch = endpoint.path.toLowerCase().includes(term) || endpoint.name && endpoint.name.toLowerCase().includes(term) || endpoint.method.toLowerCase().includes(term) || group.toLowerCase().includes(term);
|
|
33057
33057
|
if (matchesSearch) {
|
|
33058
33058
|
if (!acc[group]) acc[group] = [];
|
|
33059
33059
|
acc[group].push(endpoint);
|
|
@@ -33115,8 +33115,8 @@ var ExpressoSwaggerUI = ({ document: initialDocument, url }) => {
|
|
|
33115
33115
|
setLoading(false);
|
|
33116
33116
|
}
|
|
33117
33117
|
};
|
|
33118
|
-
if (fetching) return /* @__PURE__ */
|
|
33119
|
-
if (!document2 || !selectedEndpoint) return /* @__PURE__ */
|
|
33118
|
+
if (fetching) return /* @__PURE__ */ React.createElement("div", { className: "flex h-screen w-full items-center justify-center bg-slate-950 text-white" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col items-center space-y-4" }, /* @__PURE__ */ React.createElement("div", { className: "w-12 h-12 border-4 border-primary-500 border-t-transparent rounded-full animate-spin" }), /* @__PURE__ */ React.createElement("p", { className: "text-sm font-bold uppercase tracking-widest text-slate-500" }, "Loading Documentation...")));
|
|
33119
|
+
if (!document2 || !selectedEndpoint) return /* @__PURE__ */ React.createElement("div", { className: "p-10 text-center text-slate-500" }, "No API document found.");
|
|
33120
33120
|
const hostBaseUrl = document2.baseUrl || (typeof window !== "undefined" ? window.location.origin : "");
|
|
33121
33121
|
const finalBaseUrl = selectedEndpoint.baseUrl || hostBaseUrl;
|
|
33122
33122
|
let displayPath = selectedEndpoint.path;
|
|
@@ -33130,15 +33130,15 @@ var ExpressoSwaggerUI = ({ document: initialDocument, url }) => {
|
|
|
33130
33130
|
const queryString = activeQueryParams.length > 0 ? "?" + new URLSearchParams(activeQueryParams).toString() : "";
|
|
33131
33131
|
const displayFullUrl = fullUrl + queryString;
|
|
33132
33132
|
const currentMethodColors = methodColors[selectedEndpoint.method] || methodColors.DEFAULT;
|
|
33133
|
-
return /* @__PURE__ */
|
|
33133
|
+
return /* @__PURE__ */ React.createElement("div", { className: "flex h-screen w-full bg-slate-50 dark:bg-slate-950 font-sans overflow-hidden text-slate-900 dark:text-slate-100 relative" }, /* @__PURE__ */ React.createElement(AnimatePresence, null, isConfigOpen && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: closeConfig, className: "absolute inset-0 bg-slate-950/40 backdrop-blur-sm z-40" }), /* @__PURE__ */ React.createElement(motion.div, { initial: { x: "100%" }, animate: { x: 0 }, exit: { x: "100%" }, transition: { type: "spring", damping: 25, stiffness: 200 }, className: "absolute right-0 top-0 bottom-0 w-[400px] bg-white dark:bg-slate-900 shadow-2xl z-50 p-8 border-l border-slate-200 dark:border-slate-800" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between mb-8" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-3" }, /* @__PURE__ */ React.createElement("div", { className: "w-10 h-10 bg-primary-500 rounded-xl flex items-center justify-center text-white" }, /* @__PURE__ */ React.createElement(import_lucide_react.Key, { className: "w-5 h-5" })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h3", { className: "font-bold text-lg" }, "Global Config"), /* @__PURE__ */ React.createElement("p", { className: "text-[10px] text-slate-400 uppercase tracking-widest font-bold" }, "Authentication & Headers"))), /* @__PURE__ */ React.createElement("button", { onClick: closeConfig, className: "p-2 hover:bg-slate-100 dark:hover:bg-slate-800 rounded-lg transition-colors" }, /* @__PURE__ */ React.createElement(import_lucide_react.X, { className: "w-5 h-5 text-slate-400" }))), /* @__PURE__ */ React.createElement("div", { className: "space-y-6" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between mb-4" }, /* @__PURE__ */ React.createElement("h4", { className: "text-sm font-bold text-slate-700 dark:text-slate-300" }, "Global Headers"), /* @__PURE__ */ React.createElement("button", { onClick: () => setGlobalHeaders([...globalHeaders, { key: "", value: "" }]), className: "flex items-center space-x-1 text-[10px] font-bold bg-primary-500 text-white px-2 py-1 rounded-md uppercase tracking-tight" }, /* @__PURE__ */ React.createElement(import_lucide_react.Plus, { className: "w-3 h-3" }), /* @__PURE__ */ React.createElement("span", null, "Add"))), /* @__PURE__ */ React.createElement("div", { className: "space-y-3 max-h-[400px] overflow-y-auto pr-2 custom-scrollbar" }, globalHeaders.length === 0 && /* @__PURE__ */ React.createElement("div", { className: "text-center py-10 border-2 border-dashed border-slate-100 dark:border-slate-800 rounded-2xl" }, /* @__PURE__ */ React.createElement("p", { className: "text-xs text-slate-400 italic" }, "No headers configured.")), globalHeaders.map((header, idx) => /* @__PURE__ */ React.createElement("div", { key: idx, className: "flex items-end space-x-2 group" }, /* @__PURE__ */ React.createElement("div", { className: "flex-1 space-y-1" }, /* @__PURE__ */ React.createElement("input", { placeholder: "Key", value: header.key, onChange: (e) => {
|
|
33134
33134
|
const newHeaders = [...globalHeaders];
|
|
33135
33135
|
newHeaders[idx].key = e.target.value;
|
|
33136
33136
|
setGlobalHeaders(newHeaders);
|
|
33137
|
-
}, className: "w-full px-3 py-1.5 text-xs bg-slate-50 dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg outline-none" }), /* @__PURE__ */
|
|
33137
|
+
}, className: "w-full px-3 py-1.5 text-xs bg-slate-50 dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg outline-none" }), /* @__PURE__ */ React.createElement("input", { placeholder: "Value", value: header.value, onChange: (e) => {
|
|
33138
33138
|
const newHeaders = [...globalHeaders];
|
|
33139
33139
|
newHeaders[idx].value = e.target.value;
|
|
33140
33140
|
setGlobalHeaders(newHeaders);
|
|
33141
|
-
}, className: "w-full px-3 py-1.5 text-xs bg-slate-50 dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg outline-none" })), /* @__PURE__ */ import_react24.default.createElement("button", { onClick: () => setGlobalHeaders(globalHeaders.filter((_, i) => i !== idx)), className: "p-2 text-rose-400" }, /* @__PURE__ */ import_react24.default.createElement(import_lucide_react.Trash2, { className: "w-4 h-4" })))))))))), /* @__PURE__ */ import_react24.default.createElement("aside", { className: "w-72 bg-white dark:bg-slate-900 border-r border-slate-200 dark:border-slate-800 flex flex-col flex-shrink-0" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "p-6 border-b border-slate-100 dark:border-slate-800" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "flex items-center justify-between mb-6" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "flex items-center space-x-3" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "w-8 h-8 bg-primary-500 rounded-lg flex items-center justify-center text-white font-bold" }, "E"), /* @__PURE__ */ import_react24.default.createElement("h1", { className: "font-bold text-lg tracking-tight uppercase" }, "Expresso")), /* @__PURE__ */ import_react24.default.createElement("button", { onClick: () => setIsConfigOpen(true), className: "p-2 text-slate-400 hover:text-primary-500 relative" }, /* @__PURE__ */ import_react24.default.createElement(import_lucide_react.Settings, { className: "w-5 h-5 hover:rotate-45 transition-transform duration-300" }), globalHeaders.length > 0 && /* @__PURE__ */ import_react24.default.createElement("span", { className: "absolute top-1.5 right-1.5 w-2 h-2 bg-primary-500 rounded-full border-2 border-white dark:border-slate-900" }))), /* @__PURE__ */ import_react24.default.createElement("div", { className: "relative" }, /* @__PURE__ */ import_react24.default.createElement(import_lucide_react.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400" }), /* @__PURE__ */ import_react24.default.createElement("input", { type: "text", placeholder: "Search API...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), className: "w-full pl-10 pr-4 py-2 text-sm bg-slate-50 dark:bg-slate-800 rounded-xl outline-none" }))), /* @__PURE__ */ import_react24.default.createElement("nav", { className: "flex-1 overflow-y-auto p-4 space-y-8" }, Object.entries(filteredGroupedEndpoints).map(([group, endpoints]) => /* @__PURE__ */ import_react24.default.createElement("div", { key: group }, /* @__PURE__ */ import_react24.default.createElement("p", { className: "text-[10px] font-black uppercase text-slate-400 mb-3 px-2 border-l-2 border-primary-500 pl-3" }, group), /* @__PURE__ */ import_react24.default.createElement("div", { className: "space-y-1.5" }, endpoints.map((endpoint, idx) => /* @__PURE__ */ import_react24.default.createElement(SidebarItem, { key: idx, method: endpoint.method, title: endpoint.summary || endpoint.path, active: selectedEndpoint === endpoint, onClick: () => setSelectedEndpoint(endpoint) }))))))), /* @__PURE__ */ import_react24.default.createElement("main", { className: "flex-1 overflow-y-auto bg-white dark:bg-slate-950 px-12 py-10" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "max-w-4xl mx-auto" }, /* @__PURE__ */ import_react24.default.createElement(motion.div, { key: selectedEndpoint.path + selectedEndpoint.method, initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 } }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "flex items-center space-x-3 mb-4" }, /* @__PURE__ */ import_react24.default.createElement("span", { className: `px-3 py-1 text-[11px] font-black rounded-lg uppercase border ${currentMethodColors.bg} ${currentMethodColors.text} ${currentMethodColors.border}` }, selectedEndpoint.method), /* @__PURE__ */ import_react24.default.createElement("span", { className: "text-sm font-mono text-slate-400" }, selectedEndpoint.path)), /* @__PURE__ */ import_react24.default.createElement("h2", { className: "text-4xl font-extrabold mb-2 tracking-tight" }, selectedEndpoint.summary), /* @__PURE__ */ import_react24.default.createElement("div", { className: "flex items-center space-x-2 p-3 bg-slate-100 dark:bg-slate-900 rounded-xl mb-6 border border-slate-200 dark:border-slate-800 group relative" }, /* @__PURE__ */ import_react24.default.createElement(import_lucide_react.Globe, { className: "w-4 h-4 text-slate-400 group-hover:text-primary-500 transition-colors" }), /* @__PURE__ */ import_react24.default.createElement("code", { className: "text-[13px] font-mono break-all text-slate-500 dark:text-slate-400 flex-1" }, displayFullUrl), /* @__PURE__ */ import_react24.default.createElement("button", { onClick: () => navigator.clipboard.writeText(displayFullUrl), className: "opacity-0 group-hover:opacity-100 p-1.5 hover:bg-white dark:hover:bg-slate-800 rounded-lg transition-all text-[10px] font-bold uppercase text-primary-500" }, "Copy")), /* @__PURE__ */ import_react24.default.createElement("p", { className: "text-sm text-slate-600 dark:text-slate-400 mb-10 leading-relaxed font-medium whitespace-pre-wrap" }, selectedEndpoint.description || "No description provided."), /* @__PURE__ */ import_react24.default.createElement("div", { className: "space-y-12" }, /* @__PURE__ */ import_react24.default.createElement("section", null, /* @__PURE__ */ import_react24.default.createElement("div", { className: "flex items-center space-x-2 mb-6 border-b border-slate-100 dark:border-slate-800 pb-2" }, /* @__PURE__ */ import_react24.default.createElement(import_lucide_react.Shield, { className: "w-5 h-5 text-slate-400" }), /* @__PURE__ */ import_react24.default.createElement("h3", { className: "text-xl font-bold" }, "Security")), /* @__PURE__ */ import_react24.default.createElement("div", { className: "p-4 bg-primary-500/5 border border-primary-500/10 rounded-2xl flex items-center justify-between" }, /* @__PURE__ */ import_react24.default.createElement("span", { className: "text-sm font-medium" }, "Include Credentials (Cookies/Session)"), /* @__PURE__ */ import_react24.default.createElement("span", { className: "text-[10px] font-bold bg-primary-500 text-white px-2 py-1 rounded-full uppercase tracking-tighter" }, "Enabled"))), /* @__PURE__ */ import_react24.default.createElement("section", null, /* @__PURE__ */ import_react24.default.createElement("div", { className: "flex items-center space-x-2 mb-6 border-b border-slate-100 dark:border-slate-800 pb-2" }, /* @__PURE__ */ import_react24.default.createElement(import_lucide_react.Database, { className: "w-5 h-5 text-slate-400" }), /* @__PURE__ */ import_react24.default.createElement("h3", { className: "text-xl font-bold" }, "Responses")), /* @__PURE__ */ import_react24.default.createElement("div", { className: "space-y-6" }, Object.entries(selectedEndpoint.responses).map(([code, res]) => /* @__PURE__ */ import_react24.default.createElement("div", { key: code, className: "p-5 rounded-2xl bg-slate-50 dark:bg-slate-900/30 border border-slate-100 dark:border-slate-800" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "flex items-start space-x-4 mb-2" }, /* @__PURE__ */ import_react24.default.createElement("span", { className: `px-2.5 py-1 rounded-lg text-xs font-black ${code.startsWith("2") ? "text-green-500" : "text-red-500"}` }, code), /* @__PURE__ */ import_react24.default.createElement("p", { className: "text-[15px] font-medium pt-0.5" }, res.description)), res.body && /* @__PURE__ */ import_react24.default.createElement(SchemaPreview, { data: resolveModel(res.body), title: typeof res.body === "string" ? res.body : "Object" }))))))))), /* @__PURE__ */ import_react24.default.createElement("aside", { className: "w-[480px] bg-slate-900 flex flex-col flex-shrink-0 text-white border-l border-slate-800 shadow-2xl" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "p-6 border-b border-slate-800 flex items-center justify-between sticky top-0 z-10 bg-slate-900" }, /* @__PURE__ */ import_react24.default.createElement("h4", { className: "text-sm font-bold uppercase tracking-widest text-slate-400" }, "Try It Out"), /* @__PURE__ */ import_react24.default.createElement("button", { onClick: executeApi, disabled: loading, className: "px-6 py-2 bg-primary-500 text-white text-xs font-bold rounded-xl active:scale-95 transition-all disabled:opacity-50" }, loading ? "Executing..." : "Execute API")), /* @__PURE__ */ import_react24.default.createElement("div", { className: "flex-1 overflow-y-auto p-6 space-y-8 font-mono text-[13px]" }, Object.keys(selectedEndpoint.params || {}).length > 0 && /* @__PURE__ */ import_react24.default.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ import_react24.default.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Path Parameters"), Object.entries(selectedEndpoint.params || {}).map(([key, def]) => /* @__PURE__ */ import_react24.default.createElement(InputField, { key, label: key, placeholder: def.description, description: def.description, value: params[key], onChange: (val) => setParams((prev) => ({ ...prev, [key]: val })) }))), Object.keys(selectedEndpoint.query || {}).length > 0 && /* @__PURE__ */ import_react24.default.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ import_react24.default.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Query Parameters"), Object.entries(selectedEndpoint.query || {}).map(([key, def]) => /* @__PURE__ */ import_react24.default.createElement(InputField, { key, label: key, placeholder: def.description, description: def.description, value: queryParams[key], onChange: (val) => setQueryParams((prev) => ({ ...prev, [key]: val })) }))), ["POST", "PUT", "PATCH"].includes(selectedEndpoint.method) && /* @__PURE__ */ import_react24.default.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ import_react24.default.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Request Body (JSON)"), /* @__PURE__ */ import_react24.default.createElement("textarea", { value: body, onChange: (e) => setBody(e.target.value), placeholder: "Enter JSON body here...", className: "w-full h-48 bg-slate-950/50 border border-slate-800 rounded-2xl p-4 text-[13px] outline-none focus:ring-2 focus:ring-primary-500/50 transition-all text-slate-300 font-mono resize-none" })), /* @__PURE__ */ import_react24.default.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ import_react24.default.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ import_react24.default.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Response"), response && /* @__PURE__ */ import_react24.default.createElement("div", { className: "flex items-center space-x-3 text-[10px] font-bold" }, /* @__PURE__ */ import_react24.default.createElement("span", { className: "flex items-center text-slate-400" }, /* @__PURE__ */ import_react24.default.createElement(import_lucide_react.Clock, { className: "w-3 h-3 mr-1" }), " ", executionTime, "ms"), /* @__PURE__ */ import_react24.default.createElement("span", { className: response.status < 300 ? "text-green-500" : "text-red-500" }, "STATUS: ", response.status))), /* @__PURE__ */ import_react24.default.createElement("div", { className: "bg-slate-950/80 p-5 rounded-2xl border border-slate-800 min-h-[100px] overflow-x-auto" }, /* @__PURE__ */ import_react24.default.createElement("pre", { className: `whitespace-pre ${response ? response.status >= 400 ? "text-red-400" : "text-green-400" : "text-slate-600"}` }, response ? JSON.stringify(response.data, null, 4) : "// Click 'Execute API'"))))));
|
|
33141
|
+
}, className: "w-full px-3 py-1.5 text-xs bg-slate-50 dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg outline-none" })), /* @__PURE__ */ React.createElement("button", { onClick: () => setGlobalHeaders(globalHeaders.filter((_, i) => i !== idx)), className: "p-2 text-rose-400" }, /* @__PURE__ */ React.createElement(import_lucide_react.Trash2, { className: "w-4 h-4" })))))))))), /* @__PURE__ */ React.createElement("aside", { className: "w-72 bg-white dark:bg-slate-900 border-r border-slate-200 dark:border-slate-800 flex flex-col flex-shrink-0" }, /* @__PURE__ */ React.createElement("div", { className: "p-6 border-b border-slate-100 dark:border-slate-800" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between mb-6" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-3" }, /* @__PURE__ */ React.createElement("div", { className: "w-8 h-8 bg-primary-500 rounded-lg flex items-center justify-center text-white font-bold" }, "E"), /* @__PURE__ */ React.createElement("h1", { className: "font-bold text-lg tracking-tight uppercase" }, "Expresso")), /* @__PURE__ */ React.createElement("button", { onClick: () => setIsConfigOpen(true), className: "p-2 text-slate-400 hover:text-primary-500 relative" }, /* @__PURE__ */ React.createElement(import_lucide_react.Settings, { className: "w-5 h-5 hover:rotate-45 transition-transform duration-300" }), globalHeaders.length > 0 && /* @__PURE__ */ React.createElement("span", { className: "absolute top-1.5 right-1.5 w-2 h-2 bg-primary-500 rounded-full border-2 border-white dark:border-slate-900" }))), /* @__PURE__ */ React.createElement("div", { className: "relative" }, /* @__PURE__ */ React.createElement(import_lucide_react.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400" }), /* @__PURE__ */ React.createElement("input", { type: "text", placeholder: "Search API...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), className: "w-full pl-10 pr-4 py-2 text-sm bg-slate-50 dark:bg-slate-800 rounded-xl outline-none" }))), /* @__PURE__ */ React.createElement("nav", { className: "flex-1 overflow-y-auto p-4 space-y-8" }, Object.entries(filteredGroupedEndpoints).map(([group, endpoints]) => /* @__PURE__ */ React.createElement("div", { key: group }, /* @__PURE__ */ React.createElement("p", { className: "text-[10px] font-black uppercase text-slate-400 mb-3 px-2 border-l-2 border-primary-500 pl-3" }, group), /* @__PURE__ */ React.createElement("div", { className: "space-y-1.5" }, endpoints.map((endpoint, idx) => /* @__PURE__ */ React.createElement(SidebarItem, { key: idx, method: endpoint.method, title: endpoint.name || endpoint.path, active: selectedEndpoint === endpoint, onClick: () => setSelectedEndpoint(endpoint) }))))))), /* @__PURE__ */ React.createElement("main", { className: "flex-1 overflow-y-auto bg-white dark:bg-slate-950 px-12 py-10" }, /* @__PURE__ */ React.createElement("div", { className: "max-w-4xl mx-auto" }, /* @__PURE__ */ React.createElement(motion.div, { key: selectedEndpoint.path + selectedEndpoint.method, initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 } }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-3 mb-4" }, /* @__PURE__ */ React.createElement("span", { className: `px-3 py-1 text-[11px] font-black rounded-lg uppercase border ${currentMethodColors.bg} ${currentMethodColors.text} ${currentMethodColors.border}` }, selectedEndpoint.method), /* @__PURE__ */ React.createElement("span", { className: "text-sm font-mono text-slate-400" }, selectedEndpoint.path)), /* @__PURE__ */ React.createElement("h2", { className: "text-4xl font-extrabold mb-2 tracking-tight" }, selectedEndpoint.name), /* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-2 p-3 bg-slate-100 dark:bg-slate-900 rounded-xl mb-6 border border-slate-200 dark:border-slate-800 group relative" }, /* @__PURE__ */ React.createElement(import_lucide_react.Globe, { className: "w-4 h-4 text-slate-400 group-hover:text-primary-500 transition-colors" }), /* @__PURE__ */ React.createElement("code", { className: "text-[13px] font-mono break-all text-slate-500 dark:text-slate-400 flex-1" }, displayFullUrl), /* @__PURE__ */ React.createElement("button", { onClick: () => navigator.clipboard.writeText(displayFullUrl), className: "opacity-0 group-hover:opacity-100 p-1.5 hover:bg-white dark:hover:bg-slate-800 rounded-lg transition-all text-[10px] font-bold uppercase text-primary-500" }, "Copy")), /* @__PURE__ */ React.createElement("p", { className: "text-sm text-slate-600 dark:text-slate-400 mb-10 leading-relaxed font-medium whitespace-pre-wrap" }, selectedEndpoint.description || "No description provided."), /* @__PURE__ */ React.createElement("div", { className: "space-y-12" }, /* @__PURE__ */ React.createElement("section", null, /* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-2 mb-6 border-b border-slate-100 dark:border-slate-800 pb-2" }, /* @__PURE__ */ React.createElement(import_lucide_react.Shield, { className: "w-5 h-5 text-slate-400" }), /* @__PURE__ */ React.createElement("h3", { className: "text-xl font-bold" }, "Security")), /* @__PURE__ */ React.createElement("div", { className: "p-4 bg-primary-500/5 border border-primary-500/10 rounded-2xl flex items-center justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "text-sm font-medium" }, "Include Credentials (Cookies/Session)"), /* @__PURE__ */ React.createElement("span", { className: "text-[10px] font-bold bg-primary-500 text-white px-2 py-1 rounded-full uppercase tracking-tighter" }, "Enabled"))), /* @__PURE__ */ React.createElement("section", null, /* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-2 mb-6 border-b border-slate-100 dark:border-slate-800 pb-2" }, /* @__PURE__ */ React.createElement(import_lucide_react.Database, { className: "w-5 h-5 text-slate-400" }), /* @__PURE__ */ React.createElement("h3", { className: "text-xl font-bold" }, "Responses")), /* @__PURE__ */ React.createElement("div", { className: "space-y-6" }, Object.entries(selectedEndpoint.responses).map(([code, res]) => /* @__PURE__ */ React.createElement("div", { key: code, className: "p-5 rounded-2xl bg-slate-50 dark:bg-slate-900/30 border border-slate-100 dark:border-slate-800" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-start space-x-4 mb-2" }, /* @__PURE__ */ React.createElement("span", { className: `px-2.5 py-1 rounded-lg text-xs font-black ${code.startsWith("2") ? "text-green-500" : "text-red-500"}` }, code), /* @__PURE__ */ React.createElement("p", { className: "text-[15px] font-medium pt-0.5" }, res.description)), res.body && /* @__PURE__ */ React.createElement(SchemaPreview, { data: resolveModel(res.body), title: typeof res.body === "string" ? res.body : "Object" }))))))))), /* @__PURE__ */ React.createElement("aside", { className: "w-[480px] bg-slate-900 flex flex-col flex-shrink-0 text-white border-l border-slate-800 shadow-2xl" }, /* @__PURE__ */ React.createElement("div", { className: "p-6 border-b border-slate-800 flex items-center justify-between sticky top-0 z-10 bg-slate-900" }, /* @__PURE__ */ React.createElement("h4", { className: "text-sm font-bold uppercase tracking-widest text-slate-400" }, "Try It Out"), /* @__PURE__ */ React.createElement("button", { onClick: executeApi, disabled: loading, className: "px-6 py-2 bg-primary-500 text-white text-xs font-bold rounded-xl active:scale-95 transition-all disabled:opacity-50" }, loading ? "Executing..." : "Execute API")), /* @__PURE__ */ React.createElement("div", { className: "flex-1 overflow-y-auto p-6 space-y-8 font-mono text-[13px]" }, Object.keys(selectedEndpoint.params || {}).length > 0 && /* @__PURE__ */ React.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Path Parameters"), Object.entries(selectedEndpoint.params || {}).map(([key, def]) => /* @__PURE__ */ React.createElement(InputField, { key, label: key, placeholder: def.description, description: def.description, value: params[key], onChange: (val) => setParams((prev) => ({ ...prev, [key]: val })) }))), Object.keys(selectedEndpoint.query || {}).length > 0 && /* @__PURE__ */ React.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Query Parameters"), Object.entries(selectedEndpoint.query || {}).map(([key, def]) => /* @__PURE__ */ React.createElement(InputField, { key, label: key, placeholder: def.description, description: def.description, value: queryParams[key], onChange: (val) => setQueryParams((prev) => ({ ...prev, [key]: val })) }))), ["POST", "PUT", "PATCH"].includes(selectedEndpoint.method) && /* @__PURE__ */ React.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Request Body (JSON)"), /* @__PURE__ */ React.createElement("textarea", { value: body, onChange: (e) => setBody(e.target.value), placeholder: "Enter JSON body here...", className: "w-full h-48 bg-slate-950/50 border border-slate-800 rounded-2xl p-4 text-[13px] outline-none focus:ring-2 focus:ring-primary-500/50 transition-all text-slate-300 font-mono resize-none" })), /* @__PURE__ */ React.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Response"), response && /* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-3 text-[10px] font-bold" }, /* @__PURE__ */ React.createElement("span", { className: "flex items-center text-slate-400" }, /* @__PURE__ */ React.createElement(import_lucide_react.Clock, { className: "w-3 h-3 mr-1" }), " ", executionTime, "ms"), /* @__PURE__ */ React.createElement("span", { className: response.status < 300 ? "text-green-500" : "text-red-500" }, "STATUS: ", response.status))), /* @__PURE__ */ React.createElement("div", { className: "bg-slate-950/80 p-5 rounded-2xl border border-slate-800 min-h-[100px] overflow-x-auto" }, /* @__PURE__ */ React.createElement("pre", { className: `whitespace-pre ${response ? response.status >= 400 ? "text-red-400" : "text-green-400" : "text-slate-600"}` }, response ? JSON.stringify(response.data, null, 4) : "// Click 'Execute API'"))))));
|
|
33142
33142
|
};
|
|
33143
33143
|
|
|
33144
33144
|
// src/lib/index.ts
|
package/dist/lib/index.mjs
CHANGED
|
@@ -11779,7 +11779,7 @@ var require_lucide_react = __commonJS({
|
|
|
11779
11779
|
}
|
|
11780
11780
|
]
|
|
11781
11781
|
];
|
|
11782
|
-
var
|
|
11782
|
+
var Play = createLucideIcon("play", __iconNode$8e);
|
|
11783
11783
|
var __iconNode$8d = [
|
|
11784
11784
|
["path", { d: "M9 2v6", key: "17ngun" }],
|
|
11785
11785
|
["path", { d: "M15 2v6", key: "s7yy2p" }],
|
|
@@ -18036,7 +18036,7 @@ var require_lucide_react = __commonJS({
|
|
|
18036
18036
|
Plane,
|
|
18037
18037
|
PlaneLanding,
|
|
18038
18038
|
PlaneTakeoff,
|
|
18039
|
-
Play
|
|
18039
|
+
Play,
|
|
18040
18040
|
Plug,
|
|
18041
18041
|
Plug2,
|
|
18042
18042
|
PlugZap,
|
|
@@ -22063,7 +22063,7 @@ var require_lucide_react = __commonJS({
|
|
|
22063
22063
|
exports.LucidePlane = Plane;
|
|
22064
22064
|
exports.LucidePlaneLanding = PlaneLanding;
|
|
22065
22065
|
exports.LucidePlaneTakeoff = PlaneTakeoff;
|
|
22066
|
-
exports.LucidePlay =
|
|
22066
|
+
exports.LucidePlay = Play;
|
|
22067
22067
|
exports.LucidePlayCircle = CirclePlay;
|
|
22068
22068
|
exports.LucidePlaySquare = SquarePlay;
|
|
22069
22069
|
exports.LucidePlug = Plug;
|
|
@@ -23189,10 +23189,10 @@ var require_lucide_react = __commonJS({
|
|
|
23189
23189
|
exports.PlaneLandingIcon = PlaneLanding;
|
|
23190
23190
|
exports.PlaneTakeoff = PlaneTakeoff;
|
|
23191
23191
|
exports.PlaneTakeoffIcon = PlaneTakeoff;
|
|
23192
|
-
exports.Play =
|
|
23192
|
+
exports.Play = Play;
|
|
23193
23193
|
exports.PlayCircle = CirclePlay;
|
|
23194
23194
|
exports.PlayCircleIcon = CirclePlay;
|
|
23195
|
-
exports.PlayIcon =
|
|
23195
|
+
exports.PlayIcon = Play;
|
|
23196
23196
|
exports.PlaySquare = SquarePlay;
|
|
23197
23197
|
exports.PlaySquareIcon = SquarePlay;
|
|
23198
23198
|
exports.Plug = Plug;
|
|
@@ -24404,8 +24404,7 @@ var ExpressoSwagger = class {
|
|
|
24404
24404
|
};
|
|
24405
24405
|
|
|
24406
24406
|
// src/ui/index.tsx
|
|
24407
|
-
|
|
24408
|
-
import React4, { useState as useState2, useEffect as useEffect5, useMemo as useMemo7 } from "react";
|
|
24407
|
+
import axios from "axios";
|
|
24409
24408
|
|
|
24410
24409
|
// node_modules/framer-motion/dist/es/components/AnimatePresence/index.mjs
|
|
24411
24410
|
import { jsx as jsx3, Fragment } from "react/jsx-runtime";
|
|
@@ -24436,7 +24435,7 @@ var useIsomorphicLayoutEffect = isBrowser ? useLayoutEffect : useEffect;
|
|
|
24436
24435
|
|
|
24437
24436
|
// node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs
|
|
24438
24437
|
import { jsx as jsx2 } from "react/jsx-runtime";
|
|
24439
|
-
import * as
|
|
24438
|
+
import * as React4 from "react";
|
|
24440
24439
|
import { useId as useId2, useMemo } from "react";
|
|
24441
24440
|
|
|
24442
24441
|
// node_modules/framer-motion/dist/es/context/PresenceContext.mjs
|
|
@@ -30861,7 +30860,7 @@ var HTMLProjectionNode = createProjectionNode({
|
|
|
30861
30860
|
});
|
|
30862
30861
|
|
|
30863
30862
|
// node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs
|
|
30864
|
-
import * as
|
|
30863
|
+
import * as React3 from "react";
|
|
30865
30864
|
import { useId, useRef as useRef2, useContext, useInsertionEffect } from "react";
|
|
30866
30865
|
|
|
30867
30866
|
// node_modules/framer-motion/dist/es/context/MotionConfigContext.mjs
|
|
@@ -30873,7 +30872,7 @@ var MotionConfigContext = createContext3({
|
|
|
30873
30872
|
});
|
|
30874
30873
|
|
|
30875
30874
|
// node_modules/framer-motion/dist/es/utils/use-composed-ref.mjs
|
|
30876
|
-
import * as
|
|
30875
|
+
import * as React2 from "react";
|
|
30877
30876
|
function setRef(ref, value) {
|
|
30878
30877
|
if (typeof ref === "function") {
|
|
30879
30878
|
return ref(value);
|
|
@@ -30906,11 +30905,11 @@ function composeRefs(...refs) {
|
|
|
30906
30905
|
};
|
|
30907
30906
|
}
|
|
30908
30907
|
function useComposedRefs(...refs) {
|
|
30909
|
-
return
|
|
30908
|
+
return React2.useCallback(composeRefs(...refs), refs);
|
|
30910
30909
|
}
|
|
30911
30910
|
|
|
30912
30911
|
// node_modules/framer-motion/dist/es/components/AnimatePresence/PopChild.mjs
|
|
30913
|
-
var PopChildMeasure = class extends
|
|
30912
|
+
var PopChildMeasure = class extends React3.Component {
|
|
30914
30913
|
getSnapshotBeforeUpdate(prevProps) {
|
|
30915
30914
|
const element = this.props.childRef.current;
|
|
30916
30915
|
if (element && prevProps.isPresent && !this.props.isPresent && this.props.pop !== false) {
|
|
@@ -30979,7 +30978,7 @@ function PopChild({ children, isPresent, anchorX, anchorY, root, pop }) {
|
|
|
30979
30978
|
}
|
|
30980
30979
|
};
|
|
30981
30980
|
}, [isPresent]);
|
|
30982
|
-
return jsx(PopChildMeasure, { isPresent, childRef: ref, sizeRef: size, pop, children: pop === false ? children :
|
|
30981
|
+
return jsx(PopChildMeasure, { isPresent, childRef: ref, sizeRef: size, pop, children: pop === false ? children : React3.cloneElement(children, { ref: composedRef }) });
|
|
30983
30982
|
}
|
|
30984
30983
|
|
|
30985
30984
|
// node_modules/framer-motion/dist/es/components/AnimatePresence/PresenceChild.mjs
|
|
@@ -31014,7 +31013,7 @@ var PresenceChild = ({ children, initial, isPresent, onExitComplete, custom, pre
|
|
|
31014
31013
|
useMemo(() => {
|
|
31015
31014
|
presenceChildren.forEach((_, key) => presenceChildren.set(key, false));
|
|
31016
31015
|
}, [isPresent]);
|
|
31017
|
-
|
|
31016
|
+
React4.useEffect(() => {
|
|
31018
31017
|
!isPresent && !presenceChildren.size && onExitComplete && onExitComplete();
|
|
31019
31018
|
}, [isPresent]);
|
|
31020
31019
|
children = jsx2(PopChild, { pop: mode === "popLayout", isPresent, anchorX, anchorY, root, children });
|
|
@@ -32937,7 +32936,8 @@ var featureBundle = {
|
|
|
32937
32936
|
var motion = /* @__PURE__ */ createMotionProxy(featureBundle, createDomVisualElement);
|
|
32938
32937
|
|
|
32939
32938
|
// src/ui/index.tsx
|
|
32940
|
-
|
|
32939
|
+
var import_lucide_react = __toESM(require_lucide_react());
|
|
32940
|
+
import { useEffect as useEffect5, useMemo as useMemo7, useState as useState2 } from "react";
|
|
32941
32941
|
var methodColors = {
|
|
32942
32942
|
GET: { bg: "bg-sky-500/10", text: "text-sky-500", border: "border-sky-500/20" },
|
|
32943
32943
|
POST: { bg: "bg-emerald-500/10", text: "text-emerald-500", border: "border-emerald-500/20" },
|
|
@@ -32948,17 +32948,17 @@ var methodColors = {
|
|
|
32948
32948
|
};
|
|
32949
32949
|
var SidebarItem = ({ method, title, active, onClick }) => {
|
|
32950
32950
|
const colors = methodColors[method] || methodColors.DEFAULT;
|
|
32951
|
-
return /* @__PURE__ */
|
|
32951
|
+
return /* @__PURE__ */ React.createElement(
|
|
32952
32952
|
"button",
|
|
32953
32953
|
{
|
|
32954
32954
|
onClick,
|
|
32955
32955
|
className: `w-full flex items-center px-4 py-2 text-[13px] font-medium transition-all duration-200 rounded-lg group text-left ${active ? "bg-white dark:bg-slate-800 shadow-sm border border-slate-200 dark:border-slate-700" : "text-slate-600 hover:bg-slate-100 dark:text-slate-400 dark:hover:bg-slate-800 border border-transparent"}`
|
|
32956
32956
|
},
|
|
32957
|
-
/* @__PURE__ */
|
|
32958
|
-
/* @__PURE__ */
|
|
32957
|
+
/* @__PURE__ */ React.createElement("span", { className: `font-black mr-3 text-[9px] w-12 py-1 rounded-md text-center shrink-0 border ${colors.bg} ${colors.text} ${colors.border} uppercase tracking-tighter` }, method),
|
|
32958
|
+
/* @__PURE__ */ React.createElement("span", { className: `truncate ${active ? "text-primary-500 font-bold" : ""}` }, title)
|
|
32959
32959
|
);
|
|
32960
32960
|
};
|
|
32961
|
-
var InputField = ({ label, value, onChange, placeholder, type = "text", description }) => /* @__PURE__ */
|
|
32961
|
+
var InputField = ({ label, value, onChange, placeholder, type = "text", description }) => /* @__PURE__ */ React.createElement("div", { className: "space-y-1.5" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between px-1" }, /* @__PURE__ */ React.createElement("label", { className: "text-[10px] font-bold uppercase tracking-wider text-slate-500" }, label), description && /* @__PURE__ */ React.createElement("span", { className: "text-[9px] text-slate-400 italic max-w-[150px] truncate" }, description)), /* @__PURE__ */ React.createElement(
|
|
32962
32962
|
"input",
|
|
32963
32963
|
{
|
|
32964
32964
|
type,
|
|
@@ -32971,15 +32971,15 @@ var InputField = ({ label, value, onChange, placeholder, type = "text", descript
|
|
|
32971
32971
|
var SchemaPreview = ({ data, title }) => {
|
|
32972
32972
|
const [isOpen, setIsOpen] = useState2(false);
|
|
32973
32973
|
if (!data) return null;
|
|
32974
|
-
return /* @__PURE__ */
|
|
32974
|
+
return /* @__PURE__ */ React.createElement("div", { className: "mt-4 border border-slate-200 dark:border-slate-800 rounded-xl overflow-hidden bg-white dark:bg-slate-900/30" }, /* @__PURE__ */ React.createElement(
|
|
32975
32975
|
"button",
|
|
32976
32976
|
{
|
|
32977
32977
|
onClick: () => setIsOpen(!isOpen),
|
|
32978
32978
|
className: "w-full flex items-center justify-between px-4 py-2 bg-slate-50 dark:bg-slate-900/50 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors"
|
|
32979
32979
|
},
|
|
32980
|
-
/* @__PURE__ */
|
|
32981
|
-
isOpen ? /* @__PURE__ */
|
|
32982
|
-
), /* @__PURE__ */
|
|
32980
|
+
/* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-2 text-[11px] font-bold text-slate-500 uppercase tracking-widest" }, /* @__PURE__ */ React.createElement(import_lucide_react.Code, { className: "w-3.5 h-3.5" }), /* @__PURE__ */ React.createElement("span", null, "Schema: ", title)),
|
|
32981
|
+
isOpen ? /* @__PURE__ */ React.createElement(import_lucide_react.ChevronDown, { className: "w-4 h-4 text-slate-400" }) : /* @__PURE__ */ React.createElement(import_lucide_react.ChevronRight, { className: "w-4 h-4 text-slate-400" })
|
|
32982
|
+
), /* @__PURE__ */ React.createElement(AnimatePresence, null, isOpen && /* @__PURE__ */ React.createElement(
|
|
32983
32983
|
motion.div,
|
|
32984
32984
|
{
|
|
32985
32985
|
initial: { height: 0, opacity: 0 },
|
|
@@ -32987,7 +32987,7 @@ var SchemaPreview = ({ data, title }) => {
|
|
|
32987
32987
|
exit: { height: 0, opacity: 0 },
|
|
32988
32988
|
className: "overflow-hidden"
|
|
32989
32989
|
},
|
|
32990
|
-
/* @__PURE__ */
|
|
32990
|
+
/* @__PURE__ */ React.createElement("pre", { className: "p-4 text-[12px] font-mono text-primary-600 dark:text-primary-400 overflow-x-auto bg-slate-50/50 dark:bg-slate-950/20" }, JSON.stringify(data, null, 4))
|
|
32991
32991
|
)));
|
|
32992
32992
|
};
|
|
32993
32993
|
var ExpressoSwaggerUI = ({ document: initialDocument, url }) => {
|
|
@@ -33047,7 +33047,7 @@ var ExpressoSwaggerUI = ({ document: initialDocument, url }) => {
|
|
|
33047
33047
|
const term = searchTerm.toLowerCase();
|
|
33048
33048
|
return document2.endpoints.reduce((acc, endpoint) => {
|
|
33049
33049
|
const group = endpoint.group || "Default";
|
|
33050
|
-
const matchesSearch = endpoint.path.toLowerCase().includes(term) || endpoint.
|
|
33050
|
+
const matchesSearch = endpoint.path.toLowerCase().includes(term) || endpoint.name && endpoint.name.toLowerCase().includes(term) || endpoint.method.toLowerCase().includes(term) || group.toLowerCase().includes(term);
|
|
33051
33051
|
if (matchesSearch) {
|
|
33052
33052
|
if (!acc[group]) acc[group] = [];
|
|
33053
33053
|
acc[group].push(endpoint);
|
|
@@ -33109,8 +33109,8 @@ var ExpressoSwaggerUI = ({ document: initialDocument, url }) => {
|
|
|
33109
33109
|
setLoading(false);
|
|
33110
33110
|
}
|
|
33111
33111
|
};
|
|
33112
|
-
if (fetching) return /* @__PURE__ */
|
|
33113
|
-
if (!document2 || !selectedEndpoint) return /* @__PURE__ */
|
|
33112
|
+
if (fetching) return /* @__PURE__ */ React.createElement("div", { className: "flex h-screen w-full items-center justify-center bg-slate-950 text-white" }, /* @__PURE__ */ React.createElement("div", { className: "flex flex-col items-center space-y-4" }, /* @__PURE__ */ React.createElement("div", { className: "w-12 h-12 border-4 border-primary-500 border-t-transparent rounded-full animate-spin" }), /* @__PURE__ */ React.createElement("p", { className: "text-sm font-bold uppercase tracking-widest text-slate-500" }, "Loading Documentation...")));
|
|
33113
|
+
if (!document2 || !selectedEndpoint) return /* @__PURE__ */ React.createElement("div", { className: "p-10 text-center text-slate-500" }, "No API document found.");
|
|
33114
33114
|
const hostBaseUrl = document2.baseUrl || (typeof window !== "undefined" ? window.location.origin : "");
|
|
33115
33115
|
const finalBaseUrl = selectedEndpoint.baseUrl || hostBaseUrl;
|
|
33116
33116
|
let displayPath = selectedEndpoint.path;
|
|
@@ -33124,15 +33124,15 @@ var ExpressoSwaggerUI = ({ document: initialDocument, url }) => {
|
|
|
33124
33124
|
const queryString = activeQueryParams.length > 0 ? "?" + new URLSearchParams(activeQueryParams).toString() : "";
|
|
33125
33125
|
const displayFullUrl = fullUrl + queryString;
|
|
33126
33126
|
const currentMethodColors = methodColors[selectedEndpoint.method] || methodColors.DEFAULT;
|
|
33127
|
-
return /* @__PURE__ */
|
|
33127
|
+
return /* @__PURE__ */ React.createElement("div", { className: "flex h-screen w-full bg-slate-50 dark:bg-slate-950 font-sans overflow-hidden text-slate-900 dark:text-slate-100 relative" }, /* @__PURE__ */ React.createElement(AnimatePresence, null, isConfigOpen && /* @__PURE__ */ React.createElement(React.Fragment, null, /* @__PURE__ */ React.createElement(motion.div, { initial: { opacity: 0 }, animate: { opacity: 1 }, exit: { opacity: 0 }, onClick: closeConfig, className: "absolute inset-0 bg-slate-950/40 backdrop-blur-sm z-40" }), /* @__PURE__ */ React.createElement(motion.div, { initial: { x: "100%" }, animate: { x: 0 }, exit: { x: "100%" }, transition: { type: "spring", damping: 25, stiffness: 200 }, className: "absolute right-0 top-0 bottom-0 w-[400px] bg-white dark:bg-slate-900 shadow-2xl z-50 p-8 border-l border-slate-200 dark:border-slate-800" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between mb-8" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-3" }, /* @__PURE__ */ React.createElement("div", { className: "w-10 h-10 bg-primary-500 rounded-xl flex items-center justify-center text-white" }, /* @__PURE__ */ React.createElement(import_lucide_react.Key, { className: "w-5 h-5" })), /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("h3", { className: "font-bold text-lg" }, "Global Config"), /* @__PURE__ */ React.createElement("p", { className: "text-[10px] text-slate-400 uppercase tracking-widest font-bold" }, "Authentication & Headers"))), /* @__PURE__ */ React.createElement("button", { onClick: closeConfig, className: "p-2 hover:bg-slate-100 dark:hover:bg-slate-800 rounded-lg transition-colors" }, /* @__PURE__ */ React.createElement(import_lucide_react.X, { className: "w-5 h-5 text-slate-400" }))), /* @__PURE__ */ React.createElement("div", { className: "space-y-6" }, /* @__PURE__ */ React.createElement("div", null, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between mb-4" }, /* @__PURE__ */ React.createElement("h4", { className: "text-sm font-bold text-slate-700 dark:text-slate-300" }, "Global Headers"), /* @__PURE__ */ React.createElement("button", { onClick: () => setGlobalHeaders([...globalHeaders, { key: "", value: "" }]), className: "flex items-center space-x-1 text-[10px] font-bold bg-primary-500 text-white px-2 py-1 rounded-md uppercase tracking-tight" }, /* @__PURE__ */ React.createElement(import_lucide_react.Plus, { className: "w-3 h-3" }), /* @__PURE__ */ React.createElement("span", null, "Add"))), /* @__PURE__ */ React.createElement("div", { className: "space-y-3 max-h-[400px] overflow-y-auto pr-2 custom-scrollbar" }, globalHeaders.length === 0 && /* @__PURE__ */ React.createElement("div", { className: "text-center py-10 border-2 border-dashed border-slate-100 dark:border-slate-800 rounded-2xl" }, /* @__PURE__ */ React.createElement("p", { className: "text-xs text-slate-400 italic" }, "No headers configured.")), globalHeaders.map((header, idx) => /* @__PURE__ */ React.createElement("div", { key: idx, className: "flex items-end space-x-2 group" }, /* @__PURE__ */ React.createElement("div", { className: "flex-1 space-y-1" }, /* @__PURE__ */ React.createElement("input", { placeholder: "Key", value: header.key, onChange: (e) => {
|
|
33128
33128
|
const newHeaders = [...globalHeaders];
|
|
33129
33129
|
newHeaders[idx].key = e.target.value;
|
|
33130
33130
|
setGlobalHeaders(newHeaders);
|
|
33131
|
-
}, className: "w-full px-3 py-1.5 text-xs bg-slate-50 dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg outline-none" }), /* @__PURE__ */
|
|
33131
|
+
}, className: "w-full px-3 py-1.5 text-xs bg-slate-50 dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg outline-none" }), /* @__PURE__ */ React.createElement("input", { placeholder: "Value", value: header.value, onChange: (e) => {
|
|
33132
33132
|
const newHeaders = [...globalHeaders];
|
|
33133
33133
|
newHeaders[idx].value = e.target.value;
|
|
33134
33134
|
setGlobalHeaders(newHeaders);
|
|
33135
|
-
}, className: "w-full px-3 py-1.5 text-xs bg-slate-50 dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg outline-none" })), /* @__PURE__ */ React4.createElement("button", { onClick: () => setGlobalHeaders(globalHeaders.filter((_, i) => i !== idx)), className: "p-2 text-rose-400" }, /* @__PURE__ */ React4.createElement(import_lucide_react.Trash2, { className: "w-4 h-4" })))))))))), /* @__PURE__ */ React4.createElement("aside", { className: "w-72 bg-white dark:bg-slate-900 border-r border-slate-200 dark:border-slate-800 flex flex-col flex-shrink-0" }, /* @__PURE__ */ React4.createElement("div", { className: "p-6 border-b border-slate-100 dark:border-slate-800" }, /* @__PURE__ */ React4.createElement("div", { className: "flex items-center justify-between mb-6" }, /* @__PURE__ */ React4.createElement("div", { className: "flex items-center space-x-3" }, /* @__PURE__ */ React4.createElement("div", { className: "w-8 h-8 bg-primary-500 rounded-lg flex items-center justify-center text-white font-bold" }, "E"), /* @__PURE__ */ React4.createElement("h1", { className: "font-bold text-lg tracking-tight uppercase" }, "Expresso")), /* @__PURE__ */ React4.createElement("button", { onClick: () => setIsConfigOpen(true), className: "p-2 text-slate-400 hover:text-primary-500 relative" }, /* @__PURE__ */ React4.createElement(import_lucide_react.Settings, { className: "w-5 h-5 hover:rotate-45 transition-transform duration-300" }), globalHeaders.length > 0 && /* @__PURE__ */ React4.createElement("span", { className: "absolute top-1.5 right-1.5 w-2 h-2 bg-primary-500 rounded-full border-2 border-white dark:border-slate-900" }))), /* @__PURE__ */ React4.createElement("div", { className: "relative" }, /* @__PURE__ */ React4.createElement(import_lucide_react.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400" }), /* @__PURE__ */ React4.createElement("input", { type: "text", placeholder: "Search API...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), className: "w-full pl-10 pr-4 py-2 text-sm bg-slate-50 dark:bg-slate-800 rounded-xl outline-none" }))), /* @__PURE__ */ React4.createElement("nav", { className: "flex-1 overflow-y-auto p-4 space-y-8" }, Object.entries(filteredGroupedEndpoints).map(([group, endpoints]) => /* @__PURE__ */ React4.createElement("div", { key: group }, /* @__PURE__ */ React4.createElement("p", { className: "text-[10px] font-black uppercase text-slate-400 mb-3 px-2 border-l-2 border-primary-500 pl-3" }, group), /* @__PURE__ */ React4.createElement("div", { className: "space-y-1.5" }, endpoints.map((endpoint, idx) => /* @__PURE__ */ React4.createElement(SidebarItem, { key: idx, method: endpoint.method, title: endpoint.summary || endpoint.path, active: selectedEndpoint === endpoint, onClick: () => setSelectedEndpoint(endpoint) }))))))), /* @__PURE__ */ React4.createElement("main", { className: "flex-1 overflow-y-auto bg-white dark:bg-slate-950 px-12 py-10" }, /* @__PURE__ */ React4.createElement("div", { className: "max-w-4xl mx-auto" }, /* @__PURE__ */ React4.createElement(motion.div, { key: selectedEndpoint.path + selectedEndpoint.method, initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 } }, /* @__PURE__ */ React4.createElement("div", { className: "flex items-center space-x-3 mb-4" }, /* @__PURE__ */ React4.createElement("span", { className: `px-3 py-1 text-[11px] font-black rounded-lg uppercase border ${currentMethodColors.bg} ${currentMethodColors.text} ${currentMethodColors.border}` }, selectedEndpoint.method), /* @__PURE__ */ React4.createElement("span", { className: "text-sm font-mono text-slate-400" }, selectedEndpoint.path)), /* @__PURE__ */ React4.createElement("h2", { className: "text-4xl font-extrabold mb-2 tracking-tight" }, selectedEndpoint.summary), /* @__PURE__ */ React4.createElement("div", { className: "flex items-center space-x-2 p-3 bg-slate-100 dark:bg-slate-900 rounded-xl mb-6 border border-slate-200 dark:border-slate-800 group relative" }, /* @__PURE__ */ React4.createElement(import_lucide_react.Globe, { className: "w-4 h-4 text-slate-400 group-hover:text-primary-500 transition-colors" }), /* @__PURE__ */ React4.createElement("code", { className: "text-[13px] font-mono break-all text-slate-500 dark:text-slate-400 flex-1" }, displayFullUrl), /* @__PURE__ */ React4.createElement("button", { onClick: () => navigator.clipboard.writeText(displayFullUrl), className: "opacity-0 group-hover:opacity-100 p-1.5 hover:bg-white dark:hover:bg-slate-800 rounded-lg transition-all text-[10px] font-bold uppercase text-primary-500" }, "Copy")), /* @__PURE__ */ React4.createElement("p", { className: "text-sm text-slate-600 dark:text-slate-400 mb-10 leading-relaxed font-medium whitespace-pre-wrap" }, selectedEndpoint.description || "No description provided."), /* @__PURE__ */ React4.createElement("div", { className: "space-y-12" }, /* @__PURE__ */ React4.createElement("section", null, /* @__PURE__ */ React4.createElement("div", { className: "flex items-center space-x-2 mb-6 border-b border-slate-100 dark:border-slate-800 pb-2" }, /* @__PURE__ */ React4.createElement(import_lucide_react.Shield, { className: "w-5 h-5 text-slate-400" }), /* @__PURE__ */ React4.createElement("h3", { className: "text-xl font-bold" }, "Security")), /* @__PURE__ */ React4.createElement("div", { className: "p-4 bg-primary-500/5 border border-primary-500/10 rounded-2xl flex items-center justify-between" }, /* @__PURE__ */ React4.createElement("span", { className: "text-sm font-medium" }, "Include Credentials (Cookies/Session)"), /* @__PURE__ */ React4.createElement("span", { className: "text-[10px] font-bold bg-primary-500 text-white px-2 py-1 rounded-full uppercase tracking-tighter" }, "Enabled"))), /* @__PURE__ */ React4.createElement("section", null, /* @__PURE__ */ React4.createElement("div", { className: "flex items-center space-x-2 mb-6 border-b border-slate-100 dark:border-slate-800 pb-2" }, /* @__PURE__ */ React4.createElement(import_lucide_react.Database, { className: "w-5 h-5 text-slate-400" }), /* @__PURE__ */ React4.createElement("h3", { className: "text-xl font-bold" }, "Responses")), /* @__PURE__ */ React4.createElement("div", { className: "space-y-6" }, Object.entries(selectedEndpoint.responses).map(([code, res]) => /* @__PURE__ */ React4.createElement("div", { key: code, className: "p-5 rounded-2xl bg-slate-50 dark:bg-slate-900/30 border border-slate-100 dark:border-slate-800" }, /* @__PURE__ */ React4.createElement("div", { className: "flex items-start space-x-4 mb-2" }, /* @__PURE__ */ React4.createElement("span", { className: `px-2.5 py-1 rounded-lg text-xs font-black ${code.startsWith("2") ? "text-green-500" : "text-red-500"}` }, code), /* @__PURE__ */ React4.createElement("p", { className: "text-[15px] font-medium pt-0.5" }, res.description)), res.body && /* @__PURE__ */ React4.createElement(SchemaPreview, { data: resolveModel(res.body), title: typeof res.body === "string" ? res.body : "Object" }))))))))), /* @__PURE__ */ React4.createElement("aside", { className: "w-[480px] bg-slate-900 flex flex-col flex-shrink-0 text-white border-l border-slate-800 shadow-2xl" }, /* @__PURE__ */ React4.createElement("div", { className: "p-6 border-b border-slate-800 flex items-center justify-between sticky top-0 z-10 bg-slate-900" }, /* @__PURE__ */ React4.createElement("h4", { className: "text-sm font-bold uppercase tracking-widest text-slate-400" }, "Try It Out"), /* @__PURE__ */ React4.createElement("button", { onClick: executeApi, disabled: loading, className: "px-6 py-2 bg-primary-500 text-white text-xs font-bold rounded-xl active:scale-95 transition-all disabled:opacity-50" }, loading ? "Executing..." : "Execute API")), /* @__PURE__ */ React4.createElement("div", { className: "flex-1 overflow-y-auto p-6 space-y-8 font-mono text-[13px]" }, Object.keys(selectedEndpoint.params || {}).length > 0 && /* @__PURE__ */ React4.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React4.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Path Parameters"), Object.entries(selectedEndpoint.params || {}).map(([key, def]) => /* @__PURE__ */ React4.createElement(InputField, { key, label: key, placeholder: def.description, description: def.description, value: params[key], onChange: (val) => setParams((prev) => ({ ...prev, [key]: val })) }))), Object.keys(selectedEndpoint.query || {}).length > 0 && /* @__PURE__ */ React4.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React4.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Query Parameters"), Object.entries(selectedEndpoint.query || {}).map(([key, def]) => /* @__PURE__ */ React4.createElement(InputField, { key, label: key, placeholder: def.description, description: def.description, value: queryParams[key], onChange: (val) => setQueryParams((prev) => ({ ...prev, [key]: val })) }))), ["POST", "PUT", "PATCH"].includes(selectedEndpoint.method) && /* @__PURE__ */ React4.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React4.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Request Body (JSON)"), /* @__PURE__ */ React4.createElement("textarea", { value: body, onChange: (e) => setBody(e.target.value), placeholder: "Enter JSON body here...", className: "w-full h-48 bg-slate-950/50 border border-slate-800 rounded-2xl p-4 text-[13px] outline-none focus:ring-2 focus:ring-primary-500/50 transition-all text-slate-300 font-mono resize-none" })), /* @__PURE__ */ React4.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React4.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React4.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Response"), response && /* @__PURE__ */ React4.createElement("div", { className: "flex items-center space-x-3 text-[10px] font-bold" }, /* @__PURE__ */ React4.createElement("span", { className: "flex items-center text-slate-400" }, /* @__PURE__ */ React4.createElement(import_lucide_react.Clock, { className: "w-3 h-3 mr-1" }), " ", executionTime, "ms"), /* @__PURE__ */ React4.createElement("span", { className: response.status < 300 ? "text-green-500" : "text-red-500" }, "STATUS: ", response.status))), /* @__PURE__ */ React4.createElement("div", { className: "bg-slate-950/80 p-5 rounded-2xl border border-slate-800 min-h-[100px] overflow-x-auto" }, /* @__PURE__ */ React4.createElement("pre", { className: `whitespace-pre ${response ? response.status >= 400 ? "text-red-400" : "text-green-400" : "text-slate-600"}` }, response ? JSON.stringify(response.data, null, 4) : "// Click 'Execute API'"))))));
|
|
33135
|
+
}, className: "w-full px-3 py-1.5 text-xs bg-slate-50 dark:bg-slate-800 border border-slate-200 dark:border-slate-700 rounded-lg outline-none" })), /* @__PURE__ */ React.createElement("button", { onClick: () => setGlobalHeaders(globalHeaders.filter((_, i) => i !== idx)), className: "p-2 text-rose-400" }, /* @__PURE__ */ React.createElement(import_lucide_react.Trash2, { className: "w-4 h-4" })))))))))), /* @__PURE__ */ React.createElement("aside", { className: "w-72 bg-white dark:bg-slate-900 border-r border-slate-200 dark:border-slate-800 flex flex-col flex-shrink-0" }, /* @__PURE__ */ React.createElement("div", { className: "p-6 border-b border-slate-100 dark:border-slate-800" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between mb-6" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-3" }, /* @__PURE__ */ React.createElement("div", { className: "w-8 h-8 bg-primary-500 rounded-lg flex items-center justify-center text-white font-bold" }, "E"), /* @__PURE__ */ React.createElement("h1", { className: "font-bold text-lg tracking-tight uppercase" }, "Expresso")), /* @__PURE__ */ React.createElement("button", { onClick: () => setIsConfigOpen(true), className: "p-2 text-slate-400 hover:text-primary-500 relative" }, /* @__PURE__ */ React.createElement(import_lucide_react.Settings, { className: "w-5 h-5 hover:rotate-45 transition-transform duration-300" }), globalHeaders.length > 0 && /* @__PURE__ */ React.createElement("span", { className: "absolute top-1.5 right-1.5 w-2 h-2 bg-primary-500 rounded-full border-2 border-white dark:border-slate-900" }))), /* @__PURE__ */ React.createElement("div", { className: "relative" }, /* @__PURE__ */ React.createElement(import_lucide_react.Search, { className: "absolute left-3 top-1/2 -translate-y-1/2 w-4 h-4 text-slate-400" }), /* @__PURE__ */ React.createElement("input", { type: "text", placeholder: "Search API...", value: searchTerm, onChange: (e) => setSearchTerm(e.target.value), className: "w-full pl-10 pr-4 py-2 text-sm bg-slate-50 dark:bg-slate-800 rounded-xl outline-none" }))), /* @__PURE__ */ React.createElement("nav", { className: "flex-1 overflow-y-auto p-4 space-y-8" }, Object.entries(filteredGroupedEndpoints).map(([group, endpoints]) => /* @__PURE__ */ React.createElement("div", { key: group }, /* @__PURE__ */ React.createElement("p", { className: "text-[10px] font-black uppercase text-slate-400 mb-3 px-2 border-l-2 border-primary-500 pl-3" }, group), /* @__PURE__ */ React.createElement("div", { className: "space-y-1.5" }, endpoints.map((endpoint, idx) => /* @__PURE__ */ React.createElement(SidebarItem, { key: idx, method: endpoint.method, title: endpoint.name || endpoint.path, active: selectedEndpoint === endpoint, onClick: () => setSelectedEndpoint(endpoint) }))))))), /* @__PURE__ */ React.createElement("main", { className: "flex-1 overflow-y-auto bg-white dark:bg-slate-950 px-12 py-10" }, /* @__PURE__ */ React.createElement("div", { className: "max-w-4xl mx-auto" }, /* @__PURE__ */ React.createElement(motion.div, { key: selectedEndpoint.path + selectedEndpoint.method, initial: { opacity: 0, y: 10 }, animate: { opacity: 1, y: 0 } }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-3 mb-4" }, /* @__PURE__ */ React.createElement("span", { className: `px-3 py-1 text-[11px] font-black rounded-lg uppercase border ${currentMethodColors.bg} ${currentMethodColors.text} ${currentMethodColors.border}` }, selectedEndpoint.method), /* @__PURE__ */ React.createElement("span", { className: "text-sm font-mono text-slate-400" }, selectedEndpoint.path)), /* @__PURE__ */ React.createElement("h2", { className: "text-4xl font-extrabold mb-2 tracking-tight" }, selectedEndpoint.name), /* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-2 p-3 bg-slate-100 dark:bg-slate-900 rounded-xl mb-6 border border-slate-200 dark:border-slate-800 group relative" }, /* @__PURE__ */ React.createElement(import_lucide_react.Globe, { className: "w-4 h-4 text-slate-400 group-hover:text-primary-500 transition-colors" }), /* @__PURE__ */ React.createElement("code", { className: "text-[13px] font-mono break-all text-slate-500 dark:text-slate-400 flex-1" }, displayFullUrl), /* @__PURE__ */ React.createElement("button", { onClick: () => navigator.clipboard.writeText(displayFullUrl), className: "opacity-0 group-hover:opacity-100 p-1.5 hover:bg-white dark:hover:bg-slate-800 rounded-lg transition-all text-[10px] font-bold uppercase text-primary-500" }, "Copy")), /* @__PURE__ */ React.createElement("p", { className: "text-sm text-slate-600 dark:text-slate-400 mb-10 leading-relaxed font-medium whitespace-pre-wrap" }, selectedEndpoint.description || "No description provided."), /* @__PURE__ */ React.createElement("div", { className: "space-y-12" }, /* @__PURE__ */ React.createElement("section", null, /* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-2 mb-6 border-b border-slate-100 dark:border-slate-800 pb-2" }, /* @__PURE__ */ React.createElement(import_lucide_react.Shield, { className: "w-5 h-5 text-slate-400" }), /* @__PURE__ */ React.createElement("h3", { className: "text-xl font-bold" }, "Security")), /* @__PURE__ */ React.createElement("div", { className: "p-4 bg-primary-500/5 border border-primary-500/10 rounded-2xl flex items-center justify-between" }, /* @__PURE__ */ React.createElement("span", { className: "text-sm font-medium" }, "Include Credentials (Cookies/Session)"), /* @__PURE__ */ React.createElement("span", { className: "text-[10px] font-bold bg-primary-500 text-white px-2 py-1 rounded-full uppercase tracking-tighter" }, "Enabled"))), /* @__PURE__ */ React.createElement("section", null, /* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-2 mb-6 border-b border-slate-100 dark:border-slate-800 pb-2" }, /* @__PURE__ */ React.createElement(import_lucide_react.Database, { className: "w-5 h-5 text-slate-400" }), /* @__PURE__ */ React.createElement("h3", { className: "text-xl font-bold" }, "Responses")), /* @__PURE__ */ React.createElement("div", { className: "space-y-6" }, Object.entries(selectedEndpoint.responses).map(([code, res]) => /* @__PURE__ */ React.createElement("div", { key: code, className: "p-5 rounded-2xl bg-slate-50 dark:bg-slate-900/30 border border-slate-100 dark:border-slate-800" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-start space-x-4 mb-2" }, /* @__PURE__ */ React.createElement("span", { className: `px-2.5 py-1 rounded-lg text-xs font-black ${code.startsWith("2") ? "text-green-500" : "text-red-500"}` }, code), /* @__PURE__ */ React.createElement("p", { className: "text-[15px] font-medium pt-0.5" }, res.description)), res.body && /* @__PURE__ */ React.createElement(SchemaPreview, { data: resolveModel(res.body), title: typeof res.body === "string" ? res.body : "Object" }))))))))), /* @__PURE__ */ React.createElement("aside", { className: "w-[480px] bg-slate-900 flex flex-col flex-shrink-0 text-white border-l border-slate-800 shadow-2xl" }, /* @__PURE__ */ React.createElement("div", { className: "p-6 border-b border-slate-800 flex items-center justify-between sticky top-0 z-10 bg-slate-900" }, /* @__PURE__ */ React.createElement("h4", { className: "text-sm font-bold uppercase tracking-widest text-slate-400" }, "Try It Out"), /* @__PURE__ */ React.createElement("button", { onClick: executeApi, disabled: loading, className: "px-6 py-2 bg-primary-500 text-white text-xs font-bold rounded-xl active:scale-95 transition-all disabled:opacity-50" }, loading ? "Executing..." : "Execute API")), /* @__PURE__ */ React.createElement("div", { className: "flex-1 overflow-y-auto p-6 space-y-8 font-mono text-[13px]" }, Object.keys(selectedEndpoint.params || {}).length > 0 && /* @__PURE__ */ React.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Path Parameters"), Object.entries(selectedEndpoint.params || {}).map(([key, def]) => /* @__PURE__ */ React.createElement(InputField, { key, label: key, placeholder: def.description, description: def.description, value: params[key], onChange: (val) => setParams((prev) => ({ ...prev, [key]: val })) }))), Object.keys(selectedEndpoint.query || {}).length > 0 && /* @__PURE__ */ React.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Query Parameters"), Object.entries(selectedEndpoint.query || {}).map(([key, def]) => /* @__PURE__ */ React.createElement(InputField, { key, label: key, placeholder: def.description, description: def.description, value: queryParams[key], onChange: (val) => setQueryParams((prev) => ({ ...prev, [key]: val })) }))), ["POST", "PUT", "PATCH"].includes(selectedEndpoint.method) && /* @__PURE__ */ React.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Request Body (JSON)"), /* @__PURE__ */ React.createElement("textarea", { value: body, onChange: (e) => setBody(e.target.value), placeholder: "Enter JSON body here...", className: "w-full h-48 bg-slate-950/50 border border-slate-800 rounded-2xl p-4 text-[13px] outline-none focus:ring-2 focus:ring-primary-500/50 transition-all text-slate-300 font-mono resize-none" })), /* @__PURE__ */ React.createElement("div", { className: "space-y-4" }, /* @__PURE__ */ React.createElement("div", { className: "flex items-center justify-between" }, /* @__PURE__ */ React.createElement("p", { className: "text-[10px] font-bold text-slate-500 uppercase tracking-widest" }, "Response"), response && /* @__PURE__ */ React.createElement("div", { className: "flex items-center space-x-3 text-[10px] font-bold" }, /* @__PURE__ */ React.createElement("span", { className: "flex items-center text-slate-400" }, /* @__PURE__ */ React.createElement(import_lucide_react.Clock, { className: "w-3 h-3 mr-1" }), " ", executionTime, "ms"), /* @__PURE__ */ React.createElement("span", { className: response.status < 300 ? "text-green-500" : "text-red-500" }, "STATUS: ", response.status))), /* @__PURE__ */ React.createElement("div", { className: "bg-slate-950/80 p-5 rounded-2xl border border-slate-800 min-h-[100px] overflow-x-auto" }, /* @__PURE__ */ React.createElement("pre", { className: `whitespace-pre ${response ? response.status >= 400 ? "text-red-400" : "text-green-400" : "text-slate-600"}` }, response ? JSON.stringify(response.data, null, 4) : "// Click 'Execute API'"))))));
|
|
33136
33136
|
};
|
|
33137
33137
|
|
|
33138
33138
|
// src/lib/index.ts
|