@azure-tools/typespec-ts 0.55.0-dev.1 → 0.55.0-dev.10
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +68 -105
- 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/hooks/binder.d.ts +1 -1
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +6 -7
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdk-types.d.ts +26 -0
- package/dist/src/framework/hooks/sdk-types.d.ts.map +1 -0
- package/dist/src/framework/hooks/sdk-types.js +157 -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 +4 -1
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +26 -34
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/framework/sample.js +1 -1
- package/dist/src/framework/sample.js.map +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +126 -192
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +2 -18
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +30 -124
- 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 +237 -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 +275 -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 +15 -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 +849 -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 +482 -0
- package/dist/src/modular/emit-samples.js.map +1 -0
- package/dist/src/modular/emit-tests.d.ts +8 -0
- package/dist/src/modular/emit-tests.d.ts.map +1 -0
- package/dist/src/modular/emit-tests.js +165 -0
- package/dist/src/modular/emit-tests.js.map +1 -0
- 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 +249 -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 +622 -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/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-model-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.js.map +1 -1
- 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 +17 -0
- package/dist/src/rlc-common/helpers/imports-util.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/imports-util.js +151 -0
- package/dist/src/rlc-common/helpers/imports-util.js.map +1 -0
- package/dist/src/rlc-common/helpers/name-constructors.d.ts +33 -0
- package/dist/src/rlc-common/helpers/name-constructors.d.ts.map +1 -0
- package/dist/src/rlc-common/helpers/name-constructors.js +45 -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/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/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/index.d.ts +21 -39
- package/dist/src/rlc-common/index.d.ts.map +1 -1
- package/dist/src/rlc-common/index.js +21 -39
- package/dist/src/rlc-common/index.js.map +1 -1
- package/dist/src/rlc-common/interfaces.d.ts +2 -20
- 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 +18 -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 +41 -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 +149 -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 +328 -0
- package/dist/src/rlc-common/metadata/build-readme-file.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 +14 -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 +51 -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 +129 -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 +73 -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 +14 -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 +14 -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 +203 -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 +155 -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/package-common.d.ts +43 -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 +103 -0
- package/dist/src/rlc-common/metadata/package-json/package-common.js.map +1 -0
- 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 +14 -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 +11 -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 +22 -0
- package/dist/src/rlc-common/test/build-snippets.js.map +1 -0
- package/dist/src/rlc-common/test/template.d.ts +3 -3
- package/dist/src/rlc-common/test/template.d.ts.map +1 -1
- package/dist/src/rlc-common/test/template.js +1 -35
- package/dist/src/rlc-common/test/template.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 +66 -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.map +1 -1
- package/dist/src/transform/transform.js +19 -26
- 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 +304 -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 +123 -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 +4 -0
- package/dist/src/utils/emit-util.d.ts.map +1 -0
- package/dist/src/utils/emit-util.js +60 -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 +57 -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 +1 -1
- 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 +1473 -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.d.ts +6 -4
- package/dist/src/utils/resolve-project-root.d.ts.map +1 -1
- package/dist/src/utils/resolve-project-root.js +11 -18
- package/dist/src/utils/resolve-project-root.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +45 -64
- package/src/context-manager.ts +101 -0
- package/src/framework/hooks/binder.ts +7 -8
- package/src/framework/hooks/sdk-types.ts +218 -0
- package/src/framework/hooks/use-dependencies.ts +16 -0
- package/src/framework/load-static-helpers.ts +38 -41
- package/src/framework/sample.ts +1 -1
- package/src/index.ts +148 -226
- package/src/lib.ts +32 -143
- 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 +317 -0
- package/src/modular/build-operations.ts +248 -0
- package/src/modular/build-project-files.ts +118 -0
- package/src/modular/build-restore-poller.ts +242 -0
- package/src/modular/build-root-index.ts +403 -0
- package/src/modular/build-subpath-index.ts +152 -0
- package/src/modular/emit-logger-file.ts +20 -0
- package/src/modular/emit-models-options.ts +56 -0
- package/src/modular/emit-models.ts +1080 -0
- package/src/modular/emit-samples.ts +659 -0
- package/src/modular/emit-tests.ts +211 -0
- package/src/modular/helpers/classical-operation-helpers.ts +375 -0
- package/src/modular/helpers/client-helpers.ts +352 -0
- package/src/modular/helpers/example-value-helpers.ts +836 -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/type-expressions/get-credential-expression.ts +1 -1
- package/src/modular/type-expressions/get-model-expression.ts +1 -1
- package/src/rlc-common/helpers/imports-util.ts +172 -0
- package/src/rlc-common/helpers/name-constructors.ts +88 -0
- package/src/rlc-common/helpers/operation-helpers.ts +138 -0
- package/src/rlc-common/index.ts +21 -39
- package/src/rlc-common/interfaces.ts +2 -23
- package/src/rlc-common/metadata/build-api-extractor-config.ts +22 -0
- package/src/rlc-common/metadata/build-es-lint-config.ts +45 -0
- package/src/rlc-common/metadata/build-package-file.ts +180 -0
- package/src/rlc-common/metadata/build-readme-file.ts +413 -0
- package/src/rlc-common/metadata/build-sample-env-file.ts +18 -0
- package/src/rlc-common/metadata/build-test-config.ts +67 -0
- package/src/rlc-common/metadata/build-ts-config.ts +177 -0
- package/src/rlc-common/metadata/build-warp-config.ts +87 -0
- package/src/rlc-common/metadata/package-json/azure-package-common.ts +20 -0
- package/src/rlc-common/metadata/package-json/build-azure-monorepo-package.ts +179 -0
- package/src/rlc-common/metadata/package-json/package-common.ts +137 -0
- package/src/rlc-common/static/polling-content.ts +225 -0
- package/src/rlc-common/test/build-recorded-client.ts +15 -0
- package/src/rlc-common/test/build-sample-test.ts +12 -0
- package/src/rlc-common/test/build-snippets.ts +25 -0
- package/src/rlc-common/test/template.ts +1 -35
- package/src/transform/transform-api-version-info.ts +103 -0
- package/src/transform/transform-helper-function-details.ts +79 -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 +18 -29
- package/src/transform/transfrom-rlc-options.ts +363 -0
- package/src/utils/client-utils.ts +161 -0
- package/src/utils/cross-language-def.ts +66 -0
- package/src/utils/emit-util.ts +67 -0
- package/src/utils/file-system-utils.ts +68 -0
- package/src/utils/import-helper.ts +59 -0
- package/src/utils/interfaces.ts +1 -1
- package/src/utils/model-utils.ts +1714 -0
- package/src/utils/operation-util.ts +763 -0
- package/src/utils/parameter-utils.ts +192 -0
- package/src/utils/resolve-project-root.ts +11 -24
- package/static/static-helpers/serialization/serializers.ts +1 -0
- 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 -157
- 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 -345
- 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 -48
- 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 -246
- 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 -14
- 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 -172
- 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 -91
- 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 -216
- 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 -279
- 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 -119
- 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 -850
- 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 -35
- 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 -500
- 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 -155
- 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 -258
- 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 -259
- 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 -639
- 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 -59
- 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 -2328
- 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 -94
- 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 -401
- 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 -444
- 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 -729
- 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 -145
- 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 -391
- 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 -157
- 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 -241
- 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 -223
- 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 -31
- 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 -412
- 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 -391
- 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 -61
- 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 -143
- 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 -71
- 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 -48
- 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 -43
- 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 -164
- 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 -61
- 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 -240
- 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 -104
- 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 -10
- 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 -10
- 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 -37
- 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 -162
- 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 -161
- 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 -55
- 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 -25
- 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 -79
- 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 -197
- 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 -418
- 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 -140
- 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 -15
- 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 -54
- 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 -26
- 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 -76
- 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 -171
- 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 -101
- 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 -180
- 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 -17
- 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 -14
- 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 -26
- 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 -313
- 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 -78
- 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 -74
- 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 -201
- 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 -102
- 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 -171
- 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 -191
- 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 -369
- 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 -124
- 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 -68
- 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 -59
- package/dist/src/utils/crossLanguageDef.js.map +0 -1
- package/dist/src/utils/dirname.d.ts +0 -9
- package/dist/src/utils/dirname.d.ts.map +0 -1
- package/dist/src/utils/dirname.js +0 -12
- package/dist/src/utils/dirname.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 -71
- package/dist/src/utils/emitUtil.js.map +0 -1
- package/dist/src/utils/fileSystemUtils.d.ts +0 -5
- package/dist/src/utils/fileSystemUtils.d.ts.map +0 -1
- package/dist/src/utils/fileSystemUtils.js +0 -59
- 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 -51
- 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 -124
- 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 -1488
- 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 -69
- 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 -547
- 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 -147
- package/dist/src/utils/parameterUtils.js.map +0 -1
- package/src/contextManager.ts +0 -101
- package/src/framework/hooks/sdkTypes.ts +0 -218
- package/src/framework/hooks/useDependencies.ts +0 -16
- package/src/modular/buildClassicalClient.ts +0 -434
- package/src/modular/buildClassicalOperationGroups.ts +0 -69
- package/src/modular/buildClientContext.ts +0 -325
- package/src/modular/buildOperations.ts +0 -248
- package/src/modular/buildProjectFiles.ts +0 -111
- package/src/modular/buildRestorePoller.ts +0 -242
- package/src/modular/buildRootIndex.ts +0 -407
- package/src/modular/buildSubpathIndex.ts +0 -152
- package/src/modular/emitLoggerFile.ts +0 -23
- package/src/modular/emitModels.ts +0 -1081
- package/src/modular/emitModelsOptions.ts +0 -56
- package/src/modular/emitSamples.ts +0 -675
- package/src/modular/emitTests.ts +0 -194
- package/src/modular/helpers/classicalOperationHelpers.ts +0 -375
- package/src/modular/helpers/clientHelpers.ts +0 -362
- package/src/modular/helpers/exampleValueHelpers.ts +0 -851
- package/src/modular/helpers/namingHelpers.ts +0 -84
- package/src/modular/helpers/operationHelpers.ts +0 -3035
- package/src/modular/helpers/typeHelpers.ts +0 -131
- package/src/modular/serialization/buildDeserializerFunction.ts +0 -564
- package/src/modular/serialization/buildSerializerFunction.ts +0 -616
- package/src/modular/serialization/buildXmlSerializerFunction.ts +0 -951
- package/src/modular/serialization/serializeUtils.ts +0 -217
- package/src/rlc-common/buildClient.ts +0 -490
- package/src/rlc-common/buildClientDefinitions.ts +0 -235
- package/src/rlc-common/buildIndexFile.ts +0 -344
- package/src/rlc-common/buildIsUnexpectedHelper.ts +0 -248
- package/src/rlc-common/buildLogger.ts +0 -43
- package/src/rlc-common/buildMethodShortcuts.ts +0 -71
- package/src/rlc-common/buildObjectTypes.ts +0 -603
- package/src/rlc-common/buildPaginateHelper.ts +0 -31
- package/src/rlc-common/buildParameterTypes.ts +0 -554
- package/src/rlc-common/buildPollingHelper.ts +0 -83
- package/src/rlc-common/buildResponseTypes.ts +0 -180
- package/src/rlc-common/buildSamples.ts +0 -32
- package/src/rlc-common/buildSchemaType.ts +0 -89
- package/src/rlc-common/buildSerializeHelper.ts +0 -49
- package/src/rlc-common/buildTopLevelIndexFile.ts +0 -58
- package/src/rlc-common/helpers/importsUtil.ts +0 -184
- package/src/rlc-common/helpers/nameConstructors.ts +0 -110
- package/src/rlc-common/helpers/operationHelpers.ts +0 -138
- package/src/rlc-common/helpers/packageUtil.ts +0 -13
- package/src/rlc-common/helpers/pathUtils.ts +0 -10
- package/src/rlc-common/helpers/shortcutMethods.ts +0 -58
- package/src/rlc-common/helpers/valueGenerationUtil.ts +0 -234
- package/src/rlc-common/metadata/buildApiExtractorConfig.ts +0 -64
- package/src/rlc-common/metadata/buildESLintConfig.ts +0 -84
- package/src/rlc-common/metadata/buildPackageFile.ts +0 -242
- package/src/rlc-common/metadata/buildReadmeFile.ts +0 -515
- package/src/rlc-common/metadata/buildRollupConfig.ts +0 -147
- package/src/rlc-common/metadata/buildSampleEnvFile.ts +0 -21
- package/src/rlc-common/metadata/buildTestConfig.ts +0 -72
- package/src/rlc-common/metadata/buildTsConfig.ts +0 -219
- package/src/rlc-common/metadata/buildWarpConfig.ts +0 -91
- package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +0 -152
- package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +0 -199
- package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +0 -123
- package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +0 -68
- package/src/rlc-common/metadata/packageJson/packageCommon.ts +0 -235
- package/src/rlc-common/static/pollingContent.ts +0 -225
- 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 -29
- package/src/rlc-common/transformSampleGroups.ts +0 -407
- package/src/transform/transformApiVersionInfo.ts +0 -103
- package/src/transform/transformHelperFunctionDetails.ts +0 -88
- package/src/transform/transformParameters.ts +0 -321
- package/src/transform/transformPaths.ts +0 -157
- package/src/transform/transformResponses.ts +0 -237
- package/src/transform/transformSchemas.ts +0 -212
- package/src/transform/transformTelemetryInfo.ts +0 -33
- package/src/transform/transfromRLCOptions.ts +0 -461
- package/src/utils/clientUtils.ts +0 -162
- package/src/utils/crossLanguageDef.ts +0 -66
- package/src/utils/dirname.ts +0 -12
- package/src/utils/emitUtil.ts +0 -92
- package/src/utils/fileSystemUtils.ts +0 -69
- package/src/utils/importHelper.ts +0 -59
- package/src/utils/modelUtils.ts +0 -1737
- package/src/utils/operationUtil.ts +0 -763
- package/src/utils/parameterUtils.ts +0 -192
- /package/src/{metaTree.ts → meta-tree.ts} +0 -0
- /package/src/modular/{buildModularOptions.ts → build-modular-options.ts} +0 -0
- /package/src/modular/helpers/{clientOptionHelpers.ts → client-option-helpers.ts} +0 -0
- /package/src/modular/helpers/{docsHelpers.ts → docs-helpers.ts} +0 -0
- /package/src/rlc-common/helpers/{apiVersionUtil.ts → api-version-util.ts} +0 -0
- /package/src/rlc-common/helpers/{nameUtils.ts → name-utils.ts} +0 -0
- /package/src/rlc-common/helpers/{schemaHelpers.ts → schema-helpers.ts} +0 -0
- /package/src/rlc-common/helpers/{typeUtil.ts → type-util.ts} +0 -0
- /package/src/rlc-common/metadata/{buildChangelogFile.ts → build-changelog-file.ts} +0 -0
- /package/src/rlc-common/metadata/{buildLicenseFile.ts → build-license-file.ts} +0 -0
- /package/src/rlc-common/metadata/{buildVitestConfig.ts → build-vitest-config.ts} +0 -0
- /package/src/rlc-common/static/{paginateContent.ts → paginate-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
- /package/src/rlc-common/test/{buildKarmaConfig.ts → build-karma-config.ts} +0 -0
- /package/src/utils/{credentialUtils.ts → credential-utils.ts} +0 -0
- /package/src/utils/{mediaTypes.ts → media-types.ts} +0 -0
- /package/src/utils/{namespaceUtils.ts → namespace-utils.ts} +0 -0
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { RLCModel } from "../interfaces.js";
|
|
2
|
+
interface PackageFileOptions {
|
|
3
|
+
exports?: Record<string, any>;
|
|
4
|
+
dependencies?: Record<string, string>;
|
|
5
|
+
clientContextPaths?: string[];
|
|
6
|
+
}
|
|
7
|
+
export declare function buildPackageFile(model: RLCModel, { exports, dependencies, clientContextPaths }?: PackageFileOptions): {
|
|
8
|
+
path: string;
|
|
9
|
+
content: string;
|
|
10
|
+
} | undefined;
|
|
11
|
+
/**
|
|
12
|
+
* Automatically updates the package.json for an existing Azure SDK package.
|
|
13
|
+
* - Migrates `@azure/core-client` → `@azure-rest/core-client` when found in dependencies.
|
|
14
|
+
* - Updates `@azure/core-lro` from `^2.x` to `^3.1.0`.
|
|
15
|
+
* - Adds LRO dependencies (`@azure/core-lro`, `@azure/abort-controller`) when the package has
|
|
16
|
+
* polling operations (for non-monorepo Azure packages).
|
|
17
|
+
* - Updates exports (tshy or warp) when `exports` is provided.
|
|
18
|
+
* - Updates `//metadata.constantPaths` when `clientContextPaths` is provided.
|
|
19
|
+
*/
|
|
20
|
+
export declare function updatePackageFile(model: RLCModel, existingFilePathOrContent: string | Record<string, any>, { exports, clientContextPaths }?: PackageFileOptions): {
|
|
21
|
+
path: string;
|
|
22
|
+
content: string;
|
|
23
|
+
} | undefined;
|
|
24
|
+
export {};
|
|
25
|
+
//# sourceMappingURL=build-package-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-package-file.d.ts","sourceRoot":"","sources":["../../../../src/rlc-common/metadata/build-package-file.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAK5C,UAAU,kBAAkB;IAC1B,OAAO,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAC9B,YAAY,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;IACtC,kBAAkB,CAAC,EAAE,MAAM,EAAE,CAAC;CAC/B;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,QAAQ,EACf,EAAE,OAAO,EAAE,YAAY,EAAE,kBAAkB,EAAE,GAAE,kBAAuB;;;cAsCvE;AAED;;;;;;;;GAQG;AACH,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,QAAQ,EACf,yBAAyB,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EACvD,EAAE,OAAO,EAAE,kBAAkB,EAAE,GAAE,kBAAuB;;;cAiGzD"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { Project } from "ts-morph";
|
|
4
|
+
import { hasPollingOperations } from "../helpers/operation-helpers.js";
|
|
5
|
+
import { buildAzureMonorepoPackage } from "./package-json/build-azure-monorepo-package.js";
|
|
6
|
+
import { resolveWarpExports } from "./package-json/package-common.js";
|
|
7
|
+
import { getPackageName } from "./utils.js";
|
|
8
|
+
export function buildPackageFile(model, { exports, dependencies, clientContextPaths } = {}) {
|
|
9
|
+
const config = {
|
|
10
|
+
description: getDescription(model),
|
|
11
|
+
name: getPackageName(model),
|
|
12
|
+
version: getPackageVersion(model),
|
|
13
|
+
withSamples: model.options?.generateSample === true,
|
|
14
|
+
withTests: model.options?.generateTest === true,
|
|
15
|
+
nameWithoutScope: model.options?.packageDetails?.nameWithoutScope,
|
|
16
|
+
exports,
|
|
17
|
+
azureArm: model.options?.azureArm,
|
|
18
|
+
generateReactNativeTarget: model.options?.generateReactNativeTarget,
|
|
19
|
+
};
|
|
20
|
+
const extendedConfig = {
|
|
21
|
+
...config,
|
|
22
|
+
hasLro: hasPollingOperations(model),
|
|
23
|
+
monorepoPackageDirectory: model.options?.azureOutputDirectory,
|
|
24
|
+
dependencies,
|
|
25
|
+
clientContextPaths,
|
|
26
|
+
};
|
|
27
|
+
const packageInfo = buildAzureMonorepoPackage(extendedConfig);
|
|
28
|
+
const project = new Project({ useInMemoryFileSystem: true });
|
|
29
|
+
const filePath = "package.json";
|
|
30
|
+
if (!packageInfo) {
|
|
31
|
+
return;
|
|
32
|
+
}
|
|
33
|
+
const packageFile = project.createSourceFile(filePath, JSON.stringify(packageInfo, null, 2), {
|
|
34
|
+
overwrite: true,
|
|
35
|
+
});
|
|
36
|
+
return {
|
|
37
|
+
path: filePath,
|
|
38
|
+
content: packageFile.getFullText(),
|
|
39
|
+
};
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* Automatically updates the package.json for an existing Azure SDK package.
|
|
43
|
+
* - Migrates `@azure/core-client` → `@azure-rest/core-client` when found in dependencies.
|
|
44
|
+
* - Updates `@azure/core-lro` from `^2.x` to `^3.1.0`.
|
|
45
|
+
* - Adds LRO dependencies (`@azure/core-lro`, `@azure/abort-controller`) when the package has
|
|
46
|
+
* polling operations (for non-monorepo Azure packages).
|
|
47
|
+
* - Updates exports (tshy or warp) when `exports` is provided.
|
|
48
|
+
* - Updates `//metadata.constantPaths` when `clientContextPaths` is provided.
|
|
49
|
+
*/
|
|
50
|
+
export function updatePackageFile(model, existingFilePathOrContent, { exports, clientContextPaths } = {}) {
|
|
51
|
+
const hasLro = hasPollingOperations(model);
|
|
52
|
+
const needsLroUpdate = hasLro;
|
|
53
|
+
const needsExportsUpdate = exports;
|
|
54
|
+
const needsConstantPathsUpdate = clientContextPaths && clientContextPaths.length > 0;
|
|
55
|
+
let packageInfo;
|
|
56
|
+
if (typeof existingFilePathOrContent === "string") {
|
|
57
|
+
let packageFile;
|
|
58
|
+
try {
|
|
59
|
+
const project = new Project();
|
|
60
|
+
packageFile = project.addSourceFileAtPath(existingFilePathOrContent);
|
|
61
|
+
}
|
|
62
|
+
catch (_e) {
|
|
63
|
+
// If the file doesn't exist, we don't need to update it.
|
|
64
|
+
return;
|
|
65
|
+
}
|
|
66
|
+
packageInfo = JSON.parse(packageFile.getFullText());
|
|
67
|
+
}
|
|
68
|
+
else {
|
|
69
|
+
packageInfo = existingFilePathOrContent;
|
|
70
|
+
}
|
|
71
|
+
// Migrate AutoRest-specific dependency names and versions to their TypeSpec equivalents.
|
|
72
|
+
const deps = { ...(packageInfo.dependencies ?? {}) };
|
|
73
|
+
let needsCoreClientUpdate = false;
|
|
74
|
+
// @azure/core-client is AutoRest-only; TypeSpec uses @azure-rest/core-client.
|
|
75
|
+
if ("@azure/core-client" in deps) {
|
|
76
|
+
needsCoreClientUpdate = true;
|
|
77
|
+
}
|
|
78
|
+
// Ensure warp packages have #platform/* imports for polyfill resolution.
|
|
79
|
+
// The `react-native` condition is only added when explicitly opted in via
|
|
80
|
+
// `generateReactNativeTarget`, matching the fresh-generation path in
|
|
81
|
+
// `getEsmEntrypointInformation` (packageCommon.ts).
|
|
82
|
+
const platformImports = {
|
|
83
|
+
browser: "./src/*-browser.mts",
|
|
84
|
+
default: "./src/*.ts",
|
|
85
|
+
};
|
|
86
|
+
if (model.options?.generateReactNativeTarget) {
|
|
87
|
+
// Insert `react-native` before `default` so Node's conditional
|
|
88
|
+
// resolution order matches the fresh-generation output.
|
|
89
|
+
packageInfo.imports = {
|
|
90
|
+
"#platform/*": {
|
|
91
|
+
browser: platformImports["browser"],
|
|
92
|
+
"react-native": "./src/*-react-native.mts",
|
|
93
|
+
default: platformImports["default"],
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
}
|
|
97
|
+
else {
|
|
98
|
+
packageInfo.imports = {
|
|
99
|
+
"#platform/*": platformImports,
|
|
100
|
+
};
|
|
101
|
+
}
|
|
102
|
+
// Update exports (warp: resolved exports in package.json)
|
|
103
|
+
if (needsExportsUpdate) {
|
|
104
|
+
packageInfo.exports = resolveWarpExports(exports, model.options?.generateReactNativeTarget);
|
|
105
|
+
}
|
|
106
|
+
// Update Core Client dependency
|
|
107
|
+
if (needsCoreClientUpdate) {
|
|
108
|
+
delete deps["@azure/core-client"];
|
|
109
|
+
if (!("@azure-rest/core-client" in deps)) {
|
|
110
|
+
deps["@azure-rest/core-client"] = "^2.3.1";
|
|
111
|
+
}
|
|
112
|
+
packageInfo.dependencies = deps;
|
|
113
|
+
}
|
|
114
|
+
// Update LRO dependencies for Azure packages
|
|
115
|
+
if (needsLroUpdate) {
|
|
116
|
+
packageInfo.dependencies = {
|
|
117
|
+
...packageInfo.dependencies,
|
|
118
|
+
"@azure/core-lro": "^3.1.0",
|
|
119
|
+
"@azure/abort-controller": "^2.1.2",
|
|
120
|
+
};
|
|
121
|
+
}
|
|
122
|
+
// Update constantPaths metadata for Azure packages
|
|
123
|
+
if (needsConstantPathsUpdate && packageInfo["//metadata"]) {
|
|
124
|
+
const metadata = packageInfo["//metadata"];
|
|
125
|
+
// Filter out existing userAgentInfo entries
|
|
126
|
+
const nonUserAgentPaths = (metadata.constantPaths || []).filter((item) => item.prefix !== "userAgentInfo");
|
|
127
|
+
// Add new userAgentInfo entries from clientContextPaths
|
|
128
|
+
const newUserAgentPaths = clientContextPaths.map((path) => ({
|
|
129
|
+
path: path,
|
|
130
|
+
prefix: "userAgentInfo",
|
|
131
|
+
}));
|
|
132
|
+
metadata.constantPaths = [...nonUserAgentPaths, ...newUserAgentPaths];
|
|
133
|
+
}
|
|
134
|
+
return {
|
|
135
|
+
path: "package.json",
|
|
136
|
+
content: JSON.stringify(packageInfo, null, 2),
|
|
137
|
+
};
|
|
138
|
+
}
|
|
139
|
+
function getPackageVersion(model) {
|
|
140
|
+
return model.options?.packageDetails?.version ?? "1.0.0-beta.1";
|
|
141
|
+
}
|
|
142
|
+
function getDescription(model) {
|
|
143
|
+
const description = model.options?.packageDetails?.description;
|
|
144
|
+
if (!description) {
|
|
145
|
+
return `A generated SDK for ${model.libraryName}.`;
|
|
146
|
+
}
|
|
147
|
+
return description;
|
|
148
|
+
}
|
|
149
|
+
//# sourceMappingURL=build-package-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-package-file.js","sourceRoot":"","sources":["../../../../src/rlc-common/metadata/build-package-file.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,OAAO,EAAc,MAAM,UAAU,CAAC;AAC/C,OAAO,EAAE,oBAAoB,EAAE,MAAM,iCAAiC,CAAC;AAEvE,OAAO,EAAE,yBAAyB,EAAE,MAAM,gDAAgD,CAAC;AAC3F,OAAO,EAA2B,kBAAkB,EAAE,MAAM,kCAAkC,CAAC;AAC/F,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAQ5C,MAAM,UAAU,gBAAgB,CAC9B,KAAe,EACf,EAAE,OAAO,EAAE,YAAY,EAAE,kBAAkB,KAAyB,EAAE;IAEtE,MAAM,MAAM,GAA4B;QACtC,WAAW,EAAE,cAAc,CAAC,KAAK,CAAC;QAClC,IAAI,EAAE,cAAc,CAAC,KAAK,CAAC;QAC3B,OAAO,EAAE,iBAAiB,CAAC,KAAK,CAAC;QACjC,WAAW,EAAE,KAAK,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI;QACnD,SAAS,EAAE,KAAK,CAAC,OAAO,EAAE,YAAY,KAAK,IAAI;QAC/C,gBAAgB,EAAE,KAAK,CAAC,OAAO,EAAE,cAAc,EAAE,gBAAgB;QACjE,OAAO;QACP,QAAQ,EAAE,KAAK,CAAC,OAAO,EAAE,QAAQ;QACjC,yBAAyB,EAAE,KAAK,CAAC,OAAO,EAAE,yBAAyB;KACpE,CAAC;IAEF,MAAM,cAAc,GAAG;QACrB,GAAG,MAAM;QACT,MAAM,EAAE,oBAA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K,CAAC,OAAO,EAAE,cAAc,EAAE,WAAW,CAAC;IAC/D,IAAI,CAAC,WAAW,EAAE,CAAC;QACjB,OAAO,uBAAuB,KAAK,CAAC,WAAW,GAAG,CAAC;IACrD,CAAC;IACD,OAAO,WAAW,CAAC;AACrB,CAAC"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { RLCModel } from "../interfaces.js";
|
|
2
|
+
export declare function buildReadmeFile(model: RLCModel): {
|
|
3
|
+
path: string;
|
|
4
|
+
content: string;
|
|
5
|
+
};
|
|
6
|
+
export declare function hasClientNameChanged(model: RLCModel, existingReadmeContent: string): boolean;
|
|
7
|
+
export declare function updateReadmeFile(model: RLCModel, existingReadmeContent: string): {
|
|
8
|
+
path: string;
|
|
9
|
+
content: string;
|
|
10
|
+
} | undefined;
|
|
11
|
+
//# sourceMappingURL=build-readme-file.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-readme-file.d.ts","sourceRoot":"","sources":["../../../../src/rlc-common/metadata/build-readme-file.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAuQ5C,wBAAgB,eAAe,CAAC,KAAK,EAAE,QAAQ;;;EAU9C;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,QAAQ,EAAE,qBAAqB,EAAE,MAAM,GAAG,OAAO,CAW5F;AAED,wBAAgB,gBAAgB,CAC9B,KAAK,EAAE,QAAQ,EACf,qBAAqB,EAAE,MAAM,GAC5B;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAA;CAAE,GAAG,SAAS,CAoB/C"}
|
|
@@ -0,0 +1,328 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
|
+
// @ts-ignore: to fix the handlebars issue
|
|
5
|
+
import hbs from "handlebars";
|
|
6
|
+
import { getClientName } from "../helpers/name-constructors.js";
|
|
7
|
+
import { NameType, normalizeName } from "../helpers/name-utils.js";
|
|
8
|
+
const azureReadmeModularTemplate = `# {{ clientDescriptiveName }} library for JavaScript
|
|
9
|
+
|
|
10
|
+
This package contains an isomorphic SDK (runs both in Node.js and in browsers) for {{ clientDescriptiveName }}.
|
|
11
|
+
|
|
12
|
+
{{ description }}
|
|
13
|
+
|
|
14
|
+
Key links:
|
|
15
|
+
|
|
16
|
+
{{#if packageSourceURL}}
|
|
17
|
+
- [Source code]({{ packageSourceURL }})
|
|
18
|
+
{{/if}}
|
|
19
|
+
{{#if packageNPMURL}}
|
|
20
|
+
- [Package (NPM)]({{ packageNPMURL }})
|
|
21
|
+
{{/if}}
|
|
22
|
+
{{#if apiRefURL}}
|
|
23
|
+
- [API reference documentation]({{ apiRefURL }})
|
|
24
|
+
{{/if}}
|
|
25
|
+
{{#if samplesURL}}
|
|
26
|
+
- [Samples]({{samplesURL}})
|
|
27
|
+
{{/if}}
|
|
28
|
+
|
|
29
|
+
## Getting started
|
|
30
|
+
|
|
31
|
+
### Currently supported environments
|
|
32
|
+
|
|
33
|
+
- [LTS versions of Node.js](https://github.com/nodejs/release#release-schedule)
|
|
34
|
+
- Latest versions of Safari, Chrome, Edge and Firefox.
|
|
35
|
+
|
|
36
|
+
See our [support policy](https://github.com/Azure/azure-sdk-for-js/blob/main/SUPPORT.md) for more details.
|
|
37
|
+
|
|
38
|
+
{{#if azure}}
|
|
39
|
+
### Prerequisites
|
|
40
|
+
|
|
41
|
+
- An [Azure subscription][azure_sub].
|
|
42
|
+
{{/if}}
|
|
43
|
+
|
|
44
|
+
{{#if isReleasablePackage}}
|
|
45
|
+
### Install the \`{{ clientPackageName }}\` package
|
|
46
|
+
|
|
47
|
+
Install the {{ clientDescriptiveName }} library for JavaScript with \`npm\`:
|
|
48
|
+
|
|
49
|
+
\`\`\`bash
|
|
50
|
+
npm install {{ clientPackageName }}
|
|
51
|
+
\`\`\`
|
|
52
|
+
{{/if}}
|
|
53
|
+
|
|
54
|
+
{{#if azure}}
|
|
55
|
+
{{#if addCredentials}}
|
|
56
|
+
### Create and authenticate a \`{{ clientClassName}}\`
|
|
57
|
+
|
|
58
|
+
To create a client object to access the {{ serviceName }} API, you will need the \`endpoint\` of your {{ serviceName }} resource and a \`credential\`. The {{ clientDescriptiveName }} can use Microsoft Entra credentials to authenticate.
|
|
59
|
+
You can find the endpoint for your {{ serviceName }} resource in the [Azure Portal][azure_portal].
|
|
60
|
+
|
|
61
|
+
You can authenticate with Microsoft Entra ID using a credential from the [@azure/identity][azure_identity] library or [an existing Microsoft Entra token](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token).
|
|
62
|
+
|
|
63
|
+
To use the [DefaultAzureCredential][defaultazurecredential] provider shown below, or other credential providers provided with the Azure SDK, please install the \`@azure/identity\` package:
|
|
64
|
+
|
|
65
|
+
\`\`\`bash
|
|
66
|
+
npm install @azure/identity
|
|
67
|
+
\`\`\`
|
|
68
|
+
|
|
69
|
+
You will also need to **register a new Microsoft Entra application and grant access to {{ serviceName}}** by assigning the suitable role to your service principal (note: roles such as \`"Owner"\` will not grant the necessary permissions).
|
|
70
|
+
|
|
71
|
+
For more information about how to create a Microsoft Entra application check out [this guide](https://learn.microsoft.com/entra/identity-platform/howto-create-service-principal-portal).
|
|
72
|
+
|
|
73
|
+
{{#if azureArm}}
|
|
74
|
+
Using Node.js and Node-like environments, you can use the \`DefaultAzureCredential\` class to authenticate the client.
|
|
75
|
+
|
|
76
|
+
\`\`\`ts {{#if generateTest}}snippet:ReadmeSampleCreateClient_Node{{/if}}
|
|
77
|
+
import { {{ clientClassName }} } from "{{ clientPackageName }}";
|
|
78
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
79
|
+
|
|
80
|
+
{{#if hasSubscriptionId}}
|
|
81
|
+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
|
82
|
+
const client = new {{ clientClassName }}(new DefaultAzureCredential(), subscriptionId);
|
|
83
|
+
{{else}}
|
|
84
|
+
const client = new {{ clientClassName }}(new DefaultAzureCredential());
|
|
85
|
+
{{/if}}
|
|
86
|
+
\`\`\`
|
|
87
|
+
|
|
88
|
+
For browser environments, use the \`InteractiveBrowserCredential\` from the \`@azure/identity\` package to authenticate.
|
|
89
|
+
|
|
90
|
+
\`\`\`ts {{#if generateTest}}snippet:ReadmeSampleCreateClient_Browser{{/if}}
|
|
91
|
+
import { InteractiveBrowserCredential } from "@azure/identity";
|
|
92
|
+
import { {{ clientClassName }} } from "{{ clientPackageName }}";
|
|
93
|
+
|
|
94
|
+
const credential = new InteractiveBrowserCredential({
|
|
95
|
+
tenantId: "<YOUR_TENANT_ID>",
|
|
96
|
+
clientId: "<YOUR_CLIENT_ID>",
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
{{#if hasSubscriptionId}}
|
|
100
|
+
const subscriptionId = "00000000-0000-0000-0000-000000000000";
|
|
101
|
+
const client = new {{ clientClassName }}(credential, subscriptionId);
|
|
102
|
+
{{else}}
|
|
103
|
+
const client = new {{ clientClassName }}(credential);
|
|
104
|
+
{{/if}}
|
|
105
|
+
\`\`\`
|
|
106
|
+
{{else}}
|
|
107
|
+
Using Node.js and Node-like environments, you can use the \`DefaultAzureCredential\` class to authenticate the client.
|
|
108
|
+
|
|
109
|
+
\`\`\`ts {{#if generateTest}}snippet:ReadmeSampleCreateClient_Node{{/if}}
|
|
110
|
+
import { {{ clientClassName }} } from "{{ clientPackageName }}";
|
|
111
|
+
import { DefaultAzureCredential } from "@azure/identity";
|
|
112
|
+
|
|
113
|
+
const client = new {{ clientClassName }}("<endpoint>", new DefaultAzureCredential());
|
|
114
|
+
\`\`\`
|
|
115
|
+
|
|
116
|
+
For browser environments, use the \`InteractiveBrowserCredential\` from the \`@azure/identity\` package to authenticate.
|
|
117
|
+
|
|
118
|
+
\`\`\`ts {{#if generateTest}}snippet:ReadmeSampleCreateClient_Browser{{/if}}
|
|
119
|
+
import { InteractiveBrowserCredential } from "@azure/identity";
|
|
120
|
+
import { {{ clientClassName }} } from "{{ clientPackageName }}";
|
|
121
|
+
|
|
122
|
+
const credential = new InteractiveBrowserCredential({
|
|
123
|
+
tenantId: "<YOUR_TENANT_ID>",
|
|
124
|
+
clientId: "<YOUR_CLIENT_ID>"
|
|
125
|
+
});
|
|
126
|
+
const client = new {{ clientClassName }}("<endpoint>", credential);
|
|
127
|
+
\`\`\`
|
|
128
|
+
{{/if}}
|
|
129
|
+
{{/if}}{{/if}}
|
|
130
|
+
|
|
131
|
+
### JavaScript Bundle
|
|
132
|
+
To use this client library in the browser, first you need to use a bundler. For details on how to do this, please refer to our [bundling documentation](https://aka.ms/AzureSDKBundling).
|
|
133
|
+
|
|
134
|
+
## Key concepts
|
|
135
|
+
|
|
136
|
+
### {{ clientClassName }}
|
|
137
|
+
|
|
138
|
+
\`{{ clientClassName }}\` is the primary interface for developers using the {{ clientDescriptiveName }} library. Explore the methods on this client object to understand the different features of the {{ serviceName }} service that you can access.
|
|
139
|
+
|
|
140
|
+
{{#if azure}}
|
|
141
|
+
## Troubleshooting
|
|
142
|
+
|
|
143
|
+
### Logging
|
|
144
|
+
|
|
145
|
+
Enabling logging may help uncover useful information about failures. In order to see a log of HTTP requests and responses, set the \`AZURE_LOG_LEVEL\` environment variable to \`info\`. Alternatively, logging can be enabled at runtime by calling \`setLogLevel\` in the \`@azure/logger\`:
|
|
146
|
+
|
|
147
|
+
\`\`\`ts {{#if generateTest}}snippet:SetLogLevel{{/if}}
|
|
148
|
+
import { setLogLevel } from "@azure/logger";
|
|
149
|
+
|
|
150
|
+
setLogLevel("info");
|
|
151
|
+
\`\`\`
|
|
152
|
+
|
|
153
|
+
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs]({{ repoURL }}/tree/main/sdk/core/logger).
|
|
154
|
+
|
|
155
|
+
{{#if samplesURL}}
|
|
156
|
+
## Next steps
|
|
157
|
+
|
|
158
|
+
Please take a look at the [samples]({{ samplesURL }}) directory for detailed examples on how to use this library.
|
|
159
|
+
{{/if}}
|
|
160
|
+
|
|
161
|
+
## Contributing
|
|
162
|
+
|
|
163
|
+
If you'd like to contribute to this library, please read the [contributing guide]({{ contributingGuideURL }}) to learn more about how to build and test the code.
|
|
164
|
+
|
|
165
|
+
## Related projects
|
|
166
|
+
|
|
167
|
+
- [{{ projectName }}]({{ repoURL }})
|
|
168
|
+
|
|
169
|
+
[azure_sub]: https://azure.microsoft.com/free/
|
|
170
|
+
[azure_portal]: https://portal.azure.com
|
|
171
|
+
{{#if identityPackageURL}}[azure_identity]: {{ identityPackageURL }}
|
|
172
|
+
{{/if}}[defaultazurecredential]: {{ identityPackageURL }}#defaultazurecredential
|
|
173
|
+
{{/if}}
|
|
174
|
+
`;
|
|
175
|
+
const nonBrandedReadmeTemplate = `# {{ clientDescriptiveName }} library for JavaScript
|
|
176
|
+
|
|
177
|
+
{{ description }}
|
|
178
|
+
|
|
179
|
+
Key links:
|
|
180
|
+
|
|
181
|
+
{{#if packageSourceURL}}
|
|
182
|
+
- [Source code]({{ packageSourceURL }})
|
|
183
|
+
{{/if}}
|
|
184
|
+
{{#if packageNPMURL}}
|
|
185
|
+
- [Package (NPM)]({{ packageNPMURL }})
|
|
186
|
+
{{/if}}
|
|
187
|
+
{{#if apiRefURL}}
|
|
188
|
+
- [API reference documentation]({{ apiRefURL }})
|
|
189
|
+
{{/if}}
|
|
190
|
+
{{#if serviceDocURL}}
|
|
191
|
+
- [Product documentation]({{ serviceDocURL }})
|
|
192
|
+
{{/if}}
|
|
193
|
+
{{#if samplesURL}}
|
|
194
|
+
- [Samples]({{ samplesURL }})
|
|
195
|
+
{{/if}}
|
|
196
|
+
|
|
197
|
+
## Getting started
|
|
198
|
+
|
|
199
|
+
### Currently supported environments
|
|
200
|
+
|
|
201
|
+
- LTS versions of Node.js
|
|
202
|
+
|
|
203
|
+
### Install the \`{{ clientPackageName }}\` package
|
|
204
|
+
|
|
205
|
+
Install the {{ clientDescriptiveName }} library for JavaScript with \`npm\`:
|
|
206
|
+
|
|
207
|
+
\`\`\`bash
|
|
208
|
+
npm install {{ clientPackageName }}
|
|
209
|
+
\`\`\`
|
|
210
|
+
`;
|
|
211
|
+
const apiReferenceTemplate = `{{#if apiRefURL}}
|
|
212
|
+
- [API reference documentation]({{ apiRefURL }})
|
|
213
|
+
{{/if}}
|
|
214
|
+
`;
|
|
215
|
+
export function buildReadmeFile(model) {
|
|
216
|
+
const metadata = createMetadata(model) ?? {};
|
|
217
|
+
const readmeFileContents = hbs.compile(model.options ? azureReadmeModularTemplate : nonBrandedReadmeTemplate, { noEscape: true });
|
|
218
|
+
return {
|
|
219
|
+
path: "README.md",
|
|
220
|
+
content: readmeFileContents(metadata),
|
|
221
|
+
};
|
|
222
|
+
}
|
|
223
|
+
export function hasClientNameChanged(model, existingReadmeContent) {
|
|
224
|
+
try {
|
|
225
|
+
const importMatch = existingReadmeContent.match(/import\s*\{\s*([A-Za-z0-9_]+)\s*\}\s*from\s*["'][^"']*["']/);
|
|
226
|
+
const existingClientName = importMatch?.[1];
|
|
227
|
+
const newClientName = getClientName(model);
|
|
228
|
+
return !!existingClientName && existingClientName !== newClientName;
|
|
229
|
+
}
|
|
230
|
+
catch {
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
export function updateReadmeFile(model, existingReadmeContent) {
|
|
235
|
+
try {
|
|
236
|
+
const metadata = createMetadata(model) ?? {};
|
|
237
|
+
const newApiRefLink = hbs.compile(apiReferenceTemplate, { noEscape: true })(metadata).trim();
|
|
238
|
+
if (!newApiRefLink) {
|
|
239
|
+
return { path: "README.md", content: existingReadmeContent };
|
|
240
|
+
}
|
|
241
|
+
const apiRefRegex = /^- \[API reference documentation\]\(https:\/\/learn\.microsoft\.com\/javascript\/api\/[^)]+\)$/m;
|
|
242
|
+
const updatedContent = existingReadmeContent.replace(apiRefRegex, (match) => match ? newApiRefLink : match);
|
|
243
|
+
return { path: "README.md", content: updatedContent };
|
|
244
|
+
}
|
|
245
|
+
catch {
|
|
246
|
+
return;
|
|
247
|
+
}
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* Returns meta data information about the service, the package, and the client.
|
|
251
|
+
* @param codeModel - include the client details
|
|
252
|
+
* @returns inferred metadata about the service, the package, and the client
|
|
253
|
+
*/
|
|
254
|
+
function createMetadata(model) {
|
|
255
|
+
if (!model.options || !model.options.packageDetails) {
|
|
256
|
+
return;
|
|
257
|
+
}
|
|
258
|
+
// const packageDetails = model.options.packageDetails;
|
|
259
|
+
const { packageDetails, azureOutputDirectory, serviceInfo, isTypeSpecTest } = model.options;
|
|
260
|
+
const azureHuh = packageDetails?.scopeName === "azure" || packageDetails?.scopeName === "azure-rest";
|
|
261
|
+
const repoURL = "https://github.com/Azure/azure-sdk-for-js";
|
|
262
|
+
const relativePackageSourcePath = azureOutputDirectory;
|
|
263
|
+
const packageSourceURL = relativePackageSourcePath && repoURL && `${repoURL}/tree/main/${relativePackageSourcePath}`;
|
|
264
|
+
const clientPackageName = packageDetails?.name;
|
|
265
|
+
const clientClassName = getClientName(model);
|
|
266
|
+
const serviceName = getServiceName(model);
|
|
267
|
+
let apiRefUrlQueryParameter = "";
|
|
268
|
+
if (!packageDetails?.isVersionUserProvided && model.apiVersionInfo?.defaultValue) {
|
|
269
|
+
if (model.apiVersionInfo?.defaultValue?.toLowerCase().includes("preview")) {
|
|
270
|
+
apiRefUrlQueryParameter = "?view=azure-node-preview";
|
|
271
|
+
}
|
|
272
|
+
}
|
|
273
|
+
else {
|
|
274
|
+
packageDetails.version = packageDetails.version ?? "1.0.0-beta.1";
|
|
275
|
+
if (packageDetails?.version.includes("beta")) {
|
|
276
|
+
apiRefUrlQueryParameter = "?view=azure-node-preview";
|
|
277
|
+
}
|
|
278
|
+
}
|
|
279
|
+
return {
|
|
280
|
+
serviceName,
|
|
281
|
+
clientClassName,
|
|
282
|
+
clientPackageName: clientPackageName,
|
|
283
|
+
clientDescriptiveName: `${serviceName} client`,
|
|
284
|
+
description: serviceInfo?.description ?? packageDetails.description,
|
|
285
|
+
packageSourceURL: packageSourceURL,
|
|
286
|
+
packageNPMURL: `https://www.npmjs.com/package/${clientPackageName}`,
|
|
287
|
+
samplesURL: model.options.generateSample && packageSourceURL ? `${packageSourceURL}/samples` : undefined,
|
|
288
|
+
apiRefURL: azureHuh
|
|
289
|
+
? `https://learn.microsoft.com/javascript/api/${clientPackageName}${apiRefUrlQueryParameter}`
|
|
290
|
+
: undefined,
|
|
291
|
+
azureArm: Boolean(model.options.azureArm),
|
|
292
|
+
azure: azureHuh,
|
|
293
|
+
isReleasablePackage: !isTypeSpecTest,
|
|
294
|
+
repoURL: repoURL,
|
|
295
|
+
projectName: azureHuh ? "Microsoft Azure SDK for JavaScript" : undefined,
|
|
296
|
+
identityPackageURL: repoURL && `${repoURL}/tree/main/sdk/identity/identity`,
|
|
297
|
+
addCredentials: model.options.addCredentials,
|
|
298
|
+
contributingGuideURL: repoURL && `${repoURL}/blob/main/CONTRIBUTING.md`,
|
|
299
|
+
generateTest: model.options.generateTest,
|
|
300
|
+
hasSubscriptionId: model.options.hasSubscriptionId,
|
|
301
|
+
};
|
|
302
|
+
}
|
|
303
|
+
function getServiceName(model) {
|
|
304
|
+
const azureHuh = model?.options?.packageDetails?.scopeName === "azure" ||
|
|
305
|
+
model?.options?.packageDetails?.scopeName === "azure-rest";
|
|
306
|
+
const libraryName = model.libraryName;
|
|
307
|
+
const serviceTitle = model.libraryName;
|
|
308
|
+
const batch = model?.options?.batch, packageDetails = model?.options?.packageDetails;
|
|
309
|
+
let simpleServiceName = batch && batch.length > 1
|
|
310
|
+
? normalizeName(packageDetails.nameWithoutScope ?? packageDetails?.name ?? "", NameType.Class)
|
|
311
|
+
: normalizeName(serviceTitle, NameType.Class);
|
|
312
|
+
simpleServiceName =
|
|
313
|
+
/**
|
|
314
|
+
* It is a required convention in Azure swaggers for their titles to end with
|
|
315
|
+
* "Client".
|
|
316
|
+
*/
|
|
317
|
+
serviceTitle.match(/(.*) Client/)?.[1] ??
|
|
318
|
+
serviceTitle.match(/(.*)Client/)?.[1] ??
|
|
319
|
+
libraryName.match(/(.*)Client/)?.[1] ??
|
|
320
|
+
serviceTitle.match(/(.*) Service/)?.[1] ??
|
|
321
|
+
simpleServiceName;
|
|
322
|
+
return azureHuh
|
|
323
|
+
? simpleServiceName.startsWith("Azure")
|
|
324
|
+
? simpleServiceName
|
|
325
|
+
: `Azure ${simpleServiceName}`
|
|
326
|
+
: simpleServiceName;
|
|
327
|
+
}
|
|
328
|
+
//# sourceMappingURL=build-readme-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-readme-file.js","sourceRoot":"","sources":["../../../../src/rlc-common/metadata/build-readme-file.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,6DAA6D;AAC7D,0CAA0C;AAC1C,OAAO,GAAG,MAAM,YAAY,CAAC;AAC7B,OAAO,EAAE,aAAa,EAAE,MAAM,iCAAiC,CAAC;AAChE,OAAO,EAAE,QAAQ,EAAE,aAAa,EAAE,MAAM,0BAA0B,CAAC;AAGnE,MAAM,0BAA0B,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAsKlC,CAAC;AAEF,MAAM,wBAAwB,GAAG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAmChC,CAAC;AAEF,MAAM,oBAAoB,GAAG;;;CAG5B,CAAC;AAqDF,MAAM,UAAU,eAAe,CAAC,KAAe;IAC7C,MAAM,QAAQ,GAAG,cAAc,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC;IAC7C,MAAM,kB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EAAE,cAAc,EAAE,SAAS,KAAK,YAAY,CAAC;IAC7D,MAAM,WAAW,GAAG,KAAK,CAAC,WAAW,CAAC;IACtC,MAAM,YAAY,GAAG,KAAK,CAAC,WAAW,CAAC;IACvC,MAAM,KAAK,GAAG,KAAK,EAAE,OAAO,EAAE,KAAK,EACjC,cAAc,GAAG,KAAK,EAAE,OAAO,EAAE,cAAc,CAAC;IAClD,IAAI,iBAAiB,GACnB,KAAK,IAAI,KAAK,CAAC,MAAM,GAAG,CAAC;QACvB,CAAC,CAAC,aAAa,CACX,cAAe,CAAC,gBAAgB,IAAI,cAAc,EAAE,IAAI,IAAI,EAAE,EAC9D,QAAQ,CAAC,KAAK,CACf;QACH,CAAC,CAAC,aAAa,CAAC,YAAY,EAAE,QAAQ,CAAC,KAAK,CAAC,CAAC;IAClD,iBAAiB;QACf;;;WAGG;QACH,YAAY,CAAC,KAAK,CAAC,aAAa,CAAC,EAAE,CAAC,CAAC,CAAC;YACtC,YAAY,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC;YACrC,WAAW,CAAC,KAAK,CAAC,YAAY,CAAC,EAAE,CAAC,CAAC,CAAC;YACpC,YAAY,CAAC,KAAK,CAAC,cAAc,CAAC,EAAE,CAAC,CAAC,CAAC;YACvC,iBAAiB,CAAC;IAEpB,OAAO,QAAQ;QACb,CAAC,CAAC,iBAAiB,CAAC,UAAU,CAAC,OAAO,CAAC;YACrC,CAAC,CAAC,iBAAiB;YACnB,CAAC,CAAC,SAAS,iBAAiB,EAAE;QAChC,CAAC,CAAC,iBAAiB,CAAC;AACxB,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-sample-env-file.d.ts","sourceRoot":"","sources":["../../../../src/rlc-common/metadata/build-sample-env-file.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAM5C,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,QAAQ;;;cASjD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
const sampleEnvText = `
|
|
2
|
+
# Feel free to add your own environment variables.
|
|
3
|
+
`;
|
|
4
|
+
export function buildSampleEnvFile(model) {
|
|
5
|
+
if (model.options?.generateMetadata === true || model.options?.generateSample === true) {
|
|
6
|
+
const filePath = "sample.env";
|
|
7
|
+
return {
|
|
8
|
+
path: filePath,
|
|
9
|
+
content: sampleEnvText.trim(),
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
return undefined;
|
|
13
|
+
}
|
|
14
|
+
//# sourceMappingURL=build-sample-env-file.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-sample-env-file.js","sourceRoot":"","sources":["../../../../src/rlc-common/metadata/build-sample-env-file.ts"],"names":[],"mappings":"AAIA,MAAM,aAAa,GAAG;;CAErB,CAAC;AAEF,MAAM,UAAU,kBAAkB,CAAC,KAAe;IAChD,IAAI,KAAK,CAAC,OAAO,EAAE,gBAAgB,KAAK,IAAI,IAAI,KAAK,CAAC,OAAO,EAAE,cAAc,KAAK,IAAI,EAAE,CAAC;QACvF,MAAM,QAAQ,GAAG,YAAY,CAAC;QAC9B,OAAO;YACL,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,aAAa,CAAC,IAAI,EAAE;SAC9B,CAAC;IACJ,CAAC;IACD,OAAO,SAAS,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { RLCModel } from "../interfaces.js";
|
|
2
|
+
/**
|
|
3
|
+
* Builds config/tsconfig.test.browser.json — extends eng/tsconfigs/test.browser.json
|
|
4
|
+
*/
|
|
5
|
+
export declare function buildTestBrowserTsConfig(model: RLCModel): {
|
|
6
|
+
path: string;
|
|
7
|
+
content: string;
|
|
8
|
+
} | undefined;
|
|
9
|
+
/**
|
|
10
|
+
* Builds config/tsconfig.test.node.json — extends eng/tsconfigs/test.node.json
|
|
11
|
+
*/
|
|
12
|
+
export declare function buildTestNodeTsConfig(model: RLCModel): {
|
|
13
|
+
path: string;
|
|
14
|
+
content: string;
|
|
15
|
+
} | undefined;
|
|
16
|
+
//# sourceMappingURL=build-test-config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-test-config.d.ts","sourceRoot":"","sources":["../../../../src/rlc-common/metadata/build-test-config.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,MAAM,kBAAkB,CAAC;AAO5C;;GAEG;AACH,wBAAgB,wBAAwB,CAAC,KAAK,EAAE,QAAQ;;;cAwBvD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,KAAK,EAAE,QAAQ;;;cAwBpD"}
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT License.
|
|
3
|
+
import { getPackageName } from "./utils.js";
|
|
4
|
+
function shouldGenerateTestConfig(model) {
|
|
5
|
+
return !(model.options?.generateMetadata === false || model.options?.generateTest === false);
|
|
6
|
+
}
|
|
7
|
+
/**
|
|
8
|
+
* Builds config/tsconfig.test.browser.json — extends eng/tsconfigs/test.browser.json
|
|
9
|
+
*/
|
|
10
|
+
export function buildTestBrowserTsConfig(model) {
|
|
11
|
+
if (!shouldGenerateTestConfig(model)) {
|
|
12
|
+
return;
|
|
13
|
+
}
|
|
14
|
+
const name = getPackageName(model);
|
|
15
|
+
return {
|
|
16
|
+
path: "config/tsconfig.test.browser.json",
|
|
17
|
+
content: JSON.stringify({
|
|
18
|
+
extends: "../../../../eng/tsconfigs/test.browser.json",
|
|
19
|
+
compilerOptions: {
|
|
20
|
+
paths: {
|
|
21
|
+
[name]: ["../src/index.ts"],
|
|
22
|
+
[`${name}/*`]: ["../src/*"],
|
|
23
|
+
"$internal/*": ["../src/*"],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
}, null, 2),
|
|
27
|
+
};
|
|
28
|
+
}
|
|
29
|
+
/**
|
|
30
|
+
* Builds config/tsconfig.test.node.json — extends eng/tsconfigs/test.node.json
|
|
31
|
+
*/
|
|
32
|
+
export function buildTestNodeTsConfig(model) {
|
|
33
|
+
if (!shouldGenerateTestConfig(model)) {
|
|
34
|
+
return;
|
|
35
|
+
}
|
|
36
|
+
const name = getPackageName(model);
|
|
37
|
+
return {
|
|
38
|
+
path: "config/tsconfig.test.node.json",
|
|
39
|
+
content: JSON.stringify({
|
|
40
|
+
extends: "../../../../eng/tsconfigs/test.node.json",
|
|
41
|
+
compilerOptions: {
|
|
42
|
+
paths: {
|
|
43
|
+
[name]: ["../src/index.ts"],
|
|
44
|
+
[`${name}/*`]: ["../src/*"],
|
|
45
|
+
"$internal/*": ["../src/*"],
|
|
46
|
+
},
|
|
47
|
+
},
|
|
48
|
+
}, null, 2),
|
|
49
|
+
};
|
|
50
|
+
}
|
|
51
|
+
//# sourceMappingURL=build-test-config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"build-test-config.js","sourceRoot":"","sources":["../../../../src/rlc-common/metadata/build-test-config.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAGlC,OAAO,EAAE,cAAc,EAAE,MAAM,YAAY,CAAC;AAE5C,SAAS,wBAAwB,CAAC,KAAe;IAC/C,OAAO,CAAC,CAAC,KAAK,CAAC,OAAO,EAAE,gBAAgB,KAAK,KAAK,IAAI,KAAK,CAAC,OAAO,EAAE,YAAY,KAAK,KAAK,CAAC,CAAC;AAC/F,CAAC;AAED;;GAEG;AACH,MAAM,UAAU,wBAAwB,CAAC,KAAe;IACtD,IAAI,CAAC,wBAAwB,CAAC,KAAK,CAAC,EAAE,CAAC;QACrC,OAAO;IACT,CAAC;IAED,MAAM,IAAI,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;IAEnC,OAAO;QACL,IAAI,EAAE,mCAAmC;QACzC,OAAO,EAAE,IAAI,CAAC,SAAS,CACrB;YACE,OAAO,EAAE,6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