@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,13 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
import ModelsPropertyOptional from "./modelsPropertyOptional";
|
|
5
|
+
|
|
6
|
+
export * from "./modelsPropertyOptional";
|
|
7
|
+
export * from "./parameters";
|
|
8
|
+
export * from "./responses";
|
|
9
|
+
export * from "./clientDefinitions";
|
|
10
|
+
export * from "./models";
|
|
11
|
+
export * from "./outputModels";
|
|
12
|
+
|
|
13
|
+
export default ModelsPropertyOptional;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
/** Template type for testing models with optional property. Pass in the type of the property you are looking for */
|
|
5
|
+
export interface StringProperty {
|
|
6
|
+
/** Property */
|
|
7
|
+
property?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Template type for testing models with optional property. Pass in the type of the property you are looking for */
|
|
11
|
+
export interface BytesProperty {
|
|
12
|
+
/** Property */
|
|
13
|
+
property?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Model with a datetime property */
|
|
17
|
+
export interface DatetimeProperty {
|
|
18
|
+
/** Property */
|
|
19
|
+
property?: Date | string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Model with a duration property */
|
|
23
|
+
export interface DurationProperty {
|
|
24
|
+
/** Property */
|
|
25
|
+
property?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Model with collection bytes properties */
|
|
29
|
+
export interface CollectionsByteProperty {
|
|
30
|
+
/** Property */
|
|
31
|
+
property?: string[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Model with collection models properties */
|
|
35
|
+
export interface CollectionsModelProperty {
|
|
36
|
+
/** Property */
|
|
37
|
+
property?: Array<StringProperty>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Model with required and optional properties */
|
|
41
|
+
export interface RequiredAndOptionalProperty {
|
|
42
|
+
/** optional string property */
|
|
43
|
+
optionalProperty?: string;
|
|
44
|
+
/** required int property */
|
|
45
|
+
requiredProperty: number;
|
|
46
|
+
}
|
|
@@ -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 { ModelsPropertyOptionalClient } from "./clientDefinitions";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Initialize a new instance of `ModelsPropertyOptionalClient`
|
|
9
|
+
* @param options type: ClientOptions, the parameter for all optional parameters
|
|
10
|
+
*/
|
|
11
|
+
export default function createClient(
|
|
12
|
+
options: ClientOptions = {}
|
|
13
|
+
): ModelsPropertyOptionalClient {
|
|
14
|
+
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
|
|
15
|
+
options.apiVersion = options.apiVersion ?? "1.0.0";
|
|
16
|
+
const userAgentInfo = `azsdk-js-optional-property-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 ModelsPropertyOptionalClient;
|
|
29
|
+
|
|
30
|
+
return client;
|
|
31
|
+
}
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
/** Template type for testing models with optional property. Pass in the type of the property you are looking for */
|
|
5
|
+
export interface StringPropertyOutput {
|
|
6
|
+
/** Property */
|
|
7
|
+
property?: string;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
/** Template type for testing models with optional property. Pass in the type of the property you are looking for */
|
|
11
|
+
export interface BytesPropertyOutput {
|
|
12
|
+
/** Property */
|
|
13
|
+
property?: string;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
/** Model with a datetime property */
|
|
17
|
+
export interface DatetimePropertyOutput {
|
|
18
|
+
/** Property */
|
|
19
|
+
property?: string;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Model with a duration property */
|
|
23
|
+
export interface DurationPropertyOutput {
|
|
24
|
+
/** Property */
|
|
25
|
+
property?: string;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
/** Model with collection bytes properties */
|
|
29
|
+
export interface CollectionsBytePropertyOutput {
|
|
30
|
+
/** Property */
|
|
31
|
+
property?: string[];
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
/** Model with collection models properties */
|
|
35
|
+
export interface CollectionsModelPropertyOutput {
|
|
36
|
+
/** Property */
|
|
37
|
+
property?: Array<StringPropertyOutput>;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** Model with required and optional properties */
|
|
41
|
+
export interface RequiredAndOptionalPropertyOutput {
|
|
42
|
+
/** optional string property */
|
|
43
|
+
optionalProperty?: string;
|
|
44
|
+
/** required int property */
|
|
45
|
+
requiredProperty: number;
|
|
46
|
+
}
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
import { RequestParameters } from "@azure-rest/core-client";
|
|
5
|
+
import {
|
|
6
|
+
StringProperty,
|
|
7
|
+
BytesProperty,
|
|
8
|
+
DatetimeProperty,
|
|
9
|
+
DurationProperty,
|
|
10
|
+
CollectionsByteProperty,
|
|
11
|
+
CollectionsModelProperty,
|
|
12
|
+
RequiredAndOptionalProperty,
|
|
13
|
+
} from "./models";
|
|
14
|
+
|
|
15
|
+
export type StringGetAllParameters = RequestParameters;
|
|
16
|
+
export type StringGetDefaultParameters = RequestParameters;
|
|
17
|
+
|
|
18
|
+
export interface StringPutAllBodyParam {
|
|
19
|
+
body: StringProperty;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
export type StringPutAllParameters = StringPutAllBodyParam & RequestParameters;
|
|
23
|
+
|
|
24
|
+
export interface StringPutDefaultBodyParam {
|
|
25
|
+
body: StringProperty;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export type StringPutDefaultParameters = StringPutDefaultBodyParam &
|
|
29
|
+
RequestParameters;
|
|
30
|
+
export type BytesGetAllParameters = RequestParameters;
|
|
31
|
+
export type BytesGetDefaultParameters = RequestParameters;
|
|
32
|
+
|
|
33
|
+
export interface BytesPutAllBodyParam {
|
|
34
|
+
body: BytesProperty;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type BytesPutAllParameters = BytesPutAllBodyParam & RequestParameters;
|
|
38
|
+
|
|
39
|
+
export interface BytesPutDefaultBodyParam {
|
|
40
|
+
body: BytesProperty;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
export type BytesPutDefaultParameters = BytesPutDefaultBodyParam &
|
|
44
|
+
RequestParameters;
|
|
45
|
+
export type DatetimeGetAllParameters = RequestParameters;
|
|
46
|
+
export type DatetimeGetDefaultParameters = RequestParameters;
|
|
47
|
+
|
|
48
|
+
export interface DatetimePutAllBodyParam {
|
|
49
|
+
body: DatetimeProperty;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export type DatetimePutAllParameters = DatetimePutAllBodyParam &
|
|
53
|
+
RequestParameters;
|
|
54
|
+
|
|
55
|
+
export interface DatetimePutDefaultBodyParam {
|
|
56
|
+
body: DatetimeProperty;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export type DatetimePutDefaultParameters = DatetimePutDefaultBodyParam &
|
|
60
|
+
RequestParameters;
|
|
61
|
+
export type DurationGetAllParameters = RequestParameters;
|
|
62
|
+
export type DurationGetDefaultParameters = RequestParameters;
|
|
63
|
+
|
|
64
|
+
export interface DurationPutAllBodyParam {
|
|
65
|
+
body: DurationProperty;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export type DurationPutAllParameters = DurationPutAllBodyParam &
|
|
69
|
+
RequestParameters;
|
|
70
|
+
|
|
71
|
+
export interface DurationPutDefaultBodyParam {
|
|
72
|
+
body: DurationProperty;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
export type DurationPutDefaultParameters = DurationPutDefaultBodyParam &
|
|
76
|
+
RequestParameters;
|
|
77
|
+
export type CollectionsByteGetAllParameters = RequestParameters;
|
|
78
|
+
export type CollectionsByteGetDefaultParameters = RequestParameters;
|
|
79
|
+
|
|
80
|
+
export interface CollectionsBytePutAllBodyParam {
|
|
81
|
+
body: CollectionsByteProperty;
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
export type CollectionsBytePutAllParameters = CollectionsBytePutAllBodyParam &
|
|
85
|
+
RequestParameters;
|
|
86
|
+
|
|
87
|
+
export interface CollectionsBytePutDefaultBodyParam {
|
|
88
|
+
body: CollectionsByteProperty;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
export type CollectionsBytePutDefaultParameters =
|
|
92
|
+
CollectionsBytePutDefaultBodyParam & RequestParameters;
|
|
93
|
+
export type CollectionsModelGetAllParameters = RequestParameters;
|
|
94
|
+
export type CollectionsModelGetDefaultParameters = RequestParameters;
|
|
95
|
+
|
|
96
|
+
export interface CollectionsModelPutAllBodyParam {
|
|
97
|
+
body: CollectionsModelProperty;
|
|
98
|
+
}
|
|
99
|
+
|
|
100
|
+
export type CollectionsModelPutAllParameters = CollectionsModelPutAllBodyParam &
|
|
101
|
+
RequestParameters;
|
|
102
|
+
|
|
103
|
+
export interface CollectionsModelPutDefaultBodyParam {
|
|
104
|
+
body: CollectionsModelProperty;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export type CollectionsModelPutDefaultParameters =
|
|
108
|
+
CollectionsModelPutDefaultBodyParam & RequestParameters;
|
|
109
|
+
export type RequiredAndOptionalGetAllParameters = RequestParameters;
|
|
110
|
+
export type RequiredAndOptionalGetRequiredOnlyParameters = RequestParameters;
|
|
111
|
+
|
|
112
|
+
export interface RequiredAndOptionalPutAllBodyParam {
|
|
113
|
+
body: RequiredAndOptionalProperty;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
export type RequiredAndOptionalPutAllParameters =
|
|
117
|
+
RequiredAndOptionalPutAllBodyParam & RequestParameters;
|
|
118
|
+
|
|
119
|
+
export interface RequiredAndOptionalPutRequiredOnlyBodyParam {
|
|
120
|
+
body: RequiredAndOptionalProperty;
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export type RequiredAndOptionalPutRequiredOnlyParameters =
|
|
124
|
+
RequiredAndOptionalPutRequiredOnlyBodyParam & RequestParameters;
|
|
@@ -0,0 +1,169 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
import { HttpResponse } from "@azure-rest/core-client";
|
|
5
|
+
import {
|
|
6
|
+
StringPropertyOutput,
|
|
7
|
+
BytesPropertyOutput,
|
|
8
|
+
DatetimePropertyOutput,
|
|
9
|
+
DurationPropertyOutput,
|
|
10
|
+
CollectionsBytePropertyOutput,
|
|
11
|
+
CollectionsModelPropertyOutput,
|
|
12
|
+
RequiredAndOptionalPropertyOutput,
|
|
13
|
+
} from "./outputModels";
|
|
14
|
+
|
|
15
|
+
/** The request has succeeded. */
|
|
16
|
+
export interface StringGetAll200Response extends HttpResponse {
|
|
17
|
+
status: "200";
|
|
18
|
+
body: StringPropertyOutput;
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
/** The request has succeeded. */
|
|
22
|
+
export interface StringGetDefault200Response extends HttpResponse {
|
|
23
|
+
status: "200";
|
|
24
|
+
body: StringPropertyOutput;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
28
|
+
export interface StringPutAll204Response extends HttpResponse {
|
|
29
|
+
status: "204";
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
33
|
+
export interface StringPutDefault204Response extends HttpResponse {
|
|
34
|
+
status: "204";
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
/** The request has succeeded. */
|
|
38
|
+
export interface BytesGetAll200Response extends HttpResponse {
|
|
39
|
+
status: "200";
|
|
40
|
+
body: BytesPropertyOutput;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
/** The request has succeeded. */
|
|
44
|
+
export interface BytesGetDefault200Response extends HttpResponse {
|
|
45
|
+
status: "200";
|
|
46
|
+
body: BytesPropertyOutput;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
50
|
+
export interface BytesPutAll204Response extends HttpResponse {
|
|
51
|
+
status: "204";
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
55
|
+
export interface BytesPutDefault204Response extends HttpResponse {
|
|
56
|
+
status: "204";
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
/** The request has succeeded. */
|
|
60
|
+
export interface DatetimeGetAll200Response extends HttpResponse {
|
|
61
|
+
status: "200";
|
|
62
|
+
body: DatetimePropertyOutput;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/** The request has succeeded. */
|
|
66
|
+
export interface DatetimeGetDefault200Response extends HttpResponse {
|
|
67
|
+
status: "200";
|
|
68
|
+
body: DatetimePropertyOutput;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
72
|
+
export interface DatetimePutAll204Response extends HttpResponse {
|
|
73
|
+
status: "204";
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
77
|
+
export interface DatetimePutDefault204Response extends HttpResponse {
|
|
78
|
+
status: "204";
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
/** The request has succeeded. */
|
|
82
|
+
export interface DurationGetAll200Response extends HttpResponse {
|
|
83
|
+
status: "200";
|
|
84
|
+
body: DurationPropertyOutput;
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** The request has succeeded. */
|
|
88
|
+
export interface DurationGetDefault200Response extends HttpResponse {
|
|
89
|
+
status: "200";
|
|
90
|
+
body: DurationPropertyOutput;
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
94
|
+
export interface DurationPutAll204Response extends HttpResponse {
|
|
95
|
+
status: "204";
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
99
|
+
export interface DurationPutDefault204Response extends HttpResponse {
|
|
100
|
+
status: "204";
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/** The request has succeeded. */
|
|
104
|
+
export interface CollectionsByteGetAll200Response extends HttpResponse {
|
|
105
|
+
status: "200";
|
|
106
|
+
body: CollectionsBytePropertyOutput;
|
|
107
|
+
}
|
|
108
|
+
|
|
109
|
+
/** The request has succeeded. */
|
|
110
|
+
export interface CollectionsByteGetDefault200Response extends HttpResponse {
|
|
111
|
+
status: "200";
|
|
112
|
+
body: CollectionsBytePropertyOutput;
|
|
113
|
+
}
|
|
114
|
+
|
|
115
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
116
|
+
export interface CollectionsBytePutAll204Response extends HttpResponse {
|
|
117
|
+
status: "204";
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
121
|
+
export interface CollectionsBytePutDefault204Response extends HttpResponse {
|
|
122
|
+
status: "204";
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/** The request has succeeded. */
|
|
126
|
+
export interface CollectionsModelGetAll200Response extends HttpResponse {
|
|
127
|
+
status: "200";
|
|
128
|
+
body: CollectionsModelPropertyOutput;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
/** The request has succeeded. */
|
|
132
|
+
export interface CollectionsModelGetDefault200Response extends HttpResponse {
|
|
133
|
+
status: "200";
|
|
134
|
+
body: CollectionsModelPropertyOutput;
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
138
|
+
export interface CollectionsModelPutAll204Response extends HttpResponse {
|
|
139
|
+
status: "204";
|
|
140
|
+
}
|
|
141
|
+
|
|
142
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
143
|
+
export interface CollectionsModelPutDefault204Response extends HttpResponse {
|
|
144
|
+
status: "204";
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
/** The request has succeeded. */
|
|
148
|
+
export interface RequiredAndOptionalGetAll200Response extends HttpResponse {
|
|
149
|
+
status: "200";
|
|
150
|
+
body: RequiredAndOptionalPropertyOutput;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/** The request has succeeded. */
|
|
154
|
+
export interface RequiredAndOptionalGetRequiredOnly200Response
|
|
155
|
+
extends HttpResponse {
|
|
156
|
+
status: "200";
|
|
157
|
+
body: RequiredAndOptionalPropertyOutput;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
161
|
+
export interface RequiredAndOptionalPutAll204Response extends HttpResponse {
|
|
162
|
+
status: "204";
|
|
163
|
+
}
|
|
164
|
+
|
|
165
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
166
|
+
export interface RequiredAndOptionalPutRequiredOnly204Response
|
|
167
|
+
extends HttpResponse {
|
|
168
|
+
status: "204";
|
|
169
|
+
}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "ES2017",
|
|
4
|
+
"module": "es6",
|
|
5
|
+
"lib": [],
|
|
6
|
+
"declaration": true,
|
|
7
|
+
"declarationMap": true,
|
|
8
|
+
"inlineSources": true,
|
|
9
|
+
"sourceMap": true,
|
|
10
|
+
"importHelpers": true,
|
|
11
|
+
"strict": true,
|
|
12
|
+
"alwaysStrict": true,
|
|
13
|
+
"noUnusedLocals": true,
|
|
14
|
+
"noUnusedParameters": true,
|
|
15
|
+
"noImplicitReturns": true,
|
|
16
|
+
"noFallthroughCasesInSwitch": true,
|
|
17
|
+
"forceConsistentCasingInFileNames": true,
|
|
18
|
+
"moduleResolution": "node",
|
|
19
|
+
"allowSyntheticDefaultImports": true,
|
|
20
|
+
"esModuleInterop": true,
|
|
21
|
+
"outDir": "./dist-esm",
|
|
22
|
+
"declarationDir": "./types"
|
|
23
|
+
},
|
|
24
|
+
"include": ["./src/**/*.ts"]
|
|
25
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
emitters:
|
|
2
|
+
"../../../../../../../../../../../packages/typespec-ts/dist/src/index.js":
|
|
3
|
+
generateMetadata: true
|
|
4
|
+
generateTest: false
|
|
5
|
+
addCredentials: false
|
|
6
|
+
azureSdkForJs: false
|
|
7
|
+
isCadlTest: true
|
|
8
|
+
packageDetails:
|
|
9
|
+
name: "@msinternal/optional-property"
|
|
10
|
+
description: "Optional Property Test Service"
|
|
11
|
+
version: "1.0.0"
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
{
|
|
2
|
+
"plugins": ["@azure/azure-sdk"],
|
|
3
|
+
"extends": ["plugin:@azure/azure-sdk/azure-sdk-base"],
|
|
4
|
+
"rules": {
|
|
5
|
+
"@azure/azure-sdk/ts-modules-only-named": "warn",
|
|
6
|
+
"@azure/azure-sdk/ts-apiextractor-json-types": "warn",
|
|
7
|
+
"@azure/azure-sdk/ts-package-json-types": "warn",
|
|
8
|
+
"@azure/azure-sdk/ts-package-json-engine-is-present": "warn",
|
|
9
|
+
"tsdoc/syntax": "warn"
|
|
10
|
+
}
|
|
11
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
# ModelsPropertyTypes REST client library for JavaScript
|
|
2
|
+
|
|
3
|
+
Illustrates various property types for models
|
|
4
|
+
|
|
5
|
+
**Please rely heavily on our [REST client docs](https://github.com/Azure/azure-sdk-for-js/blob/main/documentation/rest-clients.md) to use this library**
|
|
6
|
+
|
|
7
|
+
Key links:
|
|
8
|
+
|
|
9
|
+
- [Package (NPM)](https://www.npmjs.com/package/@msinternal/property-types)
|
|
10
|
+
|
|
11
|
+
## Getting started
|
|
12
|
+
|
|
13
|
+
### Currently supported environments
|
|
14
|
+
|
|
15
|
+
- LTS versions of Node.js
|
|
16
|
+
|
|
17
|
+
### Prerequisites
|
|
18
|
+
|
|
19
|
+
- You must have an [Azure subscription](https://azure.microsoft.com/free/) to use this package.
|
|
20
|
+
|
|
21
|
+
### Install the `@msinternal/property-types` package
|
|
22
|
+
|
|
23
|
+
Install the ModelsPropertyTypes REST client REST client library for JavaScript with `npm`:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @msinternal/property-types
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Create and authenticate a `ModelsPropertyTypesClient`
|
|
30
|
+
|
|
31
|
+
To use an [Azure Active Directory (AAD) token credential](https://github.com/Azure/azure-sdk-for-js/blob/main/sdk/identity/identity/samples/AzureIdentityExamples.md#authenticating-with-a-pre-fetched-access-token),
|
|
32
|
+
provide an instance of the desired credential type obtained from the
|
|
33
|
+
[@azure/identity](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) library.
|
|
34
|
+
|
|
35
|
+
To authenticate with AAD, you must first `npm` install [`@azure/identity`](https://www.npmjs.com/package/@azure/identity)
|
|
36
|
+
|
|
37
|
+
After setup, you can choose which type of [credential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#credentials) from `@azure/identity` to use.
|
|
38
|
+
As an example, [DefaultAzureCredential](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/identity/identity#defaultazurecredential)
|
|
39
|
+
can be used to authenticate the client.
|
|
40
|
+
|
|
41
|
+
Set the values of the client ID, tenant ID, and client secret of the AAD application as environment variables:
|
|
42
|
+
AZURE_CLIENT_ID, AZURE_TENANT_ID, AZURE_CLIENT_SECRET
|
|
43
|
+
|
|
44
|
+
## Troubleshooting
|
|
45
|
+
|
|
46
|
+
### Logging
|
|
47
|
+
|
|
48
|
+
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`:
|
|
49
|
+
|
|
50
|
+
```javascript
|
|
51
|
+
const { setLogLevel } = require("@azure/logger");
|
|
52
|
+
|
|
53
|
+
setLogLevel("info");
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
For more detailed instructions on how to enable logs, you can look at the [@azure/logger package docs](https://github.com/Azure/azure-sdk-for-js/tree/main/sdk/core/logger).
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://developer.microsoft.com/json-schemas/api-extractor/v7/api-extractor.schema.json",
|
|
3
|
+
"mainEntryPointFilePath": "./types/index.d.ts",
|
|
4
|
+
"docModel": { "enabled": true },
|
|
5
|
+
"apiReport": { "enabled": true, "reportFolder": "./review" },
|
|
6
|
+
"dtsRollup": {
|
|
7
|
+
"enabled": true,
|
|
8
|
+
"untrimmedFilePath": "",
|
|
9
|
+
"publicTrimmedFilePath": "./types/property-types.d.ts"
|
|
10
|
+
},
|
|
11
|
+
"messages": {
|
|
12
|
+
"tsdocMessageReporting": { "default": { "logLevel": "none" } },
|
|
13
|
+
"extractorMessageReporting": {
|
|
14
|
+
"ae-missing-release-tag": { "logLevel": "none" },
|
|
15
|
+
"ae-unresolved-link": { "logLevel": "none" }
|
|
16
|
+
}
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@msinternal/property-types",
|
|
3
|
+
"sdk-type": "client",
|
|
4
|
+
"author": "Microsoft Corporation",
|
|
5
|
+
"version": "1.0.0",
|
|
6
|
+
"description": "Property Types Test Service",
|
|
7
|
+
"keywords": ["node", "azure", "cloud", "typescript", "browser", "isomorphic"],
|
|
8
|
+
"license": "MIT",
|
|
9
|
+
"main": "dist/index.js",
|
|
10
|
+
"module": "./dist-esm/index.js",
|
|
11
|
+
"types": "./types/property-types.d.ts",
|
|
12
|
+
"repository": "github:Azure/azure-sdk-for-js",
|
|
13
|
+
"bugs": { "url": "https://github.com/Azure/azure-sdk-for-js/issues" },
|
|
14
|
+
"files": [
|
|
15
|
+
"dist/",
|
|
16
|
+
"dist-esm/",
|
|
17
|
+
"types/property-types.d.ts",
|
|
18
|
+
"README.md",
|
|
19
|
+
"LICENSE",
|
|
20
|
+
"review/*"
|
|
21
|
+
],
|
|
22
|
+
"engines": { "node": ">=14.0.0" },
|
|
23
|
+
"scripts": {
|
|
24
|
+
"audit": "node ../../../common/scripts/rush-audit.js && rimraf node_modules package-lock.json && npm i --package-lock-only 2>&1 && npm audit",
|
|
25
|
+
"build:browser": "echo skipped.",
|
|
26
|
+
"build:node": "echo skipped.",
|
|
27
|
+
"build:samples": "echo skipped.",
|
|
28
|
+
"build:test": "echo skipped.",
|
|
29
|
+
"build:debug": "echo skipped.",
|
|
30
|
+
"check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" ",
|
|
31
|
+
"clean": "rimraf dist dist-browser dist-esm test-dist temp types *.tgz *.log",
|
|
32
|
+
"execute:samples": "echo skipped",
|
|
33
|
+
"extract-api": "rimraf review && mkdirp ./review && api-extractor run --local",
|
|
34
|
+
"format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"*.{js,json}\" ",
|
|
35
|
+
"generate:client": "echo skipped",
|
|
36
|
+
"integration-test:browser": "echo skipped",
|
|
37
|
+
"integration-test:node": "echo skipped",
|
|
38
|
+
"integration-test": "echo skipped",
|
|
39
|
+
"lint:fix": "eslint package.json api-extractor.json src --ext .ts --fix --fix-type [problem,suggestion]",
|
|
40
|
+
"lint": "eslint package.json api-extractor.json src --ext .ts",
|
|
41
|
+
"pack": "npm pack 2>&1",
|
|
42
|
+
"test:browser": "echo skipped",
|
|
43
|
+
"test:node": "echo skipped",
|
|
44
|
+
"test": "echo \"Error: no test specified\" && exit 1",
|
|
45
|
+
"unit-test": "echo skipped",
|
|
46
|
+
"unit-test:node": "echo skipped",
|
|
47
|
+
"unit-test:browser": "echo skipped",
|
|
48
|
+
"build": "npm run clean && tsc && rollup -c 2>&1 && npm run minify && mkdirp ./review && npm run extract-api",
|
|
49
|
+
"minify": "uglifyjs -c -m --comments --source-map \"content='./dist/index.js.map'\" -o ./dist/index.min.js ./dist/index.js"
|
|
50
|
+
},
|
|
51
|
+
"sideEffects": false,
|
|
52
|
+
"autoPublish": false,
|
|
53
|
+
"dependencies": {
|
|
54
|
+
"@azure/core-auth": "^1.3.0",
|
|
55
|
+
"@azure-rest/core-client": "^1.1.0",
|
|
56
|
+
"@azure/core-rest-pipeline": "^1.8.0",
|
|
57
|
+
"@azure/logger": "^1.0.0",
|
|
58
|
+
"tslib": "^2.2.0"
|
|
59
|
+
},
|
|
60
|
+
"devDependencies": {
|
|
61
|
+
"@microsoft/api-extractor": "^7.31.1",
|
|
62
|
+
"autorest": "latest",
|
|
63
|
+
"@types/node": "^14.0.0",
|
|
64
|
+
"dotenv": "^16.0.0",
|
|
65
|
+
"eslint": "^8.0.0",
|
|
66
|
+
"mkdirp": "^2.1.2",
|
|
67
|
+
"prettier": "^2.5.1",
|
|
68
|
+
"rimraf": "^3.0.0",
|
|
69
|
+
"source-map-support": "^0.5.9",
|
|
70
|
+
"typescript": "~4.8.0",
|
|
71
|
+
"@rollup/plugin-commonjs": "^24.0.0",
|
|
72
|
+
"@rollup/plugin-json": "^6.0.0",
|
|
73
|
+
"@rollup/plugin-multi-entry": "^6.0.0",
|
|
74
|
+
"@rollup/plugin-node-resolve": "^13.1.3",
|
|
75
|
+
"rollup": "^2.66.1",
|
|
76
|
+
"rollup-plugin-sourcemaps": "^0.6.3",
|
|
77
|
+
"uglify-js": "^3.4.9"
|
|
78
|
+
},
|
|
79
|
+
"type": "module"
|
|
80
|
+
}
|