@azure-tools/typespec-ts 0.56.0-dev.14 → 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 +8 -9
- 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 +3 -3
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +0 -1
- 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 +3 -4
- 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,11 +2,11 @@
|
|
|
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 { HttpOperation, HttpOperationParameters } from "@typespec/http";
|
|
9
|
+
import type { HttpOperation, HttpOperationParameters } from "@typespec/http";
|
|
10
10
|
import { getImportedModelName, getSchemaForType, isBodyRequired } from "../utils/model-utils.js";
|
|
11
11
|
import {
|
|
12
12
|
extractOperationLroDetail,
|
|
@@ -20,9 +20,15 @@ import {
|
|
|
20
20
|
} from "../utils/operation-util.js";
|
|
21
21
|
|
|
22
22
|
import { getDoc } from "@typespec/compiler";
|
|
23
|
-
import {
|
|
23
|
+
import {
|
|
24
|
+
type Imports,
|
|
25
|
+
type OperationMethod,
|
|
26
|
+
type PathMetadata,
|
|
27
|
+
type Paths,
|
|
28
|
+
SchemaContext,
|
|
29
|
+
} from "../interfaces.js";
|
|
24
30
|
import { listOperationsUnderClient } from "../utils/client-utils.js";
|
|
25
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
31
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
26
32
|
import { getParameterTypeName, getResponseTypeName } from "../utils/name-constructors.js";
|
|
27
33
|
import { getParameterSerializationInfo } from "../utils/parameter-utils.js";
|
|
28
34
|
|
|
@@ -1,19 +1,22 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
getHttpOperationWithCache,
|
|
6
|
+
type SdkClient,
|
|
7
|
+
} from "@azure-tools/typespec-client-generator-core";
|
|
5
8
|
import { getDoc, isVoidType } from "@typespec/compiler";
|
|
6
|
-
import { HttpOperation, HttpOperationResponse } from "@typespec/http";
|
|
9
|
+
import type { HttpOperation, HttpOperationResponse } from "@typespec/http";
|
|
7
10
|
import {
|
|
8
|
-
Imports,
|
|
9
|
-
OperationResponse,
|
|
10
|
-
ResponseHeaderSchema,
|
|
11
|
-
ResponseMetadata,
|
|
12
|
-
Schema,
|
|
11
|
+
type Imports,
|
|
12
|
+
type OperationResponse,
|
|
13
|
+
type ResponseHeaderSchema,
|
|
14
|
+
type ResponseMetadata,
|
|
15
|
+
type Schema,
|
|
13
16
|
SchemaContext,
|
|
14
17
|
} from "../interfaces.js";
|
|
15
18
|
import { listOperationsUnderClient } from "../utils/client-utils.js";
|
|
16
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
19
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
17
20
|
import {
|
|
18
21
|
getBinaryType,
|
|
19
22
|
getImportedModelName,
|
|
@@ -1,9 +1,12 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
import {
|
|
5
|
+
type SdkClient,
|
|
6
|
+
getHttpOperationWithCache,
|
|
7
|
+
} from "@azure-tools/typespec-client-generator-core";
|
|
8
|
+
import type { Model, Type } from "@typespec/compiler";
|
|
9
|
+
import { type HttpOperation, getServers } from "@typespec/http";
|
|
7
10
|
import { KnownMediaType, extractMediaTypes } from "../utils/media-types.js";
|
|
8
11
|
import {
|
|
9
12
|
getBodyType,
|
|
@@ -17,7 +20,7 @@ import {
|
|
|
17
20
|
import { useContext } from "../context-manager.js";
|
|
18
21
|
import { SchemaContext } from "../interfaces.js";
|
|
19
22
|
import { listOperationsUnderClient } from "../utils/client-utils.js";
|
|
20
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
23
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
21
24
|
|
|
22
25
|
export function transformSchemas(client: SdkClient, dpgContext: SdkContext) {
|
|
23
26
|
const program = dpgContext.program;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
getHttpOperationWithCache,
|
|
3
|
-
SdkClient,
|
|
4
|
-
SdkContext,
|
|
3
|
+
type SdkClient,
|
|
4
|
+
type SdkContext,
|
|
5
5
|
} from "@azure-tools/typespec-client-generator-core";
|
|
6
|
-
import { TelemetryInfo } from "../interfaces.js";
|
|
6
|
+
import type { TelemetryInfo } from "../interfaces.js";
|
|
7
7
|
import { listOperationsUnderClient } from "../utils/client-utils.js";
|
|
8
8
|
import { getCustomRequestHeaderNameForOperation } from "../utils/operation-util.js";
|
|
9
9
|
|
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import { SdkClient } from "@azure-tools/typespec-client-generator-core";
|
|
4
|
+
import type { SdkClient } from "@azure-tools/typespec-client-generator-core";
|
|
5
5
|
import { getDoc, joinPaths } from "@typespec/compiler";
|
|
6
6
|
import { getServers } from "@typespec/http";
|
|
7
7
|
import {
|
|
8
|
-
ClientModel,
|
|
9
|
-
ClientOptions,
|
|
10
|
-
Imports,
|
|
11
|
-
OperationParameter,
|
|
12
|
-
OperationResponse,
|
|
13
|
-
PathParameter,
|
|
14
|
-
Paths,
|
|
15
|
-
Schema,
|
|
8
|
+
type ClientModel,
|
|
9
|
+
type ClientOptions,
|
|
10
|
+
type Imports,
|
|
11
|
+
type OperationParameter,
|
|
12
|
+
type OperationResponse,
|
|
13
|
+
type PathParameter,
|
|
14
|
+
type Paths,
|
|
15
|
+
type Schema,
|
|
16
16
|
SchemaContext,
|
|
17
|
-
UrlInfo,
|
|
17
|
+
type UrlInfo,
|
|
18
18
|
} from "../interfaces.js";
|
|
19
19
|
import { buildRuntimeImports, initInternalImports } from "../utils/imports-util.js";
|
|
20
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
20
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
21
21
|
import {
|
|
22
22
|
getDefaultService,
|
|
23
23
|
getFormattedPropertyDoc,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ApiVersionInfo, ApiVersionPosition, UrlInfo } from "../interfaces.js";
|
|
1
|
+
import type { ApiVersionInfo, ApiVersionPosition, UrlInfo } from "../interfaces.js";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Extract the path api-version detail from UrlInfo, return undefined if no valid api-version parameter
|
|
@@ -2,20 +2,20 @@ import {
|
|
|
2
2
|
InitializedByFlags,
|
|
3
3
|
listAllServiceNamespaces,
|
|
4
4
|
listClients,
|
|
5
|
-
SdkClient,
|
|
6
|
-
SdkClientType,
|
|
7
|
-
SdkServiceOperation,
|
|
5
|
+
type SdkClient,
|
|
6
|
+
type SdkClientType,
|
|
7
|
+
type SdkServiceOperation,
|
|
8
8
|
} from "@azure-tools/typespec-client-generator-core";
|
|
9
9
|
import {
|
|
10
10
|
getNamespaceFullName,
|
|
11
|
-
Interface,
|
|
11
|
+
type Interface,
|
|
12
12
|
isTemplateDeclaration,
|
|
13
13
|
isTemplateDeclarationOrInstance,
|
|
14
|
-
Namespace,
|
|
15
|
-
Operation,
|
|
14
|
+
type Namespace,
|
|
15
|
+
type Operation,
|
|
16
16
|
} from "@typespec/compiler";
|
|
17
|
-
import { ClientModuleInfo } from "../modular/interfaces.js";
|
|
18
|
-
import { SdkContext } from "./interfaces.js";
|
|
17
|
+
import type { ClientModuleInfo } from "../modular/interfaces.js";
|
|
18
|
+
import type { SdkContext } from "./interfaces.js";
|
|
19
19
|
import { NameType, normalizeName } from "./name-utils.js";
|
|
20
20
|
|
|
21
21
|
export function getClients(dpgContext: SdkContext): SdkClient[] {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SdkClientInitializationType } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
-
import { NoTarget, Program } from "@typespec/compiler";
|
|
3
|
-
import { Authentication, HttpAuth } from "@typespec/http";
|
|
1
|
+
import type { SdkClientInitializationType } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
+
import { NoTarget, type Program } from "@typespec/compiler";
|
|
3
|
+
import type { Authentication, HttpAuth } from "@typespec/http";
|
|
4
4
|
import { reportDiagnostic } from "../lib.js";
|
|
5
5
|
|
|
6
6
|
/**
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import { UsageFlags } from "@azure-tools/typespec-client-generator-core";
|
|
5
5
|
import { transformModularEmitterOptions } from "../modular/build-modular-options.js";
|
|
6
|
-
import { SdkContext } from "./interfaces.js";
|
|
6
|
+
import type { SdkContext } from "./interfaces.js";
|
|
7
7
|
import { NameType, normalizeName } from "./name-utils.js";
|
|
8
8
|
import { getMethodHierarchiesMap } from "./operation-util.js";
|
|
9
9
|
|
package/src/utils/emit-util.ts
CHANGED
|
@@ -1,9 +1,15 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
type CompilerHost,
|
|
3
|
+
getDirectoryPath,
|
|
4
|
+
joinPaths,
|
|
5
|
+
NoTarget,
|
|
6
|
+
type Program,
|
|
7
|
+
} from "@typespec/compiler";
|
|
2
8
|
import { format } from "prettier";
|
|
3
9
|
import prettierPluginBabel from "prettier/plugins/babel";
|
|
4
10
|
import prettierPluginEstree from "prettier/plugins/estree";
|
|
5
11
|
import prettierPluginTypescript from "prettier/plugins/typescript";
|
|
6
|
-
import { ClientModel, ContentBuilder, File } from "../interfaces.js";
|
|
12
|
+
import type { ClientModel, ContentBuilder, File } from "../interfaces.js";
|
|
7
13
|
import { prettierJSONOptions, prettierTypeScriptOptions, reportDiagnostic } from "../lib.js";
|
|
8
14
|
|
|
9
15
|
export async function emitContentByBuilder(
|
|
@@ -36,7 +42,7 @@ async function emitFile(file: File, program: Program, emitterOutputDir?: string)
|
|
|
36
42
|
const host: CompilerHost = program.host;
|
|
37
43
|
const filePath = joinPaths(emitterOutputDir ?? "", file.path);
|
|
38
44
|
const isJson = /\.json$/gi.test(filePath);
|
|
39
|
-
const isSourceCode = /\.(ts|js)$/gi.test(filePath);
|
|
45
|
+
const isSourceCode = /\.(m|c)?(ts|js)$/gi.test(filePath);
|
|
40
46
|
const licenseHeader = `// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n`;
|
|
41
47
|
let prettierFileContent = file.content;
|
|
42
48
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { NoTarget,
|
|
1
|
+
import { NoTarget, resolvePath, type CompilerHost, type Program } from "@typespec/compiler";
|
|
2
2
|
import { reportDiagnostic } from "../lib.js";
|
|
3
3
|
|
|
4
4
|
export async function pathExists(host: CompilerHost, targetPath: string): Promise<boolean> {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { SourceFile } from "ts-morph";
|
|
2
|
-
import { ImportType, Imports } from "../interfaces.js";
|
|
2
|
+
import type { ImportType, Imports } from "../interfaces.js";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* Build the common imports for generated SDK. Azure Core packages are always used.
|
|
@@ -10,7 +10,7 @@ export function buildRuntimeImports(): Imports {
|
|
|
10
10
|
restClient: {
|
|
11
11
|
type: "restClient",
|
|
12
12
|
specifier: "@azure-rest/core-client",
|
|
13
|
-
version: "^2.
|
|
13
|
+
version: "^2.7.0",
|
|
14
14
|
},
|
|
15
15
|
coreAuth: {
|
|
16
16
|
type: "coreAuth",
|
package/src/utils/interfaces.ts
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { SdkContext as TCGCSdkContext } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
-
import { ModelProperty, Namespace } from "@typespec/compiler";
|
|
3
|
-
import { ClientOptions, SchemaContext } from "../interfaces.js";
|
|
1
|
+
import type { SdkContext as TCGCSdkContext } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
+
import type { ModelProperty, Namespace } from "@typespec/compiler";
|
|
3
|
+
import { type ClientOptions, SchemaContext } from "../interfaces.js";
|
|
4
4
|
import { KnownMediaType } from "./media-types.js";
|
|
5
5
|
|
|
6
6
|
export interface SdkContext extends TCGCSdkContext {
|
package/src/utils/model-utils.ts
CHANGED
|
@@ -8,20 +8,20 @@ import {
|
|
|
8
8
|
isApiVersion,
|
|
9
9
|
} from "@azure-tools/typespec-client-generator-core";
|
|
10
10
|
import {
|
|
11
|
-
Discriminator,
|
|
12
|
-
EncodeData,
|
|
13
|
-
Enum,
|
|
14
|
-
EnumMember,
|
|
15
|
-
Model,
|
|
16
|
-
ModelProperty,
|
|
11
|
+
type Discriminator,
|
|
12
|
+
type EncodeData,
|
|
13
|
+
type Enum,
|
|
14
|
+
type EnumMember,
|
|
15
|
+
type Model,
|
|
16
|
+
type ModelProperty,
|
|
17
17
|
NoTarget,
|
|
18
|
-
Program,
|
|
19
|
-
Scalar,
|
|
20
|
-
Service,
|
|
21
|
-
Type,
|
|
22
|
-
Union,
|
|
23
|
-
UnionVariant,
|
|
24
|
-
Value,
|
|
18
|
+
type Program,
|
|
19
|
+
type Scalar,
|
|
20
|
+
type Service,
|
|
21
|
+
type Type,
|
|
22
|
+
type Union,
|
|
23
|
+
type UnionVariant,
|
|
24
|
+
type Value,
|
|
25
25
|
getDiscriminator,
|
|
26
26
|
getDoc,
|
|
27
27
|
getEffectiveModelType,
|
|
@@ -50,11 +50,11 @@ import {
|
|
|
50
50
|
listServices,
|
|
51
51
|
} from "@typespec/compiler";
|
|
52
52
|
import {
|
|
53
|
-
HttpOperation,
|
|
54
|
-
HttpOperationHeaderParameter,
|
|
55
|
-
HttpOperationParameters,
|
|
56
|
-
HttpOperationPathParameter,
|
|
57
|
-
HttpOperationQueryParameter,
|
|
53
|
+
type HttpOperation,
|
|
54
|
+
type HttpOperationHeaderParameter,
|
|
55
|
+
type HttpOperationParameters,
|
|
56
|
+
type HttpOperationPathParameter,
|
|
57
|
+
type HttpOperationQueryParameter,
|
|
58
58
|
Visibility,
|
|
59
59
|
getHeaderFieldName,
|
|
60
60
|
getHttpFileModel,
|
|
@@ -64,14 +64,14 @@ import {
|
|
|
64
64
|
isBody,
|
|
65
65
|
isStatusCode,
|
|
66
66
|
} from "@typespec/http";
|
|
67
|
-
import { GetSchemaOptions, SdkContext } from "./interfaces.js";
|
|
67
|
+
import type { GetSchemaOptions, SdkContext } from "./interfaces.js";
|
|
68
68
|
import { KnownMediaType, hasMediaType, isMediaTypeMultipartFormData } from "./media-types.js";
|
|
69
69
|
|
|
70
70
|
import {
|
|
71
|
-
ArraySchema,
|
|
72
|
-
DictionarySchema,
|
|
73
|
-
ObjectSchema,
|
|
74
|
-
Schema,
|
|
71
|
+
type ArraySchema,
|
|
72
|
+
type DictionarySchema,
|
|
73
|
+
type ObjectSchema,
|
|
74
|
+
type Schema,
|
|
75
75
|
SchemaContext,
|
|
76
76
|
} from "../interfaces.js";
|
|
77
77
|
import { reportDiagnostic } from "../lib.js";
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
import { getAllModels, UsageFlags } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
isGlobalNamespace,
|
|
4
|
+
isService,
|
|
5
|
+
type Namespace,
|
|
6
|
+
NoTarget,
|
|
7
|
+
type Operation,
|
|
8
|
+
} from "@typespec/compiler";
|
|
3
9
|
import { reportDiagnostic } from "../lib.js";
|
|
4
|
-
import { SdkContext } from "./interfaces.js";
|
|
10
|
+
import type { SdkContext } from "./interfaces.js";
|
|
5
11
|
|
|
6
12
|
export function getModelNamespaceName(dpgContext: SdkContext, namespace: Namespace): string[] {
|
|
7
13
|
const result: string[] = [];
|
|
@@ -1,14 +1,18 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import type {
|
|
5
|
+
MethodSignatureStructure,
|
|
6
|
+
OptionalKind,
|
|
7
|
+
ParameterDeclarationStructure,
|
|
8
|
+
} from "ts-morph";
|
|
5
9
|
import {
|
|
6
|
-
ClientModel,
|
|
7
|
-
Methods,
|
|
8
|
-
ObjectSchema,
|
|
9
|
-
ParameterMetadata,
|
|
10
|
-
PathParameter,
|
|
11
|
-
Schema,
|
|
10
|
+
type ClientModel,
|
|
11
|
+
type Methods,
|
|
12
|
+
type ObjectSchema,
|
|
13
|
+
type ParameterMetadata,
|
|
14
|
+
type PathParameter,
|
|
15
|
+
type Schema,
|
|
12
16
|
SchemaContext,
|
|
13
17
|
} from "../interfaces.js";
|
|
14
18
|
import { NameType, normalizeName, pascalCase } from "./name-utils.js";
|
|
@@ -7,19 +7,26 @@ import {
|
|
|
7
7
|
getHttpOperationWithCache,
|
|
8
8
|
getWireName,
|
|
9
9
|
InitializedByFlags,
|
|
10
|
-
SdkBodyParameter,
|
|
11
|
-
SdkClient,
|
|
12
|
-
SdkClientType,
|
|
13
|
-
SdkHttpOperation,
|
|
14
|
-
SdkHttpParameter,
|
|
15
|
-
SdkMethod,
|
|
16
|
-
SdkMethodParameter,
|
|
17
|
-
SdkServiceMethod,
|
|
18
|
-
SdkServiceOperation,
|
|
10
|
+
type SdkBodyParameter,
|
|
11
|
+
type SdkClient,
|
|
12
|
+
type SdkClientType,
|
|
13
|
+
type SdkHttpOperation,
|
|
14
|
+
type SdkHttpParameter,
|
|
15
|
+
type SdkMethod,
|
|
16
|
+
type SdkMethodParameter,
|
|
17
|
+
type SdkServiceMethod,
|
|
18
|
+
type SdkServiceOperation,
|
|
19
19
|
} from "@azure-tools/typespec-client-generator-core";
|
|
20
|
-
import { isList, ModelProperty, NoTarget, Operation, Program, Type } from "@typespec/compiler";
|
|
21
|
-
import { $ } from "@typespec/compiler/typekit";
|
|
22
20
|
import {
|
|
21
|
+
isList,
|
|
22
|
+
type ModelProperty,
|
|
23
|
+
NoTarget,
|
|
24
|
+
type Operation,
|
|
25
|
+
type Program,
|
|
26
|
+
type Type,
|
|
27
|
+
} from "@typespec/compiler";
|
|
28
|
+
import { $ } from "@typespec/compiler/typekit";
|
|
29
|
+
import type {
|
|
23
30
|
HttpOperation,
|
|
24
31
|
HttpOperationParameter,
|
|
25
32
|
HttpOperationResponse,
|
|
@@ -29,15 +36,15 @@ import { resolveReference } from "../framework/reference.js";
|
|
|
29
36
|
import {
|
|
30
37
|
OPERATION_LRO_HIGH_PRIORITY,
|
|
31
38
|
OPERATION_LRO_LOW_PRIORITY,
|
|
32
|
-
OperationLroDetail,
|
|
33
|
-
Paths,
|
|
34
|
-
ResponseMetadata,
|
|
35
|
-
ResponseTypes,
|
|
39
|
+
type OperationLroDetail,
|
|
40
|
+
type Paths,
|
|
41
|
+
type ResponseMetadata,
|
|
42
|
+
type ResponseTypes,
|
|
36
43
|
} from "../interfaces.js";
|
|
37
44
|
import { reportDiagnostic } from "../lib.js";
|
|
38
45
|
import { SerializationHelpers } from "../modular/static-helpers-metadata.js";
|
|
39
46
|
import { listOperationsUnderClient } from "./client-utils.js";
|
|
40
|
-
import { SdkContext } from "./interfaces.js";
|
|
47
|
+
import type { SdkContext } from "./interfaces.js";
|
|
41
48
|
import {
|
|
42
49
|
isMediaTypeMultipart,
|
|
43
50
|
isMediaTypeXml,
|
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
import { getEncode, NoTarget, Program } from "@typespec/compiler";
|
|
2
|
-
import { HttpOperationParameter } from "@typespec/http";
|
|
3
|
-
import { Schema, SchemaContext } from "../interfaces.js";
|
|
1
|
+
import { getEncode, NoTarget, type Program } from "@typespec/compiler";
|
|
2
|
+
import type { HttpOperationParameter } from "@typespec/http";
|
|
3
|
+
import { type Schema, SchemaContext } from "../interfaces.js";
|
|
4
4
|
import { reportDiagnostic } from "../lib.js";
|
|
5
|
-
import { SdkContext } from "./interfaces.js";
|
|
5
|
+
import type { SdkContext } from "./interfaces.js";
|
|
6
6
|
import { getTypeName, isArrayType, isObjectOrDictType } from "./model-utils.js";
|
|
7
7
|
import { NameType, normalizeName } from "./name-utils.js";
|
|
8
8
|
|
|
@@ -1,7 +1,13 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import {
|
|
5
|
+
type ArraySchema,
|
|
6
|
+
type ClientModel,
|
|
7
|
+
type ObjectSchema,
|
|
8
|
+
type Schema,
|
|
9
|
+
SchemaContext,
|
|
10
|
+
} from "../interfaces.js";
|
|
5
11
|
|
|
6
12
|
export interface IsDictionaryOptions {
|
|
7
13
|
filterEmpty?: boolean;
|
package/src/utils/type-util.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import { Schema } from "../interfaces.js";
|
|
4
|
+
import type { Schema } from "../interfaces.js";
|
|
5
5
|
|
|
6
6
|
export function isRecord(type: string) {
|
|
7
7
|
return /^Record<([a-zA-Z]+),(\s*)(?<type>.+)>$/.test(type);
|
|
@@ -1,14 +1,10 @@
|
|
|
1
|
-
import { NodeReadableStream } from "
|
|
1
|
+
import { NodeReadableStream } from "@azure/core-rest-pipeline";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* Valid values for the contents of a binary file.
|
|
5
5
|
*/
|
|
6
6
|
export type FileContents =
|
|
7
|
-
|
|
|
8
|
-
| NodeReadableStream
|
|
9
|
-
| ReadableStream<Uint8Array>
|
|
10
|
-
| Uint8Array
|
|
11
|
-
| Blob;
|
|
7
|
+
string | NodeReadableStream | ReadableStream<Uint8Array> | Uint8Array | Blob;
|
|
12
8
|
|
|
13
9
|
export function createFilePartDescriptor(
|
|
14
10
|
partName: string,
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Type alias for Node.js ReadableStream.
|
|
3
|
-
* On Node targets this resolves to the actual NodeJS.ReadableStream type.
|
|
4
|
-
* On browser/react-native targets the platform variant resolves to `never`,
|
|
5
|
-
* which drops out of union types naturally.
|
|
6
|
-
*/
|
|
7
|
-
export type NodeReadableStream = NodeJS.ReadableStream;
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { HttpResponse, StreamableMethod } from "@azure-rest/core-client";
|
|
2
|
-
import { NodeReadableStream } from "../platform-types-browser.mjs";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Resolves a StreamableMethod into a binary stream response using browser streaming.
|
|
6
|
-
* Returns both the raw HttpResponse (for status/header inspection) and a blobBody Promise.
|
|
7
|
-
* Error handling is left to the caller so that generated deserializers can apply
|
|
8
|
-
* operation-specific error deserialization (per-status-code details, exception headers, etc.).
|
|
9
|
-
*/
|
|
10
|
-
export async function getBinaryStreamResponse(streamableMethod: StreamableMethod): Promise<
|
|
11
|
-
HttpResponse & {
|
|
12
|
-
blobBody?: Promise<Blob>;
|
|
13
|
-
readableStreamBody?: NodeReadableStream;
|
|
14
|
-
}
|
|
15
|
-
> {
|
|
16
|
-
const response = await streamableMethod.asBrowserStream();
|
|
17
|
-
return {
|
|
18
|
-
...response,
|
|
19
|
-
blobBody: new Response(response.body).blob(),
|
|
20
|
-
readableStreamBody: undefined,
|
|
21
|
-
};
|
|
22
|
-
}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { getBinaryStreamResponse } from "./get-binary-stream-response-browser.mjs";
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
import { HttpResponse, StreamableMethod } from "@azure-rest/core-client";
|
|
2
|
-
import { NodeReadableStream } from "../platform-types.js";
|
|
3
|
-
|
|
4
|
-
/**
|
|
5
|
-
* Resolves a StreamableMethod into a binary stream response using Node.js streaming.
|
|
6
|
-
* Returns both the raw HttpResponse (for status/header inspection) and the readable stream body.
|
|
7
|
-
* Error handling is left to the caller so that generated deserializers can apply
|
|
8
|
-
* operation-specific error deserialization (per-status-code details, exception headers, etc.).
|
|
9
|
-
*/
|
|
10
|
-
export async function getBinaryStreamResponse(streamableMethod: StreamableMethod): Promise<
|
|
11
|
-
HttpResponse & {
|
|
12
|
-
blobBody?: Promise<Blob>;
|
|
13
|
-
readableStreamBody?: NodeReadableStream;
|
|
14
|
-
}
|
|
15
|
-
> {
|
|
16
|
-
const response = await streamableMethod.asNodeStream();
|
|
17
|
-
return {
|
|
18
|
-
...response,
|
|
19
|
-
blobBody: undefined,
|
|
20
|
-
readableStreamBody: response.body,
|
|
21
|
-
};
|
|
22
|
-
}
|