@azure-tools/typespec-ts 0.54.0-dev.6 → 0.54.0-dev.8
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/dist/src/contextManager.d.ts +5 -5
- package/dist/src/contextManager.d.ts.map +1 -1
- 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 +12 -20
- 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 -11
- 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 +12 -25
- 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 +1 -1
- 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 +70 -48
- 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 +49 -62
- 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 +4 -7
- 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 +30 -36
- 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 +2 -2
- 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 +22 -23
- 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 +7 -9
- 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 +11 -11
- 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 +30 -39
- 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 -17
- 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 +2 -2
- 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 +54 -72
- 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 +6 -7
- 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 +40 -52
- 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 +9 -12
- 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 +27 -36
- 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 +20 -38
- 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.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 +39 -58
- 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 +4 -5
- 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 +136 -196
- 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 +1 -1
- 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 +50 -56
- 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 +52 -59
- 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 +43 -51
- 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 +4 -11
- 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 -1
- 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 +7 -9
- 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.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 +4 -8
- 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 +48 -66
- 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 +24 -42
- 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 +57 -57
- 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 +32 -35
- 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 +3 -3
- 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 +3 -3
- 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 +31 -48
- 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 +63 -50
- 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 +5 -5
- 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 +19 -22
- 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 +2 -3
- 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 +23 -25
- 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.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.js +8 -13
- 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 +8 -12
- package/dist/src/rlc-common/helpers/operationHelpers.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 +1 -1
- 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 +1 -2
- package/dist/src/rlc-common/helpers/typeUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js +3 -4
- 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 +13 -13
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildChangelogFile.js +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.js +3 -5
- 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 +16 -16
- 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 +10 -18
- 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 +3 -4
- 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 +2 -3
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTestConfig.js +8 -8
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.js +23 -21
- 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 -4
- 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 +2 -2
- 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 +13 -13
- 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 +22 -26
- 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 +26 -29
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +1 -1
- package/dist/src/rlc-common/test/buildKarmaConfig.js +1 -1
- package/dist/src/rlc-common/test/buildRecordedClient.js +3 -3
- package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.js +2 -2
- 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 +4 -6
- 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 +19 -23
- 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 +10 -11
- 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 +8 -10
- 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 +9 -11
- 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 +22 -28
- 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 +11 -12
- 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 +12 -12
- 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 -15
- 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 +14 -26
- 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 +11 -14
- 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 +3 -3
- 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 +8 -12
- 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 +4 -6
- package/dist/src/utils/emitUtil.js.map +1 -1
- package/dist/src/utils/fileSystemUtils.d.ts.map +1 -1
- package/dist/src/utils/fileSystemUtils.js +2 -2
- 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 +2 -4
- 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 +108 -171
- 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 +2 -2
- 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 +29 -42
- 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 +19 -22
- 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 +1 -3
- 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 +139 -180
- 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 -159
- 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 +91 -177
- 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 +97 -209
- 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 -21
- 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 +43 -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 -115
- 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 +4 -6
- 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 +15 -28
- 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.ts +2 -2
- 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 +41 -89
- package/static/static-helpers/simplePollerHelpers.ts +9 -18
- 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,50 +1,43 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
NameType,
|
|
4
|
-
isAzurePackage,
|
|
5
|
-
normalizeName
|
|
6
|
-
} from "../rlc-common/index.js";
|
|
1
|
+
import { NameType, isAzurePackage, normalizeName } from "../rlc-common/index.js";
|
|
7
2
|
import {
|
|
8
3
|
buildGetClientCredentialParam,
|
|
9
4
|
buildGetClientEndpointParam,
|
|
10
5
|
buildGetClientOptionsParam,
|
|
11
6
|
getClientParameterName,
|
|
12
7
|
getClientParameters,
|
|
13
|
-
getClientParametersDeclaration
|
|
8
|
+
getClientParametersDeclaration,
|
|
14
9
|
} from "./helpers/clientHelpers.js";
|
|
10
|
+
import { ModularEmitterOptions } from "./interfaces.js";
|
|
15
11
|
|
|
16
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
17
|
-
import { SourceFile } from "ts-morph";
|
|
18
|
-
import {
|
|
19
|
-
getClassicalClientName,
|
|
20
|
-
getClientName
|
|
21
|
-
} from "./helpers/namingHelpers.js";
|
|
22
|
-
import { getDocsFromDescription } from "./helpers/docsHelpers.js";
|
|
23
|
-
import { getTypeExpression } from "./type-expressions/get-type-expression.js";
|
|
24
|
-
import { resolveReference } from "../framework/reference.js";
|
|
25
|
-
import { useDependencies } from "../framework/hooks/useDependencies.js";
|
|
26
|
-
import { buildEnumTypes, getApiVersionEnum } from "./emitModels.js";
|
|
27
12
|
import {
|
|
28
13
|
SdkClientType,
|
|
29
14
|
SdkCredentialParameter,
|
|
30
15
|
SdkEndpointParameter,
|
|
31
16
|
SdkHttpParameter,
|
|
32
17
|
SdkMethodParameter,
|
|
33
|
-
SdkServiceOperation
|
|
18
|
+
SdkServiceOperation,
|
|
34
19
|
} from "@azure-tools/typespec-client-generator-core";
|
|
35
|
-
import {
|
|
20
|
+
import { NoTarget } from "@typespec/compiler";
|
|
21
|
+
import { SourceFile } from "ts-morph";
|
|
36
22
|
import { useContext } from "../contextManager.js";
|
|
23
|
+
import { useDependencies } from "../framework/hooks/useDependencies.js";
|
|
24
|
+
import { resolveReference } from "../framework/reference.js";
|
|
37
25
|
import { refkey } from "../framework/refkey.js";
|
|
38
26
|
import { reportDiagnostic } from "../lib.js";
|
|
39
|
-
import {
|
|
27
|
+
import { getModularClientOptions } from "../utils/clientUtils.js";
|
|
28
|
+
import { SdkContext } from "../utils/interfaces.js";
|
|
29
|
+
import { buildEnumTypes, getApiVersionEnum } from "./emitModels.js";
|
|
30
|
+
import { getDocsFromDescription } from "./helpers/docsHelpers.js";
|
|
31
|
+
import { getClassicalClientName, getClientName } from "./helpers/namingHelpers.js";
|
|
40
32
|
import { CloudSettingHelpers } from "./static-helpers-metadata.js";
|
|
33
|
+
import { getTypeExpression } from "./type-expressions/get-type-expression.js";
|
|
41
34
|
|
|
42
35
|
/**
|
|
43
36
|
* This function gets the path of the file containing the modular client context
|
|
44
37
|
*/
|
|
45
38
|
export function getClientContextPath(
|
|
46
39
|
clientMap: [string[], SdkClientType<SdkServiceOperation>],
|
|
47
|
-
emitterOptions: ModularEmitterOptions
|
|
40
|
+
emitterOptions: ModularEmitterOptions,
|
|
48
41
|
): string {
|
|
49
42
|
const [_, client] = clientMap;
|
|
50
43
|
const { subfolder } = getModularClientOptions(clientMap);
|
|
@@ -62,7 +55,7 @@ export function getClientContextPath(
|
|
|
62
55
|
export function buildClientContext(
|
|
63
56
|
dpgContext: SdkContext,
|
|
64
57
|
clientMap: [string[], SdkClientType<SdkServiceOperation>],
|
|
65
|
-
emitterOptions: ModularEmitterOptions
|
|
58
|
+
emitterOptions: ModularEmitterOptions,
|
|
66
59
|
): SourceFile {
|
|
67
60
|
const project = useContext("outputProject");
|
|
68
61
|
const dependencies = useDependencies();
|
|
@@ -72,40 +65,36 @@ export function buildClientContext(
|
|
|
72
65
|
const requiredParams = getClientParametersDeclaration(client, dpgContext, {
|
|
73
66
|
onClientOnly: false,
|
|
74
67
|
requiredOnly: true,
|
|
75
|
-
apiVersionAsRequired: true
|
|
68
|
+
apiVersionAsRequired: true,
|
|
76
69
|
});
|
|
77
70
|
const clientContextFile = project.createSourceFile(
|
|
78
|
-
getClientContextPath(clientMap, emitterOptions)
|
|
71
|
+
getClientContextPath(clientMap, emitterOptions),
|
|
79
72
|
);
|
|
80
73
|
|
|
81
74
|
// Get all client parameters (both required and optional) for the interface
|
|
82
75
|
const requiredInterfaceProperties = getClientParameters(client, dpgContext, {
|
|
83
76
|
onClientOnly: false,
|
|
84
|
-
requiredOnly: true
|
|
77
|
+
requiredOnly: true,
|
|
85
78
|
})
|
|
86
79
|
.filter((p) => {
|
|
87
80
|
const clientParamName = getClientParameterName(p);
|
|
88
|
-
return
|
|
89
|
-
clientParamName !== "endpointParam" && clientParamName !== "credential"
|
|
90
|
-
);
|
|
81
|
+
return clientParamName !== "endpointParam" && clientParamName !== "credential";
|
|
91
82
|
})
|
|
92
83
|
.map((p) => {
|
|
93
84
|
return {
|
|
94
85
|
name: getClientParameterName(p),
|
|
95
86
|
type: getTypeExpression(dpgContext, p.type),
|
|
96
87
|
hasQuestionToken: false,
|
|
97
|
-
docs: getDocsWithKnownVersion(dpgContext, p)
|
|
88
|
+
docs: getDocsWithKnownVersion(dpgContext, p),
|
|
98
89
|
};
|
|
99
90
|
});
|
|
100
91
|
|
|
101
92
|
// Collect names of required properties to avoid duplicates
|
|
102
|
-
const requiredPropertyNames = new Set(
|
|
103
|
-
requiredInterfaceProperties.map((p) => p.name)
|
|
104
|
-
);
|
|
93
|
+
const requiredPropertyNames = new Set(requiredInterfaceProperties.map((p) => p.name));
|
|
105
94
|
|
|
106
95
|
const optionalInterfaceProperties = getClientParameters(client, dpgContext, {
|
|
107
96
|
onClientOnly: false,
|
|
108
|
-
optionalOnly: true
|
|
97
|
+
optionalOnly: true,
|
|
109
98
|
})
|
|
110
99
|
.filter((p) => {
|
|
111
100
|
const clientParamName = getClientParameterName(p);
|
|
@@ -121,7 +110,7 @@ export function buildClientContext(
|
|
|
121
110
|
name: getClientParameterName(p),
|
|
122
111
|
type: getTypeExpression(dpgContext, p.type),
|
|
123
112
|
hasQuestionToken: true,
|
|
124
|
-
docs: getDocsWithKnownVersion(dpgContext, p)
|
|
113
|
+
docs: getDocsWithKnownVersion(dpgContext, p),
|
|
125
114
|
};
|
|
126
115
|
});
|
|
127
116
|
|
|
@@ -130,22 +119,20 @@ export function buildClientContext(
|
|
|
130
119
|
name: `${rlcClientName}`,
|
|
131
120
|
extends: [resolveReference(dependencies.Client)],
|
|
132
121
|
docs: getDocsFromDescription(client.doc),
|
|
133
|
-
properties: [...requiredInterfaceProperties, ...optionalInterfaceProperties]
|
|
122
|
+
properties: [...requiredInterfaceProperties, ...optionalInterfaceProperties],
|
|
134
123
|
});
|
|
135
124
|
|
|
136
125
|
const propertiesInOptions = getClientParameters(client, dpgContext, {
|
|
137
|
-
optionalOnly: true
|
|
126
|
+
optionalOnly: true,
|
|
138
127
|
})
|
|
139
128
|
.filter((p) => getClientParameterName(p) !== "endpoint")
|
|
140
129
|
.map((p) => {
|
|
141
130
|
return {
|
|
142
131
|
name: getClientParameterName(p),
|
|
143
132
|
type:
|
|
144
|
-
p.name.toLowerCase() === "apiversion"
|
|
145
|
-
? "string"
|
|
146
|
-
: getTypeExpression(dpgContext, p.type),
|
|
133
|
+
p.name.toLowerCase() === "apiversion" ? "string" : getTypeExpression(dpgContext, p.type),
|
|
147
134
|
hasQuestionToken: true,
|
|
148
|
-
docs: getDocsWithKnownVersion(dpgContext, p)
|
|
135
|
+
docs: getDocsWithKnownVersion(dpgContext, p),
|
|
149
136
|
};
|
|
150
137
|
});
|
|
151
138
|
if (dpgContext.arm) {
|
|
@@ -153,7 +140,7 @@ export function buildClientContext(
|
|
|
153
140
|
name: "cloudSetting",
|
|
154
141
|
type: `${resolveReference(CloudSettingHelpers.AzureSupportedClouds)}`,
|
|
155
142
|
hasQuestionToken: true,
|
|
156
|
-
docs: [`Specifies the Azure cloud environment for the client.`]
|
|
143
|
+
docs: [`Specifies the Azure cloud environment for the client.`],
|
|
157
144
|
});
|
|
158
145
|
}
|
|
159
146
|
// check if we have duplication options
|
|
@@ -163,7 +150,7 @@ export function buildClientContext(
|
|
|
163
150
|
reportDiagnostic(dpgContext.program, {
|
|
164
151
|
code: "parameter-name-conflict",
|
|
165
152
|
format: { parameterName: property.name },
|
|
166
|
-
target: NoTarget
|
|
153
|
+
target: NoTarget,
|
|
167
154
|
});
|
|
168
155
|
}
|
|
169
156
|
existingOptionNames.add(property.name);
|
|
@@ -173,7 +160,7 @@ export function buildClientContext(
|
|
|
173
160
|
isExported: true,
|
|
174
161
|
extends: [resolveReference(dependencies.ClientOptions)],
|
|
175
162
|
properties: propertiesInOptions,
|
|
176
|
-
docs: ["Optional parameters for the client."]
|
|
163
|
+
docs: ["Optional parameters for the client."],
|
|
177
164
|
});
|
|
178
165
|
|
|
179
166
|
// TODO use binder here
|
|
@@ -181,7 +168,7 @@ export function buildClientContext(
|
|
|
181
168
|
if (isAzurePackage(emitterOptions)) {
|
|
182
169
|
clientContextFile.addImportDeclaration({
|
|
183
170
|
moduleSpecifier: "../".repeat(hierarchy.length + 1) + "logger.js",
|
|
184
|
-
namedImports: ["logger"]
|
|
171
|
+
namedImports: ["logger"],
|
|
185
172
|
});
|
|
186
173
|
}
|
|
187
174
|
|
|
@@ -191,38 +178,36 @@ export function buildClientContext(
|
|
|
191
178
|
returnType: `${rlcClientName}`,
|
|
192
179
|
parameters: getClientParametersDeclaration(client, dpgContext, {
|
|
193
180
|
onClientOnly: false,
|
|
194
|
-
requiredOnly: true
|
|
181
|
+
requiredOnly: true,
|
|
195
182
|
}),
|
|
196
|
-
isExported: true
|
|
183
|
+
isExported: true,
|
|
197
184
|
});
|
|
198
185
|
|
|
199
|
-
const { endpointParamName: endpointParam, assignedOptionalParams } =
|
|
200
|
-
|
|
186
|
+
const { endpointParamName: endpointParam, assignedOptionalParams } = buildGetClientEndpointParam(
|
|
187
|
+
factoryFunction,
|
|
188
|
+
dpgContext,
|
|
189
|
+
client,
|
|
190
|
+
);
|
|
201
191
|
const credentialParam = buildGetClientCredentialParam(client, emitterOptions);
|
|
202
192
|
|
|
203
193
|
// Get api version param early so we can use its name when building options
|
|
204
|
-
const apiVersionParam = getClientParameters(client, dpgContext).find(
|
|
205
|
-
|
|
206
|
-
);
|
|
207
|
-
const apiVersionParamName = apiVersionParam
|
|
208
|
-
? getClientParameterName(apiVersionParam)
|
|
209
|
-
: undefined;
|
|
194
|
+
const apiVersionParam = getClientParameters(client, dpgContext).find((x) => x.isApiVersionParam);
|
|
195
|
+
const apiVersionParamName = apiVersionParam ? getClientParameterName(apiVersionParam) : undefined;
|
|
210
196
|
|
|
211
197
|
const optionsParam = buildGetClientOptionsParam(
|
|
212
198
|
factoryFunction,
|
|
213
199
|
emitterOptions,
|
|
214
200
|
endpointParam,
|
|
215
|
-
apiVersionParamName
|
|
201
|
+
apiVersionParamName,
|
|
216
202
|
);
|
|
217
203
|
|
|
218
204
|
factoryFunction.addStatements(
|
|
219
205
|
`const clientContext = ${resolveReference(
|
|
220
|
-
dependencies.getClient
|
|
221
|
-
)}(${endpointParam}, ${credentialParam}, ${optionsParam})
|
|
206
|
+
dependencies.getClient,
|
|
207
|
+
)}(${endpointParam}, ${credentialParam}, ${optionsParam});`,
|
|
222
208
|
);
|
|
223
209
|
|
|
224
|
-
const { customHttpAuthHeaderName, customHttpAuthSharedKeyPrefix } =
|
|
225
|
-
emitterOptions.options;
|
|
210
|
+
const { customHttpAuthHeaderName, customHttpAuthSharedKeyPrefix } = emitterOptions.options;
|
|
226
211
|
|
|
227
212
|
if (customHttpAuthHeaderName && customHttpAuthSharedKeyPrefix) {
|
|
228
213
|
factoryFunction.addStatements(`
|
|
@@ -242,7 +227,7 @@ export function buildClientContext(
|
|
|
242
227
|
const endpointParameter = getClientParameters(client, dpgContext, {
|
|
243
228
|
onClientOnly: false,
|
|
244
229
|
requiredOnly: true,
|
|
245
|
-
skipEndpointTemplate: true
|
|
230
|
+
skipEndpointTemplate: true,
|
|
246
231
|
}).find((x) => x.kind === "endpoint");
|
|
247
232
|
if (apiVersionParam) {
|
|
248
233
|
const templateArguments =
|
|
@@ -270,10 +255,7 @@ export function buildClientContext(
|
|
|
270
255
|
factoryFunction.addStatements(apiVersionStatement);
|
|
271
256
|
|
|
272
257
|
const contextRequiredParam = requiredParams.filter(
|
|
273
|
-
(p) =>
|
|
274
|
-
p.name !== "endpointParam" &&
|
|
275
|
-
p.name !== "credential" &&
|
|
276
|
-
p.name !== "options"
|
|
258
|
+
(p) => p.name !== "endpointParam" && p.name !== "credential" && p.name !== "options",
|
|
277
259
|
);
|
|
278
260
|
|
|
279
261
|
// Collect names of required parameters to avoid duplicates
|
|
@@ -282,7 +264,7 @@ export function buildClientContext(
|
|
|
282
264
|
// Also include optional parameters from clientInitialization that should be passed through
|
|
283
265
|
const contextOptionalParams = getClientParameters(client, dpgContext, {
|
|
284
266
|
optionalOnly: true,
|
|
285
|
-
onClientOnly: false
|
|
267
|
+
onClientOnly: false,
|
|
286
268
|
}).filter((p) => {
|
|
287
269
|
const clientParamName = getClientParameterName(p);
|
|
288
270
|
return (
|
|
@@ -307,21 +289,18 @@ export function buildClientContext(
|
|
|
307
289
|
return clientParamName;
|
|
308
290
|
}
|
|
309
291
|
return `${clientParamName}: options.${clientParamName}`;
|
|
310
|
-
})
|
|
292
|
+
}),
|
|
311
293
|
];
|
|
312
294
|
|
|
313
295
|
if (allContextParams.length) {
|
|
314
296
|
factoryFunction.addStatements(
|
|
315
|
-
`return { ...clientContext, ${allContextParams.join(", ")}} as ${rlcClientName}
|
|
297
|
+
`return { ...clientContext, ${allContextParams.join(", ")}} as ${rlcClientName};`,
|
|
316
298
|
);
|
|
317
299
|
} else {
|
|
318
300
|
factoryFunction.addStatements(`return clientContext;`);
|
|
319
301
|
}
|
|
320
302
|
|
|
321
|
-
clientContextFile.fixMissingImports(
|
|
322
|
-
{},
|
|
323
|
-
{ importModuleSpecifierEnding: "js" }
|
|
324
|
-
);
|
|
303
|
+
clientContextFile.fixMissingImports({}, { importModuleSpecifierEnding: "js" });
|
|
325
304
|
|
|
326
305
|
clientContextFile.fixUnusedIdentifiers();
|
|
327
306
|
return clientContextFile;
|
|
@@ -329,11 +308,7 @@ export function buildClientContext(
|
|
|
329
308
|
|
|
330
309
|
function getDocsWithKnownVersion(
|
|
331
310
|
dpgContext: SdkContext,
|
|
332
|
-
param:
|
|
333
|
-
| SdkMethodParameter
|
|
334
|
-
| SdkEndpointParameter
|
|
335
|
-
| SdkCredentialParameter
|
|
336
|
-
| SdkHttpParameter
|
|
311
|
+
param: SdkMethodParameter | SdkEndpointParameter | SdkCredentialParameter | SdkHttpParameter,
|
|
337
312
|
) {
|
|
338
313
|
const docs = getDocsFromDescription(param.doc);
|
|
339
314
|
if (param.name.toLowerCase() !== "apiversion") {
|
|
@@ -341,13 +316,9 @@ function getDocsWithKnownVersion(
|
|
|
341
316
|
}
|
|
342
317
|
const apiVersionEnum = getApiVersionEnum(dpgContext);
|
|
343
318
|
if (apiVersionEnum) {
|
|
344
|
-
const [_, knownValuesEnum] = buildEnumTypes(
|
|
345
|
-
dpgContext,
|
|
346
|
-
apiVersionEnum,
|
|
347
|
-
true
|
|
348
|
-
);
|
|
319
|
+
const [_, knownValuesEnum] = buildEnumTypes(dpgContext, apiVersionEnum, true);
|
|
349
320
|
docs.push(
|
|
350
|
-
`Known values of {@link ${resolveReference(refkey(knownValuesEnum.name, "knownValues"))}} that the service accepts
|
|
321
|
+
`Known values of {@link ${resolveReference(refkey(knownValuesEnum.name, "knownValues"))}} that the service accepts.`,
|
|
351
322
|
);
|
|
352
323
|
}
|
|
353
324
|
return docs;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { ModularEmitterOptions } from "./interfaces.js";
|
|
2
1
|
import { SdkContext } from "../utils/interfaces.js";
|
|
2
|
+
import { ModularEmitterOptions } from "./interfaces.js";
|
|
3
3
|
|
|
4
4
|
let CASING: "camel" | "snake" = "snake";
|
|
5
5
|
|
|
6
6
|
export function transformModularEmitterOptions(
|
|
7
7
|
dpgContext: SdkContext,
|
|
8
8
|
modularSourcesRoot: string,
|
|
9
|
-
options: { casing: "snake" | "camel" } = { casing: "snake" }
|
|
9
|
+
options: { casing: "snake" | "camel" } = { casing: "snake" },
|
|
10
10
|
): ModularEmitterOptions {
|
|
11
11
|
CASING = options.casing ?? CASING;
|
|
12
12
|
const emitterOptions: ModularEmitterOptions = {
|
|
@@ -14,9 +14,8 @@ export function transformModularEmitterOptions(
|
|
|
14
14
|
modularOptions: {
|
|
15
15
|
sourceRoot: modularSourcesRoot,
|
|
16
16
|
compatibilityMode: !!dpgContext.rlcOptions?.compatibilityMode,
|
|
17
|
-
experimentalExtensibleEnums:
|
|
18
|
-
|
|
19
|
-
}
|
|
17
|
+
experimentalExtensibleEnums: !!dpgContext.rlcOptions?.experimentalExtensibleEnums,
|
|
18
|
+
},
|
|
20
19
|
};
|
|
21
20
|
|
|
22
21
|
return emitterOptions;
|
|
@@ -1,46 +1,39 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { InterfaceDeclarationStructure, SourceFile, StructureKind } from "ts-morph";
|
|
2
2
|
import { NameType, normalizeName } from "../rlc-common/index.js";
|
|
3
3
|
import {
|
|
4
|
-
SourceFile,
|
|
5
|
-
InterfaceDeclarationStructure,
|
|
6
|
-
StructureKind
|
|
7
|
-
} from "ts-morph";
|
|
8
|
-
import {
|
|
9
|
-
getDeserializePrivateFunction,
|
|
10
|
-
getDeserializeHeadersPrivateFunction,
|
|
11
4
|
getDeserializeExceptionHeadersPrivateFunction,
|
|
5
|
+
getDeserializeHeadersPrivateFunction,
|
|
6
|
+
getDeserializePrivateFunction,
|
|
12
7
|
getExpectedStatuses,
|
|
13
8
|
getOperationFunction,
|
|
14
9
|
getOperationOptionsName,
|
|
15
10
|
getSendPrivateFunction,
|
|
11
|
+
isLroAndPagingOperation,
|
|
16
12
|
isLroOnlyOperation,
|
|
17
|
-
isLroAndPagingOperation
|
|
18
13
|
} from "./helpers/operationHelpers.js";
|
|
14
|
+
import { ModularEmitterOptions } from "./interfaces.js";
|
|
19
15
|
|
|
20
|
-
import { OperationPathAndDeserDetails } from "./interfaces.js";
|
|
21
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
22
|
-
import { getDocsFromDescription } from "./helpers/docsHelpers.js";
|
|
23
|
-
import { getOperationName } from "./helpers/namingHelpers.js";
|
|
24
|
-
import {
|
|
25
|
-
getModularClientOptions,
|
|
26
|
-
isRLCMultiEndpoint
|
|
27
|
-
} from "../utils/clientUtils.js";
|
|
28
|
-
import { getTypeExpression } from "./type-expressions/get-type-expression.js";
|
|
29
16
|
import {
|
|
30
17
|
SdkClientType,
|
|
31
18
|
SdkMethodParameter,
|
|
32
|
-
SdkServiceOperation
|
|
19
|
+
SdkServiceOperation,
|
|
33
20
|
} from "@azure-tools/typespec-client-generator-core";
|
|
21
|
+
import { useContext } from "../contextManager.js";
|
|
22
|
+
import { addDeclaration } from "../framework/declaration.js";
|
|
23
|
+
import { useDependencies } from "../framework/hooks/useDependencies.js";
|
|
24
|
+
import { resolveReference } from "../framework/reference.js";
|
|
25
|
+
import { refkey } from "../framework/refkey.js";
|
|
26
|
+
import { getModularClientOptions, isRLCMultiEndpoint } from "../utils/clientUtils.js";
|
|
27
|
+
import { SdkContext } from "../utils/interfaces.js";
|
|
34
28
|
import {
|
|
35
29
|
getMethodHierarchiesMap,
|
|
30
|
+
hasDualFormatSupport,
|
|
36
31
|
ServiceOperation,
|
|
37
|
-
hasDualFormatSupport
|
|
38
32
|
} from "../utils/operationUtil.js";
|
|
39
|
-
import {
|
|
40
|
-
import {
|
|
41
|
-
import {
|
|
42
|
-
import {
|
|
43
|
-
import { useContext } from "../contextManager.js";
|
|
33
|
+
import { getDocsFromDescription } from "./helpers/docsHelpers.js";
|
|
34
|
+
import { getOperationName } from "./helpers/namingHelpers.js";
|
|
35
|
+
import { OperationPathAndDeserDetails } from "./interfaces.js";
|
|
36
|
+
import { getTypeExpression } from "./type-expressions/get-type-expression.js";
|
|
44
37
|
|
|
45
38
|
/**
|
|
46
39
|
* This function creates a file under /api for each operation group.
|
|
@@ -50,7 +43,7 @@ import { useContext } from "../contextManager.js";
|
|
|
50
43
|
export function buildOperationFiles(
|
|
51
44
|
dpgContext: SdkContext,
|
|
52
45
|
clientMap: [string[], SdkClientType<SdkServiceOperation>],
|
|
53
|
-
emitterOptions: ModularEmitterOptions
|
|
46
|
+
emitterOptions: ModularEmitterOptions,
|
|
54
47
|
) {
|
|
55
48
|
const project = useContext("outputProject");
|
|
56
49
|
const [_, client] = clientMap;
|
|
@@ -79,29 +72,23 @@ export function buildOperationFiles(
|
|
|
79
72
|
|
|
80
73
|
const operationGroupFile = project.createSourceFile(filepath);
|
|
81
74
|
operations.forEach((op) => {
|
|
82
|
-
const operationDeclaration = getOperationFunction(
|
|
83
|
-
dpgContext,
|
|
84
|
-
[prefixes, op],
|
|
85
|
-
clientType
|
|
86
|
-
);
|
|
75
|
+
const operationDeclaration = getOperationFunction(dpgContext, [prefixes, op], clientType);
|
|
87
76
|
const sendOperationDeclaration = getSendPrivateFunction(
|
|
88
77
|
dpgContext,
|
|
89
78
|
[prefixes, op],
|
|
90
79
|
clientType,
|
|
91
|
-
client
|
|
80
|
+
client,
|
|
92
81
|
);
|
|
93
|
-
const deserializeOperationDeclaration = getDeserializePrivateFunction(
|
|
82
|
+
const deserializeOperationDeclaration = getDeserializePrivateFunction(dpgContext, [
|
|
83
|
+
prefixes,
|
|
84
|
+
op,
|
|
85
|
+
]);
|
|
86
|
+
const deserializeHeadersDeclaration = getDeserializeHeadersPrivateFunction(dpgContext, op);
|
|
87
|
+
const deserializeExceptionHeadersDeclaration = getDeserializeExceptionHeadersPrivateFunction(
|
|
94
88
|
dpgContext,
|
|
95
|
-
|
|
89
|
+
op,
|
|
96
90
|
);
|
|
97
|
-
const
|
|
98
|
-
getDeserializeHeadersPrivateFunction(dpgContext, op);
|
|
99
|
-
const deserializeExceptionHeadersDeclaration =
|
|
100
|
-
getDeserializeExceptionHeadersPrivateFunction(dpgContext, op);
|
|
101
|
-
const functionsToAdd = [
|
|
102
|
-
sendOperationDeclaration,
|
|
103
|
-
deserializeOperationDeclaration
|
|
104
|
-
];
|
|
91
|
+
const functionsToAdd = [sendOperationDeclaration, deserializeOperationDeclaration];
|
|
105
92
|
if (deserializeHeadersDeclaration) {
|
|
106
93
|
functionsToAdd.push(deserializeHeadersDeclaration);
|
|
107
94
|
}
|
|
@@ -110,18 +97,13 @@ export function buildOperationFiles(
|
|
|
110
97
|
}
|
|
111
98
|
|
|
112
99
|
operationGroupFile.addFunctions(functionsToAdd);
|
|
113
|
-
addDeclaration(
|
|
114
|
-
operationGroupFile,
|
|
115
|
-
operationDeclaration,
|
|
116
|
-
refkey(op, "api")
|
|
117
|
-
);
|
|
100
|
+
addDeclaration(operationGroupFile, operationDeclaration, refkey(op, "api"));
|
|
118
101
|
});
|
|
119
102
|
|
|
120
|
-
const indexPathPrefix =
|
|
121
|
-
"../".repeat(prefixKey === "" ? 0 : prefixes.length) || "./";
|
|
103
|
+
const indexPathPrefix = "../".repeat(prefixKey === "" ? 0 : prefixes.length) || "./";
|
|
122
104
|
operationGroupFile.addImportDeclaration({
|
|
123
105
|
namedImports: [`${rlcClientName} as Client`],
|
|
124
|
-
moduleSpecifier: `${indexPathPrefix}index.js
|
|
106
|
+
moduleSpecifier: `${indexPathPrefix}index.js`,
|
|
125
107
|
});
|
|
126
108
|
operationGroupFile.fixUnusedIdentifiers();
|
|
127
109
|
|
|
@@ -136,7 +118,7 @@ export function buildOperationFiles(
|
|
|
136
118
|
export function buildOperationOptions(
|
|
137
119
|
context: SdkContext,
|
|
138
120
|
method: [string[], ServiceOperation],
|
|
139
|
-
sourceFile: SourceFile
|
|
121
|
+
sourceFile: SourceFile,
|
|
140
122
|
) {
|
|
141
123
|
const dependencies = useDependencies();
|
|
142
124
|
const operation = method[1];
|
|
@@ -144,10 +126,7 @@ export function buildOperationOptions(
|
|
|
144
126
|
.filter(
|
|
145
127
|
(p) =>
|
|
146
128
|
p.onClient === false &&
|
|
147
|
-
!(
|
|
148
|
-
p.isGeneratedName &&
|
|
149
|
-
(p.name === "contentType" || p.name !== "accept")
|
|
150
|
-
)
|
|
129
|
+
!(p.isGeneratedName && (p.name === "contentType" || p.name !== "accept")),
|
|
151
130
|
)
|
|
152
131
|
.filter((p) => p.optional || p.clientDefaultValue);
|
|
153
132
|
const options: SdkMethodParameter[] = [...optionalParameters];
|
|
@@ -157,7 +136,7 @@ export function buildOperationOptions(
|
|
|
157
136
|
name: "updateIntervalInMs",
|
|
158
137
|
type: "number",
|
|
159
138
|
hasQuestionToken: true,
|
|
160
|
-
docs: ["Delay to wait until next poll, in milliseconds."]
|
|
139
|
+
docs: ["Delay to wait until next poll, in milliseconds."],
|
|
161
140
|
};
|
|
162
141
|
|
|
163
142
|
// Check if this operation supports both JSON and XML content types
|
|
@@ -170,17 +149,15 @@ export function buildOperationOptions(
|
|
|
170
149
|
type: "string",
|
|
171
150
|
hasQuestionToken: true,
|
|
172
151
|
docs: [
|
|
173
|
-
'The content type for the request body. Defaults to "application/json". Use "application/xml" for XML serialization.'
|
|
174
|
-
]
|
|
152
|
+
'The content type for the request body. Defaults to "application/json". Use "application/xml" for XML serialization.',
|
|
153
|
+
],
|
|
175
154
|
};
|
|
176
155
|
|
|
177
156
|
// handle optional body parameter
|
|
178
157
|
// if (operation.operation.bodyParam?.optional === true) {
|
|
179
158
|
// options.push(operation.operation.bodyParam);
|
|
180
159
|
// }
|
|
181
|
-
const operationOptionsReference = resolveReference(
|
|
182
|
-
dependencies.OperationOptions
|
|
183
|
-
);
|
|
160
|
+
const operationOptionsReference = resolveReference(dependencies.OperationOptions);
|
|
184
161
|
|
|
185
162
|
// Build the additional options array
|
|
186
163
|
const additionalOptions: {
|
|
@@ -207,17 +184,13 @@ export function buildOperationOptions(
|
|
|
207
184
|
docs: getDocsFromDescription(p.doc),
|
|
208
185
|
hasQuestionToken: true,
|
|
209
186
|
type: getTypeExpression(context, p.type, { isOptional: true }),
|
|
210
|
-
name: normalizeName(p.name, NameType.Parameter)
|
|
187
|
+
name: normalizeName(p.name, NameType.Parameter),
|
|
211
188
|
};
|
|
212
|
-
})
|
|
189
|
+
}),
|
|
213
190
|
),
|
|
214
|
-
docs: [`Optional parameters.`]
|
|
191
|
+
docs: [`Optional parameters.`],
|
|
215
192
|
};
|
|
216
|
-
addDeclaration(
|
|
217
|
-
sourceFile,
|
|
218
|
-
operationOptionsInterface,
|
|
219
|
-
refkey(method[1], "operationOptions")
|
|
220
|
-
);
|
|
193
|
+
addDeclaration(sourceFile, operationOptionsInterface, refkey(method[1], "operationOptions"));
|
|
221
194
|
}
|
|
222
195
|
|
|
223
196
|
/**
|
|
@@ -225,7 +198,7 @@ export function buildOperationOptions(
|
|
|
225
198
|
*/
|
|
226
199
|
export function buildLroDeserDetailMap(
|
|
227
200
|
context: SdkContext,
|
|
228
|
-
client: SdkClientType<SdkServiceOperation
|
|
201
|
+
client: SdkClientType<SdkServiceOperation>,
|
|
229
202
|
) {
|
|
230
203
|
const map = new Map<string, OperationPathAndDeserDetails[]>();
|
|
231
204
|
const existingNames = new Set<string>();
|
|
@@ -257,7 +230,7 @@ export function buildLroDeserDetailMap(
|
|
|
257
230
|
if (existingNames.has(deserName)) {
|
|
258
231
|
const newName = `${name}Deserialize${normalizeName(
|
|
259
232
|
operationFileName.split("/").slice(0, -1).join("_"),
|
|
260
|
-
NameType.Interface
|
|
233
|
+
NameType.Interface,
|
|
261
234
|
)}`;
|
|
262
235
|
renamedDeserName = `_${newName}`;
|
|
263
236
|
}
|
|
@@ -266,9 +239,9 @@ export function buildLroDeserDetailMap(
|
|
|
266
239
|
path: `${o.operation.verb.toUpperCase()} ${o.operation.path}`,
|
|
267
240
|
expectedStatusesExpression: getExpectedStatuses(o),
|
|
268
241
|
deserName,
|
|
269
|
-
renamedDeserName
|
|
242
|
+
renamedDeserName,
|
|
270
243
|
};
|
|
271
|
-
})
|
|
244
|
+
}),
|
|
272
245
|
);
|
|
273
246
|
}
|
|
274
247
|
return map;
|