@azure-tools/typespec-ts 0.54.0 → 0.55.0-dev.6
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/README.md +0 -4
- package/dist/src/contextManager.d.ts +5 -5
- package/dist/src/contextManager.d.ts.map +1 -1
- package/dist/src/contextManager.js +3 -3
- package/dist/src/contextManager.js.map +1 -1
- package/dist/src/framework/declaration.d.ts +1 -1
- package/dist/src/framework/declaration.d.ts.map +1 -1
- package/dist/src/framework/declaration.js +2 -4
- package/dist/src/framework/declaration.js.map +1 -1
- package/dist/src/framework/dependency.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.d.ts +1 -1
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +31 -40
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.js +8 -12
- package/dist/src/framework/hooks/sdkTypes.js.map +1 -1
- package/dist/src/framework/hooks/useDependencies.d.ts.map +1 -1
- package/dist/src/framework/hooks/useDependencies.js +1 -1
- package/dist/src/framework/hooks/useDependencies.js.map +1 -1
- package/dist/src/framework/load-static-helpers.d.ts +1 -1
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +17 -31
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/framework/reference.d.ts.map +1 -1
- package/dist/src/framework/reference.js +2 -2
- package/dist/src/framework/reference.js.map +1 -1
- package/dist/src/framework/sample.js +8 -8
- package/dist/src/framework/sample.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +103 -92
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +1 -1
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +140 -140
- package/dist/src/lib.js.map +1 -1
- package/dist/src/metaTree.d.ts +1 -1
- package/dist/src/metaTree.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.js +60 -74
- package/dist/src/modular/buildClassicalClient.js.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.d.ts +2 -2
- package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js +8 -10
- package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
- package/dist/src/modular/buildClientContext.d.ts +2 -2
- package/dist/src/modular/buildClientContext.d.ts.map +1 -1
- package/dist/src/modular/buildClientContext.js +31 -38
- package/dist/src/modular/buildClientContext.js.map +1 -1
- package/dist/src/modular/buildModularOptions.d.ts +1 -1
- package/dist/src/modular/buildModularOptions.d.ts.map +1 -1
- package/dist/src/modular/buildModularOptions.js +5 -6
- package/dist/src/modular/buildModularOptions.js.map +1 -1
- package/dist/src/modular/buildOperations.d.ts +3 -3
- package/dist/src/modular/buildOperations.d.ts.map +1 -1
- package/dist/src/modular/buildOperations.js +23 -25
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts.map +1 -1
- package/dist/src/modular/buildProjectFiles.js +8 -11
- package/dist/src/modular/buildProjectFiles.js.map +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts.map +1 -1
- package/dist/src/modular/buildRestorePoller.js +12 -13
- package/dist/src/modular/buildRestorePoller.js.map +1 -1
- package/dist/src/modular/buildRootIndex.d.ts +2 -2
- package/dist/src/modular/buildRootIndex.d.ts.map +1 -1
- package/dist/src/modular/buildRootIndex.js +36 -50
- package/dist/src/modular/buildRootIndex.js.map +1 -1
- package/dist/src/modular/buildSubpathIndex.d.ts.map +1 -1
- package/dist/src/modular/buildSubpathIndex.js +9 -18
- package/dist/src/modular/buildSubpathIndex.js.map +1 -1
- package/dist/src/modular/emitLoggerFile.d.ts.map +1 -1
- package/dist/src/modular/emitLoggerFile.js +4 -4
- package/dist/src/modular/emitLoggerFile.js.map +1 -1
- package/dist/src/modular/emitModels.d.ts +1 -1
- package/dist/src/modular/emitModels.d.ts.map +1 -1
- package/dist/src/modular/emitModels.js +81 -113
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts.map +1 -1
- package/dist/src/modular/emitModelsOptions.js +7 -8
- package/dist/src/modular/emitModelsOptions.js.map +1 -1
- package/dist/src/modular/emitSamples.d.ts.map +1 -1
- package/dist/src/modular/emitSamples.js +69 -77
- package/dist/src/modular/emitSamples.js.map +1 -1
- package/dist/src/modular/emitTests.d.ts.map +1 -1
- package/dist/src/modular/emitTests.js +13 -18
- package/dist/src/modular/emitTests.js.map +1 -1
- package/dist/src/modular/external-dependencies.js +54 -54
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js +59 -68
- package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.js +31 -54
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.js +72 -84
- package/dist/src/modular/helpers/exampleValueHelpers.js.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.js +7 -10
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +204 -288
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.js +4 -6
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.js +58 -67
- package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js +65 -75
- package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js +73 -90
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.d.ts.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.js +25 -33
- package/dist/src/modular/serialization/serializeUtils.js.map +1 -1
- package/dist/src/modular/static-helpers-metadata.js +60 -60
- package/dist/src/modular/type-expressions/get-credential-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-credential-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.js +1 -2
- package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.js +10 -13
- package/dist/src/modular/type-expressions/get-model-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.js +2 -3
- package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.js +5 -11
- package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
- package/dist/src/rlc-common/buildClient.d.ts +1 -1
- package/dist/src/rlc-common/buildClient.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClient.js +67 -89
- package/dist/src/rlc-common/buildClient.js.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.js +28 -45
- package/dist/src/rlc-common/buildClientDefinitions.js.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.js +59 -60
- package/dist/src/rlc-common/buildIndexFile.js.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js +37 -38
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +1 -1
- package/dist/src/rlc-common/buildLogger.d.ts.map +1 -1
- package/dist/src/rlc-common/buildLogger.js +4 -5
- package/dist/src/rlc-common/buildLogger.js.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.js +4 -4
- package/dist/src/rlc-common/buildMethodShortcuts.js.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.js +57 -96
- package/dist/src/rlc-common/buildObjectTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.js +2 -2
- package/dist/src/rlc-common/buildPaginateHelper.js.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.js +71 -61
- package/dist/src/rlc-common/buildParameterTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.js +9 -10
- package/dist/src/rlc-common/buildPollingHelper.js.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.js +23 -27
- package/dist/src/rlc-common/buildResponseTypes.js.map +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSamples.js +2 -2
- package/dist/src/rlc-common/buildSchemaType.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSchemaType.js +31 -13
- package/dist/src/rlc-common/buildSchemaType.js.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.js +4 -4
- package/dist/src/rlc-common/buildSerializeHelper.js.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.js +9 -13
- package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.js +6 -8
- package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.js +32 -37
- package/dist/src/rlc-common/helpers/importsUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.js +2 -4
- package/dist/src/rlc-common/helpers/nameConstructors.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.js +17 -23
- package/dist/src/rlc-common/helpers/nameUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.js +16 -31
- package/dist/src/rlc-common/helpers/operationHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/packageUtil.js +3 -6
- package/dist/src/rlc-common/helpers/packageUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.js +1 -3
- package/dist/src/rlc-common/helpers/pathUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.js +3 -7
- package/dist/src/rlc-common/helpers/schemaHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.js +2 -2
- package/dist/src/rlc-common/helpers/shortcutMethods.js.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.js +4 -9
- package/dist/src/rlc-common/helpers/typeUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js +7 -11
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +1 -1
- package/dist/src/rlc-common/index.d.ts +28 -28
- package/dist/src/rlc-common/index.d.ts.map +1 -1
- package/dist/src/rlc-common/index.js +28 -28
- package/dist/src/rlc-common/index.js.map +1 -1
- package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
- package/dist/src/rlc-common/interfaces.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +14 -15
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildChangelogFile.js +2 -3
- package/dist/src/rlc-common/metadata/buildChangelogFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.js +5 -8
- package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildLicenseFile.js +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.js +33 -37
- package/dist/src/rlc-common/metadata/buildPackageFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.js +31 -39
- package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.js +4 -6
- package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +3 -5
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTestConfig.js +11 -12
- package/dist/src/rlc-common/metadata/buildTestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.js +28 -28
- package/dist/src/rlc-common/metadata/buildTsConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.js +3 -5
- package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.js +4 -5
- package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +14 -14
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +24 -29
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +15 -16
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +8 -8
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +28 -31
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/utils.js +1 -2
- package/dist/src/rlc-common/metadata/utils.js.map +1 -1
- package/dist/src/rlc-common/test/buildKarmaConfig.js +1 -1
- package/dist/src/rlc-common/test/buildRecordedClient.js +4 -5
- package/dist/src/rlc-common/test/buildRecordedClient.js.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.js +3 -4
- package/dist/src/rlc-common/test/buildSampleTest.js.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.js +7 -10
- package/dist/src/rlc-common/test/buildSnippets.js.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.d.ts.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.js +41 -45
- package/dist/src/rlc-common/transformSampleGroups.js.map +1 -1
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +1 -1
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/transform/transform.d.ts +1 -1
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/transform/transform.js +28 -27
- package/dist/src/transform/transform.js.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.js +12 -14
- package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.js +11 -14
- package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -1
- package/dist/src/transform/transformParameters.d.ts +2 -2
- package/dist/src/transform/transformParameters.d.ts.map +1 -1
- package/dist/src/transform/transformParameters.js +32 -45
- package/dist/src/transform/transformParameters.js.map +1 -1
- package/dist/src/transform/transformPaths.d.ts +1 -1
- package/dist/src/transform/transformPaths.d.ts.map +1 -1
- package/dist/src/transform/transformPaths.js +19 -23
- package/dist/src/transform/transformPaths.js.map +1 -1
- package/dist/src/transform/transformResponses.d.ts +1 -1
- package/dist/src/transform/transformResponses.d.ts.map +1 -1
- package/dist/src/transform/transformResponses.js +21 -25
- 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 +21 -32
- package/dist/src/transform/transformSchemas.js.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.js +3 -3
- package/dist/src/transform/transformTelemetryInfo.js.map +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
- package/dist/src/transform/transfromRLCOptions.js +28 -39
- package/dist/src/transform/transfromRLCOptions.js.map +1 -1
- package/dist/src/utils/clientUtils.d.ts +1 -1
- package/dist/src/utils/clientUtils.d.ts.map +1 -1
- package/dist/src/utils/clientUtils.js +15 -23
- package/dist/src/utils/clientUtils.js.map +1 -1
- package/dist/src/utils/credentialUtils.d.ts +1 -1
- package/dist/src/utils/credentialUtils.d.ts.map +1 -1
- package/dist/src/utils/credentialUtils.js +4 -5
- package/dist/src/utils/credentialUtils.js.map +1 -1
- package/dist/src/utils/crossLanguageDef.d.ts.map +1 -1
- package/dist/src/utils/crossLanguageDef.js +11 -15
- package/dist/src/utils/crossLanguageDef.js.map +1 -1
- package/dist/src/utils/emitUtil.d.ts +1 -1
- package/dist/src/utils/emitUtil.d.ts.map +1 -1
- package/dist/src/utils/emitUtil.js +5 -7
- package/dist/src/utils/emitUtil.js.map +1 -1
- package/dist/src/utils/fileSystemUtils.d.ts +2 -0
- package/dist/src/utils/fileSystemUtils.d.ts.map +1 -1
- package/dist/src/utils/fileSystemUtils.js +26 -7
- package/dist/src/utils/fileSystemUtils.js.map +1 -1
- package/dist/src/utils/importHelper.d.ts.map +1 -1
- package/dist/src/utils/importHelper.js +3 -6
- package/dist/src/utils/importHelper.js.map +1 -1
- package/dist/src/utils/interfaces.d.ts +1 -1
- package/dist/src/utils/interfaces.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.js +7 -19
- package/dist/src/utils/mediaTypes.js.map +1 -1
- package/dist/src/utils/modelUtils.d.ts +5 -5
- package/dist/src/utils/modelUtils.d.ts.map +1 -1
- package/dist/src/utils/modelUtils.js +168 -257
- package/dist/src/utils/modelUtils.js.map +1 -1
- package/dist/src/utils/namespaceUtils.d.ts.map +1 -1
- package/dist/src/utils/namespaceUtils.js +6 -7
- package/dist/src/utils/namespaceUtils.js.map +1 -1
- package/dist/src/utils/operationUtil.d.ts +1 -1
- package/dist/src/utils/operationUtil.d.ts.map +1 -1
- package/dist/src/utils/operationUtil.js +60 -81
- package/dist/src/utils/operationUtil.js.map +1 -1
- package/dist/src/utils/parameterUtils.d.ts +1 -1
- package/dist/src/utils/parameterUtils.d.ts.map +1 -1
- package/dist/src/utils/parameterUtils.js +26 -33
- package/dist/src/utils/parameterUtils.js.map +1 -1
- package/dist/src/utils/resolve-project-root.js +2 -2
- package/dist/src/utils/resolve-project-root.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -45
- package/src/contextManager.ts +6 -9
- package/src/framework/declaration.ts +18 -28
- package/src/framework/dependency.ts +1 -2
- package/src/framework/hooks/binder.ts +47 -120
- package/src/framework/hooks/sdkTypes.ts +27 -54
- package/src/framework/hooks/useDependencies.ts +2 -4
- package/src/framework/load-static-helpers.ts +28 -51
- package/src/framework/reference.ts +2 -5
- package/src/framework/sample.ts +9 -9
- package/src/index.ts +145 -185
- package/src/lib.ts +143 -158
- package/src/metaTree.ts +1 -1
- package/src/modular/buildClassicalClient.ts +83 -160
- package/src/modular/buildClassicalOperationGroups.ts +14 -39
- package/src/modular/buildClientContext.ts +54 -83
- package/src/modular/buildModularOptions.ts +4 -5
- package/src/modular/buildOperations.ts +46 -73
- package/src/modular/buildProjectFiles.ts +18 -47
- package/src/modular/buildRestorePoller.ts +27 -46
- package/src/modular/buildRootIndex.ts +86 -160
- package/src/modular/buildSubpathIndex.ts +35 -58
- package/src/modular/emitLoggerFile.ts +4 -9
- package/src/modular/emitModels.ts +136 -266
- package/src/modular/emitModelsOptions.ts +10 -16
- package/src/modular/emitSamples.ts +92 -180
- package/src/modular/emitTests.ts +28 -61
- package/src/modular/external-dependencies.ts +54 -54
- package/src/modular/helpers/classicalOperationHelpers.ts +73 -126
- package/src/modular/helpers/clientHelpers.ts +41 -88
- package/src/modular/helpers/clientOptionHelpers.ts +4 -11
- package/src/modular/helpers/exampleValueHelpers.ts +99 -215
- package/src/modular/helpers/namingHelpers.ts +12 -28
- package/src/modular/helpers/operationHelpers.ts +430 -757
- package/src/modular/helpers/typeHelpers.ts +11 -22
- package/src/modular/serialization/buildDeserializerFunction.ts +88 -122
- package/src/modular/serialization/buildSerializerFunction.ts +91 -129
- package/src/modular/serialization/buildXmlSerializerFunction.ts +104 -183
- package/src/modular/serialization/serializeUtils.ts +12 -22
- package/src/modular/static/rollup.test.config.js +11 -14
- package/src/modular/static/scripts/renameOutput.mjs +2 -2
- package/src/modular/static-helpers-metadata.ts +60 -60
- package/src/modular/type-expressions/get-credential-expression.ts +1 -1
- package/src/modular/type-expressions/get-enum-expression.ts +5 -10
- package/src/modular/type-expressions/get-model-expression.ts +13 -17
- package/src/modular/type-expressions/get-nullable-expression.ts +4 -5
- package/src/modular/type-expressions/get-type-expression.ts +8 -12
- package/src/modular/type-expressions/get-union-expression.ts +4 -4
- package/src/modular/type-expressions/utils.ts +1 -1
- package/src/rlc-common/buildClient.ts +70 -141
- package/src/rlc-common/buildClientDefinitions.ts +44 -87
- package/src/rlc-common/buildIndexFile.ts +78 -78
- package/src/rlc-common/buildIsUnexpectedHelper.ts +34 -41
- package/src/rlc-common/buildLogger.ts +7 -7
- package/src/rlc-common/buildMethodShortcuts.ts +9 -21
- package/src/rlc-common/buildObjectTypes.ts +79 -156
- package/src/rlc-common/buildPaginateHelper.ts +9 -12
- package/src/rlc-common/buildParameterTypes.ts +116 -137
- package/src/rlc-common/buildPollingHelper.ts +7 -7
- package/src/rlc-common/buildResponseTypes.ts +34 -57
- package/src/rlc-common/buildSamples.ts +3 -3
- package/src/rlc-common/buildSchemaType.ts +37 -29
- package/src/rlc-common/buildSerializeHelper.ts +5 -5
- package/src/rlc-common/buildTopLevelIndexFile.ts +12 -19
- package/src/rlc-common/helpers/apiVersionUtil.ts +5 -10
- package/src/rlc-common/helpers/importsUtil.ts +27 -30
- package/src/rlc-common/helpers/nameConstructors.ts +16 -50
- package/src/rlc-common/helpers/nameUtils.ts +19 -42
- package/src/rlc-common/helpers/operationHelpers.ts +14 -31
- package/src/rlc-common/helpers/pathUtils.ts +2 -7
- package/src/rlc-common/helpers/schemaHelpers.ts +4 -15
- package/src/rlc-common/helpers/shortcutMethods.ts +6 -15
- package/src/rlc-common/helpers/typeUtil.ts +4 -11
- package/src/rlc-common/helpers/valueGenerationUtil.ts +16 -39
- package/src/rlc-common/index.ts +28 -28
- package/src/rlc-common/interfaces.ts +3 -11
- package/src/rlc-common/metadata/buildApiExtractorConfig.ts +17 -24
- package/src/rlc-common/metadata/buildChangelogFile.ts +1 -1
- package/src/rlc-common/metadata/buildESLintConfig.ts +3 -5
- package/src/rlc-common/metadata/buildLicenseFile.ts +1 -1
- package/src/rlc-common/metadata/buildPackageFile.ts +27 -35
- package/src/rlc-common/metadata/buildReadmeFile.ts +16 -29
- package/src/rlc-common/metadata/buildRollupConfig.ts +5 -8
- package/src/rlc-common/metadata/buildSampleEnvFile.ts +2 -3
- package/src/rlc-common/metadata/buildTestConfig.ts +10 -10
- package/src/rlc-common/metadata/buildTsConfig.ts +32 -35
- package/src/rlc-common/metadata/buildVitestConfig.ts +4 -10
- package/src/rlc-common/metadata/buildWarpConfig.ts +3 -6
- package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +16 -25
- package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +29 -50
- package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +20 -31
- package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +11 -13
- package/src/rlc-common/metadata/packageJson/packageCommon.ts +32 -52
- package/src/rlc-common/test/buildKarmaConfig.ts +1 -1
- package/src/rlc-common/test/buildRecordedClient.ts +3 -3
- package/src/rlc-common/test/buildSampleTest.ts +3 -3
- package/src/rlc-common/test/buildSnippets.ts +6 -12
- package/src/rlc-common/transformSampleGroups.ts +54 -105
- package/src/testing/index.ts +2 -5
- package/src/transform/transform.ts +22 -34
- package/src/transform/transformApiVersionInfo.ts +17 -30
- package/src/transform/transformHelperFunctionDetails.ts +14 -26
- package/src/transform/transformParameters.ts +55 -105
- package/src/transform/transformPaths.ts +26 -43
- package/src/transform/transformResponses.ts +26 -33
- package/src/transform/transformSchemas.ts +15 -33
- package/src/transform/transformTelemetryInfo.ts +8 -14
- package/src/transform/transfromRLCOptions.ts +53 -116
- package/src/utils/clientUtils.ts +22 -41
- package/src/utils/credentialUtils.ts +8 -19
- package/src/utils/crossLanguageDef.ts +15 -34
- package/src/utils/emitUtil.ts +11 -17
- package/src/utils/fileSystemUtils.ts +30 -8
- package/src/utils/importHelper.ts +5 -10
- package/src/utils/interfaces.ts +1 -1
- package/src/utils/mediaTypes.ts +13 -34
- package/src/utils/modelUtils.ts +175 -384
- package/src/utils/namespaceUtils.ts +8 -24
- package/src/utils/operationUtil.ts +98 -190
- package/src/utils/parameterUtils.ts +31 -54
- package/src/utils/resolve-project-root.ts +3 -3
- package/static/static-helpers/cloudSettingHelpers.ts +4 -6
- package/static/static-helpers/multipartHelpers.ts +3 -3
- package/static/static-helpers/pagingHelpers.ts +28 -63
- package/static/static-helpers/pollingHelpers.ts +16 -29
- package/static/static-helpers/serialization/build-multi-collection.ts +1 -4
- package/static/static-helpers/serialization/check-prop-undefined.ts +1 -4
- package/static/static-helpers/serialization/get-binary-response-browser.mts +3 -1
- package/static/static-helpers/serialization/get-binary-response.ts +2 -2
- package/static/static-helpers/serialization/get-binary-stream-response-browser.mts +1 -3
- package/static/static-helpers/serialization/get-binary-stream-response.ts +2 -4
- package/static/static-helpers/serialization/serialize-record.ts +1 -1
- package/static/static-helpers/serialization/serializers.ts +4 -7
- package/static/static-helpers/serialization/xml-helpers.ts +42 -90
- package/static/static-helpers/simplePollerHelpers.ts +10 -19
- package/static/static-helpers/storageCompatResponse.ts +10 -27
- package/static/static-helpers/urlTemplate.ts +4 -7
- package/static/test-helpers/recordedClient.ts +5 -10
|
@@ -1,21 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
UsageFlags
|
|
4
|
-
} from "@azure-tools/typespec-client-generator-core";
|
|
5
|
-
import {
|
|
6
|
-
isGlobalNamespace,
|
|
7
|
-
isService,
|
|
8
|
-
Namespace,
|
|
9
|
-
NoTarget,
|
|
10
|
-
Operation
|
|
11
|
-
} from "@typespec/compiler";
|
|
1
|
+
import { getAllModels, UsageFlags } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
+
import { isGlobalNamespace, isService, Namespace, NoTarget, Operation } from "@typespec/compiler";
|
|
12
3
|
import { reportDiagnostic } from "../lib.js";
|
|
13
4
|
import { SdkContext } from "./interfaces.js";
|
|
14
5
|
|
|
15
|
-
export function getModelNamespaceName(
|
|
16
|
-
dpgContext: SdkContext,
|
|
17
|
-
namespace: Namespace
|
|
18
|
-
): string[] {
|
|
6
|
+
export function getModelNamespaceName(dpgContext: SdkContext, namespace: Namespace): string[] {
|
|
19
7
|
const result: string[] = [];
|
|
20
8
|
if (
|
|
21
9
|
namespace &&
|
|
@@ -30,7 +18,7 @@ export function getModelNamespaceName(
|
|
|
30
18
|
|
|
31
19
|
export function getOperationNamespaceInterfaceName(
|
|
32
20
|
dpgContext: SdkContext,
|
|
33
|
-
operation: Operation
|
|
21
|
+
operation: Operation,
|
|
34
22
|
): string[] {
|
|
35
23
|
const result: string[] = [];
|
|
36
24
|
if (
|
|
@@ -52,9 +40,7 @@ export function getOperationNamespaceInterfaceName(
|
|
|
52
40
|
!isGlobalNamespace(dpgContext.program, operation.interface.namespace) &&
|
|
53
41
|
!isService(dpgContext.program, operation.interface.namespace)
|
|
54
42
|
) {
|
|
55
|
-
result.push(
|
|
56
|
-
...getModelNamespaceName(dpgContext, operation.interface.namespace)
|
|
57
|
-
);
|
|
43
|
+
result.push(...getModelNamespaceName(dpgContext, operation.interface.namespace));
|
|
58
44
|
}
|
|
59
45
|
result.push(operation.interface.name);
|
|
60
46
|
} else if (
|
|
@@ -62,9 +48,7 @@ export function getOperationNamespaceInterfaceName(
|
|
|
62
48
|
!isGlobalNamespace(dpgContext.program, operation.namespace) &&
|
|
63
49
|
!isService(dpgContext.program, operation.namespace)
|
|
64
50
|
) {
|
|
65
|
-
result.push(
|
|
66
|
-
...getModelNamespaceName(dpgContext, operation.namespace.namespace!)
|
|
67
|
-
);
|
|
51
|
+
result.push(...getModelNamespaceName(dpgContext, operation.namespace.namespace!));
|
|
68
52
|
result.push(operation.namespace.name);
|
|
69
53
|
}
|
|
70
54
|
return result;
|
|
@@ -87,9 +71,9 @@ export function detectModelConflicts(dpgContext: SdkContext) {
|
|
|
87
71
|
namespaces: allModels
|
|
88
72
|
.filter((m) => m.name === model.name)
|
|
89
73
|
.map((m) => m.namespace)
|
|
90
|
-
.join(" and ")
|
|
74
|
+
.join(" and "),
|
|
91
75
|
},
|
|
92
|
-
target: NoTarget
|
|
76
|
+
target: NoTarget,
|
|
93
77
|
});
|
|
94
78
|
reported.add(model.name);
|
|
95
79
|
hasConflict = true;
|
|
@@ -1,18 +1,6 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
getLroLogicalResponseName,
|
|
6
|
-
getResponseTypeName,
|
|
7
|
-
NameType,
|
|
8
|
-
normalizeName,
|
|
9
|
-
OperationLroDetail,
|
|
10
|
-
OPERATION_LRO_HIGH_PRIORITY,
|
|
11
|
-
OPERATION_LRO_LOW_PRIORITY,
|
|
12
|
-
Paths,
|
|
13
|
-
ResponseMetadata,
|
|
14
|
-
ResponseTypes
|
|
15
|
-
} from "../rlc-common/index.js";
|
|
16
4
|
import { getLroMetadata } from "@azure-tools/typespec-azure-core";
|
|
17
5
|
import {
|
|
18
6
|
getDisablePageable,
|
|
@@ -27,36 +15,41 @@ import {
|
|
|
27
15
|
SdkMethod,
|
|
28
16
|
SdkMethodParameter,
|
|
29
17
|
SdkServiceMethod,
|
|
30
|
-
SdkServiceOperation
|
|
18
|
+
SdkServiceOperation,
|
|
31
19
|
} from "@azure-tools/typespec-client-generator-core";
|
|
32
|
-
import {
|
|
33
|
-
|
|
34
|
-
ModelProperty,
|
|
35
|
-
NoTarget,
|
|
36
|
-
Operation,
|
|
37
|
-
Program,
|
|
38
|
-
Type
|
|
39
|
-
} from "@typespec/compiler";
|
|
20
|
+
import { isList, ModelProperty, NoTarget, Operation, Program, Type } from "@typespec/compiler";
|
|
21
|
+
import { $ } from "@typespec/compiler/typekit";
|
|
40
22
|
import {
|
|
41
23
|
HttpOperation,
|
|
42
24
|
HttpOperationParameter,
|
|
43
25
|
HttpOperationResponse,
|
|
44
|
-
HttpStatusCodesEntry
|
|
26
|
+
HttpStatusCodesEntry,
|
|
45
27
|
} from "@typespec/http";
|
|
28
|
+
import { resolveReference } from "../framework/reference.js";
|
|
29
|
+
import { reportDiagnostic } from "../lib.js";
|
|
30
|
+
import { SerializationHelpers } from "../modular/static-helpers-metadata.js";
|
|
31
|
+
import {
|
|
32
|
+
getLroLogicalResponseName,
|
|
33
|
+
getResponseTypeName,
|
|
34
|
+
NameType,
|
|
35
|
+
normalizeName,
|
|
36
|
+
OPERATION_LRO_HIGH_PRIORITY,
|
|
37
|
+
OPERATION_LRO_LOW_PRIORITY,
|
|
38
|
+
OperationLroDetail,
|
|
39
|
+
Paths,
|
|
40
|
+
ResponseMetadata,
|
|
41
|
+
ResponseTypes,
|
|
42
|
+
} from "../rlc-common/index.js";
|
|
43
|
+
import { listOperationsUnderRLCClient } from "./clientUtils.js";
|
|
46
44
|
import { SdkContext } from "./interfaces.js";
|
|
47
45
|
import {
|
|
46
|
+
isMediaTypeMultipart,
|
|
47
|
+
isMediaTypeXml,
|
|
48
48
|
KnownMediaType,
|
|
49
49
|
knownMediaType,
|
|
50
|
-
isMediaTypeXml,
|
|
51
|
-
isMediaTypeMultipart
|
|
52
50
|
} from "./mediaTypes.js";
|
|
53
51
|
import { isByteOrByteUnion } from "./modelUtils.js";
|
|
54
52
|
import { getOperationNamespaceInterfaceName } from "./namespaceUtils.js";
|
|
55
|
-
import { resolveReference } from "../framework/reference.js";
|
|
56
|
-
import { SerializationHelpers } from "../modular/static-helpers-metadata.js";
|
|
57
|
-
import { listOperationsUnderRLCClient } from "./clientUtils.js";
|
|
58
|
-
import { $ } from "@typespec/compiler/typekit";
|
|
59
|
-
import { reportDiagnostic } from "../lib.js";
|
|
60
53
|
|
|
61
54
|
// Sorts the responses by status code
|
|
62
55
|
export function sortedOperationResponses(responses: HttpOperationResponse[]) {
|
|
@@ -67,10 +60,8 @@ export function sortedOperationResponses(responses: HttpOperationResponse[]) {
|
|
|
67
60
|
if (b.statusCodes === "*") {
|
|
68
61
|
return -1;
|
|
69
62
|
}
|
|
70
|
-
const aStatus =
|
|
71
|
-
|
|
72
|
-
const bStatus =
|
|
73
|
-
typeof b.statusCodes === "number" ? b.statusCodes : b.statusCodes.start;
|
|
63
|
+
const aStatus = typeof a.statusCodes === "number" ? a.statusCodes : a.statusCodes.start;
|
|
64
|
+
const bStatus = typeof b.statusCodes === "number" ? b.statusCodes : b.statusCodes.start;
|
|
74
65
|
return aStatus - bStatus;
|
|
75
66
|
});
|
|
76
67
|
}
|
|
@@ -81,11 +72,11 @@ export function sortedOperationResponses(responses: HttpOperationResponse[]) {
|
|
|
81
72
|
*/
|
|
82
73
|
export function getOperationResponseTypes(
|
|
83
74
|
dpgContext: SdkContext,
|
|
84
|
-
operation: HttpOperation
|
|
75
|
+
operation: HttpOperation,
|
|
85
76
|
): ResponseTypes {
|
|
86
77
|
const returnTypes: ResponseTypes = {
|
|
87
78
|
error: [],
|
|
88
|
-
success: []
|
|
79
|
+
success: [],
|
|
89
80
|
};
|
|
90
81
|
function getResponseType(responses: HttpOperationResponse[]) {
|
|
91
82
|
return responses.map((r) => {
|
|
@@ -93,17 +84,17 @@ export function getOperationResponseTypes(
|
|
|
93
84
|
const responseName = getResponseTypeName(
|
|
94
85
|
getOperationGroupName(dpgContext, operation),
|
|
95
86
|
getOperationName(dpgContext, operation.operation),
|
|
96
|
-
statusCode
|
|
87
|
+
statusCode,
|
|
97
88
|
);
|
|
98
89
|
return responseName;
|
|
99
90
|
});
|
|
100
91
|
}
|
|
101
92
|
if (operation.responses && operation.responses.length) {
|
|
102
93
|
returnTypes.error = getResponseType(
|
|
103
|
-
operation.responses.filter((r) => isDefaultStatusCode(r.statusCodes))
|
|
94
|
+
operation.responses.filter((r) => isDefaultStatusCode(r.statusCodes)),
|
|
104
95
|
);
|
|
105
96
|
returnTypes.success = getResponseType(
|
|
106
|
-
operation.responses.filter((r) => isDefinedStatusCode(r.statusCodes))
|
|
97
|
+
operation.responses.filter((r) => isDefinedStatusCode(r.statusCodes)),
|
|
107
98
|
);
|
|
108
99
|
}
|
|
109
100
|
return returnTypes;
|
|
@@ -125,9 +116,7 @@ export function getOperationSuccessStatus(operation: HttpOperation): string[] {
|
|
|
125
116
|
return status;
|
|
126
117
|
}
|
|
127
118
|
|
|
128
|
-
export function getOperationStatuscode(
|
|
129
|
-
response: HttpOperationResponse
|
|
130
|
-
): string {
|
|
119
|
+
export function getOperationStatuscode(response: HttpOperationResponse): string {
|
|
131
120
|
const statusCodes = response.statusCodes;
|
|
132
121
|
if (statusCodes === "*") {
|
|
133
122
|
return "default";
|
|
@@ -140,17 +129,11 @@ export function getOperationStatuscode(
|
|
|
140
129
|
}
|
|
141
130
|
}
|
|
142
131
|
|
|
132
|
+
export function getOperationGroupName(dpgContext: SdkContext, route?: HttpOperation): string;
|
|
133
|
+
export function getOperationGroupName(dpgContext: SdkContext, operation?: Operation): string;
|
|
143
134
|
export function getOperationGroupName(
|
|
144
135
|
dpgContext: SdkContext,
|
|
145
|
-
|
|
146
|
-
): string;
|
|
147
|
-
export function getOperationGroupName(
|
|
148
|
-
dpgContext: SdkContext,
|
|
149
|
-
operation?: Operation
|
|
150
|
-
): string;
|
|
151
|
-
export function getOperationGroupName(
|
|
152
|
-
dpgContext: SdkContext,
|
|
153
|
-
operationOrRoute?: Operation | HttpOperation
|
|
136
|
+
operationOrRoute?: Operation | HttpOperation,
|
|
154
137
|
) {
|
|
155
138
|
if (!dpgContext.rlcOptions?.enableOperationGroup || !operationOrRoute) {
|
|
156
139
|
return "";
|
|
@@ -160,10 +143,7 @@ export function getOperationGroupName(
|
|
|
160
143
|
operationOrRoute = (operationOrRoute as HttpOperation).operation;
|
|
161
144
|
}
|
|
162
145
|
const operation = operationOrRoute as Operation;
|
|
163
|
-
const namespaceNames = getOperationNamespaceInterfaceName(
|
|
164
|
-
dpgContext,
|
|
165
|
-
operation
|
|
166
|
-
);
|
|
146
|
+
const namespaceNames = getOperationNamespaceInterfaceName(dpgContext, operation);
|
|
167
147
|
|
|
168
148
|
return namespaceNames
|
|
169
149
|
.map((name) => {
|
|
@@ -175,11 +155,7 @@ export function getOperationGroupName(
|
|
|
175
155
|
export function getOperationName(dpgContext: SdkContext, operation: Operation) {
|
|
176
156
|
const projectedOperationName = getWireName(dpgContext, operation);
|
|
177
157
|
|
|
178
|
-
return normalizeName(
|
|
179
|
-
projectedOperationName ?? operation.name,
|
|
180
|
-
NameType.Interface,
|
|
181
|
-
true
|
|
182
|
-
);
|
|
158
|
+
return normalizeName(projectedOperationName ?? operation.name, NameType.Interface, true);
|
|
183
159
|
}
|
|
184
160
|
|
|
185
161
|
export function isDefaultStatusCode(statusCodes: HttpStatusCodesEntry) {
|
|
@@ -194,7 +170,7 @@ export function isBinaryPayload(
|
|
|
194
170
|
dpgContext: SdkContext,
|
|
195
171
|
body: Type,
|
|
196
172
|
contentType: string | string[],
|
|
197
|
-
encode?: string
|
|
173
|
+
encode?: string,
|
|
198
174
|
) {
|
|
199
175
|
const knownMediaTypes: KnownMediaType[] = (
|
|
200
176
|
Array.isArray(contentType) ? contentType : [contentType]
|
|
@@ -232,19 +208,12 @@ export function isMultipartPayload(contentType: string | string[]): boolean {
|
|
|
232
208
|
* Checks if the operation supports multiple content types (e.g., both JSON and XML)
|
|
233
209
|
*/
|
|
234
210
|
export function hasDualFormatSupport(contentTypes: string[]): boolean {
|
|
235
|
-
const hasJson = contentTypes.some(
|
|
236
|
-
|
|
237
|
-
);
|
|
238
|
-
const hasXml = contentTypes.some(
|
|
239
|
-
(ct) => knownMediaType(ct) === KnownMediaType.Xml
|
|
240
|
-
);
|
|
211
|
+
const hasJson = contentTypes.some((ct) => knownMediaType(ct) === KnownMediaType.Json);
|
|
212
|
+
const hasXml = contentTypes.some((ct) => knownMediaType(ct) === KnownMediaType.Xml);
|
|
241
213
|
return hasJson && hasXml;
|
|
242
214
|
}
|
|
243
215
|
|
|
244
|
-
export function isLongRunningOperation(
|
|
245
|
-
program: Program,
|
|
246
|
-
operation: HttpOperation
|
|
247
|
-
) {
|
|
216
|
+
export function isLongRunningOperation(program: Program, operation: HttpOperation) {
|
|
248
217
|
return Boolean(getLroMetadata(program, operation.operation));
|
|
249
218
|
}
|
|
250
219
|
|
|
@@ -286,15 +255,13 @@ export function getOperationLroOverload(
|
|
|
286
255
|
program: Program,
|
|
287
256
|
operation: HttpOperation,
|
|
288
257
|
existingResponseTypes?: ResponseTypes,
|
|
289
|
-
existingResponses?: ResponseMetadata[]
|
|
258
|
+
existingResponses?: ResponseMetadata[],
|
|
290
259
|
) {
|
|
291
260
|
const metadata = getLroMetadata(program, operation.operation);
|
|
292
261
|
if (!metadata) {
|
|
293
262
|
return false;
|
|
294
263
|
}
|
|
295
|
-
const hasSuccessReturn = existingResponses?.filter((r) =>
|
|
296
|
-
r.statusCode.startsWith("20")
|
|
297
|
-
);
|
|
264
|
+
const hasSuccessReturn = existingResponses?.filter((r) => r.statusCode.startsWith("20"));
|
|
298
265
|
if (existingResponseTypes?.success || hasSuccessReturn) {
|
|
299
266
|
return true;
|
|
300
267
|
}
|
|
@@ -313,7 +280,7 @@ export function extractOperationLroDetail(
|
|
|
313
280
|
dpgContext: SdkContext,
|
|
314
281
|
operation: HttpOperation,
|
|
315
282
|
responsesTypes: ResponseTypes,
|
|
316
|
-
operationGroupName: string
|
|
283
|
+
operationGroupName: string,
|
|
317
284
|
): OperationLroDetail {
|
|
318
285
|
let logicalResponseTypes: ResponseTypes | undefined;
|
|
319
286
|
|
|
@@ -321,7 +288,7 @@ export function extractOperationLroDetail(
|
|
|
321
288
|
const operationLroOverload = getOperationLroOverload(
|
|
322
289
|
dpgContext.program,
|
|
323
290
|
operation,
|
|
324
|
-
responsesTypes
|
|
291
|
+
responsesTypes,
|
|
325
292
|
);
|
|
326
293
|
if (operationLroOverload) {
|
|
327
294
|
logicalResponseTypes = {
|
|
@@ -329,9 +296,9 @@ export function extractOperationLroDetail(
|
|
|
329
296
|
success: [
|
|
330
297
|
getLroLogicalResponseName(
|
|
331
298
|
operationGroupName,
|
|
332
|
-
getOperationName(dpgContext, operation.operation)
|
|
333
|
-
)
|
|
334
|
-
]
|
|
299
|
+
getOperationName(dpgContext, operation.operation),
|
|
300
|
+
),
|
|
301
|
+
],
|
|
335
302
|
};
|
|
336
303
|
const metadata = getLroMetadata(dpgContext.program, operation.operation);
|
|
337
304
|
precedence =
|
|
@@ -344,19 +311,14 @@ export function extractOperationLroDetail(
|
|
|
344
311
|
}
|
|
345
312
|
|
|
346
313
|
return {
|
|
347
|
-
isLongRunning: Boolean(
|
|
348
|
-
getLroMetadata(dpgContext.program, operation.operation)
|
|
349
|
-
),
|
|
314
|
+
isLongRunning: Boolean(getLroMetadata(dpgContext.program, operation.operation)),
|
|
350
315
|
logicalResponseTypes,
|
|
351
316
|
operationLroOverload,
|
|
352
|
-
precedence
|
|
317
|
+
precedence,
|
|
353
318
|
};
|
|
354
319
|
}
|
|
355
320
|
|
|
356
|
-
export function hasPollingOperations(
|
|
357
|
-
client: SdkClient,
|
|
358
|
-
dpgContext: SdkContext
|
|
359
|
-
) {
|
|
321
|
+
export function hasPollingOperations(client: SdkClient, dpgContext: SdkContext) {
|
|
360
322
|
const program = dpgContext.program;
|
|
361
323
|
for (const op of listOperationsUnderRLCClient(client)) {
|
|
362
324
|
const route = getHttpOperationWithCache(dpgContext, op);
|
|
@@ -378,64 +340,54 @@ export interface PageDetails {
|
|
|
378
340
|
|
|
379
341
|
export function extractPageDetails(
|
|
380
342
|
program: Program,
|
|
381
|
-
operation: HttpOperation
|
|
343
|
+
operation: HttpOperation,
|
|
382
344
|
): PageDetails | undefined {
|
|
383
345
|
if (isList(program, operation.operation)) {
|
|
384
346
|
// If the operation is a list, we don't need to extract paging details.
|
|
385
|
-
const metadata = $(program).operation.getPagingMetadata(
|
|
386
|
-
operation.operation
|
|
387
|
-
);
|
|
347
|
+
const metadata = $(program).operation.getPagingMetadata(operation.operation);
|
|
388
348
|
if (metadata === undefined) {
|
|
389
349
|
// would fallback to default paging metadata
|
|
390
350
|
reportDiagnostic(program, {
|
|
391
351
|
code: "no-paging-items-defined",
|
|
392
352
|
format: {
|
|
393
|
-
operationName: operation.operation.name
|
|
353
|
+
operationName: operation.operation.name,
|
|
394
354
|
},
|
|
395
|
-
target: NoTarget
|
|
355
|
+
target: NoTarget,
|
|
396
356
|
});
|
|
397
357
|
}
|
|
398
358
|
|
|
399
359
|
const nextLinkPath = mapFirstSegmentForResultSegments(
|
|
400
360
|
metadata?.output.nextLink?.path,
|
|
401
|
-
operation.responses
|
|
361
|
+
operation.responses,
|
|
402
362
|
);
|
|
403
363
|
const itemNamePath = mapFirstSegmentForResultSegments(
|
|
404
364
|
metadata?.output.pageItems?.path,
|
|
405
|
-
operation.responses
|
|
365
|
+
operation.responses,
|
|
406
366
|
);
|
|
407
|
-
if (
|
|
408
|
-
(nextLinkPath && nextLinkPath?.length > 1) ||
|
|
409
|
-
(itemNamePath && itemNamePath?.length > 1)
|
|
410
|
-
) {
|
|
367
|
+
if ((nextLinkPath && nextLinkPath?.length > 1) || (itemNamePath && itemNamePath?.length > 1)) {
|
|
411
368
|
// Any cases with nested nextLink or itemName are not supported
|
|
412
369
|
reportDiagnostic(program, {
|
|
413
370
|
code: "un-supported-paging-cases",
|
|
414
371
|
format: {
|
|
415
|
-
operationName: operation.operation.name
|
|
372
|
+
operationName: operation.operation.name,
|
|
416
373
|
},
|
|
417
|
-
target: NoTarget
|
|
374
|
+
target: NoTarget,
|
|
418
375
|
});
|
|
419
376
|
// these paging information will be ignored
|
|
420
377
|
// and the operation will be treated as a non-paging operation.
|
|
421
378
|
return undefined;
|
|
422
379
|
}
|
|
423
|
-
const nextLinkNames =
|
|
424
|
-
|
|
425
|
-
const itemNames =
|
|
426
|
-
itemNamePath?.map((prop) => prop.name).join(".") ?? "value";
|
|
380
|
+
const nextLinkNames = nextLinkPath?.map((prop) => prop.name).join(".") ?? "nextLink";
|
|
381
|
+
const itemNames = itemNamePath?.map((prop) => prop.name).join(".") ?? "value";
|
|
427
382
|
return {
|
|
428
383
|
nextLinkNames: [nextLinkNames],
|
|
429
|
-
itemNames: [itemNames]
|
|
384
|
+
itemNames: [itemNames],
|
|
430
385
|
};
|
|
431
386
|
}
|
|
432
387
|
return undefined;
|
|
433
388
|
}
|
|
434
389
|
|
|
435
|
-
export function isPagingOperation(
|
|
436
|
-
dpgContext: SdkContext,
|
|
437
|
-
operation: HttpOperation
|
|
438
|
-
) {
|
|
390
|
+
export function isPagingOperation(dpgContext: SdkContext, operation: HttpOperation) {
|
|
439
391
|
const { program } = dpgContext;
|
|
440
392
|
if (getDisablePageable(dpgContext, operation.operation)) {
|
|
441
393
|
return false;
|
|
@@ -446,10 +398,9 @@ export function isPagingOperation(
|
|
|
446
398
|
|
|
447
399
|
function mapFirstSegmentForResultSegments(
|
|
448
400
|
resultSegments: ModelProperty[] | undefined,
|
|
449
|
-
responses: HttpOperationResponse[]
|
|
401
|
+
responses: HttpOperationResponse[],
|
|
450
402
|
): ModelProperty[] | undefined {
|
|
451
|
-
const pagingBodyType = responses.find((r) => r.statusCodes === 200)
|
|
452
|
-
?.responses[0]?.body;
|
|
403
|
+
const pagingBodyType = responses.find((r) => r.statusCodes === 200)?.responses[0]?.body;
|
|
453
404
|
if (!pagingBodyType || pagingBodyType.bodyKind !== "single") return undefined;
|
|
454
405
|
const bodyType = pagingBodyType.type;
|
|
455
406
|
|
|
@@ -468,8 +419,7 @@ function mapFirstSegmentForResultSegments(
|
|
|
468
419
|
if (
|
|
469
420
|
property &&
|
|
470
421
|
segment &&
|
|
471
|
-
findRootSourceProperty(property[1]) ===
|
|
472
|
-
findRootSourceProperty(segment)
|
|
422
|
+
findRootSourceProperty(property[1]) === findRootSourceProperty(segment)
|
|
473
423
|
) {
|
|
474
424
|
return [property[1], ...resultSegments.slice(i + 1)];
|
|
475
425
|
}
|
|
@@ -500,10 +450,7 @@ export function hasPagingOperations(client: SdkClient, dpgContext: SdkContext) {
|
|
|
500
450
|
return false;
|
|
501
451
|
}
|
|
502
452
|
|
|
503
|
-
export function hasCollectionFormatInfo(
|
|
504
|
-
paramType: string,
|
|
505
|
-
paramFormat: string
|
|
506
|
-
) {
|
|
453
|
+
export function hasCollectionFormatInfo(paramType: string, paramFormat: string) {
|
|
507
454
|
return (
|
|
508
455
|
getHasMultiCollection(paramType, paramFormat, false) ||
|
|
509
456
|
getHasSsvCollection(paramType, paramFormat) ||
|
|
@@ -517,13 +464,13 @@ export function hasCollectionFormatInfo(
|
|
|
517
464
|
export function getSpecialSerializeInfo(
|
|
518
465
|
dpgContext: SdkContext,
|
|
519
466
|
paramType: string,
|
|
520
|
-
paramFormat: string
|
|
467
|
+
paramFormat: string,
|
|
521
468
|
) {
|
|
522
469
|
const hasMultiCollection = getHasMultiCollection(
|
|
523
470
|
paramType,
|
|
524
471
|
paramFormat,
|
|
525
472
|
// Include query multi support in compatibility mode
|
|
526
|
-
dpgContext.rlcOptions?.compatibilityQueryMultiFormat ?? false
|
|
473
|
+
dpgContext.rlcOptions?.compatibilityQueryMultiFormat ?? false,
|
|
527
474
|
);
|
|
528
475
|
const hasCsvCollection = getHasCsvCollection(paramType, paramFormat);
|
|
529
476
|
const descriptions = [];
|
|
@@ -541,15 +488,11 @@ export function getSpecialSerializeInfo(
|
|
|
541
488
|
hasMultiCollection,
|
|
542
489
|
hasCsvCollection,
|
|
543
490
|
descriptions,
|
|
544
|
-
collectionInfo
|
|
491
|
+
collectionInfo,
|
|
545
492
|
};
|
|
546
493
|
}
|
|
547
494
|
|
|
548
|
-
function getHasMultiCollection(
|
|
549
|
-
paramType: string,
|
|
550
|
-
paramFormat: string,
|
|
551
|
-
includeQuery = true
|
|
552
|
-
) {
|
|
495
|
+
function getHasMultiCollection(paramType: string, paramFormat: string, includeQuery = true) {
|
|
553
496
|
return (
|
|
554
497
|
((includeQuery && paramType === "query") || paramType === "header") &&
|
|
555
498
|
paramFormat === KnownCollectionFormat.Multi
|
|
@@ -557,8 +500,7 @@ function getHasMultiCollection(
|
|
|
557
500
|
}
|
|
558
501
|
function getHasSsvCollection(paramType: string, paramFormat: string) {
|
|
559
502
|
return (
|
|
560
|
-
(paramType === "query" || paramType === "property") &&
|
|
561
|
-
paramFormat === KnownCollectionFormat.Ssv
|
|
503
|
+
(paramType === "query" || paramType === "property") && paramFormat === KnownCollectionFormat.Ssv
|
|
562
504
|
);
|
|
563
505
|
}
|
|
564
506
|
|
|
@@ -581,9 +523,7 @@ function getHasPipeCollection(paramType: string, paramFormat: string) {
|
|
|
581
523
|
}
|
|
582
524
|
|
|
583
525
|
function getHasNewlineCollection(paramType: string, paramFormat: string) {
|
|
584
|
-
return
|
|
585
|
-
paramType === "property" && paramFormat === KnownCollectionFormat.Newline
|
|
586
|
-
);
|
|
526
|
+
return paramType === "property" && paramFormat === KnownCollectionFormat.Newline;
|
|
587
527
|
}
|
|
588
528
|
|
|
589
529
|
export function getCollectionFormatHelper(format: string) {
|
|
@@ -641,15 +581,11 @@ export enum KnownCollectionFormat {
|
|
|
641
581
|
Tsv = "tsv",
|
|
642
582
|
Pipes = "pipes",
|
|
643
583
|
Newline = "newline",
|
|
644
|
-
Multi = "multi"
|
|
584
|
+
Multi = "multi",
|
|
645
585
|
}
|
|
646
586
|
|
|
647
|
-
export function getCustomRequestHeaderNameForOperation(
|
|
648
|
-
route
|
|
649
|
-
): string | undefined {
|
|
650
|
-
const params = route.parameters.parameters.filter(
|
|
651
|
-
isCustomClientRequestIdParam
|
|
652
|
-
);
|
|
587
|
+
export function getCustomRequestHeaderNameForOperation(route: HttpOperation): string | undefined {
|
|
588
|
+
const params = route.parameters.parameters.filter(isCustomClientRequestIdParam);
|
|
653
589
|
if (params.length > 0) {
|
|
654
590
|
return "client-request-id";
|
|
655
591
|
}
|
|
@@ -658,18 +594,14 @@ export function getCustomRequestHeaderNameForOperation(
|
|
|
658
594
|
}
|
|
659
595
|
|
|
660
596
|
export function isCustomClientRequestIdParam(param: HttpOperationParameter) {
|
|
661
|
-
return (
|
|
662
|
-
param.type === "header" && param.name.toLowerCase() === "client-request-id"
|
|
663
|
-
);
|
|
597
|
+
return param.type === "header" && param.name.toLowerCase() === "client-request-id";
|
|
664
598
|
}
|
|
665
599
|
|
|
666
600
|
export function isIgnoredHeaderParam(param: HttpOperationParameter) {
|
|
667
601
|
return (
|
|
668
602
|
isCustomClientRequestIdParam(param) ||
|
|
669
603
|
(param.type === "header" &&
|
|
670
|
-
["return-client-request-id", "ocp-date"].includes(
|
|
671
|
-
param.name.toLowerCase()
|
|
672
|
-
))
|
|
604
|
+
["return-client-request-id", "ocp-date"].includes(param.name.toLowerCase()))
|
|
673
605
|
);
|
|
674
606
|
}
|
|
675
607
|
|
|
@@ -677,29 +609,22 @@ export type ServiceOperation = SdkServiceMethod<SdkHttpOperation> & {
|
|
|
677
609
|
oriName?: string;
|
|
678
610
|
};
|
|
679
611
|
|
|
680
|
-
export type ServiceParameter = (
|
|
681
|
-
| SdkMethodParameter
|
|
682
|
-
| SdkHttpParameter
|
|
683
|
-
| SdkBodyParameter
|
|
684
|
-
) & {
|
|
612
|
+
export type ServiceParameter = (SdkMethodParameter | SdkHttpParameter | SdkBodyParameter) & {
|
|
685
613
|
oriName?: string;
|
|
686
614
|
};
|
|
687
615
|
|
|
688
616
|
export function getMethodHierarchiesMap(
|
|
689
617
|
context: SdkContext,
|
|
690
|
-
client: SdkClientType<SdkServiceOperation
|
|
618
|
+
client: SdkClientType<SdkServiceOperation>,
|
|
691
619
|
): Map<string, ServiceOperation[]> {
|
|
692
620
|
const methodQueue: [
|
|
693
621
|
string[],
|
|
694
|
-
SdkMethod<SdkHttpOperation> | SdkClientType<SdkServiceOperation
|
|
622
|
+
SdkMethod<SdkHttpOperation> | SdkClientType<SdkServiceOperation>,
|
|
695
623
|
][] =
|
|
696
624
|
client.children
|
|
697
625
|
?.filter((p) => {
|
|
698
626
|
return (
|
|
699
|
-
!(
|
|
700
|
-
p.clientInitialization.initializedBy &
|
|
701
|
-
InitializedByFlags.Individually
|
|
702
|
-
) &&
|
|
627
|
+
!(p.clientInitialization.initializedBy & InitializedByFlags.Individually) &&
|
|
703
628
|
!(p.clientInitialization.initializedBy & InitializedByFlags.Parent)
|
|
704
629
|
);
|
|
705
630
|
})
|
|
@@ -728,36 +653,25 @@ export function getMethodHierarchiesMap(
|
|
|
728
653
|
|
|
729
654
|
if (operationOrGroup.kind === "client") {
|
|
730
655
|
operationOrGroup.methods.forEach((m) =>
|
|
731
|
-
methodQueue.push([[...prefixes, operationOrGroup.name], m])
|
|
732
|
-
);
|
|
733
|
-
const nonIndependentChildren = operationOrGroup.children?.filter(
|
|
734
|
-
(child) => {
|
|
735
|
-
return (
|
|
736
|
-
!(
|
|
737
|
-
child.clientInitialization.initializedBy &
|
|
738
|
-
InitializedByFlags.Individually
|
|
739
|
-
) &&
|
|
740
|
-
!(
|
|
741
|
-
child.clientInitialization.initializedBy &
|
|
742
|
-
InitializedByFlags.Parent
|
|
743
|
-
)
|
|
744
|
-
);
|
|
745
|
-
}
|
|
656
|
+
methodQueue.push([[...prefixes, operationOrGroup.name], m]),
|
|
746
657
|
);
|
|
658
|
+
const nonIndependentChildren = operationOrGroup.children?.filter((child) => {
|
|
659
|
+
return (
|
|
660
|
+
!(child.clientInitialization.initializedBy & InitializedByFlags.Individually) &&
|
|
661
|
+
!(child.clientInitialization.initializedBy & InitializedByFlags.Parent)
|
|
662
|
+
);
|
|
663
|
+
});
|
|
747
664
|
if (nonIndependentChildren && nonIndependentChildren.length > 0) {
|
|
748
665
|
nonIndependentChildren.forEach((child) =>
|
|
749
|
-
methodQueue.push([[...prefixes, operationOrGroup.name], child])
|
|
666
|
+
methodQueue.push([[...prefixes, operationOrGroup.name], child]),
|
|
750
667
|
);
|
|
751
668
|
}
|
|
752
669
|
} else {
|
|
753
670
|
const prefixKey =
|
|
754
|
-
context.rlcOptions?.hierarchyClient ||
|
|
755
|
-
context.rlcOptions?.enableOperationGroup
|
|
671
|
+
context.rlcOptions?.hierarchyClient || context.rlcOptions?.enableOperationGroup
|
|
756
672
|
? prefixes.join("/")
|
|
757
673
|
: "";
|
|
758
|
-
const groupName = prefixes
|
|
759
|
-
.map((p) => normalizeName(p, NameType.OperationGroup))
|
|
760
|
-
.join("");
|
|
674
|
+
const groupName = prefixes.map((p) => normalizeName(p, NameType.OperationGroup)).join("");
|
|
761
675
|
if (
|
|
762
676
|
context.rlcOptions?.hierarchyClient === false &&
|
|
763
677
|
context.rlcOptions?.enableOperationGroup &&
|
|
@@ -774,19 +688,14 @@ export function getMethodHierarchiesMap(
|
|
|
774
688
|
operationOrGroup.operation.parameters.map((p) => {
|
|
775
689
|
return resolveParameterNameConflict(operationOrGroup, p);
|
|
776
690
|
});
|
|
777
|
-
if (
|
|
778
|
-
operationOrGroup.operation.bodyParam?.name === operationOrGroup.name
|
|
779
|
-
) {
|
|
691
|
+
if (operationOrGroup.operation.bodyParam?.name === operationOrGroup.name) {
|
|
780
692
|
operationOrGroup.operation.bodyParam = resolveParameterNameConflict(
|
|
781
693
|
operationOrGroup,
|
|
782
|
-
operationOrGroup.operation.bodyParam
|
|
694
|
+
operationOrGroup.operation.bodyParam,
|
|
783
695
|
) as SdkBodyParameter;
|
|
784
696
|
}
|
|
785
697
|
const operations = operationHierarchiesMap.get(prefixKey);
|
|
786
|
-
operationHierarchiesMap.set(prefixKey, [
|
|
787
|
-
...(operations ?? []),
|
|
788
|
-
operationOrGroup
|
|
789
|
-
]);
|
|
698
|
+
operationHierarchiesMap.set(prefixKey, [...(operations ?? []), operationOrGroup]);
|
|
790
699
|
}
|
|
791
700
|
}
|
|
792
701
|
return operationHierarchiesMap;
|
|
@@ -794,12 +703,11 @@ export function getMethodHierarchiesMap(
|
|
|
794
703
|
|
|
795
704
|
export function isTenantLevelOperation(
|
|
796
705
|
operation: ServiceOperation,
|
|
797
|
-
client: SdkClientType<SdkServiceOperation
|
|
706
|
+
client: SdkClientType<SdkServiceOperation>,
|
|
798
707
|
): boolean {
|
|
799
708
|
// Check if this operation has a subscriptionId path parameter
|
|
800
709
|
const subscriptionIdParam = operation.operation.parameters?.find(
|
|
801
|
-
(param) =>
|
|
802
|
-
param.name.toLowerCase() === "subscriptionid" && param.kind === "path"
|
|
710
|
+
(param) => param.name.toLowerCase() === "subscriptionid" && param.kind === "path",
|
|
803
711
|
);
|
|
804
712
|
|
|
805
713
|
if (subscriptionIdParam) {
|
|
@@ -829,7 +737,7 @@ export function isTenantLevelOperation(
|
|
|
829
737
|
|
|
830
738
|
function resolveParameterNameConflict(
|
|
831
739
|
operationOrGroup: SdkServiceMethod<SdkHttpOperation>,
|
|
832
|
-
p: ServiceParameter
|
|
740
|
+
p: ServiceParameter,
|
|
833
741
|
): ServiceParameter {
|
|
834
742
|
// When the name starts with $DO_NOT_NORMALIZE$, record the original name so that
|
|
835
743
|
// subsequent calls (e.g. emitNonModelResponseTypes then buildApiOptions both call
|
|
@@ -841,7 +749,7 @@ function resolveParameterNameConflict(
|
|
|
841
749
|
true,
|
|
842
750
|
undefined,
|
|
843
751
|
undefined,
|
|
844
|
-
p.oriName
|
|
752
|
+
p.oriName,
|
|
845
753
|
);
|
|
846
754
|
if (!p.oriName) {
|
|
847
755
|
p.oriName = p.name;
|