@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
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
export interface
|
|
3
|
+
export interface ClientModel {
|
|
4
4
|
libraryName: string;
|
|
5
5
|
srcPath: string;
|
|
6
6
|
paths: Paths;
|
|
7
7
|
importInfo: ImportInfo;
|
|
8
|
-
options?:
|
|
8
|
+
options?: ClientOptions;
|
|
9
9
|
schemas: Schema[];
|
|
10
10
|
apiVersionInfo?: ApiVersionInfo;
|
|
11
11
|
parameters?: OperationParameter[];
|
|
@@ -13,8 +13,8 @@ export interface RLCModel {
|
|
|
13
13
|
helperDetails?: HelperFunctionDetails;
|
|
14
14
|
urlInfo?: UrlInfo;
|
|
15
15
|
telemetryOptions?: TelemetryInfo;
|
|
16
|
-
sampleGroups?:
|
|
17
|
-
|
|
16
|
+
sampleGroups?: SampleGroup[];
|
|
17
|
+
sourceDir?: string;
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
export interface ImportInfo {
|
|
@@ -28,10 +28,10 @@ export type ImportType =
|
|
|
28
28
|
/**inner models' imports for parameter and response */
|
|
29
29
|
| "parameter"
|
|
30
30
|
| "response"
|
|
31
|
-
| "
|
|
31
|
+
| "index"
|
|
32
32
|
| "modularModel"
|
|
33
|
-
| "
|
|
34
|
-
| "
|
|
33
|
+
| "clientFactory"
|
|
34
|
+
| "clientDefinition"
|
|
35
35
|
/**common third party imports */
|
|
36
36
|
| "restClient"
|
|
37
37
|
| "coreAuth"
|
|
@@ -60,18 +60,18 @@ export interface ImportMetadata {
|
|
|
60
60
|
/**
|
|
61
61
|
* A group of samples in operation_id level and they are used to generate in a sample file
|
|
62
62
|
*/
|
|
63
|
-
export interface
|
|
63
|
+
export interface SampleGroup {
|
|
64
64
|
filename: string;
|
|
65
65
|
clientPackageName: string;
|
|
66
66
|
defaultFactoryName: string;
|
|
67
|
-
samples:
|
|
67
|
+
samples: SampleDetail[];
|
|
68
68
|
importedTypes?: string[];
|
|
69
69
|
}
|
|
70
70
|
|
|
71
71
|
/**
|
|
72
72
|
* An independent sample detail and it will be wrapped as a func
|
|
73
73
|
*/
|
|
74
|
-
export interface
|
|
74
|
+
export interface SampleDetail {
|
|
75
75
|
/**
|
|
76
76
|
* metadata for comments
|
|
77
77
|
*/
|
|
@@ -190,7 +190,7 @@ export interface OperationLroDetail {
|
|
|
190
190
|
precedence?: number;
|
|
191
191
|
}
|
|
192
192
|
|
|
193
|
-
export interface
|
|
193
|
+
export interface ClientOptions {
|
|
194
194
|
/**
|
|
195
195
|
* Whether to include response headers in the generated response types. If true, the generated response types will include headers as properties.
|
|
196
196
|
*/
|
|
@@ -223,7 +223,6 @@ export interface RLCOptions {
|
|
|
223
223
|
generateTest?: boolean;
|
|
224
224
|
generateSample?: boolean;
|
|
225
225
|
azureOutputDirectory?: string;
|
|
226
|
-
isTypeSpecTest?: boolean;
|
|
227
226
|
serviceInfo?: ServiceInfo;
|
|
228
227
|
azureArm?: boolean;
|
|
229
228
|
enableOperationGroup?: boolean;
|
|
@@ -234,7 +233,6 @@ export interface RLCOptions {
|
|
|
234
233
|
clearOutputFolder?: boolean;
|
|
235
234
|
ignorePropertyNameNormalize?: boolean;
|
|
236
235
|
ignoreEnumMemberNameNormalize?: boolean;
|
|
237
|
-
compatibilityQueryMultiFormat?: boolean;
|
|
238
236
|
typespecTitleMap?: Record<string, string>;
|
|
239
237
|
hasSubscriptionId?: boolean;
|
|
240
238
|
compatibilityLro?: boolean;
|
|
@@ -357,8 +355,8 @@ export interface ParameterMetadatas {
|
|
|
357
355
|
export interface ParameterBodyMetadata {
|
|
358
356
|
/**
|
|
359
357
|
* In case of formData we'd get multiple properties in body marked as partialBody
|
|
360
|
-
* If yes,
|
|
361
|
-
* usually false in typespec source because
|
|
358
|
+
* If yes, the emitter would prepare the whole part shape;
|
|
359
|
+
* usually false in typespec source because the emitter doesn't have to prepare the whole part shape
|
|
362
360
|
*/
|
|
363
361
|
isPartialBody?: boolean;
|
|
364
362
|
body?: ParameterBodySchema[];
|
|
@@ -398,7 +396,7 @@ export type ResponseHeaderSchema = Schema;
|
|
|
398
396
|
export type ResponseBodySchema = Schema;
|
|
399
397
|
|
|
400
398
|
export type ContentBuilder = {
|
|
401
|
-
(model:
|
|
399
|
+
(model: ClientModel): File | File[] | undefined;
|
|
402
400
|
};
|
|
403
401
|
|
|
404
402
|
export type SampleParameterPosition = "client" | "path" | "method";
|
package/src/lib.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import { createTypeSpecLibrary, JSONSchemaType, paramMessage } from "@typespec/compiler";
|
|
5
5
|
import { Options } from "prettier";
|
|
6
|
-
import { PackageDetails } from "./
|
|
6
|
+
import { PackageDetails } from "./interfaces.js";
|
|
7
7
|
|
|
8
8
|
export interface EmitterOptions {
|
|
9
9
|
/**
|
|
@@ -39,7 +39,6 @@ export interface EmitterOptions {
|
|
|
39
39
|
*/
|
|
40
40
|
"generate-test"?: boolean;
|
|
41
41
|
"generate-sample"?: boolean;
|
|
42
|
-
"is-typespec-test"?: boolean;
|
|
43
42
|
"azure-arm"?: boolean;
|
|
44
43
|
"enable-operation-group"?: boolean;
|
|
45
44
|
"enable-model-namespace"?: boolean;
|
|
@@ -49,7 +48,6 @@ export interface EmitterOptions {
|
|
|
49
48
|
"experimental-extensible-enums"?: boolean;
|
|
50
49
|
"clear-output-folder"?: boolean;
|
|
51
50
|
"ignore-property-name-normalize"?: boolean;
|
|
52
|
-
"compatibility-query-multi-format"?: boolean;
|
|
53
51
|
"typespec-title-map"?: Record<string, string>;
|
|
54
52
|
"ignore-enum-member-name-normalize"?: boolean;
|
|
55
53
|
//TODO should remove this after finish the release tool test
|
|
@@ -82,7 +80,7 @@ export interface EmitterOptions {
|
|
|
82
80
|
"generate-react-native-target"?: boolean;
|
|
83
81
|
}
|
|
84
82
|
|
|
85
|
-
export const
|
|
83
|
+
export const EmitterOptionsSchema: JSONSchemaType<EmitterOptions> = {
|
|
86
84
|
type: "object",
|
|
87
85
|
additionalProperties: true,
|
|
88
86
|
properties: {
|
|
@@ -171,11 +169,6 @@ export const RLCOptionsSchema: JSONSchemaType<EmitterOptions> = {
|
|
|
171
169
|
description:
|
|
172
170
|
"Whether to generate sample files, for basic samples of your generated sdks. Defaults to `undefined`. Management packages' default to `true`.",
|
|
173
171
|
},
|
|
174
|
-
"is-typespec-test": {
|
|
175
|
-
type: "boolean",
|
|
176
|
-
nullable: true,
|
|
177
|
-
description: "Internal option for test",
|
|
178
|
-
},
|
|
179
172
|
"azure-arm": {
|
|
180
173
|
type: "boolean",
|
|
181
174
|
nullable: true,
|
|
@@ -234,12 +227,6 @@ export const RLCOptionsSchema: JSONSchemaType<EmitterOptions> = {
|
|
|
234
227
|
description:
|
|
235
228
|
"The emitter has a normalization logic for enum member key, to ignore this normalization, you can set this option to true",
|
|
236
229
|
},
|
|
237
|
-
"compatibility-query-multi-format": {
|
|
238
|
-
type: "boolean",
|
|
239
|
-
nullable: true,
|
|
240
|
-
description:
|
|
241
|
-
"Whether to generate the backward-compatible code for query parameter serialization for array types in RLC. Defaults to `false`",
|
|
242
|
-
},
|
|
243
230
|
"typespec-title-map": {
|
|
244
231
|
type: "object",
|
|
245
232
|
additionalProperties: {
|
|
@@ -561,7 +548,7 @@ const libDef = {
|
|
|
561
548
|
},
|
|
562
549
|
},
|
|
563
550
|
emitter: {
|
|
564
|
-
options:
|
|
551
|
+
options: EmitterOptionsSchema,
|
|
565
552
|
},
|
|
566
553
|
} as const;
|
|
567
554
|
|
package/src/meta-tree.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { Type } from "@typespec/compiler";
|
|
2
|
-
import { Schema
|
|
2
|
+
import { Schema } from "./interfaces.js";
|
|
3
3
|
|
|
4
|
-
export interface
|
|
5
|
-
|
|
4
|
+
export interface ClientTypeMetadata {
|
|
5
|
+
clientType: Schema;
|
|
6
6
|
}
|
|
7
7
|
|
|
8
|
-
export type
|
|
8
|
+
export type ClientTypeMetaTree = Map<Type, ClientTypeMetadata>;
|
|
@@ -2,9 +2,9 @@
|
|
|
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
|
-
export function buildApiExtractorConfig(_model:
|
|
7
|
+
export function buildApiExtractorConfig(_model: ClientModel) {
|
|
8
8
|
const project = new Project({ useInMemoryFileSystem: true });
|
|
9
9
|
|
|
10
10
|
const config = {
|
|
@@ -1,13 +1,13 @@
|
|
|
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
|
-
function getPackageVersion(model:
|
|
6
|
+
function getPackageVersion(model: ClientModel): string {
|
|
7
7
|
return model.options?.packageDetails?.version ?? "1.0.0-beta.1";
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
export function buildChangelogFile(model:
|
|
10
|
+
export function buildChangelogFile(model: ClientModel) {
|
|
11
11
|
const version = getPackageVersion(model);
|
|
12
12
|
const content = `# Release History
|
|
13
13
|
|
|
@@ -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
|
const esLintConfigEsmAzureSdk = `import azsdkEslint from "@azure/eslint-plugin-azure-sdk";
|
|
8
8
|
|
|
@@ -31,7 +31,7 @@ export default [
|
|
|
31
31
|
];
|
|
32
32
|
`;
|
|
33
33
|
|
|
34
|
-
export function buildEsLintConfig(_model:
|
|
34
|
+
export function buildEsLintConfig(_model: ClientModel) {
|
|
35
35
|
const project = new Project({ useInMemoryFileSystem: true });
|
|
36
36
|
const filePath = "eslint.config.mjs";
|
|
37
37
|
|
|
@@ -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}.`;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import { NameType, normalizeName } from "../helpers/name-utils.js";
|
|
9
|
-
import { RLCModel } from "../interfaces.js";
|
|
4
|
+
import { ClientModel } from "../interfaces.js";
|
|
5
|
+
import { getClientName } from "../utils/name-constructors.js";
|
|
6
|
+
import { NameType, normalizeName } from "../utils/name-utils.js";
|
|
7
|
+
import { renderTemplate } from "./render-template.js";
|
|
10
8
|
|
|
11
9
|
const azureReadmeModularTemplate = `# {{ clientDescriptiveName }} library for JavaScript
|
|
12
10
|
|
|
@@ -38,13 +36,10 @@ Key links:
|
|
|
38
36
|
|
|
39
37
|
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
|
|
40
38
|
|
|
41
|
-
{{#if azure}}
|
|
42
39
|
### Prerequisites
|
|
43
40
|
|
|
44
41
|
- An [Azure subscription][azure_sub].
|
|
45
|
-
{{/if}}
|
|
46
42
|
|
|
47
|
-
{{#if isReleasablePackage}}
|
|
48
43
|
### Install the \`{{ clientPackageName }}\` package
|
|
49
44
|
|
|
50
45
|
Install the {{ clientDescriptiveName }} library for JavaScript with \`npm\`:
|
|
@@ -52,9 +47,7 @@ Install the {{ clientDescriptiveName }} library for JavaScript with \`npm\`:
|
|
|
52
47
|
\`\`\`bash
|
|
53
48
|
npm install {{ clientPackageName }}
|
|
54
49
|
\`\`\`
|
|
55
|
-
{{/if}}
|
|
56
50
|
|
|
57
|
-
{{#if azure}}
|
|
58
51
|
{{#if addCredentials}}
|
|
59
52
|
### Create and authenticate a \`{{ clientClassName}}\`
|
|
60
53
|
|
|
@@ -129,7 +122,8 @@ const credential = new InteractiveBrowserCredential({
|
|
|
129
122
|
const client = new {{ clientClassName }}("<endpoint>", credential);
|
|
130
123
|
\`\`\`
|
|
131
124
|
{{/if}}
|
|
132
|
-
{{/if}}
|
|
125
|
+
{{/if}}
|
|
126
|
+
|
|
133
127
|
|
|
134
128
|
### JavaScript Bundle
|
|
135
129
|
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
|
|
@@ -140,7 +134,6 @@ To use this client library in the browser, first you need to use a bundler. For
|
|
|
140
134
|
|
|
141
135
|
\`{{ clientClassName }}\` is the primary interface for developers using the {{ clientDescriptiveName }} library. Explore the methods on this client object to understand the different features of the {{ serviceName }} service that you can access.
|
|
142
136
|
|
|
143
|
-
{{#if azure}}
|
|
144
137
|
## Troubleshooting
|
|
145
138
|
|
|
146
139
|
### Logging
|
|
@@ -153,7 +146,7 @@ import { setLogLevel } from "@azure/logger";
|
|
|
153
146
|
setLogLevel("info");
|
|
154
147
|
\`\`\`
|
|
155
148
|
|
|
156
|
-
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](
|
|
149
|
+
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
|
|
157
150
|
|
|
158
151
|
{{#if samplesURL}}
|
|
159
152
|
## Next steps
|
|
@@ -163,54 +156,16 @@ Please take a look at the [samples]({{ samplesURL }}) directory for detailed exa
|
|
|
163
156
|
|
|
164
157
|
## Contributing
|
|
165
158
|
|
|
166
|
-
If you'd like to contribute to this library, please read the [contributing guide](
|
|
159
|
+
If you'd like to contribute to this library, please read the [contributing guide](https://github.com/Azure/azure-sdk-for-js/blob/main/CONTRIBUTING.md) to learn more about how to build and test the code.
|
|
167
160
|
|
|
168
161
|
## Related projects
|
|
169
162
|
|
|
170
|
-
- [
|
|
163
|
+
- [Microsoft Azure SDK for JavaScript](https://github.com/Azure/azure-sdk-for-js)
|
|
171
164
|
|
|
172
165
|
[azure_sub]: https://azure.microsoft.com/free/
|
|
173
166
|
[azure_portal]: https://portal.azure.com
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
{{/if}}
|
|
177
|
-
`;
|
|
178
|
-
|
|
179
|
-
const nonBrandedReadmeTemplate = `# {{ clientDescriptiveName }} library for JavaScript
|
|
180
|
-
|
|
181
|
-
{{ description }}
|
|
182
|
-
|
|
183
|
-
Key links:
|
|
184
|
-
|
|
185
|
-
{{#if packageSourceURL}}
|
|
186
|
-
- [Source code]({{ packageSourceURL }})
|
|
187
|
-
{{/if}}
|
|
188
|
-
{{#if packageNPMURL}}
|
|
189
|
-
- [Package (NPM)]({{ packageNPMURL }})
|
|
190
|
-
{{/if}}
|
|
191
|
-
{{#if apiRefURL}}
|
|
192
|
-
- [API reference documentation]({{ apiRefURL }})
|
|
193
|
-
{{/if}}
|
|
194
|
-
{{#if serviceDocURL}}
|
|
195
|
-
- [Product documentation]({{ serviceDocURL }})
|
|
196
|
-
{{/if}}
|
|
197
|
-
{{#if samplesURL}}
|
|
198
|
-
- [Samples]({{ samplesURL }})
|
|
199
|
-
{{/if}}
|
|
200
|
-
|
|
201
|
-
## Getting started
|
|
202
|
-
|
|
203
|
-
### Currently supported environments
|
|
204
|
-
|
|
205
|
-
- LTS versions of Node.js
|
|
206
|
-
|
|
207
|
-
### Install the \`{{ clientPackageName }}\` package
|
|
208
|
-
|
|
209
|
-
Install the {{ clientDescriptiveName }} library for JavaScript with \`npm\`:
|
|
210
|
-
|
|
211
|
-
\`\`\`bash
|
|
212
|
-
npm install {{ clientPackageName }}
|
|
213
|
-
\`\`\`
|
|
167
|
+
[azure_identity]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity
|
|
168
|
+
[defaultazurecredential]: https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential
|
|
214
169
|
`;
|
|
215
170
|
|
|
216
171
|
const apiReferenceTemplate = `{{#if apiRefURL}}
|
|
@@ -228,8 +183,6 @@ interface Metadata {
|
|
|
228
183
|
clientPackageName: string;
|
|
229
184
|
/** The name of the client class */
|
|
230
185
|
clientClassName: string;
|
|
231
|
-
/** The URL of the repository the package lives in */
|
|
232
|
-
repoURL?: string;
|
|
233
186
|
/** The URL to the package directory in the repository */
|
|
234
187
|
packageSourceURL?: string;
|
|
235
188
|
/** The URL to the package's samples */
|
|
@@ -240,48 +193,28 @@ interface Metadata {
|
|
|
240
193
|
description?: string;
|
|
241
194
|
/** The URL to the package on npmjs.org */
|
|
242
195
|
packageNPMURL?: string;
|
|
243
|
-
/** The name of the project that lives in the repository */
|
|
244
|
-
projectName?: string;
|
|
245
196
|
/** whether the client accepts standard credentials */
|
|
246
197
|
addCredentials?: boolean;
|
|
247
|
-
/** The link to the identity package in the repository */
|
|
248
|
-
identityPackageURL?: string;
|
|
249
|
-
/** The URL for the service document */
|
|
250
|
-
serviceDocURL?: string;
|
|
251
|
-
/** The dependency info for this service */
|
|
252
|
-
dependencyDescription?: string;
|
|
253
|
-
dependencyLink?: string;
|
|
254
|
-
/** Indicates if the package is a multi-client */
|
|
255
|
-
hasMultiClients?: boolean;
|
|
256
198
|
/** The URL to the API reference */
|
|
257
199
|
apiRefURL?: string;
|
|
258
200
|
/** Check if the rp is management plane */
|
|
259
201
|
azureArm?: boolean;
|
|
260
|
-
/** Whether the package being generated is for an Azure service */
|
|
261
|
-
azure: boolean;
|
|
262
|
-
/** Indicates if the package is a test/releasable package. */
|
|
263
|
-
isReleasablePackage?: boolean;
|
|
264
|
-
/** The link to the contributing guide in the repository */
|
|
265
|
-
contributingGuideURL?: string;
|
|
266
202
|
/** Indicates if the package need generate test files */
|
|
267
203
|
generateTest?: boolean;
|
|
268
204
|
/** Indicates if the package need SubscriptionId as the client parameter */
|
|
269
205
|
hasSubscriptionId?: boolean;
|
|
270
206
|
}
|
|
271
207
|
|
|
272
|
-
export function buildReadmeFile(model:
|
|
208
|
+
export function buildReadmeFile(model: ClientModel) {
|
|
273
209
|
const metadata = createMetadata(model) ?? {};
|
|
274
|
-
const
|
|
275
|
-
model.options ? azureReadmeModularTemplate : nonBrandedReadmeTemplate,
|
|
276
|
-
{ noEscape: true },
|
|
277
|
-
);
|
|
210
|
+
const content = renderTemplate(azureReadmeModularTemplate, metadata as Record<string, unknown>);
|
|
278
211
|
return {
|
|
279
212
|
path: "README.md",
|
|
280
|
-
content
|
|
213
|
+
content,
|
|
281
214
|
};
|
|
282
215
|
}
|
|
283
216
|
|
|
284
|
-
export function hasClientNameChanged(model:
|
|
217
|
+
export function hasClientNameChanged(model: ClientModel, existingReadmeContent: string): boolean {
|
|
285
218
|
try {
|
|
286
219
|
const importMatch = existingReadmeContent.match(
|
|
287
220
|
/import\s*\{\s*([A-Za-z0-9_]+)\s*\}\s*from\s*["'][^"']*["']/,
|
|
@@ -295,13 +228,16 @@ export function hasClientNameChanged(model: RLCModel, existingReadmeContent: str
|
|
|
295
228
|
}
|
|
296
229
|
|
|
297
230
|
export function updateReadmeFile(
|
|
298
|
-
model:
|
|
231
|
+
model: ClientModel,
|
|
299
232
|
existingReadmeContent: string,
|
|
300
233
|
): { path: string; content: string } | undefined {
|
|
301
234
|
try {
|
|
302
235
|
const metadata = createMetadata(model) ?? {};
|
|
303
236
|
|
|
304
|
-
const newApiRefLink =
|
|
237
|
+
const newApiRefLink = renderTemplate(
|
|
238
|
+
apiReferenceTemplate,
|
|
239
|
+
metadata as Record<string, unknown>,
|
|
240
|
+
).trim();
|
|
305
241
|
|
|
306
242
|
if (!newApiRefLink) {
|
|
307
243
|
return { path: "README.md", content: existingReadmeContent };
|
|
@@ -324,19 +260,17 @@ export function updateReadmeFile(
|
|
|
324
260
|
* @param codeModel - include the client details
|
|
325
261
|
* @returns inferred metadata about the service, the package, and the client
|
|
326
262
|
*/
|
|
327
|
-
function createMetadata(model:
|
|
263
|
+
function createMetadata(model: ClientModel): Metadata | undefined {
|
|
328
264
|
if (!model.options || !model.options.packageDetails) {
|
|
329
265
|
return;
|
|
330
266
|
}
|
|
331
267
|
// const packageDetails = model.options.packageDetails;
|
|
332
|
-
const { packageDetails, azureOutputDirectory, serviceInfo
|
|
268
|
+
const { packageDetails, azureOutputDirectory, serviceInfo } = model.options;
|
|
333
269
|
|
|
334
|
-
const azureHuh =
|
|
335
|
-
packageDetails?.scopeName === "azure" || packageDetails?.scopeName === "azure-rest";
|
|
336
270
|
const repoURL = "https://github.com/Azure/azure-sdk-for-js";
|
|
337
271
|
const relativePackageSourcePath = azureOutputDirectory;
|
|
338
272
|
const packageSourceURL =
|
|
339
|
-
relativePackageSourcePath &&
|
|
273
|
+
relativePackageSourcePath && `${repoURL}/tree/main/${relativePackageSourcePath}`;
|
|
340
274
|
|
|
341
275
|
const clientPackageName = packageDetails?.name;
|
|
342
276
|
const clientClassName = getClientName(model);
|
|
@@ -363,23 +297,15 @@ function createMetadata(model: RLCModel): Metadata | undefined {
|
|
|
363
297
|
packageNPMURL: `https://www.npmjs.com/package/${clientPackageName}`,
|
|
364
298
|
samplesURL:
|
|
365
299
|
model.options.generateSample && packageSourceURL ? `${packageSourceURL}/samples` : undefined,
|
|
366
|
-
apiRefURL:
|
|
367
|
-
? `https://learn.microsoft.com/javascript/api/${clientPackageName}${apiRefUrlQueryParameter}`
|
|
368
|
-
: undefined,
|
|
300
|
+
apiRefURL: `https://learn.microsoft.com/javascript/api/${clientPackageName}${apiRefUrlQueryParameter}`,
|
|
369
301
|
azureArm: Boolean(model.options.azureArm),
|
|
370
|
-
azure: azureHuh,
|
|
371
|
-
isReleasablePackage: !isTypeSpecTest,
|
|
372
|
-
repoURL: repoURL,
|
|
373
|
-
projectName: azureHuh ? "Microsoft Azure SDK for JavaScript" : undefined,
|
|
374
|
-
identityPackageURL: repoURL && `${repoURL}/tree/main/sdk/identity/identity`,
|
|
375
302
|
addCredentials: model.options.addCredentials,
|
|
376
|
-
contributingGuideURL: repoURL && `${repoURL}/blob/main/CONTRIBUTING.md`,
|
|
377
303
|
generateTest: model.options.generateTest,
|
|
378
304
|
hasSubscriptionId: model.options.hasSubscriptionId,
|
|
379
305
|
};
|
|
380
306
|
}
|
|
381
307
|
|
|
382
|
-
function getServiceName(model:
|
|
308
|
+
function getServiceName(model: ClientModel) {
|
|
383
309
|
const azureHuh =
|
|
384
310
|
model?.options?.packageDetails?.scopeName === "azure" ||
|
|
385
311
|
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,
|