@azure-tools/typespec-ts 0.11.0
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/.eslintrc.json +23 -0
- package/.prettierignore +1 -0
- package/.prettierrc +7 -0
- package/.rush/temp/package-deps_build.json +303 -0
- package/.rush/temp/shrinkwrap-deps.json +469 -0
- package/CHANGELOG.md +65 -0
- package/CONTRIBUTING.md +134 -0
- package/README.md +150 -0
- package/dist/src/emitUtil.d.ts +6 -0
- package/dist/src/emitUtil.d.ts.map +1 -0
- package/dist/src/emitUtil.js +45 -0
- package/dist/src/emitUtil.js.map +1 -0
- package/dist/src/index.d.ts +3 -0
- package/dist/src/index.d.ts.map +1 -0
- package/dist/src/index.js +59 -0
- package/dist/src/index.js.map +1 -0
- package/dist/src/lib.d.ts +159 -0
- package/dist/src/lib.d.ts.map +1 -0
- package/dist/src/lib.js +189 -0
- package/dist/src/lib.js.map +1 -0
- package/dist/src/modelUtils.d.ts +12 -0
- package/dist/src/modelUtils.d.ts.map +1 -0
- package/dist/src/modelUtils.js +812 -0
- package/dist/src/modelUtils.js.map +1 -0
- package/dist/src/operationUtil.d.ts +16 -0
- package/dist/src/operationUtil.d.ts.map +1 -0
- package/dist/src/operationUtil.js +142 -0
- package/dist/src/operationUtil.js.map +1 -0
- package/dist/src/transform/transform.d.ts +8 -0
- package/dist/src/transform/transform.d.ts.map +1 -0
- package/dist/src/transform/transform.js +131 -0
- package/dist/src/transform/transform.js.map +1 -0
- package/dist/src/transform/transformAnnotationDetails.d.ts +6 -0
- package/dist/src/transform/transformAnnotationDetails.d.ts.map +1 -0
- package/dist/src/transform/transformAnnotationDetails.js +188 -0
- package/dist/src/transform/transformAnnotationDetails.js.map +1 -0
- package/dist/src/transform/transformApiVersionParam.d.ts +5 -0
- package/dist/src/transform/transformApiVersionParam.d.ts.map +1 -0
- package/dist/src/transform/transformApiVersionParam.js +76 -0
- package/dist/src/transform/transformApiVersionParam.js.map +1 -0
- package/dist/src/transform/transformParameters.d.ts +14 -0
- package/dist/src/transform/transformParameters.d.ts.map +1 -0
- package/dist/src/transform/transformParameters.js +315 -0
- package/dist/src/transform/transformParameters.js.map +1 -0
- package/dist/src/transform/transformPaths.d.ts +10 -0
- package/dist/src/transform/transformPaths.d.ts.map +1 -0
- package/dist/src/transform/transformPaths.js +124 -0
- package/dist/src/transform/transformPaths.js.map +1 -0
- package/dist/src/transform/transformResponses.d.ts +5 -0
- package/dist/src/transform/transformResponses.d.ts.map +1 -0
- package/dist/src/transform/transformResponses.js +136 -0
- package/dist/src/transform/transformResponses.js.map +1 -0
- package/dist/src/transform/transformSchemas.d.ts +4 -0
- package/dist/src/transform/transformSchemas.d.ts.map +1 -0
- package/dist/src/transform/transformSchemas.js +175 -0
- package/dist/src/transform/transformSchemas.js.map +1 -0
- package/dist/src/transform/transfromRLCOptions.d.ts +10 -0
- package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -0
- package/dist/src/transform/transfromRLCOptions.js +156 -0
- package/dist/src/transform/transfromRLCOptions.js.map +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +73 -0
- package/src/emitUtil.ts +63 -0
- package/src/index.ts +106 -0
- package/src/lib.ts +207 -0
- package/src/modelUtils.ts +961 -0
- package/src/operationUtil.ts +203 -0
- package/src/transform/transform.ts +224 -0
- package/src/transform/transformAnnotationDetails.ts +231 -0
- package/src/transform/transformApiVersionParam.ts +104 -0
- package/src/transform/transformParameters.ts +480 -0
- package/src/transform/transformPaths.ts +187 -0
- package/src/transform/transformResponses.ts +190 -0
- package/src/transform/transformSchemas.ts +209 -0
- package/src/transform/transfromRLCOptions.ts +202 -0
- package/test/commands/cadl-ranch-list.ts +83 -0
- package/test/commands/check-clean-tree.ts +55 -0
- package/test/commands/childProcessOnExit.ts +16 -0
- package/test/commands/gen-cadl-ranch.ts +21 -0
- package/test/commands/run.ts +41 -0
- package/test/integration/arrayItemTypes.spec.ts +93 -0
- package/test/integration/authApiKey.spec.ts +38 -0
- package/test/integration/authOauth2.spec.ts +65 -0
- package/test/integration/authUnion.spec.ts +72 -0
- package/test/integration/dictionary.spec.ts +102 -0
- package/test/integration/extensibleEnums.spec.ts +61 -0
- package/test/integration/fixedEnums.spec.ts +52 -0
- package/test/integration/generated/arrays/itemTypes/src/arrayItemTypesClient.ts +31 -0
- package/test/integration/generated/arrays/itemTypes/src/clientDefinitions.ts +150 -0
- package/test/integration/generated/arrays/itemTypes/src/index.ts +13 -0
- package/test/integration/generated/arrays/itemTypes/src/models.ts +9 -0
- package/test/integration/generated/arrays/itemTypes/src/outputModels.ts +9 -0
- package/test/integration/generated/arrays/itemTypes/src/parameters.ts +78 -0
- package/test/integration/generated/arrays/itemTypes/src/responses.ts +104 -0
- package/test/integration/generated/arrays/itemTypes/tspconfig.yaml +12 -0
- package/test/integration/generated/authentication/apiKey/.eslintrc.json +11 -0
- package/test/integration/generated/authentication/apiKey/README.md +56 -0
- package/test/integration/generated/authentication/apiKey/api-extractor.json +18 -0
- package/test/integration/generated/authentication/apiKey/karma.conf.js +133 -0
- package/test/integration/generated/authentication/apiKey/package.json +103 -0
- package/test/integration/generated/authentication/apiKey/rollup.config.js +118 -0
- package/test/integration/generated/authentication/apiKey/src/authApiKeyClient.ts +41 -0
- package/test/integration/generated/authentication/apiKey/src/clientDefinitions.ts +33 -0
- package/test/integration/generated/authentication/apiKey/src/index.ts +12 -0
- package/test/integration/generated/authentication/apiKey/src/outputModels.ts +6 -0
- package/test/integration/generated/authentication/apiKey/src/parameters.ts +7 -0
- package/test/integration/generated/authentication/apiKey/src/responses.ts +21 -0
- package/test/integration/generated/authentication/apiKey/test/public/sampleTest.spec.ts +23 -0
- package/test/integration/generated/authentication/apiKey/test/public/utils/env.browser.ts +2 -0
- package/test/integration/generated/authentication/apiKey/test/public/utils/env.ts +6 -0
- package/test/integration/generated/authentication/apiKey/test/public/utils/recordedClient.ts +29 -0
- package/test/integration/generated/authentication/apiKey/tsconfig.json +25 -0
- package/test/integration/generated/authentication/apiKey/tspconfig.yaml +10 -0
- package/test/integration/generated/authentication/oauth2/karma.conf.js +133 -0
- package/test/integration/generated/authentication/oauth2/src/authOauth2Client.ts +41 -0
- package/test/integration/generated/authentication/oauth2/src/clientDefinitions.ts +33 -0
- package/test/integration/generated/authentication/oauth2/src/index.ts +12 -0
- package/test/integration/generated/authentication/oauth2/src/outputModels.ts +6 -0
- package/test/integration/generated/authentication/oauth2/src/parameters.ts +7 -0
- package/test/integration/generated/authentication/oauth2/src/responses.ts +21 -0
- package/test/integration/generated/authentication/oauth2/test/public/sampleTest.spec.ts +23 -0
- package/test/integration/generated/authentication/oauth2/test/public/utils/env.browser.ts +2 -0
- package/test/integration/generated/authentication/oauth2/test/public/utils/env.ts +6 -0
- package/test/integration/generated/authentication/oauth2/test/public/utils/recordedClient.ts +29 -0
- package/test/integration/generated/authentication/oauth2/tspconfig.yaml +12 -0
- package/test/integration/generated/authentication/union/karma.conf.js +133 -0
- package/test/integration/generated/authentication/union/src/authUnionClient.ts +42 -0
- package/test/integration/generated/authentication/union/src/clientDefinitions.ts +27 -0
- package/test/integration/generated/authentication/union/src/index.ts +11 -0
- package/test/integration/generated/authentication/union/src/parameters.ts +7 -0
- package/test/integration/generated/authentication/union/src/responses.ts +14 -0
- package/test/integration/generated/authentication/union/test/public/sampleTest.spec.ts +23 -0
- package/test/integration/generated/authentication/union/test/public/utils/env.browser.ts +2 -0
- package/test/integration/generated/authentication/union/test/public/utils/env.ts +6 -0
- package/test/integration/generated/authentication/union/test/public/utils/recordedClient.ts +29 -0
- package/test/integration/generated/authentication/union/tspconfig.yaml +12 -0
- package/test/integration/generated/dictionary/.eslintrc.json +11 -0
- package/test/integration/generated/dictionary/README.md +56 -0
- package/test/integration/generated/dictionary/api-extractor.json +18 -0
- package/test/integration/generated/dictionary/package.json +80 -0
- package/test/integration/generated/dictionary/rollup.config.js +118 -0
- package/test/integration/generated/dictionary/src/clientDefinitions.ts +165 -0
- package/test/integration/generated/dictionary/src/dictClient.ts +29 -0
- package/test/integration/generated/dictionary/src/index.ts +13 -0
- package/test/integration/generated/dictionary/src/models.ts +9 -0
- package/test/integration/generated/dictionary/src/outputModels.ts +9 -0
- package/test/integration/generated/dictionary/src/parameters.ts +86 -0
- package/test/integration/generated/dictionary/src/responses.ts +115 -0
- package/test/integration/generated/dictionary/tsconfig.json +25 -0
- package/test/integration/generated/dictionary/tspconfig.yaml +12 -0
- package/test/integration/generated/enums/extensible/.eslintrc.json +11 -0
- package/test/integration/generated/enums/extensible/README.md +56 -0
- package/test/integration/generated/enums/extensible/api-extractor.json +18 -0
- package/test/integration/generated/enums/extensible/package.json +80 -0
- package/test/integration/generated/enums/extensible/rollup.config.js +118 -0
- package/test/integration/generated/enums/extensible/src/clientDefinitions.ts +45 -0
- package/test/integration/generated/enums/extensible/src/enumsExtensible.ts +31 -0
- package/test/integration/generated/enums/extensible/src/index.ts +11 -0
- package/test/integration/generated/enums/extensible/src/parameters.ts +23 -0
- package/test/integration/generated/enums/extensible/src/responses.ts +26 -0
- package/test/integration/generated/enums/extensible/tsconfig.json +25 -0
- package/test/integration/generated/enums/extensible/tspconfig.yaml +11 -0
- package/test/integration/generated/enums/fixed/.eslintrc.json +11 -0
- package/test/integration/generated/enums/fixed/README.md +56 -0
- package/test/integration/generated/enums/fixed/api-extractor.json +18 -0
- package/test/integration/generated/enums/fixed/package.json +80 -0
- package/test/integration/generated/enums/fixed/rollup.config.js +118 -0
- package/test/integration/generated/enums/fixed/src/clientDefinitions.ts +43 -0
- package/test/integration/generated/enums/fixed/src/enumsFixed.ts +31 -0
- package/test/integration/generated/enums/fixed/src/index.ts +11 -0
- package/test/integration/generated/enums/fixed/src/parameters.ts +36 -0
- package/test/integration/generated/enums/fixed/src/responses.ts +27 -0
- package/test/integration/generated/enums/fixed/tsconfig.json +25 -0
- package/test/integration/generated/enums/fixed/tspconfig.yaml +11 -0
- package/test/integration/generated/hello/.eslintrc.json +11 -0
- package/test/integration/generated/hello/README.md +56 -0
- package/test/integration/generated/hello/api-extractor.json +18 -0
- package/test/integration/generated/hello/package.json +80 -0
- package/test/integration/generated/hello/rollup.config.js +118 -0
- package/test/integration/generated/hello/src/clientDefinitions.ts +19 -0
- package/test/integration/generated/hello/src/hello.ts +29 -0
- package/test/integration/generated/hello/src/index.ts +11 -0
- package/test/integration/generated/hello/src/parameters.ts +6 -0
- package/test/integration/generated/hello/src/responses.ts +10 -0
- package/test/integration/generated/hello/tsconfig.json +25 -0
- package/test/integration/generated/hello/tspconfig.yaml +11 -0
- package/test/integration/generated/lro/lroBasic/.eslintrc.json +11 -0
- package/test/integration/generated/lro/lroBasic/README.md +56 -0
- package/test/integration/generated/lro/lroBasic/api-extractor.json +18 -0
- package/test/integration/generated/lro/lroBasic/package.json +82 -0
- package/test/integration/generated/lro/lroBasic/rollup.config.js +118 -0
- package/test/integration/generated/lro/lroBasic/src/azureLro.ts +31 -0
- package/test/integration/generated/lro/lroBasic/src/clientDefinitions.ts +37 -0
- package/test/integration/generated/lro/lroBasic/src/index.ts +12 -0
- package/test/integration/generated/lro/lroBasic/src/parameters.ts +8 -0
- package/test/integration/generated/lro/lroBasic/src/pollingHelper.ts +75 -0
- package/test/integration/generated/lro/lroBasic/src/responses.ts +22 -0
- package/test/integration/generated/lro/lroBasic/tsconfig.json +25 -0
- package/test/integration/generated/lro/lroBasic/tspconfig.yaml +11 -0
- package/test/integration/generated/models/inheritance/.eslintrc.json +11 -0
- package/test/integration/generated/models/inheritance/README.md +56 -0
- package/test/integration/generated/models/inheritance/api-extractor.json +18 -0
- package/test/integration/generated/models/inheritance/package.json +80 -0
- package/test/integration/generated/models/inheritance/rollup.config.js +118 -0
- package/test/integration/generated/models/inheritance/src/clientDefinitions.ts +79 -0
- package/test/integration/generated/models/inheritance/src/index.ts +13 -0
- package/test/integration/generated/models/inheritance/src/models.ts +52 -0
- package/test/integration/generated/models/inheritance/src/modelsInheritance.ts +31 -0
- package/test/integration/generated/models/inheritance/src/outputModels.ts +52 -0
- package/test/integration/generated/models/inheritance/src/parameters.ts +35 -0
- package/test/integration/generated/models/inheritance/src/responses.ts +56 -0
- package/test/integration/generated/models/inheritance/tsconfig.json +25 -0
- package/test/integration/generated/models/inheritance/tspconfig.yaml +11 -0
- package/test/integration/generated/models/propertyOptional/.eslintrc.json +11 -0
- package/test/integration/generated/models/propertyOptional/README.md +56 -0
- package/test/integration/generated/models/propertyOptional/api-extractor.json +18 -0
- package/test/integration/generated/models/propertyOptional/package.json +80 -0
- package/test/integration/generated/models/propertyOptional/rollup.config.js +118 -0
- package/test/integration/generated/models/propertyOptional/src/clientDefinitions.ts +263 -0
- package/test/integration/generated/models/propertyOptional/src/index.ts +13 -0
- package/test/integration/generated/models/propertyOptional/src/models.ts +46 -0
- package/test/integration/generated/models/propertyOptional/src/modelsPropertyOptional.ts +31 -0
- package/test/integration/generated/models/propertyOptional/src/outputModels.ts +46 -0
- package/test/integration/generated/models/propertyOptional/src/parameters.ts +124 -0
- package/test/integration/generated/models/propertyOptional/src/responses.ts +169 -0
- package/test/integration/generated/models/propertyOptional/tsconfig.json +25 -0
- package/test/integration/generated/models/propertyOptional/tspconfig.yaml +11 -0
- package/test/integration/generated/models/propertyTypes/.eslintrc.json +11 -0
- package/test/integration/generated/models/propertyTypes/README.md +56 -0
- package/test/integration/generated/models/propertyTypes/api-extractor.json +18 -0
- package/test/integration/generated/models/propertyTypes/package.json +80 -0
- package/test/integration/generated/models/propertyTypes/rollup.config.js +118 -0
- package/test/integration/generated/models/propertyTypes/src/clientDefinitions.ts +234 -0
- package/test/integration/generated/models/propertyTypes/src/index.ts +13 -0
- package/test/integration/generated/models/propertyTypes/src/models.ts +99 -0
- package/test/integration/generated/models/propertyTypes/src/modelsPropertyTypes.ts +31 -0
- package/test/integration/generated/models/propertyTypes/src/outputModels.ts +99 -0
- package/test/integration/generated/models/propertyTypes/src/parameters.ts +147 -0
- package/test/integration/generated/models/propertyTypes/src/responses.ts +186 -0
- package/test/integration/generated/models/propertyTypes/tsconfig.json +25 -0
- package/test/integration/generated/models/propertyTypes/tspconfig.yaml +11 -0
- package/test/integration/generated/models/usage/.eslintrc.json +11 -0
- package/test/integration/generated/models/usage/README.md +56 -0
- package/test/integration/generated/models/usage/api-extractor.json +18 -0
- package/test/integration/generated/models/usage/package.json +80 -0
- package/test/integration/generated/models/usage/rollup.config.js +118 -0
- package/test/integration/generated/models/usage/src/clientDefinitions.ts +41 -0
- package/test/integration/generated/models/usage/src/index.ts +13 -0
- package/test/integration/generated/models/usage/src/models.ts +12 -0
- package/test/integration/generated/models/usage/src/modelsUsage.ts +31 -0
- package/test/integration/generated/models/usage/src/outputModels.ts +12 -0
- package/test/integration/generated/models/usage/src/parameters.ts +19 -0
- package/test/integration/generated/models/usage/src/responses.ts +22 -0
- package/test/integration/generated/models/usage/tsconfig.json +25 -0
- package/test/integration/generated/models/usage/tspconfig.yaml +11 -0
- package/test/integration/generated/models/visibility/.eslintrc.json +11 -0
- package/test/integration/generated/models/visibility/README.md +56 -0
- package/test/integration/generated/models/visibility/api-extractor.json +18 -0
- package/test/integration/generated/models/visibility/package.json +80 -0
- package/test/integration/generated/models/visibility/rollup.config.js +118 -0
- package/test/integration/generated/models/visibility/src/clientDefinitions.ts +40 -0
- package/test/integration/generated/models/visibility/src/index.ts +13 -0
- package/test/integration/generated/models/visibility/src/models.ts +14 -0
- package/test/integration/generated/models/visibility/src/modelsVisibilityAutomatic.ts +31 -0
- package/test/integration/generated/models/visibility/src/outputModels.ts +16 -0
- package/test/integration/generated/models/visibility/src/parameters.ts +41 -0
- package/test/integration/generated/models/visibility/src/responses.ts +36 -0
- package/test/integration/generated/models/visibility/tsconfig.json +25 -0
- package/test/integration/generated/models/visibility/tspconfig.yaml +11 -0
- package/test/integration/generated/resiliency/devDriven/.eslintrc.json +11 -0
- package/test/integration/generated/resiliency/devDriven/README.md +56 -0
- package/test/integration/generated/resiliency/devDriven/api-extractor.json +18 -0
- package/test/integration/generated/resiliency/devDriven/package.json +81 -0
- package/test/integration/generated/resiliency/devDriven/rollup.config.js +118 -0
- package/test/integration/generated/resiliency/devDriven/src/clientDefinitions.ts +75 -0
- package/test/integration/generated/resiliency/devDriven/src/index.ts +15 -0
- package/test/integration/generated/resiliency/devDriven/src/isUnexpected.ts +117 -0
- package/test/integration/generated/resiliency/devDriven/src/models.ts +8 -0
- package/test/integration/generated/resiliency/devDriven/src/outputModels.ts +25 -0
- package/test/integration/generated/resiliency/devDriven/src/paginateHelper.ts +154 -0
- package/test/integration/generated/resiliency/devDriven/src/parameters.ts +17 -0
- package/test/integration/generated/resiliency/devDriven/src/resiliencyDevDriven.ts +31 -0
- package/test/integration/generated/resiliency/devDriven/src/responses.ts +62 -0
- package/test/integration/generated/resiliency/devDriven/tsconfig.json +25 -0
- package/test/integration/generated/resiliency/devDriven/tspconfig.yaml +11 -0
- package/test/integration/generated/resiliency/srvDriven1/.eslintrc.json +11 -0
- package/test/integration/generated/resiliency/srvDriven1/README.md +56 -0
- package/test/integration/generated/resiliency/srvDriven1/api-extractor.json +18 -0
- package/test/integration/generated/resiliency/srvDriven1/package.json +80 -0
- package/test/integration/generated/resiliency/srvDriven1/rollup.config.js +118 -0
- package/test/integration/generated/resiliency/srvDriven1/src/clientDefinitions.ts +70 -0
- package/test/integration/generated/resiliency/srvDriven1/src/index.ts +13 -0
- package/test/integration/generated/resiliency/srvDriven1/src/models.ts +6 -0
- package/test/integration/generated/resiliency/srvDriven1/src/outputModels.ts +6 -0
- package/test/integration/generated/resiliency/srvDriven1/src/parameters.ts +51 -0
- package/test/integration/generated/resiliency/srvDriven1/src/resiliencyServiceDriven1.ts +31 -0
- package/test/integration/generated/resiliency/srvDriven1/src/responses.ts +34 -0
- package/test/integration/generated/resiliency/srvDriven1/tsconfig.json +25 -0
- package/test/integration/generated/resiliency/srvDriven1/tspconfig.yaml +11 -0
- package/test/integration/generated/resiliency/srvDriven2/.eslintrc.json +11 -0
- package/test/integration/generated/resiliency/srvDriven2/README.md +56 -0
- package/test/integration/generated/resiliency/srvDriven2/api-extractor.json +18 -0
- package/test/integration/generated/resiliency/srvDriven2/package.json +80 -0
- package/test/integration/generated/resiliency/srvDriven2/rollup.config.js +118 -0
- package/test/integration/generated/resiliency/srvDriven2/src/clientDefinitions.ts +93 -0
- package/test/integration/generated/resiliency/srvDriven2/src/index.ts +13 -0
- package/test/integration/generated/resiliency/srvDriven2/src/models.ts +6 -0
- package/test/integration/generated/resiliency/srvDriven2/src/outputModels.ts +6 -0
- package/test/integration/generated/resiliency/srvDriven2/src/parameters.ts +68 -0
- package/test/integration/generated/resiliency/srvDriven2/src/resiliencyServiceDriven2.ts +31 -0
- package/test/integration/generated/resiliency/srvDriven2/src/responses.ts +45 -0
- package/test/integration/generated/resiliency/srvDriven2/tsconfig.json +25 -0
- package/test/integration/generated/resiliency/srvDriven2/tspconfig.yaml +11 -0
- package/test/integration/generated/specialWords/src/clientDefinitions.ts +61 -0
- package/test/integration/generated/specialWords/src/index.ts +13 -0
- package/test/integration/generated/specialWords/src/models.ts +17 -0
- package/test/integration/generated/specialWords/src/outputModels.ts +17 -0
- package/test/integration/generated/specialWords/src/parameters.ts +37 -0
- package/test/integration/generated/specialWords/src/responses.ts +31 -0
- package/test/integration/generated/specialWords/src/specialWordsClient.ts +31 -0
- package/test/integration/generated/specialWords/tspconfig.yaml +11 -0
- package/test/integration/generated/unions/src/clientDefinitions.ts +53 -0
- package/test/integration/generated/unions/src/index.ts +12 -0
- package/test/integration/generated/unions/src/models.ts +27 -0
- package/test/integration/generated/unions/src/parameters.ts +34 -0
- package/test/integration/generated/unions/src/responses.ts +24 -0
- package/test/integration/generated/unions/src/unionsClient.ts +31 -0
- package/test/integration/generated/unions/tspconfig.yaml +11 -0
- package/test/integration/helloWorld.spec.ts +20 -0
- package/test/integration/lroBasic.spec.ts +25 -0
- package/test/integration/modelInheritance.spec.ts +192 -0
- package/test/integration/modelPropertyOptional.spec.ts +362 -0
- package/test/integration/modelPropertyType.spec.ts +119 -0
- package/test/integration/modelUsage.spec.ts +47 -0
- package/test/integration/resiliencyDpgCustomization.spec.ts +52 -0
- package/test/integration/specialWords.spec.ts +73 -0
- package/test/integration/unions.spec.ts +69 -0
- package/test/tsconfig.json +4 -0
- package/test/unit/azureCoreOperationsGenerator.spec.ts +71 -0
- package/test/unit/clientDefinitionGenerator.spec.ts +73 -0
- package/test/unit/clientFactoryGenerator.spec.ts +507 -0
- package/test/unit/docsGenerator.spec.ts +201 -0
- package/test/unit/modelsGenerator.spec.ts +1319 -0
- package/test/unit/parametersGenerator.spec.ts +561 -0
- package/test/unit/responsesGenerator.spec.ts +462 -0
- package/test/unit/spreadAndAlias.spec.ts +200 -0
- package/test/unit/util/emitUtil.ts +156 -0
- package/test/unit/util/testUtil.ts +83 -0
- package/test/util/customBearerTokenTestingPolicy.ts +78 -0
- package/test/util/matrix.ts +48 -0
- package/tsconfig.json +36 -0
- package/tsconfig.test.json +7 -0
- package/typespec-ts.build.log +2 -0
|
@@ -0,0 +1,118 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
5
|
+
import cjs from "@rollup/plugin-commonjs";
|
|
6
|
+
import sourcemaps from "rollup-plugin-sourcemaps";
|
|
7
|
+
import multiEntry from "@rollup/plugin-multi-entry";
|
|
8
|
+
import json from "@rollup/plugin-json";
|
|
9
|
+
|
|
10
|
+
import nodeBuiltins from "builtin-modules";
|
|
11
|
+
|
|
12
|
+
// #region Warning Handler
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* A function that can determine whether a rollup warning should be ignored. If
|
|
16
|
+
* the function returns `true`, then the warning will not be displayed.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
function ignoreNiseSinonEval(warning) {
|
|
20
|
+
return (
|
|
21
|
+
warning.code === "EVAL" &&
|
|
22
|
+
warning.id &&
|
|
23
|
+
(warning.id.includes("node_modules/nise") ||
|
|
24
|
+
warning.id.includes("node_modules/sinon")) === true
|
|
25
|
+
);
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
function ignoreChaiCircularDependency(warning) {
|
|
29
|
+
return (
|
|
30
|
+
warning.code === "CIRCULAR_DEPENDENCY" &&
|
|
31
|
+
warning.importer &&
|
|
32
|
+
warning.importer.includes("node_modules/chai") === true
|
|
33
|
+
);
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const warningInhibitors = [ignoreChaiCircularDependency, ignoreNiseSinonEval];
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Construct a warning handler for the shared rollup configuration
|
|
40
|
+
* that ignores certain warnings that are not relevant to testing.
|
|
41
|
+
*/
|
|
42
|
+
function makeOnWarnForTesting() {
|
|
43
|
+
return (warning, warn) => {
|
|
44
|
+
// If every inhibitor returns false (i.e. no inhibitors), then show the warning
|
|
45
|
+
if (warningInhibitors.every((inhib) => !inhib(warning))) {
|
|
46
|
+
warn(warning);
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// #endregion
|
|
52
|
+
|
|
53
|
+
function makeBrowserTestConfig() {
|
|
54
|
+
const config = {
|
|
55
|
+
input: {
|
|
56
|
+
include: ["dist-esm/test/**/*.spec.js"],
|
|
57
|
+
exclude: ["dist-esm/test/**/node/**"],
|
|
58
|
+
},
|
|
59
|
+
output: {
|
|
60
|
+
file: `dist-test/index.browser.js`,
|
|
61
|
+
format: "umd",
|
|
62
|
+
sourcemap: true,
|
|
63
|
+
},
|
|
64
|
+
preserveSymlinks: false,
|
|
65
|
+
plugins: [
|
|
66
|
+
multiEntry({ exports: false }),
|
|
67
|
+
nodeResolve({
|
|
68
|
+
mainFields: ["module", "browser"],
|
|
69
|
+
}),
|
|
70
|
+
cjs(),
|
|
71
|
+
json(),
|
|
72
|
+
sourcemaps(),
|
|
73
|
+
//viz({ filename: "dist-test/browser-stats.html", sourcemap: true })
|
|
74
|
+
],
|
|
75
|
+
onwarn: makeOnWarnForTesting(),
|
|
76
|
+
// Disable tree-shaking of test code. In rollup-plugin-node-resolve@5.0.0,
|
|
77
|
+
// rollup started respecting the "sideEffects" field in package.json. Since
|
|
78
|
+
// our package.json sets "sideEffects=false", this also applies to test
|
|
79
|
+
// code, which causes all tests to be removed by tree-shaking.
|
|
80
|
+
treeshake: false,
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
return config;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
const defaultConfigurationOptions = {
|
|
87
|
+
disableBrowserBundle: false,
|
|
88
|
+
};
|
|
89
|
+
|
|
90
|
+
export function makeConfig(pkg, options) {
|
|
91
|
+
options = {
|
|
92
|
+
...defaultConfigurationOptions,
|
|
93
|
+
...(options || {}),
|
|
94
|
+
};
|
|
95
|
+
|
|
96
|
+
const baseConfig = {
|
|
97
|
+
// Use the package's module field if it has one
|
|
98
|
+
input: pkg["module"] || "dist-esm/src/index.js",
|
|
99
|
+
external: [
|
|
100
|
+
...nodeBuiltins,
|
|
101
|
+
...Object.keys(pkg.dependencies),
|
|
102
|
+
...Object.keys(pkg.devDependencies),
|
|
103
|
+
],
|
|
104
|
+
output: { file: "dist/index.js", format: "cjs", sourcemap: true },
|
|
105
|
+
preserveSymlinks: false,
|
|
106
|
+
plugins: [sourcemaps(), nodeResolve()],
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
const config = [baseConfig];
|
|
110
|
+
|
|
111
|
+
if (!options.disableBrowserBundle) {
|
|
112
|
+
config.push(makeBrowserTestConfig());
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
return config;
|
|
116
|
+
}
|
|
117
|
+
|
|
118
|
+
export default makeConfig(require("./package.json"));
|
|
@@ -0,0 +1,234 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
BooleanGetParameters,
|
|
6
|
+
BooleanPutParameters,
|
|
7
|
+
StringGetParameters,
|
|
8
|
+
StringPutParameters,
|
|
9
|
+
BytesGetParameters,
|
|
10
|
+
BytesPutParameters,
|
|
11
|
+
IntGetParameters,
|
|
12
|
+
IntPutParameters,
|
|
13
|
+
FloatGetParameters,
|
|
14
|
+
FloatPutParameters,
|
|
15
|
+
DatetimeGetParameters,
|
|
16
|
+
DatetimePutParameters,
|
|
17
|
+
DurationGetParameters,
|
|
18
|
+
DurationPutParameters,
|
|
19
|
+
EnumGetParameters,
|
|
20
|
+
EnumPutParameters,
|
|
21
|
+
ExtensibleEnumGetParameters,
|
|
22
|
+
ExtensibleEnumPutParameters,
|
|
23
|
+
ModelGetParameters,
|
|
24
|
+
ModelPutParameters,
|
|
25
|
+
CollectionsStringGetParameters,
|
|
26
|
+
CollectionsStringPutParameters,
|
|
27
|
+
CollectionsIntGetParameters,
|
|
28
|
+
CollectionsIntPutParameters,
|
|
29
|
+
CollectionsModelGetParameters,
|
|
30
|
+
CollectionsModelPutParameters,
|
|
31
|
+
DictionaryStringGetParameters,
|
|
32
|
+
DictionaryStringPutParameters,
|
|
33
|
+
NeverGetParameters,
|
|
34
|
+
NeverPutParameters,
|
|
35
|
+
} from "./parameters";
|
|
36
|
+
import {
|
|
37
|
+
BooleanGet200Response,
|
|
38
|
+
BooleanPut204Response,
|
|
39
|
+
StringGet200Response,
|
|
40
|
+
StringPut204Response,
|
|
41
|
+
BytesGet200Response,
|
|
42
|
+
BytesPut204Response,
|
|
43
|
+
IntGet200Response,
|
|
44
|
+
IntPut204Response,
|
|
45
|
+
FloatGet200Response,
|
|
46
|
+
FloatPut204Response,
|
|
47
|
+
DatetimeGet200Response,
|
|
48
|
+
DatetimePut204Response,
|
|
49
|
+
DurationGet200Response,
|
|
50
|
+
DurationPut204Response,
|
|
51
|
+
EnumGet200Response,
|
|
52
|
+
EnumPut204Response,
|
|
53
|
+
ExtensibleEnumGet200Response,
|
|
54
|
+
ExtensibleEnumPut204Response,
|
|
55
|
+
ModelGet200Response,
|
|
56
|
+
ModelPut204Response,
|
|
57
|
+
CollectionsStringGet200Response,
|
|
58
|
+
CollectionsStringPut204Response,
|
|
59
|
+
CollectionsIntGet200Response,
|
|
60
|
+
CollectionsIntPut204Response,
|
|
61
|
+
CollectionsModelGet200Response,
|
|
62
|
+
CollectionsModelPut204Response,
|
|
63
|
+
DictionaryStringGet200Response,
|
|
64
|
+
DictionaryStringPut204Response,
|
|
65
|
+
NeverGet200Response,
|
|
66
|
+
NeverPut204Response,
|
|
67
|
+
} from "./responses";
|
|
68
|
+
import { Client, StreamableMethod } from "@azure-rest/core-client";
|
|
69
|
+
|
|
70
|
+
export interface BooleanGet {
|
|
71
|
+
/** Get call */
|
|
72
|
+
get(options?: BooleanGetParameters): StreamableMethod<BooleanGet200Response>;
|
|
73
|
+
/** Put operation */
|
|
74
|
+
put(options: BooleanPutParameters): StreamableMethod<BooleanPut204Response>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface StringGet {
|
|
78
|
+
/** Get call */
|
|
79
|
+
get(options?: StringGetParameters): StreamableMethod<StringGet200Response>;
|
|
80
|
+
/** Put operation */
|
|
81
|
+
put(options: StringPutParameters): StreamableMethod<StringPut204Response>;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export interface BytesGet {
|
|
85
|
+
/** Get call */
|
|
86
|
+
get(options?: BytesGetParameters): StreamableMethod<BytesGet200Response>;
|
|
87
|
+
/** Put operation */
|
|
88
|
+
put(options: BytesPutParameters): StreamableMethod<BytesPut204Response>;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export interface IntGet {
|
|
92
|
+
/** Get call */
|
|
93
|
+
get(options?: IntGetParameters): StreamableMethod<IntGet200Response>;
|
|
94
|
+
/** Put operation */
|
|
95
|
+
put(options: IntPutParameters): StreamableMethod<IntPut204Response>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
export interface FloatGet {
|
|
99
|
+
/** Get call */
|
|
100
|
+
get(options?: FloatGetParameters): StreamableMethod<FloatGet200Response>;
|
|
101
|
+
/** Put operation */
|
|
102
|
+
put(options: FloatPutParameters): StreamableMethod<FloatPut204Response>;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface DatetimeGet {
|
|
106
|
+
/** Get call */
|
|
107
|
+
get(
|
|
108
|
+
options?: DatetimeGetParameters
|
|
109
|
+
): StreamableMethod<DatetimeGet200Response>;
|
|
110
|
+
/** Put operation */
|
|
111
|
+
put(options: DatetimePutParameters): StreamableMethod<DatetimePut204Response>;
|
|
112
|
+
}
|
|
113
|
+
|
|
114
|
+
export interface DurationGet {
|
|
115
|
+
/** Get call */
|
|
116
|
+
get(
|
|
117
|
+
options?: DurationGetParameters
|
|
118
|
+
): StreamableMethod<DurationGet200Response>;
|
|
119
|
+
/** Put operation */
|
|
120
|
+
put(options: DurationPutParameters): StreamableMethod<DurationPut204Response>;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export interface EnumGet {
|
|
124
|
+
/** Get call */
|
|
125
|
+
get(options?: EnumGetParameters): StreamableMethod<EnumGet200Response>;
|
|
126
|
+
/** Put operation */
|
|
127
|
+
put(options: EnumPutParameters): StreamableMethod<EnumPut204Response>;
|
|
128
|
+
}
|
|
129
|
+
|
|
130
|
+
export interface ExtensibleEnumGet {
|
|
131
|
+
/** Get call */
|
|
132
|
+
get(
|
|
133
|
+
options?: ExtensibleEnumGetParameters
|
|
134
|
+
): StreamableMethod<ExtensibleEnumGet200Response>;
|
|
135
|
+
/** Put operation */
|
|
136
|
+
put(
|
|
137
|
+
options: ExtensibleEnumPutParameters
|
|
138
|
+
): StreamableMethod<ExtensibleEnumPut204Response>;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
export interface ModelGet {
|
|
142
|
+
/** Get call */
|
|
143
|
+
get(options?: ModelGetParameters): StreamableMethod<ModelGet200Response>;
|
|
144
|
+
/** Put operation */
|
|
145
|
+
put(options: ModelPutParameters): StreamableMethod<ModelPut204Response>;
|
|
146
|
+
}
|
|
147
|
+
|
|
148
|
+
export interface CollectionsStringGet {
|
|
149
|
+
/** Get call */
|
|
150
|
+
get(
|
|
151
|
+
options?: CollectionsStringGetParameters
|
|
152
|
+
): StreamableMethod<CollectionsStringGet200Response>;
|
|
153
|
+
/** Put operation */
|
|
154
|
+
put(
|
|
155
|
+
options: CollectionsStringPutParameters
|
|
156
|
+
): StreamableMethod<CollectionsStringPut204Response>;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
export interface CollectionsIntGet {
|
|
160
|
+
/** Get call */
|
|
161
|
+
get(
|
|
162
|
+
options?: CollectionsIntGetParameters
|
|
163
|
+
): StreamableMethod<CollectionsIntGet200Response>;
|
|
164
|
+
/** Put operation */
|
|
165
|
+
put(
|
|
166
|
+
options: CollectionsIntPutParameters
|
|
167
|
+
): StreamableMethod<CollectionsIntPut204Response>;
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
export interface CollectionsModelGet {
|
|
171
|
+
/** Get call */
|
|
172
|
+
get(
|
|
173
|
+
options?: CollectionsModelGetParameters
|
|
174
|
+
): StreamableMethod<CollectionsModelGet200Response>;
|
|
175
|
+
/** Put operation */
|
|
176
|
+
put(
|
|
177
|
+
options: CollectionsModelPutParameters
|
|
178
|
+
): StreamableMethod<CollectionsModelPut204Response>;
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
export interface DictionaryStringGet {
|
|
182
|
+
/** Get call */
|
|
183
|
+
get(
|
|
184
|
+
options?: DictionaryStringGetParameters
|
|
185
|
+
): StreamableMethod<DictionaryStringGet200Response>;
|
|
186
|
+
/** Put operation */
|
|
187
|
+
put(
|
|
188
|
+
options: DictionaryStringPutParameters
|
|
189
|
+
): StreamableMethod<DictionaryStringPut204Response>;
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
export interface NeverGet {
|
|
193
|
+
/** Get call */
|
|
194
|
+
get(options?: NeverGetParameters): StreamableMethod<NeverGet200Response>;
|
|
195
|
+
/** Put operation */
|
|
196
|
+
put(options: NeverPutParameters): StreamableMethod<NeverPut204Response>;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
export interface Routes {
|
|
200
|
+
/** Resource for '/models/properties/types/boolean' has methods for the following verbs: get, put */
|
|
201
|
+
(path: "/models/properties/types/boolean"): BooleanGet;
|
|
202
|
+
/** Resource for '/models/properties/types/string' has methods for the following verbs: get, put */
|
|
203
|
+
(path: "/models/properties/types/string"): StringGet;
|
|
204
|
+
/** Resource for '/models/properties/types/bytes' has methods for the following verbs: get, put */
|
|
205
|
+
(path: "/models/properties/types/bytes"): BytesGet;
|
|
206
|
+
/** Resource for '/models/properties/types/int' has methods for the following verbs: get, put */
|
|
207
|
+
(path: "/models/properties/types/int"): IntGet;
|
|
208
|
+
/** Resource for '/models/properties/types/float' has methods for the following verbs: get, put */
|
|
209
|
+
(path: "/models/properties/types/float"): FloatGet;
|
|
210
|
+
/** Resource for '/models/properties/types/datetime' has methods for the following verbs: get, put */
|
|
211
|
+
(path: "/models/properties/types/datetime"): DatetimeGet;
|
|
212
|
+
/** Resource for '/models/properties/types/duration' has methods for the following verbs: get, put */
|
|
213
|
+
(path: "/models/properties/types/duration"): DurationGet;
|
|
214
|
+
/** Resource for '/models/properties/types/enum' has methods for the following verbs: get, put */
|
|
215
|
+
(path: "/models/properties/types/enum"): EnumGet;
|
|
216
|
+
/** Resource for '/models/properties/types/extensible-enum' has methods for the following verbs: get, put */
|
|
217
|
+
(path: "/models/properties/types/extensible-enum"): ExtensibleEnumGet;
|
|
218
|
+
/** Resource for '/models/properties/types/model' has methods for the following verbs: get, put */
|
|
219
|
+
(path: "/models/properties/types/model"): ModelGet;
|
|
220
|
+
/** Resource for '/models/properties/types/collections/string' has methods for the following verbs: get, put */
|
|
221
|
+
(path: "/models/properties/types/collections/string"): CollectionsStringGet;
|
|
222
|
+
/** Resource for '/models/properties/types/collections/int' has methods for the following verbs: get, put */
|
|
223
|
+
(path: "/models/properties/types/collections/int"): CollectionsIntGet;
|
|
224
|
+
/** Resource for '/models/properties/types/collections/model' has methods for the following verbs: get, put */
|
|
225
|
+
(path: "/models/properties/types/collections/model"): CollectionsModelGet;
|
|
226
|
+
/** Resource for '/models/properties/types/dictionary/string' has methods for the following verbs: get, put */
|
|
227
|
+
(path: "/models/properties/types/dictionary/string"): DictionaryStringGet;
|
|
228
|
+
/** Resource for '/models/properties/types/never' has methods for the following verbs: get, put */
|
|
229
|
+
(path: "/models/properties/types/never"): NeverGet;
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
export type ModelsPropertyTypesClient = Client & {
|
|
233
|
+
path: Routes;
|
|
234
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
import ModelsPropertyTypes from "./modelsPropertyTypes";
|
|
5
|
+
|
|
6
|
+
export * from "./modelsPropertyTypes";
|
|
7
|
+
export * from "./parameters";
|
|
8
|
+
export * from "./responses";
|
|
9
|
+
export * from "./clientDefinitions";
|
|
10
|
+
export * from "./models";
|
|
11
|
+
export * from "./outputModels";
|
|
12
|
+
|
|
13
|
+
export default ModelsPropertyTypes;
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
/** Model with a boolean property */
|
|
5
|
+
export interface BooleanProperty {
|
|
6
|
+
/** Property */
|
|
7
|
+
property: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Model with a string property */
|
|
11
|
+
export interface StringProperty {
|
|
12
|
+
/** Property */
|
|
13
|
+
property: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Model with a bytes property */
|
|
17
|
+
export interface BytesProperty {
|
|
18
|
+
/** Property */
|
|
19
|
+
property: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Model with a int property */
|
|
23
|
+
export interface IntProperty {
|
|
24
|
+
/** Property */
|
|
25
|
+
property: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Model with a float property */
|
|
29
|
+
export interface FloatProperty {
|
|
30
|
+
/** Property */
|
|
31
|
+
property: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Model with a datetime property */
|
|
35
|
+
export interface DatetimeProperty {
|
|
36
|
+
/** Property */
|
|
37
|
+
property: Date | string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Model with a duration property */
|
|
41
|
+
export interface DurationProperty {
|
|
42
|
+
/** Property */
|
|
43
|
+
property: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Model with enum properties */
|
|
47
|
+
export interface EnumProperty {
|
|
48
|
+
/** Property */
|
|
49
|
+
property: "ValueOne" | "ValueTwo";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Model with extensible enum properties */
|
|
53
|
+
export interface ExtensibleEnumProperty {
|
|
54
|
+
/**
|
|
55
|
+
* Property
|
|
56
|
+
*
|
|
57
|
+
* Possible values: ValueOne, ValueTwo
|
|
58
|
+
*/
|
|
59
|
+
property: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Model with model properties */
|
|
63
|
+
export interface ModelProperty {
|
|
64
|
+
/** Property */
|
|
65
|
+
property: InnerModel;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Inner model. Will be a property type for ModelWithModelProperties */
|
|
69
|
+
export interface InnerModel {
|
|
70
|
+
/** Required string property */
|
|
71
|
+
property: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Model with collection string properties */
|
|
75
|
+
export interface CollectionsStringProperty {
|
|
76
|
+
/** Property */
|
|
77
|
+
property: string[];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Model with collection int properties */
|
|
81
|
+
export interface CollectionsIntProperty {
|
|
82
|
+
/** Property */
|
|
83
|
+
property: number[];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Model with collection model properties */
|
|
87
|
+
export interface CollectionsModelProperty {
|
|
88
|
+
/** Property */
|
|
89
|
+
property: Array<InnerModel>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Model with dictionary string properties */
|
|
93
|
+
export interface DictionaryStringProperty {
|
|
94
|
+
/** Property */
|
|
95
|
+
property: Record<string, string>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Model with a property never. (This property should not be included). */
|
|
99
|
+
export interface NeverProperty {}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
import { getClient, ClientOptions } from "@azure-rest/core-client";
|
|
5
|
+
import { ModelsPropertyTypesClient } from "./clientDefinitions";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Initialize a new instance of `ModelsPropertyTypesClient`
|
|
9
|
+
* @param options type: ClientOptions, the parameter for all optional parameters
|
|
10
|
+
*/
|
|
11
|
+
export default function createClient(
|
|
12
|
+
options: ClientOptions = {}
|
|
13
|
+
): ModelsPropertyTypesClient {
|
|
14
|
+
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
|
|
15
|
+
options.apiVersion = options.apiVersion ?? "1.0.0";
|
|
16
|
+
const userAgentInfo = `azsdk-js-property-types-rest/1.0.0`;
|
|
17
|
+
const userAgentPrefix =
|
|
18
|
+
options.userAgentOptions && options.userAgentOptions.userAgentPrefix
|
|
19
|
+
? `${options.userAgentOptions.userAgentPrefix} ${userAgentInfo}`
|
|
20
|
+
: `${userAgentInfo}`;
|
|
21
|
+
options = {
|
|
22
|
+
...options,
|
|
23
|
+
userAgentOptions: {
|
|
24
|
+
userAgentPrefix,
|
|
25
|
+
},
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
const client = getClient(baseUrl, options) as ModelsPropertyTypesClient;
|
|
29
|
+
|
|
30
|
+
return client;
|
|
31
|
+
}
|
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
/** Model with a boolean property */
|
|
5
|
+
export interface BooleanPropertyOutput {
|
|
6
|
+
/** Property */
|
|
7
|
+
property: boolean;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Model with a string property */
|
|
11
|
+
export interface StringPropertyOutput {
|
|
12
|
+
/** Property */
|
|
13
|
+
property: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Model with a bytes property */
|
|
17
|
+
export interface BytesPropertyOutput {
|
|
18
|
+
/** Property */
|
|
19
|
+
property: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Model with a int property */
|
|
23
|
+
export interface IntPropertyOutput {
|
|
24
|
+
/** Property */
|
|
25
|
+
property: number;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Model with a float property */
|
|
29
|
+
export interface FloatPropertyOutput {
|
|
30
|
+
/** Property */
|
|
31
|
+
property: number;
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Model with a datetime property */
|
|
35
|
+
export interface DatetimePropertyOutput {
|
|
36
|
+
/** Property */
|
|
37
|
+
property: string;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Model with a duration property */
|
|
41
|
+
export interface DurationPropertyOutput {
|
|
42
|
+
/** Property */
|
|
43
|
+
property: string;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** Model with enum properties */
|
|
47
|
+
export interface EnumPropertyOutput {
|
|
48
|
+
/** Property */
|
|
49
|
+
property: "ValueOne" | "ValueTwo";
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
/** Model with extensible enum properties */
|
|
53
|
+
export interface ExtensibleEnumPropertyOutput {
|
|
54
|
+
/**
|
|
55
|
+
* Property
|
|
56
|
+
*
|
|
57
|
+
* Possible values: ValueOne, ValueTwo
|
|
58
|
+
*/
|
|
59
|
+
property: string;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** Model with model properties */
|
|
63
|
+
export interface ModelPropertyOutput {
|
|
64
|
+
/** Property */
|
|
65
|
+
property: InnerModelOutput;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** Inner model. Will be a property type for ModelWithModelProperties */
|
|
69
|
+
export interface InnerModelOutput {
|
|
70
|
+
/** Required string property */
|
|
71
|
+
property: string;
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
/** Model with collection string properties */
|
|
75
|
+
export interface CollectionsStringPropertyOutput {
|
|
76
|
+
/** Property */
|
|
77
|
+
property: string[];
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
/** Model with collection int properties */
|
|
81
|
+
export interface CollectionsIntPropertyOutput {
|
|
82
|
+
/** Property */
|
|
83
|
+
property: number[];
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
/** Model with collection model properties */
|
|
87
|
+
export interface CollectionsModelPropertyOutput {
|
|
88
|
+
/** Property */
|
|
89
|
+
property: Array<InnerModelOutput>;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** Model with dictionary string properties */
|
|
93
|
+
export interface DictionaryStringPropertyOutput {
|
|
94
|
+
/** Property */
|
|
95
|
+
property: Record<string, string>;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** Model with a property never. (This property should not be included). */
|
|
99
|
+
export interface NeverPropertyOutput {}
|