@redocly/cli 0.0.0-snapshot.1786981559 → 0.0.0-snapshot.1787063344
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/lib/chunks/{7TRFVYUO.js → 24ESKWFL.js} +1 -1
- package/lib/chunks/3GFYSU6P.js +7 -0
- package/lib/chunks/3J7TYMNY.js +12 -0
- package/lib/chunks/3KKMLZN3.js +907 -0
- package/lib/chunks/3XBPOSEL.js +9 -0
- package/lib/chunks/4QLYHB77.js +9 -0
- package/lib/chunks/{B5WLDLN6.js → 4SKAZCBW.js} +1 -1
- package/lib/chunks/525K3KKQ.js +7 -0
- package/lib/chunks/6RGGKRMK.js +7 -0
- package/lib/chunks/7VLU66PD.js +68 -0
- package/lib/chunks/AIHAS7WL.js +21 -0
- package/lib/chunks/{K2UXKI2V.js → B2HSCSZY.js} +1 -1
- package/lib/chunks/BBIPNV2E.js +519 -0
- package/lib/chunks/BDG6IUCF.js +12 -0
- package/lib/chunks/BLENHA73.js +875 -0
- package/lib/chunks/DCFZZBW4.js +7 -0
- package/lib/chunks/DSXAYXC6.js +7 -0
- package/lib/chunks/EG5RJVOK.js +7 -0
- package/lib/chunks/{2RS6QTNZ.js → ENVN665Z.js} +1 -1
- package/lib/chunks/FWC4UK42.js +7 -0
- package/lib/chunks/{ILXFDUDM.js → HW5YVDNF.js} +1 -1
- package/lib/chunks/{HN3COO3T.js → I273NYDN.js} +1 -1
- package/lib/chunks/{4CN66APV.js → I5PJ57KX.js} +1 -1
- package/lib/chunks/I7OXWDCF.js +15 -0
- package/lib/chunks/IIXD6MTE.js +53 -0
- package/lib/chunks/IWSGIYUF.js +7 -0
- package/lib/chunks/{5W2UW6CM.js → J4GR23FE.js} +1 -1
- package/lib/chunks/JKEX4O5F.js +7 -0
- package/lib/chunks/JWWD4Q3V.js +176 -0
- package/lib/chunks/KGC6UZEF.js +17 -0
- package/lib/chunks/KKC3JNZX.js +7 -0
- package/lib/chunks/L5QMCITI.js +460 -0
- package/lib/chunks/{JZHIT2D6.js → LXG2SIFN.js} +2 -2
- package/lib/chunks/NTV4IYLO.js +7 -0
- package/lib/chunks/OAHVR5VG.js +7 -0
- package/lib/chunks/OASJV7SH.js +7 -0
- package/lib/chunks/{YXIFRLAQ.js → PABGNVKY.js} +1 -1
- package/lib/chunks/QZ4IM6W3.js +41 -0
- package/lib/chunks/RQRJWX5O.js +7 -0
- package/lib/chunks/RUGBARP6.js +25 -0
- package/lib/chunks/{PQIVJVVR.js → SRU4AKOH.js} +1 -1
- package/lib/chunks/TN2II3C6.js +2532 -0
- package/lib/chunks/VL2X6UEV.js +7 -0
- package/lib/chunks/{PBP4ER2C.js → VRLTHLBT.js} +1 -1
- package/lib/chunks/{E3RZ2XAH.js → W44PVWUQ.js} +1 -1
- package/lib/chunks/WADSYGSX.js +8 -0
- package/lib/chunks/WJDVORBS.js +11 -0
- package/lib/chunks/{GW3KXIEQ.js → WKR5Q7LM.js} +1 -1
- package/lib/chunks/X4TYPL6T.js +9 -0
- package/lib/chunks/Y4KBXPSO.js +184 -0
- package/lib/chunks/YOREK3PZ.js +7 -0
- package/lib/chunks/YSMUBJCG.js +7 -0
- package/lib/chunks/{OR44WUDX.js → YXVH3SNZ.js} +1 -1
- package/lib/chunks/YYGTKCOF.js +7 -0
- package/lib/chunks/Z224NMB5.js +7 -0
- package/lib/chunks/ZGQWJITG.js +9 -0
- package/lib/chunks/ZTS6JG4V.js +7 -0
- package/lib/chunks/{H63AUFXL.js → ZU6UIRB3.js} +1 -1
- package/lib/eject-assets/AGENTS.md +130 -0
- package/lib/eject-assets/generators/cli.mjs +700 -0
- package/lib/eject-assets/generators/go.mjs +856 -0
- package/lib/eject-assets/generators/mock.mjs +689 -0
- package/lib/eject-assets/generators/php.mjs +830 -0
- package/lib/eject-assets/generators/python.mjs +742 -0
- package/lib/eject-assets/generators/swr.mjs +267 -0
- package/lib/eject-assets/generators/tanstack-query.mjs +632 -0
- package/lib/eject-assets/generators/transformers.mjs +403 -0
- package/lib/eject-assets/generators/typescript.mjs +1819 -0
- package/lib/eject-assets/generators/zod.mjs +520 -0
- package/lib/eject-assets/skills/cli-generator/SKILL.md +112 -0
- package/lib/eject-assets/skills/client-generators/SKILL.md +135 -0
- package/lib/eject-assets/skills/go-generator/SKILL.md +89 -0
- package/lib/eject-assets/skills/mock-generator/SKILL.md +45 -0
- package/lib/eject-assets/skills/php-generator/SKILL.md +105 -0
- package/lib/eject-assets/skills/python-generator/SKILL.md +93 -0
- package/lib/eject-assets/skills/swr-generator/SKILL.md +44 -0
- package/lib/eject-assets/skills/tanstack-query-generator/SKILL.md +48 -0
- package/lib/eject-assets/skills/transformers-generator/SKILL.md +43 -0
- package/lib/eject-assets/skills/typescript-generator/SKILL.md +73 -0
- package/lib/eject-assets/skills/zod-generator/SKILL.md +49 -0
- package/lib/index.js +258 -232
- package/package.json +1 -1
- package/lib/chunks/4MDSODM5.js +0 -2542
- package/lib/chunks/DPT4RB2T.js +0 -187
- package/lib/chunks/XDQREKXU.js +0 -8
|
@@ -4,5 +4,5 @@ import { dirname as __pathDirname } from 'node:path';
|
|
|
4
4
|
const require = __createRequire(import.meta.url);
|
|
5
5
|
var __filename = __fileURLToPath(import.meta.url);
|
|
6
6
|
var __dirname = __pathDirname(__filename);
|
|
7
|
-
import{c}from"./
|
|
7
|
+
import{c}from"./Y4KBXPSO.js";import{open as C,readdir as N,stat as P}from"node:fs/promises";import d from"node:path";var $=new Set([".yaml",".yml",".json"]);async function D(e){let n=[];async function t(r){let o=await N(r,{withFileTypes:!0});for(let s of o){if(s.name.startsWith("."))continue;let i=d.join(r,s.name);if(s.isDirectory()){await t(i);continue}s.isFile()&&$.has(d.extname(s.name).toLowerCase())&&n.push(i)}}return await t(e),n.sort(),n}async function _(e,n=4096){let t=await C(e,"r");try{let r=Buffer.allocUnsafe(n),{bytesRead:o}=await t.read(r,0,n,0);return r.toString("utf8",0,o)}finally{await t.close()}}function M(e){return d.resolve(process.cwd(),e)}async function K(e){let n=await P(e);if(n.isFile())return[e];if(!n.isDirectory())return[];let t=[];async function r(o){let s=await N(o,{withFileTypes:!0});for(let i of s){if(i.name.startsWith("."))continue;let a=d.join(o,i.name);if(i.isDirectory()){await r(a);continue}i.isFile()&&t.push(a)}}return await r(e),t.sort(),t}var k="drift.local",O=`http://${k}`;function u(e){return e===k}var U=new Set(["accept","accept-charset","accept-encoding","accept-language","authorization","baggage","cache-control","cdn-loop","cookie","connection","content-length","content-type","dpr","dnt","downlink","ect","forwarded","host","if-match","if-modified-since","if-none-match","if-range","if-unmodified-since","origin","pragma","priority","range","referer","sec-fetch-dest","sec-fetch-mode","sec-fetch-site","sec-fetch-user","sec-gpc","sentry-trace","te","traceparent","tracestate","upgrade","upgrade-insecure-requests","user-agent","via","x-client-trace-id","x-cloud-trace-context","x-correlation-id","x-http-method-override","x-hub-signature","x-hub-signature-256","x-method-override","x-real-ip","x-request-id","x-forwarded-for","x-forwarded-host","x-forwarded-port","x-forwarded-proto"]),J=["cf-","sec-ch-","sec-fetch-","x-amz-","x-amzn-","x-b3-","x-envoy-","x-forwarded-","x-github-"],R=`
|
|
8
8
|
`;function Y(e){return e.split(R)}function g(e,n,t){let r=n.toLowerCase(),o=e[r];if(o===void 0){e[r]=t;return}e[r]=r==="set-cookie"?`${o}${R}${t}`:`${o},${t}`}function p(e){if(!c(e)&&!Array.isArray(e))return{};let n={};if(Array.isArray(e)){for(let t of e){if(!c(t))continue;let{name:r,value:o}=t;typeof r=="string"&&o!==void 0&&g(n,r,String(o))}return n}for(let[t,r]of Object.entries(e))if(r!=null){if(Array.isArray(r)){for(let o of r)g(n,t,String(o));continue}g(n,t,String(r))}return n}function f(e){try{return new URL(e)}catch{return new URL(e,O)}}function m(e){return e.length>1&&e.endsWith("/")?e.slice(0,-1):e}function L(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function V(e){let n=[],t=0,r=e.startsWith("/")?e:`/${e}`,s=m(r).split("/").map(i=>{if(!i)return"";let a=i.match(/^\{([^}]+)\}$/);return a?(n.push(a[1]),"([^/]+)"):(t+=2,L(i))}).join("/");return{regex:new RegExp(`^${s||"/"}$`),params:n,score:t}}function l(e,n){if(n&&A(e))try{return JSON.parse(n)}catch{return}}function E(e){return e?e.split(";")[0]?.trim().toLowerCase()??"":""}function A(e){let n=E(e);return n==="application/json"||n.endsWith("+json")}function Q(e,n){let t=E(n);if(!t)return e["application/json"]??e["*/*"];if(e[t]!==void 0)return e[t];let[r,o]=t.split("/");if(r&&o){let s=`${r}/*`;if(e[s]!==void 0)return e[s]}return e["*/*"]}function Z(e){let n=new Set,t=[];for(let r of e){let o=r.trim().toLowerCase();o.length!==0&&(o.endsWith("*")?t.push(o.slice(0,-1)):n.add(o))}return{names:n,prefixes:t}}function v(e,n){let t=e.toLowerCase();return t.startsWith(":")||U.has(t)||J.some(r=>t.startsWith(r))?!0:n?n.names.has(t)||n.prefixes.some(r=>t.startsWith(r)):!1}import{createReadStream as q}from"node:fs";import{readFile as B}from"node:fs/promises";import{createInterface as F}from"node:readline";function I(e){if(e!=null){if(typeof e=="string")return e;if(Buffer.isBuffer(e))return e.toString("utf8");if(c(e)||Array.isArray(e))try{return JSON.stringify(e)}catch{return String(e)}return String(e)}}function se(e){if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim()!==""){let n=Number(e);if(Number.isFinite(n))return n}}function H(e,n){if(e!=null){if(n==="base64"&&typeof e=="string")try{return Buffer.from(e,"base64").toString("utf8")}catch{return e}return I(e)}}function ae(e,n,t){let r=e.method?.toUpperCase(),o=e.url;if(!r||!o)return null;let s=p(e.requestHeaders),i=f(o);if(u(i.host)&&s.host)try{i=new URL(`${i.protocol}//${s.host}${i.pathname}${i.search}`)}catch{i=f(o)}let a=e.requestContentType??s["content-type"],y=H(e.requestBody),T={method:r,url:i.toString(),path:i.pathname,query:i.searchParams,protocol:i.protocol,protocolKnown:e.schemeKnown??/^https?:\/\//i.test(o),host:u(i.host)?void 0:i.host||void 0,headers:s,contentType:a,bodyText:y,bodyJson:l(a,y)},h,x=e.responseStatus;if(x!==void 0){let w=p(e.responseHeaders),S=e.responseContentType??w["content-type"],b=H(e.responseBody);h={status:x,statusText:e.responseStatusText,headers:w,contentType:S,bodyText:b,bodyJson:l(S,b)}}return{index:n,source:t,startedAt:e.startedAt,request:T,response:h,raw:e.raw}}async function*ce(e){let n=q(e,{encoding:"utf8"}),t=F({input:n,crlfDelay:1/0});for await(let r of t){let o=r.trim();if(o)try{let s=JSON.parse(o);c(s)&&(yield s)}catch{}}}async function*ue(e,n){let t=await B(e,"utf8"),r=JSON.parse(t);if(n)for(let o of n.split("."))r=c(r)?r[o]:void 0;if(Array.isArray(r))for(let o of r)c(o)&&(yield o)}function fe(e){return p(e)["content-type"]}function ge(e){return e?.replace(/\/+$/,"")||void 0}function z(e,n){if(!n||n==="/")return e||"/";if(e===n)return"/";if(e.startsWith(`${n}/`))return e.slice(n.length)||"/"}function me(e,n){if(n.startsWith("/"))return z(e.path,n);let t=f(n.includes("://")?n:`http://${n}`);if(!(u(t.host)||e.host!==void 0&&e.host.toLowerCase()!==t.host))return z(e.path,m(t.pathname))}export{D as a,_ as b,M as c,K as d,u as e,Y as f,f as g,m as h,V as i,E as j,A as k,Q as l,Z as m,v as n,I as o,se as p,H as q,ae as r,ce as s,ue as t,fe as u,ge as v,me as w};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
var __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __pathDirname(__filename);
|
|
7
|
+
var i="text/event-stream";function t(n){return n.successResponses.find(e=>e.contentType.split(";")[0].trim().toLowerCase()===i)}function s(n){return t(n)!==void 0}function r(n){let e=t(n);if(e){if(e.itemSchema&&e.itemSchema.kind!=="unknown")return e.itemSchema;if(e.schema.kind!=="unknown")return e.schema}}function o(n){let e=r(n);return e&&(e.kind==="object"||e.kind==="ref"||e.kind==="array"||e.kind==="record"||e.kind==="union"||e.kind==="intersection")?"json":"text"}export{s as a,r as b,o as c};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { createRequire as __createRequire } from 'node:module';
|
|
2
|
+
import { fileURLToPath as __fileURLToPath } from 'node:url';
|
|
3
|
+
import { dirname as __pathDirname } from 'node:path';
|
|
4
|
+
const require = __createRequire(import.meta.url);
|
|
5
|
+
var __filename = __fileURLToPath(import.meta.url);
|
|
6
|
+
var __dirname = __pathDirname(__filename);
|
|
7
|
+
import{c as y,f as D}from"./BDG6IUCF.js";import{e as T,g as E}from"./3XBPOSEL.js";import{join as z}from"node:path";var a=" ";function m(r){return`transform${E(r)}`}var B="type __Writable<T> = { -readonly [K in keyof T]: T[K] };",A=!1;function I(r){return{text:r,path:[r]}}function G(r,t){return{text:`${r.text}[${JSON.stringify(t)}]`,path:[...r.path,t]}}function d(r,t,n){if(k(r))return!0;switch(r.kind){case"array":return d(r.items,t,n);case"union":return r.members.some(o=>d(o,t,n));case"ref":{if(n.has(r.name))return!1;let o=t.get(r.name);return o!==void 0&&d(o,t,new Set(n).add(r.name))}default:return!1}}function k(r){return r.kind==="scalar"&&r.scalar==="string"&&(r.metadata?.format==="date-time"||r.metadata?.format==="date")}function $(r,t,n){if(k(r))return!0;switch(r.kind){case"array":return $(r.items,t,n);case"record":return $(r.value,t,n);case"object":return r.properties.some(o=>$(o.schema,t,n));case"union":case"intersection":return r.members.some(o=>$(o,t,n));case"ref":{let o=t.get(r.name);return o!==void 0&&!n.has(r.name)?$(o,t,new Set(n).add(r.name)):!1}default:return!1}}function l(r,t,n,o=!1){return o?[`${n}if (${r}) {`,...t(n+a),`${n}}`]:[`${n}if (${r})`,...t(n+a)]}function j(r,t,n=!1){let o=n?K(r):r.text;return u=>[`${u}${o} = ${t};`]}function _(r){return t=>[`${t}${r};`]}function K(r){if(r.path.length<2)return r.text;A=!0;let t={text:r.text.slice(0,r.text.lastIndexOf("[")),path:r.path.slice(0,-1)},n=r.path[r.path.length-1];return`(${t.text} as __Writable<${R(t)}>)[${JSON.stringify(n)}]`}function R(r){let t=`typeof ${r.path[0]}`;for(let n of r.path.slice(1))t=`NonNullable<${t}>[${JSON.stringify(n)}]`;return`NonNullable<${t}>`}function U(r){return r==="data"?"item":`item${Number(r.slice(4))+1}`}function p(r,t,n,o,u,e,i=!1){if(k(t))return l(`typeof ${r.text} === "string"`,j(r,`new Date(${r.text})`,i),e);switch(t.kind){case"ref":return S(r,t.name,n,o,e,i);case"object":{let f=[];for(let c of t.properties)f.push(...H(G(r,c.name),c.schema,n,o,u,e,c.readOnly===!0));return f}case"array":return P(r,t.items,n,o,u,e,i);case"record":return J(r,t.value,n,o,u,e,!0);case"intersection":{let f=[];for(let c of t.members)f.push(...p(r,c,n,o,u,e,i));return f}case"union":return b(r,t.members,n,o,u,e,i);default:return[]}}function b(r,t,n,o,u,e,i=!1){let f=[],c=e+a,x=[];for(let s of t)if(k(s))f.push(...p(r,s,n,o,u,e,i));else if(s.kind==="ref"){if(!$(s,n,o))continue;let w=`${m(s.name)}(${r.text} as ${s.name})`,v=d(s,n,o)?j(r,w,i):_(w);x.push(...v(c))}else x.push(...p(r,s,n,o,u,c,i));return x.length>0&&f.push(...l(`${r.text} && typeof ${r.text} === "object"`,()=>x,e,!0)),f}function S(r,t,n,o,u,e=!1){let i={kind:"ref",name:t};if(!$(i,n,o))return[];let f=`${m(t)}(${r.text})`;return l(r.text,d(i,n,o)?j(r,f,e):_(f),u)}function H(r,t,n,o,u,e,i=!1){if(t.kind==="ref")return S(r,t.name,n,o,e,i);if(t.kind==="object"){let f=p(r,t,n,o,u,e+a);return f.length===0?[]:l(r.text,()=>f,e,!0)}return p(r,t,n,o,u,e,i)}function h(r,t,n,o,u=0){if(k(t))return`new Date(${r})`;if(t.kind==="ref"&&d(t,n,o))return`${m(t.name)}(${r})`;if(t.kind==="array"){let e=t.items.kind==="array"?M(u+1):"v",i=h(e,t.items,n,o,u+1);return i===null?null:`${r}.map(${e} => ${i})`}return null}function M(r){return r<=1?"row":`row${r}`}function P(r,t,n,o,u,e,i=!1){let f=t.kind==="array"?M(1):"v",c=h(f,t,n,o,1);return c!==null?l(`Array.isArray(${r.text})`,j(r,`${r.text}.map(${f} => ${c})`,i),e):t.kind==="ref"?$(t,n,o)?l(`Array.isArray(${r.text})`,_(`${r.text}.forEach(${m(t.name)})`),e):[]:J(r,t,n,o,u,e,!1)}function J(r,t,n,o,u,e,i){if(i){let s={text:`${r.text}[__k]`,path:[...r.path,"__k"]},w=h(s.text,t,n,o);if(w!==null){let v=k(t)?`typeof ${s.text} === "string"`:`Array.isArray(${s.text})`;return l(r.text,O=>[`${O}for (const __k of Object.keys(${r.text}))`,...l(v,W=>[`${W}${s.text} = ${w};`],O+a)],e)}}let f=U(u),c=p(I(f),t,n,o,f,e+a+a);if(c.length===0)return[];let x=i?`Object.values(${r.text})`:r.text;return l(i?r.text:`Array.isArray(${r.text})`,s=>[`${s}${x}.forEach(${f} => {`,...c,`${s}});`],e)}function q(r,t){let n=r.name,o=I("data"),u=r.schema.kind==="ref"?S(o,r.schema.name,t,new Set,a):p(o,r.schema,t,new Set,"data",a);return[`export const ${m(r.name)} = (data: ${n}): ${n} => {`,...u,`${a}return data;`,"};"].join(`
|
|
8
|
+
`)}function C(r,t){let n=new Map(r.schemas.map(f=>[f.name,f.schema])),o=r.schemas.filter(f=>$(f.schema,n,new Set));if(o.length===0)return"";let u=o.map(f=>T(f.name)).join(", ");A=!1;let e=o.map(f=>q(f,n));return[`import type { ${u} } from ${JSON.stringify(t.sdkModule)};`,...A?[B]:[],...e].join(`
|
|
9
|
+
|
|
10
|
+
`)}var N=({model:r,outputPath:t,emit:n})=>{let{dir:o,stem:u}=D(t),e=C(r,{sdkModule:`./${u}.${n.importExt??"js"}`});return e===""?[]:[{path:z(o,`${u}.transformers.ts`),content:`${y}
|
|
11
|
+
|
|
12
|
+
${e}`}]};export{N as a};
|