@redocly/cli 2.54.2 → 2.55.0
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/THIRD_PARTY_NOTICES +2 -2
- package/lib/chunks/{AQQVMAUF.js → 22LQIPY2.js} +1 -1
- package/lib/chunks/{UUIZXPYS.js → 2IUJCGSA.js} +1 -1
- package/lib/chunks/{G66T7F2A.js → 2SOGAGWL.js} +1 -1
- package/lib/chunks/{LZRNA4HH.js → 3GASF4WI.js} +1 -1
- package/lib/chunks/{ITRAFA2I.js → 3MYY3GBQ.js} +1 -1
- package/lib/chunks/{WCMZCZST.js → 3V7S4KRL.js} +1 -1
- package/lib/chunks/{BR3C2ZRO.js → 4N37PAKJ.js} +33 -33
- package/lib/chunks/{HITQPK62.js → 5CIDGIXH.js} +1 -1
- package/lib/chunks/5VJVFRWZ.js +9 -0
- package/lib/chunks/63QCRU6J.js +20 -0
- package/lib/chunks/{73UEREUT.js → A2ODYHX2.js} +1 -1
- package/lib/chunks/{FSTHNUTZ.js → ASDHVJ5A.js} +1 -1
- package/lib/chunks/{CWYADEAF.js → AYQ35VOB.js} +1 -1
- package/lib/chunks/{32ZHA42N.js → BAXGMV6A.js} +1 -1
- package/lib/chunks/{VQVISWBJ.js → BL2RHSRD.js} +1 -1
- package/lib/chunks/{ICLFVPDF.js → BLT2564G.js} +5 -7
- package/lib/chunks/{YOV4L7V6.js → DGKML64B.js} +51 -50
- package/lib/chunks/{G5RGUPPT.js → EQ7EIDJ2.js} +3 -3
- package/lib/chunks/{SZH6RAZB.js → EY2ZN6BT.js} +1 -1
- package/lib/chunks/{LW5V3SVS.js → FCXOAAZW.js} +1 -1
- package/lib/chunks/{HNVJYHEV.js → FTARR2LM.js} +1 -1
- package/lib/chunks/{ZRACBTMS.js → FZMIYQXC.js} +1 -1
- package/lib/chunks/{42DSSM4F.js → HFYWZVOK.js} +1 -1
- package/lib/chunks/HNPYGEY3.js +11 -0
- package/lib/chunks/{KVPIWPOL.js → ICZFEEL2.js} +1 -1
- package/lib/chunks/IOCKS4AM.js +7 -0
- package/lib/chunks/{VUQEVFSD.js → ITMFCWG4.js} +1 -1
- package/lib/chunks/{T3U6D4C3.js → IVQGWJFK.js} +1 -1
- package/lib/chunks/KGTQGGCB.js +13 -0
- package/lib/chunks/{42HL7XQH.js → LBF5UJY7.js} +1 -1
- package/lib/chunks/{3UYF5CLP.js → N7PVTAFM.js} +1 -1
- package/lib/chunks/{QHPWFCD2.js → P2PCNXBE.js} +1 -1
- package/lib/chunks/{HR7ZTPFZ.js → P32DILLK.js} +1 -1
- package/lib/chunks/{M5WLF4GV.js → PZOJ2P55.js} +1 -1
- package/lib/chunks/{ZIP2B7BB.js → PZWFBD3A.js} +1 -1
- package/lib/chunks/QI2D3IAP.js +7 -0
- package/lib/chunks/SWK3YGGD.js +78 -0
- package/lib/chunks/{SOTTFVAK.js → TEHFMQKM.js} +1 -1
- package/lib/chunks/{RAYH3MG6.js → TFRQNTX4.js} +1 -1
- package/lib/chunks/{LY6HM2BD.js → TJ6BPMCF.js} +1 -1
- package/lib/chunks/{L2EEGRZN.js → V7XX5H7Y.js} +48 -48
- package/lib/chunks/{5KKTVK6L.js → VMGY6BKZ.js} +1 -1
- package/lib/chunks/VWDCJNJS.js +20 -0
- package/lib/chunks/XGSKSQUA.js +30 -0
- package/lib/chunks/{EPBAZUU2.js → XRTDDB7G.js} +4 -4
- package/lib/chunks/{SJCEHWE2.js → Y66YFAUD.js} +1 -1
- package/lib/chunks/{26SMEC4W.js → YASQUPUQ.js} +1 -1
- package/lib/chunks/{BV72RZCF.js → YHGVWNO2.js} +2 -2
- package/lib/chunks/{CUB5GMHZ.js → YJG3HGNT.js} +1 -1
- package/lib/chunks/{UR72TK6I.js → YMFLZXNF.js} +1 -1
- package/lib/chunks/{AWIBN2J5.js → Z7FXXAFA.js} +1 -1
- package/lib/chunks/ZZB27P2P.js +7 -0
- package/lib/eject-assets/AGENTS.md +1 -0
- package/lib/eject-assets/generators/cli/docs.ts +1 -1
- package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
- package/lib/eject-assets/generators/cli/index.ts +2 -2
- package/lib/eject-assets/generators/cli/render.ts +3 -6
- package/lib/eject-assets/generators/go/client.ts +1 -1
- package/lib/eject-assets/generators/go/descriptor.ts +1 -1
- package/lib/eject-assets/generators/go/index.ts +2 -2
- package/lib/eject-assets/generators/go/models.ts +1 -1
- package/lib/eject-assets/generators/go/naming.ts +1 -1
- package/lib/eject-assets/generators/go/operations.ts +1 -1
- package/lib/eject-assets/generators/go/pagination.ts +1 -1
- package/lib/eject-assets/generators/go/types.ts +1 -1
- package/lib/eject-assets/generators/mock/faker.ts +1 -1
- package/lib/eject-assets/generators/mock/index.ts +2 -2
- package/lib/eject-assets/generators/mock/render.ts +1 -1
- package/lib/eject-assets/generators/mock/sample.ts +1 -1
- package/lib/eject-assets/generators/mock/values.ts +1 -1
- package/lib/eject-assets/generators/php/client.ts +1 -1
- package/lib/eject-assets/generators/php/descriptor.ts +1 -1
- package/lib/eject-assets/generators/php/index.ts +2 -2
- package/lib/eject-assets/generators/php/models.ts +1 -1
- package/lib/eject-assets/generators/php/naming.ts +1 -1
- package/lib/eject-assets/generators/php/operations.ts +1 -1
- package/lib/eject-assets/generators/php/pagination.ts +1 -1
- package/lib/eject-assets/generators/php/types.ts +1 -1
- package/lib/eject-assets/generators/python/client.ts +1 -1
- package/lib/eject-assets/generators/python/descriptor.ts +1 -1
- package/lib/eject-assets/generators/python/index.ts +2 -2
- package/lib/eject-assets/generators/python/models.ts +1 -1
- package/lib/eject-assets/generators/python/naming.ts +1 -1
- package/lib/eject-assets/generators/python/operations.ts +1 -1
- package/lib/eject-assets/generators/python/pagination.ts +1 -1
- package/lib/eject-assets/generators/python/types.ts +1 -1
- package/lib/eject-assets/generators/swr/index.ts +2 -2
- package/lib/eject-assets/generators/swr/render.ts +1 -1
- package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
- package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
- package/lib/eject-assets/generators/transformers/index.ts +2 -2
- package/lib/eject-assets/generators/transformers/render.ts +1 -1
- package/lib/eject-assets/generators/typescript/banner.ts +1 -1
- package/lib/eject-assets/generators/typescript/client.ts +1 -1
- package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
- package/lib/eject-assets/generators/typescript/index.ts +2 -2
- package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
- package/lib/eject-assets/generators/typescript/operations.ts +3 -5
- package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
- package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
- package/lib/eject-assets/generators/typescript/types.ts +1 -1
- package/lib/eject-assets/generators/zod/index.ts +2 -2
- package/lib/eject-assets/generators/zod/schemas.ts +1 -1
- package/lib/eject-assets/skills/client-generators/SKILL.md +1 -0
- package/lib/index.js +9 -9
- package/package.json +2 -2
- package/lib/chunks/4UWA75AV.js +0 -9
- package/lib/chunks/5H5SOEIM.js +0 -20
- package/lib/chunks/7GJ7DF3O.js +0 -20
- package/lib/chunks/7X6ZJPG4.js +0 -78
- package/lib/chunks/CGBDHCS4.js +0 -30
- package/lib/chunks/F645HTKX.js +0 -7
- package/lib/chunks/IWS3O2SM.js +0 -7
- package/lib/chunks/NSK6GPZU.js +0 -7
- package/lib/chunks/RBL3UMVK.js +0 -13
- package/lib/chunks/RSOM77DA.js +0 -11
|
@@ -4,11 +4,11 @@ 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{b as S,c as E,d as w,f as A,g as M,h as q,i as D,j as B,k as F}from"./
|
|
7
|
+
import{b as S,c as E,d as w,f as A,g as M,h as q,i as D,j as B,k as F}from"./XGSKSQUA.js";import{g as b,i as T}from"./HNPYGEY3.js";import{a as f,c as R,d as v,e as k}from"./YHGVWNO2.js";import{d as I,f as N,h as P,i as j,m as C}from"./LD5MEXEL.js";import{join as Y}from"node:path";var y="// Generated by @redocly/client-generator \u2014 do not edit by hand.\n// Source: OpenAPI description. Re-run `redocly generate-client` to update.";function $(e){return e.filter(t=>t.length>0).join(`
|
|
8
8
|
|
|
9
9
|
`)+`
|
|
10
10
|
`}function O(e){let t=["/**",` * ${j(`${e.title} (v${e.version})`)}`];if(e.description)for(let n of C(j(e.description)))t.push(` * ${n}`.replace(/ +$/,""));return t.push(" */"),t.join(`
|
|
11
|
-
`)}function x(e){let t=new Set(k),n=new Map;for(let r of f(e.services))n.set(r.name,N(r.name,t));return n}function Z(e,t,n,r,s=[],o="grouped"){let i=[...e.pathParams,...e.queryParams,...e.headerParams,...e.cookieParams].map(c=>({name:c.name,in:c.in,...c.style!==void 0?{style:c.style}:{},...c.explode!==void 0?{explode:c.explode}:{},...c.allowReserved!==void 0?{allowReserved:c.allowReserved}:{}})),p=
|
|
11
|
+
`)}function x(e){let t=new Set(k),n=new Map;for(let r of f(e.services))n.set(r.name,N(r.name,t));return n}function Z(e,t,n,r,s=[],o="grouped"){let i=[...e.pathParams,...e.queryParams,...e.headerParams,...e.cookieParams].map(c=>({name:c.name,in:c.in,...c.style!==void 0?{style:c.style}:{},...c.explode!==void 0?{explode:c.explode}:{},...c.allowReserved!==void 0?{allowReserved:c.allowReserved}:{}})),p=b(e,{securitySchemes:t}),m=e.sse!==void 0?"sse":M(e.successResponses,n).kind,u=E(e.successResponseHeaders,s);return{id:e.specName??e.name,method:e.method.toUpperCase(),path:e.path,...e.tags.length>0?{tags:e.tags}:{},...i.length>0?{params:i}:{},...e.requestBody?{body:{contentType:e.requestBody.contentType,...S(e.requestBody)?{multipart:!0}:{}}}:{},...m!=="json"?{responseKind:m}:{},...e.sse===void 0?{}:{sseDataKind:e.sse.dataKind},...p.length>0?{security:p}:{},...u===void 0?{}:{responseHeaders:u},...r?.has(e.name)?{pagination:r.get(e.name).spec}:{},...o==="flat"&&"collisions"in q(e,s)?{argsStyle:"grouped"}:{}}}function L(e,t,n,r,s="grouped"){let o=f(e.services);if(o.length===0)return"";let i=o.map((a,m)=>{let u=P(Z(a,e.securitySchemes,n,r,e.schemas,s));return` ${t.get(a.name)}: ${u}${m===o.length-1?"":","}`}),p=[[...w(`The wire-shape descriptor for every operation, keyed by operationId \u2014 the data the
|
|
12
12
|
runtime routes requests by. Also minification-safe static metadata (method, path,
|
|
13
13
|
tags) for cache keys, tracing span names, and request logging.`,void 0,""),"export const OPERATIONS = {",...i,"} as const satisfies Record<string, OperationDescriptor>;"].join(`
|
|
14
14
|
`),'export type OperationId = (typeof OPERATIONS)[keyof typeof OPERATIONS]["id"];','export type OperationPath = (typeof OPERATIONS)[keyof typeof OPERATIONS]["path"];'];return o.some(a=>a.tags.length>0)&&p.push(`export type OperationTag = Extract<(typeof OPERATIONS)[keyof typeof OPERATIONS], {
|
|
@@ -61,7 +61,7 @@ ${r.trim()}
|
|
|
61
61
|
const __redoclySetup: { config?: ClientConfig; middleware?: Middleware[] } = ${e.setup};
|
|
62
62
|
`+u:u}function ae(e,t){let n=["export const { configure, use } = client;"];if(e.length===0)return n.join(`
|
|
63
63
|
`);let r=e.map(s=>t.get(s.name)).join(", ");return n.push(`export const { ${r} } = client;`),n.join(`
|
|
64
|
-
`)}var Me=({model:e,output:t,outputMode:n,emit:r})=>{let s=V(e,r).map(({name:o,content:i})=>({path:Y(t.dir,"runtime",o),content:i}));if(n==="split"){let{dir:o,stem:i}=t,{entry:p,schemas:a}=W(e,r,i);return[...a===void 0?[]:[{path:Y(o,`${i}.schemas.ts`),content:a}],{path:t.path,content:p},...s]}return[{path:t.path,content:K(e,r)},...s]},qe=({model:e,output:t,emit:n,pagination:r})=>[{path:t.path.replace(/\.[^.\\/]+$/,".typescript.md"),content:
|
|
64
|
+
`)}var Me=({model:e,output:t,outputMode:n,emit:r})=>{let s=V(e,r).map(({name:o,content:i})=>({path:Y(t.dir,"runtime",o),content:i}));if(n==="split"){let{dir:o,stem:i}=t,{entry:p,schemas:a}=W(e,r,i);return[...a===void 0?[]:[{path:Y(o,`${i}.schemas.ts`),content:a}],{path:t.path,content:p},...s]}return[{path:t.path,content:K(e,r)},...s]},qe=({model:e,output:t,emit:n,pagination:r})=>[{path:t.path.replace(/\.[^.\\/]+$/,".typescript.md"),content:T(e,{title:`${e.title} TypeScript client reference`,frontmatter:n.docsFrontmatter===!0,language:{name:"typescript",label:"TypeScript",fence:"typescript",requires:"The client has no dependencies."},sample:s=>ce(s,{model:e,emit:n,outputPath:t.path}),paginated:new Set(r?.keys()??[])})}];function ce(e,t){let n=x(t.model).get(e.name)??e.name,s=`./${t.outputPath.replace(/^.*[\\/]/,"").replace(/\.[^.]+$/,"")}.${t.emit.importExt??"js"}`,o=e.queryParams.filter(c=>c.required),i=t.emit.argsStyle==="flat",p=e.pathParams.map(c=>`${c.name}: '<${c.name}>'`),a=o.map(c=>`${c.name}: /* \u2026 */`),m=i?[...p,...a,...e.requestBody?["/* body properties */"]:[]]:[...p.length>0?[`path: { ${p.join(", ")} }`]:[],...a.length>0?[`query: { ${a.join(", ")} }`]:[],...e.requestBody?["body: { /* \u2026 */ }"]:[]],u=m.length>0?[`{ ${m.join(", ")} }`]:[];return{lang:"typescript",label:"TypeScript SDK",source:`import { ${n} } from '${s}';
|
|
65
65
|
|
|
66
66
|
const result = await ${n}(${u.join(", ")});
|
|
67
67
|
`}}export{Me as a,qe as b,ce as c};
|
|
@@ -4,7 +4,7 @@ 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{a as h}from"./
|
|
7
|
+
import{a as h}from"./YHGVWNO2.js";import{e as g,h as p,k as $}from"./LD5MEXEL.js";import{join as R}from"node:path";var a=" ";function m(e){return`${$(e)}Schema`}var y=new Map;function u(e,r=y,t=""){return j(w(e,r,t),e)}function w(e,r,t){switch(e.kind){case"scalar":return z(e.scalar,e.metadata);case"object":return b(e.properties,r,t);case"array":return`z.array(${u(e.items,r,t)})`;case"record":return`z.record(z.string(), ${u(e.value,r,t)})`;case"ref":return`z.lazy(() => ${m(e.name)})`;case"literal":return`z.literal(${p(e.value)})`;case"enum":return q(e.values);case"union":return k(e.members,r,t);case"intersection":return e.members.map(n=>u(n,r,t)).reduce((n,o)=>`${n}.and(${o})`);case"null":return"z.null()";case"unknown":return"z.unknown()";case"omit":return E(e.base,e.keys,r,t)}}function z(e,r){switch(e){case"string":return r?.format==="binary"?"z.instanceof(Blob)":"z.string()";case"integer":return"z.number().int()";case"number":return"z.number()";case"boolean":return"z.boolean()"}}function c(e){return g(e)===e?e:JSON.stringify(e)}function b(e,r,t){if(e.length===0)return"z.object({})";let n=t+a;return`z.object({
|
|
8
8
|
${e.map((s,i)=>{let d=u(s.schema,r,n),l=s.required?d:`${d}.optional()`,x=i===e.length-1?"":",";return`${n}${c(s.name)}: ${l}${x}`}).join(`
|
|
9
9
|
`)}
|
|
10
10
|
${t}})`}function q(e){return e.every(r=>typeof r=="string")?`z.enum([${e.map(r=>JSON.stringify(r)).join(", ")}])`:`z.union([${e.map(r=>`z.literal(${p(r)})`).join(", ")}])`}function k(e,r,t){let n=e.map(o=>u(o,r,t));return n.length===1?n[0]:`z.union([${n.join(", ")}])`}function E(e,r,t,n){let o=t.get(e);if(o&&o.kind!=="object")return u(f(o,r,t,new Set([e])),t,n);let s=r.map(i=>`${c(i)}: true`).join(", ");return`${m(e)}.omit({ ${s} })`}function f(e,r,t,n){switch(e.kind){case"object":return{...e,properties:e.properties.filter(o=>!r.includes(o.name))};case"union":case"intersection":return{...e,members:e.members.map(o=>f(o,r,t,n))};case"ref":{if(n.has(e.name))return e;let o=t.get(e.name);if(!o)return e;if(o.kind==="object"){let s=r.filter(i=>o.properties.some(d=>d.name===i));return s.length>0?{kind:"omit",base:e.name,keys:s}:e}return f(o,r,t,new Set([...n,e.name]))}default:return e}}function j(e,r){let t=r.metadata;if(!t)return e;let n=e;return r.kind==="scalar"&&r.scalar==="string"&&(t.minLength!==void 0&&(n=`${n}.min(${t.minLength})`),t.maxLength!==void 0&&(n=`${n}.max(${t.maxLength})`),t.pattern!==void 0&&(n=`${n}.regex(new RegExp(${JSON.stringify(t.pattern)}))`)),r.kind==="scalar"&&(r.scalar==="number"||r.scalar==="integer")&&(t.minimum!==void 0&&(n=`${n}.min(${t.minimum})`),t.maximum!==void 0&&(n=`${n}.max(${t.maximum})`),t.exclusiveMinimum!==void 0&&(n=`${n}.gt(${t.exclusiveMinimum})`),t.exclusiveMaximum!==void 0&&(n=`${n}.lt(${t.exclusiveMaximum})`)),r.kind==="array"&&(t.minItems!==void 0&&(n=`${n}.min(${t.minItems})`),t.maxItems!==void 0&&(n=`${n}.max(${t.maxItems})`)),n}function Z(e,r){let t=[];for(let n of h(e.services)){if(n.sse!==void 0)continue;let o=n.requestBody,s=o&&o.contentType.toLowerCase().includes("json")?u(o.schema,r,a):void 0,i=n.successResponses.find(l=>l.contentType.toLowerCase().includes("json")),d=i?u(i.schema,r,a):void 0;!s&&!d||t.push({name:n.specName??n.name,request:s,response:d})}return t}function I(e){let r=e.flatMap(n=>[`${a}${c(n.name)}: {`,...n.request?[`${a}${a}request: z.ZodType;`]:[],...n.response?[`${a}${a}response: z.ZodType;`]:[],`${a}};`]),t=e.map((n,o)=>{let s=[...n.request?[`request: ${n.request}`]:[],...n.response?[`response: ${n.response}`]:[]].join(", "),i=o===e.length-1?"":",";return`${a}${c(n.name)}: { ${s} }${i}`});return["/**"," * Request/response validators by operationId \u2014 powers `zodValidation`, or import one directly."," */","export const operationSchemas: {",...r,"} = {",...t,"};"].join(`
|
|
@@ -4,7 +4,7 @@ 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{a as x,b as f,c as m,d}from"./
|
|
7
|
+
import{a as x,b as f,c as m,d}from"./LBF5UJY7.js";import{b as y,d as h,e as l}from"./LD5MEXEL.js";import{m as P}from"./UW4UC7ZI.js";import{join as E}from"node:path";function q(e,t){let n=x(e,"tanstack-query");if(n.length===0)return"";let r=t.pagination??new Map;return[j(n,t,r),...n.filter(f).map(i=>K(i,t.queryKeyPrefix)),Q(e,n,r,t.queryKeyPrefix,t.argsStyle),...R(n,r)].join(`
|
|
8
8
|
`)}function b(e,t){if(!f(e))return!1;let n=t.get(e.name);return n!==void 0&&n.spec.style!=="link"}function j(e,t,n){let r=[...e.some(a=>b(a,n))?["infiniteQueryOptions"]:[],...e.some(f)?["queryOptions"]:[]],s=[...e.filter(m).map(d),"RequestOptions"].sort().map(a=>`type ${a}`),i=[];return r.length>0&&i.push(`import { ${r.join(", ")} } from "@tanstack/${t.framework}-query";`),i.push(`import { client, ${s.join(", ")} } from "${t.sdkModule}";`),i.join(`
|
|
9
9
|
`)}function K(e,t){let n=M(e,t);return m(e)?`export const ${e.name}QueryKey = (vars?: ${d(e)}) =>
|
|
10
10
|
vars === undefined ? ([${n}] as const) : ([${n}, vars] as const);`:`export const ${e.name}QueryKey = () => [${n}] as const;`}function M(e,t){return t===void 0?`"${e.name}"`:`${h(t)}, "${e.name}"`}function Q(e,t,n,r,s){return`/**
|
|
@@ -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{X as t}from"./
|
|
7
|
+
import{X as t}from"./V7XX5H7Y.js";import*as e from"node:process";var o=["\u280B","\u2819","\u2839","\u2838","\u283C","\u2834","\u2826","\u2827","\u2807","\u280F"],n=class{frames;currentFrame;intervalId;message;constructor(){this.frames=o,this.currentFrame=0,this.intervalId=null,this.message=""}showFrame(){t.info("\r"+this.frames[this.currentFrame]+" "+this.message),this.currentFrame=(this.currentFrame+1)%this.frames.length}start(r){if(this.message!==r){if(this.message=r,!e.stderr.isTTY){t.info(`${r}...
|
|
8
8
|
`);return}this.intervalId===null&&(this.intervalId=setInterval(()=>{this.showFrame()},100))}}stop(){this.intervalId!==null&&(clearInterval(this.intervalId),this.intervalId=null,t.info("\r")),this.message=""}};function h(i){i.stop(),e.stderr.isTTY&&t.info("\x1B[2K")}function m(i,r){let[s]=r.inFlight;if(!s)return;let a=r.inFlight.size>1?` (+${r.inFlight.size-1} more)`:"";i.start(`[${r.position}/${r.total}] ${r.action} ${s}${a}`)}export{n as a,h as b,m as c};
|
|
@@ -4,4 +4,4 @@ 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{a}from"./
|
|
7
|
+
import{a}from"./FCXOAAZW.js";import"./LBF5UJY7.js";import"./XGSKSQUA.js";import"./HNPYGEY3.js";import"./YHGVWNO2.js";import"./WZXA5XPB.js";import"./V7XX5H7Y.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as tanstackQueryGenerator};
|
|
@@ -4,4 +4,4 @@ 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 as a,d as b}from"./
|
|
7
|
+
import{c as a,d as b}from"./PZWFBD3A.js";import"./YHGVWNO2.js";import"./WZXA5XPB.js";import"./V7XX5H7Y.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{b as generateClient,a as runGenerators};
|
|
@@ -0,0 +1,11 @@
|
|
|
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{a as f,m as u}from"./UW4UC7ZI.js";function m(e,t){let n=t??{},i=e.specName??e.name;if(Array.isArray(n.exclude)&&n.exclude.includes(i))return;let r=(n.operations??{})[i]??e.paginationExtension;if(r===void 0&&typeof n.style=="string"){let{exclude:c,operations:B,...l}=n,g=l.style==="cursor"?l.cursorParam:l.offsetParam;(l.style==="link"?e.successResponseHeaders?.some(p=>p.name==="link")===!0:typeof g=="string"&&e.queryParams.some(p=>p.name===g))&&(r=l)}if(r===void 0||typeof r.style!="string")return;let s=r.style==="cursor"?r.cursorParam:r.offsetParam;return{style:r.style,...typeof s=="string"?{param:s}:{},...typeof r.nextCursor=="string"?{nextCursor:r.nextCursor}:{},...typeof r.hasMore=="string"?{hasMore:r.hasMore}:{},...typeof r.limitParam=="string"?{limitParam:r.limitParam}:{},...typeof r.items=="string"?{items:r.items}:{}}}function h(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("json"))?.schema}function x(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("text/event-stream"))}function k(e){return e.requestBody?.contentType.toLowerCase().includes("multipart")??!1}var R=["application/octet-stream","application/pdf","image/","audio/","video/","font/","application/x-font-","application/zip","application/x-zip-compressed","application/gzip","application/x-gzip","application/x-bzip2","application/x-tar","application/x-rar-compressed","application/x-7z-compressed","application/vnd.openxmlformats-officedocument","application/vnd.ms-excel","application/vnd.ms-powerpoint","application/msword","application/x-shockwave-flash"];function d(e){let t=e.split(";")[0].trim().toLowerCase();return R.some(n=>t.startsWith(n))}function b(e){let t=new Set(e.variables.map(s=>s.name)),n=[],i="",a=e.url,r=/\{([^{}]+)\}/;for(let s=r.exec(a);s!==null;s=r.exec(a))i+=a.slice(0,s.index),t.has(s[1])?(i!==""&&n.push({kind:"literal",value:i}),i="",n.push({kind:"variable",name:s[1]})):i+=s[0],a=a.slice(s.index+s[0].length);return i+=a,(i!==""||n.length===0)&&n.push({kind:"literal",value:i}),n}function S(e,t){return e.security.map(n=>n.flatMap(i=>{let a=t.securitySchemes.find(r=>r.key===i);return a===void 0?[]:a.kind==="bearer"||a.kind==="basic"?[{scheme:i,kind:a.kind}]:a.kind==="apiKeyHeader"?[{scheme:i,kind:"apiKey",name:a.headerName,in:"header"}]:a.kind==="apiKeyQuery"?[{scheme:i,kind:"apiKey",name:a.paramName,in:"query"}]:[{scheme:i,kind:"apiKey",name:a.cookieName,in:"cookie"}]})).filter(n=>n.length>0)}function $(e,t,n){if(e===void 0||t===void 0)return;let i=u(e,t,n);return i?.kind==="array"?i.items:void 0}function y(e){return(e??"").replace(/\s+/g," ").trim().replace(/\\/g,"\\\\").replace(/\|/g,"\\|")}function o(e){switch(e.kind){case"ref":return e.name;case"omit":return e.base;case"scalar":return e.scalar;case"array":return`array of ${o(e.items)}`;case"record":return`map of ${o(e.value)}`;case"enum":{let t=e.values.map(String),n=t.slice(0,6).join(", ");return t.length>6?`enum: ${n}, and ${t.length-6} more`:`enum: ${n}`}case"literal":return String(e.value);case"union":return e.members.map(o).join(" or ");case"intersection":return e.members.map(o).join(" and ");case"object":return"object";case"null":return"null";case"unknown":return"any"}}function P(e){return e.successResponses.some(t=>t.contentType.toLowerCase().includes("json"))?!1:e.successResponses.some(t=>d(t.contentType))}function T(e,t){e.line("| Parameter | In | Type | Required | Description |"),e.line("| --------- | -- | ---- | -------- | ----------- |");for(let n of t)e.line(`| \`${n.name}\` | ${n.in} | ${y(o(n.schema))} | ${n.required?"yes":"no"} | ${y(n.description)} |`);e.blank()}function C(e,t,n){e.line(`### \`${t.specName??t.name}\``),e.blank(),t.summary!==void 0&&(e.line(y(t.summary)),e.blank()),e.line(`\`${t.method.toUpperCase()} ${t.path}\``),e.blank();let i=n.sample(t);if(i!==void 0){e.line("```"+n.language.fence);for(let c of i.source.replace(/\n+$/,"").split(`
|
|
8
|
+
`))e.line(c);e.line("```"),e.blank()}let a=[...t.pathParams,...t.queryParams,...t.headerParams];a.length>0&&T(e,a),t.requestBody!==void 0&&e.line(`Body: \`${t.requestBody.contentType}\`${t.requestBody.required?", required":", optional"}, of type ${o(t.requestBody.schema)}.`);let r=t.successResponses[0];e.line(r===void 0?"Returns no content.":`Returns \`${r.contentType}\`, of type ${o(r.schema)}.`),(n.paginated!==void 0?n.paginated.has(t.name):m(t,n.pagination)!==void 0)&&e.line("This operation is paginated, so the SDK gives it page and item iterators."),t.successResponses.some(c=>c.contentType==="text/event-stream")&&e.line("This operation streams server-sent events, so the SDK iterates the events."),P(t)&&e.line("This operation returns binary content."),e.blank()}function v(e,t){let n=new f;if(t.frontmatter&&(n.line("---"),n.line(`title: ${t.title}`),n.line("---"),n.blank()),n.line(`# ${t.title}`),n.blank(),n.line(`Generated reference for the ${t.language.label} SDK, produced from the API description by \`redocly generate-client\`.`),n.line("Re-run generation to update it \u2014 this file is not hand-edited."),n.blank(),n.line(t.language.requires),n.blank(),n.line("## Authentication"),n.blank(),e.securitySchemes.length===0)n.line("The description declares no security schemes.");else{n.line("The description declares these schemes, which you pass to the client:"),n.blank(),n.line("| Scheme | Kind | Sent as |"),n.line("| ------ | ---- | ------- |");for(let r of e.securitySchemes){let s=r.kind==="bearer"?"`Authorization: Bearer <token>`":r.kind==="basic"?"`Authorization: Basic <base64>`":r.kind==="apiKeyHeader"?`the \`${r.headerName}\` header`:r.kind==="apiKeyQuery"?`the \`${r.paramName}\` query parameter`:`the \`${r.cookieName}\` cookie`;n.line(`| \`${r.key}\` | ${r.kind} | ${s} |`)}}n.blank();let i=e.services.flatMap(r=>r.operations),a=[...new Set(i.map(r=>r.tags[0]))];for(let r of a){n.line(r===void 0?"## Operations":`## ${r}`),n.blank();for(let s of i.filter(c=>c.tags[0]===r))C(n,s,t)}return n.toString().replace(/\n{3,}/g,`
|
|
9
|
+
|
|
10
|
+
`).trimEnd()+`
|
|
11
|
+
`}var ee=["Printer","casing","identifierFor","uniqueIdentifiers","RESERVED_WORDS","flattenAllOf","deref","discriminatorCases","jsonSuccessSchema","sseResponse","isMultipartBody","isBinaryContentType","serverUrlParts","securityRequirements","paginationItemSchema","isNullable","unwrapNullable","enumValues","docText","headerCoerceType","schemaAtPointer","paginationRuleFor","renderReferencePage","NotSupportedError"];function E(e){return e}function w(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-")}function A(e){return e.replace(/[^A-Za-z0-9]+/g,"_").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()}function q(e,t){let n={...e};for(let[i,a]of Object.entries(t))a!==void 0&&(n[i]=a);return n}function de(e){return e}async function ke(e){return(await import("./HFYWZVOK.js")).generateClient(e)}export{m as a,h as b,x as c,k as d,d as e,b as f,S as g,$ as h,v as i,ee as j,E as k,w as l,A as m,q as n,de as o,ke as p};
|
|
@@ -4,7 +4,7 @@ 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{a as x,b as y,c as R,d as u}from"./
|
|
7
|
+
import{a as x,b as y,c as R,d as u}from"./BAXGMV6A.js";import{a as v}from"./YMFLZXNF.js";import{c as f,d as g}from"./TEHFMQKM.js";import{X as a,na as m,oa as w}from"./V7XX5H7Y.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as S,writeFile as O}from"node:fs/promises";import C from"node:path";async function F(e){let i=await g(e.trafficPath);if(i.length===0)throw new Error("No traffic files found in the provided traffic path.");let t=y.create({openApiIndex:e.openApiIndex,matchMode:e.matchMode,ignoreCookies:e.ignoreCookies,ignoreHeaders:e.ignoreHeaders,previewFindingsLimit:e.previewFindingsLimit,activeRules:e.activeRules,server:e.server,minSeverity:e.minSeverity}),r=0,o=0;for(let n of i){let s=await v(n,e.format);if(!s){a.warn(`Skipping traffic file with unrecognized format: ${n}
|
|
8
8
|
`);continue}r+=1;for await(let c of s.parse(n))await t.process({...c,index:o}),o+=1}if(r===0)throw new Error("No supported traffic files found. In auto mode, files must match built-in traffic parser signatures.");if(o===0)throw new Error("No HTTP exchanges were parsed from the provided traffic files.");return t.finalize()}var E=!!process.stdout.isTTY&&process.env.NO_COLOR===void 0;function T(e){let i=new Set;for(let t of e.operationsByMethod.values())for(let r of t)for(let o of r.servers)i.add(o.rawUrl);return Array.from(i).sort()}function I(e,i,t){let r=e.totalExchanges-e.skippedExchanges;if(r===0&&e.skippedExchanges>0){a.warn(`All ${e.skippedExchanges} exchange(s) were outside the --server "${t}" and were skipped. Check that the server matches the traffic URLs.
|
|
9
9
|
`);return}if(e.documentedExchanges>0||r===0)return;let o=T(i),n=t?`Check that the --server "${t}" matches the traffic URLs and that the description paths align with the remainder.`:e.hostCompatibleExchanges===r?`The traffic hosts are compatible with the description servers (${o.join(", ")}), so the endpoints are likely undocumented; if they should be documented, check that the description base paths and paths align with the traffic URLs, or use --server to declare the server the traffic was captured against.`:`Check that the traffic host and base path match the description servers (${o.join(", ")}), or use --server to declare the server the traffic was captured against.`;a.warn(`None of the ${r} validated exchange(s) matched a documented operation. ${n}
|
|
10
10
|
`)}async function $(e,i){let t=f(e);await S(C.dirname(t),{recursive:!0}),await O(t,i,"utf8")}async function q({argv:e,config:i}){let t=f(e.traffic),r=e["traffic-format"],o=e.rules?u(e.rules):void 0,n=e["ignore-headers"]?u(e["ignore-headers"]):void 0,s=e.server;if(s&&e["match-mode"])throw new m("The --server and --match-mode options are mutually exclusive: --match-mode controls how requests are located via the description servers, while --server replaces the description servers with the one the traffic was captured against.");let c=e["match-mode"]??"strict-host",d=f(e.api),p=await R(d,i);if(p.loadedOperations===0)throw new m(`No OpenAPI operations were loaded from: ${d}`);let{runId:k,summary:h,findings:A}=await F({trafficPath:t,format:r,matchMode:c,ignoreCookies:e["ignore-cookies"],ignoreHeaders:n,previewFindingsLimit:e["max-findings"],activeRules:o,openApiIndex:p,server:s,minSeverity:e["min-severity"]});I(h,p,s);let l=x({runId:k,summary:h,findings:A,meta:{specSource:d,trafficPath:t,format:r,matchMode:c,server:s}},{format:e["report-format"],color:E&&e["report-format"]==="pretty"&&!e.output,maxFindings:e["max-findings"]});if(e.output?(await $(e.output,l),a.info(`Drift report written to: ${f(e.output)}
|
|
@@ -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 e={name:"@redocly/cli",version:"2.55.0",description:"",license:"MIT",bin:{redocly:"bin/cli.js",openapi:"bin/cli.js"},type:"module",engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,scripts:{build:"node ./scripts/build.mjs","prepare:publish-dir":"node ./scripts/prepare-publish-dir.mjs","clean:publish-dir":`node -e "require('fs').rmSync('.publish', {recursive:true, force:true})"`},publishConfig:{directory:".publish"},repository:{type:"git",url:"git+https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["linter","OpenAPI","Swagger","OpenAPI linter","Swagger linter","AsyncAPI linter","Arazzo linter","oas"],contributors:["Roman Hotsiy <roman@redocly.com> (https://redocly.com/)"],devDependencies:{"@modelcontextprotocol/sdk":"^1.30.0","@opentelemetry/exporter-trace-otlp-http":"0.219.0","@opentelemetry/resources":"2.8.0","@opentelemetry/sdk-trace-node":"2.8.0","@opentelemetry/semantic-conventions":"1.41.1","@redocly/cli-otel":"0.3.5","@redocly/client-generator":"0.4.17","@redocly/openapi-core":"2.55.0","@redocly/respect-core":"2.55.0","@redocly/reunite-integration":"2.55.0","@types/cookie":"0.6.0","@types/har-format":"^1.2.16","@types/react":"^17.0.0 || ^18.2.21 || ^19.2.16","@types/react-dom":"^17.0.0 || ^18.2.7 || ^19.2.3","@types/semver":"^7.5.0","@types/set-cookie-parser":"2.4.10","@types/yargs":"17.0.32",colorette:"^1.2.0",cookie:"^0.7.2",dotenv:"16.4.7",esbuild:"^0.28.0",glob:"^13.0.5",handlebars:"^4.7.9",react:"^17.0.0 || ^18.2.0 || ^19.2.7","react-dom":"^17.0.0 || ^18.2.0 || ^19.2.7",redoc:"2.5.4",semver:"^7.5.2","set-cookie-parser":"^2.3.5","styled-components":"6.4.2",typescript:"6.0.2",ulid:"^3.0.1",undici:"^6.28.0",yargs:"17.0.1"}};var{version:i,name:c,engines:s}=e,n=e.devDependencies.redoc,p="sha384-w447zOpYfw/1Tv/5AK9NfHTlQIqE3RVR6KY62jCyy9zNDgO64cMwGGP1Fj0zJVf5";export{i as a,c as b,s as c,n as d,p as e};
|
|
@@ -4,4 +4,4 @@ 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{a,b,c,d,e}from"./
|
|
7
|
+
import{a,b,c,d,e}from"./XRTDDB7G.js";import"./2U6O26CV.js";import"./HNPYGEY3.js";import"./YHGVWNO2.js";import"./WZXA5XPB.js";import"./V7XX5H7Y.js";import"./NEWT5A6S.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{e as goDocs,c as goGenerator,d as goSample,a as goType,b as renderGoModels};
|
|
@@ -4,4 +4,4 @@ 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{a,b,c}from"./
|
|
7
|
+
import{a,b,c}from"./EQ7EIDJ2.js";import"./2U6O26CV.js";import"./XGSKSQUA.js";import"./HNPYGEY3.js";import"./YHGVWNO2.js";import"./WZXA5XPB.js";import"./V7XX5H7Y.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{b as typescriptDocs,a as typescriptGenerator,c as typescriptSample};
|
|
@@ -0,0 +1,13 @@
|
|
|
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{b as x,c as P,d as c}from"./BL2RHSRD.js";import{e as y,g as b,m as w,n as $}from"./5VJVFRWZ.js";import"./FTARR2LM.js";import{f as l}from"./YJG3HGNT.js";import"./BXI4SF2U.js";import{P as g,X as n,l as p}from"./V7XX5H7Y.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function C({argv:t,config:o,version:h}){let f=performance.now(),A=Date.now(),{organization:s,project:m,"mount-path":F,verbose:I}=t,d=t.domain||b(),e,r,u=[];try{let i=y();if(e=$(t.files,(a,S)=>{n.warn(`File ${a} is overwritten by ${S}
|
|
8
|
+
`)}),!e.length)return l("push",f,"No files to upload");r=(await w({domain:d,apiKey:i,organization:s,project:m,mountPath:F,files:e,defaultBranch:t["default-branch"],commit:{message:t.message,branchName:t.branch,sha:t["commit-sha"],url:t["commit-url"],createdAt:t["created-at"],namespace:t.namespace,repository:t.repository,author:T(t.author)},version:h,replace:t.replace,onUploadStart:a=>{n.info(`Uploading to ${a.mountPath} ${e.length} ${p("file",e.length)}:
|
|
9
|
+
`)},onSunsetWarning:a=>u.push(a)})).pushId}catch(i){c("push",u),P("\u2717 File upload failed.",i)}for(let i of e)n.info(g(`\u2713 ${i.name}
|
|
10
|
+
`));return n.info(`
|
|
11
|
+
`),n.info(`Push ID: ${r}
|
|
12
|
+
`),c("push",u),t["wait-for-deployment"]&&(n.info(`
|
|
13
|
+
`),await x({argv:{organization:s,project:m,pushId:r,wait:!0,domain:d,"max-execution-time":t["max-execution-time"],"start-time":A,"continue-on-deploy-failures":t["continue-on-deploy-failures"]},config:o,version:h})),I&&l("push",f,`${p("file",e.length)} uploaded to organization ${s}, project ${m}. Push ID: ${r}.`),{pushId:r}}function T(t){let o=t.match(/^(?<name>.+)\s<(?<email>[^<>]+)>$/);if(!o?.groups)throw new Error('Invalid author format. Use "Author Name <author@email.com>"');return{name:o.groups.name.trim(),email:o.groups.email.trim()}}export{C as handlePush};
|
|
@@ -4,6 +4,6 @@ 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{a}from"./
|
|
7
|
+
import{a}from"./XGSKSQUA.js";import{X as p}from"./V7XX5H7Y.js";function g(t,r){let n=t.services.flatMap(e=>e.operations),s=n.filter(e=>e.sse!==void 0);s.length>0&&p.warn(`generate-client: ${r} skipped ${s.length} server-sent-events operation(s) \u2014 iterate the sdk's exported async generators directly: ${s.map(e=>e.name).join(", ")}.
|
|
8
8
|
`);let i=new Set(t.schemas.map(e=>e.name)),o=n.filter(e=>e.sse===void 0&&m(e,i));return o.length>0&&p.warn(`generate-client: ${r} skipped ${o.length} operation(s) whose variables type name collides with a schema \u2014 rename the schema or the operation: ${o.map(e=>e.name).join(", ")}.
|
|
9
9
|
`),n.filter(e=>e.sse===void 0&&!m(e,i))}function m(t,r){let n=a(t);return n.hasInputs&&r.has(n.variablesTypeName)}function x(t){return t.method==="get"||t.method==="head"}function u(t){return a(t).hasInputs}function f(t){return a(t).variablesTypeName}function $(t,r,n){let s=[];return a(t).hasInputs?s.push(r):n&&s.push("{}"),n&&s.push("{ ...init, envelope: undefined }"),`${t.name}(${s.join(", ")})`}function v(t,r,n){let s=t.map(e=>e.name).sort(),i=t.filter(u).map(f).sort();return n&&i.push("RequestOptions"),`import { ${[...s,...i.map(e=>`type ${e}`)].join(", ")} } from ${JSON.stringify(r)};`}export{g as a,x as b,u as c,f as d,$ as e,v as f};
|
|
@@ -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{l as t}from"./
|
|
7
|
+
import{l as t}from"./5VJVFRWZ.js";import"./BXI4SF2U.js";import{X as o}from"./V7XX5H7Y.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function i({version:n}){new t(n).logout(),o.output(`Logged out from the Redocly account. \u270B
|
|
8
8
|
`)}export{i as handleLogout};
|
|
@@ -4,4 +4,4 @@ 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{a,b,c,d,e}from"./
|
|
7
|
+
import{a,b,c,d,e}from"./VWDCJNJS.js";import"./2U6O26CV.js";import"./HNPYGEY3.js";import"./YHGVWNO2.js";import"./WZXA5XPB.js";import"./V7XX5H7Y.js";import"./NEWT5A6S.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{e as phpDocs,c as phpGenerator,d as phpSample,a as phpType,b as renderPhpModels};
|
|
@@ -4,7 +4,7 @@ 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{a as T,b as O,c as A,d as E}from"./
|
|
7
|
+
import{a as T,b as O,c as A,d as E}from"./BAXGMV6A.js";import{c as m,k as C,r as $}from"./TEHFMQKM.js";import{a as q}from"./BXI4SF2U.js";import{X as u,c as H,na as y,oa as R}from"./V7XX5H7Y.js";import"./NEWT5A6S.js";import{e as z}from"./RFWIIJFG.js";import{createReadStream as F,createWriteStream as k,existsSync as N}from"node:fs";import{appendFile as V,mkdir as _,rm as j,writeFile as W}from"node:fs/promises";import B from"node:path";import{createInterface as G}from"node:readline";var w=class{outputPath;entriesPath;creatorVersion;writeChain=Promise.resolve();directoryEnsured=!1;started=!1;count=0;constructor(t,r){this.outputPath=B.resolve(process.cwd(),t),this.entriesPath=`${this.outputPath}.entries.tmp`,this.creatorVersion=r}get entryCount(){return this.count}add(t){let r=`${JSON.stringify(t)}
|
|
8
8
|
`,n=this.writeChain.catch(()=>{}).then(()=>this.append(r)).then(()=>{this.count+=1});return this.writeChain=n.catch(()=>{}),n}async finalize(){await this.writeChain.catch(()=>{}),await this.ensureDirectory(),await this.writeDocument(),await j(this.entriesPath,{force:!0})}async append(t){if(await this.ensureDirectory(),!this.started){await W(this.entriesPath,t,"utf8"),this.started=!0;return}await V(this.entriesPath,t,"utf8")}async ensureDirectory(){this.directoryEnsured||(await _(B.dirname(this.outputPath),{recursive:!0}),this.directoryEnsured=!0)}async writeDocument(){let t=k(this.outputPath,{encoding:"utf8"}),r=n=>new Promise((o,s)=>{t.write(n,i=>i?s(i):o())});try{let n=JSON.stringify({name:"redocly-cli proxy",version:this.creatorVersion});await r(`{
|
|
9
9
|
"log": {
|
|
10
10
|
"version": "1.2",
|
|
@@ -4,4 +4,4 @@ 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{a}from"./
|
|
7
|
+
import{a}from"./Z7FXXAFA.js";import"./HNPYGEY3.js";import"./YHGVWNO2.js";import"./WZXA5XPB.js";import"./V7XX5H7Y.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as mockGenerator};
|
|
@@ -4,7 +4,7 @@ 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{a as Z,b as ee,f as te,g as G,h as ne}from"./
|
|
7
|
+
import{a as Z,b as ee,f as te,g as G,h as ne}from"./YHGVWNO2.js";import{a as y}from"./WZXA5XPB.js";import{D as J,I as V,X as b,Z as W,c as x,ca as Q,ea as E,la as Y,r as v,t as H}from"./V7XX5H7Y.js";import{b as M,c as T,k as D}from"./LD5MEXEL.js";import{mkdir as at,readFile as ct,writeFile as ut}from"node:fs/promises";import{dirname as $e,parse as dt,resolve as R,sep as ft}from"node:path";function A(e){return{requires:["typescript"],errorModes:["throw"],load:()=>import("./FZMIYQXC.js").then(t=>({run:t.tanstackQueryGenerator(e)}))}}var U={outputMode:"it always emits one self-contained file",runtime:"the runtime is always embedded in the generated file",argsStyle:"inputs follow the target language's own idiom",importExt:"the generated file has no relative imports"},I={typescript:{load:()=>import("./IVQGWJFK.js").then(e=>({run:e.typescriptGenerator,sample:e.typescriptSample,docs:e.typescriptDocs}))},zod:{load:()=>import("./TJ6BPMCF.js").then(e=>({run:e.zodGenerator}))},transformers:{requires:["typescript"],dateTypes:["Date"],load:()=>import("./IULINGO6.js").then(e=>({run:e.transformersGenerator}))},"tanstack-query":A("react"),"tanstack-query-vue":A("vue"),"tanstack-query-svelte":A("svelte"),"tanstack-query-solid":A("solid"),swr:{requires:["typescript"],errorModes:["throw"],load:()=>import("./YASQUPUQ.js").then(e=>({run:e.swrGenerator}))},mock:{requires:["typescript"],load:()=>import("./PZOJ2P55.js").then(e=>({run:e.mockGenerator}))},cli:{requires:["typescript","zod"],errorModes:["throw"],load:()=>import("./VMGY6BKZ.js").then(e=>({run:e.cliGenerator,sample:e.cliSample,docs:e.cliDocs}))},python:{notApplicable:U,load:()=>import("./22LQIPY2.js").then(e=>({run:e.pythonGenerator,sample:e.pythonSample,docs:e.pythonDocs,options:e.pythonOptions}))},go:{errorModes:["throw"],notApplicable:U,load:()=>import("./ITMFCWG4.js").then(e=>({run:e.goGenerator,sample:e.goSample,docs:e.goDocs}))},php:{errorModes:["throw"],notApplicable:U,load:()=>import("./P2PCNXBE.js").then(e=>({run:e.phpGenerator,sample:e.phpSample,docs:e.phpDocs}))}};function re(e,t,n,r){let s=new Set(e);t.goPackage!==void 0&&!s.has("go")&&b.warn(`generate-client: goPackage is ignored \u2014 it declares the Go package clause, and no selected generator uses it (add --generator go).
|
|
8
8
|
`);let o=t.errorMode??"throw",i=t.dateType??"string";for(let a of e){let c=n.get(a);if(!c)throw new y(`Unknown generator: ${a}`);for(let d of c.requires??[])if(!s.has(d)){let f=[...new Set([d,...e])].map(h=>`--generator ${h}`).join(" ");throw new y(`The "${a}" generator requires the "${d}" generator. Add it, e.g. ${f}.`)}if(c.errorModes&&!c.errorModes.includes(o))throw new y(`The "${a}" generator does not support --error-mode "${o}" (supported: ${c.errorModes.join(", ")}).`);if(c.dateTypes&&!c.dateTypes.includes(i))throw new y(`The "${a}" generator requires --date-type ${c.dateTypes.join(" or ")} (got "${i}") so the runtime values match the generated types.`);let u={...t,outputMode:r};for(let[d,f]of Object.entries(c.notApplicable??{}))u[d]!==void 0&&b.warn(`generate-client: the "${a}" generator ignores ${d} \u2014 ${f}.
|
|
9
9
|
`)}}function oe(e,t,n){let r=new Map;for(let s of e){let o=t.get(s)?.options,i=n?.[s];if(o===void 0){i!==void 0&&b.warn(`generate-client: the "${s}" generator declares no options, so client.options.${s} is ignored.
|
|
10
10
|
`),r.set(s,{});continue}r.set(s,ke(s,o,i))}return r}function ke(e,t,n){if(n!==void 0&&!x(n))throw new y(`The "${e}" generator's options must be a map of option names to values.`);let r=n??{},s=Object.keys(t.properties);if(t.additionalProperties!==!0){for(let i of Object.keys(r))if(!s.includes(i))throw new y(`The "${e}" generator got an unknown option "${i}". Declared options: ${s.join(", ")||"(none)"}.`)}for(let i of t.required??[])if(r[i]===void 0)throw new y(`The "${e}" generator requires the "${i}" option.`);let o={...r};for(let[i,a]of Object.entries(t.properties)){if(o[i]===void 0){a.default!==void 0&&(o[i]=a.default);continue}let c=ve(a,o[i]);if(c!==void 0)throw new y(`The "${e}" generator's "${i}" ${c}.`)}return o}function ve(e,t){if("enum"in e)return e.enum.includes(t)?void 0:`must be one of: ${e.enum.join(", ")}`;if(e.type==="array"){let n=e.items.type;return Array.isArray(t)&&t.every(r=>typeof r===n)?void 0:`must be an array of ${n}`}return typeof t===e.type?void 0:`must be a ${e.type}`}import{isAbsolute as Oe,resolve as xe}from"node:path";import{pathToFileURL as qe}from"node:url";var Se=function(e,t){return typeof e=="string"&&/^\.\.?\//.test(e)?e.replace(/\.(tsx)$|((?:\.d)?)((?:\.[^./]+?)?)\.([cm]?)ts$/i,function(n,r,s,o,i){return r?t?".jsx":".js":s&&(!o||!i)?n:s+o+"."+i.toLowerCase()+"js"}):e};async function ie(e,t={}){let n=new Map;for(let a of t.customGenerators??[])ae(n,a);let r=[];for(let a of e)r.push(await se(a,n,t.configDir));let s=[],o=new Set,i=async a=>{if(!(s.includes(a)||o.has(a))){o.add(a);for(let c of n.get(a).requires??[])(n.has(c)||c in I)&&await i(await se(c,n,t.configDir));o.delete(a),s.push(a)}};for(let a of r)await i(a);return{selected:s,registry:n}}async function se(e,t,n){if(t.has(e))return e;let r=I[e];if(r!==void 0){let{load:o,...i}=r;return t.set(e,{...i,...await o()}),e}if(e==="sdk")throw new y('The "sdk" generator is now named "typescript". Update the `generators` list or the --generator flag.');let s=await Pe(e,n??process.cwd());return ae(t,s),s.name}function ae(e,t){if(!x(t)||typeof t.name!="string"||t.name===""||typeof t.run!="function")throw new y("Invalid custom generator: expected an object with a non-empty string `name` and a `run` function (build one with `defineGenerator`).");if(e.has(t.name))throw new y(`Generator name "${t.name}" collides with an existing generator. Rename the custom generator.`);if(t.requiresGenerator!==void 0){let n=ne(G,t.requiresGenerator);if(n===void 0)throw new y(`Generator "${t.name}" declares requiresGenerator "${t.requiresGenerator}", which is not a range we read. Use ^1.2.0, ~1.2.0, >=1.2.0, or an exact version.`);if(!n)throw new y(`Generator "${t.name}" needs @redocly/client-generator ${t.requiresGenerator}; this CLI ships ${G}. Upgrade @redocly/cli if the generator is newer, or update the generator \u2014 \`redocly eject-generator <name> --update\` for an ejected file, or upgrade its package.`)}t.name in I&&b.warn(`generate-client: custom generator "${t.name}" takes over the built-in generator of the same name.
|
|
@@ -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
|
+
import{a as R,b as u,c as f,d}from"./SWK3YGGD.js";import{d as y,e as G,f as x}from"./63QCRU6J.js";import{c as g,d as S,e as h}from"./XRTDDB7G.js";import{c as k,d as v,e as b}from"./VWDCJNJS.js";import{a as D,b as E,c as q,d as z}from"./PZWFBD3A.js";import{a as o}from"./FCXOAAZW.js";import{a,b as p,c as s}from"./EQ7EIDJ2.js";import"./2U6O26CV.js";import{a as m}from"./EY2ZN6BT.js";import{a as i}from"./JM7BMZLD.js";import{a as c}from"./A2ODYHX2.js";import"./LBF5UJY7.js";import{a as I,d as M,e as N}from"./XGSKSQUA.js";import{a as l}from"./Z7FXXAFA.js";import{a as H,b as er,c as tr,d as or,e as nr,f as ar,g as pr,h as sr,i as mr,j as ir}from"./HNPYGEY3.js";import"./YHGVWNO2.js";import{a as U}from"./WZXA5XPB.js";import"./V7XX5H7Y.js";import"./NEWT5A6S.js";import{e as T,h as j,k as w}from"./LD5MEXEL.js";import{a as _,b as B,c as F,d as J,e as Q,f as K,g as P,h as V,i as W,j as X,k as Y,l as Z,m as $,n as rr}from"./UW4UC7ZI.js";import"./RFWIIJFG.js";var A={typescript:{run:a,sample:s,docs:p},zod:{run:m},transformers:{run:i},"tanstack-query":{run:o("react")},"tanstack-query-vue":{run:o("vue")},"tanstack-query-svelte":{run:o("svelte")},"tanstack-query-solid":{run:o("solid")},swr:{run:c},mock:{run:l},cli:{run:u,sample:d,docs:f},python:{run:y,sample:G,docs:x},go:{run:g,sample:S,docs:h},php:{run:k,sample:v,docs:b}},L=Object.fromEntries(Object.entries(D).map(([e,{load:r,...t}])=>[e,{...t,...A[e]}]));function n(){return new Map(Object.entries(L))}function C(e,r,t=n(),O){E(e,r,t,O)}function Dr(e,r){let t=r.registry??n();return C(r.generators,r.emit,t,r.outputMode),q(e,{...r,registry:t})}export{ir as AUTHORING_HELPER_NAMES,U as NotSupportedError,_ as Printer,F as RESERVED_WORDS,B as casing,j as codeLiteral,Dr as collectGeneratedFiles,K as deref,V as discriminatorCases,Z as docText,Y as enumValues,P as flattenAllOf,z as generateClient,rr as headerCoerceType,J as identifierFor,nr as isBinaryContentType,or as isMultipartBody,W as isNullable,er as jsonSuccessSchema,I as operationSignature,sr as paginationItemSchema,H as paginationRuleFor,w as pascalCase,R as renderComposedCliEntry,mr as renderReferencePage,T as safeIdent,$ as schemaAtPointer,pr as securityRequirements,ar as serverUrlParts,tr as sseResponse,M as tsJsdoc,N as tsType,Q as uniqueIdentifiers,X as unwrapNullable};
|
|
@@ -0,0 +1,78 @@
|
|
|
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{h as g}from"./XGSKSQUA.js";import{e as C,l as u,m as p}from"./HNPYGEY3.js";import{c as j,d as v}from"./YHGVWNO2.js";import{X as b}from"./V7XX5H7Y.js";import{a as S,b as k}from"./UW4UC7ZI.js";import{join as $}from"node:path";function h(r){return(r??"").replace(/\s+/g," ").trim().replace(/\\/g,"\\\\").replace(/\|/g,"\\|")}function w(r){return[r.group===void 0?void 0:u(r.group),r.name].filter(Boolean).join(" ")}function T(r,e){return[r,w(e),...e.positionals.map(o=>`<${o.name}>`),...e.flags.filter(o=>o.required).map(o=>`--${o.name} <${o.type}>`),...e.body?[e.body.required?"--json '<json>'":"[--json '<json>']"]:[]].filter(o=>o!=="").join(" ")}function B(r,e){r.line("| Flag | Type | Required | Description |"),r.line("| ---- | ---- | -------- | ----------- |");for(let n of e){let o=[h(n.description),n.enum===void 0?"":`One of ${n.enum.map(t=>`\`${t}\``).join(", ")}.`,n.type==="array"?"Repeat the flag for multiple values.":""].filter(t=>t!=="").join(" ");r.line(`| \`--${n.name}\` | ${n.type} | ${n.required?"yes":"no"} | ${o} |`)}r.blank()}function D(r,e,n){if(r.line(`### \`${w(e)}\``),r.blank(),e.summary!==void 0&&(r.line(h(e.summary)),r.blank()),r.line(`\`${e.method} ${e.path}\``),r.blank(),r.line("```sh"),r.line(T(n.name,e)),r.line("```"),r.blank(),e.positionals.length>0){r.line("| Argument | Description |"),r.line("| -------- | ----------- |");for(let t of e.positionals)r.line(`| \`<${t.name}>\` | ${h(t.description)} |`);r.blank()}e.flags.length>0&&B(r,e.flags);let o=[e.body===void 0?"":`Takes a JSON body${e.body.required?" (required)":""}: \`--json '<json>'\`, \`--json @file.json\`, or \`--json @-\` for stdin.`,e.unsupportedBody===void 0?"":`Takes a \`${e.unsupportedBody}\` body, which the CLI cannot build \u2014 call this operation through the generated client instead.`,e.paginated===!0?"Paginated: `--page-all` follows every page, printing one JSON page per line.":"",e.sse===!0?"Streams server-sent events as one JSON object per line.":"",e.blob===!0?"Returns binary content, so `--output <path>` is required.":""].filter(t=>t!=="");for(let t of o)r.line(t);o.length>0&&r.blank()}function R(r,e){let n=new S;e.frontmatter&&(n.line("---"),n.line(`title: ${e.title}`),n.line("---"),n.blank()),n.line(`# ${e.title}`),n.blank(),n.line(`Generated command-line reference for \`${e.name}\`, produced from the API description by \`redocly generate-client\`.`),n.line("Re-run generation to update it \u2014 this file is not hand-edited."),n.blank(),n.line("## Usage"),n.blank(),n.line("```sh"),n.line(`${e.name} <command> [flags]`),n.line(`${e.name} --help`),n.line(`${e.name} schema <command> # request/response schemas`),n.line("```"),n.blank(),n.line("Install the file under any `bin` name: the command takes that name, and the credential variables below do not change."),n.blank(),n.line("## Global flags"),n.blank(),n.line("| Flag | Description |"),n.line("| ---- | ----------- |");let o=e.schemes.some(i=>i.kind==="bearer");for(let[i,s]of[["--server-url <url>","Override the server URL included in the client."],["--format <json\\|ndjson>","Output format."],["--dry-run","Print the prepared request, credentials redacted, without sending it."],["--page-all","Follow pagination, printing one JSON page per line."],["--output <path>","Write the response body to a file. Required for binary responses."],...o?[["--token <token>","Bearer token, overriding the environment."]]:[],["--json <json\\|@file\\|@->","Request body, inline or from a file or stdin."]])n.line(`| \`${i}\` | ${s} |`);n.blank();let t=p(e.name);if(n.line("## Credentials"),n.blank(),e.schemes.length===0)n.line("The description declares no security schemes, so no credentials are read.");else{n.line("Credentials come from the environment:"),n.blank(),n.line("| Scheme | Variable |"),n.line("| ------ | -------- |");for(let i of e.schemes){let s=i.kind==="bearer"?`\`${t}_TOKEN\` (or \`--token\`)`:i.kind==="basic"?`\`${t}_USERNAME\` and \`${t}_PASSWORD\``:`\`${t}_API_KEY_${p(i.key)}\``;n.line(`| ${i.kind} (\`${i.key}\`) | ${s} |`)}}n.blank(),n.line("## Exit codes"),n.blank(),n.line("| Code | Meaning |"),n.line("| ---- | ------- |");for(let[i,s]of[[0,"success"],[1,"API error (status other than 401 or 403)"],[2,"auth error (401 or 403)"],[3,"validation error"],[4,"usage error (unknown command or flag, bad `--json`)"]])n.line(`| ${i} | ${s} |`);n.blank(),n.line("Errors print one JSON object to stderr, so stdout stays clean for piping."),n.blank();let a=[...new Set(r.map(i=>i.group))];for(let i of a){let s=r.filter(l=>l.group===i);i===void 0?(n.line("## Commands"),n.blank()):(n.line(`## ${i}`),n.blank(),n.line(`Addressed as \`${e.name} ${u(i)} <command>\`.`),n.blank());for(let l of s)D(n,l,e)}return n.toString().replace(/\n{3,}/g,`
|
|
8
|
+
|
|
9
|
+
`).trimEnd()+`
|
|
10
|
+
`}function x(){return v["cli.ts"]}function E(){return j["cli.ts"]}var q="// Generated by @redocly/client-generator \u2014 do not edit by hand.\n// Source: OpenAPI description. Re-run `redocly generate-client` to update.";function P(r){return k.snake(r).replace(/_/g,"-")}function O(r){let e=r.schema,n=e.kind==="array"?"array":e.kind==="scalar"&&(e.scalar==="integer"||e.scalar==="number")?"number":e.kind==="scalar"&&e.scalar==="boolean"?"boolean":"string";return{name:P(r.name),param:r.name,type:n,required:r.required,...e.kind==="enum"?{enum:e.values.map(String)}:{},...r.description!==void 0?{description:r.description}:{}}}function F(r){let e=r.successResponses;return e.some(n=>n.contentType.toLowerCase().includes("json"))?!1:e.some(n=>C(n.contentType))}function M(r){return r.successResponses.find(e=>e.contentType.toLowerCase().includes("json"))?.schema}function U(r,e,n){if(n!=="flat")return{};let o=g(r,e.schemas);return"mergeBody"in o&&o.mergeBody?{merged:!0}:{}}function _(r,e,n){return n!=="flat"?{}:"collisions"in g(r,e.schemas)?{argsStyle:"grouped"}:{}}function f(r,e){let n=[];for(let o of r.services)for(let t of o.operations){let a=t.requestBody?.contentType.toLowerCase().includes("json")?t.requestBody:void 0,i=M(t);n.push({...t.tags.length>0?{group:t.tags[0]}:{},name:t.name,...t.summary!==void 0?{summary:t.summary}:{},method:t.method.toUpperCase(),path:t.path,positionals:t.pathParams.map(s=>({name:s.name,type:O(s).type,...s.description!==void 0?{description:s.description}:{}})),flags:t.queryParams.map(O),...a?{body:{required:a.required,...U(t,r,e.argsStyle)}}:{},...a===void 0&&t.requestBody!==void 0?{unsupportedBody:t.requestBody.contentType}:{},...e.pagination?.has(t.name)===!0?{paginated:!0}:{},..._(t,r,e.argsStyle),...t.sse!==void 0?{sse:!0}:{},...F(t)?{blob:!0}:{},...a!==void 0||i!==void 0?{schemas:{...a?{request:a.schema}:{},...i!==void 0?{response:i}:{}}}:{}})}return n}var A=`function isProcessEntry(): boolean {
|
|
11
|
+
if (process.argv[1] === undefined) return false;
|
|
12
|
+
try {
|
|
13
|
+
return realpathSync(fileURLToPath(import.meta.url)) === realpathSync(process.argv[1]);
|
|
14
|
+
} catch {
|
|
15
|
+
return false;
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
if (isProcessEntry()) {
|
|
19
|
+
process.exit(await run());
|
|
20
|
+
}`;function m(r,e){return JSON.stringify(r,null,e).replace(/\u2028/g,"\\u2028").replace(/\u2029/g,"\\u2029")}function y(r){return r.securitySchemes.map(e=>({key:e.key,kind:e.kind==="bearer"||e.kind==="basic"?e.kind:"apiKey"}))}function I(r){return r.group===void 0?`${r.name} (keeps the bare word, so the "${r.name}" group has no help page)`:`${r.name} (run it as "${u(r.group)} ${r.name}")`}function L(r){let e=new Set(r.filter(o=>o.group).map(o=>u(o.group))),n=r.filter(o=>e.has(o.name));n.length!==0&&b.warn(`generate-client: cli reads a leading group name as the group, so ${n.length} operation(s) named after a tag resolve unusually \u2014 rename the operation or the tag: ${n.map(I).join(", ")}.
|
|
21
|
+
`)}function N(r,e){let n=f(r,{pagination:e.pagination,argsStyle:e.argsStyle});L(n);let o=y(r),t=`./${e.stem}.${e.importExt}`,a=["client","configure",...e.zodSelected?["use"]:[]];return["#!/usr/bin/env node",q,`import { readFileSync, realpathSync, writeFileSync } from "node:fs";
|
|
22
|
+
import { fileURLToPath } from "node:url";`,[`import { ${a.join(", ")} } from "${t}";`,...e.zodSelected?[`import { zodValidation } from "./${e.stem}.zod.${e.importExt}";`]:[]].join(`
|
|
23
|
+
`),e.runtime==="module"?`import { invokedName, runCli, type CliCommand, type CliWiring } from "./runtime/cli.${e.importExt}";`:`// \u2500\u2500\u2500 Embedded cli engine (@redocly/client-generator) \u2500\u2500\u2500
|
|
24
|
+
`+x(),`export const COMMANDS: CliCommand[] = ${m(n,2)};`,...e.zodSelected?['use(zodValidation(process.argv.includes("--dry-run") ? { response: false } : {}));']:[],`export const wiring: CliWiring = {
|
|
25
|
+
name: invokedName(process.argv[1], ${m(e.stem)}),
|
|
26
|
+
envPrefix: ${m(p(e.stem))},
|
|
27
|
+
client,
|
|
28
|
+
${e.argsStyle==="flat"?` argsStyle: "flat",
|
|
29
|
+
`:""} configure,
|
|
30
|
+
schemes: ${m(o)},
|
|
31
|
+
env: process.env,
|
|
32
|
+
stdin: () => readFileSync(0, "utf-8"),
|
|
33
|
+
readFile: (path: string) => readFileSync(path, "utf-8"),
|
|
34
|
+
writeFile: (path: string, data: Uint8Array) => writeFileSync(path, data),
|
|
35
|
+
stdout: (line: string) => console.log(line),
|
|
36
|
+
stderr: (line: string) => console.error(line),
|
|
37
|
+
};
|
|
38
|
+
|
|
39
|
+
/** Run this CLI programmatically; defaults to the process argv. */
|
|
40
|
+
export const run = (argv: string[] = process.argv.slice(2)): Promise<number> =>
|
|
41
|
+
runCli(COMMANDS, wiring, argv);
|
|
42
|
+
|
|
43
|
+
// Re-exported so a composed entry can run these commands without its own runtime copy.
|
|
44
|
+
export { runCli };
|
|
45
|
+
|
|
46
|
+
// Self-execute only as the process entry, so importing this module is side-effect-safe:
|
|
47
|
+
// composed binaries and login-style wrappers import COMMANDS/wiring/run instead of
|
|
48
|
+
// editing this generated file.
|
|
49
|
+
${A}`].join(`
|
|
50
|
+
|
|
51
|
+
`)+`
|
|
52
|
+
`}function Q(r,e){let n=p(e),o=new Map;r.forEach(({alias:s},l)=>{let c=s.replace(/[^A-Za-z0-9]/g,"_"),d=/^[A-Za-z_]/.test(c)?c:`_${c}`;o.set(s,[...o.values()].includes(d)?`${d}_${l}`:d)});let t=s=>o.get(s),a=r.map(({alias:s,modulePath:l},c)=>{let d=t(s);return`import { COMMANDS as ${d}Commands, wiring as ${d}Wiring${c===0?", runCli":""} } from ${JSON.stringify(l)};`}),i=r.map(({alias:s})=>{let l=t(s),c=P(s),d=`${n}_${p(s)}`;return` {
|
|
53
|
+
namespace: ${JSON.stringify(c)},
|
|
54
|
+
commands: ${l}Commands,
|
|
55
|
+
wiring: { ...${l}Wiring, envPrefix: ${JSON.stringify(d)} },
|
|
56
|
+
},`});return["#!/usr/bin/env node",q,['import { realpathSync } from "node:fs";','import { fileURLToPath } from "node:url";',...a].join(`
|
|
57
|
+
`),`/** The composed sources \u2014 import SOURCES to layer custom commands around this binary. */
|
|
58
|
+
export const SOURCES = [
|
|
59
|
+
${i.join(`
|
|
60
|
+
`)}
|
|
61
|
+
];
|
|
62
|
+
|
|
63
|
+
/** Run the composed CLI programmatically; defaults to the process argv. */
|
|
64
|
+
export const run = (argv: string[] = process.argv.slice(2)): Promise<number> =>
|
|
65
|
+
runCli(SOURCES, argv);
|
|
66
|
+
|
|
67
|
+
// Re-exported so a wrapper (a custom \`login\` command) can run these sources itself.
|
|
68
|
+
export { runCli };
|
|
69
|
+
|
|
70
|
+
${A}`].join(`
|
|
71
|
+
|
|
72
|
+
`)+`
|
|
73
|
+
`}var ie=({model:r,output:e,banner:n,emit:o,selected:t,pagination:a})=>{let i=N(r,{stem:e.stem,importExt:o.importExt??"js",zodSelected:t?.includes("zod")??!1,pagination:a,argsStyle:o.argsStyle??"grouped",runtime:o.runtime??"inline"}),s={path:$(e.dir,`${e.stem}.cli.ts`),content:i};if(o.runtime!=="module")return[s];let l=n.map(c=>`// ${c}`).join(`
|
|
74
|
+
`);return[s,{path:$(e.dir,"runtime","cli.ts"),content:`${l}
|
|
75
|
+
|
|
76
|
+
${E().trim()}
|
|
77
|
+
`}]},se=({model:r,output:e,emit:n,pagination:o})=>{let t=R(f(r,{pagination:o}),{title:`${r.title} command-line reference`,frontmatter:n.docsFrontmatter===!0,name:e.stem,schemes:y(r)});return[{path:$(e.dir,`${e.stem}.cli.md`),content:t}]};function ae(r,e){let n=f(e.model,{pagination:e.pagination}).find(t=>t.name===r.name);return n===void 0?void 0:{lang:"shell",label:"CLI",source:`npx tsx client.cli.ts ${["client",...n.group?[u(n.group)]:[],n.name,...n.positionals.map(t=>`<${t.name}>`),...n.flags.filter(t=>t.required).map(t=>`--${t.name} <${t.type}>`),...n.body?["--json '<json>'"]:[]].slice(1).join(" ")}
|
|
78
|
+
`}}export{Q as a,ie as b,se as c,ae as d};
|
|
@@ -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"./V7XX5H7Y.js";import{open as U,readdir as H,stat as J}from"node:fs/promises";import x from"node:path";var L=new Set([".yaml",".yml",".json"]);async function K(e){let n=[];async function t(r){let o=await H(r,{withFileTypes:!0});for(let s of o){if(s.name.startsWith("."))continue;let i=x.join(r,s.name);if(s.isDirectory()){await t(i);continue}s.isFile()&&L.has(x.extname(s.name).toLowerCase())&&n.push(i)}}return await t(e),n.sort(),n}async function G(e,n=4096){let t=await U(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 X(e){return x.resolve(process.cwd(),e)}async function Y(e){let n=await J(e);if(n.isFile())return[e];if(!n.isDirectory())return[];let t=[];async function r(o){let s=await H(o,{withFileTypes:!0});for(let i of s){if(i.name.startsWith("."))continue;let a=x.join(o,i.name);if(i.isDirectory()){await r(a);continue}i.isFile()&&t.push(a)}}return await r(e),t.sort(),t}var z="drift.local",B=`http://${z}`;function l(e){return e===z}var I=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"]),q=["cf-","sec-ch-","sec-fetch-","x-amz-","x-amzn-","x-b3-","x-envoy-","x-forwarded-","x-github-"],T=`
|
|
8
8
|
`;function Z(e){return e.split(T)}function S(e,n,t){let r=n.toLowerCase(),o=e[r];if(o===void 0){e[r]=t;return}e[r]=r==="set-cookie"?`${o}${T}${t}`:`${o},${t}`}function w(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&&S(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)S(n,t,String(o));continue}S(n,t,String(r))}return n}function m(e){try{return new URL(e)}catch{return new URL(e,B)}}function N(e){return e.length>1&&e.endsWith("/")?e.slice(0,-1):e}function b(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function v(e){let n=[],t=0,r=e.startsWith("/")?e:`/${e}`,s=N(r).split("/").map(i=>{if(!i)return"";let a=[...i.matchAll(/\{([^}]+)\}/g)],h=n.length,u="",p=0,f=0;for(let[y,d]of a.entries()){let R=i.slice(f,d.index);u+=b(R),p+=R.length,n.push(d[1]),f=d.index+d[0].length;let E=a[y+1];if(!E){u+="([^/]+)";continue}let A=i.slice(f,E.index);u+=A?`((?:(?!${b(A)})[^/])+)`:"([^/])"}let g=i.slice(f);return u+=b(g),p+=g.length,n.length===h?t+=2:p>0&&(t+=1),u}).join("/");return{regex:new RegExp(`^${s||"/"}$`),params:n,score:t}}function k(e,n){if(n&&P(e))try{return JSON.parse(n)}catch{return}}function C(e){return e?e.split(";")[0]?.trim().toLowerCase()??"":""}function P(e){let n=C(e);return n==="application/json"||n.endsWith("+json")}function ee(e,n){let t=C(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 ne(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 te(e,n){let t=e.toLowerCase();return t.startsWith(":")||I.has(t)||q.some(r=>t.startsWith(r))?!0:n?n.names.has(t)||n.prefixes.some(r=>t.startsWith(r)):!1}import{createReadStream as F}from"node:fs";import{readFile as j}from"node:fs/promises";import{createInterface as W}from"node:readline";function D(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 ue(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 $(e,n){if(e!=null){if(n==="base64"&&typeof e=="string")try{return Buffer.from(e,"base64").toString("utf8")}catch{return e}return D(e)}}function fe(e,n,t){let r=e.method?.toUpperCase(),o=e.url;if(!r||!o)return null;let s=w(e.requestHeaders),i=m(o);if(l(i.host)&&s.host)try{i=new URL(`${i.protocol}//${s.host}${i.pathname}${i.search}`)}catch{i=m(o)}let a=e.requestContentType??s["content-type"],h=$(e.requestBody),u={method:r,url:i.toString(),path:i.pathname,query:i.searchParams,protocol:i.protocol,protocolKnown:e.schemeKnown??/^https?:\/\//i.test(o),host:l(i.host)?void 0:i.host||void 0,headers:s,contentType:a,bodyText:h,bodyJson:k(a,h)},p,f=e.responseStatus;if(f!==void 0){let g=w(e.responseHeaders),y=e.responseContentType??g["content-type"],d=$(e.responseBody);p={status:f,statusText:e.responseStatusText,headers:g,contentType:y,bodyText:d,bodyJson:k(y,d)}}return{index:n,source:t,startedAt:e.startedAt,request:u,response:p,raw:e.raw}}async function*de(e){let n=F(e,{encoding:"utf8"}),t=W({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*pe(e,n){let t=await j(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 ge(e){return w(e)["content-type"]}function he(e){return e?.replace(/\/+$/,"")||void 0}function O(e,n){if(!n||n==="/")return e||"/";if(e===n)return"/";if(e.startsWith(`${n}/`))return e.slice(n.length)||"/"}function ye(e,n){if(n.startsWith("/"))return O(e.path,n);let t=m(n.includes("://")?n:`http://${n}`);if(!(l(t.host)||e.host!==void 0&&e.host.toLowerCase()!==t.host))return O(e.path,N(t.pathname))}export{K as a,G as b,X as c,Y as d,l as e,Z as f,m as g,N as h,v as i,C as j,P as k,ee as l,ne as m,te as n,D as o,ue as p,$ as q,fe as r,de as s,pe as t,ge as u,he as v,ye as w};
|
|
@@ -4,4 +4,4 @@ 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{a,b,c,d,e,f,g}from"./
|
|
7
|
+
import{a,b,c,d,e,f,g}from"./DGKML64B.js";import"./7IULUVWX.js";import"./V7XX5H7Y.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";export{d as RESET_ESCAPE_CODE,c as calculateTotals,f as conditionallyMaskSecrets,b as generate,e as maskSecrets,a as parseRuntimeExpression,g as run};
|
|
@@ -4,4 +4,4 @@ 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{a}from"./
|
|
7
|
+
import{a}from"./EY2ZN6BT.js";import"./HNPYGEY3.js";import"./YHGVWNO2.js";import"./WZXA5XPB.js";import"./V7XX5H7Y.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{a as zodGenerator};
|