@redocly/cli 2.62.2 → 2.64.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 (135) hide show
  1. package/THIRD_PARTY_NOTICES +1 -1
  2. package/lib/chunks/{37WWN4MA.js → 2DKR4Z25.js} +1 -1
  3. package/lib/chunks/{S6NFOZ34.js → 2MCPXKB6.js} +1 -1
  4. package/lib/chunks/2ZIICV4T.js +7 -0
  5. package/lib/chunks/3CSDNX6S.js +20 -0
  6. package/lib/chunks/{KOR5TUJG.js → 4EAF6XUQ.js} +1 -1
  7. package/lib/chunks/5PR7FNUB.js +59 -0
  8. package/lib/chunks/{5X35UU2C.js → 654FMWX6.js} +1 -1
  9. package/lib/chunks/{4AM55DEH.js → 6FADWAOY.js} +1 -1
  10. package/lib/chunks/{3FXYWWTJ.js → 6MP4DHWK.js} +1 -1
  11. package/lib/chunks/{SLQPKXO2.js → 7APJVQSB.js} +1 -1
  12. package/lib/chunks/{KRCCY64H.js → AC62H63B.js} +1 -1
  13. package/lib/chunks/{ZCVUIIPU.js → ALBI5SPY.js} +1 -1
  14. package/lib/chunks/{SXBAAS4M.js → B5ZOH4BB.js} +1 -1
  15. package/lib/chunks/{V2YF33JL.js → BGGUKU7E.js} +1 -1
  16. package/lib/chunks/{6EGJEFXO.js → BWXAXULF.js} +1 -1
  17. package/lib/chunks/{3JYQOGV3.js → CEASD5U3.js} +1 -1
  18. package/lib/chunks/{TBZEEKTV.js → CVPT656W.js} +1 -1
  19. package/lib/chunks/{5PG3ST2N.js → DL4VP2Z4.js} +2 -2
  20. package/lib/chunks/DPNI74SB.js +69 -0
  21. package/lib/chunks/{GWXT3QO6.js → ENIPOAVJ.js} +2 -2
  22. package/lib/chunks/{22EANOP2.js → EQTXHL74.js} +101 -101
  23. package/lib/chunks/{3WHXM4DJ.js → FU7GBMUU.js} +1 -1
  24. package/lib/chunks/{JLVGRO3I.js → FVGFKJ67.js} +7 -7
  25. package/lib/chunks/{73RBZL53.js → FXKIC5R3.js} +1 -1
  26. package/lib/chunks/{2OBVZIAW.js → GKCVQWOQ.js} +3 -3
  27. package/lib/chunks/{MNH2K4WM.js → GKSUZULD.js} +1 -1
  28. package/lib/chunks/GOTKYHFM.js +20 -0
  29. package/lib/chunks/{2XK7ML3U.js → GRTUPOKN.js} +1 -1
  30. package/lib/chunks/{XJE2OFDN.js → HAOBCQWB.js} +358 -19
  31. package/lib/chunks/{IUSSBOYO.js → HIII45WJ.js} +1 -1
  32. package/lib/chunks/{2OVI7BIW.js → HYMULX2S.js} +1 -1
  33. package/lib/chunks/{FDMXHRDK.js → I6NMWBVI.js} +1 -1
  34. package/lib/chunks/{SHZZKTDE.js → IH3N62Q4.js} +1 -1
  35. package/lib/chunks/{V3ILUN2S.js → J665DSDI.js} +1 -1
  36. package/lib/chunks/JQJ5TDVP.js +11 -0
  37. package/lib/chunks/{HWTYAU4Y.js → L5X7LBV6.js} +1 -1
  38. package/lib/chunks/{VXONEXYX.js → LCAJ35J6.js} +1 -1
  39. package/lib/chunks/{US7X4XPD.js → LG3SUXEW.js} +1 -1
  40. package/lib/chunks/{YDVWNFMS.js → LMO5V2XF.js} +1 -1
  41. package/lib/chunks/{XFBJHVYU.js → M4NCSK7Q.js} +1 -1
  42. package/lib/chunks/{RPHIT72T.js → M74SGAZK.js} +1 -1
  43. package/lib/chunks/{M3XPS7UF.js → MVCGBDOY.js} +1 -1
  44. package/lib/chunks/{HYE4U6V5.js → N4R4236N.js} +1 -1
  45. package/lib/chunks/{6NB3FKVN.js → NRWIPPEV.js} +1 -1
  46. package/lib/chunks/{3C6UUCEW.js → OGNRVBTI.js} +1 -1
  47. package/lib/chunks/{6MH5ZWLD.js → ONBORCDJ.js} +1 -1
  48. package/lib/chunks/{ENSYM7KY.js → OS52EARM.js} +1 -1
  49. package/lib/chunks/{6DO6IN4A.js → QCOPS234.js} +1 -1
  50. package/lib/chunks/{CQKQB4PJ.js → QWTSCCNH.js} +1 -1
  51. package/lib/chunks/{4OEXH5EV.js → RRQJCLNO.js} +1 -1
  52. package/lib/chunks/{HBENVUR4.js → RWDQI2KD.js} +1 -1
  53. package/lib/chunks/{I5CGSLGR.js → S3W5GQGC.js} +1 -1
  54. package/lib/chunks/{HUWKDZPP.js → SRRHJLPL.js} +1 -1
  55. package/lib/chunks/{7WM6VLB3.js → TTE4EAVV.js} +3 -2
  56. package/lib/chunks/{LRLGVYCG.js → TWFZE4OF.js} +1 -1
  57. package/lib/chunks/{OP7NIAI7.js → U4RAHOFK.js} +1 -1
  58. package/lib/chunks/{36IHQANV.js → UC5EDLXL.js} +1 -1
  59. package/lib/chunks/{TKLMYBPI.js → ULQK2S4O.js} +1 -1
  60. package/lib/chunks/{FDGP3ZYZ.js → UNOXQ62I.js} +363 -156
  61. package/lib/chunks/{6WZUCZGV.js → UQW6CW3M.js} +1 -1
  62. package/lib/chunks/{DS4SCWID.js → VKTRI5YG.js} +1 -1
  63. package/lib/chunks/{PTNNX4IU.js → VMIHLA3H.js} +1 -1
  64. package/lib/chunks/{WX24BERR.js → VWF52WKH.js} +1 -1
  65. package/lib/chunks/WKQJPOYW.js +7 -0
  66. package/lib/chunks/{SYWAPWW7.js → WQBSNQXL.js} +1 -1
  67. package/lib/chunks/{CIDSJFJO.js → X6TQQHRM.js} +1 -1
  68. package/lib/chunks/{XJTGJYVS.js → XDBFHG7X.js} +1 -1
  69. package/lib/chunks/{LVGVWPDB.js → XYU2LTWU.js} +1 -1
  70. package/lib/chunks/{2OQM5ARW.js → Z4X6WES7.js} +1 -1
  71. package/lib/chunks/{3JYY42DL.js → ZFXOCOU6.js} +1 -1
  72. package/lib/chunks/{3DEJQSYG.js → ZM3M44Q3.js} +1 -1
  73. package/lib/eject-assets/generators/cli/docs.ts +1 -1
  74. package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
  75. package/lib/eject-assets/generators/cli/index.ts +2 -2
  76. package/lib/eject-assets/generators/cli/render.ts +1 -1
  77. package/lib/eject-assets/generators/go/client.ts +1 -1
  78. package/lib/eject-assets/generators/go/descriptor.ts +2 -1
  79. package/lib/eject-assets/generators/go/index.ts +2 -2
  80. package/lib/eject-assets/generators/go/models.ts +1 -1
  81. package/lib/eject-assets/generators/go/naming.ts +1 -1
  82. package/lib/eject-assets/generators/go/operations.ts +1 -1
  83. package/lib/eject-assets/generators/go/pagination.ts +1 -1
  84. package/lib/eject-assets/generators/go/types.ts +1 -1
  85. package/lib/eject-assets/generators/mock/faker.ts +1 -1
  86. package/lib/eject-assets/generators/mock/index.ts +2 -2
  87. package/lib/eject-assets/generators/mock/render.ts +1 -1
  88. package/lib/eject-assets/generators/mock/sample.ts +1 -1
  89. package/lib/eject-assets/generators/mock/values.ts +1 -1
  90. package/lib/eject-assets/generators/php/client.ts +1 -1
  91. package/lib/eject-assets/generators/php/descriptor.ts +2 -1
  92. package/lib/eject-assets/generators/php/index.ts +2 -2
  93. package/lib/eject-assets/generators/php/models.ts +1 -1
  94. package/lib/eject-assets/generators/php/naming.ts +1 -1
  95. package/lib/eject-assets/generators/php/operations.ts +1 -1
  96. package/lib/eject-assets/generators/php/pagination.ts +1 -1
  97. package/lib/eject-assets/generators/php/types.ts +1 -1
  98. package/lib/eject-assets/generators/python/client.ts +1 -1
  99. package/lib/eject-assets/generators/python/descriptor.ts +2 -1
  100. package/lib/eject-assets/generators/python/index.ts +2 -2
  101. package/lib/eject-assets/generators/python/models.ts +1 -1
  102. package/lib/eject-assets/generators/python/naming.ts +1 -1
  103. package/lib/eject-assets/generators/python/operations.ts +1 -1
  104. package/lib/eject-assets/generators/python/pagination.ts +1 -1
  105. package/lib/eject-assets/generators/python/types.ts +1 -1
  106. package/lib/eject-assets/generators/swr/index.ts +2 -2
  107. package/lib/eject-assets/generators/swr/render.ts +1 -1
  108. package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
  109. package/lib/eject-assets/generators/tanstack-query/render.ts +56 -9
  110. package/lib/eject-assets/generators/transformers/index.ts +2 -2
  111. package/lib/eject-assets/generators/transformers/render.ts +1 -1
  112. package/lib/eject-assets/generators/typescript/banner.ts +1 -1
  113. package/lib/eject-assets/generators/typescript/client.ts +1 -1
  114. package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
  115. package/lib/eject-assets/generators/typescript/index.ts +29 -3
  116. package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
  117. package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
  118. package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
  119. package/lib/eject-assets/generators/typescript/operations.ts +1 -1
  120. package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
  121. package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
  122. package/lib/eject-assets/generators/typescript/types.ts +1 -1
  123. package/lib/eject-assets/generators/zod/index.ts +2 -2
  124. package/lib/eject-assets/generators/zod/schemas.ts +1 -1
  125. package/lib/eject-assets/skills/tanstack-query-generator/SKILL.md +5 -2
  126. package/lib/eject-assets/skills/typescript-generator/SKILL.md +24 -0
  127. package/lib/index.js +5 -5
  128. package/package.json +1 -1
  129. package/lib/chunks/5SIJI5LC.js +0 -42
  130. package/lib/chunks/7WTV5KH3.js +0 -67
  131. package/lib/chunks/EDQ6QRIB.js +0 -20
  132. package/lib/chunks/LCFG5N4V.js +0 -7
  133. package/lib/chunks/PWGFZ5ZK.js +0 -7
  134. package/lib/chunks/RU7T4CKG.js +0 -11
  135. package/lib/chunks/Z6GHMX6Z.js +0 -20
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "go" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — 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.5.3 — the built-in "mock" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — 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.5.3 — the built-in "mock" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — 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.5.3',
34
+ requiresGenerator: '^0.7.0',
35
35
  };
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "mock" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — 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.5.3 — the built-in "mock" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — 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.5.3 — the built-in "mock" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — 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.5.3 — the built-in "php" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — 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.5.3 — the built-in "php" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — 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`.
@@ -36,6 +36,7 @@ export function phpPaginationLiteral(rule: NeutralPaginationRule): string {
36
36
  ...(rule.param !== undefined ? [`'param' => ${phpString(rule.param)}`] : []),
37
37
  ...(rule.nextCursor !== undefined ? [`'nextCursor' => ${phpString(rule.nextCursor)}`] : []),
38
38
  ...(rule.hasMore !== undefined ? [`'hasMore' => ${phpString(rule.hasMore)}`] : []),
39
+ ...(rule.nextLink !== undefined ? [`'nextLink' => ${phpString(rule.nextLink)}`] : []),
39
40
  ...(rule.limitParam !== undefined ? [`'limitParam' => ${phpString(rule.limitParam)}`] : []),
40
41
  ...(rule.items !== undefined ? [`'items' => ${phpString(rule.items)}`] : []),
41
42
  ];
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "php" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — 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.5.3',
237
+ requiresGenerator: '^0.7.0',
238
238
  };
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "php" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — 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.5.3 — the built-in "php" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — 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.5.3 — the built-in "php" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — 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.5.3 — the built-in "php" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — 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.5.3 — the built-in "php" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — 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.5.3 — the built-in "python" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "python" 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 python --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "python" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "python" 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 python --update`.
@@ -31,6 +31,7 @@ export function paginationSpec(
31
31
  ...(rule.param !== undefined ? { param: rule.param } : {}),
32
32
  ...(rule.nextCursor !== undefined ? { next_cursor: rule.nextCursor } : {}),
33
33
  ...(rule.hasMore !== undefined ? { has_more: rule.hasMore } : {}),
34
+ ...(rule.nextLink !== undefined ? { next_link: rule.nextLink } : {}),
34
35
  ...(rule.limitParam !== undefined ? { limit_param: rule.limitParam } : {}),
35
36
  ...(rule.items !== undefined ? { items: rule.items } : {}),
36
37
  };
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "python" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "python" 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 python --update`.
@@ -247,5 +247,5 @@ export default {
247
247
  "argsStyle": "inputs follow the target language's own idiom",
248
248
  "importExt": "the generated file has no relative imports"
249
249
  },
250
- requiresGenerator: '^0.5.3',
250
+ requiresGenerator: '^0.7.0',
251
251
  };
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "python" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "python" 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 python --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "python" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "python" 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 python --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "python" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "python" 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 python --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "python" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "python" 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 python --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "python" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "python" 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 python --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "swr" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "swr" 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 swr --update`.
@@ -33,5 +33,5 @@ export default {
33
33
  run: swrGenerator,
34
34
  requires: ["typescript"],
35
35
  errorModes: ["throw"],
36
- requiresGenerator: '^0.5.3',
36
+ requiresGenerator: '^0.7.0',
37
37
  };
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "swr" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "swr" 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 swr --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "tanstack-query" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "tanstack-query" 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 tanstack-query --update`.
@@ -44,5 +44,5 @@ export default {
44
44
  run: tanstackQueryGenerator('react'),
45
45
  requires: ["typescript"],
46
46
  errorModes: ["throw"],
47
- requiresGenerator: '^0.5.3',
47
+ requiresGenerator: '^0.7.0',
48
48
  };
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "tanstack-query" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "tanstack-query" 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 tanstack-query --update`.
@@ -11,7 +11,7 @@
11
11
  // `<op>InfiniteOptions(vars, init?)` with `initialPageParam`/`getNextPageParam` compiled
12
12
  // from the pagination rule's JSON pointers. Per mutation: `<op>Mutation(init?)`. Calls go
13
13
  // through the client instance's methods, which take one input object in either
14
- // `--args-style`; only the infinite query's cursor override differs between them.
14
+ // `--args-style`; only the infinite query's page-param override differs between them.
15
15
  //
16
16
  // The factory bodies are authored as source text — the emitted module verbatim
17
17
  // and normalizes everything to the printer's canonical style. Every interpolated piece
@@ -58,6 +58,7 @@ export function renderTanstackModule(model: ApiModel, opts: TanstackOptions): st
58
58
  const pagination = opts.pagination ?? new Map();
59
59
  const source = [
60
60
  importHeader(ops, opts, pagination),
61
+ ...(ops.some((op) => isBodyLinkInfinite(op, pagination)) ? [NEXT_LINK_QUERY] : []),
61
62
  ...ops.filter(isQuery).map((op) => queryKeySource(op, opts.queryKeyPrefix)),
62
63
  factoriesSource(model, ops, pagination, opts.queryKeyPrefix, opts.argsStyle),
63
64
  ...defaultBindings(ops, pagination),
@@ -69,14 +70,36 @@ export function renderTanstackModule(model: ApiModel, opts: TanstackOptions): st
69
70
  * Whether the op gets an `<op>InfiniteOptions` factory: a paginated query operation.
70
71
  * `link`-style pagination is excluded — its next page lives in the `Link` response
71
72
  * HEADER, which a TanStack `queryFn` (body-only) cannot see; use the sdk's
72
- * `.pages()`/`.items()` iterators for those operations instead.
73
+ * `.pages()`/`.items()` iterators for those operations instead. `body-link` qualifies
74
+ * when the operation has a query parameter to carry the link's parameters.
73
75
  */
74
76
  function isInfinite(op: OperationModel, pagination: ModelPagination): boolean {
75
77
  if (!isQuery(op)) return false;
76
78
  const paginated = pagination.get(op.name);
77
- return paginated !== undefined && paginated.spec.style !== 'link';
79
+ if (paginated === undefined || paginated.spec.style === 'link') return false;
80
+ return paginated.spec.style !== 'body-link' || op.queryParams.length > 0;
78
81
  }
79
82
 
83
+ /** A query op whose `body-link` pagination gets an `<op>InfiniteOptions` factory. */
84
+ function isBodyLinkInfinite(op: OperationModel, pagination: ModelPagination): boolean {
85
+ return isInfinite(op, pagination) && pagination.get(op.name)?.spec.style === 'body-link';
86
+ }
87
+
88
+ /**
89
+ * The module-private helper a body-link `queryFn` merges the next page's query
90
+ * parameters with, the way the sdk's link iterator does: a repeated key becomes an array.
91
+ */
92
+ const NEXT_LINK_QUERY =
93
+ '/** The query parameters of a next-page link; a repeated key becomes an array. */\n' +
94
+ 'const nextLinkQuery = (link: string) => {\n' +
95
+ ' const query: Record<string, string | string[]> = {};\n' +
96
+ ' for (const [key, value] of new URL(link, "http://relative.invalid").searchParams) {\n' +
97
+ ' const seen = query[key];\n' +
98
+ ' query[key] = seen === undefined ? value : Array.isArray(seen) ? [...seen, value] : [seen, value];\n' +
99
+ ' }\n' +
100
+ ' return query;\n' +
101
+ '};';
102
+
80
103
  /**
81
104
  * The import header: the option helpers from `@tanstack/${framework}-query` (only the
82
105
  * ones used), then the sdk's `client` instance plus the referenced types.
@@ -133,9 +156,9 @@ function factoriesSource(
133
156
  ): string {
134
157
  const members = ops.flatMap((op) => {
135
158
  if (!isQuery(op)) return [mutationMember(op, prefix)];
136
- const paginated = pagination.get(op.name);
137
- return paginated !== undefined && paginated.spec.style !== 'link'
138
- ? [optionsMember(op), infiniteMember(model, op, paginated.spec, argsStyle)]
159
+ const spec = pagination.get(op.name)?.spec;
160
+ return spec !== undefined && spec.style !== 'link' && isInfinite(op, pagination)
161
+ ? [optionsMember(op), infiniteMember(model, op, spec, argsStyle)]
139
162
  : [optionsMember(op)];
140
163
  });
141
164
  return (
@@ -179,7 +202,8 @@ function mutationMember(op: OperationModel, prefix: string | undefined): string
179
202
  * page param rides the rule's advance query parameter, `initialPageParam` resumes from
180
203
  * the caller's own value, and `getNextPageParam` mirrors the runtime iterators' stop
181
204
  * conditions (cursor: absent/`null`/`''`, plus the optional `hasMore === false`;
182
- * offset/page: an empty items page).
205
+ * offset/page: an empty items page). A body link is the page param itself: the first
206
+ * page sends `vars` as given, later pages merge the link's query parameters over them.
183
207
  */
184
208
  function infiniteMember(
185
209
  model: ApiModel,
@@ -188,6 +212,29 @@ function infiniteMember(
188
212
  argsStyle: TanstackOptions['argsStyle']
189
213
  ): string {
190
214
  const { params, keyArg } = varsPieces(op);
215
+ if (spec.style === 'body-link') {
216
+ const merged =
217
+ argsStyle === 'flat'
218
+ ? '{ ...vars, ...nextLinkQuery(pageParam) }'
219
+ : '{ ...vars, query: { ...vars.query, ...nextLinkQuery(pageParam) } }';
220
+ const pointer = spec.nextLink;
221
+ const checks = cursorStopChecks(model, op, pointer);
222
+ const next =
223
+ checks.length === 0
224
+ ? ` return lastPage${pointerChain(pointer)};\n`
225
+ : ` const next = lastPage${pointerChain(pointer)};\n` +
226
+ ` return ${checks.join(' || ')} ? undefined : next;\n`;
227
+ return (
228
+ ` ${op.name}InfiniteOptions: (${params}) => infiniteQueryOptions({\n` +
229
+ ` queryKey: [...${op.name}QueryKey(${keyArg}), "infinite"] as const,\n` +
230
+ ` queryFn: ({ pageParam, signal }) => instance.${op.name}(pageParam === undefined ? vars : ${merged} as ${variablesName(op)}, { ...init, signal, envelope: undefined }),\n` +
231
+ ` initialPageParam: undefined as string | undefined,\n` +
232
+ ` getNextPageParam: (lastPage) => {\n` +
233
+ next +
234
+ ` },\n` +
235
+ ` })`
236
+ );
237
+ }
191
238
  // The cursor is a query parameter, so it lands in the sdk's own spelling for one:
192
239
  // inside the `query` layer, or at the top level of a merged call.
193
240
  const cursor = safeIdent(spec.param);
@@ -208,7 +255,7 @@ function infiniteMember(
208
255
  function nextPageSource(
209
256
  model: ApiModel,
210
257
  op: OperationModel,
211
- spec: Exclude<PaginationSpec, { style: 'link' }>,
258
+ spec: Exclude<PaginationSpec, { style: 'link' | 'body-link' }>,
212
259
  argsStyle: TanstackOptions['argsStyle']
213
260
  ): string {
214
261
  const advance = paramsAccess(spec.param);
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "transformers" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "transformers" 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 transformers --update`.
@@ -42,5 +42,5 @@ export default {
42
42
  run: transformersGenerator,
43
43
  requires: ["typescript"],
44
44
  dateTypes: ["Date"],
45
- requiresGenerator: '^0.5.3',
45
+ requiresGenerator: '^0.7.0',
46
46
  };
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "transformers" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "transformers" 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 transformers --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "typescript" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "typescript" 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 typescript --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "typescript" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "typescript" 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 typescript --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "typescript" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "typescript" 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 typescript --update`.
@@ -1,16 +1,21 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "typescript" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "typescript" 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 typescript --update`.
5
5
  import {
6
6
  type CodeSample,
7
+ type EmitOptions,
7
8
  type Generator,
9
+ GENERATOR_VERSION,
10
+ type GeneratedFile,
8
11
  type OperationModel,
9
12
  renderReferencePage,
10
13
  type SampleContext,
11
14
  } from '@redocly/client-generator';
15
+ import { TELEMETRY_RUNTIME_SOURCE } from '@redocly/client-generator/runtime-sources';
12
16
  import { join } from 'node:path';
13
17
 
18
+ import { HEADER } from './banner.ts';
14
19
  import { emitClientSingleFile, emitClientSplit, emitRuntimeFiles } from './client.ts';
15
20
  import { packageIdents } from './descriptor.ts';
16
21
 
@@ -29,6 +34,10 @@ export const typescriptGenerator: Generator = ({ model, output, outputMode, emit
29
34
  path: join(output.dir, 'runtime', name),
30
35
  content,
31
36
  }));
37
+ const telemetry: GeneratedFile[] = [];
38
+ if (emit.telemetry === 'on') {
39
+ telemetry.push(telemetryFile(output.dir, output.stem, emit));
40
+ }
32
41
  if (outputMode === 'split') {
33
42
  const { dir, stem } = output;
34
43
  const { entry, schemas } = emitClientSplit(model, emit, stem);
@@ -38,11 +47,28 @@ export const typescriptGenerator: Generator = ({ model, output, outputMode, emit
38
47
  : [{ path: join(dir, `${stem}.schemas.ts`), content: schemas }]),
39
48
  { path: output.path, content: entry },
40
49
  ...runtime,
50
+ ...telemetry,
41
51
  ];
42
52
  }
43
- return [{ path: output.path, content: emitClientSingleFile(model, emit) }, ...runtime];
53
+ return [
54
+ { path: output.path, content: emitClientSingleFile(model, emit) },
55
+ ...runtime,
56
+ ...telemetry,
57
+ ];
44
58
  };
45
59
 
60
+ function telemetryFile(dir: string, stem: string, emit: EmitOptions): GeneratedFile {
61
+ const clientModule = `./${stem}.${emit.importExt ?? 'js'}`;
62
+ const content = TELEMETRY_RUNTIME_SOURCE.replace(
63
+ "from '../../../runtime-contract.js';",
64
+ () => `from '${clientModule}';`
65
+ ).replace(
66
+ "const GENERATOR_VERSION: string = 'dev';",
67
+ () => `const GENERATOR_VERSION: string = '${GENERATOR_VERSION}';`
68
+ );
69
+ return { path: join(dir, `${stem}.telemetry.ts`), content: `${HEADER}\n\n${content}` };
70
+ }
71
+
46
72
  /**
47
73
  * The client's own reference page, written when `client.docs` is on. Its snippets come from
48
74
  * `typescriptSample` below, so the page shows the calling convention this run generated —
@@ -97,5 +123,5 @@ export default {
97
123
  run: typescriptGenerator,
98
124
  sample: typescriptSample,
99
125
  docs: typescriptDocs,
100
- requiresGenerator: '^0.5.3',
126
+ requiresGenerator: '^0.7.0',
101
127
  };
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "typescript" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "typescript" 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 typescript --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "typescript" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "typescript" 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 typescript --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "typescript" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "typescript" 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 typescript --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "typescript" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "typescript" 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 typescript --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "typescript" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "typescript" 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 typescript --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "typescript" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "typescript" 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 typescript --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "typescript" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "typescript" 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 typescript --update`.
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "zod" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "zod" 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 zod --update`.
@@ -28,5 +28,5 @@ export const zodGenerator: Generator = ({ model, output, banner }) => {
28
28
  export default {
29
29
  name: 'zod',
30
30
  run: zodGenerator,
31
- requiresGenerator: '^0.5.3',
31
+ requiresGenerator: '^0.7.0',
32
32
  };
@@ -1,4 +1,4 @@
1
- // Ejected from @redocly/client-generator@0.5.3 — the built-in "zod" generator.
1
+ // Ejected from @redocly/client-generator@0.7.0 — the built-in "zod" 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 zod --update`.
@@ -21,8 +21,11 @@ query keys. One generator, four framework variants (`react` default, `-vue`,
21
21
  - **Options factories, not hooks:** consumers call `useQuery(<op>Options(...))`, so the
22
22
  output works with any of the framework adapters and stays testable.
23
23
  - **`queryKeyPrefix`** namespaces every key when several clients share a cache.
24
- - **Infinite queries** derive `getNextPageParam` from the resolved pagination rule; a
25
- `link`-style rule reads the `Link` header the descriptor declares.
24
+ - **Infinite queries** derive `getNextPageParam` from the resolved pagination rule. A
25
+ `body-link` rule gets one when the operation has a query parameter: the next page's
26
+ URL is the page param, and each later page merges the URL's query parameters over
27
+ `vars`. A `Link` header is invisible to a `queryFn`, so `link`-style operations get
28
+ only the sdk's `.pages()`/`.items()`.
26
29
  - **`envelope` is excluded and stripped** — cached data is the plain body.
27
30
  - Requires `typescript`; throw-mode only (it wraps thrown errors into query errors).
28
31
 
@@ -17,6 +17,10 @@ operation, and the runtime — embedded in the file (`runtime: inline`, the defa
17
17
  written as real modules in a `runtime/` folder beside it that the client imports
18
18
  relatively (`runtime: module`).
19
19
 
20
+ With `client.telemetry: on`, it also writes `<stem>.telemetry.ts`: the usage telemetry
21
+ middleware. The module exports `telemetry()` and `flush()`, and the application registers
22
+ it with `use(telemetry({ sdkName, sdkVersion, client }))`.
23
+
20
24
  ## Design decisions that must hold
21
25
 
22
26
  - **Descriptor-driven:** generated code is DATA (`OPERATIONS` + `Ops`) plus wiring;
@@ -26,6 +30,11 @@ relatively (`runtime: module`).
26
30
  an entry that `export *`s it; the entry type-imports only the schema names it
27
31
  references (`collectEntrySchemaRefs`).
28
32
  - **Zero runtime dependencies.** `Date`, `Blob`, `fetch` — nothing else.
33
+ - **Timeouts need no platform statics.** `send()` uses `AbortSignal.timeout()` and
34
+ `AbortSignal.any()` where they exist and builds the same signal from an `AbortController`
35
+ and `setTimeout` where they do not (Chrome before 116, Safari before 17.4, Firefox before
36
+ 124). A timed-out attempt is recognized by its own timeout signal having fired, never by
37
+ the abort reason's name, because Chrome 103 to 123 abort a timeout with `AbortError`.
29
38
  - **Names are collision-safe:** `packageIdents` seeds every reserved wiring name before
30
39
  any operation is sanitized, so renames are deterministic (`configure` → `configure_2`).
31
40
  A rename becomes part of the SDK's public API, so the warning must say WHICH cause it
@@ -56,6 +65,18 @@ relatively (`runtime: module`).
56
65
  derives, boundary included), `send()` sets the operation's declared content type only
57
66
  when the caller set none, the same rule the JSON branch already follows. A forwarded
58
67
  multipart boundary therefore survives, and a binary upload is never sent untyped.
68
+ - **`onSettled` sees every sent call once.** `send()` calls it after the last attempt
69
+ with the final response, the error, or both, the attempt count, and the duration from
70
+ the first attempt to the end of the `onResponse` hooks on the final response. A call
71
+ that fails in `onRequest` or in body serialization does not reach it. A call whose
72
+ signal is already aborted reaches it with 0 attempts.
73
+ Every hook runs. The first hook error rejects a successful call; on a failed call, the
74
+ original error wins.
75
+ - **Telemetry is opt-in at generation time.** Without `telemetry: on`, the output holds
76
+ no telemetry code, and the client file does not change. An event holds only the
77
+ operation id, the counts, the window, and the SDK identity. The kill switches and a
78
+ browser turn the middleware off. The module embeds on its own, not in
79
+ `RUNTIME_SOURCES`, so `telemetry` and `flush` never become reserved names of a client.
59
80
  - **Throw mode returns the body**; `{ envelope: true }` opts into
60
81
  `{ data, headers, response }` with typed declared headers. Result mode returns
61
82
  `{ data, error, response }` and ignores `envelope`.
@@ -77,6 +98,9 @@ inside the package and reach the generator through
77
98
  `@redocly/client-generator/runtime-sources` (in this repo they live in `runtime/` beside
78
99
  these files). Naming and string escaping live in the TypeScript printer
79
100
  (`@redocly/client-generator/printers/typescript`).
101
+ The telemetry middleware ships the same way, as `TELEMETRY_RUNTIME_SOURCE` (in this repo
102
+ it lives in `telemetry/`); `index.ts` writes it with the contract import pointed at the
103
+ client entry and the generator version baked in.
80
104
 
81
105
  ## Ejecting it
82
106