@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
|
@@ -12,34 +12,25 @@ export function getResponseTypeName(baseResponseName: string): string;
|
|
|
12
12
|
export function getResponseTypeName(
|
|
13
13
|
operationGroup: string,
|
|
14
14
|
operationName: string,
|
|
15
|
-
statusCode: string
|
|
15
|
+
statusCode: string,
|
|
16
16
|
): string;
|
|
17
17
|
export function getResponseTypeName(
|
|
18
18
|
baseNameOrOperationGroup: string,
|
|
19
19
|
operationName?: string,
|
|
20
|
-
statusCode?: string
|
|
20
|
+
statusCode?: string,
|
|
21
21
|
): string {
|
|
22
22
|
if (operationName) {
|
|
23
23
|
baseNameOrOperationGroup = getResponseBaseName(
|
|
24
24
|
baseNameOrOperationGroup,
|
|
25
25
|
operationName!,
|
|
26
|
-
statusCode || ""
|
|
26
|
+
statusCode || "",
|
|
27
27
|
);
|
|
28
28
|
}
|
|
29
|
-
return normalizeName(
|
|
30
|
-
`${baseNameOrOperationGroup}Response`,
|
|
31
|
-
NameType.Interface
|
|
32
|
-
);
|
|
29
|
+
return normalizeName(`${baseNameOrOperationGroup}Response`, NameType.Interface);
|
|
33
30
|
}
|
|
34
31
|
|
|
35
|
-
export function getLroLogicalResponseName(
|
|
36
|
-
operationGroup
|
|
37
|
-
operationName: string
|
|
38
|
-
) {
|
|
39
|
-
return normalizeName(
|
|
40
|
-
`${operationGroup}_${operationName}_Logical_Response`,
|
|
41
|
-
NameType.Interface
|
|
42
|
-
);
|
|
32
|
+
export function getLroLogicalResponseName(operationGroup: string, operationName: string) {
|
|
33
|
+
return normalizeName(`${operationGroup}_${operationName}_Logical_Response`, NameType.Interface);
|
|
43
34
|
}
|
|
44
35
|
|
|
45
36
|
/**
|
|
@@ -52,15 +43,11 @@ export function getLroLogicalResponseName(
|
|
|
52
43
|
export function getResponseBaseName(
|
|
53
44
|
operationGroup: string,
|
|
54
45
|
operationName: string,
|
|
55
|
-
statusCode: string
|
|
46
|
+
statusCode: string,
|
|
56
47
|
) {
|
|
57
48
|
return normalizeName(
|
|
58
|
-
`${operationGroup}_${normalizeName(
|
|
59
|
-
|
|
60
|
-
NameType.Interface,
|
|
61
|
-
true
|
|
62
|
-
)}_${statusCode}`,
|
|
63
|
-
NameType.Interface
|
|
49
|
+
`${operationGroup}_${normalizeName(operationName, NameType.Interface, true)}_${statusCode}`,
|
|
50
|
+
NameType.Interface,
|
|
64
51
|
);
|
|
65
52
|
}
|
|
66
53
|
|
|
@@ -69,14 +56,8 @@ export function getResponseBaseName(
|
|
|
69
56
|
* @param operationName is composed with operationGroup and operationID e.g string_PutEmpty
|
|
70
57
|
* @returns
|
|
71
58
|
*/
|
|
72
|
-
export function getParameterBaseName(
|
|
73
|
-
operationGroup
|
|
74
|
-
operationName: string
|
|
75
|
-
) {
|
|
76
|
-
return normalizeName(
|
|
77
|
-
`${operationGroup}_${operationName}`,
|
|
78
|
-
NameType.Interface
|
|
79
|
-
);
|
|
59
|
+
export function getParameterBaseName(operationGroup: string, operationName: string) {
|
|
60
|
+
return normalizeName(`${operationGroup}_${operationName}`, NameType.Interface);
|
|
80
61
|
}
|
|
81
62
|
|
|
82
63
|
/**
|
|
@@ -86,25 +67,13 @@ export function getParameterBaseName(
|
|
|
86
67
|
* @returns top-layer parameter name e.g StringPutEmptParameters
|
|
87
68
|
*/
|
|
88
69
|
export function getParameterTypeName(baseName: string): string;
|
|
89
|
-
export function getParameterTypeName(
|
|
90
|
-
|
|
91
|
-
operationName: string
|
|
92
|
-
): string;
|
|
93
|
-
export function getParameterTypeName(
|
|
94
|
-
baseNameOrOperationGroup: string,
|
|
95
|
-
operationName?: string
|
|
96
|
-
) {
|
|
70
|
+
export function getParameterTypeName(operationGroup: string, operationName: string): string;
|
|
71
|
+
export function getParameterTypeName(baseNameOrOperationGroup: string, operationName?: string) {
|
|
97
72
|
if (operationName) {
|
|
98
|
-
baseNameOrOperationGroup = getParameterBaseName(
|
|
99
|
-
baseNameOrOperationGroup,
|
|
100
|
-
operationName!
|
|
101
|
-
);
|
|
73
|
+
baseNameOrOperationGroup = getParameterBaseName(baseNameOrOperationGroup, operationName!);
|
|
102
74
|
}
|
|
103
75
|
|
|
104
|
-
return normalizeName(
|
|
105
|
-
`${baseNameOrOperationGroup}_Parameters`,
|
|
106
|
-
NameType.Interface
|
|
107
|
-
);
|
|
76
|
+
return normalizeName(`${baseNameOrOperationGroup}_Parameters`, NameType.Interface);
|
|
108
77
|
}
|
|
109
78
|
|
|
110
79
|
export interface ModuleName {
|
|
@@ -137,8 +106,5 @@ export function getMultipartPartTypeName(schemaName: string, partName: string) {
|
|
|
137
106
|
const name = normalizeName(partName, NameType.Interface);
|
|
138
107
|
const bodyParamName = normalizeName(schemaName, NameType.Interface);
|
|
139
108
|
|
|
140
|
-
return normalizeName(
|
|
141
|
-
`${bodyParamName}_${name}_PartDescriptor`,
|
|
142
|
-
NameType.Interface
|
|
143
|
-
);
|
|
109
|
+
return normalizeName(`${bodyParamName}_${name}_PartDescriptor`, NameType.Interface);
|
|
144
110
|
}
|
|
@@ -22,7 +22,7 @@ export enum NameType {
|
|
|
22
22
|
Operation,
|
|
23
23
|
OperationGroup,
|
|
24
24
|
Method,
|
|
25
|
-
EnumMemberName
|
|
25
|
+
EnumMemberName,
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
const Newable = [NameType.Class, NameType.Interface, NameType.OperationGroup];
|
|
@@ -47,7 +47,7 @@ export const ReservedModelNames: ReservedName[] = [
|
|
|
47
47
|
{ name: "default", reservedFor: [NameType.Parameter, NameType.Method] },
|
|
48
48
|
{
|
|
49
49
|
name: "delete",
|
|
50
|
-
reservedFor: [NameType.Parameter, NameType.Operation, NameType.Method]
|
|
50
|
+
reservedFor: [NameType.Parameter, NameType.Operation, NameType.Method],
|
|
51
51
|
},
|
|
52
52
|
{ name: "do", reservedFor: [NameType.Parameter, NameType.Method] },
|
|
53
53
|
{ name: "else", reservedFor: [NameType.Parameter, NameType.Method] },
|
|
@@ -55,7 +55,7 @@ export const ReservedModelNames: ReservedName[] = [
|
|
|
55
55
|
{ name: "error", reservedFor: [NameType.Parameter, ...Newable] },
|
|
56
56
|
{
|
|
57
57
|
name: "export",
|
|
58
|
-
reservedFor: [NameType.Parameter, NameType.Operation, NameType.Method]
|
|
58
|
+
reservedFor: [NameType.Parameter, NameType.Operation, NameType.Method],
|
|
59
59
|
},
|
|
60
60
|
{ name: "extends", reservedFor: [NameType.Parameter, NameType.Method] },
|
|
61
61
|
{ name: "false", reservedFor: [NameType.Parameter, NameType.Method] },
|
|
@@ -64,7 +64,7 @@ export const ReservedModelNames: ReservedName[] = [
|
|
|
64
64
|
{ name: "from", reservedFor: [NameType.Parameter] },
|
|
65
65
|
{
|
|
66
66
|
name: "function",
|
|
67
|
-
reservedFor: [NameType.Parameter, ...Newable, NameType.Method]
|
|
67
|
+
reservedFor: [NameType.Parameter, ...Newable, NameType.Method],
|
|
68
68
|
},
|
|
69
69
|
{ name: "get", reservedFor: [NameType.Parameter] },
|
|
70
70
|
{ name: "if", reservedFor: [NameType.Parameter, NameType.Method] },
|
|
@@ -84,7 +84,7 @@ export const ReservedModelNames: ReservedName[] = [
|
|
|
84
84
|
{ name: "protected", reservedFor: [NameType.Parameter] },
|
|
85
85
|
{
|
|
86
86
|
name: "public",
|
|
87
|
-
reservedFor: [NameType.Parameter, NameType.Operation, NameType.Method]
|
|
87
|
+
reservedFor: [NameType.Parameter, NameType.Operation, NameType.Method],
|
|
88
88
|
},
|
|
89
89
|
{ name: "requestoptions", reservedFor: [NameType.Parameter] },
|
|
90
90
|
{ name: "require", reservedFor: [NameType.Parameter, NameType.Method] },
|
|
@@ -111,18 +111,18 @@ export const ReservedModelNames: ReservedName[] = [
|
|
|
111
111
|
// reserve client for codegen
|
|
112
112
|
{ name: "client", reservedFor: [NameType.Parameter] },
|
|
113
113
|
{ name: "endpoint", reservedFor: [NameType.Parameter] },
|
|
114
|
-
{ name: "apiVersion", reservedFor: [NameType.Parameter] }
|
|
114
|
+
{ name: "apiVersion", reservedFor: [NameType.Parameter] },
|
|
115
115
|
];
|
|
116
116
|
|
|
117
117
|
export enum CasingConvention {
|
|
118
118
|
Pascal,
|
|
119
|
-
Camel
|
|
119
|
+
Camel,
|
|
120
120
|
}
|
|
121
121
|
|
|
122
122
|
export function guardReservedNames(
|
|
123
123
|
name: string,
|
|
124
124
|
nameType: NameType,
|
|
125
|
-
customReservedNames: ReservedName[] = []
|
|
125
|
+
customReservedNames: ReservedName[] = [],
|
|
126
126
|
): string {
|
|
127
127
|
const [prefix, suffix] = getAffix(nameType);
|
|
128
128
|
return [...ReservedModelNames, ...customReservedNames]
|
|
@@ -158,12 +158,12 @@ export function normalizeName(
|
|
|
158
158
|
shouldGuard?: boolean,
|
|
159
159
|
customReservedNames?: ReservedName[],
|
|
160
160
|
casingOverride?: CasingConvention,
|
|
161
|
-
oriName?: string
|
|
161
|
+
oriName?: string,
|
|
162
162
|
): string;
|
|
163
163
|
export function normalizeName(
|
|
164
164
|
name: string,
|
|
165
165
|
nameType: NameType,
|
|
166
|
-
options?: NormalizeNameOption
|
|
166
|
+
options?: NormalizeNameOption,
|
|
167
167
|
): string;
|
|
168
168
|
export function normalizeName(
|
|
169
169
|
name: string,
|
|
@@ -171,7 +171,7 @@ export function normalizeName(
|
|
|
171
171
|
optionsOrShouldGuard?: NormalizeNameOption | boolean,
|
|
172
172
|
optionalCustomReservedNames?: ReservedName[],
|
|
173
173
|
optionalCasingOverride?: CasingConvention,
|
|
174
|
-
oriName?: string
|
|
174
|
+
oriName?: string,
|
|
175
175
|
): string {
|
|
176
176
|
let shouldGuard: boolean | undefined,
|
|
177
177
|
customReservedNames: ReservedName[],
|
|
@@ -208,11 +208,7 @@ export function normalizeName(
|
|
|
208
208
|
return fixLeadingNumber(result, nameType, numberPrefixOverride);
|
|
209
209
|
}
|
|
210
210
|
|
|
211
|
-
export function fixLeadingNumber(
|
|
212
|
-
name: string,
|
|
213
|
-
nameType: NameType,
|
|
214
|
-
prefix: string = "_"
|
|
215
|
-
): string {
|
|
211
|
+
export function fixLeadingNumber(name: string, nameType: NameType, prefix: string = "_"): string {
|
|
216
212
|
const casingConvention = getCasingConvention(nameType);
|
|
217
213
|
if (!name || !name.match(/^[-.]?\d/)) {
|
|
218
214
|
return name;
|
|
@@ -220,16 +216,10 @@ export function fixLeadingNumber(
|
|
|
220
216
|
return `${toCasing(prefix, casingConvention)}${name}`;
|
|
221
217
|
}
|
|
222
218
|
|
|
223
|
-
function isFullyUpperCase(
|
|
224
|
-
identifier: string,
|
|
225
|
-
maxUppercasePreserve: number = 3
|
|
226
|
-
) {
|
|
219
|
+
function isFullyUpperCase(identifier: string, maxUppercasePreserve: number = 3) {
|
|
227
220
|
const len = identifier.length;
|
|
228
221
|
if (len > 1) {
|
|
229
|
-
if (
|
|
230
|
-
len <= maxUppercasePreserve &&
|
|
231
|
-
identifier === identifier.toUpperCase()
|
|
232
|
-
) {
|
|
222
|
+
if (len <= maxUppercasePreserve && identifier === identifier.toUpperCase()) {
|
|
233
223
|
return true;
|
|
234
224
|
}
|
|
235
225
|
|
|
@@ -283,19 +273,11 @@ function getCasingConvention(nameType: NameType) {
|
|
|
283
273
|
}
|
|
284
274
|
}
|
|
285
275
|
|
|
286
|
-
function toCasing(
|
|
287
|
-
str: string,
|
|
288
|
-
casing: CasingConvention,
|
|
289
|
-
keepConsistent = false
|
|
290
|
-
): string {
|
|
276
|
+
function toCasing(str: string, casing: CasingConvention, keepConsistent = false): string {
|
|
291
277
|
const firstChar =
|
|
292
|
-
casing === CasingConvention.Pascal
|
|
293
|
-
? str.charAt(0).toUpperCase()
|
|
294
|
-
: str.charAt(0).toLowerCase();
|
|
278
|
+
casing === CasingConvention.Pascal ? str.charAt(0).toUpperCase() : str.charAt(0).toLowerCase();
|
|
295
279
|
const allLowerCases =
|
|
296
|
-
casing !== CasingConvention.Pascal &&
|
|
297
|
-
keepConsistent &&
|
|
298
|
-
str.toUpperCase() === str;
|
|
280
|
+
casing !== CasingConvention.Pascal && keepConsistent && str.toUpperCase() === str;
|
|
299
281
|
return allLowerCases ? str.toLowerCase() : `${firstChar}${str.substring(1)}`;
|
|
300
282
|
}
|
|
301
283
|
|
|
@@ -303,14 +285,9 @@ export function pascalCase(str: string) {
|
|
|
303
285
|
return str.charAt(0).toUpperCase() + str.slice(1);
|
|
304
286
|
}
|
|
305
287
|
|
|
306
|
-
export function camelCase(
|
|
307
|
-
str: string,
|
|
308
|
-
options: { uppercaseThreshold?: number } = {}
|
|
309
|
-
) {
|
|
288
|
+
export function camelCase(str: string, options: { uppercaseThreshold?: number } = {}) {
|
|
310
289
|
const { uppercaseThreshold = 4 } = options;
|
|
311
|
-
const thresholdRegex = new RegExp(
|
|
312
|
-
`^(?<![A-Z])[A-Z]{1,${uppercaseThreshold}}(?![A-Z])`
|
|
313
|
-
);
|
|
290
|
+
const thresholdRegex = new RegExp(`^(?<![A-Z])[A-Z]{1,${uppercaseThreshold}}(?![A-Z])`);
|
|
314
291
|
if (!thresholdRegex.test(str)) {
|
|
315
292
|
return str;
|
|
316
293
|
}
|
|
@@ -1,11 +1,7 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
MethodSignatureStructure,
|
|
6
|
-
OptionalKind,
|
|
7
|
-
ParameterDeclarationStructure
|
|
8
|
-
} from "ts-morph";
|
|
4
|
+
import { MethodSignatureStructure, OptionalKind, ParameterDeclarationStructure } from "ts-morph";
|
|
9
5
|
import {
|
|
10
6
|
Methods,
|
|
11
7
|
ObjectSchema,
|
|
@@ -13,14 +9,14 @@ import {
|
|
|
13
9
|
PathParameter,
|
|
14
10
|
RLCModel,
|
|
15
11
|
Schema,
|
|
16
|
-
SchemaContext
|
|
12
|
+
SchemaContext,
|
|
17
13
|
} from "../interfaces.js";
|
|
18
14
|
import { NameType, normalizeName, pascalCase } from "./nameUtils.js";
|
|
19
15
|
import { isObjectSchema } from "./schemaHelpers.js";
|
|
20
16
|
|
|
21
17
|
export function buildMethodDefinitions(
|
|
22
18
|
methods: Methods,
|
|
23
|
-
pathParams: PathParameter[] = []
|
|
19
|
+
pathParams: PathParameter[] = [],
|
|
24
20
|
): OptionalKind<MethodSignatureStructure>[] {
|
|
25
21
|
const methodDefinitions: OptionalKind<MethodSignatureStructure>[] = [];
|
|
26
22
|
for (const key of Object.keys(methods)) {
|
|
@@ -40,10 +36,10 @@ export function buildMethodDefinitions(
|
|
|
40
36
|
{
|
|
41
37
|
name: "options",
|
|
42
38
|
hasQuestionToken: areAllOptional,
|
|
43
|
-
type: pascalCase(method.optionsName)
|
|
44
|
-
}
|
|
39
|
+
type: pascalCase(method.optionsName),
|
|
40
|
+
},
|
|
45
41
|
],
|
|
46
|
-
returnType: `StreamableMethod<${method.returnType}
|
|
42
|
+
returnType: `StreamableMethod<${method.returnType}>`,
|
|
47
43
|
});
|
|
48
44
|
}
|
|
49
45
|
}
|
|
@@ -52,13 +48,13 @@ export function buildMethodDefinitions(
|
|
|
52
48
|
}
|
|
53
49
|
|
|
54
50
|
export function getPathParamDefinitions(
|
|
55
|
-
pathParams: PathParameter[]
|
|
51
|
+
pathParams: PathParameter[],
|
|
56
52
|
): OptionalKind<ParameterDeclarationStructure>[] {
|
|
57
53
|
return pathParams.map(({ name, type, description }) => {
|
|
58
54
|
return {
|
|
59
55
|
name: normalizeName(name, NameType.Parameter),
|
|
60
56
|
type,
|
|
61
|
-
description
|
|
57
|
+
description,
|
|
62
58
|
};
|
|
63
59
|
});
|
|
64
60
|
}
|
|
@@ -114,33 +110,22 @@ export function hasInputModels(model: RLCModel) {
|
|
|
114
110
|
return hasSchemaContextObject(model, [SchemaContext.Input]);
|
|
115
111
|
}
|
|
116
112
|
export function hasOutputModels(model: RLCModel) {
|
|
117
|
-
return hasSchemaContextObject(model, [
|
|
118
|
-
SchemaContext.Output,
|
|
119
|
-
SchemaContext.Exception
|
|
120
|
-
]);
|
|
113
|
+
return hasSchemaContextObject(model, [SchemaContext.Output, SchemaContext.Exception]);
|
|
121
114
|
}
|
|
122
115
|
|
|
123
116
|
function hasSchemaContextObject(model: RLCModel, schemaUsage: SchemaContext[]) {
|
|
124
117
|
const objectSchemas: ObjectSchema[] = (model.schemas ?? []).filter(
|
|
125
|
-
(o) =>
|
|
126
|
-
isObjectSchema(o) &&
|
|
127
|
-
(o as ObjectSchema).usage?.some((u) => schemaUsage.includes(u))
|
|
118
|
+
(o) => isObjectSchema(o) && (o as ObjectSchema).usage?.some((u) => schemaUsage.includes(u)),
|
|
128
119
|
);
|
|
129
120
|
|
|
130
121
|
return objectSchemas.length > 0;
|
|
131
122
|
}
|
|
132
123
|
|
|
133
|
-
export function getGeneratedWrapperTypes(
|
|
134
|
-
params: ParameterMetadata[] | PathParameter[]
|
|
135
|
-
): Schema[] {
|
|
124
|
+
export function getGeneratedWrapperTypes(params: ParameterMetadata[] | PathParameter[]): Schema[] {
|
|
136
125
|
const wrapperTypes = params
|
|
137
|
-
.map((qp) =>
|
|
138
|
-
isParameterMetadata(qp) ? qp.param.wrapperType : qp.wrapperType
|
|
139
|
-
)
|
|
126
|
+
.map((qp) => (isParameterMetadata(qp) ? qp.param.wrapperType : qp.wrapperType))
|
|
140
127
|
.filter((v) => v !== undefined);
|
|
141
|
-
const wrapperFromObjects = wrapperTypes.filter(
|
|
142
|
-
(wrap) => wrap.type === "object"
|
|
143
|
-
);
|
|
128
|
+
const wrapperFromObjects = wrapperTypes.filter((wrap) => wrap.type === "object");
|
|
144
129
|
const wrapperFromUnions = wrapperTypes
|
|
145
130
|
.filter((wrap) => wrap.type === "union")
|
|
146
131
|
.flatMap((wrapperType) => wrapperType?.enum ?? [])
|
|
@@ -148,8 +133,6 @@ export function getGeneratedWrapperTypes(
|
|
|
148
133
|
return [...wrapperFromUnions, ...wrapperFromObjects];
|
|
149
134
|
}
|
|
150
135
|
|
|
151
|
-
function isParameterMetadata(
|
|
152
|
-
param: ParameterMetadata | PathParameter
|
|
153
|
-
): param is ParameterMetadata {
|
|
136
|
+
function isParameterMetadata(param: ParameterMetadata | PathParameter): param is ParameterMetadata {
|
|
154
137
|
return (param as any).param !== undefined;
|
|
155
138
|
}
|
|
@@ -1,15 +1,10 @@
|
|
|
1
1
|
import * as path from "path";
|
|
2
2
|
|
|
3
|
-
export function getRelativePartFromSrcPath(
|
|
4
|
-
srcPath: string,
|
|
5
|
-
isModularLibrary: boolean = false
|
|
6
|
-
) {
|
|
3
|
+
export function getRelativePartFromSrcPath(srcPath: string, isModularLibrary: boolean = false) {
|
|
7
4
|
const sep = srcPath.includes(path.sep + "src") ? path.sep : "/";
|
|
8
5
|
let relativePart = srcPath.substring(srcPath.indexOf(sep + "src") + 4);
|
|
9
6
|
if (isModularLibrary) {
|
|
10
7
|
relativePart = relativePart.substring(srcPath.indexOf(sep + "rest"), +5);
|
|
11
8
|
}
|
|
12
|
-
return relativePart.startsWith(sep)
|
|
13
|
-
? relativePart.substring(1)
|
|
14
|
-
: relativePart;
|
|
9
|
+
return relativePart.startsWith(sep) ? relativePart.substring(1) : relativePart;
|
|
15
10
|
}
|
|
@@ -1,28 +1,17 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
ArraySchema,
|
|
6
|
-
ObjectSchema,
|
|
7
|
-
RLCModel,
|
|
8
|
-
Schema,
|
|
9
|
-
SchemaContext
|
|
10
|
-
} from "../interfaces.js";
|
|
4
|
+
import { ArraySchema, ObjectSchema, RLCModel, Schema, SchemaContext } from "../interfaces.js";
|
|
11
5
|
|
|
12
6
|
export interface IsDictionaryOptions {
|
|
13
7
|
filterEmpty?: boolean;
|
|
14
8
|
}
|
|
15
9
|
|
|
16
10
|
export function isArraySchema(schema: Schema): schema is ArraySchema {
|
|
17
|
-
return (
|
|
18
|
-
schema.type === "array" || typeof (schema as any).items !== "undefined"
|
|
19
|
-
);
|
|
11
|
+
return schema.type === "array" || typeof (schema as any).items !== "undefined";
|
|
20
12
|
}
|
|
21
13
|
|
|
22
|
-
export function isDictionarySchema(
|
|
23
|
-
schema: Schema,
|
|
24
|
-
options: IsDictionaryOptions = {}
|
|
25
|
-
) {
|
|
14
|
+
export function isDictionarySchema(schema: Schema, options: IsDictionaryOptions = {}) {
|
|
26
15
|
if (schema.type === "dictionary") {
|
|
27
16
|
if (!options.filterEmpty || (options.filterEmpty && !schema.typeName)) {
|
|
28
17
|
return true;
|
|
@@ -51,7 +40,7 @@ export function buildSchemaObjectMap(model: RLCModel) {
|
|
|
51
40
|
const allSchemas = (model.schemas ?? []).filter(
|
|
52
41
|
(o) =>
|
|
53
42
|
isObjectSchema(o) &&
|
|
54
|
-
(o as ObjectSchema).usage?.some((u) => [SchemaContext.Input].includes(u))
|
|
43
|
+
(o as ObjectSchema).usage?.some((u) => [SchemaContext.Input].includes(u)),
|
|
55
44
|
);
|
|
56
45
|
allSchemas.forEach((o) => {
|
|
57
46
|
map.set(o.name, o);
|
|
@@ -1,17 +1,13 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
3
|
|
|
4
|
-
import {
|
|
5
|
-
OptionalKind,
|
|
6
|
-
MethodSignatureStructure,
|
|
7
|
-
InterfaceDeclarationStructure
|
|
8
|
-
} from "ts-morph";
|
|
4
|
+
import { InterfaceDeclarationStructure, MethodSignatureStructure, OptionalKind } from "ts-morph";
|
|
9
5
|
import { PathMetadata, Paths } from "../interfaces.js";
|
|
10
|
-
import { buildMethodDefinitions } from "./operationHelpers.js";
|
|
11
6
|
import { NameType, normalizeName } from "./nameUtils.js";
|
|
7
|
+
import { buildMethodDefinitions } from "./operationHelpers.js";
|
|
12
8
|
|
|
13
9
|
export function generateMethodShortcuts(
|
|
14
|
-
paths: Paths
|
|
10
|
+
paths: Paths,
|
|
15
11
|
): OptionalKind<InterfaceDeclarationStructure>[] {
|
|
16
12
|
const keys: Record<string, OptionalKind<MethodSignatureStructure>[]> = {};
|
|
17
13
|
for (const path in paths) {
|
|
@@ -36,16 +32,14 @@ export function generateMethodShortcuts(
|
|
|
36
32
|
name: `${interfaceName}Operations`,
|
|
37
33
|
methods: methods,
|
|
38
34
|
isExported: true,
|
|
39
|
-
docs: [`Contains operations for ${interfaceName} operations`]
|
|
35
|
+
docs: [`Contains operations for ${interfaceName} operations`],
|
|
40
36
|
});
|
|
41
37
|
}
|
|
42
38
|
|
|
43
39
|
return interfaces;
|
|
44
40
|
}
|
|
45
41
|
|
|
46
|
-
function buildOperationDefinitions(
|
|
47
|
-
path: PathMetadata
|
|
48
|
-
): OptionalKind<MethodSignatureStructure>[] {
|
|
42
|
+
function buildOperationDefinitions(path: PathMetadata): OptionalKind<MethodSignatureStructure>[] {
|
|
49
43
|
let ops: OptionalKind<MethodSignatureStructure>[] = [];
|
|
50
44
|
|
|
51
45
|
for (const verb in path.methods) {
|
|
@@ -56,10 +50,7 @@ function buildOperationDefinitions(
|
|
|
56
50
|
for (const method of methods) {
|
|
57
51
|
const name = normalizeName(method.operationName, NameType.Property);
|
|
58
52
|
const pathParams = path.pathParameters;
|
|
59
|
-
const methodDefinitions = buildMethodDefinitions(
|
|
60
|
-
{ [name]: [method] },
|
|
61
|
-
pathParams
|
|
62
|
-
);
|
|
53
|
+
const methodDefinitions = buildMethodDefinitions({ [name]: [method] }, pathParams);
|
|
63
54
|
ops = [...ops, ...methodDefinitions];
|
|
64
55
|
}
|
|
65
56
|
}
|
|
@@ -71,12 +71,10 @@ export enum TypeScriptType {
|
|
|
71
71
|
object,
|
|
72
72
|
union,
|
|
73
73
|
unknown,
|
|
74
|
-
enum
|
|
74
|
+
enum,
|
|
75
75
|
}
|
|
76
76
|
|
|
77
|
-
export function toTypeScriptTypeFromSchema(
|
|
78
|
-
schema: Schema
|
|
79
|
-
): TypeScriptType | undefined {
|
|
77
|
+
export function toTypeScriptTypeFromSchema(schema: Schema): TypeScriptType | undefined {
|
|
80
78
|
schema.type = schema.type.trim();
|
|
81
79
|
if (
|
|
82
80
|
schema.type === "string" &&
|
|
@@ -92,10 +90,7 @@ export function toTypeScriptTypeFromSchema(
|
|
|
92
90
|
// Include both extensible and fixed enum
|
|
93
91
|
return TypeScriptType.enum;
|
|
94
92
|
}
|
|
95
|
-
} else if (
|
|
96
|
-
schema.isConstant === true ||
|
|
97
|
-
isConstant(schema.typeName ?? schema.type)
|
|
98
|
-
) {
|
|
93
|
+
} else if (schema.isConstant === true || isConstant(schema.typeName ?? schema.type)) {
|
|
99
94
|
return TypeScriptType.constant;
|
|
100
95
|
} else if (schema.type === "number") {
|
|
101
96
|
return TypeScriptType.number;
|
|
@@ -115,9 +110,7 @@ export function toTypeScriptTypeFromSchema(
|
|
|
115
110
|
return undefined;
|
|
116
111
|
}
|
|
117
112
|
|
|
118
|
-
export function toTypeScriptTypeFromName(
|
|
119
|
-
typeName: string
|
|
120
|
-
): TypeScriptType | undefined {
|
|
113
|
+
export function toTypeScriptTypeFromName(typeName: string): TypeScriptType | undefined {
|
|
121
114
|
typeName = typeName.trim();
|
|
122
115
|
if (typeName === "Date") {
|
|
123
116
|
return TypeScriptType.date;
|
|
@@ -7,7 +7,7 @@ import {
|
|
|
7
7
|
DictionarySchema,
|
|
8
8
|
ObjectSchema,
|
|
9
9
|
Schema,
|
|
10
|
-
SchemaContext
|
|
10
|
+
SchemaContext,
|
|
11
11
|
} from "../interfaces.js";
|
|
12
12
|
import {
|
|
13
13
|
TypeScriptType,
|
|
@@ -20,7 +20,7 @@ import {
|
|
|
20
20
|
leaveBracket,
|
|
21
21
|
leaveStringQuotes,
|
|
22
22
|
toTypeScriptTypeFromName,
|
|
23
|
-
toTypeScriptTypeFromSchema
|
|
23
|
+
toTypeScriptTypeFromSchema,
|
|
24
24
|
} from "./typeUtil.js";
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -37,7 +37,7 @@ export function generateParameterTypeValue(
|
|
|
37
37
|
parameterName: string,
|
|
38
38
|
schemaMap: Map<string, Schema>,
|
|
39
39
|
path: Set<string> = new Set(),
|
|
40
|
-
_allowMockValue = true
|
|
40
|
+
_allowMockValue = true,
|
|
41
41
|
): string | undefined {
|
|
42
42
|
type = leaveBracket(type?.trim());
|
|
43
43
|
let tsType: TypeScriptType | undefined;
|
|
@@ -85,25 +85,20 @@ function mockEnumValues(
|
|
|
85
85
|
type: string,
|
|
86
86
|
parameterName: string,
|
|
87
87
|
schemaMap: Map<string, Schema>,
|
|
88
|
-
path: Set<string> = new Set()
|
|
88
|
+
path: Set<string> = new Set(),
|
|
89
89
|
) {
|
|
90
90
|
const schema = schemaMap.get(type);
|
|
91
91
|
if (schema && schema.enum && schema.enum.length > 0) {
|
|
92
92
|
return schema.enum[0].type;
|
|
93
93
|
}
|
|
94
|
-
return generateParameterTypeValue(
|
|
95
|
-
getUnionType(type),
|
|
96
|
-
parameterName,
|
|
97
|
-
schemaMap,
|
|
98
|
-
path
|
|
99
|
-
);
|
|
94
|
+
return generateParameterTypeValue(getUnionType(type), parameterName, schemaMap, path);
|
|
100
95
|
}
|
|
101
96
|
|
|
102
97
|
function mockUnionValues(
|
|
103
98
|
type: string,
|
|
104
99
|
parameterName: string,
|
|
105
100
|
schemaMap: Map<string, Schema>,
|
|
106
|
-
path: Set<string> = new Set()
|
|
101
|
+
path: Set<string> = new Set(),
|
|
107
102
|
) {
|
|
108
103
|
const schema = schemaMap.get(type);
|
|
109
104
|
if (schema && schema.enum && schema.enum.length > 0) {
|
|
@@ -112,22 +107,17 @@ function mockUnionValues(
|
|
|
112
107
|
getAccurateTypeName(schema.enum[0]) ?? schema.enum[0],
|
|
113
108
|
parameterName,
|
|
114
109
|
schemaMap,
|
|
115
|
-
path
|
|
110
|
+
path,
|
|
116
111
|
);
|
|
117
112
|
}
|
|
118
|
-
return generateParameterTypeValue(
|
|
119
|
-
getUnionType(type),
|
|
120
|
-
parameterName,
|
|
121
|
-
schemaMap,
|
|
122
|
-
path
|
|
123
|
-
);
|
|
113
|
+
return generateParameterTypeValue(getUnionType(type), parameterName, schemaMap, path);
|
|
124
114
|
}
|
|
125
115
|
|
|
126
116
|
function generateRecordValues(
|
|
127
117
|
type: string,
|
|
128
118
|
parameterName: string,
|
|
129
119
|
schemaMap: Map<string, Schema>,
|
|
130
|
-
path: Set<string> = new Set()
|
|
120
|
+
path: Set<string> = new Set(),
|
|
131
121
|
) {
|
|
132
122
|
let recordType = getRecordType(type);
|
|
133
123
|
const schema = schemaMap.get(type) as DictionarySchema;
|
|
@@ -137,12 +127,7 @@ function generateRecordValues(
|
|
|
137
127
|
}
|
|
138
128
|
|
|
139
129
|
return recordType
|
|
140
|
-
? `{"key": ${generateParameterTypeValue(
|
|
141
|
-
recordType,
|
|
142
|
-
parameterName,
|
|
143
|
-
schemaMap,
|
|
144
|
-
path
|
|
145
|
-
)}}`
|
|
130
|
+
? `{"key": ${generateParameterTypeValue(recordType, parameterName, schemaMap, path)}}`
|
|
146
131
|
: `{}`;
|
|
147
132
|
}
|
|
148
133
|
|
|
@@ -150,7 +135,7 @@ function generateArrayValues(
|
|
|
150
135
|
type: string,
|
|
151
136
|
parameterName: string,
|
|
152
137
|
schemaMap: Map<string, Schema>,
|
|
153
|
-
path: Set<string> = new Set()
|
|
138
|
+
path: Set<string> = new Set(),
|
|
154
139
|
) {
|
|
155
140
|
let arrayType;
|
|
156
141
|
const schema = schemaMap.get(type) as ArraySchema;
|
|
@@ -172,7 +157,7 @@ function generateObjectValues(
|
|
|
172
157
|
type: string,
|
|
173
158
|
_parameterName: string,
|
|
174
159
|
schemaMap: Map<string, Schema>,
|
|
175
|
-
path: Set<string> = new Set()
|
|
160
|
+
path: Set<string> = new Set(),
|
|
176
161
|
) {
|
|
177
162
|
if (path.has(type)) {
|
|
178
163
|
// skip generating if self referenced
|
|
@@ -189,7 +174,7 @@ function generateObjectValues(
|
|
|
189
174
|
|
|
190
175
|
function getAllProperties(
|
|
191
176
|
schema?: ObjectSchema,
|
|
192
|
-
schemaMap: Map<string, Schema> = new Map()
|
|
177
|
+
schemaMap: Map<string, Schema> = new Map(),
|
|
193
178
|
): Map<string, Schema> {
|
|
194
179
|
const propertiesMap: Map<string, Schema> = new Map();
|
|
195
180
|
if (!schema) {
|
|
@@ -213,7 +198,7 @@ function getAllProperties(
|
|
|
213
198
|
function extractObjectProperties(
|
|
214
199
|
properties: Map<string, Schema>,
|
|
215
200
|
schemaMap: Map<string, Schema> = new Map(),
|
|
216
|
-
path: Set<string> = new Set()
|
|
201
|
+
path: Set<string> = new Set(),
|
|
217
202
|
) {
|
|
218
203
|
const values: string[] = [];
|
|
219
204
|
for (const name of properties.keys()) {
|
|
@@ -224,12 +209,7 @@ function extractObjectProperties(
|
|
|
224
209
|
addToSchemaMap(schemaMap, property);
|
|
225
210
|
values.push(
|
|
226
211
|
`${name}: ` +
|
|
227
|
-
generateParameterTypeValue(
|
|
228
|
-
getAccurateTypeName(property),
|
|
229
|
-
name,
|
|
230
|
-
schemaMap,
|
|
231
|
-
path
|
|
232
|
-
)
|
|
212
|
+
generateParameterTypeValue(getAccurateTypeName(property), name, schemaMap, path),
|
|
233
213
|
);
|
|
234
214
|
}
|
|
235
215
|
return values;
|
|
@@ -248,10 +228,7 @@ function addToSchemaMap(schemaMap: Map<string, Schema>, schema: Schema) {
|
|
|
248
228
|
if (!type) {
|
|
249
229
|
return;
|
|
250
230
|
}
|
|
251
|
-
if (
|
|
252
|
-
!schemaMap.has(type) &&
|
|
253
|
-
!["string", "number", "boolean"].includes(schema.type)
|
|
254
|
-
) {
|
|
231
|
+
if (!schemaMap.has(type) && !["string", "number", "boolean"].includes(schema.type)) {
|
|
255
232
|
schemaMap.set(type, schema);
|
|
256
233
|
}
|
|
257
234
|
}
|