@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
package/src/index.ts
CHANGED
|
@@ -1,20 +1,16 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
+
import { EmitContext, Program } from "@typespec/compiler";
|
|
5
|
+
import { provideContext, useContext } from "./contextManager.js";
|
|
6
|
+
import { buildRootIndex, buildSubClientIndexFile } from "./modular/buildRootIndex.js";
|
|
4
7
|
import {
|
|
5
8
|
AzureCoreDependencies,
|
|
6
9
|
AzureIdentityDependencies,
|
|
7
10
|
AzurePollingDependencies,
|
|
11
|
+
AzureTestDependencies,
|
|
8
12
|
DefaultCoreDependencies,
|
|
9
|
-
AzureTestDependencies
|
|
10
13
|
} from "./modular/external-dependencies.js";
|
|
11
|
-
import {
|
|
12
|
-
clearDirectory,
|
|
13
|
-
emptyDir,
|
|
14
|
-
pathExists
|
|
15
|
-
} from "./utils/fileSystemUtils.js";
|
|
16
|
-
import { EmitContext, Program } from "@typespec/compiler";
|
|
17
|
-
import { GenerationDirDetail, SdkContext } from "./utils/interfaces.js";
|
|
18
14
|
import {
|
|
19
15
|
CloudSettingHelpers,
|
|
20
16
|
CreateRecorderHelpers,
|
|
@@ -26,100 +22,94 @@ import {
|
|
|
26
22
|
SimplePollerHelpers,
|
|
27
23
|
StorageCompatHelpers,
|
|
28
24
|
UrlTemplateHelpers,
|
|
29
|
-
XmlHelpers
|
|
25
|
+
XmlHelpers,
|
|
30
26
|
} from "./modular/static-helpers-metadata.js";
|
|
31
27
|
import {
|
|
32
28
|
RLCModel,
|
|
33
29
|
RLCOptions,
|
|
34
30
|
buildApiExtractorConfig,
|
|
31
|
+
buildChangelogFile,
|
|
35
32
|
buildClient,
|
|
36
33
|
buildClientDefinitions,
|
|
37
34
|
buildEsLintConfig,
|
|
38
35
|
buildIndexFile,
|
|
39
36
|
buildIsUnexpectedHelper,
|
|
40
37
|
buildLicenseFile,
|
|
41
|
-
buildChangelogFile,
|
|
42
38
|
buildLogger,
|
|
43
39
|
buildPackageFile,
|
|
44
40
|
buildParameterTypes,
|
|
45
41
|
buildPollingHelper,
|
|
46
42
|
buildPaginateHelper as buildRLCPaginateHelper,
|
|
47
43
|
buildReadmeFile,
|
|
48
|
-
hasClientNameChanged,
|
|
49
|
-
updateReadmeFile,
|
|
50
44
|
buildRecordedClientFile,
|
|
51
45
|
buildResponseTypes,
|
|
52
46
|
buildRollupConfig,
|
|
47
|
+
buildSampleEnvFile,
|
|
53
48
|
buildSampleTest,
|
|
54
49
|
buildSamples,
|
|
55
50
|
buildSerializeHelper,
|
|
51
|
+
buildSnippets,
|
|
52
|
+
buildTestBrowserTsConfig,
|
|
53
|
+
buildTestNodeTsConfig,
|
|
56
54
|
buildTopLevelIndex,
|
|
57
55
|
buildTsConfig,
|
|
56
|
+
buildTsLintConfig,
|
|
57
|
+
buildTsSampleConfig,
|
|
58
58
|
buildTsSnippetsConfig,
|
|
59
|
-
buildTsSrcEsmConfig,
|
|
60
59
|
buildTsSrcBrowserConfig,
|
|
61
|
-
buildTsSrcReactNativeConfig,
|
|
62
60
|
buildTsSrcCjsConfig,
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
buildTestNodeTsConfig,
|
|
61
|
+
buildTsSrcEsmConfig,
|
|
62
|
+
buildTsSrcReactNativeConfig,
|
|
66
63
|
buildVitestConfig,
|
|
67
64
|
buildWarpConfig,
|
|
68
65
|
getClientName,
|
|
66
|
+
hasClientNameChanged,
|
|
69
67
|
hasUnexpectedHelper,
|
|
70
68
|
isAzurePackage,
|
|
71
69
|
updatePackageFile,
|
|
72
|
-
|
|
73
|
-
buildSnippets,
|
|
74
|
-
buildTsSampleConfig
|
|
70
|
+
updateReadmeFile,
|
|
75
71
|
} from "./rlc-common/index.js";
|
|
76
|
-
import {
|
|
77
|
-
buildRootIndex,
|
|
78
|
-
buildSubClientIndexFile
|
|
79
|
-
} from "./modular/buildRootIndex.js";
|
|
80
72
|
import { emitContentByBuilder, emitModels } from "./utils/emitUtil.js";
|
|
81
|
-
import {
|
|
73
|
+
import { clearDirectory, emptyDir, pathExists } from "./utils/fileSystemUtils.js";
|
|
74
|
+
import { GenerationDirDetail, SdkContext } from "./utils/interfaces.js";
|
|
82
75
|
|
|
83
|
-
import { EmitterOptions } from "./lib.js";
|
|
84
|
-
import { ModularEmitterOptions } from "./modular/interfaces.js";
|
|
85
|
-
import { Project } from "ts-morph";
|
|
86
|
-
import { buildClassicOperationFiles } from "./modular/buildClassicalOperationGroups.js";
|
|
87
|
-
import { buildClassicalClient } from "./modular/buildClassicalClient.js";
|
|
88
|
-
import {
|
|
89
|
-
getClientContextPath,
|
|
90
|
-
buildClientContext
|
|
91
|
-
} from "./modular/buildClientContext.js";
|
|
92
|
-
import { buildApiOptions } from "./modular/emitModelsOptions.js";
|
|
93
|
-
import { buildOperationFiles } from "./modular/buildOperations.js";
|
|
94
|
-
import { buildRestorePoller } from "./modular/buildRestorePoller.js";
|
|
95
|
-
import { buildSubpathIndexFile } from "./modular/buildSubpathIndex.js";
|
|
96
76
|
import {
|
|
77
|
+
SdkClientType,
|
|
78
|
+
SdkServiceOperation,
|
|
97
79
|
createSdkContext,
|
|
98
80
|
listAllServiceNamespaces,
|
|
99
|
-
SdkClientType,
|
|
100
|
-
SdkServiceOperation
|
|
101
81
|
} from "@azure-tools/typespec-client-generator-core";
|
|
102
|
-
import { transformModularEmitterOptions } from "./modular/buildModularOptions.js";
|
|
103
|
-
import { emitLoggerFile } from "./modular/emitLoggerFile.js";
|
|
104
|
-
import { emitTypes, emitNonModelResponseTypes } from "./modular/emitModels.js";
|
|
105
82
|
import { existsSync } from "fs";
|
|
106
|
-
import { getModuleExports } from "./modular/buildProjectFiles.js";
|
|
107
|
-
import {
|
|
108
|
-
getClientHierarchyMap,
|
|
109
|
-
getRLCClients,
|
|
110
|
-
getModularClientOptions
|
|
111
|
-
} from "./utils/clientUtils.js";
|
|
112
83
|
import { basename, join } from "path";
|
|
113
|
-
import {
|
|
114
|
-
import { packageUsesXmlSerialization } from "./modular/serialization/buildXmlSerializerFunction.js";
|
|
84
|
+
import { Project } from "ts-morph";
|
|
115
85
|
import { provideBinder } from "./framework/hooks/binder.js";
|
|
116
86
|
import { provideSdkTypes } from "./framework/hooks/sdkTypes.js";
|
|
117
|
-
import {
|
|
118
|
-
import {
|
|
87
|
+
import { loadStaticHelpers } from "./framework/load-static-helpers.js";
|
|
88
|
+
import { EmitterOptions } from "./lib.js";
|
|
89
|
+
import { buildClassicalClient } from "./modular/buildClassicalClient.js";
|
|
90
|
+
import { buildClassicOperationFiles } from "./modular/buildClassicalOperationGroups.js";
|
|
91
|
+
import { buildClientContext, getClientContextPath } from "./modular/buildClientContext.js";
|
|
92
|
+
import { transformModularEmitterOptions } from "./modular/buildModularOptions.js";
|
|
93
|
+
import { buildOperationFiles } from "./modular/buildOperations.js";
|
|
94
|
+
import { getModuleExports } from "./modular/buildProjectFiles.js";
|
|
95
|
+
import { buildRestorePoller } from "./modular/buildRestorePoller.js";
|
|
96
|
+
import { buildSubpathIndexFile } from "./modular/buildSubpathIndex.js";
|
|
97
|
+
import { emitLoggerFile } from "./modular/emitLoggerFile.js";
|
|
98
|
+
import { emitNonModelResponseTypes, emitTypes } from "./modular/emitModels.js";
|
|
99
|
+
import { buildApiOptions } from "./modular/emitModelsOptions.js";
|
|
119
100
|
import { emitSamples } from "./modular/emitSamples.js";
|
|
120
101
|
import { emitTests } from "./modular/emitTests.js";
|
|
121
|
-
import { generateCrossLanguageDefinitionFile } from "./utils/crossLanguageDef.js";
|
|
122
102
|
import { getClassicalClientName } from "./modular/helpers/namingHelpers.js";
|
|
103
|
+
import { ModularEmitterOptions } from "./modular/interfaces.js";
|
|
104
|
+
import { packageUsesXmlSerialization } from "./modular/serialization/buildXmlSerializerFunction.js";
|
|
105
|
+
import { transformRLCModel } from "./transform/transform.js";
|
|
106
|
+
import { transformRLCOptions } from "./transform/transfromRLCOptions.js";
|
|
107
|
+
import {
|
|
108
|
+
getClientHierarchyMap,
|
|
109
|
+
getModularClientOptions,
|
|
110
|
+
getRLCClients,
|
|
111
|
+
} from "./utils/clientUtils.js";
|
|
112
|
+
import { generateCrossLanguageDefinitionFile } from "./utils/crossLanguageDef.js";
|
|
123
113
|
|
|
124
114
|
export * from "./lib.js";
|
|
125
115
|
|
|
@@ -143,16 +133,13 @@ export async function $onEmit(context: EmitContext) {
|
|
|
143
133
|
const rlcOptions = dpgContext.rlcOptions ?? {};
|
|
144
134
|
|
|
145
135
|
const needUnexpectedHelper: Map<string, boolean> = new Map<string, boolean>();
|
|
146
|
-
const serviceNameToRlcModelsMap: Map<string, RLCModel> = new Map<
|
|
147
|
-
string,
|
|
148
|
-
RLCModel
|
|
149
|
-
>();
|
|
136
|
+
const serviceNameToRlcModelsMap: Map<string, RLCModel> = new Map<string, RLCModel>();
|
|
150
137
|
provideContext("rlcMetaTree", new Map());
|
|
151
138
|
provideContext("symbolMap", new Map());
|
|
152
139
|
provideContext("outputProject", outputProject);
|
|
153
140
|
provideContext("emitContext", {
|
|
154
141
|
compilerContext: context,
|
|
155
|
-
tcgcContext: dpgContext
|
|
142
|
+
tcgcContext: dpgContext,
|
|
156
143
|
});
|
|
157
144
|
const staticHelpers = await loadStaticHelpers(
|
|
158
145
|
outputProject,
|
|
@@ -167,29 +154,29 @@ export async function $onEmit(context: EmitContext) {
|
|
|
167
154
|
...CloudSettingHelpers,
|
|
168
155
|
...XmlHelpers,
|
|
169
156
|
...(rlcOptions.generateTest ? CreateRecorderHelpers : {}),
|
|
170
|
-
...(rlcOptions.enableStorageCompat ? StorageCompatHelpers : {})
|
|
157
|
+
...(rlcOptions.enableStorageCompat ? StorageCompatHelpers : {}),
|
|
171
158
|
},
|
|
172
159
|
{
|
|
173
160
|
sourcesDir: dpgContext.generationPathDetail?.modularSourcesDir,
|
|
174
161
|
rootDir: dpgContext.generationPathDetail?.rootDir,
|
|
175
162
|
options: rlcOptions,
|
|
176
|
-
program
|
|
177
|
-
}
|
|
163
|
+
program,
|
|
164
|
+
},
|
|
178
165
|
);
|
|
179
166
|
const extraDependencies = isAzurePackage({ options: rlcOptions })
|
|
180
167
|
? {
|
|
181
168
|
...AzurePollingDependencies,
|
|
182
169
|
...AzureCoreDependencies,
|
|
183
170
|
...AzureIdentityDependencies,
|
|
184
|
-
...AzureTestDependencies
|
|
171
|
+
...AzureTestDependencies,
|
|
185
172
|
}
|
|
186
173
|
: { ...DefaultCoreDependencies };
|
|
187
174
|
const binder = provideBinder(outputProject, {
|
|
188
175
|
staticHelpers,
|
|
189
176
|
dependencies: {
|
|
190
|
-
...extraDependencies
|
|
177
|
+
...extraDependencies,
|
|
191
178
|
},
|
|
192
|
-
useSubpathImports: rlcOptions.azureSdkForJs === true
|
|
179
|
+
useSubpathImports: rlcOptions.azureSdkForJs === true,
|
|
193
180
|
});
|
|
194
181
|
provideSdkTypes(dpgContext);
|
|
195
182
|
|
|
@@ -213,7 +200,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
213
200
|
// 5. Generate metadata and test files
|
|
214
201
|
function getTypespecTsVersion(context: EmitContext): string | undefined {
|
|
215
202
|
const emitterMetadata = context.program.emitters.find(
|
|
216
|
-
(emitter) => emitter.metadata.name === "@azure-tools/typespec-ts"
|
|
203
|
+
(emitter) => emitter.metadata.name === "@azure-tools/typespec-ts",
|
|
217
204
|
);
|
|
218
205
|
return emitterMetadata?.metadata.version;
|
|
219
206
|
}
|
|
@@ -221,8 +208,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
221
208
|
await generateMetadataAndTest(dpgContext);
|
|
222
209
|
|
|
223
210
|
async function enrichDpgContext() {
|
|
224
|
-
const generationPathDetail: GenerationDirDetail =
|
|
225
|
-
await calculateGenerationDir();
|
|
211
|
+
const generationPathDetail: GenerationDirDetail = await calculateGenerationDir();
|
|
226
212
|
dpgContext.generationPathDetail = generationPathDetail;
|
|
227
213
|
dpgContext.allServiceNamespaces = listAllServiceNamespaces(dpgContext);
|
|
228
214
|
const options: RLCOptions = transformRLCOptions(emitterOptions, dpgContext);
|
|
@@ -231,14 +217,10 @@ export async function $onEmit(context: EmitContext) {
|
|
|
231
217
|
// clear output folder if needed
|
|
232
218
|
if (options.clearOutputFolder) {
|
|
233
219
|
// Clear output directory while preserving TempTypeSpecFiles
|
|
234
|
-
await clearDirectory(
|
|
235
|
-
context.emitterOutputDir,
|
|
236
|
-
["TempTypeSpecFiles"],
|
|
237
|
-
program
|
|
238
|
-
);
|
|
220
|
+
await clearDirectory(context.emitterOutputDir, ["TempTypeSpecFiles"], program);
|
|
239
221
|
}
|
|
240
222
|
const hasTestFolder = await pathExists(
|
|
241
|
-
join(dpgContext.generationPathDetail?.metadataDir ?? "", "test")
|
|
223
|
+
join(dpgContext.generationPathDetail?.metadataDir ?? "", "test"),
|
|
242
224
|
);
|
|
243
225
|
options.generateTest =
|
|
244
226
|
options.generateTest === true ||
|
|
@@ -263,7 +245,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
263
245
|
rootDir: projectRoot,
|
|
264
246
|
metadataDir: projectRoot,
|
|
265
247
|
rlcSourcesDir: sourcesRoot,
|
|
266
|
-
modularSourcesDir: sourcesRoot
|
|
248
|
+
modularSourcesDir: sourcesRoot,
|
|
267
249
|
};
|
|
268
250
|
}
|
|
269
251
|
|
|
@@ -271,16 +253,13 @@ export async function $onEmit(context: EmitContext) {
|
|
|
271
253
|
await emptyDir(
|
|
272
254
|
dpgContext.generationPathDetail?.modularSourcesDir ??
|
|
273
255
|
dpgContext.generationPathDetail?.rlcSourcesDir ??
|
|
274
|
-
""
|
|
256
|
+
"",
|
|
275
257
|
);
|
|
276
258
|
}
|
|
277
259
|
|
|
278
260
|
async function clearSamplesDevFolder() {
|
|
279
261
|
if (emitterOptions["generate-sample"] === true) {
|
|
280
|
-
const samplesDevPath = join(
|
|
281
|
-
dpgContext.generationPathDetail?.rootDir ?? "",
|
|
282
|
-
"samples-dev"
|
|
283
|
-
);
|
|
262
|
+
const samplesDevPath = join(dpgContext.generationPathDetail?.rootDir ?? "", "samples-dev");
|
|
284
263
|
if (await pathExists(samplesDevPath)) {
|
|
285
264
|
await emptyDir(samplesDevPath);
|
|
286
265
|
}
|
|
@@ -294,10 +273,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
294
273
|
rlcCodeModels.push(rlcModels);
|
|
295
274
|
const serviceName = client.services[0]?.name ?? "Unknown";
|
|
296
275
|
serviceNameToRlcModelsMap.set(serviceName, rlcModels);
|
|
297
|
-
needUnexpectedHelper.set(
|
|
298
|
-
getClientName(rlcModels),
|
|
299
|
-
hasUnexpectedHelper(rlcModels)
|
|
300
|
-
);
|
|
276
|
+
needUnexpectedHelper.set(getClientName(rlcModels), hasUnexpectedHelper(rlcModels));
|
|
301
277
|
}
|
|
302
278
|
}
|
|
303
279
|
|
|
@@ -319,37 +295,56 @@ export async function $onEmit(context: EmitContext) {
|
|
|
319
295
|
program,
|
|
320
296
|
buildSamples,
|
|
321
297
|
rlcModels,
|
|
322
|
-
dpgContext.generationPathDetail?.metadataDir
|
|
298
|
+
dpgContext.generationPathDetail?.metadataDir,
|
|
323
299
|
);
|
|
324
300
|
}
|
|
301
|
+
// The binder is only resolved in the modular path, so static helper files
|
|
302
|
+
// loaded into the outputProject are never written to disk in the RLC path.
|
|
303
|
+
// The RLC builders reference the platform-types helper (NodeReadableStream),
|
|
304
|
+
// so emit those files here.
|
|
305
|
+
await emitRLCStaticHelpers();
|
|
325
306
|
}
|
|
326
307
|
|
|
327
|
-
async function
|
|
328
|
-
|
|
329
|
-
|
|
308
|
+
async function emitRLCStaticHelpers() {
|
|
309
|
+
if (program.compilerOptions.noEmit || program.hasError() || !rlcCodeModels[0]) {
|
|
310
|
+
return;
|
|
311
|
+
}
|
|
330
312
|
const project = useContext("outputProject");
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
313
|
+
for (const helperFile of project.getSourceFiles()) {
|
|
314
|
+
const filePath = helperFile.getFilePath();
|
|
315
|
+
// RLC builders (buildParameterTypes / buildSchemaType) only reference
|
|
316
|
+
// platform-types (and its browser/react-native variants); emit those
|
|
317
|
+
// files directly under src/ (strip the static-helpers/ segment) to match
|
|
318
|
+
// the RLC design where all generated output lives in src/.
|
|
319
|
+
if (!basename(filePath).startsWith("platform-types")) {
|
|
320
|
+
continue;
|
|
336
321
|
}
|
|
337
|
-
|
|
322
|
+
const outputPath = filePath.replace(/\/static-helpers\//g, "/");
|
|
323
|
+
await emitContentByBuilder(
|
|
324
|
+
program,
|
|
325
|
+
() => ({ content: helperFile.getFullText(), path: outputPath }),
|
|
326
|
+
rlcCodeModels[0],
|
|
327
|
+
);
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
|
|
331
|
+
async function generateModularSources() {
|
|
332
|
+
const modularSourcesRoot = dpgContext.generationPathDetail?.modularSourcesDir ?? "src";
|
|
333
|
+
const project = useContext("outputProject");
|
|
334
|
+
modularEmitterOptions = transformModularEmitterOptions(dpgContext, modularSourcesRoot, {
|
|
335
|
+
casing: "camel",
|
|
336
|
+
});
|
|
338
337
|
|
|
339
338
|
emitLoggerFile(modularEmitterOptions, modularSourcesRoot);
|
|
340
339
|
|
|
341
|
-
const rootIndexFile = project.createSourceFile(
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
{
|
|
345
|
-
overwrite: true
|
|
346
|
-
}
|
|
347
|
-
);
|
|
340
|
+
const rootIndexFile = project.createSourceFile(`${modularSourcesRoot}/index.ts`, "", {
|
|
341
|
+
overwrite: true,
|
|
342
|
+
});
|
|
348
343
|
|
|
349
344
|
emitTypes(dpgContext, { sourceRoot: modularSourcesRoot });
|
|
350
345
|
emitNonModelResponseTypes(dpgContext, { sourceRoot: modularSourcesRoot });
|
|
351
346
|
buildSubpathIndexFile(modularEmitterOptions, "models", undefined, {
|
|
352
|
-
recursive: true
|
|
347
|
+
recursive: true,
|
|
353
348
|
});
|
|
354
349
|
const clientMap = getClientHierarchyMap(dpgContext);
|
|
355
350
|
if (clientMap.length === 0) {
|
|
@@ -365,12 +360,12 @@ export async function $onEmit(context: EmitContext) {
|
|
|
365
360
|
if (dpgContext.rlcOptions?.hierarchyClient) {
|
|
366
361
|
buildSubpathIndexFile(modularEmitterOptions, "api", subClient, {
|
|
367
362
|
exportIndex: false,
|
|
368
|
-
recursive: true
|
|
363
|
+
recursive: true,
|
|
369
364
|
});
|
|
370
365
|
} else {
|
|
371
366
|
buildSubpathIndexFile(modularEmitterOptions, "api", subClient, {
|
|
372
367
|
recursive: true,
|
|
373
|
-
exportIndex: true
|
|
368
|
+
exportIndex: true,
|
|
374
369
|
});
|
|
375
370
|
}
|
|
376
371
|
|
|
@@ -378,19 +373,14 @@ export async function $onEmit(context: EmitContext) {
|
|
|
378
373
|
buildClassicOperationFiles(dpgContext, subClient, modularEmitterOptions);
|
|
379
374
|
buildSubpathIndexFile(modularEmitterOptions, "classic", subClient, {
|
|
380
375
|
exportIndex: true,
|
|
381
|
-
interfaceOnly: true
|
|
376
|
+
interfaceOnly: true,
|
|
382
377
|
});
|
|
383
378
|
const { subfolder } = getModularClientOptions(subClient);
|
|
384
379
|
// Generate index file for clients with subfolders (multi-client scenarios and nested clients)
|
|
385
380
|
if (subfolder) {
|
|
386
381
|
buildSubClientIndexFile(dpgContext, subClient, modularEmitterOptions);
|
|
387
382
|
}
|
|
388
|
-
buildRootIndex(
|
|
389
|
-
dpgContext,
|
|
390
|
-
modularEmitterOptions,
|
|
391
|
-
rootIndexFile,
|
|
392
|
-
subClient
|
|
393
|
-
);
|
|
383
|
+
buildRootIndex(dpgContext, modularEmitterOptions, rootIndexFile, subClient);
|
|
394
384
|
}
|
|
395
385
|
// Enable modular sample generation when explicitly set to true or MPG
|
|
396
386
|
if (emitterOptions["generate-sample"] === true) {
|
|
@@ -402,10 +392,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
402
392
|
}
|
|
403
393
|
}
|
|
404
394
|
|
|
405
|
-
binder.resolveAllReferences(
|
|
406
|
-
modularSourcesRoot,
|
|
407
|
-
dpgContext.generationPathDetail?.rootDir
|
|
408
|
-
);
|
|
395
|
+
binder.resolveAllReferences(modularSourcesRoot, dpgContext.generationPathDetail?.rootDir);
|
|
409
396
|
if (program.compilerOptions.noEmit || program.hasError()) {
|
|
410
397
|
return;
|
|
411
398
|
}
|
|
@@ -414,7 +401,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
414
401
|
await emitContentByBuilder(
|
|
415
402
|
program,
|
|
416
403
|
() => ({ content: file.getFullText(), path: file.getFilePath() }),
|
|
417
|
-
modularEmitterOptions as any
|
|
404
|
+
modularEmitterOptions as any,
|
|
418
405
|
);
|
|
419
406
|
}
|
|
420
407
|
}
|
|
@@ -442,12 +429,11 @@ export async function $onEmit(context: EmitContext) {
|
|
|
442
429
|
content.emitterVersion = emitterVersion;
|
|
443
430
|
}
|
|
444
431
|
if (dpgContext.rlcOptions?.isModularLibrary) {
|
|
445
|
-
content.crossLanguageDefinitions =
|
|
446
|
-
generateCrossLanguageDefinitionFile(dpgContext);
|
|
432
|
+
content.crossLanguageDefinitions = generateCrossLanguageDefinitionFile(dpgContext);
|
|
447
433
|
}
|
|
448
434
|
return {
|
|
449
435
|
path: "metadata.json",
|
|
450
|
-
content: JSON.stringify(content, null, 2)
|
|
436
|
+
content: JSON.stringify(content, null, 2),
|
|
451
437
|
};
|
|
452
438
|
}
|
|
453
439
|
|
|
@@ -469,25 +455,21 @@ export async function $onEmit(context: EmitContext) {
|
|
|
469
455
|
// Generate metadata
|
|
470
456
|
const existingPackageFilePath = join(
|
|
471
457
|
dpgContext.generationPathDetail?.metadataDir ?? "",
|
|
472
|
-
"package.json"
|
|
458
|
+
"package.json",
|
|
473
459
|
);
|
|
474
460
|
const hasPackageFile = await existsSync(existingPackageFilePath);
|
|
475
461
|
const existingReadmeFilePath = join(
|
|
476
462
|
dpgContext.generationPathDetail?.metadataDir ?? "",
|
|
477
|
-
"README.md"
|
|
463
|
+
"README.md",
|
|
478
464
|
);
|
|
479
465
|
const hasReadmeFile = await existsSync(existingReadmeFilePath);
|
|
480
466
|
const existingChangelogFilePath = join(
|
|
481
467
|
dpgContext.generationPathDetail?.metadataDir ?? "",
|
|
482
|
-
"CHANGELOG.md"
|
|
468
|
+
"CHANGELOG.md",
|
|
483
469
|
);
|
|
484
470
|
const hasChangelogFile = await existsSync(existingChangelogFilePath);
|
|
485
|
-
const shouldGenerateMetadata =
|
|
486
|
-
|
|
487
|
-
const existingTestFolderPath = join(
|
|
488
|
-
dpgContext.generationPathDetail?.metadataDir ?? "",
|
|
489
|
-
"test"
|
|
490
|
-
);
|
|
471
|
+
const shouldGenerateMetadata = option.generateMetadata === true || !hasPackageFile;
|
|
472
|
+
const existingTestFolderPath = join(dpgContext.generationPathDetail?.metadataDir ?? "", "test");
|
|
491
473
|
const hasTestFolder = await existsSync(existingTestFolderPath);
|
|
492
474
|
if (option.generateTest === undefined) {
|
|
493
475
|
if (hasTestFolder) {
|
|
@@ -510,7 +492,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
510
492
|
buildApiExtractorConfig,
|
|
511
493
|
buildReadmeFile,
|
|
512
494
|
buildLicenseFile,
|
|
513
|
-
buildSampleEnvFile
|
|
495
|
+
buildSampleEnvFile,
|
|
514
496
|
];
|
|
515
497
|
if (option.generateTest) {
|
|
516
498
|
commonBuilders.push((model) => buildVitestConfig(model, "node"));
|
|
@@ -534,7 +516,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
534
516
|
let modularPackageInfo = {};
|
|
535
517
|
if (option.isModularLibrary) {
|
|
536
518
|
modularPackageInfo = {
|
|
537
|
-
exports: getModuleExports(context, modularEmitterOptions)
|
|
519
|
+
exports: getModuleExports(context, modularEmitterOptions),
|
|
538
520
|
};
|
|
539
521
|
// Build dependencies
|
|
540
522
|
const dependencies: Record<string, string> = {};
|
|
@@ -549,26 +531,19 @@ export async function $onEmit(context: EmitContext) {
|
|
|
549
531
|
modularPackageInfo = {
|
|
550
532
|
...modularPackageInfo,
|
|
551
533
|
dependencies,
|
|
552
|
-
clientContextPaths: getRelativeContextPaths(
|
|
553
|
-
context,
|
|
554
|
-
modularEmitterOptions
|
|
555
|
-
)
|
|
534
|
+
clientContextPaths: getRelativeContextPaths(context, modularEmitterOptions),
|
|
556
535
|
};
|
|
557
536
|
} else if (Object.keys(dependencies).length > 0) {
|
|
558
537
|
modularPackageInfo = {
|
|
559
538
|
...modularPackageInfo,
|
|
560
|
-
dependencies
|
|
539
|
+
dependencies,
|
|
561
540
|
};
|
|
562
541
|
}
|
|
563
542
|
}
|
|
564
|
-
commonBuilders.push((model) =>
|
|
565
|
-
buildPackageFile(model, modularPackageInfo)
|
|
566
|
-
);
|
|
543
|
+
commonBuilders.push((model) => buildPackageFile(model, modularPackageInfo));
|
|
567
544
|
// Generate warp.config.yml for Azure monorepo ESM packages
|
|
568
545
|
if (option.azureSdkForJs) {
|
|
569
|
-
commonBuilders.push((model) =>
|
|
570
|
-
buildWarpConfig(model, modularPackageInfo)
|
|
571
|
-
);
|
|
546
|
+
commonBuilders.push((model) => buildWarpConfig(model, modularPackageInfo));
|
|
572
547
|
}
|
|
573
548
|
commonBuilders.push(buildTsConfig);
|
|
574
549
|
if (option.azureSdkForJs) {
|
|
@@ -590,7 +565,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
590
565
|
if (option.generateTest) {
|
|
591
566
|
for (const subClient of dpgContext.sdkPackage.clients) {
|
|
592
567
|
commonBuilders.push((model) =>
|
|
593
|
-
buildSnippets(model, subClient.name, option.azureSdkForJs)
|
|
568
|
+
buildSnippets(model, subClient.name, option.azureSdkForJs),
|
|
594
569
|
);
|
|
595
570
|
}
|
|
596
571
|
commonBuilders.push(buildTsSnippetsConfig);
|
|
@@ -601,7 +576,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
601
576
|
program,
|
|
602
577
|
commonBuilders,
|
|
603
578
|
rlcClient,
|
|
604
|
-
dpgContext.generationPathDetail?.metadataDir
|
|
579
|
+
dpgContext.generationPathDetail?.metadataDir,
|
|
605
580
|
);
|
|
606
581
|
|
|
607
582
|
if (option.isModularLibrary) {
|
|
@@ -609,7 +584,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
609
584
|
await emitContentByBuilder(
|
|
610
585
|
program,
|
|
611
586
|
() => ({ content: file.getFullText(), path: file.getFilePath() }),
|
|
612
|
-
modularEmitterOptions as any
|
|
587
|
+
modularEmitterOptions as any,
|
|
613
588
|
);
|
|
614
589
|
}
|
|
615
590
|
}
|
|
@@ -627,13 +602,10 @@ export async function $onEmit(context: EmitContext) {
|
|
|
627
602
|
}
|
|
628
603
|
modularPackageInfo = {
|
|
629
604
|
exports: getModuleExports(context, modularEmitterOptions),
|
|
630
|
-
clientContextPaths: getRelativeContextPaths(
|
|
631
|
-
context,
|
|
632
|
-
modularEmitterOptions
|
|
633
|
-
),
|
|
605
|
+
clientContextPaths: getRelativeContextPaths(context, modularEmitterOptions),
|
|
634
606
|
...(Object.keys(additionalDependencies).length > 0 && {
|
|
635
|
-
dependencies: additionalDependencies
|
|
636
|
-
})
|
|
607
|
+
dependencies: additionalDependencies,
|
|
608
|
+
}),
|
|
637
609
|
};
|
|
638
610
|
}
|
|
639
611
|
|
|
@@ -641,40 +613,30 @@ export async function $onEmit(context: EmitContext) {
|
|
|
641
613
|
// and for modular packages (adds exports, clientContextPaths, LRO deps)
|
|
642
614
|
if (option.isModularLibrary || option.azureSdkForJs) {
|
|
643
615
|
updateBuilders.push((model: RLCModel) =>
|
|
644
|
-
updatePackageFile(model, existingPackageFilePath, modularPackageInfo)
|
|
616
|
+
updatePackageFile(model, existingPackageFilePath, modularPackageInfo),
|
|
645
617
|
);
|
|
646
618
|
}
|
|
647
619
|
|
|
648
620
|
// Update warp.config.yml for Azure monorepo packages
|
|
649
621
|
if (option.azureSdkForJs) {
|
|
650
|
-
updateBuilders.push((model: RLCModel) =>
|
|
651
|
-
buildWarpConfig(model, modularPackageInfo)
|
|
652
|
-
);
|
|
622
|
+
updateBuilders.push((model: RLCModel) => buildWarpConfig(model, modularPackageInfo));
|
|
653
623
|
}
|
|
654
624
|
|
|
655
625
|
// If the client name changed, regenerate the README and snippets completely;
|
|
656
626
|
// otherwise update only the API reference link in-place.
|
|
657
627
|
if (hasReadmeFile) {
|
|
658
|
-
const clientNameChanged = hasClientNameChanged(
|
|
659
|
-
rlcClient,
|
|
660
|
-
existingReadmeFilePath
|
|
661
|
-
);
|
|
628
|
+
const clientNameChanged = hasClientNameChanged(rlcClient, existingReadmeFilePath);
|
|
662
629
|
updateBuilders.push(
|
|
663
630
|
clientNameChanged
|
|
664
631
|
? buildReadmeFile
|
|
665
|
-
: (model: RLCModel) =>
|
|
666
|
-
updateReadmeFile(model, existingReadmeFilePath)
|
|
632
|
+
: (model: RLCModel) => updateReadmeFile(model, existingReadmeFilePath),
|
|
667
633
|
);
|
|
668
634
|
|
|
669
635
|
// Regenerate snippets.spec.ts only when the client name changed
|
|
670
636
|
if (clientNameChanged && option.azureSdkForJs) {
|
|
671
637
|
for (const subClient of dpgContext.sdkPackage.clients) {
|
|
672
638
|
updateBuilders.push((model: RLCModel) =>
|
|
673
|
-
buildSnippets(
|
|
674
|
-
model,
|
|
675
|
-
getClassicalClientName(subClient),
|
|
676
|
-
option.azureSdkForJs
|
|
677
|
-
)
|
|
639
|
+
buildSnippets(model, getClassicalClientName(subClient), option.azureSdkForJs),
|
|
678
640
|
);
|
|
679
641
|
}
|
|
680
642
|
}
|
|
@@ -685,7 +647,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
685
647
|
program,
|
|
686
648
|
updateBuilders,
|
|
687
649
|
rlcClient,
|
|
688
|
-
dpgContext.generationPathDetail?.metadataDir
|
|
650
|
+
dpgContext.generationPathDetail?.metadataDir,
|
|
689
651
|
);
|
|
690
652
|
}
|
|
691
653
|
if (isAzureFlavor) {
|
|
@@ -693,7 +655,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
693
655
|
program,
|
|
694
656
|
buildMetadataJson,
|
|
695
657
|
rlcClient,
|
|
696
|
-
dpgContext.generationPathDetail?.metadataDir
|
|
658
|
+
dpgContext.generationPathDetail?.metadataDir,
|
|
697
659
|
);
|
|
698
660
|
}
|
|
699
661
|
|
|
@@ -703,15 +665,12 @@ export async function $onEmit(context: EmitContext) {
|
|
|
703
665
|
program,
|
|
704
666
|
[buildRecordedClientFile, buildSampleTest],
|
|
705
667
|
rlcClient,
|
|
706
|
-
dpgContext.generationPathDetail?.metadataDir
|
|
668
|
+
dpgContext.generationPathDetail?.metadataDir,
|
|
707
669
|
);
|
|
708
670
|
}
|
|
709
671
|
}
|
|
710
672
|
|
|
711
|
-
function getRelativeContextPaths(
|
|
712
|
-
context: SdkContext,
|
|
713
|
-
options: ModularEmitterOptions
|
|
714
|
-
) {
|
|
673
|
+
function getRelativeContextPaths(context: SdkContext, options: ModularEmitterOptions) {
|
|
715
674
|
const clientMap = getClientHierarchyMap(context);
|
|
716
675
|
return Array.from(clientMap)
|
|
717
676
|
.map((subClient) => getClientContextPath(subClient, options))
|
|
@@ -720,7 +679,7 @@ export async function $onEmit(context: EmitContext) {
|
|
|
720
679
|
}
|
|
721
680
|
|
|
722
681
|
export async function createContextWithDefaultOptions(
|
|
723
|
-
context: EmitContext<Record<string, any
|
|
682
|
+
context: EmitContext<Record<string, any>>,
|
|
724
683
|
): Promise<SdkContext> {
|
|
725
684
|
const flattenUnionAsEnum =
|
|
726
685
|
context.options["experimental-extensible-enums"] === undefined
|
|
@@ -732,21 +691,21 @@ export async function createContextWithDefaultOptions(
|
|
|
732
691
|
emitters: [
|
|
733
692
|
{
|
|
734
693
|
main: "@azure-tools/typespec-ts",
|
|
735
|
-
metadata: { name: "@azure-tools/typespec-ts" }
|
|
736
|
-
}
|
|
737
|
-
]
|
|
694
|
+
metadata: { name: "@azure-tools/typespec-ts" },
|
|
695
|
+
},
|
|
696
|
+
],
|
|
738
697
|
};
|
|
739
698
|
context.options = {
|
|
740
699
|
...context.options,
|
|
741
|
-
...tcgcSettings
|
|
700
|
+
...tcgcSettings,
|
|
742
701
|
};
|
|
743
702
|
|
|
744
703
|
return (await createSdkContext(
|
|
745
704
|
context,
|
|
746
705
|
context.program.emitters[0]?.metadata.name ?? "@azure-tools/typespec-ts",
|
|
747
706
|
{
|
|
748
|
-
flattenUnionAsEnum
|
|
749
|
-
}
|
|
707
|
+
flattenUnionAsEnum,
|
|
708
|
+
},
|
|
750
709
|
)) as SdkContext;
|
|
751
710
|
}
|
|
752
711
|
|
|
@@ -758,7 +717,7 @@ function isArm(context: EmitContext<Record<string, any>>) {
|
|
|
758
717
|
|
|
759
718
|
export async function renameClientName(
|
|
760
719
|
client: SdkClientType<SdkServiceOperation>,
|
|
761
|
-
emitterOptions: ModularEmitterOptions
|
|
720
|
+
emitterOptions: ModularEmitterOptions,
|
|
762
721
|
) {
|
|
763
722
|
if (
|
|
764
723
|
emitterOptions.options.typespecTitleMap &&
|