@azure-tools/typespec-ts 0.56.0-dev.1 → 0.56.0-dev.11
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 +19 -2
- package/dist/src/context-manager.d.ts.map +1 -1
- package/dist/src/context-manager.js +21 -0
- package/dist/src/context-manager.js.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 +9 -0
- package/dist/src/framework/hooks/sdk-types.d.ts.map +1 -1
- package/dist/src/framework/hooks/sdk-types.js +14 -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 +73 -62
- 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 +25 -2
- package/src/framework/declaration.ts +8 -20
- package/src/framework/hooks/sdk-types.ts +15 -1
- package/src/framework/source-file-batch.ts +140 -0
- package/src/index.ts +92 -103
- 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,227 +0,0 @@
|
|
|
1
|
-
export const karmaConfig = `
|
|
2
|
-
// https://github.com/karma-runner/karma-chrome-launcher
|
|
3
|
-
process.env.CHROME_BIN = require("puppeteer").executablePath();
|
|
4
|
-
require("dotenv").config();
|
|
5
|
-
const { relativeRecordingsPath } = require("@azure-tools/test-recorder");
|
|
6
|
-
process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath();
|
|
7
|
-
|
|
8
|
-
module.exports = function (config) {
|
|
9
|
-
config.set({
|
|
10
|
-
// base path that will be used to resolve all patterns (eg. files, exclude)
|
|
11
|
-
basePath: "./",
|
|
12
|
-
|
|
13
|
-
// frameworks to use
|
|
14
|
-
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
|
15
|
-
frameworks: ["source-map-support", "mocha"],
|
|
16
|
-
|
|
17
|
-
plugins: [
|
|
18
|
-
"karma-mocha",
|
|
19
|
-
"karma-mocha-reporter",
|
|
20
|
-
"karma-chrome-launcher",
|
|
21
|
-
"karma-firefox-launcher",
|
|
22
|
-
"karma-env-preprocessor",
|
|
23
|
-
"karma-coverage",
|
|
24
|
-
"karma-sourcemap-loader",
|
|
25
|
-
"karma-junit-reporter",
|
|
26
|
-
"karma-source-map-support",
|
|
27
|
-
],
|
|
28
|
-
|
|
29
|
-
// list of files / patterns to load in the browser
|
|
30
|
-
files: [
|
|
31
|
-
"dist-test/index.browser.js",
|
|
32
|
-
{ pattern: "dist-test/index.browser.js.map", type: "html", included: false, served: true },
|
|
33
|
-
],
|
|
34
|
-
|
|
35
|
-
// list of files / patterns to exclude
|
|
36
|
-
exclude: [],
|
|
37
|
-
|
|
38
|
-
// preprocess matching files before serving them to the browser
|
|
39
|
-
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
|
40
|
-
preprocessors: {
|
|
41
|
-
"**/*.js": ["sourcemap", "env"],
|
|
42
|
-
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
|
|
43
|
-
// Preprocess source file to calculate code coverage, however this will make source file unreadable
|
|
44
|
-
// "dist-test/index.js": ["coverage"]
|
|
45
|
-
},
|
|
46
|
-
|
|
47
|
-
envPreprocessor: [
|
|
48
|
-
"TEST_MODE",
|
|
49
|
-
"ENDPOINT",
|
|
50
|
-
"AZURE_CLIENT_SECRET",
|
|
51
|
-
"AZURE_CLIENT_ID",
|
|
52
|
-
"AZURE_TENANT_ID",
|
|
53
|
-
"SUBSCRIPTION_ID",
|
|
54
|
-
"RECORDINGS_RELATIVE_PATH",
|
|
55
|
-
],
|
|
56
|
-
|
|
57
|
-
// test results reporter to use
|
|
58
|
-
// possible values: 'dots', 'progress'
|
|
59
|
-
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
|
60
|
-
reporters: ["mocha", "coverage", "junit"],
|
|
61
|
-
|
|
62
|
-
coverageReporter: {
|
|
63
|
-
// specify a common output directory
|
|
64
|
-
dir: "coverage-browser/",
|
|
65
|
-
reporters: [
|
|
66
|
-
{ type: "json", subdir: ".", file: "coverage.json" },
|
|
67
|
-
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
|
|
68
|
-
{ type: "html", subdir: "html" },
|
|
69
|
-
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" },
|
|
70
|
-
],
|
|
71
|
-
},
|
|
72
|
-
|
|
73
|
-
junitReporter: {
|
|
74
|
-
outputDir: "", // results will be saved as $outputDir/$browserName.xml
|
|
75
|
-
outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile
|
|
76
|
-
suite: "", // suite will become the package name attribute in xml testsuite element
|
|
77
|
-
useBrowserName: false, // add browser name to report and classes names
|
|
78
|
-
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
|
|
79
|
-
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
|
|
80
|
-
properties: {}, // key value pair of properties to add to the <properties> section of the report
|
|
81
|
-
},
|
|
82
|
-
|
|
83
|
-
// web server port
|
|
84
|
-
port: 9876,
|
|
85
|
-
|
|
86
|
-
// enable / disable colors in the output (reporters and logs)
|
|
87
|
-
colors: true,
|
|
88
|
-
|
|
89
|
-
// level of logging
|
|
90
|
-
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
|
91
|
-
logLevel: config.LOG_INFO,
|
|
92
|
-
|
|
93
|
-
// enable / disable watching file and executing tests whenever any file changes
|
|
94
|
-
autoWatch: false,
|
|
95
|
-
|
|
96
|
-
// --no-sandbox allows our tests to run in Linux without having to change the system.
|
|
97
|
-
// --disable-web-security allows us to authenticate from the browser without having to write tests using interactive auth, which would be far more complex.
|
|
98
|
-
browsers: ["ChromeHeadlessNoSandbox"],
|
|
99
|
-
customLaunchers: {
|
|
100
|
-
ChromeHeadlessNoSandbox: {
|
|
101
|
-
base: "ChromeHeadless",
|
|
102
|
-
flags: ["--no-sandbox", "--disable-web-security"],
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
|
|
106
|
-
// Continuous Integration mode
|
|
107
|
-
// if true, Karma captures browsers, runs the tests and exits
|
|
108
|
-
singleRun: false,
|
|
109
|
-
|
|
110
|
-
// Concurrency level
|
|
111
|
-
// how many browser should be started simultaneous
|
|
112
|
-
concurrency: 1,
|
|
113
|
-
|
|
114
|
-
browserNoActivityTimeout: 60000000,
|
|
115
|
-
browserDisconnectTimeout: 10000,
|
|
116
|
-
browserDisconnectTolerance: 3,
|
|
117
|
-
|
|
118
|
-
client: {
|
|
119
|
-
mocha: {
|
|
120
|
-
// change Karma's debug.html to the mocha web reporter
|
|
121
|
-
reporter: "html",
|
|
122
|
-
timeout: "600000",
|
|
123
|
-
},
|
|
124
|
-
},
|
|
125
|
-
});
|
|
126
|
-
};
|
|
127
|
-
`;
|
|
128
|
-
export const recordedClientContent = `
|
|
129
|
-
|
|
130
|
-
import {
|
|
131
|
-
Recorder,
|
|
132
|
-
RecorderStartOptions,
|
|
133
|
-
VitestTestContext,
|
|
134
|
-
} from "@azure-tools/test-recorder";
|
|
135
|
-
|
|
136
|
-
const replaceableVariables: Record<string, string> = {
|
|
137
|
-
SUBSCRIPTION_ID: "azure_subscription_id"
|
|
138
|
-
};
|
|
139
|
-
|
|
140
|
-
const recorderEnvSetup: RecorderStartOptions = {
|
|
141
|
-
envSetupForPlayback: replaceableVariables,
|
|
142
|
-
};
|
|
143
|
-
|
|
144
|
-
/**
|
|
145
|
-
* creates the recorder and reads the environment variables from the \`.env\` file.
|
|
146
|
-
* Should be called first in the test suite to make sure environment variables are
|
|
147
|
-
* read before they are being used.
|
|
148
|
-
*/
|
|
149
|
-
export async function createRecorder(context: VitestTestContext): Promise<Recorder> {
|
|
150
|
-
const recorder = new Recorder(context);
|
|
151
|
-
await recorder.start(recorderEnvSetup);
|
|
152
|
-
return recorder;
|
|
153
|
-
}
|
|
154
|
-
`;
|
|
155
|
-
export const sampleTestContent = `
|
|
156
|
-
// import { Recorder } from "@azure-tools/test-recorder";
|
|
157
|
-
// import { createRecorder } from "./utils/recordedClient.js";
|
|
158
|
-
import { assert,
|
|
159
|
-
// beforeEach,
|
|
160
|
-
// afterEach,
|
|
161
|
-
it,
|
|
162
|
-
describe
|
|
163
|
-
} from "vitest";
|
|
164
|
-
|
|
165
|
-
describe("My test", () => {
|
|
166
|
-
// let recorder: Recorder;
|
|
167
|
-
|
|
168
|
-
// beforeEach(async function(ctx) {
|
|
169
|
-
// recorder = await createRecorder(ctx);
|
|
170
|
-
// });
|
|
171
|
-
|
|
172
|
-
// afterEach(async function() {
|
|
173
|
-
// await recorder.stop();
|
|
174
|
-
// });
|
|
175
|
-
|
|
176
|
-
it("sample test", async function() {
|
|
177
|
-
assert.equal(1, 1);
|
|
178
|
-
});
|
|
179
|
-
});
|
|
180
|
-
`;
|
|
181
|
-
export const snippetsContent = `
|
|
182
|
-
import { {{ clientClassName }} } from "../src/index.js";
|
|
183
|
-
import { DefaultAzureCredential, InteractiveBrowserCredential } from "@azure/identity";
|
|
184
|
-
import { setLogLevel } from "@azure/logger";
|
|
185
|
-
import { describe, it } from "vitest";
|
|
186
|
-
|
|
187
|
-
describe("snippets", () => {
|
|
188
|
-
it("ReadmeSampleCreateClient_Node", async () => {
|
|
189
|
-
{{#if azureArm}}
|
|
190
|
-
{{#if hasSubscriptionId}}
|
|
191
|
-
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
|
192
|
-
const client = new {{ clientClassName }}(new DefaultAzureCredential(), subscriptionId);
|
|
193
|
-
{{else}}
|
|
194
|
-
const client = new {{ clientClassName }}(new DefaultAzureCredential());
|
|
195
|
-
{{/if}}
|
|
196
|
-
{{else}}
|
|
197
|
-
const client = new {{ clientClassName }}("<endpoint>", new DefaultAzureCredential());
|
|
198
|
-
{{/if}}
|
|
199
|
-
});
|
|
200
|
-
|
|
201
|
-
it("ReadmeSampleCreateClient_Browser", async () => {
|
|
202
|
-
{{#if azureArm}}
|
|
203
|
-
const credential = new InteractiveBrowserCredential({
|
|
204
|
-
tenantId: "<YOUR_TENANT_ID>",
|
|
205
|
-
clientId: "<YOUR_CLIENT_ID>",
|
|
206
|
-
});
|
|
207
|
-
{{#if hasSubscriptionId}}
|
|
208
|
-
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
|
209
|
-
const client = new {{ clientClassName }}(credential, subscriptionId);
|
|
210
|
-
{{else}}
|
|
211
|
-
const client = new {{ clientClassName }}(credential);
|
|
212
|
-
{{/if}}
|
|
213
|
-
{{else}}
|
|
214
|
-
const credential = new InteractiveBrowserCredential({
|
|
215
|
-
tenantId: "<YOUR_TENANT_ID>",
|
|
216
|
-
clientId: "<YOUR_CLIENT_ID>",
|
|
217
|
-
});
|
|
218
|
-
const client = new {{ clientClassName }}("<endpoint>", credential);
|
|
219
|
-
{{/if}}
|
|
220
|
-
});
|
|
221
|
-
|
|
222
|
-
it("SetLogLevel", async () => {
|
|
223
|
-
setLogLevel("info");
|
|
224
|
-
});
|
|
225
|
-
});
|
|
226
|
-
`;
|
|
227
|
-
//# sourceMappingURL=template.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"template.js","sourceRoot":"","sources":["../../../../src/rlc-common/test/template.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,WAAW,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA8H1B,CAAC;AAEF,MAAM,CAAC,MAAM,qBAAqB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;CA0BpC,CAAC;AAEF,MAAM,CAAC,MAAM,iBAAiB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;CAyBhC,CAAC;AAEF,MAAM,CAAC,MAAM,eAAe,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CA6C9B,CAAC"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transfrom-rlc-options.d.ts","sourceRoot":"","sources":["../../../src/transform/transfrom-rlc-options.ts"],"names":[],"mappings":"AACA,OAAO,EAAoB,OAAO,EAAE,MAAM,oBAAoB,CAAC;AAE/D,OAAO,EAAE,cAAc,EAAoB,MAAM,WAAW,CAAC;AAE7D,OAAO,EAKL,UAAU,EAEX,MAAM,wBAAwB,CAAC;AAGhC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAKpD,wBAAgB,mBAAmB,CACjC,cAAc,EAAE,cAAc,EAC9B,UAAU,EAAE,UAAU,GACrB,UAAU,CAUZ;AAuRD,wBAAgB,iBAAiB,CAAC,OAAO,EAAE,OAAO,EAAE,cAAc,EAAE,cAAc;;;;;;EA+BjF;AAQD,wBAAgB,iBAAiB,CAAC,UAAU,EAAE,UAAU,WAWvD"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"transfrom-rlc-options.js","sourceRoot":"","sources":["../../../src/transform/transfrom-rlc-options.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,6CAA6C,CAAC;AACxF,OAAO,EAAE,MAAM,EAAE,QAAQ,EAAW,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,iBAAiB,EAAE,MAAM,gBAAgB,CAAC;AACnD,OAAO,EAAkB,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7D,OAAO,EAAE,mBAAmB,EAAE,MAAM,sCAAsC,CAAC;AAC3E,OAAO,EACL,QAAQ,EACR,aAAa,EAEb,UAAU,GAGX,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,aAAa,EAAE,4BAA4B,EAAE,MAAM,0BAA0B,CAAC;AACvF,OAAO,EAAE,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,wBAAwB;QACvC,CAAC,CAAC,cAAc,CAAC,8BAA8B,CAAC,CAAC;IACrD,MAAM,6BAA6B,GACjC,YAAY,IAAI,YAAY,CAAC,6BAA6B;QACxD,CAAC,CAAC,YAAY,CAAC,6BAA6B;QAC5C,CAAC,CAAC,cAAc,CAAC,oCAAoC,CAAC,CAAC;IAC3D,OAAO;QACL,cAAc;QACd,gBAAgB;QAChB,uBAAuB;QACvB,wBAAwB;QACxB,6BAA6B;KAC9B,CAAC;AACJ,CAAC;AAED,SAAS,uBAAuB,CAAC,gBAAwB;IACvD,MAAM,SAAS,GAAG,gBAAgB,CAAC;IACnC,MAAM,eAAe,GAAG,SAAS,EAAE,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;IACrF,OAAO,eAAe,EAAE,SAAS,CAAC,CAAC,EAAE,CAAC,CAAC,KAAK,KAAK,CAAC,CAAC,CAAC,eAAe,CAAC,CAAC,CAAC,SAAS,CAAC;AAClF,CAAC;AAED,MAAM,UAAU,iBAAiB,CAAC,UAAsB;IACtD,KAAK,MAAM,MAAM,IAAI,UAAU,CAAC,UAAU,CAAC,OAAO,EAAE,CAAC;QACnD,IACE,mBAAmB,CAAC,MAAM,EAAE,UAAU,CAAC;aACpC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,CAAC;aACxB,QAAQ,CAAC,gBAAgB,CAAC,EAC7B,CAAC;YACD,OAAO,IAAI,CAAC;QACd,CAAC;IACH,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/src/rlc-common/index.ts
DELETED
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
export * from "./helpers/api-version-util.js";
|
|
5
|
-
export * from "./helpers/imports-util.js";
|
|
6
|
-
export * from "./helpers/name-constructors.js";
|
|
7
|
-
export * from "./helpers/name-utils.js";
|
|
8
|
-
export * from "./helpers/operation-helpers.js";
|
|
9
|
-
export * from "./helpers/schema-helpers.js";
|
|
10
|
-
export * from "./interfaces.js";
|
|
11
|
-
export * from "./metadata/build-api-extractor-config.js";
|
|
12
|
-
export * from "./metadata/build-changelog-file.js";
|
|
13
|
-
export * from "./metadata/build-es-lint-config.js";
|
|
14
|
-
export * from "./metadata/build-license-file.js";
|
|
15
|
-
export * from "./metadata/build-package-file.js";
|
|
16
|
-
export * from "./metadata/build-readme-file.js";
|
|
17
|
-
export * from "./metadata/build-sample-env-file.js";
|
|
18
|
-
export * from "./metadata/build-test-config.js";
|
|
19
|
-
export * from "./metadata/build-ts-config.js";
|
|
20
|
-
export * from "./metadata/build-vitest-config.js";
|
|
21
|
-
export * from "./metadata/build-warp-config.js";
|
|
22
|
-
export * from "./test/build-karma-config.js";
|
|
23
|
-
export * from "./test/build-recorded-client.js";
|
|
24
|
-
export * from "./test/build-sample-test.js";
|
|
25
|
-
export * from "./test/build-snippets.js";
|
|
@@ -1,345 +0,0 @@
|
|
|
1
|
-
// Copyright (c) Microsoft Corporation.
|
|
2
|
-
// Licensed under the MIT License.
|
|
3
|
-
|
|
4
|
-
export const paginateContent = `
|
|
5
|
-
import type { Client, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
6
|
-
import { createRestError } from "@azure-rest/core-client";
|
|
7
|
-
|
|
8
|
-
/**
|
|
9
|
-
* returns an async iterator that iterates over results. It also has a \`byPage\`
|
|
10
|
-
* method that returns pages of items at once.
|
|
11
|
-
*
|
|
12
|
-
* @param pagedResult - an object that specifies how to get pages.
|
|
13
|
-
* @returns a paged async iterator that iterates over results.
|
|
14
|
-
*/
|
|
15
|
-
function getPagedAsyncIterator<
|
|
16
|
-
TElement,
|
|
17
|
-
TPage = TElement[],
|
|
18
|
-
TPageSettings = PageSettings,
|
|
19
|
-
TLink = string,
|
|
20
|
-
>(
|
|
21
|
-
pagedResult: PagedResult<TPage, TPageSettings, TLink>,
|
|
22
|
-
): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {
|
|
23
|
-
const iter = getItemAsyncIterator<TElement, TPage, TLink, TPageSettings>(pagedResult);
|
|
24
|
-
return {
|
|
25
|
-
next() {
|
|
26
|
-
return iter.next();
|
|
27
|
-
},
|
|
28
|
-
[Symbol.asyncIterator]() {
|
|
29
|
-
return this;
|
|
30
|
-
},
|
|
31
|
-
byPage:
|
|
32
|
-
pagedResult?.byPage ??
|
|
33
|
-
(((settings?: PageSettings) => {
|
|
34
|
-
const { continuationToken } = settings ?? {};
|
|
35
|
-
return getPageAsyncIterator(pagedResult, {
|
|
36
|
-
pageLink: continuationToken as unknown as TLink | undefined,
|
|
37
|
-
});
|
|
38
|
-
}) as unknown as (settings?: TPageSettings) => AsyncIterableIterator<TPage>),
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
|
|
42
|
-
async function* getItemAsyncIterator<TElement, TPage, TLink, TPageSettings>(
|
|
43
|
-
pagedResult: PagedResult<TPage, TPageSettings, TLink>,
|
|
44
|
-
): AsyncIterableIterator<TElement> {
|
|
45
|
-
const pages = getPageAsyncIterator(pagedResult);
|
|
46
|
-
const firstVal = await pages.next();
|
|
47
|
-
// if the result does not have an array shape, i.e. TPage = TElement, then we return it as is
|
|
48
|
-
if (!Array.isArray(firstVal.value)) {
|
|
49
|
-
// can extract elements from this page
|
|
50
|
-
const { toElements } = pagedResult;
|
|
51
|
-
if (toElements) {
|
|
52
|
-
yield* toElements(firstVal.value) as TElement[];
|
|
53
|
-
for await (const page of pages) {
|
|
54
|
-
yield* toElements(page) as TElement[];
|
|
55
|
-
}
|
|
56
|
-
} else {
|
|
57
|
-
yield firstVal.value;
|
|
58
|
-
// \`pages\` is of type \`AsyncIterableIterator<TPage>\` but TPage = TElement in this case
|
|
59
|
-
yield* pages as unknown as AsyncIterableIterator<TElement>;
|
|
60
|
-
}
|
|
61
|
-
} else {
|
|
62
|
-
yield* firstVal.value;
|
|
63
|
-
for await (const page of pages) {
|
|
64
|
-
// pages is of type \`AsyncIterableIterator<TPage>\` so \`page\` is of type \`TPage\`. In this branch,
|
|
65
|
-
// it must be the case that \`TPage = TElement[]\`
|
|
66
|
-
yield* page as unknown as TElement[];
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async function* getPageAsyncIterator<TPage, TLink, TPageSettings>(
|
|
72
|
-
pagedResult: PagedResult<TPage, TPageSettings, TLink>,
|
|
73
|
-
options: {
|
|
74
|
-
pageLink?: TLink;
|
|
75
|
-
} = {},
|
|
76
|
-
): AsyncIterableIterator<TPage> {
|
|
77
|
-
const { pageLink } = options;
|
|
78
|
-
let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);
|
|
79
|
-
if (!response) {
|
|
80
|
-
return;
|
|
81
|
-
}
|
|
82
|
-
yield response.page;
|
|
83
|
-
while (response.nextPageLink) {
|
|
84
|
-
response = await pagedResult.getPage(response.nextPageLink);
|
|
85
|
-
if (!response) {
|
|
86
|
-
return;
|
|
87
|
-
}
|
|
88
|
-
yield response.page;
|
|
89
|
-
}
|
|
90
|
-
}
|
|
91
|
-
|
|
92
|
-
/**
|
|
93
|
-
* An interface that tracks the settings for paged iteration
|
|
94
|
-
*/
|
|
95
|
-
export interface PageSettings {
|
|
96
|
-
/**
|
|
97
|
-
* The token that keeps track of where to continue the iterator
|
|
98
|
-
*/
|
|
99
|
-
continuationToken?: string;
|
|
100
|
-
}
|
|
101
|
-
|
|
102
|
-
/**
|
|
103
|
-
* An interface that allows async iterable iteration both to completion and by page.
|
|
104
|
-
*/
|
|
105
|
-
export interface PagedAsyncIterableIterator<
|
|
106
|
-
TElement,
|
|
107
|
-
TPage = TElement[],
|
|
108
|
-
TPageSettings = PageSettings,
|
|
109
|
-
> {
|
|
110
|
-
/**
|
|
111
|
-
* The next method, part of the iteration protocol
|
|
112
|
-
*/
|
|
113
|
-
next(): Promise<IteratorResult<TElement>>;
|
|
114
|
-
/**
|
|
115
|
-
* The connection to the async iterator, part of the iteration protocol
|
|
116
|
-
*/
|
|
117
|
-
[Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
118
|
-
/**
|
|
119
|
-
* Return an AsyncIterableIterator that works a page at a time
|
|
120
|
-
*/
|
|
121
|
-
byPage: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;
|
|
122
|
-
}
|
|
123
|
-
|
|
124
|
-
/**
|
|
125
|
-
* An interface that describes how to communicate with the service.
|
|
126
|
-
*/
|
|
127
|
-
interface PagedResult<TPage, TPageSettings = PageSettings, TLink = string> {
|
|
128
|
-
/**
|
|
129
|
-
* Link to the first page of results.
|
|
130
|
-
*/
|
|
131
|
-
firstPageLink: TLink;
|
|
132
|
-
/**
|
|
133
|
-
* A method that returns a page of results.
|
|
134
|
-
*/
|
|
135
|
-
getPage: (
|
|
136
|
-
pageLink: TLink,
|
|
137
|
-
) => Promise<{ page: TPage; nextPageLink?: TLink } | undefined>;
|
|
138
|
-
/**
|
|
139
|
-
* a function to implement the \`byPage\` method on the paged async iterator.
|
|
140
|
-
*/
|
|
141
|
-
byPage?: (settings?: TPageSettings) => AsyncIterableIterator<TPage>;
|
|
142
|
-
|
|
143
|
-
/**
|
|
144
|
-
* A function to extract elements from a page.
|
|
145
|
-
*/
|
|
146
|
-
toElements?: (page: TPage) => unknown[];
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
/**
|
|
150
|
-
* Helper type to extract the type of an array
|
|
151
|
-
*/
|
|
152
|
-
export type GetArrayType<T> = T extends Array<infer TData> ? TData : never;
|
|
153
|
-
|
|
154
|
-
/**
|
|
155
|
-
* The type of a custom function that defines how to get a page and a link to the next one if any.
|
|
156
|
-
*/
|
|
157
|
-
export type GetPage<TPage> = (
|
|
158
|
-
pageLink: string,
|
|
159
|
-
) => Promise<{
|
|
160
|
-
page: TPage;
|
|
161
|
-
nextPageLink?: string;
|
|
162
|
-
}>;
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* Options for the paging helper
|
|
166
|
-
*/
|
|
167
|
-
export interface PagingOptions<TResponse> {
|
|
168
|
-
/**
|
|
169
|
-
* Custom function to extract pagination details for crating the PagedAsyncIterableIterator
|
|
170
|
-
*/
|
|
171
|
-
customGetPage?: GetPage<PaginateReturn<TResponse>[]>
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
/**
|
|
175
|
-
* Helper type to infer the Type of the paged elements from the response type
|
|
176
|
-
* This type is generated based on the swagger information for x-ms-pageable
|
|
177
|
-
* specifically on the itemName property which indicates the property of the response
|
|
178
|
-
* where the page items are found. The default value is \`value\`.
|
|
179
|
-
* This type will allow us to provide strongly typed Iterator based on the response we get as second parameter
|
|
180
|
-
*/
|
|
181
|
-
export type PaginateReturn<TResult> = TResult extends {{#each itemNames}}
|
|
182
|
-
{
|
|
183
|
-
|
|
184
|
-
body: { {{this}}?: infer TPage }
|
|
185
|
-
|
|
186
|
-
} {{#if @last }}{{else}} | {{/if}}
|
|
187
|
-
{{/each}}
|
|
188
|
-
? GetArrayType<TPage>
|
|
189
|
-
: Array<unknown>;
|
|
190
|
-
|
|
191
|
-
/**
|
|
192
|
-
* Helper to paginate results from an initial response that follows the specification of Autorest \`x-ms-pageable\` extension
|
|
193
|
-
* @param client - Client to use for sending the next page requests
|
|
194
|
-
* @param initialResponse - Initial response containing the nextLink and current page of elements
|
|
195
|
-
* @param customGetPage - Optional - Function to define how to extract the page and next link to be used to paginate the results
|
|
196
|
-
* @returns - PagedAsyncIterableIterator to iterate the elements
|
|
197
|
-
*/
|
|
198
|
-
export function paginate<TResponse extends PathUncheckedResponse>(
|
|
199
|
-
client: Client,
|
|
200
|
-
initialResponse: TResponse,
|
|
201
|
-
options: PagingOptions<TResponse> = {}
|
|
202
|
-
): PagedAsyncIterableIterator<PaginateReturn<TResponse>> {
|
|
203
|
-
// Extract element type from initial response
|
|
204
|
-
type TElement = PaginateReturn<TResponse>;
|
|
205
|
-
let firstRun = true;
|
|
206
|
-
{{#if isComplexPaging}}
|
|
207
|
-
// We need to check the response for success before trying to inspect it looking for
|
|
208
|
-
// the properties to use for nextLink and itemName
|
|
209
|
-
checkPagingRequest(initialResponse);
|
|
210
|
-
const { itemName, nextLinkName } = getPaginationProperties(initialResponse);
|
|
211
|
-
{{else}}
|
|
212
|
-
const itemName = {{ quoteWrap itemNames }};
|
|
213
|
-
const nextLinkName = {{quoteWrap nextLinkNames}};
|
|
214
|
-
{{/if}}
|
|
215
|
-
const { customGetPage } = options;
|
|
216
|
-
const pagedResult: PagedResult<TElement[]> = {
|
|
217
|
-
firstPageLink: "",
|
|
218
|
-
getPage:
|
|
219
|
-
typeof customGetPage === "function"
|
|
220
|
-
? customGetPage
|
|
221
|
-
: async (pageLink: string) => {
|
|
222
|
-
const result = firstRun
|
|
223
|
-
? initialResponse
|
|
224
|
-
: await client.pathUnchecked(pageLink).get();
|
|
225
|
-
firstRun = false;
|
|
226
|
-
checkPagingRequest(result);
|
|
227
|
-
const nextLink = getNextLink(result.body, nextLinkName);
|
|
228
|
-
const values = getElements<TElement>(result.body, itemName);
|
|
229
|
-
return {
|
|
230
|
-
page: values,
|
|
231
|
-
nextPageLink: nextLink
|
|
232
|
-
};
|
|
233
|
-
}
|
|
234
|
-
};
|
|
235
|
-
|
|
236
|
-
return getPagedAsyncIterator(pagedResult);
|
|
237
|
-
}
|
|
238
|
-
|
|
239
|
-
/**
|
|
240
|
-
* Gets for the value of nextLink in the body
|
|
241
|
-
*/
|
|
242
|
-
function getNextLink(body: unknown, nextLinkName?: string): string | undefined {
|
|
243
|
-
if (!nextLinkName) {
|
|
244
|
-
return undefined;
|
|
245
|
-
}
|
|
246
|
-
|
|
247
|
-
const nextLink = (body as Record<string, unknown>)[nextLinkName];
|
|
248
|
-
|
|
249
|
-
if (typeof nextLink !== "string" && typeof nextLink !== "undefined") {
|
|
250
|
-
throw new Error(
|
|
251
|
-
\`Body Property \${nextLinkName} should be a string or undefined\`
|
|
252
|
-
);
|
|
253
|
-
}
|
|
254
|
-
|
|
255
|
-
return nextLink;
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
/**
|
|
259
|
-
* Gets the elements of the current request in the body.
|
|
260
|
-
*/
|
|
261
|
-
function getElements<T = unknown>(body: unknown, itemName: string): T[] {
|
|
262
|
-
const value = (body as Record<string, unknown>)[itemName] as T[];
|
|
263
|
-
|
|
264
|
-
// value has to be an array according to the x-ms-pageable extension.
|
|
265
|
-
// The fact that this must be an array is used above to calculate the
|
|
266
|
-
// type of elements in the page in PaginateReturn
|
|
267
|
-
if (!Array.isArray(value)) {
|
|
268
|
-
throw new Error(
|
|
269
|
-
\`Couldn't paginate response\\n Body doesn't contain an array property with name: \${itemName}\`
|
|
270
|
-
);
|
|
271
|
-
}
|
|
272
|
-
|
|
273
|
-
return value ?? [];
|
|
274
|
-
}
|
|
275
|
-
|
|
276
|
-
/**
|
|
277
|
-
* Checks if a request failed
|
|
278
|
-
*/
|
|
279
|
-
function checkPagingRequest(response: PathUncheckedResponse): void {
|
|
280
|
-
const Http2xxStatusCodes = [
|
|
281
|
-
"200",
|
|
282
|
-
"201",
|
|
283
|
-
"202",
|
|
284
|
-
"203",
|
|
285
|
-
"204",
|
|
286
|
-
"205",
|
|
287
|
-
"206",
|
|
288
|
-
"207",
|
|
289
|
-
"208",
|
|
290
|
-
"226"
|
|
291
|
-
];
|
|
292
|
-
if (!Http2xxStatusCodes.includes(response.status)) {
|
|
293
|
-
throw createRestError(
|
|
294
|
-
\`Pagination failed with unexpected statusCode \${response.status}\`,
|
|
295
|
-
response
|
|
296
|
-
);
|
|
297
|
-
}
|
|
298
|
-
}
|
|
299
|
-
|
|
300
|
-
{{#if isComplexPaging}}
|
|
301
|
-
/**
|
|
302
|
-
* Extracts the itemName and nextLinkName from the initial response to use them for pagination
|
|
303
|
-
*/
|
|
304
|
-
function getPaginationProperties(initialResponse: PathUncheckedResponse) {
|
|
305
|
-
// Build a set with the passed custom nextLinkNames
|
|
306
|
-
const nextLinkNames = new Set([{{ quoteWrap nextLinkNames }}]);
|
|
307
|
-
|
|
308
|
-
// Build a set with the passed custom set of itemNames
|
|
309
|
-
const itemNames = new Set([{{ quoteWrap itemNames }}]);
|
|
310
|
-
|
|
311
|
-
let nextLinkName: string | undefined;
|
|
312
|
-
let itemName: string | undefined;
|
|
313
|
-
|
|
314
|
-
for (const name of nextLinkNames) {
|
|
315
|
-
const nextLink = (initialResponse.body as Record<string, unknown>)[
|
|
316
|
-
name
|
|
317
|
-
] as string;
|
|
318
|
-
if (nextLink) {
|
|
319
|
-
nextLinkName = name;
|
|
320
|
-
break;
|
|
321
|
-
}
|
|
322
|
-
}
|
|
323
|
-
|
|
324
|
-
for (const name of itemNames) {
|
|
325
|
-
const item = (initialResponse.body as Record<string, unknown>)[
|
|
326
|
-
name
|
|
327
|
-
] as string;
|
|
328
|
-
if (item) {
|
|
329
|
-
itemName = name;
|
|
330
|
-
break;
|
|
331
|
-
}
|
|
332
|
-
}
|
|
333
|
-
|
|
334
|
-
if (!itemName) {
|
|
335
|
-
throw new Error(
|
|
336
|
-
\`Couldn't paginate response\\n Body doesn't contain an array property with name: \${[
|
|
337
|
-
...itemNames
|
|
338
|
-
].join(" OR ")}\`
|
|
339
|
-
);
|
|
340
|
-
}
|
|
341
|
-
|
|
342
|
-
return { itemName, nextLinkName };
|
|
343
|
-
}
|
|
344
|
-
{{/if}}
|
|
345
|
-
`;
|