@azure-tools/typespec-ts 0.56.0-dev.1 → 0.56.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +1 -13
- package/dist/src/context-manager.d.ts +2 -2
- package/dist/src/context-manager.d.ts.map +1 -1
- package/dist/src/framework/declaration.d.ts.map +1 -1
- package/dist/src/framework/declaration.js +6 -20
- package/dist/src/framework/declaration.js.map +1 -1
- package/dist/src/framework/hooks/sdk-types.d.ts.map +1 -1
- package/dist/src/framework/hooks/sdk-types.js +1 -1
- package/dist/src/framework/hooks/sdk-types.js.map +1 -1
- package/dist/src/framework/source-file-batch.d.ts +35 -0
- package/dist/src/framework/source-file-batch.d.ts.map +1 -0
- package/dist/src/framework/source-file-batch.js +128 -0
- package/dist/src/framework/source-file-batch.js.map +1 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +63 -60
- package/dist/src/index.js.map +1 -1
- package/dist/src/{rlc-common/interfaces.d.ts → interfaces.d.ts} +12 -14
- package/dist/src/interfaces.d.ts.map +1 -0
- package/dist/src/interfaces.js.map +1 -0
- package/dist/src/lib.d.ts +2 -4
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +2 -12
- package/dist/src/lib.js.map +1 -1
- package/dist/src/meta-tree.d.ts +4 -4
- package/dist/src/meta-tree.d.ts.map +1 -1
- package/dist/src/metadata/build-api-extractor-config.d.ts +6 -0
- package/dist/src/metadata/build-api-extractor-config.d.ts.map +1 -0
- package/dist/src/metadata/build-api-extractor-config.js.map +1 -0
- package/dist/src/metadata/build-changelog-file.d.ts +6 -0
- package/dist/src/metadata/build-changelog-file.d.ts.map +1 -0
- package/dist/src/metadata/build-changelog-file.js.map +1 -0
- package/dist/src/metadata/build-es-lint-config.d.ts +6 -0
- package/dist/src/metadata/build-es-lint-config.d.ts.map +1 -0
- package/dist/src/metadata/build-es-lint-config.js.map +1 -0
- package/dist/src/metadata/build-license-file.d.ts.map +1 -0
- package/dist/src/metadata/build-license-file.js.map +1 -0
- package/dist/src/{rlc-common/metadata → metadata}/build-package-file.d.ts +3 -3
- package/dist/src/metadata/build-package-file.d.ts.map +1 -0
- package/dist/src/{rlc-common/metadata → metadata}/build-package-file.js +1 -1
- package/dist/src/metadata/build-package-file.js.map +1 -0
- package/dist/src/metadata/build-readme-file.d.ts +11 -0
- package/dist/src/metadata/build-readme-file.d.ts.map +1 -0
- package/dist/src/{rlc-common/metadata → metadata}/build-readme-file.js +16 -69
- package/dist/src/metadata/build-readme-file.js.map +1 -0
- package/dist/src/metadata/build-sample-env-file.d.ts +6 -0
- package/dist/src/metadata/build-sample-env-file.d.ts.map +1 -0
- package/dist/src/metadata/build-sample-env-file.js.map +1 -0
- package/dist/src/{rlc-common/metadata → metadata}/build-test-config.d.ts +3 -3
- package/dist/src/metadata/build-test-config.d.ts.map +1 -0
- package/dist/src/metadata/build-test-config.js.map +1 -0
- package/dist/src/{rlc-common/metadata → metadata}/build-ts-config.d.ts +3 -3
- package/dist/src/metadata/build-ts-config.d.ts.map +1 -0
- package/dist/src/metadata/build-ts-config.js.map +1 -0
- package/dist/src/metadata/build-vitest-config.d.ts +6 -0
- package/dist/src/metadata/build-vitest-config.d.ts.map +1 -0
- package/dist/src/metadata/build-vitest-config.js.map +1 -0
- package/dist/src/{rlc-common/metadata → metadata}/build-warp-config.d.ts +2 -2
- package/dist/src/metadata/build-warp-config.d.ts.map +1 -0
- package/dist/src/metadata/build-warp-config.js.map +1 -0
- package/dist/src/metadata/package-json/azure-package-common.d.ts.map +1 -0
- package/dist/src/metadata/package-json/azure-package-common.js.map +1 -0
- package/dist/src/metadata/package-json/build-azure-monorepo-package.d.ts.map +1 -0
- package/dist/src/metadata/package-json/build-azure-monorepo-package.js.map +1 -0
- package/dist/src/metadata/package-json/package-common.d.ts.map +1 -0
- package/dist/src/metadata/package-json/package-common.js.map +1 -0
- package/dist/src/metadata/render-template.d.ts +24 -0
- package/dist/src/metadata/render-template.d.ts.map +1 -0
- package/dist/src/metadata/render-template.js +148 -0
- package/dist/src/metadata/render-template.js.map +1 -0
- package/dist/src/metadata/test/build-recorded-client.d.ts +6 -0
- package/dist/src/metadata/test/build-recorded-client.d.ts.map +1 -0
- package/dist/src/metadata/test/build-recorded-client.js +8 -0
- package/dist/src/metadata/test/build-recorded-client.js.map +1 -0
- package/dist/src/metadata/test/build-sample-test.d.ts +6 -0
- package/dist/src/metadata/test/build-sample-test.d.ts.map +1 -0
- package/dist/src/metadata/test/build-sample-test.js +8 -0
- package/dist/src/metadata/test/build-sample-test.js.map +1 -0
- package/dist/src/metadata/test/build-snippets.d.ts +6 -0
- package/dist/src/metadata/test/build-snippets.d.ts.map +1 -0
- package/dist/src/{rlc-common → metadata}/test/build-snippets.js +3 -5
- package/dist/src/metadata/test/build-snippets.js.map +1 -0
- package/dist/src/metadata/test/template.d.ts +4 -0
- package/dist/src/metadata/test/template.d.ts.map +1 -0
- package/dist/src/metadata/test/template.js +100 -0
- package/dist/src/metadata/test/template.js.map +1 -0
- package/dist/src/metadata/utils.d.ts +3 -0
- package/dist/src/metadata/utils.d.ts.map +1 -0
- package/dist/src/metadata/utils.js.map +1 -0
- package/dist/src/modular/build-classical-client.d.ts.map +1 -1
- package/dist/src/modular/build-classical-client.js +9 -9
- package/dist/src/modular/build-classical-client.js.map +1 -1
- package/dist/src/modular/build-classical-operation-groups.d.ts.map +1 -1
- package/dist/src/modular/build-classical-operation-groups.js +3 -3
- package/dist/src/modular/build-classical-operation-groups.js.map +1 -1
- package/dist/src/modular/build-client-context.d.ts.map +1 -1
- package/dist/src/modular/build-client-context.js +7 -7
- package/dist/src/modular/build-client-context.js.map +1 -1
- package/dist/src/modular/build-modular-options.js +3 -3
- package/dist/src/modular/build-modular-options.js.map +1 -1
- package/dist/src/modular/build-operations.d.ts.map +1 -1
- package/dist/src/modular/build-operations.js +6 -6
- package/dist/src/modular/build-operations.js.map +1 -1
- package/dist/src/modular/build-project-files.d.ts.map +1 -1
- package/dist/src/modular/build-project-files.js +4 -4
- package/dist/src/modular/build-project-files.js.map +1 -1
- package/dist/src/modular/build-restore-poller.d.ts.map +1 -1
- package/dist/src/modular/build-restore-poller.js +3 -3
- package/dist/src/modular/build-restore-poller.js.map +1 -1
- package/dist/src/modular/build-root-index.d.ts.map +1 -1
- package/dist/src/modular/build-root-index.js +42 -14
- package/dist/src/modular/build-root-index.js.map +1 -1
- package/dist/src/modular/build-subpath-index.d.ts.map +1 -1
- package/dist/src/modular/build-subpath-index.js +17 -4
- package/dist/src/modular/build-subpath-index.js.map +1 -1
- package/dist/src/modular/emit-models-options.d.ts.map +1 -1
- package/dist/src/modular/emit-models-options.js +3 -3
- package/dist/src/modular/emit-models-options.js.map +1 -1
- package/dist/src/modular/emit-models.d.ts +1 -1
- package/dist/src/modular/emit-models.d.ts.map +1 -1
- package/dist/src/modular/emit-models.js +32 -25
- package/dist/src/modular/emit-models.js.map +1 -1
- package/dist/src/modular/emit-samples.d.ts.map +1 -1
- package/dist/src/modular/emit-samples.js +5 -5
- package/dist/src/modular/emit-samples.js.map +1 -1
- package/dist/src/modular/emit-tests.d.ts.map +1 -1
- package/dist/src/modular/emit-tests.js +1 -1
- package/dist/src/modular/emit-tests.js.map +1 -1
- package/dist/src/modular/helpers/classical-operation-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/classical-operation-helpers.js +11 -11
- package/dist/src/modular/helpers/classical-operation-helpers.js.map +1 -1
- package/dist/src/modular/helpers/client-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/client-helpers.js +3 -3
- package/dist/src/modular/helpers/client-helpers.js.map +1 -1
- package/dist/src/modular/helpers/example-value-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/example-value-helpers.js +2 -2
- package/dist/src/modular/helpers/example-value-helpers.js.map +1 -1
- package/dist/src/modular/helpers/naming-helpers.d.ts +1 -1
- package/dist/src/modular/helpers/naming-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/naming-helpers.js +2 -2
- package/dist/src/modular/helpers/naming-helpers.js.map +1 -1
- package/dist/src/modular/helpers/operation-helpers.d.ts +4 -4
- package/dist/src/modular/helpers/operation-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operation-helpers.js +25 -26
- package/dist/src/modular/helpers/operation-helpers.js.map +1 -1
- package/dist/src/modular/helpers/type-helpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/type-helpers.js +1 -1
- package/dist/src/modular/helpers/type-helpers.js.map +1 -1
- package/dist/src/modular/interfaces.d.ts +4 -4
- package/dist/src/modular/interfaces.d.ts.map +1 -1
- package/dist/src/modular/serialization/build-deserializer-function.d.ts.map +1 -1
- package/dist/src/modular/serialization/build-deserializer-function.js +2 -2
- package/dist/src/modular/serialization/build-deserializer-function.js.map +1 -1
- package/dist/src/modular/serialization/build-serializer-function.d.ts.map +1 -1
- package/dist/src/modular/serialization/build-serializer-function.js +2 -2
- package/dist/src/modular/serialization/build-serializer-function.js.map +1 -1
- package/dist/src/modular/serialization/build-xml-serializer-function.d.ts.map +1 -1
- package/dist/src/modular/serialization/build-xml-serializer-function.js +1 -1
- package/dist/src/modular/serialization/build-xml-serializer-function.js.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.js +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.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.js +3 -3
- package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
- package/dist/src/transform/transform-api-version-info.d.ts +1 -1
- package/dist/src/transform/transform-api-version-info.d.ts.map +1 -1
- package/dist/src/transform/transform-api-version-info.js +4 -3
- package/dist/src/transform/transform-api-version-info.js.map +1 -1
- package/dist/src/transform/{transfrom-rlc-options.d.ts → transform-client-options.d.ts} +3 -3
- package/dist/src/transform/transform-client-options.d.ts.map +1 -0
- package/dist/src/transform/{transfrom-rlc-options.js → transform-client-options.js} +9 -13
- package/dist/src/transform/transform-client-options.js.map +1 -0
- package/dist/src/transform/transform-helper-function-details.d.ts +1 -1
- package/dist/src/transform/transform-helper-function-details.d.ts.map +1 -1
- package/dist/src/transform/transform-helper-function-details.js +4 -4
- package/dist/src/transform/transform-helper-function-details.js.map +1 -1
- package/dist/src/transform/transform-parameters.d.ts +1 -1
- package/dist/src/transform/transform-parameters.d.ts.map +1 -1
- package/dist/src/transform/transform-parameters.js +11 -11
- package/dist/src/transform/transform-parameters.js.map +1 -1
- package/dist/src/transform/transform-paths.d.ts +1 -1
- package/dist/src/transform/transform-paths.d.ts.map +1 -1
- package/dist/src/transform/transform-paths.js +5 -4
- package/dist/src/transform/transform-paths.js.map +1 -1
- package/dist/src/transform/transform-responses.d.ts +1 -1
- package/dist/src/transform/transform-responses.d.ts.map +1 -1
- package/dist/src/transform/transform-responses.js +19 -18
- package/dist/src/transform/transform-responses.js.map +1 -1
- package/dist/src/transform/transform-schemas.js +5 -5
- package/dist/src/transform/transform-schemas.js.map +1 -1
- package/dist/src/transform/transform-telemetry-info.d.ts +1 -1
- package/dist/src/transform/transform-telemetry-info.d.ts.map +1 -1
- package/dist/src/transform/transform-telemetry-info.js +2 -2
- package/dist/src/transform/transform-telemetry-info.js.map +1 -1
- package/dist/src/transform/transform.d.ts +2 -2
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/transform/transform.js +9 -10
- package/dist/src/transform/transform.js.map +1 -1
- package/dist/src/utils/api-version-util.d.ts.map +1 -0
- package/dist/src/utils/api-version-util.js.map +1 -0
- package/dist/src/utils/client-utils.d.ts +5 -5
- package/dist/src/utils/client-utils.d.ts.map +1 -1
- package/dist/src/utils/client-utils.js +10 -10
- package/dist/src/utils/client-utils.js.map +1 -1
- package/dist/src/utils/cross-language-def.d.ts.map +1 -1
- package/dist/src/utils/cross-language-def.js +3 -3
- package/dist/src/utils/cross-language-def.js.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/imports-util.d.ts.map +1 -0
- package/dist/src/{rlc-common/helpers → utils}/imports-util.js +6 -6
- package/dist/src/utils/imports-util.js.map +1 -0
- package/dist/src/utils/interfaces.d.ts +3 -4
- package/dist/src/utils/interfaces.d.ts.map +1 -1
- package/dist/src/utils/model-utils.d.ts +1 -1
- package/dist/src/utils/model-utils.d.ts.map +1 -1
- package/dist/src/utils/model-utils.js +4 -2
- package/dist/src/utils/model-utils.js.map +1 -1
- package/dist/src/{rlc-common/helpers → utils}/name-constructors.d.ts +2 -2
- package/dist/src/utils/name-constructors.d.ts.map +1 -0
- package/dist/src/utils/name-constructors.js.map +1 -0
- package/dist/src/utils/name-utils.d.ts.map +1 -0
- package/dist/src/utils/name-utils.js.map +1 -0
- package/dist/src/utils/namespace-utils.js +4 -4
- package/dist/src/utils/namespace-utils.js.map +1 -1
- package/dist/src/utils/operation-helpers.d.ts +16 -0
- package/dist/src/utils/operation-helpers.d.ts.map +1 -0
- package/dist/src/utils/operation-helpers.js.map +1 -0
- package/dist/src/utils/operation-util.d.ts +2 -2
- package/dist/src/utils/operation-util.d.ts.map +1 -1
- package/dist/src/utils/operation-util.js +17 -18
- package/dist/src/utils/operation-util.js.map +1 -1
- package/dist/src/utils/parameter-utils.d.ts +1 -1
- package/dist/src/utils/parameter-utils.d.ts.map +1 -1
- package/dist/src/utils/parameter-utils.js +2 -4
- package/dist/src/utils/parameter-utils.js.map +1 -1
- package/dist/src/{rlc-common/helpers → utils}/schema-helpers.d.ts +2 -2
- package/dist/src/utils/schema-helpers.d.ts.map +1 -0
- package/dist/src/utils/schema-helpers.js.map +1 -0
- package/dist/src/utils/type-util.d.ts.map +1 -0
- package/dist/src/utils/type-util.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +14 -24
- package/src/context-manager.ts +2 -2
- package/src/framework/declaration.ts +8 -20
- package/src/framework/hooks/sdk-types.ts +1 -1
- package/src/framework/source-file-batch.ts +140 -0
- package/src/index.ts +81 -101
- package/src/{rlc-common/interfaces.ts → interfaces.ts} +14 -16
- package/src/lib.ts +3 -16
- package/src/meta-tree.ts +4 -4
- package/src/{rlc-common/metadata → metadata}/build-api-extractor-config.ts +2 -2
- package/src/{rlc-common/metadata → metadata}/build-changelog-file.ts +3 -3
- package/src/{rlc-common/metadata → metadata}/build-es-lint-config.ts +2 -2
- package/src/{rlc-common/metadata → metadata}/build-package-file.ts +6 -6
- package/src/{rlc-common/metadata → metadata}/build-readme-file.ts +25 -99
- package/src/{rlc-common/metadata → metadata}/build-sample-env-file.ts +2 -2
- package/src/{rlc-common/metadata → metadata}/build-test-config.ts +4 -4
- package/src/{rlc-common/metadata → metadata}/build-ts-config.ts +3 -3
- package/src/{rlc-common/metadata → metadata}/build-vitest-config.ts +2 -2
- package/src/{rlc-common/metadata → metadata}/build-warp-config.ts +2 -2
- package/src/metadata/render-template.ts +202 -0
- package/src/metadata/test/build-recorded-client.ts +9 -0
- package/src/metadata/test/build-sample-test.ts +9 -0
- package/src/{rlc-common → metadata}/test/build-snippets.ts +5 -7
- package/src/metadata/test/template.ts +101 -0
- package/src/{rlc-common/metadata → metadata}/utils.ts +2 -2
- package/src/modular/build-classical-client.ts +9 -9
- package/src/modular/build-classical-operation-groups.ts +3 -3
- package/src/modular/build-client-context.ts +7 -7
- package/src/modular/build-modular-options.ts +3 -3
- package/src/modular/build-operations.ts +6 -6
- package/src/modular/build-project-files.ts +4 -5
- package/src/modular/build-restore-poller.ts +3 -3
- package/src/modular/build-root-index.ts +57 -19
- package/src/modular/build-subpath-index.ts +26 -5
- package/src/modular/emit-models-options.ts +3 -3
- package/src/modular/emit-models.ts +32 -26
- package/src/modular/emit-samples.ts +5 -5
- package/src/modular/emit-tests.ts +1 -1
- package/src/modular/helpers/classical-operation-helpers.ts +11 -11
- package/src/modular/helpers/client-helpers.ts +3 -3
- package/src/modular/helpers/example-value-helpers.ts +2 -2
- package/src/modular/helpers/naming-helpers.ts +2 -2
- package/src/modular/helpers/operation-helpers.ts +27 -27
- package/src/modular/helpers/type-helpers.ts +1 -1
- package/src/modular/interfaces.ts +4 -4
- package/src/modular/serialization/build-deserializer-function.ts +2 -2
- package/src/modular/serialization/build-serializer-function.ts +2 -2
- package/src/modular/serialization/build-xml-serializer-function.ts +1 -1
- package/src/modular/type-expressions/get-enum-expression.ts +1 -1
- package/src/modular/type-expressions/get-nullable-expression.ts +1 -1
- package/src/modular/type-expressions/get-type-expression.ts +3 -3
- package/src/transform/transform-api-version-info.ts +4 -10
- package/src/transform/{transfrom-rlc-options.ts → transform-client-options.ts} +12 -22
- package/src/transform/transform-helper-function-details.ts +5 -5
- package/src/transform/transform-parameters.ts +12 -12
- package/src/transform/transform-paths.ts +5 -12
- package/src/transform/transform-responses.ts +19 -19
- package/src/transform/transform-schemas.ts +5 -5
- package/src/transform/transform-telemetry-info.ts +3 -3
- package/src/transform/transform.ts +13 -18
- package/src/utils/client-utils.ts +11 -11
- package/src/utils/cross-language-def.ts +3 -3
- package/src/utils/emit-util.ts +3 -3
- package/src/{rlc-common/helpers → utils}/imports-util.ts +6 -6
- package/src/utils/interfaces.ts +3 -4
- package/src/utils/model-utils.ts +7 -8
- package/src/{rlc-common/helpers → utils}/name-constructors.ts +2 -2
- package/src/utils/namespace-utils.ts +4 -4
- package/src/{rlc-common/helpers → utils}/operation-helpers.ts +12 -12
- package/src/utils/operation-util.ts +19 -33
- package/src/utils/parameter-utils.ts +2 -4
- package/src/{rlc-common/helpers → utils}/schema-helpers.ts +2 -2
- package/dist/src/rlc-common/helpers/api-version-util.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/api-version-util.js.map +0 -1
- package/dist/src/rlc-common/helpers/imports-util.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/imports-util.js.map +0 -1
- package/dist/src/rlc-common/helpers/name-constructors.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/name-constructors.js.map +0 -1
- package/dist/src/rlc-common/helpers/name-utils.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/name-utils.js.map +0 -1
- package/dist/src/rlc-common/helpers/operation-helpers.d.ts +0 -16
- package/dist/src/rlc-common/helpers/operation-helpers.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/operation-helpers.js.map +0 -1
- package/dist/src/rlc-common/helpers/schema-helpers.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/schema-helpers.js.map +0 -1
- package/dist/src/rlc-common/helpers/type-util.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/type-util.js.map +0 -1
- package/dist/src/rlc-common/index.d.ts +0 -23
- package/dist/src/rlc-common/index.d.ts.map +0 -1
- package/dist/src/rlc-common/index.js +0 -25
- package/dist/src/rlc-common/index.js.map +0 -1
- package/dist/src/rlc-common/interfaces.d.ts.map +0 -1
- package/dist/src/rlc-common/interfaces.js.map +0 -1
- package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts +0 -6
- package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/build-api-extractor-config.js.map +0 -1
- package/dist/src/rlc-common/metadata/build-changelog-file.d.ts +0 -6
- package/dist/src/rlc-common/metadata/build-changelog-file.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/build-changelog-file.js.map +0 -1
- package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts +0 -6
- package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/build-es-lint-config.js.map +0 -1
- package/dist/src/rlc-common/metadata/build-license-file.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/build-license-file.js.map +0 -1
- package/dist/src/rlc-common/metadata/build-package-file.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/build-package-file.js.map +0 -1
- package/dist/src/rlc-common/metadata/build-readme-file.d.ts +0 -11
- package/dist/src/rlc-common/metadata/build-readme-file.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/build-readme-file.js.map +0 -1
- package/dist/src/rlc-common/metadata/build-sample-env-file.d.ts +0 -6
- package/dist/src/rlc-common/metadata/build-sample-env-file.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/build-sample-env-file.js.map +0 -1
- package/dist/src/rlc-common/metadata/build-test-config.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/build-test-config.js.map +0 -1
- package/dist/src/rlc-common/metadata/build-ts-config.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/build-ts-config.js.map +0 -1
- package/dist/src/rlc-common/metadata/build-vitest-config.d.ts +0 -6
- package/dist/src/rlc-common/metadata/build-vitest-config.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/build-vitest-config.js.map +0 -1
- package/dist/src/rlc-common/metadata/build-warp-config.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/build-warp-config.js.map +0 -1
- package/dist/src/rlc-common/metadata/package-json/azure-package-common.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/package-json/azure-package-common.js.map +0 -1
- package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js.map +0 -1
- package/dist/src/rlc-common/metadata/package-json/package-common.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/package-json/package-common.js.map +0 -1
- package/dist/src/rlc-common/metadata/utils.d.ts +0 -3
- package/dist/src/rlc-common/metadata/utils.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/utils.js.map +0 -1
- package/dist/src/rlc-common/static/paginate-content.d.ts +0 -2
- package/dist/src/rlc-common/static/paginate-content.d.ts.map +0 -1
- package/dist/src/rlc-common/static/paginate-content.js +0 -345
- package/dist/src/rlc-common/static/paginate-content.js.map +0 -1
- package/dist/src/rlc-common/static/polling-content.d.ts +0 -2
- package/dist/src/rlc-common/static/polling-content.d.ts.map +0 -1
- package/dist/src/rlc-common/static/polling-content.js +0 -225
- package/dist/src/rlc-common/static/polling-content.js.map +0 -1
- package/dist/src/rlc-common/static/sample-template.d.ts +0 -2
- package/dist/src/rlc-common/static/sample-template.d.ts.map +0 -1
- package/dist/src/rlc-common/static/sample-template.js +0 -56
- package/dist/src/rlc-common/static/sample-template.js.map +0 -1
- package/dist/src/rlc-common/static/serialize-helper.d.ts +0 -6
- package/dist/src/rlc-common/static/serialize-helper.d.ts.map +0 -1
- package/dist/src/rlc-common/static/serialize-helper.js +0 -31
- package/dist/src/rlc-common/static/serialize-helper.js.map +0 -1
- package/dist/src/rlc-common/test/build-karma-config.d.ts +0 -6
- package/dist/src/rlc-common/test/build-karma-config.d.ts.map +0 -1
- package/dist/src/rlc-common/test/build-karma-config.js +0 -11
- package/dist/src/rlc-common/test/build-karma-config.js.map +0 -1
- package/dist/src/rlc-common/test/build-recorded-client.d.ts +0 -6
- package/dist/src/rlc-common/test/build-recorded-client.d.ts.map +0 -1
- package/dist/src/rlc-common/test/build-recorded-client.js +0 -14
- package/dist/src/rlc-common/test/build-recorded-client.js.map +0 -1
- package/dist/src/rlc-common/test/build-sample-test.d.ts +0 -6
- package/dist/src/rlc-common/test/build-sample-test.d.ts.map +0 -1
- package/dist/src/rlc-common/test/build-sample-test.js +0 -11
- package/dist/src/rlc-common/test/build-sample-test.js.map +0 -1
- package/dist/src/rlc-common/test/build-snippets.d.ts +0 -6
- package/dist/src/rlc-common/test/build-snippets.d.ts.map +0 -1
- package/dist/src/rlc-common/test/build-snippets.js.map +0 -1
- package/dist/src/rlc-common/test/template.d.ts +0 -5
- package/dist/src/rlc-common/test/template.d.ts.map +0 -1
- package/dist/src/rlc-common/test/template.js +0 -227
- package/dist/src/rlc-common/test/template.js.map +0 -1
- package/dist/src/transform/transfrom-rlc-options.d.ts.map +0 -1
- package/dist/src/transform/transfrom-rlc-options.js.map +0 -1
- package/src/rlc-common/index.ts +0 -25
- package/src/rlc-common/static/paginate-content.ts +0 -345
- package/src/rlc-common/static/polling-content.ts +0 -225
- package/src/rlc-common/static/sample-template.ts +0 -56
- package/src/rlc-common/static/serialize-helper.ts +0 -34
- package/src/rlc-common/test/build-karma-config.ts +0 -12
- package/src/rlc-common/test/build-recorded-client.ts +0 -15
- package/src/rlc-common/test/build-sample-test.ts +0 -12
- package/src/rlc-common/test/template.ts +0 -229
- /package/dist/src/{rlc-common/interfaces.js → interfaces.js} +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/build-api-extractor-config.js +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/build-changelog-file.js +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/build-es-lint-config.js +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/build-license-file.d.ts +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/build-license-file.js +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/build-sample-env-file.js +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/build-test-config.js +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/build-ts-config.js +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/build-vitest-config.js +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/build-warp-config.js +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/package-json/azure-package-common.d.ts +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/package-json/azure-package-common.js +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/package-json/build-azure-monorepo-package.d.ts +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/package-json/build-azure-monorepo-package.js +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/package-json/package-common.d.ts +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/package-json/package-common.js +0 -0
- /package/dist/src/{rlc-common/metadata → metadata}/utils.js +0 -0
- /package/dist/src/{rlc-common/helpers → utils}/api-version-util.d.ts +0 -0
- /package/dist/src/{rlc-common/helpers → utils}/api-version-util.js +0 -0
- /package/dist/src/{rlc-common/helpers → utils}/imports-util.d.ts +0 -0
- /package/dist/src/{rlc-common/helpers → utils}/name-constructors.js +0 -0
- /package/dist/src/{rlc-common/helpers → utils}/name-utils.d.ts +0 -0
- /package/dist/src/{rlc-common/helpers → utils}/name-utils.js +0 -0
- /package/dist/src/{rlc-common/helpers → utils}/operation-helpers.js +0 -0
- /package/dist/src/{rlc-common/helpers → utils}/schema-helpers.js +0 -0
- /package/dist/src/{rlc-common/helpers → utils}/type-util.d.ts +0 -0
- /package/dist/src/{rlc-common/helpers → utils}/type-util.js +0 -0
- /package/src/{rlc-common/metadata → metadata}/build-license-file.ts +0 -0
- /package/src/{rlc-common/metadata → metadata}/package-json/azure-package-common.ts +0 -0
- /package/src/{rlc-common/metadata → metadata}/package-json/build-azure-monorepo-package.ts +0 -0
- /package/src/{rlc-common/metadata → metadata}/package-json/package-common.ts +0 -0
- /package/src/{rlc-common/helpers → utils}/api-version-util.ts +0 -0
- /package/src/{rlc-common/helpers → utils}/name-utils.ts +0 -0
- /package/src/{rlc-common/helpers → utils}/type-util.ts +0 -0
|
@@ -5,15 +5,14 @@ import { getHttpOperationWithCache, SdkClient } from "@azure-tools/typespec-clie
|
|
|
5
5
|
import { getDoc, isVoidType } from "@typespec/compiler";
|
|
6
6
|
import { HttpOperation, HttpOperationResponse } from "@typespec/http";
|
|
7
7
|
import {
|
|
8
|
-
getLroLogicalResponseName,
|
|
9
8
|
Imports,
|
|
10
9
|
OperationResponse,
|
|
11
10
|
ResponseHeaderSchema,
|
|
12
11
|
ResponseMetadata,
|
|
13
12
|
Schema,
|
|
14
13
|
SchemaContext,
|
|
15
|
-
} from "../
|
|
16
|
-
import {
|
|
14
|
+
} from "../interfaces.js";
|
|
15
|
+
import { listOperationsUnderClient } from "../utils/client-utils.js";
|
|
17
16
|
import { SdkContext } from "../utils/interfaces.js";
|
|
18
17
|
import {
|
|
19
18
|
getBinaryType,
|
|
@@ -21,6 +20,7 @@ import {
|
|
|
21
20
|
getSchemaForType,
|
|
22
21
|
getTypeName,
|
|
23
22
|
} from "../utils/model-utils.js";
|
|
23
|
+
import { getLroLogicalResponseName } from "../utils/name-constructors.js";
|
|
24
24
|
import {
|
|
25
25
|
getOperationGroupName,
|
|
26
26
|
getOperationLroOverload,
|
|
@@ -35,9 +35,9 @@ export function transformToResponseTypes(
|
|
|
35
35
|
dpgContext: SdkContext,
|
|
36
36
|
importDetails: Imports,
|
|
37
37
|
): OperationResponse[] {
|
|
38
|
-
const
|
|
38
|
+
const clientResponses: OperationResponse[] = [];
|
|
39
39
|
const inputImportedSet = new Set<string>();
|
|
40
|
-
for (const op of
|
|
40
|
+
for (const op of listOperationsUnderClient(client)) {
|
|
41
41
|
const route = getHttpOperationWithCache(dpgContext, op);
|
|
42
42
|
// ignore overload base operation
|
|
43
43
|
if (route.overloads && route.overloads?.length > 0) {
|
|
@@ -49,7 +49,7 @@ export function transformToResponseTypes(
|
|
|
49
49
|
importDetails.response.importsSet = inputImportedSet;
|
|
50
50
|
}
|
|
51
51
|
function transformToResponseTypesForRoute(route: HttpOperation) {
|
|
52
|
-
const
|
|
52
|
+
const operationUnit: OperationResponse = {
|
|
53
53
|
operationGroup: getOperationGroupName(dpgContext, route),
|
|
54
54
|
operationName: getOperationName(dpgContext, route.operation),
|
|
55
55
|
path: route.path,
|
|
@@ -59,7 +59,7 @@ export function transformToResponseTypes(
|
|
|
59
59
|
nonDefaultSchemas: Schema[] = [];
|
|
60
60
|
for (const resp of sortedOperationResponses(route.responses)) {
|
|
61
61
|
const statusCode = getOperationStatuscode(resp);
|
|
62
|
-
const
|
|
62
|
+
const responseUnit: ResponseMetadata = {
|
|
63
63
|
statusCode,
|
|
64
64
|
description: resp.description,
|
|
65
65
|
};
|
|
@@ -67,8 +67,8 @@ export function transformToResponseTypes(
|
|
|
67
67
|
const headers = transformHeaders(dpgContext, resp, inputImportedSet);
|
|
68
68
|
// transform body
|
|
69
69
|
const [body, schemas] = transformBody(dpgContext, resp, inputImportedSet) ?? [undefined, []];
|
|
70
|
-
|
|
71
|
-
...
|
|
70
|
+
operationUnit.responses.push({
|
|
71
|
+
...responseUnit,
|
|
72
72
|
headers,
|
|
73
73
|
body,
|
|
74
74
|
});
|
|
@@ -82,20 +82,20 @@ export function transformToResponseTypes(
|
|
|
82
82
|
dpgContext,
|
|
83
83
|
route,
|
|
84
84
|
getOperationGroupName(dpgContext, route),
|
|
85
|
-
|
|
85
|
+
operationUnit.responses,
|
|
86
86
|
);
|
|
87
87
|
if (lroLogicalResponse) {
|
|
88
|
-
|
|
88
|
+
operationUnit.responses.push(lroLogicalResponse);
|
|
89
89
|
}
|
|
90
|
-
|
|
90
|
+
clientResponses.push(operationUnit);
|
|
91
91
|
}
|
|
92
|
-
return
|
|
92
|
+
return clientResponses;
|
|
93
93
|
}
|
|
94
94
|
|
|
95
95
|
/**
|
|
96
96
|
* Return undefined if no valid header param
|
|
97
97
|
* @param response response detail
|
|
98
|
-
* @returns
|
|
98
|
+
* @returns the response header schema
|
|
99
99
|
*/
|
|
100
100
|
function transformHeaders(
|
|
101
101
|
dpgContext: SdkContext,
|
|
@@ -106,8 +106,8 @@ function transformHeaders(
|
|
|
106
106
|
return;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
const
|
|
110
|
-
//
|
|
109
|
+
const responseHeaders: Map<string, ResponseHeaderSchema> = new Map();
|
|
110
|
+
// The client can't represent different headers per content type.
|
|
111
111
|
// So we merge headers here, and report any duplicates.
|
|
112
112
|
// It may be possible in principle to not error for identically declared
|
|
113
113
|
// headers.
|
|
@@ -139,11 +139,11 @@ function transformHeaders(
|
|
|
139
139
|
required: !value?.optional,
|
|
140
140
|
description: getDoc(dpgContext.program, value!),
|
|
141
141
|
};
|
|
142
|
-
|
|
142
|
+
responseHeaders.set(header.name, header);
|
|
143
143
|
}
|
|
144
144
|
}
|
|
145
145
|
|
|
146
|
-
return
|
|
146
|
+
return responseHeaders.size ? Array.from(responseHeaders.values()) : undefined;
|
|
147
147
|
}
|
|
148
148
|
|
|
149
149
|
function transformBody(
|
|
@@ -154,7 +154,7 @@ function transformBody(
|
|
|
154
154
|
if (!response.responses.length) {
|
|
155
155
|
return;
|
|
156
156
|
}
|
|
157
|
-
// Currently
|
|
157
|
+
// Currently a response only has one header and body defined
|
|
158
158
|
// So we'll union all body shapes together with "|"
|
|
159
159
|
const typeSet = new Set<string>();
|
|
160
160
|
const descriptions = new Set<string>();
|
|
@@ -15,19 +15,19 @@ import {
|
|
|
15
15
|
} from "../utils/model-utils.js";
|
|
16
16
|
|
|
17
17
|
import { useContext } from "../context-manager.js";
|
|
18
|
-
import { SchemaContext } from "../
|
|
19
|
-
import {
|
|
18
|
+
import { SchemaContext } from "../interfaces.js";
|
|
19
|
+
import { listOperationsUnderClient } from "../utils/client-utils.js";
|
|
20
20
|
import { SdkContext } from "../utils/interfaces.js";
|
|
21
21
|
|
|
22
22
|
export function transformSchemas(client: SdkClient, dpgContext: SdkContext) {
|
|
23
23
|
const program = dpgContext.program;
|
|
24
|
-
const metatree = useContext("
|
|
24
|
+
const metatree = useContext("clientTypeMetaTree");
|
|
25
25
|
const schemas: Map<string, SchemaContext[]> = new Map<string, SchemaContext[]>();
|
|
26
26
|
const schemaMap: Map<any, any> = new Map<any, any>();
|
|
27
27
|
const usageMap = new Map<Type, SchemaContext[]>();
|
|
28
28
|
const requestBodySet = new Set<Type>();
|
|
29
29
|
const contentTypeMap = new Map<Type, KnownMediaType[]>();
|
|
30
|
-
for (const op of
|
|
30
|
+
for (const op of listOperationsUnderClient(client)) {
|
|
31
31
|
const route = getHttpOperationWithCache(dpgContext, op);
|
|
32
32
|
// ignore overload base operation
|
|
33
33
|
if (route.overloads && route.overloads?.length > 0) {
|
|
@@ -103,7 +103,7 @@ export function transformSchemas(client: SdkClient, dpgContext: SdkContext) {
|
|
|
103
103
|
if (model) {
|
|
104
104
|
model.usage = context;
|
|
105
105
|
}
|
|
106
|
-
metatree.set(tspModel, {
|
|
106
|
+
metatree.set(tspModel, { clientType: model });
|
|
107
107
|
if (model.name === "") {
|
|
108
108
|
return;
|
|
109
109
|
}
|
|
@@ -3,8 +3,8 @@ import {
|
|
|
3
3
|
SdkClient,
|
|
4
4
|
SdkContext,
|
|
5
5
|
} from "@azure-tools/typespec-client-generator-core";
|
|
6
|
-
import { TelemetryInfo } from "../
|
|
7
|
-
import {
|
|
6
|
+
import { TelemetryInfo } from "../interfaces.js";
|
|
7
|
+
import { listOperationsUnderClient } from "../utils/client-utils.js";
|
|
8
8
|
import { getCustomRequestHeaderNameForOperation } from "../utils/operation-util.js";
|
|
9
9
|
|
|
10
10
|
export function transformTelemetryInfo(
|
|
@@ -21,7 +21,7 @@ export function transformTelemetryInfo(
|
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
function getCustomRequestHeaderNameForClient(dpgContext: SdkContext, client: SdkClient) {
|
|
24
|
-
for (const op of
|
|
24
|
+
for (const op of listOperationsUnderClient(client)) {
|
|
25
25
|
const headerName = getCustomRequestHeaderNameForOperation(
|
|
26
26
|
getHttpOperationWithCache(dpgContext, op),
|
|
27
27
|
);
|
|
@@ -5,21 +5,18 @@ import { SdkClient } from "@azure-tools/typespec-client-generator-core";
|
|
|
5
5
|
import { getDoc, joinPaths } from "@typespec/compiler";
|
|
6
6
|
import { getServers } from "@typespec/http";
|
|
7
7
|
import {
|
|
8
|
-
|
|
8
|
+
ClientModel,
|
|
9
|
+
ClientOptions,
|
|
9
10
|
Imports,
|
|
10
|
-
initInternalImports,
|
|
11
|
-
NameType,
|
|
12
|
-
normalizeName,
|
|
13
11
|
OperationParameter,
|
|
14
12
|
OperationResponse,
|
|
15
13
|
PathParameter,
|
|
16
14
|
Paths,
|
|
17
|
-
RLCModel,
|
|
18
|
-
RLCOptions,
|
|
19
15
|
Schema,
|
|
20
16
|
SchemaContext,
|
|
21
17
|
UrlInfo,
|
|
22
|
-
} from "../
|
|
18
|
+
} from "../interfaces.js";
|
|
19
|
+
import { buildRuntimeImports, initInternalImports } from "../utils/imports-util.js";
|
|
23
20
|
import { SdkContext } from "../utils/interfaces.js";
|
|
24
21
|
import {
|
|
25
22
|
getDefaultService,
|
|
@@ -29,6 +26,7 @@ import {
|
|
|
29
26
|
getTypeName,
|
|
30
27
|
predictDefaultValue,
|
|
31
28
|
} from "../utils/model-utils.js";
|
|
29
|
+
import { NameType, normalizeName } from "../utils/name-utils.js";
|
|
32
30
|
import { getClientLroOverload } from "../utils/operation-util.js";
|
|
33
31
|
import { transformApiVersionInfo } from "./transform-api-version-info.js";
|
|
34
32
|
import { transformHelperFunctionDetails } from "./transform-helper-function-details.js";
|
|
@@ -38,15 +36,15 @@ import { transformToResponseTypes } from "./transform-responses.js";
|
|
|
38
36
|
import { transformSchemas } from "./transform-schemas.js";
|
|
39
37
|
import { transformTelemetryInfo } from "./transform-telemetry-info.js";
|
|
40
38
|
|
|
41
|
-
export async function
|
|
39
|
+
export async function transformClientModel(
|
|
42
40
|
client: SdkClient,
|
|
43
41
|
dpgContext: SdkContext,
|
|
44
|
-
): Promise<
|
|
42
|
+
): Promise<ClientModel> {
|
|
45
43
|
const program = dpgContext.program;
|
|
46
|
-
const options:
|
|
47
|
-
const
|
|
44
|
+
const options: ClientOptions = dpgContext.emitterOptions!;
|
|
45
|
+
const sourceDir = dpgContext.generationPathDetail?.sourcesDir;
|
|
48
46
|
const srcPath = joinPaths(
|
|
49
|
-
dpgContext.generationPathDetail?.
|
|
47
|
+
dpgContext.generationPathDetail?.sourcesDir ?? "",
|
|
50
48
|
options.batch && options.batch.length > 1
|
|
51
49
|
? normalizeName(client.name.replace("Client", ""), NameType.File)
|
|
52
50
|
: "",
|
|
@@ -71,7 +69,7 @@ export async function transformRLCModel(
|
|
|
71
69
|
helperDetails.clientLroOverload = getClientLroOverload(paths);
|
|
72
70
|
|
|
73
71
|
const telemetryOptions = transformTelemetryInfo(client, dpgContext);
|
|
74
|
-
const model:
|
|
72
|
+
const model: ClientModel = {
|
|
75
73
|
srcPath,
|
|
76
74
|
libraryName,
|
|
77
75
|
paths,
|
|
@@ -87,11 +85,8 @@ export async function transformRLCModel(
|
|
|
87
85
|
internalImports: importSet,
|
|
88
86
|
runtimeImports: buildRuntimeImports(),
|
|
89
87
|
},
|
|
90
|
-
|
|
88
|
+
sourceDir,
|
|
91
89
|
};
|
|
92
|
-
// RLC sample generation has been removed; modular samples are emitted separately,
|
|
93
|
-
// so the RLC model never carries sample groups.
|
|
94
|
-
options.generateSample = false;
|
|
95
90
|
return model;
|
|
96
91
|
}
|
|
97
92
|
|
|
@@ -145,7 +140,7 @@ export function transformUrlInfo(
|
|
|
145
140
|
}
|
|
146
141
|
}
|
|
147
142
|
if (importedModels.size > 0) {
|
|
148
|
-
importDetails.
|
|
143
|
+
importDetails.clientFactory.importsSet = importedModels;
|
|
149
144
|
}
|
|
150
145
|
if (endpoint && urlParameters.length > 0) {
|
|
151
146
|
for (const param of urlParameters) {
|
|
@@ -14,11 +14,11 @@ import {
|
|
|
14
14
|
Namespace,
|
|
15
15
|
Operation,
|
|
16
16
|
} from "@typespec/compiler";
|
|
17
|
-
import {
|
|
18
|
-
import { NameType, normalizeName } from "../rlc-common/index.js";
|
|
17
|
+
import { ClientModuleInfo } from "../modular/interfaces.js";
|
|
19
18
|
import { SdkContext } from "./interfaces.js";
|
|
19
|
+
import { NameType, normalizeName } from "./name-utils.js";
|
|
20
20
|
|
|
21
|
-
export function
|
|
21
|
+
export function getClients(dpgContext: SdkContext): SdkClient[] {
|
|
22
22
|
const clients = listClients(dpgContext);
|
|
23
23
|
const rawServiceNamespaces =
|
|
24
24
|
dpgContext.allServiceNamespaces ?? listAllServiceNamespaces(dpgContext);
|
|
@@ -79,7 +79,7 @@ export function getRLCClients(dpgContext: SdkContext): SdkClient[] {
|
|
|
79
79
|
});
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
export function
|
|
82
|
+
export function listOperationsUnderClient(client: SdkClient): Operation[] {
|
|
83
83
|
const operations = [];
|
|
84
84
|
const serviceArray = client.services;
|
|
85
85
|
const queue: (Namespace | Interface)[] = [...serviceArray];
|
|
@@ -110,17 +110,17 @@ export function listOperationsUnderRLCClient(client: SdkClient): Operation[] {
|
|
|
110
110
|
return operations;
|
|
111
111
|
}
|
|
112
112
|
|
|
113
|
-
export function
|
|
114
|
-
return
|
|
113
|
+
export function isMultiEndpointClient(dpgContext: SdkContext): boolean {
|
|
114
|
+
return getClients(dpgContext).length > 1;
|
|
115
115
|
}
|
|
116
116
|
|
|
117
|
-
export function
|
|
117
|
+
export function getClientModuleInfo(clientMap: [string[], SdkClientType<SdkServiceOperation>]) {
|
|
118
118
|
const [hierarchy, client] = clientMap;
|
|
119
|
-
const
|
|
120
|
-
|
|
119
|
+
const clientModuleInfo: ClientModuleInfo = {
|
|
120
|
+
clientName: `${client.name.replace(/Client$/, "")}Context`,
|
|
121
121
|
};
|
|
122
|
-
|
|
123
|
-
return
|
|
122
|
+
clientModuleInfo.subfolder = hierarchy.join("/");
|
|
123
|
+
return clientModuleInfo;
|
|
124
124
|
}
|
|
125
125
|
|
|
126
126
|
export function getClientHierarchyMap(
|
|
@@ -3,15 +3,15 @@
|
|
|
3
3
|
|
|
4
4
|
import { UsageFlags } from "@azure-tools/typespec-client-generator-core";
|
|
5
5
|
import { transformModularEmitterOptions } from "../modular/build-modular-options.js";
|
|
6
|
-
import { NameType, normalizeName } from "../rlc-common/index.js";
|
|
7
6
|
import { SdkContext } from "./interfaces.js";
|
|
7
|
+
import { NameType, normalizeName } from "./name-utils.js";
|
|
8
8
|
import { getMethodHierarchiesMap } from "./operation-util.js";
|
|
9
9
|
|
|
10
10
|
export function generateCrossLanguageDefinitionFile(dpgContext: SdkContext): {
|
|
11
11
|
CrossLanguagePackageId: string;
|
|
12
12
|
CrossLanguageDefinitionId: Record<string, string>;
|
|
13
13
|
} {
|
|
14
|
-
const modularSourcesRoot = dpgContext.generationPathDetail?.
|
|
14
|
+
const modularSourcesRoot = dpgContext.generationPathDetail?.sourcesDir ?? "src";
|
|
15
15
|
const emitterOptions = transformModularEmitterOptions(dpgContext, modularSourcesRoot, {
|
|
16
16
|
casing: "camel",
|
|
17
17
|
});
|
|
@@ -24,7 +24,7 @@ export function generateCrossLanguageDefinitionFile(dpgContext: SdkContext): {
|
|
|
24
24
|
}
|
|
25
25
|
for (const enm of dpgContext.sdkPackage.enums) {
|
|
26
26
|
// Skip api version enum for multi-service scenarios since each service may have different versions
|
|
27
|
-
if (dpgContext.
|
|
27
|
+
if (dpgContext.emitterOptions?.isMultiService && enm.usage === UsageFlags.ApiVersionEnum) {
|
|
28
28
|
continue;
|
|
29
29
|
}
|
|
30
30
|
CrossLanguageDefinitionId[`${packageName}!Known${enm.name}:enum`] =
|
package/src/utils/emit-util.ts
CHANGED
|
@@ -3,20 +3,20 @@ import { format } from "prettier";
|
|
|
3
3
|
import prettierPluginBabel from "prettier/plugins/babel";
|
|
4
4
|
import prettierPluginEstree from "prettier/plugins/estree";
|
|
5
5
|
import prettierPluginTypescript from "prettier/plugins/typescript";
|
|
6
|
+
import { ClientModel, ContentBuilder, File } from "../interfaces.js";
|
|
6
7
|
import { prettierJSONOptions, prettierTypeScriptOptions, reportDiagnostic } from "../lib.js";
|
|
7
|
-
import { ContentBuilder, File, RLCModel } from "../rlc-common/index.js";
|
|
8
8
|
|
|
9
9
|
export async function emitContentByBuilder(
|
|
10
10
|
program: Program,
|
|
11
11
|
builderFnOrList: ContentBuilder | ContentBuilder[],
|
|
12
|
-
|
|
12
|
+
clientModels: ClientModel,
|
|
13
13
|
emitterOutputDir?: string,
|
|
14
14
|
) {
|
|
15
15
|
if (!Array.isArray(builderFnOrList)) {
|
|
16
16
|
builderFnOrList = [builderFnOrList];
|
|
17
17
|
}
|
|
18
18
|
for (const builderFn of builderFnOrList) {
|
|
19
|
-
let contentFiles: File[] | File | undefined = builderFn(
|
|
19
|
+
let contentFiles: File[] | File | undefined = builderFn(clientModels);
|
|
20
20
|
if (!contentFiles) {
|
|
21
21
|
continue;
|
|
22
22
|
}
|
|
@@ -63,20 +63,20 @@ export function initInternalImports(): Imports {
|
|
|
63
63
|
type: "response",
|
|
64
64
|
importsSet: new Set<string>(),
|
|
65
65
|
},
|
|
66
|
-
|
|
67
|
-
type: "
|
|
66
|
+
index: {
|
|
67
|
+
type: "index",
|
|
68
68
|
importsSet: new Set<string>(),
|
|
69
69
|
},
|
|
70
70
|
modularModel: {
|
|
71
71
|
type: "modularModel",
|
|
72
72
|
importsSet: new Set<string>(),
|
|
73
73
|
},
|
|
74
|
-
|
|
75
|
-
type: "
|
|
74
|
+
clientFactory: {
|
|
75
|
+
type: "clientFactory",
|
|
76
76
|
importsSet: new Set<string>(),
|
|
77
77
|
},
|
|
78
|
-
|
|
79
|
-
type: "
|
|
78
|
+
clientDefinition: {
|
|
79
|
+
type: "clientDefinition",
|
|
80
80
|
importsSet: new Set<string>(),
|
|
81
81
|
},
|
|
82
82
|
serializerHelpers: {
|
package/src/utils/interfaces.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { SdkContext as TCGCSdkContext } from "@azure-tools/typespec-client-generator-core";
|
|
2
2
|
import { ModelProperty, Namespace } from "@typespec/compiler";
|
|
3
|
-
import {
|
|
3
|
+
import { ClientOptions, SchemaContext } from "../interfaces.js";
|
|
4
4
|
import { KnownMediaType } from "./media-types.js";
|
|
5
5
|
|
|
6
6
|
export interface SdkContext extends TCGCSdkContext {
|
|
7
|
-
|
|
7
|
+
emitterOptions?: ClientOptions;
|
|
8
8
|
generationPathDetail?: GenerationDirDetail;
|
|
9
9
|
hasApiVersionInClient?: boolean;
|
|
10
10
|
allServiceNamespaces?: Namespace[];
|
|
@@ -12,8 +12,7 @@ export interface SdkContext extends TCGCSdkContext {
|
|
|
12
12
|
|
|
13
13
|
export interface GenerationDirDetail {
|
|
14
14
|
rootDir: string;
|
|
15
|
-
|
|
16
|
-
modularSourcesDir?: string;
|
|
15
|
+
sourcesDir: string;
|
|
17
16
|
metadataDir: string;
|
|
18
17
|
}
|
|
19
18
|
|
package/src/utils/model-utils.ts
CHANGED
|
@@ -64,21 +64,20 @@ import {
|
|
|
64
64
|
isBody,
|
|
65
65
|
isStatusCode,
|
|
66
66
|
} from "@typespec/http";
|
|
67
|
+
import { GetSchemaOptions, SdkContext } from "./interfaces.js";
|
|
68
|
+
import { KnownMediaType, hasMediaType, isMediaTypeMultipartFormData } from "./media-types.js";
|
|
69
|
+
|
|
67
70
|
import {
|
|
68
71
|
ArraySchema,
|
|
69
72
|
DictionarySchema,
|
|
70
|
-
NameType,
|
|
71
73
|
ObjectSchema,
|
|
72
74
|
Schema,
|
|
73
75
|
SchemaContext,
|
|
74
|
-
|
|
75
|
-
normalizeName,
|
|
76
|
-
} from "../rlc-common/index.js";
|
|
77
|
-
import { GetSchemaOptions, SdkContext } from "./interfaces.js";
|
|
78
|
-
import { KnownMediaType, hasMediaType, isMediaTypeMultipartFormData } from "./media-types.js";
|
|
79
|
-
|
|
76
|
+
} from "../interfaces.js";
|
|
80
77
|
import { reportDiagnostic } from "../lib.js";
|
|
78
|
+
import { NameType, normalizeName } from "./name-utils.js";
|
|
81
79
|
import { getModelNamespaceName } from "./namespace-utils.js";
|
|
80
|
+
import { isArraySchema } from "./schema-helpers.js";
|
|
82
81
|
|
|
83
82
|
export const BINARY_TYPE_UNION =
|
|
84
83
|
"string | Uint8Array | ReadableStream<Uint8Array> | NodeReadableStream";
|
|
@@ -859,7 +858,7 @@ function getModelName(dpgContext: SdkContext, model: Model) {
|
|
|
859
858
|
fullNamespacePrefix = "";
|
|
860
859
|
}
|
|
861
860
|
// 5. check if this model should be namespaced
|
|
862
|
-
return dpgContext.
|
|
861
|
+
return dpgContext.emitterOptions?.enableModelNamespace ? `${fullNamespacePrefix}${name}` : name;
|
|
863
862
|
}
|
|
864
863
|
|
|
865
864
|
// Map an typespec type to an OA schema. Returns undefined when the resulting
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { ClientModel } from "../interfaces.js";
|
|
5
5
|
import { NameType, normalizeName } from "./name-utils.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
@@ -76,7 +76,7 @@ export function getParameterTypeName(baseNameOrOperationGroup: string, operation
|
|
|
76
76
|
return normalizeName(`${baseNameOrOperationGroup}_Parameters`, NameType.Interface);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
|
-
export function getClientName(model:
|
|
79
|
+
export function getClientName(model: ClientModel) {
|
|
80
80
|
return model.libraryName;
|
|
81
81
|
}
|
|
82
82
|
|
|
@@ -22,15 +22,15 @@ export function getOperationNamespaceInterfaceName(
|
|
|
22
22
|
): string[] {
|
|
23
23
|
const result: string[] = [];
|
|
24
24
|
if (
|
|
25
|
-
dpgContext.
|
|
26
|
-
dpgContext.
|
|
25
|
+
dpgContext.emitterOptions?.hierarchyClient === false &&
|
|
26
|
+
dpgContext.emitterOptions?.enableOperationGroup !== true
|
|
27
27
|
) {
|
|
28
28
|
return result;
|
|
29
29
|
}
|
|
30
30
|
if (operation.interface) {
|
|
31
31
|
if (
|
|
32
|
-
dpgContext.
|
|
33
|
-
dpgContext.
|
|
32
|
+
dpgContext.emitterOptions?.enableOperationGroup === true &&
|
|
33
|
+
dpgContext.emitterOptions?.hierarchyClient === false
|
|
34
34
|
) {
|
|
35
35
|
result.push(operation.interface.name);
|
|
36
36
|
return result;
|
|
@@ -3,11 +3,11 @@
|
|
|
3
3
|
|
|
4
4
|
import { MethodSignatureStructure, OptionalKind, ParameterDeclarationStructure } from "ts-morph";
|
|
5
5
|
import {
|
|
6
|
+
ClientModel,
|
|
6
7
|
Methods,
|
|
7
8
|
ObjectSchema,
|
|
8
9
|
ParameterMetadata,
|
|
9
10
|
PathParameter,
|
|
10
|
-
RLCModel,
|
|
11
11
|
Schema,
|
|
12
12
|
SchemaContext,
|
|
13
13
|
} from "../interfaces.js";
|
|
@@ -59,35 +59,35 @@ export function getPathParamDefinitions(
|
|
|
59
59
|
});
|
|
60
60
|
}
|
|
61
61
|
|
|
62
|
-
export function hasPagingOperations(model:
|
|
62
|
+
export function hasPagingOperations(model: ClientModel) {
|
|
63
63
|
return Boolean(model.helperDetails?.hasPaging);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
-
export function hasPollingOperations(model:
|
|
66
|
+
export function hasPollingOperations(model: ClientModel) {
|
|
67
67
|
return Boolean(model.helperDetails?.hasLongRunning);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
|
-
export function hasMultiCollection(model:
|
|
70
|
+
export function hasMultiCollection(model: ClientModel) {
|
|
71
71
|
return Boolean(model.helperDetails?.hasMultiCollection);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
-
export function hasPipeCollection(model:
|
|
74
|
+
export function hasPipeCollection(model: ClientModel) {
|
|
75
75
|
return Boolean(model.helperDetails?.hasPipeCollection);
|
|
76
76
|
}
|
|
77
77
|
|
|
78
|
-
export function hasSsvCollection(model:
|
|
78
|
+
export function hasSsvCollection(model: ClientModel) {
|
|
79
79
|
return Boolean(model.helperDetails?.hasSsvCollection);
|
|
80
80
|
}
|
|
81
81
|
|
|
82
|
-
export function hasTsvCollection(model:
|
|
82
|
+
export function hasTsvCollection(model: ClientModel) {
|
|
83
83
|
return Boolean(model.helperDetails?.hasTsvCollection);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
export function hasCsvCollection(model:
|
|
86
|
+
export function hasCsvCollection(model: ClientModel) {
|
|
87
87
|
return Boolean(model.helperDetails?.hasCsvCollection);
|
|
88
88
|
}
|
|
89
89
|
|
|
90
|
-
export function hasUnexpectedHelper(model:
|
|
90
|
+
export function hasUnexpectedHelper(model: ClientModel) {
|
|
91
91
|
const pathDictionary = model.paths;
|
|
92
92
|
for (const details of Object.values(pathDictionary)) {
|
|
93
93
|
for (const methodDetails of Object.values(details.methods)) {
|
|
@@ -106,14 +106,14 @@ export function hasUnexpectedHelper(model: RLCModel) {
|
|
|
106
106
|
return false;
|
|
107
107
|
}
|
|
108
108
|
|
|
109
|
-
export function hasInputModels(model:
|
|
109
|
+
export function hasInputModels(model: ClientModel) {
|
|
110
110
|
return hasSchemaContextObject(model, [SchemaContext.Input]);
|
|
111
111
|
}
|
|
112
|
-
export function hasOutputModels(model:
|
|
112
|
+
export function hasOutputModels(model: ClientModel) {
|
|
113
113
|
return hasSchemaContextObject(model, [SchemaContext.Output, SchemaContext.Exception]);
|
|
114
114
|
}
|
|
115
115
|
|
|
116
|
-
function hasSchemaContextObject(model:
|
|
116
|
+
function hasSchemaContextObject(model: ClientModel, schemaUsage: SchemaContext[]) {
|
|
117
117
|
const objectSchemas: ObjectSchema[] = (model.schemas ?? []).filter(
|
|
118
118
|
(o) => isObjectSchema(o) && (o as ObjectSchema).usage?.some((u) => schemaUsage.includes(u)),
|
|
119
119
|
);
|