@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,6 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
+
import * as path from "path";
|
|
4
5
|
import {
|
|
5
6
|
CallSignatureDeclarationStructure,
|
|
6
7
|
InterfaceDeclarationStructure,
|
|
@@ -8,41 +9,32 @@ import {
|
|
|
8
9
|
Project,
|
|
9
10
|
SourceFile,
|
|
10
11
|
StructureKind,
|
|
11
|
-
Writers
|
|
12
|
+
Writers,
|
|
12
13
|
} from "ts-morph";
|
|
13
|
-
import * as path from "path";
|
|
14
14
|
|
|
15
|
+
import { REST_CLIENT_RESERVED } from "./buildMethodShortcuts.js";
|
|
16
|
+
import { getImportSpecifier } from "./helpers/importsUtil.js";
|
|
17
|
+
import { getClientName, getImportModuleName } from "./helpers/nameConstructors.js";
|
|
18
|
+
import { CasingConvention, NameType, normalizeName, pascalCase } from "./helpers/nameUtils.js";
|
|
15
19
|
import {
|
|
16
20
|
buildMethodDefinitions,
|
|
17
21
|
getGeneratedWrapperTypes,
|
|
18
|
-
getPathParamDefinitions
|
|
22
|
+
getPathParamDefinitions,
|
|
19
23
|
} from "./helpers/operationHelpers.js";
|
|
20
|
-
import { PathMetadata, Paths, RLCModel } from "./interfaces.js";
|
|
21
24
|
import { generateMethodShortcuts } from "./helpers/shortcutMethods.js";
|
|
22
|
-
import {
|
|
23
|
-
import {
|
|
24
|
-
CasingConvention,
|
|
25
|
-
NameType,
|
|
26
|
-
normalizeName
|
|
27
|
-
} from "./helpers/nameUtils.js";
|
|
28
|
-
import { pascalCase } from "./helpers/nameUtils.js";
|
|
29
|
-
import {
|
|
30
|
-
getClientName,
|
|
31
|
-
getImportModuleName
|
|
32
|
-
} from "./helpers/nameConstructors.js";
|
|
33
|
-
import { getImportSpecifier } from "./helpers/importsUtil.js";
|
|
25
|
+
import { PathMetadata, Paths, RLCModel } from "./interfaces.js";
|
|
34
26
|
|
|
35
27
|
export function buildClientDefinitions(model: RLCModel) {
|
|
36
28
|
const options = {
|
|
37
29
|
importedParameters: new Set<string>(),
|
|
38
30
|
importedResponses: new Set<string>(),
|
|
39
|
-
clientImports: new Set<string>()
|
|
31
|
+
clientImports: new Set<string>(),
|
|
40
32
|
};
|
|
41
33
|
const project = new Project();
|
|
42
34
|
const srcPath = model.srcPath;
|
|
43
35
|
const filePath = path.join(srcPath, `clientDefinitions.ts`);
|
|
44
36
|
const clientDefinitionsFile = project.createSourceFile(filePath, undefined, {
|
|
45
|
-
overwrite: true
|
|
37
|
+
overwrite: true,
|
|
46
38
|
});
|
|
47
39
|
|
|
48
40
|
// Get all paths
|
|
@@ -66,8 +58,8 @@ export function buildClientDefinitions(model: RLCModel) {
|
|
|
66
58
|
callSignatures: getPathFirstRoutesInterfaceDefinition(
|
|
67
59
|
pathDictionary,
|
|
68
60
|
clientDefinitionsFile,
|
|
69
|
-
options
|
|
70
|
-
)
|
|
61
|
+
options,
|
|
62
|
+
),
|
|
71
63
|
});
|
|
72
64
|
|
|
73
65
|
const clientInterfaceName = getClientName(model);
|
|
@@ -77,19 +69,14 @@ export function buildClientDefinitions(model: RLCModel) {
|
|
|
77
69
|
type: Writers.intersectionType(
|
|
78
70
|
"Client",
|
|
79
71
|
Writers.objectType({
|
|
80
|
-
properties: [
|
|
81
|
-
{ name: "path", type: "Routes" },
|
|
82
|
-
...shortcutsInOperationGroup
|
|
83
|
-
]
|
|
72
|
+
properties: [{ name: "path", type: "Routes" }, ...shortcutsInOperationGroup],
|
|
84
73
|
}),
|
|
85
74
|
// If the length of shortcuts in operation group and all shortcutsInOperationGroup
|
|
86
75
|
// is the same, then we don't have any operations at the client level
|
|
87
76
|
// Otherwise we need to make the client interface name an union with the
|
|
88
77
|
// definition of all client level shortcut methods
|
|
89
|
-
...(shortcutsInOperationGroup.length !== shortcuts.length
|
|
90
|
-
|
|
91
|
-
: [])
|
|
92
|
-
)
|
|
78
|
+
...(shortcutsInOperationGroup.length !== shortcuts.length ? [`ClientOperations`] : []),
|
|
79
|
+
),
|
|
93
80
|
});
|
|
94
81
|
|
|
95
82
|
if (options.importedParameters.size) {
|
|
@@ -98,8 +85,8 @@ export function buildClientDefinitions(model: RLCModel) {
|
|
|
98
85
|
namedImports: [...options.importedParameters],
|
|
99
86
|
moduleSpecifier: getImportModuleName(
|
|
100
87
|
{ cjsName: "./parameters", esModulesName: "./parameters.js" },
|
|
101
|
-
model
|
|
102
|
-
)
|
|
88
|
+
model,
|
|
89
|
+
),
|
|
103
90
|
});
|
|
104
91
|
}
|
|
105
92
|
|
|
@@ -109,24 +96,19 @@ export function buildClientDefinitions(model: RLCModel) {
|
|
|
109
96
|
namedImports: [...options.importedResponses],
|
|
110
97
|
moduleSpecifier: getImportModuleName(
|
|
111
98
|
{ cjsName: "./responses", esModulesName: "./responses.js" },
|
|
112
|
-
model
|
|
113
|
-
)
|
|
99
|
+
model,
|
|
100
|
+
),
|
|
114
101
|
});
|
|
115
102
|
}
|
|
116
103
|
|
|
117
|
-
if (
|
|
118
|
-
(model.importInfo.internalImports.rlcClientDefinition.importsSet?.size ??
|
|
119
|
-
0) > 0
|
|
120
|
-
) {
|
|
104
|
+
if ((model.importInfo.internalImports.rlcClientDefinition.importsSet?.size ?? 0) > 0) {
|
|
121
105
|
clientDefinitionsFile.addImportDeclaration({
|
|
122
106
|
isTypeOnly: true,
|
|
123
|
-
namedImports: Array.from(
|
|
124
|
-
model.importInfo.internalImports.rlcClientDefinition.importsSet!
|
|
125
|
-
),
|
|
107
|
+
namedImports: Array.from(model.importInfo.internalImports.rlcClientDefinition.importsSet!),
|
|
126
108
|
moduleSpecifier: getImportModuleName(
|
|
127
109
|
{ cjsName: "./models", esModulesName: "./models.js" },
|
|
128
|
-
model
|
|
129
|
-
)
|
|
110
|
+
model,
|
|
111
|
+
),
|
|
130
112
|
});
|
|
131
113
|
}
|
|
132
114
|
|
|
@@ -136,11 +118,8 @@ export function buildClientDefinitions(model: RLCModel) {
|
|
|
136
118
|
{
|
|
137
119
|
isTypeOnly: true,
|
|
138
120
|
namedImports: [...options.clientImports],
|
|
139
|
-
moduleSpecifier: getImportSpecifier(
|
|
140
|
-
|
|
141
|
-
model.importInfo.runtimeImports
|
|
142
|
-
)
|
|
143
|
-
}
|
|
121
|
+
moduleSpecifier: getImportSpecifier("restClient", model.importInfo.runtimeImports),
|
|
122
|
+
},
|
|
144
123
|
]);
|
|
145
124
|
|
|
146
125
|
return { path: filePath, content: clientDefinitionsFile.getFullText() };
|
|
@@ -153,7 +132,7 @@ function getPathFirstRoutesInterfaceDefinition(
|
|
|
153
132
|
importedParameters: Set<string>;
|
|
154
133
|
importedResponses: Set<string>;
|
|
155
134
|
clientImports: Set<string>;
|
|
156
|
-
}
|
|
135
|
+
},
|
|
157
136
|
): CallSignatureDeclarationStructure[] {
|
|
158
137
|
const operationGroupCount = getOperationGroupCount(paths);
|
|
159
138
|
|
|
@@ -170,40 +149,26 @@ function getPathFirstRoutesInterfaceDefinition(
|
|
|
170
149
|
}
|
|
171
150
|
for (const method of methods) {
|
|
172
151
|
options.importedParameters.add(method.optionsName);
|
|
173
|
-
method.returnType
|
|
174
|
-
.split(" | ")
|
|
175
|
-
.forEach((item) => options.importedResponses.add(item));
|
|
152
|
+
method.returnType.split(" | ").forEach((item) => options.importedResponses.add(item));
|
|
176
153
|
}
|
|
177
154
|
}
|
|
178
|
-
generatePathFirstRouteMethodsDefinition(
|
|
179
|
-
pathMetadata,
|
|
180
|
-
operationGroupCount,
|
|
181
|
-
sourcefile
|
|
182
|
-
);
|
|
155
|
+
generatePathFirstRouteMethodsDefinition(pathMetadata, operationGroupCount, sourcefile);
|
|
183
156
|
const pathParams = pathMetadata.pathParameters;
|
|
184
157
|
getGeneratedWrapperTypes(pathParams).forEach((p) =>
|
|
185
|
-
options.importedParameters.add(p.name ?? p.type)
|
|
158
|
+
options.importedParameters.add(p.name ?? p.type),
|
|
186
159
|
);
|
|
187
160
|
signatures.push({
|
|
188
161
|
docs: [
|
|
189
162
|
`Resource for '${key
|
|
163
|
+
.replace(/\\/g, "\\\\")
|
|
190
164
|
.replace(/}/g, "\\}")
|
|
191
|
-
.replace(
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
)}' has methods for the following verbs: ${Object.keys(
|
|
195
|
-
pathMetadata.methods
|
|
196
|
-
).join(", ")}`
|
|
197
|
-
],
|
|
198
|
-
parameters: [
|
|
199
|
-
{ name: "path", type: `"${key}"` },
|
|
200
|
-
...getPathParamDefinitions(pathParams)
|
|
165
|
+
.replace(/{/g, "\\{")}' has methods for the following verbs: ${Object.keys(
|
|
166
|
+
pathMetadata.methods,
|
|
167
|
+
).join(", ")}`,
|
|
201
168
|
],
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
),
|
|
206
|
-
kind: StructureKind.CallSignature
|
|
169
|
+
parameters: [{ name: "path", type: `"${key}"` }, ...getPathParamDefinitions(pathParams)],
|
|
170
|
+
returnType: getOperationReturnTypeName(pathMetadata, getOperationGroupCount(paths)),
|
|
171
|
+
kind: StructureKind.CallSignature,
|
|
207
172
|
});
|
|
208
173
|
}
|
|
209
174
|
return signatures;
|
|
@@ -220,16 +185,12 @@ function getOperationGroupCount(paths: Paths) {
|
|
|
220
185
|
|
|
221
186
|
function getOperationReturnTypeName(
|
|
222
187
|
{ operationGroupName, name }: PathMetadata,
|
|
223
|
-
operationGroupCount: number
|
|
188
|
+
operationGroupCount: number,
|
|
224
189
|
) {
|
|
225
|
-
if (
|
|
226
|
-
operationGroupCount > 1 &&
|
|
227
|
-
operationGroupName &&
|
|
228
|
-
operationGroupName !== "Client"
|
|
229
|
-
) {
|
|
190
|
+
if (operationGroupCount > 1 && operationGroupName && operationGroupName !== "Client") {
|
|
230
191
|
return normalizeName(
|
|
231
192
|
`${pascalCase(operationGroupName)}${pascalCase(name)}`,
|
|
232
|
-
NameType.Interface
|
|
193
|
+
NameType.Interface,
|
|
233
194
|
);
|
|
234
195
|
}
|
|
235
196
|
|
|
@@ -239,13 +200,13 @@ function getOperationReturnTypeName(
|
|
|
239
200
|
function generatePathFirstRouteMethodsDefinition(
|
|
240
201
|
path: PathMetadata,
|
|
241
202
|
operationGroupCount: number,
|
|
242
|
-
file: SourceFile
|
|
203
|
+
file: SourceFile,
|
|
243
204
|
): void {
|
|
244
205
|
const methodDefinitions = buildMethodDefinitions(path.methods);
|
|
245
206
|
const interfaceDef = {
|
|
246
207
|
methods: methodDefinitions,
|
|
247
208
|
name: getOperationReturnTypeName(path, operationGroupCount),
|
|
248
|
-
isExported: true
|
|
209
|
+
isExported: true,
|
|
249
210
|
};
|
|
250
211
|
file.addInterface(interfaceDef);
|
|
251
212
|
}
|
|
@@ -259,20 +220,16 @@ function getShortcutName(interfaceName: string) {
|
|
|
259
220
|
NameType.OperationGroup,
|
|
260
221
|
true,
|
|
261
222
|
REST_CLIENT_RESERVED,
|
|
262
|
-
CasingConvention.Camel
|
|
223
|
+
CasingConvention.Camel,
|
|
263
224
|
);
|
|
264
225
|
|
|
265
226
|
return {
|
|
266
227
|
name: clientProperty,
|
|
267
|
-
type: interfaceName
|
|
228
|
+
type: interfaceName,
|
|
268
229
|
};
|
|
269
230
|
}
|
|
270
231
|
|
|
271
232
|
function shouldKeepSuffix(name: string) {
|
|
272
|
-
const reservedNames = [
|
|
273
|
-
"pipelineOperations",
|
|
274
|
-
"pathOperations",
|
|
275
|
-
"pathUncheckedOperations"
|
|
276
|
-
];
|
|
233
|
+
const reservedNames = ["pipelineOperations", "pathOperations", "pathUncheckedOperations"];
|
|
277
234
|
return reservedNames.some((r) => r.toLowerCase() === name.toLowerCase());
|
|
278
235
|
}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
+
import * as path from "path";
|
|
4
5
|
import { Project, SourceFile } from "ts-morph";
|
|
6
|
+
import { getImportModuleName } from "./helpers/nameConstructors.js";
|
|
5
7
|
import { NameType, normalizeName } from "./helpers/nameUtils.js";
|
|
6
8
|
import {
|
|
7
9
|
hasCsvCollection,
|
|
@@ -13,12 +15,10 @@ import {
|
|
|
13
15
|
hasPollingOperations,
|
|
14
16
|
hasSsvCollection,
|
|
15
17
|
hasTsvCollection,
|
|
16
|
-
hasUnexpectedHelper
|
|
18
|
+
hasUnexpectedHelper,
|
|
17
19
|
} from "./helpers/operationHelpers.js";
|
|
18
20
|
import { isAzurePackage } from "./helpers/packageUtil.js";
|
|
19
21
|
import { RLCModel } from "./interfaces.js";
|
|
20
|
-
import * as path from "path";
|
|
21
|
-
import { getImportModuleName } from "./helpers/nameConstructors.js";
|
|
22
22
|
|
|
23
23
|
export function buildIndexFile(model: RLCModel) {
|
|
24
24
|
const multiClient = Boolean(model.options?.multiClient),
|
|
@@ -27,7 +27,7 @@ export function buildIndexFile(model: RLCModel) {
|
|
|
27
27
|
const { srcPath } = model;
|
|
28
28
|
const filePath = path.join(srcPath, `index.ts`);
|
|
29
29
|
const indexFile = project.createSourceFile(filePath, undefined, {
|
|
30
|
-
overwrite: true
|
|
30
|
+
overwrite: true,
|
|
31
31
|
});
|
|
32
32
|
|
|
33
33
|
if (!multiClient || !batch || batch?.length === 1) {
|
|
@@ -38,7 +38,7 @@ export function buildIndexFile(model: RLCModel) {
|
|
|
38
38
|
}
|
|
39
39
|
return {
|
|
40
40
|
path: filePath,
|
|
41
|
-
content: indexFile.getFullText()
|
|
41
|
+
content: indexFile.getFullText(),
|
|
42
42
|
};
|
|
43
43
|
}
|
|
44
44
|
|
|
@@ -52,16 +52,16 @@ function generateRLCIndexForMultiClient(file: SourceFile, model: RLCModel) {
|
|
|
52
52
|
namespaceImport: "Parameters",
|
|
53
53
|
moduleSpecifier: getImportModuleName(
|
|
54
54
|
{ cjsName: "./parameters", esModulesName: "./parameters.js" },
|
|
55
|
-
model
|
|
56
|
-
)
|
|
55
|
+
model,
|
|
56
|
+
),
|
|
57
57
|
});
|
|
58
58
|
|
|
59
59
|
file.addImportDeclaration({
|
|
60
60
|
namespaceImport: "Responses",
|
|
61
61
|
moduleSpecifier: getImportModuleName(
|
|
62
62
|
{ cjsName: "./responses", esModulesName: "./responses.js" },
|
|
63
|
-
model
|
|
64
|
-
)
|
|
63
|
+
model,
|
|
64
|
+
),
|
|
65
65
|
});
|
|
66
66
|
|
|
67
67
|
file.addImportDeclaration({
|
|
@@ -69,10 +69,10 @@ function generateRLCIndexForMultiClient(file: SourceFile, model: RLCModel) {
|
|
|
69
69
|
moduleSpecifier: getImportModuleName(
|
|
70
70
|
{
|
|
71
71
|
cjsName: "./clientDefinitions",
|
|
72
|
-
esModulesName: "./clientDefinitions.js"
|
|
72
|
+
esModulesName: "./clientDefinitions.js",
|
|
73
73
|
},
|
|
74
|
-
model
|
|
75
|
-
)
|
|
74
|
+
model,
|
|
75
|
+
),
|
|
76
76
|
});
|
|
77
77
|
|
|
78
78
|
const exports = ["Parameters", "Responses", "Client"];
|
|
@@ -82,10 +82,10 @@ function generateRLCIndexForMultiClient(file: SourceFile, model: RLCModel) {
|
|
|
82
82
|
moduleSpecifier: getImportModuleName(
|
|
83
83
|
{
|
|
84
84
|
cjsName: "./models",
|
|
85
|
-
esModulesName: "./models.js"
|
|
85
|
+
esModulesName: "./models.js",
|
|
86
86
|
},
|
|
87
|
-
model
|
|
88
|
-
)
|
|
87
|
+
model,
|
|
88
|
+
),
|
|
89
89
|
});
|
|
90
90
|
exports.push("Models");
|
|
91
91
|
}
|
|
@@ -96,10 +96,10 @@ function generateRLCIndexForMultiClient(file: SourceFile, model: RLCModel) {
|
|
|
96
96
|
moduleSpecifier: getImportModuleName(
|
|
97
97
|
{
|
|
98
98
|
cjsName: "./outputModels",
|
|
99
|
-
esModulesName: "./outputModels.js"
|
|
99
|
+
esModulesName: "./outputModels.js",
|
|
100
100
|
},
|
|
101
|
-
model
|
|
102
|
-
)
|
|
101
|
+
model,
|
|
102
|
+
),
|
|
103
103
|
});
|
|
104
104
|
exports.push("OutputModels");
|
|
105
105
|
}
|
|
@@ -110,10 +110,10 @@ function generateRLCIndexForMultiClient(file: SourceFile, model: RLCModel) {
|
|
|
110
110
|
moduleSpecifier: getImportModuleName(
|
|
111
111
|
{
|
|
112
112
|
cjsName: "./paginateHelper",
|
|
113
|
-
esModulesName: "./paginateHelper.js"
|
|
113
|
+
esModulesName: "./paginateHelper.js",
|
|
114
114
|
},
|
|
115
|
-
model
|
|
116
|
-
)
|
|
115
|
+
model,
|
|
116
|
+
),
|
|
117
117
|
});
|
|
118
118
|
exports.push("PaginateHelper");
|
|
119
119
|
}
|
|
@@ -124,10 +124,10 @@ function generateRLCIndexForMultiClient(file: SourceFile, model: RLCModel) {
|
|
|
124
124
|
moduleSpecifier: getImportModuleName(
|
|
125
125
|
{
|
|
126
126
|
cjsName: "./isUnexpected",
|
|
127
|
-
esModulesName: "./isUnexpected.js"
|
|
127
|
+
esModulesName: "./isUnexpected.js",
|
|
128
128
|
},
|
|
129
|
-
model
|
|
130
|
-
)
|
|
129
|
+
model,
|
|
130
|
+
),
|
|
131
131
|
});
|
|
132
132
|
exports.push("UnexpectedHelper");
|
|
133
133
|
}
|
|
@@ -138,10 +138,10 @@ function generateRLCIndexForMultiClient(file: SourceFile, model: RLCModel) {
|
|
|
138
138
|
moduleSpecifier: getImportModuleName(
|
|
139
139
|
{
|
|
140
140
|
cjsName: "./pollingHelper",
|
|
141
|
-
esModulesName: "./pollingHelper.js"
|
|
141
|
+
esModulesName: "./pollingHelper.js",
|
|
142
142
|
},
|
|
143
|
-
model
|
|
144
|
-
)
|
|
143
|
+
model,
|
|
144
|
+
),
|
|
145
145
|
});
|
|
146
146
|
exports.push("PollingHelper");
|
|
147
147
|
}
|
|
@@ -158,10 +158,10 @@ function generateRLCIndexForMultiClient(file: SourceFile, model: RLCModel) {
|
|
|
158
158
|
moduleSpecifier: getImportModuleName(
|
|
159
159
|
{
|
|
160
160
|
cjsName: "./serializeHelper",
|
|
161
|
-
esModulesName: "./serializeHelper.js"
|
|
161
|
+
esModulesName: "./serializeHelper.js",
|
|
162
162
|
},
|
|
163
|
-
model
|
|
164
|
-
)
|
|
163
|
+
model,
|
|
164
|
+
),
|
|
165
165
|
});
|
|
166
166
|
exports.push("SerializeHelper");
|
|
167
167
|
}
|
|
@@ -171,15 +171,15 @@ function generateRLCIndexForMultiClient(file: SourceFile, model: RLCModel) {
|
|
|
171
171
|
moduleSpecifier: getImportModuleName(
|
|
172
172
|
{
|
|
173
173
|
cjsName: `./${moduleName}`,
|
|
174
|
-
esModulesName: `./${moduleName}.js
|
|
174
|
+
esModulesName: `./${moduleName}.js`,
|
|
175
175
|
},
|
|
176
|
-
model
|
|
176
|
+
model,
|
|
177
177
|
),
|
|
178
|
-
namedExports: [`${createClientFuncName}`, `${clientName}ClientOptions`]
|
|
178
|
+
namedExports: [`${createClientFuncName}`, `${clientName}ClientOptions`],
|
|
179
179
|
},
|
|
180
180
|
{
|
|
181
|
-
namedExports: [...exports]
|
|
182
|
-
}
|
|
181
|
+
namedExports: [...exports],
|
|
182
|
+
},
|
|
183
183
|
]);
|
|
184
184
|
}
|
|
185
185
|
|
|
@@ -192,11 +192,11 @@ function generateRLCIndex(file: SourceFile, model: RLCModel) {
|
|
|
192
192
|
moduleSpecifier: getImportModuleName(
|
|
193
193
|
{
|
|
194
194
|
cjsName: `./${moduleName}`,
|
|
195
|
-
esModulesName: `./${moduleName}.js
|
|
195
|
+
esModulesName: `./${moduleName}.js`,
|
|
196
196
|
},
|
|
197
|
-
model
|
|
197
|
+
model,
|
|
198
198
|
),
|
|
199
|
-
defaultImport: createClientFuncName
|
|
199
|
+
defaultImport: createClientFuncName,
|
|
200
200
|
});
|
|
201
201
|
|
|
202
202
|
file.addExportDeclarations([
|
|
@@ -204,38 +204,38 @@ function generateRLCIndex(file: SourceFile, model: RLCModel) {
|
|
|
204
204
|
moduleSpecifier: getImportModuleName(
|
|
205
205
|
{
|
|
206
206
|
cjsName: `./${moduleName}`,
|
|
207
|
-
esModulesName: `./${moduleName}.js
|
|
207
|
+
esModulesName: `./${moduleName}.js`,
|
|
208
208
|
},
|
|
209
|
-
model
|
|
210
|
-
)
|
|
209
|
+
model,
|
|
210
|
+
),
|
|
211
211
|
},
|
|
212
212
|
{
|
|
213
213
|
moduleSpecifier: getImportModuleName(
|
|
214
214
|
{
|
|
215
215
|
cjsName: `./parameters`,
|
|
216
|
-
esModulesName: `./parameters.js
|
|
216
|
+
esModulesName: `./parameters.js`,
|
|
217
217
|
},
|
|
218
|
-
model
|
|
219
|
-
)
|
|
218
|
+
model,
|
|
219
|
+
),
|
|
220
220
|
},
|
|
221
221
|
{
|
|
222
222
|
moduleSpecifier: getImportModuleName(
|
|
223
223
|
{
|
|
224
224
|
cjsName: `./responses`,
|
|
225
|
-
esModulesName: `./responses.js
|
|
225
|
+
esModulesName: `./responses.js`,
|
|
226
226
|
},
|
|
227
|
-
model
|
|
228
|
-
)
|
|
227
|
+
model,
|
|
228
|
+
),
|
|
229
229
|
},
|
|
230
230
|
{
|
|
231
231
|
moduleSpecifier: getImportModuleName(
|
|
232
232
|
{
|
|
233
233
|
cjsName: `./clientDefinitions`,
|
|
234
|
-
esModulesName: `./clientDefinitions.js
|
|
234
|
+
esModulesName: `./clientDefinitions.js`,
|
|
235
235
|
},
|
|
236
|
-
model
|
|
237
|
-
)
|
|
238
|
-
}
|
|
236
|
+
model,
|
|
237
|
+
),
|
|
238
|
+
},
|
|
239
239
|
]);
|
|
240
240
|
|
|
241
241
|
if (hasUnexpectedHelper(model)) {
|
|
@@ -244,11 +244,11 @@ function generateRLCIndex(file: SourceFile, model: RLCModel) {
|
|
|
244
244
|
moduleSpecifier: getImportModuleName(
|
|
245
245
|
{
|
|
246
246
|
cjsName: `./isUnexpected`,
|
|
247
|
-
esModulesName: `./isUnexpected.js
|
|
247
|
+
esModulesName: `./isUnexpected.js`,
|
|
248
248
|
},
|
|
249
|
-
model
|
|
250
|
-
)
|
|
251
|
-
}
|
|
249
|
+
model,
|
|
250
|
+
),
|
|
251
|
+
},
|
|
252
252
|
]);
|
|
253
253
|
}
|
|
254
254
|
|
|
@@ -258,11 +258,11 @@ function generateRLCIndex(file: SourceFile, model: RLCModel) {
|
|
|
258
258
|
moduleSpecifier: getImportModuleName(
|
|
259
259
|
{
|
|
260
260
|
cjsName: `./models`,
|
|
261
|
-
esModulesName: `./models.js
|
|
261
|
+
esModulesName: `./models.js`,
|
|
262
262
|
},
|
|
263
|
-
model
|
|
264
|
-
)
|
|
265
|
-
}
|
|
263
|
+
model,
|
|
264
|
+
),
|
|
265
|
+
},
|
|
266
266
|
]);
|
|
267
267
|
}
|
|
268
268
|
|
|
@@ -272,11 +272,11 @@ function generateRLCIndex(file: SourceFile, model: RLCModel) {
|
|
|
272
272
|
moduleSpecifier: getImportModuleName(
|
|
273
273
|
{
|
|
274
274
|
cjsName: `./outputModels`,
|
|
275
|
-
esModulesName: `./outputModels.js
|
|
275
|
+
esModulesName: `./outputModels.js`,
|
|
276
276
|
},
|
|
277
|
-
model
|
|
278
|
-
)
|
|
279
|
-
}
|
|
277
|
+
model,
|
|
278
|
+
),
|
|
279
|
+
},
|
|
280
280
|
]);
|
|
281
281
|
}
|
|
282
282
|
|
|
@@ -286,11 +286,11 @@ function generateRLCIndex(file: SourceFile, model: RLCModel) {
|
|
|
286
286
|
moduleSpecifier: getImportModuleName(
|
|
287
287
|
{
|
|
288
288
|
cjsName: `./paginateHelper`,
|
|
289
|
-
esModulesName: `./paginateHelper.js
|
|
289
|
+
esModulesName: `./paginateHelper.js`,
|
|
290
290
|
},
|
|
291
|
-
model
|
|
292
|
-
)
|
|
293
|
-
}
|
|
291
|
+
model,
|
|
292
|
+
),
|
|
293
|
+
},
|
|
294
294
|
]);
|
|
295
295
|
}
|
|
296
296
|
|
|
@@ -300,11 +300,11 @@ function generateRLCIndex(file: SourceFile, model: RLCModel) {
|
|
|
300
300
|
moduleSpecifier: getImportModuleName(
|
|
301
301
|
{
|
|
302
302
|
cjsName: `./pollingHelper`,
|
|
303
|
-
esModulesName: `./pollingHelper.js
|
|
303
|
+
esModulesName: `./pollingHelper.js`,
|
|
304
304
|
},
|
|
305
|
-
model
|
|
306
|
-
)
|
|
307
|
-
}
|
|
305
|
+
model,
|
|
306
|
+
),
|
|
307
|
+
},
|
|
308
308
|
]);
|
|
309
309
|
}
|
|
310
310
|
|
|
@@ -320,11 +320,11 @@ function generateRLCIndex(file: SourceFile, model: RLCModel) {
|
|
|
320
320
|
moduleSpecifier: getImportModuleName(
|
|
321
321
|
{
|
|
322
322
|
cjsName: `./serializeHelper`,
|
|
323
|
-
esModulesName: `./serializeHelper.js
|
|
323
|
+
esModulesName: `./serializeHelper.js`,
|
|
324
324
|
},
|
|
325
|
-
model
|
|
326
|
-
)
|
|
327
|
-
}
|
|
325
|
+
model,
|
|
326
|
+
),
|
|
327
|
+
},
|
|
328
328
|
]);
|
|
329
329
|
}
|
|
330
330
|
|
|
@@ -332,13 +332,13 @@ function generateRLCIndex(file: SourceFile, model: RLCModel) {
|
|
|
332
332
|
file.addExportDeclarations([
|
|
333
333
|
{
|
|
334
334
|
moduleSpecifier: "@azure/core-rest-pipeline",
|
|
335
|
-
namedExports: ["RestError", "isRestError"]
|
|
336
|
-
}
|
|
335
|
+
namedExports: ["RestError", "isRestError"],
|
|
336
|
+
},
|
|
337
337
|
]);
|
|
338
338
|
}
|
|
339
339
|
|
|
340
340
|
file.addExportAssignment({
|
|
341
341
|
expression: createClientFuncName,
|
|
342
|
-
isExportEquals: false
|
|
342
|
+
isExportEquals: false,
|
|
343
343
|
});
|
|
344
344
|
}
|