@azure-tools/typespec-ts 0.54.0-dev.6 → 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 -3
- package/src/contextManager.ts +6 -9
- package/src/framework/declaration.ts +18 -28
- package/src/framework/dependency.ts +1 -2
- package/src/framework/hooks/binder.ts +47 -120
- package/src/framework/hooks/sdkTypes.ts +27 -54
- package/src/framework/hooks/useDependencies.ts +2 -4
- package/src/framework/load-static-helpers.ts +28 -51
- package/src/framework/reference.ts +2 -5
- package/src/framework/sample.ts +9 -9
- package/src/index.ts +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 -115
- package/src/utils/clientUtils.ts +22 -41
- package/src/utils/credentialUtils.ts +8 -19
- package/src/utils/crossLanguageDef.ts +15 -34
- package/src/utils/emitUtil.ts +11 -17
- package/src/utils/fileSystemUtils.ts +4 -6
- package/src/utils/importHelper.ts +5 -10
- package/src/utils/interfaces.ts +1 -1
- package/src/utils/mediaTypes.ts +13 -34
- package/src/utils/modelUtils.ts +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,30 +1,30 @@
|
|
|
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
|
Project,
|
|
7
8
|
PropertySignatureStructure,
|
|
8
9
|
SourceFile,
|
|
9
|
-
StructureKind
|
|
10
|
+
StructureKind,
|
|
10
11
|
} from "ts-morph";
|
|
11
|
-
import
|
|
12
|
+
import { getObjectInterfaceDeclaration } from "./buildObjectTypes.js";
|
|
13
|
+
import { getImportSpecifier } from "./helpers/importsUtil.js";
|
|
14
|
+
import {
|
|
15
|
+
getImportModuleName,
|
|
16
|
+
getParameterBaseName,
|
|
17
|
+
getParameterTypeName,
|
|
18
|
+
} from "./helpers/nameConstructors.js";
|
|
19
|
+
import { getGeneratedWrapperTypes } from "./helpers/operationHelpers.js";
|
|
12
20
|
import {
|
|
13
21
|
ObjectSchema,
|
|
14
22
|
ParameterMetadata,
|
|
15
23
|
ParameterMetadatas,
|
|
16
24
|
RLCModel,
|
|
17
25
|
Schema,
|
|
18
|
-
SchemaContext
|
|
26
|
+
SchemaContext,
|
|
19
27
|
} from "./interfaces.js";
|
|
20
|
-
import {
|
|
21
|
-
getImportModuleName,
|
|
22
|
-
getParameterBaseName,
|
|
23
|
-
getParameterTypeName
|
|
24
|
-
} from "./helpers/nameConstructors.js";
|
|
25
|
-
import { getImportSpecifier } from "./helpers/importsUtil.js";
|
|
26
|
-
import { getObjectInterfaceDeclaration } from "./buildObjectTypes.js";
|
|
27
|
-
import { getGeneratedWrapperTypes } from "./helpers/operationHelpers.js";
|
|
28
28
|
|
|
29
29
|
export function buildParameterTypes(model: RLCModel) {
|
|
30
30
|
const project = new Project();
|
|
@@ -32,7 +32,7 @@ export function buildParameterTypes(model: RLCModel) {
|
|
|
32
32
|
const filePath = path.join(srcPath, `parameters.ts`);
|
|
33
33
|
const partialBodyTypeNames = new Set<string>();
|
|
34
34
|
const parametersFile = project.createSourceFile(filePath, undefined, {
|
|
35
|
-
overwrite: true
|
|
35
|
+
overwrite: true,
|
|
36
36
|
});
|
|
37
37
|
let hasHeaders = false;
|
|
38
38
|
|
|
@@ -42,7 +42,7 @@ export function buildParameterTypes(model: RLCModel) {
|
|
|
42
42
|
for (const requestParameter of model.parameters) {
|
|
43
43
|
const baseParameterName = getParameterBaseName(
|
|
44
44
|
requestParameter.operationGroup,
|
|
45
|
-
requestParameter.operationName
|
|
45
|
+
requestParameter.operationName,
|
|
46
46
|
);
|
|
47
47
|
const requestCount = requestParameter?.parameters?.length ?? 0;
|
|
48
48
|
const topParamName = getParameterTypeName(baseParameterName);
|
|
@@ -60,15 +60,13 @@ export function buildParameterTypes(model: RLCModel) {
|
|
|
60
60
|
// In case we have more than one request to model we need to add a suffix to differentiate
|
|
61
61
|
const nameSuffix = i > 0 ? `${i}` : "";
|
|
62
62
|
const parameterInterfaceName =
|
|
63
|
-
requestCount > 1
|
|
64
|
-
? `${baseParameterName}RequestParameters${nameSuffix}`
|
|
65
|
-
: topParamName;
|
|
63
|
+
requestCount > 1 ? `${baseParameterName}RequestParameters${nameSuffix}` : topParamName;
|
|
66
64
|
const queryParameterDefinitions = buildQueryParameterDefinition(
|
|
67
65
|
model,
|
|
68
66
|
parameter,
|
|
69
67
|
baseParameterName,
|
|
70
68
|
internalReferences,
|
|
71
|
-
i
|
|
69
|
+
i,
|
|
72
70
|
);
|
|
73
71
|
const pathParameterDefinitions = buildPathParameterDefinitions(
|
|
74
72
|
model,
|
|
@@ -76,7 +74,7 @@ export function buildParameterTypes(model: RLCModel) {
|
|
|
76
74
|
baseParameterName,
|
|
77
75
|
parametersFile,
|
|
78
76
|
internalReferences,
|
|
79
|
-
i
|
|
77
|
+
i,
|
|
80
78
|
);
|
|
81
79
|
|
|
82
80
|
const headerParameterDefinitions = buildHeaderParameterDefinitions(
|
|
@@ -84,22 +82,21 @@ export function buildParameterTypes(model: RLCModel) {
|
|
|
84
82
|
baseParameterName,
|
|
85
83
|
parametersFile,
|
|
86
84
|
internalReferences,
|
|
87
|
-
i
|
|
85
|
+
i,
|
|
88
86
|
);
|
|
89
87
|
|
|
90
|
-
const contentTypeParameterDefinition =
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
);
|
|
88
|
+
const contentTypeParameterDefinition = buildContentTypeParametersDefinition(
|
|
89
|
+
parameter,
|
|
90
|
+
baseParameterName,
|
|
91
|
+
internalReferences,
|
|
92
|
+
i,
|
|
93
|
+
);
|
|
97
94
|
|
|
98
95
|
const bodyParameterDefinition = buildBodyParametersDefinition(
|
|
99
96
|
parameter,
|
|
100
97
|
baseParameterName,
|
|
101
98
|
internalReferences,
|
|
102
|
-
i
|
|
99
|
+
i,
|
|
103
100
|
);
|
|
104
101
|
|
|
105
102
|
const bodyTypeAlias = buildBodyTypeAlias(parameter, partialBodyTypeNames);
|
|
@@ -113,9 +110,7 @@ export function buildParameterTypes(model: RLCModel) {
|
|
|
113
110
|
...(queryParameterDefinitions ?? []),
|
|
114
111
|
...(pathParameterDefinitions ?? []),
|
|
115
112
|
...(headerParameterDefinitions ? [headerParameterDefinitions] : []),
|
|
116
|
-
...(contentTypeParameterDefinition
|
|
117
|
-
? [contentTypeParameterDefinition]
|
|
118
|
-
: [])
|
|
113
|
+
...(contentTypeParameterDefinition ? [contentTypeParameterDefinition] : []),
|
|
119
114
|
]);
|
|
120
115
|
|
|
121
116
|
// Add Operation parameters type alias which is composed of the types we generated above
|
|
@@ -123,7 +118,7 @@ export function buildParameterTypes(model: RLCModel) {
|
|
|
123
118
|
parametersFile.addTypeAlias({
|
|
124
119
|
name: parameterInterfaceName,
|
|
125
120
|
isExported: true,
|
|
126
|
-
type: [...internalReferences, "RequestParameters"].join(" & ")
|
|
121
|
+
type: [...internalReferences, "RequestParameters"].join(" & "),
|
|
127
122
|
});
|
|
128
123
|
|
|
129
124
|
subParamNames.push(parameterInterfaceName);
|
|
@@ -138,7 +133,7 @@ export function buildParameterTypes(model: RLCModel) {
|
|
|
138
133
|
parametersFile.addTypeAlias({
|
|
139
134
|
name: topParamName,
|
|
140
135
|
isExported: true,
|
|
141
|
-
type: [...subParamNames].join(" | ")
|
|
136
|
+
type: [...subParamNames].join(" | "),
|
|
142
137
|
});
|
|
143
138
|
}
|
|
144
139
|
}
|
|
@@ -148,40 +143,30 @@ export function buildParameterTypes(model: RLCModel) {
|
|
|
148
143
|
{
|
|
149
144
|
isTypeOnly: true,
|
|
150
145
|
namedImports: ["RawHttpHeadersInput"],
|
|
151
|
-
moduleSpecifier: getImportSpecifier(
|
|
152
|
-
|
|
153
|
-
model.importInfo.runtimeImports
|
|
154
|
-
)
|
|
155
|
-
}
|
|
146
|
+
moduleSpecifier: getImportSpecifier("restPipeline", model.importInfo.runtimeImports),
|
|
147
|
+
},
|
|
156
148
|
]);
|
|
157
149
|
}
|
|
158
150
|
parametersFile.addImportDeclarations([
|
|
159
151
|
{
|
|
160
152
|
isTypeOnly: true,
|
|
161
153
|
namedImports: ["RequestParameters"],
|
|
162
|
-
moduleSpecifier: getImportSpecifier(
|
|
163
|
-
|
|
164
|
-
model.importInfo.runtimeImports
|
|
165
|
-
)
|
|
166
|
-
}
|
|
154
|
+
moduleSpecifier: getImportSpecifier("restClient", model.importInfo.runtimeImports),
|
|
155
|
+
},
|
|
167
156
|
]);
|
|
168
|
-
if (
|
|
169
|
-
(model.importInfo.internalImports?.parameter?.importsSet?.size ?? 0) > 0
|
|
170
|
-
) {
|
|
157
|
+
if ((model.importInfo.internalImports?.parameter?.importsSet?.size ?? 0) > 0) {
|
|
171
158
|
parametersFile.addImportDeclarations([
|
|
172
159
|
{
|
|
173
160
|
isTypeOnly: true,
|
|
174
|
-
namedImports: Array.from(
|
|
175
|
-
model.importInfo.internalImports.parameter.importsSet!
|
|
176
|
-
),
|
|
161
|
+
namedImports: Array.from(model.importInfo.internalImports.parameter.importsSet!),
|
|
177
162
|
moduleSpecifier: getImportModuleName(
|
|
178
163
|
{
|
|
179
164
|
cjsName: `./models`,
|
|
180
|
-
esModulesName: `./models.js
|
|
165
|
+
esModulesName: `./models.js`,
|
|
181
166
|
},
|
|
182
|
-
model
|
|
183
|
-
)
|
|
184
|
-
}
|
|
167
|
+
model,
|
|
168
|
+
),
|
|
169
|
+
},
|
|
185
170
|
]);
|
|
186
171
|
}
|
|
187
172
|
return { path: filePath, content: parametersFile.getFullText() };
|
|
@@ -192,11 +177,9 @@ function buildQueryParameterDefinition(
|
|
|
192
177
|
parameters: ParameterMetadatas,
|
|
193
178
|
baseName: string,
|
|
194
179
|
internalReferences: Set<string>,
|
|
195
|
-
requestIndex: number
|
|
180
|
+
requestIndex: number,
|
|
196
181
|
): InterfaceDeclarationStructure[] | undefined {
|
|
197
|
-
const queryParameters = (parameters?.parameters || []).filter(
|
|
198
|
-
(p) => p.type === "query"
|
|
199
|
-
);
|
|
182
|
+
const queryParameters = (parameters?.parameters || []).filter((p) => p.type === "query");
|
|
200
183
|
|
|
201
184
|
if (!queryParameters.length) {
|
|
202
185
|
return undefined;
|
|
@@ -207,31 +190,25 @@ function buildQueryParameterDefinition(
|
|
|
207
190
|
const queryParameterPropertiesName = `${baseName}QueryParamProperties`;
|
|
208
191
|
|
|
209
192
|
// Get the property signature for each query parameter
|
|
210
|
-
const propertiesDefinition = queryParameters.map((qp) =>
|
|
211
|
-
getPropertyFromSchema(qp.param)
|
|
212
|
-
);
|
|
193
|
+
const propertiesDefinition = queryParameters.map((qp) => getPropertyFromSchema(qp.param));
|
|
213
194
|
// Get wrapper types for query parameters
|
|
214
|
-
const wrapperTypesDefinition = getGeneratedWrapperTypes(queryParameters).map(
|
|
215
|
-
(
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
);
|
|
195
|
+
const wrapperTypesDefinition = getGeneratedWrapperTypes(queryParameters).map((wrapObj) => {
|
|
196
|
+
return getObjectInterfaceDeclaration(
|
|
197
|
+
model,
|
|
198
|
+
wrapObj.name,
|
|
199
|
+
wrapObj,
|
|
200
|
+
[SchemaContext.Input],
|
|
201
|
+
new Set<string>(),
|
|
202
|
+
);
|
|
203
|
+
});
|
|
225
204
|
|
|
226
|
-
const hasRequiredParameters = propertiesDefinition.some(
|
|
227
|
-
(p) => !p.hasQuestionToken
|
|
228
|
-
);
|
|
205
|
+
const hasRequiredParameters = propertiesDefinition.some((p) => !p.hasQuestionToken);
|
|
229
206
|
|
|
230
207
|
const propertiesInterface: InterfaceDeclarationStructure = {
|
|
231
208
|
kind: StructureKind.Interface,
|
|
232
209
|
isExported: true,
|
|
233
210
|
name: queryParameterPropertiesName,
|
|
234
|
-
properties: propertiesDefinition
|
|
211
|
+
properties: propertiesDefinition,
|
|
235
212
|
};
|
|
236
213
|
|
|
237
214
|
const parameterInterface: InterfaceDeclarationStructure = {
|
|
@@ -243,9 +220,9 @@ function buildQueryParameterDefinition(
|
|
|
243
220
|
name: "queryParameters",
|
|
244
221
|
type: queryParameterPropertiesName,
|
|
245
222
|
// Mark as optional if there are no required parameters
|
|
246
|
-
hasQuestionToken: !hasRequiredParameters
|
|
247
|
-
}
|
|
248
|
-
]
|
|
223
|
+
hasQuestionToken: !hasRequiredParameters,
|
|
224
|
+
},
|
|
225
|
+
],
|
|
249
226
|
};
|
|
250
227
|
|
|
251
228
|
// Mark the queryParameter interface for importing
|
|
@@ -261,7 +238,7 @@ function getPropertyFromSchema(schema: Schema): PropertySignatureStructure {
|
|
|
261
238
|
...(description && { docs: [{ description }] }),
|
|
262
239
|
type: schema.type,
|
|
263
240
|
hasQuestionToken: !schema.required,
|
|
264
|
-
kind: StructureKind.PropertySignature
|
|
241
|
+
kind: StructureKind.PropertySignature,
|
|
265
242
|
};
|
|
266
243
|
}
|
|
267
244
|
|
|
@@ -271,11 +248,9 @@ function buildPathParameterDefinitions(
|
|
|
271
248
|
baseName: string,
|
|
272
249
|
parametersFile: SourceFile,
|
|
273
250
|
internalReferences: Set<string>,
|
|
274
|
-
requestIndex: number
|
|
251
|
+
requestIndex: number,
|
|
275
252
|
): InterfaceDeclarationStructure[] | undefined {
|
|
276
|
-
const pathParameters = (parameters.parameters || []).filter(
|
|
277
|
-
(p) => p.type === "path"
|
|
278
|
-
);
|
|
253
|
+
const pathParameters = (parameters.parameters || []).filter((p) => p.type === "path");
|
|
279
254
|
if (!pathParameters.length) {
|
|
280
255
|
return undefined;
|
|
281
256
|
}
|
|
@@ -293,10 +268,7 @@ function buildPathParameterDefinitions(
|
|
|
293
268
|
const nameSuffix = requestIndex > 0 ? `${requestIndex}` : "";
|
|
294
269
|
const pathParameterInterfaceName = `${baseName}PathParam${nameSuffix}`;
|
|
295
270
|
|
|
296
|
-
const pathInterface = getPathInterfaceDefinition(
|
|
297
|
-
clientPathParams,
|
|
298
|
-
baseName
|
|
299
|
-
);
|
|
271
|
+
const pathInterface = getPathInterfaceDefinition(clientPathParams, baseName);
|
|
300
272
|
|
|
301
273
|
if (pathInterface) {
|
|
302
274
|
parametersFile.addInterface(pathInterface);
|
|
@@ -312,9 +284,9 @@ function buildPathParameterDefinitions(
|
|
|
312
284
|
{
|
|
313
285
|
name: "pathParameters",
|
|
314
286
|
type: `${baseName}PathParameters`,
|
|
315
|
-
kind: StructureKind.PropertySignature
|
|
316
|
-
}
|
|
317
|
-
]
|
|
287
|
+
kind: StructureKind.PropertySignature,
|
|
288
|
+
},
|
|
289
|
+
],
|
|
318
290
|
});
|
|
319
291
|
}
|
|
320
292
|
|
|
@@ -326,15 +298,13 @@ function buildPathParameterDefinitions(
|
|
|
326
298
|
const methodPathParams = pathParameters.length > 0 ? pathParameters : [];
|
|
327
299
|
|
|
328
300
|
// we only need to build the wrapper types if the path parameters are objects
|
|
329
|
-
const wrapperTypesDefinition = getGeneratedWrapperTypes(
|
|
330
|
-
methodPathParams
|
|
331
|
-
).map((wrap) => {
|
|
301
|
+
const wrapperTypesDefinition = getGeneratedWrapperTypes(methodPathParams).map((wrap) => {
|
|
332
302
|
return getObjectInterfaceDeclaration(
|
|
333
303
|
model,
|
|
334
304
|
wrap.name,
|
|
335
305
|
wrap,
|
|
336
306
|
[SchemaContext.Input],
|
|
337
|
-
new Set<string>()
|
|
307
|
+
new Set<string>(),
|
|
338
308
|
);
|
|
339
309
|
});
|
|
340
310
|
allDefinitions.push(...wrapperTypesDefinition);
|
|
@@ -343,16 +313,14 @@ function buildPathParameterDefinitions(
|
|
|
343
313
|
|
|
344
314
|
function getPathInterfaceDefinition(
|
|
345
315
|
pathParameters: ParameterMetadata[],
|
|
346
|
-
baseName: string
|
|
316
|
+
baseName: string,
|
|
347
317
|
): undefined | InterfaceDeclarationStructure {
|
|
348
318
|
const pathInterfaceName = `${baseName}PathParameters`;
|
|
349
319
|
return {
|
|
350
320
|
kind: StructureKind.Interface,
|
|
351
321
|
isExported: true,
|
|
352
322
|
name: pathInterfaceName,
|
|
353
|
-
properties: pathParameters.map((p: ParameterMetadata) =>
|
|
354
|
-
getPropertyFromSchema(p.param)
|
|
355
|
-
)
|
|
323
|
+
properties: pathParameters.map((p: ParameterMetadata) => getPropertyFromSchema(p.param)),
|
|
356
324
|
};
|
|
357
325
|
}
|
|
358
326
|
|
|
@@ -361,10 +329,10 @@ function buildHeaderParameterDefinitions(
|
|
|
361
329
|
baseName: string,
|
|
362
330
|
parametersFile: SourceFile,
|
|
363
331
|
internalReferences: Set<string>,
|
|
364
|
-
requestIndex: number
|
|
332
|
+
requestIndex: number,
|
|
365
333
|
): InterfaceDeclarationStructure | undefined {
|
|
366
334
|
const headerParameters = (parameters.parameters || []).filter(
|
|
367
|
-
(p) => p.type === "header" && p.name !== "contentType"
|
|
335
|
+
(p) => p.type === "header" && p.name !== "contentType",
|
|
368
336
|
);
|
|
369
337
|
if (!headerParameters.length) {
|
|
370
338
|
return undefined;
|
|
@@ -373,16 +341,13 @@ function buildHeaderParameterDefinitions(
|
|
|
373
341
|
const nameSuffix = requestIndex > 0 ? `${requestIndex}` : "";
|
|
374
342
|
const headerParameterInterfaceName = `${baseName}HeaderParam${nameSuffix}`;
|
|
375
343
|
|
|
376
|
-
const headersInterface = getRequestHeaderInterfaceDefinition(
|
|
377
|
-
headerParameters,
|
|
378
|
-
baseName
|
|
379
|
-
);
|
|
344
|
+
const headersInterface = getRequestHeaderInterfaceDefinition(headerParameters, baseName);
|
|
380
345
|
|
|
381
346
|
let isOptional = true;
|
|
382
347
|
if (headersInterface) {
|
|
383
348
|
parametersFile.addInterface(headersInterface);
|
|
384
349
|
isOptional = !(headersInterface.properties || []).some(
|
|
385
|
-
(prop) => prop.hasQuestionToken === false
|
|
350
|
+
(prop) => prop.hasQuestionToken === false,
|
|
386
351
|
);
|
|
387
352
|
}
|
|
388
353
|
|
|
@@ -397,24 +362,22 @@ function buildHeaderParameterDefinitions(
|
|
|
397
362
|
name: "headers",
|
|
398
363
|
type: `RawHttpHeadersInput & ${baseName}Headers`,
|
|
399
364
|
kind: StructureKind.PropertySignature,
|
|
400
|
-
hasQuestionToken: isOptional
|
|
401
|
-
}
|
|
402
|
-
]
|
|
365
|
+
hasQuestionToken: isOptional,
|
|
366
|
+
},
|
|
367
|
+
],
|
|
403
368
|
};
|
|
404
369
|
}
|
|
405
370
|
|
|
406
371
|
function getRequestHeaderInterfaceDefinition(
|
|
407
372
|
headerParameters: ParameterMetadata[],
|
|
408
|
-
baseName: string
|
|
373
|
+
baseName: string,
|
|
409
374
|
): undefined | InterfaceDeclarationStructure {
|
|
410
375
|
const headersInterfaceName = `${baseName}Headers`;
|
|
411
376
|
return {
|
|
412
377
|
kind: StructureKind.Interface,
|
|
413
378
|
isExported: true,
|
|
414
379
|
name: headersInterfaceName,
|
|
415
|
-
properties: headerParameters.map((h: ParameterMetadata) =>
|
|
416
|
-
getPropertyFromSchema(h.param)
|
|
417
|
-
)
|
|
380
|
+
properties: headerParameters.map((h: ParameterMetadata) => getPropertyFromSchema(h.param)),
|
|
418
381
|
};
|
|
419
382
|
}
|
|
420
383
|
|
|
@@ -422,10 +385,10 @@ function buildContentTypeParametersDefinition(
|
|
|
422
385
|
parameters: ParameterMetadatas,
|
|
423
386
|
baseName: string,
|
|
424
387
|
internalReferences: Set<string>,
|
|
425
|
-
requestIndex: number
|
|
388
|
+
requestIndex: number,
|
|
426
389
|
): InterfaceDeclarationStructure | undefined {
|
|
427
390
|
const mediaTypeParameters = (parameters.parameters || []).filter(
|
|
428
|
-
(p) => p.type === "header" && p.name === "contentType"
|
|
391
|
+
(p) => p.type === "header" && p.name === "contentType",
|
|
429
392
|
);
|
|
430
393
|
if (!mediaTypeParameters.length) {
|
|
431
394
|
return undefined;
|
|
@@ -446,7 +409,7 @@ function buildContentTypeParametersDefinition(
|
|
|
446
409
|
isExported: true,
|
|
447
410
|
kind: StructureKind.Interface,
|
|
448
411
|
name: mediaTypesParameterInterfaceName,
|
|
449
|
-
properties: [getPropertyFromSchema(mediaParam)]
|
|
412
|
+
properties: [getPropertyFromSchema(mediaParam)],
|
|
450
413
|
};
|
|
451
414
|
}
|
|
452
415
|
|
|
@@ -454,14 +417,10 @@ function buildBodyParametersDefinition(
|
|
|
454
417
|
parameters: ParameterMetadatas,
|
|
455
418
|
baseName: string,
|
|
456
419
|
internalReferences: Set<string>,
|
|
457
|
-
requestIndex: number
|
|
420
|
+
requestIndex: number,
|
|
458
421
|
): InterfaceDeclarationStructure[] {
|
|
459
422
|
const bodyParameters = parameters.body;
|
|
460
|
-
if (
|
|
461
|
-
!bodyParameters ||
|
|
462
|
-
!bodyParameters?.body ||
|
|
463
|
-
!bodyParameters?.body.length
|
|
464
|
-
) {
|
|
423
|
+
if (!bodyParameters || !bodyParameters?.body || !bodyParameters?.body.length) {
|
|
465
424
|
return [];
|
|
466
425
|
}
|
|
467
426
|
|
|
@@ -486,7 +445,7 @@ function buildBodyParametersDefinition(
|
|
|
486
445
|
isExported: true,
|
|
487
446
|
kind: StructureKind.Interface,
|
|
488
447
|
name: formBodyName,
|
|
489
|
-
properties: propertiesDefinitions
|
|
448
|
+
properties: propertiesDefinitions,
|
|
490
449
|
};
|
|
491
450
|
|
|
492
451
|
return [
|
|
@@ -498,11 +457,11 @@ function buildBodyParametersDefinition(
|
|
|
498
457
|
{
|
|
499
458
|
name: "body",
|
|
500
459
|
type: formBodyName,
|
|
501
|
-
hasQuestionToken: allOptionalParts
|
|
502
|
-
}
|
|
503
|
-
]
|
|
460
|
+
hasQuestionToken: allOptionalParts,
|
|
461
|
+
},
|
|
462
|
+
],
|
|
504
463
|
},
|
|
505
|
-
formBodyInterface
|
|
464
|
+
formBodyInterface,
|
|
506
465
|
];
|
|
507
466
|
} else {
|
|
508
467
|
const firstBody = bodyParameters.body[0];
|
|
@@ -521,29 +480,25 @@ function buildBodyParametersDefinition(
|
|
|
521
480
|
docs: bodySignature.docs,
|
|
522
481
|
name: "body",
|
|
523
482
|
type: bodySignature.type,
|
|
524
|
-
hasQuestionToken: bodySignature.hasQuestionToken
|
|
525
|
-
}
|
|
526
|
-
]
|
|
527
|
-
}
|
|
483
|
+
hasQuestionToken: bodySignature.hasQuestionToken,
|
|
484
|
+
},
|
|
485
|
+
],
|
|
486
|
+
},
|
|
528
487
|
];
|
|
529
488
|
}
|
|
530
489
|
}
|
|
531
490
|
|
|
532
491
|
export function buildBodyTypeAlias(
|
|
533
492
|
parameters: ParameterMetadatas,
|
|
534
|
-
partialBodyTypeNames: Set<string
|
|
493
|
+
partialBodyTypeNames: Set<string>,
|
|
535
494
|
) {
|
|
536
495
|
const bodyParameters = parameters.body;
|
|
537
|
-
if (
|
|
538
|
-
!bodyParameters ||
|
|
539
|
-
!bodyParameters?.body ||
|
|
540
|
-
!bodyParameters?.body.length
|
|
541
|
-
) {
|
|
496
|
+
if (!bodyParameters || !bodyParameters?.body || !bodyParameters?.body.length) {
|
|
542
497
|
return undefined;
|
|
543
498
|
}
|
|
544
499
|
const schema = bodyParameters.body[0] as ObjectSchema;
|
|
545
500
|
const headerParameters = (parameters.parameters || []).filter(
|
|
546
|
-
(p) => p.type === "header" && p.name === "contentType"
|
|
501
|
+
(p) => p.type === "header" && p.name === "contentType",
|
|
547
502
|
);
|
|
548
503
|
if (!headerParameters.length || headerParameters.length > 1) {
|
|
549
504
|
return undefined;
|
|
@@ -568,7 +523,7 @@ export function buildBodyTypeAlias(
|
|
|
568
523
|
...(description && { docs: [{ description }] }),
|
|
569
524
|
name: `${typeName}`,
|
|
570
525
|
type,
|
|
571
|
-
isExported: true
|
|
526
|
+
isExported: true,
|
|
572
527
|
};
|
|
573
528
|
}
|
|
574
529
|
return undefined;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { OPERATION_LRO_HIGH_PRIORITY, RLCModel } from "./interfaces.js";
|
|
2
1
|
import * as path from "path";
|
|
2
|
+
import { OPERATION_LRO_HIGH_PRIORITY, 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";
|
|
@@ -29,7 +29,7 @@ export function buildPollingHelper(model: RLCModel) {
|
|
|
29
29
|
const { srcPath } = model;
|
|
30
30
|
return {
|
|
31
31
|
path: path.join(srcPath, "pollingHelper.ts"),
|
|
32
|
-
content: readmeFileContents(lroDetail)
|
|
32
|
+
content: readmeFileContents(lroDetail),
|
|
33
33
|
};
|
|
34
34
|
}
|
|
35
35
|
|
|
@@ -37,7 +37,7 @@ function buildLroHelperDetail(model: RLCModel): LroDetail {
|
|
|
37
37
|
if (!model.helperDetails?.clientLroOverload) {
|
|
38
38
|
return {
|
|
39
39
|
clientOverload: false,
|
|
40
|
-
isEsm: model.options?.moduleKind === "esm"
|
|
40
|
+
isEsm: model.options?.moduleKind === "esm",
|
|
41
41
|
};
|
|
42
42
|
}
|
|
43
43
|
const mapDetail = [];
|
|
@@ -52,11 +52,11 @@ function buildLroHelperDetail(model: RLCModel): LroDetail {
|
|
|
52
52
|
const lroDetail = firstMethod.operationHelperDetail?.lroDetails;
|
|
53
53
|
if (lroDetail?.isLongRunning) {
|
|
54
54
|
const initialResponses = firstMethod.responseTypes.success.concat(
|
|
55
|
-
firstMethod.responseTypes.error
|
|
55
|
+
firstMethod.responseTypes.error,
|
|
56
56
|
);
|
|
57
57
|
|
|
58
58
|
const finalResponse = lroDetail.logicalResponseTypes?.success.concat(
|
|
59
|
-
firstMethod.responseTypes.error
|
|
59
|
+
firstMethod.responseTypes.error,
|
|
60
60
|
);
|
|
61
61
|
|
|
62
62
|
if (initialResponses && finalResponse) {
|
|
@@ -65,7 +65,7 @@ function buildLroHelperDetail(model: RLCModel): LroDetail {
|
|
|
65
65
|
mapDetail!.push({
|
|
66
66
|
initialResponses: initialResponses.join("|"),
|
|
67
67
|
finalResponses: finalResponse.join("|"),
|
|
68
|
-
precedence: lroDetail.precedence ?? OPERATION_LRO_HIGH_PRIORITY
|
|
68
|
+
precedence: lroDetail.precedence ?? OPERATION_LRO_HIGH_PRIORITY,
|
|
69
69
|
});
|
|
70
70
|
}
|
|
71
71
|
}
|
|
@@ -78,6 +78,6 @@ function buildLroHelperDetail(model: RLCModel): LroDetail {
|
|
|
78
78
|
clientOverload: responses.size > 0 && mapDetail.length > 0,
|
|
79
79
|
importedResponses: Array.from(responses),
|
|
80
80
|
overloadMap: mapDetail,
|
|
81
|
-
isEsm: model.options?.moduleKind === "esm"
|
|
81
|
+
isEsm: model.options?.moduleKind === "esm",
|
|
82
82
|
};
|
|
83
83
|
}
|