@azure-tools/typespec-ts 0.56.0-dev.13 → 0.56.0-dev.15
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/CHANGELOG.md +16 -0
- package/README.md +31 -15
- package/dist/src/context-manager.d.ts +6 -6
- package/dist/src/context-manager.d.ts.map +1 -1
- package/dist/src/context-manager.js +1 -0
- package/dist/src/context-manager.js.map +1 -1
- package/dist/src/framework/declaration.d.ts +1 -1
- package/dist/src/framework/declaration.d.ts.map +1 -1
- package/dist/src/framework/declaration.js +2 -1
- package/dist/src/framework/declaration.js.map +1 -1
- package/dist/src/framework/hooks/binder.d.ts +2 -5
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +2 -29
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdk-types.d.ts +3 -3
- package/dist/src/framework/hooks/sdk-types.d.ts.map +1 -1
- package/dist/src/framework/hooks/sdk-types.js.map +1 -1
- package/dist/src/framework/hooks/use-dependencies.d.ts +1 -1
- package/dist/src/framework/hooks/use-dependencies.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.d.ts +2 -2
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +1 -13
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/framework/reference.js.map +1 -1
- package/dist/src/framework/source-file-batch.d.ts +1 -1
- package/dist/src/framework/source-file-batch.d.ts.map +1 -1
- package/dist/src/framework/source-file-batch.js +1 -1
- package/dist/src/framework/source-file-batch.js.map +1 -1
- package/dist/src/index.d.ts +4 -4
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +14 -17
- package/dist/src/index.js.map +1 -1
- package/dist/src/interfaces.d.ts +0 -1
- package/dist/src/interfaces.d.ts.map +1 -1
- package/dist/src/lib.d.ts +18 -4
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +22 -6
- package/dist/src/lib.js.map +1 -1
- package/dist/src/meta-tree.d.ts +2 -2
- package/dist/src/meta-tree.d.ts.map +1 -1
- package/dist/src/metadata/build-api-extractor-config.d.ts +1 -1
- package/dist/src/metadata/build-api-extractor-config.d.ts.map +1 -1
- package/dist/src/metadata/build-changelog-file.d.ts +1 -1
- package/dist/src/metadata/build-changelog-file.d.ts.map +1 -1
- package/dist/src/metadata/build-es-lint-config.d.ts +1 -1
- package/dist/src/metadata/build-es-lint-config.d.ts.map +1 -1
- package/dist/src/metadata/build-package-file.d.ts +3 -5
- package/dist/src/metadata/build-package-file.d.ts.map +1 -1
- package/dist/src/metadata/build-package-file.js +10 -45
- package/dist/src/metadata/build-package-file.js.map +1 -1
- package/dist/src/metadata/build-readme-file.d.ts +1 -1
- package/dist/src/metadata/build-readme-file.d.ts.map +1 -1
- package/dist/src/metadata/build-readme-file.js +3 -3
- package/dist/src/metadata/build-readme-file.js.map +1 -1
- package/dist/src/metadata/build-sample-env-file.d.ts +1 -1
- package/dist/src/metadata/build-sample-env-file.d.ts.map +1 -1
- package/dist/src/metadata/build-test-config.d.ts +1 -1
- package/dist/src/metadata/build-test-config.d.ts.map +1 -1
- package/dist/src/metadata/build-ts-config.d.ts +11 -5
- package/dist/src/metadata/build-ts-config.d.ts.map +1 -1
- package/dist/src/metadata/build-ts-config.js +36 -8
- package/dist/src/metadata/build-ts-config.js.map +1 -1
- package/dist/src/metadata/build-vitest-config.d.ts +1 -1
- package/dist/src/metadata/build-vitest-config.d.ts.map +1 -1
- package/dist/src/metadata/build-warp-config.d.ts +1 -3
- package/dist/src/metadata/build-warp-config.d.ts.map +1 -1
- package/dist/src/metadata/build-warp-config.js +0 -2
- package/dist/src/metadata/build-warp-config.js.map +1 -1
- package/dist/src/metadata/package-json/azure-package-common.d.ts +1 -1
- package/dist/src/metadata/package-json/azure-package-common.d.ts.map +1 -1
- package/dist/src/metadata/package-json/build-azure-monorepo-package.d.ts +1 -2
- package/dist/src/metadata/package-json/build-azure-monorepo-package.d.ts.map +1 -1
- package/dist/src/metadata/package-json/build-azure-monorepo-package.js +2 -16
- package/dist/src/metadata/package-json/build-azure-monorepo-package.js.map +1 -1
- package/dist/src/metadata/package-json/package-common.d.ts.map +1 -1
- package/dist/src/metadata/package-json/package-common.js +0 -15
- package/dist/src/metadata/package-json/package-common.js.map +1 -1
- package/dist/src/metadata/test/build-recorded-client.d.ts +1 -1
- package/dist/src/metadata/test/build-recorded-client.d.ts.map +1 -1
- package/dist/src/metadata/test/build-sample-test.d.ts +1 -1
- package/dist/src/metadata/test/build-sample-test.d.ts.map +1 -1
- package/dist/src/metadata/test/build-snippets.d.ts +1 -1
- package/dist/src/metadata/test/build-snippets.d.ts.map +1 -1
- package/dist/src/metadata/utils.d.ts +1 -1
- package/dist/src/metadata/utils.d.ts.map +1 -1
- package/dist/src/modular/build-classical-client.d.ts +3 -3
- package/dist/src/modular/build-classical-client.d.ts.map +1 -1
- package/dist/src/modular/build-classical-client.js +1 -1
- package/dist/src/modular/build-classical-client.js.map +1 -1
- package/dist/src/modular/build-classical-operation-groups.d.ts +3 -3
- package/dist/src/modular/build-classical-operation-groups.d.ts.map +1 -1
- package/dist/src/modular/build-classical-operation-groups.js +1 -0
- package/dist/src/modular/build-classical-operation-groups.js.map +1 -1
- package/dist/src/modular/build-client-context.d.ts +3 -3
- package/dist/src/modular/build-client-context.d.ts.map +1 -1
- package/dist/src/modular/build-client-context.js +1 -0
- package/dist/src/modular/build-client-context.js.map +1 -1
- package/dist/src/modular/build-modular-options.d.ts +2 -2
- package/dist/src/modular/build-modular-options.d.ts.map +1 -1
- package/dist/src/modular/build-operations.d.ts +5 -5
- package/dist/src/modular/build-operations.d.ts.map +1 -1
- package/dist/src/modular/build-operations.js +7 -4
- package/dist/src/modular/build-operations.js.map +1 -1
- package/dist/src/modular/build-project-files.d.ts +2 -2
- package/dist/src/modular/build-project-files.d.ts.map +1 -1
- package/dist/src/modular/build-restore-poller.d.ts +3 -3
- package/dist/src/modular/build-restore-poller.d.ts.map +1 -1
- package/dist/src/modular/build-restore-poller.js +1 -0
- package/dist/src/modular/build-restore-poller.js.map +1 -1
- package/dist/src/modular/build-root-index.d.ts +3 -3
- package/dist/src/modular/build-root-index.d.ts.map +1 -1
- package/dist/src/modular/build-root-index.js +4 -3
- package/dist/src/modular/build-root-index.js.map +1 -1
- package/dist/src/modular/build-subpath-index.d.ts +2 -2
- package/dist/src/modular/build-subpath-index.d.ts.map +1 -1
- package/dist/src/modular/build-subpath-index.js +1 -1
- package/dist/src/modular/build-subpath-index.js.map +1 -1
- package/dist/src/modular/emit-logger-file.d.ts +1 -1
- package/dist/src/modular/emit-logger-file.d.ts.map +1 -1
- package/dist/src/modular/emit-models-options.d.ts +3 -3
- package/dist/src/modular/emit-models-options.d.ts.map +1 -1
- package/dist/src/modular/emit-models-options.js.map +1 -1
- package/dist/src/modular/emit-models.d.ts +3 -3
- package/dist/src/modular/emit-models.d.ts.map +1 -1
- package/dist/src/modular/emit-models.js +1 -1
- package/dist/src/modular/emit-models.js.map +1 -1
- package/dist/src/modular/emit-samples.d.ts +1 -1
- package/dist/src/modular/emit-samples.d.ts.map +1 -1
- package/dist/src/modular/emit-samples.js +1 -1
- package/dist/src/modular/emit-samples.js.map +1 -1
- package/dist/src/modular/emit-tests.d.ts +1 -1
- package/dist/src/modular/emit-tests.d.ts.map +1 -1
- package/dist/src/modular/emit-tests.js +1 -0
- package/dist/src/modular/emit-tests.js.map +1 -1
- package/dist/src/modular/external-dependencies.d.ts +1 -1
- package/dist/src/modular/external-dependencies.d.ts.map +1 -1
- package/dist/src/modular/external-dependencies.js +10 -0
- package/dist/src/modular/external-dependencies.js.map +1 -1
- package/dist/src/modular/helpers/classical-operation-helpers.d.ts +3 -3
- package/dist/src/modular/helpers/classical-operation-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/classical-operation-helpers.js +1 -1
- package/dist/src/modular/helpers/classical-operation-helpers.js.map +1 -1
- package/dist/src/modular/helpers/client-helpers.d.ts +6 -6
- package/dist/src/modular/helpers/client-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/client-helpers.js +24 -7
- package/dist/src/modular/helpers/client-helpers.js.map +1 -1
- package/dist/src/modular/helpers/client-option-helpers.d.ts +1 -1
- package/dist/src/modular/helpers/client-option-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/example-value-helpers.d.ts +3 -3
- package/dist/src/modular/helpers/example-value-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/example-value-helpers.js +1 -0
- package/dist/src/modular/helpers/example-value-helpers.js.map +1 -1
- package/dist/src/modular/helpers/naming-helpers.d.ts +7 -4
- package/dist/src/modular/helpers/naming-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/naming-helpers.js +44 -5
- package/dist/src/modular/helpers/naming-helpers.js.map +1 -1
- package/dist/src/modular/helpers/operation-helpers.d.ts +7 -7
- package/dist/src/modular/helpers/operation-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operation-helpers.js +24 -21
- package/dist/src/modular/helpers/operation-helpers.js.map +1 -1
- package/dist/src/modular/helpers/type-helpers.d.ts +3 -3
- package/dist/src/modular/helpers/type-helpers.d.ts.map +1 -1
- package/dist/src/modular/interfaces.d.ts +1 -1
- package/dist/src/modular/interfaces.d.ts.map +1 -1
- package/dist/src/modular/serialization/build-deserializer-function.d.ts +4 -4
- package/dist/src/modular/serialization/build-deserializer-function.d.ts.map +1 -1
- package/dist/src/modular/serialization/build-deserializer-function.js.map +1 -1
- package/dist/src/modular/serialization/build-serializer-function.d.ts +4 -4
- package/dist/src/modular/serialization/build-serializer-function.d.ts.map +1 -1
- package/dist/src/modular/serialization/build-serializer-function.js.map +1 -1
- package/dist/src/modular/serialization/build-xml-serializer-function.d.ts +4 -4
- package/dist/src/modular/serialization/build-xml-serializer-function.d.ts.map +1 -1
- package/dist/src/modular/serialization/build-xml-serializer-function.js.map +1 -1
- package/dist/src/modular/serialization/serialize-utils.d.ts +1 -1
- package/dist/src/modular/serialization/serialize-utils.d.ts.map +1 -1
- package/dist/src/modular/static-helpers-metadata.d.ts +0 -12
- package/dist/src/modular/static-helpers-metadata.d.ts.map +1 -1
- package/dist/src/modular/static-helpers-metadata.js +0 -12
- package/dist/src/modular/static-helpers-metadata.js.map +1 -1
- package/dist/src/modular/type-expressions/get-credential-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-credential-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts +3 -3
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.d.ts +3 -3
- package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +3 -3
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.d.ts +2 -2
- package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts +3 -3
- package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/utils.d.ts +1 -1
- package/dist/src/modular/type-expressions/utils.d.ts.map +1 -1
- package/dist/src/transform/transform-api-version-info.d.ts +3 -3
- package/dist/src/transform/transform-api-version-info.d.ts.map +1 -1
- package/dist/src/transform/transform-api-version-info.js +1 -1
- package/dist/src/transform/transform-api-version-info.js.map +1 -1
- package/dist/src/transform/transform-client-options.d.ts +4 -4
- package/dist/src/transform/transform-client-options.d.ts.map +1 -1
- package/dist/src/transform/transform-client-options.js +1 -3
- package/dist/src/transform/transform-client-options.js.map +1 -1
- package/dist/src/transform/transform-helper-function-details.d.ts +3 -3
- package/dist/src/transform/transform-helper-function-details.d.ts.map +1 -1
- package/dist/src/transform/transform-helper-function-details.js +1 -1
- package/dist/src/transform/transform-helper-function-details.js.map +1 -1
- package/dist/src/transform/transform-parameters.d.ts +4 -4
- package/dist/src/transform/transform-parameters.d.ts.map +1 -1
- package/dist/src/transform/transform-parameters.js.map +1 -1
- package/dist/src/transform/transform-paths.d.ts +3 -3
- package/dist/src/transform/transform-paths.d.ts.map +1 -1
- package/dist/src/transform/transform-paths.js +1 -1
- package/dist/src/transform/transform-paths.js.map +1 -1
- package/dist/src/transform/transform-responses.d.ts +3 -3
- package/dist/src/transform/transform-responses.d.ts.map +1 -1
- package/dist/src/transform/transform-responses.js +1 -1
- package/dist/src/transform/transform-responses.js.map +1 -1
- package/dist/src/transform/transform-schemas.d.ts +2 -2
- package/dist/src/transform/transform-schemas.d.ts.map +1 -1
- package/dist/src/transform/transform-schemas.js +2 -2
- package/dist/src/transform/transform-schemas.js.map +1 -1
- package/dist/src/transform/transform-telemetry-info.d.ts +2 -2
- package/dist/src/transform/transform-telemetry-info.d.ts.map +1 -1
- package/dist/src/transform/transform.d.ts +3 -3
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/utils/api-version-util.d.ts +1 -1
- package/dist/src/utils/api-version-util.d.ts.map +1 -1
- package/dist/src/utils/client-utils.d.ts +4 -4
- package/dist/src/utils/client-utils.d.ts.map +1 -1
- package/dist/src/utils/credential-utils.d.ts +3 -3
- package/dist/src/utils/credential-utils.d.ts.map +1 -1
- package/dist/src/utils/credential-utils.js.map +1 -1
- package/dist/src/utils/cross-language-def.d.ts +1 -1
- package/dist/src/utils/cross-language-def.d.ts.map +1 -1
- package/dist/src/utils/emit-util.d.ts +2 -2
- package/dist/src/utils/emit-util.d.ts.map +1 -1
- package/dist/src/utils/emit-util.js +2 -2
- package/dist/src/utils/emit-util.js.map +1 -1
- package/dist/src/utils/file-system-utils.d.ts +1 -1
- package/dist/src/utils/file-system-utils.d.ts.map +1 -1
- package/dist/src/utils/file-system-utils.js.map +1 -1
- package/dist/src/utils/import-helper.js +1 -0
- package/dist/src/utils/import-helper.js.map +1 -1
- package/dist/src/utils/imports-util.d.ts +1 -1
- package/dist/src/utils/imports-util.d.ts.map +1 -1
- package/dist/src/utils/imports-util.js +2 -1
- package/dist/src/utils/imports-util.js.map +1 -1
- package/dist/src/utils/interfaces.d.ts +3 -3
- package/dist/src/utils/interfaces.d.ts.map +1 -1
- package/dist/src/utils/interfaces.js +2 -1
- package/dist/src/utils/interfaces.js.map +1 -1
- package/dist/src/utils/model-utils.d.ts +4 -4
- package/dist/src/utils/model-utils.d.ts.map +1 -1
- package/dist/src/utils/name-constructors.d.ts +1 -1
- package/dist/src/utils/name-constructors.d.ts.map +1 -1
- package/dist/src/utils/namespace-utils.d.ts +2 -2
- package/dist/src/utils/namespace-utils.d.ts.map +1 -1
- package/dist/src/utils/namespace-utils.js +1 -1
- package/dist/src/utils/namespace-utils.js.map +1 -1
- package/dist/src/utils/operation-helpers.d.ts +2 -2
- package/dist/src/utils/operation-helpers.d.ts.map +1 -1
- package/dist/src/utils/operation-helpers.js.map +1 -1
- package/dist/src/utils/operation-util.d.ts +5 -5
- package/dist/src/utils/operation-util.d.ts.map +1 -1
- package/dist/src/utils/operation-util.js +1 -1
- package/dist/src/utils/operation-util.js.map +1 -1
- package/dist/src/utils/parameter-utils.d.ts +3 -3
- package/dist/src/utils/parameter-utils.d.ts.map +1 -1
- package/dist/src/utils/parameter-utils.js.map +1 -1
- package/dist/src/utils/schema-helpers.d.ts +1 -1
- package/dist/src/utils/schema-helpers.d.ts.map +1 -1
- package/dist/src/utils/schema-helpers.js +1 -1
- package/dist/src/utils/schema-helpers.js.map +1 -1
- package/dist/src/utils/type-util.d.ts +1 -1
- package/dist/src/utils/type-util.d.ts.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +41 -38
- package/src/context-manager.ts +6 -6
- package/src/framework/declaration.ts +7 -6
- package/src/framework/hooks/binder.ts +5 -33
- package/src/framework/hooks/sdk-types.ts +8 -8
- package/src/framework/hooks/use-dependencies.ts +1 -1
- package/src/framework/load-static-helpers.ts +3 -18
- package/src/framework/reference.ts +2 -2
- package/src/framework/sample.ts +2 -2
- package/src/framework/source-file-batch.ts +2 -2
- package/src/index.ts +23 -27
- package/src/interfaces.ts +0 -1
- package/src/lib.ts +43 -11
- package/src/meta-tree.ts +2 -2
- package/src/metadata/build-api-extractor-config.ts +1 -1
- package/src/metadata/build-changelog-file.ts +1 -1
- package/src/metadata/build-es-lint-config.ts +1 -1
- package/src/metadata/build-package-file.ts +11 -49
- package/src/metadata/build-readme-file.ts +4 -4
- package/src/metadata/build-sample-env-file.ts +1 -1
- package/src/metadata/build-test-config.ts +1 -1
- package/src/metadata/build-ts-config.ts +38 -9
- package/src/metadata/build-vitest-config.ts +1 -1
- package/src/metadata/build-warp-config.ts +1 -3
- package/src/metadata/package-json/azure-package-common.ts +1 -1
- package/src/metadata/package-json/build-azure-monorepo-package.ts +3 -20
- package/src/metadata/package-json/package-common.ts +0 -15
- package/src/metadata/test/build-recorded-client.ts +1 -1
- package/src/metadata/test/build-sample-test.ts +1 -1
- package/src/metadata/test/build-snippets.ts +1 -1
- package/src/metadata/utils.ts +1 -1
- package/src/modular/build-classical-client.ts +6 -6
- package/src/modular/build-classical-operation-groups.ts +6 -3
- package/src/modular/build-client-context.ts +3 -3
- package/src/modular/build-modular-options.ts +2 -2
- package/src/modular/build-operations.ts +12 -9
- package/src/modular/build-project-files.ts +2 -2
- package/src/modular/build-restore-poller.ts +6 -3
- package/src/modular/build-root-index.ts +9 -10
- package/src/modular/build-subpath-index.ts +5 -2
- package/src/modular/emit-logger-file.ts +1 -1
- package/src/modular/emit-models-options.ts +6 -3
- package/src/modular/emit-models.ts +23 -33
- package/src/modular/emit-samples.ts +11 -11
- package/src/modular/emit-tests.ts +3 -3
- package/src/modular/external-dependencies.ts +11 -1
- package/src/modular/helpers/classical-operation-helpers.ts +10 -7
- package/src/modular/helpers/client-helpers.ts +36 -19
- package/src/modular/helpers/client-option-helpers.ts +1 -1
- package/src/modular/helpers/example-value-helpers.ts +9 -9
- package/src/modular/helpers/naming-helpers.ts +55 -7
- package/src/modular/helpers/operation-helpers.ts +46 -44
- package/src/modular/helpers/type-helpers.ts +3 -3
- package/src/modular/interfaces.ts +1 -1
- package/src/modular/serialization/build-deserializer-function.ts +9 -9
- package/src/modular/serialization/build-serializer-function.ts +9 -9
- package/src/modular/serialization/build-xml-serializer-function.ts +7 -7
- package/src/modular/serialization/serialize-utils.ts +1 -1
- package/src/modular/static-helpers-metadata.ts +0 -13
- package/src/modular/type-expressions/get-credential-expression.ts +1 -1
- package/src/modular/type-expressions/get-enum-expression.ts +3 -3
- package/src/modular/type-expressions/get-model-expression.ts +3 -3
- package/src/modular/type-expressions/get-nullable-expression.ts +3 -3
- package/src/modular/type-expressions/get-type-expression.ts +2 -2
- package/src/modular/type-expressions/get-union-expression.ts +3 -3
- package/src/modular/type-expressions/utils.ts +1 -1
- package/src/transform/transform-api-version-info.ts +8 -3
- package/src/transform/transform-client-options.ts +5 -7
- package/src/transform/transform-helper-function-details.ts +6 -3
- package/src/transform/transform-parameters.ts +15 -11
- package/src/transform/transform-paths.ts +10 -4
- package/src/transform/transform-responses.ts +11 -8
- package/src/transform/transform-schemas.ts +7 -4
- package/src/transform/transform-telemetry-info.ts +3 -3
- package/src/transform/transform.ts +11 -11
- package/src/utils/api-version-util.ts +1 -1
- package/src/utils/client-utils.ts +8 -8
- package/src/utils/credential-utils.ts +3 -3
- package/src/utils/cross-language-def.ts +1 -1
- package/src/utils/emit-util.ts +9 -3
- package/src/utils/file-system-utils.ts +1 -1
- package/src/utils/imports-util.ts +2 -2
- package/src/utils/interfaces.ts +3 -3
- package/src/utils/model-utils.ts +23 -23
- package/src/utils/name-constructors.ts +1 -1
- package/src/utils/namespace-utils.ts +8 -2
- package/src/utils/operation-helpers.ts +11 -7
- package/src/utils/operation-util.ts +23 -16
- package/src/utils/parameter-utils.ts +4 -4
- package/src/utils/schema-helpers.ts +7 -1
- package/src/utils/type-util.ts +1 -1
- package/static/static-helpers/multipartHelpers.ts +2 -6
- package/static/static-helpers/platform-types-browser.mts +0 -5
- package/static/static-helpers/platform-types-react-native.mts +0 -5
- package/static/static-helpers/platform-types.ts +0 -7
- package/static/static-helpers/serialization/get-binary-stream-response-browser.mts +0 -22
- package/static/static-helpers/serialization/get-binary-stream-response-react-native.mts +0 -1
- package/static/static-helpers/serialization/get-binary-stream-response.ts +0 -22
|
@@ -2,30 +2,30 @@ import {
|
|
|
2
2
|
getClientOptions,
|
|
3
3
|
isHttpMetadata,
|
|
4
4
|
isReadOnly,
|
|
5
|
-
SdkBodyParameter,
|
|
6
|
-
SdkClientType,
|
|
7
|
-
SdkConstantType,
|
|
8
|
-
SdkEnumType,
|
|
9
|
-
SdkHttpOperation,
|
|
10
|
-
SdkHttpParameter,
|
|
11
|
-
SdkLroPagingServiceMethod,
|
|
12
|
-
SdkLroServiceMethod,
|
|
13
|
-
SdkMethod,
|
|
14
|
-
SdkMethodParameter,
|
|
15
|
-
SdkModelPropertyType,
|
|
16
|
-
SdkModelType,
|
|
17
|
-
SdkPagingServiceMethod,
|
|
18
|
-
SdkServiceResponseHeader,
|
|
19
|
-
SdkType,
|
|
5
|
+
type SdkBodyParameter,
|
|
6
|
+
type SdkClientType,
|
|
7
|
+
type SdkConstantType,
|
|
8
|
+
type SdkEnumType,
|
|
9
|
+
type SdkHttpOperation,
|
|
10
|
+
type SdkHttpParameter,
|
|
11
|
+
type SdkLroPagingServiceMethod,
|
|
12
|
+
type SdkLroServiceMethod,
|
|
13
|
+
type SdkMethod,
|
|
14
|
+
type SdkMethodParameter,
|
|
15
|
+
type SdkModelPropertyType,
|
|
16
|
+
type SdkModelType,
|
|
17
|
+
type SdkPagingServiceMethod,
|
|
18
|
+
type SdkServiceResponseHeader,
|
|
19
|
+
type SdkType,
|
|
20
20
|
} from "@azure-tools/typespec-client-generator-core";
|
|
21
|
-
import { NoTarget, Program } from "@typespec/compiler";
|
|
21
|
+
import { NoTarget, type Program } from "@typespec/compiler";
|
|
22
22
|
import { isHeader, isMetadata } from "@typespec/http";
|
|
23
23
|
import {
|
|
24
|
-
FunctionDeclarationStructure,
|
|
25
|
-
OptionalKind,
|
|
26
|
-
ParameterDeclarationStructure,
|
|
24
|
+
type FunctionDeclarationStructure,
|
|
25
|
+
type OptionalKind,
|
|
26
|
+
type ParameterDeclarationStructure,
|
|
27
27
|
StructureKind,
|
|
28
|
-
TypeAliasDeclarationStructure,
|
|
28
|
+
type TypeAliasDeclarationStructure,
|
|
29
29
|
} from "ts-morph";
|
|
30
30
|
import { useContext } from "../../context-manager.js";
|
|
31
31
|
import { useSdkTypes } from "../../framework/hooks/sdk-types.js";
|
|
@@ -33,7 +33,7 @@ import { useDependencies } from "../../framework/hooks/use-dependencies.js";
|
|
|
33
33
|
import { resolveReference } from "../../framework/reference.js";
|
|
34
34
|
import { refkey } from "../../framework/refkey.js";
|
|
35
35
|
import { reportDiagnostic } from "../../lib.js";
|
|
36
|
-
import { SdkContext } from "../../utils/interfaces.js";
|
|
36
|
+
import type { SdkContext } from "../../utils/interfaces.js";
|
|
37
37
|
import { isAzureCoreErrorType } from "../../utils/model-utils.js";
|
|
38
38
|
import { NameType, normalizeName } from "../../utils/name-utils.js";
|
|
39
39
|
import {
|
|
@@ -46,9 +46,9 @@ import {
|
|
|
46
46
|
isMultipartPayload,
|
|
47
47
|
isXmlPayload,
|
|
48
48
|
KnownCollectionFormat,
|
|
49
|
-
ServiceOperation,
|
|
49
|
+
type ServiceOperation,
|
|
50
50
|
} from "../../utils/operation-util.js";
|
|
51
|
-
import { AzurePollingDependencies } from "../external-dependencies.js";
|
|
51
|
+
import { AzureCoreDependencies, AzurePollingDependencies } from "../external-dependencies.js";
|
|
52
52
|
import {
|
|
53
53
|
buildModelDeserializer,
|
|
54
54
|
buildPropertyDeserializer,
|
|
@@ -66,11 +66,10 @@ import {
|
|
|
66
66
|
getPropertyWithOverrides,
|
|
67
67
|
isNormalUnion,
|
|
68
68
|
isSpecialHandledUnion,
|
|
69
|
-
ModelOverrideOptions,
|
|
69
|
+
type ModelOverrideOptions,
|
|
70
70
|
} from "../serialization/serialize-utils.js";
|
|
71
71
|
import {
|
|
72
72
|
PagingHelpers,
|
|
73
|
-
PlatformTypeHelpers,
|
|
74
73
|
PollingHelpers,
|
|
75
74
|
SerializationHelpers,
|
|
76
75
|
StorageCompatHelpers,
|
|
@@ -112,7 +111,7 @@ export function getSendPrivateFunction(
|
|
|
112
111
|
): OptionalKind<FunctionDeclarationStructure> {
|
|
113
112
|
const operation = method[1];
|
|
114
113
|
const parameters = getOperationSignatureParameters(dpgContext, method, clientType);
|
|
115
|
-
const { name } = getOperationName(operation);
|
|
114
|
+
const { name } = getOperationName(operation, dpgContext, method[0]);
|
|
116
115
|
const dependencies = useDependencies();
|
|
117
116
|
|
|
118
117
|
const functionStatement: OptionalKind<FunctionDeclarationStructure> = {
|
|
@@ -169,7 +168,7 @@ export function getDeserializePrivateFunction(
|
|
|
169
168
|
method: [string[], ServiceOperation],
|
|
170
169
|
): OptionalKind<FunctionDeclarationStructure> {
|
|
171
170
|
const operation = method[1];
|
|
172
|
-
const { name } = getOperationName(operation);
|
|
171
|
+
const { name } = getOperationName(operation, context, method[0]);
|
|
173
172
|
const dependencies = useDependencies();
|
|
174
173
|
const PathUncheckedResponseReference = resolveReference(dependencies.PathUncheckedResponse);
|
|
175
174
|
|
|
@@ -247,7 +246,7 @@ export function getDeserializePrivateFunction(
|
|
|
247
246
|
statements.push(`const expectedStatuses = ${getExpectedStatuses(operation)};`);
|
|
248
247
|
statements.push(
|
|
249
248
|
`if(!expectedStatuses.includes(result.status)){`,
|
|
250
|
-
`${getExceptionThrowStatement(context,
|
|
249
|
+
`${getExceptionThrowStatement(context, method)}`,
|
|
251
250
|
"}",
|
|
252
251
|
);
|
|
253
252
|
const deserializedType =
|
|
@@ -461,8 +460,9 @@ export function getDeserializePrivateFunction(
|
|
|
461
460
|
*/
|
|
462
461
|
export function getDeserializeHeadersPrivateFunction(
|
|
463
462
|
context: SdkContext,
|
|
464
|
-
|
|
463
|
+
method: [string[], ServiceOperation],
|
|
465
464
|
): OptionalKind<FunctionDeclarationStructure> | undefined {
|
|
465
|
+
const operation = method[1];
|
|
466
466
|
const responseHeaders = getResponseHeaders(operation.operation.responses);
|
|
467
467
|
const isResponseHeadersEnabled = context.emitterOptions?.includeHeadersInResponse === true;
|
|
468
468
|
const isStorageCompatEnabled = context.emitterOptions?.enableStorageCompat === true;
|
|
@@ -472,7 +472,7 @@ export function getDeserializeHeadersPrivateFunction(
|
|
|
472
472
|
return undefined;
|
|
473
473
|
}
|
|
474
474
|
|
|
475
|
-
const { name } = getOperationName(operation);
|
|
475
|
+
const { name } = getOperationName(operation, context, method[0]);
|
|
476
476
|
const dependencies = useDependencies();
|
|
477
477
|
const PathUncheckedResponseReference = resolveReference(dependencies.PathUncheckedResponse);
|
|
478
478
|
|
|
@@ -615,8 +615,9 @@ function getExceptionResponseHeaders(
|
|
|
615
615
|
*/
|
|
616
616
|
export function getDeserializeExceptionHeadersPrivateFunction(
|
|
617
617
|
context: SdkContext,
|
|
618
|
-
|
|
618
|
+
method: [string[], ServiceOperation],
|
|
619
619
|
): OptionalKind<FunctionDeclarationStructure> | undefined {
|
|
620
|
+
const operation = method[1];
|
|
620
621
|
const isResponseHeadersEnabled = context.emitterOptions?.includeHeadersInResponse === true;
|
|
621
622
|
if (!isResponseHeadersEnabled) {
|
|
622
623
|
return undefined;
|
|
@@ -627,7 +628,7 @@ export function getDeserializeExceptionHeadersPrivateFunction(
|
|
|
627
628
|
return undefined;
|
|
628
629
|
}
|
|
629
630
|
|
|
630
|
-
const { name } = getOperationName(operation);
|
|
631
|
+
const { name } = getOperationName(operation, context, method[0]);
|
|
631
632
|
const dependencies = useDependencies();
|
|
632
633
|
const PathUncheckedResponseReference = resolveReference(dependencies.PathUncheckedResponse);
|
|
633
634
|
|
|
@@ -667,7 +668,8 @@ function getExceptionDeserializeExpr(exception: ExceptionThrowDetail): string {
|
|
|
667
668
|
return `isXml ? ${exception.xmlDeserializer}(result.body) : ${exception.deserializer}(result.body)`;
|
|
668
669
|
}
|
|
669
670
|
|
|
670
|
-
function getExceptionThrowStatement(context: SdkContext,
|
|
671
|
+
function getExceptionThrowStatement(context: SdkContext, method: [string[], ServiceOperation]) {
|
|
672
|
+
const operation = method[1];
|
|
671
673
|
const statements = [];
|
|
672
674
|
const createRestErrorReference = resolveReference(useDependencies().createRestError);
|
|
673
675
|
const { customized, defaultDeserializer, defaultXmlDeserializer, defaultIsXmlOnly } =
|
|
@@ -678,7 +680,7 @@ function getExceptionThrowStatement(context: SdkContext, operation: ServiceOpera
|
|
|
678
680
|
// Check if exception headers function exists and build the call
|
|
679
681
|
const exceptionHeaders = getExceptionResponseHeaders(operation.operation.exceptions);
|
|
680
682
|
const hasExceptionHeaders = isResponseHeadersEnabled && exceptionHeaders.length > 0;
|
|
681
|
-
const { name: opName } = getOperationName(operation);
|
|
683
|
+
const { name: opName } = getOperationName(operation, context, method[0]);
|
|
682
684
|
const exceptionHeadersCall = hasExceptionHeaders
|
|
683
685
|
? `error.details = {...(error.details as any), ..._${opName}DeserializeExceptionHeaders(result)};`
|
|
684
686
|
: undefined;
|
|
@@ -996,14 +998,14 @@ export function getOperationFunction(
|
|
|
996
998
|
}
|
|
997
999
|
}
|
|
998
1000
|
|
|
999
|
-
const { name, fixme = [] } = getOperationName(operation, context);
|
|
1001
|
+
const { name, propertyName, fixme = [] } = getOperationName(operation, context, method[0]);
|
|
1000
1002
|
const functionStatement = {
|
|
1001
1003
|
kind: StructureKind.Function,
|
|
1002
1004
|
docs: [...getDocsFromDescription(operation.doc), ...getFixmeForMultilineDocs(fixme)],
|
|
1003
1005
|
isAsync: true,
|
|
1004
1006
|
isExported: true,
|
|
1005
1007
|
name,
|
|
1006
|
-
propertyName
|
|
1008
|
+
propertyName,
|
|
1007
1009
|
parameters,
|
|
1008
1010
|
returnType: `Promise<${finalReturnType}>`,
|
|
1009
1011
|
};
|
|
@@ -1043,7 +1045,7 @@ export function getOperationFunction(
|
|
|
1043
1045
|
statements.push(`const ${streamableMethodVarName} = _${name}Send(${sendParameterList});`);
|
|
1044
1046
|
const binaryHelper =
|
|
1045
1047
|
wrapReturn && wrapReturnIsBinary
|
|
1046
|
-
?
|
|
1048
|
+
? AzureCoreDependencies["getBinaryStreamResponse"]
|
|
1047
1049
|
: SerializationHelpers.getBinaryResponse;
|
|
1048
1050
|
statements.push(
|
|
1049
1051
|
`const ${resultVarName} = await ${resolveReference(binaryHelper)}(${streamableMethodVarName});`,
|
|
@@ -1120,7 +1122,7 @@ function getLroOnlyOperationFunction(
|
|
|
1120
1122
|
clientType,
|
|
1121
1123
|
);
|
|
1122
1124
|
const returnType = buildLroReturnType(context, operation);
|
|
1123
|
-
const { name, fixme = [] } = getOperationName(operation, context);
|
|
1125
|
+
const { name, propertyName, fixme = [] } = getOperationName(operation, context, method[0]);
|
|
1124
1126
|
const pollerLikeReference = resolveReference(AzurePollingDependencies.PollerLike);
|
|
1125
1127
|
const operationStateReference = resolveReference(AzurePollingDependencies.OperationState);
|
|
1126
1128
|
|
|
@@ -1140,7 +1142,7 @@ function getLroOnlyOperationFunction(
|
|
|
1140
1142
|
isAsync: false,
|
|
1141
1143
|
isExported: true,
|
|
1142
1144
|
name,
|
|
1143
|
-
propertyName
|
|
1145
|
+
propertyName,
|
|
1144
1146
|
isLro: true,
|
|
1145
1147
|
lroFinalReturnType: effectiveReturnTypeName,
|
|
1146
1148
|
parameters,
|
|
@@ -1194,7 +1196,7 @@ function getLroAndPagingOperationFunction(
|
|
|
1194
1196
|
} {
|
|
1195
1197
|
const operation = method[1];
|
|
1196
1198
|
const parameters = getOperationSignatureParameters(context, method, clientType);
|
|
1197
|
-
const { name, fixme = [] } = getOperationName(operation, context);
|
|
1199
|
+
const { name, propertyName, fixme = [] } = getOperationName(operation, context, method[0]);
|
|
1198
1200
|
|
|
1199
1201
|
const returnType = buildLroPagingReturnType(context, operation);
|
|
1200
1202
|
|
|
@@ -1247,7 +1249,7 @@ function getLroAndPagingOperationFunction(
|
|
|
1247
1249
|
isLroPaging: true,
|
|
1248
1250
|
lropagingFinalReturnType: returnType.type,
|
|
1249
1251
|
name,
|
|
1250
|
-
propertyName
|
|
1252
|
+
propertyName,
|
|
1251
1253
|
parameters,
|
|
1252
1254
|
returnType: `${refs.pagedIterator}<${returnType.type}>`,
|
|
1253
1255
|
statements: [
|
|
@@ -1324,7 +1326,7 @@ function getPagingOnlyOperationFunction(
|
|
|
1324
1326
|
type: getTypeExpression(context, type.valueType),
|
|
1325
1327
|
};
|
|
1326
1328
|
}
|
|
1327
|
-
const { name, fixme = [] } = getOperationName(operation, context);
|
|
1329
|
+
const { name, propertyName, fixme = [] } = getOperationName(operation, context, method[0]);
|
|
1328
1330
|
const pagedAsyncIterableIteratorReference = resolveReference(
|
|
1329
1331
|
PagingHelpers.PagedAsyncIterableIterator,
|
|
1330
1332
|
);
|
|
@@ -1335,7 +1337,7 @@ function getPagingOnlyOperationFunction(
|
|
|
1335
1337
|
isAsync: false,
|
|
1336
1338
|
isExported: true,
|
|
1337
1339
|
name,
|
|
1338
|
-
propertyName
|
|
1340
|
+
propertyName,
|
|
1339
1341
|
parameters,
|
|
1340
1342
|
returnType: `${pagedAsyncIterableIteratorReference}<${returnType.type}>`,
|
|
1341
1343
|
};
|
|
@@ -3003,7 +3005,7 @@ export function buildNonModelResponseTypeDeclaration(
|
|
|
3003
3005
|
let typeBody: string;
|
|
3004
3006
|
|
|
3005
3007
|
if (isBinary) {
|
|
3006
|
-
const nodeReadableStreamRef = resolveReference(
|
|
3008
|
+
const nodeReadableStreamRef = resolveReference(AzureCoreDependencies["NodeReadableStream"]);
|
|
3007
3009
|
typeBody = `{
|
|
3008
3010
|
/**
|
|
3009
3011
|
* BROWSER ONLY
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
SdkBodyParameter,
|
|
3
3
|
SdkCredentialParameter,
|
|
4
4
|
SdkEndpointParameter,
|
|
@@ -6,11 +6,11 @@ import {
|
|
|
6
6
|
SdkModelType,
|
|
7
7
|
SdkType,
|
|
8
8
|
} from "@azure-tools/typespec-client-generator-core";
|
|
9
|
-
import { SdkContext } from "../../utils/interfaces.js";
|
|
9
|
+
import type { SdkContext } from "../../utils/interfaces.js";
|
|
10
10
|
import { NameType, normalizeName } from "../../utils/name-utils.js";
|
|
11
11
|
import {
|
|
12
12
|
getPropertyWithOverrides,
|
|
13
|
-
ModelOverrideOptions,
|
|
13
|
+
type ModelOverrideOptions,
|
|
14
14
|
} from "../serialization/serialize-utils.js";
|
|
15
15
|
import { getAllAncestors, getAllProperties } from "./operation-helpers.js";
|
|
16
16
|
|
|
@@ -1,19 +1,19 @@
|
|
|
1
1
|
import {
|
|
2
|
-
SdkArrayType,
|
|
3
|
-
SdkDictionaryType,
|
|
4
|
-
SdkModelPropertyType,
|
|
5
|
-
SdkModelType,
|
|
6
|
-
SdkType,
|
|
7
|
-
SdkUnionType,
|
|
2
|
+
type SdkArrayType,
|
|
3
|
+
type SdkDictionaryType,
|
|
4
|
+
type SdkModelPropertyType,
|
|
5
|
+
type SdkModelType,
|
|
6
|
+
type SdkType,
|
|
7
|
+
type SdkUnionType,
|
|
8
8
|
UsageFlags,
|
|
9
9
|
} from "@azure-tools/typespec-client-generator-core";
|
|
10
10
|
import { NoTarget } from "@typespec/compiler";
|
|
11
|
-
import { FunctionDeclarationStructure, StructureKind } from "ts-morph";
|
|
11
|
+
import { type FunctionDeclarationStructure, StructureKind } from "ts-morph";
|
|
12
12
|
import { useContext } from "../../context-manager.js";
|
|
13
13
|
import { resolveReference } from "../../framework/reference.js";
|
|
14
14
|
import { refkey } from "../../framework/refkey.js";
|
|
15
15
|
import { reportDiagnostic } from "../../lib.js";
|
|
16
|
-
import { SdkContext } from "../../utils/interfaces.js";
|
|
16
|
+
import type { SdkContext } from "../../utils/interfaces.js";
|
|
17
17
|
import { isAzureCoreErrorType } from "../../utils/model-utils.js";
|
|
18
18
|
import { NameType, normalizeName } from "../../utils/name-utils.js";
|
|
19
19
|
import { getAdditionalPropertiesName, normalizeModelName } from "../emit-models.js";
|
|
@@ -29,7 +29,7 @@ import {
|
|
|
29
29
|
getAllDiscriminatedValues,
|
|
30
30
|
isDiscriminatedUnion,
|
|
31
31
|
isSupportedSerializeType,
|
|
32
|
-
ModelSerializeOptions,
|
|
32
|
+
type ModelSerializeOptions,
|
|
33
33
|
} from "./serialize-utils.js";
|
|
34
34
|
|
|
35
35
|
export function buildPropertyDeserializer(
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
|
-
SdkArrayType,
|
|
3
|
-
SdkDictionaryType,
|
|
4
|
-
SdkModelPropertyType,
|
|
5
|
-
SdkModelType,
|
|
6
|
-
SdkType,
|
|
7
|
-
SdkUnionType,
|
|
2
|
+
type SdkArrayType,
|
|
3
|
+
type SdkDictionaryType,
|
|
4
|
+
type SdkModelPropertyType,
|
|
5
|
+
type SdkModelType,
|
|
6
|
+
type SdkType,
|
|
7
|
+
type SdkUnionType,
|
|
8
8
|
UsageFlags,
|
|
9
9
|
} from "@azure-tools/typespec-client-generator-core";
|
|
10
10
|
import { NoTarget } from "@typespec/compiler";
|
|
11
11
|
import { isOrExtendsHttpFile } from "@typespec/http";
|
|
12
|
-
import { FunctionDeclarationStructure, StructureKind } from "ts-morph";
|
|
12
|
+
import { type FunctionDeclarationStructure, StructureKind } from "ts-morph";
|
|
13
13
|
import { useContext } from "../../context-manager.js";
|
|
14
14
|
import { resolveReference } from "../../framework/reference.js";
|
|
15
15
|
import { refkey } from "../../framework/refkey.js";
|
|
16
16
|
import { reportDiagnostic } from "../../lib.js";
|
|
17
|
-
import { SdkContext } from "../../utils/interfaces.js";
|
|
17
|
+
import type { SdkContext } from "../../utils/interfaces.js";
|
|
18
18
|
import { isAzureCoreErrorType } from "../../utils/model-utils.js";
|
|
19
19
|
import { NameType, normalizeName } from "../../utils/name-utils.js";
|
|
20
20
|
import { getAdditionalPropertiesName, normalizeModelName } from "../emit-models.js";
|
|
@@ -31,7 +31,7 @@ import {
|
|
|
31
31
|
getAllDiscriminatedValues,
|
|
32
32
|
isDiscriminatedUnion,
|
|
33
33
|
isSupportedSerializeType,
|
|
34
|
-
ModelSerializeOptions,
|
|
34
|
+
type ModelSerializeOptions,
|
|
35
35
|
} from "./serialize-utils.js";
|
|
36
36
|
|
|
37
37
|
export function buildPropertySerializer(
|
|
@@ -3,20 +3,20 @@
|
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
5
|
isReadOnly,
|
|
6
|
-
SdkModelPropertyType,
|
|
7
|
-
SdkModelType,
|
|
8
|
-
SdkPackage,
|
|
9
|
-
SdkType,
|
|
6
|
+
type SdkModelPropertyType,
|
|
7
|
+
type SdkModelType,
|
|
8
|
+
type SdkPackage,
|
|
9
|
+
type SdkType,
|
|
10
10
|
UsageFlags,
|
|
11
11
|
} from "@azure-tools/typespec-client-generator-core";
|
|
12
12
|
import { NoTarget } from "@typespec/compiler";
|
|
13
13
|
import { isMetadata } from "@typespec/http";
|
|
14
|
-
import { FunctionDeclarationStructure, StructureKind } from "ts-morph";
|
|
14
|
+
import { type FunctionDeclarationStructure, StructureKind } from "ts-morph";
|
|
15
15
|
import { useDependencies } from "../../framework/hooks/use-dependencies.js";
|
|
16
16
|
import { resolveReference } from "../../framework/reference.js";
|
|
17
17
|
import { refkey } from "../../framework/refkey.js";
|
|
18
18
|
import { reportDiagnostic } from "../../lib.js";
|
|
19
|
-
import { SdkContext } from "../../utils/interfaces.js";
|
|
19
|
+
import type { SdkContext } from "../../utils/interfaces.js";
|
|
20
20
|
import { isAzureCoreErrorType } from "../../utils/model-utils.js";
|
|
21
21
|
import { NameType } from "../../utils/name-utils.js";
|
|
22
22
|
import { getAdditionalPropertiesName, normalizeModelName } from "../emit-models.js";
|
|
@@ -24,7 +24,7 @@ import { getAllAncestors, getAllProperties } from "../helpers/operation-helpers.
|
|
|
24
24
|
import { getAdditionalPropertiesType } from "../helpers/type-helpers.js";
|
|
25
25
|
import { XmlHelpers } from "../static-helpers-metadata.js";
|
|
26
26
|
import { normalizeModelPropertyName } from "../type-expressions/get-type-expression.js";
|
|
27
|
-
import { isSupportedSerializeType, ModelSerializeOptions } from "./serialize-utils.js";
|
|
27
|
+
import { isSupportedSerializeType, type ModelSerializeOptions } from "./serialize-utils.js";
|
|
28
28
|
|
|
29
29
|
/**
|
|
30
30
|
* Checks if a model type has XML serialization options defined
|
|
@@ -59,11 +59,6 @@ export const SerializationHelpers = {
|
|
|
59
59
|
name: "getBinaryResponse",
|
|
60
60
|
location: "serialization/get-binary-response.ts",
|
|
61
61
|
},
|
|
62
|
-
getBinaryStreamResponse: {
|
|
63
|
-
kind: "function",
|
|
64
|
-
name: "getBinaryStreamResponse",
|
|
65
|
-
location: "serialization/get-binary-stream-response.ts",
|
|
66
|
-
},
|
|
67
62
|
areAllPropsUndefined: {
|
|
68
63
|
kind: "function",
|
|
69
64
|
name: "areAllPropsUndefined",
|
|
@@ -150,14 +145,6 @@ export const MultipartHelpers = {
|
|
|
150
145
|
},
|
|
151
146
|
} as const;
|
|
152
147
|
|
|
153
|
-
export const PlatformTypeHelpers = {
|
|
154
|
-
NodeReadableStream: {
|
|
155
|
-
kind: "typeAlias",
|
|
156
|
-
name: "NodeReadableStream",
|
|
157
|
-
location: "platform-types.ts",
|
|
158
|
-
},
|
|
159
|
-
} as const;
|
|
160
|
-
|
|
161
148
|
export const CloudSettingHelpers = {
|
|
162
149
|
AzureClouds: {
|
|
163
150
|
kind: "enum",
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SdkCredentialType } from "@azure-tools/typespec-client-generator-core";
|
|
1
|
+
import type { SdkCredentialType } from "@azure-tools/typespec-client-generator-core";
|
|
2
2
|
import { useDependencies } from "../../framework/hooks/use-dependencies.js";
|
|
3
3
|
import { resolveReference } from "../../framework/reference.js";
|
|
4
4
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SdkEnumType } from "@azure-tools/typespec-client-generator-core";
|
|
1
|
+
import type { SdkEnumType } from "@azure-tools/typespec-client-generator-core";
|
|
2
2
|
import { resolveReference } from "../../framework/reference.js";
|
|
3
|
-
import { SdkContext } from "../../utils/interfaces.js";
|
|
4
|
-
import { EmitTypeOptions, getTypeExpression } from "./get-type-expression.js";
|
|
3
|
+
import type { SdkContext } from "../../utils/interfaces.js";
|
|
4
|
+
import { type EmitTypeOptions, getTypeExpression } from "./get-type-expression.js";
|
|
5
5
|
import { shouldEmitInline } from "./utils.js";
|
|
6
6
|
|
|
7
7
|
export function getEnumExpression(
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import {
|
|
2
|
-
EmitTypeOptions,
|
|
2
|
+
type EmitTypeOptions,
|
|
3
3
|
getTypeExpression,
|
|
4
4
|
normalizeModelPropertyName,
|
|
5
5
|
} from "./get-type-expression.js";
|
|
6
6
|
|
|
7
|
-
import {
|
|
7
|
+
import type {
|
|
8
8
|
SdkModelPropertyType,
|
|
9
9
|
SdkModelType,
|
|
10
10
|
SdkServiceResponseHeader,
|
|
@@ -12,7 +12,7 @@ import {
|
|
|
12
12
|
import { useContext } from "../../context-manager.js";
|
|
13
13
|
import { resolveReference } from "../../framework/reference.js";
|
|
14
14
|
import { refkey } from "../../framework/refkey.js";
|
|
15
|
-
import { SdkContext } from "../../utils/interfaces.js";
|
|
15
|
+
import type { SdkContext } from "../../utils/interfaces.js";
|
|
16
16
|
import { MultipartHelpers } from "../static-helpers-metadata.js";
|
|
17
17
|
import { shouldEmitInline } from "./utils.js";
|
|
18
18
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SdkNullableType } from "@azure-tools/typespec-client-generator-core";
|
|
1
|
+
import type { SdkNullableType } from "@azure-tools/typespec-client-generator-core";
|
|
2
2
|
import { resolveReference } from "../../framework/reference.js";
|
|
3
|
-
import { SdkContext } from "../../utils/interfaces.js";
|
|
4
|
-
import { EmitTypeOptions, getTypeExpression } from "./get-type-expression.js";
|
|
3
|
+
import type { SdkContext } from "../../utils/interfaces.js";
|
|
4
|
+
import { type EmitTypeOptions, getTypeExpression } from "./get-type-expression.js";
|
|
5
5
|
import { shouldEmitInline } from "./utils.js";
|
|
6
6
|
|
|
7
7
|
export function getNullableExpression(
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
2
|
SdkHttpParameter,
|
|
3
3
|
SdkModelPropertyType,
|
|
4
4
|
SdkServiceResponseHeader,
|
|
5
5
|
SdkType,
|
|
6
6
|
} from "@azure-tools/typespec-client-generator-core";
|
|
7
|
-
import { SdkContext } from "../../utils/interfaces.js";
|
|
7
|
+
import type { SdkContext } from "../../utils/interfaces.js";
|
|
8
8
|
import { NameType, normalizeName } from "../../utils/name-utils.js";
|
|
9
9
|
import { getCredentialExpression } from "./get-credential-expression.js";
|
|
10
10
|
import { getEnumExpression } from "./get-enum-expression.js";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { SdkUnionType } from "@azure-tools/typespec-client-generator-core";
|
|
1
|
+
import type { SdkUnionType } from "@azure-tools/typespec-client-generator-core";
|
|
2
2
|
import { resolveReference } from "../../framework/reference.js";
|
|
3
|
-
import { SdkContext } from "../../utils/interfaces.js";
|
|
4
|
-
import { EmitTypeOptions, getTypeExpression } from "./get-type-expression.js";
|
|
3
|
+
import type { SdkContext } from "../../utils/interfaces.js";
|
|
4
|
+
import { type EmitTypeOptions, getTypeExpression } from "./get-type-expression.js";
|
|
5
5
|
import { shouldEmitInline } from "./utils.js";
|
|
6
6
|
|
|
7
7
|
export function getUnionExpression(
|
|
@@ -1,12 +1,17 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getHttpOperationWithCache,
|
|
3
3
|
isApiVersion,
|
|
4
|
-
SdkClient,
|
|
4
|
+
type SdkClient,
|
|
5
5
|
} from "@azure-tools/typespec-client-generator-core";
|
|
6
|
-
import {
|
|
6
|
+
import {
|
|
7
|
+
type ApiVersionInfo,
|
|
8
|
+
type ApiVersionPosition,
|
|
9
|
+
SchemaContext,
|
|
10
|
+
type UrlInfo,
|
|
11
|
+
} from "../interfaces.js";
|
|
7
12
|
import { extractDefinedPosition, extractPathApiVersion } from "../utils/api-version-util.js";
|
|
8
13
|
import { listOperationsUnderClient } from "../utils/client-utils.js";
|
|
9
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
14
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
10
15
|
import { getDefaultApiVersionString, getSchemaForType, trimUsage } from "../utils/model-utils.js";
|
|
11
16
|
|
|
12
17
|
export function transformApiVersionInfo(
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import { getHttpOperationWithCache } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
-
import { getDoc, NoTarget, Program } from "@typespec/compiler";
|
|
2
|
+
import { getDoc, NoTarget, type Program } from "@typespec/compiler";
|
|
3
3
|
import { getAuthentication } from "@typespec/http";
|
|
4
|
-
import { ClientOptions, PackageDetails, ServiceInfo } from "../interfaces.js";
|
|
5
|
-
import { EmitterOptions, reportDiagnostic } from "../lib.js";
|
|
4
|
+
import type { ClientOptions, PackageDetails, ServiceInfo } from "../interfaces.js";
|
|
5
|
+
import { type EmitterOptions, reportDiagnostic } from "../lib.js";
|
|
6
6
|
import { getClientParameters } from "../modular/helpers/client-helpers.js";
|
|
7
7
|
import { getClients, listOperationsUnderClient } from "../utils/client-utils.js";
|
|
8
8
|
import { getSupportedHttpAuth } from "../utils/credential-utils.js";
|
|
9
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
9
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
10
10
|
import { getDefaultService } from "../utils/model-utils.js";
|
|
11
11
|
import { NameType, normalizeName, pascalCase } from "../utils/name-utils.js";
|
|
12
12
|
import { detectModelConflicts } from "../utils/namespace-utils.js";
|
|
@@ -232,14 +232,12 @@ function buildPackageDetails(program: Program, emitterOptions: EmitterOptions):
|
|
|
232
232
|
nameWithoutScope: "unamedpackage",
|
|
233
233
|
version: "1.0.0-beta.1",
|
|
234
234
|
};
|
|
235
|
-
const isVersionUserProvided = Boolean(emitterOptions["package-details"]?.version);
|
|
236
235
|
const packageDetails: PackageDetails = {
|
|
237
236
|
...emitterOptions["package-details"],
|
|
238
237
|
name:
|
|
239
238
|
emitterOptions["package-details"]?.name ??
|
|
240
239
|
normalizeName(getDefaultService(program)?.title ?? "", NameType.Class),
|
|
241
|
-
version: emitterOptions["package-details"]?.version
|
|
242
|
-
isVersionUserProvided,
|
|
240
|
+
version: emitterOptions["package-details"]?.version,
|
|
243
241
|
};
|
|
244
242
|
if (emitterOptions["package-details"]?.name) {
|
|
245
243
|
const nameParts = emitterOptions["package-details"]?.name.split("/");
|
|
@@ -1,7 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
getHttpOperationWithCache,
|
|
3
|
+
type SdkClient,
|
|
4
|
+
} from "@azure-tools/typespec-client-generator-core";
|
|
5
|
+
import type { HelperFunctionDetails } from "../interfaces.js";
|
|
3
6
|
import { listOperationsUnderClient } from "../utils/client-utils.js";
|
|
4
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
7
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
5
8
|
import { getCollectionFormat } from "../utils/model-utils.js";
|
|
6
9
|
import {
|
|
7
10
|
extractPageDetails,
|
|
@@ -2,25 +2,29 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
4
|
import {
|
|
5
|
-
SdkClient,
|
|
5
|
+
type SdkClient,
|
|
6
6
|
getHttpOperationWithCache,
|
|
7
7
|
isApiVersion,
|
|
8
8
|
} from "@azure-tools/typespec-client-generator-core";
|
|
9
|
-
import { NoTarget, Type, isVoidType } from "@typespec/compiler";
|
|
10
|
-
import {
|
|
9
|
+
import { NoTarget, type Type, isVoidType } from "@typespec/compiler";
|
|
10
|
+
import type {
|
|
11
|
+
HttpOperation,
|
|
12
|
+
HttpOperationParameter,
|
|
13
|
+
HttpOperationParameters,
|
|
14
|
+
} from "@typespec/http";
|
|
11
15
|
import {
|
|
12
|
-
ApiVersionInfo,
|
|
13
|
-
Imports,
|
|
14
|
-
ObjectSchema,
|
|
15
|
-
OperationParameter,
|
|
16
|
-
ParameterBodyMetadata,
|
|
17
|
-
ParameterMetadata,
|
|
18
|
-
Schema,
|
|
16
|
+
type ApiVersionInfo,
|
|
17
|
+
type Imports,
|
|
18
|
+
type ObjectSchema,
|
|
19
|
+
type OperationParameter,
|
|
20
|
+
type ParameterBodyMetadata,
|
|
21
|
+
type ParameterMetadata,
|
|
22
|
+
type Schema,
|
|
19
23
|
SchemaContext,
|
|
20
24
|
} from "../interfaces.js";
|
|
21
25
|
import { reportDiagnostic } from "../lib.js";
|
|
22
26
|
import { listOperationsUnderClient } from "../utils/client-utils.js";
|
|
23
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
27
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
24
28
|
import {
|
|
25
29
|
KnownMediaType,
|
|
26
30
|
extractMediaTypes,
|