@azure-tools/typespec-ts 0.11.0-alpha.20230413.3
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 +392 -0
- package/.rush/temp/shrinkwrap-deps.json +472 -0
- package/CHANGELOG.md +65 -0
- package/CONTRIBUTING.md +137 -0
- package/README.md +150 -0
- package/dist/src/casingUtils.d.ts +4 -0
- package/dist/src/casingUtils.d.ts.map +1 -0
- package/dist/src/casingUtils.js +39 -0
- package/dist/src/casingUtils.js.map +1 -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 +90 -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 +190 -0
- package/dist/src/lib.js.map +1 -0
- package/dist/src/modelUtils.d.ts +33 -0
- package/dist/src/modelUtils.d.ts.map +1 -0
- package/dist/src/modelUtils.js +900 -0
- package/dist/src/modelUtils.js.map +1 -0
- package/dist/src/modular/buildApiIndex.d.ts +3 -0
- package/dist/src/modular/buildApiIndex.d.ts.map +1 -0
- package/dist/src/modular/buildApiIndex.js +12 -0
- package/dist/src/modular/buildApiIndex.js.map +1 -0
- package/dist/src/modular/buildClassicalClient.d.ts +4 -0
- package/dist/src/modular/buildClassicalClient.d.ts.map +1 -0
- package/dist/src/modular/buildClassicalClient.js +116 -0
- package/dist/src/modular/buildClassicalClient.js.map +1 -0
- package/dist/src/modular/buildClientContext.d.ts +7 -0
- package/dist/src/modular/buildClientContext.d.ts.map +1 -0
- package/dist/src/modular/buildClientContext.js +65 -0
- package/dist/src/modular/buildClientContext.js.map +1 -0
- package/dist/src/modular/buildCodeModel.d.ts +14 -0
- package/dist/src/modular/buildCodeModel.d.ts.map +1 -0
- package/dist/src/modular/buildCodeModel.js +1106 -0
- package/dist/src/modular/buildCodeModel.js.map +1 -0
- package/dist/src/modular/buildOperations.d.ts +13 -0
- package/dist/src/modular/buildOperations.d.ts.map +1 -0
- package/dist/src/modular/buildOperations.js +68 -0
- package/dist/src/modular/buildOperations.js.map +1 -0
- package/dist/src/modular/buildProjectFiles.d.ts +5 -0
- package/dist/src/modular/buildProjectFiles.d.ts.map +1 -0
- package/dist/src/modular/buildProjectFiles.js +188 -0
- package/dist/src/modular/buildProjectFiles.js.map +1 -0
- package/dist/src/modular/buildRootIndex.d.ts +4 -0
- package/dist/src/modular/buildRootIndex.d.ts.map +1 -0
- package/dist/src/modular/buildRootIndex.js +49 -0
- package/dist/src/modular/buildRootIndex.js.map +1 -0
- package/dist/src/modular/buildSharedTypes.d.ts +6 -0
- package/dist/src/modular/buildSharedTypes.d.ts.map +1 -0
- package/dist/src/modular/buildSharedTypes.js +33 -0
- package/dist/src/modular/buildSharedTypes.js.map +1 -0
- package/dist/src/modular/emitModels.d.ts +7 -0
- package/dist/src/modular/emitModels.d.ts.map +1 -0
- package/dist/src/modular/emitModels.js +63 -0
- package/dist/src/modular/emitModels.js.map +1 -0
- package/dist/src/modular/helpers/clientHelpers.d.ts +4 -0
- package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/clientHelpers.js +31 -0
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -0
- package/dist/src/modular/helpers/credentialHelpers.d.ts +7 -0
- package/dist/src/modular/helpers/credentialHelpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/credentialHelpers.js +22 -0
- package/dist/src/modular/helpers/credentialHelpers.js.map +1 -0
- package/dist/src/modular/helpers/namingHelpers.d.ts +3 -0
- package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/namingHelpers.js +4 -0
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -0
- package/dist/src/modular/helpers/operationHelpers.d.ts +8 -0
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/operationHelpers.js +191 -0
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -0
- package/dist/src/modular/helpers/parameterHelpers.d.ts +3 -0
- package/dist/src/modular/helpers/parameterHelpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/parameterHelpers.js +11 -0
- package/dist/src/modular/helpers/parameterHelpers.js.map +1 -0
- package/dist/src/modular/helpers/typeHelpers.d.ts +16 -0
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/typeHelpers.js +71 -0
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -0
- package/dist/src/modular/interfaces.d.ts +10 -0
- package/dist/src/modular/interfaces.d.ts.map +1 -0
- package/dist/src/modular/interfaces.js +2 -0
- package/dist/src/modular/interfaces.js.map +1 -0
- package/dist/src/modular/modularCodeModel.d.ts +120 -0
- package/dist/src/modular/modularCodeModel.d.ts.map +1 -0
- package/dist/src/modular/modularCodeModel.js +2 -0
- package/dist/src/modular/modularCodeModel.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 +6 -0
- package/dist/src/transform/transform.d.ts.map +1 -0
- package/dist/src/transform/transform.js +87 -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/transformApiVersionInfo.d.ts +5 -0
- package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -0
- package/dist/src/transform/transformApiVersionInfo.js +64 -0
- package/dist/src/transform/transformApiVersionInfo.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 +314 -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 +161 -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 +80 -0
- package/src/casingUtils.ts +48 -0
- package/src/emitUtil.ts +63 -0
- package/src/index.ts +148 -0
- package/src/lib.ts +208 -0
- package/src/modelUtils.ts +1080 -0
- package/src/modular/buildApiIndex.ts +13 -0
- package/src/modular/buildClassicalClient.ts +154 -0
- package/src/modular/buildClientContext.ts +96 -0
- package/src/modular/buildCodeModel.ts +1444 -0
- package/src/modular/buildOperations.ts +93 -0
- package/src/modular/buildProjectFiles.ts +217 -0
- package/src/modular/buildRootIndex.ts +75 -0
- package/src/modular/buildSharedTypes.ts +40 -0
- package/src/modular/emitModels.ts +72 -0
- package/src/modular/helpers/clientHelpers.ts +38 -0
- package/src/modular/helpers/credentialHelpers.ts +29 -0
- package/src/modular/helpers/namingHelpers.ts +5 -0
- package/src/modular/helpers/operationHelpers.ts +289 -0
- package/src/modular/helpers/parameterHelpers.ts +12 -0
- package/src/modular/helpers/typeHelpers.ts +84 -0
- package/src/modular/interfaces.ts +10 -0
- package/src/modular/modularCodeModel.ts +148 -0
- package/src/operationUtil.ts +203 -0
- package/src/transform/transform.ts +154 -0
- package/src/transform/transformAnnotationDetails.ts +231 -0
- package/src/transform/transformApiVersionInfo.ts +108 -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 +197 -0
- package/src/transform/transfromRLCOptions.ts +202 -0
- package/test/commands/cadl-ranch-list.ts +111 -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 +31 -0
- package/test/integration/arrayItemTypes.spec.ts +96 -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/collectionFormat.spec.ts +74 -0
- package/test/integration/dictionary.spec.ts +106 -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 +165 -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 +86 -0
- package/test/integration/generated/arrays/itemTypes/src/responses.ts +115 -0
- package/test/integration/generated/arrays/itemTypes/tspconfig.yaml +15 -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 +13 -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 +15 -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 +15 -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 +180 -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 +94 -0
- package/test/integration/generated/dictionary/src/responses.ts +126 -0
- package/test/integration/generated/dictionary/tsconfig.json +25 -0
- package/test/integration/generated/dictionary/tspconfig.yaml +15 -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 +14 -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 +14 -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 +14 -0
- package/test/integration/generated/internal/src/clientDefinitions.ts +27 -0
- package/test/integration/generated/internal/src/index.ts +13 -0
- package/test/integration/generated/internal/src/internalClient.ts +31 -0
- package/test/integration/generated/internal/src/models.ts +8 -0
- package/test/integration/generated/internal/src/outputModels.ts +13 -0
- package/test/integration/generated/internal/src/parameters.ts +21 -0
- package/test/integration/generated/internal/src/responses.ts +20 -0
- package/test/integration/generated/internal/tspconfig.yaml +14 -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 +13 -0
- package/test/integration/generated/lro/lroBasic/src/outputModels.ts +8 -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 +23 -0
- package/test/integration/generated/lro/lroBasic/tsconfig.json +25 -0
- package/test/integration/generated/lro/lroBasic/tspconfig.yaml +14 -0
- package/test/integration/generated/lro/lroCore/.eslintrc.json +11 -0
- package/test/integration/generated/lro/lroCore/README.md +56 -0
- package/test/integration/generated/lro/lroCore/api-extractor.json +18 -0
- package/test/integration/generated/lro/lroCore/package.json +82 -0
- package/test/integration/generated/lro/lroCore/rollup.config.js +118 -0
- package/test/integration/generated/lro/lroCore/src/azureLroCore.ts +31 -0
- package/test/integration/generated/lro/lroCore/src/clientDefinitions.ts +51 -0
- package/test/integration/generated/lro/lroCore/src/index.ts +15 -0
- package/test/integration/generated/lro/lroCore/src/isUnexpected.ts +128 -0
- package/test/integration/generated/lro/lroCore/src/models.ts +8 -0
- package/test/integration/generated/lro/lroCore/src/outputModels.ts +53 -0
- package/test/integration/generated/lro/lroCore/src/parameters.ts +25 -0
- package/test/integration/generated/lro/lroCore/src/pollingHelper.ts +75 -0
- package/test/integration/generated/lro/lroCore/src/responses.ts +91 -0
- package/test/integration/generated/lro/lroCore/tsconfig.json +25 -0
- package/test/integration/generated/lro/lroCore/tspconfig.yaml +14 -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 +14 -0
- package/test/integration/generated/models/propertyNullable/.eslintrc.json +11 -0
- package/test/integration/generated/models/propertyNullable/README.md +56 -0
- package/test/integration/generated/models/propertyNullable/api-extractor.json +18 -0
- package/test/integration/generated/models/propertyNullable/package.json +80 -0
- package/test/integration/generated/models/propertyNullable/rollup.config.js +118 -0
- package/test/integration/generated/models/propertyNullable/src/clientDefinitions.ts +227 -0
- package/test/integration/generated/models/propertyNullable/src/index.ts +13 -0
- package/test/integration/generated/models/propertyNullable/src/models.ts +56 -0
- package/test/integration/generated/models/propertyNullable/src/modelsPropertyNullable.ts +31 -0
- package/test/integration/generated/models/propertyNullable/src/outputModels.ts +56 -0
- package/test/integration/generated/models/propertyNullable/src/parameters.ts +195 -0
- package/test/integration/generated/models/propertyNullable/src/responses.ts +144 -0
- package/test/integration/generated/models/propertyNullable/tsconfig.json +25 -0
- package/test/integration/generated/models/propertyNullable/tspconfig.yaml +14 -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 +14 -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 +14 -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 +14 -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 +14 -0
- package/test/integration/generated/parameters/collection-format/src/clientDefinitions.ts +39 -0
- package/test/integration/generated/parameters/collection-format/src/collectionFormatClient.ts +31 -0
- package/test/integration/generated/parameters/collection-format/src/index.ts +12 -0
- package/test/integration/generated/parameters/collection-format/src/parameters.ts +38 -0
- package/test/integration/generated/parameters/collection-format/src/responses.ts +19 -0
- package/test/integration/generated/parameters/collection-format/src/serializeHelper.ts +16 -0
- package/test/integration/generated/parameters/collection-format/tspconfig.yaml +14 -0
- package/test/integration/generated/projection/src/clientDefinitions.ts +45 -0
- package/test/integration/generated/projection/src/index.ts +12 -0
- package/test/integration/generated/projection/src/models.ts +11 -0
- package/test/integration/generated/projection/src/parameters.ts +26 -0
- package/test/integration/generated/projection/src/projectionClient.ts +31 -0
- package/test/integration/generated/projection/src/responses.ts +19 -0
- package/test/integration/generated/projection/tspconfig.yaml +14 -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 +14 -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 +14 -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 +14 -0
- package/test/integration/generated/server/path/multiple/src/clientDefinitions.ts +35 -0
- package/test/integration/generated/server/path/multiple/src/index.ts +11 -0
- package/test/integration/generated/server/path/multiple/src/multipleParamInServerPathClient.ts +39 -0
- package/test/integration/generated/server/path/multiple/src/parameters.ts +7 -0
- package/test/integration/generated/server/path/multiple/src/responses.ts +14 -0
- package/test/integration/generated/server/path/multiple/tspconfig.yaml +14 -0
- package/test/integration/generated/server/path/single/src/clientDefinitions.ts +19 -0
- package/test/integration/generated/server/path/single/src/index.ts +11 -0
- package/test/integration/generated/server/path/single/src/parameters.ts +6 -0
- package/test/integration/generated/server/path/single/src/responses.ts +9 -0
- package/test/integration/generated/server/path/single/src/singleParamInServerPathClient.ts +34 -0
- package/test/integration/generated/server/path/single/tspconfig.yaml +14 -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 +14 -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 +14 -0
- package/test/integration/helloWorld.spec.ts +20 -0
- package/test/integration/internal.spec.ts +43 -0
- package/test/integration/lroBasic.spec.ts +25 -0
- package/test/integration/modelInheritance.spec.ts +192 -0
- package/test/integration/modelPropertyNullable.spec.ts +115 -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/projection.spec.ts +55 -0
- package/test/integration/resiliencyDpgCustomization.spec.ts +52 -0
- package/test/integration/server.spec.ts +59 -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/apiVersion.spec.ts +388 -0
- package/test/unit/azureCoreOperationsGenerator.spec.ts +71 -0
- package/test/unit/clientDefinitionGenerator.spec.ts +73 -0
- package/test/unit/clientFactoryGenerator.spec.ts +376 -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 +157 -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,31 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
import { getClient, ClientOptions } from "@azure-rest/core-client";
|
|
5
|
+
import { ArrayItemTypesClient } from "./clientDefinitions";
|
|
6
|
+
|
|
7
|
+
/**
|
|
8
|
+
* Initialize a new instance of `ArrayItemTypesClient`
|
|
9
|
+
* @param options type: ClientOptions, the parameter for all optional parameters
|
|
10
|
+
*/
|
|
11
|
+
export default function createClient(
|
|
12
|
+
options: ClientOptions = {}
|
|
13
|
+
): ArrayItemTypesClient {
|
|
14
|
+
const baseUrl = options.baseUrl ?? `http://localhost:3000`;
|
|
15
|
+
options.apiVersion = options.apiVersion ?? "1.0.0";
|
|
16
|
+
const userAgentInfo = `azsdk-js-array-itemtypes-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 ArrayItemTypesClient;
|
|
29
|
+
|
|
30
|
+
return client;
|
|
31
|
+
}
|
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
import {
|
|
5
|
+
Int32ValueGetParameters,
|
|
6
|
+
Int32ValuePutParameters,
|
|
7
|
+
Int64ValueGetParameters,
|
|
8
|
+
Int64ValuePutParameters,
|
|
9
|
+
BooleanValueGetParameters,
|
|
10
|
+
BooleanValuePutParameters,
|
|
11
|
+
StringValueGetParameters,
|
|
12
|
+
StringValuePutParameters,
|
|
13
|
+
Float32ValueGetParameters,
|
|
14
|
+
Float32ValuePutParameters,
|
|
15
|
+
DatetimeValueGetParameters,
|
|
16
|
+
DatetimeValuePutParameters,
|
|
17
|
+
DurationValueGetParameters,
|
|
18
|
+
DurationValuePutParameters,
|
|
19
|
+
UnknownValueGetParameters,
|
|
20
|
+
UnknownValuePutParameters,
|
|
21
|
+
ModelValueGetParameters,
|
|
22
|
+
ModelValuePutParameters,
|
|
23
|
+
NullableFloatValueGetParameters,
|
|
24
|
+
NullableFloatValuePutParameters,
|
|
25
|
+
} from "./parameters";
|
|
26
|
+
import {
|
|
27
|
+
Int32ValueGet200Response,
|
|
28
|
+
Int32ValuePut204Response,
|
|
29
|
+
Int64ValueGet200Response,
|
|
30
|
+
Int64ValuePut204Response,
|
|
31
|
+
BooleanValueGet200Response,
|
|
32
|
+
BooleanValuePut204Response,
|
|
33
|
+
StringValueGet200Response,
|
|
34
|
+
StringValuePut204Response,
|
|
35
|
+
Float32ValueGet200Response,
|
|
36
|
+
Float32ValuePut204Response,
|
|
37
|
+
DatetimeValueGet200Response,
|
|
38
|
+
DatetimeValuePut204Response,
|
|
39
|
+
DurationValueGet200Response,
|
|
40
|
+
DurationValuePut204Response,
|
|
41
|
+
UnknownValueGet200Response,
|
|
42
|
+
UnknownValuePut204Response,
|
|
43
|
+
ModelValueGet200Response,
|
|
44
|
+
ModelValuePut204Response,
|
|
45
|
+
NullableFloatValueGet200Response,
|
|
46
|
+
NullableFloatValuePut204Response,
|
|
47
|
+
} from "./responses";
|
|
48
|
+
import { Client, StreamableMethod } from "@azure-rest/core-client";
|
|
49
|
+
|
|
50
|
+
export interface Int32ValueGet {
|
|
51
|
+
get(
|
|
52
|
+
options?: Int32ValueGetParameters
|
|
53
|
+
): StreamableMethod<Int32ValueGet200Response>;
|
|
54
|
+
put(
|
|
55
|
+
options: Int32ValuePutParameters
|
|
56
|
+
): StreamableMethod<Int32ValuePut204Response>;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface Int64ValueGet {
|
|
60
|
+
get(
|
|
61
|
+
options?: Int64ValueGetParameters
|
|
62
|
+
): StreamableMethod<Int64ValueGet200Response>;
|
|
63
|
+
put(
|
|
64
|
+
options: Int64ValuePutParameters
|
|
65
|
+
): StreamableMethod<Int64ValuePut204Response>;
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export interface BooleanValueGet {
|
|
69
|
+
get(
|
|
70
|
+
options?: BooleanValueGetParameters
|
|
71
|
+
): StreamableMethod<BooleanValueGet200Response>;
|
|
72
|
+
put(
|
|
73
|
+
options: BooleanValuePutParameters
|
|
74
|
+
): StreamableMethod<BooleanValuePut204Response>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export interface StringValueGet {
|
|
78
|
+
get(
|
|
79
|
+
options?: StringValueGetParameters
|
|
80
|
+
): StreamableMethod<StringValueGet200Response>;
|
|
81
|
+
put(
|
|
82
|
+
options: StringValuePutParameters
|
|
83
|
+
): StreamableMethod<StringValuePut204Response>;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
export interface Float32ValueGet {
|
|
87
|
+
get(
|
|
88
|
+
options?: Float32ValueGetParameters
|
|
89
|
+
): StreamableMethod<Float32ValueGet200Response>;
|
|
90
|
+
put(
|
|
91
|
+
options: Float32ValuePutParameters
|
|
92
|
+
): StreamableMethod<Float32ValuePut204Response>;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface DatetimeValueGet {
|
|
96
|
+
get(
|
|
97
|
+
options?: DatetimeValueGetParameters
|
|
98
|
+
): StreamableMethod<DatetimeValueGet200Response>;
|
|
99
|
+
put(
|
|
100
|
+
options: DatetimeValuePutParameters
|
|
101
|
+
): StreamableMethod<DatetimeValuePut204Response>;
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
export interface DurationValueGet {
|
|
105
|
+
get(
|
|
106
|
+
options?: DurationValueGetParameters
|
|
107
|
+
): StreamableMethod<DurationValueGet200Response>;
|
|
108
|
+
put(
|
|
109
|
+
options: DurationValuePutParameters
|
|
110
|
+
): StreamableMethod<DurationValuePut204Response>;
|
|
111
|
+
}
|
|
112
|
+
|
|
113
|
+
export interface UnknownValueGet {
|
|
114
|
+
get(
|
|
115
|
+
options?: UnknownValueGetParameters
|
|
116
|
+
): StreamableMethod<UnknownValueGet200Response>;
|
|
117
|
+
put(
|
|
118
|
+
options: UnknownValuePutParameters
|
|
119
|
+
): StreamableMethod<UnknownValuePut204Response>;
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
export interface ModelValueGet {
|
|
123
|
+
get(
|
|
124
|
+
options?: ModelValueGetParameters
|
|
125
|
+
): StreamableMethod<ModelValueGet200Response>;
|
|
126
|
+
put(
|
|
127
|
+
options: ModelValuePutParameters
|
|
128
|
+
): StreamableMethod<ModelValuePut204Response>;
|
|
129
|
+
}
|
|
130
|
+
|
|
131
|
+
export interface NullableFloatValueGet {
|
|
132
|
+
get(
|
|
133
|
+
options?: NullableFloatValueGetParameters
|
|
134
|
+
): StreamableMethod<NullableFloatValueGet200Response>;
|
|
135
|
+
put(
|
|
136
|
+
options: NullableFloatValuePutParameters
|
|
137
|
+
): StreamableMethod<NullableFloatValuePut204Response>;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
export interface Routes {
|
|
141
|
+
/** Resource for '/arrays/item-types/int32' has methods for the following verbs: get, put */
|
|
142
|
+
(path: "/arrays/item-types/int32"): Int32ValueGet;
|
|
143
|
+
/** Resource for '/arrays/item-types/int64' has methods for the following verbs: get, put */
|
|
144
|
+
(path: "/arrays/item-types/int64"): Int64ValueGet;
|
|
145
|
+
/** Resource for '/arrays/item-types/boolean' has methods for the following verbs: get, put */
|
|
146
|
+
(path: "/arrays/item-types/boolean"): BooleanValueGet;
|
|
147
|
+
/** Resource for '/arrays/item-types/string' has methods for the following verbs: get, put */
|
|
148
|
+
(path: "/arrays/item-types/string"): StringValueGet;
|
|
149
|
+
/** Resource for '/arrays/item-types/float32' has methods for the following verbs: get, put */
|
|
150
|
+
(path: "/arrays/item-types/float32"): Float32ValueGet;
|
|
151
|
+
/** Resource for '/arrays/item-types/datetime' has methods for the following verbs: get, put */
|
|
152
|
+
(path: "/arrays/item-types/datetime"): DatetimeValueGet;
|
|
153
|
+
/** Resource for '/arrays/item-types/duration' has methods for the following verbs: get, put */
|
|
154
|
+
(path: "/arrays/item-types/duration"): DurationValueGet;
|
|
155
|
+
/** Resource for '/arrays/item-types/unknown' has methods for the following verbs: get, put */
|
|
156
|
+
(path: "/arrays/item-types/unknown"): UnknownValueGet;
|
|
157
|
+
/** Resource for '/arrays/item-types/model' has methods for the following verbs: get, put */
|
|
158
|
+
(path: "/arrays/item-types/model"): ModelValueGet;
|
|
159
|
+
/** Resource for '/arrays/item-types/nullable-float' has methods for the following verbs: get, put */
|
|
160
|
+
(path: "/arrays/item-types/nullable-float"): NullableFloatValueGet;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
export type ArrayItemTypesClient = Client & {
|
|
164
|
+
path: Routes;
|
|
165
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
import ArrayItemTypesClient from "./arrayItemTypesClient";
|
|
5
|
+
|
|
6
|
+
export * from "./arrayItemTypesClient";
|
|
7
|
+
export * from "./parameters";
|
|
8
|
+
export * from "./responses";
|
|
9
|
+
export * from "./clientDefinitions";
|
|
10
|
+
export * from "./models";
|
|
11
|
+
export * from "./outputModels";
|
|
12
|
+
|
|
13
|
+
export default ArrayItemTypesClient;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
import { RequestParameters } from "@azure-rest/core-client";
|
|
5
|
+
import { InnerModel } from "./models";
|
|
6
|
+
|
|
7
|
+
export type Int32ValueGetParameters = RequestParameters;
|
|
8
|
+
|
|
9
|
+
export interface Int32ValuePutBodyParam {
|
|
10
|
+
body: number[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export type Int32ValuePutParameters = Int32ValuePutBodyParam &
|
|
14
|
+
RequestParameters;
|
|
15
|
+
export type Int64ValueGetParameters = RequestParameters;
|
|
16
|
+
|
|
17
|
+
export interface Int64ValuePutBodyParam {
|
|
18
|
+
body: number[];
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
export type Int64ValuePutParameters = Int64ValuePutBodyParam &
|
|
22
|
+
RequestParameters;
|
|
23
|
+
export type BooleanValueGetParameters = RequestParameters;
|
|
24
|
+
|
|
25
|
+
export interface BooleanValuePutBodyParam {
|
|
26
|
+
body: boolean[];
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
export type BooleanValuePutParameters = BooleanValuePutBodyParam &
|
|
30
|
+
RequestParameters;
|
|
31
|
+
export type StringValueGetParameters = RequestParameters;
|
|
32
|
+
|
|
33
|
+
export interface StringValuePutBodyParam {
|
|
34
|
+
body: string[];
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export type StringValuePutParameters = StringValuePutBodyParam &
|
|
38
|
+
RequestParameters;
|
|
39
|
+
export type Float32ValueGetParameters = RequestParameters;
|
|
40
|
+
|
|
41
|
+
export interface Float32ValuePutBodyParam {
|
|
42
|
+
body: number[];
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
export type Float32ValuePutParameters = Float32ValuePutBodyParam &
|
|
46
|
+
RequestParameters;
|
|
47
|
+
export type DatetimeValueGetParameters = RequestParameters;
|
|
48
|
+
|
|
49
|
+
export interface DatetimeValuePutBodyParam {
|
|
50
|
+
body: Date[] | string[];
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export type DatetimeValuePutParameters = DatetimeValuePutBodyParam &
|
|
54
|
+
RequestParameters;
|
|
55
|
+
export type DurationValueGetParameters = RequestParameters;
|
|
56
|
+
|
|
57
|
+
export interface DurationValuePutBodyParam {
|
|
58
|
+
body: string[];
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export type DurationValuePutParameters = DurationValuePutBodyParam &
|
|
62
|
+
RequestParameters;
|
|
63
|
+
export type UnknownValueGetParameters = RequestParameters;
|
|
64
|
+
|
|
65
|
+
export interface UnknownValuePutBodyParam {
|
|
66
|
+
body: unknown[];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
export type UnknownValuePutParameters = UnknownValuePutBodyParam &
|
|
70
|
+
RequestParameters;
|
|
71
|
+
export type ModelValueGetParameters = RequestParameters;
|
|
72
|
+
|
|
73
|
+
export interface ModelValuePutBodyParam {
|
|
74
|
+
body: Array<InnerModel>;
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
export type ModelValuePutParameters = ModelValuePutBodyParam &
|
|
78
|
+
RequestParameters;
|
|
79
|
+
export type NullableFloatValueGetParameters = RequestParameters;
|
|
80
|
+
|
|
81
|
+
export interface NullableFloatValuePutBodyParam {
|
|
82
|
+
body: (number | null)[];
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
export type NullableFloatValuePutParameters = NullableFloatValuePutBodyParam &
|
|
86
|
+
RequestParameters;
|
|
@@ -0,0 +1,115 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
import { HttpResponse } from "@azure-rest/core-client";
|
|
5
|
+
import { InnerModelOutput } from "./outputModels";
|
|
6
|
+
|
|
7
|
+
/** The request has succeeded. */
|
|
8
|
+
export interface Int32ValueGet200Response extends HttpResponse {
|
|
9
|
+
status: "200";
|
|
10
|
+
body: number[];
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
14
|
+
export interface Int32ValuePut204Response extends HttpResponse {
|
|
15
|
+
status: "204";
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** The request has succeeded. */
|
|
19
|
+
export interface Int64ValueGet200Response extends HttpResponse {
|
|
20
|
+
status: "200";
|
|
21
|
+
body: number[];
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
25
|
+
export interface Int64ValuePut204Response extends HttpResponse {
|
|
26
|
+
status: "204";
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** The request has succeeded. */
|
|
30
|
+
export interface BooleanValueGet200Response extends HttpResponse {
|
|
31
|
+
status: "200";
|
|
32
|
+
body: boolean[];
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
36
|
+
export interface BooleanValuePut204Response extends HttpResponse {
|
|
37
|
+
status: "204";
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/** The request has succeeded. */
|
|
41
|
+
export interface StringValueGet200Response extends HttpResponse {
|
|
42
|
+
status: "200";
|
|
43
|
+
body: string[];
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
47
|
+
export interface StringValuePut204Response extends HttpResponse {
|
|
48
|
+
status: "204";
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
/** The request has succeeded. */
|
|
52
|
+
export interface Float32ValueGet200Response extends HttpResponse {
|
|
53
|
+
status: "200";
|
|
54
|
+
body: number[];
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
58
|
+
export interface Float32ValuePut204Response extends HttpResponse {
|
|
59
|
+
status: "204";
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/** The request has succeeded. */
|
|
63
|
+
export interface DatetimeValueGet200Response extends HttpResponse {
|
|
64
|
+
status: "200";
|
|
65
|
+
body: string[];
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
69
|
+
export interface DatetimeValuePut204Response extends HttpResponse {
|
|
70
|
+
status: "204";
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/** The request has succeeded. */
|
|
74
|
+
export interface DurationValueGet200Response extends HttpResponse {
|
|
75
|
+
status: "200";
|
|
76
|
+
body: string[];
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
80
|
+
export interface DurationValuePut204Response extends HttpResponse {
|
|
81
|
+
status: "204";
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
/** The request has succeeded. */
|
|
85
|
+
export interface UnknownValueGet200Response extends HttpResponse {
|
|
86
|
+
status: "200";
|
|
87
|
+
body: any[];
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
91
|
+
export interface UnknownValuePut204Response extends HttpResponse {
|
|
92
|
+
status: "204";
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/** The request has succeeded. */
|
|
96
|
+
export interface ModelValueGet200Response extends HttpResponse {
|
|
97
|
+
status: "200";
|
|
98
|
+
body: Array<InnerModelOutput>;
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
102
|
+
export interface ModelValuePut204Response extends HttpResponse {
|
|
103
|
+
status: "204";
|
|
104
|
+
}
|
|
105
|
+
|
|
106
|
+
/** The request has succeeded. */
|
|
107
|
+
export interface NullableFloatValueGet200Response extends HttpResponse {
|
|
108
|
+
status: "200";
|
|
109
|
+
body: (number | null)[];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
/** There is no content to send for this request, but the headers may be useful. */
|
|
113
|
+
export interface NullableFloatValuePut204Response extends HttpResponse {
|
|
114
|
+
status: "204";
|
|
115
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
emit:
|
|
2
|
+
- "@azure-tools/typespec-ts"
|
|
3
|
+
options:
|
|
4
|
+
"@azure-tools/typespec-ts":
|
|
5
|
+
"emitter-output-dir": "{project-root}"
|
|
6
|
+
generateMetadata: false
|
|
7
|
+
generateTest: false
|
|
8
|
+
addCredentials: false
|
|
9
|
+
azureSdkForJs: false
|
|
10
|
+
isCadlTest: true
|
|
11
|
+
title: ArrayItemTypesClient
|
|
12
|
+
packageDetails:
|
|
13
|
+
name: "@msinternal/array-itemtypes"
|
|
14
|
+
description: "Array item-types Test Service"
|
|
15
|
+
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
|
+
# AuthApiKey REST client library for JavaScript
|
|
2
|
+
|
|
3
|
+
Illustrates clients generated with ApiKey authentication.
|
|
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/auth-apikey)
|
|
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/auth-apikey` package
|
|
22
|
+
|
|
23
|
+
Install the AuthApiKey REST client REST client library for JavaScript with `npm`:
|
|
24
|
+
|
|
25
|
+
```bash
|
|
26
|
+
npm install @msinternal/auth-apikey
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Create and authenticate a `AuthApiKeyClient`
|
|
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/src/index.d.ts",
|
|
4
|
+
"docModel": { "enabled": true },
|
|
5
|
+
"apiReport": { "enabled": true, "reportFolder": "./review" },
|
|
6
|
+
"dtsRollup": {
|
|
7
|
+
"enabled": true,
|
|
8
|
+
"untrimmedFilePath": "",
|
|
9
|
+
"publicTrimmedFilePath": "./types/auth-apikey.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,133 @@
|
|
|
1
|
+
// Copyright (c) Microsoft Corporation.
|
|
2
|
+
// Licensed under the MIT license.
|
|
3
|
+
|
|
4
|
+
// https://github.com/karma-runner/karma-chrome-launcher
|
|
5
|
+
process.env.CHROME_BIN = require("puppeteer").executablePath();
|
|
6
|
+
require("dotenv").config();
|
|
7
|
+
const { relativeRecordingsPath } = require("@azure-tools/test-recorder");
|
|
8
|
+
process.env.RECORDINGS_RELATIVE_PATH = relativeRecordingsPath();
|
|
9
|
+
|
|
10
|
+
module.exports = function (config) {
|
|
11
|
+
config.set({
|
|
12
|
+
// base path that will be used to resolve all patterns (eg. files, exclude)
|
|
13
|
+
basePath: "./",
|
|
14
|
+
|
|
15
|
+
// frameworks to use
|
|
16
|
+
// available frameworks: https://npmjs.org/browse/keyword/karma-adapter
|
|
17
|
+
frameworks: ["source-map-support", "mocha"],
|
|
18
|
+
|
|
19
|
+
plugins: [
|
|
20
|
+
"karma-mocha",
|
|
21
|
+
"karma-mocha-reporter",
|
|
22
|
+
"karma-chrome-launcher",
|
|
23
|
+
"karma-firefox-launcher",
|
|
24
|
+
"karma-env-preprocessor",
|
|
25
|
+
"karma-coverage",
|
|
26
|
+
"karma-sourcemap-loader",
|
|
27
|
+
"karma-junit-reporter",
|
|
28
|
+
"karma-source-map-support",
|
|
29
|
+
],
|
|
30
|
+
|
|
31
|
+
// list of files / patterns to load in the browser
|
|
32
|
+
files: [
|
|
33
|
+
"dist-test/index.browser.js",
|
|
34
|
+
{
|
|
35
|
+
pattern: "dist-test/index.browser.js.map",
|
|
36
|
+
type: "html",
|
|
37
|
+
included: false,
|
|
38
|
+
served: true,
|
|
39
|
+
},
|
|
40
|
+
],
|
|
41
|
+
|
|
42
|
+
// list of files / patterns to exclude
|
|
43
|
+
exclude: [],
|
|
44
|
+
|
|
45
|
+
// preprocess matching files before serving them to the browser
|
|
46
|
+
// available preprocessors: https://npmjs.org/browse/keyword/karma-preprocessor
|
|
47
|
+
preprocessors: {
|
|
48
|
+
"**/*.js": ["sourcemap", "env"],
|
|
49
|
+
// IMPORTANT: COMMENT following line if you want to debug in your browsers!!
|
|
50
|
+
// Preprocess source file to calculate code coverage, however this will make source file unreadable
|
|
51
|
+
// "dist-test/index.js": ["coverage"]
|
|
52
|
+
},
|
|
53
|
+
|
|
54
|
+
envPreprocessor: [
|
|
55
|
+
"TEST_MODE",
|
|
56
|
+
"ENDPOINT",
|
|
57
|
+
"AZURE_CLIENT_SECRET",
|
|
58
|
+
"AZURE_CLIENT_ID",
|
|
59
|
+
"AZURE_TENANT_ID",
|
|
60
|
+
"SUBSCRIPTION_ID",
|
|
61
|
+
"RECORDINGS_RELATIVE_PATH",
|
|
62
|
+
],
|
|
63
|
+
|
|
64
|
+
// test results reporter to use
|
|
65
|
+
// possible values: 'dots', 'progress'
|
|
66
|
+
// available reporters: https://npmjs.org/browse/keyword/karma-reporter
|
|
67
|
+
reporters: ["mocha", "coverage", "junit"],
|
|
68
|
+
|
|
69
|
+
coverageReporter: {
|
|
70
|
+
// specify a common output directory
|
|
71
|
+
dir: "coverage-browser/",
|
|
72
|
+
reporters: [
|
|
73
|
+
{ type: "json", subdir: ".", file: "coverage.json" },
|
|
74
|
+
{ type: "lcovonly", subdir: ".", file: "lcov.info" },
|
|
75
|
+
{ type: "html", subdir: "html" },
|
|
76
|
+
{ type: "cobertura", subdir: ".", file: "cobertura-coverage.xml" },
|
|
77
|
+
],
|
|
78
|
+
},
|
|
79
|
+
|
|
80
|
+
junitReporter: {
|
|
81
|
+
outputDir: "", // results will be saved as $outputDir/$browserName.xml
|
|
82
|
+
outputFile: "test-results.browser.xml", // if included, results will be saved as $outputDir/$browserName/$outputFile
|
|
83
|
+
suite: "", // suite will become the package name attribute in xml testsuite element
|
|
84
|
+
useBrowserName: false, // add browser name to report and classes names
|
|
85
|
+
nameFormatter: undefined, // function (browser, result) to customize the name attribute in xml testcase element
|
|
86
|
+
classNameFormatter: undefined, // function (browser, result) to customize the classname attribute in xml testcase element
|
|
87
|
+
properties: {}, // key value pair of properties to add to the <properties> section of the report
|
|
88
|
+
},
|
|
89
|
+
|
|
90
|
+
// web server port
|
|
91
|
+
port: 9876,
|
|
92
|
+
|
|
93
|
+
// enable / disable colors in the output (reporters and logs)
|
|
94
|
+
colors: true,
|
|
95
|
+
|
|
96
|
+
// level of logging
|
|
97
|
+
// possible values: config.LOG_DISABLE || config.LOG_ERROR || config.LOG_WARN || config.LOG_INFO || config.LOG_DEBUG
|
|
98
|
+
logLevel: config.LOG_INFO,
|
|
99
|
+
|
|
100
|
+
// enable / disable watching file and executing tests whenever any file changes
|
|
101
|
+
autoWatch: false,
|
|
102
|
+
|
|
103
|
+
// --no-sandbox allows our tests to run in Linux without having to change the system.
|
|
104
|
+
// --disable-web-security allows us to authenticate from the browser without having to write tests using interactive auth, which would be far more complex.
|
|
105
|
+
browsers: ["ChromeHeadlessNoSandbox"],
|
|
106
|
+
customLaunchers: {
|
|
107
|
+
ChromeHeadlessNoSandbox: {
|
|
108
|
+
base: "ChromeHeadless",
|
|
109
|
+
flags: ["--no-sandbox", "--disable-web-security"],
|
|
110
|
+
},
|
|
111
|
+
},
|
|
112
|
+
|
|
113
|
+
// Continuous Integration mode
|
|
114
|
+
// if true, Karma captures browsers, runs the tests and exits
|
|
115
|
+
singleRun: false,
|
|
116
|
+
|
|
117
|
+
// Concurrency level
|
|
118
|
+
// how many browser should be started simultaneous
|
|
119
|
+
concurrency: 1,
|
|
120
|
+
|
|
121
|
+
browserNoActivityTimeout: 60000000,
|
|
122
|
+
browserDisconnectTimeout: 10000,
|
|
123
|
+
browserDisconnectTolerance: 3,
|
|
124
|
+
|
|
125
|
+
client: {
|
|
126
|
+
mocha: {
|
|
127
|
+
// change Karma's debug.html to the mocha web reporter
|
|
128
|
+
reporter: "html",
|
|
129
|
+
timeout: "600000",
|
|
130
|
+
},
|
|
131
|
+
},
|
|
132
|
+
});
|
|
133
|
+
};
|