@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
|
@@ -1,14 +1,17 @@
|
|
|
1
|
-
import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
-
import { SdkContext } from "../../utils/interfaces.js";
|
|
1
|
+
import { type SdkClientType, type SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
+
import type { SdkContext } from "../../utils/interfaces.js";
|
|
3
3
|
import { NameType } from "../../utils/name-utils.js";
|
|
4
|
-
import { ServiceOperation } from "../../utils/operation-util.js";
|
|
4
|
+
import type { ServiceOperation } from "../../utils/operation-util.js";
|
|
5
5
|
export declare function getClientName(client: SdkClientType<SdkServiceOperation>): string;
|
|
6
6
|
export declare function getClassicalClientName(client: SdkClientType<SdkServiceOperation>): string;
|
|
7
7
|
export interface GuardedName {
|
|
8
|
+
/** The name used for the generated API-layer function (e.g. `deleteConversation`). */
|
|
8
9
|
name: string;
|
|
10
|
+
/** The name used for the public method exposed on clients and operation groups. */
|
|
11
|
+
propertyName: string;
|
|
9
12
|
fixme?: string[];
|
|
10
13
|
}
|
|
11
|
-
export declare function getOperationName(operation: ServiceOperation, dpgContext?: SdkContext): GuardedName;
|
|
14
|
+
export declare function getOperationName(operation: ServiceOperation, dpgContext?: SdkContext, prefixes?: string[]): GuardedName;
|
|
12
15
|
export declare function isReservedName(name: string, nameType: NameType): boolean;
|
|
13
16
|
export declare function getClassicalLayerPrefix(prefixes: string[], nameType: NameType, separator?: string, layer?: number): string;
|
|
14
17
|
export declare function isDefined<T>(thing: T | undefined | null): thing is T;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"naming-helpers.d.ts","sourceRoot":"","sources":["../../../../src/modular/helpers/naming-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,
|
|
1
|
+
{"version":3,"file":"naming-helpers.d.ts","sourceRoot":"","sources":["../../../../src/modular/helpers/naming-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,aAAa,EAClB,KAAK,mBAAmB,EACzB,MAAM,6CAA6C,CAAC;AAErD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAqC,MAAM,2BAA2B,CAAC;AACxF,OAAO,KAAK,EAAE,gBAAgB,EAAE,MAAM,+BAA+B,CAAC;AAEtE,wBAAgB,aAAa,CAAC,MAAM,EAAE,aAAa,CAAC,mBAAmB,CAAC,GAAG,MAAM,CAEhF;AAED,wBAAgB,sBAAsB,CAAC,MAAM,EAAE,aAAa,CAAC,mBAAmB,CAAC,GAAG,MAAM,CAEzF;AAED,MAAM,WAAW,WAAW;IAC1B,sFAAsF;IACtF,IAAI,EAAE,MAAM,CAAC;IACb,mFAAmF;IACnF,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,CAAC,EAAE,MAAM,EAAE,CAAC;CAClB;AAED,wBAAgB,gBAAgB,CAC9B,SAAS,EAAE,gBAAgB,EAC3B,UAAU,CAAC,EAAE,UAAU,EACvB,QAAQ,GAAE,MAAM,EAAO,GACtB,WAAW,CAyCb;AAgBD,wBAAgB,cAAc,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAKxE;AAED,wBAAgB,uBAAuB,CACrC,QAAQ,EAAE,MAAM,EAAE,EAClB,QAAQ,EAAE,QAAQ,EAClB,SAAS,GAAE,MAAW,EACtB,KAAK,GAAE,MAA4B,GAClC,MAAM,CAYR;AAED,wBAAgB,SAAS,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,SAAS,GAAG,IAAI,GAAG,KAAK,IAAI,CAAC,CAEpE;AAED;;;;;GAKG;AACH,wBAAgB,yBAAyB,CAAC,IAAI,EAAE,MAAM,EAAE,aAAa,EAAE,GAAG,CAAC,MAAM,CAAC,GAAG,MAAM,CAQ1F"}
|
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { getClientNameOverride, } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
+
import pluralize from "pluralize";
|
|
1
3
|
import { NameType, normalizeName, ReservedModelNames } from "../../utils/name-utils.js";
|
|
2
4
|
export function getClientName(client) {
|
|
3
5
|
return client.name.replace(/Client$/, "");
|
|
@@ -5,12 +7,35 @@ export function getClientName(client) {
|
|
|
5
7
|
export function getClassicalClientName(client) {
|
|
6
8
|
return client.name;
|
|
7
9
|
}
|
|
8
|
-
export function getOperationName(operation, dpgContext) {
|
|
9
|
-
const
|
|
10
|
+
export function getOperationName(operation, dpgContext, prefixes = []) {
|
|
11
|
+
const name = normalizeName(operation.name, NameType.Method, true);
|
|
12
|
+
const propertyName = normalizeName(operation.name, NameType.Property);
|
|
10
13
|
const isDataplane = dpgContext !== undefined && !dpgContext.emitterOptions?.azureArm;
|
|
11
|
-
|
|
14
|
+
// An explicit `@clientName` override is an intentional naming choice by the user, so we
|
|
15
|
+
// honor it verbatim and skip the reserved-word disambiguation (and its `@fixme`). The
|
|
16
|
+
// public method keeps the reserved word (e.g. `delete`), while the generated API-layer
|
|
17
|
+
// function stays guarded (e.g. `$delete`) because a reserved word is not a valid function
|
|
18
|
+
// binding in JavaScript.
|
|
19
|
+
const hasClientNameOverride = dpgContext !== undefined &&
|
|
20
|
+
operation.__raw !== undefined &&
|
|
21
|
+
getClientNameOverride(dpgContext, operation.__raw) !== undefined;
|
|
22
|
+
if (isReservedName(operation.name, NameType.Method) && isDataplane && !hasClientNameOverride) {
|
|
23
|
+
const suffix = getReservedNameGroupSuffix(prefixes);
|
|
24
|
+
if (suffix) {
|
|
25
|
+
// Disambiguate the reserved word by suffixing the singularized operation group
|
|
26
|
+
// name, e.g. `delete` in the `Conversations` group becomes `deleteConversation`.
|
|
27
|
+
const disambiguated = normalizeName(`${operation.name}_${suffix}`, NameType.Method);
|
|
28
|
+
return {
|
|
29
|
+
name: disambiguated,
|
|
30
|
+
propertyName: disambiguated,
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
// There is no operation group to disambiguate the reserved word with (e.g. a top-level
|
|
34
|
+
// operation), so keep the guarded name (e.g. `$delete`) and surface a fixme asking the
|
|
35
|
+
// user to override the generated name.
|
|
12
36
|
return {
|
|
13
|
-
name
|
|
37
|
+
name,
|
|
38
|
+
propertyName,
|
|
14
39
|
fixme: [
|
|
15
40
|
`${operation.name} is a reserved word that cannot be used as an operation name.
|
|
16
41
|
Please add @clientName("clientName") or @clientName("<JS-Specific-Name>", "javascript")
|
|
@@ -19,9 +44,23 @@ export function getOperationName(operation, dpgContext) {
|
|
|
19
44
|
};
|
|
20
45
|
}
|
|
21
46
|
return {
|
|
22
|
-
name
|
|
47
|
+
name,
|
|
48
|
+
propertyName,
|
|
23
49
|
};
|
|
24
50
|
}
|
|
51
|
+
/**
|
|
52
|
+
* Builds the suffix used to disambiguate a reserved-word operation name from the
|
|
53
|
+
* operation group it belongs to. The innermost operation group name is singularized
|
|
54
|
+
* so that, for example, the `Conversations` group yields `Conversation`.
|
|
55
|
+
*/
|
|
56
|
+
function getReservedNameGroupSuffix(prefixes) {
|
|
57
|
+
const groups = prefixes.filter((prefix) => prefix && prefix.length > 0);
|
|
58
|
+
const innermostGroup = groups[groups.length - 1];
|
|
59
|
+
if (!innermostGroup) {
|
|
60
|
+
return undefined;
|
|
61
|
+
}
|
|
62
|
+
return pluralize.singular(normalizeName(innermostGroup, NameType.Interface));
|
|
63
|
+
}
|
|
25
64
|
export function isReservedName(name, nameType) {
|
|
26
65
|
return ReservedModelNames.some((reservedName) => reservedName.name === name.toLowerCase() && reservedName.reservedFor.includes(nameType));
|
|
27
66
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"naming-helpers.js","sourceRoot":"","sources":["../../../../src/modular/helpers/naming-helpers.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"naming-helpers.js","sourceRoot":"","sources":["../../../../src/modular/helpers/naming-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,qBAAqB,GAGtB,MAAM,6CAA6C,CAAC;AACrD,OAAO,SAAS,MAAM,WAAW,CAAC;AAElC,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,kBAAkB,EAAE,MAAM,2BAA2B,CAAC;AAGxF,MAAM,UAAU,aAAa,CAAC,MAA0C;IACtE,OAAO,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC;AAC5C,CAAC;AAED,MAAM,UAAU,sBAAsB,CAAC,MAA0C;IAC/E,OAAO,MAAM,CAAC,IAAI,CAAC;AACrB,CAAC;AAUD,MAAM,UAAU,gBAAgB,CAC9B,SAA2B,EAC3B,UAAuB,EACvB,WAAqB,EAAE;IAEvB,MAAM,IAAI,GAAG,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IAClE,MAAM,YAAY,GAAG,aAAa,CAAC,SAAS,CAAC,IAAI,EAAE,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACtE,MAAM,WAAW,GAAG,UAAU,KAAK,SAAS,IAAI,CAAC,UAAU,CAAC,cAAc,EAAE,QAAQ,CAAC;IACrF,wFAAwF;IACxF,sFAAsF;IACtF,uFAAuF;IACvF,0FAA0F;IAC1F,yBAAyB;IACzB,MAAM,qBAAqB,GACzB,UAAU,KAAK,SAAS;QACxB,SAAS,CAAC,KAAK,KAAK,SAAS;QAC7B,qBAAqB,CAAC,UAAU,EAAE,SAAS,CAAC,KAAK,CAAC,KAAK,SAAS,CAAC;IACnE,IAAI,cAAc,CAAC,SAAS,CAAC,IAAI,EAAE,QAA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SdkHttpOperation, SdkHttpParameter, SdkLroPagingServiceMethod, SdkLroServiceMethod, SdkMethod, SdkModelPropertyType, SdkModelType, SdkPagingServiceMethod, SdkServiceResponseHeader, SdkType } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
-
import { FunctionDeclarationStructure, OptionalKind, TypeAliasDeclarationStructure } from "ts-morph";
|
|
3
|
-
import { SdkContext } from "../../utils/interfaces.js";
|
|
4
|
-
import { ServiceOperation } from "../../utils/operation-util.js";
|
|
5
|
-
import { ModelOverrideOptions } from "../serialization/serialize-utils.js";
|
|
1
|
+
import { type SdkClientType, type SdkHttpOperation, type SdkHttpParameter, type SdkLroPagingServiceMethod, type SdkLroServiceMethod, type SdkMethod, type SdkModelPropertyType, type SdkModelType, type SdkPagingServiceMethod, type SdkServiceResponseHeader, type SdkType } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
+
import { type FunctionDeclarationStructure, type OptionalKind, type TypeAliasDeclarationStructure } from "ts-morph";
|
|
3
|
+
import type { SdkContext } from "../../utils/interfaces.js";
|
|
4
|
+
import { type ServiceOperation } from "../../utils/operation-util.js";
|
|
5
|
+
import { type ModelOverrideOptions } from "../serialization/serialize-utils.js";
|
|
6
6
|
export declare function getSendPrivateFunction(dpgContext: SdkContext, method: [string[], ServiceOperation], clientType: string, client?: SdkClientType<SdkHttpOperation>): OptionalKind<FunctionDeclarationStructure>;
|
|
7
7
|
export declare function getDeserializePrivateFunction(context: SdkContext, method: [string[], ServiceOperation]): OptionalKind<FunctionDeclarationStructure>;
|
|
8
8
|
/**
|
|
@@ -10,12 +10,12 @@ export declare function getDeserializePrivateFunction(context: SdkContext, metho
|
|
|
10
10
|
* Only generated when response headers are present and include-headers-in-response
|
|
11
11
|
* or enable-storage-compat is enabled.
|
|
12
12
|
*/
|
|
13
|
-
export declare function getDeserializeHeadersPrivateFunction(context: SdkContext,
|
|
13
|
+
export declare function getDeserializeHeadersPrivateFunction(context: SdkContext, method: [string[], ServiceOperation]): OptionalKind<FunctionDeclarationStructure> | undefined;
|
|
14
14
|
/**
|
|
15
15
|
* Generates a private function to deserialize exception response headers.
|
|
16
16
|
* Only generated when exception headers are present and include-headers-in-response is enabled.
|
|
17
17
|
*/
|
|
18
|
-
export declare function getDeserializeExceptionHeadersPrivateFunction(context: SdkContext,
|
|
18
|
+
export declare function getDeserializeExceptionHeadersPrivateFunction(context: SdkContext, method: [string[], ServiceOperation]): OptionalKind<FunctionDeclarationStructure> | undefined;
|
|
19
19
|
/**
|
|
20
20
|
* This operation builds and returns the function declaration for an operation.
|
|
21
21
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"operation-helpers.d.ts","sourceRoot":"","sources":["../../../../src/modular/helpers/operation-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,aAAa,
|
|
1
|
+
{"version":3,"file":"operation-helpers.d.ts","sourceRoot":"","sources":["../../../../src/modular/helpers/operation-helpers.ts"],"names":[],"mappings":"AAAA,OAAO,EAKL,KAAK,aAAa,EAGlB,KAAK,gBAAgB,EACrB,KAAK,gBAAgB,EACrB,KAAK,yBAAyB,EAC9B,KAAK,mBAAmB,EACxB,KAAK,SAAS,EAEd,KAAK,oBAAoB,EACzB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,wBAAwB,EAC7B,KAAK,OAAO,EACb,MAAM,6CAA6C,CAAC;AAGrD,OAAO,EACL,KAAK,4BAA4B,EACjC,KAAK,YAAY,EAGjB,KAAK,6BAA6B,EACnC,MAAM,UAAU,CAAC;AAOlB,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAG5D,OAAO,EAUL,KAAK,gBAAgB,EACtB,MAAM,+BAA+B,CAAC;AAevC,OAAO,EAIL,KAAK,oBAAoB,EAC1B,MAAM,qCAAqC,CAAC;AAoC7C,wBAAgB,sBAAsB,CACpC,UAAU,EAAE,UAAU,EACtB,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC,EAC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AC,WAAW,CAAC,GACvC,wBAAwB,EAAE,CAY5B;AAsGD;;;;GAIG;AACH,wBAAgB,4BAA4B,CAAC,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC,GAAG,MAAM,CAOzF;AAyCD;;;GAGG;AACH,wBAAgB,uBAAuB,CACrC,OAAO,EAAE,UAAU,EACnB,SAAS,EAAE,gBAAgB,GAC1B;IAAE,UAAU,EAAE,OAAO,CAAC;IAAC,QAAQ,EAAE,OAAO,CAAA;CAAE,CA2C5C;AAED;;;;GAIG;AACH,wBAAgB,oCAAoC,CAClD,OAAO,EAAE,UAAU,EACnB,MAAM,EAAE,CAAC,MAAM,EAAE,EAAE,gBAAgB,CAAC,EACpC,QAAQ,EAAE,OAAO,GAChB,6BAA6B,CAmC/B"}
|
|
@@ -11,12 +11,12 @@ import { reportDiagnostic } from "../../lib.js";
|
|
|
11
11
|
import { isAzureCoreErrorType } from "../../utils/model-utils.js";
|
|
12
12
|
import { NameType, normalizeName } from "../../utils/name-utils.js";
|
|
13
13
|
import { getCollectionFormatFromArrayEncoding, getCollectionFormatHelper, getCollectionFormatParseHelper, hasCollectionFormatInfo, hasDualFormatSupport, isBinaryPayload, isMultipartPayload, isXmlPayload, KnownCollectionFormat, } from "../../utils/operation-util.js";
|
|
14
|
-
import { AzurePollingDependencies } from "../external-dependencies.js";
|
|
14
|
+
import { AzureCoreDependencies, AzurePollingDependencies } from "../external-dependencies.js";
|
|
15
15
|
import { buildModelDeserializer, buildPropertyDeserializer, } from "../serialization/build-deserializer-function.js";
|
|
16
16
|
import { buildModelSerializer, buildPropertySerializer, } from "../serialization/build-serializer-function.js";
|
|
17
17
|
import { buildXmlModelDeserializer, buildXmlModelSerializer, hasXmlSerialization, } from "../serialization/build-xml-serializer-function.js";
|
|
18
18
|
import { getPropertyWithOverrides, isNormalUnion, isSpecialHandledUnion, } from "../serialization/serialize-utils.js";
|
|
19
|
-
import { PagingHelpers,
|
|
19
|
+
import { PagingHelpers, PollingHelpers, SerializationHelpers, StorageCompatHelpers, UrlTemplateHelpers, XmlHelpers, } from "../static-helpers-metadata.js";
|
|
20
20
|
import { isExtensibleEnum } from "../type-expressions/get-enum-expression.js";
|
|
21
21
|
import { emitInlineModel } from "../type-expressions/get-model-expression.js";
|
|
22
22
|
import { getTypeExpression, normalizeModelPropertyName, } from "../type-expressions/get-type-expression.js";
|
|
@@ -36,7 +36,7 @@ function shouldSkipHeaderSerialization(header) {
|
|
|
36
36
|
export function getSendPrivateFunction(dpgContext, method, clientType, client) {
|
|
37
37
|
const operation = method[1];
|
|
38
38
|
const parameters = getOperationSignatureParameters(dpgContext, method, clientType);
|
|
39
|
-
const { name } = getOperationName(operation);
|
|
39
|
+
const { name } = getOperationName(operation, dpgContext, method[0]);
|
|
40
40
|
const dependencies = useDependencies();
|
|
41
41
|
const functionStatement = {
|
|
42
42
|
isAsync: false,
|
|
@@ -77,7 +77,7 @@ export function getSendPrivateFunction(dpgContext, method, clientType, client) {
|
|
|
77
77
|
}
|
|
78
78
|
export function getDeserializePrivateFunction(context, method) {
|
|
79
79
|
const operation = method[1];
|
|
80
|
-
const { name } = getOperationName(operation);
|
|
80
|
+
const { name } = getOperationName(operation, context, method[0]);
|
|
81
81
|
const dependencies = useDependencies();
|
|
82
82
|
const PathUncheckedResponseReference = resolveReference(dependencies.PathUncheckedResponse);
|
|
83
83
|
// Check if we need to wrap the non-model return type
|
|
@@ -155,7 +155,7 @@ export function getDeserializePrivateFunction(context, method) {
|
|
|
155
155
|
const statements = [];
|
|
156
156
|
const createRestErrorReference = resolveReference(dependencies.createRestError);
|
|
157
157
|
statements.push(`const expectedStatuses = ${getExpectedStatuses(operation)};`);
|
|
158
|
-
statements.push(`if(!expectedStatuses.includes(result.status)){`, `${getExceptionThrowStatement(context,
|
|
158
|
+
statements.push(`if(!expectedStatuses.includes(result.status)){`, `${getExceptionThrowStatement(context, method)}`, "}");
|
|
159
159
|
const deserializedType = isLroOnly || isLroAndPaging
|
|
160
160
|
? operation?.lroMetadata?.finalResponse?.result
|
|
161
161
|
: isPagingOnly && restResponse?.type
|
|
@@ -330,7 +330,8 @@ export function getDeserializePrivateFunction(context, method) {
|
|
|
330
330
|
* Only generated when response headers are present and include-headers-in-response
|
|
331
331
|
* or enable-storage-compat is enabled.
|
|
332
332
|
*/
|
|
333
|
-
export function getDeserializeHeadersPrivateFunction(context,
|
|
333
|
+
export function getDeserializeHeadersPrivateFunction(context, method) {
|
|
334
|
+
const operation = method[1];
|
|
334
335
|
const responseHeaders = getResponseHeaders(operation.operation.responses);
|
|
335
336
|
const isResponseHeadersEnabled = context.emitterOptions?.includeHeadersInResponse === true;
|
|
336
337
|
const isStorageCompatEnabled = context.emitterOptions?.enableStorageCompat === true;
|
|
@@ -338,7 +339,7 @@ export function getDeserializeHeadersPrivateFunction(context, operation) {
|
|
|
338
339
|
if (responseHeaders.length === 0 || (!isResponseHeadersEnabled && !isStorageCompatEnabled)) {
|
|
339
340
|
return undefined;
|
|
340
341
|
}
|
|
341
|
-
const { name } = getOperationName(operation);
|
|
342
|
+
const { name } = getOperationName(operation, context, method[0]);
|
|
342
343
|
const dependencies = useDependencies();
|
|
343
344
|
const PathUncheckedResponseReference = resolveReference(dependencies.PathUncheckedResponse);
|
|
344
345
|
const parameters = [
|
|
@@ -448,7 +449,8 @@ function getExceptionResponseHeaders(exceptions) {
|
|
|
448
449
|
* Generates a private function to deserialize exception response headers.
|
|
449
450
|
* Only generated when exception headers are present and include-headers-in-response is enabled.
|
|
450
451
|
*/
|
|
451
|
-
export function getDeserializeExceptionHeadersPrivateFunction(context,
|
|
452
|
+
export function getDeserializeExceptionHeadersPrivateFunction(context, method) {
|
|
453
|
+
const operation = method[1];
|
|
452
454
|
const isResponseHeadersEnabled = context.emitterOptions?.includeHeadersInResponse === true;
|
|
453
455
|
if (!isResponseHeadersEnabled) {
|
|
454
456
|
return undefined;
|
|
@@ -457,7 +459,7 @@ export function getDeserializeExceptionHeadersPrivateFunction(context, operation
|
|
|
457
459
|
if (exceptionHeaders.length === 0) {
|
|
458
460
|
return undefined;
|
|
459
461
|
}
|
|
460
|
-
const { name } = getOperationName(operation);
|
|
462
|
+
const { name } = getOperationName(operation, context, method[0]);
|
|
461
463
|
const dependencies = useDependencies();
|
|
462
464
|
const PathUncheckedResponseReference = resolveReference(dependencies.PathUncheckedResponse);
|
|
463
465
|
const parameters = [
|
|
@@ -490,7 +492,8 @@ function getExceptionDeserializeExpr(exception) {
|
|
|
490
492
|
}
|
|
491
493
|
return `isXml ? ${exception.xmlDeserializer}(result.body) : ${exception.deserializer}(result.body)`;
|
|
492
494
|
}
|
|
493
|
-
function getExceptionThrowStatement(context,
|
|
495
|
+
function getExceptionThrowStatement(context, method) {
|
|
496
|
+
const operation = method[1];
|
|
494
497
|
const statements = [];
|
|
495
498
|
const createRestErrorReference = resolveReference(useDependencies().createRestError);
|
|
496
499
|
const { customized, defaultDeserializer, defaultXmlDeserializer, defaultIsXmlOnly } = getExceptionDetails(context, operation);
|
|
@@ -498,7 +501,7 @@ function getExceptionThrowStatement(context, operation) {
|
|
|
498
501
|
// Check if exception headers function exists and build the call
|
|
499
502
|
const exceptionHeaders = getExceptionResponseHeaders(operation.operation.exceptions);
|
|
500
503
|
const hasExceptionHeaders = isResponseHeadersEnabled && exceptionHeaders.length > 0;
|
|
501
|
-
const { name: opName } = getOperationName(operation);
|
|
504
|
+
const { name: opName } = getOperationName(operation, context, method[0]);
|
|
502
505
|
const exceptionHeadersCall = hasExceptionHeaders
|
|
503
506
|
? `error.details = {...(error.details as any), ..._${opName}DeserializeExceptionHeaders(result)};`
|
|
504
507
|
: undefined;
|
|
@@ -761,14 +764,14 @@ export function getOperationFunction(context, method, clientType) {
|
|
|
761
764
|
}
|
|
762
765
|
}
|
|
763
766
|
}
|
|
764
|
-
const { name, fixme = [] } = getOperationName(operation, context);
|
|
767
|
+
const { name, propertyName, fixme = [] } = getOperationName(operation, context, method[0]);
|
|
765
768
|
const functionStatement = {
|
|
766
769
|
kind: StructureKind.Function,
|
|
767
770
|
docs: [...getDocsFromDescription(operation.doc), ...getFixmeForMultilineDocs(fixme)],
|
|
768
771
|
isAsync: true,
|
|
769
772
|
isExported: true,
|
|
770
773
|
name,
|
|
771
|
-
propertyName
|
|
774
|
+
propertyName,
|
|
772
775
|
parameters,
|
|
773
776
|
returnType: `Promise<${finalReturnType}>`,
|
|
774
777
|
};
|
|
@@ -795,7 +798,7 @@ export function getOperationFunction(context, method, clientType) {
|
|
|
795
798
|
const streamableMethodVarName = generateLocallyUniqueName("streamableMethod", paramNames);
|
|
796
799
|
statements.push(`const ${streamableMethodVarName} = _${name}Send(${sendParameterList});`);
|
|
797
800
|
const binaryHelper = wrapReturn && wrapReturnIsBinary
|
|
798
|
-
?
|
|
801
|
+
? AzureCoreDependencies["getBinaryStreamResponse"]
|
|
799
802
|
: SerializationHelpers.getBinaryResponse;
|
|
800
803
|
statements.push(`const ${resultVarName} = await ${resolveReference(binaryHelper)}(${streamableMethodVarName});`);
|
|
801
804
|
}
|
|
@@ -851,7 +854,7 @@ function getLroOnlyOperationFunction(context, method, clientType, optionalParamN
|
|
|
851
854
|
// Extract required parameters
|
|
852
855
|
const parameters = getOperationSignatureParameters(context, method, clientType);
|
|
853
856
|
const returnType = buildLroReturnType(context, operation);
|
|
854
|
-
const { name, fixme = [] } = getOperationName(operation, context);
|
|
857
|
+
const { name, propertyName, fixme = [] } = getOperationName(operation, context, method[0]);
|
|
855
858
|
const pollerLikeReference = resolveReference(AzurePollingDependencies.PollerLike);
|
|
856
859
|
const operationStateReference = resolveReference(AzurePollingDependencies.OperationState);
|
|
857
860
|
// When wrap-non-model-return is enabled and the LRO final result is a non-model type,
|
|
@@ -869,7 +872,7 @@ function getLroOnlyOperationFunction(context, method, clientType, optionalParamN
|
|
|
869
872
|
isAsync: false,
|
|
870
873
|
isExported: true,
|
|
871
874
|
name,
|
|
872
|
-
propertyName
|
|
875
|
+
propertyName,
|
|
873
876
|
isLro: true,
|
|
874
877
|
lroFinalReturnType: effectiveReturnTypeName,
|
|
875
878
|
parameters,
|
|
@@ -906,7 +909,7 @@ function getLroOnlyOperationFunction(context, method, clientType, optionalParamN
|
|
|
906
909
|
function getLroAndPagingOperationFunction(context, method, clientType, optionalParamName = "options") {
|
|
907
910
|
const operation = method[1];
|
|
908
911
|
const parameters = getOperationSignatureParameters(context, method, clientType);
|
|
909
|
-
const { name, fixme = [] } = getOperationName(operation, context);
|
|
912
|
+
const { name, propertyName, fixme = [] } = getOperationName(operation, context, method[0]);
|
|
910
913
|
const returnType = buildLroPagingReturnType(context, operation);
|
|
911
914
|
// Get apiVersion expression for both LRO poller and paging options
|
|
912
915
|
const apiVersion = getApiVersionExpression(context, operation);
|
|
@@ -951,7 +954,7 @@ function getLroAndPagingOperationFunction(context, method, clientType, optionalP
|
|
|
951
954
|
isLroPaging: true,
|
|
952
955
|
lropagingFinalReturnType: returnType.type,
|
|
953
956
|
name,
|
|
954
|
-
propertyName
|
|
957
|
+
propertyName,
|
|
955
958
|
parameters,
|
|
956
959
|
returnType: `${refs.pagedIterator}<${returnType.type}>`,
|
|
957
960
|
statements: [
|
|
@@ -1010,7 +1013,7 @@ function getPagingOnlyOperationFunction(context, method, clientType) {
|
|
|
1010
1013
|
type: getTypeExpression(context, type.valueType),
|
|
1011
1014
|
};
|
|
1012
1015
|
}
|
|
1013
|
-
const { name, fixme = [] } = getOperationName(operation, context);
|
|
1016
|
+
const { name, propertyName, fixme = [] } = getOperationName(operation, context, method[0]);
|
|
1014
1017
|
const pagedAsyncIterableIteratorReference = resolveReference(PagingHelpers.PagedAsyncIterableIterator);
|
|
1015
1018
|
const buildPagedAsyncIteratorReference = resolveReference(PagingHelpers.BuildPagedAsyncIterator);
|
|
1016
1019
|
const functionStatement = {
|
|
@@ -1019,7 +1022,7 @@ function getPagingOnlyOperationFunction(context, method, clientType) {
|
|
|
1019
1022
|
isAsync: false,
|
|
1020
1023
|
isExported: true,
|
|
1021
1024
|
name,
|
|
1022
|
-
propertyName
|
|
1025
|
+
propertyName,
|
|
1023
1026
|
parameters,
|
|
1024
1027
|
returnType: `${pagedAsyncIterableIteratorReference}<${returnType.type}>`,
|
|
1025
1028
|
};
|
|
@@ -2294,7 +2297,7 @@ export function buildNonModelResponseTypeDeclaration(context, method, isBinary)
|
|
|
2294
2297
|
const operation = method[1];
|
|
2295
2298
|
let typeBody;
|
|
2296
2299
|
if (isBinary) {
|
|
2297
|
-
const nodeReadableStreamRef = resolveReference(
|
|
2300
|
+
const nodeReadableStreamRef = resolveReference(AzureCoreDependencies["NodeReadableStream"]);
|
|
2298
2301
|
typeBody = `{
|
|
2299
2302
|
/**
|
|
2300
2303
|
* BROWSER ONLY
|