@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,21 +2,20 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
4
|
import { Project, SourceFile } from "ts-morph";
|
|
5
|
-
import { ClientModel } from "../interfaces.js";
|
|
5
|
+
import type { ClientModel } from "../interfaces.js";
|
|
6
6
|
import { hasPollingOperations } from "../utils/operation-helpers.js";
|
|
7
7
|
import { buildAzureMonorepoPackage } from "./package-json/build-azure-monorepo-package.js";
|
|
8
|
-
import { PackageCommonInfoConfig, resolveWarpExports } from "./package-json/package-common.js";
|
|
8
|
+
import { type PackageCommonInfoConfig, resolveWarpExports } from "./package-json/package-common.js";
|
|
9
9
|
import { getPackageName } from "./utils.js";
|
|
10
10
|
|
|
11
11
|
interface PackageFileOptions {
|
|
12
12
|
exports?: Record<string, any>;
|
|
13
13
|
dependencies?: Record<string, string>;
|
|
14
|
-
clientContextPaths?: string[];
|
|
15
14
|
}
|
|
16
15
|
|
|
17
16
|
export function buildPackageFile(
|
|
18
17
|
model: ClientModel,
|
|
19
|
-
{ exports, dependencies
|
|
18
|
+
{ exports, dependencies }: PackageFileOptions = {},
|
|
20
19
|
) {
|
|
21
20
|
const config: PackageCommonInfoConfig = {
|
|
22
21
|
description: getDescription(model),
|
|
@@ -35,7 +34,6 @@ export function buildPackageFile(
|
|
|
35
34
|
hasLro: hasPollingOperations(model),
|
|
36
35
|
monorepoPackageDirectory: model.options?.azureOutputDirectory,
|
|
37
36
|
dependencies,
|
|
38
|
-
clientContextPaths,
|
|
39
37
|
};
|
|
40
38
|
|
|
41
39
|
const packageInfo: Record<string, any> = buildAzureMonorepoPackage(extendedConfig);
|
|
@@ -63,17 +61,15 @@ export function buildPackageFile(
|
|
|
63
61
|
* - Adds LRO dependencies (`@azure/core-lro`, `@azure/abort-controller`) when the package has
|
|
64
62
|
* polling operations (for non-monorepo Azure packages).
|
|
65
63
|
* - Updates exports (tshy or warp) when `exports` is provided.
|
|
66
|
-
* - Updates `//metadata.constantPaths` when `clientContextPaths` is provided.
|
|
67
64
|
*/
|
|
68
65
|
export function updatePackageFile(
|
|
69
66
|
model: ClientModel,
|
|
70
67
|
existingFilePathOrContent: string | Record<string, any>,
|
|
71
|
-
{ exports
|
|
68
|
+
{ exports }: PackageFileOptions = {},
|
|
72
69
|
) {
|
|
73
70
|
const hasLro = hasPollingOperations(model);
|
|
74
71
|
const needsLroUpdate = hasLro;
|
|
75
72
|
const needsExportsUpdate = exports;
|
|
76
|
-
const needsConstantPathsUpdate = clientContextPaths && clientContextPaths.length > 0;
|
|
77
73
|
|
|
78
74
|
let packageInfo;
|
|
79
75
|
if (typeof existingFilePathOrContent === "string") {
|
|
@@ -99,30 +95,6 @@ export function updatePackageFile(
|
|
|
99
95
|
needsCoreClientUpdate = true;
|
|
100
96
|
}
|
|
101
97
|
|
|
102
|
-
// Ensure warp packages have #platform/* imports for polyfill resolution.
|
|
103
|
-
// The `react-native` condition is only added when explicitly opted in via
|
|
104
|
-
// `generateReactNativeTarget`, matching the fresh-generation path in
|
|
105
|
-
// `getEsmEntrypointInformation` (packageCommon.ts).
|
|
106
|
-
const platformImports: Record<string, string> = {
|
|
107
|
-
browser: "./src/*-browser.mts",
|
|
108
|
-
default: "./src/*.ts",
|
|
109
|
-
};
|
|
110
|
-
if (model.options?.generateReactNativeTarget) {
|
|
111
|
-
// Insert `react-native` before `default` so Node's conditional
|
|
112
|
-
// resolution order matches the fresh-generation output.
|
|
113
|
-
packageInfo.imports = {
|
|
114
|
-
"#platform/*": {
|
|
115
|
-
browser: platformImports["browser"],
|
|
116
|
-
"react-native": "./src/*-react-native.mts",
|
|
117
|
-
default: platformImports["default"],
|
|
118
|
-
},
|
|
119
|
-
};
|
|
120
|
-
} else {
|
|
121
|
-
packageInfo.imports = {
|
|
122
|
-
"#platform/*": platformImports,
|
|
123
|
-
};
|
|
124
|
-
}
|
|
125
|
-
|
|
126
98
|
// Update exports (warp: resolved exports in package.json)
|
|
127
99
|
if (needsExportsUpdate) {
|
|
128
100
|
packageInfo.exports = resolveWarpExports(exports, model.options?.generateReactNativeTarget);
|
|
@@ -131,9 +103,6 @@ export function updatePackageFile(
|
|
|
131
103
|
// Update Core Client dependency
|
|
132
104
|
if (needsCoreClientUpdate) {
|
|
133
105
|
delete deps["@azure/core-client"];
|
|
134
|
-
if (!("@azure-rest/core-client" in deps)) {
|
|
135
|
-
deps["@azure-rest/core-client"] = "^2.3.1";
|
|
136
|
-
}
|
|
137
106
|
packageInfo.dependencies = deps;
|
|
138
107
|
}
|
|
139
108
|
|
|
@@ -146,20 +115,13 @@ export function updatePackageFile(
|
|
|
146
115
|
};
|
|
147
116
|
}
|
|
148
117
|
|
|
149
|
-
//
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
// Add new userAgentInfo entries from clientContextPaths
|
|
157
|
-
const newUserAgentPaths = clientContextPaths!.map((path) => ({
|
|
158
|
-
path: path,
|
|
159
|
-
prefix: "userAgentInfo",
|
|
160
|
-
}));
|
|
161
|
-
metadata.constantPaths = [...nonUserAgentPaths, ...newUserAgentPaths];
|
|
162
|
-
}
|
|
118
|
+
// Always update @azure/core-rest-pipeline and @azure-rest/core-client to the latest
|
|
119
|
+
// versions because our imports rely on APIs from those latest package versions.
|
|
120
|
+
packageInfo.dependencies = {
|
|
121
|
+
...packageInfo.dependencies,
|
|
122
|
+
"@azure/core-rest-pipeline": "^1.24.0",
|
|
123
|
+
"@azure-rest/core-client": "^2.7.0",
|
|
124
|
+
};
|
|
163
125
|
|
|
164
126
|
return {
|
|
165
127
|
path: "package.json",
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import { ClientModel } from "../interfaces.js";
|
|
4
|
+
import type { ClientModel } from "../interfaces.js";
|
|
5
5
|
import { getClientName } from "../utils/name-constructors.js";
|
|
6
6
|
import { NameType, normalizeName } from "../utils/name-utils.js";
|
|
7
7
|
import { renderTemplate } from "./render-template.js";
|
|
@@ -276,13 +276,13 @@ function createMetadata(model: ClientModel): Metadata | undefined {
|
|
|
276
276
|
const clientClassName = getClientName(model);
|
|
277
277
|
const serviceName = getServiceName(model);
|
|
278
278
|
let apiRefUrlQueryParameter: string = "";
|
|
279
|
-
if (!packageDetails?.
|
|
279
|
+
if (!packageDetails?.version && model.apiVersionInfo?.defaultValue) {
|
|
280
280
|
if (model.apiVersionInfo?.defaultValue?.toLowerCase().includes("preview")) {
|
|
281
281
|
apiRefUrlQueryParameter = "?view=azure-node-preview";
|
|
282
282
|
}
|
|
283
283
|
} else {
|
|
284
|
-
|
|
285
|
-
if (
|
|
284
|
+
const packageVersion = packageDetails.version ?? "1.0.0-beta.1";
|
|
285
|
+
if (packageVersion.includes("beta")) {
|
|
286
286
|
apiRefUrlQueryParameter = "?view=azure-node-preview";
|
|
287
287
|
}
|
|
288
288
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import { ClientModel } from "../interfaces.js";
|
|
4
|
+
import type { ClientModel } from "../interfaces.js";
|
|
5
5
|
import { getPackageName } from "./utils.js";
|
|
6
6
|
|
|
7
7
|
function shouldGenerateTestConfig(model: ClientModel): boolean {
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
4
|
import { Project } from "ts-morph";
|
|
5
|
-
import { ClientModel } from "../interfaces.js";
|
|
5
|
+
import type { ClientModel } from "../interfaces.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Builds the root tsconfig.json.
|
|
@@ -52,16 +52,36 @@ export function buildTsConfig(model: ClientModel) {
|
|
|
52
52
|
};
|
|
53
53
|
}
|
|
54
54
|
|
|
55
|
+
/**
|
|
56
|
+
* Derives the tsconfig `include` list from the warp `exports` map so every
|
|
57
|
+
* exported client entry point is compiled and emitted to `dist`; if they drift
|
|
58
|
+
* out of sync, warp fails the build with `DIST_MISSING`. Root index is the fallback.
|
|
59
|
+
*/
|
|
60
|
+
export function getSrcIncludePaths(exports?: Record<string, string>): string[] {
|
|
61
|
+
const includes = new Set<string>(["../src/index.ts"]);
|
|
62
|
+
if (exports) {
|
|
63
|
+
for (const value of Object.values(exports)) {
|
|
64
|
+
if (typeof value === "string" && value.endsWith(".ts")) {
|
|
65
|
+
includes.add(value.replace(/^\.\//, "../"));
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
return Array.from(includes);
|
|
70
|
+
}
|
|
71
|
+
|
|
55
72
|
/**
|
|
56
73
|
* Builds config/tsconfig.src.esm.json — extends eng/tsconfigs/src.esm.json
|
|
57
74
|
*/
|
|
58
|
-
export function buildTsSrcEsmConfig() {
|
|
75
|
+
export function buildTsSrcEsmConfig(exports?: Record<string, string>) {
|
|
59
76
|
return {
|
|
60
77
|
path: "config/tsconfig.src.esm.json",
|
|
61
78
|
content: JSON.stringify(
|
|
62
79
|
{
|
|
63
80
|
extends: "../../../../eng/tsconfigs/src.esm.json",
|
|
64
|
-
|
|
81
|
+
compilerOptions: {
|
|
82
|
+
resolveJsonModule: true,
|
|
83
|
+
},
|
|
84
|
+
include: getSrcIncludePaths(exports),
|
|
65
85
|
},
|
|
66
86
|
null,
|
|
67
87
|
2,
|
|
@@ -72,13 +92,16 @@ export function buildTsSrcEsmConfig() {
|
|
|
72
92
|
/**
|
|
73
93
|
* Builds config/tsconfig.src.browser.json — extends eng/tsconfigs/src.browser.json
|
|
74
94
|
*/
|
|
75
|
-
export function buildTsSrcBrowserConfig() {
|
|
95
|
+
export function buildTsSrcBrowserConfig(exports?: Record<string, string>) {
|
|
76
96
|
return {
|
|
77
97
|
path: "config/tsconfig.src.browser.json",
|
|
78
98
|
content: JSON.stringify(
|
|
79
99
|
{
|
|
80
100
|
extends: "../../../../eng/tsconfigs/src.browser.json",
|
|
81
|
-
|
|
101
|
+
compilerOptions: {
|
|
102
|
+
resolveJsonModule: true,
|
|
103
|
+
},
|
|
104
|
+
include: getSrcIncludePaths(exports),
|
|
82
105
|
},
|
|
83
106
|
null,
|
|
84
107
|
2,
|
|
@@ -89,13 +112,16 @@ export function buildTsSrcBrowserConfig() {
|
|
|
89
112
|
/**
|
|
90
113
|
* Builds config/tsconfig.src.react-native.json — extends eng/tsconfigs/src.react-native.json
|
|
91
114
|
*/
|
|
92
|
-
export function buildTsSrcReactNativeConfig() {
|
|
115
|
+
export function buildTsSrcReactNativeConfig(exports?: Record<string, string>) {
|
|
93
116
|
return {
|
|
94
117
|
path: "config/tsconfig.src.react-native.json",
|
|
95
118
|
content: JSON.stringify(
|
|
96
119
|
{
|
|
97
120
|
extends: "../../../../eng/tsconfigs/src.react-native.json",
|
|
98
|
-
|
|
121
|
+
compilerOptions: {
|
|
122
|
+
resolveJsonModule: true,
|
|
123
|
+
},
|
|
124
|
+
include: getSrcIncludePaths(exports),
|
|
99
125
|
},
|
|
100
126
|
null,
|
|
101
127
|
2,
|
|
@@ -106,13 +132,16 @@ export function buildTsSrcReactNativeConfig() {
|
|
|
106
132
|
/**
|
|
107
133
|
* Builds config/tsconfig.src.cjs.json — extends eng/tsconfigs/src.cjs.json
|
|
108
134
|
*/
|
|
109
|
-
export function buildTsSrcCjsConfig() {
|
|
135
|
+
export function buildTsSrcCjsConfig(exports?: Record<string, string>) {
|
|
110
136
|
return {
|
|
111
137
|
path: "config/tsconfig.src.cjs.json",
|
|
112
138
|
content: JSON.stringify(
|
|
113
139
|
{
|
|
114
140
|
extends: "../../../../eng/tsconfigs/src.cjs.json",
|
|
115
|
-
|
|
141
|
+
compilerOptions: {
|
|
142
|
+
resolveJsonModule: true,
|
|
143
|
+
},
|
|
144
|
+
include: getSrcIncludePaths(exports),
|
|
116
145
|
},
|
|
117
146
|
null,
|
|
118
147
|
2,
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import { ClientModel } from "../interfaces.js";
|
|
4
|
+
import type { ClientModel } from "../interfaces.js";
|
|
5
5
|
|
|
6
6
|
const nodeConfig = `import viteConfig from "../../../vitest.shared.config.ts";
|
|
7
7
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import { ClientModel } from "../interfaces.js";
|
|
4
|
+
import type { ClientModel } from "../interfaces.js";
|
|
5
5
|
|
|
6
6
|
export interface WarpConfigOptions {
|
|
7
7
|
/** Source-level exports, e.g. { ".": "./src/index.ts", "./models": "./src/models/index.ts" } */
|
|
@@ -61,8 +61,6 @@ targets:
|
|
|
61
61
|
* Builds a self-contained warp.config.yml file.
|
|
62
62
|
*
|
|
63
63
|
* Emits a full inline config with all exports and targets.
|
|
64
|
-
* Polyfill resolution (browser/react-native file substitution) is handled
|
|
65
|
-
* via package.json `imports` subpath imports (#platform/*).
|
|
66
64
|
*
|
|
67
65
|
* By default, react-native target is NOT included. Set `generateReactNativeTarget: true`
|
|
68
66
|
* in options to include it.
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import { PackageCommonInfoConfig } from "./package-common.js";
|
|
4
|
+
import type { PackageCommonInfoConfig } from "./package-common.js";
|
|
5
5
|
|
|
6
6
|
export interface AzurePackageInfoConfig extends PackageCommonInfoConfig {
|
|
7
7
|
hasLro: boolean;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import { AzurePackageInfoConfig, getAzureCommonPackageInfo } from "./azure-package-common.js";
|
|
4
|
+
import { type AzurePackageInfoConfig, getAzureCommonPackageInfo } from "./azure-package-common.js";
|
|
5
5
|
import { getCommonPackageScripts, getPackageCommonInfo } from "./package-common.js";
|
|
6
6
|
|
|
7
7
|
export interface AzureMonorepoInfoConfig extends AzurePackageInfoConfig {
|
|
8
8
|
monorepoPackageDirectory?: string;
|
|
9
|
-
clientContextPaths?: string[];
|
|
10
9
|
}
|
|
11
10
|
|
|
12
11
|
/**
|
|
@@ -32,7 +31,7 @@ export function getAzureMonorepoDependencies(config: AzureMonorepoInfoConfig) {
|
|
|
32
31
|
// revert this change after sdk repo update.
|
|
33
32
|
const runtimeDeps = {
|
|
34
33
|
...dependencies,
|
|
35
|
-
"@azure-rest/core-client": "^2.
|
|
34
|
+
"@azure-rest/core-client": "^2.7.0",
|
|
36
35
|
...(hasLro && {
|
|
37
36
|
"@azure/abort-controller": "^2.1.2",
|
|
38
37
|
}),
|
|
@@ -40,7 +39,7 @@ export function getAzureMonorepoDependencies(config: AzureMonorepoInfoConfig) {
|
|
|
40
39
|
...(hasLro && {
|
|
41
40
|
"@azure/core-lro": "^3.1.0",
|
|
42
41
|
}),
|
|
43
|
-
"@azure/core-rest-pipeline": "^1.
|
|
42
|
+
"@azure/core-rest-pipeline": "^1.24.0",
|
|
44
43
|
"@azure/core-util": "^1.12.0",
|
|
45
44
|
"@azure/logger": "^1.2.0",
|
|
46
45
|
tslib: "catalog:",
|
|
@@ -101,7 +100,6 @@ export function getAzureMonorepoPackageInfo(config: AzureMonorepoInfoConfig): Re
|
|
|
101
100
|
homepage: `https://github.com/Azure/azure-sdk-for-js/tree/main/${config.monorepoPackageDirectory}/README.md`,
|
|
102
101
|
}),
|
|
103
102
|
prettier: "@azure/eslint-plugin-azure-sdk/prettier.json",
|
|
104
|
-
"//metadata": getMetadataInfo(config),
|
|
105
103
|
};
|
|
106
104
|
}
|
|
107
105
|
|
|
@@ -162,18 +160,3 @@ function getEsmScripts() {
|
|
|
162
160
|
test: "tsc -b --noEmit && npm run test:node && npm run test:browser",
|
|
163
161
|
};
|
|
164
162
|
}
|
|
165
|
-
|
|
166
|
-
function getMetadataInfo(config: AzureMonorepoInfoConfig) {
|
|
167
|
-
const metadata: Record<string, any> = {
|
|
168
|
-
constantPaths: [],
|
|
169
|
-
};
|
|
170
|
-
const paths = config.clientContextPaths;
|
|
171
|
-
for (const path of paths ?? []) {
|
|
172
|
-
metadata["constantPaths"].push({
|
|
173
|
-
path: path,
|
|
174
|
-
prefix: "userAgentInfo",
|
|
175
|
-
});
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
return metadata;
|
|
179
|
-
}
|
|
@@ -45,26 +45,11 @@ function getEntryPointInformation(config: PackageCommonInfoConfig) {
|
|
|
45
45
|
module: "./dist/esm/index.js",
|
|
46
46
|
types: "./dist/commonjs/index.d.ts",
|
|
47
47
|
browser: "./dist/browser/index.js",
|
|
48
|
-
imports: {
|
|
49
|
-
"#platform/*": {
|
|
50
|
-
browser: "./src/*-browser.mts",
|
|
51
|
-
default: "./src/*.ts",
|
|
52
|
-
} as Record<string, string>,
|
|
53
|
-
},
|
|
54
48
|
exports: resolveWarpExports(config.exports, config.generateReactNativeTarget),
|
|
55
49
|
};
|
|
56
50
|
|
|
57
51
|
if (config.generateReactNativeTarget) {
|
|
58
52
|
result["react-native"] = "./dist/react-native/index.js";
|
|
59
|
-
(result["imports"]["#platform/*"] as Record<string, string>)["react-native"] =
|
|
60
|
-
"./src/*-react-native.mts";
|
|
61
|
-
// Reorder so react-native comes before default
|
|
62
|
-
const importsEntry = result["imports"]["#platform/*"] as Record<string, string>;
|
|
63
|
-
result["imports"]["#platform/*"] = {
|
|
64
|
-
browser: importsEntry["browser"],
|
|
65
|
-
"react-native": importsEntry["react-native"],
|
|
66
|
-
default: importsEntry["default"],
|
|
67
|
-
};
|
|
68
53
|
}
|
|
69
54
|
|
|
70
55
|
return result;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ClientModel } from "../../interfaces.js";
|
|
1
|
+
import type { ClientModel } from "../../interfaces.js";
|
|
2
2
|
import { getClientName } from "../../utils/name-constructors.js";
|
|
3
3
|
import { renderTemplate } from "../render-template.js";
|
|
4
4
|
import { snippetsContent } from "./template.js";
|
package/src/metadata/utils.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import { ClientModel } from "../interfaces.js";
|
|
4
|
+
import type { ClientModel } from "../interfaces.js";
|
|
5
5
|
|
|
6
6
|
export function getPackageName(model: ClientModel): string {
|
|
7
7
|
return model.options?.packageDetails?.name ?? model.libraryName;
|
|
@@ -1,26 +1,26 @@
|
|
|
1
1
|
import {
|
|
2
2
|
ClassDeclaration,
|
|
3
|
-
MethodDeclarationStructure,
|
|
3
|
+
type MethodDeclarationStructure,
|
|
4
4
|
Scope,
|
|
5
5
|
SourceFile,
|
|
6
6
|
StructureKind,
|
|
7
7
|
} from "ts-morph";
|
|
8
8
|
import { getClientParametersDeclaration } from "./helpers/client-helpers.js";
|
|
9
9
|
import { getClassicalClientName, getClientName } from "./helpers/naming-helpers.js";
|
|
10
|
-
import { ModularEmitterOptions } from "./interfaces.js";
|
|
10
|
+
import type { ModularEmitterOptions } from "./interfaces.js";
|
|
11
11
|
|
|
12
12
|
import {
|
|
13
13
|
InitializedByFlags,
|
|
14
|
-
SdkClientType,
|
|
15
|
-
SdkServiceMethod,
|
|
16
|
-
SdkServiceOperation,
|
|
14
|
+
type SdkClientType,
|
|
15
|
+
type SdkServiceMethod,
|
|
16
|
+
type SdkServiceOperation,
|
|
17
17
|
} from "@azure-tools/typespec-client-generator-core";
|
|
18
18
|
import { useContext } from "../context-manager.js";
|
|
19
19
|
import { useDependencies } from "../framework/hooks/use-dependencies.js";
|
|
20
20
|
import { resolveReference } from "../framework/reference.js";
|
|
21
21
|
import { refkey } from "../framework/refkey.js";
|
|
22
22
|
import { getClientModuleInfo, isMultiEndpointClient } from "../utils/client-utils.js";
|
|
23
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
23
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
24
24
|
import { NameType, normalizeName } from "../utils/name-utils.js";
|
|
25
25
|
import { getMethodHierarchiesMap, isTenantLevelOperation } from "../utils/operation-util.js";
|
|
26
26
|
import { AzurePollingDependencies } from "./external-dependencies.js";
|
|
@@ -1,13 +1,16 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
|
+
SdkClientType,
|
|
3
|
+
SdkServiceOperation,
|
|
4
|
+
} from "@azure-tools/typespec-client-generator-core";
|
|
2
5
|
import { SourceFile } from "ts-morph";
|
|
3
6
|
import { useContext } from "../context-manager.js";
|
|
4
7
|
import { getClientModuleInfo } from "../utils/client-utils.js";
|
|
5
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
8
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
6
9
|
import { NameType } from "../utils/name-utils.js";
|
|
7
10
|
import { getMethodHierarchiesMap } from "../utils/operation-util.js";
|
|
8
11
|
import { getClassicalOperation } from "./helpers/classical-operation-helpers.js";
|
|
9
12
|
import { getClassicalLayerPrefix } from "./helpers/naming-helpers.js";
|
|
10
|
-
import { ModularEmitterOptions } from "./interfaces.js";
|
|
13
|
+
import type { ModularEmitterOptions } from "./interfaces.js";
|
|
11
14
|
|
|
12
15
|
export function buildClassicOperationFiles(
|
|
13
16
|
dpgContext: SdkContext,
|
|
@@ -6,9 +6,9 @@ import {
|
|
|
6
6
|
getClientParameters,
|
|
7
7
|
getClientParametersDeclaration,
|
|
8
8
|
} from "./helpers/client-helpers.js";
|
|
9
|
-
import { ModularEmitterOptions } from "./interfaces.js";
|
|
9
|
+
import type { ModularEmitterOptions } from "./interfaces.js";
|
|
10
10
|
|
|
11
|
-
import {
|
|
11
|
+
import type {
|
|
12
12
|
SdkClientType,
|
|
13
13
|
SdkCredentialParameter,
|
|
14
14
|
SdkEndpointParameter,
|
|
@@ -24,7 +24,7 @@ import { resolveReference } from "../framework/reference.js";
|
|
|
24
24
|
import { refkey } from "../framework/refkey.js";
|
|
25
25
|
import { reportDiagnostic } from "../lib.js";
|
|
26
26
|
import { getClientModuleInfo } from "../utils/client-utils.js";
|
|
27
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
27
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
28
28
|
import { NameType, normalizeName } from "../utils/name-utils.js";
|
|
29
29
|
import { buildEnumTypes, getApiVersionEnum } from "./emit-models.js";
|
|
30
30
|
import { getDocsFromDescription } from "./helpers/docs-helpers.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
2
|
-
import { ModularEmitterOptions } from "./interfaces.js";
|
|
1
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
2
|
+
import type { ModularEmitterOptions } from "./interfaces.js";
|
|
3
3
|
|
|
4
4
|
let CASING: "camel" | "snake" = "snake";
|
|
5
5
|
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { InterfaceDeclarationStructure, SourceFile, StructureKind } from "ts-morph";
|
|
1
|
+
import { type InterfaceDeclarationStructure, SourceFile, StructureKind } from "ts-morph";
|
|
2
2
|
import {
|
|
3
3
|
getDeserializeExceptionHeadersPrivateFunction,
|
|
4
4
|
getDeserializeHeadersPrivateFunction,
|
|
@@ -10,9 +10,9 @@ import {
|
|
|
10
10
|
isLroAndPagingOperation,
|
|
11
11
|
isLroOnlyOperation,
|
|
12
12
|
} from "./helpers/operation-helpers.js";
|
|
13
|
-
import { ModularEmitterOptions } from "./interfaces.js";
|
|
13
|
+
import type { ModularEmitterOptions } from "./interfaces.js";
|
|
14
14
|
|
|
15
|
-
import {
|
|
15
|
+
import type {
|
|
16
16
|
SdkClientType,
|
|
17
17
|
SdkMethodParameter,
|
|
18
18
|
SdkServiceOperation,
|
|
@@ -23,16 +23,16 @@ import { useDependencies } from "../framework/hooks/use-dependencies.js";
|
|
|
23
23
|
import { resolveReference } from "../framework/reference.js";
|
|
24
24
|
import { refkey } from "../framework/refkey.js";
|
|
25
25
|
import { getClientModuleInfo, isMultiEndpointClient } from "../utils/client-utils.js";
|
|
26
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
26
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
27
27
|
import { NameType, normalizeName } from "../utils/name-utils.js";
|
|
28
28
|
import {
|
|
29
29
|
getMethodHierarchiesMap,
|
|
30
30
|
hasDualFormatSupport,
|
|
31
|
-
ServiceOperation,
|
|
31
|
+
type ServiceOperation,
|
|
32
32
|
} from "../utils/operation-util.js";
|
|
33
33
|
import { getDocsFromDescription } from "./helpers/docs-helpers.js";
|
|
34
34
|
import { getOperationName } from "./helpers/naming-helpers.js";
|
|
35
|
-
import { OperationPathAndDeserDetails } from "./interfaces.js";
|
|
35
|
+
import type { OperationPathAndDeserDetails } from "./interfaces.js";
|
|
36
36
|
import { getTypeExpression } from "./type-expressions/get-type-expression.js";
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -83,10 +83,13 @@ export function buildOperationFiles(
|
|
|
83
83
|
prefixes,
|
|
84
84
|
op,
|
|
85
85
|
]);
|
|
86
|
-
const deserializeHeadersDeclaration = getDeserializeHeadersPrivateFunction(dpgContext,
|
|
86
|
+
const deserializeHeadersDeclaration = getDeserializeHeadersPrivateFunction(dpgContext, [
|
|
87
|
+
prefixes,
|
|
88
|
+
op,
|
|
89
|
+
]);
|
|
87
90
|
const deserializeExceptionHeadersDeclaration = getDeserializeExceptionHeadersPrivateFunction(
|
|
88
91
|
dpgContext,
|
|
89
|
-
op,
|
|
92
|
+
[prefixes, op],
|
|
90
93
|
);
|
|
91
94
|
const functionsToAdd = [sendOperationDeclaration, deserializeOperationDeclaration];
|
|
92
95
|
if (deserializeHeadersDeclaration) {
|
|
@@ -224,7 +227,7 @@ export function buildLroDeserDetailMap(
|
|
|
224
227
|
map.set(
|
|
225
228
|
`./api/${operationFileName}.js`,
|
|
226
229
|
lroOperations.map((o) => {
|
|
227
|
-
const { name } = getOperationName(o);
|
|
230
|
+
const { name } = getOperationName(o, context, prefixes);
|
|
228
231
|
const deserName = `_${name}Deserialize`;
|
|
229
232
|
let renamedDeserName = undefined;
|
|
230
233
|
if (existingNames.has(deserName)) {
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
import { getRelativePathFromDirectory, joinPaths } from "@typespec/compiler";
|
|
2
2
|
import { useContext } from "../context-manager.js";
|
|
3
3
|
import { getClientHierarchyMap, getClientModuleInfo } from "../utils/client-utils.js";
|
|
4
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
4
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
5
5
|
import { NameType } from "../utils/name-utils.js";
|
|
6
6
|
import { getMethodHierarchiesMap } from "../utils/operation-util.js";
|
|
7
7
|
import { getClassicalLayerPrefix } from "./helpers/naming-helpers.js";
|
|
8
|
-
import { ModularEmitterOptions } from "./interfaces.js";
|
|
8
|
+
import type { ModularEmitterOptions } from "./interfaces.js";
|
|
9
9
|
|
|
10
10
|
/**
|
|
11
11
|
* Computes the relative path prefix (e.g. `./src` or `./src/generated`) from
|
|
@@ -1,18 +1,21 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
|
+
SdkClientType,
|
|
3
|
+
SdkServiceOperation,
|
|
4
|
+
} from "@azure-tools/typespec-client-generator-core";
|
|
2
5
|
import { joinPaths } from "@typespec/compiler";
|
|
3
6
|
import { SourceFile } from "ts-morph";
|
|
4
7
|
import { useContext } from "../context-manager.js";
|
|
5
8
|
import { useDependencies } from "../framework/hooks/use-dependencies.js";
|
|
6
9
|
import { resolveReference } from "../framework/reference.js";
|
|
7
10
|
import { getClientModuleInfo } from "../utils/client-utils.js";
|
|
8
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
11
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
9
12
|
import { NameType, normalizeName } from "../utils/name-utils.js";
|
|
10
13
|
import { getMethodHierarchiesMap } from "../utils/operation-util.js";
|
|
11
14
|
import { buildLroDeserDetailMap } from "./build-operations.js";
|
|
12
15
|
import { AzurePollingDependencies } from "./external-dependencies.js";
|
|
13
16
|
import { getClassicalClientName } from "./helpers/naming-helpers.js";
|
|
14
17
|
import { isLroOnlyOperation } from "./helpers/operation-helpers.js";
|
|
15
|
-
import { ModularEmitterOptions } from "./interfaces.js";
|
|
18
|
+
import type { ModularEmitterOptions } from "./interfaces.js";
|
|
16
19
|
import { PollingHelpers } from "./static-helpers-metadata.js";
|
|
17
20
|
|
|
18
21
|
export function buildRestorePoller(
|
|
@@ -1,4 +1,7 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type {
|
|
2
|
+
SdkClientType,
|
|
3
|
+
SdkServiceOperation,
|
|
4
|
+
} from "@azure-tools/typespec-client-generator-core";
|
|
2
5
|
import { joinPaths, NoTarget } from "@typespec/compiler";
|
|
3
6
|
import { Project, SourceFile, StructureKind } from "ts-morph";
|
|
4
7
|
import { useContext } from "../context-manager.js";
|
|
@@ -12,19 +15,15 @@ import {
|
|
|
12
15
|
} from "../framework/source-file-batch.js";
|
|
13
16
|
import { reportDiagnostic } from "../lib.js";
|
|
14
17
|
import { getClientModuleInfo } from "../utils/client-utils.js";
|
|
15
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
18
|
+
import type { SdkContext } from "../utils/interfaces.js";
|
|
16
19
|
import { NameType, normalizeName } from "../utils/name-utils.js";
|
|
17
20
|
import { getMethodHierarchiesMap } from "../utils/operation-util.js";
|
|
18
21
|
import { partitionAndEmitExports } from "./build-subpath-index.js";
|
|
22
|
+
import { AzureCoreDependencies } from "./external-dependencies.js";
|
|
19
23
|
import { getClassicalClientName } from "./helpers/naming-helpers.js";
|
|
20
24
|
import { isLroOnlyOperation } from "./helpers/operation-helpers.js";
|
|
21
|
-
import { ModularEmitterOptions } from "./interfaces.js";
|
|
22
|
-
import {
|
|
23
|
-
CloudSettingHelpers,
|
|
24
|
-
MultipartHelpers,
|
|
25
|
-
PagingHelpers,
|
|
26
|
-
PlatformTypeHelpers,
|
|
27
|
-
} from "./static-helpers-metadata.js";
|
|
25
|
+
import type { ModularEmitterOptions } from "./interfaces.js";
|
|
26
|
+
import { CloudSettingHelpers, MultipartHelpers, PagingHelpers } from "./static-helpers-metadata.js";
|
|
28
27
|
|
|
29
28
|
export function buildRootIndex(
|
|
30
29
|
context: SdkContext,
|
|
@@ -179,7 +178,7 @@ function exportFileContentsType(context: SdkContext, rootIndexFile: SourceFile)
|
|
|
179
178
|
rootIndexFile,
|
|
180
179
|
[
|
|
181
180
|
resolveReference(MultipartHelpers.FileContents),
|
|
182
|
-
resolveReference(
|
|
181
|
+
resolveReference(AzureCoreDependencies["NodeReadableStream"]),
|
|
183
182
|
],
|
|
184
183
|
true,
|
|
185
184
|
);
|