@azure-tools/typespec-ts 0.13.0 → 0.13.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 +19 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.js +99 -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 +18 -0
- package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -1
- package/dist/src/transform/transformParameters.d.ts.map +1 -1
- package/dist/src/transform/transformParameters.js +27 -34
- 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 +14 -7
- 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 +121 -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 +16 -0
- package/src/transform/transformParameters.ts +42 -40
- 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,192 +0,0 @@
|
|
|
1
|
-
import TypeModelInheritanceClientFactory, {
|
|
2
|
-
TypeModelInheritanceClient,
|
|
3
|
-
Salmon,
|
|
4
|
-
SharkOutput
|
|
5
|
-
} from "./generated/models/inheritance/src/index.js";
|
|
6
|
-
import { assert } from "chai";
|
|
7
|
-
|
|
8
|
-
describe("ModelsInheritance Rest Client", () => {
|
|
9
|
-
let client: TypeModelInheritanceClient;
|
|
10
|
-
|
|
11
|
-
beforeEach(() => {
|
|
12
|
-
client = TypeModelInheritanceClientFactory({
|
|
13
|
-
allowInsecureConnection: true
|
|
14
|
-
});
|
|
15
|
-
});
|
|
16
|
-
|
|
17
|
-
const validBody = { name: "abc", age: 32, smart: true };
|
|
18
|
-
it("should get valid", async () => {
|
|
19
|
-
try {
|
|
20
|
-
const result = await client.path("/type/model/inheritance/valid").get();
|
|
21
|
-
assert.strictEqual(result.status, "200");
|
|
22
|
-
assert.strictEqual(result.body.age, 32);
|
|
23
|
-
assert.strictEqual(result.body.name, "abc");
|
|
24
|
-
assert.strictEqual(result.body.smart, true);
|
|
25
|
-
} catch (err) {
|
|
26
|
-
assert.fail(err as string);
|
|
27
|
-
}
|
|
28
|
-
});
|
|
29
|
-
|
|
30
|
-
it("should put valid", async () => {
|
|
31
|
-
try {
|
|
32
|
-
const result = await client.path("/type/model/inheritance/valid").put({
|
|
33
|
-
body: validBody
|
|
34
|
-
});
|
|
35
|
-
assert.strictEqual(result.status, "200");
|
|
36
|
-
assert.strictEqual(result.body.age, 32);
|
|
37
|
-
assert.strictEqual(result.body.name, "abc");
|
|
38
|
-
assert.strictEqual(result.body.smart, true);
|
|
39
|
-
} catch (err) {
|
|
40
|
-
assert.fail(err as string);
|
|
41
|
-
}
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it("should post valid", async () => {
|
|
45
|
-
try {
|
|
46
|
-
const result = await client.path("/type/model/inheritance/valid").post({
|
|
47
|
-
body: validBody
|
|
48
|
-
});
|
|
49
|
-
assert.strictEqual(result.status, "200");
|
|
50
|
-
} catch (err) {
|
|
51
|
-
assert.fail(err as string);
|
|
52
|
-
}
|
|
53
|
-
});
|
|
54
|
-
|
|
55
|
-
it("should get polymorphic body", async () => {
|
|
56
|
-
try {
|
|
57
|
-
const result = await client
|
|
58
|
-
.path("/type/model/inheritance/discriminated/model")
|
|
59
|
-
.get();
|
|
60
|
-
assert.strictEqual(result.status, "200");
|
|
61
|
-
assert.strictEqual(result.body.age, 1);
|
|
62
|
-
assert.strictEqual(result.body.kind, "shark");
|
|
63
|
-
assert.strictEqual((result.body as SharkOutput).sharktype, "goblin");
|
|
64
|
-
} catch (err) {
|
|
65
|
-
assert.fail(err as string);
|
|
66
|
-
}
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
it("should put polymorphic body", async () => {
|
|
70
|
-
try {
|
|
71
|
-
const result = await client
|
|
72
|
-
.path("/type/model/inheritance/discriminated/model")
|
|
73
|
-
.put({
|
|
74
|
-
body: {
|
|
75
|
-
age: 1,
|
|
76
|
-
kind: "shark",
|
|
77
|
-
sharktype: "goblin"
|
|
78
|
-
}
|
|
79
|
-
});
|
|
80
|
-
assert.strictEqual(result.status, "200");
|
|
81
|
-
} catch (err) {
|
|
82
|
-
assert.fail(err as string);
|
|
83
|
-
}
|
|
84
|
-
});
|
|
85
|
-
|
|
86
|
-
const validRecursiveBody = {
|
|
87
|
-
age: 1,
|
|
88
|
-
kind: "salmon",
|
|
89
|
-
partner: {
|
|
90
|
-
age: 2,
|
|
91
|
-
kind: "shark",
|
|
92
|
-
sharktype: "saw",
|
|
93
|
-
},
|
|
94
|
-
friends: [
|
|
95
|
-
{
|
|
96
|
-
age: 2,
|
|
97
|
-
kind: "salmon",
|
|
98
|
-
partner: {
|
|
99
|
-
age: 3,
|
|
100
|
-
kind: "salmon",
|
|
101
|
-
},
|
|
102
|
-
hate: {
|
|
103
|
-
key1: {
|
|
104
|
-
age: 4,
|
|
105
|
-
kind: "salmon",
|
|
106
|
-
},
|
|
107
|
-
key2: {
|
|
108
|
-
age: 2,
|
|
109
|
-
kind: "shark",
|
|
110
|
-
sharktype: "goblin",
|
|
111
|
-
},
|
|
112
|
-
},
|
|
113
|
-
},
|
|
114
|
-
{
|
|
115
|
-
age: 3,
|
|
116
|
-
kind: "shark",
|
|
117
|
-
sharktype: "goblin",
|
|
118
|
-
},
|
|
119
|
-
],
|
|
120
|
-
hate: {
|
|
121
|
-
key3: {
|
|
122
|
-
age: 3,
|
|
123
|
-
kind: "shark",
|
|
124
|
-
sharktype: "saw",
|
|
125
|
-
},
|
|
126
|
-
key4: {
|
|
127
|
-
age: 2,
|
|
128
|
-
kind: "salmon",
|
|
129
|
-
friends: [
|
|
130
|
-
{
|
|
131
|
-
age: 1,
|
|
132
|
-
kind: "salmon",
|
|
133
|
-
},
|
|
134
|
-
{
|
|
135
|
-
age: 4,
|
|
136
|
-
kind: "shark",
|
|
137
|
-
sharktype: "goblin",
|
|
138
|
-
},
|
|
139
|
-
],
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
};
|
|
143
|
-
it("should get recursive body", async () => {
|
|
144
|
-
try {
|
|
145
|
-
const result = await client
|
|
146
|
-
.path("/type/model/inheritance/discriminated/recursivemodel")
|
|
147
|
-
.get();
|
|
148
|
-
assert.strictEqual(result.status, "200");
|
|
149
|
-
assert.strictEqual(JSON.stringify(result.body), JSON.stringify(validRecursiveBody));
|
|
150
|
-
} catch (err) {
|
|
151
|
-
assert.fail(err as string);
|
|
152
|
-
}
|
|
153
|
-
});
|
|
154
|
-
|
|
155
|
-
it("should put recursive body", async () => {
|
|
156
|
-
try {
|
|
157
|
-
const result = await client
|
|
158
|
-
.path("/type/model/inheritance/discriminated/recursivemodel")
|
|
159
|
-
.put({
|
|
160
|
-
body: validRecursiveBody as Salmon
|
|
161
|
-
});
|
|
162
|
-
assert.strictEqual(result.status, "200");
|
|
163
|
-
} catch (err) {
|
|
164
|
-
assert.fail(err as string);
|
|
165
|
-
}
|
|
166
|
-
});
|
|
167
|
-
|
|
168
|
-
it("should get missing discriminator body", async () => {
|
|
169
|
-
try {
|
|
170
|
-
const result = await client
|
|
171
|
-
.path("/type/model/inheritance/discriminated/missingdiscriminator")
|
|
172
|
-
.get();
|
|
173
|
-
assert.strictEqual(result.status, "200");
|
|
174
|
-
assert.strictEqual(result.body.age, 1);
|
|
175
|
-
} catch (err) {
|
|
176
|
-
assert.fail(err as string);
|
|
177
|
-
}
|
|
178
|
-
});
|
|
179
|
-
|
|
180
|
-
it("should get wrong discriminator body", async () => {
|
|
181
|
-
try {
|
|
182
|
-
const result = await client
|
|
183
|
-
.path("/type/model/inheritance/discriminated/wrongdiscriminator")
|
|
184
|
-
.get();
|
|
185
|
-
assert.strictEqual(result.status, "200");
|
|
186
|
-
assert.strictEqual(result.body.age, 1);
|
|
187
|
-
assert.strictEqual(result.body.kind, "wrongKind")
|
|
188
|
-
} catch (err) {
|
|
189
|
-
assert.fail(err as string);
|
|
190
|
-
}
|
|
191
|
-
});
|
|
192
|
-
});
|
|
@@ -1,115 +0,0 @@
|
|
|
1
|
-
import { assert } from "chai";
|
|
2
|
-
import TypePropertyNullableClientFactory, {
|
|
3
|
-
TypePropertyNullableClient
|
|
4
|
-
} from "./generated/models/propertyNullable/src/index.js";
|
|
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: "string",
|
|
16
|
-
defaultValue: "hello"
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
type: "bytes",
|
|
20
|
-
defaultValue: "aGVsbG8sIHdvcmxkIQ=="
|
|
21
|
-
},
|
|
22
|
-
{
|
|
23
|
-
type: "datetime",
|
|
24
|
-
defaultValue: "2022-08-26T18:38:00Z"
|
|
25
|
-
},
|
|
26
|
-
{
|
|
27
|
-
type: "duration",
|
|
28
|
-
defaultValue: "P123DT22H14M12.011S"
|
|
29
|
-
},
|
|
30
|
-
{
|
|
31
|
-
type: "collections/bytes",
|
|
32
|
-
defaultValue: ["aGVsbG8sIHdvcmxkIQ==", "aGVsbG8sIHdvcmxkIQ=="]
|
|
33
|
-
},
|
|
34
|
-
{
|
|
35
|
-
type: "collections/model",
|
|
36
|
-
defaultValue: [{ property: "hello" }, { property: "world" }]
|
|
37
|
-
}
|
|
38
|
-
];
|
|
39
|
-
describe("ModelsPropertyNullableClient Rest Client", () => {
|
|
40
|
-
let client: TypePropertyNullableClient;
|
|
41
|
-
|
|
42
|
-
beforeEach(() => {
|
|
43
|
-
client = TypePropertyNullableClientFactory({
|
|
44
|
-
allowInsecureConnection: true
|
|
45
|
-
});
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
matrix([testedTypes], async (params: TypeDetail) => {
|
|
49
|
-
it(`should get a null value for nullable ${params.type}`, async () => {
|
|
50
|
-
try {
|
|
51
|
-
const result = await client
|
|
52
|
-
.path(`/type/property/nullable/${params.type}/null` as any)
|
|
53
|
-
.get();
|
|
54
|
-
assert.strictEqual(result.status, "200");
|
|
55
|
-
assert.strictEqual(result.body.nullableProperty, null);
|
|
56
|
-
assert.deepEqual(result.body.requiredProperty, "foo");
|
|
57
|
-
} catch (err) {
|
|
58
|
-
assert.fail(err as string);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it(`should get a non-null value for nullable ${params.type}`, async () => {
|
|
63
|
-
try {
|
|
64
|
-
const result = await client
|
|
65
|
-
.path(`/type/property/nullable/${params.type}/non-null` as any)
|
|
66
|
-
.get();
|
|
67
|
-
assert.strictEqual(result.status, "200");
|
|
68
|
-
assert.deepEqual(result.body.nullableProperty, params.defaultValue);
|
|
69
|
-
assert.deepEqual(result.body.requiredProperty, "foo");
|
|
70
|
-
} catch (err) {
|
|
71
|
-
assert.fail(err as string);
|
|
72
|
-
}
|
|
73
|
-
});
|
|
74
|
-
|
|
75
|
-
it(`should patch a null value for nullable ${params.type}`, async () => {
|
|
76
|
-
try {
|
|
77
|
-
const result = await client
|
|
78
|
-
.path(`/type/property/nullable/${params.type}/null` as any)
|
|
79
|
-
.patch({
|
|
80
|
-
contentType: "application/merge-patch+json",
|
|
81
|
-
body: {
|
|
82
|
-
requiredProperty: "foo",
|
|
83
|
-
nullableProperty: null
|
|
84
|
-
}
|
|
85
|
-
});
|
|
86
|
-
assert.strictEqual(result.status, "204");
|
|
87
|
-
} catch (err) {
|
|
88
|
-
assert.fail(err as string);
|
|
89
|
-
}
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it(`should patch a non-null value for nullable ${params.type}`, async () => {
|
|
93
|
-
try {
|
|
94
|
-
let property;
|
|
95
|
-
if (params.convertedToFn) {
|
|
96
|
-
property = params.convertedToFn(params.defaultValue);
|
|
97
|
-
} else {
|
|
98
|
-
property = params.defaultValue;
|
|
99
|
-
}
|
|
100
|
-
const result = await client
|
|
101
|
-
.path(`/type/property/nullable/${params.type}/non-null` as any)
|
|
102
|
-
.patch({
|
|
103
|
-
contentType: "application/merge-patch+json",
|
|
104
|
-
body: {
|
|
105
|
-
requiredProperty: "foo",
|
|
106
|
-
nullableProperty: property || null
|
|
107
|
-
}
|
|
108
|
-
});
|
|
109
|
-
assert.strictEqual(result.status, "204");
|
|
110
|
-
} catch (err) {
|
|
111
|
-
assert.fail(err as string);
|
|
112
|
-
}
|
|
113
|
-
});
|
|
114
|
-
});
|
|
115
|
-
});
|
|
@@ -1,362 +0,0 @@
|
|
|
1
|
-
import TypePropertyOptionalClientFactory, {
|
|
2
|
-
TypePropertyOptionalClient
|
|
3
|
-
} from "./generated/models/propertyOptional/src/index.js";
|
|
4
|
-
import { assert } from "chai";
|
|
5
|
-
|
|
6
|
-
describe("ModelsPropertyOptional Rest Client", () => {
|
|
7
|
-
let client: TypePropertyOptionalClient;
|
|
8
|
-
|
|
9
|
-
beforeEach(() => {
|
|
10
|
-
client = TypePropertyOptionalClientFactory({
|
|
11
|
-
allowInsecureConnection: true
|
|
12
|
-
});
|
|
13
|
-
});
|
|
14
|
-
|
|
15
|
-
it("should get all string", async () => {
|
|
16
|
-
try {
|
|
17
|
-
const result = await client
|
|
18
|
-
.path("/type/property/optional/string/all")
|
|
19
|
-
.get();
|
|
20
|
-
assert.strictEqual(result.status, "200");
|
|
21
|
-
assert.strictEqual(result.body.property, "hello");
|
|
22
|
-
} catch (err) {
|
|
23
|
-
assert.fail(err as string);
|
|
24
|
-
}
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it("should get default string", async () => {
|
|
28
|
-
try {
|
|
29
|
-
const result = await client
|
|
30
|
-
.path("/type/property/optional/string/default")
|
|
31
|
-
.get();
|
|
32
|
-
assert.strictEqual(result.status, "200");
|
|
33
|
-
} catch (err) {
|
|
34
|
-
assert.fail(err as string);
|
|
35
|
-
}
|
|
36
|
-
});
|
|
37
|
-
|
|
38
|
-
it("should put all string", async () => {
|
|
39
|
-
try {
|
|
40
|
-
const result = await client
|
|
41
|
-
.path("/type/property/optional/string/all")
|
|
42
|
-
.put({
|
|
43
|
-
body: { property: "hello" }
|
|
44
|
-
});
|
|
45
|
-
assert.strictEqual(result.status, "204");
|
|
46
|
-
} catch (err) {
|
|
47
|
-
assert.fail(err as string);
|
|
48
|
-
}
|
|
49
|
-
});
|
|
50
|
-
|
|
51
|
-
it("should put default string", async () => {
|
|
52
|
-
try {
|
|
53
|
-
const result = await client
|
|
54
|
-
.path("/type/property/optional/string/default")
|
|
55
|
-
.put({ body: {} });
|
|
56
|
-
assert.strictEqual(result.status, "204");
|
|
57
|
-
} catch (err) {
|
|
58
|
-
assert.fail(err as string);
|
|
59
|
-
}
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it("should get all bytes", async () => {
|
|
63
|
-
try {
|
|
64
|
-
const result = await client
|
|
65
|
-
.path("/type/property/optional/bytes/all")
|
|
66
|
-
.get();
|
|
67
|
-
assert.strictEqual(result.status, "200");
|
|
68
|
-
assert.strictEqual(result.body.property, "aGVsbG8sIHdvcmxkIQ==");
|
|
69
|
-
} catch (err) {
|
|
70
|
-
assert.fail(err as string);
|
|
71
|
-
}
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
it("should get default bytes", async () => {
|
|
75
|
-
try {
|
|
76
|
-
const result = await client
|
|
77
|
-
.path("/type/property/optional/bytes/default")
|
|
78
|
-
.get();
|
|
79
|
-
assert.strictEqual(result.status, "200");
|
|
80
|
-
} catch (err) {
|
|
81
|
-
assert.fail(err as string);
|
|
82
|
-
}
|
|
83
|
-
});
|
|
84
|
-
|
|
85
|
-
it("should put all bytes", async () => {
|
|
86
|
-
try {
|
|
87
|
-
const result = await client
|
|
88
|
-
.path("/type/property/optional/bytes/all")
|
|
89
|
-
.put({
|
|
90
|
-
body: { property: "aGVsbG8sIHdvcmxkIQ==" }
|
|
91
|
-
});
|
|
92
|
-
assert.strictEqual(result.status, "204");
|
|
93
|
-
} catch (err) {
|
|
94
|
-
assert.fail(err as string);
|
|
95
|
-
}
|
|
96
|
-
});
|
|
97
|
-
|
|
98
|
-
it("should put default bytes", async () => {
|
|
99
|
-
try {
|
|
100
|
-
const result = await client
|
|
101
|
-
.path("/type/property/optional/bytes/default")
|
|
102
|
-
.put({
|
|
103
|
-
body: {}
|
|
104
|
-
});
|
|
105
|
-
assert.strictEqual(result.status, "204");
|
|
106
|
-
} catch (err) {
|
|
107
|
-
assert.fail(err as string);
|
|
108
|
-
}
|
|
109
|
-
});
|
|
110
|
-
|
|
111
|
-
it("should get all datetime", async () => {
|
|
112
|
-
try {
|
|
113
|
-
const result = await client
|
|
114
|
-
.path("/type/property/optional/datetime/all")
|
|
115
|
-
.get();
|
|
116
|
-
assert.strictEqual(result.status, "200");
|
|
117
|
-
assert.strictEqual(result.body.property, "2022-08-26T18:38:00Z");
|
|
118
|
-
} catch (err) {
|
|
119
|
-
assert.fail(err as string);
|
|
120
|
-
}
|
|
121
|
-
});
|
|
122
|
-
|
|
123
|
-
it("should get default datetime", async () => {
|
|
124
|
-
try {
|
|
125
|
-
const result = await client
|
|
126
|
-
.path("/type/property/optional/datetime/default")
|
|
127
|
-
.get();
|
|
128
|
-
assert.strictEqual(result.status, "200");
|
|
129
|
-
} catch (err) {
|
|
130
|
-
assert.fail(err as string);
|
|
131
|
-
}
|
|
132
|
-
});
|
|
133
|
-
|
|
134
|
-
it("should put all datetime", async () => {
|
|
135
|
-
try {
|
|
136
|
-
const result = await client
|
|
137
|
-
.path("/type/property/optional/datetime/all")
|
|
138
|
-
.put({
|
|
139
|
-
body: { property: "2022-08-26T18:38:00Z" }
|
|
140
|
-
});
|
|
141
|
-
assert.strictEqual(result.status, "204");
|
|
142
|
-
} catch (err) {
|
|
143
|
-
assert.fail(err as string);
|
|
144
|
-
}
|
|
145
|
-
});
|
|
146
|
-
|
|
147
|
-
it("should put default datetime", async () => {
|
|
148
|
-
try {
|
|
149
|
-
const result = await client
|
|
150
|
-
.path("/type/property/optional/datetime/default")
|
|
151
|
-
.put({
|
|
152
|
-
body: {}
|
|
153
|
-
});
|
|
154
|
-
assert.strictEqual(result.status, "204");
|
|
155
|
-
} catch (err) {
|
|
156
|
-
assert.fail(err as string);
|
|
157
|
-
}
|
|
158
|
-
});
|
|
159
|
-
|
|
160
|
-
it("should get all duration", async () => {
|
|
161
|
-
try {
|
|
162
|
-
const result = await client
|
|
163
|
-
.path("/type/property/optional/duration/all")
|
|
164
|
-
.get();
|
|
165
|
-
assert.strictEqual(result.status, "200");
|
|
166
|
-
assert.strictEqual(result.body.property, "P123DT22H14M12.011S");
|
|
167
|
-
} catch (err) {
|
|
168
|
-
assert.fail(err as string);
|
|
169
|
-
}
|
|
170
|
-
});
|
|
171
|
-
|
|
172
|
-
it("should get default duration", async () => {
|
|
173
|
-
try {
|
|
174
|
-
const result = await client
|
|
175
|
-
.path("/type/property/optional/duration/default")
|
|
176
|
-
.get();
|
|
177
|
-
assert.strictEqual(result.status, "200");
|
|
178
|
-
} catch (err) {
|
|
179
|
-
assert.fail(err as string);
|
|
180
|
-
}
|
|
181
|
-
});
|
|
182
|
-
|
|
183
|
-
it("should put all duration", async () => {
|
|
184
|
-
try {
|
|
185
|
-
const result = await client
|
|
186
|
-
.path("/type/property/optional/duration/all")
|
|
187
|
-
.put({
|
|
188
|
-
body: { property: "P123DT22H14M12.011S" }
|
|
189
|
-
});
|
|
190
|
-
assert.strictEqual(result.status, "204");
|
|
191
|
-
} catch (err) {
|
|
192
|
-
assert.fail(err as string);
|
|
193
|
-
}
|
|
194
|
-
});
|
|
195
|
-
|
|
196
|
-
it("should put default duration", async () => {
|
|
197
|
-
try {
|
|
198
|
-
const result = await client
|
|
199
|
-
.path("/type/property/optional/duration/default")
|
|
200
|
-
.put({
|
|
201
|
-
body: {}
|
|
202
|
-
});
|
|
203
|
-
assert.strictEqual(result.status, "204");
|
|
204
|
-
} catch (err) {
|
|
205
|
-
assert.fail(err as string);
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
|
|
209
|
-
it("should get all collections bytes", async () => {
|
|
210
|
-
try {
|
|
211
|
-
const result = await client
|
|
212
|
-
.path("/type/property/optional/collections/bytes/all")
|
|
213
|
-
.get();
|
|
214
|
-
assert.strictEqual(result.status, "200");
|
|
215
|
-
assert.strictEqual(result.body.property?.length, 2);
|
|
216
|
-
} catch (err) {
|
|
217
|
-
assert.fail(err as string);
|
|
218
|
-
}
|
|
219
|
-
});
|
|
220
|
-
|
|
221
|
-
it("should get default collections bytes", async () => {
|
|
222
|
-
try {
|
|
223
|
-
const result = await client
|
|
224
|
-
.path("/type/property/optional/collections/bytes/default")
|
|
225
|
-
.get();
|
|
226
|
-
assert.strictEqual(result.status, "200");
|
|
227
|
-
} catch (err) {
|
|
228
|
-
assert.fail(err as string);
|
|
229
|
-
}
|
|
230
|
-
});
|
|
231
|
-
|
|
232
|
-
it("should put all collections bytes", async () => {
|
|
233
|
-
try {
|
|
234
|
-
const result = await client
|
|
235
|
-
.path("/type/property/optional/collections/bytes/all")
|
|
236
|
-
.put({
|
|
237
|
-
body: { property: ["aGVsbG8sIHdvcmxkIQ==", "aGVsbG8sIHdvcmxkIQ=="] }
|
|
238
|
-
});
|
|
239
|
-
assert.strictEqual(result.status, "204");
|
|
240
|
-
} catch (err) {
|
|
241
|
-
assert.fail(err as string);
|
|
242
|
-
}
|
|
243
|
-
});
|
|
244
|
-
|
|
245
|
-
it("should put default collections bytes", async () => {
|
|
246
|
-
try {
|
|
247
|
-
const result = await client
|
|
248
|
-
.path("/type/property/optional/collections/bytes/default")
|
|
249
|
-
.put({
|
|
250
|
-
body: {}
|
|
251
|
-
});
|
|
252
|
-
assert.strictEqual(result.status, "204");
|
|
253
|
-
} catch (err) {
|
|
254
|
-
assert.fail(err as string);
|
|
255
|
-
}
|
|
256
|
-
});
|
|
257
|
-
|
|
258
|
-
it("should get all collections model", async () => {
|
|
259
|
-
try {
|
|
260
|
-
const result = await client
|
|
261
|
-
.path("/type/property/optional/collections/model/all")
|
|
262
|
-
.get();
|
|
263
|
-
assert.strictEqual(result.status, "200");
|
|
264
|
-
assert.strictEqual(result.body.property?.length, 2);
|
|
265
|
-
} catch (err) {
|
|
266
|
-
assert.fail(err as string);
|
|
267
|
-
}
|
|
268
|
-
});
|
|
269
|
-
|
|
270
|
-
it("should get default collections model", async () => {
|
|
271
|
-
try {
|
|
272
|
-
const result = await client
|
|
273
|
-
.path("/type/property/optional/collections/model/default")
|
|
274
|
-
.get();
|
|
275
|
-
assert.strictEqual(result.status, "200");
|
|
276
|
-
} catch (err) {
|
|
277
|
-
assert.fail(err as string);
|
|
278
|
-
}
|
|
279
|
-
});
|
|
280
|
-
|
|
281
|
-
it("should put all collections model", async () => {
|
|
282
|
-
try {
|
|
283
|
-
const result = await client
|
|
284
|
-
.path("/type/property/optional/collections/model/all")
|
|
285
|
-
.put({
|
|
286
|
-
body: { property: [{ property: "hello" }, { property: "world" }] }
|
|
287
|
-
});
|
|
288
|
-
assert.strictEqual(result.status, "204");
|
|
289
|
-
} catch (err) {
|
|
290
|
-
assert.fail(err as string);
|
|
291
|
-
}
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
it("should put default collections model", async () => {
|
|
295
|
-
try {
|
|
296
|
-
const result = await client
|
|
297
|
-
.path("/type/property/optional/collections/model/default")
|
|
298
|
-
.put({
|
|
299
|
-
body: {}
|
|
300
|
-
});
|
|
301
|
-
assert.strictEqual(result.status, "204");
|
|
302
|
-
} catch (err) {
|
|
303
|
-
assert.fail(err as string);
|
|
304
|
-
}
|
|
305
|
-
});
|
|
306
|
-
|
|
307
|
-
it("should get models that will return all properties in the model", async () => {
|
|
308
|
-
try {
|
|
309
|
-
const result = await client
|
|
310
|
-
.path("/type/property/optional/requiredAndOptional/all")
|
|
311
|
-
.get();
|
|
312
|
-
assert.strictEqual(result.status, "200");
|
|
313
|
-
assert.strictEqual(result.body.optionalProperty, "hello");
|
|
314
|
-
assert.strictEqual(result.body.requiredProperty, 42);
|
|
315
|
-
} catch (err) {
|
|
316
|
-
assert.fail(err as string);
|
|
317
|
-
}
|
|
318
|
-
});
|
|
319
|
-
|
|
320
|
-
it("should get models that will return only the required properties", async () => {
|
|
321
|
-
try {
|
|
322
|
-
const result = await client
|
|
323
|
-
.path("/type/property/optional/requiredAndOptional/requiredOnly")
|
|
324
|
-
.get();
|
|
325
|
-
assert.strictEqual(result.status, "200");
|
|
326
|
-
assert.strictEqual(result.body.requiredProperty, 42);
|
|
327
|
-
} catch (err) {
|
|
328
|
-
assert.fail(err as string);
|
|
329
|
-
}
|
|
330
|
-
});
|
|
331
|
-
|
|
332
|
-
it("should put a body with all properties present", async () => {
|
|
333
|
-
try {
|
|
334
|
-
const result = await client
|
|
335
|
-
.path("/type/property/optional/requiredAndOptional/all")
|
|
336
|
-
.put({
|
|
337
|
-
body: {
|
|
338
|
-
requiredProperty: 42,
|
|
339
|
-
optionalProperty: "hello"
|
|
340
|
-
}
|
|
341
|
-
});
|
|
342
|
-
assert.strictEqual(result.status, "204");
|
|
343
|
-
} catch (err) {
|
|
344
|
-
assert.fail(err as string);
|
|
345
|
-
}
|
|
346
|
-
});
|
|
347
|
-
|
|
348
|
-
it("should put a body with only required properties", async () => {
|
|
349
|
-
try {
|
|
350
|
-
const result = await client
|
|
351
|
-
.path("/type/property/optional/requiredAndOptional/requiredOnly")
|
|
352
|
-
.put({
|
|
353
|
-
body: {
|
|
354
|
-
requiredProperty: 42
|
|
355
|
-
}
|
|
356
|
-
});
|
|
357
|
-
assert.strictEqual(result.status, "204");
|
|
358
|
-
} catch (err) {
|
|
359
|
-
assert.fail(err as string);
|
|
360
|
-
}
|
|
361
|
-
});
|
|
362
|
-
});
|