@azure-tools/typespec-ts 0.13.0 → 0.13.1-alpha.20230609.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +8 -0
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +37 -1
- package/dist/src/index.js.map +1 -1
- package/dist/src/modelUtils.d.ts +2 -0
- package/dist/src/modelUtils.d.ts.map +1 -1
- package/dist/src/modelUtils.js +82 -13
- package/dist/src/modelUtils.js.map +1 -1
- package/dist/src/modular/buildApiIndex.d.ts.map +1 -1
- package/dist/src/modular/buildApiIndex.js +1 -1
- package/dist/src/modular/buildApiIndex.js.map +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.js +6 -6
- package/dist/src/modular/buildClassicalClient.js.map +1 -1
- package/dist/src/modular/buildClientContext.d.ts.map +1 -1
- package/dist/src/modular/buildClientContext.js +9 -3
- package/dist/src/modular/buildClientContext.js.map +1 -1
- package/dist/src/modular/buildCodeModel.d.ts.map +1 -1
- package/dist/src/modular/buildCodeModel.js +190 -169
- package/dist/src/modular/buildCodeModel.js.map +1 -1
- package/dist/src/modular/buildOperations.d.ts.map +1 -1
- package/dist/src/modular/buildOperations.js +20 -2
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/buildRootIndex.js +2 -2
- package/dist/src/modular/buildRootIndex.js.map +1 -1
- package/dist/src/modular/buildSharedTypes.d.ts.map +1 -1
- package/dist/src/modular/buildSharedTypes.js +8 -10
- package/dist/src/modular/buildSharedTypes.js.map +1 -1
- package/dist/src/modular/emitModels.d.ts.map +1 -1
- package/dist/src/modular/emitModels.js +19 -6
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.js +2 -11
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
- package/dist/src/modular/helpers/credentialHelpers.js +1 -1
- package/dist/src/modular/helpers/credentialHelpers.js.map +1 -1
- package/dist/src/modular/helpers/fixmeHelpers.d.ts +2 -0
- package/dist/src/modular/helpers/fixmeHelpers.d.ts.map +1 -0
- package/dist/src/modular/helpers/fixmeHelpers.js +4 -0
- package/dist/src/modular/helpers/fixmeHelpers.js.map +1 -0
- package/dist/src/modular/helpers/namingHelpers.d.ts +10 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.js +20 -0
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +2 -0
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +117 -35
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/parameterHelpers.js +1 -1
- package/dist/src/modular/helpers/parameterHelpers.js.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.js +31 -12
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
- package/dist/src/modular/modularCodeModel.d.ts +2 -1
- package/dist/src/modular/modularCodeModel.d.ts.map +1 -1
- package/dist/src/operationUtil.d.ts +1 -1
- package/dist/src/operationUtil.d.ts.map +1 -1
- package/dist/src/operationUtil.js +21 -3
- package/dist/src/operationUtil.js.map +1 -1
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/transform/transform.js +2 -2
- package/dist/src/transform/transform.js.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.js +9 -0
- package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.js +27 -1
- package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -1
- package/dist/src/transform/transformParameters.d.ts +1 -0
- package/dist/src/transform/transformParameters.d.ts.map +1 -1
- package/dist/src/transform/transformParameters.js +36 -35
- package/dist/src/transform/transformParameters.js.map +1 -1
- package/dist/src/transform/transformPaths.d.ts.map +1 -1
- package/dist/src/transform/transformPaths.js +9 -0
- package/dist/src/transform/transformPaths.js.map +1 -1
- package/dist/src/transform/transformResponses.d.ts.map +1 -1
- package/dist/src/transform/transformResponses.js +10 -1
- package/dist/src/transform/transformResponses.js.map +1 -1
- package/dist/src/transform/transformSchemas.d.ts.map +1 -1
- package/dist/src/transform/transformSchemas.js +9 -0
- package/dist/src/transform/transformSchemas.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +20 -15
- package/src/index.ts +47 -2
- package/src/modelUtils.ts +90 -15
- package/src/modular/buildApiIndex.ts +3 -1
- package/src/modular/buildClassicalClient.ts +8 -6
- package/src/modular/buildClientContext.ts +11 -3
- package/src/modular/buildCodeModel.ts +221 -196
- package/src/modular/buildOperations.ts +23 -1
- package/src/modular/buildRootIndex.ts +2 -2
- package/src/modular/buildSharedTypes.ts +8 -10
- package/src/modular/emitModels.ts +14 -0
- package/src/modular/helpers/clientHelpers.ts +3 -13
- package/src/modular/helpers/credentialHelpers.ts +1 -1
- package/src/modular/helpers/fixmeHelpers.ts +3 -0
- package/src/modular/helpers/namingHelpers.ts +35 -1
- package/src/modular/helpers/operationHelpers.ts +173 -66
- package/src/modular/helpers/parameterHelpers.ts +1 -1
- package/src/modular/helpers/typeHelpers.ts +33 -12
- package/src/modular/modularCodeModel.ts +3 -1
- package/src/operationUtil.ts +24 -3
- package/src/transform/transform.ts +4 -1
- package/src/transform/transformApiVersionInfo.ts +8 -0
- package/src/transform/transformHelperFunctionDetails.ts +25 -1
- package/src/transform/transformParameters.ts +52 -41
- package/src/transform/transformPaths.ts +8 -0
- package/src/transform/transformResponses.ts +9 -1
- package/src/transform/transformSchemas.ts +8 -0
- package/.eslintrc.json +0 -23
- package/.prettierignore +0 -1
- package/.prettierrc +0 -7
- package/.rush/temp/operation/build/all.log +0 -1
- package/.rush/temp/operation/build/state.json +0 -3
- package/.rush/temp/package-deps_build.json +0 -442
- package/.rush/temp/shrinkwrap-deps.json +0 -490
- package/CONTRIBUTING.md +0 -137
- package/test/commands/cadl-ranch-list.ts +0 -116
- package/test/commands/check-clean-tree.ts +0 -55
- package/test/commands/childProcessOnExit.ts +0 -16
- package/test/commands/gen-cadl-ranch.ts +0 -25
- package/test/commands/run.ts +0 -31
- package/test/integration/arrayItemTypes.spec.ts +0 -96
- package/test/integration/authApiKey.spec.ts +0 -38
- package/test/integration/authOauth2.spec.ts +0 -65
- package/test/integration/authUnion.spec.ts +0 -72
- package/test/integration/azurecore.spec.ts +0 -170
- package/test/integration/collectionFormat.spec.ts +0 -118
- package/test/integration/dictionary.spec.ts +0 -106
- package/test/integration/extensibleEnums.spec.ts +0 -61
- package/test/integration/fixedEnums.spec.ts +0 -52
- package/test/integration/generated/arrays/itemTypes/src/arrayItemTypesClient.ts +0 -35
- package/test/integration/generated/arrays/itemTypes/src/clientDefinitions.ts +0 -165
- package/test/integration/generated/arrays/itemTypes/src/index.ts +0 -13
- package/test/integration/generated/arrays/itemTypes/src/logger.ts +0 -5
- package/test/integration/generated/arrays/itemTypes/src/models.ts +0 -9
- package/test/integration/generated/arrays/itemTypes/src/outputModels.ts +0 -9
- package/test/integration/generated/arrays/itemTypes/src/parameters.ts +0 -86
- package/test/integration/generated/arrays/itemTypes/src/responses.ts +0 -115
- package/test/integration/generated/arrays/itemTypes/tspconfig.yaml +0 -15
- package/test/integration/generated/authentication/apiKey/.eslintrc.json +0 -11
- package/test/integration/generated/authentication/apiKey/README.md +0 -56
- package/test/integration/generated/authentication/apiKey/api-extractor.json +0 -18
- package/test/integration/generated/authentication/apiKey/karma.conf.js +0 -133
- package/test/integration/generated/authentication/apiKey/package.json +0 -103
- package/test/integration/generated/authentication/apiKey/rollup.config.js +0 -118
- package/test/integration/generated/authentication/apiKey/src/authApiKeyClient.ts +0 -45
- package/test/integration/generated/authentication/apiKey/src/clientDefinitions.ts +0 -33
- package/test/integration/generated/authentication/apiKey/src/index.ts +0 -12
- package/test/integration/generated/authentication/apiKey/src/logger.ts +0 -5
- package/test/integration/generated/authentication/apiKey/src/outputModels.ts +0 -6
- package/test/integration/generated/authentication/apiKey/src/parameters.ts +0 -7
- package/test/integration/generated/authentication/apiKey/src/responses.ts +0 -21
- package/test/integration/generated/authentication/apiKey/test/public/sampleTest.spec.ts +0 -23
- package/test/integration/generated/authentication/apiKey/test/public/utils/env.browser.ts +0 -2
- package/test/integration/generated/authentication/apiKey/test/public/utils/env.ts +0 -6
- package/test/integration/generated/authentication/apiKey/test/public/utils/recordedClient.ts +0 -29
- package/test/integration/generated/authentication/apiKey/tsconfig.json +0 -25
- package/test/integration/generated/authentication/apiKey/tspconfig.yaml +0 -13
- package/test/integration/generated/authentication/oauth2/karma.conf.js +0 -133
- package/test/integration/generated/authentication/oauth2/src/authOauth2Client.ts +0 -45
- package/test/integration/generated/authentication/oauth2/src/clientDefinitions.ts +0 -33
- package/test/integration/generated/authentication/oauth2/src/index.ts +0 -12
- package/test/integration/generated/authentication/oauth2/src/logger.ts +0 -5
- package/test/integration/generated/authentication/oauth2/src/outputModels.ts +0 -6
- package/test/integration/generated/authentication/oauth2/src/parameters.ts +0 -7
- package/test/integration/generated/authentication/oauth2/src/responses.ts +0 -21
- package/test/integration/generated/authentication/oauth2/test/public/sampleTest.spec.ts +0 -23
- package/test/integration/generated/authentication/oauth2/test/public/utils/env.browser.ts +0 -2
- package/test/integration/generated/authentication/oauth2/test/public/utils/env.ts +0 -6
- package/test/integration/generated/authentication/oauth2/test/public/utils/recordedClient.ts +0 -29
- package/test/integration/generated/authentication/oauth2/tspconfig.yaml +0 -15
- package/test/integration/generated/authentication/union/karma.conf.js +0 -133
- package/test/integration/generated/authentication/union/src/authUnionClient.ts +0 -46
- package/test/integration/generated/authentication/union/src/clientDefinitions.ts +0 -27
- package/test/integration/generated/authentication/union/src/index.ts +0 -11
- package/test/integration/generated/authentication/union/src/logger.ts +0 -5
- package/test/integration/generated/authentication/union/src/parameters.ts +0 -7
- package/test/integration/generated/authentication/union/src/responses.ts +0 -14
- package/test/integration/generated/authentication/union/test/public/sampleTest.spec.ts +0 -23
- package/test/integration/generated/authentication/union/test/public/utils/env.browser.ts +0 -2
- package/test/integration/generated/authentication/union/test/public/utils/env.ts +0 -6
- package/test/integration/generated/authentication/union/test/public/utils/recordedClient.ts +0 -29
- package/test/integration/generated/authentication/union/tspconfig.yaml +0 -15
- package/test/integration/generated/azure/core/.eslintrc.json +0 -11
- package/test/integration/generated/azure/core/README.md +0 -56
- package/test/integration/generated/azure/core/api-extractor.json +0 -18
- package/test/integration/generated/azure/core/package.json +0 -81
- package/test/integration/generated/azure/core/rollup.config.js +0 -118
- package/test/integration/generated/azure/core/src/azureCoreClient.ts +0 -35
- package/test/integration/generated/azure/core/src/clientDefinitions.ts +0 -108
- package/test/integration/generated/azure/core/src/index.ts +0 -16
- package/test/integration/generated/azure/core/src/isUnexpected.ts +0 -178
- package/test/integration/generated/azure/core/src/logger.ts +0 -5
- package/test/integration/generated/azure/core/src/models.ts +0 -18
- package/test/integration/generated/azure/core/src/outputModels.ts +0 -38
- package/test/integration/generated/azure/core/src/paginateHelper.ts +0 -204
- package/test/integration/generated/azure/core/src/parameters.ts +0 -68
- package/test/integration/generated/azure/core/src/responses.ts +0 -158
- package/test/integration/generated/azure/core/src/serializeHelper.ts +0 -16
- package/test/integration/generated/azure/core/tsconfig.json +0 -25
- package/test/integration/generated/azure/core/tspconfig.yaml +0 -15
- package/test/integration/generated/azure/core-traits/.eslintrc.json +0 -11
- package/test/integration/generated/azure/core-traits/README.md +0 -56
- package/test/integration/generated/azure/core-traits/api-extractor.json +0 -18
- package/test/integration/generated/azure/core-traits/package.json +0 -80
- package/test/integration/generated/azure/core-traits/rollup.config.js +0 -118
- package/test/integration/generated/azure/core-traits/src/azureCoreTraitsClient.ts +0 -35
- package/test/integration/generated/azure/core-traits/src/clientDefinitions.ts +0 -22
- package/test/integration/generated/azure/core-traits/src/index.ts +0 -13
- package/test/integration/generated/azure/core-traits/src/isUnexpected.ts +0 -97
- package/test/integration/generated/azure/core-traits/src/logger.ts +0 -5
- package/test/integration/generated/azure/core-traits/src/outputModels.ts +0 -25
- package/test/integration/generated/azure/core-traits/src/parameters.ts +0 -26
- package/test/integration/generated/azure/core-traits/src/responses.ts +0 -32
- package/test/integration/generated/azure/core-traits/tsconfig.json +0 -25
- package/test/integration/generated/azure/core-traits/tspconfig.yaml +0 -15
- package/test/integration/generated/dictionary/.eslintrc.json +0 -11
- package/test/integration/generated/dictionary/README.md +0 -56
- package/test/integration/generated/dictionary/api-extractor.json +0 -18
- package/test/integration/generated/dictionary/package.json +0 -80
- package/test/integration/generated/dictionary/rollup.config.js +0 -118
- package/test/integration/generated/dictionary/src/clientDefinitions.ts +0 -180
- package/test/integration/generated/dictionary/src/dictClient.ts +0 -33
- package/test/integration/generated/dictionary/src/index.ts +0 -13
- package/test/integration/generated/dictionary/src/logger.ts +0 -5
- package/test/integration/generated/dictionary/src/models.ts +0 -9
- package/test/integration/generated/dictionary/src/outputModels.ts +0 -9
- package/test/integration/generated/dictionary/src/parameters.ts +0 -94
- package/test/integration/generated/dictionary/src/responses.ts +0 -126
- package/test/integration/generated/dictionary/tsconfig.json +0 -25
- package/test/integration/generated/dictionary/tspconfig.yaml +0 -15
- package/test/integration/generated/enums/extensible/.eslintrc.json +0 -11
- package/test/integration/generated/enums/extensible/README.md +0 -56
- package/test/integration/generated/enums/extensible/api-extractor.json +0 -18
- package/test/integration/generated/enums/extensible/package.json +0 -80
- package/test/integration/generated/enums/extensible/rollup.config.js +0 -118
- package/test/integration/generated/enums/extensible/src/clientDefinitions.ts +0 -45
- package/test/integration/generated/enums/extensible/src/index.ts +0 -11
- package/test/integration/generated/enums/extensible/src/logger.ts +0 -5
- package/test/integration/generated/enums/extensible/src/parameters.ts +0 -23
- package/test/integration/generated/enums/extensible/src/responses.ts +0 -26
- package/test/integration/generated/enums/extensible/src/typeEnumExtensible.ts +0 -35
- package/test/integration/generated/enums/extensible/tsconfig.json +0 -25
- package/test/integration/generated/enums/extensible/tspconfig.yaml +0 -14
- package/test/integration/generated/enums/fixed/.eslintrc.json +0 -11
- package/test/integration/generated/enums/fixed/README.md +0 -56
- package/test/integration/generated/enums/fixed/api-extractor.json +0 -18
- package/test/integration/generated/enums/fixed/package.json +0 -80
- package/test/integration/generated/enums/fixed/rollup.config.js +0 -118
- package/test/integration/generated/enums/fixed/src/clientDefinitions.ts +0 -43
- package/test/integration/generated/enums/fixed/src/index.ts +0 -11
- package/test/integration/generated/enums/fixed/src/logger.ts +0 -5
- package/test/integration/generated/enums/fixed/src/parameters.ts +0 -36
- package/test/integration/generated/enums/fixed/src/responses.ts +0 -27
- package/test/integration/generated/enums/fixed/src/typeEnumFixed.ts +0 -35
- package/test/integration/generated/enums/fixed/tsconfig.json +0 -25
- package/test/integration/generated/enums/fixed/tspconfig.yaml +0 -14
- package/test/integration/generated/hello/.eslintrc.json +0 -11
- package/test/integration/generated/hello/README.md +0 -56
- package/test/integration/generated/hello/api-extractor.json +0 -18
- package/test/integration/generated/hello/package.json +0 -80
- package/test/integration/generated/hello/rollup.config.js +0 -118
- package/test/integration/generated/hello/src/clientDefinitions.ts +0 -19
- package/test/integration/generated/hello/src/hello.ts +0 -29
- package/test/integration/generated/hello/src/index.ts +0 -11
- package/test/integration/generated/hello/src/parameters.ts +0 -6
- package/test/integration/generated/hello/src/responses.ts +0 -10
- package/test/integration/generated/hello/tsconfig.json +0 -25
- package/test/integration/generated/hello/tspconfig.yaml +0 -14
- package/test/integration/generated/internal/src/clientDefinitions.ts +0 -53
- package/test/integration/generated/internal/src/index.ts +0 -12
- package/test/integration/generated/internal/src/internalClient.ts +0 -35
- package/test/integration/generated/internal/src/logger.ts +0 -5
- package/test/integration/generated/internal/src/outputModels.ts +0 -17
- package/test/integration/generated/internal/src/parameters.ts +0 -45
- package/test/integration/generated/internal/src/responses.ts +0 -33
- package/test/integration/generated/internal/tspconfig.yaml +0 -14
- package/test/integration/generated/lro/lroCore/.eslintrc.json +0 -11
- package/test/integration/generated/lro/lroCore/README.md +0 -56
- package/test/integration/generated/lro/lroCore/api-extractor.json +0 -18
- package/test/integration/generated/lro/lroCore/package.json +0 -82
- package/test/integration/generated/lro/lroCore/rollup.config.js +0 -118
- package/test/integration/generated/lro/lroCore/src/clientDefinitions.ts +0 -54
- package/test/integration/generated/lro/lroCore/src/index.ts +0 -15
- package/test/integration/generated/lro/lroCore/src/isUnexpected.ts +0 -135
- package/test/integration/generated/lro/lroCore/src/logger.ts +0 -5
- package/test/integration/generated/lro/lroCore/src/models.ts +0 -8
- package/test/integration/generated/lro/lroCore/src/outputModels.ts +0 -50
- package/test/integration/generated/lro/lroCore/src/parameters.ts +0 -25
- package/test/integration/generated/lro/lroCore/src/pollingHelper.ts +0 -113
- package/test/integration/generated/lro/lroCore/src/responses.ts +0 -109
- package/test/integration/generated/lro/lroCore/src/specsAzureCoreLroStandard.ts +0 -35
- package/test/integration/generated/lro/lroCore/tsconfig.json +0 -25
- package/test/integration/generated/lro/lroCore/tspconfig.yaml +0 -14
- package/test/integration/generated/lro/lroRPC/.eslintrc.json +0 -11
- package/test/integration/generated/lro/lroRPC/README.md +0 -56
- package/test/integration/generated/lro/lroRPC/api-extractor.json +0 -18
- package/test/integration/generated/lro/lroRPC/package.json +0 -82
- package/test/integration/generated/lro/lroRPC/rollup.config.js +0 -118
- package/test/integration/generated/lro/lroRPC/src/clientDefinitions.ts +0 -79
- package/test/integration/generated/lro/lroRPC/src/index.ts +0 -15
- package/test/integration/generated/lro/lroRPC/src/isUnexpected.ts +0 -153
- package/test/integration/generated/lro/lroRPC/src/logger.ts +0 -5
- package/test/integration/generated/lro/lroRPC/src/models.ts +0 -8
- package/test/integration/generated/lro/lroRPC/src/outputModels.ts +0 -40
- package/test/integration/generated/lro/lroRPC/src/parameters.ts +0 -20
- package/test/integration/generated/lro/lroRPC/src/pollingHelper.ts +0 -127
- package/test/integration/generated/lro/lroRPC/src/responses.ts +0 -124
- package/test/integration/generated/lro/lroRPC/src/specsAzureCoreLroRpc.ts +0 -35
- package/test/integration/generated/lro/lroRPC/tsconfig.json +0 -25
- package/test/integration/generated/lro/lroRPC/tspconfig.yaml +0 -14
- package/test/integration/generated/models/inheritance/.eslintrc.json +0 -11
- package/test/integration/generated/models/inheritance/README.md +0 -56
- package/test/integration/generated/models/inheritance/api-extractor.json +0 -18
- package/test/integration/generated/models/inheritance/package.json +0 -80
- package/test/integration/generated/models/inheritance/rollup.config.js +0 -118
- package/test/integration/generated/models/inheritance/src/clientDefinitions.ts +0 -81
- package/test/integration/generated/models/inheritance/src/index.ts +0 -13
- package/test/integration/generated/models/inheritance/src/logger.ts +0 -5
- package/test/integration/generated/models/inheritance/src/models.ts +0 -52
- package/test/integration/generated/models/inheritance/src/outputModels.ts +0 -52
- package/test/integration/generated/models/inheritance/src/parameters.ts +0 -35
- package/test/integration/generated/models/inheritance/src/responses.ts +0 -56
- package/test/integration/generated/models/inheritance/src/typeModelInheritance.ts +0 -35
- package/test/integration/generated/models/inheritance/tsconfig.json +0 -25
- package/test/integration/generated/models/inheritance/tspconfig.yaml +0 -14
- package/test/integration/generated/models/propertyNullable/.eslintrc.json +0 -11
- package/test/integration/generated/models/propertyNullable/README.md +0 -56
- package/test/integration/generated/models/propertyNullable/api-extractor.json +0 -18
- package/test/integration/generated/models/propertyNullable/package.json +0 -80
- package/test/integration/generated/models/propertyNullable/rollup.config.js +0 -118
- package/test/integration/generated/models/propertyNullable/src/clientDefinitions.ts +0 -227
- package/test/integration/generated/models/propertyNullable/src/index.ts +0 -13
- package/test/integration/generated/models/propertyNullable/src/logger.ts +0 -5
- package/test/integration/generated/models/propertyNullable/src/models.ts +0 -56
- package/test/integration/generated/models/propertyNullable/src/outputModels.ts +0 -56
- package/test/integration/generated/models/propertyNullable/src/parameters.ts +0 -197
- package/test/integration/generated/models/propertyNullable/src/responses.ts +0 -144
- package/test/integration/generated/models/propertyNullable/src/typePropertyNullable.ts +0 -35
- package/test/integration/generated/models/propertyNullable/tsconfig.json +0 -25
- package/test/integration/generated/models/propertyNullable/tspconfig.yaml +0 -14
- package/test/integration/generated/models/propertyOptional/.eslintrc.json +0 -11
- package/test/integration/generated/models/propertyOptional/README.md +0 -56
- package/test/integration/generated/models/propertyOptional/api-extractor.json +0 -18
- package/test/integration/generated/models/propertyOptional/package.json +0 -80
- package/test/integration/generated/models/propertyOptional/rollup.config.js +0 -118
- package/test/integration/generated/models/propertyOptional/src/clientDefinitions.ts +0 -263
- package/test/integration/generated/models/propertyOptional/src/index.ts +0 -13
- package/test/integration/generated/models/propertyOptional/src/logger.ts +0 -5
- package/test/integration/generated/models/propertyOptional/src/models.ts +0 -46
- package/test/integration/generated/models/propertyOptional/src/outputModels.ts +0 -46
- package/test/integration/generated/models/propertyOptional/src/parameters.ts +0 -125
- package/test/integration/generated/models/propertyOptional/src/responses.ts +0 -169
- package/test/integration/generated/models/propertyOptional/src/typePropertyOptional.ts +0 -35
- package/test/integration/generated/models/propertyOptional/tsconfig.json +0 -25
- package/test/integration/generated/models/propertyOptional/tspconfig.yaml +0 -14
- package/test/integration/generated/models/propertyTypes/.eslintrc.json +0 -11
- package/test/integration/generated/models/propertyTypes/README.md +0 -56
- package/test/integration/generated/models/propertyTypes/api-extractor.json +0 -18
- package/test/integration/generated/models/propertyTypes/package.json +0 -80
- package/test/integration/generated/models/propertyTypes/rollup.config.js +0 -118
- package/test/integration/generated/models/propertyTypes/src/clientDefinitions.ts +0 -310
- package/test/integration/generated/models/propertyTypes/src/index.ts +0 -13
- package/test/integration/generated/models/propertyTypes/src/logger.ts +0 -5
- package/test/integration/generated/models/propertyTypes/src/models.ts +0 -123
- package/test/integration/generated/models/propertyTypes/src/outputModels.ts +0 -123
- package/test/integration/generated/models/propertyTypes/src/parameters.ts +0 -189
- package/test/integration/generated/models/propertyTypes/src/responses.ts +0 -234
- package/test/integration/generated/models/propertyTypes/src/typePropertyValueTypes.ts +0 -35
- package/test/integration/generated/models/propertyTypes/tsconfig.json +0 -25
- package/test/integration/generated/models/propertyTypes/tspconfig.yaml +0 -14
- package/test/integration/generated/models/usage/.eslintrc.json +0 -11
- package/test/integration/generated/models/usage/README.md +0 -56
- package/test/integration/generated/models/usage/api-extractor.json +0 -18
- package/test/integration/generated/models/usage/package.json +0 -80
- package/test/integration/generated/models/usage/rollup.config.js +0 -118
- package/test/integration/generated/models/usage/src/clientDefinitions.ts +0 -41
- package/test/integration/generated/models/usage/src/index.ts +0 -13
- package/test/integration/generated/models/usage/src/logger.ts +0 -5
- package/test/integration/generated/models/usage/src/models.ts +0 -12
- package/test/integration/generated/models/usage/src/outputModels.ts +0 -12
- package/test/integration/generated/models/usage/src/parameters.ts +0 -19
- package/test/integration/generated/models/usage/src/responses.ts +0 -22
- package/test/integration/generated/models/usage/src/typeModelUsage.ts +0 -35
- package/test/integration/generated/models/usage/tsconfig.json +0 -25
- package/test/integration/generated/models/usage/tspconfig.yaml +0 -14
- package/test/integration/generated/models/visibility/.eslintrc.json +0 -11
- package/test/integration/generated/models/visibility/README.md +0 -56
- package/test/integration/generated/models/visibility/api-extractor.json +0 -18
- package/test/integration/generated/models/visibility/package.json +0 -80
- package/test/integration/generated/models/visibility/rollup.config.js +0 -118
- package/test/integration/generated/models/visibility/src/clientDefinitions.ts +0 -40
- package/test/integration/generated/models/visibility/src/index.ts +0 -13
- package/test/integration/generated/models/visibility/src/logger.ts +0 -5
- package/test/integration/generated/models/visibility/src/models.ts +0 -14
- package/test/integration/generated/models/visibility/src/outputModels.ts +0 -16
- package/test/integration/generated/models/visibility/src/parameters.ts +0 -41
- package/test/integration/generated/models/visibility/src/responses.ts +0 -36
- package/test/integration/generated/models/visibility/src/typeModelVisibility.ts +0 -35
- package/test/integration/generated/models/visibility/tsconfig.json +0 -25
- package/test/integration/generated/models/visibility/tspconfig.yaml +0 -14
- package/test/integration/generated/parameters/collection-format/src/clientDefinitions.ts +0 -63
- package/test/integration/generated/parameters/collection-format/src/collectionFormatClient.ts +0 -35
- package/test/integration/generated/parameters/collection-format/src/index.ts +0 -12
- package/test/integration/generated/parameters/collection-format/src/logger.ts +0 -5
- package/test/integration/generated/parameters/collection-format/src/parameters.ts +0 -71
- package/test/integration/generated/parameters/collection-format/src/responses.ts +0 -34
- package/test/integration/generated/parameters/collection-format/src/serializeHelper.ts +0 -28
- package/test/integration/generated/parameters/collection-format/tspconfig.yaml +0 -14
- package/test/integration/generated/parameters/spread/src/clientDefinitions.ts +0 -61
- package/test/integration/generated/parameters/spread/src/index.ts +0 -12
- package/test/integration/generated/parameters/spread/src/logger.ts +0 -5
- package/test/integration/generated/parameters/spread/src/models.ts +0 -7
- package/test/integration/generated/parameters/spread/src/parameters.ts +0 -61
- package/test/integration/generated/parameters/spread/src/parametersSpread.ts +0 -35
- package/test/integration/generated/parameters/spread/src/responses.ts +0 -25
- package/test/integration/generated/parameters/spread/tspconfig.yaml +0 -12
- package/test/integration/generated/projection/src/clientDefinitions.ts +0 -71
- package/test/integration/generated/projection/src/index.ts +0 -12
- package/test/integration/generated/projection/src/logger.ts +0 -5
- package/test/integration/generated/projection/src/models.ts +0 -22
- package/test/integration/generated/projection/src/parameters.ts +0 -48
- package/test/integration/generated/projection/src/projectionClient.ts +0 -35
- package/test/integration/generated/projection/src/responses.ts +0 -34
- package/test/integration/generated/projection/tspconfig.yaml +0 -14
- package/test/integration/generated/resiliency/srvDriven1/.eslintrc.json +0 -11
- package/test/integration/generated/resiliency/srvDriven1/README.md +0 -56
- package/test/integration/generated/resiliency/srvDriven1/api-extractor.json +0 -18
- package/test/integration/generated/resiliency/srvDriven1/package.json +0 -80
- package/test/integration/generated/resiliency/srvDriven1/rollup.config.js +0 -118
- package/test/integration/generated/resiliency/srvDriven1/src/clientDefinitions.ts +0 -46
- package/test/integration/generated/resiliency/srvDriven1/src/index.ts +0 -11
- package/test/integration/generated/resiliency/srvDriven1/src/logger.ts +0 -5
- package/test/integration/generated/resiliency/srvDriven1/src/parameters.ts +0 -30
- package/test/integration/generated/resiliency/srvDriven1/src/responses.ts +0 -19
- package/test/integration/generated/resiliency/srvDriven1/src/serviceDrivenOldClient.ts +0 -43
- package/test/integration/generated/resiliency/srvDriven1/tsconfig.json +0 -25
- package/test/integration/generated/resiliency/srvDriven1/tspconfig.yaml +0 -15
- package/test/integration/generated/resiliency/srvDriven2/.eslintrc.json +0 -11
- package/test/integration/generated/resiliency/srvDriven2/README.md +0 -65
- package/test/integration/generated/resiliency/srvDriven2/api-extractor.json +0 -18
- package/test/integration/generated/resiliency/srvDriven2/package.json +0 -80
- package/test/integration/generated/resiliency/srvDriven2/rollup.config.js +0 -118
- package/test/integration/generated/resiliency/srvDriven2/src/clientDefinitions.ts +0 -57
- package/test/integration/generated/resiliency/srvDriven2/src/index.ts +0 -11
- package/test/integration/generated/resiliency/srvDriven2/src/logger.ts +0 -5
- package/test/integration/generated/resiliency/srvDriven2/src/parameters.ts +0 -45
- package/test/integration/generated/resiliency/srvDriven2/src/responses.ts +0 -24
- package/test/integration/generated/resiliency/srvDriven2/src/serviceDrivenNewClient.ts +0 -43
- package/test/integration/generated/resiliency/srvDriven2/tsconfig.json +0 -25
- package/test/integration/generated/resiliency/srvDriven2/tspconfig.yaml +0 -15
- package/test/integration/generated/server/path/multiple/src/clientDefinitions.ts +0 -35
- package/test/integration/generated/server/path/multiple/src/index.ts +0 -11
- package/test/integration/generated/server/path/multiple/src/logger.ts +0 -5
- package/test/integration/generated/server/path/multiple/src/multipleParamInServerPathClient.ts +0 -43
- package/test/integration/generated/server/path/multiple/src/parameters.ts +0 -7
- package/test/integration/generated/server/path/multiple/src/responses.ts +0 -14
- package/test/integration/generated/server/path/multiple/tspconfig.yaml +0 -14
- package/test/integration/generated/server/path/single/src/clientDefinitions.ts +0 -19
- package/test/integration/generated/server/path/single/src/index.ts +0 -11
- package/test/integration/generated/server/path/single/src/logger.ts +0 -5
- package/test/integration/generated/server/path/single/src/parameters.ts +0 -6
- package/test/integration/generated/server/path/single/src/responses.ts +0 -9
- package/test/integration/generated/server/path/single/src/singleParamInServerPathClient.ts +0 -38
- package/test/integration/generated/server/path/single/tspconfig.yaml +0 -14
- package/test/integration/generated/specialWords/src/clientDefinitions.ts +0 -61
- package/test/integration/generated/specialWords/src/index.ts +0 -13
- package/test/integration/generated/specialWords/src/logger.ts +0 -5
- package/test/integration/generated/specialWords/src/models.ts +0 -17
- package/test/integration/generated/specialWords/src/outputModels.ts +0 -17
- package/test/integration/generated/specialWords/src/parameters.ts +0 -37
- package/test/integration/generated/specialWords/src/responses.ts +0 -31
- package/test/integration/generated/specialWords/src/specialWordsClient.ts +0 -35
- package/test/integration/generated/specialWords/tspconfig.yaml +0 -14
- package/test/integration/generated/unions/src/clientDefinitions.ts +0 -53
- package/test/integration/generated/unions/src/index.ts +0 -12
- package/test/integration/generated/unions/src/logger.ts +0 -5
- package/test/integration/generated/unions/src/models.ts +0 -27
- package/test/integration/generated/unions/src/parameters.ts +0 -34
- package/test/integration/generated/unions/src/responses.ts +0 -24
- package/test/integration/generated/unions/src/unionsClient.ts +0 -35
- package/test/integration/generated/unions/tspconfig.yaml +0 -14
- package/test/integration/internal.spec.ts +0 -76
- package/test/integration/lroCore.spec.ts +0 -89
- package/test/integration/modelInheritance.spec.ts +0 -192
- package/test/integration/modelPropertyNullable.spec.ts +0 -115
- package/test/integration/modelPropertyOptional.spec.ts +0 -362
- package/test/integration/modelPropertyType.spec.ts +0 -135
- package/test/integration/modelUsage.spec.ts +0 -47
- package/test/integration/projection.spec.ts +0 -102
- package/test/integration/resiliencyDpgCustomization.spec.ts +0 -147
- package/test/integration/server.spec.ts +0 -59
- package/test/integration/specialWords.spec.ts +0 -73
- package/test/integration/spreadParameters.spec.ts +0 -82
- package/test/integration/unions.spec.ts +0 -69
- package/test/tsconfig.json +0 -4
- package/test/unit/apiVersion.spec.ts +0 -400
- package/test/unit/azureCoreOperationsGenerator.spec.ts +0 -71
- package/test/unit/clientDefinitionGenerator.spec.ts +0 -73
- package/test/unit/clientFactoryGenerator.spec.ts +0 -404
- package/test/unit/docsGenerator.spec.ts +0 -201
- package/test/unit/modelsGenerator.spec.ts +0 -1529
- package/test/unit/parametersGenerator.spec.ts +0 -561
- package/test/unit/responsesGenerator.spec.ts +0 -462
- package/test/unit/spreadAndAlias.spec.ts +0 -200
- package/test/unit/util/emitUtil.ts +0 -166
- package/test/unit/util/testUtil.ts +0 -88
- package/test/util/customBearerTokenTestingPolicy.ts +0 -78
- package/test/util/matrix.ts +0 -48
- package/tsconfig.json +0 -36
- package/tsconfig.test.json +0 -7
- package/typespec-ts.build.log +0 -1
|
@@ -1,135 +0,0 @@
|
|
|
1
|
-
import TypePropertyValueTypesClientFactory, {
|
|
2
|
-
TypePropertyValueTypesClient
|
|
3
|
-
} from "./generated/models/propertyTypes/src/index.js";
|
|
4
|
-
import { assert } from "chai";
|
|
5
|
-
import { matrix } from "../util/matrix.js";
|
|
6
|
-
|
|
7
|
-
interface TypeDetail {
|
|
8
|
-
type: string;
|
|
9
|
-
defaultValue: any;
|
|
10
|
-
convertedToFn?: (_: any) => any;
|
|
11
|
-
}
|
|
12
|
-
|
|
13
|
-
const testedTypes: TypeDetail[] = [
|
|
14
|
-
{
|
|
15
|
-
type: "boolean",
|
|
16
|
-
defaultValue: true
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
type: "string",
|
|
20
|
-
defaultValue: "hello"
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
type: "bytes",
|
|
24
|
-
defaultValue: "aGVsbG8sIHdvcmxkIQ=="
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
type: "int",
|
|
28
|
-
defaultValue: 42
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
type: "float",
|
|
32
|
-
defaultValue: 42.42
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
type: "datetime",
|
|
36
|
-
defaultValue: "2022-08-26T18:38:00Z",
|
|
37
|
-
convertedToFn: (value: string) => new Date(value).toISOString()
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
type: "duration",
|
|
41
|
-
defaultValue: "P123DT22H14M12.011S"
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
type: "enum",
|
|
45
|
-
defaultValue: "ValueOne"
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
type: "extensible-enum",
|
|
49
|
-
defaultValue: "UnknownValue"
|
|
50
|
-
},
|
|
51
|
-
{
|
|
52
|
-
type: "model",
|
|
53
|
-
defaultValue: { property: "hello" }
|
|
54
|
-
},
|
|
55
|
-
{
|
|
56
|
-
type: "collections/string",
|
|
57
|
-
defaultValue: ["hello", "world"]
|
|
58
|
-
},
|
|
59
|
-
{
|
|
60
|
-
type: "collections/int",
|
|
61
|
-
defaultValue: [1, 2]
|
|
62
|
-
},
|
|
63
|
-
{
|
|
64
|
-
type: "collections/model",
|
|
65
|
-
defaultValue: [{ property: "hello" }, { property: "world" }]
|
|
66
|
-
},
|
|
67
|
-
{
|
|
68
|
-
type: "dictionary/string",
|
|
69
|
-
defaultValue: { k1: "hello", k2: "world" }
|
|
70
|
-
},
|
|
71
|
-
{
|
|
72
|
-
type: "never",
|
|
73
|
-
defaultValue: undefined
|
|
74
|
-
},
|
|
75
|
-
{
|
|
76
|
-
type: "unknown/string",
|
|
77
|
-
defaultValue: "hello"
|
|
78
|
-
},
|
|
79
|
-
{
|
|
80
|
-
type: "unknown/int",
|
|
81
|
-
defaultValue: 42
|
|
82
|
-
},
|
|
83
|
-
{
|
|
84
|
-
type: "unknown/dict",
|
|
85
|
-
defaultValue: { k1: "hello", k2: 42 }
|
|
86
|
-
},
|
|
87
|
-
{
|
|
88
|
-
type: "unknown/array",
|
|
89
|
-
defaultValue: ["hello", "world"]
|
|
90
|
-
}
|
|
91
|
-
];
|
|
92
|
-
describe("ModelsPropertyTypesClient Rest Client", () => {
|
|
93
|
-
let client: TypePropertyValueTypesClient;
|
|
94
|
-
|
|
95
|
-
beforeEach(() => {
|
|
96
|
-
client = TypePropertyValueTypesClientFactory({
|
|
97
|
-
allowInsecureConnection: true
|
|
98
|
-
});
|
|
99
|
-
});
|
|
100
|
-
|
|
101
|
-
matrix([testedTypes], async (params: TypeDetail) => {
|
|
102
|
-
it(`should get a ${params.type} value`, async () => {
|
|
103
|
-
try {
|
|
104
|
-
const result = await client
|
|
105
|
-
.path(`/type/property/value-types/${params.type}` as any)
|
|
106
|
-
.get();
|
|
107
|
-
assert.strictEqual(result.status, "200");
|
|
108
|
-
assert.deepEqual(result.body.property, params.defaultValue);
|
|
109
|
-
} catch (err) {
|
|
110
|
-
assert.fail(err as string);
|
|
111
|
-
}
|
|
112
|
-
});
|
|
113
|
-
|
|
114
|
-
it(`should put a ${params.type} value`, async () => {
|
|
115
|
-
try {
|
|
116
|
-
let property;
|
|
117
|
-
if (params.convertedToFn) {
|
|
118
|
-
property = params.convertedToFn(params.defaultValue);
|
|
119
|
-
} else {
|
|
120
|
-
property = params.defaultValue;
|
|
121
|
-
}
|
|
122
|
-
const result = await client
|
|
123
|
-
.path(`/type/property/value-types/${params.type}` as any)
|
|
124
|
-
.put({
|
|
125
|
-
body: {
|
|
126
|
-
property
|
|
127
|
-
}
|
|
128
|
-
});
|
|
129
|
-
assert.strictEqual(result.status, "204");
|
|
130
|
-
} catch (err) {
|
|
131
|
-
assert.fail(err as string);
|
|
132
|
-
}
|
|
133
|
-
});
|
|
134
|
-
});
|
|
135
|
-
});
|
|
@@ -1,47 +0,0 @@
|
|
|
1
|
-
import TypeModelUsageClientFactory, {
|
|
2
|
-
TypeModelUsageClient
|
|
3
|
-
} from "./generated/models/usage/src/index.js";
|
|
4
|
-
import { assert } from "chai";
|
|
5
|
-
describe("ModelsUsageClient Rest Client", () => {
|
|
6
|
-
let client: TypeModelUsageClient;
|
|
7
|
-
const body = {
|
|
8
|
-
requiredProp: "example-value"
|
|
9
|
-
};
|
|
10
|
-
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
client = TypeModelUsageClientFactory({ allowInsecureConnection: true });
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it("should post input model correctly", async () => {
|
|
16
|
-
try {
|
|
17
|
-
const result = await client.path("/type/model/usage/input").post({
|
|
18
|
-
body
|
|
19
|
-
});
|
|
20
|
-
assert.strictEqual(result.status, "204");
|
|
21
|
-
} catch (err) {
|
|
22
|
-
assert.fail(err as string);
|
|
23
|
-
}
|
|
24
|
-
});
|
|
25
|
-
|
|
26
|
-
it("should get output model correctly", async () => {
|
|
27
|
-
try {
|
|
28
|
-
const result = await client.path("/type/model/usage/output").get();
|
|
29
|
-
assert.strictEqual(result.status, "200");
|
|
30
|
-
assert.deepEqual(result.body, body);
|
|
31
|
-
} catch (err) {
|
|
32
|
-
assert.fail(err as string);
|
|
33
|
-
}
|
|
34
|
-
});
|
|
35
|
-
|
|
36
|
-
it("should get output model correctly", async () => {
|
|
37
|
-
try {
|
|
38
|
-
const result = await client
|
|
39
|
-
.path("/type/model/usage/input-output")
|
|
40
|
-
.post({ body });
|
|
41
|
-
assert.strictEqual(result.status, "200");
|
|
42
|
-
assert.deepEqual(result.body, body);
|
|
43
|
-
} catch (err) {
|
|
44
|
-
assert.fail(err as string);
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
});
|
|
@@ -1,102 +0,0 @@
|
|
|
1
|
-
import { assert } from "chai";
|
|
2
|
-
import ProjectionClientFactory, {
|
|
3
|
-
ProjectionClient
|
|
4
|
-
} from "./generated/projection/src/index.js";
|
|
5
|
-
describe("Projected Name Rest Client", () => {
|
|
6
|
-
let client: ProjectionClient;
|
|
7
|
-
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
client = ProjectionClientFactory({
|
|
10
|
-
allowInsecureConnection: true,
|
|
11
|
-
retryOptions: {
|
|
12
|
-
maxRetries: 0
|
|
13
|
-
}
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
it("should respect json projection", async () => {
|
|
18
|
-
try {
|
|
19
|
-
const result = await client
|
|
20
|
-
.path("/projection/projected-name/property/json")
|
|
21
|
-
.post({
|
|
22
|
-
body: {
|
|
23
|
-
wireName: true
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
assert.strictEqual(result.status, "204");
|
|
27
|
-
} catch (err) {
|
|
28
|
-
assert.fail(err as string);
|
|
29
|
-
}
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
it("should not respect client projection", async () => {
|
|
33
|
-
try {
|
|
34
|
-
const result = await client
|
|
35
|
-
.path("/projection/projected-name/property/client")
|
|
36
|
-
.post({
|
|
37
|
-
body: {
|
|
38
|
-
defaultName: true
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
assert.strictEqual(result.status, "204");
|
|
42
|
-
} catch (err) {
|
|
43
|
-
assert.fail(err as string);
|
|
44
|
-
}
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
it("should not respect language projection", async () => {
|
|
48
|
-
try {
|
|
49
|
-
const result = await client
|
|
50
|
-
.path("/projection/projected-name/property/language")
|
|
51
|
-
.post({
|
|
52
|
-
body: {
|
|
53
|
-
defaultName: true
|
|
54
|
-
}
|
|
55
|
-
});
|
|
56
|
-
assert.strictEqual(result.status, "204");
|
|
57
|
-
} catch (err) {
|
|
58
|
-
assert.fail(err as string);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it("should not respect language projection", async () => {
|
|
63
|
-
try {
|
|
64
|
-
const result = await client
|
|
65
|
-
.path("/projection/projected-name/property/json-and-client")
|
|
66
|
-
.post({
|
|
67
|
-
body: {
|
|
68
|
-
wireName: true
|
|
69
|
-
}
|
|
70
|
-
});
|
|
71
|
-
assert.strictEqual(result.status, "204");
|
|
72
|
-
} catch (err) {
|
|
73
|
-
assert.fail(err as string);
|
|
74
|
-
}
|
|
75
|
-
});
|
|
76
|
-
|
|
77
|
-
it("should not respect operation projection", async () => {
|
|
78
|
-
try {
|
|
79
|
-
const result = await client
|
|
80
|
-
.path("/projection/projected-name/operation")
|
|
81
|
-
.post();
|
|
82
|
-
assert.strictEqual(result.status, "204");
|
|
83
|
-
} catch (err) {
|
|
84
|
-
assert.fail(err as string);
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
|
|
88
|
-
it("should not respect operation projection", async () => {
|
|
89
|
-
try {
|
|
90
|
-
const result = await client
|
|
91
|
-
.path("/projection/projected-name/parameter")
|
|
92
|
-
.post({
|
|
93
|
-
queryParameters: {
|
|
94
|
-
"default-name": "true"
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
assert.strictEqual(result.status, "204");
|
|
98
|
-
} catch (err) {
|
|
99
|
-
assert.fail(err as string);
|
|
100
|
-
}
|
|
101
|
-
});
|
|
102
|
-
});
|
|
@@ -1,147 +0,0 @@
|
|
|
1
|
-
import { assert } from "chai";
|
|
2
|
-
import ServiceDrivenOldClientFactory, {
|
|
3
|
-
ServiceDrivenOldClient
|
|
4
|
-
} from "./generated/resiliency/srvDriven1/src/index.js";
|
|
5
|
-
import ServiceDrivenNewClientFactory, {
|
|
6
|
-
ServiceDrivenNewClient
|
|
7
|
-
} from "./generated/resiliency/srvDriven2/src/index.js";
|
|
8
|
-
describe("ResiliencyDevDrivenClient Rest Client", () => {
|
|
9
|
-
let client11: ServiceDrivenOldClient;
|
|
10
|
-
let client12: ServiceDrivenOldClient;
|
|
11
|
-
let client21: ServiceDrivenNewClient;
|
|
12
|
-
let client22: ServiceDrivenNewClient;
|
|
13
|
-
|
|
14
|
-
beforeEach(() => {
|
|
15
|
-
client11 = ServiceDrivenOldClientFactory("v1", {
|
|
16
|
-
allowInsecureConnection: true,
|
|
17
|
-
apiVersion: "v1"
|
|
18
|
-
});
|
|
19
|
-
client12 = ServiceDrivenOldClientFactory("v2", {
|
|
20
|
-
allowInsecureConnection: true,
|
|
21
|
-
apiVersion: "v1"
|
|
22
|
-
});
|
|
23
|
-
client21 = ServiceDrivenNewClientFactory("v2", {
|
|
24
|
-
allowInsecureConnection: true,
|
|
25
|
-
apiVersion: "v1"
|
|
26
|
-
});
|
|
27
|
-
client22 = ServiceDrivenNewClientFactory("v2", {
|
|
28
|
-
allowInsecureConnection: true,
|
|
29
|
-
apiVersion: "v2"
|
|
30
|
-
});
|
|
31
|
-
});
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
describe("resiliency with service driven", () => {
|
|
35
|
-
it("should work with none parameter", async () => {
|
|
36
|
-
const result11 = await client11
|
|
37
|
-
.path("/add-optional-param/from-none")
|
|
38
|
-
.head();
|
|
39
|
-
|
|
40
|
-
assert.equal(result11.status, "204");
|
|
41
|
-
const result12 = await client12
|
|
42
|
-
.path("/add-optional-param/from-none")
|
|
43
|
-
.head();
|
|
44
|
-
|
|
45
|
-
assert.equal(result12.status, "204");
|
|
46
|
-
const result21 = await client21.path("/add-optional-param/from-none").head({
|
|
47
|
-
queryParameters: {
|
|
48
|
-
"new-parameter": "new"
|
|
49
|
-
}
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
assert.equal(result21.status, "204");
|
|
53
|
-
const result22 = await client22.path("/add-optional-param/from-none").head({
|
|
54
|
-
queryParameters: {
|
|
55
|
-
"new-parameter": "new"
|
|
56
|
-
}
|
|
57
|
-
});
|
|
58
|
-
|
|
59
|
-
assert.equal(result22.status, "204");
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it("should work with one optional parameter", async () => {
|
|
63
|
-
const result11 = await client11
|
|
64
|
-
.path("/add-optional-param/from-one-optional")
|
|
65
|
-
.get({
|
|
66
|
-
queryParameters: {
|
|
67
|
-
parameter: "optional"
|
|
68
|
-
}
|
|
69
|
-
});
|
|
70
|
-
assert.equal(result11.status, "204");
|
|
71
|
-
const result12 = await client12
|
|
72
|
-
.path("/add-optional-param/from-one-optional")
|
|
73
|
-
.get({
|
|
74
|
-
queryParameters: {
|
|
75
|
-
parameter: "optional"
|
|
76
|
-
}
|
|
77
|
-
});
|
|
78
|
-
assert.equal(result12.status, "204");
|
|
79
|
-
const result21 = await client21
|
|
80
|
-
.path("/add-optional-param/from-one-optional")
|
|
81
|
-
.get({
|
|
82
|
-
queryParameters: {
|
|
83
|
-
parameter: "optional",
|
|
84
|
-
"new-parameter": "new"
|
|
85
|
-
}
|
|
86
|
-
});
|
|
87
|
-
assert.equal(result21.status, "204");
|
|
88
|
-
const result22 = await client22
|
|
89
|
-
.path("/add-optional-param/from-one-optional")
|
|
90
|
-
.get({
|
|
91
|
-
queryParameters: {
|
|
92
|
-
parameter: "optional",
|
|
93
|
-
"new-parameter": "new"
|
|
94
|
-
}
|
|
95
|
-
});
|
|
96
|
-
assert.equal(result22.status, "204");
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it("should work with one required parameter", async () => {
|
|
100
|
-
const result11 = await client11
|
|
101
|
-
.path("/add-optional-param/from-one-required")
|
|
102
|
-
.get({
|
|
103
|
-
queryParameters: {
|
|
104
|
-
parameter: "required"
|
|
105
|
-
}
|
|
106
|
-
});
|
|
107
|
-
assert.equal(result11.status, "204");
|
|
108
|
-
const result12 = await client12
|
|
109
|
-
.path("/add-optional-param/from-one-required")
|
|
110
|
-
.get({
|
|
111
|
-
queryParameters: {
|
|
112
|
-
parameter: "required"
|
|
113
|
-
}
|
|
114
|
-
});
|
|
115
|
-
assert.equal(result12.status, "204");
|
|
116
|
-
const result21 = await client21
|
|
117
|
-
.path("/add-optional-param/from-one-required")
|
|
118
|
-
.get({
|
|
119
|
-
queryParameters: {
|
|
120
|
-
parameter: "required",
|
|
121
|
-
"new-parameter": "new"
|
|
122
|
-
}
|
|
123
|
-
});
|
|
124
|
-
assert.equal(result21.status, "204");
|
|
125
|
-
const result22 = await client22
|
|
126
|
-
.path("/add-optional-param/from-one-required")
|
|
127
|
-
.get({
|
|
128
|
-
queryParameters: {
|
|
129
|
-
parameter: "required",
|
|
130
|
-
"new-parameter": "new"
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
assert.equal(result22.status, "204");
|
|
134
|
-
});
|
|
135
|
-
});
|
|
136
|
-
|
|
137
|
-
it("should work with add operation", async () => {
|
|
138
|
-
const client122 = ServiceDrivenOldClientFactory("v2", {
|
|
139
|
-
allowInsecureConnection: true,
|
|
140
|
-
apiVersion: "v2"
|
|
141
|
-
});
|
|
142
|
-
const result122 = await client122.pathUnchecked("/add-operation").delete();
|
|
143
|
-
assert.equal(result122.status, "204");
|
|
144
|
-
const result22 = await client22.path("/add-operation").delete()
|
|
145
|
-
assert.equal(result22.status, "204");
|
|
146
|
-
});
|
|
147
|
-
});
|
|
@@ -1,59 +0,0 @@
|
|
|
1
|
-
import { assert } from "chai";
|
|
2
|
-
import SingleParamInServerPathClientFactory, {
|
|
3
|
-
SingleParamInServerPathClient
|
|
4
|
-
} from "./generated/server/path/single/src/index.js";
|
|
5
|
-
import MultipleParamInServerPathClientFactory, {
|
|
6
|
-
MultipleParamInServerPathClient
|
|
7
|
-
} from "./generated/server/path/multiple/src/index.js";
|
|
8
|
-
describe("SingleParamInServerPath Rest Client", () => {
|
|
9
|
-
let client: SingleParamInServerPathClient;
|
|
10
|
-
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
client = SingleParamInServerPathClientFactory("http://localhost:3000", {
|
|
13
|
-
allowInsecureConnection: true,
|
|
14
|
-
retryOptions: {
|
|
15
|
-
maxRetries: 0
|
|
16
|
-
}
|
|
17
|
-
});
|
|
18
|
-
});
|
|
19
|
-
|
|
20
|
-
it("should work with no param", async () => {
|
|
21
|
-
try {
|
|
22
|
-
const result = await client.path("/server/path/single/myOp").head();
|
|
23
|
-
assert.strictEqual(result.status, "200");
|
|
24
|
-
} catch (err) {
|
|
25
|
-
assert.fail(err as string);
|
|
26
|
-
}
|
|
27
|
-
});
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
describe("MultipleParamInServerPath Rest Client", () => {
|
|
31
|
-
let client: MultipleParamInServerPathClient;
|
|
32
|
-
|
|
33
|
-
beforeEach(() => {
|
|
34
|
-
client = MultipleParamInServerPathClientFactory("http://localhost:3000", {
|
|
35
|
-
allowInsecureConnection: true,
|
|
36
|
-
retryOptions: {
|
|
37
|
-
maxRetries: 0
|
|
38
|
-
}
|
|
39
|
-
});
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it("should work with no param", async () => {
|
|
43
|
-
try {
|
|
44
|
-
const result = await client.path("/").get();
|
|
45
|
-
assert.strictEqual(result.status, "204");
|
|
46
|
-
} catch (err) {
|
|
47
|
-
assert.fail(err as string);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it("should work with param", async () => {
|
|
52
|
-
try {
|
|
53
|
-
const result = await client.path("/{keyword}", "test").get();
|
|
54
|
-
assert.strictEqual(result.status, "204");
|
|
55
|
-
} catch (err) {
|
|
56
|
-
assert.fail(err as string);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
});
|
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
import SpecialWordsClientFactory, {
|
|
2
|
-
DerivedModel,
|
|
3
|
-
SpecialWordsClient
|
|
4
|
-
} from "./generated/specialWords/src/index.js";
|
|
5
|
-
import { assert } from "chai";
|
|
6
|
-
describe("HelloClient Rest Client", () => {
|
|
7
|
-
let client: SpecialWordsClient;
|
|
8
|
-
const modelValue: DerivedModel = {
|
|
9
|
-
"model.kind": "derived",
|
|
10
|
-
"derived.name": "my.name",
|
|
11
|
-
for: "value"
|
|
12
|
-
};
|
|
13
|
-
|
|
14
|
-
beforeEach(() => {
|
|
15
|
-
client = SpecialWordsClientFactory({ allowInsecureConnection: true });
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
it("should get special words for operation `for`", async () => {
|
|
19
|
-
try {
|
|
20
|
-
const result = await client.path("/special-words/operation/for").get();
|
|
21
|
-
assert.strictEqual(result.status, "204");
|
|
22
|
-
} catch (err) {
|
|
23
|
-
assert.fail(err as string);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it("should get special words for parameter `if`", async () => {
|
|
28
|
-
try {
|
|
29
|
-
const result = await client.path("/special-words/parameter/if").get({
|
|
30
|
-
headers: {
|
|
31
|
-
if: "weekend"
|
|
32
|
-
}
|
|
33
|
-
});
|
|
34
|
-
assert.strictEqual(result.status, "204");
|
|
35
|
-
} catch (err) {
|
|
36
|
-
assert.fail(err as string);
|
|
37
|
-
}
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it("should get special words for parameter `filter`", async () => {
|
|
41
|
-
try {
|
|
42
|
-
const result = await client.path("/special-words/parameter/filter").get({
|
|
43
|
-
queryParameters: {
|
|
44
|
-
filter: "abc*."
|
|
45
|
-
}
|
|
46
|
-
});
|
|
47
|
-
assert.strictEqual(result.status, "204");
|
|
48
|
-
} catch (err) {
|
|
49
|
-
assert.fail(err as string);
|
|
50
|
-
}
|
|
51
|
-
});
|
|
52
|
-
|
|
53
|
-
it("should get special words for model", async () => {
|
|
54
|
-
try {
|
|
55
|
-
const result = await client.path("/special-words/model/get").get();
|
|
56
|
-
assert.strictEqual(result.status, "200");
|
|
57
|
-
assert.deepEqual(result.body, modelValue);
|
|
58
|
-
} catch (err) {
|
|
59
|
-
assert.fail(err as string);
|
|
60
|
-
}
|
|
61
|
-
});
|
|
62
|
-
|
|
63
|
-
it("should put special words for model", async () => {
|
|
64
|
-
try {
|
|
65
|
-
const result = await client.path("/special-words/model/put").put({
|
|
66
|
-
body: modelValue
|
|
67
|
-
});
|
|
68
|
-
assert.strictEqual(result.status, "204");
|
|
69
|
-
} catch (err) {
|
|
70
|
-
assert.fail(err as string);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
});
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import ParametersSpreadClientFactory, {
|
|
2
|
-
ParametersSpreadClient
|
|
3
|
-
} from "./generated/parameters/spread/src/index.js";
|
|
4
|
-
import { assert } from "chai";
|
|
5
|
-
describe("HelloClient Rest Client", () => {
|
|
6
|
-
let client: ParametersSpreadClient;
|
|
7
|
-
|
|
8
|
-
beforeEach(() => {
|
|
9
|
-
client = ParametersSpreadClientFactory({ allowInsecureConnection: true });
|
|
10
|
-
});
|
|
11
|
-
|
|
12
|
-
it("should spread named model", async () => {
|
|
13
|
-
try {
|
|
14
|
-
const result = await client
|
|
15
|
-
.path("/parameters/spread/model/request-body")
|
|
16
|
-
.put({
|
|
17
|
-
body: {
|
|
18
|
-
name: "foo"
|
|
19
|
-
}
|
|
20
|
-
});
|
|
21
|
-
assert.strictEqual(result.status, "204");
|
|
22
|
-
} catch (err) {
|
|
23
|
-
assert.fail(err as string);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it("should spread alias with only body param", async () => {
|
|
28
|
-
try {
|
|
29
|
-
const result = await client
|
|
30
|
-
.path("/parameters/spread/alias/request-body")
|
|
31
|
-
.put({
|
|
32
|
-
body: {
|
|
33
|
-
name: "foo"
|
|
34
|
-
}
|
|
35
|
-
});
|
|
36
|
-
assert.strictEqual(result.status, "204");
|
|
37
|
-
} catch (err) {
|
|
38
|
-
assert.fail(err as string);
|
|
39
|
-
}
|
|
40
|
-
});
|
|
41
|
-
|
|
42
|
-
it("should spread alias with mixed params", async () => {
|
|
43
|
-
try {
|
|
44
|
-
const result = await client
|
|
45
|
-
.path("/parameters/spread/alias/request-parameter/{id}", "1")
|
|
46
|
-
.put({
|
|
47
|
-
body: {
|
|
48
|
-
name: "foo"
|
|
49
|
-
},
|
|
50
|
-
headers: {
|
|
51
|
-
"x-ms-test-header": "bar"
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
assert.strictEqual(result.status, "204");
|
|
55
|
-
} catch (err) {
|
|
56
|
-
assert.fail(err as string);
|
|
57
|
-
}
|
|
58
|
-
});
|
|
59
|
-
|
|
60
|
-
it("should spread alias with more than 5 params", async () => {
|
|
61
|
-
try {
|
|
62
|
-
const result = await client
|
|
63
|
-
.path("/parameters/spread/alias/multiple-parameters/{id}", "1")
|
|
64
|
-
.put({
|
|
65
|
-
body: {
|
|
66
|
-
prop1: "foo1",
|
|
67
|
-
prop2: "foo2",
|
|
68
|
-
prop3: "foo3",
|
|
69
|
-
prop4: "foo4",
|
|
70
|
-
prop5: "foo5",
|
|
71
|
-
prop6: "foo6"
|
|
72
|
-
},
|
|
73
|
-
headers: {
|
|
74
|
-
"x-ms-test-header": "bar"
|
|
75
|
-
}
|
|
76
|
-
});
|
|
77
|
-
assert.strictEqual(result.status, "204");
|
|
78
|
-
} catch (err) {
|
|
79
|
-
assert.fail(err as string);
|
|
80
|
-
}
|
|
81
|
-
});
|
|
82
|
-
});
|