@azure-tools/typespec-ts 0.54.0 → 0.55.0-dev.6
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/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,9 +1,9 @@
|
|
|
1
|
-
import { getAllAncestors } from "../helpers/operationHelpers.js";
|
|
2
1
|
import {
|
|
3
2
|
SdkModelPropertyType,
|
|
4
3
|
SdkModelType,
|
|
5
|
-
SdkType
|
|
4
|
+
SdkType,
|
|
6
5
|
} from "@azure-tools/typespec-client-generator-core";
|
|
6
|
+
import { getAllAncestors } from "../helpers/operationHelpers.js";
|
|
7
7
|
import { getDirectSubtypes } from "../helpers/typeHelpers.js";
|
|
8
8
|
|
|
9
9
|
/**
|
|
@@ -14,7 +14,7 @@ import { getDirectSubtypes } from "../helpers/typeHelpers.js";
|
|
|
14
14
|
*/
|
|
15
15
|
export function getAllDiscriminatedValues(
|
|
16
16
|
type: SdkModelType,
|
|
17
|
-
discriminatorProperty?: SdkModelPropertyType
|
|
17
|
+
discriminatorProperty?: SdkModelPropertyType,
|
|
18
18
|
) {
|
|
19
19
|
if (!type.discriminatorValue) {
|
|
20
20
|
return [];
|
|
@@ -30,8 +30,7 @@ export function getAllDiscriminatedValues(
|
|
|
30
30
|
// Check if this model is a subtype of the given discriminator property
|
|
31
31
|
if (
|
|
32
32
|
!!discriminatorProperty &&
|
|
33
|
-
model.baseModel?.discriminatorProperty?.name ===
|
|
34
|
-
discriminatorProperty?.name
|
|
33
|
+
model.baseModel?.discriminatorProperty?.name === discriminatorProperty?.name
|
|
35
34
|
) {
|
|
36
35
|
values.push(model.discriminatorValue);
|
|
37
36
|
if (model.discriminatorProperty?.name === discriminatorProperty.name) {
|
|
@@ -46,10 +45,7 @@ export function getAllDiscriminatedValues(
|
|
|
46
45
|
|
|
47
46
|
export function isSupportedSerializeType(type: SdkType): boolean {
|
|
48
47
|
return (
|
|
49
|
-
type.kind === "model" ||
|
|
50
|
-
type.kind === "dict" ||
|
|
51
|
-
type.kind === "array" ||
|
|
52
|
-
type.kind === "union"
|
|
48
|
+
type.kind === "model" || type.kind === "dict" || type.kind === "array" || type.kind === "union"
|
|
53
49
|
);
|
|
54
50
|
}
|
|
55
51
|
|
|
@@ -68,7 +64,7 @@ export function isSupportedSerializeType(type: SdkType): boolean {
|
|
|
68
64
|
const specialVariantMap = new Map<SdkType, boolean>();
|
|
69
65
|
export function isSpecialUnionVariant(
|
|
70
66
|
t: SdkType & { isNonExhaustive?: boolean },
|
|
71
|
-
variantStack: SdkType[] = []
|
|
67
|
+
variantStack: SdkType[] = [],
|
|
72
68
|
): boolean {
|
|
73
69
|
if (variantStack.length <= 0) {
|
|
74
70
|
variantStack.push(t);
|
|
@@ -91,15 +87,13 @@ export function isSpecialUnionVariant(
|
|
|
91
87
|
ancestors.includes(p.type) ||
|
|
92
88
|
(p.type.kind === "array" &&
|
|
93
89
|
p.type.valueType &&
|
|
94
|
-
(variantStack.includes(p.type.valueType) ||
|
|
95
|
-
ancestors.includes(p.type.valueType)))
|
|
90
|
+
(variantStack.includes(p.type.valueType) || ancestors.includes(p.type.valueType)))
|
|
96
91
|
);
|
|
97
92
|
})
|
|
98
93
|
?.some(
|
|
99
94
|
(p) =>
|
|
100
|
-
// eslint-disable-next-line
|
|
101
95
|
(p.kind === "property" && p.name !== p.serializedName) ||
|
|
102
|
-
isSpecialUnionVariant(p.type, [...variantStack, p.type])
|
|
96
|
+
isSpecialUnionVariant(p.type, [...variantStack, p.type]),
|
|
103
97
|
)) ||
|
|
104
98
|
isPolymorphicUnion(t) ||
|
|
105
99
|
(t.kind === "array" &&
|
|
@@ -138,21 +132,17 @@ export function isNormalUnion(t: SdkType): boolean {
|
|
|
138
132
|
}
|
|
139
133
|
|
|
140
134
|
export function isDiscriminatedUnion(
|
|
141
|
-
type: SdkType
|
|
135
|
+
type: SdkType,
|
|
142
136
|
): type is SdkModelType & { discriminatorProperty: SdkType } {
|
|
143
137
|
if (!type) {
|
|
144
138
|
return false;
|
|
145
139
|
}
|
|
146
140
|
return Boolean(
|
|
147
|
-
type?.kind === "model" &&
|
|
148
|
-
type.discriminatorProperty &&
|
|
149
|
-
type.discriminatedSubtypes
|
|
141
|
+
type?.kind === "model" && type.discriminatorProperty && type.discriminatedSubtypes,
|
|
150
142
|
);
|
|
151
143
|
}
|
|
152
144
|
|
|
153
|
-
export function isSpecialHandledUnion(
|
|
154
|
-
t: SdkType & { isNonExhaustive?: boolean }
|
|
155
|
-
): boolean {
|
|
145
|
+
export function isSpecialHandledUnion(t: SdkType & { isNonExhaustive?: boolean }): boolean {
|
|
156
146
|
return isDiscriminatedUnion(t!) || isPolymorphicUnion(t);
|
|
157
147
|
}
|
|
158
148
|
|
|
@@ -210,7 +200,7 @@ export interface ModelOverrideOptions {
|
|
|
210
200
|
|
|
211
201
|
export function getPropertyWithOverrides(
|
|
212
202
|
property: SdkModelPropertyType,
|
|
213
|
-
overrides?: ModelOverrideOptions
|
|
203
|
+
overrides?: ModelOverrideOptions,
|
|
214
204
|
): SdkModelPropertyType {
|
|
215
205
|
if (!overrides) {
|
|
216
206
|
return property;
|
|
@@ -1,16 +1,13 @@
|
|
|
1
|
+
import { makeBrowserTestConfig, makeConfig } from "@azure/dev-tool/shared-config/rollup";
|
|
1
2
|
import cjs from "@rollup/plugin-commonjs";
|
|
2
3
|
import inject from "@rollup/plugin-inject";
|
|
3
4
|
import json from "@rollup/plugin-json";
|
|
4
5
|
import multiEntry from "@rollup/plugin-multi-entry";
|
|
5
6
|
import nodeResolve from "@rollup/plugin-node-resolve";
|
|
6
7
|
import replace from "@rollup/plugin-replace";
|
|
8
|
+
import typescript from "@rollup/plugin-typescript";
|
|
7
9
|
import shim from "rollup-plugin-shim";
|
|
8
10
|
import sourcemaps from "rollup-plugin-sourcemaps";
|
|
9
|
-
import typescript from "@rollup/plugin-typescript";
|
|
10
|
-
import {
|
|
11
|
-
makeConfig,
|
|
12
|
-
makeBrowserTestConfig
|
|
13
|
-
} from "@azure/dev-tool/shared-config/rollup";
|
|
14
11
|
|
|
15
12
|
const inputs = makeConfig(require("./package.json"));
|
|
16
13
|
|
|
@@ -26,7 +23,7 @@ function makeBrowserTestConfigPatch() {
|
|
|
26
23
|
config.plugins = [
|
|
27
24
|
multiEntry({ exports: false }),
|
|
28
25
|
typescript({
|
|
29
|
-
exclude: ["test/**/*.spec.ts"]
|
|
26
|
+
exclude: ["test/**/*.spec.ts"],
|
|
30
27
|
}),
|
|
31
28
|
sourcemaps(),
|
|
32
29
|
replace({
|
|
@@ -36,29 +33,29 @@ function makeBrowserTestConfigPatch() {
|
|
|
36
33
|
// browser only. Rollup's dead code elimination will remove
|
|
37
34
|
// any code guarded by if (isNode) { ... }
|
|
38
35
|
"if (isNode)": "if (false)",
|
|
39
|
-
"if (!isNode)": "if (true)"
|
|
36
|
+
"if (!isNode)": "if (true)",
|
|
40
37
|
}),
|
|
41
38
|
// fs, net, and tls are used by rhea and need to be shimmed
|
|
42
39
|
// dotenv doesn't work in the browser, so replace it with a no-op function
|
|
43
40
|
shim({
|
|
44
|
-
dotenv: `export function config() { }
|
|
41
|
+
dotenv: `export function config() { }`,
|
|
45
42
|
}),
|
|
46
43
|
nodeResolve({
|
|
47
44
|
mainFields: ["module", "browser"],
|
|
48
|
-
preferBuiltins: false
|
|
45
|
+
preferBuiltins: false,
|
|
49
46
|
}),
|
|
50
47
|
cjs({
|
|
51
48
|
namedExports: {
|
|
52
|
-
chai: ["should", "assert"]
|
|
53
|
-
}
|
|
49
|
+
chai: ["should", "assert"],
|
|
50
|
+
},
|
|
54
51
|
}),
|
|
55
52
|
inject({
|
|
56
53
|
modules: {
|
|
57
|
-
process: "process"
|
|
54
|
+
process: "process",
|
|
58
55
|
},
|
|
59
|
-
exclude: ["./**/package.json"]
|
|
56
|
+
exclude: ["./**/package.json"],
|
|
60
57
|
}),
|
|
61
|
-
json()
|
|
58
|
+
json(),
|
|
62
59
|
];
|
|
63
60
|
|
|
64
61
|
return config;
|
|
@@ -5,7 +5,7 @@ import * as fs from "fs";
|
|
|
5
5
|
import * as path from "path";
|
|
6
6
|
import * as url from "url";
|
|
7
7
|
|
|
8
|
-
const __dirname = url.fileURLToPath(new URL(
|
|
8
|
+
const __dirname = url.fileURLToPath(new URL(".", import.meta.url));
|
|
9
9
|
const destinationPath = path.join(__dirname, "../dist/");
|
|
10
10
|
|
|
11
11
|
const inputFile = path.join(destinationPath, "index.js");
|
|
@@ -14,4 +14,4 @@ const inputMapFile = path.join(destinationPath, "index.js.map");
|
|
|
14
14
|
if (fs.existsSync(inputFile) && fs.existsSync(inputMapFile)) {
|
|
15
15
|
fs.renameSync(inputFile, path.join(destinationPath, "index.cjs"));
|
|
16
16
|
fs.renameSync(inputMapFile, path.join(destinationPath, "index.cjs.map"));
|
|
17
|
-
}
|
|
17
|
+
}
|
|
@@ -2,275 +2,275 @@ export const SerializationHelpers = {
|
|
|
2
2
|
buildMultiCollection: {
|
|
3
3
|
kind: "function",
|
|
4
4
|
name: "buildMultiCollection",
|
|
5
|
-
location: "serialization/build-multi-collection.ts"
|
|
5
|
+
location: "serialization/build-multi-collection.ts",
|
|
6
6
|
},
|
|
7
7
|
buildCsvCollection: {
|
|
8
8
|
kind: "function",
|
|
9
9
|
name: "buildCsvCollection",
|
|
10
|
-
location: "serialization/build-csv-collection.ts"
|
|
10
|
+
location: "serialization/build-csv-collection.ts",
|
|
11
11
|
},
|
|
12
12
|
buildPipeCollection: {
|
|
13
13
|
kind: "function",
|
|
14
14
|
name: "buildPipeCollection",
|
|
15
|
-
location: "serialization/build-pipe-collection.ts"
|
|
15
|
+
location: "serialization/build-pipe-collection.ts",
|
|
16
16
|
},
|
|
17
17
|
buildSsvCollection: {
|
|
18
18
|
kind: "function",
|
|
19
19
|
name: "buildSsvCollection",
|
|
20
|
-
location: "serialization/build-ssv-collection.ts"
|
|
20
|
+
location: "serialization/build-ssv-collection.ts",
|
|
21
21
|
},
|
|
22
22
|
buildTsvCollection: {
|
|
23
23
|
kind: "function",
|
|
24
24
|
name: "buildTsvCollection",
|
|
25
|
-
location: "serialization/build-tsv-collection.ts"
|
|
25
|
+
location: "serialization/build-tsv-collection.ts",
|
|
26
26
|
},
|
|
27
27
|
buildNewlineCollection: {
|
|
28
28
|
kind: "function",
|
|
29
29
|
name: "buildNewlineCollection",
|
|
30
|
-
location: "serialization/build-newline-collection.ts"
|
|
30
|
+
location: "serialization/build-newline-collection.ts",
|
|
31
31
|
},
|
|
32
32
|
parseCsvCollection: {
|
|
33
33
|
kind: "function",
|
|
34
34
|
name: "parseCsvCollection",
|
|
35
|
-
location: "serialization/parse-csv-collection.ts"
|
|
35
|
+
location: "serialization/parse-csv-collection.ts",
|
|
36
36
|
},
|
|
37
37
|
parsePipeCollection: {
|
|
38
38
|
kind: "function",
|
|
39
39
|
name: "parsePipeCollection",
|
|
40
|
-
location: "serialization/parse-pipe-collection.ts"
|
|
40
|
+
location: "serialization/parse-pipe-collection.ts",
|
|
41
41
|
},
|
|
42
42
|
parseSsvCollection: {
|
|
43
43
|
kind: "function",
|
|
44
44
|
name: "parseSsvCollection",
|
|
45
|
-
location: "serialization/parse-ssv-collection.ts"
|
|
45
|
+
location: "serialization/parse-ssv-collection.ts",
|
|
46
46
|
},
|
|
47
47
|
parseNewlineCollection: {
|
|
48
48
|
kind: "function",
|
|
49
49
|
name: "parseNewlineCollection",
|
|
50
|
-
location: "serialization/parse-newline-collection.ts"
|
|
50
|
+
location: "serialization/parse-newline-collection.ts",
|
|
51
51
|
},
|
|
52
52
|
serializeRecord: {
|
|
53
53
|
kind: "function",
|
|
54
54
|
name: "serializeRecord",
|
|
55
|
-
location: "serialization/serialize-record.ts"
|
|
55
|
+
location: "serialization/serialize-record.ts",
|
|
56
56
|
},
|
|
57
57
|
getBinaryResponse: {
|
|
58
58
|
kind: "function",
|
|
59
59
|
name: "getBinaryResponse",
|
|
60
|
-
location: "serialization/get-binary-response.ts"
|
|
60
|
+
location: "serialization/get-binary-response.ts",
|
|
61
61
|
},
|
|
62
62
|
getBinaryStreamResponse: {
|
|
63
63
|
kind: "function",
|
|
64
64
|
name: "getBinaryStreamResponse",
|
|
65
|
-
location: "serialization/get-binary-stream-response.ts"
|
|
65
|
+
location: "serialization/get-binary-stream-response.ts",
|
|
66
66
|
},
|
|
67
67
|
areAllPropsUndefined: {
|
|
68
68
|
kind: "function",
|
|
69
69
|
name: "areAllPropsUndefined",
|
|
70
|
-
location: "serialization/check-prop-undefined.ts"
|
|
71
|
-
}
|
|
70
|
+
location: "serialization/check-prop-undefined.ts",
|
|
71
|
+
},
|
|
72
72
|
} as const;
|
|
73
73
|
|
|
74
74
|
export const PagingHelpers = {
|
|
75
75
|
PageSettings: {
|
|
76
76
|
kind: "interface",
|
|
77
77
|
name: "PageSettings",
|
|
78
|
-
location: "pagingHelpers.ts"
|
|
78
|
+
location: "pagingHelpers.ts",
|
|
79
79
|
},
|
|
80
80
|
ContinuablePage: {
|
|
81
81
|
kind: "typeAlias",
|
|
82
82
|
name: "ContinuablePage",
|
|
83
|
-
location: "pagingHelpers.ts"
|
|
83
|
+
location: "pagingHelpers.ts",
|
|
84
84
|
},
|
|
85
85
|
PagedAsyncIterableIterator: {
|
|
86
86
|
kind: "interface",
|
|
87
87
|
name: "PagedAsyncIterableIterator",
|
|
88
|
-
location: "pagingHelpers.ts"
|
|
88
|
+
location: "pagingHelpers.ts",
|
|
89
89
|
},
|
|
90
90
|
PagedResult: {
|
|
91
91
|
kind: "interface",
|
|
92
92
|
name: "PagedResult",
|
|
93
|
-
location: "pagingHelpers.ts"
|
|
93
|
+
location: "pagingHelpers.ts",
|
|
94
94
|
},
|
|
95
95
|
BuildPagedAsyncIteratorOptions: {
|
|
96
96
|
kind: "interface",
|
|
97
97
|
name: "BuildPagedAsyncIteratorOptions",
|
|
98
|
-
location: "pagingHelpers.ts"
|
|
98
|
+
location: "pagingHelpers.ts",
|
|
99
99
|
},
|
|
100
100
|
BuildPagedAsyncIterator: {
|
|
101
101
|
kind: "function",
|
|
102
102
|
name: "buildPagedAsyncIterator",
|
|
103
|
-
location: "pagingHelpers.ts"
|
|
104
|
-
}
|
|
103
|
+
location: "pagingHelpers.ts",
|
|
104
|
+
},
|
|
105
105
|
} as const;
|
|
106
106
|
|
|
107
107
|
export const PollingHelpers = {
|
|
108
108
|
GetLongRunningPollerOptions: {
|
|
109
109
|
kind: "interface",
|
|
110
110
|
name: "GetLongRunningPollerOptions",
|
|
111
|
-
location: "pollingHelpers.ts"
|
|
111
|
+
location: "pollingHelpers.ts",
|
|
112
112
|
},
|
|
113
113
|
GetLongRunningPoller: {
|
|
114
114
|
kind: "function",
|
|
115
115
|
name: "getLongRunningPoller",
|
|
116
|
-
location: "pollingHelpers.ts"
|
|
117
|
-
}
|
|
116
|
+
location: "pollingHelpers.ts",
|
|
117
|
+
},
|
|
118
118
|
} as const;
|
|
119
119
|
|
|
120
120
|
export const SimplePollerHelpers = {
|
|
121
121
|
SimplePollerLike: {
|
|
122
122
|
kind: "interface",
|
|
123
123
|
name: "SimplePollerLike",
|
|
124
|
-
location: "simplePollerHelpers.ts"
|
|
124
|
+
location: "simplePollerHelpers.ts",
|
|
125
125
|
},
|
|
126
126
|
getSimplePoller: {
|
|
127
127
|
kind: "function",
|
|
128
128
|
name: "getSimplePoller",
|
|
129
|
-
location: "simplePollerHelpers.ts"
|
|
130
|
-
}
|
|
129
|
+
location: "simplePollerHelpers.ts",
|
|
130
|
+
},
|
|
131
131
|
} as const;
|
|
132
132
|
|
|
133
133
|
export const UrlTemplateHelpers = {
|
|
134
134
|
parseTemplate: {
|
|
135
135
|
kind: "function",
|
|
136
136
|
name: "expandUrlTemplate",
|
|
137
|
-
location: "urlTemplate.ts"
|
|
138
|
-
}
|
|
137
|
+
location: "urlTemplate.ts",
|
|
138
|
+
},
|
|
139
139
|
} as const;
|
|
140
140
|
export const MultipartHelpers = {
|
|
141
141
|
FileContents: {
|
|
142
142
|
kind: "typeAlias",
|
|
143
143
|
name: "FileContents",
|
|
144
|
-
location: "multipartHelpers.ts"
|
|
144
|
+
location: "multipartHelpers.ts",
|
|
145
145
|
},
|
|
146
146
|
createFilePartDescriptor: {
|
|
147
147
|
kind: "function",
|
|
148
148
|
name: "createFilePartDescriptor",
|
|
149
|
-
location: "multipartHelpers.ts"
|
|
150
|
-
}
|
|
149
|
+
location: "multipartHelpers.ts",
|
|
150
|
+
},
|
|
151
151
|
} as const;
|
|
152
152
|
|
|
153
153
|
export const PlatformTypeHelpers = {
|
|
154
154
|
NodeReadableStream: {
|
|
155
155
|
kind: "typeAlias",
|
|
156
156
|
name: "NodeReadableStream",
|
|
157
|
-
location: "platform-types.ts"
|
|
158
|
-
}
|
|
157
|
+
location: "platform-types.ts",
|
|
158
|
+
},
|
|
159
159
|
} as const;
|
|
160
160
|
|
|
161
161
|
export const CloudSettingHelpers = {
|
|
162
162
|
AzureClouds: {
|
|
163
163
|
kind: "enum",
|
|
164
164
|
name: "AzureClouds",
|
|
165
|
-
location: "cloudSettingHelpers.ts"
|
|
165
|
+
location: "cloudSettingHelpers.ts",
|
|
166
166
|
},
|
|
167
167
|
AzureSupportedClouds: {
|
|
168
168
|
kind: "typeAlias",
|
|
169
169
|
name: "AzureSupportedClouds",
|
|
170
|
-
location: "cloudSettingHelpers.ts"
|
|
170
|
+
location: "cloudSettingHelpers.ts",
|
|
171
171
|
},
|
|
172
172
|
getArmEndpoint: {
|
|
173
173
|
kind: "function",
|
|
174
174
|
name: "getArmEndpoint",
|
|
175
|
-
location: "cloudSettingHelpers.ts"
|
|
176
|
-
}
|
|
175
|
+
location: "cloudSettingHelpers.ts",
|
|
176
|
+
},
|
|
177
177
|
} as const;
|
|
178
178
|
|
|
179
179
|
export const CreateRecorderHelpers = {
|
|
180
180
|
createRecorder: {
|
|
181
181
|
kind: "function",
|
|
182
182
|
name: "createRecorder",
|
|
183
|
-
location: "recordedClient.ts"
|
|
184
|
-
}
|
|
183
|
+
location: "recordedClient.ts",
|
|
184
|
+
},
|
|
185
185
|
} as const;
|
|
186
186
|
|
|
187
187
|
export const XmlHelpers = {
|
|
188
188
|
XmlSerializationOptions: {
|
|
189
189
|
kind: "interface",
|
|
190
190
|
name: "XmlSerializationOptions",
|
|
191
|
-
location: "serialization/xml-helpers.ts"
|
|
191
|
+
location: "serialization/xml-helpers.ts",
|
|
192
192
|
},
|
|
193
193
|
XmlPropertyMetadata: {
|
|
194
194
|
kind: "interface",
|
|
195
195
|
name: "XmlPropertyMetadata",
|
|
196
|
-
location: "serialization/xml-helpers.ts"
|
|
196
|
+
location: "serialization/xml-helpers.ts",
|
|
197
197
|
},
|
|
198
198
|
XmlPropertyDeserializeMetadata: {
|
|
199
199
|
kind: "interface",
|
|
200
200
|
name: "XmlPropertyDeserializeMetadata",
|
|
201
|
-
location: "serialization/xml-helpers.ts"
|
|
201
|
+
location: "serialization/xml-helpers.ts",
|
|
202
202
|
},
|
|
203
203
|
XmlAdditionalPropertiesConfig: {
|
|
204
204
|
kind: "interface",
|
|
205
205
|
name: "XmlAdditionalPropertiesConfig",
|
|
206
|
-
location: "serialization/xml-helpers.ts"
|
|
206
|
+
location: "serialization/xml-helpers.ts",
|
|
207
207
|
},
|
|
208
208
|
serializeModelToXml: {
|
|
209
209
|
kind: "function",
|
|
210
210
|
name: "serializeModelToXml",
|
|
211
|
-
location: "serialization/xml-helpers.ts"
|
|
211
|
+
location: "serialization/xml-helpers.ts",
|
|
212
212
|
},
|
|
213
213
|
serializeToXml: {
|
|
214
214
|
kind: "function",
|
|
215
215
|
name: "serializeToXml",
|
|
216
|
-
location: "serialization/xml-helpers.ts"
|
|
216
|
+
location: "serialization/xml-helpers.ts",
|
|
217
217
|
},
|
|
218
218
|
xmlObjectToString: {
|
|
219
219
|
kind: "function",
|
|
220
220
|
name: "xmlObjectToString",
|
|
221
|
-
location: "serialization/xml-helpers.ts"
|
|
221
|
+
location: "serialization/xml-helpers.ts",
|
|
222
222
|
},
|
|
223
223
|
parseXmlString: {
|
|
224
224
|
kind: "function",
|
|
225
225
|
name: "parseXmlString",
|
|
226
|
-
location: "serialization/xml-helpers.ts"
|
|
226
|
+
location: "serialization/xml-helpers.ts",
|
|
227
227
|
},
|
|
228
228
|
deserializeXmlToModel: {
|
|
229
229
|
kind: "function",
|
|
230
230
|
name: "deserializeXmlToModel",
|
|
231
|
-
location: "serialization/xml-helpers.ts"
|
|
231
|
+
location: "serialization/xml-helpers.ts",
|
|
232
232
|
},
|
|
233
233
|
deserializeFromXml: {
|
|
234
234
|
kind: "function",
|
|
235
235
|
name: "deserializeFromXml",
|
|
236
|
-
location: "serialization/xml-helpers.ts"
|
|
236
|
+
location: "serialization/xml-helpers.ts",
|
|
237
237
|
},
|
|
238
238
|
deserializeXmlObject: {
|
|
239
239
|
kind: "function",
|
|
240
240
|
name: "deserializeXmlObject",
|
|
241
|
-
location: "serialization/xml-helpers.ts"
|
|
241
|
+
location: "serialization/xml-helpers.ts",
|
|
242
242
|
},
|
|
243
243
|
isXmlContentType: {
|
|
244
244
|
kind: "function",
|
|
245
245
|
name: "isXmlContentType",
|
|
246
|
-
location: "serialization/xml-helpers.ts"
|
|
246
|
+
location: "serialization/xml-helpers.ts",
|
|
247
247
|
},
|
|
248
248
|
isJsonContentType: {
|
|
249
249
|
kind: "function",
|
|
250
250
|
name: "isJsonContentType",
|
|
251
|
-
location: "serialization/xml-helpers.ts"
|
|
251
|
+
location: "serialization/xml-helpers.ts",
|
|
252
252
|
},
|
|
253
253
|
XmlSerializedObject: {
|
|
254
254
|
kind: "interface",
|
|
255
255
|
name: "XmlSerializedObject",
|
|
256
|
-
location: "serialization/xml-helpers.ts"
|
|
257
|
-
}
|
|
256
|
+
location: "serialization/xml-helpers.ts",
|
|
257
|
+
},
|
|
258
258
|
} as const;
|
|
259
259
|
|
|
260
260
|
export const StorageCompatHelpers = {
|
|
261
261
|
StorageCompatResponseInfo: {
|
|
262
262
|
kind: "interface",
|
|
263
263
|
name: "StorageCompatResponseInfo",
|
|
264
|
-
location: "storageCompatResponse.ts"
|
|
264
|
+
location: "storageCompatResponse.ts",
|
|
265
265
|
},
|
|
266
266
|
createStorageCompatOnResponse: {
|
|
267
267
|
kind: "function",
|
|
268
268
|
name: "createStorageCompatOnResponse",
|
|
269
|
-
location: "storageCompatResponse.ts"
|
|
269
|
+
location: "storageCompatResponse.ts",
|
|
270
270
|
},
|
|
271
271
|
addStorageCompatResponse: {
|
|
272
272
|
kind: "function",
|
|
273
273
|
name: "addStorageCompatResponse",
|
|
274
|
-
location: "storageCompatResponse.ts"
|
|
275
|
-
}
|
|
274
|
+
location: "storageCompatResponse.ts",
|
|
275
|
+
},
|
|
276
276
|
} as const;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { SdkCredentialType } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
-
import { resolveReference } from "../../framework/reference.js";
|
|
3
2
|
import { useDependencies } from "../../framework/hooks/useDependencies.js";
|
|
3
|
+
import { resolveReference } from "../../framework/reference.js";
|
|
4
4
|
|
|
5
5
|
export function getCredentialExpression(type: SdkCredentialType): string {
|
|
6
6
|
const dependencies = useDependencies();
|
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
import { SdkEnumType } from "@azure-tools/typespec-client-generator-core";
|
|
2
2
|
import { resolveReference } from "../../framework/reference.js";
|
|
3
|
-
import { getTypeExpression, EmitTypeOptions } from "./get-type-expression.js";
|
|
4
|
-
import { shouldEmitInline } from "./utils.js";
|
|
5
3
|
import { SdkContext } from "../../utils/interfaces.js";
|
|
4
|
+
import { EmitTypeOptions, getTypeExpression } from "./get-type-expression.js";
|
|
5
|
+
import { shouldEmitInline } from "./utils.js";
|
|
6
6
|
|
|
7
7
|
export function getEnumExpression(
|
|
8
8
|
context: SdkContext,
|
|
9
9
|
type: SdkEnumType,
|
|
10
|
-
options: EmitTypeOptions = {}
|
|
10
|
+
options: EmitTypeOptions = {},
|
|
11
11
|
): string {
|
|
12
12
|
if (shouldEmitInline(type, options)) {
|
|
13
13
|
return !isExtensibleEnum(context, type)
|
|
@@ -18,11 +18,6 @@ export function getEnumExpression(
|
|
|
18
18
|
}
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
export function isExtensibleEnum(
|
|
22
|
-
context
|
|
23
|
-
type: SdkEnumType
|
|
24
|
-
): boolean {
|
|
25
|
-
return (
|
|
26
|
-
!type.isFixed && context.rlcOptions?.experimentalExtensibleEnums === true
|
|
27
|
-
);
|
|
21
|
+
export function isExtensibleEnum(context: SdkContext, type: SdkEnumType): boolean {
|
|
22
|
+
return !type.isFixed && context.rlcOptions?.experimentalExtensibleEnums === true;
|
|
28
23
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EmitTypeOptions,
|
|
3
3
|
getTypeExpression,
|
|
4
|
-
normalizeModelPropertyName
|
|
4
|
+
normalizeModelPropertyName,
|
|
5
5
|
} from "./get-type-expression.js";
|
|
6
6
|
|
|
7
7
|
import {
|
|
8
8
|
SdkModelPropertyType,
|
|
9
9
|
SdkModelType,
|
|
10
|
-
SdkServiceResponseHeader
|
|
10
|
+
SdkServiceResponseHeader,
|
|
11
11
|
} from "@azure-tools/typespec-client-generator-core";
|
|
12
|
-
import { refkey } from "../../framework/refkey.js";
|
|
13
|
-
import { resolveReference } from "../../framework/reference.js";
|
|
14
|
-
import { shouldEmitInline } from "./utils.js";
|
|
15
12
|
import { useContext } from "../../contextManager.js";
|
|
13
|
+
import { resolveReference } from "../../framework/reference.js";
|
|
14
|
+
import { refkey } from "../../framework/refkey.js";
|
|
16
15
|
import { SdkContext } from "../../utils/interfaces.js";
|
|
17
16
|
import { MultipartHelpers } from "../static-helpers-metadata.js";
|
|
17
|
+
import { shouldEmitInline } from "./utils.js";
|
|
18
18
|
|
|
19
19
|
export interface ModelExpressionOptions extends EmitTypeOptions {
|
|
20
20
|
skipPolymorphicUnion?: boolean;
|
|
@@ -23,7 +23,7 @@ export interface ModelExpressionOptions extends EmitTypeOptions {
|
|
|
23
23
|
export function getModelExpression(
|
|
24
24
|
context: SdkContext,
|
|
25
25
|
type: SdkModelType,
|
|
26
|
-
options: ModelExpressionOptions = {}
|
|
26
|
+
options: ModelExpressionOptions = {},
|
|
27
27
|
): string {
|
|
28
28
|
const externalModel = getExternalModel(type);
|
|
29
29
|
if (externalModel) {
|
|
@@ -43,12 +43,12 @@ export function getModelExpression(
|
|
|
43
43
|
|
|
44
44
|
const externalModels: Record<string, string> = {
|
|
45
45
|
"Azure.Core.Foundations.Error": "ErrorModel",
|
|
46
|
-
"Azure.Core.Foundations.ErrorResponse": "AzureCoreErrorResponse"
|
|
46
|
+
"Azure.Core.Foundations.ErrorResponse": "AzureCoreErrorResponse",
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
export function emitInlineModel(
|
|
50
50
|
context: SdkContext,
|
|
51
|
-
properties: (SdkModelPropertyType | SdkServiceResponseHeader)[]
|
|
51
|
+
properties: (SdkModelPropertyType | SdkServiceResponseHeader)[],
|
|
52
52
|
): string {
|
|
53
53
|
// generate Record<string, any> for empty anonymous object
|
|
54
54
|
if (properties.length === 0) {
|
|
@@ -58,7 +58,7 @@ export function emitInlineModel(
|
|
|
58
58
|
${properties
|
|
59
59
|
.map(
|
|
60
60
|
(p) =>
|
|
61
|
-
`${normalizeModelPropertyName(context, p)}${p.optional ? "?" : ""}: ${getPropertyTypeExpression(context, p)}
|
|
61
|
+
`${normalizeModelPropertyName(context, p)}${p.optional ? "?" : ""}: ${getPropertyTypeExpression(context, p)}`,
|
|
62
62
|
)
|
|
63
63
|
.join(",\n")}
|
|
64
64
|
}`;
|
|
@@ -66,12 +66,9 @@ export function emitInlineModel(
|
|
|
66
66
|
|
|
67
67
|
function getPropertyTypeExpression(
|
|
68
68
|
context: SdkContext,
|
|
69
|
-
property: SdkModelPropertyType | SdkServiceResponseHeader
|
|
69
|
+
property: SdkModelPropertyType | SdkServiceResponseHeader,
|
|
70
70
|
): string {
|
|
71
|
-
if (
|
|
72
|
-
property.kind === "property" &&
|
|
73
|
-
property.serializationOptions.multipart?.isFilePart
|
|
74
|
-
) {
|
|
71
|
+
if (property.kind === "property" && property.serializationOptions.multipart?.isFilePart) {
|
|
75
72
|
return getMultipartFileTypeExpression(context, property);
|
|
76
73
|
}
|
|
77
74
|
return getTypeExpression(context, property.type);
|
|
@@ -79,7 +76,7 @@ function getPropertyTypeExpression(
|
|
|
79
76
|
|
|
80
77
|
export function getMultipartFileTypeExpression(
|
|
81
78
|
context: SdkContext,
|
|
82
|
-
property: SdkModelPropertyType
|
|
79
|
+
property: SdkModelPropertyType,
|
|
83
80
|
): string {
|
|
84
81
|
const multipartOptions = property.serializationOptions.multipart;
|
|
85
82
|
|
|
@@ -88,8 +85,7 @@ export function getMultipartFileTypeExpression(
|
|
|
88
85
|
multipartOptions.contentType.optional ||
|
|
89
86
|
multipartOptions.defaultContentTypes.length > 0;
|
|
90
87
|
const isFilenameOptional =
|
|
91
|
-
multipartOptions?.filename === undefined ||
|
|
92
|
-
multipartOptions.filename.optional;
|
|
88
|
+
multipartOptions?.filename === undefined || multipartOptions.filename.optional;
|
|
93
89
|
|
|
94
90
|
const contentTypeType = multipartOptions?.contentType
|
|
95
91
|
? getTypeExpression(context, multipartOptions.contentType.type)
|
|
@@ -1,18 +1,17 @@
|
|
|
1
1
|
import { SdkNullableType } from "@azure-tools/typespec-client-generator-core";
|
|
2
2
|
import { resolveReference } from "../../framework/reference.js";
|
|
3
|
-
import { getTypeExpression, EmitTypeOptions } from "./get-type-expression.js";
|
|
4
|
-
import { shouldEmitInline } from "./utils.js";
|
|
5
3
|
import { SdkContext } from "../../utils/interfaces.js";
|
|
4
|
+
import { EmitTypeOptions, getTypeExpression } from "./get-type-expression.js";
|
|
5
|
+
import { shouldEmitInline } from "./utils.js";
|
|
6
6
|
|
|
7
7
|
export function getNullableExpression(
|
|
8
8
|
context: SdkContext,
|
|
9
9
|
type: SdkNullableType,
|
|
10
|
-
options: EmitTypeOptions = {}
|
|
10
|
+
options: EmitTypeOptions = {},
|
|
11
11
|
): string {
|
|
12
12
|
if (shouldEmitInline(type, options)) {
|
|
13
13
|
// Check if we should ignore null for optional properties
|
|
14
|
-
const ignoreNullableOnOptional =
|
|
15
|
-
context.rlcOptions?.ignoreNullableOnOptional ?? false;
|
|
14
|
+
const ignoreNullableOnOptional = context.rlcOptions?.ignoreNullableOnOptional ?? false;
|
|
16
15
|
const isOptional = options.isOptional ?? false;
|
|
17
16
|
|
|
18
17
|
const nonNullableType = getTypeExpression(context, type.type, options);
|