@redocly/cli 2.66.1 → 2.67.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/chunks/{7NPQH3V7.js → 3HSHTOK2.js} +1 -1
- package/lib/chunks/{F7K3O6UM.js → 3SPC2VZI.js} +1 -1
- package/lib/chunks/{SDGM5YBT.js → 3TA4HFKR.js} +1 -1
- package/lib/chunks/{GLUPJCQU.js → 3YAJYKXK.js} +52 -52
- package/lib/chunks/{AONBK2JI.js → 46IZNQXT.js} +1 -1
- package/lib/chunks/{K4IZRPJV.js → 4JI4GT6B.js} +35 -35
- package/lib/chunks/{CVCE3TMJ.js → 4TRNMV5F.js} +1 -1
- package/lib/chunks/{ARBQ5CUR.js → 5TURUALC.js} +1 -1
- package/lib/chunks/{RO4A6LSK.js → 5ZI53QB3.js} +1 -1
- package/lib/chunks/{CK2FG2DD.js → 6BJRKKAU.js} +1 -1
- package/lib/chunks/{VAPT4FUS.js → 6VOUSPJC.js} +1 -1
- package/lib/chunks/{LR6VKQFM.js → 76YF3WE6.js} +2 -2
- package/lib/chunks/{4ABWBH3W.js → AENSGZDZ.js} +1 -1
- package/lib/chunks/{JZV7OYQZ.js → AXLAA4G3.js} +1 -1
- package/lib/chunks/{B4Z2Z4FS.js → BUQQJCMF.js} +1 -1
- package/lib/chunks/{U7SJFXVW.js → BVOC7J5D.js} +1 -1
- package/lib/chunks/{TLDUEX6A.js → BYO4KBZG.js} +1 -1
- package/lib/chunks/{LJTGHAPA.js → DQZXJA6Q.js} +1 -1
- package/lib/chunks/{LSFJCPZH.js → EPVPJTXN.js} +1 -1
- package/lib/chunks/{LIDTATJI.js → F5KYXJ4D.js} +1 -1
- package/lib/chunks/{TOBKCE6P.js → F77DQGVI.js} +1 -1
- package/lib/chunks/{NUBOB7QM.js → FB5G4265.js} +2 -2
- package/lib/chunks/{IVWO724G.js → FHCO7BAY.js} +1 -1
- package/lib/chunks/{JFWECYV5.js → FP5Y23ZO.js} +1 -1
- package/lib/chunks/{RALPAYEE.js → GP5VOB7R.js} +1 -1
- package/lib/chunks/{STYLK3WI.js → GPQL6QQF.js} +1 -1
- package/lib/chunks/{L3SH4LDY.js → H3CWVIT3.js} +1 -1
- package/lib/chunks/{ON2YZD5C.js → HET452FN.js} +1 -1
- package/lib/chunks/{HXPCC4OG.js → HG5B2AKP.js} +1 -1
- package/lib/chunks/{POIQ4MUQ.js → ICPHPZSW.js} +1 -1
- package/lib/chunks/{IAAYM25M.js → IHFKHD4E.js} +1 -1
- package/lib/chunks/{UJN4HIWM.js → IUNK2H6J.js} +1 -1
- package/lib/chunks/{OYDBXGWA.js → IZVG6IUS.js} +1 -1
- package/lib/chunks/{6KF4UNVM.js → KA43H34P.js} +1 -1
- package/lib/chunks/{KTZA5BVG.js → KLQ5NXSC.js} +1 -1
- package/lib/chunks/{JGSM4NRA.js → KMGFC2JR.js} +1 -1
- package/lib/chunks/{QMIJ4HMG.js → KZAJGPZF.js} +1 -1
- package/lib/chunks/{M37DUXGN.js → LEHWOEMH.js} +1 -1
- package/lib/chunks/{5EHUKG3I.js → LEPQDSTM.js} +1 -1
- package/lib/chunks/{PYSE2LAG.js → LFULTEM7.js} +1 -1
- package/lib/chunks/{UYF7BOSD.js → LZUYKJND.js} +1 -1
- package/lib/chunks/{PGX27JIK.js → M5FZMXND.js} +1 -1
- package/lib/chunks/{NHOPECWM.js → MLLRCWW6.js} +1 -1
- package/lib/chunks/{FOXOWXSK.js → OKWRNBEY.js} +1 -1
- package/lib/chunks/{6JHVGOS4.js → PNADRNVV.js} +1 -1
- package/lib/chunks/{NFCO7FU3.js → QPNNEO3Y.js} +1 -1
- package/lib/chunks/{FP63LRP5.js → QT45SNBU.js} +1 -1
- package/lib/chunks/{46YO7ZAG.js → RIJ5NQKJ.js} +1 -1
- package/lib/chunks/{ULKOLYWY.js → RJDVI7E2.js} +1 -1
- package/lib/chunks/{R5MSEDNK.js → TLFGTILI.js} +1 -1
- package/lib/chunks/{WFZEGGBA.js → TSAU4XGW.js} +1 -1
- package/lib/chunks/{KOEA2NZG.js → UEZU37HN.js} +2 -2
- package/lib/chunks/{DRSH6QBU.js → UNWO4KGQ.js} +1 -1
- package/lib/chunks/{YY44N7JX.js → VEVZJC25.js} +1 -1
- package/lib/chunks/{NT6J6VMM.js → VIRXKNH3.js} +1 -1
- package/lib/chunks/{FHDBQIEB.js → WFKHK77N.js} +1 -1
- package/lib/chunks/{ZSK75GT2.js → WFVFBVFX.js} +1 -1
- package/lib/chunks/{36DQZK3T.js → WH5ELPJC.js} +1 -1
- package/lib/chunks/{YCJL4ZHF.js → WJLUIDSE.js} +1 -1
- package/lib/chunks/{FXCLUZIF.js → WO2YS6JS.js} +13 -13
- package/lib/chunks/{GG6HRP6Y.js → WSGGRTNA.js} +1 -1
- package/lib/chunks/{TPBJSMIK.js → X3HIEVZ4.js} +1 -1
- package/lib/chunks/{M3VAMERP.js → XZIAEGVZ.js} +1 -1
- package/lib/chunks/{JZPKVDJA.js → XZNJU67S.js} +1 -1
- package/lib/chunks/{T23ZPTN4.js → Y3K7R2D5.js} +1 -1
- package/lib/chunks/{AZPQQ3GI.js → YAYCIIIB.js} +1 -1
- package/lib/chunks/{OMDMN4SS.js → YQYR6TIT.js} +1 -1
- package/lib/chunks/{USAJ5FBD.js → ZMV5LF7Y.js} +1 -1
- package/lib/chunks/ZWMTCZ4P.js +34 -0
- package/lib/chunks/{ROLEKKAB.js → ZYVAFW6F.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 +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 +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/index.js +5 -5
- package/package.json +1 -1
- package/lib/chunks/MSJZTIMR.js +0 -34
|
@@ -4,16 +4,16 @@ 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"./
|
|
8
|
-
`),t.telemetry==="on"&&!
|
|
9
|
-
`);let
|
|
10
|
-
`)}}function se(e,t,n){let r=new Map;for(let
|
|
11
|
-
`),r.set(
|
|
12
|
-
`),e.set(t.name,{run:t.run,sample:t.sample,docs:t.docs,notApplicable:t.notApplicable,options:t.options,requires:t.requires,errorModes:t.errorModes,dateTypes:t.dateTypes})}async function je(e,t){if(J(e))throw new y(`Remote generator modules are not supported \u2014 use a local path or a package name. Got: ${e}`);let n=e.startsWith(".")||xe(e),r=n?Pe(qe(t,e)).href:e;if(n&&e.endsWith(".ts")&&!process.features.typescript)throw new y(`Generator "${e}" is TypeScript, which this Node cannot run directly \u2014 use Node 22.18, 23.6, or newer.`);let
|
|
13
|
-
`)}function de(e,t){return t.has(e)?{kind:"reserved"}:{kind:"unusable"}}function $(e,t){switch(e.kind){case"ref":e.name=t(e.name);break;case"omit":e.base=t(e.base);break;case"array":$(e.items,t);break;case"record":$(e.value,t);break;case"object":for(let n of e.properties)$(n.schema,t);break;case"union":for(let n of e.members)$(n,t);if(e.discriminator)for(let n of e.discriminator.mapping)n.schemaName=t(n.schemaName);break;case"intersection":for(let n of e.members)$(n,t);break}}function Ne(e,t){for(let n of e.pathParams)$(n.schema,t);for(let n of e.queryParams)$(n.schema,t);for(let n of e.headerParams)$(n.schema,t);for(let n of e.cookieParams)$(n.schema,t);e.requestBody&&$(e.requestBody.schema,t);for(let n of[...e.successResponses,...e.errorResponses])$(n.schema,t),n.itemSchema&&$(n.itemSchema,t)}var Ae=["get","post","put","delete","patch","head","options"];function me(e,t){if(!t.startsWith("#/"))throw new y(`External $ref not supported: ${t}`);let n=t.slice(2).split("/").map(
|
|
14
|
-
`),n.push({kind:"apiKeyCookie",key:r,cookieName:
|
|
15
|
-
`);let u=c&&(
|
|
16
|
-
`);throw new Error(`The API description has ${
|
|
17
|
-
${
|
|
18
|
-
`),n}function ht(e){for(let t of e.services)for(let n of t.operations){let r=new Set,
|
|
19
|
-
`)}}function yt(e,t,n,r,s,
|
|
7
|
+
import{a as ee,b as te,f as ne,g as E,h as re}from"./76YF3WE6.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 S,ra as Y,s as H,ta as T,u as J}from"./4JI4GT6B.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("./3TA4HFKR.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("./Y3K7R2D5.js").then(e=>({run:e.typescriptGenerator,sample:e.typescriptSample,docs:e.typescriptDocs}))},zod:{load:()=>import("./5TURUALC.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("./F5KYXJ4D.js").then(e=>({run:e.swrGenerator}))},mock:{requires:["typescript"],load:()=>import("./VIRXKNH3.js").then(e=>({run:e.mockGenerator}))},cli:{requires:["typescript","zod"],errorModes:["throw"],load:()=>import("./4TRNMV5F.js").then(e=>({run:e.cliGenerator,sample:e.cliSample,docs:e.cliDocs}))},python:{notApplicable:U,load:()=>import("./TLFGTILI.js").then(e=>({run:e.pythonGenerator,sample:e.pythonSample,docs:e.pythonDocs,options:e.pythonOptions}))},go:{errorModes:["throw"],notApplicable:U,load:()=>import("./TSAU4XGW.js").then(e=>({run:e.goGenerator,sample:e.goSample,docs:e.goDocs}))},php:{errorModes:["throw"],notApplicable:U,load:()=>import("./X3HIEVZ4.js").then(e=>({run:e.phpGenerator,sample:e.phpSample,docs:e.phpDocs}))}};function oe(e,t,n,r){let o=new Set(e);t.goPackage!==void 0&&!o.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
|
+
`),t.telemetry==="on"&&!o.has("typescript")&&b.warn(`generate-client: telemetry is ignored \u2014 the typescript generator writes the telemetry module, and it is not selected (add --generator typescript).
|
|
9
|
+
`);let s=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(!o.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(s))throw new y(`The "${a}" generator does not support --error-mode "${s}" (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}.
|
|
10
|
+
`)}}function se(e,t,n){let r=new Map;for(let o of e){let s=t.get(o)?.options,i=n?.[o];if(s===void 0){i!==void 0&&b.warn(`generate-client: the "${o}" generator declares no options, so client.options.${o} is ignored.
|
|
11
|
+
`),r.set(o,{});continue}r.set(o,Se(o,s,i))}return r}function Se(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??{},o=Object.keys(t.properties);if(t.additionalProperties!==!0){for(let i of Object.keys(r))if(!o.includes(i))throw new y(`The "${e}" generator got an unknown option "${i}". Declared options: ${o.join(", ")||"(none)"}.`)}for(let i of t.required??[])if(r[i]===void 0)throw new y(`The "${e}" generator requires the "${i}" option.`);let s={...r};for(let[i,a]of Object.entries(t.properties)){if(s[i]===void 0){a.default!==void 0&&(s[i]=a.default);continue}let c=ve(a,s[i]);if(c!==void 0)throw new y(`The "${e}" generator's "${i}" ${c}.`)}return s}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 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,o,s,i){return r?t?".jsx":".js":o&&(!s||!i)?n:o+s+"."+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 o=[],s=new Set,i=async a=>{if(!(o.includes(a)||s.has(a))){s.add(a);for(let c of n.get(a).requires??[])(n.has(c)||c in I)&&await i(await ie(c,n,t.configDir));s.delete(a),o.push(a)}};for(let a of r)await i(a);return{selected:o,registry:n}}async function ie(e,t,n){if(t.has(e))return e;let r=I[e];if(r!==void 0){let{load:s,...i}=r;return t.set(e,{...i,...await s()}),e}if(e==="sdk")throw new y('The "sdk" generator is now named "typescript". Update the `generators` list or the --generator flag.');let o=await je(e,n??process.cwd());return ce(t,o),o.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.
|
|
12
|
+
`),e.set(t.name,{run:t.run,sample:t.sample,docs:t.docs,notApplicable:t.notApplicable,options:t.options,requires:t.requires,errorModes:t.errorModes,dateTypes:t.dateTypes})}async function je(e,t){if(J(e))throw new y(`Remote generator modules are not supported \u2014 use a local path or a package name. Got: ${e}`);let n=e.startsWith(".")||xe(e),r=n?Pe(qe(t,e)).href:e;if(n&&e.endsWith(".ts")&&!process.features.typescript)throw new y(`Generator "${e}" is TypeScript, which this Node cannot run directly \u2014 use Node 22.18, 23.6, or newer.`);let o;try{o=await import(Oe(r))}catch(i){throw new y(`Could not load generator "${e}": ${i.message}`)}let s=o.default??o.generator;if(s===void 0)throw new y(`Generator module "${e}" must export a generator (a default export or a \`generator\` export built with \`defineGenerator\`).`);return s}function fe(e){let t=new Set,n=new Set,r=new Map;for(let l of e.securitySchemes){let h=C(l.key,t,n);h!==l.key&&(r.set(l.key,h),L("security scheme",l.key,h,de(l.key,t)),l.key=h)}let o=new Set(ne()),s=new Set(o),i=new Set,a=new Map;for(let l of e.schemas){let h=C(l.name,s,i);h!==l.name&&(a.set(l.name,h),L("schema",l.name,h,de(l.name,o)),l.name=h)}let c=l=>a.get(l)??ue(l),u=l=>r.get(l)??ue(l);for(let l of e.schemas)$(l.schema,c);let d=new Set(s),f=new Set,m=new Set;for(let l of e.services)for(let h of l.operations){let p=m.has(h.name);m.add(h.name);let g=h.name,P=C(h.name,d,f);if(P!==h.name){let j=p?{kind:"duplicate-operation-id"}:o.has(g)?{kind:"reserved"}:s.has(g)?{kind:"schema-collision"}:{kind:"unusable"};L("operation",g,P,j),h.specName=h.name,h.name=P}Ne(h,c),h.security=h.security.map(j=>j.map(u))}}function C(e,t,n){let r=G(e),o=r,s=2;for(;t.has(o)||n.has(D(o));)o=`${r}_${s++}`;return t.add(o),n.add(D(o)),o}function pe(e){for(let t of e.schemas)if(!A(t.name))throw B("schema",t.name);for(let t of e.securitySchemes)if(!A(t.key))throw B("security scheme",t.key);for(let t of e.services)for(let n of t.operations)if(!A(n.name))throw B("operation",n.name)}function B(e,t){return new Error(`Internal error: ${e} name ${JSON.stringify(t)} is not a safe identifier after sanitization.`)}function ue(e){return G(e)}function L(e,t,n,r){let o=JSON.stringify(t),s=JSON.stringify(n),i=r.kind==="duplicate-operation-id"?`two operations share the operationId ${o}; the second is emitted as ${s} \u2014 give each operation a unique operationId to control its method name`:r.kind==="schema-collision"?`${e} ${o} collides with the schema of the same name, so it is emitted as ${s} \u2014 rename the operation or the schema in the description to control its name`:r.kind==="reserved"?`${e} ${o} is a name a generated client already declares, so it is emitted as ${s} \u2014 the reserved set spans every target language, so one schema keeps one name across the SDKs you generate`:`${e} ${o} is not a usable identifier, so it is emitted as ${s}`;b.warn(`generate-client: ${i}.
|
|
13
|
+
`)}function de(e,t){return t.has(e)?{kind:"reserved"}:{kind:"unusable"}}function $(e,t){switch(e.kind){case"ref":e.name=t(e.name);break;case"omit":e.base=t(e.base);break;case"array":$(e.items,t);break;case"record":$(e.value,t);break;case"object":for(let n of e.properties)$(n.schema,t);break;case"union":for(let n of e.members)$(n,t);if(e.discriminator)for(let n of e.discriminator.mapping)n.schemaName=t(n.schemaName);break;case"intersection":for(let n of e.members)$(n,t);break}}function Ne(e,t){for(let n of e.pathParams)$(n.schema,t);for(let n of e.queryParams)$(n.schema,t);for(let n of e.headerParams)$(n.schema,t);for(let n of e.cookieParams)$(n.schema,t);e.requestBody&&$(e.requestBody.schema,t);for(let n of[...e.successResponses,...e.errorResponses])$(n.schema,t),n.itemSchema&&$(n.itemSchema,t)}var Ae=["get","post","put","delete","patch","head","options"];function me(e,t){if(!t.startsWith("#/"))throw new y(`External $ref not supported: ${t}`);let n=t.slice(2).split("/").map(o=>o.replace(/~1/g,"/").replace(/~0/g,"~")),r=e;for(let o of n){if(!x(r)&&!Array.isArray(r))throw new y(`Cannot resolve $ref: ${t}`);r=r[o]}if(r===void 0)throw new y(`Cannot resolve $ref: ${t}`);return r}function v(e,t){return S(t)?me(e,t.$ref):t}function N(e){let t=e.lastIndexOf("/");return t>=0?e.slice(t+1):e}function Me(e){let t=e,n={};return typeof t.minimum=="number"&&(n.minimum=t.minimum),typeof t.maximum=="number"&&(n.maximum=t.maximum),typeof t.exclusiveMinimum=="number"?n.exclusiveMinimum=t.exclusiveMinimum:t.exclusiveMinimum===!0&&typeof t.minimum=="number"&&(n.exclusiveMinimum=t.minimum,delete n.minimum),typeof t.exclusiveMaximum=="number"?n.exclusiveMaximum=t.exclusiveMaximum:t.exclusiveMaximum===!0&&typeof t.maximum=="number"&&(n.exclusiveMaximum=t.maximum,delete n.maximum),typeof t.minLength=="number"&&(n.minLength=t.minLength),typeof t.maxLength=="number"&&(n.maxLength=t.maxLength),typeof t.pattern=="string"&&(n.pattern=t.pattern),typeof t.minItems=="number"&&(n.minItems=t.minItems),typeof t.maxItems=="number"&&(n.maxItems=t.maxItems),t.uniqueItems===!0&&(n.uniqueItems=!0),typeof t.format=="string"&&(n.format=t.format),t.deprecated===!0&&(n.deprecated=!0),t.example!==void 0?n.example=t.example:Array.isArray(t.examples)&&t.examples.length>0&&(n.example=t.examples[0]),t.default!==void 0&&(n.default=t.default),Object.keys(n).length>0?n:void 0}function Ie(e,t){let n=e.discriminator;if(!n||typeof n.propertyName!="string")return;let r=[];if(n.mapping)for(let[o,s]of Object.entries(n.mapping))r.push({value:o,schemaName:N(s)});else for(let o of t)if(S(o)){let s=N(o.$ref);r.push({value:s,schemaName:s})}if(r.length!==0)return{propertyName:n.propertyName,mapping:r}}function k(e,t){return t?{...e,metadata:t}:e}function z(e,t){return e?t?{...e,...t}:e:t}function Re(e){return e?e.url.replace(/\{([^{}]+)\}/g,(t,n)=>e.variables?.[n]?.default??t):""}function he(e){let t=e.info?.title??"Api",n=e.info?.version??"0.0.0",r=e.info?.description,o=Re(e.servers?.[0]),s=(e.servers??[]).map(d=>({url:d.url,description:d.description,variables:Object.entries(d.variables??{}).map(([f,m])=>({name:f,default:m.default,description:m.description}))})),i=Be(e),a=Ue(e),c=Le(e,a),u={title:t,version:n,description:r,serverUrl:o,servers:s,services:c,schemas:i,securitySchemes:a};return fe(u),Te(c,i),pe(u),u}function Te(e,t){let n=new Map(t.map(r=>[r.name,r.schema]));for(let r of e)for(let o of r.operations)o.requestBody&&(o.requestBody.schema=Ge(o.requestBody.schema,n))}function Ee(e){let t=e.filter(n=>n.kind!=="unknown");return t.length>0?t:[{kind:"unknown"}]}function Ge(e,t){if(e.kind==="ref"){let n=De(e,t,new Set);return n.length>0?{kind:"omit",base:e.name,keys:n}:e}if(e.kind==="object"){let n=e.properties.filter(r=>!r.readOnly);return n.length===e.properties.length?e:{...e,properties:n}}return e}function De(e,t,n){let r=[],o=s=>{if(s.kind==="ref"){if(n.has(s.name))return;n.add(s.name);let i=t.get(s.name);i&&o(i)}else if(s.kind==="object")for(let i of s.properties)i.readOnly&&!r.includes(i.name)&&r.push(i.name);else if(s.kind==="intersection")for(let i of s.members)o(i)};return o(e),r}function Ue(e){let t=e.components?.securitySchemes;if(!t)return[];let n=[];for(let[r,o]of Object.entries(t)){let s=v(e,o),i=s.type;i==="oauth2"||i==="openIdConnect"?n.push({kind:"bearer",key:r}):i==="http"&&(s.scheme??"").toLowerCase()==="bearer"?n.push({kind:"bearer",key:r}):i==="http"&&(s.scheme??"").toLowerCase()==="basic"?n.push({kind:"basic",key:r}):i==="apiKey"&&s.in==="header"&&typeof s.name=="string"?n.push({kind:"apiKeyHeader",key:r,headerName:s.name}):i==="apiKey"&&s.in==="query"&&typeof s.name=="string"?n.push({kind:"apiKeyQuery",key:r,paramName:s.name}):i==="apiKey"&&s.in==="cookie"&&typeof s.name=="string"&&(b.warn(`generate-client: security scheme "${r}" sends its credential in the Cookie header, which browsers ignore \u2014 cookie auth works only in server-side clients.
|
|
14
|
+
`),n.push({kind:"apiKeyCookie",key:r,cookieName:s.name}))}return n}function Ce(e,t,n){let r=e.security??t.security;if(!r)return[];let o=[];for(let s of r){let i=Object.keys(s);i.length!==0&&i.every(a=>n.has(a))&&o.push([...new Set(i)])}return o}function Be(e){let t=e.components?.schemas;return t?Object.entries(t).map(([n,r])=>{if(S(r)){let s=me(e,r.$ref);return{name:n,schema:q(s,`components.schemas.${n}`,e),description:s.description}}let o=q(r,`components.schemas.${n}`,e);return{name:n,schema:o,description:r.description}}):[]}function Le(e,t){let n=new Set(t.map(i=>i.key)),r=[],o=new Set;for(let[i,a]of Object.entries(e.paths??{})){if(!a)continue;let c=v(e,a),u=(c.parameters??[]).map(d=>ye(v(e,d),`paths.${i}.parameters`,e));for(let d of Ae){let f=c[d];f&&(r.push({method:d,path:i,operation:f,pathLevelParams:u}),f.operationId&&o.add(f.operationId))}}return[{name:"Default",operations:r.map(i=>{let a=i.operation.operationId??_e(ze(i.method,i.path),o);return Fe(i.method,i.path,i.operation,a,i.pathLevelParams,e,n)})}]}function ze(e,t){let n=t.split("/").filter(Boolean).map(r=>Ke(r.replace(/[{}]/g,"")));return`${e}${n.join("")}`}function Ke(e){return e.split(/[^A-Za-z0-9]+/).filter(Boolean).map(t=>t[0].toUpperCase()+t.slice(1)).join("")}function _e(e,t){let n=e,r=2;for(;t.has(n);)n=`${e}${r++}`;return t.add(n),n}function Fe(e,t,n,r,o,s,i){let a=(n.parameters??[]).map(w=>ye(v(s,w),`paths.${t}.${e}.parameters`,s)),c=new Set,u=[];for(let w of a)c.add(`${w.in}:${w.name}`),u.push(w);for(let w of o)c.has(`${w.in}:${w.name}`)||u.push(w);let d=u.filter(w=>w.in==="path"),f=u.filter(w=>w.in==="query"),m=u.filter(w=>w.in==="header"),l=u.filter(w=>w.in==="cookie"),h=n.requestBody?He(v(s,n.requestBody),`${e} ${t}`,s):void 0,{successResponses:p,successResponseHeaders:g}=Je(n,t,s),P=Ve(n,t,s),j=Ce(n,s,i),F=n["x-redoclyPagination"],X=Xe(p);return{name:r,method:e,path:t,summary:n.summary,description:n.description,pathParams:d,queryParams:f,headerParams:m,cookieParams:l,requestBody:h,successResponses:p,...g===void 0?{}:{successResponseHeaders:g},errorResponses:P,security:j,tags:Array.isArray(n.tags)?n.tags.filter(w=>typeof w=="string"):[],...F!==void 0?{paginationExtension:F}:{},...X===void 0?{}:{sse:X}}}function Xe(e){let t=e.find(o=>o.contentType.split(";")[0].trim().toLowerCase()==="text/event-stream");if(t===void 0)return;let n=t.itemSchema&&t.itemSchema.kind!=="unknown"?t.itemSchema:t.schema.kind!=="unknown"?t.schema:void 0;if(n===void 0)return{dataKind:"text"};let r=n.kind==="object"||n.kind==="ref"||n.kind==="array"||n.kind==="record"||n.kind==="union"||n.kind==="intersection";return{eventSchema:n,dataKind:r?"json":"text"}}function ye(e,t,n){if(!e.in)throw new y(`Parameter ${e.name} at ${t} is missing "in"`);if(!["path","query","header","cookie"].includes(e.in))throw new y(`Unsupported parameter location "${e.in}" for ${e.name} at ${t}`);let r=O(e.schema,`${t}.${e.name}`,n);e.deprecated===!0&&(r={...r,metadata:z(r.metadata,{deprecated:!0})});let o={name:e.name,in:e.in,schema:r,required:!!e.required,description:e.description};if(o.in==="query"){let s=e;(s.style==="form"||s.style==="spaceDelimited"||s.style==="pipeDelimited"||s.style==="deepObject")&&(o.style=s.style),typeof s.explode=="boolean"&&(o.explode=s.explode),typeof s.allowReserved=="boolean"&&(o.allowReserved=s.allowReserved)}return o}function He(e,t,n){let r=e.content??{},o=r["application/json"]??r["application/merge-patch+json"]??r["application/x-www-form-urlencoded"]??r["multipart/form-data"]??Object.values(r)[0];if(!o)return;let s=Object.keys(r).find(a=>r[a]===o),i=O(o.schema,`${t}.requestBody`,n);return{contentType:s,schema:i,required:!!e.required,description:e.description}}function Je(e,t,n){let r=e.responses??{},o=Object.keys(r).filter(m=>/^2\d\d$/.test(m));o.length===0&&(r["2XX"]?o.push("2XX"):r.default&&o.push("default"));let s=o[0];if(!s)return{successResponses:[]};let i=r[s];if(!i)return{successResponses:[]};let a=v(n,i),c=We(a.headers,`paths.${t}.response.${s}`,n),u=a.content;if(!u)return{successResponses:[],...c===void 0?{}:{successResponseHeaders:c}};let d=s==="default"||s==="2XX"?s:Number(s),f=[];for(let[m,l]of Object.entries(u)){let h=O(l.schema,`paths.${t}.response.${s}.${m}`,n),p=l.itemSchema,g=p!==void 0?O(p,`paths.${t}.response.${s}.${m}.itemSchema`,n):void 0;f.push({contentType:m,schema:h,status:d,...g===void 0?{}:{itemSchema:g}})}return{successResponses:f,...c===void 0?{}:{successResponseHeaders:c}}}function We(e,t,n){if(!e)return;let r=[];for(let[o,s]of Object.entries(e)){let i=v(n,s),a={name:o.toLowerCase(),schema:O(i.schema===void 0?void 0:v(n,i.schema),`${t}.headers.${o}`,n)};i.required===!0&&(a.required=!0),r.push(a)}return r.length>0?r:void 0}function Ve(e,t,n){let r=e.responses??{},o=Object.keys(r).filter(a=>/^([45]\d\d|4XX|5XX)$/.test(a));Object.keys(r).some(a=>/^(2\d\d|2XX)$/.test(a))&&r.default&&o.push("default");let i=[];for(let a of o){let c=r[a];if(!c)continue;let d=v(n,c).content;if(!d)continue;let f=a==="default"||a==="4XX"||a==="5XX"?a:Number(a);for(let[m,l]of Object.entries(d)){let h=O(l.schema,`paths.${t}.response.${a}.${m}`,n);i.push({contentType:m,schema:h,status:f})}}return i}function O(e,t,n){return e===void 0||typeof e=="boolean"?{kind:"unknown"}:S(e)?{kind:"ref",name:N(e.$ref)}:q(e,t,n)}function q(e,t,n){let r=Me(e),o=e.oneOf??e.anyOf;if(o){let a=o.map((d,f)=>S(d)?{kind:"ref",name:N(d.$ref)}:q(d,`${t}.[${f}]`,n)),c=Ee(a);if(c.length===1&&c.length<a.length){let d=c[0];return{...d,description:d.description??e.description,metadata:z(r,d.metadata)}}let u=Ie(e,o);return k({kind:"union",members:c,discriminator:u,description:e.description},r)}if(e.allOf){let a=e.allOf.map((u,d)=>S(u)?{kind:"ref",name:N(u.$ref)}:q(u,`${t}.allOf[${d}]`,n)),c=le(e,t,n);if(c.length>0&&a.unshift({kind:"object",properties:c}),a.length===1){let u=a[0];return{...u,description:u.description??e.description,metadata:z(r,u.metadata)}}return k({kind:"intersection",members:a,description:e.description},r)}let s=e.type;if(Array.isArray(s)){let a=s.filter(d=>d!=="null"),c=s.includes("null"),u=a.map(d=>{let f={...e,type:d};if(Array.isArray(f.enum)){let m=f.enum.filter(l=>l!==null);f.enum=m.length>0?m:void 0}return q(f,t,n)});return c&&u.push({kind:"null"}),u.length===1?u[0]:k({kind:"union",members:u,description:e.description},r)}if(e.nullable)return{kind:"union",members:[q({...e,nullable:void 0},t,n),{kind:"null"}],description:e.description};if(e.const!==void 0){let a=e.const;if(typeof a!="string"&&typeof a!="number"&&typeof a!="boolean")throw new y(`Unsupported const value at ${t}: ${JSON.stringify(a)}`);return k({kind:"literal",value:a,description:e.description},r)}if(e.enum){let a=e.enum,c=a.filter(m=>m!==null),u=c.length!==a.length;if(c.length===0)return k({kind:"null",description:e.description},r);let d=Qe(c,t),f=d==="boolean"?{kind:"scalar",scalar:"boolean",description:e.description}:{kind:"enum",values:c,scalar:d,description:e.description};return k(u?{kind:"union",members:[f,{kind:"null"}],description:e.description}:f,r)}let i=s;if(i==="null")return k({kind:"null",description:e.description},r);if(i==="array"){let a=e.items,c=O(a,`${t}.items`,n);return k({kind:"array",items:c,description:e.description},r)}if(i==="object"||e.properties||e.additionalProperties){let a=le(e,t,n),c=e.additionalProperties;if(a.length===0&&c!==!1){let u=O(c,`${t}.additionalProperties`,n);return k({kind:"record",value:u,description:e.description},r)}return k({kind:"object",properties:a,description:e.description},r)}return k(i==="string"||i==="number"||i==="integer"||i==="boolean"?{kind:"scalar",scalar:i,description:e.description}:{kind:"unknown",description:e.description},r)}function Qe(e,t){let n=!1,r=!1,o=!1;for(let s of e)if(typeof s=="string")n=!0;else if(typeof s=="number")r=!0;else if(typeof s=="boolean")o=!0;else throw new y(`Unsupported enum value type at ${t}: ${JSON.stringify(s)}`);return n&&!r&&!o?"string":r&&!n&&!o?"number":o&&!n&&!r?"boolean":"string"}function Ye(e){return!(e.openapi??"").startsWith("3.0")}function le(e,t,n){let r=e.properties??{},o=new Set(e.required??[]),s=Ye(n);return Object.entries(r).map(([i,a])=>{let c=a.readOnly===!0;c&&S(a)&&!s&&b.warn(`generate-client: "${i}" declares readOnly beside a $ref, which OpenAPI ${n.openapi} ignores \u2014 the property stays in request bodies. Inline the schema, wrap the $ref in allOf, or move the description to OpenAPI 3.1.
|
|
15
|
+
`);let u=c&&(s||!S(a));return{name:i,schema:O(a,`${t}.${i}`,n),required:o.has(i),description:a.description,...u?{readOnly:!0}:{}}})}function ge(e){let t=K(e),n={...t};delete n.swagger,delete n.host,delete n.basePath,delete n.schemes,delete n.definitions,delete n.securityDefinitions,delete n.consumes,delete n.produces,delete n.parameters,delete n.responses,n.openapi="3.0.3";let r=Ze(t);return r&&(n.servers=r),n.components=et(t),n.paths=ot(t.paths??{},t.consumes??void 0,t.produces??void 0),n}function Ze(e){let t=e.host,n=e.basePath??"",r=(e.schemes??["https"])[0]??"https";if(t)return[{url:`${r}://${t}${n}`}]}function et(e){let t={};e.definitions&&(t.schemas=e.definitions),e.parameters&&(t.parameters=Object.fromEntries(Object.entries(e.parameters).map(([r,o])=>[r,_(o)]))),e.responses&&(t.responses=be(e.responses,void 0));let n=e.securityDefinitions;if(n){let r={};for(let[o,s]of Object.entries(n))r[o]=tt(s);t.securitySchemes=r}return t}function tt(e){switch(e.type){case"basic":return{type:"http",scheme:"basic"};case"apiKey":return{type:"apiKey",name:e.name,in:e.in};case"oauth2":{let t=e.flow==="accessCode"?"authorizationCode":e.flow==="application"?"clientCredentials":e.flow,n={scopes:e.scopes??{}};return e.authorizationUrl&&(n.authorizationUrl=e.authorizationUrl),e.tokenUrl&&(n.tokenUrl=e.tokenUrl),{type:"oauth2",flows:{[t]:n}}}default:return e}}function K(e){if(Array.isArray(e))return e.map(K);if(x(e)){let t={};for(let[n,r]of Object.entries(e))n==="$ref"&&typeof r=="string"?t.$ref=r.replace("#/definitions/","#/components/schemas/").replace("#/parameters/","#/components/parameters/").replace("#/responses/","#/components/responses/"):t[n]=K(r);return t}return e}var nt="application/json",rt="application/json",we=new Set(["name","in","required","description","deprecated","allowEmptyValue","collectionFormat"]);function ot(e,t,n){let r={};for(let[o,s]of Object.entries(e)){let i=s,a={};for(let[c,u]of Object.entries(i)){if(c==="parameters"&&Array.isArray(u)){a.parameters=u.map(_);continue}if(!st(c)){a[c]=u;continue}a[c]=it(u,t,n)}r[o]=a}return r}function st(e){return["get","put","post","delete","options","head","patch"].includes(e.toLowerCase())}function it(e,t,n){let r=e.consumes??t,o=e.produces??n,s=e.parameters??[],i=s.find(f=>f.in==="body"),a=s.filter(f=>f.in==="formData"),c=s.filter(f=>f.in!=="body"&&f.in!=="formData").map(_),u={...e,parameters:c};delete u.consumes,delete u.produces;let d=r?.[0]??nt;if(i)u.requestBody={required:!!i.required,content:{[d]:{schema:i.schema}}};else if(a.length>0){let f={},m=[];for(let p of a)f[p.name]=at(p),p.required&&m.push(p.name);let l={type:"object",properties:f};m.length>0&&(l.required=m);let h=r?.find(p=>p==="multipart/form-data")??r?.[0]??"application/x-www-form-urlencoded";u.requestBody={required:m.length>0,content:{[h]:{schema:l}}}}return e.responses&&(u.responses=be(e.responses,o)),u}function _(e){if(e.$ref!==void 0||e.in==="body"||e.in==="formData")return e;let t={},n={};for(let[r,o]of Object.entries(e))we.has(r)?t[r]=o:n[r]=o;if(t.schema=n,delete t.collectionFormat,e.in==="query"&&n.type==="array"){let r=e.collectionFormat??"csv";r!=="multi"&&(t.style=r==="ssv"?"spaceDelimited":r==="pipes"?"pipeDelimited":"form",t.explode=!1)}return t}function at(e){let t={};for(let[n,r]of Object.entries(e))we.has(n)||(t[n]=r);return t}function be(e,t){let n=t?.[0]??rt,r={};for(let[o,s]of Object.entries(e)){let i=s;if(i.schema===void 0){r[o]=i;continue}let{schema:a,...c}=i;r[o]={...c,content:{[n]:{schema:a}}}}return r}async function $e(e,t,n){let r=t??await T({}),o=await Y({ref:e,config:r,collectSpecData:n}),s=await T({rules:{struct:"error"}}),i=await Z({externalRefResolver:new V,document:o.bundle,config:s}),a=[...o.problems,...i].filter(u=>u.severity==="error");if(a.length>0){let u=a.map(d=>`- ${d.message} (at ${d.location?.[0]?.pointer??e})`).join(`
|
|
16
|
+
`);throw new Error(`The API description has ${a.length} error(s):
|
|
17
|
+
${u}`)}let c=o.bundle.parsed;return{document:c,version:Q(c)}}var lt=["Generated by @redocly/client-generator \u2014 do not edit by hand.","Source: OpenAPI description. Re-run `redocly generate-client` to update."];function mt(e,t){let n=[],r=new Set,o=R(ke(t.outputPath)),{dir:s,name:i,ext:a}=ft(t.outputPath),c={path:t.outputPath,dir:s,stem:i,ext:a},u=lt,d=!1;for(let f of t.generators){let m=t.registry.get(f),l={model:e,output:c,banner:u,outputMode:t.outputMode,emit:t.emit,pagination:t.pagination,selected:t.generators,options:t.generatorOptions?.get(f)??{}},h;try{t.emit.docs===!0&&m.docs!==void 0?(h=[...m.run(l),...m.docs(l)],d=!0):h=m.run(l)}catch(p){let g=p instanceof Error?p.message:String(p);throw new Error(`Generator "${f}" failed: ${g}`)}if(!Array.isArray(h)||h.some(p=>typeof p?.path!="string"||p.path===""||typeof p.content!="string"))throw new Error(`Generator "${f}" failed: run() must return an array of { path, content } files.`);for(let p of h){let g=R(o,p.path);if(g!==o&&!g.startsWith(o+pt))throw new Error(`Generator "${f}" failed: file path escapes the output directory: ${p.path}`);if(r.has(g))throw new Error(`Generator conflict: ${p.path} already emitted by an earlier generator`);r.add(g),n.push({path:g,content:p.content})}}return t.emit.docs===!0&&!d&&b.warn(`generate-client: docs is on, but no selected generator writes documentation (${t.generators.join(", ")}).
|
|
18
|
+
`),n}function ht(e){for(let t of e.services)for(let n of t.operations){let r=new Set,o=new Set;for(let s of[...n.pathParams,...n.queryParams,...n.headerParams,...n.cookieParams])r.has(s.name)&&o.add(s.name),r.add(s.name);o.size!==0&&b.warn(`generate-client: operation "${n.specName??n.name}" uses ${[...o].map(s=>`"${s}"`).join(", ")} in more than one parameter location. Every SDK sends both, and the SDKs whose methods take one argument per parameter give the later one a suffixed name \u2014 rename it in the description to choose the name yourself.
|
|
19
|
+
`)}}function yt(e,t,n,r,o,s,i){let a=[],c=new Set;for(let u of ee(t.services)){let d=gt(e,u.path,u.method);if(c.has(d))continue;c.add(d);let f=r.map(m=>o.get(m)?.sample?.(u,{model:t,emit:n,outputPath:s,pagination:i})).filter(m=>m!==void 0);f.length>0&&a.push({target:d,update:{"x-codeSamples":f}})}if(a.length!==0)return W({overlay:"1.0.0",info:{title:`Code samples for ${t.title}`,version:t.version},actions:a})}function gt(e,t,n){let r=i=>`['${i.replaceAll("\\","\\\\").replaceAll("'","\\'")}']`,o=e.paths?.[t];return`${S(o)&&o.$ref.startsWith("#/")?"$"+o.$ref.slice(2).split("/").map(H).map(r).join(""):`$.paths${r(t)}`}.${n}`}async function nn(e){if(e.output.split(/[\\/]/).some(p=>p==="undefined"||p==="null"))throw new Error(`output path "${e.output}" contains a literal "undefined" or "null" segment \u2014 this looks like an interpolation bug in the caller`);if(e.setup&&/^[a-z][a-z0-9+.-]+:/i.test(e.setup))throw new y(`setup must be a local file path \u2014 remote setup modules are not supported (got: ${e.setup})`);let t=R(e.output),{document:n,version:r}=await $e(e.api,e.config,e.collectSpecData),o=r==="oas2"?ge(n):n,s=he(o);ht(s);let i;if(e.setup){let{bakeSetup:p}=await import("./CQMMUWIJ.js"),g=R(e.configDir??process.cwd(),e.setup);i=p(await ut(g,"utf-8"))}let a=e.generators?.length?e.generators:["typescript"],{selected:c,registry:u}=await ae(a,{customGenerators:e.customGenerators,configDir:e.configDir}),d=te(s,e.pagination),f={serverUrl:e.serverUrl,argsStyle:e.argsStyle,errorMode:e.errorMode,dateType:e.dateType,mockData:e.mockData,mockSeed:e.mockSeed,queryKeyPrefix:e.queryKeyPrefix,telemetry:e.telemetry,setup:i,runtime:e.runtime,importExt:e.importExt,goPackage:e.goPackage,pagination:d,docs:e.docs,docsFrontmatter:e.docsFrontmatter};oe(c,f,u,e.outputMode);let m=se(c,u,e.options),l=mt(s,{outputPath:t,outputMode:e.outputMode??"single",emit:f,pagination:d,generators:c,generatorOptions:m,registry:u});if(e.codeSamples===!0){let p=yt(n,s,f,c,u,t,d);p!==void 0&&l.push({path:t.replace(/\.[^.]+$/,".code-samples.yaml"),content:p})}let h=[];for(let p of l)await ct(ke(p.path),{recursive:!0}),await dt(p.path,p.content,"utf-8"),h.push({path:p.path,bytes:Buffer.byteLength(p.content,"utf-8")});return{outputPath:t,bytes:h.reduce((p,g)=>p+g.bytes,0),files:h}}export{I as a,oe as b,mt as c,nn as d};
|
|
@@ -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 g,d}from"./
|
|
7
|
+
import{a as x,b as y,c as g,d}from"./YAYCIIIB.js";import{b as P,d as h,e as m}from"./LD5MEXEL.js";import{m as v}from"./UW4UC7ZI.js";import{join as B}from"node:path";function b(e,t){let n=x(e,"tanstack-query");if(n.length===0)return"";let r=t.pagination??new Map;return[I(n,t,r),...n.some(s=>M(s,r))?[j]:[],...n.filter(y).map(s=>F(s,t.queryKeyPrefix)),S(e,n,r,t.queryKeyPrefix,t.argsStyle),...E(n,r)].join(`
|
|
8
8
|
`)}function p(e,t){if(!y(e))return!1;let n=t.get(e.name);return n===void 0||n.spec.style==="link"?!1:n.spec.style!=="body-link"||e.queryParams.length>0}function M(e,t){return p(e,t)&&t.get(e.name)?.spec.style==="body-link"}var j=`/** The query parameters of a next-page link; a repeated key becomes an array. */
|
|
9
9
|
const nextLinkQuery = (link: string) => {
|
|
10
10
|
const query: Record<string, string | string[]> = {};
|
|
@@ -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"./IUNK2H6J.js";import"./HAOBCQWB.js";import"./LFULTEM7.js";import"./76YF3WE6.js";import"./WZXA5XPB.js";import"./4JI4GT6B.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{b as $,e as T,o as E,p as F,r as I,t as L,v as m}from"./
|
|
7
|
+
import{b as $,e as T,o as E,p as F,r as I,t as L,v as m}from"./RIJ5NQKJ.js";import{ca as w,ga as l,ia as n,l as x,pa as h,va as A,wa as g,ya as k}from"./4JI4GT6B.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{performance as O}from"perf_hooks";async function X({argv:e,config:t,version:u,collectSpecData:P,collectResults:R}){let c=await $(e.apis,t),r={errors:0,warnings:0,ignored:0},p=0,b=e.format==="checkstyle"||e.format==="junit",y=[];for(let{path:o,alias:f}of c)try{let d=O.now(),s=t.forAlias(f);L(s.rules),s.skipRules(e["skip-rule"]),s.skipPreprocessors(e["skip-preprocessor"]),typeof t.document?.parsed>"u"&&!e.extends&&n.info(`No configurations were provided -- using built in ${w("recommended")} configuration by default.
|
|
8
8
|
|
|
9
9
|
`),f===void 0?n.info(l(`validating ${m(o)}...
|
|
10
10
|
`)):n.info(l(`validating ${m(o)} using lint rules for api '${f}'...
|
|
@@ -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 A,c as F,d as S,e as l}from"./
|
|
7
|
+
import{b as A,c as F,d as S,e as l}from"./MLLRCWW6.js";import"./3SPC2VZI.js";import{e as $,g as x,n as I,o as P}from"./GP5VOB7R.js";import"./GKXY6U4S.js";import{f as p}from"./RIJ5NQKJ.js";import{aa as w,ia as n,l as u}from"./4JI4GT6B.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";async function O({argv:t,config:o,version:c}){let h=performance.now(),j=Date.now(),{organization:g,project:d,"mount-path":z,verbose:D}=t,f=t.domain||x(),e,r,y,b,s=[];try{let i=$();if(e=P(t.files,(a,T)=>{n.warn(`File ${a} is overwritten by ${T}
|
|
8
8
|
`)}),!e.length)return p("push",h,"No files to upload");let m=await I({domain:f,apiKey:i,organization:g,project:d,mountPath:z,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:U(t.author)},version:c,replace:t.replace,onUploadStart:a=>{n.info(`Uploading to ${a.mountPath} ${e.length} ${u("file",e.length)}:
|
|
9
9
|
`)},onSunsetWarning:a=>s.push(a),onSlugDeprecated:S});r=m.pushId,y=m.organizationId,b=m.projectId}catch(i){l("push",s),F("\u2717 File upload failed.",i)}for(let i of e)n.info(w(`\u2713 ${i.name}
|
|
10
10
|
`));return n.info(`
|
|
@@ -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"./46IZNQXT.js";import"./HAOBCQWB.js";import"./LEHWOEMH.js";import"./LFULTEM7.js";import"./76YF3WE6.js";import"./WZXA5XPB.js";import"./4JI4GT6B.js";import"./NEWT5A6S.js";import"./LD5MEXEL.js";import"./UW4UC7ZI.js";import"./RFWIIJFG.js";export{b as typescriptDocs,a as typescriptGenerator,c as typescriptSample};
|
|
@@ -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"./LEHWOEMH.js";import{ia as p}from"./4JI4GT6B.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,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 o,b as t,c as e}from"./HBUZKWXC.js";import{ia as r}from"./
|
|
7
|
+
import{a as o,b as t,c as e}from"./HBUZKWXC.js";import{ia as r}from"./4JI4GT6B.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{spawn as p}from"node:child_process";var u=async({argv:n})=>{r.info(`
|
|
8
8
|
Launching translate using NPX.
|
|
9
9
|
|
|
10
10
|
`);let{npxExecutableName:s,sanitize:a,shell:i}=e(),l=a(n["project-dir"],o),c=a(n.locale,t);p(s,["-y","@redocly/realm","translate",c,`-d=${l}`],{stdio:"inherit",shell:i}).on("error",m=>{throw r.info(`Translate launch failed: ${m.message}`),new Error("Translate launch failed.")})};export{u as handleTranslations};
|
|
@@ -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 C,b as Z,c as ee,d as Ne,e as te,f as ne,g as Se,h as oe}from"./
|
|
7
|
+
import{a as C,b as Z,c as ee,d as Ne,e as te,f as ne,g as Se,h as oe}from"./3HSHTOK2.js";import{a as Fe,b as De}from"./64G5RPLP.js";import{f as de,g as L,h as ue,i as Ce,l as W,m as h,n as Oe}from"./RIJ5NQKJ.js";import{$ as le,O as pe,S as ce,T as fe,aa as ye,b as me,c as j,ca as u,d as O,h as ae,ia as N,ka as he,o as A,oa as S,r as d,t as v,va as ge,wa as Ae}from"./4JI4GT6B.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import*as U from"node:fs";import*as Ge from"node:path";import{performance as Xe}from"perf_hooks";import*as G from"node:path";import*as R from"node:path";function F(e,t,o){let n=R.resolve(e),r=R.resolve(t);if(r!==n&&!r.startsWith(n+R.sep))throw new S(`Refusing to write "${o}" outside the output directory.`)}import*as we from"node:path";function D(e,t,o,n,r){let m=o?`.${o}`:"",a=we.join(e,t),i=a+m,p=n.get(i.toLowerCase());for(let s=2;n.has(i.toLowerCase());s++)i=`${a}-${s}${m}`;return r&&p&&p!==t&&p.toLowerCase()===t.toLowerCase()&&r.conflicts.push({name:t,collidingName:p,filename:i,pointer:r.pointer}),n.set(i.toLowerCase(),t),i}function $(e,t,o,n,r,m,a){let i={},p=new Map;for(let[s,c]of Object.entries(e||{})){if(d(c))continue;let f=D(n,L(s,r),m,p,{conflicts:a,pointer:`${t}/${v(s)}`});F(o,f,s),i[s]=f}return i}import*as Pe from"node:path";function g(e,t,o={}){Se(e,r=>{if(d(r)&&oe(r.$ref))n(r,"$ref");else if(j(r.discriminator)&&j(r.discriminator.mapping)){let{mapping:m}=r.discriminator;for(let a of Object.keys(m)){let i=m[a];typeof i=="string"&&oe(i)&&n(r.discriminator.mapping,a)}}});function n(r,m){let a=r[m].split("/"),i=a.pop(),p=a[2],s=o[p];if(!s||!s[i])return;let c=A(Pe.relative(t,s[i].filename));c.startsWith(".")||(c="./"+c),r[m]=c}}function Y(e,t,o="warn"){if(o==="off"||e.length===0)return;let n=e.map(({name:r,collidingName:m,filename:a,pointer:i})=>({ruleId:"split",severity:o,message:`${r} and ${m} would share one file on a case-insensitive file system`+(o==="error"?".":`, saving ${r} to ${a}.`),location:[{source:t,pointer:i,reportOnKey:!0}],suggest:[]}));if(Ae(n,{totals:ge(n),command:"split"}),o==="error")throw new S("\u274C Errors encountered while splitting: files not created.")}import*as ie from"node:path";var Ee=["schemas","messages","securitySchemes","parameters","correlationIds","messageTraits","operationTraits","serverBindings","channelBindings","operationBindings","messageBindings"];var xe=["schemas","messages","securitySchemes","servers","serverVariables","parameters","replies","replyAddresses","correlationIds","messageTraits","operationTraits","tags","externalDocs","serverBindings","channelBindings","operationBindings","messageBindings"];function H(e,t){return(t==="async2"?Ee:xe).filter(n=>n in e)}function ve({asyncapi:e,asyncapiDir:t,componentsFiles:o,ext:n,specVersion:r,conflicts:m}){let a=e.components;if(!a)return;let i=ie.join(t,C),p=H(a,r);for(let s of p){let c=ie.join(i,s),f=new Map;for(let l of Object.keys(a[s]||{})){let y=D(c,l,n,f,{conflicts:m,pointer:`#/components/${s}/${v(l)}`});F(t,y,l),o[s]=o[s]||{},o[s][l]={filename:y}}}}import*as be from"node:fs";import*as V from"node:path";import*as P from"node:fs";import*as $e from"node:path";function E(e,t,o){if(!P.existsSync(e)||!P.statSync(e).isDirectory())return;let n=P.readdirSync(e);for(let r of n){let m=$e.join(e,r);P.statSync(m).isDirectory()?E(m,t,o):t(m,e,o)}}function b(e,t,o){if(!ce(e))return;let n=W(e);g(n,t,o),h(n,e)}function Te({channels:e,channelsFiles:t,asyncapiDir:o,outDir:n,componentsFiles:r}){if(e){be.mkdirSync(n,{recursive:!0});for(let m of Object.keys(e)){let a=e[m];if(d(a))continue;let i=t[m];g(a,V.dirname(i),r),h(a,i),e[m]={$ref:A(V.relative(o,i))},E(n,b,r)}}}import*as Be from"node:fs";import*as k from"node:path";import*as ke from"node:fs";function K(e){return e!=="securitySchemes"}function z(e,t){K(t)&&ke.mkdirSync(e,{recursive:!0})}import*as je from"node:fs";function q(e,t){return je.existsSync(e)&&!me(W(e),t)}import*as Re from"node:path";function T(e,t,o){if(!(!j(e)&&!Array.isArray(e))){if(Array.isArray(e)){for(let n of e)T(n,t,o);return}for(let n of Object.keys(e)){let r=e[n];if(n==="$ref"&&typeof r=="string"&&r.startsWith("#/channels/")){let m=r.slice(11),a=m.indexOf("/"),i=a===-1?m:m.slice(0,a),p=a===-1?"":m.slice(a),s=o[i];if(s){let c=A(Re.relative(t,s));e[n]=p?`${c}#${p}`:c}}else T(r,t,o)}}}function _e(e,t){let o=e.components;o&&(O(o[t])&&delete o[t],O(o)&&delete e.components)}function Ie({asyncapi:e,asyncapiDir:t,componentsFiles:o,channelsFiles:n,specVersion:r}){let m=e.components;if(m){let p=function(s){let c=k.join(a,s);z(c,s);for(let f of Object.keys(m?.[s]||{})){let{filename:l}=o[s][f],y=m?.[s]?.[f];g(y,k.dirname(l),o),T(y,k.dirname(l),n),q(l,y)?N.warn(`warning: conflict for ${f} - file already exists with different content: ${u(l)} ... Skip.
|
|
8
8
|
`):h(y,l),delete m?.[s]?.[f]}_e(e,s)},a=k.join(t,C);Be.mkdirSync(a,{recursive:!0}),H(m,r).forEach(p)}}import*as Me from"node:fs";import*as _ from"node:path";function Le({operations:e,operationFiles:t,asyncapiDir:o,outDir:n,componentsFiles:r,channelsFiles:m}){if(e){Me.mkdirSync(n,{recursive:!0});for(let a of Object.keys(e)){let i=e[a];if(d(i))continue;let p=t[a];g(i,_.dirname(p),r),T(i,_.dirname(p),m),h(i,p),e[a]={$ref:A(_.relative(o,p))},E(n,b,r)}}}function We({asyncapi:e,asyncapiDir:t,pathSeparator:o,ext:n,specVersion:r,source:m,fileNameConflictsSeverity:a}){let i=G.join(t,te),p=G.join(t,ne),s=r==="async3"?e.operations:void 0,c={},f=[];ve({asyncapi:e,asyncapiDir:t,componentsFiles:c,ext:n,specVersion:r,conflicts:f});let l=$(e.channels,`#/${te}`,t,i,o,n,f),y=$(s,`#/${ne}`,t,p,o,n,f);Y(f,m,a),Te({channels:e.channels,channelsFiles:l,asyncapiDir:t,outDir:i,componentsFiles:c}),Ie({asyncapi:e,asyncapiDir:t,componentsFiles:c,channelsFiles:l,specVersion:r}),Le({operations:s,operationFiles:y,asyncapiDir:t,outDir:p,componentsFiles:c,channelsFiles:l}),g(e,t,c),h(e,G.join(t,`asyncapi.${n}`))}import*as Q from"node:path";import*as se from"node:path";function X(e){return e?De.filter(t=>K(t)&&Object.keys(e).includes(t)):[]}function Ye(e,t,o,n,r){let{components:m}=e;if(!m)return;let a=se.join(t,C);for(let i of X(m)){let p=se.join(a,i),s=new Map;for(let c of Object.keys(m[i]||{})){let f=D(p,c,n,s,{conflicts:r,pointer:`#/components/${i}/${v(c)}`});F(t,f,c);let l=[];i==="schemas"&&(l=(m[i]?.[c]?.allOf||[]).map(({$ref:y})=>y).filter(ae)),o[i]=o[i]||{},o[i][c]={inherits:l,filename:f}}}}import*as Ke from"node:fs";import*as B from"node:path";import*as J from"node:path";function He(e,t,o,n){if(!e.discriminator)return;let r=`#/${C}/schemas/${t}`,m={};for(let[s,{inherits:c,filename:f}]of Object.entries(n))if(c.indexOf(r)>-1){let l=A(J.relative(J.dirname(o),f));m[s]=l.startsWith(".")?l:"./"+l}if(O(m))return;let a=e.properties[e.discriminator.propertyName],i=a&&a.enum,p=e.discriminator.mapping=e.discriminator.mapping||{};for(let s of Object.keys(m))i&&!i.includes(s)||(p[s]&&p[s]!==m[s]&&N.warn(`warning: explicit mapping overlaps with local mapping entry ${le(s)} at ${u(o)}. Please check it.`),p[s]=m[s])}function Ve(e,t){e.components&&O(e.components[t])&&delete e.components[t],O(e.components)&&delete e.components}function ze(e,t,o){let{components:n}=e;if(n){let a=function(i){let p=B.join(r,i);z(p,i);for(let s of Object.keys(n?.[i]||{})){let{filename:c}=o[i][s],f=n?.[i]?.[s];g(f,B.dirname(c),o),He(f,s,c,o.schemas||{}),q(c,f)?N.warn(`warning: conflict for ${s} - file already exists with different content: ${u(c)} ... Skip.
|
|
9
9
|
`):h(f,c),delete e.components?.[i]?.[s]}Ve(e,i)},r=B.join(t,C);Ke.mkdirSync(r,{recursive:!0}),X(n).forEach(a)}}import*as I from"node:fs";import*as x from"node:path";function re(e,t,o,n,r,m,a=""){if(!e)return;I.mkdirSync(n,{recursive:!0});let i=new Map;for(let p of Object.keys(e)){let s=e[p];if(d(s))continue;let c=t[p];for(let f of Fe){let l=s[f],y=l?.["x-code-samples"]||l?.["x-codeSamples"];if(!(!y||!Array.isArray(y)))for(let w of y){if(w.source&&w.source.$ref)continue;let M=D(x.join(o,"code_samples",ue(w.lang),a+L(p,m)),f,Ce(w.lang).slice(1),i);F(o,M,w.lang),I.mkdirSync(x.dirname(M),{recursive:!0}),I.writeFileSync(M,w.source),w.source={$ref:A(x.relative(n,M))}}}h(s,c),e[p]={$ref:A(x.relative(o,c))},E(n,b,r)}}function qe(e,t,o,n,r,m){let a=Q.join(t,Z),i=Q.join(t,ee),p=e.webhooks||e["x-webhooks"],s="webhooks"in e&&e.webhooks?`#/${ee}`:`#/${Ne}`,c={},f=[];Ye(e,t,c,n,f);let l=$(e.paths,`#/${Z}`,t,a,o,n,f),y=$(p,s,t,i,o,n,f);Y(f,r,m),ze(e,t,c),re(e.paths,l,t,a,c,o),re(p,y,t,i,c,o,"webhook_"),g(e,t,c),h(e,Q.join(t,`openapi.${n}`))}async function ro({argv:e,collectSpecData:t}){let o=Xe.now(),{api:n,outDir:r,separator:m}=e,a=Oe(n);if(!U.existsSync(n))throw new S(`File ${u(n)} does not exist.`);let i=new fe(Ge.resolve(n),U.readFileSync(n,"utf-8")),p=pe(i.body,{filename:n});t?.({parsed:p});let s=he(p);switch(s){case"async2":case"async3":We({asyncapi:p,asyncapiDir:r,pathSeparator:m,ext:a,specVersion:s,source:i,fileNameConflictsSeverity:e["file-name-conflicts-severity"]});break;case"oas3_0":case"oas3_1":case"oas3_2":qe(p,r,m,a,i,e["file-name-conflicts-severity"]);break;case"oas2":throw new S("OpenAPI 2 is not supported by this command.");default:throw new S("File does not conform to the OpenAPI or AsyncAPI Specification. Version is not specified.")}N.info(`\u{1FA93} Document: ${u(n)} ${ye("is successfully split")}
|
|
10
10
|
and all related files are saved to the directory: ${u(r)}
|
|
@@ -0,0 +1,34 @@
|
|
|
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,b as U,c as F,d as R,e as j}from"./U5DIFWGH.js";import{b as O}from"./RIJ5NQKJ.js";import{ba as $,c as b,ca as A,ga as v,ia as k,l as P,oa as d}from"./4JI4GT6B.js";import"./NEWT5A6S.js";import"./RFWIIJFG.js";import{readFileSync as H}from"node:fs";import{mkdir as B,writeFile as D}from"node:fs/promises";import{basename as I,dirname as S,extname as N,isAbsolute as L,relative as x,resolve as f}from"node:path";var V=/^[a-z][a-z0-9+.-]+:/i;function W(e,t){let{setup:i}=e;if(typeof i!="string")return e;if(V.test(i))throw new d(`
|
|
8
|
+
\u274C \`client.setup\` must be a local file path \u2014 remote setup modules are not supported.
|
|
9
|
+
Got: ${i}
|
|
10
|
+
`);return L(i)?e:{...e,setup:f(t,i)}}function q(e){return`${e.replace(/[\\/]/g,"_")}.client.ts`}function J(e){if(e.startsWith("//"))return!1;if(e.startsWith("/"))return!0;try{let t=new URL(e);return t.protocol==="http:"||t.protocol==="https:"}catch{return!1}}async function se({argv:e,config:t,collectSpecData:i}){let{AUTHORING_HELPER_NAMES:r,generateClient:m,mergeConfig:n}=await import("./6VOUSPJC.js"),l=t.configPath?S(t.configPath):process.cwd(),o={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(c=>c.startsWith(".")?f(c):c),setup:e.setup===void 0?void 0:W({setup:e.setup},process.cwd()).setup},s=t.resolvedConfig.apis??{},a=Object.keys(s).filter(c=>b(s[c].client)||s[c].clientOutput!==void 0);if(e.api===void 0){if(e.output)throw new d("\n\u274C --output can't target multiple APIs. Set `clientOutput` under each api in redocly.yaml, or pass a single <api>.\n");if(a.length===0)throw new d("\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 h=await O(e.api===void 0?a:[e.api],t),g={config:t,collectSpecData:i,configDir:l,cliFlags:o,outputFlag:e.output,toolkit:{generateClient:m,mergeConfig:n,helperNames:r},seenOutputs:new Set,composable:[]};for(let c of h)await K(c,g);let w=b(t.resolvedConfig.client)?t.resolvedConfig.client:{};w.cliOutput!==void 0&&e.api===void 0&&g.composable.length>0&&await Q(w.cliOutput,g)}async function K(e,{config:t,collectSpecData:i,configDir:r,cliFlags:m,outputFlag:n,toolkit:l,seenOutputs:o,composable:s}){let{path:a,alias:h}=e,g=h??I(a,N(a)),w=t.forAlias(h),{client:c,clientOutput:E}=w.resolvedConfig,M=W(b(c)?c:{},r),C=l.mergeConfig(M,m);X(C.generators??[],l.helperNames,r);let y=n!==void 0?f(n):E!==void 0?f(r,E):f(r,q(g));if(!y.endsWith(".ts"))throw new d(`
|
|
11
|
+
\u274C output must point at a TypeScript file (ending in .ts).
|
|
12
|
+
Got: ${y}
|
|
13
|
+
`);if(o.has(y))throw new d(`
|
|
14
|
+
\u274C Two APIs write to the same path: ${y}.
|
|
15
|
+
Give each api a distinct \`clientOutput\`.
|
|
16
|
+
`);if(o.add(y),C.serverUrl!==void 0&&!J(C.serverUrl))throw new d(`
|
|
17
|
+
\u274C serverUrl must be an absolute URL (https://api.example.com) or a root-relative path (/v1) \u2014 set via --server-url or the \`client\` block in redocly.yaml.
|
|
18
|
+
Got: ${C.serverUrl}
|
|
19
|
+
`);try{k.info(v(`
|
|
20
|
+
Generating client for ${g}...
|
|
21
|
+
`));let u=await l.generateClient({...C,api:a,output:y,config:w,configDir:r,collectSpecData:i}),_=u.files.find(G=>G.path.endsWith(".cli.ts"));if(_!==void 0){let G=C.importExt??"js";s.push({alias:g,cliPath:_.path.replace(/\.ts$/,G==="ts"?".ts":".js")})}for(let G of u.files)o.add(G.path);let z=`Client successfully generated: ${`${u.files.length} ${P("file",u.files.length)}`} (${u.bytes} bytes) at ${$(u.outputPath)}.`;k.info(`
|
|
22
|
+
`+A(z)+`
|
|
23
|
+
`)}catch(u){let _=u instanceof Error?u.message:String(u);throw p.generate_client_error_category=j(_),new d(`
|
|
24
|
+
\u274C Failed to generate client for ${g}.
|
|
25
|
+
${_}
|
|
26
|
+
`)}}async function Q(e,{configDir:t,seenOutputs:i,composable:r}){let{renderComposedCliEntry:m}=await import("./FP5Y23ZO.js"),n=f(t,e);if(!n.endsWith(".ts"))throw new d(`
|
|
27
|
+
\u274C client.cliOutput must point at a TypeScript file (ending in .ts).
|
|
28
|
+
Got: ${n}
|
|
29
|
+
`);if(i.has(n))throw new d(`
|
|
30
|
+
\u274C client.cliOutput resolves to a file this run generated: ${n}.
|
|
31
|
+
Give the composed entry its own path.
|
|
32
|
+
`);let l=I(n,N(n)),o=m(r.map(({alias:s,cliPath:a})=>({alias:s,modulePath:`./${x(S(n),a).split("\\").join("/")}`})),l);await B(S(n),{recursive:!0}),await D(n,o,"utf-8"),p.generate_client_composed_apis_count=r.length,k.info(`
|
|
33
|
+
`+A(`Composed CLI written to ${$(x(process.cwd(),n))} \u2014 ${r.map(({alias:s})=>s).join(", ")} behind one \`${l}\` binary.`)+`
|
|
34
|
+
`)}var T=new Set;function X(e,t,i){let r=new Set(p.generate_client_builtin_generators??[]),m=new Set(p.generate_client_toolkit_imports??[]),n=new Set(p.generate_client_ejected_generators??[]),l=p.generate_client_custom_generators_count??0;for(let o of e){if(U.has(o)){r.add(o);continue}if(!T.has(o)&&(T.add(o),l++,o.startsWith(".")||L(o)))try{let s=H(f(i,o),"utf-8");for(let h of F(s,t))m.add(h);let a=R(s);a&&n.add(`${a.name}@${a.version}`)}catch{}}p.generate_client_builtin_generators=[...r],p.generate_client_custom_generators_count=l,p.generate_client_toolkit_imports=[...m],p.generate_client_ejected_generators=[...n]}export{X as collectGeneratorUsage,se as handleGenerateClient};
|
|
@@ -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"./3YAJYKXK.js";import"./UF2ZCH7W.js";import"./4JI4GT6B.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};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "cli" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator cli --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "cli" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator cli --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "cli" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator cli --update`.
|
|
@@ -86,5 +86,5 @@ export default {
|
|
|
86
86
|
docs: cliDocs,
|
|
87
87
|
requires: ["typescript","zod"],
|
|
88
88
|
errorModes: ["throw"],
|
|
89
|
-
requiresGenerator: '^0.7.
|
|
89
|
+
requiresGenerator: '^0.7.7',
|
|
90
90
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "cli" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator cli --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "go" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator go --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "go" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator go --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "go" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator go --update`.
|
|
@@ -332,5 +332,5 @@ export default {
|
|
|
332
332
|
"argsStyle": "inputs follow the target language's own idiom",
|
|
333
333
|
"importExt": "the generated file has no relative imports"
|
|
334
334
|
},
|
|
335
|
-
requiresGenerator: '^0.7.
|
|
335
|
+
requiresGenerator: '^0.7.7',
|
|
336
336
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "go" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator go --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "go" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator go --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "go" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator go --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "go" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator go --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "go" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator go --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "mock" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator mock --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "mock" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator mock --update`.
|
|
@@ -31,5 +31,5 @@ export default {
|
|
|
31
31
|
name: 'mock',
|
|
32
32
|
run: mockGenerator,
|
|
33
33
|
requires: ["typescript"],
|
|
34
|
-
requiresGenerator: '^0.7.
|
|
34
|
+
requiresGenerator: '^0.7.7',
|
|
35
35
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "mock" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator mock --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "mock" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator mock --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "mock" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator mock --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "php" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator php --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "php" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator php --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "php" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator php --update`.
|
|
@@ -234,5 +234,5 @@ export default {
|
|
|
234
234
|
"argsStyle": "inputs follow the target language's own idiom",
|
|
235
235
|
"importExt": "the generated file has no relative imports"
|
|
236
236
|
},
|
|
237
|
-
requiresGenerator: '^0.7.
|
|
237
|
+
requiresGenerator: '^0.7.7',
|
|
238
238
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "php" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator php --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "php" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator php --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "php" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator php --update`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.7.
|
|
1
|
+
// Ejected from @redocly/client-generator@0.7.7 — the built-in "php" generator.
|
|
2
2
|
// This file is yours: edit freely; the generated client stays machine-owned and is
|
|
3
3
|
// rebuilt by `redocly generate-client`. Newer generator versions merge in with
|
|
4
4
|
// `redocly eject-generator php --update`.
|