@azure-tools/typespec-ts 0.54.0-dev.5 → 0.54.0-dev.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/src/contextManager.d.ts +5 -5
- package/dist/src/contextManager.d.ts.map +1 -1
- package/dist/src/contextManager.js.map +1 -1
- package/dist/src/framework/declaration.d.ts +1 -1
- package/dist/src/framework/declaration.d.ts.map +1 -1
- package/dist/src/framework/declaration.js +2 -4
- package/dist/src/framework/declaration.js.map +1 -1
- package/dist/src/framework/dependency.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.d.ts +1 -1
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +12 -20
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.js +8 -11
- package/dist/src/framework/hooks/sdkTypes.js.map +1 -1
- package/dist/src/framework/hooks/useDependencies.d.ts.map +1 -1
- package/dist/src/framework/hooks/useDependencies.js +1 -1
- package/dist/src/framework/hooks/useDependencies.js.map +1 -1
- package/dist/src/framework/load-static-helpers.d.ts +1 -1
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +12 -25
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/framework/reference.d.ts.map +1 -1
- package/dist/src/framework/reference.js +1 -1
- package/dist/src/framework/reference.js.map +1 -1
- package/dist/src/framework/sample.js +8 -8
- package/dist/src/framework/sample.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +47 -48
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +1 -1
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +140 -140
- package/dist/src/lib.js.map +1 -1
- package/dist/src/metaTree.d.ts +1 -1
- package/dist/src/metaTree.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.js +49 -62
- package/dist/src/modular/buildClassicalClient.js.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.d.ts +2 -2
- package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js +4 -7
- package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
- package/dist/src/modular/buildClientContext.d.ts +2 -2
- package/dist/src/modular/buildClientContext.d.ts.map +1 -1
- package/dist/src/modular/buildClientContext.js +30 -36
- package/dist/src/modular/buildClientContext.js.map +1 -1
- package/dist/src/modular/buildModularOptions.d.ts +1 -1
- package/dist/src/modular/buildModularOptions.d.ts.map +1 -1
- package/dist/src/modular/buildModularOptions.js +2 -2
- package/dist/src/modular/buildModularOptions.js.map +1 -1
- package/dist/src/modular/buildOperations.d.ts +3 -3
- package/dist/src/modular/buildOperations.d.ts.map +1 -1
- package/dist/src/modular/buildOperations.js +22 -23
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts.map +1 -1
- package/dist/src/modular/buildProjectFiles.js +7 -9
- package/dist/src/modular/buildProjectFiles.js.map +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts.map +1 -1
- package/dist/src/modular/buildRestorePoller.js +11 -11
- package/dist/src/modular/buildRestorePoller.js.map +1 -1
- package/dist/src/modular/buildRootIndex.d.ts +2 -2
- package/dist/src/modular/buildRootIndex.d.ts.map +1 -1
- package/dist/src/modular/buildRootIndex.js +30 -39
- package/dist/src/modular/buildRootIndex.js.map +1 -1
- package/dist/src/modular/buildSubpathIndex.d.ts.map +1 -1
- package/dist/src/modular/buildSubpathIndex.js +9 -17
- package/dist/src/modular/buildSubpathIndex.js.map +1 -1
- package/dist/src/modular/emitLoggerFile.d.ts.map +1 -1
- package/dist/src/modular/emitLoggerFile.js +2 -2
- package/dist/src/modular/emitLoggerFile.js.map +1 -1
- package/dist/src/modular/emitModels.d.ts +1 -1
- package/dist/src/modular/emitModels.d.ts.map +1 -1
- package/dist/src/modular/emitModels.js +54 -72
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts.map +1 -1
- package/dist/src/modular/emitModelsOptions.js +6 -7
- package/dist/src/modular/emitModelsOptions.js.map +1 -1
- package/dist/src/modular/emitSamples.d.ts.map +1 -1
- package/dist/src/modular/emitSamples.js +40 -52
- package/dist/src/modular/emitSamples.js.map +1 -1
- package/dist/src/modular/emitTests.d.ts.map +1 -1
- package/dist/src/modular/emitTests.js +9 -12
- package/dist/src/modular/emitTests.js.map +1 -1
- package/dist/src/modular/external-dependencies.js +54 -54
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js +27 -36
- package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.js +20 -38
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.js +39 -58
- package/dist/src/modular/helpers/exampleValueHelpers.js.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.js +4 -5
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +136 -196
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.js +1 -1
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.js +50 -56
- package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js +52 -59
- package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js +43 -51
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.d.ts.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.js +4 -11
- package/dist/src/modular/serialization/serializeUtils.js.map +1 -1
- package/dist/src/modular/static-helpers-metadata.js +60 -60
- package/dist/src/modular/type-expressions/get-credential-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-credential-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.js +7 -9
- package/dist/src/modular/type-expressions/get-model-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.js +4 -8
- package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
- package/dist/src/rlc-common/buildClient.d.ts +1 -1
- package/dist/src/rlc-common/buildClient.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClient.js +48 -66
- package/dist/src/rlc-common/buildClient.js.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.js +24 -42
- package/dist/src/rlc-common/buildClientDefinitions.js.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.js +57 -57
- package/dist/src/rlc-common/buildIndexFile.js.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js +32 -35
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +1 -1
- package/dist/src/rlc-common/buildLogger.d.ts.map +1 -1
- package/dist/src/rlc-common/buildLogger.js +3 -3
- package/dist/src/rlc-common/buildLogger.js.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.js +3 -3
- package/dist/src/rlc-common/buildMethodShortcuts.js.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.js +29 -46
- 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 +42 -50
- package/dist/src/rlc-common/buildParameterTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.js +5 -5
- package/dist/src/rlc-common/buildPollingHelper.js.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.js +19 -22
- package/dist/src/rlc-common/buildResponseTypes.js.map +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSamples.js +2 -2
- package/dist/src/rlc-common/buildSchemaType.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSchemaType.js +9 -13
- package/dist/src/rlc-common/buildSchemaType.js.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.js +4 -4
- package/dist/src/rlc-common/buildSerializeHelper.js.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.js +9 -13
- package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.js +2 -3
- package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.js +23 -25
- package/dist/src/rlc-common/helpers/importsUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.js +8 -13
- package/dist/src/rlc-common/helpers/nameUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.js +8 -12
- package/dist/src/rlc-common/helpers/operationHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.js +1 -3
- package/dist/src/rlc-common/helpers/pathUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.js +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.js +2 -2
- package/dist/src/rlc-common/helpers/shortcutMethods.js.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.js +1 -2
- package/dist/src/rlc-common/helpers/typeUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js +3 -4
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +1 -1
- package/dist/src/rlc-common/index.d.ts +28 -28
- package/dist/src/rlc-common/index.d.ts.map +1 -1
- package/dist/src/rlc-common/index.js +28 -28
- package/dist/src/rlc-common/index.js.map +1 -1
- package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
- package/dist/src/rlc-common/interfaces.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +13 -13
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildChangelogFile.js +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.js +3 -5
- package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildLicenseFile.js +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.js +16 -16
- package/dist/src/rlc-common/metadata/buildPackageFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.js +10 -18
- package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.js +3 -4
- package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +2 -3
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTestConfig.js +8 -8
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.js +23 -21
- package/dist/src/rlc-common/metadata/buildTsConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.js +3 -4
- package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.js +2 -2
- package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +13 -13
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +22 -26
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +15 -16
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +8 -8
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +26 -29
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +1 -1
- package/dist/src/rlc-common/test/buildKarmaConfig.js +1 -1
- package/dist/src/rlc-common/test/buildRecordedClient.js +3 -3
- package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.js +2 -2
- package/dist/src/rlc-common/test/buildSampleTest.js.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.js +4 -6
- package/dist/src/rlc-common/test/buildSnippets.js.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.d.ts.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.js +19 -23
- package/dist/src/rlc-common/transformSampleGroups.js.map +1 -1
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +1 -1
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/transform/transform.d.ts +1 -1
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/transform/transform.js +10 -11
- package/dist/src/transform/transform.js.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.js +8 -10
- package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.js +9 -11
- package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -1
- package/dist/src/transform/transformParameters.d.ts +2 -2
- package/dist/src/transform/transformParameters.d.ts.map +1 -1
- package/dist/src/transform/transformParameters.js +22 -28
- package/dist/src/transform/transformParameters.js.map +1 -1
- package/dist/src/transform/transformPaths.d.ts +1 -1
- package/dist/src/transform/transformPaths.d.ts.map +1 -1
- package/dist/src/transform/transformPaths.js +11 -12
- package/dist/src/transform/transformPaths.js.map +1 -1
- package/dist/src/transform/transformResponses.d.ts +1 -1
- package/dist/src/transform/transformResponses.d.ts.map +1 -1
- package/dist/src/transform/transformResponses.js +12 -12
- package/dist/src/transform/transformResponses.js.map +1 -1
- package/dist/src/transform/transformSchemas.d.ts.map +1 -1
- package/dist/src/transform/transformSchemas.js +9 -15
- package/dist/src/transform/transformSchemas.js.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.js +3 -3
- package/dist/src/transform/transformTelemetryInfo.js.map +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
- package/dist/src/transform/transfromRLCOptions.js +14 -26
- package/dist/src/transform/transfromRLCOptions.js.map +1 -1
- package/dist/src/utils/clientUtils.d.ts +1 -1
- package/dist/src/utils/clientUtils.d.ts.map +1 -1
- package/dist/src/utils/clientUtils.js +11 -14
- package/dist/src/utils/clientUtils.js.map +1 -1
- package/dist/src/utils/credentialUtils.d.ts +1 -1
- package/dist/src/utils/credentialUtils.d.ts.map +1 -1
- package/dist/src/utils/credentialUtils.js +3 -3
- package/dist/src/utils/credentialUtils.js.map +1 -1
- package/dist/src/utils/crossLanguageDef.d.ts.map +1 -1
- package/dist/src/utils/crossLanguageDef.js +8 -12
- package/dist/src/utils/crossLanguageDef.js.map +1 -1
- package/dist/src/utils/emitUtil.d.ts +1 -1
- package/dist/src/utils/emitUtil.d.ts.map +1 -1
- package/dist/src/utils/emitUtil.js +4 -6
- package/dist/src/utils/emitUtil.js.map +1 -1
- package/dist/src/utils/fileSystemUtils.d.ts.map +1 -1
- package/dist/src/utils/fileSystemUtils.js +2 -2
- package/dist/src/utils/fileSystemUtils.js.map +1 -1
- package/dist/src/utils/importHelper.d.ts.map +1 -1
- package/dist/src/utils/importHelper.js +2 -4
- package/dist/src/utils/importHelper.js.map +1 -1
- package/dist/src/utils/interfaces.d.ts +1 -1
- package/dist/src/utils/interfaces.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.js +7 -19
- package/dist/src/utils/mediaTypes.js.map +1 -1
- package/dist/src/utils/modelUtils.d.ts +2 -2
- package/dist/src/utils/modelUtils.d.ts.map +1 -1
- package/dist/src/utils/modelUtils.js +107 -170
- package/dist/src/utils/modelUtils.js.map +1 -1
- package/dist/src/utils/namespaceUtils.d.ts.map +1 -1
- package/dist/src/utils/namespaceUtils.js +2 -2
- package/dist/src/utils/namespaceUtils.js.map +1 -1
- package/dist/src/utils/operationUtil.d.ts +1 -1
- package/dist/src/utils/operationUtil.d.ts.map +1 -1
- package/dist/src/utils/operationUtil.js +29 -42
- package/dist/src/utils/operationUtil.js.map +1 -1
- package/dist/src/utils/parameterUtils.d.ts +1 -1
- package/dist/src/utils/parameterUtils.d.ts.map +1 -1
- package/dist/src/utils/parameterUtils.js +19 -22
- package/dist/src/utils/parameterUtils.js.map +1 -1
- package/dist/src/utils/resolve-project-root.js +2 -2
- package/dist/src/utils/resolve-project-root.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -5
- 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 +111 -180
- package/src/lib.ts +143 -158
- package/src/metaTree.ts +1 -1
- package/src/modular/buildClassicalClient.ts +83 -160
- package/src/modular/buildClassicalOperationGroups.ts +14 -39
- package/src/modular/buildClientContext.ts +54 -83
- package/src/modular/buildModularOptions.ts +4 -5
- package/src/modular/buildOperations.ts +46 -73
- package/src/modular/buildProjectFiles.ts +18 -47
- package/src/modular/buildRestorePoller.ts +27 -46
- package/src/modular/buildRootIndex.ts +86 -159
- package/src/modular/buildSubpathIndex.ts +35 -58
- package/src/modular/emitLoggerFile.ts +4 -9
- package/src/modular/emitModels.ts +136 -266
- package/src/modular/emitModelsOptions.ts +10 -16
- package/src/modular/emitSamples.ts +91 -177
- package/src/modular/emitTests.ts +28 -61
- package/src/modular/external-dependencies.ts +54 -54
- package/src/modular/helpers/classicalOperationHelpers.ts +73 -126
- package/src/modular/helpers/clientHelpers.ts +41 -88
- package/src/modular/helpers/clientOptionHelpers.ts +4 -11
- package/src/modular/helpers/exampleValueHelpers.ts +97 -209
- package/src/modular/helpers/namingHelpers.ts +12 -28
- package/src/modular/helpers/operationHelpers.ts +430 -757
- package/src/modular/helpers/typeHelpers.ts +11 -22
- package/src/modular/serialization/buildDeserializerFunction.ts +88 -122
- package/src/modular/serialization/buildSerializerFunction.ts +91 -129
- package/src/modular/serialization/buildXmlSerializerFunction.ts +104 -183
- package/src/modular/serialization/serializeUtils.ts +12 -21
- package/src/modular/static/rollup.test.config.js +11 -14
- package/src/modular/static/scripts/renameOutput.mjs +2 -2
- package/src/modular/static-helpers-metadata.ts +60 -60
- package/src/modular/type-expressions/get-credential-expression.ts +1 -1
- package/src/modular/type-expressions/get-enum-expression.ts +5 -10
- package/src/modular/type-expressions/get-model-expression.ts +13 -17
- package/src/modular/type-expressions/get-nullable-expression.ts +4 -5
- package/src/modular/type-expressions/get-type-expression.ts +8 -12
- package/src/modular/type-expressions/get-union-expression.ts +4 -4
- package/src/modular/type-expressions/utils.ts +1 -1
- package/src/rlc-common/buildClient.ts +70 -141
- package/src/rlc-common/buildClientDefinitions.ts +43 -87
- package/src/rlc-common/buildIndexFile.ts +78 -78
- package/src/rlc-common/buildIsUnexpectedHelper.ts +34 -41
- package/src/rlc-common/buildLogger.ts +7 -7
- package/src/rlc-common/buildMethodShortcuts.ts +9 -21
- package/src/rlc-common/buildObjectTypes.ts +78 -155
- package/src/rlc-common/buildPaginateHelper.ts +9 -12
- package/src/rlc-common/buildParameterTypes.ts +92 -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 +12 -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 +4 -6
- package/src/utils/importHelper.ts +5 -10
- package/src/utils/interfaces.ts +1 -1
- package/src/utils/mediaTypes.ts +13 -34
- package/src/utils/modelUtils.ts +174 -383
- package/src/utils/namespaceUtils.ts +8 -24
- package/src/utils/operationUtil.ts +98 -190
- package/src/utils/parameterUtils.ts +31 -54
- package/src/utils/resolve-project-root.ts +3 -3
- package/static/static-helpers/cloudSettingHelpers.ts +4 -6
- package/static/static-helpers/multipartHelpers.ts +3 -3
- package/static/static-helpers/pagingHelpers.ts +28 -63
- package/static/static-helpers/pollingHelpers.ts +15 -28
- package/static/static-helpers/serialization/build-multi-collection.ts +1 -4
- package/static/static-helpers/serialization/check-prop-undefined.ts +1 -4
- package/static/static-helpers/serialization/get-binary-response.ts +2 -2
- package/static/static-helpers/serialization/get-binary-stream-response.ts +2 -4
- package/static/static-helpers/serialization/serialize-record.ts +1 -1
- package/static/static-helpers/serialization/serializers.ts +4 -7
- package/static/static-helpers/serialization/xml-helpers.ts +41 -89
- package/static/static-helpers/simplePollerHelpers.ts +9 -18
- package/static/static-helpers/storageCompatResponse.ts +10 -27
- package/static/static-helpers/urlTemplate.ts +4 -7
- package/static/test-helpers/recordedClient.ts +5 -10
|
@@ -1,25 +1,21 @@
|
|
|
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
|
InterfaceDeclarationStructure,
|
|
6
7
|
OptionalKind,
|
|
7
8
|
Project,
|
|
8
9
|
PropertySignatureStructure,
|
|
9
|
-
StructureKind
|
|
10
|
+
StructureKind,
|
|
10
11
|
} from "ts-morph";
|
|
11
|
-
import {
|
|
12
|
-
ResponseHeaderSchema,
|
|
13
|
-
ResponseMetadata,
|
|
14
|
-
RLCModel
|
|
15
|
-
} from "./interfaces.js";
|
|
16
|
-
import * as path from "path";
|
|
12
|
+
import { getImportSpecifier } from "./helpers/importsUtil.js";
|
|
17
13
|
import {
|
|
18
14
|
getImportModuleName,
|
|
19
15
|
getResponseBaseName,
|
|
20
|
-
getResponseTypeName
|
|
16
|
+
getResponseTypeName,
|
|
21
17
|
} from "./helpers/nameConstructors.js";
|
|
22
|
-
import {
|
|
18
|
+
import { ResponseHeaderSchema, ResponseMetadata, RLCModel } from "./interfaces.js";
|
|
23
19
|
|
|
24
20
|
let hasErrorResponse = false;
|
|
25
21
|
export function buildResponseTypes(model: RLCModel) {
|
|
@@ -28,7 +24,7 @@ export function buildResponseTypes(model: RLCModel) {
|
|
|
28
24
|
const filePath = path.join(srcPath, `responses.ts`);
|
|
29
25
|
hasErrorResponse = false;
|
|
30
26
|
const responsesFile = project.createSourceFile(filePath, undefined, {
|
|
31
|
-
overwrite: true
|
|
27
|
+
overwrite: true,
|
|
32
28
|
});
|
|
33
29
|
// Set used to track down which models need to be imported
|
|
34
30
|
// Track if we need to import RawHttpHeaders
|
|
@@ -42,7 +38,7 @@ export function buildResponseTypes(model: RLCModel) {
|
|
|
42
38
|
const baseResponseName = getResponseBaseName(
|
|
43
39
|
operationResponse.operationGroup,
|
|
44
40
|
operationResponse.operationName,
|
|
45
|
-
response.statusCode
|
|
41
|
+
response.statusCode,
|
|
46
42
|
);
|
|
47
43
|
|
|
48
44
|
// Build the response header
|
|
@@ -54,27 +50,20 @@ export function buildResponseTypes(model: RLCModel) {
|
|
|
54
50
|
}
|
|
55
51
|
|
|
56
52
|
// Get the information to build the Response Interface
|
|
57
|
-
const responseTypeName =
|
|
58
|
-
|
|
59
|
-
const responseProperties = getResponseInterfaceProperties(
|
|
60
|
-
response,
|
|
61
|
-
headersInterface?.name
|
|
62
|
-
);
|
|
53
|
+
const responseTypeName = response.predefinedName ?? getResponseTypeName(baseResponseName);
|
|
54
|
+
const responseProperties = getResponseInterfaceProperties(response, headersInterface?.name);
|
|
63
55
|
|
|
64
|
-
const responseInterfaceDefinition: OptionalKind<InterfaceDeclarationStructure> =
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
};
|
|
56
|
+
const responseInterfaceDefinition: OptionalKind<InterfaceDeclarationStructure> = {
|
|
57
|
+
name: responseTypeName,
|
|
58
|
+
properties: responseProperties,
|
|
59
|
+
isExported: true,
|
|
60
|
+
extends: ["HttpResponse"],
|
|
61
|
+
};
|
|
71
62
|
|
|
72
63
|
// Only add a description if one was provided in the Swagger
|
|
73
64
|
// otherwise skip to avoid having empty TSDoc lines
|
|
74
65
|
if (response.description) {
|
|
75
|
-
responseInterfaceDefinition.docs = [
|
|
76
|
-
{ description: response.description }
|
|
77
|
-
];
|
|
66
|
+
responseInterfaceDefinition.docs = [{ description: response.description }];
|
|
78
67
|
}
|
|
79
68
|
|
|
80
69
|
// Add the response interface to the responses file
|
|
@@ -87,11 +76,8 @@ export function buildResponseTypes(model: RLCModel) {
|
|
|
87
76
|
{
|
|
88
77
|
isTypeOnly: true,
|
|
89
78
|
namedImports: ["RawHttpHeaders"],
|
|
90
|
-
moduleSpecifier: getImportSpecifier(
|
|
91
|
-
|
|
92
|
-
model.importInfo.runtimeImports
|
|
93
|
-
)
|
|
94
|
-
}
|
|
79
|
+
moduleSpecifier: getImportSpecifier("restPipeline", model.importInfo.runtimeImports),
|
|
80
|
+
},
|
|
95
81
|
]);
|
|
96
82
|
}
|
|
97
83
|
const namedImports = ["HttpResponse"];
|
|
@@ -102,16 +88,13 @@ export function buildResponseTypes(model: RLCModel) {
|
|
|
102
88
|
{
|
|
103
89
|
isTypeOnly: true,
|
|
104
90
|
namedImports,
|
|
105
|
-
moduleSpecifier: getImportSpecifier(
|
|
106
|
-
|
|
107
|
-
model.importInfo.runtimeImports
|
|
108
|
-
)
|
|
109
|
-
}
|
|
91
|
+
moduleSpecifier: getImportSpecifier("restClient", model.importInfo.runtimeImports),
|
|
92
|
+
},
|
|
110
93
|
]);
|
|
111
94
|
|
|
112
95
|
if ((model.importInfo.internalImports.response?.importsSet?.size ?? 0) > 0) {
|
|
113
96
|
const modelNamedImports = Array.from(
|
|
114
|
-
model.importInfo.internalImports.response!.importsSet
|
|
97
|
+
model.importInfo.internalImports.response!.importsSet!,
|
|
115
98
|
).filter((modelName) => {
|
|
116
99
|
return !(modelName === "ErrorResponseOutput" && hasErrorResponse);
|
|
117
100
|
});
|
|
@@ -122,11 +105,11 @@ export function buildResponseTypes(model: RLCModel) {
|
|
|
122
105
|
moduleSpecifier: getImportModuleName(
|
|
123
106
|
{
|
|
124
107
|
cjsName: `./outputModels`,
|
|
125
|
-
esModulesName: `./outputModels.js
|
|
108
|
+
esModulesName: `./outputModels.js`,
|
|
126
109
|
},
|
|
127
|
-
model
|
|
128
|
-
)
|
|
129
|
-
}
|
|
110
|
+
model,
|
|
111
|
+
),
|
|
112
|
+
},
|
|
130
113
|
]);
|
|
131
114
|
}
|
|
132
115
|
return { path: filePath, content: responsesFile.getFullText() };
|
|
@@ -134,7 +117,7 @@ export function buildResponseTypes(model: RLCModel) {
|
|
|
134
117
|
|
|
135
118
|
function getResponseHeaderInterfaceDefinition(
|
|
136
119
|
response: ResponseMetadata,
|
|
137
|
-
baseName: string
|
|
120
|
+
baseName: string,
|
|
138
121
|
): undefined | InterfaceDeclarationStructure {
|
|
139
122
|
// Check if there are any required headers
|
|
140
123
|
if (!response.headers) {
|
|
@@ -151,35 +134,29 @@ function getResponseHeaderInterfaceDefinition(
|
|
|
151
134
|
name: h.name,
|
|
152
135
|
...(description && { docs: [{ description }] }),
|
|
153
136
|
type: h.type,
|
|
154
|
-
hasQuestionToken: !h.required
|
|
137
|
+
hasQuestionToken: !h.required,
|
|
155
138
|
};
|
|
156
|
-
})
|
|
139
|
+
}),
|
|
157
140
|
};
|
|
158
141
|
}
|
|
159
142
|
|
|
160
143
|
/**
|
|
161
144
|
* Gets the properties that need to be part of the response interface
|
|
162
145
|
*/
|
|
163
|
-
function getResponseInterfaceProperties(
|
|
164
|
-
response: ResponseMetadata,
|
|
165
|
-
headersInterfaceName?: string
|
|
166
|
-
) {
|
|
146
|
+
function getResponseInterfaceProperties(response: ResponseMetadata, headersInterfaceName?: string) {
|
|
167
147
|
const statusCode = response.statusCode;
|
|
168
148
|
const responseProperties: PropertySignatureStructure[] = [
|
|
169
149
|
{
|
|
170
150
|
name: "status",
|
|
171
151
|
type: statusCode === "default" ? `string` : `"${statusCode}"`,
|
|
172
|
-
kind: StructureKind.PropertySignature
|
|
173
|
-
}
|
|
152
|
+
kind: StructureKind.PropertySignature,
|
|
153
|
+
},
|
|
174
154
|
];
|
|
175
155
|
|
|
176
156
|
if (response.body) {
|
|
177
157
|
const description = response.body.description;
|
|
178
158
|
let type = response.body.type;
|
|
179
|
-
if (
|
|
180
|
-
response.body.type === "ErrorResponseOutput" &&
|
|
181
|
-
response.body.fromCore
|
|
182
|
-
) {
|
|
159
|
+
if (response.body.type === "ErrorResponseOutput" && response.body.fromCore) {
|
|
183
160
|
type = "ErrorResponse";
|
|
184
161
|
hasErrorResponse = true;
|
|
185
162
|
}
|
|
@@ -187,7 +164,7 @@ function getResponseInterfaceProperties(
|
|
|
187
164
|
name: "body",
|
|
188
165
|
type,
|
|
189
166
|
kind: StructureKind.PropertySignature,
|
|
190
|
-
...(description && { docs: [{ description }] })
|
|
167
|
+
...(description && { docs: [{ description }] }),
|
|
191
168
|
});
|
|
192
169
|
}
|
|
193
170
|
|
|
@@ -195,7 +172,7 @@ function getResponseInterfaceProperties(
|
|
|
195
172
|
responseProperties.push({
|
|
196
173
|
name: "headers",
|
|
197
174
|
type: `RawHttpHeaders & ${headersInterfaceName}`,
|
|
198
|
-
kind: StructureKind.PropertySignature
|
|
175
|
+
kind: StructureKind.PropertySignature,
|
|
199
176
|
});
|
|
200
177
|
}
|
|
201
178
|
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import {
|
|
4
|
+
import { File as RLCFile, RLCModel, RLCSampleGroup } from "./interfaces.js";
|
|
5
5
|
import { sampleTemplate } from "./static/sampleTemplate.js";
|
|
6
6
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
7
7
|
// @ts-ignore: to fix the handlebars issue
|
|
@@ -20,12 +20,12 @@ export function buildSamples(model: RLCModel) {
|
|
|
20
20
|
const sampleFiles: RLCFile[] = [];
|
|
21
21
|
for (const sampleGroup of sampleGroups) {
|
|
22
22
|
const sampleGroupFileContents = hbs.compile(sampleTemplate, {
|
|
23
|
-
noEscape: true
|
|
23
|
+
noEscape: true,
|
|
24
24
|
});
|
|
25
25
|
const filePath = path.join("samples-dev", `${sampleGroup.filename}.ts`);
|
|
26
26
|
sampleFiles.push({
|
|
27
27
|
path: filePath,
|
|
28
|
-
content: sampleGroupFileContents(sampleGroup)
|
|
28
|
+
content: sampleGroupFileContents(sampleGroup),
|
|
29
29
|
});
|
|
30
30
|
}
|
|
31
31
|
return sampleFiles;
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import { Project } from "ts-morph";
|
|
5
4
|
import * as path from "path";
|
|
5
|
+
import { Project } from "ts-morph";
|
|
6
6
|
import {
|
|
7
7
|
buildObjectAliases,
|
|
8
8
|
buildObjectInterfaces,
|
|
9
|
-
buildPolymorphicAliases
|
|
9
|
+
buildPolymorphicAliases,
|
|
10
10
|
} from "./buildObjectTypes.js";
|
|
11
|
-
import { RLCModel, SchemaContext } from "./interfaces.js";
|
|
12
11
|
import { getImportSpecifier } from "./helpers/importsUtil.js";
|
|
12
|
+
import { RLCModel, SchemaContext } from "./interfaces.js";
|
|
13
13
|
|
|
14
14
|
/**
|
|
15
15
|
* Generates types to represent schema definitions in the swagger
|
|
@@ -18,13 +18,11 @@ export function buildSchemaTypes(model: RLCModel) {
|
|
|
18
18
|
const { srcPath } = model;
|
|
19
19
|
const project = new Project();
|
|
20
20
|
let filePath = path.join(srcPath, `models.ts`);
|
|
21
|
-
const inputModelFile = generateModelFiles(model, project, filePath, [
|
|
22
|
-
SchemaContext.Input
|
|
23
|
-
]);
|
|
21
|
+
const inputModelFile = generateModelFiles(model, project, filePath, [SchemaContext.Input]);
|
|
24
22
|
filePath = path.join(srcPath, `outputModels.ts`);
|
|
25
23
|
const outputModelFile = generateModelFiles(model, project, filePath, [
|
|
26
24
|
SchemaContext.Output,
|
|
27
|
-
SchemaContext.Exception
|
|
25
|
+
SchemaContext.Exception,
|
|
28
26
|
]);
|
|
29
27
|
return { inputModelFile, outputModelFile };
|
|
30
28
|
}
|
|
@@ -33,31 +31,19 @@ export function generateModelFiles(
|
|
|
33
31
|
model: RLCModel,
|
|
34
32
|
project: Project,
|
|
35
33
|
filePath: string,
|
|
36
|
-
schemaContext: SchemaContext[]
|
|
34
|
+
schemaContext: SchemaContext[],
|
|
37
35
|
) {
|
|
38
36
|
// Track models that need to be imported
|
|
39
37
|
const importedModels = new Set<string>();
|
|
40
|
-
const objectsDefinitions = buildObjectInterfaces(
|
|
41
|
-
model,
|
|
42
|
-
importedModels,
|
|
43
|
-
schemaContext
|
|
44
|
-
);
|
|
38
|
+
const objectsDefinitions = buildObjectInterfaces(model, importedModels, schemaContext);
|
|
45
39
|
|
|
46
40
|
const objectTypeAliases = buildPolymorphicAliases(model, schemaContext);
|
|
47
41
|
|
|
48
|
-
const objectAliases = buildObjectAliases(
|
|
49
|
-
model,
|
|
50
|
-
importedModels,
|
|
51
|
-
schemaContext
|
|
52
|
-
);
|
|
42
|
+
const objectAliases = buildObjectAliases(model, importedModels, schemaContext);
|
|
53
43
|
|
|
54
|
-
if (
|
|
55
|
-
objectTypeAliases.length ||
|
|
56
|
-
objectsDefinitions.length ||
|
|
57
|
-
objectAliases.length
|
|
58
|
-
) {
|
|
44
|
+
if (objectTypeAliases.length || objectsDefinitions.length || objectAliases.length) {
|
|
59
45
|
const modelsFile = project.createSourceFile(filePath, undefined, {
|
|
60
|
-
overwrite: true
|
|
46
|
+
overwrite: true,
|
|
61
47
|
});
|
|
62
48
|
|
|
63
49
|
modelsFile.addInterfaces(objectsDefinitions);
|
|
@@ -68,11 +54,8 @@ export function generateModelFiles(
|
|
|
68
54
|
{
|
|
69
55
|
isTypeOnly: true,
|
|
70
56
|
namedImports: [...Array.from(importedModels || [])],
|
|
71
|
-
moduleSpecifier: getImportSpecifier(
|
|
72
|
-
|
|
73
|
-
model.importInfo.runtimeImports
|
|
74
|
-
)
|
|
75
|
-
}
|
|
57
|
+
moduleSpecifier: getImportSpecifier("restClient", model.importInfo.runtimeImports),
|
|
58
|
+
},
|
|
76
59
|
]);
|
|
77
60
|
}
|
|
78
61
|
return { path: filePath, content: modelsFile.getFullText() };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { RLCModel } from "./interfaces.js";
|
|
2
1
|
import * as path from "path";
|
|
2
|
+
import { RLCModel } from "./interfaces.js";
|
|
3
3
|
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
|
|
4
4
|
// @ts-ignore: to fix the handlebars issue
|
|
5
5
|
import hbs from "handlebars";
|
|
@@ -8,14 +8,14 @@ import {
|
|
|
8
8
|
hasMultiCollection,
|
|
9
9
|
hasPipeCollection,
|
|
10
10
|
hasSsvCollection,
|
|
11
|
-
hasTsvCollection
|
|
11
|
+
hasTsvCollection,
|
|
12
12
|
} from "./helpers/operationHelpers.js";
|
|
13
13
|
import {
|
|
14
14
|
buildCsvCollectionContent,
|
|
15
15
|
buildMultiCollectionContent,
|
|
16
16
|
buildPipeCollectionContent,
|
|
17
17
|
buildSsvCollectionContent,
|
|
18
|
-
buildTsvCollectionContent
|
|
18
|
+
buildTsvCollectionContent,
|
|
19
19
|
} from "./static/serializeHelper.js";
|
|
20
20
|
|
|
21
21
|
export function buildSerializeHelper(model: RLCModel) {
|
|
@@ -37,12 +37,12 @@ export function buildSerializeHelper(model: RLCModel) {
|
|
|
37
37
|
}
|
|
38
38
|
if (serializeHelperContent !== "") {
|
|
39
39
|
const readmeFileContents = hbs.compile(serializeHelperContent, {
|
|
40
|
-
noEscape: true
|
|
40
|
+
noEscape: true,
|
|
41
41
|
});
|
|
42
42
|
const { srcPath } = model;
|
|
43
43
|
return {
|
|
44
44
|
path: path.join(srcPath, "serializeHelper.ts"),
|
|
45
|
-
content: readmeFileContents({})
|
|
45
|
+
content: readmeFileContents({}),
|
|
46
46
|
};
|
|
47
47
|
}
|
|
48
48
|
return undefined;
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import { NameType, normalizeName } from "./helpers/nameUtils.js";
|
|
5
|
-
import { RLCModel } from "./interfaces.js";
|
|
6
|
-
import { Project } from "ts-morph";
|
|
7
4
|
import * as path from "path";
|
|
8
|
-
import {
|
|
5
|
+
import { Project } from "ts-morph";
|
|
9
6
|
import { getImportModuleName } from "./helpers/nameConstructors.js";
|
|
7
|
+
import { NameType, normalizeName } from "./helpers/nameUtils.js";
|
|
8
|
+
import { getRelativePartFromSrcPath } from "./helpers/pathUtils.js";
|
|
9
|
+
import { RLCModel } from "./interfaces.js";
|
|
10
10
|
|
|
11
11
|
const batchOutputFolder: [string, string, string][] = [];
|
|
12
12
|
|
|
@@ -21,19 +21,12 @@ export function buildTopLevelIndex(model: RLCModel) {
|
|
|
21
21
|
if (srcPath) {
|
|
22
22
|
const clientName = model.libraryName;
|
|
23
23
|
const moduleName = normalizeName(clientName, NameType.File);
|
|
24
|
-
const relativePath =
|
|
25
|
-
"./" +
|
|
26
|
-
getRelativePartFromSrcPath(srcPath, model.options.isModularLibrary);
|
|
24
|
+
const relativePath = "./" + getRelativePartFromSrcPath(srcPath, model.options.isModularLibrary);
|
|
27
25
|
batchOutputFolder.push([relativePath, clientName, moduleName]);
|
|
28
26
|
}
|
|
29
|
-
if (
|
|
30
|
-
multiClient &&
|
|
31
|
-
batch &&
|
|
32
|
-
batch.length > 1 &&
|
|
33
|
-
batchOutputFolder.length === batch.length
|
|
34
|
-
) {
|
|
27
|
+
if (multiClient && batch && batch.length > 1 && batchOutputFolder.length === batch.length) {
|
|
35
28
|
const indexFile = project.createSourceFile("index.ts", undefined, {
|
|
36
|
-
overwrite: true
|
|
29
|
+
overwrite: true,
|
|
37
30
|
});
|
|
38
31
|
const allModules: string[] = [];
|
|
39
32
|
batchOutputFolder.forEach((item) => {
|
|
@@ -43,21 +36,21 @@ export function buildTopLevelIndex(model: RLCModel) {
|
|
|
43
36
|
moduleSpecifier: getImportModuleName(
|
|
44
37
|
{
|
|
45
38
|
cjsName: `${item[0]}`,
|
|
46
|
-
esModulesName: `${item[0]}/index.js
|
|
39
|
+
esModulesName: `${item[0]}/index.js`,
|
|
47
40
|
},
|
|
48
|
-
model
|
|
49
|
-
)
|
|
41
|
+
model,
|
|
42
|
+
),
|
|
50
43
|
});
|
|
51
44
|
allModules.push(item[1]);
|
|
52
45
|
});
|
|
53
46
|
indexFile.addExportDeclaration({
|
|
54
|
-
namedExports: [...allModules]
|
|
47
|
+
namedExports: [...allModules],
|
|
55
48
|
});
|
|
56
49
|
const content = indexFile.getFullText();
|
|
57
50
|
const filePath = path.join(
|
|
58
51
|
srcPath.substring(0, srcPath.lastIndexOf("src") + 4),
|
|
59
52
|
model.options.isModularLibrary ? "rest" : "",
|
|
60
|
-
`index.ts
|
|
53
|
+
`index.ts`,
|
|
61
54
|
);
|
|
62
55
|
return { path: filePath, content };
|
|
63
56
|
}
|
|
@@ -5,16 +5,12 @@ import { ApiVersionInfo, ApiVersionPosition, UrlInfo } from "../interfaces.js";
|
|
|
5
5
|
* @param urlInfo UrlInfo detail
|
|
6
6
|
* @returns path api-version detail
|
|
7
7
|
*/
|
|
8
|
-
export function extractPathApiVersion(
|
|
9
|
-
urlInfo?: UrlInfo
|
|
10
|
-
): ApiVersionInfo | undefined {
|
|
8
|
+
export function extractPathApiVersion(urlInfo?: UrlInfo): ApiVersionInfo | undefined {
|
|
11
9
|
if (!urlInfo) {
|
|
12
10
|
return;
|
|
13
11
|
}
|
|
14
12
|
const param = urlInfo.urlParameters?.filter(
|
|
15
|
-
(p) =>
|
|
16
|
-
p.name.toLowerCase() === "api-version" ||
|
|
17
|
-
p.name.toLowerCase() === "apiversion"
|
|
13
|
+
(p) => p.name.toLowerCase() === "api-version" || p.name.toLowerCase() === "apiversion",
|
|
18
14
|
);
|
|
19
15
|
if (!param || param?.length < 1) {
|
|
20
16
|
return;
|
|
@@ -22,9 +18,8 @@ export function extractPathApiVersion(
|
|
|
22
18
|
const detail: ApiVersionInfo = {
|
|
23
19
|
definedPosition: "path",
|
|
24
20
|
isCrossedVersion: Boolean(param?.length > 1),
|
|
25
|
-
defaultValue:
|
|
26
|
-
|
|
27
|
-
required: true
|
|
21
|
+
defaultValue: param.length === 1 ? (param[0]?.value as string | undefined) : undefined,
|
|
22
|
+
required: true,
|
|
28
23
|
};
|
|
29
24
|
return detail;
|
|
30
25
|
}
|
|
@@ -39,7 +34,7 @@ export function extractPathApiVersion(
|
|
|
39
34
|
*/
|
|
40
35
|
export function extractDefinedPosition(
|
|
41
36
|
operationApiVersion?: ApiVersionInfo,
|
|
42
|
-
urlVersionDetail?: ApiVersionInfo
|
|
37
|
+
urlVersionDetail?: ApiVersionInfo,
|
|
43
38
|
): ApiVersionPosition {
|
|
44
39
|
let pos: ApiVersionPosition = "none";
|
|
45
40
|
if (operationApiVersion && urlVersionDetail) {
|
|
@@ -12,42 +12,42 @@ export function buildRuntimeImports(flavor?: PackageFlavor): Imports {
|
|
|
12
12
|
restClient: {
|
|
13
13
|
type: "restClient",
|
|
14
14
|
specifier: "@azure-rest/core-client",
|
|
15
|
-
version: "^2.0.0"
|
|
15
|
+
version: "^2.0.0",
|
|
16
16
|
},
|
|
17
17
|
coreAuth: {
|
|
18
18
|
type: "coreAuth",
|
|
19
19
|
specifier: "@azure/core-auth",
|
|
20
|
-
version: "^1.6.0"
|
|
20
|
+
version: "^1.6.0",
|
|
21
21
|
},
|
|
22
22
|
restPipeline: {
|
|
23
23
|
type: "restPipeline",
|
|
24
24
|
specifier: "@azure/core-rest-pipeline",
|
|
25
|
-
version: "^1.14.0"
|
|
25
|
+
version: "^1.14.0",
|
|
26
26
|
},
|
|
27
27
|
coreUtil: {
|
|
28
28
|
type: "coreUtil",
|
|
29
29
|
specifier: "@azure/core-util",
|
|
30
|
-
version: "^1.4.0"
|
|
30
|
+
version: "^1.4.0",
|
|
31
31
|
},
|
|
32
32
|
coreLogger: {
|
|
33
33
|
type: "coreLogger",
|
|
34
34
|
specifier: "@azure/logger",
|
|
35
|
-
version: "^1.0.4"
|
|
35
|
+
version: "^1.0.4",
|
|
36
36
|
},
|
|
37
37
|
azureEslintPlugin: {
|
|
38
38
|
type: "azureEslintPlugin",
|
|
39
39
|
specifier: "@azure/eslint-plugin-azure-sdk",
|
|
40
|
-
version: "^3.0.0"
|
|
40
|
+
version: "^3.0.0",
|
|
41
41
|
},
|
|
42
42
|
azureTestRecorder: {
|
|
43
43
|
type: "azureTestRecorder",
|
|
44
44
|
specifier: "@azure-tools/test-recorder",
|
|
45
|
-
version: "^3.0.0"
|
|
45
|
+
version: "^3.0.0",
|
|
46
46
|
},
|
|
47
47
|
azureCoreLro: {
|
|
48
48
|
type: "azureCoreLro",
|
|
49
|
-
specifier: "@azure/core-lro"
|
|
50
|
-
}
|
|
49
|
+
specifier: "@azure/core-lro",
|
|
50
|
+
},
|
|
51
51
|
} as Imports;
|
|
52
52
|
} else {
|
|
53
53
|
// In non-azure branded scope we only have one dependency that is ts-http-runtime
|
|
@@ -55,8 +55,8 @@ export function buildRuntimeImports(flavor?: PackageFlavor): Imports {
|
|
|
55
55
|
commonFallback: {
|
|
56
56
|
type: "commonFallback",
|
|
57
57
|
specifier: "@typespec/ts-http-runtime",
|
|
58
|
-
version: "0.1.0"
|
|
59
|
-
}
|
|
58
|
+
version: "0.1.0",
|
|
59
|
+
},
|
|
60
60
|
} as Imports;
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -69,39 +69,39 @@ export function initInternalImports(): Imports {
|
|
|
69
69
|
return {
|
|
70
70
|
parameter: {
|
|
71
71
|
type: "parameter",
|
|
72
|
-
importsSet: new Set<string>()
|
|
72
|
+
importsSet: new Set<string>(),
|
|
73
73
|
},
|
|
74
74
|
response: {
|
|
75
75
|
type: "response",
|
|
76
|
-
importsSet: new Set<string>()
|
|
76
|
+
importsSet: new Set<string>(),
|
|
77
77
|
},
|
|
78
78
|
rlcIndex: {
|
|
79
79
|
type: "rlcIndex",
|
|
80
|
-
importsSet: new Set<string>()
|
|
80
|
+
importsSet: new Set<string>(),
|
|
81
81
|
},
|
|
82
82
|
modularModel: {
|
|
83
83
|
type: "modularModel",
|
|
84
|
-
importsSet: new Set<string>()
|
|
84
|
+
importsSet: new Set<string>(),
|
|
85
85
|
},
|
|
86
86
|
rlcClientFactory: {
|
|
87
87
|
type: "rlcClientFactory",
|
|
88
|
-
importsSet: new Set<string>()
|
|
88
|
+
importsSet: new Set<string>(),
|
|
89
89
|
},
|
|
90
90
|
rlcClientDefinition: {
|
|
91
91
|
type: "rlcClientDefinition",
|
|
92
|
-
importsSet: new Set<string>()
|
|
92
|
+
importsSet: new Set<string>(),
|
|
93
93
|
},
|
|
94
94
|
serializerHelpers: {
|
|
95
95
|
type: "serializerHelpers",
|
|
96
|
-
importsSet: new Set<string>()
|
|
97
|
-
}
|
|
96
|
+
importsSet: new Set<string>(),
|
|
97
|
+
},
|
|
98
98
|
} as Imports;
|
|
99
99
|
}
|
|
100
100
|
|
|
101
101
|
export function getImportSpecifier(
|
|
102
102
|
importType: ImportType,
|
|
103
103
|
imports?: Imports,
|
|
104
|
-
includeFallback = true
|
|
104
|
+
includeFallback = true,
|
|
105
105
|
): string {
|
|
106
106
|
imports = imports ?? ({} as Imports);
|
|
107
107
|
const defaultPackageMap: Record<ImportType, string> = {
|
|
@@ -110,7 +110,7 @@ export function getImportSpecifier(
|
|
|
110
110
|
restPipeline: "@azure/core-rest-pipeline",
|
|
111
111
|
coreUtil: "@azure/core-util",
|
|
112
112
|
coreLogger: "@azure/logger",
|
|
113
|
-
azureCoreLro: "@azure/core-lro"
|
|
113
|
+
azureCoreLro: "@azure/core-lro",
|
|
114
114
|
} as any;
|
|
115
115
|
if (!includeFallback) {
|
|
116
116
|
return imports[importType]?.specifier ?? "";
|
|
@@ -125,7 +125,7 @@ export function getImportSpecifier(
|
|
|
125
125
|
export function addImportToSpecifier(
|
|
126
126
|
importType: ImportType,
|
|
127
127
|
runtimeImports: Imports,
|
|
128
|
-
importedName: string
|
|
128
|
+
importedName: string,
|
|
129
129
|
): void {
|
|
130
130
|
const specifier = getImportSpecifier(importType, runtimeImports);
|
|
131
131
|
const importSet = runtimeImports[importType]?.importsSet;
|
|
@@ -133,7 +133,7 @@ export function addImportToSpecifier(
|
|
|
133
133
|
runtimeImports[importType] = {
|
|
134
134
|
type: importType,
|
|
135
135
|
specifier,
|
|
136
|
-
importsSet: new Set<string>().add(importedName)
|
|
136
|
+
importsSet: new Set<string>().add(importedName),
|
|
137
137
|
};
|
|
138
138
|
} else {
|
|
139
139
|
importSet.add(importedName);
|
|
@@ -149,15 +149,14 @@ export function clearImportSets(runtimeImports: Imports): void {
|
|
|
149
149
|
export function addImportsToFiles(
|
|
150
150
|
runtimeImports: Imports,
|
|
151
151
|
file: SourceFile,
|
|
152
|
-
internalSpecifierMap?: Record<string, string
|
|
152
|
+
internalSpecifierMap?: Record<string, string>,
|
|
153
153
|
): void {
|
|
154
154
|
Object.values(runtimeImports)
|
|
155
155
|
.filter((importType) => {
|
|
156
156
|
return importType.importsSet?.size;
|
|
157
157
|
})
|
|
158
158
|
.forEach((importType) => {
|
|
159
|
-
const specifier =
|
|
160
|
-
internalSpecifierMap?.[importType.type] ?? importType.specifier!;
|
|
159
|
+
const specifier = internalSpecifierMap?.[importType.type] ?? importType.specifier!;
|
|
161
160
|
let hasModifier = false;
|
|
162
161
|
if (!specifier) {
|
|
163
162
|
return;
|
|
@@ -169,16 +168,14 @@ export function addImportsToFiles(
|
|
|
169
168
|
})
|
|
170
169
|
.forEach((importDeclaration) => {
|
|
171
170
|
hasModifier = true;
|
|
172
|
-
importDeclaration.addNamedImports([
|
|
173
|
-
...importType.importsSet!.values()
|
|
174
|
-
]);
|
|
171
|
+
importDeclaration.addNamedImports([...importType.importsSet!.values()]);
|
|
175
172
|
});
|
|
176
173
|
|
|
177
174
|
if (!hasModifier) {
|
|
178
175
|
file.addImportDeclaration({
|
|
179
176
|
isTypeOnly: true,
|
|
180
177
|
moduleSpecifier: specifier,
|
|
181
|
-
namedImports: [...importType.importsSet!.values()]
|
|
178
|
+
namedImports: [...importType.importsSet!.values()],
|
|
182
179
|
});
|
|
183
180
|
return;
|
|
184
181
|
}
|