@redocly/cli 2.63.0 → 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.
- package/THIRD_PARTY_NOTICES +1 -1
- package/lib/chunks/{PHWKGYUT.js → 2DKR4Z25.js} +1 -1
- package/lib/chunks/{JHK6XIMG.js → 2MCPXKB6.js} +1 -1
- package/lib/chunks/{3SFDVGEQ.js → 2ZIICV4T.js} +1 -1
- package/lib/chunks/{6AB3BDX4.js → 3CSDNX6S.js} +1 -1
- package/lib/chunks/{IODGA6FG.js → 4EAF6XUQ.js} +1 -1
- package/lib/chunks/{Y4UTXOI2.js → 5PR7FNUB.js} +1 -1
- package/lib/chunks/{7AWM5GPD.js → 654FMWX6.js} +1 -1
- package/lib/chunks/{4C44BO5N.js → 6FADWAOY.js} +1 -1
- package/lib/chunks/{X2V5QOZP.js → 6MP4DHWK.js} +1 -1
- package/lib/chunks/{A22GELRX.js → 7APJVQSB.js} +1 -1
- package/lib/chunks/{3LGZAJES.js → AC62H63B.js} +1 -1
- package/lib/chunks/{C2OCU4E3.js → ALBI5SPY.js} +1 -1
- package/lib/chunks/{XNNK5G6V.js → B5ZOH4BB.js} +1 -1
- package/lib/chunks/{ZP54RCIQ.js → BGGUKU7E.js} +1 -1
- package/lib/chunks/{L2EBKZQZ.js → BWXAXULF.js} +1 -1
- package/lib/chunks/{5IIJHGNO.js → CEASD5U3.js} +1 -1
- package/lib/chunks/{U52CY34I.js → CVPT656W.js} +1 -1
- package/lib/chunks/{NCBLLIQ3.js → DL4VP2Z4.js} +2 -2
- package/lib/chunks/DPNI74SB.js +69 -0
- package/lib/chunks/{RFGNVCAR.js → ENIPOAVJ.js} +2 -2
- package/lib/chunks/{ACMV5RZA.js → EQTXHL74.js} +101 -101
- package/lib/chunks/{HTG3RKCV.js → FU7GBMUU.js} +1 -1
- package/lib/chunks/{J7J4PH3V.js → FVGFKJ67.js} +1 -1
- package/lib/chunks/{NERCHMVY.js → FXKIC5R3.js} +1 -1
- package/lib/chunks/{B4ONRSDG.js → GKCVQWOQ.js} +3 -3
- package/lib/chunks/{Z52TEGV5.js → GKSUZULD.js} +1 -1
- package/lib/chunks/{AU7VOB4V.js → GOTKYHFM.js} +1 -1
- package/lib/chunks/{YXH72HCU.js → GRTUPOKN.js} +1 -1
- package/lib/chunks/{NR3R4HFM.js → HAOBCQWB.js} +313 -1
- package/lib/chunks/{JGBWIR5U.js → HIII45WJ.js} +1 -1
- package/lib/chunks/{ZK27F53P.js → HYMULX2S.js} +1 -1
- package/lib/chunks/{DEXQ6S3P.js → I6NMWBVI.js} +1 -1
- package/lib/chunks/{LLWU7A5G.js → IH3N62Q4.js} +1 -1
- package/lib/chunks/{WV2NAII3.js → J665DSDI.js} +1 -1
- package/lib/chunks/{BC3XCWQE.js → JQJ5TDVP.js} +1 -1
- package/lib/chunks/{BS3AUVYD.js → L5X7LBV6.js} +1 -1
- package/lib/chunks/{BFIZTFWS.js → LCAJ35J6.js} +1 -1
- package/lib/chunks/{CQMZF72H.js → LG3SUXEW.js} +1 -1
- package/lib/chunks/{KMP5ZE2D.js → LMO5V2XF.js} +1 -1
- package/lib/chunks/{J373CXCH.js → M4NCSK7Q.js} +1 -1
- package/lib/chunks/{DQFNUDOT.js → M74SGAZK.js} +1 -1
- package/lib/chunks/{HW7ZCN7J.js → MVCGBDOY.js} +1 -1
- package/lib/chunks/{24AVTWC7.js → N4R4236N.js} +1 -1
- package/lib/chunks/{Q4UGLPO2.js → NRWIPPEV.js} +1 -1
- package/lib/chunks/{CTPVBOG5.js → OGNRVBTI.js} +1 -1
- package/lib/chunks/{5VDBZVBF.js → ONBORCDJ.js} +1 -1
- package/lib/chunks/{OFJ2KV5N.js → OS52EARM.js} +1 -1
- package/lib/chunks/{YKST56C6.js → QCOPS234.js} +1 -1
- package/lib/chunks/{7LNKXEIU.js → QWTSCCNH.js} +1 -1
- package/lib/chunks/{FCZH3476.js → RRQJCLNO.js} +1 -1
- package/lib/chunks/{SXIFTBZB.js → RWDQI2KD.js} +1 -1
- package/lib/chunks/{I3M476SQ.js → S3W5GQGC.js} +1 -1
- package/lib/chunks/{AAPHKNGA.js → SRRHJLPL.js} +1 -1
- package/lib/chunks/{E2D25T4G.js → TTE4EAVV.js} +3 -2
- package/lib/chunks/{6LEQ46KS.js → TWFZE4OF.js} +1 -1
- package/lib/chunks/{Z7J6WWCO.js → U4RAHOFK.js} +1 -1
- package/lib/chunks/{QNCKZURN.js → UC5EDLXL.js} +1 -1
- package/lib/chunks/{2G2Q42ND.js → ULQK2S4O.js} +1 -1
- package/lib/chunks/{7RQW6KPZ.js → UNOXQ62I.js} +224 -115
- package/lib/chunks/{OYUXHAGQ.js → UQW6CW3M.js} +1 -1
- package/lib/chunks/{4JKMQCWY.js → VKTRI5YG.js} +1 -1
- package/lib/chunks/{6WESXERF.js → VMIHLA3H.js} +1 -1
- package/lib/chunks/{ITUUIAOZ.js → VWF52WKH.js} +1 -1
- package/lib/chunks/{VB4PNWOR.js → WKQJPOYW.js} +1 -1
- package/lib/chunks/{VSBSD3XZ.js → WQBSNQXL.js} +1 -1
- package/lib/chunks/{IYKYAJDC.js → X6TQQHRM.js} +1 -1
- package/lib/chunks/{TCALQAX5.js → XDBFHG7X.js} +1 -1
- package/lib/chunks/{LXSCIQFU.js → XYU2LTWU.js} +1 -1
- package/lib/chunks/{6QRNEF7K.js → Z4X6WES7.js} +1 -1
- package/lib/chunks/{CVUPOCX4.js → ZFXOCOU6.js} +1 -1
- package/lib/chunks/{Z5QYTPVY.js → ZM3M44Q3.js} +1 -1
- package/lib/eject-assets/generators/cli/docs.ts +1 -1
- package/lib/eject-assets/generators/cli/engine-source.ts +1 -1
- package/lib/eject-assets/generators/cli/index.ts +2 -2
- package/lib/eject-assets/generators/cli/render.ts +1 -1
- package/lib/eject-assets/generators/go/client.ts +1 -1
- package/lib/eject-assets/generators/go/descriptor.ts +1 -1
- package/lib/eject-assets/generators/go/index.ts +2 -2
- package/lib/eject-assets/generators/go/models.ts +1 -1
- package/lib/eject-assets/generators/go/naming.ts +1 -1
- package/lib/eject-assets/generators/go/operations.ts +1 -1
- package/lib/eject-assets/generators/go/pagination.ts +1 -1
- package/lib/eject-assets/generators/go/types.ts +1 -1
- package/lib/eject-assets/generators/mock/faker.ts +1 -1
- package/lib/eject-assets/generators/mock/index.ts +2 -2
- package/lib/eject-assets/generators/mock/render.ts +1 -1
- package/lib/eject-assets/generators/mock/sample.ts +1 -1
- package/lib/eject-assets/generators/mock/values.ts +1 -1
- package/lib/eject-assets/generators/php/client.ts +1 -1
- package/lib/eject-assets/generators/php/descriptor.ts +1 -1
- package/lib/eject-assets/generators/php/index.ts +2 -2
- package/lib/eject-assets/generators/php/models.ts +1 -1
- package/lib/eject-assets/generators/php/naming.ts +1 -1
- package/lib/eject-assets/generators/php/operations.ts +1 -1
- package/lib/eject-assets/generators/php/pagination.ts +1 -1
- package/lib/eject-assets/generators/php/types.ts +1 -1
- package/lib/eject-assets/generators/python/client.ts +1 -1
- package/lib/eject-assets/generators/python/descriptor.ts +1 -1
- package/lib/eject-assets/generators/python/index.ts +2 -2
- package/lib/eject-assets/generators/python/models.ts +1 -1
- package/lib/eject-assets/generators/python/naming.ts +1 -1
- package/lib/eject-assets/generators/python/operations.ts +1 -1
- package/lib/eject-assets/generators/python/pagination.ts +1 -1
- package/lib/eject-assets/generators/python/types.ts +1 -1
- package/lib/eject-assets/generators/swr/index.ts +2 -2
- package/lib/eject-assets/generators/swr/render.ts +1 -1
- package/lib/eject-assets/generators/tanstack-query/index.ts +2 -2
- package/lib/eject-assets/generators/tanstack-query/render.ts +1 -1
- package/lib/eject-assets/generators/transformers/index.ts +2 -2
- package/lib/eject-assets/generators/transformers/render.ts +1 -1
- package/lib/eject-assets/generators/typescript/banner.ts +1 -1
- package/lib/eject-assets/generators/typescript/client.ts +1 -1
- package/lib/eject-assets/generators/typescript/descriptor.ts +1 -1
- package/lib/eject-assets/generators/typescript/index.ts +29 -3
- package/lib/eject-assets/generators/typescript/inline-runtime.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-signature.ts +1 -1
- package/lib/eject-assets/generators/typescript/operation-types.ts +1 -1
- package/lib/eject-assets/generators/typescript/operations.ts +1 -1
- package/lib/eject-assets/generators/typescript/response-headers.ts +1 -1
- package/lib/eject-assets/generators/typescript/type-guards.ts +1 -1
- package/lib/eject-assets/generators/typescript/types.ts +1 -1
- package/lib/eject-assets/generators/zod/index.ts +2 -2
- package/lib/eject-assets/generators/zod/schemas.ts +1 -1
- package/lib/eject-assets/skills/typescript-generator/SKILL.md +19 -0
- package/lib/index.js +5 -5
- package/package.json +1 -1
- package/lib/chunks/FRM6TZ42.js +0 -67
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
250
|
+
requiresGenerator: '^0.7.0',
|
|
251
251
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
36
|
+
requiresGenerator: '^0.7.0',
|
|
37
37
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.
|
|
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.
|
|
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.
|
|
47
|
+
requiresGenerator: '^0.7.0',
|
|
48
48
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.
|
|
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`.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.
|
|
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.
|
|
45
|
+
requiresGenerator: '^0.7.0',
|
|
46
46
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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 [
|
|
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.
|
|
126
|
+
requiresGenerator: '^0.7.0',
|
|
101
127
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
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.
|
|
31
|
+
requiresGenerator: '^0.7.0',
|
|
32
32
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
// Ejected from @redocly/client-generator@0.
|
|
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`.
|
|
@@ -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;
|
|
@@ -61,6 +65,18 @@ relatively (`runtime: module`).
|
|
|
61
65
|
derives, boundary included), `send()` sets the operation's declared content type only
|
|
62
66
|
when the caller set none, the same rule the JSON branch already follows. A forwarded
|
|
63
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.
|
|
64
80
|
- **Throw mode returns the body**; `{ envelope: true }` opts into
|
|
65
81
|
`{ data, headers, response }` with typed declared headers. Result mode returns
|
|
66
82
|
`{ data, error, response }` and ignores `envelope`.
|
|
@@ -82,6 +98,9 @@ inside the package and reach the generator through
|
|
|
82
98
|
`@redocly/client-generator/runtime-sources` (in this repo they live in `runtime/` beside
|
|
83
99
|
these files). Naming and string escaping live in the TypeScript printer
|
|
84
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.
|
|
85
104
|
|
|
86
105
|
## Ejecting it
|
|
87
106
|
|