@azure-tools/typespec-ts 0.56.0-dev.1 → 0.56.0-dev.2
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 -7
- package/dist/src/context-manager.d.ts +2 -2
- package/dist/src/context-manager.d.ts.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/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 -13
- package/dist/src/interfaces.d.ts.map +1 -0
- package/dist/src/interfaces.js.map +1 -0
- package/dist/src/lib.d.ts +2 -3
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +2 -7
- 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 +2 -2
- 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/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.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.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 +1 -1
- package/dist/src/metadata/test/build-snippets.js.map +1 -0
- package/dist/src/metadata/test/template.d.ts.map +1 -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 +5 -5
- package/dist/src/modular/build-root-index.js.map +1 -1
- package/dist/src/modular/build-subpath-index.js +2 -2
- 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 +8 -8
- 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 +17 -17
- 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 -11
- 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 +2 -2
- package/src/context-manager.ts +2 -2
- package/src/framework/hooks/sdk-types.ts +1 -1
- package/src/index.ts +81 -101
- package/src/{rlc-common/interfaces.ts → interfaces.ts} +14 -15
- package/src/lib.ts +3 -10
- 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 +8 -8
- 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/{rlc-common → metadata}/test/build-recorded-client.ts +2 -2
- package/src/{rlc-common → metadata}/test/build-sample-test.ts +2 -2
- package/src/{rlc-common → metadata}/test/build-snippets.ts +3 -3
- 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 +5 -5
- package/src/modular/build-subpath-index.ts +2 -2
- package/src/modular/emit-models-options.ts +3 -3
- package/src/modular/emit-models.ts +8 -8
- 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 +17 -17
- 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 -20
- 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.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.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.map +0 -1
- 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/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}/test/build-recorded-client.js +0 -0
- /package/dist/src/{rlc-common → metadata}/test/build-sample-test.js +0 -0
- /package/dist/src/{rlc-common → metadata}/test/template.d.ts +0 -0
- /package/dist/src/{rlc-common → metadata}/test/template.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 → metadata}/test/template.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
|
@@ -2,8 +2,8 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
4
|
import { Project, SourceFile } from "ts-morph";
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
5
|
+
import { ClientModel } from "../interfaces.js";
|
|
6
|
+
import { hasPollingOperations } from "../utils/operation-helpers.js";
|
|
7
7
|
import { buildAzureMonorepoPackage } from "./package-json/build-azure-monorepo-package.js";
|
|
8
8
|
import { PackageCommonInfoConfig, resolveWarpExports } from "./package-json/package-common.js";
|
|
9
9
|
import { getPackageName } from "./utils.js";
|
|
@@ -15,7 +15,7 @@ interface PackageFileOptions {
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
export function buildPackageFile(
|
|
18
|
-
model:
|
|
18
|
+
model: ClientModel,
|
|
19
19
|
{ exports, dependencies, clientContextPaths }: PackageFileOptions = {},
|
|
20
20
|
) {
|
|
21
21
|
const config: PackageCommonInfoConfig = {
|
|
@@ -66,7 +66,7 @@ export function buildPackageFile(
|
|
|
66
66
|
* - Updates `//metadata.constantPaths` when `clientContextPaths` is provided.
|
|
67
67
|
*/
|
|
68
68
|
export function updatePackageFile(
|
|
69
|
-
model:
|
|
69
|
+
model: ClientModel,
|
|
70
70
|
existingFilePathOrContent: string | Record<string, any>,
|
|
71
71
|
{ exports, clientContextPaths }: PackageFileOptions = {},
|
|
72
72
|
) {
|
|
@@ -167,11 +167,11 @@ export function updatePackageFile(
|
|
|
167
167
|
};
|
|
168
168
|
}
|
|
169
169
|
|
|
170
|
-
function getPackageVersion(model:
|
|
170
|
+
function getPackageVersion(model: ClientModel): string {
|
|
171
171
|
return model.options?.packageDetails?.version ?? "1.0.0-beta.1";
|
|
172
172
|
}
|
|
173
173
|
|
|
174
|
-
function getDescription(model:
|
|
174
|
+
function getDescription(model: ClientModel): string {
|
|
175
175
|
const description = model.options?.packageDetails?.description;
|
|
176
176
|
if (!description) {
|
|
177
177
|
return `A generated SDK for ${model.libraryName}.`;
|
|
@@ -4,9 +4,9 @@
|
|
|
4
4
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
5
5
|
// @ts-ignore: to fix the handlebars issue
|
|
6
6
|
import hbs from "handlebars";
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
7
|
+
import { ClientModel } from "../interfaces.js";
|
|
8
|
+
import { getClientName } from "../utils/name-constructors.js";
|
|
9
|
+
import { NameType, normalizeName } from "../utils/name-utils.js";
|
|
10
10
|
|
|
11
11
|
const azureReadmeModularTemplate = `# {{ clientDescriptiveName }} library for JavaScript
|
|
12
12
|
|
|
@@ -269,7 +269,7 @@ interface Metadata {
|
|
|
269
269
|
hasSubscriptionId?: boolean;
|
|
270
270
|
}
|
|
271
271
|
|
|
272
|
-
export function buildReadmeFile(model:
|
|
272
|
+
export function buildReadmeFile(model: ClientModel) {
|
|
273
273
|
const metadata = createMetadata(model) ?? {};
|
|
274
274
|
const readmeFileContents = hbs.compile(
|
|
275
275
|
model.options ? azureReadmeModularTemplate : nonBrandedReadmeTemplate,
|
|
@@ -281,7 +281,7 @@ export function buildReadmeFile(model: RLCModel) {
|
|
|
281
281
|
};
|
|
282
282
|
}
|
|
283
283
|
|
|
284
|
-
export function hasClientNameChanged(model:
|
|
284
|
+
export function hasClientNameChanged(model: ClientModel, existingReadmeContent: string): boolean {
|
|
285
285
|
try {
|
|
286
286
|
const importMatch = existingReadmeContent.match(
|
|
287
287
|
/import\s*\{\s*([A-Za-z0-9_]+)\s*\}\s*from\s*["'][^"']*["']/,
|
|
@@ -295,7 +295,7 @@ export function hasClientNameChanged(model: RLCModel, existingReadmeContent: str
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
export function updateReadmeFile(
|
|
298
|
-
model:
|
|
298
|
+
model: ClientModel,
|
|
299
299
|
existingReadmeContent: string,
|
|
300
300
|
): { path: string; content: string } | undefined {
|
|
301
301
|
try {
|
|
@@ -324,7 +324,7 @@ export function updateReadmeFile(
|
|
|
324
324
|
* @param codeModel - include the client details
|
|
325
325
|
* @returns inferred metadata about the service, the package, and the client
|
|
326
326
|
*/
|
|
327
|
-
function createMetadata(model:
|
|
327
|
+
function createMetadata(model: ClientModel): Metadata | undefined {
|
|
328
328
|
if (!model.options || !model.options.packageDetails) {
|
|
329
329
|
return;
|
|
330
330
|
}
|
|
@@ -379,7 +379,7 @@ function createMetadata(model: RLCModel): Metadata | undefined {
|
|
|
379
379
|
};
|
|
380
380
|
}
|
|
381
381
|
|
|
382
|
-
function getServiceName(model:
|
|
382
|
+
function getServiceName(model: ClientModel) {
|
|
383
383
|
const azureHuh =
|
|
384
384
|
model?.options?.packageDetails?.scopeName === "azure" ||
|
|
385
385
|
model?.options?.packageDetails?.scopeName === "azure-rest";
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import {
|
|
3
|
+
import { ClientModel } from "../interfaces.js";
|
|
4
4
|
|
|
5
5
|
const sampleEnvText = `
|
|
6
6
|
# Feel free to add your own environment variables.
|
|
7
7
|
`;
|
|
8
8
|
|
|
9
|
-
export function buildSampleEnvFile(model:
|
|
9
|
+
export function buildSampleEnvFile(model: ClientModel) {
|
|
10
10
|
if (model.options?.generateMetadata === true || model.options?.generateSample === true) {
|
|
11
11
|
const filePath = "sample.env";
|
|
12
12
|
return {
|
|
@@ -1,17 +1,17 @@
|
|
|
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 { getPackageName } from "./utils.js";
|
|
6
6
|
|
|
7
|
-
function shouldGenerateTestConfig(model:
|
|
7
|
+
function shouldGenerateTestConfig(model: ClientModel): boolean {
|
|
8
8
|
return !(model.options?.generateMetadata === false || model.options?.generateTest === false);
|
|
9
9
|
}
|
|
10
10
|
|
|
11
11
|
/**
|
|
12
12
|
* Builds config/tsconfig.test.browser.json — extends eng/tsconfigs/test.browser.json
|
|
13
13
|
*/
|
|
14
|
-
export function buildTestBrowserTsConfig(model:
|
|
14
|
+
export function buildTestBrowserTsConfig(model: ClientModel) {
|
|
15
15
|
if (!shouldGenerateTestConfig(model)) {
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
@@ -40,7 +40,7 @@ export function buildTestBrowserTsConfig(model: RLCModel) {
|
|
|
40
40
|
/**
|
|
41
41
|
* Builds config/tsconfig.test.node.json — extends eng/tsconfigs/test.node.json
|
|
42
42
|
*/
|
|
43
|
-
export function buildTestNodeTsConfig(model:
|
|
43
|
+
export function buildTestNodeTsConfig(model: ClientModel) {
|
|
44
44
|
if (!shouldGenerateTestConfig(model)) {
|
|
45
45
|
return;
|
|
46
46
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
4
|
import { Project } from "ts-morph";
|
|
5
|
-
import {
|
|
5
|
+
import { ClientModel } from "../interfaces.js";
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
8
|
* Builds the root tsconfig.json.
|
|
@@ -10,7 +10,7 @@ import { RLCModel } from "../interfaces.js";
|
|
|
10
10
|
* Emits project references pointing into the `config/` subfolder
|
|
11
11
|
* (following the eng/tsconfigs pattern).
|
|
12
12
|
*/
|
|
13
|
-
export function buildTsConfig(model:
|
|
13
|
+
export function buildTsConfig(model: ClientModel) {
|
|
14
14
|
const { generateTest, generateSample, generateReactNativeTarget } = model.options || {};
|
|
15
15
|
const project = new Project({ useInMemoryFileSystem: true });
|
|
16
16
|
|
|
@@ -123,7 +123,7 @@ export function buildTsSrcCjsConfig() {
|
|
|
123
123
|
/**
|
|
124
124
|
* Builds config/tsconfig.samples.json — extends eng/tsconfigs/samples.json
|
|
125
125
|
*/
|
|
126
|
-
export function buildTsSampleConfig(model:
|
|
126
|
+
export function buildTsSampleConfig(model: ClientModel) {
|
|
127
127
|
const { packageDetails } = model.options || {};
|
|
128
128
|
const clientPackageName = packageDetails?.name ?? "";
|
|
129
129
|
return {
|
|
@@ -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
|
|
|
6
6
|
const nodeConfig = `import viteConfig from "../../../vitest.shared.config.ts";
|
|
7
7
|
|
|
@@ -11,7 +11,7 @@ export default viteConfig;
|
|
|
11
11
|
const browserConfig = `export { default } from "../../../eng/vitestconfigs/browser.config.ts";
|
|
12
12
|
`;
|
|
13
13
|
|
|
14
|
-
export function buildVitestConfig(model:
|
|
14
|
+
export function buildVitestConfig(model: ClientModel, platform: "browser" | "node") {
|
|
15
15
|
if (model.options?.generateMetadata === false || model.options?.generateTest === false) {
|
|
16
16
|
return;
|
|
17
17
|
}
|
|
@@ -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
|
|
|
6
6
|
export interface WarpConfigOptions {
|
|
7
7
|
/** Source-level exports, e.g. { ".": "./src/index.ts", "./models": "./src/models/index.ts" } */
|
|
@@ -67,7 +67,7 @@ targets:
|
|
|
67
67
|
* By default, react-native target is NOT included. Set `generateReactNativeTarget: true`
|
|
68
68
|
* in options to include it.
|
|
69
69
|
*/
|
|
70
|
-
export function buildWarpConfig(model:
|
|
70
|
+
export function buildWarpConfig(model: ClientModel, { exports }: WarpConfigOptions = {}) {
|
|
71
71
|
const allExports: Record<string, string> = {
|
|
72
72
|
...BASE_EXPORTS,
|
|
73
73
|
...exports,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
2
|
// @ts-ignore: to fix the handlebars issue
|
|
3
3
|
import hbs from "handlebars";
|
|
4
|
-
import {
|
|
4
|
+
import { ClientModel } from "../../interfaces.js";
|
|
5
5
|
import { recordedClientContent } from "./template.js";
|
|
6
6
|
|
|
7
|
-
export function buildRecordedClientFile(_model:
|
|
7
|
+
export function buildRecordedClientFile(_model: ClientModel) {
|
|
8
8
|
const recordedClientFileContents = hbs.compile(recordedClientContent, {
|
|
9
9
|
noEscape: true,
|
|
10
10
|
});
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
2
|
// @ts-ignore: to fix the handlebars issue
|
|
3
3
|
import hbs from "handlebars";
|
|
4
|
-
import {
|
|
4
|
+
import { ClientModel } from "../../interfaces.js";
|
|
5
5
|
import { sampleTestContent } from "./template.js";
|
|
6
6
|
|
|
7
|
-
export function buildSampleTest(_model:
|
|
7
|
+
export function buildSampleTest(_model: ClientModel) {
|
|
8
8
|
return {
|
|
9
9
|
path: "test/public/sampleTest.spec.ts",
|
|
10
10
|
content: hbs.compile(sampleTestContent, { noEscape: true })({}),
|
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
2
2
|
// @ts-ignore: to fix the handlebars issue
|
|
3
3
|
import hbs from "handlebars";
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
4
|
+
import { ClientModel } from "../../interfaces.js";
|
|
5
|
+
import { getClientName } from "../../utils/name-constructors.js";
|
|
6
6
|
import { snippetsContent } from "./template.js";
|
|
7
7
|
|
|
8
|
-
export function buildSnippets(model:
|
|
8
|
+
export function buildSnippets(model: ClientModel, clientName?: string) {
|
|
9
9
|
// to keep the same config for azure scope in buildReadmeFile.ts
|
|
10
10
|
if (
|
|
11
11
|
(model?.options?.packageDetails?.scopeName === "azure" ||
|
|
@@ -1,8 +1,8 @@
|
|
|
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
|
|
|
6
|
-
export function getPackageName(model:
|
|
6
|
+
export function getPackageName(model: ClientModel): string {
|
|
7
7
|
return model.options?.packageDetails?.name ?? model.libraryName;
|
|
8
8
|
}
|
|
@@ -5,7 +5,6 @@ import {
|
|
|
5
5
|
SourceFile,
|
|
6
6
|
StructureKind,
|
|
7
7
|
} from "ts-morph";
|
|
8
|
-
import { NameType, normalizeName } from "../rlc-common/index.js";
|
|
9
8
|
import { buildUserAgentOptions, getClientParametersDeclaration } from "./helpers/client-helpers.js";
|
|
10
9
|
import { getClassicalClientName, getClientName } from "./helpers/naming-helpers.js";
|
|
11
10
|
import { ModularEmitterOptions } from "./interfaces.js";
|
|
@@ -20,8 +19,9 @@ import { useContext } from "../context-manager.js";
|
|
|
20
19
|
import { useDependencies } from "../framework/hooks/use-dependencies.js";
|
|
21
20
|
import { resolveReference } from "../framework/reference.js";
|
|
22
21
|
import { refkey } from "../framework/refkey.js";
|
|
23
|
-
import {
|
|
22
|
+
import { getClientModuleInfo, isMultiEndpointClient } from "../utils/client-utils.js";
|
|
24
23
|
import { SdkContext } from "../utils/interfaces.js";
|
|
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";
|
|
27
27
|
import { getPagingLROMethodName } from "./helpers/classical-operation-helpers.js";
|
|
@@ -47,7 +47,7 @@ export function buildClassicalClient(
|
|
|
47
47
|
requiredOnly: true,
|
|
48
48
|
});
|
|
49
49
|
const srcPath = emitterOptions.modularOptions.sourceRoot;
|
|
50
|
-
const { subfolder,
|
|
50
|
+
const { subfolder, clientName } = getClientModuleInfo(clientMap);
|
|
51
51
|
|
|
52
52
|
const clientFile = project.createSourceFile(
|
|
53
53
|
`${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}${normalizeName(
|
|
@@ -68,16 +68,16 @@ export function buildClassicalClient(
|
|
|
68
68
|
});
|
|
69
69
|
|
|
70
70
|
// Add the private client member. This will be the client context from /api
|
|
71
|
-
if (
|
|
71
|
+
if (isMultiEndpointClient(dpgContext)) {
|
|
72
72
|
clientClass.addProperty({
|
|
73
73
|
name: "_client",
|
|
74
|
-
type: `Client.${
|
|
74
|
+
type: `Client.${clientName}`,
|
|
75
75
|
scope: Scope.Private,
|
|
76
76
|
});
|
|
77
77
|
} else {
|
|
78
78
|
clientClass.addProperty({
|
|
79
79
|
name: "_client",
|
|
80
|
-
type: `${
|
|
80
|
+
type: `${clientName}`,
|
|
81
81
|
scope: Scope.Private,
|
|
82
82
|
});
|
|
83
83
|
}
|
|
@@ -214,7 +214,7 @@ function generateMethod(
|
|
|
214
214
|
});
|
|
215
215
|
|
|
216
216
|
// add LRO helper methods if applicable
|
|
217
|
-
if (context.
|
|
217
|
+
if (context.emitterOptions?.compatibilityLro && declaration?.isLro && !declaration?.isLroPaging) {
|
|
218
218
|
const operationStateReference = resolveReference(AzurePollingDependencies.OperationState);
|
|
219
219
|
const simplePollerLikeReference = resolveReference(SimplePollerHelpers.SimplePollerLike);
|
|
220
220
|
const getSimplePollerReference = resolveReference(SimplePollerHelpers.getSimplePoller);
|
|
@@ -244,7 +244,7 @@ function generateMethod(
|
|
|
244
244
|
statements: `return await ${declarationRefKey}(${methodParamStr});`,
|
|
245
245
|
});
|
|
246
246
|
} // For LRO+Paging operations, use different return types and implementation
|
|
247
|
-
else if (context.
|
|
247
|
+
else if (context.emitterOptions?.compatibilityLro && declaration?.isLroPaging) {
|
|
248
248
|
const returnType = declaration?.lropagingFinalReturnType ?? "void";
|
|
249
249
|
const pagedAsyncIterableIteratorReference = resolveReference(
|
|
250
250
|
PagingHelpers.PagedAsyncIterableIterator,
|
|
@@ -274,7 +274,7 @@ function buildClientOperationGroups(
|
|
|
274
274
|
) {
|
|
275
275
|
let clientType = "Client";
|
|
276
276
|
const [_hierarchy, client] = clientMap;
|
|
277
|
-
const { subfolder } =
|
|
277
|
+
const { subfolder } = getClientModuleInfo(clientMap);
|
|
278
278
|
if (subfolder && subfolder !== "") {
|
|
279
279
|
clientType = `Client.${clientClass.getName()}`;
|
|
280
280
|
}
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
|
|
2
2
|
import { SourceFile } from "ts-morph";
|
|
3
3
|
import { useContext } from "../context-manager.js";
|
|
4
|
-
import {
|
|
5
|
-
import { getModularClientOptions } from "../utils/client-utils.js";
|
|
4
|
+
import { getClientModuleInfo } from "../utils/client-utils.js";
|
|
6
5
|
import { SdkContext } from "../utils/interfaces.js";
|
|
6
|
+
import { NameType } from "../utils/name-utils.js";
|
|
7
7
|
import { getMethodHierarchiesMap } from "../utils/operation-util.js";
|
|
8
8
|
import { getClassicalOperation } from "./helpers/classical-operation-helpers.js";
|
|
9
9
|
import { getClassicalLayerPrefix } from "./helpers/naming-helpers.js";
|
|
@@ -17,7 +17,7 @@ export function buildClassicOperationFiles(
|
|
|
17
17
|
// const sdkPackage = dpgContext.sdkPackage;
|
|
18
18
|
const project = useContext("outputProject");
|
|
19
19
|
const [_hierarchy, client] = clientMap;
|
|
20
|
-
const { subfolder } =
|
|
20
|
+
const { subfolder } = getClientModuleInfo(clientMap);
|
|
21
21
|
const classicOperationFiles: Map<string, SourceFile> = new Map<string, SourceFile>();
|
|
22
22
|
const methodMap = getMethodHierarchiesMap(dpgContext, client);
|
|
23
23
|
for (const [prefixKey, operations] of methodMap) {
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
import { NameType, normalizeName } from "../rlc-common/index.js";
|
|
2
1
|
import {
|
|
3
2
|
buildGetClientCredentialParam,
|
|
4
3
|
buildGetClientEndpointParam,
|
|
@@ -24,8 +23,9 @@ import { useDependencies } from "../framework/hooks/use-dependencies.js";
|
|
|
24
23
|
import { resolveReference } from "../framework/reference.js";
|
|
25
24
|
import { refkey } from "../framework/refkey.js";
|
|
26
25
|
import { reportDiagnostic } from "../lib.js";
|
|
27
|
-
import {
|
|
26
|
+
import { getClientModuleInfo } from "../utils/client-utils.js";
|
|
28
27
|
import { SdkContext } from "../utils/interfaces.js";
|
|
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";
|
|
31
31
|
import { getClassicalClientName, getClientName } from "./helpers/naming-helpers.js";
|
|
@@ -40,7 +40,7 @@ export function getClientContextPath(
|
|
|
40
40
|
emitterOptions: ModularEmitterOptions,
|
|
41
41
|
): string {
|
|
42
42
|
const [_, client] = clientMap;
|
|
43
|
-
const { subfolder } =
|
|
43
|
+
const { subfolder } = getClientModuleInfo(clientMap);
|
|
44
44
|
const name = getClientName(client);
|
|
45
45
|
const srcPath = emitterOptions.modularOptions.sourceRoot;
|
|
46
46
|
const contentPath = `${srcPath}/${
|
|
@@ -61,7 +61,7 @@ export function buildClientContext(
|
|
|
61
61
|
const dependencies = useDependencies();
|
|
62
62
|
const [hierarchy, client] = clientMap;
|
|
63
63
|
const name = getClientName(client);
|
|
64
|
-
const {
|
|
64
|
+
const { clientName } = getClientModuleInfo(clientMap);
|
|
65
65
|
const requiredParams = getClientParametersDeclaration(client, dpgContext, {
|
|
66
66
|
onClientOnly: false,
|
|
67
67
|
requiredOnly: true,
|
|
@@ -116,7 +116,7 @@ export function buildClientContext(
|
|
|
116
116
|
|
|
117
117
|
clientContextFile.addInterface({
|
|
118
118
|
isExported: true,
|
|
119
|
-
name: `${
|
|
119
|
+
name: `${clientName}`,
|
|
120
120
|
extends: [resolveReference(dependencies.Client)],
|
|
121
121
|
docs: getDocsFromDescription(client.doc),
|
|
122
122
|
properties: [...requiredInterfaceProperties, ...optionalInterfaceProperties],
|
|
@@ -172,7 +172,7 @@ export function buildClientContext(
|
|
|
172
172
|
const factoryFunction = clientContextFile.addFunction({
|
|
173
173
|
docs: getDocsFromDescription(client.doc),
|
|
174
174
|
name: `create${name}`,
|
|
175
|
-
returnType: `${
|
|
175
|
+
returnType: `${clientName}`,
|
|
176
176
|
parameters: getClientParametersDeclaration(client, dpgContext, {
|
|
177
177
|
onClientOnly: false,
|
|
178
178
|
requiredOnly: true,
|
|
@@ -286,7 +286,7 @@ export function buildClientContext(
|
|
|
286
286
|
|
|
287
287
|
if (allContextParams.length) {
|
|
288
288
|
factoryFunction.addStatements(
|
|
289
|
-
`return { ...clientContext, ${allContextParams.join(", ")}} as ${
|
|
289
|
+
`return { ...clientContext, ${allContextParams.join(", ")}} as ${clientName};`,
|
|
290
290
|
);
|
|
291
291
|
} else {
|
|
292
292
|
factoryFunction.addStatements(`return clientContext;`);
|
|
@@ -10,11 +10,11 @@ export function transformModularEmitterOptions(
|
|
|
10
10
|
): ModularEmitterOptions {
|
|
11
11
|
CASING = options.casing ?? CASING;
|
|
12
12
|
const emitterOptions: ModularEmitterOptions = {
|
|
13
|
-
options: dpgContext.
|
|
13
|
+
options: dpgContext.emitterOptions ?? {},
|
|
14
14
|
modularOptions: {
|
|
15
15
|
sourceRoot: modularSourcesRoot,
|
|
16
|
-
compatibilityMode: !!dpgContext.
|
|
17
|
-
experimentalExtensibleEnums: !!dpgContext.
|
|
16
|
+
compatibilityMode: !!dpgContext.emitterOptions?.compatibilityMode,
|
|
17
|
+
experimentalExtensibleEnums: !!dpgContext.emitterOptions?.experimentalExtensibleEnums,
|
|
18
18
|
},
|
|
19
19
|
};
|
|
20
20
|
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import { InterfaceDeclarationStructure, SourceFile, StructureKind } from "ts-morph";
|
|
2
|
-
import { NameType, normalizeName } from "../rlc-common/index.js";
|
|
3
2
|
import {
|
|
4
3
|
getDeserializeExceptionHeadersPrivateFunction,
|
|
5
4
|
getDeserializeHeadersPrivateFunction,
|
|
@@ -23,8 +22,9 @@ import { addDeclaration } from "../framework/declaration.js";
|
|
|
23
22
|
import { useDependencies } from "../framework/hooks/use-dependencies.js";
|
|
24
23
|
import { resolveReference } from "../framework/reference.js";
|
|
25
24
|
import { refkey } from "../framework/refkey.js";
|
|
26
|
-
import {
|
|
25
|
+
import { getClientModuleInfo, isMultiEndpointClient } from "../utils/client-utils.js";
|
|
27
26
|
import { SdkContext } from "../utils/interfaces.js";
|
|
27
|
+
import { NameType, normalizeName } from "../utils/name-utils.js";
|
|
28
28
|
import {
|
|
29
29
|
getMethodHierarchiesMap,
|
|
30
30
|
hasDualFormatSupport,
|
|
@@ -48,9 +48,9 @@ export function buildOperationFiles(
|
|
|
48
48
|
const project = useContext("outputProject");
|
|
49
49
|
const [_, client] = clientMap;
|
|
50
50
|
const operationFiles: Set<SourceFile> = new Set();
|
|
51
|
-
const { subfolder,
|
|
52
|
-
const isMultiEndpoint =
|
|
53
|
-
const clientType = isMultiEndpoint ? `Client.${
|
|
51
|
+
const { subfolder, clientName } = getClientModuleInfo(clientMap);
|
|
52
|
+
const isMultiEndpoint = isMultiEndpointClient(dpgContext);
|
|
53
|
+
const clientType = isMultiEndpoint ? `Client.${clientName}` : "Client";
|
|
54
54
|
const methodMap = getMethodHierarchiesMap(dpgContext, client);
|
|
55
55
|
for (const [prefixKey, operations] of methodMap) {
|
|
56
56
|
const prefixes = prefixKey.split("/");
|
|
@@ -102,7 +102,7 @@ export function buildOperationFiles(
|
|
|
102
102
|
|
|
103
103
|
const indexPathPrefix = "../".repeat(prefixKey === "" ? 0 : prefixes.length) || "./";
|
|
104
104
|
operationGroupFile.addImportDeclaration({
|
|
105
|
-
namedImports: [`${
|
|
105
|
+
namedImports: [`${clientName} as Client`],
|
|
106
106
|
moduleSpecifier: `${indexPathPrefix}index.js`,
|
|
107
107
|
});
|
|
108
108
|
operationGroupFile.fixUnusedIdentifiers();
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import { NameType } from "../rlc-common/index.js";
|
|
2
|
-
|
|
3
1
|
import { getRelativePathFromDirectory, joinPaths } from "@typespec/compiler";
|
|
4
2
|
import { useContext } from "../context-manager.js";
|
|
5
|
-
import { getClientHierarchyMap,
|
|
3
|
+
import { getClientHierarchyMap, getClientModuleInfo } from "../utils/client-utils.js";
|
|
6
4
|
import { SdkContext } from "../utils/interfaces.js";
|
|
5
|
+
import { NameType } from "../utils/name-utils.js";
|
|
7
6
|
import { getMethodHierarchiesMap } from "../utils/operation-util.js";
|
|
8
7
|
import { getClassicalLayerPrefix } from "./helpers/naming-helpers.js";
|
|
9
8
|
import { ModularEmitterOptions } from "./interfaces.js";
|
|
@@ -42,7 +41,7 @@ function buildExportsForMultiClient(
|
|
|
42
41
|
if (hierarchy.length === 0) {
|
|
43
42
|
hasTopLevelClient = true;
|
|
44
43
|
}
|
|
45
|
-
const { subfolder } =
|
|
44
|
+
const { subfolder } = getClientModuleInfo([hierarchy, client]);
|
|
46
45
|
if (subfolder !== "" && methodMap.size > 0) {
|
|
47
46
|
packageInfo.exports[`./${subfolder}`] = `${srcPrefix}/${subfolder}/index.ts`;
|
|
48
47
|
|
|
@@ -56,7 +55,7 @@ function buildExportsForMultiClient(
|
|
|
56
55
|
// TODO: support api subpath exports for multi-service. Skip for now. https://github.com/Azure/autorest.typescript/issues/3717
|
|
57
56
|
if (!emitterOptions.options.isMultiService) {
|
|
58
57
|
for (const flattenedClient of clientMap) {
|
|
59
|
-
const { subfolder } =
|
|
58
|
+
const { subfolder } = getClientModuleInfo(flattenedClient);
|
|
60
59
|
const client = flattenedClient[1];
|
|
61
60
|
const methodMap = getMethodHierarchiesMap(context, client);
|
|
62
61
|
for (const [prefixKey, _] of methodMap) {
|
|
@@ -4,9 +4,9 @@ import { SourceFile } from "ts-morph";
|
|
|
4
4
|
import { useContext } from "../context-manager.js";
|
|
5
5
|
import { useDependencies } from "../framework/hooks/use-dependencies.js";
|
|
6
6
|
import { resolveReference } from "../framework/reference.js";
|
|
7
|
-
import {
|
|
8
|
-
import { getModularClientOptions } from "../utils/client-utils.js";
|
|
7
|
+
import { getClientModuleInfo } from "../utils/client-utils.js";
|
|
9
8
|
import { SdkContext } from "../utils/interfaces.js";
|
|
9
|
+
import { NameType, normalizeName } from "../utils/name-utils.js";
|
|
10
10
|
import { getMethodHierarchiesMap } from "../utils/operation-util.js";
|
|
11
11
|
import { buildLroDeserDetailMap } from "./build-operations.js";
|
|
12
12
|
import { AzurePollingDependencies } from "./external-dependencies.js";
|
|
@@ -23,7 +23,7 @@ export function buildRestorePoller(
|
|
|
23
23
|
const project = useContext("outputProject");
|
|
24
24
|
const [_, client] = clientMap;
|
|
25
25
|
const dependencies = useDependencies();
|
|
26
|
-
const { subfolder } =
|
|
26
|
+
const { subfolder } = getClientModuleInfo(clientMap);
|
|
27
27
|
const methodMap = getMethodHierarchiesMap(context, client);
|
|
28
28
|
const hasLro = Array.from(methodMap.values()).some((operations) => {
|
|
29
29
|
return operations.some(isLroOnlyOperation);
|
|
@@ -4,9 +4,9 @@ import { Project, SourceFile } from "ts-morph";
|
|
|
4
4
|
import { useContext } from "../context-manager.js";
|
|
5
5
|
import { resolveReference } from "../framework/reference.js";
|
|
6
6
|
import { reportDiagnostic } from "../lib.js";
|
|
7
|
-
import {
|
|
8
|
-
import { getModularClientOptions } from "../utils/client-utils.js";
|
|
7
|
+
import { getClientModuleInfo } from "../utils/client-utils.js";
|
|
9
8
|
import { SdkContext } from "../utils/interfaces.js";
|
|
9
|
+
import { NameType, normalizeName } from "../utils/name-utils.js";
|
|
10
10
|
import { getMethodHierarchiesMap } from "../utils/operation-util.js";
|
|
11
11
|
import { partitionAndEmitExports } from "./build-subpath-index.js";
|
|
12
12
|
import { getClassicalClientName } from "./helpers/naming-helpers.js";
|
|
@@ -34,7 +34,7 @@ export function buildRootIndex(
|
|
|
34
34
|
const project = useContext("outputProject");
|
|
35
35
|
const [_, client] = clientMap;
|
|
36
36
|
const srcPath = emitterOptions.modularOptions.sourceRoot;
|
|
37
|
-
const { subfolder } =
|
|
37
|
+
const { subfolder } = getClientModuleInfo(clientMap);
|
|
38
38
|
const clientName = `${getClassicalClientName(client)}`;
|
|
39
39
|
const clientFile = project.getSourceFile(
|
|
40
40
|
`${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}${normalizeName(
|
|
@@ -208,7 +208,7 @@ function exportSimplePollerLike(
|
|
|
208
208
|
const hasLro = Array.from(methodMap.values()).some((operations) => {
|
|
209
209
|
return operations.some(isLroOnlyOperation);
|
|
210
210
|
});
|
|
211
|
-
if (!hasLro || context.
|
|
211
|
+
if (!hasLro || context.emitterOptions?.compatibilityLro !== true) {
|
|
212
212
|
return;
|
|
213
213
|
}
|
|
214
214
|
const helperFile = project.getSourceFile(
|
|
@@ -365,7 +365,7 @@ export function buildSubClientIndexFile(
|
|
|
365
365
|
) {
|
|
366
366
|
const project = useContext("outputProject");
|
|
367
367
|
const [_, client] = clientMap;
|
|
368
|
-
const { subfolder } =
|
|
368
|
+
const { subfolder } = getClientModuleInfo(clientMap);
|
|
369
369
|
const srcPath = emitterOptions.modularOptions.sourceRoot;
|
|
370
370
|
const subClientIndexFile = project.createSourceFile(
|
|
371
371
|
`${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}index.ts`,
|
|
@@ -4,7 +4,7 @@ import { ModularEmitterOptions } from "./interfaces.js";
|
|
|
4
4
|
|
|
5
5
|
import { Node, SourceFile } from "ts-morph";
|
|
6
6
|
import { useContext } from "../context-manager.js";
|
|
7
|
-
import {
|
|
7
|
+
import { getClientModuleInfo } from "../utils/client-utils.js";
|
|
8
8
|
|
|
9
9
|
export interface buildSubpathIndexFileOptions {
|
|
10
10
|
exportIndex?: boolean;
|
|
@@ -19,7 +19,7 @@ export function buildSubpathIndexFile(
|
|
|
19
19
|
options: buildSubpathIndexFileOptions = {},
|
|
20
20
|
) {
|
|
21
21
|
const project = useContext("outputProject");
|
|
22
|
-
const subfolder = clientMap ? (
|
|
22
|
+
const subfolder = clientMap ? (getClientModuleInfo(clientMap).subfolder ?? "") : "";
|
|
23
23
|
const srcPath = emitterOptions.modularOptions.sourceRoot;
|
|
24
24
|
// Skip to export these files because they are used internally.
|
|
25
25
|
const skipFiles = ["pagingHelpers.ts", "pollingHelpers.ts"];
|
|
@@ -4,9 +4,9 @@ import { ModularEmitterOptions } from "./interfaces.js";
|
|
|
4
4
|
|
|
5
5
|
import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
|
|
6
6
|
import { useContext } from "../context-manager.js";
|
|
7
|
-
import {
|
|
8
|
-
import { getModularClientOptions } from "../utils/client-utils.js";
|
|
7
|
+
import { getClientModuleInfo } from "../utils/client-utils.js";
|
|
9
8
|
import { SdkContext } from "../utils/interfaces.js";
|
|
9
|
+
import { NameType, normalizeName } from "../utils/name-utils.js";
|
|
10
10
|
import { getMethodHierarchiesMap } from "../utils/operation-util.js";
|
|
11
11
|
import { buildOperationOptions } from "./build-operations.js";
|
|
12
12
|
|
|
@@ -20,7 +20,7 @@ export function buildApiOptions(
|
|
|
20
20
|
const project = useContext("outputProject");
|
|
21
21
|
const [_, client] = clientMap;
|
|
22
22
|
const modelOptionsFiles = [];
|
|
23
|
-
const { subfolder } =
|
|
23
|
+
const { subfolder } = getClientModuleInfo(clientMap);
|
|
24
24
|
const methodMap = getMethodHierarchiesMap(context, client);
|
|
25
25
|
for (const [prefixKey, operations] of methodMap) {
|
|
26
26
|
const prefixes = prefixKey.split("/");
|