@azure-tools/typespec-ts 0.54.0 → 0.55.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -10
- package/README.md +0 -4
- package/dist/src/contextManager.d.ts +5 -5
- package/dist/src/contextManager.d.ts.map +1 -1
- package/dist/src/contextManager.js +3 -3
- package/dist/src/contextManager.js.map +1 -1
- package/dist/src/framework/declaration.d.ts +1 -1
- package/dist/src/framework/declaration.d.ts.map +1 -1
- package/dist/src/framework/declaration.js +2 -4
- package/dist/src/framework/declaration.js.map +1 -1
- package/dist/src/framework/dependency.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.d.ts +1 -1
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +31 -40
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.js +8 -12
- package/dist/src/framework/hooks/sdkTypes.js.map +1 -1
- package/dist/src/framework/hooks/useDependencies.d.ts.map +1 -1
- package/dist/src/framework/hooks/useDependencies.js +1 -1
- package/dist/src/framework/hooks/useDependencies.js.map +1 -1
- package/dist/src/framework/load-static-helpers.d.ts +1 -1
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +17 -31
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/framework/reference.d.ts.map +1 -1
- package/dist/src/framework/reference.js +2 -2
- package/dist/src/framework/reference.js.map +1 -1
- package/dist/src/framework/sample.js +8 -8
- package/dist/src/framework/sample.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +103 -92
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +1 -1
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +140 -140
- package/dist/src/lib.js.map +1 -1
- package/dist/src/metaTree.d.ts +1 -1
- package/dist/src/metaTree.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.js +60 -74
- package/dist/src/modular/buildClassicalClient.js.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.d.ts +2 -2
- package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js +8 -10
- package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
- package/dist/src/modular/buildClientContext.d.ts +2 -2
- package/dist/src/modular/buildClientContext.d.ts.map +1 -1
- package/dist/src/modular/buildClientContext.js +31 -38
- package/dist/src/modular/buildClientContext.js.map +1 -1
- package/dist/src/modular/buildModularOptions.d.ts +1 -1
- package/dist/src/modular/buildModularOptions.d.ts.map +1 -1
- package/dist/src/modular/buildModularOptions.js +5 -6
- package/dist/src/modular/buildModularOptions.js.map +1 -1
- package/dist/src/modular/buildOperations.d.ts +3 -3
- package/dist/src/modular/buildOperations.d.ts.map +1 -1
- package/dist/src/modular/buildOperations.js +23 -25
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts.map +1 -1
- package/dist/src/modular/buildProjectFiles.js +8 -11
- package/dist/src/modular/buildProjectFiles.js.map +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts.map +1 -1
- package/dist/src/modular/buildRestorePoller.js +12 -13
- package/dist/src/modular/buildRestorePoller.js.map +1 -1
- package/dist/src/modular/buildRootIndex.d.ts +2 -2
- package/dist/src/modular/buildRootIndex.d.ts.map +1 -1
- package/dist/src/modular/buildRootIndex.js +36 -50
- package/dist/src/modular/buildRootIndex.js.map +1 -1
- package/dist/src/modular/buildSubpathIndex.d.ts.map +1 -1
- package/dist/src/modular/buildSubpathIndex.js +9 -18
- package/dist/src/modular/buildSubpathIndex.js.map +1 -1
- package/dist/src/modular/emitLoggerFile.d.ts.map +1 -1
- package/dist/src/modular/emitLoggerFile.js +4 -4
- package/dist/src/modular/emitLoggerFile.js.map +1 -1
- package/dist/src/modular/emitModels.d.ts +1 -1
- package/dist/src/modular/emitModels.d.ts.map +1 -1
- package/dist/src/modular/emitModels.js +81 -113
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts.map +1 -1
- package/dist/src/modular/emitModelsOptions.js +7 -8
- package/dist/src/modular/emitModelsOptions.js.map +1 -1
- package/dist/src/modular/emitSamples.d.ts.map +1 -1
- package/dist/src/modular/emitSamples.js +69 -77
- package/dist/src/modular/emitSamples.js.map +1 -1
- package/dist/src/modular/emitTests.d.ts.map +1 -1
- package/dist/src/modular/emitTests.js +13 -18
- package/dist/src/modular/emitTests.js.map +1 -1
- package/dist/src/modular/external-dependencies.js +54 -54
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js +59 -68
- package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.js +31 -54
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.js +72 -84
- package/dist/src/modular/helpers/exampleValueHelpers.js.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.js +7 -10
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +204 -288
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.js +4 -6
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.js +58 -67
- package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js +65 -75
- package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js +73 -90
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.d.ts.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.js +25 -33
- package/dist/src/modular/serialization/serializeUtils.js.map +1 -1
- package/dist/src/modular/static-helpers-metadata.js +60 -60
- package/dist/src/modular/type-expressions/get-credential-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-credential-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.js +1 -2
- package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.js +10 -13
- package/dist/src/modular/type-expressions/get-model-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.js +2 -3
- package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.js +5 -11
- package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
- package/dist/src/rlc-common/buildClient.d.ts +1 -1
- package/dist/src/rlc-common/buildClient.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClient.js +67 -89
- package/dist/src/rlc-common/buildClient.js.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.js +28 -45
- package/dist/src/rlc-common/buildClientDefinitions.js.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.js +59 -60
- package/dist/src/rlc-common/buildIndexFile.js.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js +37 -38
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +1 -1
- package/dist/src/rlc-common/buildLogger.d.ts.map +1 -1
- package/dist/src/rlc-common/buildLogger.js +4 -5
- package/dist/src/rlc-common/buildLogger.js.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.js +4 -4
- package/dist/src/rlc-common/buildMethodShortcuts.js.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.js +57 -96
- package/dist/src/rlc-common/buildObjectTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.js +2 -2
- package/dist/src/rlc-common/buildPaginateHelper.js.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.js +71 -61
- package/dist/src/rlc-common/buildParameterTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.js +9 -10
- package/dist/src/rlc-common/buildPollingHelper.js.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.js +23 -27
- package/dist/src/rlc-common/buildResponseTypes.js.map +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSamples.js +2 -2
- package/dist/src/rlc-common/buildSchemaType.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSchemaType.js +31 -13
- package/dist/src/rlc-common/buildSchemaType.js.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.js +4 -4
- package/dist/src/rlc-common/buildSerializeHelper.js.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.js +9 -13
- package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.js +6 -8
- package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.js +32 -37
- package/dist/src/rlc-common/helpers/importsUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.js +2 -4
- package/dist/src/rlc-common/helpers/nameConstructors.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.js +17 -23
- package/dist/src/rlc-common/helpers/nameUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.js +16 -31
- package/dist/src/rlc-common/helpers/operationHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/packageUtil.js +3 -6
- package/dist/src/rlc-common/helpers/packageUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.js +1 -3
- package/dist/src/rlc-common/helpers/pathUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.js +3 -7
- package/dist/src/rlc-common/helpers/schemaHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.js +2 -2
- package/dist/src/rlc-common/helpers/shortcutMethods.js.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.js +4 -9
- package/dist/src/rlc-common/helpers/typeUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js +7 -11
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +1 -1
- package/dist/src/rlc-common/index.d.ts +28 -28
- package/dist/src/rlc-common/index.d.ts.map +1 -1
- package/dist/src/rlc-common/index.js +28 -28
- package/dist/src/rlc-common/index.js.map +1 -1
- package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
- package/dist/src/rlc-common/interfaces.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +14 -15
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildChangelogFile.js +2 -3
- package/dist/src/rlc-common/metadata/buildChangelogFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.js +5 -8
- package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildLicenseFile.js +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.js +33 -37
- package/dist/src/rlc-common/metadata/buildPackageFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.js +31 -39
- package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.js +4 -6
- package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +3 -5
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTestConfig.js +11 -12
- package/dist/src/rlc-common/metadata/buildTestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.js +28 -28
- package/dist/src/rlc-common/metadata/buildTsConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.js +3 -5
- package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.js +4 -5
- package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +14 -14
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +24 -29
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +15 -16
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +8 -8
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +28 -31
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/utils.js +1 -2
- package/dist/src/rlc-common/metadata/utils.js.map +1 -1
- package/dist/src/rlc-common/test/buildKarmaConfig.js +1 -1
- package/dist/src/rlc-common/test/buildRecordedClient.js +4 -5
- package/dist/src/rlc-common/test/buildRecordedClient.js.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.js +3 -4
- package/dist/src/rlc-common/test/buildSampleTest.js.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.js +7 -10
- package/dist/src/rlc-common/test/buildSnippets.js.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.d.ts.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.js +41 -45
- package/dist/src/rlc-common/transformSampleGroups.js.map +1 -1
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +1 -1
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/transform/transform.d.ts +1 -1
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/transform/transform.js +28 -27
- package/dist/src/transform/transform.js.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.js +12 -14
- package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.js +11 -14
- package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -1
- package/dist/src/transform/transformParameters.d.ts +2 -2
- package/dist/src/transform/transformParameters.d.ts.map +1 -1
- package/dist/src/transform/transformParameters.js +32 -45
- package/dist/src/transform/transformParameters.js.map +1 -1
- package/dist/src/transform/transformPaths.d.ts +1 -1
- package/dist/src/transform/transformPaths.d.ts.map +1 -1
- package/dist/src/transform/transformPaths.js +19 -23
- package/dist/src/transform/transformPaths.js.map +1 -1
- package/dist/src/transform/transformResponses.d.ts +1 -1
- package/dist/src/transform/transformResponses.d.ts.map +1 -1
- package/dist/src/transform/transformResponses.js +21 -25
- package/dist/src/transform/transformResponses.js.map +1 -1
- package/dist/src/transform/transformSchemas.d.ts.map +1 -1
- package/dist/src/transform/transformSchemas.js +21 -32
- package/dist/src/transform/transformSchemas.js.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.js +3 -3
- package/dist/src/transform/transformTelemetryInfo.js.map +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
- package/dist/src/transform/transfromRLCOptions.js +28 -39
- package/dist/src/transform/transfromRLCOptions.js.map +1 -1
- package/dist/src/utils/clientUtils.d.ts +1 -1
- package/dist/src/utils/clientUtils.d.ts.map +1 -1
- package/dist/src/utils/clientUtils.js +15 -23
- package/dist/src/utils/clientUtils.js.map +1 -1
- package/dist/src/utils/credentialUtils.d.ts +1 -1
- package/dist/src/utils/credentialUtils.d.ts.map +1 -1
- package/dist/src/utils/credentialUtils.js +4 -5
- package/dist/src/utils/credentialUtils.js.map +1 -1
- package/dist/src/utils/crossLanguageDef.d.ts.map +1 -1
- package/dist/src/utils/crossLanguageDef.js +11 -15
- package/dist/src/utils/crossLanguageDef.js.map +1 -1
- package/dist/src/utils/emitUtil.d.ts +1 -1
- package/dist/src/utils/emitUtil.d.ts.map +1 -1
- package/dist/src/utils/emitUtil.js +5 -7
- package/dist/src/utils/emitUtil.js.map +1 -1
- package/dist/src/utils/fileSystemUtils.d.ts +2 -0
- package/dist/src/utils/fileSystemUtils.d.ts.map +1 -1
- package/dist/src/utils/fileSystemUtils.js +26 -7
- package/dist/src/utils/fileSystemUtils.js.map +1 -1
- package/dist/src/utils/importHelper.d.ts.map +1 -1
- package/dist/src/utils/importHelper.js +3 -6
- package/dist/src/utils/importHelper.js.map +1 -1
- package/dist/src/utils/interfaces.d.ts +1 -1
- package/dist/src/utils/interfaces.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.js +7 -19
- package/dist/src/utils/mediaTypes.js.map +1 -1
- package/dist/src/utils/modelUtils.d.ts +5 -5
- package/dist/src/utils/modelUtils.d.ts.map +1 -1
- package/dist/src/utils/modelUtils.js +168 -257
- package/dist/src/utils/modelUtils.js.map +1 -1
- package/dist/src/utils/namespaceUtils.d.ts.map +1 -1
- package/dist/src/utils/namespaceUtils.js +6 -7
- package/dist/src/utils/namespaceUtils.js.map +1 -1
- package/dist/src/utils/operationUtil.d.ts +1 -1
- package/dist/src/utils/operationUtil.d.ts.map +1 -1
- package/dist/src/utils/operationUtil.js +60 -81
- package/dist/src/utils/operationUtil.js.map +1 -1
- package/dist/src/utils/parameterUtils.d.ts +1 -1
- package/dist/src/utils/parameterUtils.d.ts.map +1 -1
- package/dist/src/utils/parameterUtils.js +26 -33
- package/dist/src/utils/parameterUtils.js.map +1 -1
- package/dist/src/utils/resolve-project-root.js +2 -2
- package/dist/src/utils/resolve-project-root.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -45
- package/src/contextManager.ts +6 -9
- package/src/framework/declaration.ts +18 -28
- package/src/framework/dependency.ts +1 -2
- package/src/framework/hooks/binder.ts +47 -120
- package/src/framework/hooks/sdkTypes.ts +27 -54
- package/src/framework/hooks/useDependencies.ts +2 -4
- package/src/framework/load-static-helpers.ts +28 -51
- package/src/framework/reference.ts +2 -5
- package/src/framework/sample.ts +9 -9
- package/src/index.ts +145 -185
- package/src/lib.ts +143 -158
- package/src/metaTree.ts +1 -1
- package/src/modular/buildClassicalClient.ts +83 -160
- package/src/modular/buildClassicalOperationGroups.ts +14 -39
- package/src/modular/buildClientContext.ts +54 -83
- package/src/modular/buildModularOptions.ts +4 -5
- package/src/modular/buildOperations.ts +46 -73
- package/src/modular/buildProjectFiles.ts +18 -47
- package/src/modular/buildRestorePoller.ts +27 -46
- package/src/modular/buildRootIndex.ts +86 -160
- package/src/modular/buildSubpathIndex.ts +35 -58
- package/src/modular/emitLoggerFile.ts +4 -9
- package/src/modular/emitModels.ts +136 -266
- package/src/modular/emitModelsOptions.ts +10 -16
- package/src/modular/emitSamples.ts +92 -180
- package/src/modular/emitTests.ts +28 -61
- package/src/modular/external-dependencies.ts +54 -54
- package/src/modular/helpers/classicalOperationHelpers.ts +73 -126
- package/src/modular/helpers/clientHelpers.ts +41 -88
- package/src/modular/helpers/clientOptionHelpers.ts +4 -11
- package/src/modular/helpers/exampleValueHelpers.ts +99 -215
- package/src/modular/helpers/namingHelpers.ts +12 -28
- package/src/modular/helpers/operationHelpers.ts +430 -757
- package/src/modular/helpers/typeHelpers.ts +11 -22
- package/src/modular/serialization/buildDeserializerFunction.ts +88 -122
- package/src/modular/serialization/buildSerializerFunction.ts +91 -129
- package/src/modular/serialization/buildXmlSerializerFunction.ts +104 -183
- package/src/modular/serialization/serializeUtils.ts +12 -22
- package/src/modular/static/rollup.test.config.js +11 -14
- package/src/modular/static/scripts/renameOutput.mjs +2 -2
- package/src/modular/static-helpers-metadata.ts +60 -60
- package/src/modular/type-expressions/get-credential-expression.ts +1 -1
- package/src/modular/type-expressions/get-enum-expression.ts +5 -10
- package/src/modular/type-expressions/get-model-expression.ts +13 -17
- package/src/modular/type-expressions/get-nullable-expression.ts +4 -5
- package/src/modular/type-expressions/get-type-expression.ts +8 -12
- package/src/modular/type-expressions/get-union-expression.ts +4 -4
- package/src/modular/type-expressions/utils.ts +1 -1
- package/src/rlc-common/buildClient.ts +70 -141
- package/src/rlc-common/buildClientDefinitions.ts +44 -87
- package/src/rlc-common/buildIndexFile.ts +78 -78
- package/src/rlc-common/buildIsUnexpectedHelper.ts +34 -41
- package/src/rlc-common/buildLogger.ts +7 -7
- package/src/rlc-common/buildMethodShortcuts.ts +9 -21
- package/src/rlc-common/buildObjectTypes.ts +79 -156
- package/src/rlc-common/buildPaginateHelper.ts +9 -12
- package/src/rlc-common/buildParameterTypes.ts +116 -137
- package/src/rlc-common/buildPollingHelper.ts +7 -7
- package/src/rlc-common/buildResponseTypes.ts +34 -57
- package/src/rlc-common/buildSamples.ts +3 -3
- package/src/rlc-common/buildSchemaType.ts +37 -29
- package/src/rlc-common/buildSerializeHelper.ts +5 -5
- package/src/rlc-common/buildTopLevelIndexFile.ts +12 -19
- package/src/rlc-common/helpers/apiVersionUtil.ts +5 -10
- package/src/rlc-common/helpers/importsUtil.ts +27 -30
- package/src/rlc-common/helpers/nameConstructors.ts +16 -50
- package/src/rlc-common/helpers/nameUtils.ts +19 -42
- package/src/rlc-common/helpers/operationHelpers.ts +14 -31
- package/src/rlc-common/helpers/pathUtils.ts +2 -7
- package/src/rlc-common/helpers/schemaHelpers.ts +4 -15
- package/src/rlc-common/helpers/shortcutMethods.ts +6 -15
- package/src/rlc-common/helpers/typeUtil.ts +4 -11
- package/src/rlc-common/helpers/valueGenerationUtil.ts +16 -39
- package/src/rlc-common/index.ts +28 -28
- package/src/rlc-common/interfaces.ts +3 -11
- package/src/rlc-common/metadata/buildApiExtractorConfig.ts +17 -24
- package/src/rlc-common/metadata/buildChangelogFile.ts +1 -1
- package/src/rlc-common/metadata/buildESLintConfig.ts +3 -5
- package/src/rlc-common/metadata/buildLicenseFile.ts +1 -1
- package/src/rlc-common/metadata/buildPackageFile.ts +27 -35
- package/src/rlc-common/metadata/buildReadmeFile.ts +16 -29
- package/src/rlc-common/metadata/buildRollupConfig.ts +5 -8
- package/src/rlc-common/metadata/buildSampleEnvFile.ts +2 -3
- package/src/rlc-common/metadata/buildTestConfig.ts +10 -10
- package/src/rlc-common/metadata/buildTsConfig.ts +32 -35
- package/src/rlc-common/metadata/buildVitestConfig.ts +4 -10
- package/src/rlc-common/metadata/buildWarpConfig.ts +3 -6
- package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +16 -25
- package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +29 -50
- package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +20 -31
- package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +11 -13
- package/src/rlc-common/metadata/packageJson/packageCommon.ts +32 -52
- package/src/rlc-common/test/buildKarmaConfig.ts +1 -1
- package/src/rlc-common/test/buildRecordedClient.ts +3 -3
- package/src/rlc-common/test/buildSampleTest.ts +3 -3
- package/src/rlc-common/test/buildSnippets.ts +6 -12
- package/src/rlc-common/transformSampleGroups.ts +54 -105
- package/src/testing/index.ts +2 -5
- package/src/transform/transform.ts +22 -34
- package/src/transform/transformApiVersionInfo.ts +17 -30
- package/src/transform/transformHelperFunctionDetails.ts +14 -26
- package/src/transform/transformParameters.ts +55 -105
- package/src/transform/transformPaths.ts +26 -43
- package/src/transform/transformResponses.ts +26 -33
- package/src/transform/transformSchemas.ts +15 -33
- package/src/transform/transformTelemetryInfo.ts +8 -14
- package/src/transform/transfromRLCOptions.ts +53 -116
- package/src/utils/clientUtils.ts +22 -41
- package/src/utils/credentialUtils.ts +8 -19
- package/src/utils/crossLanguageDef.ts +15 -34
- package/src/utils/emitUtil.ts +11 -17
- package/src/utils/fileSystemUtils.ts +30 -8
- package/src/utils/importHelper.ts +5 -10
- package/src/utils/interfaces.ts +1 -1
- package/src/utils/mediaTypes.ts +13 -34
- package/src/utils/modelUtils.ts +175 -384
- package/src/utils/namespaceUtils.ts +8 -24
- package/src/utils/operationUtil.ts +98 -190
- package/src/utils/parameterUtils.ts +31 -54
- package/src/utils/resolve-project-root.ts +3 -3
- package/static/static-helpers/cloudSettingHelpers.ts +4 -6
- package/static/static-helpers/multipartHelpers.ts +3 -3
- package/static/static-helpers/pagingHelpers.ts +28 -63
- package/static/static-helpers/pollingHelpers.ts +16 -29
- package/static/static-helpers/serialization/build-multi-collection.ts +1 -4
- package/static/static-helpers/serialization/check-prop-undefined.ts +1 -4
- package/static/static-helpers/serialization/get-binary-response-browser.mts +3 -1
- package/static/static-helpers/serialization/get-binary-response.ts +2 -2
- package/static/static-helpers/serialization/get-binary-stream-response-browser.mts +1 -3
- package/static/static-helpers/serialization/get-binary-stream-response.ts +2 -4
- package/static/static-helpers/serialization/serialize-record.ts +1 -1
- package/static/static-helpers/serialization/serializers.ts +4 -7
- package/static/static-helpers/serialization/xml-helpers.ts +42 -90
- package/static/static-helpers/simplePollerHelpers.ts +10 -19
- package/static/static-helpers/storageCompatResponse.ts +10 -27
- package/static/static-helpers/urlTemplate.ts +4 -7
- package/static/test-helpers/recordedClient.ts +5 -10
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
import {
|
|
2
|
-
NameType,
|
|
3
|
-
normalizeName,
|
|
4
|
-
Schema,
|
|
5
|
-
SchemaContext
|
|
6
|
-
} from "../rlc-common/index.js";
|
|
1
|
+
import { getEncode, NoTarget, Program } from "@typespec/compiler";
|
|
7
2
|
import { HttpOperationParameter } from "@typespec/http";
|
|
8
|
-
import { getTypeName, isArrayType, isObjectOrDictType } from "./modelUtils.js";
|
|
9
|
-
import { SdkContext } from "./interfaces.js";
|
|
10
3
|
import { reportDiagnostic } from "../lib.js";
|
|
11
|
-
import {
|
|
4
|
+
import { NameType, normalizeName, Schema, SchemaContext } from "../rlc-common/index.js";
|
|
5
|
+
import { SdkContext } from "./interfaces.js";
|
|
6
|
+
import { getTypeName, isArrayType, isObjectOrDictType } from "./modelUtils.js";
|
|
12
7
|
|
|
13
8
|
export interface ParameterSerializationInfo {
|
|
14
9
|
typeName: string;
|
|
@@ -20,11 +15,11 @@ export function getParameterSerializationInfo(
|
|
|
20
15
|
parameter: HttpOperationParameter,
|
|
21
16
|
valueSchema: Schema,
|
|
22
17
|
operationGroup: string = "",
|
|
23
|
-
operationName: string = ""
|
|
18
|
+
operationName: string = "",
|
|
24
19
|
): ParameterSerializationInfo {
|
|
25
20
|
const schemaContext = [SchemaContext.Input];
|
|
26
21
|
const retVal: ParameterSerializationInfo = buildSerializationInfo(
|
|
27
|
-
getTypeName(valueSchema, schemaContext)
|
|
22
|
+
getTypeName(valueSchema, schemaContext),
|
|
28
23
|
);
|
|
29
24
|
const prefix = `${operationGroup}_${operationName}_${parameter.name}`;
|
|
30
25
|
switch (parameter.type) {
|
|
@@ -33,7 +28,7 @@ export function getParameterSerializationInfo(
|
|
|
33
28
|
const wrapperType = buildAllowReserved(
|
|
34
29
|
normalizeName(`${prefix}_PathParam`, NameType.Interface),
|
|
35
30
|
valueSchema,
|
|
36
|
-
parameter.name
|
|
31
|
+
parameter.name,
|
|
37
32
|
);
|
|
38
33
|
return buildSerializationInfo(wrapperType);
|
|
39
34
|
}
|
|
@@ -56,7 +51,7 @@ export function getParameterSerializationInfo(
|
|
|
56
51
|
parameter.explode,
|
|
57
52
|
format ?? "form",
|
|
58
53
|
valueSchema,
|
|
59
|
-
parameter.name
|
|
54
|
+
parameter.name,
|
|
60
55
|
);
|
|
61
56
|
if (parameter.explode === true) {
|
|
62
57
|
if (format !== undefined) {
|
|
@@ -65,17 +60,14 @@ export function getParameterSerializationInfo(
|
|
|
65
60
|
format: {
|
|
66
61
|
paramName: parameter.name,
|
|
67
62
|
explode: String(parameter.explode),
|
|
68
|
-
format: format
|
|
63
|
+
format: format,
|
|
69
64
|
},
|
|
70
|
-
target: NoTarget
|
|
65
|
+
target: NoTarget,
|
|
71
66
|
});
|
|
72
67
|
}
|
|
73
68
|
|
|
74
69
|
if (dpgContext.rlcOptions?.compatibilityQueryMultiFormat) {
|
|
75
|
-
wrapperType = buildUnionType([
|
|
76
|
-
wrapperType,
|
|
77
|
-
{ type: "string", name: "string" }
|
|
78
|
-
]);
|
|
70
|
+
wrapperType = buildUnionType([wrapperType, { type: "string", name: "string" }]);
|
|
79
71
|
}
|
|
80
72
|
return buildSerializationInfo(wrapperType);
|
|
81
73
|
}
|
|
@@ -90,11 +82,7 @@ export function getParameterSerializationInfo(
|
|
|
90
82
|
}
|
|
91
83
|
case "header": {
|
|
92
84
|
return buildSerializationInfo(
|
|
93
|
-
getHeaderSerializeTypeName(
|
|
94
|
-
dpgContext.program,
|
|
95
|
-
valueSchema,
|
|
96
|
-
schemaContext
|
|
97
|
-
)
|
|
85
|
+
getHeaderSerializeTypeName(dpgContext.program, valueSchema, schemaContext),
|
|
98
86
|
);
|
|
99
87
|
}
|
|
100
88
|
default:
|
|
@@ -102,30 +90,25 @@ export function getParameterSerializationInfo(
|
|
|
102
90
|
}
|
|
103
91
|
}
|
|
104
92
|
|
|
105
|
-
function buildSerializationInfo(
|
|
106
|
-
typeOrSchema: string | Schema
|
|
107
|
-
): ParameterSerializationInfo {
|
|
93
|
+
function buildSerializationInfo(typeOrSchema: string | Schema): ParameterSerializationInfo {
|
|
108
94
|
if (typeof typeOrSchema === "string") {
|
|
109
95
|
return {
|
|
110
|
-
typeName: typeOrSchema
|
|
96
|
+
typeName: typeOrSchema,
|
|
111
97
|
};
|
|
112
98
|
}
|
|
113
99
|
return {
|
|
114
100
|
typeName: getTypeName(typeOrSchema),
|
|
115
|
-
wrapperType: typeOrSchema
|
|
101
|
+
wrapperType: typeOrSchema,
|
|
116
102
|
};
|
|
117
103
|
}
|
|
118
104
|
|
|
119
105
|
function getHeaderSerializeTypeName(
|
|
120
106
|
program: Program,
|
|
121
107
|
schema: Schema,
|
|
122
|
-
usage?: SchemaContext[]
|
|
108
|
+
usage?: SchemaContext[],
|
|
123
109
|
): string {
|
|
124
110
|
const typeName = getTypeName(schema, usage);
|
|
125
|
-
const formattedName = (schema.alias ?? typeName).replace(
|
|
126
|
-
"Date | string",
|
|
127
|
-
"string"
|
|
128
|
-
);
|
|
111
|
+
const formattedName = (schema.alias ?? typeName).replace("Date | string", "string");
|
|
129
112
|
const canSerialize = isSerializable(schema);
|
|
130
113
|
if (canSerialize) {
|
|
131
114
|
return schema.alias ? typeName : formattedName;
|
|
@@ -133,7 +116,7 @@ function getHeaderSerializeTypeName(
|
|
|
133
116
|
reportDiagnostic(program, {
|
|
134
117
|
code: "unable-serialized-type",
|
|
135
118
|
format: { type: typeName },
|
|
136
|
-
target: NoTarget
|
|
119
|
+
target: NoTarget,
|
|
137
120
|
});
|
|
138
121
|
return "string";
|
|
139
122
|
function isSerializable(type: any) {
|
|
@@ -142,17 +125,11 @@ function getHeaderSerializeTypeName(
|
|
|
142
125
|
return isSerializable(i) || i.type === "null";
|
|
143
126
|
});
|
|
144
127
|
}
|
|
145
|
-
return (
|
|
146
|
-
["string", "number", "boolean"].includes(type.type) || type.isConstant
|
|
147
|
-
);
|
|
128
|
+
return ["string", "number", "boolean"].includes(type.type) || type.isConstant;
|
|
148
129
|
}
|
|
149
130
|
}
|
|
150
131
|
|
|
151
|
-
function buildAllowReserved(
|
|
152
|
-
typeName: string,
|
|
153
|
-
valueSchema: Schema,
|
|
154
|
-
parameterName: string
|
|
155
|
-
) {
|
|
132
|
+
function buildAllowReserved(typeName: string, valueSchema: Schema, parameterName: string) {
|
|
156
133
|
return {
|
|
157
134
|
type: "object",
|
|
158
135
|
name: typeName,
|
|
@@ -161,14 +138,14 @@ function buildAllowReserved(
|
|
|
161
138
|
value: {
|
|
162
139
|
...valueSchema,
|
|
163
140
|
description: valueSchema.description ?? "Value of the parameter",
|
|
164
|
-
required: true
|
|
141
|
+
required: true,
|
|
165
142
|
},
|
|
166
143
|
allowReserved: {
|
|
167
144
|
type: `true`,
|
|
168
145
|
description: "Whether to allow reserved characters",
|
|
169
|
-
required: true
|
|
170
|
-
}
|
|
171
|
-
}
|
|
146
|
+
required: true,
|
|
147
|
+
},
|
|
148
|
+
},
|
|
172
149
|
};
|
|
173
150
|
}
|
|
174
151
|
|
|
@@ -177,7 +154,7 @@ function buildExplodeAndStyle(
|
|
|
177
154
|
explode: boolean,
|
|
178
155
|
style: string,
|
|
179
156
|
valueSchema: Schema,
|
|
180
|
-
parameterName: string
|
|
157
|
+
parameterName: string,
|
|
181
158
|
) {
|
|
182
159
|
return {
|
|
183
160
|
type: "object",
|
|
@@ -187,19 +164,19 @@ function buildExplodeAndStyle(
|
|
|
187
164
|
value: {
|
|
188
165
|
...valueSchema,
|
|
189
166
|
description: valueSchema.description ?? "Value of the parameter",
|
|
190
|
-
required: true
|
|
167
|
+
required: true,
|
|
191
168
|
},
|
|
192
169
|
explode: {
|
|
193
170
|
type: `${explode}`,
|
|
194
171
|
description: "Should we explode the value?",
|
|
195
|
-
required: true
|
|
172
|
+
required: true,
|
|
196
173
|
},
|
|
197
174
|
style: {
|
|
198
175
|
type: `"${style}"`,
|
|
199
176
|
description: "Style of the value",
|
|
200
|
-
required: true
|
|
201
|
-
}
|
|
202
|
-
}
|
|
177
|
+
required: true,
|
|
178
|
+
},
|
|
179
|
+
},
|
|
203
180
|
};
|
|
204
181
|
}
|
|
205
182
|
|
|
@@ -210,6 +187,6 @@ function buildUnionType(values: Schema[]) {
|
|
|
210
187
|
type: "union",
|
|
211
188
|
typeName: `${values.map((v) => getTypeName(v)).join(" | ")}`,
|
|
212
189
|
required: true,
|
|
213
|
-
description: undefined
|
|
190
|
+
description: undefined,
|
|
214
191
|
};
|
|
215
192
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { fileURLToPath } from "url";
|
|
2
|
-
import { dirname, resolve } from "path";
|
|
3
1
|
import { existsSync } from "fs";
|
|
2
|
+
import { dirname, resolve } from "path";
|
|
3
|
+
import { fileURLToPath } from "url";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Recursively finds the nearest package.json file starting from the specified directory.
|
|
@@ -8,7 +8,7 @@ import { existsSync } from "fs";
|
|
|
8
8
|
* @returns {string} path to the directory containing the package.json file.
|
|
9
9
|
*/
|
|
10
10
|
export function resolveProjectRoot(
|
|
11
|
-
currentDir: string = dirname(fileURLToPath(import.meta.url))
|
|
11
|
+
currentDir: string = dirname(fileURLToPath(import.meta.url)),
|
|
12
12
|
): string {
|
|
13
13
|
const packageJsonPath = resolve(currentDir, "package.json");
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@ export enum AzureClouds {
|
|
|
8
8
|
/** Azure China cloud */
|
|
9
9
|
AZURE_CHINA_CLOUD = "AZURE_CHINA_CLOUD",
|
|
10
10
|
/** Azure US government cloud */
|
|
11
|
-
AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT"
|
|
11
|
+
AZURE_US_GOVERNMENT = "AZURE_US_GOVERNMENT",
|
|
12
12
|
}
|
|
13
13
|
|
|
14
14
|
/** The supported values for cloud setting as a string literal type */
|
|
@@ -20,22 +20,20 @@ export type AzureSupportedClouds = `${AzureClouds}`;
|
|
|
20
20
|
* @returns The ARM endpoint URL for the specified cloud, or undefined if cloudSetting is undefined.
|
|
21
21
|
* @throws {Error} Throws an error if an unknown cloud setting is provided.
|
|
22
22
|
*/
|
|
23
|
-
export function getArmEndpoint(
|
|
24
|
-
cloudSetting?: AzureSupportedClouds
|
|
25
|
-
): string | undefined {
|
|
23
|
+
export function getArmEndpoint(cloudSetting?: AzureSupportedClouds): string | undefined {
|
|
26
24
|
if (cloudSetting === undefined) {
|
|
27
25
|
return undefined;
|
|
28
26
|
}
|
|
29
27
|
const cloudEndpoints: Record<keyof typeof AzureClouds, string> = {
|
|
30
28
|
AZURE_CHINA_CLOUD: "https://management.chinacloudapi.cn/",
|
|
31
29
|
AZURE_US_GOVERNMENT: "https://management.usgovcloudapi.net/",
|
|
32
|
-
AZURE_PUBLIC_CLOUD: "https://management.azure.com/"
|
|
30
|
+
AZURE_PUBLIC_CLOUD: "https://management.azure.com/",
|
|
33
31
|
};
|
|
34
32
|
if (cloudSetting in cloudEndpoints) {
|
|
35
33
|
return cloudEndpoints[cloudSetting];
|
|
36
34
|
} else {
|
|
37
35
|
throw new Error(
|
|
38
|
-
`Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values
|
|
36
|
+
`Unknown cloud setting: ${cloudSetting}. Please refer to the enum AzureClouds for possible values.`,
|
|
39
37
|
);
|
|
40
38
|
}
|
|
41
39
|
}
|
|
@@ -13,20 +13,20 @@ export type FileContents =
|
|
|
13
13
|
export function createFilePartDescriptor(
|
|
14
14
|
partName: string,
|
|
15
15
|
fileInput: any,
|
|
16
|
-
defaultContentType?: string
|
|
16
|
+
defaultContentType?: string,
|
|
17
17
|
): any {
|
|
18
18
|
if (fileInput.contents) {
|
|
19
19
|
return {
|
|
20
20
|
name: partName,
|
|
21
21
|
body: fileInput.contents,
|
|
22
22
|
contentType: fileInput.contentType ?? defaultContentType,
|
|
23
|
-
filename: fileInput.filename
|
|
23
|
+
filename: fileInput.filename,
|
|
24
24
|
};
|
|
25
25
|
} else {
|
|
26
26
|
return {
|
|
27
27
|
name: partName,
|
|
28
28
|
body: fileInput,
|
|
29
|
-
contentType: defaultContentType
|
|
29
|
+
contentType: defaultContentType,
|
|
30
30
|
};
|
|
31
31
|
}
|
|
32
32
|
}
|
|
@@ -1,8 +1,4 @@
|
|
|
1
|
-
import {
|
|
2
|
-
Client,
|
|
3
|
-
createRestError,
|
|
4
|
-
PathUncheckedResponse
|
|
5
|
-
} from "@azure-rest/core-client";
|
|
1
|
+
import { Client, createRestError, PathUncheckedResponse } from "@azure-rest/core-client";
|
|
6
2
|
import { RestError } from "@azure/core-rest-pipeline";
|
|
7
3
|
|
|
8
4
|
/**
|
|
@@ -31,7 +27,7 @@ export type ContinuablePage<TElement, TPage = TElement[]> = TPage & {
|
|
|
31
27
|
export interface PagedAsyncIterableIterator<
|
|
32
28
|
TElement,
|
|
33
29
|
TPage = TElement[],
|
|
34
|
-
TPageSettings extends PageSettings = PageSettings
|
|
30
|
+
TPageSettings extends PageSettings = PageSettings,
|
|
35
31
|
> {
|
|
36
32
|
/**
|
|
37
33
|
* The next method, part of the iteration protocol
|
|
@@ -40,17 +36,11 @@ export interface PagedAsyncIterableIterator<
|
|
|
40
36
|
/**
|
|
41
37
|
* The connection to the async iterator, part of the iteration protocol
|
|
42
38
|
*/
|
|
43
|
-
[Symbol.asyncIterator](): PagedAsyncIterableIterator<
|
|
44
|
-
TElement,
|
|
45
|
-
TPage,
|
|
46
|
-
TPageSettings
|
|
47
|
-
>;
|
|
39
|
+
[Symbol.asyncIterator](): PagedAsyncIterableIterator<TElement, TPage, TPageSettings>;
|
|
48
40
|
/**
|
|
49
41
|
* Return an AsyncIterableIterator that works a page at a time
|
|
50
42
|
*/
|
|
51
|
-
byPage: (
|
|
52
|
-
settings?: TPageSettings
|
|
53
|
-
) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
|
|
43
|
+
byPage: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
|
|
54
44
|
}
|
|
55
45
|
|
|
56
46
|
/**
|
|
@@ -59,7 +49,7 @@ export interface PagedAsyncIterableIterator<
|
|
|
59
49
|
export interface PagedResult<
|
|
60
50
|
TElement,
|
|
61
51
|
TPage = TElement[],
|
|
62
|
-
TPageSettings extends PageSettings = PageSettings
|
|
52
|
+
TPageSettings extends PageSettings = PageSettings,
|
|
63
53
|
> {
|
|
64
54
|
/**
|
|
65
55
|
* Link to the first page of results.
|
|
@@ -68,15 +58,11 @@ export interface PagedResult<
|
|
|
68
58
|
/**
|
|
69
59
|
* A method that returns a page of results.
|
|
70
60
|
*/
|
|
71
|
-
getPage: (
|
|
72
|
-
pageLink?: string
|
|
73
|
-
) => Promise<{ page: TPage; nextPageLink?: string } | undefined>;
|
|
61
|
+
getPage: (pageLink?: string) => Promise<{ page: TPage; nextPageLink?: string } | undefined>;
|
|
74
62
|
/**
|
|
75
63
|
* a function to implement the `byPage` method on the paged async iterator.
|
|
76
64
|
*/
|
|
77
|
-
byPage?: (
|
|
78
|
-
settings?: TPageSettings
|
|
79
|
-
) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
|
|
65
|
+
byPage?: (settings?: TPageSettings) => AsyncIterableIterator<ContinuablePage<TElement, TPage>>;
|
|
80
66
|
|
|
81
67
|
/**
|
|
82
68
|
* A function to extract elements from a page.
|
|
@@ -101,13 +87,13 @@ export function buildPagedAsyncIterator<
|
|
|
101
87
|
TElement,
|
|
102
88
|
TPage = TElement[],
|
|
103
89
|
TPageSettings extends PageSettings = PageSettings,
|
|
104
|
-
TResponse extends PathUncheckedResponse = PathUncheckedResponse
|
|
90
|
+
TResponse extends PathUncheckedResponse = PathUncheckedResponse,
|
|
105
91
|
>(
|
|
106
92
|
client: Client,
|
|
107
93
|
getInitialResponse: () => PromiseLike<TResponse>,
|
|
108
94
|
processResponseBody: (result: TResponse) => PromiseLike<unknown>,
|
|
109
95
|
expectedStatuses: string[],
|
|
110
|
-
options: BuildPagedAsyncIteratorOptions = {}
|
|
96
|
+
options: BuildPagedAsyncIteratorOptions = {},
|
|
111
97
|
): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {
|
|
112
98
|
const itemName = options.itemName ?? "value";
|
|
113
99
|
const nextLinkName = options.nextLinkName ?? "nextLink";
|
|
@@ -119,9 +105,7 @@ export function buildPagedAsyncIterator<
|
|
|
119
105
|
if (pageLink === undefined) {
|
|
120
106
|
result = await getInitialResponse();
|
|
121
107
|
} else {
|
|
122
|
-
const resolvedPageLink = apiVersion
|
|
123
|
-
? addApiVersionToUrl(pageLink, apiVersion)
|
|
124
|
-
: pageLink;
|
|
108
|
+
const resolvedPageLink = apiVersion ? addApiVersionToUrl(pageLink, apiVersion) : pageLink;
|
|
125
109
|
result =
|
|
126
110
|
nextLinkMethod === "POST"
|
|
127
111
|
? await client.pathUnchecked(resolvedPageLink).post()
|
|
@@ -133,15 +117,15 @@ export function buildPagedAsyncIterator<
|
|
|
133
117
|
const values = getElements<TElement>(results, itemName) as TPage;
|
|
134
118
|
return {
|
|
135
119
|
page: values,
|
|
136
|
-
nextPageLink: nextLink
|
|
120
|
+
nextPageLink: nextLink,
|
|
137
121
|
};
|
|
138
122
|
},
|
|
139
123
|
byPage: (settings?: TPageSettings) => {
|
|
140
124
|
const { continuationToken } = settings ?? {};
|
|
141
125
|
return getPageAsyncIterator(pagedResult, {
|
|
142
|
-
pageLink: continuationToken
|
|
126
|
+
pageLink: continuationToken,
|
|
143
127
|
});
|
|
144
|
-
}
|
|
128
|
+
},
|
|
145
129
|
};
|
|
146
130
|
return getPagedAsyncIterator(pagedResult);
|
|
147
131
|
}
|
|
@@ -157,13 +141,11 @@ export function buildPagedAsyncIterator<
|
|
|
157
141
|
function getPagedAsyncIterator<
|
|
158
142
|
TElement,
|
|
159
143
|
TPage = TElement[],
|
|
160
|
-
TPageSettings extends PageSettings = PageSettings
|
|
144
|
+
TPageSettings extends PageSettings = PageSettings,
|
|
161
145
|
>(
|
|
162
|
-
pagedResult: PagedResult<TElement, TPage, TPageSettings
|
|
146
|
+
pagedResult: PagedResult<TElement, TPage, TPageSettings>,
|
|
163
147
|
): PagedAsyncIterableIterator<TElement, TPage, TPageSettings> {
|
|
164
|
-
const iter = getItemAsyncIterator<TElement, TPage, TPageSettings>(
|
|
165
|
-
pagedResult
|
|
166
|
-
);
|
|
148
|
+
const iter = getItemAsyncIterator<TElement, TPage, TPageSettings>(pagedResult);
|
|
167
149
|
return {
|
|
168
150
|
next() {
|
|
169
151
|
return iter.next();
|
|
@@ -176,18 +158,14 @@ function getPagedAsyncIterator<
|
|
|
176
158
|
((settings?: TPageSettings) => {
|
|
177
159
|
const { continuationToken } = settings ?? {};
|
|
178
160
|
return getPageAsyncIterator(pagedResult, {
|
|
179
|
-
pageLink: continuationToken
|
|
161
|
+
pageLink: continuationToken,
|
|
180
162
|
});
|
|
181
|
-
})
|
|
163
|
+
}),
|
|
182
164
|
};
|
|
183
165
|
}
|
|
184
166
|
|
|
185
|
-
async function* getItemAsyncIterator<
|
|
186
|
-
TElement,
|
|
187
|
-
TPage,
|
|
188
|
-
TPageSettings extends PageSettings
|
|
189
|
-
>(
|
|
190
|
-
pagedResult: PagedResult<TElement, TPage, TPageSettings>
|
|
167
|
+
async function* getItemAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(
|
|
168
|
+
pagedResult: PagedResult<TElement, TPage, TPageSettings>,
|
|
191
169
|
): AsyncIterableIterator<TElement> {
|
|
192
170
|
const pages = getPageAsyncIterator(pagedResult);
|
|
193
171
|
for await (const page of pages) {
|
|
@@ -195,20 +173,14 @@ async function* getItemAsyncIterator<
|
|
|
195
173
|
}
|
|
196
174
|
}
|
|
197
175
|
|
|
198
|
-
async function* getPageAsyncIterator<
|
|
199
|
-
TElement,
|
|
200
|
-
TPage,
|
|
201
|
-
TPageSettings extends PageSettings
|
|
202
|
-
>(
|
|
176
|
+
async function* getPageAsyncIterator<TElement, TPage, TPageSettings extends PageSettings>(
|
|
203
177
|
pagedResult: PagedResult<TElement, TPage, TPageSettings>,
|
|
204
178
|
options: {
|
|
205
179
|
pageLink?: string;
|
|
206
|
-
} = {}
|
|
180
|
+
} = {},
|
|
207
181
|
): AsyncIterableIterator<ContinuablePage<TElement, TPage>> {
|
|
208
182
|
const { pageLink } = options;
|
|
209
|
-
let response = await pagedResult.getPage(
|
|
210
|
-
pageLink ?? pagedResult.firstPageLink
|
|
211
|
-
);
|
|
183
|
+
let response = await pagedResult.getPage(pageLink ?? pagedResult.firstPageLink);
|
|
212
184
|
if (!response) {
|
|
213
185
|
return;
|
|
214
186
|
}
|
|
@@ -236,13 +208,9 @@ function getNextLink(body: unknown, nextLinkName?: string): string | undefined {
|
|
|
236
208
|
|
|
237
209
|
const nextLink = (body as Record<string, unknown>)[nextLinkName];
|
|
238
210
|
|
|
239
|
-
if (
|
|
240
|
-
typeof nextLink !== "string" &&
|
|
241
|
-
typeof nextLink !== "undefined" &&
|
|
242
|
-
nextLink !== null
|
|
243
|
-
) {
|
|
211
|
+
if (typeof nextLink !== "string" && typeof nextLink !== "undefined" && nextLink !== null) {
|
|
244
212
|
throw new RestError(
|
|
245
|
-
`Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}
|
|
213
|
+
`Body Property ${nextLinkName} should be a string or undefined or null but got ${typeof nextLink}`,
|
|
246
214
|
);
|
|
247
215
|
}
|
|
248
216
|
|
|
@@ -260,7 +228,7 @@ function getElements<T = unknown>(body: unknown, itemName: string): T[] {
|
|
|
260
228
|
const value = (body as Record<string, unknown>)[itemName] as T[];
|
|
261
229
|
if (!Array.isArray(value)) {
|
|
262
230
|
throw new RestError(
|
|
263
|
-
`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}
|
|
231
|
+
`Couldn't paginate response\n Body doesn't contain an array property with name: ${itemName}`,
|
|
264
232
|
);
|
|
265
233
|
}
|
|
266
234
|
|
|
@@ -270,14 +238,11 @@ function getElements<T = unknown>(body: unknown, itemName: string): T[] {
|
|
|
270
238
|
/**
|
|
271
239
|
* Checks if a request failed
|
|
272
240
|
*/
|
|
273
|
-
function checkPagingRequest(
|
|
274
|
-
response: PathUncheckedResponse,
|
|
275
|
-
expectedStatuses: string[]
|
|
276
|
-
): void {
|
|
241
|
+
function checkPagingRequest(response: PathUncheckedResponse, expectedStatuses: string[]): void {
|
|
277
242
|
if (!expectedStatuses.includes(response.status)) {
|
|
278
243
|
throw createRestError(
|
|
279
244
|
`Pagination failed with unexpected statusCode ${response.status}`,
|
|
280
|
-
response
|
|
245
|
+
response,
|
|
281
246
|
);
|
|
282
247
|
}
|
|
283
248
|
}
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
2
|
+
OperationResponse,
|
|
3
3
|
OperationState,
|
|
4
|
+
PollerLike,
|
|
4
5
|
ResourceLocationConfig,
|
|
5
6
|
RunningOperation,
|
|
6
7
|
createHttpPoller,
|
|
7
|
-
OperationResponse
|
|
8
8
|
} from "@azure/core-lro";
|
|
9
9
|
|
|
10
|
-
import {
|
|
11
|
-
Client,
|
|
12
|
-
PathUncheckedResponse,
|
|
13
|
-
createRestError
|
|
14
|
-
} from "@azure-rest/core-client";
|
|
10
|
+
import { Client, PathUncheckedResponse, createRestError } from "@azure-rest/core-client";
|
|
15
11
|
import { AbortSignalLike } from "@azure/abort-controller";
|
|
16
12
|
|
|
17
13
|
export interface GetLongRunningPollerOptions<TResponse> {
|
|
@@ -43,29 +39,22 @@ export interface GetLongRunningPollerOptions<TResponse> {
|
|
|
43
39
|
*/
|
|
44
40
|
apiVersion?: string;
|
|
45
41
|
}
|
|
46
|
-
export function getLongRunningPoller<
|
|
47
|
-
TResponse extends PathUncheckedResponse,
|
|
48
|
-
TResult = void
|
|
49
|
-
>(
|
|
42
|
+
export function getLongRunningPoller<TResponse extends PathUncheckedResponse, TResult = void>(
|
|
50
43
|
client: Client,
|
|
51
44
|
processResponseBody: (result: TResponse) => Promise<TResult>,
|
|
52
45
|
expectedStatuses: string[],
|
|
53
|
-
options: GetLongRunningPollerOptions<TResponse
|
|
46
|
+
options: GetLongRunningPollerOptions<TResponse>,
|
|
54
47
|
): PollerLike<OperationState<TResult>, TResult> {
|
|
55
48
|
const { restoreFrom, getInitialResponse, apiVersion } = options;
|
|
56
49
|
if (!restoreFrom && !getInitialResponse) {
|
|
57
|
-
throw new Error(
|
|
58
|
-
"Either restoreFrom or getInitialResponse must be specified"
|
|
59
|
-
);
|
|
50
|
+
throw new Error("Either restoreFrom or getInitialResponse must be specified");
|
|
60
51
|
}
|
|
61
52
|
let initialResponse: TResponse | undefined = undefined;
|
|
62
53
|
const pollAbortController = new AbortController();
|
|
63
54
|
const poller: RunningOperation<TResponse> = {
|
|
64
55
|
sendInitialRequest: async () => {
|
|
65
56
|
if (!getInitialResponse) {
|
|
66
|
-
throw new Error(
|
|
67
|
-
"getInitialResponse is required when initializing a new poller"
|
|
68
|
-
);
|
|
57
|
+
throw new Error("getInitialResponse is required when initializing a new poller");
|
|
69
58
|
}
|
|
70
59
|
initialResponse = await getInitialResponse();
|
|
71
60
|
return getLroResponse(initialResponse, expectedStatuses);
|
|
@@ -74,7 +63,7 @@ export function getLongRunningPoller<
|
|
|
74
63
|
path: string,
|
|
75
64
|
pollOptions?: {
|
|
76
65
|
abortSignal?: AbortSignalLike;
|
|
77
|
-
}
|
|
66
|
+
},
|
|
78
67
|
) => {
|
|
79
68
|
// The poll request would both listen to the user provided abort signal and the poller's own abort signal
|
|
80
69
|
function abortListener(): void {
|
|
@@ -87,17 +76,15 @@ export function getLongRunningPoller<
|
|
|
87
76
|
pollAbortController.abort();
|
|
88
77
|
} else if (!abortSignal.aborted) {
|
|
89
78
|
options.abortSignal?.addEventListener("abort", abortListener, {
|
|
90
|
-
once: true
|
|
79
|
+
once: true,
|
|
91
80
|
});
|
|
92
81
|
pollOptions?.abortSignal?.addEventListener("abort", abortListener, {
|
|
93
|
-
once: true
|
|
82
|
+
once: true,
|
|
94
83
|
});
|
|
95
84
|
}
|
|
96
85
|
let response;
|
|
97
86
|
try {
|
|
98
|
-
const pollingPath = apiVersion
|
|
99
|
-
? addApiVersionToUrl(path, apiVersion)
|
|
100
|
-
: path;
|
|
87
|
+
const pollingPath = apiVersion ? addApiVersionToUrl(path, apiVersion) : path;
|
|
101
88
|
response = await client.pathUnchecked(pollingPath).get({ abortSignal });
|
|
102
89
|
} finally {
|
|
103
90
|
options.abortSignal?.removeEventListener("abort", abortListener);
|
|
@@ -105,7 +92,7 @@ export function getLongRunningPoller<
|
|
|
105
92
|
}
|
|
106
93
|
|
|
107
94
|
return getLroResponse(response as TResponse, expectedStatuses);
|
|
108
|
-
}
|
|
95
|
+
},
|
|
109
96
|
};
|
|
110
97
|
return createHttpPoller(poller, {
|
|
111
98
|
intervalInMs: options?.updateIntervalInMs,
|
|
@@ -113,7 +100,7 @@ export function getLongRunningPoller<
|
|
|
113
100
|
restoreFrom: options?.restoreFrom,
|
|
114
101
|
processResult: (result: unknown) => {
|
|
115
102
|
return processResponseBody(result as TResponse);
|
|
116
|
-
}
|
|
103
|
+
},
|
|
117
104
|
});
|
|
118
105
|
}
|
|
119
106
|
/**
|
|
@@ -124,7 +111,7 @@ export function getLongRunningPoller<
|
|
|
124
111
|
*/
|
|
125
112
|
function getLroResponse<TResponse extends PathUncheckedResponse>(
|
|
126
113
|
response: TResponse,
|
|
127
|
-
expectedStatuses: string[]
|
|
114
|
+
expectedStatuses: string[],
|
|
128
115
|
): OperationResponse<TResponse> {
|
|
129
116
|
if (!expectedStatuses.includes(response.status)) {
|
|
130
117
|
throw createRestError(response);
|
|
@@ -135,8 +122,8 @@ function getLroResponse<TResponse extends PathUncheckedResponse>(
|
|
|
135
122
|
rawResponse: {
|
|
136
123
|
...response,
|
|
137
124
|
statusCode: Number.parseInt(response.status),
|
|
138
|
-
body: response.body
|
|
139
|
-
}
|
|
125
|
+
body: response.body,
|
|
126
|
+
},
|
|
140
127
|
};
|
|
141
128
|
}
|
|
142
129
|
|
|
@@ -4,10 +4,7 @@
|
|
|
4
4
|
* @param properties The list of property names to check on the item.
|
|
5
5
|
* @returns True if all specified properties are undefined, otherwise false.
|
|
6
6
|
*/
|
|
7
|
-
export function areAllPropsUndefined(
|
|
8
|
-
item: Record<string, any>,
|
|
9
|
-
properties: string[]
|
|
10
|
-
): boolean {
|
|
7
|
+
export function areAllPropsUndefined(item: Record<string, any>, properties: string[]): boolean {
|
|
11
8
|
for (const property of properties) {
|
|
12
9
|
if (item[property] !== undefined) {
|
|
13
10
|
return false;
|
|
@@ -5,7 +5,9 @@ import { HttpResponse, StreamableMethod } from "@azure-rest/core-client";
|
|
|
5
5
|
* to bypass Core's default response handling. This works around an issue where binary bodies in Core
|
|
6
6
|
* are coerced into UTF-8, regardless of whether the body is valid UTF-8 or not.
|
|
7
7
|
*/
|
|
8
|
-
export async function getBinaryResponse(
|
|
8
|
+
export async function getBinaryResponse(
|
|
9
|
+
streamableMethod: StreamableMethod,
|
|
10
|
+
): Promise<HttpResponse & { body?: Uint8Array }> {
|
|
9
11
|
const response = await streamableMethod.asBrowserStream();
|
|
10
12
|
|
|
11
13
|
if (response.body === undefined) {
|
|
@@ -7,7 +7,7 @@ import { Buffer } from "node:buffer";
|
|
|
7
7
|
* are coerced into UTF-8, regardless of whether the body is valid UTF-8 or not.
|
|
8
8
|
*/
|
|
9
9
|
export async function getBinaryResponse(
|
|
10
|
-
streamableMethod: StreamableMethod
|
|
10
|
+
streamableMethod: StreamableMethod,
|
|
11
11
|
): Promise<HttpResponse & { body?: Uint8Array }> {
|
|
12
12
|
const response = await streamableMethod.asNodeStream();
|
|
13
13
|
if (response.body === undefined) {
|
|
@@ -20,6 +20,6 @@ export async function getBinaryResponse(
|
|
|
20
20
|
|
|
21
21
|
return {
|
|
22
22
|
...response,
|
|
23
|
-
body: Buffer.concat(bufs)
|
|
23
|
+
body: Buffer.concat(bufs),
|
|
24
24
|
};
|
|
25
25
|
}
|
|
@@ -7,9 +7,7 @@ import { NodeReadableStream } from "../platform-types-browser.mjs";
|
|
|
7
7
|
* Error handling is left to the caller so that generated deserializers can apply
|
|
8
8
|
* operation-specific error deserialization (per-status-code details, exception headers, etc.).
|
|
9
9
|
*/
|
|
10
|
-
export async function getBinaryStreamResponse(
|
|
11
|
-
streamableMethod: StreamableMethod
|
|
12
|
-
): Promise<
|
|
10
|
+
export async function getBinaryStreamResponse(streamableMethod: StreamableMethod): Promise<
|
|
13
11
|
HttpResponse & {
|
|
14
12
|
blobBody?: Promise<Blob>;
|
|
15
13
|
readableStreamBody?: NodeReadableStream;
|