@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
|
@@ -2,23 +2,20 @@ import * as path from "path";
|
|
|
2
2
|
|
|
3
3
|
import { ModularEmitterOptions } from "./interfaces.js";
|
|
4
4
|
|
|
5
|
-
import {
|
|
5
|
+
import { SdkClientType, SdkServiceOperation } from "@azure-tools/typespec-client-generator-core";
|
|
6
|
+
import { useContext } from "../contextManager.js";
|
|
7
|
+
import { NameType, normalizeName } from "../rlc-common/index.js";
|
|
8
|
+
import { getModularClientOptions } from "../utils/clientUtils.js";
|
|
6
9
|
import { SdkContext } from "../utils/interfaces.js";
|
|
7
|
-
import {
|
|
8
|
-
SdkClientType,
|
|
9
|
-
SdkServiceOperation
|
|
10
|
-
} from "@azure-tools/typespec-client-generator-core";
|
|
11
10
|
import { getMethodHierarchiesMap } from "../utils/operationUtil.js";
|
|
12
|
-
import {
|
|
13
|
-
import { NameType, normalizeName } from "../rlc-common/index.js";
|
|
14
|
-
import { useContext } from "../contextManager.js";
|
|
11
|
+
import { buildOperationOptions } from "./buildOperations.js";
|
|
15
12
|
|
|
16
13
|
// ====== UTILITIES ======
|
|
17
14
|
|
|
18
15
|
export function buildApiOptions(
|
|
19
16
|
context: SdkContext,
|
|
20
17
|
clientMap: [string[], SdkClientType<SdkServiceOperation>],
|
|
21
|
-
emitterOptions: ModularEmitterOptions
|
|
18
|
+
emitterOptions: ModularEmitterOptions,
|
|
22
19
|
) {
|
|
23
20
|
const project = useContext("outputProject");
|
|
24
21
|
const [_, client] = clientMap;
|
|
@@ -33,12 +30,12 @@ export function buildApiOptions(
|
|
|
33
30
|
subfolder ?? "",
|
|
34
31
|
`api`,
|
|
35
32
|
...prefixes.map((p) => normalizeName(p, NameType.File)),
|
|
36
|
-
"options.ts"
|
|
33
|
+
"options.ts",
|
|
37
34
|
),
|
|
38
35
|
undefined,
|
|
39
36
|
{
|
|
40
|
-
overwrite: true
|
|
41
|
-
}
|
|
37
|
+
overwrite: true,
|
|
38
|
+
},
|
|
42
39
|
);
|
|
43
40
|
operations.forEach((o) => {
|
|
44
41
|
buildOperationOptions(context, [prefixes, o], modelOptionsFile);
|
|
@@ -46,10 +43,7 @@ export function buildApiOptions(
|
|
|
46
43
|
modelOptionsFile
|
|
47
44
|
.getImportDeclarations()
|
|
48
45
|
.filter((id) => {
|
|
49
|
-
return (
|
|
50
|
-
id.isModuleSpecifierRelative() &&
|
|
51
|
-
!id.getModuleSpecifierValue().endsWith(".js")
|
|
52
|
-
);
|
|
46
|
+
return id.isModuleSpecifierRelative() && !id.getModuleSpecifierValue().endsWith(".js");
|
|
53
47
|
})
|
|
54
48
|
.map((id) => {
|
|
55
49
|
id.setModuleSpecifier(id.getModuleSpecifierValue() + ".js");
|
|
@@ -1,52 +1,38 @@
|
|
|
1
1
|
import {
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
SourceFile
|
|
5
|
-
} from "ts-morph";
|
|
6
|
-
import { resolveReference } from "../framework/reference.js";
|
|
7
|
-
import { SdkContext } from "../utils/interfaces.js";
|
|
8
|
-
import {
|
|
2
|
+
isReadOnly,
|
|
3
|
+
SdkClientInitializationType,
|
|
9
4
|
SdkClientType,
|
|
5
|
+
SdkExampleValue,
|
|
10
6
|
SdkHttpOperationExample,
|
|
11
7
|
SdkHttpParameterExampleValue,
|
|
12
|
-
SdkServiceOperation,
|
|
13
|
-
SdkExampleValue,
|
|
14
|
-
SdkClientInitializationType,
|
|
15
8
|
SdkModelPropertyType,
|
|
16
|
-
|
|
9
|
+
SdkServiceOperation,
|
|
17
10
|
} from "@azure-tools/typespec-client-generator-core";
|
|
18
|
-
import {
|
|
19
|
-
isAzurePackage,
|
|
20
|
-
NameType,
|
|
21
|
-
normalizeName
|
|
22
|
-
} from "../rlc-common/index.js";
|
|
23
|
-
import { useContext } from "../contextManager.js";
|
|
11
|
+
import { NoTarget } from "@typespec/compiler";
|
|
24
12
|
import { join } from "path";
|
|
25
|
-
import {
|
|
13
|
+
import { FunctionDeclarationStructure, SourceFile, StructureKind } from "ts-morph";
|
|
14
|
+
import { useContext } from "../contextManager.js";
|
|
15
|
+
import { resolveReference } from "../framework/reference.js";
|
|
26
16
|
import { reportDiagnostic } from "../index.js";
|
|
27
|
-
import {
|
|
28
|
-
import {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} from "
|
|
32
|
-
import { getClassicalClientName } from "./helpers/namingHelpers.js";
|
|
33
|
-
import {
|
|
34
|
-
hasKeyCredential,
|
|
35
|
-
hasTokenCredential
|
|
36
|
-
} from "../utils/credentialUtils.js";
|
|
17
|
+
import { AzureIdentityDependencies } from "../modular/external-dependencies.js";
|
|
18
|
+
import { isAzurePackage, NameType, normalizeName } from "../rlc-common/index.js";
|
|
19
|
+
import { getSubscriptionId } from "../transform/transfromRLCOptions.js";
|
|
20
|
+
import { hasKeyCredential, hasTokenCredential } from "../utils/credentialUtils.js";
|
|
21
|
+
import { SdkContext } from "../utils/interfaces.js";
|
|
37
22
|
import {
|
|
38
23
|
getMethodHierarchiesMap,
|
|
39
24
|
isTenantLevelOperation,
|
|
40
|
-
ServiceOperation
|
|
25
|
+
ServiceOperation,
|
|
41
26
|
} from "../utils/operationUtil.js";
|
|
42
|
-
import { getSubscriptionId } from "../transform/transfromRLCOptions.js";
|
|
43
27
|
import {
|
|
44
|
-
|
|
28
|
+
getClientParameterName,
|
|
45
29
|
getClientParameters,
|
|
30
|
+
getClientParametersDeclaration,
|
|
46
31
|
hasDefaultValue,
|
|
47
|
-
getClientParameterName
|
|
48
32
|
} from "./helpers/clientHelpers.js";
|
|
33
|
+
import { getClassicalClientName } from "./helpers/namingHelpers.js";
|
|
49
34
|
import { getOperationFunction } from "./helpers/operationHelpers.js";
|
|
35
|
+
import { buildPropertyNameMapper, isSpreadBodyParameter } from "./helpers/typeHelpers.js";
|
|
50
36
|
import { ModelOverrideOptions } from "./serialization/serializeUtils.js";
|
|
51
37
|
|
|
52
38
|
/**
|
|
@@ -79,7 +65,7 @@ export function emitSamples(dpgContext: SdkContext): SourceFile[] {
|
|
|
79
65
|
subFolder:
|
|
80
66
|
clients.length > 1
|
|
81
67
|
? normalizeName(getClassicalClientName(client), NameType.File)
|
|
82
|
-
: undefined
|
|
68
|
+
: undefined,
|
|
83
69
|
});
|
|
84
70
|
}
|
|
85
71
|
return generatedFiles;
|
|
@@ -88,7 +74,7 @@ export function emitSamples(dpgContext: SdkContext): SourceFile[] {
|
|
|
88
74
|
function emitClientSamples(
|
|
89
75
|
dpgContext: SdkContext,
|
|
90
76
|
client: SdkClientType<SdkServiceOperation>,
|
|
91
|
-
options: EmitSampleOptions
|
|
77
|
+
options: EmitSampleOptions,
|
|
92
78
|
) {
|
|
93
79
|
const methodMap = getMethodHierarchiesMap(dpgContext, client);
|
|
94
80
|
for (const [prefixKey, operations] of methodMap) {
|
|
@@ -102,7 +88,7 @@ function emitClientSamples(
|
|
|
102
88
|
emitMethodSamples(dpgContext, op, {
|
|
103
89
|
...options,
|
|
104
90
|
classicalMethodPrefix: prefix,
|
|
105
|
-
hierarchies: hierarchies
|
|
91
|
+
hierarchies: hierarchies,
|
|
106
92
|
});
|
|
107
93
|
}
|
|
108
94
|
}
|
|
@@ -111,48 +97,39 @@ function emitClientSamples(
|
|
|
111
97
|
function emitMethodSamples(
|
|
112
98
|
dpgContext: SdkContext,
|
|
113
99
|
method: ServiceOperation,
|
|
114
|
-
options: EmitSampleOptions
|
|
100
|
+
options: EmitSampleOptions,
|
|
115
101
|
): SourceFile | undefined {
|
|
116
102
|
const examples = method.operation.examples ?? [];
|
|
117
103
|
if (examples.length === 0) {
|
|
118
104
|
return;
|
|
119
105
|
}
|
|
120
106
|
const project = useContext("outputProject");
|
|
121
|
-
const operationPrefix = `${options.classicalMethodPrefix ?? ""} ${
|
|
122
|
-
method.oriName ?? method.name
|
|
123
|
-
}`;
|
|
107
|
+
const operationPrefix = `${options.classicalMethodPrefix ?? ""} ${method.oriName ?? method.name}`;
|
|
124
108
|
const sampleFolder = join(
|
|
125
109
|
dpgContext.generationPathDetail?.rootDir ?? "",
|
|
126
110
|
"samples-dev",
|
|
127
|
-
options.subFolder ?? ""
|
|
111
|
+
options.subFolder ?? "",
|
|
128
112
|
);
|
|
129
113
|
const fileName = normalizeName(`${operationPrefix} Sample`, NameType.File);
|
|
130
|
-
const sourceFile = project.createSourceFile(
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
{
|
|
134
|
-
overwrite: true
|
|
135
|
-
}
|
|
136
|
-
);
|
|
114
|
+
const sourceFile = project.createSourceFile(join(sampleFolder, `${fileName}.ts`), "", {
|
|
115
|
+
overwrite: true,
|
|
116
|
+
});
|
|
137
117
|
const exampleFunctions = [];
|
|
138
118
|
// TODO: remove hard-coded for package
|
|
139
119
|
if (dpgContext.rlcOptions?.packageDetails?.name) {
|
|
140
120
|
sourceFile.addImportDeclaration({
|
|
141
121
|
moduleSpecifier: dpgContext.rlcOptions?.packageDetails?.name,
|
|
142
|
-
namedImports: [getClassicalClientName(options.topLevelClient)]
|
|
122
|
+
namedImports: [getClassicalClientName(options.topLevelClient)],
|
|
143
123
|
});
|
|
144
124
|
}
|
|
145
125
|
|
|
146
126
|
for (const example of examples) {
|
|
147
127
|
const exampleFunctionBody: string[] = [];
|
|
148
|
-
const exampleName = normalizeName(
|
|
149
|
-
escapeSpecialCharToSpace(example.name),
|
|
150
|
-
NameType.Method
|
|
151
|
-
);
|
|
128
|
+
const exampleName = normalizeName(escapeSpecialCharToSpace(example.name), NameType.Method);
|
|
152
129
|
const exampleFunctionType = {
|
|
153
130
|
name: exampleName,
|
|
154
131
|
returnType: "Promise<void>",
|
|
155
|
-
body: exampleFunctionBody
|
|
132
|
+
body: exampleFunctionBody,
|
|
156
133
|
};
|
|
157
134
|
const parameterMap: Record<string, SdkHttpParameterExampleValue> =
|
|
158
135
|
buildParameterValueMap(example);
|
|
@@ -160,7 +137,7 @@ function emitMethodSamples(
|
|
|
160
137
|
dpgContext,
|
|
161
138
|
method,
|
|
162
139
|
parameterMap,
|
|
163
|
-
options.topLevelClient
|
|
140
|
+
options.topLevelClient,
|
|
164
141
|
);
|
|
165
142
|
// prepare client-level parameters
|
|
166
143
|
const clientParamValues = parameters.filter((p) => p.onClient);
|
|
@@ -174,15 +151,13 @@ function emitMethodSamples(
|
|
|
174
151
|
.filter((p) => p.isOptional)
|
|
175
152
|
.map((param) => `${param.name}: ${param.value}`);
|
|
176
153
|
if (optionalClientParams.length > 0) {
|
|
177
|
-
exampleFunctionBody.push(
|
|
178
|
-
`const clientOptions = {${optionalClientParams.join(", ")}};`
|
|
179
|
-
);
|
|
154
|
+
exampleFunctionBody.push(`const clientOptions = {${optionalClientParams.join(", ")}};`);
|
|
180
155
|
clientParams.push("clientOptions");
|
|
181
156
|
}
|
|
182
157
|
exampleFunctionBody.push(
|
|
183
158
|
`const client = new ${getClassicalClientName(
|
|
184
|
-
options.topLevelClient
|
|
185
|
-
)}(${clientParams.join(", ")})
|
|
159
|
+
options.topLevelClient,
|
|
160
|
+
)}(${clientParams.join(", ")});`,
|
|
186
161
|
);
|
|
187
162
|
|
|
188
163
|
// prepare operation-level parameters
|
|
@@ -190,17 +165,13 @@ function emitMethodSamples(
|
|
|
190
165
|
const operationFunction = getOperationFunction(
|
|
191
166
|
dpgContext,
|
|
192
167
|
[options.hierarchies ?? [], method],
|
|
193
|
-
"Client"
|
|
168
|
+
"Client",
|
|
194
169
|
);
|
|
195
170
|
|
|
196
171
|
// Extract parameter names from the function signature (excluding context and options)
|
|
197
172
|
const signatureParamNames =
|
|
198
173
|
operationFunction.parameters
|
|
199
|
-
?.filter(
|
|
200
|
-
(p) =>
|
|
201
|
-
p.name !== "context" &&
|
|
202
|
-
!p.type?.toString().includes("OptionalParams")
|
|
203
|
-
)
|
|
174
|
+
?.filter((p) => p.name !== "context" && !p.type?.toString().includes("OptionalParams"))
|
|
204
175
|
.map((p) => p.name) ?? [];
|
|
205
176
|
|
|
206
177
|
const methodParamValues = parameters.filter((p) => !p.onClient);
|
|
@@ -221,18 +192,14 @@ function emitMethodSamples(
|
|
|
221
192
|
if (optionalParams.length > 0) {
|
|
222
193
|
methodParams.push(`{${optionalParams.join(", ")}}`);
|
|
223
194
|
}
|
|
224
|
-
const prefix = options.classicalMethodPrefix
|
|
225
|
-
? `${options.classicalMethodPrefix}.`
|
|
226
|
-
: "";
|
|
195
|
+
const prefix = options.classicalMethodPrefix ? `${options.classicalMethodPrefix}.` : "";
|
|
227
196
|
const isPaging = method.kind === "paging";
|
|
228
197
|
const methodCall = `client.${prefix}${normalizeName(method.oriName ?? method.name, NameType.Property)}(${methodParams.join(
|
|
229
|
-
", "
|
|
198
|
+
", ",
|
|
230
199
|
)})`;
|
|
231
200
|
if (isPaging) {
|
|
232
201
|
exampleFunctionBody.push(`const resArray = new Array();`);
|
|
233
|
-
exampleFunctionBody.push(
|
|
234
|
-
`for await (const item of ${methodCall}) { resArray.push(item); }`
|
|
235
|
-
);
|
|
202
|
+
exampleFunctionBody.push(`for await (const item of ${methodCall}) { resArray.push(item); }`);
|
|
236
203
|
exampleFunctionBody.push(`console.log(resArray);`);
|
|
237
204
|
} else if (method.response.type === undefined) {
|
|
238
205
|
// skip response handling for void methods
|
|
@@ -243,10 +210,8 @@ function emitMethodSamples(
|
|
|
243
210
|
}
|
|
244
211
|
|
|
245
212
|
// Create a function declaration structure
|
|
246
|
-
const description =
|
|
247
|
-
|
|
248
|
-
const normalizedDescription =
|
|
249
|
-
description.charAt(0).toLowerCase() + description.slice(1);
|
|
213
|
+
const description = method.doc ?? `execute ${method.oriName ?? method.name}`;
|
|
214
|
+
const normalizedDescription = description.charAt(0).toLowerCase() + description.slice(1);
|
|
250
215
|
const functionDeclaration: FunctionDeclarationStructure = {
|
|
251
216
|
returnType: exampleFunctionType.returnType,
|
|
252
217
|
kind: StructureKind.Function,
|
|
@@ -254,8 +219,8 @@ function emitMethodSamples(
|
|
|
254
219
|
name: exampleFunctionType.name,
|
|
255
220
|
statements: exampleFunctionType.body,
|
|
256
221
|
docs: [
|
|
257
|
-
`This sample demonstrates how to ${normalizedDescription}\n\n@summary ${normalizedDescription}\nx-ms-original-file: ${example.filePath}
|
|
258
|
-
]
|
|
222
|
+
`This sample demonstrates how to ${normalizedDescription}\n\n@summary ${normalizedDescription}\nx-ms-original-file: ${example.filePath}`,
|
|
223
|
+
],
|
|
259
224
|
};
|
|
260
225
|
sourceFile.addFunction(functionDeclaration);
|
|
261
226
|
exampleFunctions.push(exampleFunctionType.name);
|
|
@@ -274,9 +239,7 @@ function emitMethodSamples(
|
|
|
274
239
|
|
|
275
240
|
function buildParameterValueMap(example: SdkHttpOperationExample) {
|
|
276
241
|
const parameterMap: Record<string, SdkHttpParameterExampleValue> = {};
|
|
277
|
-
example.parameters.forEach(
|
|
278
|
-
(param) => (parameterMap[param.parameter.serializedName] = param)
|
|
279
|
-
);
|
|
242
|
+
example.parameters.forEach((param) => (parameterMap[param.parameter.serializedName] = param));
|
|
280
243
|
return parameterMap;
|
|
281
244
|
}
|
|
282
245
|
|
|
@@ -285,14 +248,13 @@ function prepareExampleValue(
|
|
|
285
248
|
name: string,
|
|
286
249
|
value: SdkExampleValue | string,
|
|
287
250
|
isOptional?: boolean,
|
|
288
|
-
onClient?: boolean
|
|
251
|
+
onClient?: boolean,
|
|
289
252
|
): ExampleValue {
|
|
290
253
|
return {
|
|
291
254
|
name: normalizeName(name, NameType.Parameter, true),
|
|
292
|
-
value:
|
|
293
|
-
typeof value === "string" ? value : getParameterValue(context, value),
|
|
255
|
+
value: typeof value === "string" ? value : getParameterValue(context, value),
|
|
294
256
|
isOptional: Boolean(isOptional),
|
|
295
|
-
onClient: Boolean(onClient)
|
|
257
|
+
onClient: Boolean(onClient),
|
|
296
258
|
};
|
|
297
259
|
}
|
|
298
260
|
|
|
@@ -300,7 +262,7 @@ function prepareExampleParameters(
|
|
|
300
262
|
dpgContext: SdkContext,
|
|
301
263
|
method: ServiceOperation,
|
|
302
264
|
parameterMap: Record<string, SdkHttpParameterExampleValue>,
|
|
303
|
-
topLevelClient: SdkClientType<SdkServiceOperation
|
|
265
|
+
topLevelClient: SdkClientType<SdkServiceOperation>,
|
|
304
266
|
): ExampleValue[] {
|
|
305
267
|
// TODO: blocked by TCGC issue: https://github.com/Azure/typespec-azure/issues/1419
|
|
306
268
|
// refine this to support generic client-level parameters once resolved
|
|
@@ -308,16 +270,12 @@ function prepareExampleParameters(
|
|
|
308
270
|
|
|
309
271
|
// Get the raw SDK parameters to check for default values
|
|
310
272
|
const rawClientParams = getClientParameters(topLevelClient, dpgContext, {
|
|
311
|
-
onClientOnly: true
|
|
273
|
+
onClientOnly: true,
|
|
312
274
|
});
|
|
313
275
|
|
|
314
|
-
const clientParams = getClientParametersDeclaration(
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
{
|
|
318
|
-
onClientOnly: true
|
|
319
|
-
}
|
|
320
|
-
);
|
|
276
|
+
const clientParams = getClientParametersDeclaration(topLevelClient, dpgContext, {
|
|
277
|
+
onClientOnly: true,
|
|
278
|
+
});
|
|
321
279
|
|
|
322
280
|
// Helper to check if a parameter has a default value
|
|
323
281
|
const hasParamDefaultValue = (paramName: string) => {
|
|
@@ -342,19 +300,16 @@ function prepareExampleParameters(
|
|
|
342
300
|
|
|
343
301
|
const exampleValue: ExampleValue = {
|
|
344
302
|
name: param.name === "endpointParam" ? "endpoint" : param.name,
|
|
345
|
-
value: getEnvironmentVariableName(
|
|
346
|
-
param.name,
|
|
347
|
-
getClassicalClientName(topLevelClient)
|
|
348
|
-
),
|
|
303
|
+
value: getEnvironmentVariableName(param.name, getClassicalClientName(topLevelClient)),
|
|
349
304
|
isOptional: Boolean(param.hasQuestionToken),
|
|
350
|
-
onClient: true
|
|
305
|
+
onClient: true,
|
|
351
306
|
};
|
|
352
307
|
|
|
353
308
|
result.push(exampleValue);
|
|
354
309
|
}
|
|
355
310
|
const credentialExampleValue = getCredentialExampleValue(
|
|
356
311
|
dpgContext,
|
|
357
|
-
topLevelClient.clientInitialization
|
|
312
|
+
topLevelClient.clientInitialization,
|
|
358
313
|
);
|
|
359
314
|
if (credentialExampleValue) {
|
|
360
315
|
result.push(credentialExampleValue);
|
|
@@ -364,11 +319,7 @@ function prepareExampleParameters(
|
|
|
364
319
|
let isSubscriptionIdAdded = false;
|
|
365
320
|
// required parameters
|
|
366
321
|
for (const param of method.operation.parameters) {
|
|
367
|
-
if (
|
|
368
|
-
param.optional === true ||
|
|
369
|
-
param.type.kind === "constant" ||
|
|
370
|
-
param.clientDefaultValue
|
|
371
|
-
) {
|
|
322
|
+
if (param.optional === true || param.type.kind === "constant" || param.clientDefaultValue) {
|
|
372
323
|
continue;
|
|
373
324
|
}
|
|
374
325
|
|
|
@@ -387,8 +338,8 @@ function prepareExampleParameters(
|
|
|
387
338
|
param.name,
|
|
388
339
|
subscriptionIdValue,
|
|
389
340
|
param.optional,
|
|
390
|
-
param.onClient
|
|
391
|
-
)
|
|
341
|
+
param.onClient,
|
|
342
|
+
),
|
|
392
343
|
);
|
|
393
344
|
continue;
|
|
394
345
|
}
|
|
@@ -399,9 +350,9 @@ function prepareExampleParameters(
|
|
|
399
350
|
code: "required-sample-parameter",
|
|
400
351
|
format: {
|
|
401
352
|
exampleName: method.oriName ?? method.name,
|
|
402
|
-
paramName: param.name
|
|
353
|
+
paramName: param.name,
|
|
403
354
|
},
|
|
404
|
-
target: NoTarget
|
|
355
|
+
target: NoTarget,
|
|
405
356
|
});
|
|
406
357
|
continue;
|
|
407
358
|
}
|
|
@@ -412,8 +363,8 @@ function prepareExampleParameters(
|
|
|
412
363
|
exampleValue.parameter.name,
|
|
413
364
|
exampleValue.value,
|
|
414
365
|
param.optional,
|
|
415
|
-
param.onClient
|
|
416
|
-
)
|
|
366
|
+
param.onClient,
|
|
367
|
+
),
|
|
417
368
|
);
|
|
418
369
|
}
|
|
419
370
|
|
|
@@ -426,13 +377,7 @@ function prepareExampleParameters(
|
|
|
426
377
|
!isTenantLevelOperation(method, topLevelClient)
|
|
427
378
|
) {
|
|
428
379
|
result.push(
|
|
429
|
-
prepareExampleValue(
|
|
430
|
-
dpgContext,
|
|
431
|
-
"subscriptionId",
|
|
432
|
-
subscriptionIdValue,
|
|
433
|
-
false,
|
|
434
|
-
true
|
|
435
|
-
)
|
|
380
|
+
prepareExampleValue(dpgContext, "subscriptionId", subscriptionIdValue, false, true),
|
|
436
381
|
);
|
|
437
382
|
}
|
|
438
383
|
|
|
@@ -456,22 +401,14 @@ function prepareExampleParameters(
|
|
|
456
401
|
continue;
|
|
457
402
|
}
|
|
458
403
|
result.push(
|
|
459
|
-
prepareExampleValue(
|
|
460
|
-
dpgContext,
|
|
461
|
-
prop.name,
|
|
462
|
-
propExample,
|
|
463
|
-
prop.optional,
|
|
464
|
-
prop.onClient
|
|
465
|
-
)
|
|
404
|
+
prepareExampleValue(dpgContext, prop.name, propExample, prop.optional, prop.onClient),
|
|
466
405
|
);
|
|
467
406
|
}
|
|
468
407
|
} else {
|
|
469
408
|
// Check if the body parameter is nested inside a wrapper (e.g., @bodyRoot)
|
|
470
409
|
const segments = bodyParam.methodParameterSegments;
|
|
471
410
|
const isNestedBody =
|
|
472
|
-
segments.length === 1 &&
|
|
473
|
-
segments[0] !== undefined &&
|
|
474
|
-
segments[0].length > 1;
|
|
411
|
+
segments.length === 1 && segments[0] !== undefined && segments[0].length > 1;
|
|
475
412
|
if (isNestedBody) {
|
|
476
413
|
const path = segments[0]!;
|
|
477
414
|
// The first segment is the method-level wrapper param (e.g., "body")
|
|
@@ -480,11 +417,7 @@ function prepareExampleParameters(
|
|
|
480
417
|
// Wrap the example value with the intermediate property names
|
|
481
418
|
let wrappedValue = getParameterValue(dpgContext, bodyExample.value);
|
|
482
419
|
for (let i = path.length - 1; i >= 1; i--) {
|
|
483
|
-
const propName = normalizeName(
|
|
484
|
-
path[i]!.name,
|
|
485
|
-
NameType.Property,
|
|
486
|
-
true
|
|
487
|
-
);
|
|
420
|
+
const propName = normalizeName(path[i]!.name, NameType.Property, true);
|
|
488
421
|
wrappedValue = `{ ${propName}: ${wrappedValue} }`;
|
|
489
422
|
}
|
|
490
423
|
result.push(
|
|
@@ -493,8 +426,8 @@ function prepareExampleParameters(
|
|
|
493
426
|
methodParamName,
|
|
494
427
|
wrappedValue,
|
|
495
428
|
methodParamOptional,
|
|
496
|
-
bodyParam.onClient
|
|
497
|
-
)
|
|
429
|
+
bodyParam.onClient,
|
|
430
|
+
),
|
|
498
431
|
);
|
|
499
432
|
} else {
|
|
500
433
|
result.push(
|
|
@@ -503,8 +436,8 @@ function prepareExampleParameters(
|
|
|
503
436
|
bodyParam.name,
|
|
504
437
|
bodyExample.value,
|
|
505
438
|
bodyParam.optional,
|
|
506
|
-
bodyParam.onClient
|
|
507
|
-
)
|
|
439
|
+
bodyParam.onClient,
|
|
440
|
+
),
|
|
508
441
|
);
|
|
509
442
|
}
|
|
510
443
|
}
|
|
@@ -513,9 +446,7 @@ function prepareExampleParameters(
|
|
|
513
446
|
method.operation.parameters
|
|
514
447
|
.filter(
|
|
515
448
|
(param) =>
|
|
516
|
-
param.optional === true &&
|
|
517
|
-
parameterMap[param.serializedName] &&
|
|
518
|
-
!param.clientDefaultValue
|
|
449
|
+
param.optional === true && parameterMap[param.serializedName] && !param.clientDefaultValue,
|
|
519
450
|
)
|
|
520
451
|
.map((param) => parameterMap[param.serializedName]!)
|
|
521
452
|
.forEach((param) => {
|
|
@@ -525,8 +456,8 @@ function prepareExampleParameters(
|
|
|
525
456
|
param.parameter.name,
|
|
526
457
|
param.value,
|
|
527
458
|
true,
|
|
528
|
-
param.parameter.onClient
|
|
529
|
-
)
|
|
459
|
+
param.parameter.onClient,
|
|
460
|
+
),
|
|
530
461
|
);
|
|
531
462
|
});
|
|
532
463
|
|
|
@@ -535,36 +466,34 @@ function prepareExampleParameters(
|
|
|
535
466
|
|
|
536
467
|
function getCredentialExampleValue(
|
|
537
468
|
dpgContext: SdkContext,
|
|
538
|
-
initialization: SdkClientInitializationType
|
|
469
|
+
initialization: SdkClientInitializationType,
|
|
539
470
|
): ExampleValue | undefined {
|
|
540
471
|
const keyCredential = hasKeyCredential(initialization),
|
|
541
472
|
tokenCredential = hasTokenCredential(initialization);
|
|
542
473
|
const defaultSetting = {
|
|
543
474
|
isOptional: false,
|
|
544
475
|
onClient: true,
|
|
545
|
-
name: "credential"
|
|
476
|
+
name: "credential",
|
|
546
477
|
};
|
|
547
478
|
if (keyCredential || tokenCredential) {
|
|
548
479
|
if (isAzurePackage({ options: dpgContext.rlcOptions })) {
|
|
549
480
|
// Support DefaultAzureCredential for Azure packages
|
|
550
481
|
return {
|
|
551
482
|
...defaultSetting,
|
|
552
|
-
value: `new ${resolveReference(
|
|
553
|
-
AzureIdentityDependencies.DefaultAzureCredential
|
|
554
|
-
)}()`
|
|
483
|
+
value: `new ${resolveReference(AzureIdentityDependencies.DefaultAzureCredential)}()`,
|
|
555
484
|
};
|
|
556
485
|
} else if (keyCredential) {
|
|
557
486
|
// Support ApiKeyCredential for non-Azure packages
|
|
558
487
|
return {
|
|
559
488
|
...defaultSetting,
|
|
560
|
-
value: `{ key: "INPUT_YOUR_KEY_HERE" }
|
|
489
|
+
value: `{ key: "INPUT_YOUR_KEY_HERE" }`,
|
|
561
490
|
};
|
|
562
491
|
} else if (tokenCredential) {
|
|
563
492
|
// Support TokenCredential for non-Azure packages
|
|
564
493
|
return {
|
|
565
494
|
...defaultSetting,
|
|
566
495
|
value: `{ getToken: async () => {
|
|
567
|
-
return { token: "INPUT_YOUR_TOKEN_HERE", expiresOnTimestamp: now() }; } }
|
|
496
|
+
return { token: "INPUT_YOUR_TOKEN_HERE", expiresOnTimestamp: now() }; } }`,
|
|
568
497
|
};
|
|
569
498
|
}
|
|
570
499
|
}
|
|
@@ -576,7 +505,7 @@ function getParameterValue(
|
|
|
576
505
|
value: SdkExampleValue,
|
|
577
506
|
options?: {
|
|
578
507
|
overrides?: ModelOverrideOptions;
|
|
579
|
-
}
|
|
508
|
+
},
|
|
580
509
|
): string {
|
|
581
510
|
let retValue = `{} as any`;
|
|
582
511
|
switch (value.kind) {
|
|
@@ -600,9 +529,7 @@ function getParameterValue(
|
|
|
600
529
|
.replace(/\n/g, "\\n")
|
|
601
530
|
.replace(/\r/g, "\\r")
|
|
602
531
|
.replace(/\t/g, "\\t")
|
|
603
|
-
.replace(/\f/g, "\\f")
|
|
604
|
-
.replace(/>/g, ">")
|
|
605
|
-
.replace(/</g, "<")}"`;
|
|
532
|
+
.replace(/\f/g, "\\f")}"`;
|
|
606
533
|
break;
|
|
607
534
|
}
|
|
608
535
|
break;
|
|
@@ -614,8 +541,7 @@ function getParameterValue(
|
|
|
614
541
|
retValue = `${JSON.stringify(value.value)}`;
|
|
615
542
|
break;
|
|
616
543
|
case "null": {
|
|
617
|
-
const ignoreNullableOnOptional =
|
|
618
|
-
context.rlcOptions?.ignoreNullableOnOptional ?? false;
|
|
544
|
+
const ignoreNullableOnOptional = context.rlcOptions?.ignoreNullableOnOptional ?? false;
|
|
619
545
|
if (ignoreNullableOnOptional) {
|
|
620
546
|
// When ignore-nullable-on-optional is true, the TypeScript type won't include
|
|
621
547
|
// | null for optional properties, so we convert null to a type-appropriate default
|
|
@@ -635,16 +561,12 @@ function getParameterValue(
|
|
|
635
561
|
}
|
|
636
562
|
case "dict":
|
|
637
563
|
case "model": {
|
|
638
|
-
const mapper = buildPropertyNameMapper(
|
|
639
|
-
context,
|
|
640
|
-
value.type,
|
|
641
|
-
options?.overrides
|
|
642
|
-
);
|
|
564
|
+
const mapper = buildPropertyNameMapper(context, value.type, options?.overrides);
|
|
643
565
|
const values = [];
|
|
644
566
|
const additionalPropertiesValue =
|
|
645
567
|
value.kind === "model" ? (value.additionalPropertiesValue ?? {}) : {};
|
|
646
568
|
for (const propName in {
|
|
647
|
-
...value.value
|
|
569
|
+
...value.value,
|
|
648
570
|
}) {
|
|
649
571
|
let property;
|
|
650
572
|
if (value.type.kind === "model") {
|
|
@@ -669,21 +591,17 @@ function getParameterValue(
|
|
|
669
591
|
// but disable further flattening to match the TypeScript interface structure
|
|
670
592
|
const paramValue = getParameterValue(context, propValue, {
|
|
671
593
|
overrides: {
|
|
672
|
-
propertyRenames:
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
enableFlatten: false
|
|
676
|
-
}
|
|
594
|
+
propertyRenames: useContext("sdkTypes").flattenProperties.get(property)?.conflictMap,
|
|
595
|
+
enableFlatten: false,
|
|
596
|
+
},
|
|
677
597
|
});
|
|
678
|
-
propRetValue =
|
|
679
|
-
paramValue.length > 2 ? paramValue.slice(1, -1) : undefined;
|
|
598
|
+
propRetValue = paramValue.length > 2 ? paramValue.slice(1, -1) : undefined;
|
|
680
599
|
} else {
|
|
681
600
|
// Don't propagate enableFlatten:false to deeper levels — it's only
|
|
682
601
|
// meant to block consecutive (transition) flatten at the direct child
|
|
683
602
|
// level. Non-flatten properties should recurse with default behavior
|
|
684
603
|
// so that independent inner flattens at deeper levels still work.
|
|
685
|
-
const childOptions =
|
|
686
|
-
options?.overrides?.enableFlatten === false ? undefined : options;
|
|
604
|
+
const childOptions = options?.overrides?.enableFlatten === false ? undefined : options;
|
|
687
605
|
propRetValue =
|
|
688
606
|
`"${mapper.get(propName) ?? propName}": ` +
|
|
689
607
|
getParameterValue(context, propValue, childOptions);
|
|
@@ -692,15 +610,14 @@ function getParameterValue(
|
|
|
692
610
|
}
|
|
693
611
|
const additionalBags = [];
|
|
694
612
|
for (const propName in {
|
|
695
|
-
...additionalPropertiesValue
|
|
613
|
+
...additionalPropertiesValue,
|
|
696
614
|
}) {
|
|
697
615
|
const propValue = additionalPropertiesValue[propName];
|
|
698
616
|
if (propValue === undefined || propValue === null) {
|
|
699
617
|
continue;
|
|
700
618
|
}
|
|
701
619
|
const propRetValue =
|
|
702
|
-
`"${mapper.get(propName) ?? propName}": ` +
|
|
703
|
-
getParameterValue(context, propValue);
|
|
620
|
+
`"${mapper.get(propName) ?? propName}": ` + getParameterValue(context, propValue);
|
|
704
621
|
additionalBags.push(propRetValue);
|
|
705
622
|
}
|
|
706
623
|
if (additionalBags.length > 0) {
|
|
@@ -716,9 +633,7 @@ function getParameterValue(
|
|
|
716
633
|
break;
|
|
717
634
|
}
|
|
718
635
|
case "array": {
|
|
719
|
-
const valuesArr = value.value.map((item) =>
|
|
720
|
-
getParameterValue(context, item)
|
|
721
|
-
);
|
|
636
|
+
const valuesArr = value.value.map((item) => getParameterValue(context, item));
|
|
722
637
|
retValue = `[${valuesArr.join(", ")}]`;
|
|
723
638
|
break;
|
|
724
639
|
}
|
|
@@ -735,10 +650,7 @@ function escapeSpecialCharToSpace(str: string) {
|
|
|
735
650
|
return str.replace(/_|,|\.|\(|\)|'s |\[|\]/g, " ").replace(/\//g, " Or ");
|
|
736
651
|
}
|
|
737
652
|
|
|
738
|
-
function getEnvironmentVariableName(
|
|
739
|
-
paramName: string,
|
|
740
|
-
clientName?: string
|
|
741
|
-
): string {
|
|
653
|
+
function getEnvironmentVariableName(paramName: string, clientName?: string): string {
|
|
742
654
|
// Remove "Param" suffix if present
|
|
743
655
|
const cleanName = paramName.replace(/Param$/, "");
|
|
744
656
|
|