@azure-tools/typespec-ts 0.54.0 → 0.55.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -10
- package/README.md +0 -4
- package/dist/src/contextManager.d.ts +5 -5
- package/dist/src/contextManager.d.ts.map +1 -1
- package/dist/src/contextManager.js +3 -3
- package/dist/src/contextManager.js.map +1 -1
- package/dist/src/framework/declaration.d.ts +1 -1
- package/dist/src/framework/declaration.d.ts.map +1 -1
- package/dist/src/framework/declaration.js +2 -4
- package/dist/src/framework/declaration.js.map +1 -1
- package/dist/src/framework/dependency.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.d.ts +1 -1
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +31 -40
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.js +8 -12
- package/dist/src/framework/hooks/sdkTypes.js.map +1 -1
- package/dist/src/framework/hooks/useDependencies.d.ts.map +1 -1
- package/dist/src/framework/hooks/useDependencies.js +1 -1
- package/dist/src/framework/hooks/useDependencies.js.map +1 -1
- package/dist/src/framework/load-static-helpers.d.ts +1 -1
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +17 -31
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/framework/reference.d.ts.map +1 -1
- package/dist/src/framework/reference.js +2 -2
- package/dist/src/framework/reference.js.map +1 -1
- package/dist/src/framework/sample.js +8 -8
- package/dist/src/framework/sample.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +103 -92
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +1 -1
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +140 -140
- package/dist/src/lib.js.map +1 -1
- package/dist/src/metaTree.d.ts +1 -1
- package/dist/src/metaTree.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.js +60 -74
- package/dist/src/modular/buildClassicalClient.js.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.d.ts +2 -2
- package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js +8 -10
- package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
- package/dist/src/modular/buildClientContext.d.ts +2 -2
- package/dist/src/modular/buildClientContext.d.ts.map +1 -1
- package/dist/src/modular/buildClientContext.js +31 -38
- package/dist/src/modular/buildClientContext.js.map +1 -1
- package/dist/src/modular/buildModularOptions.d.ts +1 -1
- package/dist/src/modular/buildModularOptions.d.ts.map +1 -1
- package/dist/src/modular/buildModularOptions.js +5 -6
- package/dist/src/modular/buildModularOptions.js.map +1 -1
- package/dist/src/modular/buildOperations.d.ts +3 -3
- package/dist/src/modular/buildOperations.d.ts.map +1 -1
- package/dist/src/modular/buildOperations.js +23 -25
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts.map +1 -1
- package/dist/src/modular/buildProjectFiles.js +8 -11
- package/dist/src/modular/buildProjectFiles.js.map +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts.map +1 -1
- package/dist/src/modular/buildRestorePoller.js +12 -13
- package/dist/src/modular/buildRestorePoller.js.map +1 -1
- package/dist/src/modular/buildRootIndex.d.ts +2 -2
- package/dist/src/modular/buildRootIndex.d.ts.map +1 -1
- package/dist/src/modular/buildRootIndex.js +36 -50
- package/dist/src/modular/buildRootIndex.js.map +1 -1
- package/dist/src/modular/buildSubpathIndex.d.ts.map +1 -1
- package/dist/src/modular/buildSubpathIndex.js +9 -18
- package/dist/src/modular/buildSubpathIndex.js.map +1 -1
- package/dist/src/modular/emitLoggerFile.d.ts.map +1 -1
- package/dist/src/modular/emitLoggerFile.js +4 -4
- package/dist/src/modular/emitLoggerFile.js.map +1 -1
- package/dist/src/modular/emitModels.d.ts +1 -1
- package/dist/src/modular/emitModels.d.ts.map +1 -1
- package/dist/src/modular/emitModels.js +81 -113
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts.map +1 -1
- package/dist/src/modular/emitModelsOptions.js +7 -8
- package/dist/src/modular/emitModelsOptions.js.map +1 -1
- package/dist/src/modular/emitSamples.d.ts.map +1 -1
- package/dist/src/modular/emitSamples.js +69 -77
- package/dist/src/modular/emitSamples.js.map +1 -1
- package/dist/src/modular/emitTests.d.ts.map +1 -1
- package/dist/src/modular/emitTests.js +13 -18
- package/dist/src/modular/emitTests.js.map +1 -1
- package/dist/src/modular/external-dependencies.js +54 -54
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js +59 -68
- package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.js +31 -54
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.js +72 -84
- package/dist/src/modular/helpers/exampleValueHelpers.js.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.js +7 -10
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +204 -288
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.js +4 -6
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.js +58 -67
- package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js +65 -75
- package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js +73 -90
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.d.ts.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.js +25 -33
- package/dist/src/modular/serialization/serializeUtils.js.map +1 -1
- package/dist/src/modular/static-helpers-metadata.js +60 -60
- package/dist/src/modular/type-expressions/get-credential-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-credential-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.js +1 -2
- package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.js +10 -13
- package/dist/src/modular/type-expressions/get-model-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.js +2 -3
- package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.js +5 -11
- package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
- package/dist/src/rlc-common/buildClient.d.ts +1 -1
- package/dist/src/rlc-common/buildClient.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClient.js +67 -89
- package/dist/src/rlc-common/buildClient.js.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.js +28 -45
- package/dist/src/rlc-common/buildClientDefinitions.js.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.js +59 -60
- package/dist/src/rlc-common/buildIndexFile.js.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js +37 -38
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +1 -1
- package/dist/src/rlc-common/buildLogger.d.ts.map +1 -1
- package/dist/src/rlc-common/buildLogger.js +4 -5
- package/dist/src/rlc-common/buildLogger.js.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.js +4 -4
- package/dist/src/rlc-common/buildMethodShortcuts.js.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.js +57 -96
- package/dist/src/rlc-common/buildObjectTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.js +2 -2
- package/dist/src/rlc-common/buildPaginateHelper.js.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.js +71 -61
- package/dist/src/rlc-common/buildParameterTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.js +9 -10
- package/dist/src/rlc-common/buildPollingHelper.js.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.js +23 -27
- package/dist/src/rlc-common/buildResponseTypes.js.map +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSamples.js +2 -2
- package/dist/src/rlc-common/buildSchemaType.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSchemaType.js +31 -13
- package/dist/src/rlc-common/buildSchemaType.js.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.js +4 -4
- package/dist/src/rlc-common/buildSerializeHelper.js.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.js +9 -13
- package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.js +6 -8
- package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.js +32 -37
- package/dist/src/rlc-common/helpers/importsUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.js +2 -4
- package/dist/src/rlc-common/helpers/nameConstructors.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.js +17 -23
- package/dist/src/rlc-common/helpers/nameUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.js +16 -31
- package/dist/src/rlc-common/helpers/operationHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/packageUtil.js +3 -6
- package/dist/src/rlc-common/helpers/packageUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.js +1 -3
- package/dist/src/rlc-common/helpers/pathUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.js +3 -7
- package/dist/src/rlc-common/helpers/schemaHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.js +2 -2
- package/dist/src/rlc-common/helpers/shortcutMethods.js.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.js +4 -9
- package/dist/src/rlc-common/helpers/typeUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js +7 -11
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +1 -1
- package/dist/src/rlc-common/index.d.ts +28 -28
- package/dist/src/rlc-common/index.d.ts.map +1 -1
- package/dist/src/rlc-common/index.js +28 -28
- package/dist/src/rlc-common/index.js.map +1 -1
- package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
- package/dist/src/rlc-common/interfaces.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +14 -15
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildChangelogFile.js +2 -3
- package/dist/src/rlc-common/metadata/buildChangelogFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.js +5 -8
- package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildLicenseFile.js +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.js +33 -37
- package/dist/src/rlc-common/metadata/buildPackageFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.js +31 -39
- package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.js +4 -6
- package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +3 -5
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTestConfig.js +11 -12
- package/dist/src/rlc-common/metadata/buildTestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.js +28 -28
- package/dist/src/rlc-common/metadata/buildTsConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.js +3 -5
- package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.js +4 -5
- package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +14 -14
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +24 -29
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +15 -16
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +8 -8
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +28 -31
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/utils.js +1 -2
- package/dist/src/rlc-common/metadata/utils.js.map +1 -1
- package/dist/src/rlc-common/test/buildKarmaConfig.js +1 -1
- package/dist/src/rlc-common/test/buildRecordedClient.js +4 -5
- package/dist/src/rlc-common/test/buildRecordedClient.js.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.js +3 -4
- package/dist/src/rlc-common/test/buildSampleTest.js.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.js +7 -10
- package/dist/src/rlc-common/test/buildSnippets.js.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.d.ts.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.js +41 -45
- package/dist/src/rlc-common/transformSampleGroups.js.map +1 -1
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +1 -1
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/transform/transform.d.ts +1 -1
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/transform/transform.js +28 -27
- package/dist/src/transform/transform.js.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.js +12 -14
- package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.js +11 -14
- package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -1
- package/dist/src/transform/transformParameters.d.ts +2 -2
- package/dist/src/transform/transformParameters.d.ts.map +1 -1
- package/dist/src/transform/transformParameters.js +32 -45
- package/dist/src/transform/transformParameters.js.map +1 -1
- package/dist/src/transform/transformPaths.d.ts +1 -1
- package/dist/src/transform/transformPaths.d.ts.map +1 -1
- package/dist/src/transform/transformPaths.js +19 -23
- package/dist/src/transform/transformPaths.js.map +1 -1
- package/dist/src/transform/transformResponses.d.ts +1 -1
- package/dist/src/transform/transformResponses.d.ts.map +1 -1
- package/dist/src/transform/transformResponses.js +21 -25
- package/dist/src/transform/transformResponses.js.map +1 -1
- package/dist/src/transform/transformSchemas.d.ts.map +1 -1
- package/dist/src/transform/transformSchemas.js +21 -32
- package/dist/src/transform/transformSchemas.js.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.js +3 -3
- package/dist/src/transform/transformTelemetryInfo.js.map +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
- package/dist/src/transform/transfromRLCOptions.js +28 -39
- package/dist/src/transform/transfromRLCOptions.js.map +1 -1
- package/dist/src/utils/clientUtils.d.ts +1 -1
- package/dist/src/utils/clientUtils.d.ts.map +1 -1
- package/dist/src/utils/clientUtils.js +15 -23
- package/dist/src/utils/clientUtils.js.map +1 -1
- package/dist/src/utils/credentialUtils.d.ts +1 -1
- package/dist/src/utils/credentialUtils.d.ts.map +1 -1
- package/dist/src/utils/credentialUtils.js +4 -5
- package/dist/src/utils/credentialUtils.js.map +1 -1
- package/dist/src/utils/crossLanguageDef.d.ts.map +1 -1
- package/dist/src/utils/crossLanguageDef.js +11 -15
- package/dist/src/utils/crossLanguageDef.js.map +1 -1
- package/dist/src/utils/emitUtil.d.ts +1 -1
- package/dist/src/utils/emitUtil.d.ts.map +1 -1
- package/dist/src/utils/emitUtil.js +5 -7
- package/dist/src/utils/emitUtil.js.map +1 -1
- package/dist/src/utils/fileSystemUtils.d.ts +2 -0
- package/dist/src/utils/fileSystemUtils.d.ts.map +1 -1
- package/dist/src/utils/fileSystemUtils.js +26 -7
- package/dist/src/utils/fileSystemUtils.js.map +1 -1
- package/dist/src/utils/importHelper.d.ts.map +1 -1
- package/dist/src/utils/importHelper.js +3 -6
- package/dist/src/utils/importHelper.js.map +1 -1
- package/dist/src/utils/interfaces.d.ts +1 -1
- package/dist/src/utils/interfaces.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.js +7 -19
- package/dist/src/utils/mediaTypes.js.map +1 -1
- package/dist/src/utils/modelUtils.d.ts +5 -5
- package/dist/src/utils/modelUtils.d.ts.map +1 -1
- package/dist/src/utils/modelUtils.js +168 -257
- package/dist/src/utils/modelUtils.js.map +1 -1
- package/dist/src/utils/namespaceUtils.d.ts.map +1 -1
- package/dist/src/utils/namespaceUtils.js +6 -7
- package/dist/src/utils/namespaceUtils.js.map +1 -1
- package/dist/src/utils/operationUtil.d.ts +1 -1
- package/dist/src/utils/operationUtil.d.ts.map +1 -1
- package/dist/src/utils/operationUtil.js +60 -81
- package/dist/src/utils/operationUtil.js.map +1 -1
- package/dist/src/utils/parameterUtils.d.ts +1 -1
- package/dist/src/utils/parameterUtils.d.ts.map +1 -1
- package/dist/src/utils/parameterUtils.js +26 -33
- package/dist/src/utils/parameterUtils.js.map +1 -1
- package/dist/src/utils/resolve-project-root.js +2 -2
- package/dist/src/utils/resolve-project-root.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -45
- package/src/contextManager.ts +6 -9
- package/src/framework/declaration.ts +18 -28
- package/src/framework/dependency.ts +1 -2
- package/src/framework/hooks/binder.ts +47 -120
- package/src/framework/hooks/sdkTypes.ts +27 -54
- package/src/framework/hooks/useDependencies.ts +2 -4
- package/src/framework/load-static-helpers.ts +28 -51
- package/src/framework/reference.ts +2 -5
- package/src/framework/sample.ts +9 -9
- package/src/index.ts +145 -185
- package/src/lib.ts +143 -158
- package/src/metaTree.ts +1 -1
- package/src/modular/buildClassicalClient.ts +83 -160
- package/src/modular/buildClassicalOperationGroups.ts +14 -39
- package/src/modular/buildClientContext.ts +54 -83
- package/src/modular/buildModularOptions.ts +4 -5
- package/src/modular/buildOperations.ts +46 -73
- package/src/modular/buildProjectFiles.ts +18 -47
- package/src/modular/buildRestorePoller.ts +27 -46
- package/src/modular/buildRootIndex.ts +86 -160
- package/src/modular/buildSubpathIndex.ts +35 -58
- package/src/modular/emitLoggerFile.ts +4 -9
- package/src/modular/emitModels.ts +136 -266
- package/src/modular/emitModelsOptions.ts +10 -16
- package/src/modular/emitSamples.ts +92 -180
- package/src/modular/emitTests.ts +28 -61
- package/src/modular/external-dependencies.ts +54 -54
- package/src/modular/helpers/classicalOperationHelpers.ts +73 -126
- package/src/modular/helpers/clientHelpers.ts +41 -88
- package/src/modular/helpers/clientOptionHelpers.ts +4 -11
- package/src/modular/helpers/exampleValueHelpers.ts +99 -215
- package/src/modular/helpers/namingHelpers.ts +12 -28
- package/src/modular/helpers/operationHelpers.ts +430 -757
- package/src/modular/helpers/typeHelpers.ts +11 -22
- package/src/modular/serialization/buildDeserializerFunction.ts +88 -122
- package/src/modular/serialization/buildSerializerFunction.ts +91 -129
- package/src/modular/serialization/buildXmlSerializerFunction.ts +104 -183
- package/src/modular/serialization/serializeUtils.ts +12 -22
- package/src/modular/static/rollup.test.config.js +11 -14
- package/src/modular/static/scripts/renameOutput.mjs +2 -2
- package/src/modular/static-helpers-metadata.ts +60 -60
- package/src/modular/type-expressions/get-credential-expression.ts +1 -1
- package/src/modular/type-expressions/get-enum-expression.ts +5 -10
- package/src/modular/type-expressions/get-model-expression.ts +13 -17
- package/src/modular/type-expressions/get-nullable-expression.ts +4 -5
- package/src/modular/type-expressions/get-type-expression.ts +8 -12
- package/src/modular/type-expressions/get-union-expression.ts +4 -4
- package/src/modular/type-expressions/utils.ts +1 -1
- package/src/rlc-common/buildClient.ts +70 -141
- package/src/rlc-common/buildClientDefinitions.ts +44 -87
- package/src/rlc-common/buildIndexFile.ts +78 -78
- package/src/rlc-common/buildIsUnexpectedHelper.ts +34 -41
- package/src/rlc-common/buildLogger.ts +7 -7
- package/src/rlc-common/buildMethodShortcuts.ts +9 -21
- package/src/rlc-common/buildObjectTypes.ts +79 -156
- package/src/rlc-common/buildPaginateHelper.ts +9 -12
- package/src/rlc-common/buildParameterTypes.ts +116 -137
- package/src/rlc-common/buildPollingHelper.ts +7 -7
- package/src/rlc-common/buildResponseTypes.ts +34 -57
- package/src/rlc-common/buildSamples.ts +3 -3
- package/src/rlc-common/buildSchemaType.ts +37 -29
- package/src/rlc-common/buildSerializeHelper.ts +5 -5
- package/src/rlc-common/buildTopLevelIndexFile.ts +12 -19
- package/src/rlc-common/helpers/apiVersionUtil.ts +5 -10
- package/src/rlc-common/helpers/importsUtil.ts +27 -30
- package/src/rlc-common/helpers/nameConstructors.ts +16 -50
- package/src/rlc-common/helpers/nameUtils.ts +19 -42
- package/src/rlc-common/helpers/operationHelpers.ts +14 -31
- package/src/rlc-common/helpers/pathUtils.ts +2 -7
- package/src/rlc-common/helpers/schemaHelpers.ts +4 -15
- package/src/rlc-common/helpers/shortcutMethods.ts +6 -15
- package/src/rlc-common/helpers/typeUtil.ts +4 -11
- package/src/rlc-common/helpers/valueGenerationUtil.ts +16 -39
- package/src/rlc-common/index.ts +28 -28
- package/src/rlc-common/interfaces.ts +3 -11
- package/src/rlc-common/metadata/buildApiExtractorConfig.ts +17 -24
- package/src/rlc-common/metadata/buildChangelogFile.ts +1 -1
- package/src/rlc-common/metadata/buildESLintConfig.ts +3 -5
- package/src/rlc-common/metadata/buildLicenseFile.ts +1 -1
- package/src/rlc-common/metadata/buildPackageFile.ts +27 -35
- package/src/rlc-common/metadata/buildReadmeFile.ts +16 -29
- package/src/rlc-common/metadata/buildRollupConfig.ts +5 -8
- package/src/rlc-common/metadata/buildSampleEnvFile.ts +2 -3
- package/src/rlc-common/metadata/buildTestConfig.ts +10 -10
- package/src/rlc-common/metadata/buildTsConfig.ts +32 -35
- package/src/rlc-common/metadata/buildVitestConfig.ts +4 -10
- package/src/rlc-common/metadata/buildWarpConfig.ts +3 -6
- package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +16 -25
- package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +29 -50
- package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +20 -31
- package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +11 -13
- package/src/rlc-common/metadata/packageJson/packageCommon.ts +32 -52
- package/src/rlc-common/test/buildKarmaConfig.ts +1 -1
- package/src/rlc-common/test/buildRecordedClient.ts +3 -3
- package/src/rlc-common/test/buildSampleTest.ts +3 -3
- package/src/rlc-common/test/buildSnippets.ts +6 -12
- package/src/rlc-common/transformSampleGroups.ts +54 -105
- package/src/testing/index.ts +2 -5
- package/src/transform/transform.ts +22 -34
- package/src/transform/transformApiVersionInfo.ts +17 -30
- package/src/transform/transformHelperFunctionDetails.ts +14 -26
- package/src/transform/transformParameters.ts +55 -105
- package/src/transform/transformPaths.ts +26 -43
- package/src/transform/transformResponses.ts +26 -33
- package/src/transform/transformSchemas.ts +15 -33
- package/src/transform/transformTelemetryInfo.ts +8 -14
- package/src/transform/transfromRLCOptions.ts +53 -116
- package/src/utils/clientUtils.ts +22 -41
- package/src/utils/credentialUtils.ts +8 -19
- package/src/utils/crossLanguageDef.ts +15 -34
- package/src/utils/emitUtil.ts +11 -17
- package/src/utils/fileSystemUtils.ts +30 -8
- package/src/utils/importHelper.ts +5 -10
- package/src/utils/interfaces.ts +1 -1
- package/src/utils/mediaTypes.ts +13 -34
- package/src/utils/modelUtils.ts +175 -384
- package/src/utils/namespaceUtils.ts +8 -24
- package/src/utils/operationUtil.ts +98 -190
- package/src/utils/parameterUtils.ts +31 -54
- package/src/utils/resolve-project-root.ts +3 -3
- package/static/static-helpers/cloudSettingHelpers.ts +4 -6
- package/static/static-helpers/multipartHelpers.ts +3 -3
- package/static/static-helpers/pagingHelpers.ts +28 -63
- package/static/static-helpers/pollingHelpers.ts +16 -29
- package/static/static-helpers/serialization/build-multi-collection.ts +1 -4
- package/static/static-helpers/serialization/check-prop-undefined.ts +1 -4
- package/static/static-helpers/serialization/get-binary-response-browser.mts +3 -1
- package/static/static-helpers/serialization/get-binary-response.ts +2 -2
- package/static/static-helpers/serialization/get-binary-stream-response-browser.mts +1 -3
- package/static/static-helpers/serialization/get-binary-stream-response.ts +2 -4
- package/static/static-helpers/serialization/serialize-record.ts +1 -1
- package/static/static-helpers/serialization/serializers.ts +4 -7
- package/static/static-helpers/serialization/xml-helpers.ts +42 -90
- package/static/static-helpers/simplePollerHelpers.ts +10 -19
- package/static/static-helpers/storageCompatResponse.ts +10 -27
- package/static/static-helpers/urlTemplate.ts +4 -7
- package/static/test-helpers/recordedClient.ts +5 -10
|
@@ -1,37 +1,30 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
isAzurePackage
|
|
5
|
-
} from "../rlc-common/index.js";
|
|
1
|
+
import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
+
import { NoTarget } from "@typespec/compiler";
|
|
3
|
+
import { join } from "path/posix";
|
|
6
4
|
import { Project, SourceFile } from "ts-morph";
|
|
5
|
+
import { useContext } from "../contextManager.js";
|
|
6
|
+
import { resolveReference } from "../framework/reference.js";
|
|
7
|
+
import { reportDiagnostic } from "../lib.js";
|
|
8
|
+
import { isAzurePackage, NameType, normalizeName } from "../rlc-common/index.js";
|
|
9
|
+
import { getModularClientOptions } from "../utils/clientUtils.js";
|
|
10
|
+
import { SdkContext } from "../utils/interfaces.js";
|
|
11
|
+
import { getMethodHierarchiesMap } from "../utils/operationUtil.js";
|
|
12
|
+
import { partitionAndEmitExports } from "./buildSubpathIndex.js";
|
|
7
13
|
import { getClassicalClientName } from "./helpers/namingHelpers.js";
|
|
14
|
+
import { isLroOnlyOperation } from "./helpers/operationHelpers.js";
|
|
8
15
|
import { ModularEmitterOptions } from "./interfaces.js";
|
|
9
|
-
import { resolveReference } from "../framework/reference.js";
|
|
10
16
|
import {
|
|
11
17
|
CloudSettingHelpers,
|
|
12
18
|
MultipartHelpers,
|
|
13
19
|
PagingHelpers,
|
|
14
|
-
PlatformTypeHelpers
|
|
20
|
+
PlatformTypeHelpers,
|
|
15
21
|
} from "./static-helpers-metadata.js";
|
|
16
|
-
import {
|
|
17
|
-
SdkClientType,
|
|
18
|
-
SdkServiceOperation
|
|
19
|
-
} from "@azure-tools/typespec-client-generator-core";
|
|
20
|
-
import { getModularClientOptions } from "../utils/clientUtils.js";
|
|
21
|
-
import { getMethodHierarchiesMap } from "../utils/operationUtil.js";
|
|
22
|
-
import { join } from "path/posix";
|
|
23
|
-
import { useContext } from "../contextManager.js";
|
|
24
|
-
import { reportDiagnostic } from "../lib.js";
|
|
25
|
-
import { NoTarget } from "@typespec/compiler";
|
|
26
|
-
import { isLroOnlyOperation } from "./helpers/operationHelpers.js";
|
|
27
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
28
|
-
import { partitionAndEmitExports } from "./buildSubpathIndex.js";
|
|
29
22
|
|
|
30
23
|
export function buildRootIndex(
|
|
31
24
|
context: SdkContext,
|
|
32
25
|
emitterOptions: ModularEmitterOptions,
|
|
33
26
|
rootIndexFile: SourceFile,
|
|
34
|
-
clientMap?: [string[], SdkClientType<SdkServiceOperation>]
|
|
27
|
+
clientMap?: [string[], SdkClientType<SdkServiceOperation>],
|
|
35
28
|
) {
|
|
36
29
|
if (!clientMap) {
|
|
37
30
|
// we still need to export the models if no client is provided
|
|
@@ -47,47 +40,33 @@ export function buildRootIndex(
|
|
|
47
40
|
const clientFile = project.getSourceFile(
|
|
48
41
|
`${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}${normalizeName(
|
|
49
42
|
clientName,
|
|
50
|
-
NameType.File
|
|
51
|
-
)}.ts
|
|
43
|
+
NameType.File,
|
|
44
|
+
)}.ts`,
|
|
52
45
|
);
|
|
53
46
|
|
|
54
47
|
if (!clientFile) {
|
|
55
48
|
reportDiagnostic(context.program, {
|
|
56
49
|
code: "client-file-not-found",
|
|
57
50
|
format: {
|
|
58
|
-
filePath: `${srcPath}/${normalizeName(clientName, NameType.File)}.ts
|
|
51
|
+
filePath: `${srcPath}/${normalizeName(clientName, NameType.File)}.ts`,
|
|
59
52
|
},
|
|
60
|
-
target: NoTarget
|
|
53
|
+
target: NoTarget,
|
|
61
54
|
});
|
|
62
55
|
return; // Skip exporting this client but continue with others
|
|
63
56
|
}
|
|
64
57
|
|
|
65
58
|
exportClassicalClient(client, rootIndexFile, subfolder ?? "");
|
|
66
|
-
exportSimplePollerLike(
|
|
67
|
-
|
|
68
|
-
clientMap,
|
|
69
|
-
rootIndexFile,
|
|
70
|
-
project,
|
|
71
|
-
srcPath,
|
|
72
|
-
subfolder
|
|
73
|
-
);
|
|
74
|
-
exportRestoreHelpers(
|
|
75
|
-
rootIndexFile,
|
|
76
|
-
project,
|
|
77
|
-
srcPath,
|
|
78
|
-
clientName,
|
|
79
|
-
subfolder,
|
|
80
|
-
true
|
|
81
|
-
);
|
|
59
|
+
exportSimplePollerLike(context, clientMap, rootIndexFile, project, srcPath, subfolder);
|
|
60
|
+
exportRestoreHelpers(rootIndexFile, project, srcPath, clientName, subfolder, true);
|
|
82
61
|
exportModels(emitterOptions, rootIndexFile, clientName);
|
|
83
62
|
exportModules(rootIndexFile, project, srcPath, clientName, "api", {
|
|
84
63
|
subfolder,
|
|
85
64
|
interfaceOnly: true,
|
|
86
|
-
isTopLevel: true
|
|
65
|
+
isTopLevel: true,
|
|
87
66
|
});
|
|
88
67
|
exportModules(rootIndexFile, project, srcPath, clientName, "classic", {
|
|
89
68
|
subfolder,
|
|
90
|
-
isTopLevel: true
|
|
69
|
+
isTopLevel: true,
|
|
91
70
|
});
|
|
92
71
|
|
|
93
72
|
exportPagingTypes(context, rootIndexFile);
|
|
@@ -99,20 +78,18 @@ export function buildRootIndex(
|
|
|
99
78
|
function exportModels(
|
|
100
79
|
emitterOptions: ModularEmitterOptions,
|
|
101
80
|
rootIndexFile: SourceFile,
|
|
102
|
-
clientName: string = ""
|
|
81
|
+
clientName: string = "",
|
|
103
82
|
) {
|
|
104
83
|
// export models index file if not exists
|
|
105
84
|
const project = useContext("outputProject");
|
|
106
85
|
const srcPath = emitterOptions.modularOptions.sourceRoot;
|
|
107
|
-
const modelsExportsIndex = rootIndexFile
|
|
108
|
-
.
|
|
109
|
-
|
|
110
|
-
return i.getModuleSpecifierValue()?.startsWith(`./models/`);
|
|
111
|
-
});
|
|
86
|
+
const modelsExportsIndex = rootIndexFile.getExportDeclarations()?.find((i) => {
|
|
87
|
+
return i.getModuleSpecifierValue()?.startsWith(`./models/`);
|
|
88
|
+
});
|
|
112
89
|
if (!modelsExportsIndex) {
|
|
113
90
|
exportModules(rootIndexFile, project, srcPath, clientName, "models", {
|
|
114
91
|
isTopLevel: true,
|
|
115
|
-
recursive: true
|
|
92
|
+
recursive: true,
|
|
116
93
|
});
|
|
117
94
|
}
|
|
118
95
|
}
|
|
@@ -120,13 +97,11 @@ function exportModels(
|
|
|
120
97
|
function exportAzureCloudTypes(context: SdkContext, rootIndexFile: SourceFile) {
|
|
121
98
|
if (context.arm) {
|
|
122
99
|
// AzureClouds is an enum (runtime value), AzureSupportedClouds is a type alias
|
|
123
|
-
addExportsToRootIndexFile(rootIndexFile, [
|
|
124
|
-
resolveReference(CloudSettingHelpers.AzureClouds)
|
|
125
|
-
]);
|
|
100
|
+
addExportsToRootIndexFile(rootIndexFile, [resolveReference(CloudSettingHelpers.AzureClouds)]);
|
|
126
101
|
addExportsToRootIndexFile(
|
|
127
102
|
rootIndexFile,
|
|
128
103
|
[resolveReference(CloudSettingHelpers.AzureSupportedClouds)],
|
|
129
|
-
true
|
|
104
|
+
true,
|
|
130
105
|
);
|
|
131
106
|
}
|
|
132
107
|
}
|
|
@@ -136,13 +111,11 @@ function exportRestErrorTypes(context: SdkContext, rootIndexFile: SourceFile) {
|
|
|
136
111
|
return;
|
|
137
112
|
}
|
|
138
113
|
const existingExports = getExistingExports(rootIndexFile);
|
|
139
|
-
const namedExports = ["RestError", "isRestError"].filter(
|
|
140
|
-
(name) => !existingExports.has(name)
|
|
141
|
-
);
|
|
114
|
+
const namedExports = ["RestError", "isRestError"].filter((name) => !existingExports.has(name));
|
|
142
115
|
if (namedExports.length > 0) {
|
|
143
116
|
rootIndexFile.addExportDeclaration({
|
|
144
117
|
moduleSpecifier: "@azure/core-rest-pipeline",
|
|
145
|
-
namedExports
|
|
118
|
+
namedExports,
|
|
146
119
|
});
|
|
147
120
|
}
|
|
148
121
|
}
|
|
@@ -160,9 +133,9 @@ function exportPagingTypes(context: SdkContext, rootIndexFile: SourceFile) {
|
|
|
160
133
|
[
|
|
161
134
|
resolveReference(PagingHelpers.PageSettings),
|
|
162
135
|
resolveReference(PagingHelpers.ContinuablePage),
|
|
163
|
-
resolveReference(PagingHelpers.PagedAsyncIterableIterator)
|
|
136
|
+
resolveReference(PagingHelpers.PagedAsyncIterableIterator),
|
|
164
137
|
],
|
|
165
|
-
true
|
|
138
|
+
true,
|
|
166
139
|
);
|
|
167
140
|
}
|
|
168
141
|
|
|
@@ -170,9 +143,7 @@ function hasPaging(context: SdkContext): boolean {
|
|
|
170
143
|
return context.sdkPackage.clients.some((client) => {
|
|
171
144
|
const methodMap = getMethodHierarchiesMap(context, client);
|
|
172
145
|
for (const [_, operations] of methodMap) {
|
|
173
|
-
if (
|
|
174
|
-
operations.some((op) => op.kind === "paging" || op.kind === "lropaging")
|
|
175
|
-
) {
|
|
146
|
+
if (operations.some((op) => op.kind === "paging" || op.kind === "lropaging")) {
|
|
176
147
|
return true;
|
|
177
148
|
}
|
|
178
149
|
}
|
|
@@ -180,15 +151,9 @@ function hasPaging(context: SdkContext): boolean {
|
|
|
180
151
|
});
|
|
181
152
|
}
|
|
182
153
|
|
|
183
|
-
function exportFileContentsType(
|
|
184
|
-
context: SdkContext,
|
|
185
|
-
rootIndexFile: SourceFile
|
|
186
|
-
) {
|
|
154
|
+
function exportFileContentsType(context: SdkContext, rootIndexFile: SourceFile) {
|
|
187
155
|
const hasMultipartFileParts = context.sdkPackage.models.some((x) =>
|
|
188
|
-
x.properties.some(
|
|
189
|
-
// eslint-disable-next-line
|
|
190
|
-
(y) => y.kind === "property" && y.multipartOptions?.isFilePart
|
|
191
|
-
)
|
|
156
|
+
x.properties.some((y) => y.kind === "property" && y.multipartOptions?.isFilePart),
|
|
192
157
|
);
|
|
193
158
|
|
|
194
159
|
if (hasMultipartFileParts) {
|
|
@@ -196,9 +161,9 @@ function exportFileContentsType(
|
|
|
196
161
|
rootIndexFile,
|
|
197
162
|
[
|
|
198
163
|
resolveReference(MultipartHelpers.FileContents),
|
|
199
|
-
resolveReference(PlatformTypeHelpers.NodeReadableStream)
|
|
164
|
+
resolveReference(PlatformTypeHelpers.NodeReadableStream),
|
|
200
165
|
],
|
|
201
|
-
true
|
|
166
|
+
true,
|
|
202
167
|
);
|
|
203
168
|
}
|
|
204
169
|
}
|
|
@@ -208,31 +173,26 @@ function getExistingExports(rootIndexFile: SourceFile): Set<string> {
|
|
|
208
173
|
rootIndexFile
|
|
209
174
|
.getExportDeclarations()
|
|
210
175
|
.flatMap((exportDecl) =>
|
|
211
|
-
exportDecl.getNamedExports().map((namedExport) => namedExport.getName())
|
|
212
|
-
)
|
|
176
|
+
exportDecl.getNamedExports().map((namedExport) => namedExport.getName()),
|
|
177
|
+
),
|
|
213
178
|
);
|
|
214
179
|
}
|
|
215
180
|
|
|
216
|
-
function getNewNamedExports(
|
|
217
|
-
namedExports
|
|
218
|
-
existingExports: Set<string>
|
|
219
|
-
): string[] {
|
|
220
|
-
return namedExports.filter(
|
|
221
|
-
(namedExport) => !existingExports.has(namedExport)
|
|
222
|
-
);
|
|
181
|
+
function getNewNamedExports(namedExports: string[], existingExports: Set<string>): string[] {
|
|
182
|
+
return namedExports.filter((namedExport) => !existingExports.has(namedExport));
|
|
223
183
|
}
|
|
224
184
|
|
|
225
185
|
function addExportsToRootIndexFile(
|
|
226
186
|
rootIndexFile: SourceFile,
|
|
227
187
|
namedExports: string[],
|
|
228
|
-
isTypeOnly: boolean = false
|
|
188
|
+
isTypeOnly: boolean = false,
|
|
229
189
|
) {
|
|
230
190
|
const existingExports = getExistingExports(rootIndexFile);
|
|
231
191
|
const newNamedExports = getNewNamedExports(namedExports, existingExports);
|
|
232
192
|
if (newNamedExports.length > 0) {
|
|
233
193
|
rootIndexFile.addExportDeclaration({
|
|
234
194
|
isTypeOnly,
|
|
235
|
-
namedExports: newNamedExports
|
|
195
|
+
namedExports: newNamedExports,
|
|
236
196
|
});
|
|
237
197
|
}
|
|
238
198
|
}
|
|
@@ -244,7 +204,7 @@ function exportSimplePollerLike(
|
|
|
244
204
|
project: Project,
|
|
245
205
|
srcPath: string,
|
|
246
206
|
subfolder: string = "",
|
|
247
|
-
isTopLevel: boolean = false
|
|
207
|
+
isTopLevel: boolean = false,
|
|
248
208
|
) {
|
|
249
209
|
const [_, client] = clientMap;
|
|
250
210
|
|
|
@@ -258,7 +218,7 @@ function exportSimplePollerLike(
|
|
|
258
218
|
const helperFile = project.getSourceFile(
|
|
259
219
|
`${srcPath}/${
|
|
260
220
|
subfolder && subfolder !== "" ? subfolder + "/" : ""
|
|
261
|
-
}static-helpers/simplePollerHelpers.ts
|
|
221
|
+
}static-helpers/simplePollerHelpers.ts`,
|
|
262
222
|
);
|
|
263
223
|
if (!helperFile) {
|
|
264
224
|
return;
|
|
@@ -269,7 +229,7 @@ function exportSimplePollerLike(
|
|
|
269
229
|
indexFile.addExportDeclaration({
|
|
270
230
|
isTypeOnly: true,
|
|
271
231
|
moduleSpecifier,
|
|
272
|
-
namedExports: ["SimplePollerLike"]
|
|
232
|
+
namedExports: ["SimplePollerLike"],
|
|
273
233
|
});
|
|
274
234
|
}
|
|
275
235
|
|
|
@@ -279,12 +239,10 @@ function exportRestoreHelpers(
|
|
|
279
239
|
srcPath: string,
|
|
280
240
|
clientName: string,
|
|
281
241
|
subfolder: string = "",
|
|
282
|
-
isTopLevel: boolean = false
|
|
242
|
+
isTopLevel: boolean = false,
|
|
283
243
|
) {
|
|
284
244
|
const helperFile = project.getSourceFile(
|
|
285
|
-
`${srcPath}/${
|
|
286
|
-
subfolder && subfolder !== "" ? subfolder + "/" : ""
|
|
287
|
-
}restorePollerHelpers.ts`
|
|
245
|
+
`${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}restorePollerHelpers.ts`,
|
|
288
246
|
);
|
|
289
247
|
if (!helperFile) {
|
|
290
248
|
return;
|
|
@@ -294,8 +252,7 @@ function exportRestoreHelpers(
|
|
|
294
252
|
const moduleSpecifier = `./${
|
|
295
253
|
isTopLevel && subfolder && subfolder !== "" ? subfolder + "/" : ""
|
|
296
254
|
}restorePollerHelpers.js`;
|
|
297
|
-
const renamer = (name: string) =>
|
|
298
|
-
exported.has(name) ? `${name} as ${clientName}${name}` : name;
|
|
255
|
+
const renamer = (name: string) => (exported.has(name) ? `${name} as ${clientName}${name}` : name);
|
|
299
256
|
partitionAndEmitExports(indexFile, moduleSpecifier, allEntries, renamer);
|
|
300
257
|
}
|
|
301
258
|
|
|
@@ -303,14 +260,14 @@ function exportClassicalClient(
|
|
|
303
260
|
client: SdkClientType<SdkServiceOperation>,
|
|
304
261
|
indexFile: SourceFile,
|
|
305
262
|
subfolder: string,
|
|
306
|
-
isSubClient: boolean = false
|
|
263
|
+
isSubClient: boolean = false,
|
|
307
264
|
) {
|
|
308
265
|
const clientName = client.name;
|
|
309
266
|
indexFile.addExportDeclaration({
|
|
310
267
|
namedExports: [clientName],
|
|
311
268
|
moduleSpecifier: `./${
|
|
312
269
|
subfolder && subfolder !== "" && !isSubClient ? subfolder + "/" : ""
|
|
313
|
-
}${normalizeName(clientName, NameType.File)}.js
|
|
270
|
+
}${normalizeName(clientName, NameType.File)}.js`,
|
|
314
271
|
});
|
|
315
272
|
}
|
|
316
273
|
|
|
@@ -331,8 +288,8 @@ function exportModules(
|
|
|
331
288
|
interfaceOnly: false,
|
|
332
289
|
isTopLevel: false,
|
|
333
290
|
subfolder: "",
|
|
334
|
-
recursive: false
|
|
335
|
-
}
|
|
291
|
+
recursive: false,
|
|
292
|
+
},
|
|
336
293
|
) {
|
|
337
294
|
const subfolder = options.subfolder ?? "";
|
|
338
295
|
let folders = [];
|
|
@@ -341,10 +298,7 @@ function exportModules(
|
|
|
341
298
|
.getDirectories()
|
|
342
299
|
.filter((dir) => {
|
|
343
300
|
const formattedDir = dir.getPath().replace(/\\/g, "/");
|
|
344
|
-
const targetPath = join(srcPath, subfolder, moduleName).replace(
|
|
345
|
-
/\\/g,
|
|
346
|
-
"/"
|
|
347
|
-
);
|
|
301
|
+
const targetPath = join(srcPath, subfolder, moduleName).replace(/\\/g, "/");
|
|
348
302
|
return formattedDir.startsWith(targetPath);
|
|
349
303
|
})
|
|
350
304
|
.map((dir) => {
|
|
@@ -355,10 +309,7 @@ function exportModules(
|
|
|
355
309
|
.getDirectories()
|
|
356
310
|
.filter((dir) => {
|
|
357
311
|
const formattedDir = dir.getPath().replace(/\\/g, "/");
|
|
358
|
-
const targetPath = join(srcPath, subfolder, moduleName).replace(
|
|
359
|
-
/\\/g,
|
|
360
|
-
"/"
|
|
361
|
-
);
|
|
312
|
+
const targetPath = join(srcPath, subfolder, moduleName).replace(/\\/g, "/");
|
|
362
313
|
return formattedDir.startsWith(targetPath);
|
|
363
314
|
})
|
|
364
315
|
.map((dir) => {
|
|
@@ -376,37 +327,30 @@ function exportModules(
|
|
|
376
327
|
|
|
377
328
|
const exported = new Set(indexFile.getExportedDeclarations().keys());
|
|
378
329
|
const serializerOrDeserializerRegex = /.*(Serializer|Deserializer)(_\d+)?$/;
|
|
379
|
-
const filteredEntries = [
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
if (exDeclaration[0].startsWith("_")) {
|
|
383
|
-
return false;
|
|
384
|
-
}
|
|
385
|
-
return exDeclaration[1].some((ex) => {
|
|
386
|
-
if (
|
|
387
|
-
options.interfaceOnly &&
|
|
388
|
-
ex.getKindName() !== "InterfaceDeclaration"
|
|
389
|
-
) {
|
|
390
|
-
return false;
|
|
391
|
-
}
|
|
392
|
-
if (
|
|
393
|
-
moduleName === "models" &&
|
|
394
|
-
ex.getKindName() === "FunctionDeclaration" &&
|
|
395
|
-
serializerOrDeserializerRegex.test(exDeclaration[0])
|
|
396
|
-
) {
|
|
397
|
-
return false;
|
|
398
|
-
}
|
|
399
|
-
if (
|
|
400
|
-
options.interfaceOnly &&
|
|
401
|
-
options.isTopLevel &&
|
|
402
|
-
exDeclaration[0].endsWith("Context")
|
|
403
|
-
) {
|
|
330
|
+
const filteredEntries = [...modelsFile.getExportedDeclarations().entries()].filter(
|
|
331
|
+
(exDeclaration) => {
|
|
332
|
+
if (exDeclaration[0].startsWith("_")) {
|
|
404
333
|
return false;
|
|
405
334
|
}
|
|
335
|
+
return exDeclaration[1].some((ex) => {
|
|
336
|
+
if (options.interfaceOnly && ex.getKindName() !== "InterfaceDeclaration") {
|
|
337
|
+
return false;
|
|
338
|
+
}
|
|
339
|
+
if (
|
|
340
|
+
moduleName === "models" &&
|
|
341
|
+
ex.getKindName() === "FunctionDeclaration" &&
|
|
342
|
+
serializerOrDeserializerRegex.test(exDeclaration[0])
|
|
343
|
+
) {
|
|
344
|
+
return false;
|
|
345
|
+
}
|
|
346
|
+
if (options.interfaceOnly && options.isTopLevel && exDeclaration[0].endsWith("Context")) {
|
|
347
|
+
return false;
|
|
348
|
+
}
|
|
406
349
|
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
350
|
+
return true;
|
|
351
|
+
});
|
|
352
|
+
},
|
|
353
|
+
);
|
|
410
354
|
const moduleSpecifier = `.${modelsFile
|
|
411
355
|
.getFilePath()
|
|
412
356
|
.replace(indexFile.getDirectoryPath(), "")
|
|
@@ -414,19 +358,14 @@ function exportModules(
|
|
|
414
358
|
.replace(".ts", "")}.js`;
|
|
415
359
|
const renamer = (name: string) =>
|
|
416
360
|
exported.has(name) ? `${name} as ${clientName}${name}` : name;
|
|
417
|
-
partitionAndEmitExports(
|
|
418
|
-
indexFile,
|
|
419
|
-
moduleSpecifier,
|
|
420
|
-
filteredEntries,
|
|
421
|
-
renamer
|
|
422
|
-
);
|
|
361
|
+
partitionAndEmitExports(indexFile, moduleSpecifier, filteredEntries, renamer);
|
|
423
362
|
}
|
|
424
363
|
}
|
|
425
364
|
|
|
426
365
|
export function buildSubClientIndexFile(
|
|
427
366
|
context: SdkContext,
|
|
428
367
|
clientMap: [string[], SdkClientType<SdkServiceOperation>],
|
|
429
|
-
emitterOptions: ModularEmitterOptions
|
|
368
|
+
emitterOptions: ModularEmitterOptions,
|
|
430
369
|
) {
|
|
431
370
|
const project = useContext("outputProject");
|
|
432
371
|
const [_, client] = clientMap;
|
|
@@ -435,7 +374,7 @@ export function buildSubClientIndexFile(
|
|
|
435
374
|
const subClientIndexFile = project.createSourceFile(
|
|
436
375
|
`${srcPath}/${subfolder && subfolder !== "" ? subfolder + "/" : ""}index.ts`,
|
|
437
376
|
undefined,
|
|
438
|
-
{ overwrite: true }
|
|
377
|
+
{ overwrite: true },
|
|
439
378
|
);
|
|
440
379
|
const clientName = `${getClassicalClientName(client)}`;
|
|
441
380
|
const clientFilePath = `${srcPath}/${
|
|
@@ -447,35 +386,22 @@ export function buildSubClientIndexFile(
|
|
|
447
386
|
reportDiagnostic(context.program, {
|
|
448
387
|
code: "client-file-not-found",
|
|
449
388
|
format: {
|
|
450
|
-
filePath: clientFilePath
|
|
389
|
+
filePath: clientFilePath,
|
|
451
390
|
},
|
|
452
|
-
target: NoTarget
|
|
391
|
+
target: NoTarget,
|
|
453
392
|
});
|
|
454
393
|
return; // Skip exporting this client but continue with others
|
|
455
394
|
}
|
|
456
395
|
|
|
457
396
|
exportClassicalClient(client, subClientIndexFile, subfolder ?? "", true);
|
|
458
|
-
exportSimplePollerLike(
|
|
459
|
-
|
|
460
|
-
clientMap,
|
|
461
|
-
subClientIndexFile,
|
|
462
|
-
project,
|
|
463
|
-
srcPath,
|
|
464
|
-
subfolder
|
|
465
|
-
);
|
|
466
|
-
exportRestoreHelpers(
|
|
467
|
-
subClientIndexFile,
|
|
468
|
-
project,
|
|
469
|
-
srcPath,
|
|
470
|
-
clientName,
|
|
471
|
-
subfolder
|
|
472
|
-
);
|
|
397
|
+
exportSimplePollerLike(context, clientMap, subClientIndexFile, project, srcPath, subfolder);
|
|
398
|
+
exportRestoreHelpers(subClientIndexFile, project, srcPath, clientName, subfolder);
|
|
473
399
|
exportModules(subClientIndexFile, project, srcPath, clientName, "api", {
|
|
474
400
|
subfolder,
|
|
475
401
|
interfaceOnly: true,
|
|
476
|
-
recursive: true
|
|
402
|
+
recursive: true,
|
|
477
403
|
});
|
|
478
404
|
exportModules(subClientIndexFile, project, srcPath, clientName, "classic", {
|
|
479
|
-
subfolder
|
|
405
|
+
subfolder,
|
|
480
406
|
});
|
|
481
407
|
}
|
|
@@ -1,13 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
SdkClientType,
|
|
3
|
-
SdkServiceOperation
|
|
4
|
-
} from "@azure-tools/typespec-client-generator-core";
|
|
1
|
+
import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
|
|
5
2
|
import { ModularEmitterOptions } from "./interfaces.js";
|
|
6
3
|
|
|
7
4
|
import { join } from "path";
|
|
8
|
-
import { getModularClientOptions } from "../utils/clientUtils.js";
|
|
9
|
-
import { useContext } from "../contextManager.js";
|
|
10
5
|
import { Node, SourceFile } from "ts-morph";
|
|
6
|
+
import { useContext } from "../contextManager.js";
|
|
7
|
+
import { getModularClientOptions } from "../utils/clientUtils.js";
|
|
11
8
|
|
|
12
9
|
export interface buildSubpathIndexFileOptions {
|
|
13
10
|
exportIndex?: boolean;
|
|
@@ -19,12 +16,10 @@ export function buildSubpathIndexFile(
|
|
|
19
16
|
emitterOptions: ModularEmitterOptions,
|
|
20
17
|
subpath: string,
|
|
21
18
|
clientMap?: [string[], SdkClientType<SdkServiceOperation>],
|
|
22
|
-
options: buildSubpathIndexFileOptions = {}
|
|
19
|
+
options: buildSubpathIndexFileOptions = {},
|
|
23
20
|
) {
|
|
24
21
|
const project = useContext("outputProject");
|
|
25
|
-
const subfolder = clientMap
|
|
26
|
-
? (getModularClientOptions(clientMap).subfolder ?? "")
|
|
27
|
-
: "";
|
|
22
|
+
const subfolder = clientMap ? (getModularClientOptions(clientMap).subfolder ?? "") : "";
|
|
28
23
|
const srcPath = emitterOptions.modularOptions.sourceRoot;
|
|
29
24
|
// Skip to export these files because they are used internally.
|
|
30
25
|
const skipFiles = ["pagingHelpers.ts", "pollingHelpers.ts"];
|
|
@@ -34,13 +29,9 @@ export function buildSubpathIndexFile(
|
|
|
34
29
|
.getDirectories()
|
|
35
30
|
.filter((dir) => {
|
|
36
31
|
const formattedDir = dir.getPath().replace(/\\/g, "/");
|
|
37
|
-
const targetPath = join(srcPath, subfolder, subpath).replace(
|
|
38
|
-
/\\/g,
|
|
39
|
-
"/"
|
|
40
|
-
);
|
|
32
|
+
const targetPath = join(srcPath, subfolder, subpath).replace(/\\/g, "/");
|
|
41
33
|
return (
|
|
42
|
-
formattedDir.startsWith(targetPath) &&
|
|
43
|
-
!project.getSourceFile(`${formattedDir}/index.ts`)
|
|
34
|
+
formattedDir.startsWith(targetPath) && !project.getSourceFile(`${formattedDir}/index.ts`)
|
|
44
35
|
);
|
|
45
36
|
})
|
|
46
37
|
.map((dir) => {
|
|
@@ -50,21 +41,16 @@ export function buildSubpathIndexFile(
|
|
|
50
41
|
folders = [join(srcPath, subfolder, subpath).replace(/\\/g, "/")];
|
|
51
42
|
}
|
|
52
43
|
for (const folder of folders) {
|
|
53
|
-
const apiFilePattern =
|
|
54
|
-
subpath === "models" ? join(folder, "models.ts") : folder;
|
|
44
|
+
const apiFilePattern = subpath === "models" ? join(folder, "models.ts") : folder;
|
|
55
45
|
const apiFiles = project.getSourceFiles().filter((file) => {
|
|
56
46
|
if (subpath === "api" && options.recursive) {
|
|
57
|
-
return (
|
|
58
|
-
file.getDirectoryPath().replace(/\\/g, "/") ===
|
|
59
|
-
apiFilePattern.replace(/\\/g, "/")
|
|
60
|
-
);
|
|
47
|
+
return file.getDirectoryPath().replace(/\\/g, "/") === apiFilePattern.replace(/\\/g, "/");
|
|
61
48
|
}
|
|
62
49
|
return file
|
|
63
50
|
.getFilePath()
|
|
64
51
|
.replace(/\\/g, "/")
|
|
65
52
|
.startsWith(
|
|
66
|
-
apiFilePattern.replace(/\\/g, "/") +
|
|
67
|
-
(apiFilePattern.endsWith("models.ts") ? "" : "/")
|
|
53
|
+
apiFilePattern.replace(/\\/g, "/") + (apiFilePattern.endsWith("models.ts") ? "" : "/"),
|
|
68
54
|
);
|
|
69
55
|
});
|
|
70
56
|
if (apiFiles.length === 0) {
|
|
@@ -73,8 +59,7 @@ export function buildSubpathIndexFile(
|
|
|
73
59
|
const indexFile = project.createSourceFile(`${folder}/index.ts`);
|
|
74
60
|
for (const file of apiFiles) {
|
|
75
61
|
const filePath = file.getFilePath();
|
|
76
|
-
const serializerOrDeserializerRegex =
|
|
77
|
-
/.*(Serializer|Deserializer)(_\d+)?$/;
|
|
62
|
+
const serializerOrDeserializerRegex = /.*(Serializer|Deserializer)(_\d+)?$/;
|
|
78
63
|
if (!options.exportIndex && filePath.endsWith("index.ts")) {
|
|
79
64
|
continue;
|
|
80
65
|
}
|
|
@@ -86,37 +71,33 @@ export function buildSubpathIndexFile(
|
|
|
86
71
|
continue;
|
|
87
72
|
}
|
|
88
73
|
|
|
89
|
-
let filteredDeclarations = [
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (exDeclaration[0].startsWith("_")) {
|
|
93
|
-
return false;
|
|
94
|
-
}
|
|
95
|
-
return exDeclaration[1].some((ex) => {
|
|
96
|
-
if (
|
|
97
|
-
options.interfaceOnly &&
|
|
98
|
-
ex.getKindName() !== "InterfaceDeclaration"
|
|
99
|
-
) {
|
|
74
|
+
let filteredDeclarations = [...file.getExportedDeclarations().entries()].filter(
|
|
75
|
+
(exDeclaration) => {
|
|
76
|
+
if (exDeclaration[0].startsWith("_")) {
|
|
100
77
|
return false;
|
|
101
78
|
}
|
|
79
|
+
return exDeclaration[1].some((ex) => {
|
|
80
|
+
if (options.interfaceOnly && ex.getKindName() !== "InterfaceDeclaration") {
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
102
83
|
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
84
|
+
// skip exporting serializers for models
|
|
85
|
+
if (
|
|
86
|
+
subpath === "models" &&
|
|
87
|
+
ex.getKindName() === "FunctionDeclaration" &&
|
|
88
|
+
serializerOrDeserializerRegex.test(exDeclaration[0])
|
|
89
|
+
) {
|
|
90
|
+
return false;
|
|
91
|
+
}
|
|
111
92
|
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
93
|
+
return true;
|
|
94
|
+
});
|
|
95
|
+
},
|
|
96
|
+
);
|
|
115
97
|
// Skip to export PagedResult and BuildPagedAsyncIteratorOptions
|
|
116
98
|
if (filePath.endsWith("pagingTypes.ts")) {
|
|
117
99
|
filteredDeclarations = filteredDeclarations.filter(
|
|
118
|
-
([name]) =>
|
|
119
|
-
!["PagedResult", "BuildPagedAsyncIteratorOptions"].includes(name)
|
|
100
|
+
([name]) => !["PagedResult", "BuildPagedAsyncIteratorOptions"].includes(name),
|
|
120
101
|
);
|
|
121
102
|
}
|
|
122
103
|
if (filteredDeclarations.length > 0) {
|
|
@@ -124,11 +105,7 @@ export function buildSubpathIndexFile(
|
|
|
124
105
|
.replace(indexFile.getDirectoryPath(), "")
|
|
125
106
|
.replace(/\\/g, "/")
|
|
126
107
|
.replace(".ts", "")}.js`;
|
|
127
|
-
partitionAndEmitExports(
|
|
128
|
-
indexFile,
|
|
129
|
-
moduleSpecifier,
|
|
130
|
-
filteredDeclarations
|
|
131
|
-
);
|
|
108
|
+
partitionAndEmitExports(indexFile, moduleSpecifier, filteredDeclarations);
|
|
132
109
|
}
|
|
133
110
|
}
|
|
134
111
|
}
|
|
@@ -147,7 +124,7 @@ export function partitionAndEmitExports(
|
|
|
147
124
|
indexFile: SourceFile,
|
|
148
125
|
moduleSpecifier: string,
|
|
149
126
|
entries: [string, Node[]][],
|
|
150
|
-
mapName: (name: string) => string = (n) => n
|
|
127
|
+
mapName: (name: string) => string = (n) => n,
|
|
151
128
|
): void {
|
|
152
129
|
const typeOnlyExports: string[] = [];
|
|
153
130
|
const valueExports: string[] = [];
|
|
@@ -163,13 +140,13 @@ export function partitionAndEmitExports(
|
|
|
163
140
|
indexFile.addExportDeclaration({
|
|
164
141
|
isTypeOnly: true,
|
|
165
142
|
moduleSpecifier,
|
|
166
|
-
namedExports: typeOnlyExports
|
|
143
|
+
namedExports: typeOnlyExports,
|
|
167
144
|
});
|
|
168
145
|
}
|
|
169
146
|
if (valueExports.length > 0) {
|
|
170
147
|
indexFile.addExportDeclaration({
|
|
171
148
|
moduleSpecifier,
|
|
172
|
-
namedExports: valueExports
|
|
149
|
+
namedExports: valueExports,
|
|
173
150
|
});
|
|
174
151
|
}
|
|
175
152
|
}
|