@azure-tools/typespec-ts 0.54.0 → 0.54.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +34 -10
- package/README.md +0 -4
- package/dist/src/context-manager.d.ts +75 -0
- package/dist/src/context-manager.d.ts.map +1 -0
- package/dist/src/context-manager.js +59 -0
- package/dist/src/context-manager.js.map +1 -0
- package/dist/src/framework/declaration.d.ts +1 -1
- package/dist/src/framework/declaration.d.ts.map +1 -1
- package/dist/src/framework/declaration.js +2 -4
- package/dist/src/framework/declaration.js.map +1 -1
- package/dist/src/framework/dependency.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.d.ts +1 -1
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +32 -41
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdk-types.d.ts +27 -0
- package/dist/src/framework/hooks/sdk-types.d.ts.map +1 -0
- package/dist/src/framework/hooks/sdk-types.js +158 -0
- package/dist/src/framework/hooks/sdk-types.js.map +1 -0
- package/dist/src/framework/hooks/use-dependencies.d.ts +4 -0
- package/dist/src/framework/hooks/use-dependencies.d.ts.map +1 -0
- package/dist/src/framework/hooks/use-dependencies.js +13 -0
- package/dist/src/framework/hooks/use-dependencies.js.map +1 -0
- package/dist/src/framework/load-static-helpers.d.ts +1 -1
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +17 -31
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/framework/reference.d.ts.map +1 -1
- package/dist/src/framework/reference.js +2 -2
- package/dist/src/framework/reference.js.map +1 -1
- package/dist/src/framework/sample.js +8 -8
- package/dist/src/framework/sample.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +111 -100
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +1 -1
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +140 -140
- package/dist/src/lib.js.map +1 -1
- package/dist/src/meta-tree.d.ts +7 -0
- package/dist/src/meta-tree.d.ts.map +1 -0
- package/dist/src/meta-tree.js +2 -0
- package/dist/src/meta-tree.js.map +1 -0
- package/dist/src/modular/build-classical-client.d.ts +6 -0
- package/dist/src/modular/build-classical-client.d.ts.map +1 -0
- package/dist/src/modular/build-classical-client.js +345 -0
- package/dist/src/modular/build-classical-client.js.map +1 -0
- package/dist/src/modular/build-classical-operation-groups.d.ts +6 -0
- package/dist/src/modular/build-classical-operation-groups.d.ts.map +1 -0
- package/dist/src/modular/build-classical-operation-groups.js +48 -0
- package/dist/src/modular/build-classical-operation-groups.js.map +1 -0
- package/dist/src/modular/build-client-context.d.ts +13 -0
- package/dist/src/modular/build-client-context.d.ts.map +1 -0
- package/dist/src/modular/build-client-context.js +246 -0
- package/dist/src/modular/build-client-context.js.map +1 -0
- package/dist/src/modular/build-modular-options.d.ts +6 -0
- package/dist/src/modular/build-modular-options.d.ts.map +1 -0
- package/dist/src/modular/build-modular-options.js +14 -0
- package/dist/src/modular/build-modular-options.js.map +1 -0
- package/dist/src/modular/build-operations.d.ts +21 -0
- package/dist/src/modular/build-operations.d.ts.map +1 -0
- package/dist/src/modular/build-operations.js +172 -0
- package/dist/src/modular/build-operations.js.map +1 -0
- package/dist/src/modular/build-project-files.d.ts +4 -0
- package/dist/src/modular/build-project-files.d.ts.map +1 -0
- package/dist/src/modular/build-project-files.js +91 -0
- package/dist/src/modular/build-project-files.js.map +1 -0
- package/dist/src/modular/build-restore-poller.d.ts +5 -0
- package/dist/src/modular/build-restore-poller.d.ts.map +1 -0
- package/dist/src/modular/build-restore-poller.js +216 -0
- package/dist/src/modular/build-restore-poller.js.map +1 -0
- package/dist/src/modular/build-root-index.d.ts +13 -0
- package/dist/src/modular/build-root-index.d.ts.map +1 -0
- package/dist/src/modular/build-root-index.js +279 -0
- package/dist/src/modular/build-root-index.js.map +1 -0
- package/dist/src/modular/build-subpath-index.d.ts +16 -0
- package/dist/src/modular/build-subpath-index.d.ts.map +1 -0
- package/dist/src/modular/build-subpath-index.js +119 -0
- package/dist/src/modular/build-subpath-index.js.map +1 -0
- package/dist/src/modular/emit-logger-file.d.ts +3 -0
- package/dist/src/modular/emit-logger-file.d.ts.map +1 -0
- package/dist/src/modular/emit-logger-file.js +18 -0
- package/dist/src/modular/emit-logger-file.js.map +1 -0
- package/dist/src/modular/emit-models-options.d.ts +5 -0
- package/dist/src/modular/emit-models-options.d.ts.map +1 -0
- package/dist/src/modular/emit-models-options.js +35 -0
- package/dist/src/modular/emit-models-options.js.map +1 -0
- package/dist/src/modular/emit-models.d.ts +23 -0
- package/dist/src/modular/emit-models.d.ts.map +1 -0
- package/dist/src/modular/emit-models.js +864 -0
- package/dist/src/modular/emit-models.js.map +1 -0
- package/dist/src/modular/emit-samples.d.ts +7 -0
- package/dist/src/modular/emit-samples.d.ts.map +1 -0
- package/dist/src/modular/emit-samples.js +500 -0
- package/dist/src/modular/emit-samples.js.map +1 -0
- package/dist/src/modular/emit-tests.d.ts +7 -0
- package/dist/src/modular/emit-tests.d.ts.map +1 -0
- package/dist/src/modular/emit-tests.js +155 -0
- package/dist/src/modular/emit-tests.js.map +1 -0
- package/dist/src/modular/external-dependencies.js +54 -54
- package/dist/src/modular/helpers/classical-operation-helpers.d.ts +7 -0
- package/dist/src/modular/helpers/classical-operation-helpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/classical-operation-helpers.js +258 -0
- package/dist/src/modular/helpers/classical-operation-helpers.js.map +1 -0
- package/dist/src/modular/helpers/client-helpers.d.ts +34 -0
- package/dist/src/modular/helpers/client-helpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/client-helpers.js +259 -0
- package/dist/src/modular/helpers/client-helpers.js.map +1 -0
- package/dist/src/modular/helpers/client-option-helpers.d.ts +43 -0
- package/dist/src/modular/helpers/client-option-helpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/client-option-helpers.js +103 -0
- package/dist/src/modular/helpers/client-option-helpers.js.map +1 -0
- package/dist/src/modular/helpers/docs-helpers.d.ts +3 -0
- package/dist/src/modular/helpers/docs-helpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/docs-helpers.js +10 -0
- package/dist/src/modular/helpers/docs-helpers.js.map +1 -0
- package/dist/src/modular/helpers/example-value-helpers.d.ts +83 -0
- package/dist/src/modular/helpers/example-value-helpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/example-value-helpers.js +639 -0
- package/dist/src/modular/helpers/example-value-helpers.js.map +1 -0
- package/dist/src/modular/helpers/naming-helpers.d.ts +22 -0
- package/dist/src/modular/helpers/naming-helpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/naming-helpers.js +59 -0
- package/dist/src/modular/helpers/naming-helpers.js.map +1 -0
- package/dist/src/modular/helpers/operation-helpers.d.ts +105 -0
- package/dist/src/modular/helpers/operation-helpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/operation-helpers.js +2328 -0
- package/dist/src/modular/helpers/operation-helpers.js.map +1 -0
- package/dist/src/modular/helpers/type-helpers.d.ts +22 -0
- package/dist/src/modular/helpers/type-helpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/type-helpers.js +94 -0
- package/dist/src/modular/helpers/type-helpers.js.map +1 -0
- package/dist/src/modular/serialization/build-deserializer-function.d.ts +7 -0
- package/dist/src/modular/serialization/build-deserializer-function.d.ts.map +1 -0
- package/dist/src/modular/serialization/build-deserializer-function.js +401 -0
- package/dist/src/modular/serialization/build-deserializer-function.js.map +1 -0
- package/dist/src/modular/serialization/build-serializer-function.d.ts +7 -0
- package/dist/src/modular/serialization/build-serializer-function.d.ts.map +1 -0
- package/dist/src/modular/serialization/build-serializer-function.js +442 -0
- package/dist/src/modular/serialization/build-serializer-function.js.map +1 -0
- package/dist/src/modular/serialization/build-xml-serializer-function.d.ts +44 -0
- package/dist/src/modular/serialization/build-xml-serializer-function.d.ts.map +1 -0
- package/dist/src/modular/serialization/build-xml-serializer-function.js +729 -0
- package/dist/src/modular/serialization/build-xml-serializer-function.js.map +1 -0
- package/dist/src/modular/serialization/serialize-utils.d.ts +37 -0
- package/dist/src/modular/serialization/serialize-utils.d.ts.map +1 -0
- package/dist/src/modular/serialization/serialize-utils.js +145 -0
- package/dist/src/modular/serialization/serialize-utils.js.map +1 -0
- package/dist/src/modular/static-helpers-metadata.js +60 -60
- package/dist/src/modular/type-expressions/get-credential-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-credential-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.js +1 -2
- package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.js +10 -13
- package/dist/src/modular/type-expressions/get-model-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.js +2 -3
- 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 +5 -11
- package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
- package/dist/src/rlc-common/build-client-definitions.d.ts +6 -0
- package/dist/src/rlc-common/build-client-definitions.d.ts.map +1 -0
- package/dist/src/rlc-common/build-client-definitions.js +157 -0
- package/dist/src/rlc-common/build-client-definitions.js.map +1 -0
- package/dist/src/rlc-common/build-client.d.ts +9 -0
- package/dist/src/rlc-common/build-client.d.ts.map +1 -0
- package/dist/src/rlc-common/build-client.js +391 -0
- package/dist/src/rlc-common/build-client.js.map +1 -0
- package/dist/src/rlc-common/build-index-file.d.ts +6 -0
- package/dist/src/rlc-common/build-index-file.d.ts.map +1 -0
- package/dist/src/rlc-common/build-index-file.js +241 -0
- package/dist/src/rlc-common/build-index-file.js.map +1 -0
- package/dist/src/rlc-common/build-is-unexpected-helper.d.ts +6 -0
- package/dist/src/rlc-common/build-is-unexpected-helper.d.ts.map +1 -0
- package/dist/src/rlc-common/build-is-unexpected-helper.js +223 -0
- package/dist/src/rlc-common/build-is-unexpected-helper.js.map +1 -0
- package/dist/src/rlc-common/build-logger.d.ts +6 -0
- package/dist/src/rlc-common/build-logger.d.ts.map +1 -0
- package/dist/src/rlc-common/build-logger.js +31 -0
- package/dist/src/rlc-common/build-logger.js.map +1 -0
- package/dist/src/rlc-common/build-method-shortcuts.d.ts +5 -0
- package/dist/src/rlc-common/build-method-shortcuts.d.ts.map +1 -0
- package/dist/src/rlc-common/build-method-shortcuts.js +54 -0
- package/dist/src/rlc-common/build-method-shortcuts.js.map +1 -0
- package/dist/src/rlc-common/build-object-types.d.ts +29 -0
- package/dist/src/rlc-common/build-object-types.d.ts.map +1 -0
- package/dist/src/rlc-common/build-object-types.js +412 -0
- package/dist/src/rlc-common/build-object-types.js.map +1 -0
- package/dist/src/rlc-common/build-paginate-helper.d.ts +6 -0
- package/dist/src/rlc-common/build-paginate-helper.d.ts.map +1 -0
- package/dist/src/rlc-common/build-paginate-helper.js +27 -0
- package/dist/src/rlc-common/build-paginate-helper.js.map +1 -0
- package/dist/src/rlc-common/build-parameter-types.d.ts +14 -0
- package/dist/src/rlc-common/build-parameter-types.d.ts.map +1 -0
- package/dist/src/rlc-common/build-parameter-types.js +391 -0
- package/dist/src/rlc-common/build-parameter-types.js.map +1 -0
- package/dist/src/rlc-common/build-polling-helper.d.ts +6 -0
- package/dist/src/rlc-common/build-polling-helper.d.ts.map +1 -0
- package/dist/src/rlc-common/build-polling-helper.js +61 -0
- package/dist/src/rlc-common/build-polling-helper.js.map +1 -0
- package/dist/src/rlc-common/build-response-types.d.ts +6 -0
- package/dist/src/rlc-common/build-response-types.d.ts.map +1 -0
- package/dist/src/rlc-common/build-response-types.js +143 -0
- package/dist/src/rlc-common/build-response-types.js.map +1 -0
- package/dist/src/rlc-common/build-samples.d.ts +3 -0
- package/dist/src/rlc-common/build-samples.d.ts.map +1 -0
- package/dist/src/rlc-common/build-samples.js +30 -0
- package/dist/src/rlc-common/build-samples.js.map +1 -0
- package/dist/src/rlc-common/build-schema-type.d.ts +20 -0
- package/dist/src/rlc-common/build-schema-type.d.ts.map +1 -0
- package/dist/src/rlc-common/build-schema-type.js +71 -0
- package/dist/src/rlc-common/build-schema-type.js.map +1 -0
- package/dist/src/rlc-common/build-serialize-helper.d.ts +6 -0
- package/dist/src/rlc-common/build-serialize-helper.d.ts.map +1 -0
- package/dist/src/rlc-common/build-serialize-helper.js +36 -0
- package/dist/src/rlc-common/build-serialize-helper.js.map +1 -0
- package/dist/src/rlc-common/build-top-level-index-file.d.ts +6 -0
- package/dist/src/rlc-common/build-top-level-index-file.d.ts.map +1 -0
- package/dist/src/rlc-common/build-top-level-index-file.js +48 -0
- package/dist/src/rlc-common/build-top-level-index-file.js.map +1 -0
- package/dist/src/rlc-common/helpers/api-version-util.d.ts +17 -0
- package/dist/src/rlc-common/helpers/api-version-util.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/api-version-util.js +43 -0
- package/dist/src/rlc-common/helpers/api-version-util.js.map +1 -0
- package/dist/src/rlc-common/helpers/imports-util.d.ts +18 -0
- package/dist/src/rlc-common/helpers/imports-util.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/imports-util.js +164 -0
- package/dist/src/rlc-common/helpers/imports-util.js.map +1 -0
- package/dist/src/rlc-common/helpers/name-constructors.d.ts +42 -0
- package/dist/src/rlc-common/helpers/name-constructors.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/name-constructors.js +61 -0
- package/dist/src/rlc-common/helpers/name-constructors.js.map +1 -0
- package/dist/src/rlc-common/helpers/name-utils.d.ts +37 -0
- package/dist/src/rlc-common/helpers/name-utils.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/name-utils.js +240 -0
- package/dist/src/rlc-common/helpers/name-utils.js.map +1 -0
- package/dist/src/rlc-common/helpers/operation-helpers.d.ts +16 -0
- package/dist/src/rlc-common/helpers/operation-helpers.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/operation-helpers.js +104 -0
- package/dist/src/rlc-common/helpers/operation-helpers.js.map +1 -0
- package/dist/src/rlc-common/helpers/package-util.d.ts +7 -0
- package/dist/src/rlc-common/helpers/package-util.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/package-util.js +10 -0
- package/dist/src/rlc-common/helpers/package-util.js.map +1 -0
- package/dist/src/rlc-common/helpers/path-utils.d.ts +2 -0
- package/dist/src/rlc-common/helpers/path-utils.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/path-utils.js +10 -0
- package/dist/src/rlc-common/helpers/path-utils.js.map +1 -0
- package/dist/src/rlc-common/helpers/schema-helpers.d.ts +10 -0
- package/dist/src/rlc-common/helpers/schema-helpers.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/schema-helpers.js +37 -0
- package/dist/src/rlc-common/helpers/schema-helpers.js.map +1 -0
- package/dist/src/rlc-common/helpers/shortcut-methods.d.ts +4 -0
- package/dist/src/rlc-common/helpers/shortcut-methods.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/shortcut-methods.js +49 -0
- package/dist/src/rlc-common/helpers/shortcut-methods.js.map +1 -0
- package/dist/src/rlc-common/helpers/type-util.d.ts +32 -0
- package/dist/src/rlc-common/helpers/type-util.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/type-util.js +162 -0
- package/dist/src/rlc-common/helpers/type-util.js.map +1 -0
- package/dist/src/rlc-common/helpers/value-generation-util.d.ts +12 -0
- package/dist/src/rlc-common/helpers/value-generation-util.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/value-generation-util.js +161 -0
- package/dist/src/rlc-common/helpers/value-generation-util.js.map +1 -0
- package/dist/src/rlc-common/index.d.ts +39 -39
- package/dist/src/rlc-common/index.d.ts.map +1 -1
- package/dist/src/rlc-common/index.js +39 -39
- package/dist/src/rlc-common/index.js.map +1 -1
- package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
- package/dist/src/rlc-common/interfaces.js.map +1 -1
- package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts +6 -0
- package/dist/src/rlc-common/metadata/build-api-extractor-config.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/build-api-extractor-config.js +55 -0
- package/dist/src/rlc-common/metadata/build-api-extractor-config.js.map +1 -0
- package/dist/src/rlc-common/metadata/build-changelog-file.d.ts +6 -0
- package/dist/src/rlc-common/metadata/build-changelog-file.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/build-changelog-file.js +25 -0
- package/dist/src/rlc-common/metadata/build-changelog-file.js.map +1 -0
- package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts +6 -0
- package/dist/src/rlc-common/metadata/build-es-lint-config.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/build-es-lint-config.js +79 -0
- package/dist/src/rlc-common/metadata/build-es-lint-config.js.map +1 -0
- package/dist/src/rlc-common/metadata/build-license-file.d.ts +5 -0
- package/dist/src/rlc-common/metadata/build-license-file.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/build-license-file.js +32 -0
- package/dist/src/rlc-common/metadata/build-license-file.js.map +1 -0
- package/dist/src/rlc-common/metadata/build-package-file.d.ts +25 -0
- package/dist/src/rlc-common/metadata/build-package-file.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/build-package-file.js +197 -0
- package/dist/src/rlc-common/metadata/build-package-file.js.map +1 -0
- package/dist/src/rlc-common/metadata/build-readme-file.d.ts +11 -0
- package/dist/src/rlc-common/metadata/build-readme-file.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/build-readme-file.js +418 -0
- package/dist/src/rlc-common/metadata/build-readme-file.js.map +1 -0
- package/dist/src/rlc-common/metadata/build-rollup-config.d.ts +6 -0
- package/dist/src/rlc-common/metadata/build-rollup-config.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/build-rollup-config.js +140 -0
- package/dist/src/rlc-common/metadata/build-rollup-config.js.map +1 -0
- package/dist/src/rlc-common/metadata/build-sample-env-file.d.ts +6 -0
- package/dist/src/rlc-common/metadata/build-sample-env-file.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/build-sample-env-file.js +15 -0
- package/dist/src/rlc-common/metadata/build-sample-env-file.js.map +1 -0
- package/dist/src/rlc-common/metadata/build-test-config.d.ts +16 -0
- package/dist/src/rlc-common/metadata/build-test-config.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/build-test-config.js +54 -0
- package/dist/src/rlc-common/metadata/build-test-config.js.map +1 -0
- package/dist/src/rlc-common/metadata/build-ts-config.d.ts +61 -0
- package/dist/src/rlc-common/metadata/build-ts-config.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/build-ts-config.js +170 -0
- package/dist/src/rlc-common/metadata/build-ts-config.js.map +1 -0
- package/dist/src/rlc-common/metadata/build-vitest-config.d.ts +6 -0
- package/dist/src/rlc-common/metadata/build-vitest-config.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/build-vitest-config.js +26 -0
- package/dist/src/rlc-common/metadata/build-vitest-config.js.map +1 -0
- package/dist/src/rlc-common/metadata/build-warp-config.d.ts +20 -0
- package/dist/src/rlc-common/metadata/build-warp-config.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/build-warp-config.js +76 -0
- package/dist/src/rlc-common/metadata/build-warp-config.js.map +1 -0
- package/dist/src/rlc-common/metadata/package-json/azure-package-common.d.ts +51 -0
- package/dist/src/rlc-common/metadata/package-json/azure-package-common.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/package-json/azure-package-common.js +121 -0
- package/dist/src/rlc-common/metadata/package-json/azure-package-common.js.map +1 -0
- package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts +242 -0
- package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js +171 -0
- package/dist/src/rlc-common/metadata/package-json/build-azure-monorepo-package.js.map +1 -0
- package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.d.ts +8 -0
- package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.js +101 -0
- package/dist/src/rlc-common/metadata/package-json/build-azure-standalone-package.js.map +1 -0
- package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.d.ts +57 -0
- package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.js +53 -0
- package/dist/src/rlc-common/metadata/package-json/build-flavorless-package.js.map +1 -0
- package/dist/src/rlc-common/metadata/package-json/package-common.d.ts +64 -0
- package/dist/src/rlc-common/metadata/package-json/package-common.d.ts.map +1 -0
- package/dist/src/rlc-common/metadata/package-json/package-common.js +180 -0
- package/dist/src/rlc-common/metadata/package-json/package-common.js.map +1 -0
- package/dist/src/rlc-common/metadata/utils.js +1 -2
- package/dist/src/rlc-common/metadata/utils.js.map +1 -1
- package/dist/src/rlc-common/static/paginate-content.d.ts +2 -0
- package/dist/src/rlc-common/static/paginate-content.d.ts.map +1 -0
- package/dist/src/rlc-common/static/paginate-content.js +345 -0
- package/dist/src/rlc-common/static/paginate-content.js.map +1 -0
- package/dist/src/rlc-common/static/polling-content.d.ts +2 -0
- package/dist/src/rlc-common/static/polling-content.d.ts.map +1 -0
- package/dist/src/rlc-common/static/polling-content.js +225 -0
- package/dist/src/rlc-common/static/polling-content.js.map +1 -0
- package/dist/src/rlc-common/static/sample-template.d.ts +2 -0
- package/dist/src/rlc-common/static/sample-template.d.ts.map +1 -0
- package/dist/src/rlc-common/static/sample-template.js +56 -0
- package/dist/src/rlc-common/static/sample-template.js.map +1 -0
- package/dist/src/rlc-common/static/serialize-helper.d.ts +6 -0
- package/dist/src/rlc-common/static/serialize-helper.d.ts.map +1 -0
- package/dist/src/rlc-common/static/serialize-helper.js +31 -0
- package/dist/src/rlc-common/static/serialize-helper.js.map +1 -0
- package/dist/src/rlc-common/test/build-karma-config.d.ts +6 -0
- package/dist/src/rlc-common/test/build-karma-config.d.ts.map +1 -0
- package/dist/src/rlc-common/test/build-karma-config.js +11 -0
- package/dist/src/rlc-common/test/build-karma-config.js.map +1 -0
- package/dist/src/rlc-common/test/build-recorded-client.d.ts +6 -0
- package/dist/src/rlc-common/test/build-recorded-client.d.ts.map +1 -0
- package/dist/src/rlc-common/test/build-recorded-client.js +17 -0
- package/dist/src/rlc-common/test/build-recorded-client.js.map +1 -0
- package/dist/src/rlc-common/test/build-sample-test.d.ts +6 -0
- package/dist/src/rlc-common/test/build-sample-test.d.ts.map +1 -0
- package/dist/src/rlc-common/test/build-sample-test.js +14 -0
- package/dist/src/rlc-common/test/build-sample-test.js.map +1 -0
- package/dist/src/rlc-common/test/build-snippets.d.ts +6 -0
- package/dist/src/rlc-common/test/build-snippets.d.ts.map +1 -0
- package/dist/src/rlc-common/test/build-snippets.js +26 -0
- package/dist/src/rlc-common/test/build-snippets.js.map +1 -0
- package/dist/src/rlc-common/transform-sample-groups.d.ts +9 -0
- package/dist/src/rlc-common/transform-sample-groups.d.ts.map +1 -0
- package/dist/src/rlc-common/transform-sample-groups.js +313 -0
- package/dist/src/rlc-common/transform-sample-groups.js.map +1 -0
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +1 -1
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/transform/transform-api-version-info.d.ts +6 -0
- package/dist/src/transform/transform-api-version-info.d.ts.map +1 -0
- package/dist/src/transform/transform-api-version-info.js +78 -0
- package/dist/src/transform/transform-api-version-info.js.map +1 -0
- package/dist/src/transform/transform-helper-function-details.d.ts +5 -0
- package/dist/src/transform/transform-helper-function-details.d.ts.map +1 -0
- package/dist/src/transform/transform-helper-function-details.js +74 -0
- package/dist/src/transform/transform-helper-function-details.js.map +1 -0
- package/dist/src/transform/transform-parameters.d.ts +14 -0
- package/dist/src/transform/transform-parameters.d.ts.map +1 -0
- package/dist/src/transform/transform-parameters.js +201 -0
- package/dist/src/transform/transform-parameters.js.map +1 -0
- package/dist/src/transform/transform-paths.d.ts +5 -0
- package/dist/src/transform/transform-paths.d.ts.map +1 -0
- package/dist/src/transform/transform-paths.js +102 -0
- package/dist/src/transform/transform-paths.js.map +1 -0
- package/dist/src/transform/transform-responses.d.ts +5 -0
- package/dist/src/transform/transform-responses.d.ts.map +1 -0
- package/dist/src/transform/transform-responses.js +171 -0
- package/dist/src/transform/transform-responses.js.map +1 -0
- package/dist/src/transform/transform-schemas.d.ts +4 -0
- package/dist/src/transform/transform-schemas.d.ts.map +1 -0
- package/dist/src/transform/transform-schemas.js +191 -0
- package/dist/src/transform/transform-schemas.js.map +1 -0
- package/dist/src/transform/transform-telemetry-info.d.ts +4 -0
- package/dist/src/transform/transform-telemetry-info.d.ts.map +1 -0
- package/dist/src/transform/transform-telemetry-info.js +22 -0
- package/dist/src/transform/transform-telemetry-info.js.map +1 -0
- package/dist/src/transform/transform.d.ts +1 -1
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/transform/transform.js +37 -36
- package/dist/src/transform/transform.js.map +1 -1
- package/dist/src/transform/transfrom-rlc-options.d.ts +14 -0
- package/dist/src/transform/transfrom-rlc-options.d.ts.map +1 -0
- package/dist/src/transform/transfrom-rlc-options.js +369 -0
- package/dist/src/transform/transfrom-rlc-options.js.map +1 -0
- package/dist/src/utils/client-utils.d.ts +10 -0
- package/dist/src/utils/client-utils.d.ts.map +1 -0
- package/dist/src/utils/client-utils.js +124 -0
- package/dist/src/utils/client-utils.js.map +1 -0
- package/dist/src/utils/credential-utils.d.ts +15 -0
- package/dist/src/utils/credential-utils.d.ts.map +1 -0
- package/dist/src/utils/credential-utils.js +68 -0
- package/dist/src/utils/credential-utils.js.map +1 -0
- package/dist/src/utils/cross-language-def.d.ts +6 -0
- package/dist/src/utils/cross-language-def.d.ts.map +1 -0
- package/dist/src/utils/cross-language-def.js +59 -0
- package/dist/src/utils/cross-language-def.js.map +1 -0
- package/dist/src/utils/emit-util.d.ts +5 -0
- package/dist/src/utils/emit-util.d.ts.map +1 -0
- package/dist/src/utils/emit-util.js +71 -0
- package/dist/src/utils/emit-util.js.map +1 -0
- package/dist/src/utils/file-system-utils.d.ts +5 -0
- package/dist/src/utils/file-system-utils.d.ts.map +1 -0
- package/dist/src/utils/file-system-utils.js +59 -0
- package/dist/src/utils/file-system-utils.js.map +1 -0
- package/dist/src/utils/import-helper.d.ts +10 -0
- package/dist/src/utils/import-helper.d.ts.map +1 -0
- package/dist/src/utils/import-helper.js +51 -0
- package/dist/src/utils/import-helper.js.map +1 -0
- package/dist/src/utils/interfaces.d.ts +2 -2
- package/dist/src/utils/interfaces.d.ts.map +1 -1
- package/dist/src/utils/media-types.d.ts +28 -0
- package/dist/src/utils/media-types.d.ts.map +1 -0
- package/dist/src/utils/media-types.js +124 -0
- package/dist/src/utils/media-types.js.map +1 -0
- package/dist/src/utils/model-utils.d.ts +60 -0
- package/dist/src/utils/model-utils.d.ts.map +1 -0
- package/dist/src/utils/model-utils.js +1480 -0
- package/dist/src/utils/model-utils.js.map +1 -0
- package/dist/src/utils/namespace-utils.d.ts +6 -0
- package/dist/src/utils/namespace-utils.d.ts.map +1 -0
- package/dist/src/utils/namespace-utils.js +69 -0
- package/dist/src/utils/namespace-utils.js.map +1 -0
- package/dist/src/utils/operation-util.d.ts +97 -0
- package/dist/src/utils/operation-util.d.ts.map +1 -0
- package/dist/src/utils/operation-util.js +547 -0
- package/dist/src/utils/operation-util.js.map +1 -0
- package/dist/src/utils/parameter-utils.d.ts +9 -0
- package/dist/src/utils/parameter-utils.d.ts.map +1 -0
- package/dist/src/utils/parameter-utils.js +147 -0
- package/dist/src/utils/parameter-utils.js.map +1 -0
- package/dist/src/utils/resolve-project-root.js +2 -2
- package/dist/src/utils/resolve-project-root.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +44 -55
- package/src/context-manager.ts +101 -0
- package/src/framework/declaration.ts +18 -28
- package/src/framework/dependency.ts +1 -2
- package/src/framework/hooks/binder.ts +48 -121
- package/src/framework/hooks/sdk-types.ts +219 -0
- package/src/framework/hooks/use-dependencies.ts +16 -0
- package/src/framework/load-static-helpers.ts +28 -51
- package/src/framework/reference.ts +2 -5
- package/src/framework/sample.ts +9 -9
- package/src/index.ts +149 -189
- package/src/lib.ts +143 -158
- package/src/meta-tree.ts +8 -0
- package/src/modular/build-classical-client.ts +434 -0
- package/src/modular/build-classical-operation-groups.ts +69 -0
- package/src/modular/build-client-context.ts +325 -0
- package/src/modular/build-modular-options.ts +22 -0
- package/src/modular/build-operations.ts +248 -0
- package/src/modular/build-project-files.ts +111 -0
- package/src/modular/build-restore-poller.ts +242 -0
- package/src/modular/build-root-index.ts +407 -0
- package/src/modular/build-subpath-index.ts +152 -0
- package/src/modular/emit-logger-file.ts +23 -0
- package/src/modular/emit-models-options.ts +56 -0
- package/src/modular/emit-models.ts +1096 -0
- package/src/modular/emit-samples.ts +675 -0
- package/src/modular/emit-tests.ts +194 -0
- package/src/modular/external-dependencies.ts +54 -54
- package/src/modular/helpers/classical-operation-helpers.ts +375 -0
- package/src/modular/helpers/client-helpers.ts +362 -0
- package/src/modular/helpers/client-option-helpers.ts +122 -0
- package/src/modular/helpers/example-value-helpers.ts +851 -0
- package/src/modular/helpers/naming-helpers.ts +84 -0
- package/src/modular/helpers/operation-helpers.ts +3035 -0
- package/src/modular/helpers/type-helpers.ts +134 -0
- package/src/modular/serialization/build-deserializer-function.ts +564 -0
- package/src/modular/serialization/build-serializer-function.ts +614 -0
- package/src/modular/serialization/build-xml-serializer-function.ts +951 -0
- package/src/modular/serialization/serialize-utils.ts +217 -0
- package/src/modular/static/rollup.test.config.js +11 -14
- package/src/modular/static/scripts/renameOutput.mjs +2 -2
- package/src/modular/static-helpers-metadata.ts +60 -60
- package/src/modular/type-expressions/get-credential-expression.ts +1 -1
- package/src/modular/type-expressions/get-enum-expression.ts +5 -10
- package/src/modular/type-expressions/get-model-expression.ts +13 -17
- package/src/modular/type-expressions/get-nullable-expression.ts +4 -5
- package/src/modular/type-expressions/get-type-expression.ts +8 -12
- package/src/modular/type-expressions/get-union-expression.ts +4 -4
- package/src/modular/type-expressions/utils.ts +1 -1
- package/src/rlc-common/build-client-definitions.ts +235 -0
- package/src/rlc-common/build-client.ts +490 -0
- package/src/rlc-common/build-index-file.ts +344 -0
- package/src/rlc-common/build-is-unexpected-helper.ts +248 -0
- package/src/rlc-common/build-logger.ts +43 -0
- package/src/rlc-common/build-method-shortcuts.ts +71 -0
- package/src/rlc-common/build-object-types.ts +603 -0
- package/src/rlc-common/build-paginate-helper.ts +31 -0
- package/src/rlc-common/build-parameter-types.ts +554 -0
- package/src/rlc-common/build-polling-helper.ts +83 -0
- package/src/rlc-common/build-response-types.ts +180 -0
- package/src/rlc-common/build-samples.ts +32 -0
- package/src/rlc-common/build-schema-type.ts +89 -0
- package/src/rlc-common/build-serialize-helper.ts +49 -0
- package/src/rlc-common/build-top-level-index-file.ts +58 -0
- package/src/rlc-common/helpers/api-version-util.ts +48 -0
- package/src/rlc-common/helpers/imports-util.ts +184 -0
- package/src/rlc-common/helpers/name-constructors.ts +110 -0
- package/src/rlc-common/helpers/name-utils.ts +296 -0
- package/src/rlc-common/helpers/operation-helpers.ts +138 -0
- package/src/rlc-common/helpers/path-utils.ts +10 -0
- package/src/rlc-common/helpers/schema-helpers.ts +50 -0
- package/src/rlc-common/helpers/shortcut-methods.ts +58 -0
- package/src/rlc-common/helpers/type-util.ts +166 -0
- package/src/rlc-common/helpers/value-generation-util.ts +234 -0
- package/src/rlc-common/index.ts +39 -39
- package/src/rlc-common/interfaces.ts +3 -11
- package/src/rlc-common/metadata/build-api-extractor-config.ts +64 -0
- package/src/rlc-common/metadata/build-changelog-file.ts +29 -0
- package/src/rlc-common/metadata/build-es-lint-config.ts +84 -0
- package/src/rlc-common/metadata/build-license-file.ts +33 -0
- package/src/rlc-common/metadata/build-package-file.ts +242 -0
- package/src/rlc-common/metadata/build-readme-file.ts +515 -0
- package/src/rlc-common/metadata/build-rollup-config.ts +147 -0
- package/src/rlc-common/metadata/build-sample-env-file.ts +21 -0
- package/src/rlc-common/metadata/build-test-config.ts +72 -0
- package/src/rlc-common/metadata/build-ts-config.ts +219 -0
- package/src/rlc-common/metadata/build-vitest-config.ts +30 -0
- package/src/rlc-common/metadata/build-warp-config.ts +91 -0
- package/src/rlc-common/metadata/package-json/azure-package-common.ts +152 -0
- package/src/rlc-common/metadata/package-json/build-azure-monorepo-package.ts +199 -0
- package/src/rlc-common/metadata/package-json/build-azure-standalone-package.ts +123 -0
- package/src/rlc-common/metadata/package-json/build-flavorless-package.ts +68 -0
- package/src/rlc-common/metadata/package-json/package-common.ts +235 -0
- package/src/rlc-common/test/build-karma-config.ts +12 -0
- package/src/rlc-common/test/build-recorded-client.ts +18 -0
- package/src/rlc-common/test/build-sample-test.ts +15 -0
- package/src/rlc-common/test/build-snippets.ts +29 -0
- package/src/rlc-common/transform-sample-groups.ts +407 -0
- package/src/testing/index.ts +2 -5
- package/src/transform/transform-api-version-info.ts +103 -0
- package/src/transform/transform-helper-function-details.ts +88 -0
- package/src/transform/transform-parameters.ts +321 -0
- package/src/transform/transform-paths.ts +157 -0
- package/src/transform/transform-responses.ts +237 -0
- package/src/transform/transform-schemas.ts +212 -0
- package/src/transform/transform-telemetry-info.ts +33 -0
- package/src/transform/transform.ts +32 -44
- package/src/transform/transfrom-rlc-options.ts +461 -0
- package/src/utils/client-utils.ts +162 -0
- package/src/utils/credential-utils.ts +74 -0
- package/src/utils/cross-language-def.ts +66 -0
- package/src/utils/emit-util.ts +92 -0
- package/src/utils/file-system-utils.ts +69 -0
- package/src/utils/import-helper.ts +59 -0
- package/src/utils/interfaces.ts +2 -2
- package/src/utils/media-types.ts +150 -0
- package/src/utils/model-utils.ts +1727 -0
- package/src/utils/namespace-utils.ts +84 -0
- package/src/utils/operation-util.ts +763 -0
- package/src/utils/parameter-utils.ts +192 -0
- package/src/utils/resolve-project-root.ts +3 -3
- package/static/static-helpers/cloudSettingHelpers.ts +4 -6
- package/static/static-helpers/multipartHelpers.ts +3 -3
- package/static/static-helpers/pagingHelpers.ts +28 -63
- package/static/static-helpers/pollingHelpers.ts +16 -29
- package/static/static-helpers/serialization/build-multi-collection.ts +1 -4
- package/static/static-helpers/serialization/check-prop-undefined.ts +1 -4
- package/static/static-helpers/serialization/get-binary-response-browser.mts +3 -1
- package/static/static-helpers/serialization/get-binary-response.ts +2 -2
- package/static/static-helpers/serialization/get-binary-stream-response-browser.mts +1 -3
- package/static/static-helpers/serialization/get-binary-stream-response.ts +2 -4
- package/static/static-helpers/serialization/serialize-record.ts +1 -1
- package/static/static-helpers/serialization/serializers.ts +5 -7
- package/static/static-helpers/serialization/xml-helpers.ts +42 -90
- package/static/static-helpers/simplePollerHelpers.ts +10 -19
- package/static/static-helpers/storageCompatResponse.ts +10 -27
- package/static/static-helpers/urlTemplate.ts +4 -7
- package/static/test-helpers/recordedClient.ts +5 -10
- package/dist/src/contextManager.d.ts +0 -75
- package/dist/src/contextManager.d.ts.map +0 -1
- package/dist/src/contextManager.js +0 -59
- package/dist/src/contextManager.js.map +0 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts +0 -26
- package/dist/src/framework/hooks/sdkTypes.d.ts.map +0 -1
- package/dist/src/framework/hooks/sdkTypes.js +0 -161
- package/dist/src/framework/hooks/sdkTypes.js.map +0 -1
- package/dist/src/framework/hooks/useDependencies.d.ts +0 -4
- package/dist/src/framework/hooks/useDependencies.d.ts.map +0 -1
- package/dist/src/framework/hooks/useDependencies.js +0 -13
- package/dist/src/framework/hooks/useDependencies.js.map +0 -1
- package/dist/src/metaTree.d.ts +0 -7
- package/dist/src/metaTree.d.ts.map +0 -1
- package/dist/src/metaTree.js +0 -2
- package/dist/src/metaTree.js.map +0 -1
- package/dist/src/modular/buildClassicalClient.d.ts +0 -6
- package/dist/src/modular/buildClassicalClient.d.ts.map +0 -1
- package/dist/src/modular/buildClassicalClient.js +0 -359
- package/dist/src/modular/buildClassicalClient.js.map +0 -1
- package/dist/src/modular/buildClassicalOperationGroups.d.ts +0 -6
- package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +0 -1
- package/dist/src/modular/buildClassicalOperationGroups.js +0 -50
- package/dist/src/modular/buildClassicalOperationGroups.js.map +0 -1
- package/dist/src/modular/buildClientContext.d.ts +0 -13
- package/dist/src/modular/buildClientContext.d.ts.map +0 -1
- package/dist/src/modular/buildClientContext.js +0 -253
- package/dist/src/modular/buildClientContext.js.map +0 -1
- package/dist/src/modular/buildModularOptions.d.ts +0 -6
- package/dist/src/modular/buildModularOptions.d.ts.map +0 -1
- package/dist/src/modular/buildModularOptions.js +0 -15
- package/dist/src/modular/buildModularOptions.js.map +0 -1
- package/dist/src/modular/buildOperations.d.ts +0 -21
- package/dist/src/modular/buildOperations.d.ts.map +0 -1
- package/dist/src/modular/buildOperations.js +0 -174
- package/dist/src/modular/buildOperations.js.map +0 -1
- package/dist/src/modular/buildProjectFiles.d.ts +0 -4
- package/dist/src/modular/buildProjectFiles.d.ts.map +0 -1
- package/dist/src/modular/buildProjectFiles.js +0 -94
- package/dist/src/modular/buildProjectFiles.js.map +0 -1
- package/dist/src/modular/buildRestorePoller.d.ts +0 -5
- package/dist/src/modular/buildRestorePoller.d.ts.map +0 -1
- package/dist/src/modular/buildRestorePoller.js +0 -217
- package/dist/src/modular/buildRestorePoller.js.map +0 -1
- package/dist/src/modular/buildRootIndex.d.ts +0 -13
- package/dist/src/modular/buildRootIndex.d.ts.map +0 -1
- package/dist/src/modular/buildRootIndex.js +0 -293
- package/dist/src/modular/buildRootIndex.js.map +0 -1
- package/dist/src/modular/buildSubpathIndex.d.ts +0 -16
- package/dist/src/modular/buildSubpathIndex.d.ts.map +0 -1
- package/dist/src/modular/buildSubpathIndex.js +0 -128
- package/dist/src/modular/buildSubpathIndex.js.map +0 -1
- package/dist/src/modular/emitLoggerFile.d.ts +0 -3
- package/dist/src/modular/emitLoggerFile.d.ts.map +0 -1
- package/dist/src/modular/emitLoggerFile.js +0 -18
- package/dist/src/modular/emitLoggerFile.js.map +0 -1
- package/dist/src/modular/emitModels.d.ts +0 -23
- package/dist/src/modular/emitModels.d.ts.map +0 -1
- package/dist/src/modular/emitModels.js +0 -882
- package/dist/src/modular/emitModels.js.map +0 -1
- package/dist/src/modular/emitModelsOptions.d.ts +0 -5
- package/dist/src/modular/emitModelsOptions.d.ts.map +0 -1
- package/dist/src/modular/emitModelsOptions.js +0 -36
- package/dist/src/modular/emitModelsOptions.js.map +0 -1
- package/dist/src/modular/emitSamples.d.ts +0 -7
- package/dist/src/modular/emitSamples.d.ts.map +0 -1
- package/dist/src/modular/emitSamples.js +0 -508
- package/dist/src/modular/emitSamples.js.map +0 -1
- package/dist/src/modular/emitTests.d.ts +0 -7
- package/dist/src/modular/emitTests.d.ts.map +0 -1
- package/dist/src/modular/emitTests.js +0 -160
- package/dist/src/modular/emitTests.js.map +0 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts +0 -7
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +0 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js +0 -267
- package/dist/src/modular/helpers/classicalOperationHelpers.js.map +0 -1
- package/dist/src/modular/helpers/clientHelpers.d.ts +0 -34
- package/dist/src/modular/helpers/clientHelpers.d.ts.map +0 -1
- package/dist/src/modular/helpers/clientHelpers.js +0 -282
- package/dist/src/modular/helpers/clientHelpers.js.map +0 -1
- package/dist/src/modular/helpers/clientOptionHelpers.d.ts +0 -43
- package/dist/src/modular/helpers/clientOptionHelpers.d.ts.map +0 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js +0 -103
- package/dist/src/modular/helpers/clientOptionHelpers.js.map +0 -1
- package/dist/src/modular/helpers/docsHelpers.d.ts +0 -3
- package/dist/src/modular/helpers/docsHelpers.d.ts.map +0 -1
- package/dist/src/modular/helpers/docsHelpers.js +0 -10
- package/dist/src/modular/helpers/docsHelpers.js.map +0 -1
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts +0 -83
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts.map +0 -1
- package/dist/src/modular/helpers/exampleValueHelpers.js +0 -651
- package/dist/src/modular/helpers/exampleValueHelpers.js.map +0 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts +0 -22
- package/dist/src/modular/helpers/namingHelpers.d.ts.map +0 -1
- package/dist/src/modular/helpers/namingHelpers.js +0 -62
- package/dist/src/modular/helpers/namingHelpers.js.map +0 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +0 -105
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +0 -1
- package/dist/src/modular/helpers/operationHelpers.js +0 -2412
- package/dist/src/modular/helpers/operationHelpers.js.map +0 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts +0 -22
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +0 -1
- package/dist/src/modular/helpers/typeHelpers.js +0 -96
- package/dist/src/modular/helpers/typeHelpers.js.map +0 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts +0 -7
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts.map +0 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.js +0 -410
- package/dist/src/modular/serialization/buildDeserializerFunction.js.map +0 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts +0 -7
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +0 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js +0 -454
- package/dist/src/modular/serialization/buildSerializerFunction.js.map +0 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts +0 -44
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts.map +0 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js +0 -746
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +0 -1
- package/dist/src/modular/serialization/serializeUtils.d.ts +0 -37
- package/dist/src/modular/serialization/serializeUtils.d.ts.map +0 -1
- package/dist/src/modular/serialization/serializeUtils.js +0 -153
- package/dist/src/modular/serialization/serializeUtils.js.map +0 -1
- package/dist/src/rlc-common/buildClient.d.ts +0 -9
- package/dist/src/rlc-common/buildClient.d.ts.map +0 -1
- package/dist/src/rlc-common/buildClient.js +0 -413
- package/dist/src/rlc-common/buildClient.js.map +0 -1
- package/dist/src/rlc-common/buildClientDefinitions.d.ts +0 -6
- package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +0 -1
- package/dist/src/rlc-common/buildClientDefinitions.js +0 -174
- package/dist/src/rlc-common/buildClientDefinitions.js.map +0 -1
- package/dist/src/rlc-common/buildIndexFile.d.ts +0 -6
- package/dist/src/rlc-common/buildIndexFile.d.ts.map +0 -1
- package/dist/src/rlc-common/buildIndexFile.js +0 -242
- package/dist/src/rlc-common/buildIndexFile.js.map +0 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts +0 -6
- package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +0 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js +0 -224
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +0 -1
- package/dist/src/rlc-common/buildLogger.d.ts +0 -6
- package/dist/src/rlc-common/buildLogger.d.ts.map +0 -1
- package/dist/src/rlc-common/buildLogger.js +0 -32
- package/dist/src/rlc-common/buildLogger.js.map +0 -1
- package/dist/src/rlc-common/buildMethodShortcuts.d.ts +0 -5
- package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +0 -1
- package/dist/src/rlc-common/buildMethodShortcuts.js +0 -54
- package/dist/src/rlc-common/buildMethodShortcuts.js.map +0 -1
- package/dist/src/rlc-common/buildObjectTypes.d.ts +0 -29
- package/dist/src/rlc-common/buildObjectTypes.d.ts.map +0 -1
- package/dist/src/rlc-common/buildObjectTypes.js +0 -451
- package/dist/src/rlc-common/buildObjectTypes.js.map +0 -1
- package/dist/src/rlc-common/buildPaginateHelper.d.ts +0 -6
- package/dist/src/rlc-common/buildPaginateHelper.d.ts.map +0 -1
- package/dist/src/rlc-common/buildPaginateHelper.js +0 -27
- package/dist/src/rlc-common/buildPaginateHelper.js.map +0 -1
- package/dist/src/rlc-common/buildParameterTypes.d.ts +0 -14
- package/dist/src/rlc-common/buildParameterTypes.d.ts.map +0 -1
- package/dist/src/rlc-common/buildParameterTypes.js +0 -381
- package/dist/src/rlc-common/buildParameterTypes.js.map +0 -1
- package/dist/src/rlc-common/buildPollingHelper.d.ts +0 -6
- package/dist/src/rlc-common/buildPollingHelper.d.ts.map +0 -1
- package/dist/src/rlc-common/buildPollingHelper.js +0 -62
- package/dist/src/rlc-common/buildPollingHelper.js.map +0 -1
- package/dist/src/rlc-common/buildResponseTypes.d.ts +0 -6
- package/dist/src/rlc-common/buildResponseTypes.d.ts.map +0 -1
- package/dist/src/rlc-common/buildResponseTypes.js +0 -147
- package/dist/src/rlc-common/buildResponseTypes.js.map +0 -1
- package/dist/src/rlc-common/buildSamples.d.ts +0 -3
- package/dist/src/rlc-common/buildSamples.d.ts.map +0 -1
- package/dist/src/rlc-common/buildSamples.js +0 -30
- package/dist/src/rlc-common/buildSamples.js.map +0 -1
- package/dist/src/rlc-common/buildSchemaType.d.ts +0 -20
- package/dist/src/rlc-common/buildSchemaType.d.ts.map +0 -1
- package/dist/src/rlc-common/buildSchemaType.js +0 -53
- package/dist/src/rlc-common/buildSchemaType.js.map +0 -1
- package/dist/src/rlc-common/buildSerializeHelper.d.ts +0 -6
- package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +0 -1
- package/dist/src/rlc-common/buildSerializeHelper.js +0 -36
- package/dist/src/rlc-common/buildSerializeHelper.js.map +0 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts +0 -6
- package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +0 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.js +0 -52
- package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +0 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts +0 -17
- package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.js +0 -45
- package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +0 -1
- package/dist/src/rlc-common/helpers/importsUtil.d.ts +0 -18
- package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/importsUtil.js +0 -169
- package/dist/src/rlc-common/helpers/importsUtil.js.map +0 -1
- package/dist/src/rlc-common/helpers/nameConstructors.d.ts +0 -42
- package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/nameConstructors.js +0 -63
- package/dist/src/rlc-common/helpers/nameConstructors.js.map +0 -1
- package/dist/src/rlc-common/helpers/nameUtils.d.ts +0 -37
- package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/nameUtils.js +0 -246
- package/dist/src/rlc-common/helpers/nameUtils.js.map +0 -1
- package/dist/src/rlc-common/helpers/operationHelpers.d.ts +0 -16
- package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/operationHelpers.js +0 -119
- package/dist/src/rlc-common/helpers/operationHelpers.js.map +0 -1
- package/dist/src/rlc-common/helpers/packageUtil.d.ts +0 -7
- package/dist/src/rlc-common/helpers/packageUtil.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/packageUtil.js +0 -13
- package/dist/src/rlc-common/helpers/packageUtil.js.map +0 -1
- package/dist/src/rlc-common/helpers/pathUtils.d.ts +0 -2
- package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/pathUtils.js +0 -12
- package/dist/src/rlc-common/helpers/pathUtils.js.map +0 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.d.ts +0 -10
- package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.js +0 -41
- package/dist/src/rlc-common/helpers/schemaHelpers.js.map +0 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +0 -4
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.js +0 -49
- package/dist/src/rlc-common/helpers/shortcutMethods.js.map +0 -1
- package/dist/src/rlc-common/helpers/typeUtil.d.ts +0 -32
- package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/typeUtil.js +0 -167
- package/dist/src/rlc-common/helpers/typeUtil.js.map +0 -1
- package/dist/src/rlc-common/helpers/valueGenerationUtil.d.ts +0 -12
- package/dist/src/rlc-common/helpers/valueGenerationUtil.d.ts.map +0 -1
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js +0 -165
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +0 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts +0 -6
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +0 -56
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +0 -1
- package/dist/src/rlc-common/metadata/buildChangelogFile.d.ts +0 -6
- package/dist/src/rlc-common/metadata/buildChangelogFile.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/buildChangelogFile.js +0 -26
- package/dist/src/rlc-common/metadata/buildChangelogFile.js.map +0 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts +0 -6
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.js +0 -82
- package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +0 -1
- package/dist/src/rlc-common/metadata/buildLicenseFile.d.ts +0 -5
- package/dist/src/rlc-common/metadata/buildLicenseFile.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/buildLicenseFile.js +0 -32
- package/dist/src/rlc-common/metadata/buildLicenseFile.js.map +0 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.d.ts +0 -25
- package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.js +0 -201
- package/dist/src/rlc-common/metadata/buildPackageFile.js.map +0 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts +0 -11
- package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.js +0 -426
- package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +0 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts +0 -6
- package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.js +0 -142
- package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +0 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts +0 -6
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +0 -17
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +0 -1
- package/dist/src/rlc-common/metadata/buildTestConfig.d.ts +0 -16
- package/dist/src/rlc-common/metadata/buildTestConfig.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/buildTestConfig.js +0 -55
- package/dist/src/rlc-common/metadata/buildTestConfig.js.map +0 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts +0 -61
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.js +0 -170
- package/dist/src/rlc-common/metadata/buildTsConfig.js.map +0 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts +0 -6
- package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.js +0 -28
- package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +0 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts +0 -20
- package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.js +0 -77
- package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +0 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +0 -51
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +0 -121
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +0 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts +0 -242
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +0 -176
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +0 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts +0 -8
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +0 -102
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +0 -1
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.d.ts +0 -57
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +0 -53
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +0 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts +0 -64
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +0 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +0 -183
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +0 -1
- package/dist/src/rlc-common/static/paginateContent.d.ts +0 -2
- package/dist/src/rlc-common/static/paginateContent.d.ts.map +0 -1
- package/dist/src/rlc-common/static/paginateContent.js +0 -345
- package/dist/src/rlc-common/static/paginateContent.js.map +0 -1
- package/dist/src/rlc-common/static/pollingContent.d.ts +0 -2
- package/dist/src/rlc-common/static/pollingContent.d.ts.map +0 -1
- package/dist/src/rlc-common/static/pollingContent.js +0 -225
- package/dist/src/rlc-common/static/pollingContent.js.map +0 -1
- package/dist/src/rlc-common/static/sampleTemplate.d.ts +0 -2
- package/dist/src/rlc-common/static/sampleTemplate.d.ts.map +0 -1
- package/dist/src/rlc-common/static/sampleTemplate.js +0 -56
- package/dist/src/rlc-common/static/sampleTemplate.js.map +0 -1
- package/dist/src/rlc-common/static/serializeHelper.d.ts +0 -6
- package/dist/src/rlc-common/static/serializeHelper.d.ts.map +0 -1
- package/dist/src/rlc-common/static/serializeHelper.js +0 -31
- package/dist/src/rlc-common/static/serializeHelper.js.map +0 -1
- package/dist/src/rlc-common/test/buildKarmaConfig.d.ts +0 -6
- package/dist/src/rlc-common/test/buildKarmaConfig.d.ts.map +0 -1
- package/dist/src/rlc-common/test/buildKarmaConfig.js +0 -11
- package/dist/src/rlc-common/test/buildKarmaConfig.js.map +0 -1
- package/dist/src/rlc-common/test/buildRecordedClient.d.ts +0 -6
- package/dist/src/rlc-common/test/buildRecordedClient.d.ts.map +0 -1
- package/dist/src/rlc-common/test/buildRecordedClient.js +0 -18
- package/dist/src/rlc-common/test/buildRecordedClient.js.map +0 -1
- package/dist/src/rlc-common/test/buildSampleTest.d.ts +0 -6
- package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +0 -1
- package/dist/src/rlc-common/test/buildSampleTest.js +0 -15
- package/dist/src/rlc-common/test/buildSampleTest.js.map +0 -1
- package/dist/src/rlc-common/test/buildSnippets.d.ts +0 -6
- package/dist/src/rlc-common/test/buildSnippets.d.ts.map +0 -1
- package/dist/src/rlc-common/test/buildSnippets.js +0 -29
- package/dist/src/rlc-common/test/buildSnippets.js.map +0 -1
- package/dist/src/rlc-common/transformSampleGroups.d.ts +0 -9
- package/dist/src/rlc-common/transformSampleGroups.d.ts.map +0 -1
- package/dist/src/rlc-common/transformSampleGroups.js +0 -317
- package/dist/src/rlc-common/transformSampleGroups.js.map +0 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts +0 -6
- package/dist/src/transform/transformApiVersionInfo.d.ts.map +0 -1
- package/dist/src/transform/transformApiVersionInfo.js +0 -80
- package/dist/src/transform/transformApiVersionInfo.js.map +0 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts +0 -5
- package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +0 -1
- package/dist/src/transform/transformHelperFunctionDetails.js +0 -77
- package/dist/src/transform/transformHelperFunctionDetails.js.map +0 -1
- package/dist/src/transform/transformParameters.d.ts +0 -14
- package/dist/src/transform/transformParameters.d.ts.map +0 -1
- package/dist/src/transform/transformParameters.js +0 -214
- package/dist/src/transform/transformParameters.js.map +0 -1
- package/dist/src/transform/transformPaths.d.ts +0 -5
- package/dist/src/transform/transformPaths.d.ts.map +0 -1
- package/dist/src/transform/transformPaths.js +0 -106
- package/dist/src/transform/transformPaths.js.map +0 -1
- package/dist/src/transform/transformResponses.d.ts +0 -5
- package/dist/src/transform/transformResponses.d.ts.map +0 -1
- package/dist/src/transform/transformResponses.js +0 -175
- package/dist/src/transform/transformResponses.js.map +0 -1
- package/dist/src/transform/transformSchemas.d.ts +0 -4
- package/dist/src/transform/transformSchemas.d.ts.map +0 -1
- package/dist/src/transform/transformSchemas.js +0 -202
- package/dist/src/transform/transformSchemas.js.map +0 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts +0 -4
- package/dist/src/transform/transformTelemetryInfo.d.ts.map +0 -1
- package/dist/src/transform/transformTelemetryInfo.js +0 -22
- package/dist/src/transform/transformTelemetryInfo.js.map +0 -1
- package/dist/src/transform/transfromRLCOptions.d.ts +0 -14
- package/dist/src/transform/transfromRLCOptions.d.ts.map +0 -1
- package/dist/src/transform/transfromRLCOptions.js +0 -380
- package/dist/src/transform/transfromRLCOptions.js.map +0 -1
- package/dist/src/utils/clientUtils.d.ts +0 -10
- package/dist/src/utils/clientUtils.d.ts.map +0 -1
- package/dist/src/utils/clientUtils.js +0 -132
- package/dist/src/utils/clientUtils.js.map +0 -1
- package/dist/src/utils/credentialUtils.d.ts +0 -15
- package/dist/src/utils/credentialUtils.d.ts.map +0 -1
- package/dist/src/utils/credentialUtils.js +0 -69
- package/dist/src/utils/credentialUtils.js.map +0 -1
- package/dist/src/utils/crossLanguageDef.d.ts +0 -6
- package/dist/src/utils/crossLanguageDef.d.ts.map +0 -1
- package/dist/src/utils/crossLanguageDef.js +0 -63
- package/dist/src/utils/crossLanguageDef.js.map +0 -1
- package/dist/src/utils/emitUtil.d.ts +0 -5
- package/dist/src/utils/emitUtil.d.ts.map +0 -1
- package/dist/src/utils/emitUtil.js +0 -73
- package/dist/src/utils/emitUtil.js.map +0 -1
- package/dist/src/utils/fileSystemUtils.d.ts +0 -3
- package/dist/src/utils/fileSystemUtils.d.ts.map +0 -1
- package/dist/src/utils/fileSystemUtils.js +0 -40
- package/dist/src/utils/fileSystemUtils.js.map +0 -1
- package/dist/src/utils/importHelper.d.ts +0 -10
- package/dist/src/utils/importHelper.d.ts.map +0 -1
- package/dist/src/utils/importHelper.js +0 -54
- package/dist/src/utils/importHelper.js.map +0 -1
- package/dist/src/utils/mediaTypes.d.ts +0 -28
- package/dist/src/utils/mediaTypes.d.ts.map +0 -1
- package/dist/src/utils/mediaTypes.js +0 -136
- package/dist/src/utils/mediaTypes.js.map +0 -1
- package/dist/src/utils/modelUtils.d.ts +0 -60
- package/dist/src/utils/modelUtils.d.ts.map +0 -1
- package/dist/src/utils/modelUtils.js +0 -1577
- package/dist/src/utils/modelUtils.js.map +0 -1
- package/dist/src/utils/namespaceUtils.d.ts +0 -6
- package/dist/src/utils/namespaceUtils.d.ts.map +0 -1
- package/dist/src/utils/namespaceUtils.js +0 -70
- package/dist/src/utils/namespaceUtils.js.map +0 -1
- package/dist/src/utils/operationUtil.d.ts +0 -97
- package/dist/src/utils/operationUtil.d.ts.map +0 -1
- package/dist/src/utils/operationUtil.js +0 -568
- package/dist/src/utils/operationUtil.js.map +0 -1
- package/dist/src/utils/parameterUtils.d.ts +0 -9
- package/dist/src/utils/parameterUtils.d.ts.map +0 -1
- package/dist/src/utils/parameterUtils.js +0 -154
- package/dist/src/utils/parameterUtils.js.map +0 -1
- package/src/contextManager.ts +0 -104
- package/src/framework/hooks/sdkTypes.ts +0 -245
- package/src/framework/hooks/useDependencies.ts +0 -18
- package/src/metaTree.ts +0 -8
- package/src/modular/buildClassicalClient.ts +0 -511
- package/src/modular/buildClassicalOperationGroups.ts +0 -94
- package/src/modular/buildClientContext.ts +0 -354
- package/src/modular/buildModularOptions.ts +0 -23
- package/src/modular/buildOperations.ts +0 -275
- package/src/modular/buildProjectFiles.ts +0 -140
- package/src/modular/buildRestorePoller.ts +0 -261
- package/src/modular/buildRootIndex.ts +0 -481
- package/src/modular/buildSubpathIndex.ts +0 -175
- package/src/modular/emitLoggerFile.ts +0 -28
- package/src/modular/emitModels.ts +0 -1211
- package/src/modular/emitModelsOptions.ts +0 -62
- package/src/modular/emitSamples.ts +0 -763
- package/src/modular/emitTests.ts +0 -227
- package/src/modular/helpers/classicalOperationHelpers.ts +0 -428
- package/src/modular/helpers/clientHelpers.ts +0 -409
- package/src/modular/helpers/clientOptionHelpers.ts +0 -129
- package/src/modular/helpers/exampleValueHelpers.ts +0 -967
- package/src/modular/helpers/namingHelpers.ts +0 -100
- package/src/modular/helpers/operationHelpers.ts +0 -3362
- package/src/modular/helpers/typeHelpers.ts +0 -142
- package/src/modular/serialization/buildDeserializerFunction.ts +0 -598
- package/src/modular/serialization/buildSerializerFunction.ts +0 -654
- package/src/modular/serialization/buildXmlSerializerFunction.ts +0 -1030
- package/src/modular/serialization/serializeUtils.ts +0 -227
- package/src/rlc-common/buildClient.ts +0 -561
- package/src/rlc-common/buildClientDefinitions.ts +0 -278
- package/src/rlc-common/buildIndexFile.ts +0 -344
- package/src/rlc-common/buildIsUnexpectedHelper.ts +0 -255
- package/src/rlc-common/buildLogger.ts +0 -43
- package/src/rlc-common/buildMethodShortcuts.ts +0 -83
- package/src/rlc-common/buildObjectTypes.ts +0 -680
- package/src/rlc-common/buildPaginateHelper.ts +0 -34
- package/src/rlc-common/buildParameterTypes.ts +0 -575
- package/src/rlc-common/buildPollingHelper.ts +0 -83
- package/src/rlc-common/buildResponseTypes.ts +0 -203
- package/src/rlc-common/buildSamples.ts +0 -32
- package/src/rlc-common/buildSchemaType.ts +0 -81
- package/src/rlc-common/buildSerializeHelper.ts +0 -49
- package/src/rlc-common/buildTopLevelIndexFile.ts +0 -65
- package/src/rlc-common/helpers/apiVersionUtil.ts +0 -53
- package/src/rlc-common/helpers/importsUtil.ts +0 -187
- package/src/rlc-common/helpers/nameConstructors.ts +0 -144
- package/src/rlc-common/helpers/nameUtils.ts +0 -319
- package/src/rlc-common/helpers/operationHelpers.ts +0 -155
- package/src/rlc-common/helpers/pathUtils.ts +0 -15
- package/src/rlc-common/helpers/schemaHelpers.ts +0 -61
- package/src/rlc-common/helpers/shortcutMethods.ts +0 -67
- package/src/rlc-common/helpers/typeUtil.ts +0 -173
- package/src/rlc-common/helpers/valueGenerationUtil.ts +0 -257
- package/src/rlc-common/metadata/buildApiExtractorConfig.ts +0 -71
- package/src/rlc-common/metadata/buildChangelogFile.ts +0 -29
- package/src/rlc-common/metadata/buildESLintConfig.ts +0 -86
- package/src/rlc-common/metadata/buildLicenseFile.ts +0 -33
- package/src/rlc-common/metadata/buildPackageFile.ts +0 -250
- package/src/rlc-common/metadata/buildReadmeFile.ts +0 -528
- package/src/rlc-common/metadata/buildRollupConfig.ts +0 -150
- package/src/rlc-common/metadata/buildSampleEnvFile.ts +0 -22
- package/src/rlc-common/metadata/buildTestConfig.ts +0 -72
- package/src/rlc-common/metadata/buildTsConfig.ts +0 -222
- package/src/rlc-common/metadata/buildVitestConfig.ts +0 -36
- package/src/rlc-common/metadata/buildWarpConfig.ts +0 -94
- package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +0 -161
- package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +0 -220
- package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +0 -134
- package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +0 -70
- package/src/rlc-common/metadata/packageJson/packageCommon.ts +0 -255
- package/src/rlc-common/test/buildKarmaConfig.ts +0 -12
- package/src/rlc-common/test/buildRecordedClient.ts +0 -18
- package/src/rlc-common/test/buildSampleTest.ts +0 -15
- package/src/rlc-common/test/buildSnippets.ts +0 -35
- package/src/rlc-common/transformSampleGroups.ts +0 -458
- package/src/transform/transformApiVersionInfo.ts +0 -116
- package/src/transform/transformHelperFunctionDetails.ts +0 -100
- package/src/transform/transformParameters.ts +0 -371
- package/src/transform/transformPaths.ts +0 -174
- package/src/transform/transformResponses.ts +0 -244
- package/src/transform/transformSchemas.ts +0 -230
- package/src/transform/transformTelemetryInfo.ts +0 -39
- package/src/transform/transfromRLCOptions.ts +0 -524
- package/src/utils/clientUtils.ts +0 -181
- package/src/utils/credentialUtils.ts +0 -85
- package/src/utils/crossLanguageDef.ts +0 -85
- package/src/utils/emitUtil.ts +0 -98
- package/src/utils/fileSystemUtils.ts +0 -47
- package/src/utils/importHelper.ts +0 -64
- package/src/utils/mediaTypes.ts +0 -171
- package/src/utils/modelUtils.ts +0 -1946
- package/src/utils/namespaceUtils.ts +0 -100
- package/src/utils/operationUtil.ts +0 -855
- package/src/utils/parameterUtils.ts +0 -215
- /package/src/modular/helpers/{docsHelpers.ts → docs-helpers.ts} +0 -0
- /package/src/rlc-common/helpers/{packageUtil.ts → package-util.ts} +0 -0
- /package/src/rlc-common/static/{paginateContent.ts → paginate-content.ts} +0 -0
- /package/src/rlc-common/static/{pollingContent.ts → polling-content.ts} +0 -0
- /package/src/rlc-common/static/{sampleTemplate.ts → sample-template.ts} +0 -0
- /package/src/rlc-common/static/{serializeHelper.ts → serialize-helper.ts} +0 -0
|
@@ -0,0 +1,1096 @@
|
|
|
1
|
+
import {
|
|
2
|
+
isPagedResultModel,
|
|
3
|
+
isReadOnly,
|
|
4
|
+
listAllServiceNamespaces,
|
|
5
|
+
SdkArrayType,
|
|
6
|
+
SdkClientType,
|
|
7
|
+
SdkDictionaryType,
|
|
8
|
+
SdkEnumType,
|
|
9
|
+
SdkEnumValueType,
|
|
10
|
+
SdkHttpOperation,
|
|
11
|
+
SdkMethod,
|
|
12
|
+
SdkModelPropertyType,
|
|
13
|
+
SdkModelType,
|
|
14
|
+
SdkNullableType,
|
|
15
|
+
SdkServiceMethod,
|
|
16
|
+
SdkServiceOperation,
|
|
17
|
+
SdkType,
|
|
18
|
+
SdkUnionType,
|
|
19
|
+
UsageFlags,
|
|
20
|
+
} from "@azure-tools/typespec-client-generator-core";
|
|
21
|
+
import {
|
|
22
|
+
EnumDeclarationStructure,
|
|
23
|
+
EnumMemberStructure,
|
|
24
|
+
InterfaceDeclarationStructure,
|
|
25
|
+
OptionalKind,
|
|
26
|
+
PropertySignatureStructure,
|
|
27
|
+
SourceFile,
|
|
28
|
+
StructureKind,
|
|
29
|
+
TypeAliasDeclarationStructure,
|
|
30
|
+
} from "ts-morph";
|
|
31
|
+
import { fixLeadingNumber, NameType, normalizeName } from "../rlc-common/index.js";
|
|
32
|
+
// import { isKey } from "@typespec/compiler";
|
|
33
|
+
import {
|
|
34
|
+
getExternalModel,
|
|
35
|
+
getModelExpression,
|
|
36
|
+
getMultipartFileTypeExpression,
|
|
37
|
+
} from "./type-expressions/get-model-expression.js";
|
|
38
|
+
|
|
39
|
+
import { getNamespaceFullName, NoTarget } from "@typespec/compiler";
|
|
40
|
+
import { isMetadata, isOrExtendsHttpFile, Visibility } from "@typespec/http";
|
|
41
|
+
import path from "path";
|
|
42
|
+
import { useContext } from "../context-manager.js";
|
|
43
|
+
import { addDeclaration } from "../framework/declaration.js";
|
|
44
|
+
import {
|
|
45
|
+
emitQueue,
|
|
46
|
+
flattenPropertyModelMap,
|
|
47
|
+
getAllOperationsFromClient,
|
|
48
|
+
pagedModelsKeptPublic,
|
|
49
|
+
} from "../framework/hooks/sdk-types.js";
|
|
50
|
+
import { refkey } from "../framework/refkey.js";
|
|
51
|
+
import { reportDiagnostic } from "../lib.js";
|
|
52
|
+
import { getClientHierarchyMap } from "../utils/client-utils.js";
|
|
53
|
+
import { SdkContext } from "../utils/interfaces.js";
|
|
54
|
+
import { isAzureCoreErrorType } from "../utils/model-utils.js";
|
|
55
|
+
import { getMethodHierarchiesMap } from "../utils/operation-util.js";
|
|
56
|
+
import { getHeaderClientOptions } from "./helpers/client-option-helpers.js";
|
|
57
|
+
import {
|
|
58
|
+
buildNonModelResponseTypeDeclaration,
|
|
59
|
+
checkWrapNonModelReturn,
|
|
60
|
+
getAllAncestors,
|
|
61
|
+
getAllProperties,
|
|
62
|
+
} from "./helpers/operation-helpers.js";
|
|
63
|
+
import { getDirectSubtypes } from "./helpers/type-helpers.js";
|
|
64
|
+
import {
|
|
65
|
+
buildModelDeserializer,
|
|
66
|
+
buildPropertyDeserializer,
|
|
67
|
+
} from "./serialization/build-deserializer-function.js";
|
|
68
|
+
import {
|
|
69
|
+
buildModelSerializer,
|
|
70
|
+
buildPropertySerializer,
|
|
71
|
+
} from "./serialization/build-serializer-function.js";
|
|
72
|
+
import {
|
|
73
|
+
buildXmlModelDeserializer,
|
|
74
|
+
buildXmlModelSerializer,
|
|
75
|
+
buildXmlObjectModelDeserializer,
|
|
76
|
+
buildXmlObjectModelSerializer,
|
|
77
|
+
hasXmlSerialization,
|
|
78
|
+
} from "./serialization/build-xml-serializer-function.js";
|
|
79
|
+
import {
|
|
80
|
+
getAllDiscriminatedValues,
|
|
81
|
+
getPropertyWithOverrides,
|
|
82
|
+
isDiscriminatedUnion,
|
|
83
|
+
} from "./serialization/serialize-utils.js";
|
|
84
|
+
import { isExtensibleEnum } from "./type-expressions/get-enum-expression.js";
|
|
85
|
+
import {
|
|
86
|
+
getTypeExpression,
|
|
87
|
+
normalizeModelPropertyName,
|
|
88
|
+
} from "./type-expressions/get-type-expression.js";
|
|
89
|
+
|
|
90
|
+
type InterfaceStructure = OptionalKind<InterfaceDeclarationStructure> & {
|
|
91
|
+
extends?: string[];
|
|
92
|
+
kind: StructureKind.Interface;
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
function isGenerableType(
|
|
96
|
+
type: SdkType,
|
|
97
|
+
): type is
|
|
98
|
+
| SdkModelType
|
|
99
|
+
| SdkEnumType
|
|
100
|
+
| SdkUnionType
|
|
101
|
+
| SdkDictionaryType
|
|
102
|
+
| SdkArrayType
|
|
103
|
+
| SdkNullableType {
|
|
104
|
+
return (
|
|
105
|
+
type.kind === "model" ||
|
|
106
|
+
type.kind === "enum" ||
|
|
107
|
+
type.kind === "union" ||
|
|
108
|
+
type.kind === "dict" ||
|
|
109
|
+
type.kind === "array" ||
|
|
110
|
+
(type.kind === "nullable" &&
|
|
111
|
+
isGenerableType(type.type) &&
|
|
112
|
+
Boolean(type.name) &&
|
|
113
|
+
!type.isGeneratedName)
|
|
114
|
+
);
|
|
115
|
+
}
|
|
116
|
+
export function emitTypes(context: SdkContext, { sourceRoot }: { sourceRoot: string }) {
|
|
117
|
+
const outputProject = useContext("outputProject");
|
|
118
|
+
|
|
119
|
+
let sourceFile;
|
|
120
|
+
|
|
121
|
+
for (const type of emitQueue) {
|
|
122
|
+
if (!isGenerableType(type)) {
|
|
123
|
+
continue;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
const namespaces = getModelNamespaces(context, type);
|
|
127
|
+
const filepath = getModelsPath(sourceRoot, namespaces);
|
|
128
|
+
sourceFile = outputProject.getSourceFile(filepath);
|
|
129
|
+
if (!sourceFile) {
|
|
130
|
+
sourceFile = outputProject.createSourceFile(filepath);
|
|
131
|
+
sourceFile.addStatements(`/**
|
|
132
|
+
* This file contains only generated model types and their (de)serializers.
|
|
133
|
+
* Disable the following rules for internal models with '_' prefix and deserializers which require 'any' for raw JSON input.
|
|
134
|
+
*/
|
|
135
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
136
|
+
/* eslint-disable @typescript-eslint/explicit-module-boundary-types */`);
|
|
137
|
+
}
|
|
138
|
+
emitType(context, type, sourceFile);
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
// Emit serialization/deserialization functions for flattened properties
|
|
142
|
+
for (const [property, _] of flattenPropertyModelMap) {
|
|
143
|
+
const namespaces = getModelNamespaces(context, property.type);
|
|
144
|
+
const filepath = getModelsPath(sourceRoot, namespaces);
|
|
145
|
+
sourceFile = outputProject.getSourceFile(filepath);
|
|
146
|
+
addSerializationFunctions(context, property, sourceFile!);
|
|
147
|
+
}
|
|
148
|
+
|
|
149
|
+
const modelFiles = outputProject.getSourceFiles(sourceRoot + "/models/**/*.ts");
|
|
150
|
+
const result = [];
|
|
151
|
+
for (const modelFile of modelFiles) {
|
|
152
|
+
if (
|
|
153
|
+
modelFile.getInterfaces().length === 0 &&
|
|
154
|
+
modelFile.getTypeAliases().length === 0 &&
|
|
155
|
+
modelFile.getEnums().length === 0
|
|
156
|
+
) {
|
|
157
|
+
outputProject.removeSourceFile(modelFile);
|
|
158
|
+
continue;
|
|
159
|
+
}
|
|
160
|
+
result.push(modelFile);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
return result;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
/**
|
|
167
|
+
* Emits the XxxResponse wrapper type aliases for non-model return operations
|
|
168
|
+
* into the models.ts file, so they are exported publicly as part of the models API surface.
|
|
169
|
+
* This must be called after emitTypes() and before buildSubpathIndexFile("models").
|
|
170
|
+
*/
|
|
171
|
+
export function emitNonModelResponseTypes(
|
|
172
|
+
context: SdkContext,
|
|
173
|
+
{ sourceRoot }: { sourceRoot: string },
|
|
174
|
+
) {
|
|
175
|
+
const outputProject = useContext("outputProject");
|
|
176
|
+
const clientMap = getClientHierarchyMap(context);
|
|
177
|
+
|
|
178
|
+
const filepath = getModelsPath(sourceRoot);
|
|
179
|
+
let modelsFile = outputProject.getSourceFile(filepath);
|
|
180
|
+
|
|
181
|
+
for (const subClient of clientMap) {
|
|
182
|
+
const methodHierarchies = getMethodHierarchiesMap(context, subClient[1]);
|
|
183
|
+
for (const [prefixKey, operations] of methodHierarchies) {
|
|
184
|
+
const prefixes = prefixKey.split("/");
|
|
185
|
+
for (const op of operations) {
|
|
186
|
+
const { shouldWrap, isBinary } = checkWrapNonModelReturn(context, op);
|
|
187
|
+
if (!shouldWrap) {
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
if (!modelsFile) {
|
|
191
|
+
modelsFile = outputProject.createSourceFile(filepath);
|
|
192
|
+
}
|
|
193
|
+
const method: [string[], typeof op] = [prefixes, op];
|
|
194
|
+
const typeAlias = buildNonModelResponseTypeDeclaration(context, method, isBinary);
|
|
195
|
+
addDeclaration(modelsFile, typeAlias, refkey(op, "response"));
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
function emitType(context: SdkContext, type: SdkType, sourceFile: SourceFile) {
|
|
202
|
+
if (type.kind === "model") {
|
|
203
|
+
if (isAzureCoreErrorType(context.program, type.__raw)) {
|
|
204
|
+
return;
|
|
205
|
+
}
|
|
206
|
+
if (isOrExtendsHttpFile(context.program, type.__raw!)) {
|
|
207
|
+
return;
|
|
208
|
+
}
|
|
209
|
+
if (
|
|
210
|
+
!type.usage ||
|
|
211
|
+
(type.usage !== undefined &&
|
|
212
|
+
(type.usage & UsageFlags.Output) !== UsageFlags.Output &&
|
|
213
|
+
(type.usage & UsageFlags.Input) !== UsageFlags.Input &&
|
|
214
|
+
(type.usage & UsageFlags.Exception) !== UsageFlags.Exception)
|
|
215
|
+
) {
|
|
216
|
+
return;
|
|
217
|
+
}
|
|
218
|
+
if (!type.name && type.isGeneratedName) {
|
|
219
|
+
// TODO: https://github.com/Azure/typespec-azure/issues/1713 and https://github.com/microsoft/typespec/issues/4815
|
|
220
|
+
// throw new Error(`Generation of anonymous types`);
|
|
221
|
+
return;
|
|
222
|
+
}
|
|
223
|
+
const modelInterface = buildModelInterface(context, type);
|
|
224
|
+
if (type.discriminatorProperty) {
|
|
225
|
+
modelInterface.properties
|
|
226
|
+
?.filter((p) => {
|
|
227
|
+
return p.name === normalizeModelPropertyName(context, type.discriminatorProperty!);
|
|
228
|
+
})
|
|
229
|
+
.map((p) => {
|
|
230
|
+
p.docs?.push(
|
|
231
|
+
`The discriminator possible values: ${Object.keys(type.discriminatedSubtypes ?? {}).join(", ")}`,
|
|
232
|
+
);
|
|
233
|
+
return p;
|
|
234
|
+
});
|
|
235
|
+
}
|
|
236
|
+
addDeclaration(sourceFile, modelInterface, type);
|
|
237
|
+
const modelPolymorphicType = buildModelPolymorphicType(context, type);
|
|
238
|
+
if (modelPolymorphicType) {
|
|
239
|
+
addSerializationFunctions(context, type, sourceFile, true);
|
|
240
|
+
addDeclaration(sourceFile, modelPolymorphicType, refkey(type, "polymorphicType"));
|
|
241
|
+
}
|
|
242
|
+
addSerializationFunctions(context, type, sourceFile);
|
|
243
|
+
} else if (type.kind === "enum") {
|
|
244
|
+
if (!type.usage) {
|
|
245
|
+
return;
|
|
246
|
+
}
|
|
247
|
+
const apiVersionEnumOnly = type.usage === UsageFlags.ApiVersionEnum;
|
|
248
|
+
// Skip known api version enums for multi-service scenarios as users are not allowed to set api versions
|
|
249
|
+
if (apiVersionEnumOnly && context.rlcOptions?.isMultiService) {
|
|
250
|
+
return;
|
|
251
|
+
}
|
|
252
|
+
const inputUsage = (type.usage & UsageFlags.Input) === UsageFlags.Input;
|
|
253
|
+
const outputUsage = (type.usage & UsageFlags.Output) === UsageFlags.Output;
|
|
254
|
+
const exceptionUsage = (type.usage & UsageFlags.Exception) === UsageFlags.Exception;
|
|
255
|
+
if (!(inputUsage || outputUsage || apiVersionEnumOnly || exceptionUsage)) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
const [enumType, knownValuesEnum] = buildEnumTypes(
|
|
259
|
+
context,
|
|
260
|
+
type,
|
|
261
|
+
isExtensibleEnum(context, type),
|
|
262
|
+
);
|
|
263
|
+
if (enumType.name.startsWith("_")) {
|
|
264
|
+
// skip enum generation for internal enums
|
|
265
|
+
return;
|
|
266
|
+
}
|
|
267
|
+
if (apiVersionEnumOnly) {
|
|
268
|
+
// generate known values enum only for api version enums
|
|
269
|
+
addDeclaration(sourceFile, knownValuesEnum, refkey(knownValuesEnum.name, "knownValues"));
|
|
270
|
+
} else {
|
|
271
|
+
if (isExtensibleEnum(context, type)) {
|
|
272
|
+
addDeclaration(sourceFile, knownValuesEnum, refkey(type, "knownValues"));
|
|
273
|
+
}
|
|
274
|
+
addDeclaration(sourceFile, enumType, type);
|
|
275
|
+
}
|
|
276
|
+
} else if (type.kind === "union") {
|
|
277
|
+
const unionType = buildUnionType(context, type);
|
|
278
|
+
addDeclaration(sourceFile, unionType, type);
|
|
279
|
+
addSerializationFunctions(context, type, sourceFile);
|
|
280
|
+
} else if (type.kind === "dict") {
|
|
281
|
+
addDeclaration(sourceFile, normalizeModelName(context, type), type);
|
|
282
|
+
addSerializationFunctions(context, type, sourceFile);
|
|
283
|
+
} else if (type.kind === "array") {
|
|
284
|
+
addDeclaration(sourceFile, normalizeModelName(context, type), type);
|
|
285
|
+
addSerializationFunctions(context, type, sourceFile);
|
|
286
|
+
} else if (type.kind === "nullable") {
|
|
287
|
+
const nullableType = buildNullableType(context, type);
|
|
288
|
+
addDeclaration(sourceFile, nullableType, type);
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
export function getApiVersionEnum(context: SdkContext) {
|
|
293
|
+
// Skip api version enum for multi-service scenarios since each service may have different versions
|
|
294
|
+
if (context.rlcOptions?.isMultiService) {
|
|
295
|
+
return;
|
|
296
|
+
}
|
|
297
|
+
const apiVersionEnum = context.sdkPackage.enums.find(
|
|
298
|
+
(e) => e.usage === UsageFlags.ApiVersionEnum,
|
|
299
|
+
);
|
|
300
|
+
if (!apiVersionEnum) {
|
|
301
|
+
return;
|
|
302
|
+
}
|
|
303
|
+
return apiVersionEnum;
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
export function getModelsPath(sourceRoot: string, modelNamespace: string[] = []): string {
|
|
307
|
+
return path.join(
|
|
308
|
+
...[
|
|
309
|
+
sourceRoot,
|
|
310
|
+
"models",
|
|
311
|
+
...modelNamespace.map((n) => normalizeName(n, NameType.File)),
|
|
312
|
+
`models.ts`,
|
|
313
|
+
],
|
|
314
|
+
);
|
|
315
|
+
}
|
|
316
|
+
|
|
317
|
+
export function getModelNamespaces(context: SdkContext, model: SdkType): string[] {
|
|
318
|
+
if (model.kind === "model" || model.kind === "enum" || model.kind === "union") {
|
|
319
|
+
if (
|
|
320
|
+
(model.namespace ?? "").startsWith("Azure.ResourceManager") ||
|
|
321
|
+
(model.namespace ?? "").startsWith("Azure.Core") ||
|
|
322
|
+
(model.crossLanguageDefinitionId ?? "").startsWith("TypeSpec.Rest.Resource") ||
|
|
323
|
+
(model.crossLanguageDefinitionId ?? "") === "TypeSpec.Http.File" // filter out the TypeSpec.Http.File model similar like what java does here https://github.com/microsoft/typespec/blob/main/packages/http-client-java/emitter/src/code-model-builder.ts#L2589
|
|
324
|
+
) {
|
|
325
|
+
return [];
|
|
326
|
+
}
|
|
327
|
+
const segments = model.namespace.split(".");
|
|
328
|
+
// Keep full namespace segments if multiple services are present because there isn't a root namespace to trim
|
|
329
|
+
if (context.rlcOptions?.isMultiService) {
|
|
330
|
+
return segments;
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
const allServiceNamespaces = context.allServiceNamespaces ?? listAllServiceNamespaces(context);
|
|
334
|
+
const deepestNamespace = getNamespaceFullName(allServiceNamespaces[0]!);
|
|
335
|
+
const rootNamespace = deepestNamespace.split(".") ?? [];
|
|
336
|
+
if (segments.length > rootNamespace.length) {
|
|
337
|
+
while (segments[0] === rootNamespace[0]) {
|
|
338
|
+
segments.shift();
|
|
339
|
+
rootNamespace.shift();
|
|
340
|
+
}
|
|
341
|
+
return segments;
|
|
342
|
+
}
|
|
343
|
+
return [];
|
|
344
|
+
} else if (model.kind === "array" || model.kind === "dict") {
|
|
345
|
+
return getModelNamespaces(context, model.valueType);
|
|
346
|
+
} else if (model.kind === "nullable") {
|
|
347
|
+
return getModelNamespaces(context, model.type);
|
|
348
|
+
}
|
|
349
|
+
return [];
|
|
350
|
+
}
|
|
351
|
+
|
|
352
|
+
/**
|
|
353
|
+
* Checks if a model type appears as a nested property (directly or as an array element)
|
|
354
|
+
* inside any other XML model in the emit queue. XmlObject serializers/deserializers
|
|
355
|
+
* are only needed for models that are nested inside other models.
|
|
356
|
+
*/
|
|
357
|
+
function isNestedInXmlModel(targetModel: SdkModelType): boolean {
|
|
358
|
+
for (const type of emitQueue) {
|
|
359
|
+
if (type.kind !== "model" || type === targetModel) {
|
|
360
|
+
continue;
|
|
361
|
+
}
|
|
362
|
+
if (!hasXmlSerialization(type)) {
|
|
363
|
+
continue;
|
|
364
|
+
}
|
|
365
|
+
// Check properties of this model and all ancestors
|
|
366
|
+
for (const property of getModelAndAncestorProperties(type)) {
|
|
367
|
+
const propType = property.type;
|
|
368
|
+
if (propType.kind === "model" && propType === targetModel) {
|
|
369
|
+
return true;
|
|
370
|
+
}
|
|
371
|
+
if (
|
|
372
|
+
propType.kind === "array" &&
|
|
373
|
+
propType.valueType.kind === "model" &&
|
|
374
|
+
propType.valueType === targetModel
|
|
375
|
+
) {
|
|
376
|
+
return true;
|
|
377
|
+
}
|
|
378
|
+
}
|
|
379
|
+
}
|
|
380
|
+
return false;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* Gets all properties from a model and its ancestors (base models).
|
|
385
|
+
*/
|
|
386
|
+
function getModelAndAncestorProperties(type: SdkModelType): SdkModelPropertyType[] {
|
|
387
|
+
const properties: SdkModelPropertyType[] = [];
|
|
388
|
+
let current: SdkModelType | undefined = type;
|
|
389
|
+
while (current) {
|
|
390
|
+
for (const prop of current.properties) {
|
|
391
|
+
if (prop.kind === "property") {
|
|
392
|
+
properties.push(prop);
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
current = current.baseModel;
|
|
396
|
+
}
|
|
397
|
+
return properties;
|
|
398
|
+
}
|
|
399
|
+
|
|
400
|
+
function addSerializationFunctions(
|
|
401
|
+
context: SdkContext,
|
|
402
|
+
typeOrProperty: SdkType | SdkModelPropertyType,
|
|
403
|
+
sourceFile: SourceFile,
|
|
404
|
+
skipDiscriminatedUnionSuffix = false,
|
|
405
|
+
) {
|
|
406
|
+
const options = {
|
|
407
|
+
nameOnly: false,
|
|
408
|
+
skipDiscriminatedUnionSuffix,
|
|
409
|
+
};
|
|
410
|
+
|
|
411
|
+
// Add JSON serializers
|
|
412
|
+
const serializationFunction =
|
|
413
|
+
typeOrProperty.kind === "property"
|
|
414
|
+
? buildPropertySerializer(context, typeOrProperty, options)
|
|
415
|
+
: buildModelSerializer(context, typeOrProperty, options);
|
|
416
|
+
|
|
417
|
+
const serializerRefKey = refkey(typeOrProperty, "serializer");
|
|
418
|
+
const deserializerRefKey = refkey(typeOrProperty, "deserializer");
|
|
419
|
+
if (
|
|
420
|
+
serializationFunction &&
|
|
421
|
+
typeof serializationFunction !== "string" &&
|
|
422
|
+
serializationFunction.name
|
|
423
|
+
) {
|
|
424
|
+
addDeclaration(sourceFile, serializationFunction, serializerRefKey);
|
|
425
|
+
}
|
|
426
|
+
const deserializationFunction =
|
|
427
|
+
typeOrProperty.kind === "property"
|
|
428
|
+
? buildPropertyDeserializer(context, typeOrProperty, options)
|
|
429
|
+
: buildModelDeserializer(context, typeOrProperty, options);
|
|
430
|
+
if (
|
|
431
|
+
deserializationFunction &&
|
|
432
|
+
typeof deserializationFunction !== "string" &&
|
|
433
|
+
deserializationFunction.name
|
|
434
|
+
) {
|
|
435
|
+
addDeclaration(sourceFile, deserializationFunction, deserializerRefKey);
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
// Add XML serializers if the type has XML serialization options
|
|
439
|
+
if (typeOrProperty.kind === "model" && hasXmlSerialization(typeOrProperty)) {
|
|
440
|
+
const xmlSerializerRefKey = refkey(typeOrProperty, "xmlSerializer");
|
|
441
|
+
const xmlDeserializerRefKey = refkey(typeOrProperty, "xmlDeserializer");
|
|
442
|
+
|
|
443
|
+
const xmlSerializationFunction = buildXmlModelSerializer(context, typeOrProperty, options);
|
|
444
|
+
if (
|
|
445
|
+
xmlSerializationFunction &&
|
|
446
|
+
typeof xmlSerializationFunction !== "string" &&
|
|
447
|
+
xmlSerializationFunction.name
|
|
448
|
+
) {
|
|
449
|
+
addDeclaration(sourceFile, xmlSerializationFunction, xmlSerializerRefKey);
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
const xmlDeserializationFunction = buildXmlModelDeserializer(context, typeOrProperty, options);
|
|
453
|
+
if (
|
|
454
|
+
xmlDeserializationFunction &&
|
|
455
|
+
typeof xmlDeserializationFunction !== "string" &&
|
|
456
|
+
xmlDeserializationFunction.name
|
|
457
|
+
) {
|
|
458
|
+
addDeclaration(sourceFile, xmlDeserializationFunction, xmlDeserializerRefKey);
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
// Only generate XML object serializer/deserializer for models that are
|
|
462
|
+
// actually nested as properties inside other XML models
|
|
463
|
+
if (isNestedInXmlModel(typeOrProperty)) {
|
|
464
|
+
const xmlObjectSerializerRefKey = refkey(typeOrProperty, "xmlObjectSerializer");
|
|
465
|
+
const xmlObjectDeserializerRefKey = refkey(typeOrProperty, "xmlObjectDeserializer");
|
|
466
|
+
|
|
467
|
+
const xmlObjectSerializationFunction = buildXmlObjectModelSerializer(
|
|
468
|
+
context,
|
|
469
|
+
typeOrProperty,
|
|
470
|
+
options,
|
|
471
|
+
);
|
|
472
|
+
if (
|
|
473
|
+
xmlObjectSerializationFunction &&
|
|
474
|
+
typeof xmlObjectSerializationFunction !== "string" &&
|
|
475
|
+
xmlObjectSerializationFunction.name
|
|
476
|
+
) {
|
|
477
|
+
addDeclaration(sourceFile, xmlObjectSerializationFunction, xmlObjectSerializerRefKey);
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
const xmlObjectDeserializationFunction = buildXmlObjectModelDeserializer(
|
|
481
|
+
context,
|
|
482
|
+
typeOrProperty,
|
|
483
|
+
options,
|
|
484
|
+
);
|
|
485
|
+
if (
|
|
486
|
+
xmlObjectDeserializationFunction &&
|
|
487
|
+
typeof xmlObjectDeserializationFunction !== "string" &&
|
|
488
|
+
xmlObjectDeserializationFunction.name
|
|
489
|
+
) {
|
|
490
|
+
addDeclaration(sourceFile, xmlObjectDeserializationFunction, xmlObjectDeserializerRefKey);
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
}
|
|
495
|
+
|
|
496
|
+
function buildUnionType(context: SdkContext, type: SdkUnionType): TypeAliasDeclarationStructure {
|
|
497
|
+
const unionDeclaration: TypeAliasDeclarationStructure = {
|
|
498
|
+
kind: StructureKind.TypeAlias,
|
|
499
|
+
name: normalizeModelName(context, type),
|
|
500
|
+
isExported: true,
|
|
501
|
+
type: type.variantTypes.map((v) => getTypeExpression(context, v)).join(" | "),
|
|
502
|
+
};
|
|
503
|
+
|
|
504
|
+
unionDeclaration.docs = [type.doc ?? `Alias for ${unionDeclaration.name}`];
|
|
505
|
+
|
|
506
|
+
return unionDeclaration;
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
function buildNullableType(context: SdkContext, type: SdkNullableType) {
|
|
510
|
+
const nullableDeclaration: TypeAliasDeclarationStructure = {
|
|
511
|
+
kind: StructureKind.TypeAlias,
|
|
512
|
+
name: normalizeModelName(context, type),
|
|
513
|
+
isExported: true,
|
|
514
|
+
type: getTypeExpression(context, type.type) + " | null",
|
|
515
|
+
};
|
|
516
|
+
nullableDeclaration.docs = [type.doc ?? `Alias for ${nullableDeclaration.name}`];
|
|
517
|
+
return nullableDeclaration;
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
export function buildEnumTypes(
|
|
521
|
+
context: SdkContext,
|
|
522
|
+
type: SdkEnumType,
|
|
523
|
+
reportMemberNameDiagnostic = false, // if reportMemberNameDiagnostic is true, it will report diagnostic for enum member name
|
|
524
|
+
): [TypeAliasDeclarationStructure, EnumDeclarationStructure] {
|
|
525
|
+
const rawMembers = type.values.map((value) =>
|
|
526
|
+
emitEnumMember(context, value, reportMemberNameDiagnostic),
|
|
527
|
+
);
|
|
528
|
+
const enumDeclaration: EnumDeclarationStructure = {
|
|
529
|
+
kind: StructureKind.Enum,
|
|
530
|
+
name: `Known${normalizeModelName(context, type)}`,
|
|
531
|
+
isExported: true,
|
|
532
|
+
members: deduplicateEnumMemberNames(rawMembers),
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
const enumAsUnion: TypeAliasDeclarationStructure = {
|
|
536
|
+
kind: StructureKind.TypeAlias,
|
|
537
|
+
name: normalizeModelName(context, type),
|
|
538
|
+
isExported: true,
|
|
539
|
+
type: !isExtensibleEnum(context, type)
|
|
540
|
+
? type.values.map((v) => getTypeExpression(context, v)).join(" | ")
|
|
541
|
+
: getTypeExpression(context, type.valueType),
|
|
542
|
+
};
|
|
543
|
+
|
|
544
|
+
const docs = type.doc ? type.doc : "Type of " + enumAsUnion.name;
|
|
545
|
+
enumAsUnion.docs =
|
|
546
|
+
isExtensibleEnum(context, type) && type.doc
|
|
547
|
+
? [getExtensibleEnumDescription(context, type) ?? docs]
|
|
548
|
+
: [docs];
|
|
549
|
+
enumDeclaration.docs = type.doc
|
|
550
|
+
? [type.doc]
|
|
551
|
+
: [`Known values of {@link ${type.name}} that the service accepts.`];
|
|
552
|
+
|
|
553
|
+
return [enumAsUnion, enumDeclaration];
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
function getExtensibleEnumDescription(context: SdkContext, model: SdkEnumType): string | undefined {
|
|
557
|
+
if (model.isFixed && model.name && model.values) {
|
|
558
|
+
return;
|
|
559
|
+
}
|
|
560
|
+
const valueDescriptions = model.values
|
|
561
|
+
.map((v) => `**${v.value}**${v.doc ? `: ${v.doc}` : ""}`)
|
|
562
|
+
.join(` \\\n`)
|
|
563
|
+
// Escape the character / to make sure we don't incorrectly announce a comment blocks /** */
|
|
564
|
+
.replace(/^\//g, "\\/")
|
|
565
|
+
.replace(/([^\\])(\/)/g, "$1\\/");
|
|
566
|
+
const enumLink = `{@link Known${normalizeModelName(context, model)}} can be used interchangeably with ${normalizeModelName(context, model)},\n this enum contains the known values that the service supports.`;
|
|
567
|
+
|
|
568
|
+
return [
|
|
569
|
+
`${model.doc} \\`,
|
|
570
|
+
enumLink,
|
|
571
|
+
`### Known values supported by the service`,
|
|
572
|
+
valueDescriptions,
|
|
573
|
+
].join(" \n");
|
|
574
|
+
}
|
|
575
|
+
|
|
576
|
+
/**
|
|
577
|
+
* Deduplicates enum member names by appending a numeric suffix (_1, _2, ...)
|
|
578
|
+
* to all members that share the same normalized name.
|
|
579
|
+
* This handles cases where different values (e.g. "10" and "1.0") normalize
|
|
580
|
+
* to the same identifier.
|
|
581
|
+
*/
|
|
582
|
+
function deduplicateEnumMemberNames(members: EnumMemberStructure[]): EnumMemberStructure[] {
|
|
583
|
+
const nameCount = new Map<string, number>();
|
|
584
|
+
for (const member of members) {
|
|
585
|
+
const name = member.name as string;
|
|
586
|
+
nameCount.set(name, (nameCount.get(name) ?? 0) + 1);
|
|
587
|
+
}
|
|
588
|
+
const nameCurrentIndex = new Map<string, number>();
|
|
589
|
+
return members.map((member) => {
|
|
590
|
+
const name = member.name as string;
|
|
591
|
+
if ((nameCount.get(name) ?? 0) > 1) {
|
|
592
|
+
const index = (nameCurrentIndex.get(name) ?? 0) + 1;
|
|
593
|
+
nameCurrentIndex.set(name, index);
|
|
594
|
+
return { ...member, name: `${name}_${index}` };
|
|
595
|
+
}
|
|
596
|
+
return member;
|
|
597
|
+
});
|
|
598
|
+
}
|
|
599
|
+
|
|
600
|
+
function emitEnumMember(
|
|
601
|
+
context: SdkContext,
|
|
602
|
+
member: SdkEnumValueType,
|
|
603
|
+
reportMemberNameDiagnostic = false, // if reportMemberNameDiagnostic is true, it will report diagnostic for enum member name
|
|
604
|
+
): EnumMemberStructure {
|
|
605
|
+
const shouldNormalizeName = !member.name.startsWith("$DO_NOT_NORMALIZE$");
|
|
606
|
+
const enumTypeName = normalizeName(member.enumType.name, NameType.Interface, true);
|
|
607
|
+
let normalizedMemberName = context.rlcOptions?.ignoreEnumMemberNameNormalize
|
|
608
|
+
? fixLeadingNumber(member.name, NameType.EnumMemberName) // need to fix the leading number also for enum member
|
|
609
|
+
: normalizeName(member.name, NameType.EnumMemberName, true);
|
|
610
|
+
// If the member name starts with _ due to a leading digit (not because the original has _),
|
|
611
|
+
// replace the _ prefix with either "V" (for API version enums) or the enum type name.
|
|
612
|
+
if (
|
|
613
|
+
shouldNormalizeName &&
|
|
614
|
+
normalizedMemberName.toLowerCase().startsWith("_") &&
|
|
615
|
+
!member.name.toLowerCase().startsWith("_")
|
|
616
|
+
) {
|
|
617
|
+
const isApiVersionEnum =
|
|
618
|
+
(member.enumType.usage & UsageFlags.ApiVersionEnum) === UsageFlags.ApiVersionEnum;
|
|
619
|
+
const prefix = isApiVersionEnum ? "V" : enumTypeName;
|
|
620
|
+
normalizedMemberName = prefix + normalizedMemberName.slice(1);
|
|
621
|
+
if (reportMemberNameDiagnostic) {
|
|
622
|
+
reportDiagnostic(context.program, {
|
|
623
|
+
code: "prefix-adding-in-enum-member",
|
|
624
|
+
format: {
|
|
625
|
+
memberName: member.name,
|
|
626
|
+
normalizedName: normalizedMemberName,
|
|
627
|
+
enumTypeName,
|
|
628
|
+
},
|
|
629
|
+
target: NoTarget,
|
|
630
|
+
});
|
|
631
|
+
}
|
|
632
|
+
}
|
|
633
|
+
const memberStructure: EnumMemberStructure = {
|
|
634
|
+
kind: StructureKind.EnumMember,
|
|
635
|
+
name: normalizedMemberName,
|
|
636
|
+
value: member.value,
|
|
637
|
+
};
|
|
638
|
+
|
|
639
|
+
if (member.doc) {
|
|
640
|
+
memberStructure.docs = [member.doc];
|
|
641
|
+
} else {
|
|
642
|
+
// Provide default documentation using the enum value when no explicit doc exists
|
|
643
|
+
memberStructure.docs = [String(member.value)];
|
|
644
|
+
}
|
|
645
|
+
|
|
646
|
+
return memberStructure;
|
|
647
|
+
}
|
|
648
|
+
|
|
649
|
+
function buildModelInterface(
|
|
650
|
+
context: SdkContext,
|
|
651
|
+
type: SdkModelType,
|
|
652
|
+
): InterfaceDeclarationStructure {
|
|
653
|
+
const flattenPropertySet = new Set<SdkModelPropertyType>();
|
|
654
|
+
// For non-input models (output-only, exception, etc.), filter out metadata
|
|
655
|
+
// properties (@header, @query, @path) since they are deserialized separately.
|
|
656
|
+
// For input models, keep metadata properties — users need to pass them.
|
|
657
|
+
const hasInputUsage = (type.usage & UsageFlags.Input) === UsageFlags.Input;
|
|
658
|
+
const interfaceStructure = {
|
|
659
|
+
kind: StructureKind.Interface,
|
|
660
|
+
name: normalizeModelName(context, type, NameType.Interface, true),
|
|
661
|
+
isExported: true,
|
|
662
|
+
properties: type.properties
|
|
663
|
+
.filter((p) => {
|
|
664
|
+
if (!hasInputUsage && p.__raw && isMetadata(context.program, p.__raw)) {
|
|
665
|
+
return false;
|
|
666
|
+
}
|
|
667
|
+
// Skip required metadata properties with Read-only visibility for ARM as they are not intended to be in the model
|
|
668
|
+
// These properties are not be generated no matter they are in input or output models in most cases in HLC
|
|
669
|
+
// Only skip properties that have exclusively Read visibility to avoid stripping @path properties
|
|
670
|
+
// on parameter bag models that also carry other visibility flags (e.g. Create/Update)
|
|
671
|
+
if (
|
|
672
|
+
context.arm &&
|
|
673
|
+
p.__raw &&
|
|
674
|
+
isMetadata(context.program, p.__raw) &&
|
|
675
|
+
p.visibility?.length === 1 &&
|
|
676
|
+
p.visibility?.includes(Visibility.Read)
|
|
677
|
+
) {
|
|
678
|
+
return false;
|
|
679
|
+
}
|
|
680
|
+
// filter out the flatten property to be processed later
|
|
681
|
+
if (p.flatten && p.type.kind === "model") {
|
|
682
|
+
flattenPropertySet.add(p);
|
|
683
|
+
return false;
|
|
684
|
+
}
|
|
685
|
+
return true;
|
|
686
|
+
})
|
|
687
|
+
.map((p) => {
|
|
688
|
+
return buildModelProperty(context, p, type);
|
|
689
|
+
}),
|
|
690
|
+
} as InterfaceStructure;
|
|
691
|
+
for (const flatten of flattenPropertySet.keys()) {
|
|
692
|
+
const conflictMap = useContext("sdkTypes").flattenProperties.get(flatten)?.conflictMap;
|
|
693
|
+
const allProperties = getAllProperties(context, flatten.type, getAllAncestors(flatten.type));
|
|
694
|
+
interfaceStructure.properties!.push(
|
|
695
|
+
...allProperties.map((p) => {
|
|
696
|
+
// when the flattened property is optional, all its child properties should be optional too
|
|
697
|
+
const property = getPropertyWithOverrides(p, {
|
|
698
|
+
allOptional: flatten.optional,
|
|
699
|
+
propertyRenames: conflictMap,
|
|
700
|
+
});
|
|
701
|
+
return buildModelProperty(context, property, type);
|
|
702
|
+
}),
|
|
703
|
+
);
|
|
704
|
+
}
|
|
705
|
+
|
|
706
|
+
// Add properties from @clientOption("header", ...) that don't already exist in the model
|
|
707
|
+
const headerOptions = getHeaderClientOptions(type);
|
|
708
|
+
if (headerOptions.length > 0) {
|
|
709
|
+
const existingNames = new Set(
|
|
710
|
+
interfaceStructure.properties!.map((p: OptionalKind<PropertySignatureStructure>) => p.name),
|
|
711
|
+
);
|
|
712
|
+
for (const opt of headerOptions) {
|
|
713
|
+
if (!existingNames.has(opt.propertyName)) {
|
|
714
|
+
interfaceStructure.properties!.push({
|
|
715
|
+
kind: StructureKind.PropertySignature,
|
|
716
|
+
name: opt.propertyName,
|
|
717
|
+
type: "string",
|
|
718
|
+
hasQuestionToken: true,
|
|
719
|
+
});
|
|
720
|
+
}
|
|
721
|
+
}
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
if (type.baseModel) {
|
|
725
|
+
const parentReference = getModelExpression(context, type.baseModel, {
|
|
726
|
+
skipPolymorphicUnion: true,
|
|
727
|
+
});
|
|
728
|
+
interfaceStructure.extends = [parentReference];
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
if (type.additionalProperties) {
|
|
732
|
+
addExtendedDictInfo(context, type, interfaceStructure);
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
interfaceStructure.docs = [type.doc ?? "model interface " + interfaceStructure.name];
|
|
736
|
+
|
|
737
|
+
return interfaceStructure;
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
function addExtendedDictInfo(
|
|
741
|
+
context: SdkContext,
|
|
742
|
+
model: SdkModelType,
|
|
743
|
+
modelInterface: InterfaceStructure,
|
|
744
|
+
) {
|
|
745
|
+
const additionalPropertiesType = model.additionalProperties
|
|
746
|
+
? getTypeExpression(context, model.additionalProperties)
|
|
747
|
+
: undefined;
|
|
748
|
+
if (context.rlcOptions?.compatibilityMode) {
|
|
749
|
+
const ancestors = getAllAncestors(model);
|
|
750
|
+
const properties = getAllProperties(context, model, ancestors);
|
|
751
|
+
let anyType: boolean;
|
|
752
|
+
if (!additionalPropertiesType) {
|
|
753
|
+
// case 1: if additionalProperties is not defined, we should use any type
|
|
754
|
+
anyType = true;
|
|
755
|
+
} else if (properties.length === 0) {
|
|
756
|
+
// case 2: if additionalProperties is defined and model.properties is empty, we should use additionalProperties type
|
|
757
|
+
anyType = false;
|
|
758
|
+
} else {
|
|
759
|
+
// case 3: if additionalProperties is defined and model.properties is not empty, we should check if all properties are compatible with additionalProperties type
|
|
760
|
+
anyType = !properties.every((p) => {
|
|
761
|
+
return additionalPropertiesType?.includes(getTypeExpression(context, p.type));
|
|
762
|
+
});
|
|
763
|
+
}
|
|
764
|
+
if (!modelInterface.extends) {
|
|
765
|
+
modelInterface.extends = [];
|
|
766
|
+
}
|
|
767
|
+
modelInterface.extends.push(`Record<string, ${anyType ? "any" : additionalPropertiesType}>`);
|
|
768
|
+
} else {
|
|
769
|
+
const additionalPropertiesType = model.additionalProperties
|
|
770
|
+
? getTypeExpression(context, model.additionalProperties)
|
|
771
|
+
: undefined;
|
|
772
|
+
const name = getAdditionalPropertiesName(context, model);
|
|
773
|
+
if (name !== "additionalProperties") {
|
|
774
|
+
// report diagnostic for additionalProperties
|
|
775
|
+
reportDiagnostic(context.program, {
|
|
776
|
+
code: "property-name-conflict",
|
|
777
|
+
format: {
|
|
778
|
+
propertyName: "additionalProperties",
|
|
779
|
+
},
|
|
780
|
+
target: NoTarget,
|
|
781
|
+
});
|
|
782
|
+
}
|
|
783
|
+
if (!modelInterface.properties) {
|
|
784
|
+
modelInterface.properties = [];
|
|
785
|
+
}
|
|
786
|
+
modelInterface.properties.push({
|
|
787
|
+
name,
|
|
788
|
+
docs: ["Additional properties"],
|
|
789
|
+
hasQuestionToken: true,
|
|
790
|
+
isReadonly: false,
|
|
791
|
+
type: `Record<string, ${additionalPropertiesType ?? "any"}>`,
|
|
792
|
+
});
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
export function getAdditionalPropertiesName(context: SdkContext, model: SdkModelType): string {
|
|
797
|
+
const ancestors = getAllAncestors(model);
|
|
798
|
+
const properties = getAllProperties(context, model, ancestors);
|
|
799
|
+
const nameConflict = properties.find((p) => p.name === "additionalProperties");
|
|
800
|
+
return nameConflict ? "additionalPropertiesBag" : "additionalProperties";
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
export function normalizeModelName(
|
|
804
|
+
context: SdkContext,
|
|
805
|
+
type:
|
|
806
|
+
| SdkModelType
|
|
807
|
+
| SdkEnumType
|
|
808
|
+
| SdkUnionType
|
|
809
|
+
| SdkArrayType
|
|
810
|
+
| SdkDictionaryType
|
|
811
|
+
| SdkNullableType,
|
|
812
|
+
nameType: NameType = NameType.Interface,
|
|
813
|
+
skipPolymorphicUnionSuffix = false,
|
|
814
|
+
rawModelName?: boolean,
|
|
815
|
+
): string {
|
|
816
|
+
if (type.kind === "array") {
|
|
817
|
+
if (rawModelName) {
|
|
818
|
+
return `${normalizeModelName(context, type.valueType as any, nameType, skipPolymorphicUnionSuffix, rawModelName)}Array`;
|
|
819
|
+
}
|
|
820
|
+
return `Array<${normalizeModelName(context, type.valueType as any, nameType)}>`;
|
|
821
|
+
} else if (type.kind === "dict") {
|
|
822
|
+
if (rawModelName) {
|
|
823
|
+
return `${normalizeModelName(context, type.valueType as any, nameType, skipPolymorphicUnionSuffix, rawModelName)}Record`;
|
|
824
|
+
}
|
|
825
|
+
return `Record<string, ${normalizeModelName(context, type.valueType as any, nameType)}>`;
|
|
826
|
+
}
|
|
827
|
+
if (
|
|
828
|
+
type.kind !== "model" &&
|
|
829
|
+
type.kind !== "enum" &&
|
|
830
|
+
type.kind !== "union" &&
|
|
831
|
+
type.kind !== "nullable"
|
|
832
|
+
) {
|
|
833
|
+
return getTypeExpression(context, type);
|
|
834
|
+
}
|
|
835
|
+
|
|
836
|
+
const segments = getModelNamespaces(context, type);
|
|
837
|
+
let unionSuffix = "";
|
|
838
|
+
if (!skipPolymorphicUnionSuffix) {
|
|
839
|
+
if (type.kind === "model" && isDiscriminatedUnion(type)) {
|
|
840
|
+
unionSuffix = "Union";
|
|
841
|
+
}
|
|
842
|
+
}
|
|
843
|
+
const namespacePrefix = context.rlcOptions?.enableModelNamespace ? segments.join("") : "";
|
|
844
|
+
const internalModelPrefix =
|
|
845
|
+
(isPagedResultModel(context, type) && !pagedModelsKeptPublic.has(type)) || type.isGeneratedName
|
|
846
|
+
? "_"
|
|
847
|
+
: "";
|
|
848
|
+
return `${internalModelPrefix}${normalizeName(namespacePrefix + type.name, nameType, true)}${unionSuffix}`;
|
|
849
|
+
}
|
|
850
|
+
|
|
851
|
+
function buildModelPolymorphicType(context: SdkContext, type: SdkModelType) {
|
|
852
|
+
// Only include direct subtypes in this union
|
|
853
|
+
const directSubtypes = getDirectSubtypes(type);
|
|
854
|
+
if (directSubtypes.length === 0) {
|
|
855
|
+
return undefined;
|
|
856
|
+
}
|
|
857
|
+
const typeDeclaration: TypeAliasDeclarationStructure = {
|
|
858
|
+
kind: StructureKind.TypeAlias,
|
|
859
|
+
name: `${normalizeModelName(context, type, NameType.Interface, true)}Union`,
|
|
860
|
+
isExported: true,
|
|
861
|
+
type: directSubtypes
|
|
862
|
+
.filter((p) => {
|
|
863
|
+
return (
|
|
864
|
+
p.usage !== undefined &&
|
|
865
|
+
((p.usage & UsageFlags.Output) === UsageFlags.Output ||
|
|
866
|
+
(p.usage & UsageFlags.Input) === UsageFlags.Input)
|
|
867
|
+
);
|
|
868
|
+
})
|
|
869
|
+
.map((t) => getTypeExpression(context, t))
|
|
870
|
+
.join(" | "),
|
|
871
|
+
};
|
|
872
|
+
typeDeclaration.docs = [`Alias for ${typeDeclaration.name}`];
|
|
873
|
+
|
|
874
|
+
typeDeclaration.type += ` | ${getModelExpression(context, type, {
|
|
875
|
+
skipPolymorphicUnion: true,
|
|
876
|
+
})}`;
|
|
877
|
+
return typeDeclaration;
|
|
878
|
+
}
|
|
879
|
+
|
|
880
|
+
function buildModelProperty(
|
|
881
|
+
context: SdkContext,
|
|
882
|
+
property: SdkModelPropertyType,
|
|
883
|
+
model: SdkModelType,
|
|
884
|
+
): PropertySignatureStructure {
|
|
885
|
+
const normalizedPropName = normalizeModelPropertyName(context, property);
|
|
886
|
+
if (
|
|
887
|
+
!context.rlcOptions?.ignorePropertyNameNormalize &&
|
|
888
|
+
normalizedPropName !== `"${property.name}"`
|
|
889
|
+
) {
|
|
890
|
+
reportDiagnostic(context.program, {
|
|
891
|
+
code: "property-name-normalized",
|
|
892
|
+
format: {
|
|
893
|
+
propertyName: property.name,
|
|
894
|
+
normalizedName: normalizedPropName,
|
|
895
|
+
},
|
|
896
|
+
target: NoTarget,
|
|
897
|
+
});
|
|
898
|
+
}
|
|
899
|
+
|
|
900
|
+
let typeExpression: string;
|
|
901
|
+
const allDiscriminatorValues = getAllDiscriminatedValues(model, property);
|
|
902
|
+
|
|
903
|
+
// We need refine the discriminator property if
|
|
904
|
+
// 1. it is discriminated union
|
|
905
|
+
// 2. it has other discriminator values except itself
|
|
906
|
+
if (isDiscriminatedUnion(model) && allDiscriminatorValues.length > 1) {
|
|
907
|
+
typeExpression = allDiscriminatorValues.map((value) => `"${value}"`).join(" | ");
|
|
908
|
+
} else if (property.kind === "property" && property.serializationOptions.multipart?.isFilePart) {
|
|
909
|
+
typeExpression = getMultipartFileTypeExpression(context, property);
|
|
910
|
+
} else {
|
|
911
|
+
typeExpression = getTypeExpression(context, property.type, {
|
|
912
|
+
isOptional: property.optional,
|
|
913
|
+
});
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
const propertyStructure: PropertySignatureStructure = {
|
|
917
|
+
kind: StructureKind.PropertySignature,
|
|
918
|
+
name: normalizedPropName,
|
|
919
|
+
type: typeExpression,
|
|
920
|
+
hasQuestionToken: property.optional,
|
|
921
|
+
isReadonly: isReadOnly(property as SdkModelPropertyType),
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
if (property.doc) {
|
|
925
|
+
propertyStructure.docs = [property.doc];
|
|
926
|
+
}
|
|
927
|
+
|
|
928
|
+
return propertyStructure;
|
|
929
|
+
}
|
|
930
|
+
|
|
931
|
+
export function visitPackageTypes(context: SdkContext) {
|
|
932
|
+
const { sdkPackage } = context;
|
|
933
|
+
emitQueue.clear();
|
|
934
|
+
flattenPropertyModelMap.clear();
|
|
935
|
+
pagedModelsKeptPublic.clear();
|
|
936
|
+
// Add all models in the package to the emit queue
|
|
937
|
+
for (const model of sdkPackage.models) {
|
|
938
|
+
visitType(context, model);
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
for (const union of sdkPackage.unions) {
|
|
942
|
+
visitType(context, union);
|
|
943
|
+
}
|
|
944
|
+
// Add all enums to the queue
|
|
945
|
+
for (const enumType of sdkPackage.enums) {
|
|
946
|
+
if (!emitQueue.has(enumType)) {
|
|
947
|
+
emitQueue.add(enumType);
|
|
948
|
+
}
|
|
949
|
+
}
|
|
950
|
+
|
|
951
|
+
// Visit the clients to discover all models
|
|
952
|
+
for (const client of sdkPackage.clients) {
|
|
953
|
+
visitClient(context, client);
|
|
954
|
+
}
|
|
955
|
+
}
|
|
956
|
+
|
|
957
|
+
function visitClient(context: SdkContext, client: SdkClientType<SdkServiceOperation>) {
|
|
958
|
+
// TODO: include the client parameters
|
|
959
|
+
// https://github.com/Azure/autorest.typescript/issues/3148
|
|
960
|
+
// Comment this out for now, as client initialization is not used in the generated code
|
|
961
|
+
getAllOperationsFromClient(client).forEach((method) => visitClientMethod(context, method));
|
|
962
|
+
}
|
|
963
|
+
|
|
964
|
+
function visitClientMethod(context: SdkContext, method: SdkMethod<SdkHttpOperation>) {
|
|
965
|
+
switch (method.kind) {
|
|
966
|
+
case "lro":
|
|
967
|
+
case "paging":
|
|
968
|
+
case "lropaging":
|
|
969
|
+
case "basic":
|
|
970
|
+
visitMethod(context, method);
|
|
971
|
+
visitOperation(context, method.operation);
|
|
972
|
+
break;
|
|
973
|
+
default:
|
|
974
|
+
reportDiagnostic(context.program, {
|
|
975
|
+
code: "unknown-sdk-method-kind",
|
|
976
|
+
format: {
|
|
977
|
+
methodKind: (method as any).kind,
|
|
978
|
+
},
|
|
979
|
+
target: NoTarget,
|
|
980
|
+
});
|
|
981
|
+
return; // Skip processing this method but continue with others
|
|
982
|
+
}
|
|
983
|
+
}
|
|
984
|
+
|
|
985
|
+
function visitOperation(context: SdkContext, operation: SdkHttpOperation) {
|
|
986
|
+
// Visit the request
|
|
987
|
+
visitType(context, operation.bodyParam?.type);
|
|
988
|
+
// Visit the response
|
|
989
|
+
operation.exceptions.forEach((exception) => visitType(context, exception.type));
|
|
990
|
+
|
|
991
|
+
operation.parameters.forEach((parameter) => {
|
|
992
|
+
visitType(context, parameter.type);
|
|
993
|
+
});
|
|
994
|
+
|
|
995
|
+
operation.responses.forEach((response) => visitType(context, response.type));
|
|
996
|
+
}
|
|
997
|
+
|
|
998
|
+
function visitMethod(context: SdkContext, method: SdkServiceMethod<SdkHttpOperation>) {
|
|
999
|
+
// Visit the request
|
|
1000
|
+
method.parameters.forEach((parameter) => {
|
|
1001
|
+
visitType(context, parameter.type);
|
|
1002
|
+
});
|
|
1003
|
+
visitType(context, method.response.type);
|
|
1004
|
+
trackPagedModelInNonPagingMethod(context, method);
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
/**
|
|
1008
|
+
* If a non-paging method's direct response type is a paged result model,
|
|
1009
|
+
* mark it so that normalizeModelName keeps it public (no "_" prefix).
|
|
1010
|
+
*/
|
|
1011
|
+
function trackPagedModelInNonPagingMethod(
|
|
1012
|
+
context: SdkContext,
|
|
1013
|
+
method: SdkServiceMethod<SdkHttpOperation>,
|
|
1014
|
+
): void {
|
|
1015
|
+
if (method.kind !== "basic" && method.kind !== "lro") return;
|
|
1016
|
+
const respType = method.response.type;
|
|
1017
|
+
if (respType && isPagedResultModel(context, respType)) {
|
|
1018
|
+
pagedModelsKeptPublic.add(respType);
|
|
1019
|
+
}
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
/**
|
|
1023
|
+
* If a paged result model is used as a model property type, mark it so that
|
|
1024
|
+
* normalizeModelName keeps it public (no "_" prefix).
|
|
1025
|
+
*/
|
|
1026
|
+
function trackPagedModelUsedAsProperty(context: SdkContext, type: SdkType): void {
|
|
1027
|
+
// Unwrap array types to check the element type
|
|
1028
|
+
const resolved = type.kind === "array" ? type.valueType : type;
|
|
1029
|
+
if (resolved && isPagedResultModel(context, resolved)) {
|
|
1030
|
+
pagedModelsKeptPublic.add(resolved);
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
|
|
1034
|
+
function visitType(context: SdkContext, type: SdkType | undefined) {
|
|
1035
|
+
if (!type) {
|
|
1036
|
+
return;
|
|
1037
|
+
}
|
|
1038
|
+
|
|
1039
|
+
if (emitQueue.has(type)) {
|
|
1040
|
+
return;
|
|
1041
|
+
}
|
|
1042
|
+
emitQueue.add(type);
|
|
1043
|
+
if (type.kind === "model") {
|
|
1044
|
+
const externalModel = getExternalModel(type);
|
|
1045
|
+
if (externalModel) {
|
|
1046
|
+
return;
|
|
1047
|
+
}
|
|
1048
|
+
|
|
1049
|
+
if (type.additionalProperties) {
|
|
1050
|
+
visitType(context, type.additionalProperties);
|
|
1051
|
+
}
|
|
1052
|
+
for (const property of type.properties) {
|
|
1053
|
+
if (!emitQueue.has(property.type)) {
|
|
1054
|
+
visitType(context, property.type);
|
|
1055
|
+
}
|
|
1056
|
+
if (property.flatten && property.type.kind === "model") {
|
|
1057
|
+
flattenPropertyModelMap.set(property, type);
|
|
1058
|
+
}
|
|
1059
|
+
// If a paged result model is used as a model property (not as a paging
|
|
1060
|
+
// operation response), it must stay public (no "_" prefix) because users
|
|
1061
|
+
// interact with it directly through the property.
|
|
1062
|
+
trackPagedModelUsedAsProperty(context, property.type);
|
|
1063
|
+
}
|
|
1064
|
+
if (type.discriminatedSubtypes) {
|
|
1065
|
+
for (const subType of Object.values(type.discriminatedSubtypes)) {
|
|
1066
|
+
if (!emitQueue.has(subType)) {
|
|
1067
|
+
visitType(context, subType);
|
|
1068
|
+
}
|
|
1069
|
+
}
|
|
1070
|
+
}
|
|
1071
|
+
}
|
|
1072
|
+
if (type.kind === "array") {
|
|
1073
|
+
if (!emitQueue.has(type.valueType)) {
|
|
1074
|
+
visitType(context, type.valueType);
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
if (type.kind === "dict") {
|
|
1078
|
+
if (!emitQueue.has(type.valueType)) {
|
|
1079
|
+
visitType(context, type.valueType);
|
|
1080
|
+
}
|
|
1081
|
+
}
|
|
1082
|
+
if (type.kind === "union") {
|
|
1083
|
+
emitQueue.add(type);
|
|
1084
|
+
for (const value of type.variantTypes) {
|
|
1085
|
+
if (!emitQueue.has(value)) {
|
|
1086
|
+
visitType(context, value);
|
|
1087
|
+
}
|
|
1088
|
+
}
|
|
1089
|
+
}
|
|
1090
|
+
if (type.kind === "nullable") {
|
|
1091
|
+
emitQueue.add(type);
|
|
1092
|
+
if (!emitQueue.has(type.type)) {
|
|
1093
|
+
visitType(context, type.type);
|
|
1094
|
+
}
|
|
1095
|
+
}
|
|
1096
|
+
}
|