@redocly/cli 2.62.1 → 2.63.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/{VXLODB3S.js → 24AVTWC7.js} +1 -1
- package/lib/chunks/{SOI7RTB4.js → 2G2Q42ND.js} +1 -1
- package/lib/chunks/{KRCCY64H.js → 3LGZAJES.js} +1 -1
- package/lib/chunks/3SFDVGEQ.js +7 -0
- package/lib/chunks/{RGU6OZYB.js → 4C44BO5N.js} +1 -1
- package/lib/chunks/4JKMQCWY.js +9 -0
- package/lib/chunks/{UFZ7VJKO.js → 5IIJHGNO.js} +1 -1
- package/lib/chunks/{3M4FKKBI.js → 5VDBZVBF.js} +1 -1
- package/lib/chunks/6AB3BDX4.js +20 -0
- package/lib/chunks/{LRLGVYCG.js → 6LEQ46KS.js} +1 -1
- package/lib/chunks/{GVQMC2WB.js → 6QRNEF7K.js} +1 -1
- package/lib/chunks/{PTNNX4IU.js → 6WESXERF.js} +1 -1
- package/lib/chunks/{PRSNVDUV.js → 7AWM5GPD.js} +1 -1
- package/lib/chunks/{KQ5RN67Y.js → 7LNKXEIU.js} +1 -1
- package/lib/chunks/{5YW5LAGV.js → 7RQW6KPZ.js} +156 -58
- package/lib/chunks/{SLQPKXO2.js → A22GELRX.js} +1 -1
- package/lib/chunks/{VE45GKNY.js → AAPHKNGA.js} +1 -1
- package/lib/chunks/{22EANOP2.js → ACMV5RZA.js} +1 -1
- package/lib/chunks/AU7VOB4V.js +20 -0
- package/lib/chunks/{O7F2NBMC.js → B4ONRSDG.js} +3 -3
- package/lib/chunks/BC3XCWQE.js +11 -0
- package/lib/chunks/{L3H2DSRP.js → BFIZTFWS.js} +1 -1
- package/lib/chunks/{W3G6AQCC.js → BS3AUVYD.js} +1 -1
- package/lib/chunks/{NBI4EQPC.js → C2OCU4E3.js} +1 -1
- package/lib/chunks/{US7X4XPD.js → CQMZF72H.js} +1 -1
- package/lib/chunks/{3C6UUCEW.js → CTPVBOG5.js} +1 -1
- package/lib/chunks/{3JYY42DL.js → CVUPOCX4.js} +1 -1
- package/lib/chunks/{FDMXHRDK.js → DEXQ6S3P.js} +1 -1
- package/lib/chunks/{RPHIT72T.js → DQFNUDOT.js} +1 -1
- package/lib/chunks/{Y5AAEFMH.js → E2D25T4G.js} +1 -1
- package/lib/chunks/{G55KF2JU.js → FCZH3476.js} +1 -1
- package/lib/chunks/{ZNQTCB4Q.js → FRM6TZ42.js} +1 -1
- package/lib/chunks/GKXY6U4S.js +145 -0
- package/lib/chunks/{YINR7LU6.js → HTG3RKCV.js} +1 -1
- package/lib/chunks/{BX2H6D2W.js → HW7ZCN7J.js} +1 -1
- package/lib/chunks/{REIGI2Y7.js → I3M476SQ.js} +1 -1
- package/lib/chunks/{AB2EMYEK.js → IODGA6FG.js} +1 -1
- package/lib/chunks/{5S5OMDQZ.js → ITUUIAOZ.js} +381 -381
- package/lib/chunks/{LWPTRXNP.js → IYKYAJDC.js} +1 -1
- package/lib/chunks/{ZJYDDU5M.js → J373CXCH.js} +1 -1
- package/lib/chunks/{5UYYEBJY.js → J7J4PH3V.js} +7 -7
- package/lib/chunks/{P7MVM2ZA.js → JGBWIR5U.js} +1 -1
- package/lib/chunks/{S6NFOZ34.js → JHK6XIMG.js} +1 -1
- package/lib/chunks/{YDVWNFMS.js → KMP5ZE2D.js} +1 -1
- package/lib/chunks/{6EGJEFXO.js → L2EBKZQZ.js} +1 -1
- package/lib/chunks/{RUIEI3YV.js → LLWU7A5G.js} +1 -1
- package/lib/chunks/{LVGVWPDB.js → LXSCIQFU.js} +1 -1
- package/lib/chunks/{5PG3ST2N.js → NCBLLIQ3.js} +2 -2
- package/lib/chunks/{7YNVVBUW.js → NERCHMVY.js} +1 -1
- package/lib/chunks/{XJE2OFDN.js → NR3R4HFM.js} +45 -18
- package/lib/chunks/{LNYTDBAU.js → OFJ2KV5N.js} +1 -1
- package/lib/chunks/{XVZ7A34Y.js → OYUXHAGQ.js} +1 -1
- package/lib/chunks/{37WWN4MA.js → PHWKGYUT.js} +1 -1
- package/lib/chunks/{6NB3FKVN.js → Q4UGLPO2.js} +1 -1
- package/lib/chunks/{DBBMGF4W.js → QNCKZURN.js} +1 -1
- package/lib/chunks/{WEOCCL26.js → RFGNVCAR.js} +5 -5
- package/lib/chunks/{HBENVUR4.js → SXIFTBZB.js} +1 -1
- package/lib/chunks/{XJTGJYVS.js → TCALQAX5.js} +1 -1
- package/lib/chunks/{TBZEEKTV.js → U52CY34I.js} +1 -1
- package/lib/chunks/VB4PNWOR.js +7 -0
- package/lib/chunks/{SYWAPWW7.js → VSBSD3XZ.js} +1 -1
- package/lib/chunks/{ID2DJAJI.js → WV2NAII3.js} +1 -1
- package/lib/chunks/{YPYZCXVX.js → X2V5QOZP.js} +1 -1
- package/lib/chunks/{SXBAAS4M.js → XNNK5G6V.js} +1 -1
- package/lib/chunks/Y4UTXOI2.js +59 -0
- package/lib/chunks/{6DO6IN4A.js → YKST56C6.js} +1 -1
- package/lib/chunks/{2XK7ML3U.js → YXH72HCU.js} +1 -1
- package/lib/chunks/{MNH2K4WM.js → Z52TEGV5.js} +1 -1
- package/lib/chunks/{3DEJQSYG.js → Z5QYTPVY.js} +1 -1
- package/lib/chunks/{OP7NIAI7.js → Z7J6WWCO.js} +1 -1
- package/lib/chunks/{2OVI7BIW.js → ZK27F53P.js} +1 -1
- package/lib/chunks/{QMIOB64K.js → ZP54RCIQ.js} +1 -1
- 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 +1 -1
- package/lib/eject-assets/generators/go/client.ts +1 -1
- package/lib/eject-assets/generators/go/descriptor.ts +2 -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 +2 -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 +2 -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 +56 -9
- 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 +1 -1
- 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/tanstack-query-generator/SKILL.md +5 -2
- package/lib/eject-assets/skills/typescript-generator/SKILL.md +5 -0
- package/lib/index.js +25 -25
- package/package.json +1 -1
- package/lib/chunks/23KTTVIR.js +0 -42
- package/lib/chunks/5NOJ76EP.js +0 -9
- package/lib/chunks/B64RMZSV.js +0 -7
- package/lib/chunks/LRUXN6H5.js +0 -59
- package/lib/chunks/QWPV64G2.js +0 -20
- package/lib/chunks/U77FTE2C.js +0 -20
- package/lib/chunks/UWK3L6LB.js +0 -11
- package/lib/chunks/WPIZQQ5C.js +0 -7
|
@@ -0,0 +1,20 @@
|
|
|
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 W}from"./NR3R4HFM.js";import{b as E,c as I,d as L,e as F,f as ne,g as te,h as re,i as ie,j as se}from"./BC3XCWQE.js";import{a as X,c as C,d as p,e as S,f as N,g as R,h as B,i as Z,j,k as D,l as O,n as ee}from"./UW4UC7ZI.js";var U=C.php,w=class extends X{constructor(){super(" ")}typeName(n){return p(n,{style:"pascal",reserved:U})}memberName(n){return p(n,{style:"camel",reserved:U})}identifier(n){return p(n,{style:"camel",reserved:U})}identifiers(n,s){return S(n,{style:"camel",reserved:U,taken:s})}string(n){return`'${n.replace(/\\/g,"\\\\").replace(/'/g,"\\'")}'`}literal(n){return n==null?"null":typeof n=="boolean"||typeof n=="number"?String(n):typeof n=="string"?this.string(n):Array.isArray(n)?`[${n.map(i=>this.literal(i)).join(", ")}]`:`[${Object.entries(n).map(([i,r])=>`${this.string(i)} => ${this.literal(r)}`).join(", ")}]`}comment(n){for(let s of O(n))this.line(s===""?"//":`// ${s}`);return this}doc(n,s,i=[]){let r=O(s);if(r.length===0&&i.length===0)return this;let t=r.length===0?n:`${n} \u2014 ${r.join(" ")}`;if(i.length===0)return this.line(`/** ${t} */`);this.line("/**"),this.line(` * ${t}`),this.line(" *");for(let a of i)this.line(` * ${a}`);return this.line(" */")}};var h=C.php,G=new w;function y(e){return G.typeName(e)}function k(e){return G.memberName(e)}function o(e){return G.string(e)}function ae(e){return p(e.name,{style:"camel",reserved:h})}function K(e){let n=e.services.flatMap(i=>i.operations),s=S(n.map(i=>i.name),{style:"camel",reserved:h});return new Map(n.map((i,r)=>[i.name,s[r]]))}function he(e){return te(e).map(s=>s.kind==="literal"?o(s.value):`$${k(s.name)}`).join(" . ")}function oe(e,n){let s=n.servers??[];if(s.length===0)return;let i=new Set;e.line("/** The declared servers; variables default to the values from the description. */"),e.line("final class Servers"),e.block("{",()=>{s.forEach((r,t)=>{let a=p(r.description??`server${t+1}`,{style:"camel",reserved:h});i.has(a)&&(a=`${a}${t+1}`),i.add(a);let c=r.variables.map(l=>`string $${k(l.name)} = ${o(l.default)}`);t>0&&e.blank(),e.line(`public static function ${a}(${c.join(", ")}): string`),e.block("{",()=>{e.line(`return ${he(r)};`)},"}")})},"}"),e.blank()}function ce(e,n){let s=re(e,n).map(i=>`[${i.map(t=>t.kind==="apiKey"?`['kind' => 'apiKey', 'scheme' => ${o(t.scheme)}, 'name' => ${o(t.name)}, 'in' => ${o(t.in)}]`:`['kind' => ${o(t.kind)}, 'scheme' => ${o(t.scheme)}]`).join(", ")}]`);if(s.length!==0)return`[${s.join(", ")}]`}function le(e){return`[${[`'style' => ${o(e.style)}`,...e.param!==void 0?[`'param' => ${o(e.param)}`]:[],...e.nextCursor!==void 0?[`'nextCursor' => ${o(e.nextCursor)}`]:[],...e.hasMore!==void 0?[`'hasMore' => ${o(e.hasMore)}`]:[],...e.nextLink!==void 0?[`'nextLink' => ${o(e.nextLink)}`]:[],...e.limitParam!==void 0?[`'limitParam' => ${o(e.limitParam)}`]:[],...e.items!==void 0?[`'items' => ${o(e.items)}`]:[]].join(", ")}]`}function ue(e,n){let s=new Set;return`[${(e.successResponseHeaders??[]).map(r=>{let t=p(r.name,{style:"camel",reserved:h}),a=2;for(;s.has(t);)t=`${p(r.name,{style:"camel",reserved:h})}_${a++}`;s.add(t);let c=ee(r.schema,n);return`[${o(r.name)}, ${o(t)}, ${o(c)}]`}).join(", ")}]`}function _(e,n){let s=n.schemas.find(t=>t.name===e);if(s===void 0)return"other";let i=s.schema,r=D(i);return r!==void 0&&(r.scalar==="string"||r.scalar==="integer")?"enum":(i.kind==="object"||i.kind==="intersection")&&R(i,n)!==void 0?"class":"other"}function m(e,n,s="string"){if(Z(e)){let i=m(j(e),n,s);return A(i)}switch(e.kind){case"scalar":return s==="Date"&&e.scalar==="string"&&J(e)?"\\DateTimeImmutable":{string:"string",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"array":case"record":return"array";case"ref":{let i=_(e.name,n);if(i==="class"||i==="enum")return y(e.name);let r=N(e,n);return r===void 0?"mixed":m(r,n,s)}case"enum":return{string:"string",integer:"int",number:"float",boolean:"bool"}[e.scalar];case"literal":return typeof e.value=="string"?"string":typeof e.value=="boolean"?"bool":"float";case"omit":return y(e.base);case"union":return ye(e.members,n,s);case"null":case"object":case"intersection":case"unknown":return"mixed"}}function J(e){let n=e.metadata?.format;return n==="date"||n==="date-time"}function A(e){return e==="mixed"||e.startsWith("?")||e.endsWith("|null")?e:e.includes("|")?`${e}|null`:`?${e}`}function ye(e,n,s){let i=[];for(let r of e){if(r.kind==="null")continue;let t=m(r,n,s);if(t==="mixed")return"mixed";let a=t.startsWith("?")?t.slice(1):t;i.includes(a)||i.push(a),t.startsWith("?")&&!i.includes("null")&&i.push("null")}return i.length===0?"mixed":i.join("|")}function V(e,n,s){if(e===void 0)return;let i=j(e);if(i.kind==="ref"){let t=N(i,n);return _(i.name,n)==="other"?V(t,n,s):void 0}if(i.kind!=="array")return;let r=m(i.items,n,s);return r==="mixed"?void 0:r}function $e(e,n){let s=n.schemas.find(i=>i.name===e);return s!==void 0&&B(s.schema,n)!==void 0}function q(e,n,s,i){let r=j(e);if(i==="Date"&&r.kind==="scalar"&&r.scalar==="string"&&J(r))return`new \\DateTimeImmutable(${n})`;if(r.kind==="omit")return q({kind:"ref",name:r.base},n,s,i);if(r.kind==="ref"){let t=_(r.name,s);if(t==="class")return`${y(r.name)}::fromArray(${n})`;if(t==="enum")return`${y(r.name)}::from(${n})`;if($e(r.name,s))return`unmarshal${y(r.name)}(${n})`;let a=N(r,s);return a===void 0?void 0:q(a,n,s,i)}if(r.kind==="array"){let t=q(r.items,"$item",s,i);return t===void 0?void 0:`array_map(static fn ($item) => ${t}, ${n})`}if(r.kind==="record"){let t=q(r.value,"$item",s,i);return t===void 0?void 0:`array_map(static fn ($item) => ${t}, ${n})`}}function x(e,n,s,i="string"){let r=j(e);if(i==="Date"&&r.kind==="scalar"&&r.scalar==="string"){if(r.metadata?.format==="date")return`${n}->format('Y-m-d')`;if(r.metadata?.format==="date-time")return`${n}->format(\\DateTimeInterface::ATOM)`}if(r.kind==="omit")return x({kind:"ref",name:r.base},n,s,i);if(r.kind==="ref"){let t=_(r.name,s);if(t==="class")return`${n}->toArray()`;if(t==="enum")return`${n}->value`;if($e(r.name,s))return`is_object(${n}) ? ${n}->toArray() : ${n}`;let a=N(r,s);return a===void 0?void 0:x(a,n,s,i)}if(r.kind==="array"||r.kind==="record"){let t=r.kind==="array"?r.items:r.value,a=x(t,"$item",s,i);return a===void 0?void 0:`array_map(static fn ($item) => ${a}, ${n})`}}function ge(e,n,s,i,r,t){let a=[...s.filter(c=>c.required),...s.filter(c=>!c.required)];e.doc(y(n),t),e.line(`final class ${y(n)}`),e.block("{",()=>{e.block("public function __construct(",()=>{for(let c of a){let l=m(c.schema,i,r);if(c.required)e.line(`public ${l} $${k(c.name)},`);else{let u=A(l);e.line(`public ${u} $${k(c.name)} = null,`)}}},") {"),e.line("}"),e.blank(),e.line("public static function fromArray(array $data): self"),e.block("{",()=>{e.block("return new self(",()=>{for(let c of a){let l=`$data[${o(c.name)}]`,u=q(c.schema,l,i,r),d=k(c.name);c.required?e.line(`${d}: ${u??l},`):u===void 0?e.line(`${d}: ${l} ?? null,`):e.line(`${d}: isset(${l}) ? ${u} : null,`)}},");")},"}"),e.blank(),e.line("public function toArray(): array"),e.block("{",()=>{e.line("$data = [];");for(let c of a){let l=`$this->${k(c.name)}`,u=x(c.schema,l,i,r)??l;c.required?e.line(`$data[${o(c.name)}] = ${u};`):e.block(`if (${l} !== null) {`,()=>{e.line(`$data[${o(c.name)}] = ${u};`)},"}")}e.line("return $data;")},"}")},"}"),e.blank()}function z(e,n="string"){let s=new w;for(let{name:i,schema:r}of e.schemas){let t=D(r);if(t!==void 0&&(t.scalar==="string"||t.scalar==="integer")){let c=t.scalar==="string"?"string":"int";s.doc(y(i),r.description),s.line(`enum ${y(i)}: ${c}`),s.block("{",()=>{let l=S(t.values.map(u=>String(u)),{style:"pascal",reserved:h});t.values.forEach((u,d)=>{let b=typeof u=="string"?o(u):String(u);s.line(`case ${l[d]} = ${b};`)})},"}"),s.blank();continue}if(r.kind==="object"||r.kind==="intersection"){let c=R(r,e);if(c!==void 0){ge(s,i,c.properties,e,n,c.description??r.description);continue}}let a=B(r,e);if(a!==void 0){let c=y(i),l=a.cases.map(u=>`${u.value} -> ${y(u.schemaName)}`).join(", ");s.line(`/** ${c} is a discriminated union (${o(a.property)}): ${l}. */`),s.line(`function unmarshal${c}(array $data): mixed`),s.block("{",()=>{s.block(`return match ($data[${o(a.property)}] ?? null) {`,()=>{for(let u of a.cases)s.line(`${o(u.value)} => ${y(u.schemaName)}::fromArray($data),`);s.line("default => $data,")},"};")},"}"),s.blank();continue}}return s.toString()}var de=new Set(["post","put","patch"]),be=["body","headers","idempotencyKey"];function fe(e){return F(e)||e.requestBody!==void 0&&ne(e.requestBody.contentType)}function Q(e,n,s,i){let r=S([...e.pathParams,...e.queryParams].map(l=>l.name),{style:"camel",reserved:h,taken:be}),t=e.pathParams.map((l,u)=>({php:r[u],wire:l.name,type:m(l.schema,n,i)})),a=e.queryParams.map((l,u)=>{let d=r[e.pathParams.length+u];return{php:d,wire:l.name,type:m(l.schema,n,i),value:x(l.schema,`$${d}`,n,i)??`$${d}`}}),c=[...t.map(({php:l,type:u})=>`${u} $${l}`),...s&&e.requestBody?[`${fe(e)?"mixed":L(e)?"array":m(e.requestBody.schema,n,i)} $body`]:[],...a.map(({php:l,type:u})=>`${A(u)} $${l} = null`),"?array $headers = null",...s&&de.has(e.method.toLowerCase())?["?string $idempotencyKey = null"]:[]];return{pathArgs:t,queryArgs:a,signature:c}}function ke(e,n,s){e.line(`$op = self::OPERATIONS[${o(n.specName??n.name)}];`),e.line("[$authHeaders, $query, $cookies] = resolveAuth($op['security'] ?? [], $this->config->auth);");for(let{php:r,wire:t,value:a}of s.queryArgs)e.block(`if ($${r} !== null) {`,()=>{e.line(`$query[${o(t)}] = ${a};`)},"}");let i=s.pathArgs.map(({php:r,wire:t})=>`${o(t)} => $${r}`).join(", ");e.line(`$url = buildUrl($this->config->serverUrl, $op['path'], [${i}]);`),e.line("$requestHeaders = array_merge($authHeaders, $headers ?? []);"),e.block("if ($cookies !== []) {",()=>{e.line("$requestHeaders['Cookie'] = implode('; ', $cookies);")},"}")}function Y(e,n,s,i,r,t=!1){let a=Q(n,i,!0,r),c=I(n),l=E(n),u=c===void 0&&l===void 0&&n.successResponses.some(g=>g.contentType!==""),d=t?"Envelope":c!==void 0?"\\Generator":l!==void 0?m(l,i,r):u?"string":"void",b=t?`${s}WithHeaders`:s,H=t?void 0:V(l,i,r);e.doc(b,t?`Like ${s}(), returning an Envelope with the declared response headers.`:n.summary??`${n.method.toUpperCase()} ${n.path}`,H===void 0?[]:[`@return ${H}[]`]),e.line(`public function ${b}(${a.signature.join(", ")}): ${d}`),e.block("{",()=>{if(ke(e,n,a),c!==void 0){let f=c.schema!==void 0&&c.schema.kind!=="unknown";e.line("$url = appendQuery($url, $query);"),e.block("$open = function (array $extraHeaders) use ($url, $requestHeaders): \\CurlHandle {",()=>{e.line("$handle = curl_init($url);"),e.line("$lines = [];"),e.block("foreach (array_merge($requestHeaders, $extraHeaders) as $name => $value) {",()=>{e.line("$lines[] = $name . ': ' . $value;")},"}"),e.line("curl_setopt($handle, CURLOPT_HTTPHEADER, $lines);"),e.line("return $handle;")},"};"),e.line(`yield from iterSse($open, ${f?"true":"false"});`);return}let g=["'operationId' => $op['id']","'method' => $op['method']","'url' => $url","'headers' => $requestHeaders","'query' => $query"];if(F(n))e.line("[$contentType, $encoded] = multipartBody($body);"),g.push("'body' => $encoded","'contentType' => $contentType");else if(n.requestBody&&fe(n))g.push("'body' => binaryBody($body)",`'contentType' => ${o(n.requestBody.contentType)}`);else if(n.requestBody&&L(n))e.line("[$contentType, $encoded] = toMultipart($body);"),g.push("'body' => $encoded","'contentType' => $contentType");else if(n.requestBody){let f=x(n.requestBody.schema,"$body",i,r)??"$body";e.line(`$payload = json_encode(${f});`),g.push("'body' => $payload",`'contentType' => ${o(n.requestBody.contentType)}`)}de.has(n.method.toLowerCase())&&n.requestBody&&g.push("'idempotencyKey' => $idempotencyKey"),e.line(`$response = send($this->config, [${g.join(", ")}]);`),e.block("if ($response['status'] >= 400) {",()=>{e.line("throw apiErrorFrom($response);")},"}");let $=u?"$response['body']":(l===void 0?void 0:q(l,"decodeJson($response)",i,r))??"decodeJson($response)";if(t){e.line(`$data = ${$};`),e.line(`return new Envelope(data: $data, headers: readEnvelopeHeaders($response, ${ue(n,i)}), status: $response['status']);`);return}if(u){e.line("return $response['body'];");return}if(d==="void"){e.line("decodeJson($response);");return}e.line(`return ${$};`)},"}"),e.blank()}function me(e,n,s,i,r,t,a,c,l){let u=Q(n,i,!1,r),d=s,b=()=>{e.line(`$op = self::OPERATIONS[${o(n.specName??n.name)}];`),e.line("$base = [];");for(let{php:f,wire:P,value:v}of u.queryArgs)e.block(`if ($${f} !== null) {`,()=>{e.line(`$base[${o(P)}] = ${v};`)},"}");let $=u.pathArgs.map(({php:f,wire:P})=>`${o(P)} => $${f}`).join(", ");e.block("$call = function (array $params) use ($op, $headers): array {",()=>{e.line("[$authHeaders, $authQuery, $cookies] = resolveAuth($op['security'] ?? [], $this->config->auth);"),e.line(`$url = buildUrl($this->config->serverUrl, $op['path'], [${$}]);`),e.line("$requestHeaders = array_merge($authHeaders, $headers ?? []);"),e.block("if ($cookies !== []) {",()=>{e.line("$requestHeaders['Cookie'] = implode('; ', $cookies);")},"}"),e.line("$response = send($this->config, ['operationId' => $op['id'], 'method' => $op['method'], 'url' => $url, 'headers' => $requestHeaders, 'query' => array_merge($params, $authQuery)]);"),e.block("if ($response['status'] >= 400) {",()=>{e.line("throw apiErrorFrom($response);")},"}"),e.line("return [decodeJson($response), $response];")},"};")},H=m(E(n)??{kind:"unknown"},i,r),g=H==="mixed"?"mixed":H;e.line("/**"),e.line(` * ${d} response pages, following the pagination rule automatically.`),e.line(" *"),e.line(` * @return \\Generator<int, ${g}>`),e.line(" */"),e.line(`public function ${d}Pages(${u.signature.join(", ")}): \\Generator`),e.block("{",()=>{b(),e.block("foreach (iterPages($call, $op['pagination'], $base) as $page) {",()=>{e.line(`yield ${t??"$page"};`)},"}")},"}"),e.blank(),e.line("/**"),e.line(` * The items of every ${d} page.`),e.line(" *"),e.line(` * @return \\Generator<int, ${l}>`),e.line(" */"),e.line(`public function ${d}Items(${u.signature.join(", ")}): \\Generator`),e.block("{",()=>{b(),e.block("foreach (iterPages($call, $op['pagination'], $base) as $page) {",()=>{e.line(`$items = resolvePointer($page, ${o(c??"")});`),e.block("foreach (is_array($items) ? $items : [] as $item) {",()=>{e.line(`yield ${a??"$item"};`)},"}")},"}")},"}"),e.blank()}function Pe(e){let n=e.split(`
|
|
8
|
+
`),s=0;for(let i=0;i<n.length;i++)if(n[i].trim().startsWith("namespace ")){s=i+1;break}return n.slice(s).join(`
|
|
9
|
+
`).trim()}var dn=({model:e,output:n,banner:s,emit:i,pagination:r})=>{let t=new w,a=i.dateType??"string",c=p(e.title,{style:"pascal",reserved:h});t.line("<?php"),t.blank(),t.line(`// Code generated by @redocly/client-generator (php) from ${o(e.title)} ${e.version}. DO NOT EDIT.`),t.line("// Regenerate with `redocly generate-client`. PHP >= 8.1, curl extension \u2014 zero Composer dependencies."),t.blank(),t.line("declare(strict_types=1);"),t.blank(),t.line(`namespace ${c};`),t.blank(),t.line(z(e,a)),oe(t,e),i.runtime==="module"?(t.line("// \u2500\u2500\u2500 Runtime (a real file beside this one, written by the same run) \u2500\u2500\u2500"),t.line("require_once __DIR__ . '/runtime.php';"),t.blank()):(t.line("// \u2500\u2500\u2500 Embedded runtime (@redocly/client-generator php runtime) \u2500\u2500\u2500"),t.line(Pe(W)),t.blank());let l=e.services.flatMap($=>$.operations),u=K(e),d=new Map;for(let $ of l){let f=r?.get($.name)?.spec;f!==void 0&&d.set($.name,f)}t.doc("Client",`Client for ${e.title} (${e.version}).`),t.line("class Client"),t.block("{",()=>{t.block("public const OPERATIONS = [",()=>{for(let $ of l){let f=$.specName??$.name,P=ce($,e),v=d.get($.name),M=[`'id' => ${o(f)}`,`'method' => ${o($.method.toUpperCase())}`,`'path' => ${o($.path)}`,...P!==void 0?[`'security' => ${P}`]:[],...v!==void 0?[`'pagination' => ${le(v)}`]:[]];t.line(`${o(f)} => [${M.join(", ")}],`)}},"];"),t.blank(),t.line("public function __construct(private Config $config)"),t.block("{",()=>{t.block("if ($this->config->serverUrl === '') {",()=>{t.line(`$this->config->serverUrl = ${o(i.serverUrl??e.serverUrl??"")};`)},"}")},"}"),t.blank();for(let $ of l){let f=u.get($.name);Y(t,$,f,e,a),I($)===void 0&&($.successResponseHeaders?.length??0)>0&&Y(t,$,f,e,a,!0);let P=d.get($.name);if(P===void 0)continue;let v=E($),M=v===void 0?void 0:q(v,"$page",e,a),T=ie(v,P.items,e),pe=T===void 0?void 0:q(T,"$item",e,a);me(t,$,f,e,a,M,pe,P.items,T===void 0?"mixed":m(T,e,a))}},"}");let b={path:n.path.replace(/\.[^.\\/]+$/,".php"),content:t.toString()};if(i.runtime!=="module")return[b];let H=s.map($=>`// ${$}`).join(`
|
|
10
|
+
`),g=W.replace(/^namespace .*$/m,`namespace ${c};`).replace(/^<\?php\n/,`<?php
|
|
11
|
+
|
|
12
|
+
${H}
|
|
13
|
+
`).trimEnd();return[b,{path:b.path.replace(/[^\\/]+$/,"runtime.php"),content:`${g}
|
|
14
|
+
`}]};function qe(e,n){let s=[...e.pathParams.map(t=>`${o(`<${k(t.name)}>`)}`),...e.requestBody?["$body"]:[],...e.queryParams.length>0?[`${k(e.queryParams[0].name)}: ${o("<value>")}`]:[]],i=p(n.model.title,{style:"pascal",reserved:h});return{lang:"php",label:"PHP SDK",source:`require '${n.outputPath.replace(/^.*[\\/]/,"").replace(/\.[^.]+$/,".php")}';
|
|
15
|
+
|
|
16
|
+
use ${i}\\{Client, Config};
|
|
17
|
+
|
|
18
|
+
$client = new Client(new Config());
|
|
19
|
+
$result = $client->${K(n.model).get(e.name)??ae(e)}(${s.join(", ")});
|
|
20
|
+
`}}var fn=({model:e,output:n,emit:s,pagination:i})=>[{path:n.path.replace(/\.[^.\\/]+$/,".php.md"),content:se(e,{title:`${e.title} PHP SDK reference`,frontmatter:s.docsFrontmatter===!0,language:{name:"php",label:"PHP",fence:"php",requires:"The SDK needs the curl extension."},sample:r=>qe(r,{model:e,emit:s,outputPath:n.path}),paginated:new Set(i?.keys()??[])})}];export{m as a,z as b,dn as c,qe as d,fn as e};
|
|
@@ -4,10 +4,10 @@ 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 l,b as v,c as U,d as F,e as R}from"./U5DIFWGH.js";import{b as O}from"./
|
|
7
|
+
import{a as l,b as v,c as U,d as F,e as R}from"./U5DIFWGH.js";import{b as O}from"./Q4UGLPO2.js";import{ba as k,c as G,ca as $,ga as S,ia as b,l as P,oa as g}from"./ACMV5RZA.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{readFileSync as z}from"node:fs";import{mkdir as H,writeFile as B}from"node:fs/promises";import{basename as T,dirname as A,extname as I,isAbsolute as N,relative as j,resolve as f}from"node:path";var V=/^[a-z][a-z0-9+.-]+:/i;function L(e,n){let{setup:o}=e;if(typeof o!="string")return e;if(V.test(o))throw new g(`
|
|
8
8
|
\u274C \`client.setup\` must be a local file path \u2014 remote setup modules are not supported.
|
|
9
9
|
Got: ${o}
|
|
10
|
-
`);return N(o)?e:{...e,setup:f(n,o)}}function q(e){return`${e.replace(/[\\/]/g,"_")}.client.ts`}function D(e){if(e.startsWith("//"))return!1;if(e.startsWith("/"))return!0;try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"}catch{return!1}}async function ie({argv:e,config:n}){let{AUTHORING_HELPER_NAMES:o,generateClient:c,mergeConfig:m}=await import("./
|
|
10
|
+
`);return N(o)?e:{...e,setup:f(n,o)}}function q(e){return`${e.replace(/[\\/]/g,"_")}.client.ts`}function D(e){if(e.startsWith("//"))return!1;if(e.startsWith("/"))return!0;try{let n=new URL(e);return n.protocol==="http:"||n.protocol==="https:"}catch{return!1}}async function ie({argv:e,config:n}){let{AUTHORING_HELPER_NAMES:o,generateClient:c,mergeConfig:m}=await import("./3SFDVGEQ.js"),t=n.configPath?A(n.configPath):process.cwd(),s={serverUrl:e["server-url"],outputMode:e["output-mode"],runtime:e.runtime,importExt:e["import-ext"],goPackage:e["go-package"],argsStyle:e["args-style"],errorMode:e["error-mode"],dateType:e["date-type"],mockData:e["mock-data"],mockSeed:e["mock-seed"],docs:e.docs,generators:e.generator?.map(a=>a.startsWith(".")?f(a):a),setup:e.setup===void 0?void 0:L({setup:e.setup},process.cwd()).setup},r=n.resolvedConfig.apis??{},i=Object.keys(r).filter(a=>G(r[a].client)||r[a].clientOutput!==void 0);if(e.api===void 0){if(e.output)throw new g("\n\u274C --output can't target multiple APIs. Set `clientOutput` under each api in redocly.yaml, or pass a single <api>.\n");if(i.length===0)throw new g("\n\u274C No API to generate. Add a `client` block or `clientOutput` under an `apis:` entry, or pass <api> (a file/URL or an `apis:` alias).\n")}let u=await O(e.api===void 0?i:[e.api],n),p={config:n,configDir:t,cliFlags:s,outputFlag:e.output,toolkit:{generateClient:c,mergeConfig:m,helperNames:o},seenOutputs:new Set,composable:[]};for(let a of u)await J(a,p);let y=G(n.resolvedConfig.client)?n.resolvedConfig.client:{};y.cliOutput!==void 0&&e.api===void 0&&p.composable.length>0&&await K(y.cliOutput,p)}async function J(e,{config:n,configDir:o,cliFlags:c,outputFlag:m,toolkit:t,seenOutputs:s,composable:r}){let{path:i,alias:u}=e,p=u??T(i,I(i)),y=n.forAlias(u),{client:a,clientOutput:E}=y.resolvedConfig,W=L(G(a)?a:{},o),h=t.mergeConfig(W,c);Q(h.generators??[],t.helperNames,o);let C=m!==void 0?f(m):E!==void 0?f(o,E):f(o,q(p));if(!C.endsWith(".ts"))throw new g(`
|
|
11
11
|
\u274C output must point at a TypeScript file (ending in .ts).
|
|
12
12
|
Got: ${C}
|
|
13
13
|
`);if(s.has(C))throw new g(`
|
|
@@ -23,7 +23,7 @@ import{a as l,b as v,c as U,d as F,e as R}from"./U5DIFWGH.js";import{b as O}from
|
|
|
23
23
|
`)}catch(d){let w=d instanceof Error?d.message:String(d);throw l.generate_client_error_category=R(w),new g(`
|
|
24
24
|
\u274C Failed to generate client for ${p}.
|
|
25
25
|
${w}
|
|
26
|
-
`)}}async function K(e,{configDir:n,seenOutputs:o,composable:c}){let{renderComposedCliEntry:m}=await import("./
|
|
26
|
+
`)}}async function K(e,{configDir:n,seenOutputs:o,composable:c}){let{renderComposedCliEntry:m}=await import("./VB4PNWOR.js"),t=f(n,e);if(!t.endsWith(".ts"))throw new g(`
|
|
27
27
|
\u274C client.cliOutput must point at a TypeScript file (ending in .ts).
|
|
28
28
|
Got: ${t}
|
|
29
29
|
`);if(o.has(t))throw new g(`
|
|
@@ -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 p,f,j as d,m as u}from"./UW4UC7ZI.js";function m(e,t,n){let i=t??{},a=e.specName??e.name;if(Array.isArray(i.exclude)&&i.exclude.includes(a))return;let r=(i.operations??{})[a]??e.paginationExtension;if(r===void 0&&typeof i.style=="string"){let{exclude:l,operations:I,...h}=i;k(e,h,n)&&(r=h)}if(r===void 0||typeof r.style!="string")return;let o=r.style==="cursor"?r.cursorParam:r.offsetParam;return{style:r.style,...typeof o=="string"?{param:o}:{},...typeof r.nextCursor=="string"?{nextCursor:r.nextCursor}:{},...typeof r.hasMore=="string"?{hasMore:r.hasMore}:{},...typeof r.nextLink=="string"?{nextLink:r.nextLink}:{},...typeof r.limitParam=="string"?{limitParam:r.limitParam}:{},...typeof r.items=="string"?{items:r.items}:{}}}function k(e,t,n){if(t.style==="link")return e.successResponseHeaders?.some(a=>a.name==="link")===!0;if(t.style==="body-link"){if(typeof t.nextLink!="string"||n===void 0)return!1;let a=e.successResponses.find(o=>o.contentType.toLowerCase().includes("json"));if(a===void 0)return!1;let s=u(a.schema,t.nextLink,n);if(s===void 0)return!1;let r=f(d(s),n);return(r?.kind==="scalar"||r?.kind==="enum")&&r.scalar==="string"}let i=t.style==="cursor"?t.cursorParam:t.offsetParam;return typeof i=="string"&&e.queryParams.some(a=>a.name===i)}function b(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("json"))?.schema}function R(e){return e.successResponses.find(t=>t.contentType.toLowerCase().includes("text/event-stream"))}function x(e){return e.requestBody?.contentType.toLowerCase().includes("multipart")??!1}function S(e){let t=e.requestBody?.schema.kind;return x(e)&&t!=="object"&&t!=="ref"}var $=["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 y(e){let t=e.split(";")[0].trim().toLowerCase();return $.some(n=>t.startsWith(n))}function P(e){let t=new Set(e.variables.map(r=>r.name)),n=[],i="",a=e.url,s=/\{([^{}]+)\}/;for(let r=s.exec(a);r!==null;r=s.exec(a))i+=a.slice(0,r.index),t.has(r[1])?(i!==""&&n.push({kind:"literal",value:i}),i="",n.push({kind:"variable",name:r[1]})):i+=r[0],a=a.slice(r.index+r[0].length);return i+=a,(i!==""||n.length===0)&&n.push({kind:"literal",value:i}),n}function T(e,t){return e.security.map(n=>n.flatMap(i=>{let a=t.securitySchemes.find(s=>s.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 C(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 g(e){return(e??"").replace(/\s+/g," ").trim().replace(/\\/g,"\\\\").replace(/\|/g,"\\|")}function c(e){switch(e.kind){case"ref":return e.name;case"omit":return e.base;case"scalar":return e.scalar;case"array":return`array of ${c(e.items)}`;case"record":return`map of ${c(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(c).join(" or ");case"intersection":return e.members.map(c).join(" and ");case"object":return"object";case"null":return"null";case"unknown":return"any"}}function N(e){return e.successResponses.some(t=>t.contentType.toLowerCase().includes("json"))?!1:e.successResponses.some(t=>y(t.contentType))}function w(e,t){e.line("| Parameter | In | Type | Required | Description |"),e.line("| --------- | -- | ---- | -------- | ----------- |");for(let n of t)e.line(`| \`${n.name}\` | ${n.in} | ${g(c(n.schema))} | ${n.required?"yes":"no"} | ${g(n.description)} |`);e.blank()}function B(e,t,n,i){e.line(`### \`${n.specName??n.name}\``),e.blank(),n.summary!==void 0&&(e.line(g(n.summary)),e.blank()),e.line(`\`${n.method.toUpperCase()} ${n.path}\``),e.blank();let a=i.sample(n);if(a!==void 0){e.line("```"+i.language.fence);for(let l of a.source.replace(/\n+$/,"").split(`
|
|
8
|
+
`))e.line(l);e.line("```"),e.blank()}let s=[...n.pathParams,...n.queryParams,...n.headerParams];s.length>0&&w(e,s),n.requestBody!==void 0&&e.line(`Body: \`${n.requestBody.contentType}\`${n.requestBody.required?", required":", optional"}, of type ${c(n.requestBody.schema)}.`);let r=n.successResponses[0];e.line(r===void 0?"Returns no content.":`Returns \`${r.contentType}\`, of type ${c(r.schema)}.`),(i.paginated!==void 0?i.paginated.has(n.name):m(n,i.pagination,t)!==void 0)&&e.line("This operation is paginated, so the SDK gives it page and item iterators."),n.successResponses.some(l=>l.contentType==="text/event-stream")&&e.line("This operation streams server-sent events, so the SDK iterates the events."),N(n)&&e.line("This operation returns binary content."),e.blank()}function E(e,t){let n=new p;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 s of e.securitySchemes){let r=s.kind==="bearer"?"`Authorization: Bearer <token>`":s.kind==="basic"?"`Authorization: Basic <base64>`":s.kind==="apiKeyHeader"?`the \`${s.headerName}\` header`:s.kind==="apiKeyQuery"?`the \`${s.paramName}\` query parameter`:`the \`${s.cookieName}\` cookie`;n.line(`| \`${s.key}\` | ${s.kind} | ${r} |`)}}n.blank();let i=e.services.flatMap(s=>s.operations),a=[...new Set(i.map(s=>s.tags[0]))];for(let s of a){n.line(s===void 0?"## Operations":`## ${s}`),n.blank();for(let r of i.filter(o=>o.tags[0]===s))B(n,e,r,t)}return n.toString().replace(/\n{3,}/g,`
|
|
9
|
+
|
|
10
|
+
`).trimEnd()+`
|
|
11
|
+
`}var ne=["Printer","casing","identifierFor","uniqueIdentifiers","RESERVED_WORDS","flattenAllOf","deref","discriminatorCases","jsonSuccessSchema","sseResponse","isMultipartBody","isUntypedMultipartBody","isBinaryContentType","serverUrlParts","securityRequirements","paginationItemSchema","isNullable","unwrapNullable","enumValues","docText","headerCoerceType","schemaAtPointer","paginationRuleFor","renderReferencePage","NotSupportedError"];function A(e){return e}function q(e){return e.toLowerCase().split(/[^a-z0-9]+/).filter(Boolean).join("-")}function j(e){return e.replace(/[^A-Za-z0-9]+/g,"_").replace(/([a-z0-9])([A-Z])/g,"$1_$2").toUpperCase()}function L(e,t){let n={...e};for(let[i,a]of Object.entries(t))a!==void 0&&(n[i]=a);return n}function ye(e){return e}async function be(e){return(await import("./7AWM5GPD.js")).generateClient(e)}export{m as a,b,R as c,x as d,S as e,y as f,P as g,T as h,C as i,E as j,ne as k,A as l,q as m,j as n,L as o,ye as p,be as q};
|
|
@@ -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"./J7J4PH3V.js";import"./NR3R4HFM.js";import"./BC3XCWQE.js";import"./7RQW6KPZ.js";import"./WZXA5XPB.js";import"./ACMV5RZA.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
|
-
var e={name:"@redocly/cli",version:"2.
|
|
7
|
+
var e={name:"@redocly/cli",version:"2.63.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.32.1","@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.7","@redocly/client-generator":"0.6.0","@redocly/openapi-core":"2.63.0","@redocly/recheck":"2.63.0","@redocly/respect-core":"2.63.0","@redocly/reunite-integration":"2.63.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.10",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:"^7.30.0",yargs:"17.0.1"}};var{version:c,name:i,engines:s}=e,n=e.devDependencies.redoc,p="sha384-w447zOpYfw/1Tv/5AK9NfHTlQIqE3RVR6KY62jCyy9zNDgO64cMwGGP1Fj0zJVf5";export{c as a,i as b,s as c,n as d,p as e};
|
|
@@ -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"./4JKMQCWY.js";import"./GKXY6U4S.js";import{ia as o}from"./ACMV5RZA.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,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{ia as t}from"./
|
|
7
|
+
import{ia as t}from"./ACMV5RZA.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,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 $,g as xt,h as et}from"./
|
|
7
|
+
import{a as $,g as xt,h as et}from"./A22GELRX.js";import{a as wt}from"./64G5RPLP.js";import{b as lt,f as ut,m as gt,n as ht,s as yt}from"./Q4UGLPO2.js";import{$ as D,V as Z,aa as G,b as N,ba as k,c as M,ca as v,d as it,g as at,i as U,ia as T,ka as tt,oa as w,qa as ft,r as E,va as ct,w as pt,wa as mt}from"./ACMV5RZA.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import*as Nt from"node:path";import{performance as jt}from"node:perf_hooks";import*as Ot from"node:path";function dt(t,e){xt(t,o=>{if(E(o)&&et(o.$ref)){let r=Ot.basename(o.$ref);o.$ref=o.$ref.replace(r,e+"_"+r)}else if(M(o.discriminator)&&M(o.discriminator.mapping)){let{mapping:r}=o.discriminator;for(let i of Object.keys(r)){let c=r[i];typeof c=="string"&&et(c)&&(r[i]=c.split("/").map((O,s,p)=>p.length-1===s&&!O.startsWith(e+"_")?e+"_"+O:O).join("/"))}}})}function j(t,e,o){if(!e)return"";if(!t)throw new w("Info section is not found in specification.");if(!t[e])throw new w(`${k(`prefix-${o}-with-info-prop`)} argument value is not found in info section.`);if(!at(t[e]))throw new w(`${k(`prefix-${o}-with-info-prop`)} argument value should be string.`);if(t[e].length>50)throw new w(`${k(`prefix-${o}-with-info-prop`)} argument value length should not exceed 50 characters.`);return t[e].replaceAll(/\s/g,"_")}function ot(t,e){return e?t?.map(o=>{let r={};for(let[i,c]of Object.entries(o))Object.assign(r,{[e+"_"+i]:c});return r}):t}function C(t,e){return e?e+"_"+t:t}import*as Pt from"node:path";function H(t,e){return t.replace(/"(#\/components\/.*?)"/g,o=>{let r=Pt.basename(o);return o.replace(r,C(r,e))})}function B(t){return t.map(e=>({name:e}))}import*as q from"node:path";function bt(t){return q.basename(t,q.extname(t))}function vt(t){return Object.entries(t).filter(([e,o])=>o.length>1)}function rt(t,e){for(let[o,r]of e)T.warn(`Conflict on ${t} : ${D(o)} in files: ${v(r)}
|
|
8
8
|
`)}function Tt(t){T.info(G(`
|
|
9
9
|
${t} conflict(s) on tags.
|
|
10
10
|
Suggestion: please use ${v("prefix-tags-with-filename")}, ${v("prefix-tags-with-info-prop")} or ${v("without-x-tag-groups")} to prevent naming conflicts.
|
|
@@ -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 A}from"./
|
|
7
|
+
import{a as A}from"./6WESXERF.js";import{a as F,b as O,c as k,d as g}from"./KMP5ZE2D.js";import{c as d,d as M}from"./3LGZAJES.js";import{$ as C,Z as y,aa as R,ba as $,ea as S,ia as s,oa as l,pa as b}from"./ACMV5RZA.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{mkdir as z,writeFile as J}from"node:fs/promises";import V from"node:path";var E=20;function D(e){return e.total===0?void 0:Math.floor(e.covered/e.total*100)}function H(e){return e===void 0?"n/a":`${e}%`}function B(e,o){let t=e===void 0?0:Math.floor(e/100*E),r=`${"\u2588".repeat(t)}${"\u2591".repeat(E-t)}`;return!o||e===void 0?r:e>=80?R(r):e>=50?$(r):C(r)}function I(e,o){let t=[["operations",e.totals.operations],["parameters",e.totals.parameters],["schema properties",e.totals.properties],["response codes",e.totals.responses]],r=Math.max(...t.map(([,i])=>`${i.covered}/${i.total}`.length)),n="API coverage",a=[o?y(S(n)):n];for(let[i,c]of t){let f=D(c);a.push(` ${i.padEnd(18)} ${B(f,o)} ${H(f).padStart(5)} ${`${c.covered}/${c.total}`.padStart(r+3)}`)}return`${a.join(`
|
|
8
8
|
`)}
|
|
9
9
|
`}function T(e,o){let t={version:1,meta:{...o,exchanges:e.exchanges},totals:e.totals,operations:e.operations};return`${JSON.stringify(t,null,2)}
|
|
10
10
|
`}async function P(e){let o=await M(e.trafficPath);if(o.length===0)throw new Error("No traffic files found in the provided traffic path.");let t=O.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,coverage:e.coverage}),r=0,n=0;for(let a of o){let i=await A(a,e.format);if(!i){s.warn(`Skipping traffic file with unrecognized format: ${a}
|
|
@@ -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 jc,b as Xr,c as Vc}from"./UF2ZCH7W.js";import{K as Ot,c as P,l as Zr,n as Ee,na as $t,ra as Qa,ta as Kt,u as Ft,va as Jt,wa as zt,ya as _t}from"./
|
|
7
|
+
import{a as jc,b as Xr,c as Vc}from"./UF2ZCH7W.js";import{K as Ot,c as P,l as Zr,n as Ee,na as $t,ra as Qa,ta as Kt,u as Ft,va as Jt,wa as zt,ya as _t}from"./ACMV5RZA.js";import{c as Q,e as re}from"./RFWIIJFG.js";var dn=Q((Ma,un)=>{"use strict";Object.defineProperty(Ma,"__esModule",{value:!0});Ma.outdent=void 0;function lr(){for(var e=[],a=0;a<arguments.length;a++)e[a]=arguments[a]}function Ei(){return typeof WeakMap<"u"?new WeakMap:Wu()}function Wu(){return{add:lr,delete:lr,get:lr,set:lr,has:function(e){return!1}}}var Gu=Object.prototype.hasOwnProperty,cn=function(e,a){return Gu.call(e,a)};function ln(e,a){for(var r in a)cn(a,r)&&(e[r]=a[r]);return e}var Iu=/^[ \t]*(?:\r\n|\r|\n)/,Fu=/(?:\r\n|\r|\n)[ \t]*$/,Ou=/^(?:[\r\n]|$)/,$u=/(?:\r\n|\r|\n)([ \t]*)(?:[^ \t\r\n]|$)/,Ku=/^[ \t]*[\r\n][ \t\r\n]*$/;function Li(e,a,r){var n=0,t=e[0].match($u);t&&(n=t[1].length);var i="(\\r\\n|\\r|\\n).{0,"+n+"}",o=new RegExp(i,"g");a&&(e=e.slice(1));var s=r.newline,c=r.trimLeadingNewline,h=r.trimTrailingNewline,p=typeof s=="string",m=e.length,k=e.map(function(S,B){return S=S.replace(o,"$1"),B===0&&c&&(S=S.replace(Iu,"")),B===m-1&&h&&(S=S.replace(Fu,"")),p&&(S=S.replace(/\r\n|\n|\r/g,function(M){return s})),S});return k}function Ju(e,a){for(var r="",n=0,t=e.length;n<t;n++)r+=e[n],n<t-1&&(r+=a[n]);return r}function zu(e){return cn(e,"raw")&&cn(e,"length")}function xi(e){var a=Ei(),r=Ei();function n(i){for(var o=[],s=1;s<arguments.length;s++)o[s-1]=arguments[s];if(zu(i)){var c=i,h=(o[0]===n||o[0]===we)&&Ku.test(c[0])&&Ou.test(c[1]),p=h?r:a,m=p.get(c);if(m||(m=Li(c,h,e),p.set(c,m)),o.length===0)return m[0];var k=Ju(m,h?o.slice(1):o);return k}else return xi(ln(ln({},e),i||{}))}var t=ln(n,{string:function(i){return Li([i],!1,e)[0]}});return t}var we=xi({trimLeadingNewline:!0,trimTrailingNewline:!0});Ma.outdent=we;Ma.default=we;if(typeof un<"u")try{un.exports=we,Object.defineProperty(we,"__esModule",{value:!0}),we.default=we,we.outdent=we}catch{}});var os=Q(Be=>{"use strict";Object.defineProperty(Be,"__esModule",{value:!0});var Zh="[",Xh="]",Qh="{",em="}",am=":",rm=",",es="true",as="false",rs="null",qo='"',nm=new Map([["t",es],["f",as],["n",rs]]),Wn=new Map([[qo,qo],["\\","\\"],["/","/"],["b","\b"],["n",`
|
|
8
8
|
`],["f","\f"],["r","\r"],["t"," "]]),Nn=new Map([[Zh,"Punctuator"],[Xh,"Punctuator"],[Qh,"Punctuator"],[em,"Punctuator"],[am,"Punctuator"],[rm,"Punctuator"],[es,"Boolean"],[as,"Boolean"],[rs,"Null"]]),qe=class extends Error{constructor(a,{line:r,column:n,index:t}){super(`${a} (${r}:${n})`),this.line=r,this.column=n,this.index=t}},Gn=class extends qe{constructor(a,r){super(`Unexpected character ${a} found.`,r)}},da=class extends qe{constructor(a){super(`Unexpected token ${a.type}(${a.value}) found.`,a.loc.start)}},In=class extends qe{constructor(a){super("Unexpected end of input found.",a)}},Zo='"',Xo="/",Qo="*",tm={comments:!1,ranges:!1};function im(e){return/[\s\n]/.test(e)}function Ge(e){return e>="0"&&e<="9"}function om(e){return Ge(e)||/[a-f]/i.test(e)}function sm(e){return e>="1"&&e<="9"}function lm(e){return/[tfn]/.test(e)}function cm(e){return Ge(e)||e==="."||e==="-"}function ns(e,a){a=Object.freeze({...tm,...a});let r=-1,n=1,t=0,i=!1,o=[];function s(b,g,A,w){let T=A.offset+g.length,_=a.ranges?{range:[A.offset,T]}:void 0;return{type:b,value:g,loc:{start:A,end:w||{line:A.line,column:A.column+g.length,offset:T}},..._}}function c(){let b=e.charAt(++r);return i?(n++,t=1,i=!1):t++,b==="\r"?(i=!0,e.charAt(r+1)===`
|
|
9
9
|
`&&r++):b===`
|
|
10
10
|
`&&(i=!0),b}function h(){return{line:n,column:t,offset:r}}function p(b){let g=nm.get(b);if(e.slice(r,r+g.length)===g)return r+=g.length-1,t+=g.length-1,{value:g,c:c()};for(let A=1;A<g.length;A++)g[A]!==e.charAt(r+A)&&B(c())}function m(b){let g=b;for(b=c();b&&b!==Zo;){if(b==="\\")if(g+=b,b=c(),Wn.has(b))g+=b;else if(b==="u"){g+=b;for(let A=0;A<4;A++)b=c(),om(b)?g+=b:B(b)}else B(b);else g+=b;b=c()}return b||M(),g+=b,{value:g,c:c()}}function k(b){let g="";if(b==="-"&&(g+=b,b=c(),Ge(b)||B(b)),b==="0")g+=b,b=c(),Ge(b)&&B(b);else{sm(b)||B(b);do g+=b,b=c();while(Ge(b))}if(b===".")do g+=b,b=c();while(Ge(b));if(b==="e"||b==="E")for(g+=b,b=c(),(b==="+"||b==="-")&&(g+=b,b=c()),Ge(b)||B(b);Ge(b);)g+=b,b=c();return{value:g,c:b}}function S(b){let g=b;if(b=c(),b==="/"){do g+=b,b=c();while(b&&b!=="\r"&&b!==`
|
|
@@ -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 P,b as y,c as $}from"./
|
|
7
|
+
import{a as P,b as y,c as $}from"./CQMZF72H.js";import{ia as h,za as x}from"./ACMV5RZA.js";function N(t){let e=t.trim(),n=e.match(/^```(?:ya?ml|json)?\s*\n([\s\S]*?)\n```$/);return n?n[1]:e}async function O(t,e){let r=(await x({source:t,config:e})).filter(o=>o.severity==="error");if(r.length>0){let o=r.slice(0,5).map(s=>`${s.ruleId}: ${s.message}`).join("; ");throw new Error(`the result has ${r.length} validation problem(s): ${o}`)}}import{spawn as T}from"node:child_process";import{mkdtemp as v}from"node:fs/promises";import{tmpdir as R}from"node:os";import S from"node:path";var I=3e5,a=class extends Error{},C;function L(){return C??=v(S.join(R(),"redocly-ai-")),C}async function w(t,e,n,r){let o=await L();return new Promise((s,u)=>{let i=T(t,e,{stdio:["pipe","pipe","pipe"],cwd:o,env:{...process.env,...r}}),l="",f="",g=!1,d=setTimeout(()=>{g=!0,i.kill("SIGKILL")},I);i.stdout.on("data",c=>{l+=c.toString()}),i.stderr.on("data",c=>{f+=c.toString()}),i.on("error",c=>{if(clearTimeout(d),c.code==="ENOENT"){u(new a(`Could not find the "${t}" CLI on PATH. Is it installed?`));return}u(c)}),i.on("close",c=>{if(clearTimeout(d),g){u(new Error(`The "${t}" CLI did not respond within ${I/1e3} seconds.`));return}s({stdout:l,stderr:f,code:c})}),i.stdin.on("error",()=>{}),i.stdin.end(n)})}async function A(t){let e=["-p","--output-format","text","--tools","","--strict-mcp-config","--setting-sources","","--no-session-persistence","--append-system-prompt",t.system];t.model&&e.push("--model",t.model);let{stdout:n,stderr:r,code:o}=await w("claude",e,t.user,{CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC:"1"});if(o!==0)throw new Error(`claude CLI exited with code ${o}: ${r.trim()||n.trim()}`);if(!n.trim())throw new Error("claude CLI returned no output.");return{text:n}}async function b(t){let e=["exec","--skip-git-repo-check","--sandbox","read-only","-c","mcp_servers={}","-c","project_doc_max_bytes=0"];t.model&&e.push("--model",t.model),e.push("-");let n=`${t.system}
|
|
8
8
|
|
|
9
9
|
${t.user}`,{stdout:r,stderr:o,code:s}=await w("codex",e,n);if(s!==0)throw new Error(`codex CLI exited with code ${s}: ${o.trim()||r.trim()}`);if(!r.trim())throw new Error("codex CLI returned no output.");return{text:r}}async function _(t){let e=["-p","--output-format","text","--trust"];t.model&&e.push("--model",t.model);let n=`${t.system}
|
|
10
10
|
|
|
@@ -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 ee,b as te,f as ne,g as E,h as re}from"./
|
|
7
|
+
import{a as ee,b as te,f as ne,g as E,h as re}from"./7RQW6KPZ.js";import{a as y}from"./WZXA5XPB.js";import{Aa as Z,P as W,V,c as x,ia as b,ka as Q,r as v,ra as Y,s as H,ta as T,u as J}from"./ACMV5RZA.js";import{b as A,c as G,k as D}from"./LD5MEXEL.js";import{mkdir as ct,readFile as ut,writeFile as dt}from"node:fs/promises";import{dirname as ke,parse as ft,resolve as R,sep as pt}from"node:path";function M(e){return{requires:["typescript"],errorModes:["throw"],load:()=>import("./IYKYAJDC.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("./HTG3RKCV.js").then(e=>({run:e.typescriptGenerator,sample:e.typescriptSample,docs:e.typescriptDocs}))},zod:{load:()=>import("./HW7ZCN7J.js").then(e=>({run:e.zodGenerator}))},transformers:{requires:["typescript"],dateTypes:["Date"],load:()=>import("./IULINGO6.js").then(e=>({run:e.transformersGenerator}))},"tanstack-query":M("react"),"tanstack-query-vue":M("vue"),"tanstack-query-svelte":M("svelte"),"tanstack-query-solid":M("solid"),swr:{requires:["typescript"],errorModes:["throw"],load:()=>import("./5VDBZVBF.js").then(e=>({run:e.swrGenerator}))},mock:{requires:["typescript"],load:()=>import("./J373CXCH.js").then(e=>({run:e.mockGenerator}))},cli:{requires:["typescript","zod"],errorModes:["throw"],load:()=>import("./FCZH3476.js").then(e=>({run:e.cliGenerator,sample:e.cliSample,docs:e.cliDocs}))},python:{notApplicable:U,load:()=>import("./ZP54RCIQ.js").then(e=>({run:e.pythonGenerator,sample:e.pythonSample,docs:e.pythonDocs,options:e.pythonOptions}))},go:{errorModes:["throw"],notApplicable:U,load:()=>import("./BFIZTFWS.js").then(e=>({run:e.goGenerator,sample:e.goSample,docs:e.goDocs}))},php:{errorModes:["throw"],notApplicable:U,load:()=>import("./WV2NAII3.js").then(e=>({run:e.phpGenerator,sample:e.phpSample,docs:e.phpDocs}))}};function oe(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(m=>`--generator ${m}`).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 se(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,ve(s,o,i))}return r}function ve(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=Se(a,o[i]);if(c!==void 0)throw new y(`The "${e}" generator's "${i}" ${c}.`)}return o}function Se(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 xe,resolve as qe}from"node:path";import{pathToFileURL as Pe}from"node:url";var Oe=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 ae(e,t={}){let n=new Map;for(let a of t.customGenerators??[])ce(n,a);let r=[];for(let a of e)r.push(await ie(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 ie(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 ie(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 je(e,n??process.cwd());return ce(t,s),s.name}function ce(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=re(E,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 ${E}. 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.
|
|
@@ -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{b as a,c as b,d as c}from"./
|
|
7
|
+
import{b as a,c as b,d as c}from"./JGBWIR5U.js";import"./NR3R4HFM.js";import"./OYUXHAGQ.js";import"./5IIJHGNO.js";import"./BC3XCWQE.js";import"./7RQW6KPZ.js";import"./WZXA5XPB.js";import"./ACMV5RZA.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{b as cliDocs,a as cliGenerator,c as cliSample};
|
|
@@ -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{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"./5IIJHGNO.js";import{h as b,j as T}from"./BC3XCWQE.js";import{a as f,c as R,d as v,e as k}from"./7RQW6KPZ.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(`
|