@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.
Files changed (137) hide show
  1. package/THIRD_PARTY_NOTICES +2 -2
  2. package/lib/chunks/{VXLODB3S.js → 24AVTWC7.js} +1 -1
  3. package/lib/chunks/{SOI7RTB4.js → 2G2Q42ND.js} +1 -1
  4. package/lib/chunks/{KRCCY64H.js → 3LGZAJES.js} +1 -1
  5. package/lib/chunks/3SFDVGEQ.js +7 -0
  6. package/lib/chunks/{RGU6OZYB.js → 4C44BO5N.js} +1 -1
  7. package/lib/chunks/4JKMQCWY.js +9 -0
  8. package/lib/chunks/{UFZ7VJKO.js → 5IIJHGNO.js} +1 -1
  9. package/lib/chunks/{3M4FKKBI.js → 5VDBZVBF.js} +1 -1
  10. package/lib/chunks/6AB3BDX4.js +20 -0
  11. package/lib/chunks/{LRLGVYCG.js → 6LEQ46KS.js} +1 -1
  12. package/lib/chunks/{GVQMC2WB.js → 6QRNEF7K.js} +1 -1
  13. package/lib/chunks/{PTNNX4IU.js → 6WESXERF.js} +1 -1
  14. package/lib/chunks/{PRSNVDUV.js → 7AWM5GPD.js} +1 -1
  15. package/lib/chunks/{KQ5RN67Y.js → 7LNKXEIU.js} +1 -1
  16. package/lib/chunks/{5YW5LAGV.js → 7RQW6KPZ.js} +156 -58
  17. package/lib/chunks/{SLQPKXO2.js → A22GELRX.js} +1 -1
  18. package/lib/chunks/{VE45GKNY.js → AAPHKNGA.js} +1 -1
  19. package/lib/chunks/{22EANOP2.js → ACMV5RZA.js} +1 -1
  20. package/lib/chunks/AU7VOB4V.js +20 -0
  21. package/lib/chunks/{O7F2NBMC.js → B4ONRSDG.js} +3 -3
  22. package/lib/chunks/BC3XCWQE.js +11 -0
  23. package/lib/chunks/{L3H2DSRP.js → BFIZTFWS.js} +1 -1
  24. package/lib/chunks/{W3G6AQCC.js → BS3AUVYD.js} +1 -1
  25. package/lib/chunks/{NBI4EQPC.js → C2OCU4E3.js} +1 -1
  26. package/lib/chunks/{US7X4XPD.js → CQMZF72H.js} +1 -1
  27. package/lib/chunks/{3C6UUCEW.js → CTPVBOG5.js} +1 -1
  28. package/lib/chunks/{3JYY42DL.js → CVUPOCX4.js} +1 -1
  29. package/lib/chunks/{FDMXHRDK.js → DEXQ6S3P.js} +1 -1
  30. package/lib/chunks/{RPHIT72T.js → DQFNUDOT.js} +1 -1
  31. package/lib/chunks/{Y5AAEFMH.js → E2D25T4G.js} +1 -1
  32. package/lib/chunks/{G55KF2JU.js → FCZH3476.js} +1 -1
  33. package/lib/chunks/{ZNQTCB4Q.js → FRM6TZ42.js} +1 -1
  34. package/lib/chunks/GKXY6U4S.js +145 -0
  35. package/lib/chunks/{YINR7LU6.js → HTG3RKCV.js} +1 -1
  36. package/lib/chunks/{BX2H6D2W.js → HW7ZCN7J.js} +1 -1
  37. package/lib/chunks/{REIGI2Y7.js → I3M476SQ.js} +1 -1
  38. package/lib/chunks/{AB2EMYEK.js → IODGA6FG.js} +1 -1
  39. package/lib/chunks/{5S5OMDQZ.js → ITUUIAOZ.js} +381 -381
  40. package/lib/chunks/{LWPTRXNP.js → IYKYAJDC.js} +1 -1
  41. package/lib/chunks/{ZJYDDU5M.js → J373CXCH.js} +1 -1
  42. package/lib/chunks/{5UYYEBJY.js → J7J4PH3V.js} +7 -7
  43. package/lib/chunks/{P7MVM2ZA.js → JGBWIR5U.js} +1 -1
  44. package/lib/chunks/{S6NFOZ34.js → JHK6XIMG.js} +1 -1
  45. package/lib/chunks/{YDVWNFMS.js → KMP5ZE2D.js} +1 -1
  46. package/lib/chunks/{6EGJEFXO.js → L2EBKZQZ.js} +1 -1
  47. package/lib/chunks/{RUIEI3YV.js → LLWU7A5G.js} +1 -1
  48. package/lib/chunks/{LVGVWPDB.js → LXSCIQFU.js} +1 -1
  49. package/lib/chunks/{5PG3ST2N.js → NCBLLIQ3.js} +2 -2
  50. package/lib/chunks/{7YNVVBUW.js → NERCHMVY.js} +1 -1
  51. package/lib/chunks/{XJE2OFDN.js → NR3R4HFM.js} +45 -18
  52. package/lib/chunks/{LNYTDBAU.js → OFJ2KV5N.js} +1 -1
  53. package/lib/chunks/{XVZ7A34Y.js → OYUXHAGQ.js} +1 -1
  54. package/lib/chunks/{37WWN4MA.js → PHWKGYUT.js} +1 -1
  55. package/lib/chunks/{6NB3FKVN.js → Q4UGLPO2.js} +1 -1
  56. package/lib/chunks/{DBBMGF4W.js → QNCKZURN.js} +1 -1
  57. package/lib/chunks/{WEOCCL26.js → RFGNVCAR.js} +5 -5
  58. package/lib/chunks/{HBENVUR4.js → SXIFTBZB.js} +1 -1
  59. package/lib/chunks/{XJTGJYVS.js → TCALQAX5.js} +1 -1
  60. package/lib/chunks/{TBZEEKTV.js → U52CY34I.js} +1 -1
  61. package/lib/chunks/VB4PNWOR.js +7 -0
  62. package/lib/chunks/{SYWAPWW7.js → VSBSD3XZ.js} +1 -1
  63. package/lib/chunks/{ID2DJAJI.js → WV2NAII3.js} +1 -1
  64. package/lib/chunks/{YPYZCXVX.js → X2V5QOZP.js} +1 -1
  65. package/lib/chunks/{SXBAAS4M.js → XNNK5G6V.js} +1 -1
  66. package/lib/chunks/Y4UTXOI2.js +59 -0
  67. package/lib/chunks/{6DO6IN4A.js → YKST56C6.js} +1 -1
  68. package/lib/chunks/{2XK7ML3U.js → YXH72HCU.js} +1 -1
  69. package/lib/chunks/{MNH2K4WM.js → Z52TEGV5.js} +1 -1
  70. package/lib/chunks/{3DEJQSYG.js → Z5QYTPVY.js} +1 -1
  71. package/lib/chunks/{OP7NIAI7.js → Z7J6WWCO.js} +1 -1
  72. package/lib/chunks/{2OVI7BIW.js → ZK27F53P.js} +1 -1
  73. package/lib/chunks/{QMIOB64K.js → ZP54RCIQ.js} +1 -1
  74. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  75. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  76. package/lib/eject-assets/generators/cli/index.ts +2 -2
  77. package/lib/eject-assets/generators/cli/render.ts +1 -1
  78. package/lib/eject-assets/generators/go/client.ts +1 -1
  79. package/lib/eject-assets/generators/go/descriptor.ts +2 -1
  80. package/lib/eject-assets/generators/go/index.ts +2 -2
  81. package/lib/eject-assets/generators/go/models.ts +1 -1
  82. package/lib/eject-assets/generators/go/naming.ts +1 -1
  83. package/lib/eject-assets/generators/go/operations.ts +1 -1
  84. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  85. package/lib/eject-assets/generators/go/types.ts +1 -1
  86. package/lib/eject-assets/generators/mock/faker.ts +1 -1
  87. package/lib/eject-assets/generators/mock/index.ts +2 -2
  88. package/lib/eject-assets/generators/mock/render.ts +1 -1
  89. package/lib/eject-assets/generators/mock/sample.ts +1 -1
  90. package/lib/eject-assets/generators/mock/values.ts +1 -1
  91. package/lib/eject-assets/generators/php/client.ts +1 -1
  92. package/lib/eject-assets/generators/php/descriptor.ts +2 -1
  93. package/lib/eject-assets/generators/php/index.ts +2 -2
  94. package/lib/eject-assets/generators/php/models.ts +1 -1
  95. package/lib/eject-assets/generators/php/naming.ts +1 -1
  96. package/lib/eject-assets/generators/php/operations.ts +1 -1
  97. package/lib/eject-assets/generators/php/pagination.ts +1 -1
  98. package/lib/eject-assets/generators/php/types.ts +1 -1
  99. package/lib/eject-assets/generators/python/client.ts +1 -1
  100. package/lib/eject-assets/generators/python/descriptor.ts +2 -1
  101. package/lib/eject-assets/generators/python/index.ts +2 -2
  102. package/lib/eject-assets/generators/python/models.ts +1 -1
  103. package/lib/eject-assets/generators/python/naming.ts +1 -1
  104. package/lib/eject-assets/generators/python/operations.ts +1 -1
  105. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  106. package/lib/eject-assets/generators/python/types.ts +1 -1
  107. package/lib/eject-assets/generators/swr/index.ts +2 -2
  108. package/lib/eject-assets/generators/swr/render.ts +1 -1
  109. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  110. package/lib/eject-assets/generators/tanstack-query/render.ts +56 -9
  111. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  112. package/lib/eject-assets/generators/transformers/render.ts +1 -1
  113. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  114. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  115. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  116. package/lib/eject-assets/generators/typescript/index.ts +2 -2
  117. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  118. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  119. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  120. package/lib/eject-assets/generators/typescript/operations.ts +1 -1
  121. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  122. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  123. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  124. package/lib/eject-assets/generators/zod/index.ts +2 -2
  125. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  126. package/lib/eject-assets/skills/tanstack-query-generator/SKILL.md +5 -2
  127. package/lib/eject-assets/skills/typescript-generator/SKILL.md +5 -0
  128. package/lib/index.js +25 -25
  129. package/package.json +1 -1
  130. package/lib/chunks/23KTTVIR.js +0 -42
  131. package/lib/chunks/5NOJ76EP.js +0 -9
  132. package/lib/chunks/B64RMZSV.js +0 -7
  133. package/lib/chunks/LRUXN6H5.js +0 -59
  134. package/lib/chunks/QWPV64G2.js +0 -20
  135. package/lib/chunks/U77FTE2C.js +0 -20
  136. package/lib/chunks/UWK3L6LB.js +0 -11
  137. package/lib/chunks/WPIZQQ5C.js +0 -7
@@ -4,9 +4,9 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{c as x,ia as R}from"./22EANOP2.js";import{m}from"./UW4UC7ZI.js";function C(e){return e.flatMap(n=>n.operations)}function P(e,n,s){let r=e.specName??e.name;if(s?.exclude?.includes(r))return{};let a=s?.operations?.[r];if(a!==void 0)return y(e,n,a,`pagination.operations["${r}"]`,!0);if(e.paginationExtension!==void 0)return y(e,n,e.paginationExtension,"x-redoclyPagination",!0);if(s?.style!==void 0){let{exclude:o,operations:c,...t}=s;return y(e,n,t,"pagination convention",!1)}return{}}function H(e,n){let s=new Map,r=[];for(let a of C(e.services)){let o=P(a,e,n);o.error!==void 0?r.push(o.error):o.spec!==void 0&&s.set(a.name,{spec:o.spec,itemSchema:o.itemSchema})}if(r.length>0)throw new Error(["Invalid pagination configuration:",...r].join(`
8
- - `));return s}function y(e,n,s,r,a){let o=`Pagination for operation "${e.name}" (${r})`,c=q(s);if(c!==void 0)return{error:`${o}: ${c}`};let t=s,d=i=>a?{error:`${o}: ${i}`}:{};if(e.sse!==void 0)return d("the operation is a Server-Sent Events stream");if(t.style!=="link"){let i=t.style==="cursor"?"cursorParam":"offsetParam",l=t.style==="cursor"?t.cursorParam:t.offsetParam,k=e.queryParams.find(u=>u.name===l);if(!k){let u=e.queryParams.map(E=>E.name).join(", ");return d(`query parameter "${l}" is not declared on the operation`+(u===""?"":` (declared: ${u})`))}let p=O(k.schema,n);if(!(p!==void 0&&(t.style==="cursor"?b(p,n):p.kind==="scalar"&&(p.scalar==="number"||p.scalar==="integer")))){let u=t.style==="cursor"?"a string":"a number";return d(`the "${i}" query parameter "${l}" must accept ${u} (got ${I(p)})`)}}let g=e.successResponses.find(i=>i.contentType.toLowerCase().includes("json"));if(!g)return d("the operation has no JSON success response");if(t.style==="link"){let i=e.successResponseHeaders?.some(l=>l.name==="link")===!0;if(!i&&!a)return{};i||R.warn(`generate-client: ${o.toLowerCase()} follows the Link header, but the success response does not document one.
9
- `)}let h=m(g.schema,t.items,n);if(h===void 0)return d(`the "items" pointer "${t.items}" does not resolve in the success response schema`);if(h.kind!=="array")return d(`the "items" pointer "${t.items}" must point at an array (got ${h.kind})`);if(t.style==="cursor"){let i=m(g.schema,t.nextCursor,n);if(i===void 0)return d(`the "nextCursor" pointer "${t.nextCursor}" does not resolve in the success response schema`);if(!b(i,n))return d(`the "nextCursor" pointer "${t.nextCursor}" must point at a string (got ${i.kind})`);if(t.hasMore!==void 0){let l=m(g.schema,t.hasMore,n);if(l===void 0)return d(`the "hasMore" pointer "${t.hasMore}" does not resolve in the success response schema`);if(l.kind!=="scalar"||l.scalar!=="boolean")return d(`the "hasMore" pointer "${t.hasMore}" must point at a boolean (got ${l.kind})`)}}let f=t.limitParam!==void 0?{limitParam:t.limitParam}:{};return{spec:t.style==="cursor"?{style:"cursor",param:t.cursorParam,...f,nextCursor:t.nextCursor,...t.hasMore!==void 0?{hasMore:t.hasMore}:{},items:t.items}:t.style==="link"?{style:"link",...f,items:t.items}:{style:t.style,param:t.offsetParam,...f,items:t.items},itemSchema:h.items}}function q(e){if(!x(e))return"the rule must be an object";let{style:n,cursorParam:s,nextCursor:r,hasMore:a,offsetParam:o,limitParam:c,items:t}=e;if(n!=="cursor"&&n!=="offset"&&n!=="page"&&n!=="link")return`"style" must be one of "cursor" | "offset" | "page" | "link" (got ${JSON.stringify(n)})`;if(typeof t!="string"||t!==""&&!t.startsWith("/"))return'"items" must be a JSON pointer starting with "/" (or "" when the response body is the item array itself)';if(n==="cursor"){if(typeof s!="string"||s==="")return'cursor style requires a "cursorParam" query parameter name';if(typeof r!="string"||!r.startsWith("/"))return'cursor style requires a "nextCursor" JSON pointer starting with "/"';if(a!==void 0&&(typeof a!="string"||!a.startsWith("/")))return'"hasMore" must be a JSON pointer starting with "/"'}else if((n==="offset"||n==="page")&&(typeof o!="string"||o===""))return`${n} style requires an "offsetParam" query parameter name`;if(c!==void 0&&typeof c!="string")return'"limitParam" must be a query parameter name'}function I(e){return e===void 0?"an unresolvable ref":e.kind==="scalar"||e.kind==="enum"?e.scalar:e.kind}function O(e,n){let s=new Set,r=e;for(;r.kind==="ref";){let{name:a}=r;if(s.has(a))return;s.add(a);let o=n.schemas.find(c=>c.name===a);if(o===void 0)return;r=o.schema}return r}function b(e,n){return e.kind==="scalar"||e.kind==="enum"?e.scalar==="string":e.kind==="literal"?typeof e.value=="string":e.kind==="union"?e.members.every(s=>{let r=O(s,n);return r!==void 0&&(r.kind==="null"||r.kind!=="union"&&b(r,n))}):!1}var G={"types.ts":`/**
7
+ import{c as x,ia as R}from"./ACMV5RZA.js";import{m}from"./UW4UC7ZI.js";function C(e){return e.flatMap(n=>n.operations)}function P(e,n,o){let r=e.specName??e.name;if(o?.exclude?.includes(r))return{};let a=o?.operations?.[r];if(a!==void 0)return b(e,n,a,`pagination.operations["${r}"]`,!0);if(e.paginationExtension!==void 0)return b(e,n,e.paginationExtension,"x-redoclyPagination",!0);if(o?.style!==void 0){let{exclude:s,operations:c,...t}=o;return b(e,n,t,"pagination convention",!1)}return{}}function H(e,n){let o=new Map,r=[];for(let a of C(e.services)){let s=P(a,e,n);s.error!==void 0?r.push(s.error):s.spec!==void 0&&o.set(a.name,{spec:s.spec,itemSchema:s.itemSchema})}if(r.length>0)throw new Error(["Invalid pagination configuration:",...r].join(`
8
+ - `));return o}function b(e,n,o,r,a){let s=`Pagination for operation "${e.name}" (${r})`,c=q(o);if(c!==void 0)return{error:`${s}: ${c}`};let t=o,i=d=>a?{error:`${s}: ${d}`}:{};if(e.sse!==void 0)return i("the operation is a Server-Sent Events stream");if(t.style!=="link"&&t.style!=="body-link"){let d=t.style==="cursor"?"cursorParam":"offsetParam",l=t.style==="cursor"?t.cursorParam:t.offsetParam,k=e.queryParams.find(u=>u.name===l);if(!k){let u=e.queryParams.map(E=>E.name).join(", ");return i(`query parameter "${l}" is not declared on the operation`+(u===""?"":` (declared: ${u})`))}let p=O(k.schema,n);if(!(p!==void 0&&(t.style==="cursor"?y(p,n):p.kind==="scalar"&&(p.scalar==="number"||p.scalar==="integer")))){let u=t.style==="cursor"?"a string":"a number";return i(`the "${d}" query parameter "${l}" must accept ${u} (got ${I(p)})`)}}let g=e.successResponses.find(d=>d.contentType.toLowerCase().includes("json"));if(!g)return i("the operation has no JSON success response");if(t.style==="link"){let d=e.successResponseHeaders?.some(l=>l.name==="link")===!0;if(!d&&!a)return{};d||R.warn(`generate-client: ${s.toLowerCase()} follows the Link header, but the success response does not document one.
9
+ `)}let h=m(g.schema,t.items,n);if(h===void 0)return i(`the "items" pointer "${t.items}" does not resolve in the success response schema`);if(h.kind!=="array")return i(`the "items" pointer "${t.items}" must point at an array (got ${h.kind})`);if(t.style==="body-link"){let d=m(g.schema,t.nextLink,n);if(d===void 0)return i(`the "nextLink" pointer "${t.nextLink}" does not resolve in the success response schema`);if(!y(d,n))return i(`the "nextLink" pointer "${t.nextLink}" must point at a string (got ${d.kind})`)}if(t.style==="cursor"){let d=m(g.schema,t.nextCursor,n);if(d===void 0)return i(`the "nextCursor" pointer "${t.nextCursor}" does not resolve in the success response schema`);if(!y(d,n))return i(`the "nextCursor" pointer "${t.nextCursor}" must point at a string (got ${d.kind})`);if(t.hasMore!==void 0){let l=m(g.schema,t.hasMore,n);if(l===void 0)return i(`the "hasMore" pointer "${t.hasMore}" does not resolve in the success response schema`);if(l.kind!=="scalar"||l.scalar!=="boolean")return i(`the "hasMore" pointer "${t.hasMore}" must point at a boolean (got ${l.kind})`)}}let f=t.limitParam!==void 0?{limitParam:t.limitParam}:{};return{spec:t.style==="cursor"?{style:"cursor",param:t.cursorParam,...f,nextCursor:t.nextCursor,...t.hasMore!==void 0?{hasMore:t.hasMore}:{},items:t.items}:t.style==="link"?{style:"link",...f,items:t.items}:t.style==="body-link"?{style:"body-link",...f,nextLink:t.nextLink,items:t.items}:{style:t.style,param:t.offsetParam,...f,items:t.items},itemSchema:h.items}}function q(e){if(!x(e))return"the rule must be an object";let{style:n,cursorParam:o,nextCursor:r,hasMore:a,offsetParam:s,nextLink:c,limitParam:t,items:i}=e;if(n!=="cursor"&&n!=="offset"&&n!=="page"&&n!=="link"&&n!=="body-link")return`"style" must be one of "cursor" | "offset" | "page" | "link" | "body-link" (got ${JSON.stringify(n)})`;if(typeof i!="string"||i!==""&&!i.startsWith("/"))return'"items" must be a JSON pointer starting with "/" (or "" when the response body is the item array itself)';if(n==="cursor"){if(typeof o!="string"||o==="")return'cursor style requires a "cursorParam" query parameter name';if(typeof r!="string"||!r.startsWith("/"))return'cursor style requires a "nextCursor" JSON pointer starting with "/"';if(a!==void 0&&(typeof a!="string"||!a.startsWith("/")))return'"hasMore" must be a JSON pointer starting with "/"'}else if(n==="offset"||n==="page"){if(typeof s!="string"||s==="")return`${n} style requires an "offsetParam" query parameter name`}else if(n==="body-link"&&(typeof c!="string"||!c.startsWith("/")))return'body-link style requires a "nextLink" JSON pointer starting with "/"';if(t!==void 0&&typeof t!="string")return'"limitParam" must be a query parameter name'}function I(e){return e===void 0?"an unresolvable ref":e.kind==="scalar"||e.kind==="enum"?e.scalar:e.kind}function O(e,n){let o=new Set,r=e;for(;r.kind==="ref";){let{name:a}=r;if(o.has(a))return;o.add(a);let s=n.schemas.find(c=>c.name===a);if(s===void 0)return;r=s.schema}return r}function y(e,n){return e.kind==="scalar"||e.kind==="enum"?e.scalar==="string":e.kind==="literal"?typeof e.value=="string":e.kind==="union"?e.members.every(o=>{let r=O(o,n);return r!==void 0&&(r.kind==="null"||r.kind!=="union"&&y(r,n))}):!1}var G={"types.ts":`/**
10
10
  * The public type surface of the client runtime \u2014 \`@redocly/client-generator\`'s
11
11
  * app-facing runtime module. Pure types, no runtime code (excluded from coverage).
12
12
  * The generator emits \`OPERATIONS\` literals typed
@@ -30,7 +30,7 @@ export type SecuritySpec =
30
30
 
31
31
  /**
32
32
  * How to auto-iterate a paginated operation (drives its \`.pages()\`/\`.items()\` members).
33
- * \`nextCursor\` and \`items\` are RFC 6901 JSON pointers into the page (response) value.
33
+ * \`nextCursor\`, \`nextLink\`, and \`items\` are RFC 6901 JSON pointers into the page (response) value.
34
34
  */
35
35
  export type PaginationSpec =
36
36
  | {
@@ -62,6 +62,16 @@ export type PaginationSpec =
62
62
  limitParam?: string;
63
63
  /** Pointer to the page's item array. */
64
64
  items: string;
65
+ }
66
+ | {
67
+ /** Follow the next page's URL at \`nextLink\` in the page; stop when it is absent. */
68
+ style: 'body-link';
69
+ /** Optional page-size query param (recorded for tooling; never set by the runtime). */
70
+ limitParam?: string;
71
+ /** Pointer to the next page's URL in the page. */
72
+ nextLink: string;
73
+ /** Pointer to the page's item array. */
74
+ items: string;
65
75
  };
66
76
 
67
77
  /** The frozen data contract between generated code and the runtime: one operation's wire shape. */
@@ -813,6 +823,42 @@ export function middlewareChain(config: ClientConfig): Middleware[] {
813
823
  return [...single, ...(config.middleware ?? [])];
814
824
  }
815
825
 
826
+ /**
827
+ * \`AbortSignal.timeout()\` where the platform has it, else an \`AbortController\` armed by
828
+ * \`setTimeout\`: Chrome before 103, Safari before 16, and Firefox before 100 lack the
829
+ * static, and every request with a timeout would throw before \`fetch\` runs.
830
+ */
831
+ function timeoutSignal(ms: number): AbortSignal {
832
+ if (typeof AbortSignal.timeout === 'function') return AbortSignal.timeout(ms);
833
+ const controller = new AbortController();
834
+ setTimeout(() => {
835
+ controller.abort(new DOMException(\`Timed out after \${ms} ms\`, 'TimeoutError'));
836
+ }, ms);
837
+ return controller.signal;
838
+ }
839
+
840
+ /**
841
+ * \`AbortSignal.any()\` where the platform has it, else a controller that follows whichever
842
+ * signal aborts first: Chrome before 116, Safari before 17.4, and Firefox before 124 lack
843
+ * the static. The listeners come off once one signal fires, so a caller's long-lived
844
+ * signal does not keep one per request.
845
+ */
846
+ function anySignal(signals: AbortSignal[]): AbortSignal {
847
+ if (typeof AbortSignal.any === 'function') return AbortSignal.any(signals);
848
+ const controller = new AbortController();
849
+ const listeners = new Map<AbortSignal, () => void>();
850
+ const abort = (reason: unknown) => {
851
+ for (const [signal, listener] of listeners) signal.removeEventListener('abort', listener);
852
+ controller.abort(reason);
853
+ };
854
+ for (const signal of signals) {
855
+ const listener = () => abort(signal.reason);
856
+ listeners.set(signal, listener);
857
+ signal.addEventListener('abort', listener);
858
+ }
859
+ return controller.signal;
860
+ }
861
+
816
862
  /**
817
863
  * The fetch core shared by every operation: default + config + per-call headers, the
818
864
  * \`onRequest\` chain (BEFORE body serialization, so mutations are sent), body
@@ -933,11 +979,8 @@ export async function send(
933
979
  if (signal?.aborted) throw abortError(signal);
934
980
  // A fresh timeout budget per attempt; the caller's signal still wins the race.
935
981
  // The composed signal also governs reading the response body.
936
- const attemptSignal = timeout
937
- ? signal
938
- ? AbortSignal.any([signal, AbortSignal.timeout(timeout)])
939
- : AbortSignal.timeout(timeout)
940
- : signal;
982
+ const budget = timeout ? timeoutSignal(timeout) : undefined;
983
+ const attemptSignal = budget && signal ? anySignal([signal, budget]) : (budget ?? signal);
941
984
  let response: Response;
942
985
  try {
943
986
  response = await doFetch(context.url, {
@@ -950,6 +993,10 @@ export async function send(
950
993
  body: payload,
951
994
  });
952
995
  } catch (error) {
996
+ // Decided before any await, when no timer can have fired since \`fetch\` rejected: an
997
+ // aborted budget means this attempt timed out. The abort reason's name is no
998
+ // evidence, because Chrome 103 to 123 abort a timeout with \`AbortError\`.
999
+ const timedOut = timeout !== undefined && budget?.aborted && !signal?.aborted;
953
1000
  if (
954
1001
  attempt < maxAttempts &&
955
1002
  !signal?.aborted &&
@@ -960,14 +1007,7 @@ export async function send(
960
1007
  }
961
1008
  // Our timeout fired (never the caller's own abort \u2014 that rethrows untouched):
962
1009
  // wrap the bare DOMException with the context a log line needs.
963
- if (
964
- timeout &&
965
- !signal?.aborted &&
966
- error instanceof DOMException &&
967
- error.name === 'TimeoutError'
968
- ) {
969
- throw new TimeoutError(op.id, timeout, attempt);
970
- }
1010
+ if (timedOut) throw new TimeoutError(op.id, timeout, attempt);
971
1011
  throw error;
972
1012
  }
973
1013
  // Reverse order: the last-registered middleware wraps closest to the network (onion).
@@ -1228,6 +1268,7 @@ export type Capabilities = SendCapabilities & {
1228
1268
  args?: OperationArgs,
1229
1269
  init?: RequestOptions
1230
1270
  ) => Promise<{ page: unknown; linkHeader: string | null; url: string }>,
1271
+ spec: PaginationSpec,
1231
1272
  args?: OperationArgs,
1232
1273
  init?: RequestOptions
1233
1274
  ) => AsyncGenerator<unknown>;
@@ -1675,11 +1716,12 @@ export function createClientCore<
1675
1716
  client[name] =
1676
1717
  spec === undefined
1677
1718
  ? method
1678
- : spec.style === 'link'
1719
+ : spec.style === 'link' || spec.style === 'body-link'
1679
1720
  ? Object.assign(method, {
1680
1721
  pages: (args?: OperationArgs, init?: RequestOptions) =>
1681
1722
  paginateCapability(caps, op).pagesByLink(
1682
1723
  linkPageCall(config, op, caps),
1724
+ spec,
1683
1725
  inputOf(op, args ?? {}, config),
1684
1726
  init
1685
1727
  ),
@@ -1823,9 +1865,9 @@ export async function* pages<TPage>(
1823
1865
  }
1824
1866
  cursor = next;
1825
1867
  }
1826
- } else if (spec.style === 'link') {
1827
- // \`link\` iteration needs the response's \`Link\` header, which the parsed-page \`call\`
1828
- // cannot carry \u2014 the client wires those operations to \`pagesByLink\` instead.
1868
+ } else if (spec.style === 'link' || spec.style === 'body-link') {
1869
+ // Link iteration needs the response's \`Link\` header and the page URL, which the
1870
+ // parsed-page \`call\` cannot carry \u2014 the client wires those operations to \`pagesByLink\`.
1829
1871
  throw new Error('link-style pagination iterates via pagesByLink');
1830
1872
  } else {
1831
1873
  // Coerce the starting position to a number: a caller may pass \`query[spec.param]\` as a
@@ -1874,7 +1916,7 @@ export async function* items<TItem>(
1874
1916
 
1875
1917
  /**
1876
1918
  * The per-page call the \`link\`-style iterators drive: the parsed page plus the raw
1877
- * \`Link\` header and the page's own URL (for resolving a relative \`next\` target).
1919
+ * \`Link\` header and the page's own URL (for resolving a relative next-page target).
1878
1920
  */
1879
1921
  export type LinkPageCall = (
1880
1922
  args?: OperationArgs,
@@ -1897,25 +1939,32 @@ export function linkNext(header: string | null): string | undefined {
1897
1939
  }
1898
1940
 
1899
1941
  /**
1900
- * Iterate a \`link\`-style operation's pages: follow the \`Link\` header's \`rel="next"\`
1901
- * target by merging ITS query params into the next call \u2014 every page goes through the
1902
- * same declared endpoint, so auth, middleware, and \`serverUrl\` handling apply
1942
+ * Iterate a \`link\`- or \`body-link\`-style operation's pages: follow the next page's URL \u2014
1943
+ * the \`Link\` header's \`rel="next"\` target (\`link\`), or the value at the \`nextLink\` pointer
1944
+ * (\`body-link\`) \u2014 by merging ITS query params into the next call. Every page goes through
1945
+ * the same declared endpoint, so auth, middleware, and \`serverUrl\` handling apply
1903
1946
  * unchanged, and credentials can never be handed to a cross-origin \`next\` URL.
1904
- * Stops when no \`rel="next"\` is present; throws when the link does not advance
1905
- * (the same target twice, or a self-link \u2014 an infinite-loop guard).
1947
+ * Stops when there is no next URL (\`body-link\`: \`undefined\`/\`null\`/\`''\`); throws when a
1948
+ * \`nextLink\` value is not a string, or when the link does not advance (the same target
1949
+ * twice, or a self-link \u2014 an infinite-loop guard).
1906
1950
  */
1907
1951
  export async function* pagesByLink<TPage>(
1908
1952
  call: LinkPageCall,
1953
+ spec: PaginationSpec,
1909
1954
  args: OperationArgs = {},
1910
1955
  init?: RequestOptions
1911
1956
  ): AsyncGenerator<TPage> {
1957
+ const pointer = spec.style === 'body-link' ? spec.nextLink : undefined;
1912
1958
  let query = args.query;
1913
1959
  let previous: string | undefined;
1914
1960
  while (true) {
1915
1961
  const { page, linkHeader, url } = await call({ ...args, query }, init);
1916
1962
  yield page as TPage;
1917
- const target = linkNext(linkHeader);
1918
- if (target === undefined) return;
1963
+ const target = pointer === undefined ? linkNext(linkHeader) : resolvePointer(page, pointer);
1964
+ if (target === undefined || target === null || target === '') return;
1965
+ if (typeof target !== 'string') {
1966
+ throw new Error(\`Pagination link at \${pointer} is not a string\`);
1967
+ }
1919
1968
  // A relative target resolves against the page's own URL (RFC 8288 \xA73.1) \u2014 which may
1920
1969
  // itself be relative (relative \`serverUrl\`, mocked fetch), so both resolve against a
1921
1970
  // placeholder origin. It never reaches the wire: only the target's query params
@@ -1946,7 +1995,7 @@ export async function* itemsByLink<TItem>(
1946
1995
  args?: OperationArgs,
1947
1996
  init?: RequestOptions
1948
1997
  ): AsyncGenerator<TItem> {
1949
- for await (const page of pagesByLink(call, args, init)) {
1998
+ for await (const page of pagesByLink(call, spec, args, init)) {
1950
1999
  const pageItems = resolvePointer(page, spec.items);
1951
2000
  if (Array.isArray(pageItems)) yield* pageItems as TItem[];
1952
2001
  }
@@ -2782,7 +2831,7 @@ export type SecuritySpec =
2782
2831
 
2783
2832
  /**
2784
2833
  * How to auto-iterate a paginated operation (drives its \`.pages()\`/\`.items()\` members).
2785
- * \`nextCursor\` and \`items\` are RFC 6901 JSON pointers into the page (response) value.
2834
+ * \`nextCursor\`, \`nextLink\`, and \`items\` are RFC 6901 JSON pointers into the page (response) value.
2786
2835
  */
2787
2836
  export type PaginationSpec =
2788
2837
  | {
@@ -2814,6 +2863,16 @@ export type PaginationSpec =
2814
2863
  limitParam?: string;
2815
2864
  /** Pointer to the page's item array. */
2816
2865
  items: string;
2866
+ }
2867
+ | {
2868
+ /** Follow the next page's URL at \`nextLink\` in the page; stop when it is absent. */
2869
+ style: 'body-link';
2870
+ /** Optional page-size query param (recorded for tooling; never set by the runtime). */
2871
+ limitParam?: string;
2872
+ /** Pointer to the next page's URL in the page. */
2873
+ nextLink: string;
2874
+ /** Pointer to the page's item array. */
2875
+ items: string;
2817
2876
  };
2818
2877
 
2819
2878
  /** The frozen data contract between generated code and the runtime: one operation's wire shape. */
@@ -3535,6 +3594,42 @@ function middlewareChain(config: ClientConfig): Middleware[] {
3535
3594
  return [...single, ...(config.middleware ?? [])];
3536
3595
  }
3537
3596
 
3597
+ /**
3598
+ * \`AbortSignal.timeout()\` where the platform has it, else an \`AbortController\` armed by
3599
+ * \`setTimeout\`: Chrome before 103, Safari before 16, and Firefox before 100 lack the
3600
+ * static, and every request with a timeout would throw before \`fetch\` runs.
3601
+ */
3602
+ function timeoutSignal(ms: number): AbortSignal {
3603
+ if (typeof AbortSignal.timeout === 'function') return AbortSignal.timeout(ms);
3604
+ const controller = new AbortController();
3605
+ setTimeout(() => {
3606
+ controller.abort(new DOMException(\`Timed out after \${ms} ms\`, 'TimeoutError'));
3607
+ }, ms);
3608
+ return controller.signal;
3609
+ }
3610
+
3611
+ /**
3612
+ * \`AbortSignal.any()\` where the platform has it, else a controller that follows whichever
3613
+ * signal aborts first: Chrome before 116, Safari before 17.4, and Firefox before 124 lack
3614
+ * the static. The listeners come off once one signal fires, so a caller's long-lived
3615
+ * signal does not keep one per request.
3616
+ */
3617
+ function anySignal(signals: AbortSignal[]): AbortSignal {
3618
+ if (typeof AbortSignal.any === 'function') return AbortSignal.any(signals);
3619
+ const controller = new AbortController();
3620
+ const listeners = new Map<AbortSignal, () => void>();
3621
+ const abort = (reason: unknown) => {
3622
+ for (const [signal, listener] of listeners) signal.removeEventListener('abort', listener);
3623
+ controller.abort(reason);
3624
+ };
3625
+ for (const signal of signals) {
3626
+ const listener = () => abort(signal.reason);
3627
+ listeners.set(signal, listener);
3628
+ signal.addEventListener('abort', listener);
3629
+ }
3630
+ return controller.signal;
3631
+ }
3632
+
3538
3633
  /**
3539
3634
  * The fetch core shared by every operation: default + config + per-call headers, the
3540
3635
  * \`onRequest\` chain (BEFORE body serialization, so mutations are sent), body
@@ -3655,11 +3750,8 @@ async function send(
3655
3750
  if (signal?.aborted) throw abortError(signal);
3656
3751
  // A fresh timeout budget per attempt; the caller's signal still wins the race.
3657
3752
  // The composed signal also governs reading the response body.
3658
- const attemptSignal = timeout
3659
- ? signal
3660
- ? AbortSignal.any([signal, AbortSignal.timeout(timeout)])
3661
- : AbortSignal.timeout(timeout)
3662
- : signal;
3753
+ const budget = timeout ? timeoutSignal(timeout) : undefined;
3754
+ const attemptSignal = budget && signal ? anySignal([signal, budget]) : (budget ?? signal);
3663
3755
  let response: Response;
3664
3756
  try {
3665
3757
  response = await doFetch(context.url, {
@@ -3672,6 +3764,10 @@ async function send(
3672
3764
  body: payload,
3673
3765
  });
3674
3766
  } catch (error) {
3767
+ // Decided before any await, when no timer can have fired since \`fetch\` rejected: an
3768
+ // aborted budget means this attempt timed out. The abort reason's name is no
3769
+ // evidence, because Chrome 103 to 123 abort a timeout with \`AbortError\`.
3770
+ const timedOut = timeout !== undefined && budget?.aborted && !signal?.aborted;
3675
3771
  if (
3676
3772
  attempt < maxAttempts &&
3677
3773
  !signal?.aborted &&
@@ -3682,14 +3778,7 @@ async function send(
3682
3778
  }
3683
3779
  // Our timeout fired (never the caller's own abort \u2014 that rethrows untouched):
3684
3780
  // wrap the bare DOMException with the context a log line needs.
3685
- if (
3686
- timeout &&
3687
- !signal?.aborted &&
3688
- error instanceof DOMException &&
3689
- error.name === 'TimeoutError'
3690
- ) {
3691
- throw new TimeoutError(op.id, timeout, attempt);
3692
- }
3781
+ if (timedOut) throw new TimeoutError(op.id, timeout, attempt);
3693
3782
  throw error;
3694
3783
  }
3695
3784
  // Reverse order: the last-registered middleware wraps closest to the network (onion).
@@ -3919,6 +4008,7 @@ type Capabilities = SendCapabilities & {
3919
4008
  args?: OperationArgs,
3920
4009
  init?: RequestOptions
3921
4010
  ) => Promise<{ page: unknown; linkHeader: string | null; url: string }>,
4011
+ spec: PaginationSpec,
3922
4012
  args?: OperationArgs,
3923
4013
  init?: RequestOptions
3924
4014
  ) => AsyncGenerator<unknown>;
@@ -4366,11 +4456,12 @@ function createClientCore<
4366
4456
  client[name] =
4367
4457
  spec === undefined
4368
4458
  ? method
4369
- : spec.style === 'link'
4459
+ : spec.style === 'link' || spec.style === 'body-link'
4370
4460
  ? Object.assign(method, {
4371
4461
  pages: (args?: OperationArgs, init?: RequestOptions) =>
4372
4462
  paginateCapability(caps, op).pagesByLink(
4373
4463
  linkPageCall(config, op, caps),
4464
+ spec,
4374
4465
  inputOf(op, args ?? {}, config),
4375
4466
  init
4376
4467
  ),
@@ -4510,9 +4601,9 @@ async function* pages<TPage>(
4510
4601
  }
4511
4602
  cursor = next;
4512
4603
  }
4513
- } else if (spec.style === 'link') {
4514
- // \`link\` iteration needs the response's \`Link\` header, which the parsed-page \`call\`
4515
- // cannot carry \u2014 the client wires those operations to \`pagesByLink\` instead.
4604
+ } else if (spec.style === 'link' || spec.style === 'body-link') {
4605
+ // Link iteration needs the response's \`Link\` header and the page URL, which the
4606
+ // parsed-page \`call\` cannot carry \u2014 the client wires those operations to \`pagesByLink\`.
4516
4607
  throw new Error('link-style pagination iterates via pagesByLink');
4517
4608
  } else {
4518
4609
  // Coerce the starting position to a number: a caller may pass \`query[spec.param]\` as a
@@ -4561,7 +4652,7 @@ async function* items<TItem>(
4561
4652
 
4562
4653
  /**
4563
4654
  * The per-page call the \`link\`-style iterators drive: the parsed page plus the raw
4564
- * \`Link\` header and the page's own URL (for resolving a relative \`next\` target).
4655
+ * \`Link\` header and the page's own URL (for resolving a relative next-page target).
4565
4656
  */
4566
4657
  type LinkPageCall = (
4567
4658
  args?: OperationArgs,
@@ -4584,25 +4675,32 @@ function linkNext(header: string | null): string | undefined {
4584
4675
  }
4585
4676
 
4586
4677
  /**
4587
- * Iterate a \`link\`-style operation's pages: follow the \`Link\` header's \`rel="next"\`
4588
- * target by merging ITS query params into the next call \u2014 every page goes through the
4589
- * same declared endpoint, so auth, middleware, and \`serverUrl\` handling apply
4678
+ * Iterate a \`link\`- or \`body-link\`-style operation's pages: follow the next page's URL \u2014
4679
+ * the \`Link\` header's \`rel="next"\` target (\`link\`), or the value at the \`nextLink\` pointer
4680
+ * (\`body-link\`) \u2014 by merging ITS query params into the next call. Every page goes through
4681
+ * the same declared endpoint, so auth, middleware, and \`serverUrl\` handling apply
4590
4682
  * unchanged, and credentials can never be handed to a cross-origin \`next\` URL.
4591
- * Stops when no \`rel="next"\` is present; throws when the link does not advance
4592
- * (the same target twice, or a self-link \u2014 an infinite-loop guard).
4683
+ * Stops when there is no next URL (\`body-link\`: \`undefined\`/\`null\`/\`''\`); throws when a
4684
+ * \`nextLink\` value is not a string, or when the link does not advance (the same target
4685
+ * twice, or a self-link \u2014 an infinite-loop guard).
4593
4686
  */
4594
4687
  async function* pagesByLink<TPage>(
4595
4688
  call: LinkPageCall,
4689
+ spec: PaginationSpec,
4596
4690
  args: OperationArgs = {},
4597
4691
  init?: RequestOptions
4598
4692
  ): AsyncGenerator<TPage> {
4693
+ const pointer = spec.style === 'body-link' ? spec.nextLink : undefined;
4599
4694
  let query = args.query;
4600
4695
  let previous: string | undefined;
4601
4696
  while (true) {
4602
4697
  const { page, linkHeader, url } = await call({ ...args, query }, init);
4603
4698
  yield page as TPage;
4604
- const target = linkNext(linkHeader);
4605
- if (target === undefined) return;
4699
+ const target = pointer === undefined ? linkNext(linkHeader) : resolvePointer(page, pointer);
4700
+ if (target === undefined || target === null || target === '') return;
4701
+ if (typeof target !== 'string') {
4702
+ throw new Error(\`Pagination link at \${pointer} is not a string\`);
4703
+ }
4606
4704
  // A relative target resolves against the page's own URL (RFC 8288 \xA73.1) \u2014 which may
4607
4705
  // itself be relative (relative \`serverUrl\`, mocked fetch), so both resolve against a
4608
4706
  // placeholder origin. It never reaches the wire: only the target's query params
@@ -4633,7 +4731,7 @@ async function* itemsByLink<TItem>(
4633
4731
  args?: OperationArgs,
4634
4732
  init?: RequestOptions
4635
4733
  ): AsyncGenerator<TItem> {
4636
- for await (const page of pagesByLink(call, args, init)) {
4734
+ for await (const page of pagesByLink(call, spec, args, init)) {
4637
4735
  const pageItems = resolvePointer(page, spec.items);
4638
4736
  if (Array.isArray(pageItems)) yield* pageItems as TItem[];
4639
4737
  }
@@ -5443,4 +5541,4 @@ async function runSingle(
5443
5541
  }
5444
5542
  return fail(1, detail);
5445
5543
  }
5446
- }`},S=["ApiError","ApiErrorLike","AuthCredentials","BodyMethod","Capabilities","CliAuthScheme","CliCommand","CliFlag","CliGlobals","CliInvocation","CliWiring","Client","ClientConfig","ClientCore","CommandContext","CommandSource","CustomCommand","Envelope","EnvelopeResult","EnvelopeResultForKnownInit","FRAME_DELIMITER","GLOBAL_FLAGS","HeadersOf","IDEMPOTENT_METHODS","LAYERS","LAYER_OF","LinkPageCall","Middleware","NoRequiredKeys","OperationArgs","OperationContext","OperationDescriptor","OperationMethodIdentity","OpsShape","PageOf","Paginated","PaginationSpec","ParamSpec","ParseAs","QueryStyle","QueryValue","RequestContext","RequestOptions","ResolvedCommand","ResponseHeaderSpec","Result","RetryConfig","RetryContext","RetryStrategy","SecuritySpec","SendCapabilities","ServerSentEvent","SseOptions","SseParseError","TRANSIENT_STATUS","ThrowMethod","TimeoutError","TokenProvider","abortError","acceptFor","buildUrl","callInputs","coerceResponseHeader","commandContract","constantCase","createClientCore","defaultRetryOn","encodeBase64","encodeReserved","execute","groupSlug","inputOf","invokedName","isConfigured","items","itemsByLink","kindFor","linkNext","linkPageCall","loadBody","mergeSetup","middlewareChain","namespaceArgs","normalizeCommands","oneLine","pageCall","pages","pagesByLink","paginateCapability","parse","parseInvocation","parseSseFrame","prepareRequest","queryStyles","readEnvelopeHeaders","readError","redactHeaders","renderComposedHelp","renderHelp","resolveAuth","resolvePointer","resolveToken","retryDelay","runCli","runSingle","runSources","send","shadowedCommandName","sleep","splitArgs","sse","stringHeaders","substitutePath","toFormData","toHeaderRecord"];var j=["client","OPERATIONS","Ops","OperationId","OperationPath","OperationTag","createClient","mergeSetup","ApiError","TimeoutError","configure","use","auth","defaultRetryOn","ClientConfig","RequestOptions","SseOptions","Middleware","OperationDescriptor","ServerSentEvent","Result","Envelope","EnvelopeResult","TokenProvider","__redoclySetup"],$=["z","http","HttpResponse","handlers","faker","queryOptions","useSWR","useSWRMutation","__Writable"],N=["AbortSignal","Array","ArrayBuffer","ArrayBufferView","AsyncGenerator","AsyncIterable","Blob","BodyInit","Boolean","DOMException","Date","Error","Extract","FormData","Headers","HeadersInit","JSON","Map","Math","NonNullable","Number","Object","Omit","Partial","Promise","ReadableStream","Record","RegExp","RegExpExecArray","Request","RequestInit","Response","Set","String","Symbol","TextDecoder","TextEncoder","TypeError","Uint8Array","URL","URLSearchParams","btoa","clearTimeout","crypto","decodeURIComponent","document","encodeURIComponent","fetch","globalThis","setTimeout","undefined"],w;function Q(){return w===void 0&&(w=new Set([...j,...$,...N,...S])),w}var A={name:"@redocly/client-generator",version:"0.5.2",description:"Generate typed, zero-dependency TypeScript clients (fetch, auth, retries, middleware, SSE) from OpenAPI descriptions.",type:"module",types:"lib/index.d.ts",sideEffects:!1,exports:{".":{types:"./lib/index.d.ts",import:"./lib/index.js",default:"./lib/index.js"},"./generate":{types:"./lib/generate.d.ts",import:"./lib/generate.js",default:"./lib/generate.js"},"./printers/python":{types:"./lib/printers/python.d.ts",import:"./lib/printers/python.js",default:"./lib/printers/python.js"},"./printers/go":{types:"./lib/printers/go.d.ts",import:"./lib/printers/go.js",default:"./lib/printers/go.js"},"./printers/php":{types:"./lib/printers/php.d.ts",import:"./lib/printers/php.js",default:"./lib/printers/php.js"},"./printers/typescript":{types:"./lib/printers/typescript.d.ts",import:"./lib/printers/typescript.js",default:"./lib/printers/typescript.js"},"./printers":{types:"./lib/printers/index.d.ts",import:"./lib/printers/index.js",default:"./lib/printers/index.js"},"./contracts/typescript":{types:"./lib/contracts/typescript.d.ts",import:"./lib/contracts/typescript.js",default:"./lib/contracts/typescript.js"},"./runtime-sources":{types:"./lib/runtime-sources.d.ts",import:"./lib/runtime-sources.js",default:"./lib/runtime-sources.js"},"./package.json":"./package.json"},engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,scripts:{"examples:regen":"node scripts/regenerate-examples.mjs",prepare:"node scripts/generate-runtime-sources.mjs && node scripts/generate-eject-assets.mjs","typecheck:examples":"node scripts/typecheck-examples.mjs"},license:"MIT",repository:{type:"git",url:"git+https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["OpenAPI","Swagger","TypeScript","client","generator","codegen","fetch"],contributors:["Roman Marshevskyi <roman.marshevskyy@redocly.com> (https://redocly.com/)"],dependencies:{"@redocly/openapi-core":"2.62.1"},peerDependencies:{typescript:">=5.5.0"},peerDependenciesMeta:{typescript:{optional:!0}},devDependencies:{typescript:"6.0.2"},files:["lib","eject-assets"]};var ee=A.version;function T(e){let n=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(e.trim());return n===null?void 0:[Number(n[1]),Number(n[2]),Number(n[3])]}function v(e,n){return e[0]-n[0]||e[1]-n[1]||e[2]-n[2]}function ne(e,n){let s=/^[\^~]|^>=/.exec(n.trim())?.[0]??"",r=T(n.trim().slice(s.length)),a=T(e);if(!(r===void 0||a===void 0))return v(a,r)<0?!1:s===">="?!0:s===""?v(a,r)===0:s==="~"?a[0]===r[0]&&a[1]===r[1]:r[0]!==0?a[0]===r[0]:r[1]!==0?a[0]===0&&a[1]===r[1]:v(a,r)===0}export{C as a,H as b,G as c,W as d,j as e,Q as f,ee as g,ne as h};
5544
+ }`},S=["ApiError","ApiErrorLike","AuthCredentials","BodyMethod","Capabilities","CliAuthScheme","CliCommand","CliFlag","CliGlobals","CliInvocation","CliWiring","Client","ClientConfig","ClientCore","CommandContext","CommandSource","CustomCommand","Envelope","EnvelopeResult","EnvelopeResultForKnownInit","FRAME_DELIMITER","GLOBAL_FLAGS","HeadersOf","IDEMPOTENT_METHODS","LAYERS","LAYER_OF","LinkPageCall","Middleware","NoRequiredKeys","OperationArgs","OperationContext","OperationDescriptor","OperationMethodIdentity","OpsShape","PageOf","Paginated","PaginationSpec","ParamSpec","ParseAs","QueryStyle","QueryValue","RequestContext","RequestOptions","ResolvedCommand","ResponseHeaderSpec","Result","RetryConfig","RetryContext","RetryStrategy","SecuritySpec","SendCapabilities","ServerSentEvent","SseOptions","SseParseError","TRANSIENT_STATUS","ThrowMethod","TimeoutError","TokenProvider","abortError","acceptFor","anySignal","buildUrl","callInputs","coerceResponseHeader","commandContract","constantCase","createClientCore","defaultRetryOn","encodeBase64","encodeReserved","execute","groupSlug","inputOf","invokedName","isConfigured","items","itemsByLink","kindFor","linkNext","linkPageCall","loadBody","mergeSetup","middlewareChain","namespaceArgs","normalizeCommands","oneLine","pageCall","pages","pagesByLink","paginateCapability","parse","parseInvocation","parseSseFrame","prepareRequest","queryStyles","readEnvelopeHeaders","readError","redactHeaders","renderComposedHelp","renderHelp","resolveAuth","resolvePointer","resolveToken","retryDelay","runCli","runSingle","runSources","send","shadowedCommandName","sleep","splitArgs","sse","stringHeaders","substitutePath","timeoutSignal","toFormData","toHeaderRecord"];var j=["client","OPERATIONS","Ops","OperationId","OperationPath","OperationTag","createClient","mergeSetup","ApiError","TimeoutError","configure","use","auth","defaultRetryOn","ClientConfig","RequestOptions","SseOptions","Middleware","OperationDescriptor","ServerSentEvent","Result","Envelope","EnvelopeResult","TokenProvider","__redoclySetup"],$=["z","http","HttpResponse","handlers","faker","queryOptions","useSWR","useSWRMutation","__Writable"],L=["AbortController","AbortSignal","Array","ArrayBuffer","ArrayBufferView","AsyncGenerator","AsyncIterable","Blob","BodyInit","Boolean","DOMException","Date","Error","Extract","FormData","Headers","HeadersInit","JSON","Map","Math","NonNullable","Number","Object","Omit","Partial","Promise","ReadableStream","Record","RegExp","RegExpExecArray","Request","RequestInit","Response","Set","String","Symbol","TextDecoder","TextEncoder","TypeError","Uint8Array","URL","URLSearchParams","btoa","clearTimeout","crypto","decodeURIComponent","document","encodeURIComponent","fetch","globalThis","setTimeout","undefined"],w;function Q(){return w===void 0&&(w=new Set([...j,...$,...L,...S])),w}var A={name:"@redocly/client-generator",version:"0.6.0",description:"Generate typed, zero-dependency TypeScript clients (fetch, auth, retries, middleware, SSE) from OpenAPI descriptions.",type:"module",types:"lib/index.d.ts",sideEffects:!1,exports:{".":{types:"./lib/index.d.ts",import:"./lib/index.js",default:"./lib/index.js"},"./generate":{types:"./lib/generate.d.ts",import:"./lib/generate.js",default:"./lib/generate.js"},"./printers/python":{types:"./lib/printers/python.d.ts",import:"./lib/printers/python.js",default:"./lib/printers/python.js"},"./printers/go":{types:"./lib/printers/go.d.ts",import:"./lib/printers/go.js",default:"./lib/printers/go.js"},"./printers/php":{types:"./lib/printers/php.d.ts",import:"./lib/printers/php.js",default:"./lib/printers/php.js"},"./printers/typescript":{types:"./lib/printers/typescript.d.ts",import:"./lib/printers/typescript.js",default:"./lib/printers/typescript.js"},"./printers":{types:"./lib/printers/index.d.ts",import:"./lib/printers/index.js",default:"./lib/printers/index.js"},"./contracts/typescript":{types:"./lib/contracts/typescript.d.ts",import:"./lib/contracts/typescript.js",default:"./lib/contracts/typescript.js"},"./runtime-sources":{types:"./lib/runtime-sources.d.ts",import:"./lib/runtime-sources.js",default:"./lib/runtime-sources.js"},"./package.json":"./package.json"},engines:{node:">=22.12.0 || >=20.19.0 <21.0.0",npm:">=10"},engineStrict:!0,scripts:{"examples:regen":"node scripts/regenerate-examples.mjs",prepare:"node scripts/generate-runtime-sources.mjs && node scripts/generate-eject-assets.mjs","typecheck:examples":"node scripts/typecheck-examples.mjs"},license:"MIT",repository:{type:"git",url:"git+https://github.com/Redocly/redocly-cli.git"},homepage:"https://github.com/Redocly/redocly-cli",keywords:["OpenAPI","Swagger","TypeScript","client","generator","codegen","fetch"],contributors:["Roman Marshevskyi <roman.marshevskyy@redocly.com> (https://redocly.com/)"],dependencies:{"@redocly/openapi-core":"2.63.0"},peerDependencies:{typescript:">=5.5.0"},peerDependenciesMeta:{typescript:{optional:!0}},devDependencies:{typescript:"6.0.2"},files:["lib","eject-assets"]};var ee=A.version;function T(e){let n=/^(\d+)\.(\d+)\.(\d+)(?:[-+].*)?$/.exec(e.trim());return n===null?void 0:[Number(n[1]),Number(n[2]),Number(n[3])]}function v(e,n){return e[0]-n[0]||e[1]-n[1]||e[2]-n[2]}function ne(e,n){let o=/^[\^~]|^>=/.exec(n.trim())?.[0]??"",r=T(n.trim().slice(o.length)),a=T(e);if(!(r===void 0||a===void 0))return v(a,r)<0?!1:o===">="?!0:o===""?v(a,r)===0:o==="~"?a[0]===r[0]&&a[1]===r[1]:r[0]!==0?a[0]===r[0]:r[1]!==0?a[0]===0&&a[1]===r[1]:v(a,r)===0}export{C as a,H as b,G as c,W as d,j as e,Q as f,ee as g,ne as h};
@@ -4,4 +4,4 @@ import { dirname as __pathDirname } from 'node:path';
4
4
  const require = __createRequire(import.meta.url);
5
5
  var __filename = __fileURLToPath(import.meta.url);
6
6
  var __dirname = __pathDirname(__filename);
7
- import{c as r}from"./22EANOP2.js";var s="components",p="paths",i="webhooks",O="x-webhooks",c="channels",f="operations";function e(o,n){if(r(o)){n(o);for(let t of Object.keys(o))e(o[t],n)}else if(Array.isArray(o))for(let t of o)e(t,n)}function S(o){return o.startsWith(`#/${s}/`)}export{s as a,p as b,i as c,O as d,c as e,f,e as g,S as h};
7
+ import{c as r}from"./ACMV5RZA.js";var s="components",p="paths",i="webhooks",O="x-webhooks",c="channels",f="operations";function e(o,n){if(r(o)){n(o);for(let t of Object.keys(o))e(o[t],n)}else if(Array.isArray(o))for(let t of o)e(t,n)}function S(o){return o.startsWith(`#/${s}/`)}export{s as a,p as b,i as c,O as d,c as e,f,e as g,S as h};