@redocly/client-generator 0.3.8 → 0.4.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/README.md +32 -54
- package/eject-assets/AGENTS.md +137 -0
- package/eject-assets/generators/cli/docs.ts +224 -0
- package/eject-assets/generators/cli/engine-source.ts +21 -0
- package/eject-assets/generators/cli/index.ts +90 -0
- package/eject-assets/generators/cli/render.ts +348 -0
- package/eject-assets/generators/go/client.ts +57 -0
- package/eject-assets/generators/go/descriptor.ts +41 -0
- package/eject-assets/generators/go/index.ts +336 -0
- package/eject-assets/generators/go/models.ts +179 -0
- package/eject-assets/generators/go/naming.ts +49 -0
- package/eject-assets/generators/go/operations.ts +296 -0
- package/eject-assets/generators/go/pagination.ts +194 -0
- package/eject-assets/generators/go/types.ts +60 -0
- package/eject-assets/generators/mock/faker.ts +214 -0
- package/eject-assets/generators/mock/index.ts +35 -0
- package/eject-assets/generators/mock/render.ts +282 -0
- package/eject-assets/generators/mock/sample.ts +316 -0
- package/eject-assets/generators/mock/values.ts +63 -0
- package/eject-assets/generators/php/client.ts +63 -0
- package/eject-assets/generators/php/descriptor.ts +58 -0
- package/eject-assets/generators/php/index.ts +237 -0
- package/eject-assets/generators/php/models.ts +275 -0
- package/eject-assets/generators/php/naming.ts +51 -0
- package/eject-assets/generators/php/operations.ts +232 -0
- package/eject-assets/generators/php/pagination.ts +133 -0
- package/eject-assets/generators/php/types.ts +148 -0
- package/eject-assets/generators/python/client.ts +123 -0
- package/eject-assets/generators/python/descriptor.ts +52 -0
- package/eject-assets/generators/python/index.ts +251 -0
- package/eject-assets/generators/python/models.ts +242 -0
- package/eject-assets/generators/python/naming.ts +46 -0
- package/eject-assets/generators/python/operations.ts +147 -0
- package/eject-assets/generators/python/pagination.ts +128 -0
- package/eject-assets/generators/python/types.ts +54 -0
- package/eject-assets/generators/swr/index.ts +37 -0
- package/eject-assets/generators/swr/render.ts +78 -0
- package/eject-assets/generators/tanstack-query/index.ts +48 -0
- package/eject-assets/generators/tanstack-query/render.ts +346 -0
- package/eject-assets/generators/transformers/index.ts +46 -0
- package/eject-assets/generators/transformers/render.ts +506 -0
- package/eject-assets/generators/typescript/banner.ts +35 -0
- package/eject-assets/generators/typescript/client.ts +254 -0
- package/eject-assets/generators/typescript/descriptor.ts +137 -0
- package/eject-assets/generators/typescript/index.ts +101 -0
- package/eject-assets/generators/typescript/inline-runtime.ts +135 -0
- package/eject-assets/generators/typescript/operation-signature.ts +62 -0
- package/eject-assets/generators/typescript/operation-types.ts +17 -0
- package/eject-assets/generators/typescript/operations.ts +524 -0
- package/eject-assets/generators/typescript/response-headers.ts +74 -0
- package/eject-assets/generators/typescript/type-guards.ts +159 -0
- package/eject-assets/generators/typescript/types.ts +172 -0
- package/eject-assets/generators/zod/index.ts +32 -0
- package/eject-assets/generators/zod/schemas.ts +456 -0
- package/eject-assets/skills/cli-generator/SKILL.md +121 -0
- package/eject-assets/skills/client-generators/SKILL.md +142 -0
- package/eject-assets/skills/go-generator/SKILL.md +96 -0
- package/eject-assets/skills/mock-generator/SKILL.md +50 -0
- package/eject-assets/skills/php-generator/SKILL.md +112 -0
- package/eject-assets/skills/python-generator/SKILL.md +110 -0
- package/eject-assets/skills/swr-generator/SKILL.md +50 -0
- package/eject-assets/skills/tanstack-query-generator/SKILL.md +55 -0
- package/eject-assets/skills/transformers-generator/SKILL.md +47 -0
- package/eject-assets/skills/typescript-generator/SKILL.md +95 -0
- package/eject-assets/skills/zod-generator/SKILL.md +54 -0
- package/lib/authoring/index.d.ts +11 -0
- package/lib/authoring/index.d.ts.map +1 -0
- package/lib/authoring/index.js +42 -0
- package/lib/authoring/index.js.map +1 -0
- package/lib/authoring/naming.d.ts +34 -0
- package/lib/authoring/naming.d.ts.map +1 -0
- package/lib/authoring/naming.js +104 -0
- package/lib/authoring/naming.js.map +1 -0
- package/lib/authoring/operation.d.ts +47 -0
- package/lib/authoring/operation.d.ts.map +1 -0
- package/lib/authoring/operation.js +86 -0
- package/lib/authoring/operation.js.map +1 -0
- package/lib/authoring/options.d.ts +9 -0
- package/lib/authoring/options.d.ts.map +1 -0
- package/lib/authoring/options.js +5 -0
- package/lib/authoring/options.js.map +1 -0
- package/lib/authoring/pagination.d.ts +19 -0
- package/lib/authoring/pagination.d.ts.map +1 -0
- package/lib/authoring/pagination.js +45 -0
- package/lib/authoring/pagination.js.map +1 -0
- package/lib/authoring/printer.d.ts +16 -0
- package/lib/authoring/printer.d.ts.map +1 -0
- package/lib/authoring/printer.js +36 -0
- package/lib/authoring/printer.js.map +1 -0
- package/lib/authoring/reference-page.d.ts +31 -0
- package/lib/authoring/reference-page.d.ts.map +1 -0
- package/lib/authoring/reference-page.js +160 -0
- package/lib/authoring/reference-page.js.map +1 -0
- package/lib/authoring/schema.d.ts +51 -0
- package/lib/authoring/schema.d.ts.map +1 -0
- package/lib/authoring/schema.js +190 -0
- package/lib/authoring/schema.js.map +1 -0
- package/lib/cli-contract.d.ts +126 -0
- package/lib/cli-contract.d.ts.map +1 -0
- package/lib/cli-contract.js +25 -0
- package/lib/cli-contract.js.map +1 -0
- package/lib/{emitters/wrapper-support.d.ts → contracts/typescript.d.ts} +13 -24
- package/lib/contracts/typescript.d.ts.map +1 -0
- package/lib/contracts/typescript.js +87 -0
- package/lib/contracts/typescript.js.map +1 -0
- package/lib/generate.d.ts +10 -10
- package/lib/generate.d.ts.map +1 -1
- package/lib/generate.js +25 -106
- package/lib/generate.js.map +1 -1
- package/lib/generators/cli/docs.d.ts +19 -0
- package/lib/generators/cli/docs.d.ts.map +1 -0
- package/lib/generators/cli/docs.js +187 -0
- package/lib/generators/cli/docs.js.map +1 -0
- package/lib/generators/cli/engine-source.d.ts +5 -0
- package/lib/generators/cli/engine-source.d.ts.map +1 -0
- package/lib/generators/cli/engine-source.js +12 -0
- package/lib/generators/cli/engine-source.js.map +1 -0
- package/lib/generators/cli/index.d.ts +18 -0
- package/lib/generators/cli/index.d.ts.map +1 -0
- package/lib/generators/cli/index.js +67 -0
- package/lib/generators/cli/index.js.map +1 -0
- package/lib/generators/cli/render.d.ts +39 -0
- package/lib/generators/cli/render.d.ts.map +1 -0
- package/lib/generators/cli/render.js +281 -0
- package/lib/generators/cli/render.js.map +1 -0
- package/lib/generators/cli/runtime/cli.d.ts +42 -0
- package/lib/generators/cli/runtime/cli.d.ts.map +1 -0
- package/lib/generators/cli/runtime/cli.js +582 -0
- package/lib/generators/cli/runtime/cli.js.map +1 -0
- package/lib/generators/compatibility.d.ts +10 -0
- package/lib/generators/compatibility.d.ts.map +1 -0
- package/lib/generators/compatibility.js +45 -0
- package/lib/generators/compatibility.js.map +1 -0
- package/lib/generators/go/client.d.ts +5 -0
- package/lib/generators/go/client.d.ts.map +1 -0
- package/lib/generators/go/client.js +34 -0
- package/lib/generators/go/client.js.map +1 -0
- package/lib/generators/go/descriptor.d.ts +6 -0
- package/lib/generators/go/descriptor.d.ts.map +1 -0
- package/lib/generators/go/descriptor.js +26 -0
- package/lib/generators/go/descriptor.js.map +1 -0
- package/lib/generators/go/index.d.ts +14 -0
- package/lib/generators/go/index.d.ts.map +1 -0
- package/lib/generators/go/index.js +240 -0
- package/lib/generators/go/index.js.map +1 -0
- package/lib/generators/go/models.d.ts +4 -0
- package/lib/generators/go/models.d.ts.map +1 -0
- package/lib/generators/go/models.js +125 -0
- package/lib/generators/go/models.js.map +1 -0
- package/lib/generators/go/naming.d.ts +15 -0
- package/lib/generators/go/naming.d.ts.map +1 -0
- package/lib/generators/go/naming.js +36 -0
- package/lib/generators/go/naming.js.map +1 -0
- package/lib/generators/go/operations.d.ts +16 -0
- package/lib/generators/go/operations.d.ts.map +1 -0
- package/lib/generators/go/operations.js +200 -0
- package/lib/generators/go/operations.js.map +1 -0
- package/lib/generators/go/pagination.d.ts +5 -0
- package/lib/generators/go/pagination.d.ts.map +1 -0
- package/lib/generators/go/pagination.js +93 -0
- package/lib/generators/go/pagination.js.map +1 -0
- package/lib/generators/go/types.d.ts +4 -0
- package/lib/generators/go/types.d.ts.map +1 -0
- package/lib/generators/go/types.js +48 -0
- package/lib/generators/go/types.js.map +1 -0
- package/lib/generators/index.d.ts +2 -3
- package/lib/generators/index.d.ts.map +1 -1
- package/lib/generators/index.js +31 -53
- package/lib/generators/index.js.map +1 -1
- package/lib/generators/meta.d.ts +13 -0
- package/lib/generators/meta.d.ts.map +1 -0
- package/lib/generators/meta.js +157 -0
- package/lib/generators/meta.js.map +1 -0
- package/lib/{emitters → generators/mock}/faker.d.ts +4 -5
- package/lib/generators/mock/faker.d.ts.map +1 -0
- package/lib/generators/mock/faker.js +180 -0
- package/lib/generators/mock/faker.js.map +1 -0
- package/lib/generators/{mock.d.ts → mock/index.d.ts} +2 -2
- package/lib/generators/mock/index.d.ts.map +1 -0
- package/lib/generators/{mock.js → mock/index.js} +8 -8
- package/lib/generators/mock/index.js.map +1 -0
- package/lib/{emitters/mock.d.ts → generators/mock/render.d.ts} +2 -3
- package/lib/generators/mock/render.d.ts.map +1 -0
- package/lib/generators/mock/render.js +228 -0
- package/lib/generators/mock/render.js.map +1 -0
- package/lib/{emitters → generators/mock}/sample.d.ts +1 -2
- package/lib/generators/mock/sample.d.ts.map +1 -0
- package/lib/generators/mock/sample.js.map +1 -0
- package/lib/generators/mock/values.d.ts +33 -0
- package/lib/generators/mock/values.d.ts.map +1 -0
- package/lib/generators/mock/values.js +46 -0
- package/lib/generators/mock/values.js.map +1 -0
- package/lib/generators/options.d.ts +7 -0
- package/lib/generators/options.d.ts.map +1 -0
- package/lib/generators/options.js +74 -0
- package/lib/generators/options.js.map +1 -0
- package/lib/generators/php/client.d.ts +5 -0
- package/lib/generators/php/client.d.ts.map +1 -0
- package/lib/generators/php/client.js +38 -0
- package/lib/generators/php/client.js.map +1 -0
- package/lib/generators/php/descriptor.d.ts +7 -0
- package/lib/generators/php/descriptor.d.ts.map +1 -0
- package/lib/generators/php/descriptor.js +42 -0
- package/lib/generators/php/descriptor.js.map +1 -0
- package/lib/generators/php/index.d.ts +14 -0
- package/lib/generators/php/index.d.ts.map +1 -0
- package/lib/generators/php/index.js +166 -0
- package/lib/generators/php/index.js.map +1 -0
- package/lib/generators/php/models.d.ts +8 -0
- package/lib/generators/php/models.d.ts.map +1 -0
- package/lib/generators/php/models.js +200 -0
- package/lib/generators/php/models.js.map +1 -0
- package/lib/generators/php/naming.d.ts +16 -0
- package/lib/generators/php/naming.d.ts.map +1 -0
- package/lib/generators/php/naming.js +31 -0
- package/lib/generators/php/naming.js.map +1 -0
- package/lib/generators/php/operations.d.ts +21 -0
- package/lib/generators/php/operations.d.ts.map +1 -0
- package/lib/generators/php/operations.js +156 -0
- package/lib/generators/php/operations.js.map +1 -0
- package/lib/generators/php/pagination.d.ts +5 -0
- package/lib/generators/php/pagination.d.ts.map +1 -0
- package/lib/generators/php/pagination.js +68 -0
- package/lib/generators/php/pagination.js.map +1 -0
- package/lib/generators/php/types.d.ts +27 -0
- package/lib/generators/php/types.d.ts.map +1 -0
- package/lib/generators/php/types.js +128 -0
- package/lib/generators/php/types.js.map +1 -0
- package/lib/generators/python/client.d.ts +6 -0
- package/lib/generators/python/client.d.ts.map +1 -0
- package/lib/generators/python/client.js +80 -0
- package/lib/generators/python/client.js.map +1 -0
- package/lib/generators/python/descriptor.d.ts +9 -0
- package/lib/generators/python/descriptor.d.ts.map +1 -0
- package/lib/generators/python/descriptor.js +38 -0
- package/lib/generators/python/descriptor.js.map +1 -0
- package/lib/generators/python/index.d.ts +15 -0
- package/lib/generators/python/index.d.ts.map +1 -0
- package/lib/generators/python/index.js +197 -0
- package/lib/generators/python/index.js.map +1 -0
- package/lib/generators/python/models.d.ts +31 -0
- package/lib/generators/python/models.d.ts.map +1 -0
- package/lib/generators/python/models.js +203 -0
- package/lib/generators/python/models.js.map +1 -0
- package/lib/generators/python/naming.d.ts +22 -0
- package/lib/generators/python/naming.d.ts.map +1 -0
- package/lib/generators/python/naming.js +28 -0
- package/lib/generators/python/naming.js.map +1 -0
- package/lib/generators/python/operations.d.ts +4 -0
- package/lib/generators/python/operations.d.ts.map +1 -0
- package/lib/generators/python/operations.js +108 -0
- package/lib/generators/python/operations.js.map +1 -0
- package/lib/generators/python/pagination.d.ts +5 -0
- package/lib/generators/python/pagination.d.ts.map +1 -0
- package/lib/generators/python/pagination.js +95 -0
- package/lib/generators/python/pagination.js.map +1 -0
- package/lib/generators/python/types.d.ts +4 -0
- package/lib/generators/python/types.d.ts.map +1 -0
- package/lib/generators/python/types.js +45 -0
- package/lib/generators/python/types.js.map +1 -0
- package/lib/generators/resolve.d.ts.map +1 -1
- package/lib/generators/resolve.js +92 -13
- package/lib/generators/resolve.js.map +1 -1
- package/lib/generators/{swr.d.ts → swr/index.d.ts} +3 -3
- package/lib/generators/swr/index.d.ts.map +1 -0
- package/lib/generators/{swr.js → swr/index.js} +7 -10
- package/lib/generators/swr/index.js.map +1 -0
- package/lib/{emitters/swr.d.ts → generators/swr/render.d.ts} +2 -4
- package/lib/generators/swr/render.d.ts.map +1 -0
- package/lib/generators/swr/render.js +57 -0
- package/lib/generators/swr/render.js.map +1 -0
- package/lib/generators/{tanstack-query.d.ts → tanstack-query/index.d.ts} +3 -3
- package/lib/generators/tanstack-query/index.d.ts.map +1 -0
- package/lib/generators/{tanstack-query.js → tanstack-query/index.js} +11 -10
- package/lib/generators/tanstack-query/index.js.map +1 -0
- package/lib/{emitters/tanstack-query.d.ts → generators/tanstack-query/render.d.ts} +6 -5
- package/lib/generators/tanstack-query/render.d.ts.map +1 -0
- package/lib/{emitters/tanstack-query.js → generators/tanstack-query/render.js} +33 -21
- package/lib/generators/tanstack-query/render.js.map +1 -0
- package/lib/generators/{transformers.d.ts → transformers/index.d.ts} +2 -2
- package/lib/generators/transformers/index.d.ts.map +1 -0
- package/lib/generators/{transformers.js → transformers/index.js} +11 -8
- package/lib/generators/transformers/index.js.map +1 -0
- package/lib/{emitters/transformers.d.ts → generators/transformers/render.d.ts} +2 -2
- package/lib/generators/transformers/render.d.ts.map +1 -0
- package/lib/{emitters/transformers.js → generators/transformers/render.js} +125 -165
- package/lib/generators/transformers/render.js.map +1 -0
- package/lib/generators/types.d.ts +190 -12
- package/lib/generators/types.d.ts.map +1 -1
- package/lib/generators/typescript/banner.d.ts +12 -0
- package/lib/generators/typescript/banner.d.ts.map +1 -0
- package/lib/{emitters/emit-options.js → generators/typescript/banner.js} +2 -3
- package/lib/generators/typescript/banner.js.map +1 -0
- package/lib/generators/typescript/client.d.ts +25 -0
- package/lib/generators/typescript/client.d.ts.map +1 -0
- package/lib/generators/typescript/client.js +207 -0
- package/lib/generators/typescript/client.js.map +1 -0
- package/lib/generators/typescript/descriptor.d.ts +11 -0
- package/lib/generators/typescript/descriptor.d.ts.map +1 -0
- package/lib/generators/typescript/descriptor.js +97 -0
- package/lib/generators/typescript/descriptor.js.map +1 -0
- package/lib/generators/typescript/index.d.ts +20 -0
- package/lib/generators/typescript/index.d.ts.map +1 -0
- package/lib/generators/typescript/index.js +80 -0
- package/lib/generators/typescript/index.js.map +1 -0
- package/lib/generators/typescript/inline-runtime.d.ts +21 -0
- package/lib/generators/typescript/inline-runtime.d.ts.map +1 -0
- package/lib/generators/typescript/inline-runtime.js +114 -0
- package/lib/generators/typescript/inline-runtime.js.map +1 -0
- package/lib/generators/typescript/operation-signature.d.ts +23 -0
- package/lib/generators/typescript/operation-signature.d.ts.map +1 -0
- package/lib/generators/typescript/operation-signature.js +41 -0
- package/lib/generators/typescript/operation-signature.js.map +1 -0
- package/lib/generators/typescript/operation-types.d.ts +9 -0
- package/lib/generators/typescript/operation-types.d.ts.map +1 -0
- package/lib/generators/typescript/operation-types.js +11 -0
- package/lib/generators/typescript/operation-types.js.map +1 -0
- package/lib/generators/typescript/operations.d.ts +60 -0
- package/lib/generators/typescript/operations.d.ts.map +1 -0
- package/lib/generators/typescript/operations.js +386 -0
- package/lib/generators/typescript/operations.js.map +1 -0
- package/lib/generators/typescript/response-headers.d.ts +12 -0
- package/lib/generators/typescript/response-headers.d.ts.map +1 -0
- package/lib/generators/typescript/response-headers.js +40 -0
- package/lib/generators/typescript/response-headers.js.map +1 -0
- package/lib/generators/typescript/runtime/auth.d.ts.map +1 -0
- package/lib/generators/typescript/runtime/auth.js.map +1 -0
- package/lib/{runtime → generators/typescript/runtime}/create-client.d.ts +7 -2
- package/lib/generators/typescript/runtime/create-client.d.ts.map +1 -0
- package/lib/{runtime → generators/typescript/runtime}/create-client.js +84 -30
- package/lib/generators/typescript/runtime/create-client.js.map +1 -0
- package/lib/generators/typescript/runtime/errors.d.ts.map +1 -0
- package/lib/generators/typescript/runtime/errors.js.map +1 -0
- package/lib/generators/typescript/runtime/index.d.ts.map +1 -0
- package/lib/generators/typescript/runtime/index.js.map +1 -0
- package/lib/generators/typescript/runtime/multipart.d.ts.map +1 -0
- package/lib/generators/typescript/runtime/multipart.js.map +1 -0
- package/lib/{runtime → generators/typescript/runtime}/paginate.d.ts +2 -2
- package/lib/generators/typescript/runtime/paginate.d.ts.map +1 -0
- package/lib/{runtime → generators/typescript/runtime}/paginate.js +12 -12
- package/lib/generators/typescript/runtime/paginate.js.map +1 -0
- package/lib/generators/typescript/runtime/parse.d.ts.map +1 -0
- package/lib/generators/typescript/runtime/parse.js.map +1 -0
- package/lib/generators/typescript/runtime/retry.d.ts.map +1 -0
- package/lib/generators/typescript/runtime/retry.js.map +1 -0
- package/lib/generators/typescript/runtime/send.d.ts.map +1 -0
- package/lib/generators/typescript/runtime/send.js.map +1 -0
- package/lib/generators/typescript/runtime/setup.d.ts.map +1 -0
- package/lib/generators/typescript/runtime/setup.js.map +1 -0
- package/lib/generators/typescript/runtime/sse.d.ts.map +1 -0
- package/lib/generators/typescript/runtime/sse.js.map +1 -0
- package/lib/{runtime → generators/typescript/runtime}/types.d.ts +17 -95
- package/lib/generators/typescript/runtime/types.d.ts.map +1 -0
- package/lib/generators/typescript/runtime/types.js.map +1 -0
- package/lib/generators/typescript/runtime/url.d.ts.map +1 -0
- package/lib/generators/typescript/runtime/url.js.map +1 -0
- package/lib/generators/typescript/type-guards.d.ts +4 -0
- package/lib/generators/typescript/type-guards.d.ts.map +1 -0
- package/lib/{emitters → generators/typescript}/type-guards.js +18 -52
- package/lib/generators/typescript/type-guards.js.map +1 -0
- package/lib/generators/typescript/types.d.ts +8 -0
- package/lib/generators/typescript/types.d.ts.map +1 -0
- package/lib/generators/typescript/types.js +132 -0
- package/lib/generators/typescript/types.js.map +1 -0
- package/lib/generators/{zod.d.ts → zod/index.d.ts} +2 -2
- package/lib/generators/zod/index.d.ts.map +1 -0
- package/lib/generators/{zod.js → zod/index.js} +5 -7
- package/lib/generators/zod/index.js.map +1 -0
- package/lib/{emitters/zod.d.ts → generators/zod/schemas.d.ts} +4 -5
- package/lib/generators/zod/schemas.d.ts.map +1 -0
- package/lib/{emitters/zod.js → generators/zod/schemas.js} +118 -154
- package/lib/generators/zod/schemas.js.map +1 -0
- package/lib/index.d.ts +8 -3
- package/lib/index.d.ts.map +1 -1
- package/lib/index.js +18 -11
- package/lib/index.js.map +1 -1
- package/lib/intermediate-representation/build.d.ts +8 -1
- package/lib/intermediate-representation/build.d.ts.map +1 -1
- package/lib/intermediate-representation/build.js +59 -4
- package/lib/intermediate-representation/build.js.map +1 -1
- package/lib/intermediate-representation/model.d.ts +26 -1
- package/lib/intermediate-representation/model.d.ts.map +1 -1
- package/lib/intermediate-representation/model.js.map +1 -1
- package/lib/intermediate-representation/sanitize-identifiers.d.ts +1 -10
- package/lib/intermediate-representation/sanitize-identifiers.d.ts.map +1 -1
- package/lib/intermediate-representation/sanitize-identifiers.js +37 -38
- package/lib/intermediate-representation/sanitize-identifiers.js.map +1 -1
- package/lib/{emitters/pagination.d.ts → pagination.d.ts} +39 -15
- package/lib/pagination.d.ts.map +1 -0
- package/lib/{emitters/pagination.js → pagination.js} +13 -52
- package/lib/pagination.js.map +1 -0
- package/lib/pipeline.d.ts +17 -0
- package/lib/pipeline.d.ts.map +1 -0
- package/lib/pipeline.js +244 -0
- package/lib/pipeline.js.map +1 -0
- package/lib/plugin.d.ts +4 -4
- package/lib/plugin.d.ts.map +1 -1
- package/lib/plugin.js +12 -9
- package/lib/plugin.js.map +1 -1
- package/lib/printers/go.d.ts +33 -0
- package/lib/printers/go.d.ts.map +1 -0
- package/lib/printers/go.js +209 -0
- package/lib/printers/go.js.map +1 -0
- package/lib/printers/index.d.ts +5 -0
- package/lib/printers/index.d.ts.map +1 -0
- package/lib/printers/index.js +9 -0
- package/lib/printers/index.js.map +1 -0
- package/lib/printers/php.d.ts +21 -0
- package/lib/printers/php.d.ts.map +1 -0
- package/lib/printers/php.js +68 -0
- package/lib/printers/php.js.map +1 -0
- package/lib/printers/python.d.ts +31 -0
- package/lib/printers/python.d.ts.map +1 -0
- package/lib/printers/python.js +101 -0
- package/lib/printers/python.js.map +1 -0
- package/lib/printers/typescript.d.ts +82 -0
- package/lib/printers/typescript.d.ts.map +1 -0
- package/lib/printers/typescript.js +268 -0
- package/lib/printers/typescript.js.map +1 -0
- package/lib/reserved-names.d.ts +8 -0
- package/lib/reserved-names.d.ts.map +1 -0
- package/lib/{emitters/reserved-names.js → reserved-names.js} +16 -27
- package/lib/reserved-names.js.map +1 -0
- package/lib/runtime-contract.d.ts +62 -2
- package/lib/runtime-contract.d.ts.map +1 -1
- package/lib/runtime-contract.js +3 -3
- package/lib/runtime-contract.js.map +1 -1
- package/lib/runtime-sources/go.d.ts +2 -0
- package/lib/runtime-sources/go.d.ts.map +1 -0
- package/lib/runtime-sources/go.js +3 -0
- package/lib/runtime-sources/go.js.map +1 -0
- package/lib/runtime-sources/php.d.ts +2 -0
- package/lib/runtime-sources/php.d.ts.map +1 -0
- package/lib/runtime-sources/php.js +3 -0
- package/lib/runtime-sources/php.js.map +1 -0
- package/lib/runtime-sources/python.d.ts +12 -0
- package/lib/runtime-sources/python.d.ts.map +1 -0
- package/lib/runtime-sources/python.js +12 -0
- package/lib/runtime-sources/python.js.map +1 -0
- package/lib/runtime-sources/typescript.d.ts +36 -0
- package/lib/runtime-sources/typescript.d.ts.map +1 -0
- package/lib/runtime-sources/typescript.js +152 -0
- package/lib/runtime-sources/typescript.js.map +1 -0
- package/lib/runtime-sources.d.ts +5 -0
- package/lib/runtime-sources.d.ts.map +1 -0
- package/lib/runtime-sources.js +10 -0
- package/lib/runtime-sources.js.map +1 -0
- package/lib/setup-bake.d.ts.map +1 -0
- package/lib/{emitters/setup-bake.js → setup-bake.js} +11 -2
- package/lib/setup-bake.js.map +1 -0
- package/lib/types.d.ts +38 -8
- package/lib/types.d.ts.map +1 -1
- package/package.json +40 -4
- package/lib/emitters/auth.d.ts +0 -14
- package/lib/emitters/auth.d.ts.map +0 -1
- package/lib/emitters/auth.js +0 -30
- package/lib/emitters/auth.js.map +0 -1
- package/lib/emitters/client-assembly.d.ts +0 -15
- package/lib/emitters/client-assembly.d.ts.map +0 -1
- package/lib/emitters/client-assembly.js +0 -358
- package/lib/emitters/client-assembly.js.map +0 -1
- package/lib/emitters/descriptor.d.ts +0 -22
- package/lib/emitters/descriptor.d.ts.map +0 -1
- package/lib/emitters/descriptor.js +0 -199
- package/lib/emitters/descriptor.js.map +0 -1
- package/lib/emitters/emit-options.d.ts +0 -67
- package/lib/emitters/emit-options.d.ts.map +0 -1
- package/lib/emitters/emit-options.js.map +0 -1
- package/lib/emitters/faker.d.ts.map +0 -1
- package/lib/emitters/faker.js +0 -221
- package/lib/emitters/faker.js.map +0 -1
- package/lib/emitters/identifier.d.ts +0 -34
- package/lib/emitters/identifier.d.ts.map +0 -1
- package/lib/emitters/identifier.js +0 -104
- package/lib/emitters/identifier.js.map +0 -1
- package/lib/emitters/inline-runtime.d.ts +0 -11
- package/lib/emitters/inline-runtime.d.ts.map +0 -1
- package/lib/emitters/inline-runtime.js +0 -99
- package/lib/emitters/inline-runtime.js.map +0 -1
- package/lib/emitters/jsdoc.d.ts +0 -9
- package/lib/emitters/jsdoc.d.ts.map +0 -1
- package/lib/emitters/jsdoc.js +0 -83
- package/lib/emitters/jsdoc.js.map +0 -1
- package/lib/emitters/mock.d.ts.map +0 -1
- package/lib/emitters/mock.js +0 -265
- package/lib/emitters/mock.js.map +0 -1
- package/lib/emitters/operation-aliases.d.ts +0 -27
- package/lib/emitters/operation-aliases.d.ts.map +0 -1
- package/lib/emitters/operation-aliases.js +0 -150
- package/lib/emitters/operation-aliases.js.map +0 -1
- package/lib/emitters/operation-signature.d.ts +0 -24
- package/lib/emitters/operation-signature.d.ts.map +0 -1
- package/lib/emitters/operation-signature.js +0 -42
- package/lib/emitters/operation-signature.js.map +0 -1
- package/lib/emitters/operation-types.d.ts +0 -32
- package/lib/emitters/operation-types.d.ts.map +0 -1
- package/lib/emitters/operation-types.js +0 -117
- package/lib/emitters/operation-types.js.map +0 -1
- package/lib/emitters/operations.d.ts +0 -41
- package/lib/emitters/operations.d.ts.map +0 -1
- package/lib/emitters/operations.js +0 -35
- package/lib/emitters/operations.js.map +0 -1
- package/lib/emitters/pagination.d.ts.map +0 -1
- package/lib/emitters/pagination.js.map +0 -1
- package/lib/emitters/reserved-names.d.ts +0 -5
- package/lib/emitters/reserved-names.d.ts.map +0 -1
- package/lib/emitters/reserved-names.js.map +0 -1
- package/lib/emitters/response-headers.d.ts +0 -14
- package/lib/emitters/response-headers.d.ts.map +0 -1
- package/lib/emitters/response-headers.js +0 -91
- package/lib/emitters/response-headers.js.map +0 -1
- package/lib/emitters/runtime-sources.d.ts +0 -16
- package/lib/emitters/runtime-sources.d.ts.map +0 -1
- package/lib/emitters/runtime-sources.js +0 -16
- package/lib/emitters/runtime-sources.js.map +0 -1
- package/lib/emitters/sample.d.ts.map +0 -1
- package/lib/emitters/sample.js.map +0 -1
- package/lib/emitters/setup-bake.d.ts.map +0 -1
- package/lib/emitters/setup-bake.js.map +0 -1
- package/lib/emitters/sse.d.ts +0 -10
- package/lib/emitters/sse.d.ts.map +0 -1
- package/lib/emitters/sse.js +0 -46
- package/lib/emitters/sse.js.map +0 -1
- package/lib/emitters/support.d.ts +0 -18
- package/lib/emitters/support.d.ts.map +0 -1
- package/lib/emitters/support.js +0 -37
- package/lib/emitters/support.js.map +0 -1
- package/lib/emitters/swr.d.ts.map +0 -1
- package/lib/emitters/swr.js +0 -88
- package/lib/emitters/swr.js.map +0 -1
- package/lib/emitters/tanstack-query.d.ts.map +0 -1
- package/lib/emitters/tanstack-query.js.map +0 -1
- package/lib/emitters/transformers.d.ts.map +0 -1
- package/lib/emitters/transformers.js.map +0 -1
- package/lib/emitters/ts.d.ts +0 -42
- package/lib/emitters/ts.d.ts.map +0 -1
- package/lib/emitters/ts.js +0 -116
- package/lib/emitters/ts.js.map +0 -1
- package/lib/emitters/type-guards.d.ts +0 -21
- package/lib/emitters/type-guards.d.ts.map +0 -1
- package/lib/emitters/type-guards.js.map +0 -1
- package/lib/emitters/types.d.ts +0 -15
- package/lib/emitters/types.d.ts.map +0 -1
- package/lib/emitters/types.js +0 -125
- package/lib/emitters/types.js.map +0 -1
- package/lib/emitters/wrapper-support.d.ts.map +0 -1
- package/lib/emitters/wrapper-support.js +0 -127
- package/lib/emitters/wrapper-support.js.map +0 -1
- package/lib/emitters/zod.d.ts.map +0 -1
- package/lib/emitters/zod.js.map +0 -1
- package/lib/generators/anchor.d.ts +0 -9
- package/lib/generators/anchor.d.ts.map +0 -1
- package/lib/generators/anchor.js +0 -10
- package/lib/generators/anchor.js.map +0 -1
- package/lib/generators/mock.d.ts.map +0 -1
- package/lib/generators/mock.js.map +0 -1
- package/lib/generators/sdk.d.ts +0 -12
- package/lib/generators/sdk.d.ts.map +0 -1
- package/lib/generators/sdk.js +0 -26
- package/lib/generators/sdk.js.map +0 -1
- package/lib/generators/swr.d.ts.map +0 -1
- package/lib/generators/swr.js.map +0 -1
- package/lib/generators/tanstack-query.d.ts.map +0 -1
- package/lib/generators/tanstack-query.js.map +0 -1
- package/lib/generators/transformers.d.ts.map +0 -1
- package/lib/generators/transformers.js.map +0 -1
- package/lib/generators/zod.d.ts.map +0 -1
- package/lib/generators/zod.js.map +0 -1
- package/lib/runtime/auth.d.ts.map +0 -1
- package/lib/runtime/auth.js.map +0 -1
- package/lib/runtime/create-client.d.ts.map +0 -1
- package/lib/runtime/create-client.js.map +0 -1
- package/lib/runtime/errors.d.ts.map +0 -1
- package/lib/runtime/errors.js.map +0 -1
- package/lib/runtime/index.d.ts.map +0 -1
- package/lib/runtime/index.js.map +0 -1
- package/lib/runtime/multipart.d.ts.map +0 -1
- package/lib/runtime/multipart.js.map +0 -1
- package/lib/runtime/paginate.d.ts.map +0 -1
- package/lib/runtime/paginate.js.map +0 -1
- package/lib/runtime/parse.d.ts.map +0 -1
- package/lib/runtime/parse.js.map +0 -1
- package/lib/runtime/retry.d.ts.map +0 -1
- package/lib/runtime/retry.js.map +0 -1
- package/lib/runtime/send.d.ts.map +0 -1
- package/lib/runtime/send.js.map +0 -1
- package/lib/runtime/setup.d.ts.map +0 -1
- package/lib/runtime/setup.js.map +0 -1
- package/lib/runtime/sse.d.ts.map +0 -1
- package/lib/runtime/sse.js.map +0 -1
- package/lib/runtime/types.d.ts.map +0 -1
- package/lib/runtime/types.js.map +0 -1
- package/lib/runtime/url.d.ts.map +0 -1
- package/lib/runtime/url.js.map +0 -1
- /package/lib/{emitters → generators/mock}/sample.js +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/auth.d.ts +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/auth.js +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/errors.d.ts +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/errors.js +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/index.d.ts +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/index.js +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/multipart.d.ts +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/multipart.js +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/parse.d.ts +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/parse.js +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/retry.d.ts +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/retry.js +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/send.d.ts +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/send.js +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/setup.d.ts +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/setup.js +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/sse.d.ts +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/sse.js +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/types.js +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/url.d.ts +0 -0
- /package/lib/{runtime → generators/typescript/runtime}/url.js +0 -0
- /package/lib/{emitters/setup-bake.d.ts → setup-bake.d.ts} +0 -0
package/lib/emitters/jsdoc.js
DELETED
|
@@ -1,83 +0,0 @@
|
|
|
1
|
-
import { splitLines } from './support.js';
|
|
2
|
-
import { escapeJsDoc } from './ts.js';
|
|
3
|
-
/**
|
|
4
|
-
* The JSDoc body for a description + metadata as a single `\n`-joined string,
|
|
5
|
-
* or `undefined` when there's nothing to document. The AST emitters feed this
|
|
6
|
-
* to `ts.ts`'s `jsdoc` helper (which owns the `*`-prefixing and indentation),
|
|
7
|
-
* so this returns only the raw body — no comment delimiters, no padding.
|
|
8
|
-
*/
|
|
9
|
-
export function jsdocText(text, metadata) {
|
|
10
|
-
const lines = jsdocLines(text, metadata);
|
|
11
|
-
return lines.length === 0 ? undefined : lines.join('\n');
|
|
12
|
-
}
|
|
13
|
-
/**
|
|
14
|
-
* Build the body of a JSDoc block from a description and an optional metadata
|
|
15
|
-
* bag. Description lines come first (trimmed of leading/trailing blanks); then
|
|
16
|
-
* the metadata tag lines in a stable, source-driven order.
|
|
17
|
-
*
|
|
18
|
-
* Returns `[]` when there's nothing to render — callers use the empty result
|
|
19
|
-
* to skip emitting any JSDoc at all.
|
|
20
|
-
*/
|
|
21
|
-
function jsdocLines(text, metadata) {
|
|
22
|
-
const lines = [];
|
|
23
|
-
if (text && text.trim()) {
|
|
24
|
-
lines.push(...trimLines(splitLines(text)));
|
|
25
|
-
}
|
|
26
|
-
if (metadata) {
|
|
27
|
-
lines.push(...formatMetadata(metadata));
|
|
28
|
-
}
|
|
29
|
-
return lines;
|
|
30
|
-
}
|
|
31
|
-
/**
|
|
32
|
-
* Project a SchemaMetadata bag into JSDoc tag lines.
|
|
33
|
-
*
|
|
34
|
-
* Order matches the (near-)spec order so generated output is deterministic and
|
|
35
|
-
* diff-stable. `pattern` is escaped so an embedded `*/` cannot terminate the
|
|
36
|
-
* surrounding JSDoc block.
|
|
37
|
-
*/
|
|
38
|
-
function formatMetadata(metadata) {
|
|
39
|
-
const lines = [];
|
|
40
|
-
const push = (tag, value) => {
|
|
41
|
-
if (value === undefined) {
|
|
42
|
-
lines.push(`@${tag}`);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
lines.push(`@${tag} ${value}`);
|
|
46
|
-
}
|
|
47
|
-
};
|
|
48
|
-
if (metadata.minimum !== undefined)
|
|
49
|
-
push('minimum', metadata.minimum);
|
|
50
|
-
if (metadata.maximum !== undefined)
|
|
51
|
-
push('maximum', metadata.maximum);
|
|
52
|
-
if (metadata.exclusiveMinimum !== undefined)
|
|
53
|
-
push('exclusiveMinimum', metadata.exclusiveMinimum);
|
|
54
|
-
if (metadata.exclusiveMaximum !== undefined)
|
|
55
|
-
push('exclusiveMaximum', metadata.exclusiveMaximum);
|
|
56
|
-
if (metadata.minLength !== undefined)
|
|
57
|
-
push('minLength', metadata.minLength);
|
|
58
|
-
if (metadata.maxLength !== undefined)
|
|
59
|
-
push('maxLength', metadata.maxLength);
|
|
60
|
-
if (metadata.pattern !== undefined)
|
|
61
|
-
push('pattern', escapeJsDoc(metadata.pattern));
|
|
62
|
-
if (metadata.minItems !== undefined)
|
|
63
|
-
push('minItems', metadata.minItems);
|
|
64
|
-
if (metadata.maxItems !== undefined)
|
|
65
|
-
push('maxItems', metadata.maxItems);
|
|
66
|
-
if (metadata.uniqueItems === true)
|
|
67
|
-
push('uniqueItems');
|
|
68
|
-
if (metadata.format !== undefined)
|
|
69
|
-
push('format', metadata.format);
|
|
70
|
-
if (metadata.deprecated === true)
|
|
71
|
-
push('deprecated');
|
|
72
|
-
return lines;
|
|
73
|
-
}
|
|
74
|
-
function trimLines(lines) {
|
|
75
|
-
let start = 0;
|
|
76
|
-
let end = lines.length;
|
|
77
|
-
while (start < end && lines[start] === '')
|
|
78
|
-
start++;
|
|
79
|
-
while (end > start && lines[end - 1] === '')
|
|
80
|
-
end--;
|
|
81
|
-
return lines.slice(start, end);
|
|
82
|
-
}
|
|
83
|
-
//# sourceMappingURL=jsdoc.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"jsdoc.js","sourceRoot":"","sources":["../../src/emitters/jsdoc.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC1C,OAAO,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAEtC;;;;;GAKG;AACH,MAAM,UAAU,SAAS,CAAC,IAAwB,EAAE,QAAyB;IAC3E,MAAM,KAAK,GAAG,UAAU,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC;IACzC,OAAO,KAAK,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;AAC3D,CAAC;AAED;;;;;;;GAOG;AACH,SAAS,UAAU,CAAC,IAAwB,EAAE,QAAoC;IAChF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,EAAE,EAAE,CAAC;QACxB,KAAK,CAAC,IAAI,CAAC,GAAG,SAAS,CAAC,UAAU,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC;IAC7C,CAAC;IACD,IAAI,QAAQ,EAAE,CAAC;QACb,KAAK,CAAC,IAAI,CAAC,GAAG,cAAc,CAAC,QAAQ,CAAC,CAAC,CAAC;IAC1C,CAAC;IACD,OAAO,K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AAQ,GAAG,OAAO,CAAC;IAC9B,yFAAyF;IACzF,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAYF,kFAAkF;AAClF,wBAAgB,gBAAgB,CAAC,KAAK,EAAE,QAAQ,EAAE,IAAI,EAAE,WAAW,GAAG,MAAM,CAqB3E"}
|
package/lib/emitters/mock.js
DELETED
|
@@ -1,265 +0,0 @@
|
|
|
1
|
-
// Emits a `*.mocks.ts` module: a `create<Schema>(overrides?)` data factory per
|
|
2
|
-
// named schema, an `<op>Handler(override?)` MSW request handler per operation
|
|
3
|
-
// (its primary success response), and an aggregated `handlers` array. Response
|
|
4
|
-
// data is sampled at codegen time (`sampleValue`) and printed as
|
|
5
|
-
// TypeScript literals through `ts.factory`, so the generated module depends only
|
|
6
|
-
// on `msw` — the real client stays zero-dependency.
|
|
7
|
-
import { isPlainObject } from '@redocly/openapi-core';
|
|
8
|
-
import { allOperations, } from '../intermediate-representation/model.js';
|
|
9
|
-
import { fakerExpression } from './faker.js';
|
|
10
|
-
import { safeIdent } from './identifier.js';
|
|
11
|
-
import { sampleValue, SampleExpression } from './sample.js';
|
|
12
|
-
import { pascalCase } from './support.js';
|
|
13
|
-
import { literalExpression, parseExpression, printStatements, ts } from './ts.js';
|
|
14
|
-
const { factory } = ts;
|
|
15
|
-
/** The body expression for `schema` under the active data mode: a static literal tree
|
|
16
|
-
* (`'static'`) or a tree of `@faker-js/faker` calls (`'faker'`). Both honor `dateType`
|
|
17
|
-
* and the binary/Blob type demand; the faker path inlines refs with the same cycle
|
|
18
|
-
* guard as the static sampler, so neither recurses forever on a cyclic schema. */
|
|
19
|
-
function bodyExpression(schema, model, opts) {
|
|
20
|
-
return opts.mockData === 'faker'
|
|
21
|
-
? fakerExpression(schema, model.schemas, { dateType: opts.dateType })
|
|
22
|
-
: literal(sampleValue(schema, model.schemas, { dateType: opts.dateType }));
|
|
23
|
-
}
|
|
24
|
-
/** Render the full `*.mocks.ts` source. `''` when the model has no operations. */
|
|
25
|
-
export function renderMockModule(model, opts) {
|
|
26
|
-
const operations = allOperations(model.services);
|
|
27
|
-
if (operations.length === 0)
|
|
28
|
-
return '';
|
|
29
|
-
const factories = model.schemas.map((s) => factoryFor(s, model, opts));
|
|
30
|
-
const handlers = operations.flatMap((op) => [
|
|
31
|
-
handlerFor(op, model, opts),
|
|
32
|
-
...(op.errorResponses.length > 0 ? [errorHandlerFor(op, model, opts)] : []),
|
|
33
|
-
]);
|
|
34
|
-
const typeImport = schemaTypeImport(model, opts);
|
|
35
|
-
// Faker mode imports `faker` (the consumer's dev-dep) and, with a seed, pins it once
|
|
36
|
-
// at module top so every run reproduces. Static mode emits neither (stays zero-dep).
|
|
37
|
-
const fakerImport = opts.mockData === 'faker' ? "import { faker } from '@faker-js/faker';\n" : '';
|
|
38
|
-
const seed = opts.mockData === 'faker' && opts.mockSeed !== undefined ? [seedStatement(opts.mockSeed)] : [];
|
|
39
|
-
return `import { http, HttpResponse } from 'msw';\n${fakerImport}\n${printStatements([
|
|
40
|
-
...typeImport,
|
|
41
|
-
...seed,
|
|
42
|
-
...factories,
|
|
43
|
-
...handlers,
|
|
44
|
-
handlersArray(operations),
|
|
45
|
-
])}`;
|
|
46
|
-
}
|
|
47
|
-
/** `faker.seed(<n>);` — pins faker's PRNG so a seeded faker-mode module reproduces. */
|
|
48
|
-
function seedStatement(seed) {
|
|
49
|
-
return factory.createExpressionStatement(factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier('faker'), 'seed'), undefined, [factory.createNumericLiteral(seed)]));
|
|
50
|
-
}
|
|
51
|
-
/**
|
|
52
|
-
* `import type { A, B, … } from '<sdkModule>';` — the named-schema types the factories
|
|
53
|
-
* reference (`create<Pascal>` returns/accepts `<Pascal>`). Sorted for stable output.
|
|
54
|
-
* Empty when the model has no named schemas (so no type import is emitted). Importing
|
|
55
|
-
* the schema types also shadows globals of the same name (e.g. an `Error` schema) so the
|
|
56
|
-
* factory return types resolve to the generated type, not `globalThis.Error`.
|
|
57
|
-
*/
|
|
58
|
-
function schemaTypeImport(model, opts) {
|
|
59
|
-
if (model.schemas.length === 0)
|
|
60
|
-
return [];
|
|
61
|
-
// Verbatim, not PascalCased: the sdk exports each schema type under its emitted name
|
|
62
|
-
// (`pet` stays `pet`), and the import must match it exactly.
|
|
63
|
-
const names = model.schemas.map((s) => s.name).sort();
|
|
64
|
-
return [
|
|
65
|
-
factory.createImportDeclaration(undefined, factory.createImportClause(true, undefined, factory.createNamedImports(names.map((name) => factory.createImportSpecifier(false, undefined, factory.createIdentifier(name))))), factory.createStringLiteral(opts.sdkModule)),
|
|
66
|
-
];
|
|
67
|
-
}
|
|
68
|
-
/**
|
|
69
|
-
* `export function create<Pascal>(overrides?: Partial<Name>): Name { return { …sampled, ...overrides }; }`.
|
|
70
|
-
* A schema whose sample is not an object literal (a scalar, enum, date, …) has nothing
|
|
71
|
-
* to spread into — `Partial<string>` is meaningless and would silently drop the argument —
|
|
72
|
-
* so its factory takes the FULL type and returns the override wholesale (`overrides ?? sample`).
|
|
73
|
-
*/
|
|
74
|
-
function factoryFor(named, model, opts) {
|
|
75
|
-
const pascal = pascalCase(named.name);
|
|
76
|
-
const sampled = bodyExpression(named.schema, model, opts);
|
|
77
|
-
// Type references use the sdk's verbatim export name; only the factory NAME is PascalCased.
|
|
78
|
-
const typeRef = factory.createTypeReferenceNode(named.name);
|
|
79
|
-
const spreads = ts.isObjectLiteralExpression(sampled);
|
|
80
|
-
// Spreading `Partial<Union>` (the override type of a union schema) distributes into
|
|
81
|
-
// `Partial<A> | Partial<B>`, which widens any discriminant property (e.g. `category`)
|
|
82
|
-
// and defeats narrowing — TS can no longer place the literal in a single union member.
|
|
83
|
-
// The sampled object is already a complete, correct member, so re-assert the type.
|
|
84
|
-
const body = !spreads
|
|
85
|
-
? factory.createBinaryExpression(factory.createIdentifier('overrides'), factory.createToken(ts.SyntaxKind.QuestionQuestionToken), sampled)
|
|
86
|
-
: named.schema.kind === 'union'
|
|
87
|
-
? factory.createAsExpression(spreadOverrides(sampled, 'overrides'), typeRef)
|
|
88
|
-
: spreadOverrides(sampled, 'overrides');
|
|
89
|
-
return factory.createFunctionDeclaration([factory.createModifier(ts.SyntaxKind.ExportKeyword)], undefined, `create${pascal}`, undefined, [
|
|
90
|
-
factory.createParameterDeclaration(undefined, undefined, 'overrides', factory.createToken(ts.SyntaxKind.QuestionToken), spreads ? factory.createTypeReferenceNode('Partial', [typeRef]) : typeRef),
|
|
91
|
-
], typeRef, factory.createBlock([factory.createReturnStatement(body)], true));
|
|
92
|
-
}
|
|
93
|
-
/** `export const <op>Handler = (override?: <OverrideType>) => http.<method>('<path>', () => <response>);`. */
|
|
94
|
-
function handlerFor(op, model, opts) {
|
|
95
|
-
const override = overrideParam(op, model, opts);
|
|
96
|
-
const arrow = factory.createArrowFunction(undefined, undefined, override ? [override] : [], undefined, factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), handlerCall(op, model, opts));
|
|
97
|
-
return factory.createVariableStatement([factory.createModifier(ts.SyntaxKind.ExportKeyword)], factory.createVariableDeclarationList([factory.createVariableDeclaration(`${op.name}Handler`, undefined, undefined, arrow)], ts.NodeFlags.Const));
|
|
98
|
-
}
|
|
99
|
-
/**
|
|
100
|
-
* `export const <op>ErrorHandler = (status: <StatusUnion>, body?: <BodyType>) =>
|
|
101
|
-
* http.<method>("<mswPath>", () => HttpResponse.json(body ?? <staticSample>, { status }));`
|
|
102
|
-
*
|
|
103
|
-
* Opt-in (not added to `handlers`): `server.use(getPetErrorHandler(404))` overrides the
|
|
104
|
-
* happy path with an error. `<StatusUnion>` is the declared error statuses as literals
|
|
105
|
-
* (plus `number` when a `default` error is present, so any status is allowed). The static
|
|
106
|
-
* fallback samples the FIRST error response's schema.
|
|
107
|
-
*/
|
|
108
|
-
function errorHandlerFor(op, model, opts) {
|
|
109
|
-
const first = op.errorResponses[0];
|
|
110
|
-
const sampled = bodyExpression(first.schema, model, opts);
|
|
111
|
-
const body = factory.createBinaryExpression(factory.createIdentifier('body'), factory.createToken(ts.SyntaxKind.QuestionQuestionToken), sampled);
|
|
112
|
-
const resolver = factory.createArrowFunction(undefined, undefined, [], undefined, factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier('HttpResponse'), 'json'), undefined, [
|
|
113
|
-
body,
|
|
114
|
-
factory.createObjectLiteralExpression([factory.createShorthandPropertyAssignment('status')], false),
|
|
115
|
-
]));
|
|
116
|
-
const call = factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier('http'), op.method), undefined, [factory.createStringLiteral(mswPath(op.path)), resolver]);
|
|
117
|
-
const arrow = factory.createArrowFunction(undefined, undefined, [
|
|
118
|
-
factory.createParameterDeclaration(undefined, undefined, 'status', undefined, errorStatusType(op)),
|
|
119
|
-
factory.createParameterDeclaration(undefined, undefined, 'body', factory.createToken(ts.SyntaxKind.QuestionToken), errorBodyType(op)),
|
|
120
|
-
], undefined, factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), call);
|
|
121
|
-
return factory.createVariableStatement([factory.createModifier(ts.SyntaxKind.ExportKeyword)], factory.createVariableDeclarationList([factory.createVariableDeclaration(`${op.name}ErrorHandler`, undefined, undefined, arrow)], ts.NodeFlags.Const));
|
|
122
|
-
}
|
|
123
|
-
/**
|
|
124
|
-
* A union of the op's declared numeric error statuses (as literals); `number` is used in place
|
|
125
|
-
* of a literal whenever a `default` error or a `4XX`/`5XX` range is present, so any status is
|
|
126
|
-
* accepted. De-duped, since a multi-media-type error contributes the same status more than once.
|
|
127
|
-
*/
|
|
128
|
-
function errorStatusType(op) {
|
|
129
|
-
const codes = [
|
|
130
|
-
...new Set(op.errorResponses.filter((r) => typeof r.status === 'number').map((r) => r.status)),
|
|
131
|
-
];
|
|
132
|
-
const members = codes.map((c) => factory.createLiteralTypeNode(factory.createNumericLiteral(c)));
|
|
133
|
-
// A `default` error (or a range wildcard) means any status is valid — widen with `number`.
|
|
134
|
-
if (op.errorResponses.some((r) => typeof r.status !== 'number')) {
|
|
135
|
-
members.push(factory.createKeywordTypeNode(ts.SyntaxKind.NumberKeyword));
|
|
136
|
-
}
|
|
137
|
-
return members.length === 1 ? members[0] : factory.createUnionTypeNode(members);
|
|
138
|
-
}
|
|
139
|
-
/**
|
|
140
|
-
* The `body?` type: the union of the error responses' body types — `ref` bodies map to their
|
|
141
|
-
* named type, anything else to `unknown` (matching how the success handler types its override
|
|
142
|
-
* loosely). De-duped by printed name.
|
|
143
|
-
*/
|
|
144
|
-
function errorBodyType(op) {
|
|
145
|
-
const names = new Set();
|
|
146
|
-
let hasUnknown = false;
|
|
147
|
-
for (const r of op.errorResponses) {
|
|
148
|
-
if (r.schema.kind === 'ref')
|
|
149
|
-
names.add(r.schema.name);
|
|
150
|
-
else
|
|
151
|
-
hasUnknown = true;
|
|
152
|
-
}
|
|
153
|
-
const members = [...names].map((n) => factory.createTypeReferenceNode(n));
|
|
154
|
-
if (hasUnknown || members.length === 0) {
|
|
155
|
-
members.push(factory.createKeywordTypeNode(ts.SyntaxKind.UnknownKeyword));
|
|
156
|
-
}
|
|
157
|
-
return members.length === 1 ? members[0] : factory.createUnionTypeNode(members);
|
|
158
|
-
}
|
|
159
|
-
/**
|
|
160
|
-
* The handler's `override?` parameter, present only when the response consumes it.
|
|
161
|
-
* A `ref` success body forwards `override` to `create<Schema>(override)`, so its type
|
|
162
|
-
* mirrors the factory's parameter (`Partial<Schema>`, or the full type when the factory
|
|
163
|
-
* replaces wholesale — see `factoryFor`). An inline object body spreads `override`, typed
|
|
164
|
-
* `Record<string, unknown>`. A body-less or non-object inline response has nothing to
|
|
165
|
-
* override, so the handler takes no parameter.
|
|
166
|
-
*/
|
|
167
|
-
function overrideParam(op, model, opts) {
|
|
168
|
-
const success = op.successResponses[0];
|
|
169
|
-
if (!success || success.schema.kind === 'unknown')
|
|
170
|
-
return undefined;
|
|
171
|
-
let type;
|
|
172
|
-
if (success.schema.kind === 'ref') {
|
|
173
|
-
const typeRef = factory.createTypeReferenceNode(success.schema.name);
|
|
174
|
-
type = ts.isObjectLiteralExpression(bodyExpression(success.schema, model, opts))
|
|
175
|
-
? factory.createTypeReferenceNode('Partial', [typeRef])
|
|
176
|
-
: typeRef;
|
|
177
|
-
}
|
|
178
|
-
else {
|
|
179
|
-
if (!ts.isObjectLiteralExpression(bodyExpression(success.schema, model, opts))) {
|
|
180
|
-
return undefined;
|
|
181
|
-
}
|
|
182
|
-
type = factory.createTypeReferenceNode('Record', [
|
|
183
|
-
factory.createKeywordTypeNode(ts.SyntaxKind.StringKeyword),
|
|
184
|
-
factory.createKeywordTypeNode(ts.SyntaxKind.UnknownKeyword),
|
|
185
|
-
]);
|
|
186
|
-
}
|
|
187
|
-
return factory.createParameterDeclaration(undefined, undefined, 'override', factory.createToken(ts.SyntaxKind.QuestionToken), type);
|
|
188
|
-
}
|
|
189
|
-
/** `http.<method>('<mswPath>', () => <responseExpr>)`. */
|
|
190
|
-
function handlerCall(op, model, opts) {
|
|
191
|
-
const resolver = factory.createArrowFunction(undefined, undefined, [], undefined, factory.createToken(ts.SyntaxKind.EqualsGreaterThanToken), responseExpression(op, model, opts));
|
|
192
|
-
return factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier('http'), op.method), undefined, [factory.createStringLiteral(mswPath(op.path)), resolver]);
|
|
193
|
-
}
|
|
194
|
-
/**
|
|
195
|
-
* The handler's response. A primary success body becomes `HttpResponse.json(…)`:
|
|
196
|
-
* a `ref` body calls its named `create<Schema>(override)` factory; an inline body
|
|
197
|
-
* is sampled and printed in place with `...override` spread in. A success with no
|
|
198
|
-
* usable body (an `unknown` schema, or no success response at all) becomes a
|
|
199
|
-
* body-less `new HttpResponse(null, { status })`. The status is the success
|
|
200
|
-
* response's declared code, or 200 when it's `default`/absent.
|
|
201
|
-
*/
|
|
202
|
-
function responseExpression(op, model, opts) {
|
|
203
|
-
const success = op.successResponses[0];
|
|
204
|
-
const status = statusCode(success?.status);
|
|
205
|
-
if (!success || success.schema.kind === 'unknown')
|
|
206
|
-
return emptyResponse(status);
|
|
207
|
-
const data = success.schema.kind === 'ref'
|
|
208
|
-
? factory.createCallExpression(factory.createIdentifier(`create${pascalCase(success.schema.name)}`), undefined, [factory.createIdentifier('override')])
|
|
209
|
-
: spreadOverrides(bodyExpression(success.schema, model, opts), 'override');
|
|
210
|
-
// `HttpResponse.json(x)` already defaults to 200, so only pass `{ status }` when it differs.
|
|
211
|
-
const args = status === 200 ? [data] : [data, statusInit(status)];
|
|
212
|
-
return factory.createCallExpression(factory.createPropertyAccessExpression(factory.createIdentifier('HttpResponse'), 'json'), undefined, args);
|
|
213
|
-
}
|
|
214
|
-
/** Numeric status for a response, mapping `default`/absent to 200. */
|
|
215
|
-
function statusCode(status) {
|
|
216
|
-
return typeof status === 'number' ? status : 200;
|
|
217
|
-
}
|
|
218
|
-
/** `{ status: <n> }`. */
|
|
219
|
-
function statusInit(status) {
|
|
220
|
-
return factory.createObjectLiteralExpression([factory.createPropertyAssignment('status', factory.createNumericLiteral(status))], false);
|
|
221
|
-
}
|
|
222
|
-
/** `new HttpResponse(null, { status: <n> })`. */
|
|
223
|
-
function emptyResponse(status) {
|
|
224
|
-
return factory.createNewExpression(factory.createIdentifier('HttpResponse'), undefined, [
|
|
225
|
-
factory.createNull(),
|
|
226
|
-
statusInit(status),
|
|
227
|
-
]);
|
|
228
|
-
}
|
|
229
|
-
/** `export const handlers = [<op>Handler(), …];`. */
|
|
230
|
-
function handlersArray(operations) {
|
|
231
|
-
const elements = operations.map((op) => factory.createCallExpression(factory.createIdentifier(`${op.name}Handler`), undefined, []));
|
|
232
|
-
return factory.createVariableStatement([factory.createModifier(ts.SyntaxKind.ExportKeyword)], factory.createVariableDeclarationList([
|
|
233
|
-
factory.createVariableDeclaration('handlers', undefined, undefined, factory.createArrayLiteralExpression(elements, false)),
|
|
234
|
-
], ts.NodeFlags.Const));
|
|
235
|
-
}
|
|
236
|
-
/** Spread `<spreadName>` into an object literal; non-object values pass through unchanged. */
|
|
237
|
-
function spreadOverrides(value, spreadName) {
|
|
238
|
-
if (!ts.isObjectLiteralExpression(value))
|
|
239
|
-
return value;
|
|
240
|
-
return factory.createObjectLiteralExpression([...value.properties, factory.createSpreadAssignment(factory.createIdentifier(spreadName))], true);
|
|
241
|
-
}
|
|
242
|
-
/** `/pets/{petId}` → `*/pets/:petId` — MSW path with a wildcard origin and `:param` segments. */
|
|
243
|
-
function mswPath(path) {
|
|
244
|
-
return `*${path.replace(/\{([^{}]+)\}/g, ':$1')}`;
|
|
245
|
-
}
|
|
246
|
-
/** Recursively print a sampled JS value as a TypeScript literal expression. Containers
|
|
247
|
-
* stay local rather than delegating to the shared `literalExpression`: sampled trees
|
|
248
|
-
* print multiline and may nest a `SampleExpression` at any depth. */
|
|
249
|
-
function literal(value) {
|
|
250
|
-
if (value instanceof SampleExpression)
|
|
251
|
-
return parseExpression(value.code);
|
|
252
|
-
if (Array.isArray(value)) {
|
|
253
|
-
return factory.createArrayLiteralExpression(value.map(literal), true);
|
|
254
|
-
}
|
|
255
|
-
if (isPlainObject(value)) {
|
|
256
|
-
const entries = Object.entries(value);
|
|
257
|
-
return factory.createObjectLiteralExpression(entries.map(([key, v]) => {
|
|
258
|
-
const safe = safeIdent(key);
|
|
259
|
-
const name = safe === key ? factory.createIdentifier(key) : factory.createStringLiteral(key);
|
|
260
|
-
return factory.createPropertyAssignment(name, literal(v));
|
|
261
|
-
}), true);
|
|
262
|
-
}
|
|
263
|
-
return literalExpression(value);
|
|
264
|
-
}
|
|
265
|
-
//# sourceMappingURL=mock.js.map
|
package/lib/emitters/mock.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"mock.js","sourceRoot":"","sources":["../../src/emitters/mock.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAC/E,8EAA8E;AAC9E,+EAA+E;AAC/E,iEAAiE;AACjE,iFAAiF;AACjF,oDAAoD;AAEpD,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC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AAC,EAAE,IAAI,CAAC,CAAC;IACxE,CAAC;IACD,IAAI,aAAa,CAAC,KAAK,CAAC,EAAE,CAAC;QACzB,MAAM,OAAO,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;QACtC,OAAO,OAAO,CAAC,6BAA6B,CAC1C,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,EAAE,EAAE;YACvB,MAAM,IAAI,GAAG,SAAS,CAAC,GAAG,CAAC,CAAC;YAC5B,MAAM,IAAI,GACR,IAAI,KAAK,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,gBAAgB,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,mBAAmB,CAAC,GAAG,CAAC,CAAC;YAClF,OAAO,OAAO,CAAC,wBAAwB,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC,CAAC;QAC5D,CAAC,CAAC,EACF,IAAI,CACL,CAAC;IACJ,CAAC;IACD,OAAO,iBAAiB,CAAC,KAAK,CAAC,CAAC;AAClC,CAAC"}
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import type { OperationModel, ParamModel } from '../intermediate-representation/model.js';
|
|
2
|
-
import type { EmitContext } from './operations.js';
|
|
3
|
-
import { ts } from './ts.js';
|
|
4
|
-
/**
|
|
5
|
-
* Emit derived type aliases for an operation so callers can name intermediate
|
|
6
|
-
* values without re-deriving via `Awaited<ReturnType<...>>` plumbing.
|
|
7
|
-
*
|
|
8
|
-
* `*Result` is always emitted (even for `void`). The others are conditional on
|
|
9
|
-
* the operation actually having the corresponding inputs — emitting empty
|
|
10
|
-
* `*Params = {}` or `*Body = unknown` aliases would just be noise.
|
|
11
|
-
*/
|
|
12
|
-
export declare function renderOperationAliases(op: OperationModel, responseType: ts.TypeNode, orderedPathParams: ParamModel[], pathParamIdent: Map<string, string>, errorAlias: string, errorMembers: ts.TypeNode[], ctx: EmitContext, emitResultAndError?: boolean, pathKeys?: 'ident' | 'wire'): ts.Statement[];
|
|
13
|
-
/**
|
|
14
|
-
* An SSE op's input aliases (`*Params` / `*Body` / `*Headers` / `*Variables`) — but NOT
|
|
15
|
-
* `*Result`/`*Error`, which describe a one-shot response an event stream has no equivalent of.
|
|
16
|
-
* Passes the real `schemaNames` so the input aliases still get collision suppression, and sets
|
|
17
|
-
* `emitResultAndError = false` to omit the result/error pair.
|
|
18
|
-
*/
|
|
19
|
-
export declare function sseAliases(op: OperationModel, orderedPathParams: ParamModel[], pathParamIdent: Map<string, string>, ctx: EmitContext, pathKeys?: 'ident' | 'wire'): ts.Statement[];
|
|
20
|
-
/**
|
|
21
|
-
* The `<Op>Variables` object type literal (the body of the alias, reused inline by the grouped
|
|
22
|
-
* signature when the alias name itself collides). Each `params`/`body`/`headers` property
|
|
23
|
-
* references its `<Op>X` alias, or inlines the type when that alias name collides with a schema
|
|
24
|
-
* (so a suppressed alias is never referenced).
|
|
25
|
-
*/
|
|
26
|
-
export declare function variablesTypeLiteral(op: OperationModel, name: string, orderedPathParams: ParamModel[], pathParamIdent: Map<string, string>, ctx: EmitContext, pathKeys?: 'ident' | 'wire'): ts.TypeNode;
|
|
27
|
-
//# sourceMappingURL=operation-aliases.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operation-aliases.d.ts","sourceRoot":"","sources":["../../src/emitters/operation-aliases.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAK1F,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,iBAAiB,CAAC;AAGnD,OAAO,EAAS,EAAE,EAAE,MAAM,SAAS,CAAC;AAKpC;;;;;;;GAOG;AACH,wBAAgB,sBAAsB,CACpC,EAAE,EAAE,cAAc,EAClB,YAAY,EAAE,EAAE,CAAC,QAAQ,EACzB,iBAAiB,EAAE,UAAU,EAAE,EAC/B,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,UAAU,EAAE,MAAM,EAClB,YAAY,EAAE,EAAE,CAAC,QAAQ,EAAE,EAC3B,GAAG,EAAE,WAAW,EAGhB,kBAAkB,UAAO,EAEzB,QAAQ,GAAE,OAAO,GAAG,MAAgB,GACnC,EAAE,CAAC,SAAS,EAAE,CAuEhB;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CACxB,EAAE,EAAE,cAAc,EAClB,iBAAiB,EAAE,UAAU,EAAE,EAC/B,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,GAAG,EAAE,WAAW,EAChB,QAAQ,GAAE,OAAO,GAAG,MAAgB,GACnC,EAAE,CAAC,SAAS,EAAE,CAYhB;AA6CD;;;;;GAKG;AACH,wBAAgB,oBAAoB,CAClC,EAAE,EAAE,cAAc,EAClB,IAAI,EAAE,MAAM,EACZ,iBAAiB,EAAE,UAAU,EAAE,EAC/B,cAAc,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EACnC,GAAG,EAAE,WAAW,EAIhB,QAAQ,GAAE,OAAO,GAAG,MAAgB,GACnC,EAAE,CAAC,QAAQ,CA+Db"}
|
|
@@ -1,150 +0,0 @@
|
|
|
1
|
-
// The `<Op>*` derived type-alias builders (`<Op>Result`/`Error`/`Params`/`Body`/`Headers`/`Variables`).
|
|
2
|
-
// Split out of operations.ts: this is the cohesive cluster the sdk emits so callers can name
|
|
3
|
-
// intermediate values. Reuses the shared type builders (operation-types.ts) and the block-wide
|
|
4
|
-
// `EmitContext` (a type-only import from operations.ts — erased, so there is no runtime cycle).
|
|
5
|
-
import { safeIdent } from './identifier.js';
|
|
6
|
-
import { jsdocText } from './jsdoc.js';
|
|
7
|
-
import { operationSignature } from './operation-signature.js';
|
|
8
|
-
import { bodyTypeNode, paramsTypeLiteral, propertyKey } from './operation-types.js';
|
|
9
|
-
import { responseHeadersTypeLiteral } from './response-headers.js';
|
|
10
|
-
import { pascalCase } from './support.js';
|
|
11
|
-
import { jsdoc, ts } from './ts.js';
|
|
12
|
-
import { schemaToTypeNode } from './types.js';
|
|
13
|
-
const { factory } = ts;
|
|
14
|
-
/**
|
|
15
|
-
* Emit derived type aliases for an operation so callers can name intermediate
|
|
16
|
-
* values without re-deriving via `Awaited<ReturnType<...>>` plumbing.
|
|
17
|
-
*
|
|
18
|
-
* `*Result` is always emitted (even for `void`). The others are conditional on
|
|
19
|
-
* the operation actually having the corresponding inputs — emitting empty
|
|
20
|
-
* `*Params = {}` or `*Body = unknown` aliases would just be noise.
|
|
21
|
-
*/
|
|
22
|
-
export function renderOperationAliases(op, responseType, orderedPathParams, pathParamIdent, errorAlias, errorMembers, ctx,
|
|
23
|
-
// SSE ops have no one-shot response, so they omit `*Result`/`*Error` and keep only the input
|
|
24
|
-
// aliases.
|
|
25
|
-
emitResultAndError = true,
|
|
26
|
-
// Threaded to the `<Op>Variables` body — see `variablesTypeLiteral`.
|
|
27
|
-
pathKeys = 'ident') {
|
|
28
|
-
const { dateType, schemaNames } = ctx;
|
|
29
|
-
const name = pascalCase(op.name);
|
|
30
|
-
const aliases = [];
|
|
31
|
-
// Every derived alias is suppressed when its name collides with an exported schema (a
|
|
32
|
-
// duplicate `export type` is a TS2300 error). References to a suppressed alias inline the
|
|
33
|
-
// underlying type instead — see `renderOperationParts` (Result/Error) and `renderVariablesAlias`
|
|
34
|
-
// / the grouped signature (Params/Body/Headers/Variables).
|
|
35
|
-
// Emit `export type <Op>Result = …` unless its name collides with an exported schema. Two
|
|
36
|
-
// cases collide: self-referential (operation `search` returning schema `SearchResult` →
|
|
37
|
-
// `export type SearchResult = SearchResult;`, circular) and plain (operation `login` returning
|
|
38
|
-
// some other type while a `LoginResult` schema also exists). In both, call sites reference the
|
|
39
|
-
// response type directly (`renderOperationParts`), so the alias is redundant.
|
|
40
|
-
const resultName = `${name}Result`;
|
|
41
|
-
if (emitResultAndError && !schemaNames.has(resultName)) {
|
|
42
|
-
aliases.push(exportType(resultName, responseType));
|
|
43
|
-
}
|
|
44
|
-
// Result mode only, and only when the operation declares error responses: the typed `error`.
|
|
45
|
-
if (emitResultAndError && errorAlias && !schemaNames.has(errorAlias)) {
|
|
46
|
-
aliases.push(exportType(errorAlias, errorMembers.length === 1 ? errorMembers[0] : factory.createUnionTypeNode(errorMembers)));
|
|
47
|
-
}
|
|
48
|
-
if (op.queryParams.length > 0 && !schemaNames.has(`${name}Params`)) {
|
|
49
|
-
// Reuse the params type-literal builder so the alias body picks up per-prop
|
|
50
|
-
// JSDoc automatically — no second renderer to keep in sync.
|
|
51
|
-
aliases.push(exportType(`${name}Params`, paramsTypeLiteral(op.queryParams, dateType)));
|
|
52
|
-
}
|
|
53
|
-
if (op.requestBody && !schemaNames.has(`${name}Body`)) {
|
|
54
|
-
// Use the same content-type → TS-type mapping as the function signature, so
|
|
55
|
-
// `<Op>Body` matches the second-positional arg of the function exactly.
|
|
56
|
-
aliases.push(exportType(`${name}Body`, bodyTypeNode(op.requestBody, dateType)));
|
|
57
|
-
}
|
|
58
|
-
if (op.headerParams.length > 0 && !schemaNames.has(`${name}Headers`)) {
|
|
59
|
-
aliases.push(exportType(`${name}Headers`, paramsTypeLiteral(op.headerParams, dateType)));
|
|
60
|
-
}
|
|
61
|
-
// Response headers (envelope) — distinct from request `<Op>Headers`.
|
|
62
|
-
const responseHeaders = op.successResponseHeaders;
|
|
63
|
-
if (responseHeaders && responseHeaders.length > 0 && !schemaNames.has(`${name}ResponseHeaders`)) {
|
|
64
|
-
aliases.push(exportType(`${name}ResponseHeaders`, responseHeadersTypeLiteral(responseHeaders, ctx.schemas)));
|
|
65
|
-
}
|
|
66
|
-
if (op.cookieParams.length > 0 && !schemaNames.has(`${name}Cookies`)) {
|
|
67
|
-
aliases.push(exportType(`${name}Cookies`, paramsTypeLiteral(op.cookieParams, dateType)));
|
|
68
|
-
}
|
|
69
|
-
if (!schemaNames.has(`${name}Variables`)) {
|
|
70
|
-
const variables = renderVariablesAlias(op, name, orderedPathParams, pathParamIdent, ctx, pathKeys);
|
|
71
|
-
if (variables)
|
|
72
|
-
aliases.push(variables);
|
|
73
|
-
}
|
|
74
|
-
return aliases;
|
|
75
|
-
}
|
|
76
|
-
/**
|
|
77
|
-
* An SSE op's input aliases (`*Params` / `*Body` / `*Headers` / `*Variables`) — but NOT
|
|
78
|
-
* `*Result`/`*Error`, which describe a one-shot response an event stream has no equivalent of.
|
|
79
|
-
* Passes the real `schemaNames` so the input aliases still get collision suppression, and sets
|
|
80
|
-
* `emitResultAndError = false` to omit the result/error pair.
|
|
81
|
-
*/
|
|
82
|
-
export function sseAliases(op, orderedPathParams, pathParamIdent, ctx, pathKeys = 'ident') {
|
|
83
|
-
return renderOperationAliases(op, factory.createKeywordTypeNode(ts.SyntaxKind.UnknownKeyword), orderedPathParams, pathParamIdent, '', [], ctx, false, pathKeys);
|
|
84
|
-
}
|
|
85
|
-
/** `export type <name> = <type>;` */
|
|
86
|
-
function exportType(name, type) {
|
|
87
|
-
return factory.createTypeAliasDeclaration([factory.createModifier(ts.SyntaxKind.ExportKeyword)], name, undefined, type);
|
|
88
|
-
}
|
|
89
|
-
/**
|
|
90
|
-
* Combined inputs alias — a single object that bundles every positional input
|
|
91
|
-
* the operation function accepts. The seam React Query / SWR wrappers use:
|
|
92
|
-
*
|
|
93
|
-
* useMutation({ mutationFn: (vars: UpdateOrderVariables) => updateOrder(vars.orderId, vars.params, vars.body) })
|
|
94
|
-
*
|
|
95
|
-
* Conventions:
|
|
96
|
-
* - Property order: path params (URL-template order), then `params`, then `body`,
|
|
97
|
-
* then `headers`. Mirrors the function's positional argument order.
|
|
98
|
-
* - Path-param props carry the same JSDoc (description + schema metadata) the
|
|
99
|
-
* function declaration omits.
|
|
100
|
-
* - `params?` is optional iff the function signature defaults to `= {}` (all query
|
|
101
|
-
* params optional). Same rule for `body?` / `headers?`.
|
|
102
|
-
* - References `<Op>Params` / `<Op>Body` / `<Op>Headers` when those aliases were
|
|
103
|
-
* also emitted, so the aliases stay in sync without duplicating their bodies.
|
|
104
|
-
*
|
|
105
|
-
* Returns `undefined` for operations with no inputs at all.
|
|
106
|
-
*/
|
|
107
|
-
function renderVariablesAlias(op, name, orderedPathParams, pathParamIdent, ctx, pathKeys) {
|
|
108
|
-
if (!operationSignature(op).hasInputs)
|
|
109
|
-
return undefined;
|
|
110
|
-
return exportType(name + 'Variables', variablesTypeLiteral(op, name, orderedPathParams, pathParamIdent, ctx, pathKeys));
|
|
111
|
-
}
|
|
112
|
-
/**
|
|
113
|
-
* The `<Op>Variables` object type literal (the body of the alias, reused inline by the grouped
|
|
114
|
-
* signature when the alias name itself collides). Each `params`/`body`/`headers` property
|
|
115
|
-
* references its `<Op>X` alias, or inlines the type when that alias name collides with a schema
|
|
116
|
-
* (so a suppressed alias is never referenced).
|
|
117
|
-
*/
|
|
118
|
-
export function variablesTypeLiteral(op, name, orderedPathParams, pathParamIdent, ctx,
|
|
119
|
-
// How path-param properties are keyed: `'ident'` (default) uses the sanitized identifier
|
|
120
|
-
// that doubles as the flat positional argument; `'wire'` (package mode) uses the spec's
|
|
121
|
-
// param name — quoted when needed — because the runtime routes `args[param.name]`.
|
|
122
|
-
pathKeys = 'ident') {
|
|
123
|
-
const { dateType, schemaNames } = ctx;
|
|
124
|
-
const props = [];
|
|
125
|
-
for (const p of orderedPathParams) {
|
|
126
|
-
// Ident mode: same safe identifier the function uses, so a wrapper can map
|
|
127
|
-
// `vars.<ident>` straight onto the positional argument.
|
|
128
|
-
const sig = factory.createPropertySignature(undefined, pathKeys === 'wire' ? propertyKey(safeIdent(p.name)) : pathParamIdent.get(p.name), undefined, schemaToTypeNode(p.schema, dateType));
|
|
129
|
-
const doc = jsdocText(p.description, p.schema.metadata);
|
|
130
|
-
props.push(doc === undefined ? sig : jsdoc(sig, doc));
|
|
131
|
-
}
|
|
132
|
-
if (op.queryParams.length > 0) {
|
|
133
|
-
props.push(inputProp('params', `${name}Params`, () => paramsTypeLiteral(op.queryParams, dateType), op.queryParams.some((p) => p.required), schemaNames));
|
|
134
|
-
}
|
|
135
|
-
if (op.requestBody) {
|
|
136
|
-
props.push(inputProp('body', `${name}Body`, () => bodyTypeNode(op.requestBody, dateType), op.requestBody.required, schemaNames));
|
|
137
|
-
}
|
|
138
|
-
if (op.headerParams.length > 0) {
|
|
139
|
-
props.push(inputProp('headers', `${name}Headers`, () => paramsTypeLiteral(op.headerParams, dateType), op.headerParams.some((p) => p.required), schemaNames));
|
|
140
|
-
}
|
|
141
|
-
if (op.cookieParams.length > 0) {
|
|
142
|
-
props.push(inputProp('cookies', `${name}Cookies`, () => paramsTypeLiteral(op.cookieParams, dateType), op.cookieParams.some((p) => p.required), schemaNames));
|
|
143
|
-
}
|
|
144
|
-
return factory.createTypeLiteralNode(props);
|
|
145
|
-
}
|
|
146
|
-
/** A `<key>(?): <Alias>` property, or an inline-typed one when `<Alias>` collides with a schema. */
|
|
147
|
-
function inputProp(key, alias, inlineType, required, schemaNames) {
|
|
148
|
-
return factory.createPropertySignature(undefined, key, required ? undefined : factory.createToken(ts.SyntaxKind.QuestionToken), schemaNames.has(alias) ? inlineType() : factory.createTypeReferenceNode(alias));
|
|
149
|
-
}
|
|
150
|
-
//# sourceMappingURL=operation-aliases.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operation-aliases.js","sourceRoot":"","sources":["../../src/emitters/operation-aliases.ts"],"names":[],"mappings":"AAAA,wGAAwG;AACxG,6FAA6F;AAC7F,+FAA+F;AAC/F,gGAAgG;AAGhG,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAE,SAAS,EAAE,MAAM,YAAY,CAAC;AACvC,OAAO,EAAE,kBAAkB,EAAE,MAAM,0BAA0B,CAAC;AAC9D,OAAO,EAAE,YAAY,EAAE,iBAAiB,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEpF,OAAO,EAAE,0BAA0B,EAAE,MAAM,uBAAuB,CAAC;AACnE,OAAO,EAAE,UAAU,EAAE,MA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AED,OAAO,OAAO,CAAC,qBAAqB,CAAC,KAAK,CAAC,CAAC;AAC9C,CAAC;AAED,oGAAoG;AACpG,SAAS,SAAS,CAChB,GAAW,EACX,KAAa,EACb,UAA6B,EAC7B,QAAiB,EACjB,WAAwB;IAExB,OAAO,OAAO,CAAC,uBAAuB,CACpC,SAAS,EACT,GAAG,EACH,QAAQ,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC,CAAC,OAAO,CAAC,WAAW,CAAC,EAAE,CAAC,UAAU,CAAC,aAAa,CAAC,EACvE,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,UAAU,EAAE,CAAC,CAAC,CAAC,OAAO,CAAC,uBAAuB,CAAC,KAAK,CAAC,CAC/E,CAAC;AACJ,CAAC"}
|
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import type { OperationModel, ParamModel } from '../intermediate-representation/model.js';
|
|
2
|
-
/** A path parameter paired with the unique JS identifier used for it in flat mode. */
|
|
3
|
-
export type SignaturePathParam = {
|
|
4
|
-
param: ParamModel;
|
|
5
|
-
ident: string;
|
|
6
|
-
};
|
|
7
|
-
export type OperationSignature = {
|
|
8
|
-
/** Path params in URL-template order, each with its unique JS identifier. */
|
|
9
|
-
pathParams: SignaturePathParam[];
|
|
10
|
-
/** Slot presence, in the order flat-mode arguments follow the path params. */
|
|
11
|
-
hasQuery: boolean;
|
|
12
|
-
hasBody: boolean;
|
|
13
|
-
hasHeaders: boolean;
|
|
14
|
-
hasCookies: boolean;
|
|
15
|
-
/** Any input at all — i.e. a `<Op>Variables` type exists for the operation. */
|
|
16
|
-
hasInputs: boolean;
|
|
17
|
-
/** Grouped mode: whether `vars` is required (else it defaults to `= {}`). */
|
|
18
|
-
varsRequired: boolean;
|
|
19
|
-
/** The `<Op>Variables` type-alias name. */
|
|
20
|
-
variablesTypeName: string;
|
|
21
|
-
};
|
|
22
|
-
/** Compute the calling-convention description for `op`. Pure; no AST. */
|
|
23
|
-
export declare function operationSignature(op: OperationModel): OperationSignature;
|
|
24
|
-
//# sourceMappingURL=operation-signature.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"operation-signature.d.ts","sourceRoot":"","sources":["../../src/emitters/operation-signature.ts"],"names":[],"mappings":"AAKA,OAAO,KAAK,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,yCAAyC,CAAC;AAI1F,sFAAsF;AACtF,MAAM,MAAM,kBAAkB,GAAG;IAAE,KAAK,EAAE,UAAU,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAC;AAEtE,MAAM,MAAM,kBAAkB,GAAG;IAC/B,6EAA6E;IAC7E,UAAU,EAAE,kBAAkB,EAAE,CAAC;IACjC,8EAA8E;IAC9E,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,OAAO,CAAC;IACjB,UAAU,EAAE,OAAO,CAAC;IACpB,UAAU,EAAE,OAAO,CAAC;IACpB,+EAA+E;IAC/E,SAAS,EAAE,OAAO,CAAC;IACnB,6EAA6E;IAC7E,YAAY,EAAE,OAAO,CAAC;IACtB,2CAA2C;IAC3C,iBAAiB,EAAE,MAAM,CAAC;CAC3B,CAAC;AAEF,yEAAyE;AACzE,wBAAgB,kBAAkB,CAAC,EAAE,EAAE,cAAc,GAAG,kBAAkB,CAkCzE"}
|