@azure-tools/typespec-ts 0.54.0 → 0.54.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -10
- package/README.md +0 -4
- package/dist/src/contextManager.d.ts +5 -5
- package/dist/src/contextManager.d.ts.map +1 -1
- package/dist/src/contextManager.js +3 -3
- package/dist/src/contextManager.js.map +1 -1
- package/dist/src/framework/declaration.d.ts +1 -1
- package/dist/src/framework/declaration.d.ts.map +1 -1
- package/dist/src/framework/declaration.js +2 -4
- package/dist/src/framework/declaration.js.map +1 -1
- package/dist/src/framework/dependency.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.d.ts +1 -1
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +31 -40
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.js +8 -12
- package/dist/src/framework/hooks/sdkTypes.js.map +1 -1
- package/dist/src/framework/hooks/useDependencies.d.ts.map +1 -1
- package/dist/src/framework/hooks/useDependencies.js +1 -1
- package/dist/src/framework/hooks/useDependencies.js.map +1 -1
- package/dist/src/framework/load-static-helpers.d.ts +1 -1
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +17 -31
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/framework/reference.d.ts.map +1 -1
- package/dist/src/framework/reference.js +2 -2
- package/dist/src/framework/reference.js.map +1 -1
- package/dist/src/framework/sample.js +8 -8
- package/dist/src/framework/sample.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +103 -92
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +1 -1
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +140 -140
- package/dist/src/lib.js.map +1 -1
- package/dist/src/metaTree.d.ts +1 -1
- package/dist/src/metaTree.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.js +60 -74
- package/dist/src/modular/buildClassicalClient.js.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.d.ts +2 -2
- package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js +8 -10
- package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
- package/dist/src/modular/buildClientContext.d.ts +2 -2
- package/dist/src/modular/buildClientContext.d.ts.map +1 -1
- package/dist/src/modular/buildClientContext.js +31 -38
- package/dist/src/modular/buildClientContext.js.map +1 -1
- package/dist/src/modular/buildModularOptions.d.ts +1 -1
- package/dist/src/modular/buildModularOptions.d.ts.map +1 -1
- package/dist/src/modular/buildModularOptions.js +5 -6
- package/dist/src/modular/buildModularOptions.js.map +1 -1
- package/dist/src/modular/buildOperations.d.ts +3 -3
- package/dist/src/modular/buildOperations.d.ts.map +1 -1
- package/dist/src/modular/buildOperations.js +23 -25
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts.map +1 -1
- package/dist/src/modular/buildProjectFiles.js +8 -11
- package/dist/src/modular/buildProjectFiles.js.map +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts.map +1 -1
- package/dist/src/modular/buildRestorePoller.js +12 -13
- package/dist/src/modular/buildRestorePoller.js.map +1 -1
- package/dist/src/modular/buildRootIndex.d.ts +2 -2
- package/dist/src/modular/buildRootIndex.d.ts.map +1 -1
- package/dist/src/modular/buildRootIndex.js +36 -50
- package/dist/src/modular/buildRootIndex.js.map +1 -1
- package/dist/src/modular/buildSubpathIndex.d.ts.map +1 -1
- package/dist/src/modular/buildSubpathIndex.js +9 -18
- package/dist/src/modular/buildSubpathIndex.js.map +1 -1
- package/dist/src/modular/emitLoggerFile.d.ts.map +1 -1
- package/dist/src/modular/emitLoggerFile.js +4 -4
- package/dist/src/modular/emitLoggerFile.js.map +1 -1
- package/dist/src/modular/emitModels.d.ts +1 -1
- package/dist/src/modular/emitModels.d.ts.map +1 -1
- package/dist/src/modular/emitModels.js +81 -113
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts.map +1 -1
- package/dist/src/modular/emitModelsOptions.js +7 -8
- package/dist/src/modular/emitModelsOptions.js.map +1 -1
- package/dist/src/modular/emitSamples.d.ts.map +1 -1
- package/dist/src/modular/emitSamples.js +69 -77
- package/dist/src/modular/emitSamples.js.map +1 -1
- package/dist/src/modular/emitTests.d.ts.map +1 -1
- package/dist/src/modular/emitTests.js +13 -18
- package/dist/src/modular/emitTests.js.map +1 -1
- package/dist/src/modular/external-dependencies.js +54 -54
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js +59 -68
- package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.js +31 -54
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.js +72 -84
- package/dist/src/modular/helpers/exampleValueHelpers.js.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.js +7 -10
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +204 -288
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.js +4 -6
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.js +58 -67
- package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js +65 -75
- package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js +73 -90
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.d.ts.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.js +25 -33
- package/dist/src/modular/serialization/serializeUtils.js.map +1 -1
- package/dist/src/modular/static-helpers-metadata.js +60 -60
- package/dist/src/modular/type-expressions/get-credential-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-credential-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.js +1 -2
- package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.js +10 -13
- package/dist/src/modular/type-expressions/get-model-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.js +2 -3
- package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.js +5 -11
- package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
- package/dist/src/rlc-common/buildClient.d.ts +1 -1
- package/dist/src/rlc-common/buildClient.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClient.js +67 -89
- package/dist/src/rlc-common/buildClient.js.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.js +28 -45
- package/dist/src/rlc-common/buildClientDefinitions.js.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.js +59 -60
- package/dist/src/rlc-common/buildIndexFile.js.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js +37 -38
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +1 -1
- package/dist/src/rlc-common/buildLogger.d.ts.map +1 -1
- package/dist/src/rlc-common/buildLogger.js +4 -5
- package/dist/src/rlc-common/buildLogger.js.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.js +4 -4
- package/dist/src/rlc-common/buildMethodShortcuts.js.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.js +57 -96
- package/dist/src/rlc-common/buildObjectTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.js +2 -2
- package/dist/src/rlc-common/buildPaginateHelper.js.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.js +71 -61
- package/dist/src/rlc-common/buildParameterTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.js +9 -10
- package/dist/src/rlc-common/buildPollingHelper.js.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.js +23 -27
- package/dist/src/rlc-common/buildResponseTypes.js.map +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSamples.js +2 -2
- package/dist/src/rlc-common/buildSchemaType.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSchemaType.js +31 -13
- package/dist/src/rlc-common/buildSchemaType.js.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.js +4 -4
- package/dist/src/rlc-common/buildSerializeHelper.js.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.js +9 -13
- package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.js +6 -8
- package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.js +32 -37
- package/dist/src/rlc-common/helpers/importsUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.js +2 -4
- package/dist/src/rlc-common/helpers/nameConstructors.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.js +17 -23
- package/dist/src/rlc-common/helpers/nameUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.js +16 -31
- package/dist/src/rlc-common/helpers/operationHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/packageUtil.js +3 -6
- package/dist/src/rlc-common/helpers/packageUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.js +1 -3
- package/dist/src/rlc-common/helpers/pathUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.js +3 -7
- package/dist/src/rlc-common/helpers/schemaHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.js +2 -2
- package/dist/src/rlc-common/helpers/shortcutMethods.js.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.js +4 -9
- package/dist/src/rlc-common/helpers/typeUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js +7 -11
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +1 -1
- package/dist/src/rlc-common/index.d.ts +28 -28
- package/dist/src/rlc-common/index.d.ts.map +1 -1
- package/dist/src/rlc-common/index.js +28 -28
- package/dist/src/rlc-common/index.js.map +1 -1
- package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
- package/dist/src/rlc-common/interfaces.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +14 -15
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildChangelogFile.js +2 -3
- package/dist/src/rlc-common/metadata/buildChangelogFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.js +5 -8
- package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildLicenseFile.js +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.js +33 -37
- package/dist/src/rlc-common/metadata/buildPackageFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.js +31 -39
- package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.js +4 -6
- package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +3 -5
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTestConfig.js +11 -12
- package/dist/src/rlc-common/metadata/buildTestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.js +28 -28
- package/dist/src/rlc-common/metadata/buildTsConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.js +3 -5
- package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.js +4 -5
- package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +14 -14
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +24 -29
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +15 -16
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +8 -8
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +28 -31
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/utils.js +1 -2
- package/dist/src/rlc-common/metadata/utils.js.map +1 -1
- package/dist/src/rlc-common/test/buildKarmaConfig.js +1 -1
- package/dist/src/rlc-common/test/buildRecordedClient.js +4 -5
- package/dist/src/rlc-common/test/buildRecordedClient.js.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.js +3 -4
- package/dist/src/rlc-common/test/buildSampleTest.js.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.js +7 -10
- package/dist/src/rlc-common/test/buildSnippets.js.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.d.ts.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.js +41 -45
- package/dist/src/rlc-common/transformSampleGroups.js.map +1 -1
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +1 -1
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/transform/transform.d.ts +1 -1
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/transform/transform.js +28 -27
- package/dist/src/transform/transform.js.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.js +12 -14
- package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.js +11 -14
- package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -1
- package/dist/src/transform/transformParameters.d.ts +2 -2
- package/dist/src/transform/transformParameters.d.ts.map +1 -1
- package/dist/src/transform/transformParameters.js +32 -45
- package/dist/src/transform/transformParameters.js.map +1 -1
- package/dist/src/transform/transformPaths.d.ts +1 -1
- package/dist/src/transform/transformPaths.d.ts.map +1 -1
- package/dist/src/transform/transformPaths.js +19 -23
- package/dist/src/transform/transformPaths.js.map +1 -1
- package/dist/src/transform/transformResponses.d.ts +1 -1
- package/dist/src/transform/transformResponses.d.ts.map +1 -1
- package/dist/src/transform/transformResponses.js +21 -25
- package/dist/src/transform/transformResponses.js.map +1 -1
- package/dist/src/transform/transformSchemas.d.ts.map +1 -1
- package/dist/src/transform/transformSchemas.js +21 -32
- package/dist/src/transform/transformSchemas.js.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.js +3 -3
- package/dist/src/transform/transformTelemetryInfo.js.map +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
- package/dist/src/transform/transfromRLCOptions.js +28 -39
- package/dist/src/transform/transfromRLCOptions.js.map +1 -1
- package/dist/src/utils/clientUtils.d.ts +1 -1
- package/dist/src/utils/clientUtils.d.ts.map +1 -1
- package/dist/src/utils/clientUtils.js +15 -23
- package/dist/src/utils/clientUtils.js.map +1 -1
- package/dist/src/utils/credentialUtils.d.ts +1 -1
- package/dist/src/utils/credentialUtils.d.ts.map +1 -1
- package/dist/src/utils/credentialUtils.js +4 -5
- package/dist/src/utils/credentialUtils.js.map +1 -1
- package/dist/src/utils/crossLanguageDef.d.ts.map +1 -1
- package/dist/src/utils/crossLanguageDef.js +11 -15
- package/dist/src/utils/crossLanguageDef.js.map +1 -1
- package/dist/src/utils/emitUtil.d.ts +1 -1
- package/dist/src/utils/emitUtil.d.ts.map +1 -1
- package/dist/src/utils/emitUtil.js +5 -7
- package/dist/src/utils/emitUtil.js.map +1 -1
- package/dist/src/utils/fileSystemUtils.d.ts +2 -0
- package/dist/src/utils/fileSystemUtils.d.ts.map +1 -1
- package/dist/src/utils/fileSystemUtils.js +26 -7
- package/dist/src/utils/fileSystemUtils.js.map +1 -1
- package/dist/src/utils/importHelper.d.ts.map +1 -1
- package/dist/src/utils/importHelper.js +3 -6
- package/dist/src/utils/importHelper.js.map +1 -1
- package/dist/src/utils/interfaces.d.ts +1 -1
- package/dist/src/utils/interfaces.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.js +7 -19
- package/dist/src/utils/mediaTypes.js.map +1 -1
- package/dist/src/utils/modelUtils.d.ts +5 -5
- package/dist/src/utils/modelUtils.d.ts.map +1 -1
- package/dist/src/utils/modelUtils.js +168 -257
- package/dist/src/utils/modelUtils.js.map +1 -1
- package/dist/src/utils/namespaceUtils.d.ts.map +1 -1
- package/dist/src/utils/namespaceUtils.js +6 -7
- package/dist/src/utils/namespaceUtils.js.map +1 -1
- package/dist/src/utils/operationUtil.d.ts +1 -1
- package/dist/src/utils/operationUtil.d.ts.map +1 -1
- package/dist/src/utils/operationUtil.js +60 -81
- package/dist/src/utils/operationUtil.js.map +1 -1
- package/dist/src/utils/parameterUtils.d.ts +1 -1
- package/dist/src/utils/parameterUtils.d.ts.map +1 -1
- package/dist/src/utils/parameterUtils.js +26 -33
- package/dist/src/utils/parameterUtils.js.map +1 -1
- package/dist/src/utils/resolve-project-root.js +2 -2
- package/dist/src/utils/resolve-project-root.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +36 -43
- package/src/contextManager.ts +6 -9
- package/src/framework/declaration.ts +18 -28
- package/src/framework/dependency.ts +1 -2
- package/src/framework/hooks/binder.ts +47 -120
- package/src/framework/hooks/sdkTypes.ts +27 -54
- package/src/framework/hooks/useDependencies.ts +2 -4
- package/src/framework/load-static-helpers.ts +28 -51
- package/src/framework/reference.ts +2 -5
- package/src/framework/sample.ts +9 -9
- package/src/index.ts +145 -185
- package/src/lib.ts +143 -158
- package/src/metaTree.ts +1 -1
- package/src/modular/buildClassicalClient.ts +83 -160
- package/src/modular/buildClassicalOperationGroups.ts +14 -39
- package/src/modular/buildClientContext.ts +54 -83
- package/src/modular/buildModularOptions.ts +4 -5
- package/src/modular/buildOperations.ts +46 -73
- package/src/modular/buildProjectFiles.ts +18 -47
- package/src/modular/buildRestorePoller.ts +27 -46
- package/src/modular/buildRootIndex.ts +86 -160
- package/src/modular/buildSubpathIndex.ts +35 -58
- package/src/modular/emitLoggerFile.ts +4 -9
- package/src/modular/emitModels.ts +136 -266
- package/src/modular/emitModelsOptions.ts +10 -16
- package/src/modular/emitSamples.ts +92 -180
- package/src/modular/emitTests.ts +28 -61
- package/src/modular/external-dependencies.ts +54 -54
- package/src/modular/helpers/classicalOperationHelpers.ts +73 -126
- package/src/modular/helpers/clientHelpers.ts +41 -88
- package/src/modular/helpers/clientOptionHelpers.ts +4 -11
- package/src/modular/helpers/exampleValueHelpers.ts +99 -215
- package/src/modular/helpers/namingHelpers.ts +12 -28
- package/src/modular/helpers/operationHelpers.ts +430 -757
- package/src/modular/helpers/typeHelpers.ts +11 -22
- package/src/modular/serialization/buildDeserializerFunction.ts +88 -122
- package/src/modular/serialization/buildSerializerFunction.ts +91 -129
- package/src/modular/serialization/buildXmlSerializerFunction.ts +104 -183
- package/src/modular/serialization/serializeUtils.ts +12 -22
- package/src/modular/static/rollup.test.config.js +11 -14
- package/src/modular/static/scripts/renameOutput.mjs +2 -2
- package/src/modular/static-helpers-metadata.ts +60 -60
- package/src/modular/type-expressions/get-credential-expression.ts +1 -1
- package/src/modular/type-expressions/get-enum-expression.ts +5 -10
- package/src/modular/type-expressions/get-model-expression.ts +13 -17
- package/src/modular/type-expressions/get-nullable-expression.ts +4 -5
- package/src/modular/type-expressions/get-type-expression.ts +8 -12
- package/src/modular/type-expressions/get-union-expression.ts +4 -4
- package/src/modular/type-expressions/utils.ts +1 -1
- package/src/rlc-common/buildClient.ts +70 -141
- package/src/rlc-common/buildClientDefinitions.ts +44 -87
- package/src/rlc-common/buildIndexFile.ts +78 -78
- package/src/rlc-common/buildIsUnexpectedHelper.ts +34 -41
- package/src/rlc-common/buildLogger.ts +7 -7
- package/src/rlc-common/buildMethodShortcuts.ts +9 -21
- package/src/rlc-common/buildObjectTypes.ts +79 -156
- package/src/rlc-common/buildPaginateHelper.ts +9 -12
- package/src/rlc-common/buildParameterTypes.ts +116 -137
- package/src/rlc-common/buildPollingHelper.ts +7 -7
- package/src/rlc-common/buildResponseTypes.ts +34 -57
- package/src/rlc-common/buildSamples.ts +3 -3
- package/src/rlc-common/buildSchemaType.ts +37 -29
- package/src/rlc-common/buildSerializeHelper.ts +5 -5
- package/src/rlc-common/buildTopLevelIndexFile.ts +12 -19
- package/src/rlc-common/helpers/apiVersionUtil.ts +5 -10
- package/src/rlc-common/helpers/importsUtil.ts +27 -30
- package/src/rlc-common/helpers/nameConstructors.ts +16 -50
- package/src/rlc-common/helpers/nameUtils.ts +19 -42
- package/src/rlc-common/helpers/operationHelpers.ts +14 -31
- package/src/rlc-common/helpers/pathUtils.ts +2 -7
- package/src/rlc-common/helpers/schemaHelpers.ts +4 -15
- package/src/rlc-common/helpers/shortcutMethods.ts +6 -15
- package/src/rlc-common/helpers/typeUtil.ts +4 -11
- package/src/rlc-common/helpers/valueGenerationUtil.ts +16 -39
- package/src/rlc-common/index.ts +28 -28
- package/src/rlc-common/interfaces.ts +3 -11
- package/src/rlc-common/metadata/buildApiExtractorConfig.ts +17 -24
- package/src/rlc-common/metadata/buildChangelogFile.ts +1 -1
- package/src/rlc-common/metadata/buildESLintConfig.ts +3 -5
- package/src/rlc-common/metadata/buildLicenseFile.ts +1 -1
- package/src/rlc-common/metadata/buildPackageFile.ts +27 -35
- package/src/rlc-common/metadata/buildReadmeFile.ts +16 -29
- package/src/rlc-common/metadata/buildRollupConfig.ts +5 -8
- package/src/rlc-common/metadata/buildSampleEnvFile.ts +2 -3
- package/src/rlc-common/metadata/buildTestConfig.ts +10 -10
- package/src/rlc-common/metadata/buildTsConfig.ts +32 -35
- package/src/rlc-common/metadata/buildVitestConfig.ts +4 -10
- package/src/rlc-common/metadata/buildWarpConfig.ts +3 -6
- package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +16 -25
- package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +29 -50
- package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +20 -31
- package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +11 -13
- package/src/rlc-common/metadata/packageJson/packageCommon.ts +32 -52
- package/src/rlc-common/test/buildKarmaConfig.ts +1 -1
- package/src/rlc-common/test/buildRecordedClient.ts +3 -3
- package/src/rlc-common/test/buildSampleTest.ts +3 -3
- package/src/rlc-common/test/buildSnippets.ts +6 -12
- package/src/rlc-common/transformSampleGroups.ts +54 -105
- package/src/testing/index.ts +2 -5
- package/src/transform/transform.ts +22 -34
- package/src/transform/transformApiVersionInfo.ts +17 -30
- package/src/transform/transformHelperFunctionDetails.ts +14 -26
- package/src/transform/transformParameters.ts +55 -105
- package/src/transform/transformPaths.ts +26 -43
- package/src/transform/transformResponses.ts +26 -33
- package/src/transform/transformSchemas.ts +15 -33
- package/src/transform/transformTelemetryInfo.ts +8 -14
- package/src/transform/transfromRLCOptions.ts +53 -116
- package/src/utils/clientUtils.ts +22 -41
- package/src/utils/credentialUtils.ts +8 -19
- package/src/utils/crossLanguageDef.ts +15 -34
- package/src/utils/emitUtil.ts +11 -17
- package/src/utils/fileSystemUtils.ts +30 -8
- package/src/utils/importHelper.ts +5 -10
- package/src/utils/interfaces.ts +1 -1
- package/src/utils/mediaTypes.ts +13 -34
- package/src/utils/modelUtils.ts +175 -384
- package/src/utils/namespaceUtils.ts +8 -24
- package/src/utils/operationUtil.ts +98 -190
- package/src/utils/parameterUtils.ts +31 -54
- package/src/utils/resolve-project-root.ts +3 -3
- package/static/static-helpers/cloudSettingHelpers.ts +4 -6
- package/static/static-helpers/multipartHelpers.ts +3 -3
- package/static/static-helpers/pagingHelpers.ts +28 -63
- package/static/static-helpers/pollingHelpers.ts +16 -29
- package/static/static-helpers/serialization/build-multi-collection.ts +1 -4
- package/static/static-helpers/serialization/check-prop-undefined.ts +1 -4
- package/static/static-helpers/serialization/get-binary-response-browser.mts +3 -1
- package/static/static-helpers/serialization/get-binary-response.ts +2 -2
- package/static/static-helpers/serialization/get-binary-stream-response-browser.mts +1 -3
- package/static/static-helpers/serialization/get-binary-stream-response.ts +2 -4
- package/static/static-helpers/serialization/serialize-record.ts +1 -1
- package/static/static-helpers/serialization/serializers.ts +4 -7
- package/static/static-helpers/serialization/xml-helpers.ts +42 -90
- package/static/static-helpers/simplePollerHelpers.ts +10 -19
- package/static/static-helpers/storageCompatResponse.ts +10 -27
- package/static/static-helpers/urlTemplate.ts +4 -7
- package/static/test-helpers/recordedClient.ts +5 -10
|
@@ -1,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,54 @@ 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
|
+
},
|
|
170
|
+
]);
|
|
171
|
+
}
|
|
172
|
+
// Add NodeReadableStream import if binary types are used in parameters.
|
|
173
|
+
// platform-types.ts is generated directly under src/ (no static-helpers/
|
|
174
|
+
// subdirectory) to match the RLC design where all output lives in src/.
|
|
175
|
+
// The platform-types static helper resolves NodeReadableStream to
|
|
176
|
+
// NodeJS.ReadableStream on Node and `never` on browser/react-native, so the
|
|
177
|
+
// union arm drops out naturally in non-Node builds.
|
|
178
|
+
if (parametersFile.getFullText().includes("NodeReadableStream")) {
|
|
179
|
+
const platformTypesModuleSpecifier = model.options?.azureSdkForJs
|
|
180
|
+
? "#platform/platform-types"
|
|
181
|
+
: getImportModuleName(
|
|
182
|
+
{
|
|
183
|
+
cjsName: `./platform-types`,
|
|
184
|
+
esModulesName: `./platform-types.js`,
|
|
185
|
+
},
|
|
186
|
+
model,
|
|
187
|
+
);
|
|
188
|
+
parametersFile.addImportDeclarations([
|
|
189
|
+
{
|
|
190
|
+
isTypeOnly: true,
|
|
191
|
+
namedImports: ["NodeReadableStream"],
|
|
192
|
+
moduleSpecifier: platformTypesModuleSpecifier,
|
|
193
|
+
},
|
|
185
194
|
]);
|
|
186
195
|
}
|
|
187
196
|
return { path: filePath, content: parametersFile.getFullText() };
|
|
@@ -192,11 +201,9 @@ function buildQueryParameterDefinition(
|
|
|
192
201
|
parameters: ParameterMetadatas,
|
|
193
202
|
baseName: string,
|
|
194
203
|
internalReferences: Set<string>,
|
|
195
|
-
requestIndex: number
|
|
204
|
+
requestIndex: number,
|
|
196
205
|
): InterfaceDeclarationStructure[] | undefined {
|
|
197
|
-
const queryParameters = (parameters?.parameters || []).filter(
|
|
198
|
-
(p) => p.type === "query"
|
|
199
|
-
);
|
|
206
|
+
const queryParameters = (parameters?.parameters || []).filter((p) => p.type === "query");
|
|
200
207
|
|
|
201
208
|
if (!queryParameters.length) {
|
|
202
209
|
return undefined;
|
|
@@ -207,31 +214,25 @@ function buildQueryParameterDefinition(
|
|
|
207
214
|
const queryParameterPropertiesName = `${baseName}QueryParamProperties`;
|
|
208
215
|
|
|
209
216
|
// Get the property signature for each query parameter
|
|
210
|
-
const propertiesDefinition = queryParameters.map((qp) =>
|
|
211
|
-
getPropertyFromSchema(qp.param)
|
|
212
|
-
);
|
|
217
|
+
const propertiesDefinition = queryParameters.map((qp) => getPropertyFromSchema(qp.param));
|
|
213
218
|
// Get wrapper types for query parameters
|
|
214
|
-
const wrapperTypesDefinition = getGeneratedWrapperTypes(queryParameters).map(
|
|
215
|
-
(
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
}
|
|
224
|
-
);
|
|
219
|
+
const wrapperTypesDefinition = getGeneratedWrapperTypes(queryParameters).map((wrapObj) => {
|
|
220
|
+
return getObjectInterfaceDeclaration(
|
|
221
|
+
model,
|
|
222
|
+
wrapObj.name,
|
|
223
|
+
wrapObj,
|
|
224
|
+
[SchemaContext.Input],
|
|
225
|
+
new Set<string>(),
|
|
226
|
+
);
|
|
227
|
+
});
|
|
225
228
|
|
|
226
|
-
const hasRequiredParameters = propertiesDefinition.some(
|
|
227
|
-
(p) => !p.hasQuestionToken
|
|
228
|
-
);
|
|
229
|
+
const hasRequiredParameters = propertiesDefinition.some((p) => !p.hasQuestionToken);
|
|
229
230
|
|
|
230
231
|
const propertiesInterface: InterfaceDeclarationStructure = {
|
|
231
232
|
kind: StructureKind.Interface,
|
|
232
233
|
isExported: true,
|
|
233
234
|
name: queryParameterPropertiesName,
|
|
234
|
-
properties: propertiesDefinition
|
|
235
|
+
properties: propertiesDefinition,
|
|
235
236
|
};
|
|
236
237
|
|
|
237
238
|
const parameterInterface: InterfaceDeclarationStructure = {
|
|
@@ -243,9 +244,9 @@ function buildQueryParameterDefinition(
|
|
|
243
244
|
name: "queryParameters",
|
|
244
245
|
type: queryParameterPropertiesName,
|
|
245
246
|
// Mark as optional if there are no required parameters
|
|
246
|
-
hasQuestionToken: !hasRequiredParameters
|
|
247
|
-
}
|
|
248
|
-
]
|
|
247
|
+
hasQuestionToken: !hasRequiredParameters,
|
|
248
|
+
},
|
|
249
|
+
],
|
|
249
250
|
};
|
|
250
251
|
|
|
251
252
|
// Mark the queryParameter interface for importing
|
|
@@ -261,7 +262,7 @@ function getPropertyFromSchema(schema: Schema): PropertySignatureStructure {
|
|
|
261
262
|
...(description && { docs: [{ description }] }),
|
|
262
263
|
type: schema.type,
|
|
263
264
|
hasQuestionToken: !schema.required,
|
|
264
|
-
kind: StructureKind.PropertySignature
|
|
265
|
+
kind: StructureKind.PropertySignature,
|
|
265
266
|
};
|
|
266
267
|
}
|
|
267
268
|
|
|
@@ -271,11 +272,9 @@ function buildPathParameterDefinitions(
|
|
|
271
272
|
baseName: string,
|
|
272
273
|
parametersFile: SourceFile,
|
|
273
274
|
internalReferences: Set<string>,
|
|
274
|
-
requestIndex: number
|
|
275
|
+
requestIndex: number,
|
|
275
276
|
): InterfaceDeclarationStructure[] | undefined {
|
|
276
|
-
const pathParameters = (parameters.parameters || []).filter(
|
|
277
|
-
(p) => p.type === "path"
|
|
278
|
-
);
|
|
277
|
+
const pathParameters = (parameters.parameters || []).filter((p) => p.type === "path");
|
|
279
278
|
if (!pathParameters.length) {
|
|
280
279
|
return undefined;
|
|
281
280
|
}
|
|
@@ -293,10 +292,7 @@ function buildPathParameterDefinitions(
|
|
|
293
292
|
const nameSuffix = requestIndex > 0 ? `${requestIndex}` : "";
|
|
294
293
|
const pathParameterInterfaceName = `${baseName}PathParam${nameSuffix}`;
|
|
295
294
|
|
|
296
|
-
const pathInterface = getPathInterfaceDefinition(
|
|
297
|
-
clientPathParams,
|
|
298
|
-
baseName
|
|
299
|
-
);
|
|
295
|
+
const pathInterface = getPathInterfaceDefinition(clientPathParams, baseName);
|
|
300
296
|
|
|
301
297
|
if (pathInterface) {
|
|
302
298
|
parametersFile.addInterface(pathInterface);
|
|
@@ -312,9 +308,9 @@ function buildPathParameterDefinitions(
|
|
|
312
308
|
{
|
|
313
309
|
name: "pathParameters",
|
|
314
310
|
type: `${baseName}PathParameters`,
|
|
315
|
-
kind: StructureKind.PropertySignature
|
|
316
|
-
}
|
|
317
|
-
]
|
|
311
|
+
kind: StructureKind.PropertySignature,
|
|
312
|
+
},
|
|
313
|
+
],
|
|
318
314
|
});
|
|
319
315
|
}
|
|
320
316
|
|
|
@@ -326,15 +322,13 @@ function buildPathParameterDefinitions(
|
|
|
326
322
|
const methodPathParams = pathParameters.length > 0 ? pathParameters : [];
|
|
327
323
|
|
|
328
324
|
// we only need to build the wrapper types if the path parameters are objects
|
|
329
|
-
const wrapperTypesDefinition = getGeneratedWrapperTypes(
|
|
330
|
-
methodPathParams
|
|
331
|
-
).map((wrap) => {
|
|
325
|
+
const wrapperTypesDefinition = getGeneratedWrapperTypes(methodPathParams).map((wrap) => {
|
|
332
326
|
return getObjectInterfaceDeclaration(
|
|
333
327
|
model,
|
|
334
328
|
wrap.name,
|
|
335
329
|
wrap,
|
|
336
330
|
[SchemaContext.Input],
|
|
337
|
-
new Set<string>()
|
|
331
|
+
new Set<string>(),
|
|
338
332
|
);
|
|
339
333
|
});
|
|
340
334
|
allDefinitions.push(...wrapperTypesDefinition);
|
|
@@ -343,16 +337,14 @@ function buildPathParameterDefinitions(
|
|
|
343
337
|
|
|
344
338
|
function getPathInterfaceDefinition(
|
|
345
339
|
pathParameters: ParameterMetadata[],
|
|
346
|
-
baseName: string
|
|
340
|
+
baseName: string,
|
|
347
341
|
): undefined | InterfaceDeclarationStructure {
|
|
348
342
|
const pathInterfaceName = `${baseName}PathParameters`;
|
|
349
343
|
return {
|
|
350
344
|
kind: StructureKind.Interface,
|
|
351
345
|
isExported: true,
|
|
352
346
|
name: pathInterfaceName,
|
|
353
|
-
properties: pathParameters.map((p: ParameterMetadata) =>
|
|
354
|
-
getPropertyFromSchema(p.param)
|
|
355
|
-
)
|
|
347
|
+
properties: pathParameters.map((p: ParameterMetadata) => getPropertyFromSchema(p.param)),
|
|
356
348
|
};
|
|
357
349
|
}
|
|
358
350
|
|
|
@@ -361,10 +353,10 @@ function buildHeaderParameterDefinitions(
|
|
|
361
353
|
baseName: string,
|
|
362
354
|
parametersFile: SourceFile,
|
|
363
355
|
internalReferences: Set<string>,
|
|
364
|
-
requestIndex: number
|
|
356
|
+
requestIndex: number,
|
|
365
357
|
): InterfaceDeclarationStructure | undefined {
|
|
366
358
|
const headerParameters = (parameters.parameters || []).filter(
|
|
367
|
-
(p) => p.type === "header" && p.name !== "contentType"
|
|
359
|
+
(p) => p.type === "header" && p.name !== "contentType",
|
|
368
360
|
);
|
|
369
361
|
if (!headerParameters.length) {
|
|
370
362
|
return undefined;
|
|
@@ -373,16 +365,13 @@ function buildHeaderParameterDefinitions(
|
|
|
373
365
|
const nameSuffix = requestIndex > 0 ? `${requestIndex}` : "";
|
|
374
366
|
const headerParameterInterfaceName = `${baseName}HeaderParam${nameSuffix}`;
|
|
375
367
|
|
|
376
|
-
const headersInterface = getRequestHeaderInterfaceDefinition(
|
|
377
|
-
headerParameters,
|
|
378
|
-
baseName
|
|
379
|
-
);
|
|
368
|
+
const headersInterface = getRequestHeaderInterfaceDefinition(headerParameters, baseName);
|
|
380
369
|
|
|
381
370
|
let isOptional = true;
|
|
382
371
|
if (headersInterface) {
|
|
383
372
|
parametersFile.addInterface(headersInterface);
|
|
384
373
|
isOptional = !(headersInterface.properties || []).some(
|
|
385
|
-
(prop) => prop.hasQuestionToken === false
|
|
374
|
+
(prop) => prop.hasQuestionToken === false,
|
|
386
375
|
);
|
|
387
376
|
}
|
|
388
377
|
|
|
@@ -397,24 +386,22 @@ function buildHeaderParameterDefinitions(
|
|
|
397
386
|
name: "headers",
|
|
398
387
|
type: `RawHttpHeadersInput & ${baseName}Headers`,
|
|
399
388
|
kind: StructureKind.PropertySignature,
|
|
400
|
-
hasQuestionToken: isOptional
|
|
401
|
-
}
|
|
402
|
-
]
|
|
389
|
+
hasQuestionToken: isOptional,
|
|
390
|
+
},
|
|
391
|
+
],
|
|
403
392
|
};
|
|
404
393
|
}
|
|
405
394
|
|
|
406
395
|
function getRequestHeaderInterfaceDefinition(
|
|
407
396
|
headerParameters: ParameterMetadata[],
|
|
408
|
-
baseName: string
|
|
397
|
+
baseName: string,
|
|
409
398
|
): undefined | InterfaceDeclarationStructure {
|
|
410
399
|
const headersInterfaceName = `${baseName}Headers`;
|
|
411
400
|
return {
|
|
412
401
|
kind: StructureKind.Interface,
|
|
413
402
|
isExported: true,
|
|
414
403
|
name: headersInterfaceName,
|
|
415
|
-
properties: headerParameters.map((h: ParameterMetadata) =>
|
|
416
|
-
getPropertyFromSchema(h.param)
|
|
417
|
-
)
|
|
404
|
+
properties: headerParameters.map((h: ParameterMetadata) => getPropertyFromSchema(h.param)),
|
|
418
405
|
};
|
|
419
406
|
}
|
|
420
407
|
|
|
@@ -422,10 +409,10 @@ function buildContentTypeParametersDefinition(
|
|
|
422
409
|
parameters: ParameterMetadatas,
|
|
423
410
|
baseName: string,
|
|
424
411
|
internalReferences: Set<string>,
|
|
425
|
-
requestIndex: number
|
|
412
|
+
requestIndex: number,
|
|
426
413
|
): InterfaceDeclarationStructure | undefined {
|
|
427
414
|
const mediaTypeParameters = (parameters.parameters || []).filter(
|
|
428
|
-
(p) => p.type === "header" && p.name === "contentType"
|
|
415
|
+
(p) => p.type === "header" && p.name === "contentType",
|
|
429
416
|
);
|
|
430
417
|
if (!mediaTypeParameters.length) {
|
|
431
418
|
return undefined;
|
|
@@ -446,7 +433,7 @@ function buildContentTypeParametersDefinition(
|
|
|
446
433
|
isExported: true,
|
|
447
434
|
kind: StructureKind.Interface,
|
|
448
435
|
name: mediaTypesParameterInterfaceName,
|
|
449
|
-
properties: [getPropertyFromSchema(mediaParam)]
|
|
436
|
+
properties: [getPropertyFromSchema(mediaParam)],
|
|
450
437
|
};
|
|
451
438
|
}
|
|
452
439
|
|
|
@@ -454,14 +441,10 @@ function buildBodyParametersDefinition(
|
|
|
454
441
|
parameters: ParameterMetadatas,
|
|
455
442
|
baseName: string,
|
|
456
443
|
internalReferences: Set<string>,
|
|
457
|
-
requestIndex: number
|
|
444
|
+
requestIndex: number,
|
|
458
445
|
): InterfaceDeclarationStructure[] {
|
|
459
446
|
const bodyParameters = parameters.body;
|
|
460
|
-
if (
|
|
461
|
-
!bodyParameters ||
|
|
462
|
-
!bodyParameters?.body ||
|
|
463
|
-
!bodyParameters?.body.length
|
|
464
|
-
) {
|
|
447
|
+
if (!bodyParameters || !bodyParameters?.body || !bodyParameters?.body.length) {
|
|
465
448
|
return [];
|
|
466
449
|
}
|
|
467
450
|
|
|
@@ -486,7 +469,7 @@ function buildBodyParametersDefinition(
|
|
|
486
469
|
isExported: true,
|
|
487
470
|
kind: StructureKind.Interface,
|
|
488
471
|
name: formBodyName,
|
|
489
|
-
properties: propertiesDefinitions
|
|
472
|
+
properties: propertiesDefinitions,
|
|
490
473
|
};
|
|
491
474
|
|
|
492
475
|
return [
|
|
@@ -498,11 +481,11 @@ function buildBodyParametersDefinition(
|
|
|
498
481
|
{
|
|
499
482
|
name: "body",
|
|
500
483
|
type: formBodyName,
|
|
501
|
-
hasQuestionToken: allOptionalParts
|
|
502
|
-
}
|
|
503
|
-
]
|
|
484
|
+
hasQuestionToken: allOptionalParts,
|
|
485
|
+
},
|
|
486
|
+
],
|
|
504
487
|
},
|
|
505
|
-
formBodyInterface
|
|
488
|
+
formBodyInterface,
|
|
506
489
|
];
|
|
507
490
|
} else {
|
|
508
491
|
const firstBody = bodyParameters.body[0];
|
|
@@ -521,29 +504,25 @@ function buildBodyParametersDefinition(
|
|
|
521
504
|
docs: bodySignature.docs,
|
|
522
505
|
name: "body",
|
|
523
506
|
type: bodySignature.type,
|
|
524
|
-
hasQuestionToken: bodySignature.hasQuestionToken
|
|
525
|
-
}
|
|
526
|
-
]
|
|
527
|
-
}
|
|
507
|
+
hasQuestionToken: bodySignature.hasQuestionToken,
|
|
508
|
+
},
|
|
509
|
+
],
|
|
510
|
+
},
|
|
528
511
|
];
|
|
529
512
|
}
|
|
530
513
|
}
|
|
531
514
|
|
|
532
515
|
export function buildBodyTypeAlias(
|
|
533
516
|
parameters: ParameterMetadatas,
|
|
534
|
-
partialBodyTypeNames: Set<string
|
|
517
|
+
partialBodyTypeNames: Set<string>,
|
|
535
518
|
) {
|
|
536
519
|
const bodyParameters = parameters.body;
|
|
537
|
-
if (
|
|
538
|
-
!bodyParameters ||
|
|
539
|
-
!bodyParameters?.body ||
|
|
540
|
-
!bodyParameters?.body.length
|
|
541
|
-
) {
|
|
520
|
+
if (!bodyParameters || !bodyParameters?.body || !bodyParameters?.body.length) {
|
|
542
521
|
return undefined;
|
|
543
522
|
}
|
|
544
523
|
const schema = bodyParameters.body[0] as ObjectSchema;
|
|
545
524
|
const headerParameters = (parameters.parameters || []).filter(
|
|
546
|
-
(p) => p.type === "header" && p.name === "contentType"
|
|
525
|
+
(p) => p.type === "header" && p.name === "contentType",
|
|
547
526
|
);
|
|
548
527
|
if (!headerParameters.length || headerParameters.length > 1) {
|
|
549
528
|
return undefined;
|
|
@@ -568,7 +547,7 @@ export function buildBodyTypeAlias(
|
|
|
568
547
|
...(description && { docs: [{ description }] }),
|
|
569
548
|
name: `${typeName}`,
|
|
570
549
|
type,
|
|
571
|
-
isExported: true
|
|
550
|
+
isExported: true,
|
|
572
551
|
};
|
|
573
552
|
}
|
|
574
553
|
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
|
}
|