PageSourceSearch

https://100plus.tools/_next/static/chunks/11949.292e0f849fe39f17.js

js 100plus.tools collected 2026-10-02 00:01:48 UTC 14,735 bytes, 1 lines download raw bytes

1"use strict";(self.webpackChunk_N_E=self.webpackChunk_N_E||[]).push([[11949,73356],{30401:function(e,t,s){s.d(t,{Z:function(){return a}});let a=(0,s(79205).Z)("check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]])},78867:function(e,t,s){s.d(t,{Z:function(){return a}});let a=(0,s(79205).Z)("copy",[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]])},48736:function(e,t,s){s.d(t,{Z:function(){return a}});let a=(0,s(79205).Z)("file-text",[["path",{d:"M6 22a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h8a2.4 2.4 0 0 1 1.704.706l3.588 3.588A2.4 2.4 0 0 1 20 8v12a2 2 0 0 1-2 2z",key:"1oefj6"}],["path",{d:"M14 2v5a1 1 0 0 0 1 1h5",key:"wfsgrz"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]])},73356:function(e,t,s){s.r(t),s.d(t,{API_DOC_EXAMPLES:function(){return a}});let a=[{label:"Simple GET",input:'curl "https://api.example.com/users?limit=20&page=1"'},{label:"POST + Auth",input:'curl -X POST "https://api.example.com/users" \\\n  -H "Authorization: Bearer YOUR_TOKEN" \\\n  -H "Content-Type: application/json" \\\n  -d \'{"name": "Alice", "email": "[email protected]", "role": "admin"}\''},{label:"CRUD set",input:'curl "https://api.example.com/products?category=electronics" \\\n  -H "Authorization: Bearer YOUR_TOKEN"\n\ncurl -X POST "https://api.example.com/products" \\\n  -H "Authorization: Bearer YOUR_TOKEN" \\\n  -H "Content-Type: application/json" \\\n  -d \'{"name": "Widget Pro", "price": 29.99, "stock": 150}\'\n\ncurl -X PUT "https://api.example.com/products/42" \\\n  -H "Authorization: Bearer YOUR_TOKEN" \\\n  -H "Content-Type: application/json" \\\n  -d \'{"price": 24.99, "stock": 200}\'\n\ncurl -X DELETE "https://api.example.com/products/42" \\\n  -H "Authorization: Bearer YOUR_TOKEN"'},{label:"HTTP format",input:'POST /orders HTTP/1.1\nHost: api.example.com\nContent-Type: application/json\nAuthorization: Bearer YOUR_TOKEN\nAccept: application/json\n\n{"product_id": 42, "quantity": 3, "shipping": "express", "address": {"street": "123 Main St", "city": "Austin"}}'}]},11949:function(e,t,s){s.r(t),s.d(t,{default:function(){return x}});
1var a=s(57437),n=s(2265),r=s(79820),l=s(30401),o=s(78867),c=s(48736),i=s(69064),u=s(49896),d=s(73356);function p(e,t,s,a){let{host:n,path:r,query:l}=function(e){try{let t=new URL(e),s=[];return t.searchParams.forEach((e,t)=>s.push({key:t,value:e})),{host:t.host,path:t.pathname,query:s}}catch(n){let[t,s]=e.split("?"),a=[];return s&&s.split("&").forEach(e=>{let[t,s]=e.split("=");a.push({key:decodeURIComponent(null!=t?t:""),value:decodeURIComponent(null!=s?s:"")})}),{host:"",path:null!=t?t:e,query:a}}}(t),o=function(e,t){var s,a;if(!t)return"none";let n=null!==(a=null===(s=e.find(e=>"content-type"===e.key.toLowerCase()))||void 0===s?void 0:s.value)&&void 0!==a?a:"";if(n.includes("json"))return"json";if(n.includes("x-www-form-urlencoded"))return"form";let r=t.trim();return r.startsWith("{")&&r.endsWith("}")||r.startsWith("[")&&r.endsWith("]")?"json":"text"}(s,a);return{method:e,url:t,path:r,query:l,host:n,headers:s,body:a.trim(),bodyType:o}}function h(e){var t,s,a,n,r,l,o;let c;let i=e.replace(/\\\s*\n\s*/g," ").trim();if(!i.toLowerCase().startsWith("curl"))return null;let u="GET",d="",h=[],m="",x=i.match(/(?:-X|--request)\s+([A-Z]+)/i);x&&(u=x[1].toUpperCase());let f=i.match(/"(https?:\/\/[^"]+)"|'(https?:\/\/[^']+)'|(https?:\/\/[^\s'"\\]+)/);f&&(d=null!==(a=null!==(s=null!==(t=f[1])&&void 0!==t?t:f[2])&&void 0!==s?s:f[3])&&void 0!==a?a:"");let g=/(?:-H|--header)\s+(?:"([^"]+)"|'([^']+)')/g;for(;null!==(c=g.exec(i));){let e=null!==(r=null!==(n=c[1])&&void 0!==n?n:c[2])&&void 0!==r?r:"",t=e.indexOf(":");t>0&&h.push({key:e.slice(0,t).trim(),value:e.slice(t+1).trim()})}let b=i.match(/(?:--data(?:-raw|-binary|-urlencode)?|-d)\s+(?:"((?:[^"\\]|\\.)*)"|'([^']*)')/);return(b&&(m=null!==(o=null!==(l=b[1])&&void 0!==l?l:b[2])&&void 0!==o?o:"","GET"===u&&(u="POST")),d)?p(u,d,h,m):null}function m(e){var t;let s=e.trim();return s?s.toLowerCase().startsWith("curl")?h(s):null!==(t=function(e){var t,s;let a=e.trim().split("\n"),n=(null!==(s=null===(t=a[0])||void 0===t?void 0:t.trim())&&void 0!==s?s:"").match(/^(GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)\s+(\S+)(?:\s+HTTP\/[\d.]+)?/i);if(!n)return null;let r=n[1].toUpperCase(),l=n[2],o=[],c="",i=-1;for(let e=1;e<a.length;e++){let t=a[e].trim();if(""===t){i=e+1;break}let s=t.indexOf(":");if(s>0){let e=t.slice(0,s).trim(),a=t.slice(s+1).trim();o.push({key:e,value:a}),"host"===e.toLowerCase()&&(c=a)}}let u=i>=0?a.slice(i).join("\n").trim():"";return p(r,c?"https://".concat(c).concat(l):l,o,u)}(s))&&void 0!==t?t:h(s):null}function x(e){let{tool:t}=e,[s,p]=(0,n.useState)(""),[h,x]=(0,n.useState)(!1),f=(0,n.useMemo)(()=>s.trim()?(s.trim().length>10&&(0,u.L9)("tool_used",{tool_slug:t.slug,tool_name:t.title,category:t.category}),function(e){if(!e.trim())return"";let t=e.split(/\n\s*---\s*\n|\n{2,}(?=curl\s|GET\s|POST\s|PUT\s|PATCH\s|DELETE\s|HEAD\s|OPTIONS\s)/i).map(e=>e.trim()).filter(Boolean).map(m).filter(e=>null!==e);if(0===t.length)return"<!-- Could not parse any requests. Paste cURL commands or raw HTTP requests. -->";let s=[];return s.push("# API Documentation"),s.push(""),s.push("> Generated from ".concat(t.length," request").concat(1===t.length?"":"s")),s.push(""),s.push("---"),s.push(""),t.length>1&&(s.push("## Endpoints"),s.push(""),t.forEach((e,t)=>{let a=e.path&&"/"!==e.path?"".concat(e.method," ").concat(e.path):e.method;s.push("".concat(t+1,". [`").concat(a,"`](#").concat(t+1,"-").concat(e.method.toLowerCase(),"-").concat(e.path.replace(/[^a-z0-9]/gi,"-").replace(/-+/g,"-").replace(/^-|-$/g,""),")"))}),s.push(""),s.push("---"),s.push("")),t.forEach((e,a)=>{s.push(function(e,t,s){var a;let n=[],r=e.path&&"/"!==e.path?"".concat(e.method," ").concat(e.path):"".concat(e.method," ").concat(e.url);if(n.push(s>1?"### ".concat(t+1,". ").concat(r):"## ".concat(r)),n.push(""),n.push("| Field | Value |"),n.push("|-------|-------|"),n.push("| **Method** | ".concat((a=e.method,"`".concat(a,"`"))," |")),n.push("| **URL** | `".concat(e.url,"` |")),e.host&&n.push("| **Host** | `".concat(e.host,"` |")),n.push(""),e.query.length>0){for(let t of(n.push("#### Query Parameters"),n.push(""),n.push("| Parameter | Value |"),n.push("|-----------|-------|"),e.query))n.push("| `".concat(t.key,"` | `").concat(t.value,"` |"));n.push("")}let l=e.headers.filter(e=>"content-length"!==e.key.toLowerCase());if(l.length>0){for(let e of(n.push("#### Headers"),n.push(""),n.push("| Header | Value |"),n.push("|--------|-------|"),l))n.push("| `".concat(e.key,"` | `").concat(e.value,"` |"));n.push("")}if(e.body&&"none"!==e.bodyType){let t=e.headers.find(e=>"content-type"===e.key.toLowerCase());t&&n.push("**Content-Type**: `".concat(t.value,"`")),n.push(""),n.push("#### Request Body"),n.push("");let s="json"===e.bodyType?"json":(e.bodyType,"text");n.push("```"+s),n.push(function(e,t){if("json"===t)try{return JSON.stringify(JSON.parse(e),null,2)}catch(e){}return e}(e.body,e.bodyType)),n.push("```"),n.push("")}n.push("#### cURL Example"),n.push(""),n.push("```bash");let o=["curl -X ".concat(e.method,' "').concat(e.url,'"')];for(let t of e.headers)o.push('  -H "'.concat(t.key,": ").concat(t.value,'"'));if(e.body){let t=e.body.replace(/'/g,"'\\''");o.push("  -d '".concat(t,"'"))}return n.push(o.join(" \\\n")),n.push("```"),n.push(""),n.join("\n")}(e,a,t.length)),a<t.length-1&&(s.push("---"),s.push(""))}),s.join("\n").trim()}(s)):"",[s,t.slug,t.title,t.category]),g=(0,n.useCallback)(e=>{let t=d.API_DOC_EXAMPLES[e];t&&(p(t.input),i.Am.success("Loaded: ".concat(t.label)))},[]),b=(0,n.useCallback)(()=>{p(""),i.Am.success("Cleared")},[]),y=(0,n.useCallback)(async()=>{f&&(await navigator.clipboard.writeText(f),x(!0),i.Am.success("Markdown copied"),(0,u.L9)("tool_completed",{tool_slug:t.slug,tool_name:t.title,category:t.category,success:!0}),setTimeout(()=>x(!1),2e3))},[f,t.slug,t.title,t.category]),T=(0,n.useMemo)(()=>{var e;return f?(null!==(e=f.match(/^#{2,3}\s+\d*\.?\s*(?:GET|POST|PUT|PATCH|DELETE|HEAD|OPTIONS)/gm))&&void 0!==e?e:[]).length:0},[f]);return(0,a.jsxs)("div",{className:"space-y-4",children:[(0,a.jsx)(r.Zb,{children:(0,a.jsx)(r.aY,{className:"pt-4 pb-4",children:(0,a.jsxs)("div",{className:"flex flex-wrap gap-2 items-center",children:[(0,a.jsx)("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:"Examples:"}),d.API_DOC_EXAMPLES.map((e,t)=>(0,a.jsx)("button",{onClick:()=>
1g(t),className:"text-xs px-3 py-1.5 bg-slate-100 dark:bg-slate-700 hover:bg-slate-200 dark:hover:bg-slate-600 text-slate-700 dark:text-slate-300 rounded-full transition-colors",children:e.label},t)),(0,a.jsx)("button",{onClick:b,className:"text-xs px-3 py-1.5 border border-slate-300 dark:border-slate-600 hover:bg-slate-100 dark:hover:bg-slate-700 text-slate-600 dark:text-slate-400 rounded-full transition-colors ml-auto",children:"Clear"})]})})}),(0,a.jsxs)("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-6",children:[(0,a.jsxs)(r.Zb,{children:[(0,a.jsx)(r.Ol,{className:"pb-2 pt-4 px-4",children:(0,a.jsx)(r.ll,{className:"text-sm font-semibold",children:"Input — cURL or HTTP Requests"})}),(0,a.jsxs)(r.aY,{className:"px-4 pb-4 space-y-3",children:[(0,a.jsx)("textarea",{value:s,onChange:e=>p(e.target.value),placeholder:'Paste one or more cURL commands or raw HTTP requests.\n\nSeparate multiple requests with a blank line.\n\nExamples:\n  curl -X POST "https://api.example.com/users" \\\n    -H "Content-Type: application/json" \\\n    -d \'{"name": "Alice"}\'\n\nor:\n\n  POST /users HTTP/1.1\n  Host: api.example.com\n  Content-Type: application/json\n\n  {"name": "Alice"}',rows:22,spellCheck:!1,className:"w-full px-3 py-2.5 text-xs font-mono border border-input bg-background rounded-md focus:outline-none focus:ring-2 focus:ring-ring resize-y"}),(0,a.jsxs)("div",{className:"flex items-center justify-between text-xs text-slate-500 dark:text-slate-400",children:[(0,a.jsx)("span",{children:"Supports cURL, raw HTTP (RFC 7230), or a mix. Separate multiple requests with a blank line."}),s&&(0,a.jsxs)("span",{className:"shrink-0 ml-2",children:[s.length.toLocaleString()," chars"]})]})]})]}),(0,a.jsxs)(r.Zb,{children:[(0,a.jsx)(r.Ol,{className:"pb-2 pt-4 px-4",children:(0,a.jsxs)("div",{className:"flex items-center justify-between",children:[(0,a.jsxs)(r.ll,{className:"text-sm font-semibold",children:["Output — Markdown Documentation",T>0&&(0,a.jsxs)("span",{className:"ml-2 text-xs font-normal text-slate-500 dark:text-slate-400",children:[T," endpoint",1!==T?"s":""]})]}),f&&(0,a.jsxs)("button",{onClick:y,className:"flex items-center gap-1.5 text-xs text-slate-500 hover:text-slate-700 dark:hover:text-slate-300 transition-colors",children:[h?(0,a.jsx)(l.Z,{className:"h-3.5 w-3.5 text-green-500"}):(0,a.jsx)(o.Z,{className:"h-3.5 w-3.5"}),h?"Copied":"Copy Markdown"]})]})}),(0,a.jsx)(r.aY,{className:"px-4 pb-4",children:f?(0,a.jsx)("pre",{className:"bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-700 rounded-lg p-4 text-xs font-mono text-slate-800 dark:text-slate-200 overflow-auto max-h-[560px] whitespace-pre",children:f}):(0,a.jsxs)("div",{className:"flex flex-col items-center justify-center min-h-[400px] rounded-lg border border-dashed border-slate-300 dark:border-slate-600 bg-slate-50 dark:bg-slate-800/50 text-center p-6",children:[(0,a.jsx)(c.Z,{className:"h-8 w-8 text-slate-300 dark:text-slate-600 mb-2"}),(0,a.jsx)("p",{className:"text-sm text-slate-400 dark:text-slate-500",children:"Paste a cURL command or HTTP request to generate docs"})]})})]})]}),(0,a.jsxs)(r.Zb,{className:"p-5",children:[(0,a.jsx)("h3",{className:"text-sm font-semibold text-slate-900 dark:text-slate-100 mb-3",children:"Supported Input Formats"}),(0,a.jsxs)("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300",children:"cURL command"}),(0,a.jsx)("pre",{className:"text-xs font-mono bg-slate-100 dark:bg-slate-800 p-3 rounded text-slate-700 dark:text-slate-300 whitespace-pre",children:'curl -X POST "https://api.example.com/users" \\\n  -H "Content-Type: application/json" \\\n  -d \'{"name": "Alice"}\''})]}),(0,a.jsxs)("div",{className:"space-y-1.5",children:[(0,a.jsx)("p",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300",children:"Raw HTTP request"}),(0,a.jsx)("pre",{className:"text-xs font-mono bg-slate-100 dark:bg-slate-800 p-3 rounded text-slate-700 dark:text-slate-300 whitespace-pre",children:'POST /users HTTP/1.1\nHost: api.example.com\nContent-Type: application/json\n\n{"name": "Alice"}'})]})]}),(0,a.jsx)("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-3",children:"Separate multiple requests with a blank line. The generator detects query parameters, request headers, JSON body, and reconstructs a clean cURL example in the output."})]}),(0,a.jsx)("div",{className:"flex items-start gap-3 p-4 bg-slate-50 dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 rounded-lg",children:(0,a.jsxs)("div",{className:"text-sm text-slate-600 dar
1k:text-slate-400",children:[(0,a.jsx)("strong",{className:"text-slate-800 dark:text-slate-200",children:"100% client-side."})," ","All parsing and Markdown generation runs in your browser. Your API endpoints, headers, and request bodies are never sent to any server."]})})]})}},79820:function(e,t,s){s.d(t,{Ol:function(){return o},SZ:function(){return i},Zb:function(){return l},aY:function(){return u},ll:function(){return c}});var a=s(57437),n=s(2265),r=s(93448);let l=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("rounded-lg border bg-card text-card-foreground shadow-sm",s),...n})});l.displayName="Card";let o=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("flex flex-col space-y-1.5 p-6",s),...n})});o.displayName="CardHeader";let c=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("text-2xl font-semibold leading-none tracking-tight",s),...n})});c.displayName="CardTitle";let i=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("text-sm text-muted-foreground",s),...n})});i.displayName="CardDescription";let u=n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("p-6 pt-0",s),...n})});u.displayName="CardContent",n.forwardRef((e,t)=>{let{className:s,...n}=e;return(0,a.jsx)("div",{ref:t,className:(0,r.cn)("flex items-center p-6 pt-0",s),...n})}).displayName="CardFooter"}}]);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.