@azure-tools/typespec-ts 0.54.0 → 0.55.0-dev.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +25 -10
- package/README.md +0 -4
- package/dist/src/contextManager.d.ts +5 -5
- package/dist/src/contextManager.d.ts.map +1 -1
- package/dist/src/contextManager.js +3 -3
- package/dist/src/contextManager.js.map +1 -1
- package/dist/src/framework/declaration.d.ts +1 -1
- package/dist/src/framework/declaration.d.ts.map +1 -1
- package/dist/src/framework/declaration.js +2 -4
- package/dist/src/framework/declaration.js.map +1 -1
- package/dist/src/framework/dependency.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.d.ts +1 -1
- package/dist/src/framework/hooks/binder.d.ts.map +1 -1
- package/dist/src/framework/hooks/binder.js +31 -40
- package/dist/src/framework/hooks/binder.js.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts +1 -1
- package/dist/src/framework/hooks/sdkTypes.d.ts.map +1 -1
- package/dist/src/framework/hooks/sdkTypes.js +8 -12
- package/dist/src/framework/hooks/sdkTypes.js.map +1 -1
- package/dist/src/framework/hooks/useDependencies.d.ts.map +1 -1
- package/dist/src/framework/hooks/useDependencies.js +1 -1
- package/dist/src/framework/hooks/useDependencies.js.map +1 -1
- package/dist/src/framework/load-static-helpers.d.ts +1 -1
- package/dist/src/framework/load-static-helpers.d.ts.map +1 -1
- package/dist/src/framework/load-static-helpers.js +17 -31
- package/dist/src/framework/load-static-helpers.js.map +1 -1
- package/dist/src/framework/reference.d.ts.map +1 -1
- package/dist/src/framework/reference.js +2 -2
- package/dist/src/framework/reference.js.map +1 -1
- package/dist/src/framework/sample.js +8 -8
- package/dist/src/framework/sample.js.map +1 -1
- package/dist/src/index.d.ts +1 -1
- package/dist/src/index.d.ts.map +1 -1
- package/dist/src/index.js +103 -92
- package/dist/src/index.js.map +1 -1
- package/dist/src/lib.d.ts +1 -1
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/lib.js +140 -140
- package/dist/src/lib.js.map +1 -1
- package/dist/src/metaTree.d.ts +1 -1
- package/dist/src/metaTree.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts +1 -1
- package/dist/src/modular/buildClassicalClient.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalClient.js +60 -74
- package/dist/src/modular/buildClassicalClient.js.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.d.ts +2 -2
- package/dist/src/modular/buildClassicalOperationGroups.d.ts.map +1 -1
- package/dist/src/modular/buildClassicalOperationGroups.js +8 -10
- package/dist/src/modular/buildClassicalOperationGroups.js.map +1 -1
- package/dist/src/modular/buildClientContext.d.ts +2 -2
- package/dist/src/modular/buildClientContext.d.ts.map +1 -1
- package/dist/src/modular/buildClientContext.js +31 -38
- package/dist/src/modular/buildClientContext.js.map +1 -1
- package/dist/src/modular/buildModularOptions.d.ts +1 -1
- package/dist/src/modular/buildModularOptions.d.ts.map +1 -1
- package/dist/src/modular/buildModularOptions.js +5 -6
- package/dist/src/modular/buildModularOptions.js.map +1 -1
- package/dist/src/modular/buildOperations.d.ts +3 -3
- package/dist/src/modular/buildOperations.d.ts.map +1 -1
- package/dist/src/modular/buildOperations.js +23 -25
- package/dist/src/modular/buildOperations.js.map +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts +1 -1
- package/dist/src/modular/buildProjectFiles.d.ts.map +1 -1
- package/dist/src/modular/buildProjectFiles.js +8 -11
- package/dist/src/modular/buildProjectFiles.js.map +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts +1 -1
- package/dist/src/modular/buildRestorePoller.d.ts.map +1 -1
- package/dist/src/modular/buildRestorePoller.js +12 -13
- package/dist/src/modular/buildRestorePoller.js.map +1 -1
- package/dist/src/modular/buildRootIndex.d.ts +2 -2
- package/dist/src/modular/buildRootIndex.d.ts.map +1 -1
- package/dist/src/modular/buildRootIndex.js +36 -50
- package/dist/src/modular/buildRootIndex.js.map +1 -1
- package/dist/src/modular/buildSubpathIndex.d.ts.map +1 -1
- package/dist/src/modular/buildSubpathIndex.js +9 -18
- package/dist/src/modular/buildSubpathIndex.js.map +1 -1
- package/dist/src/modular/emitLoggerFile.d.ts.map +1 -1
- package/dist/src/modular/emitLoggerFile.js +4 -4
- package/dist/src/modular/emitLoggerFile.js.map +1 -1
- package/dist/src/modular/emitModels.d.ts +1 -1
- package/dist/src/modular/emitModels.d.ts.map +1 -1
- package/dist/src/modular/emitModels.js +81 -113
- package/dist/src/modular/emitModels.js.map +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts +1 -1
- package/dist/src/modular/emitModelsOptions.d.ts.map +1 -1
- package/dist/src/modular/emitModelsOptions.js +7 -8
- package/dist/src/modular/emitModelsOptions.js.map +1 -1
- package/dist/src/modular/emitSamples.d.ts.map +1 -1
- package/dist/src/modular/emitSamples.js +69 -77
- package/dist/src/modular/emitSamples.js.map +1 -1
- package/dist/src/modular/emitTests.d.ts.map +1 -1
- package/dist/src/modular/emitTests.js +13 -18
- package/dist/src/modular/emitTests.js.map +1 -1
- package/dist/src/modular/external-dependencies.js +54 -54
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/classicalOperationHelpers.js +59 -68
- package/dist/src/modular/helpers/classicalOperationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/clientHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientHelpers.js +31 -54
- package/dist/src/modular/helpers/clientHelpers.js.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js +1 -1
- package/dist/src/modular/helpers/clientOptionHelpers.js.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/exampleValueHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/exampleValueHelpers.js +72 -84
- package/dist/src/modular/helpers/exampleValueHelpers.js.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/namingHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/namingHelpers.js +7 -10
- package/dist/src/modular/helpers/namingHelpers.js.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.d.ts +2 -2
- package/dist/src/modular/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/operationHelpers.js +204 -288
- package/dist/src/modular/helpers/operationHelpers.js.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts +1 -1
- package/dist/src/modular/helpers/typeHelpers.d.ts.map +1 -1
- package/dist/src/modular/helpers/typeHelpers.js +4 -6
- package/dist/src/modular/helpers/typeHelpers.js.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildDeserializerFunction.js +58 -67
- package/dist/src/modular/serialization/buildDeserializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildSerializerFunction.js +65 -75
- package/dist/src/modular/serialization/buildSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.d.ts.map +1 -1
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js +73 -90
- package/dist/src/modular/serialization/buildXmlSerializerFunction.js.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.d.ts.map +1 -1
- package/dist/src/modular/serialization/serializeUtils.js +25 -33
- package/dist/src/modular/serialization/serializeUtils.js.map +1 -1
- package/dist/src/modular/static-helpers-metadata.js +60 -60
- package/dist/src/modular/type-expressions/get-credential-expression.js +1 -1
- package/dist/src/modular/type-expressions/get-credential-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-enum-expression.js +1 -2
- package/dist/src/modular/type-expressions/get-enum-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-model-expression.js +10 -13
- package/dist/src/modular/type-expressions/get-model-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-nullable-expression.js +2 -3
- package/dist/src/modular/type-expressions/get-nullable-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-type-expression.js +5 -11
- package/dist/src/modular/type-expressions/get-type-expression.js.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.d.ts.map +1 -1
- package/dist/src/modular/type-expressions/get-union-expression.js.map +1 -1
- package/dist/src/rlc-common/buildClient.d.ts +1 -1
- package/dist/src/rlc-common/buildClient.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClient.js +67 -89
- package/dist/src/rlc-common/buildClient.js.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.d.ts.map +1 -1
- package/dist/src/rlc-common/buildClientDefinitions.js +28 -45
- package/dist/src/rlc-common/buildClientDefinitions.js.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIndexFile.js +59 -60
- package/dist/src/rlc-common/buildIndexFile.js.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js +37 -38
- package/dist/src/rlc-common/buildIsUnexpectedHelper.js.map +1 -1
- package/dist/src/rlc-common/buildLogger.d.ts.map +1 -1
- package/dist/src/rlc-common/buildLogger.js +4 -5
- package/dist/src/rlc-common/buildLogger.js.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.d.ts.map +1 -1
- package/dist/src/rlc-common/buildMethodShortcuts.js +4 -4
- package/dist/src/rlc-common/buildMethodShortcuts.js.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildObjectTypes.js +57 -96
- package/dist/src/rlc-common/buildObjectTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPaginateHelper.js +2 -2
- package/dist/src/rlc-common/buildPaginateHelper.js.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildParameterTypes.js +71 -61
- package/dist/src/rlc-common/buildParameterTypes.js.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildPollingHelper.js +9 -10
- package/dist/src/rlc-common/buildPollingHelper.js.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.d.ts.map +1 -1
- package/dist/src/rlc-common/buildResponseTypes.js +23 -27
- package/dist/src/rlc-common/buildResponseTypes.js.map +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts +1 -1
- package/dist/src/rlc-common/buildSamples.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSamples.js +2 -2
- package/dist/src/rlc-common/buildSchemaType.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSchemaType.js +31 -13
- package/dist/src/rlc-common/buildSchemaType.js.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.d.ts.map +1 -1
- package/dist/src/rlc-common/buildSerializeHelper.js +4 -4
- package/dist/src/rlc-common/buildSerializeHelper.js.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.d.ts.map +1 -1
- package/dist/src/rlc-common/buildTopLevelIndexFile.js +9 -13
- package/dist/src/rlc-common/buildTopLevelIndexFile.js.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/apiVersionUtil.js +6 -8
- package/dist/src/rlc-common/helpers/apiVersionUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/importsUtil.js +32 -37
- package/dist/src/rlc-common/helpers/importsUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameConstructors.js +2 -4
- package/dist/src/rlc-common/helpers/nameConstructors.js.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/nameUtils.js +17 -23
- package/dist/src/rlc-common/helpers/nameUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/operationHelpers.js +16 -31
- package/dist/src/rlc-common/helpers/operationHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/packageUtil.js +3 -6
- package/dist/src/rlc-common/helpers/packageUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/pathUtils.js +1 -3
- package/dist/src/rlc-common/helpers/pathUtils.js.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/schemaHelpers.js +3 -7
- package/dist/src/rlc-common/helpers/schemaHelpers.js.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/shortcutMethods.js +2 -2
- package/dist/src/rlc-common/helpers/shortcutMethods.js.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.d.ts.map +1 -1
- package/dist/src/rlc-common/helpers/typeUtil.js +4 -9
- package/dist/src/rlc-common/helpers/typeUtil.js.map +1 -1
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js +7 -11
- package/dist/src/rlc-common/helpers/valueGenerationUtil.js.map +1 -1
- package/dist/src/rlc-common/index.d.ts +28 -28
- package/dist/src/rlc-common/index.d.ts.map +1 -1
- package/dist/src/rlc-common/index.js +28 -28
- package/dist/src/rlc-common/index.js.map +1 -1
- package/dist/src/rlc-common/interfaces.d.ts.map +1 -1
- package/dist/src/rlc-common/interfaces.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js +14 -15
- package/dist/src/rlc-common/metadata/buildApiExtractorConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildChangelogFile.js +2 -3
- package/dist/src/rlc-common/metadata/buildChangelogFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildESLintConfig.js +5 -8
- package/dist/src/rlc-common/metadata/buildESLintConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildLicenseFile.js +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildPackageFile.js +33 -37
- package/dist/src/rlc-common/metadata/buildPackageFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildReadmeFile.js +31 -39
- package/dist/src/rlc-common/metadata/buildReadmeFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildRollupConfig.js +4 -6
- package/dist/src/rlc-common/metadata/buildRollupConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js +3 -5
- package/dist/src/rlc-common/metadata/buildSampleEnvFile.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTestConfig.js +11 -12
- package/dist/src/rlc-common/metadata/buildTestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildTsConfig.js +28 -28
- package/dist/src/rlc-common/metadata/buildTsConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildVitestConfig.js +3 -5
- package/dist/src/rlc-common/metadata/buildVitestConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/buildWarpConfig.js +4 -5
- package/dist/src/rlc-common/metadata/buildWarpConfig.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js +14 -14
- package/dist/src/rlc-common/metadata/packageJson/azurePackageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js +24 -29
- package/dist/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js +15 -16
- package/dist/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js +8 -8
- package/dist/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.js.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.d.ts.map +1 -1
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js +28 -31
- package/dist/src/rlc-common/metadata/packageJson/packageCommon.js.map +1 -1
- package/dist/src/rlc-common/metadata/utils.js +1 -2
- package/dist/src/rlc-common/metadata/utils.js.map +1 -1
- package/dist/src/rlc-common/test/buildKarmaConfig.js +1 -1
- package/dist/src/rlc-common/test/buildRecordedClient.js +4 -5
- package/dist/src/rlc-common/test/buildRecordedClient.js.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSampleTest.js +3 -4
- package/dist/src/rlc-common/test/buildSampleTest.js.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.d.ts.map +1 -1
- package/dist/src/rlc-common/test/buildSnippets.js +7 -10
- package/dist/src/rlc-common/test/buildSnippets.js.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.d.ts.map +1 -1
- package/dist/src/rlc-common/transformSampleGroups.js +41 -45
- package/dist/src/rlc-common/transformSampleGroups.js.map +1 -1
- package/dist/src/testing/index.d.ts.map +1 -1
- package/dist/src/testing/index.js +1 -1
- package/dist/src/testing/index.js.map +1 -1
- package/dist/src/transform/transform.d.ts +1 -1
- package/dist/src/transform/transform.d.ts.map +1 -1
- package/dist/src/transform/transform.js +28 -27
- package/dist/src/transform/transform.js.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts +1 -1
- package/dist/src/transform/transformApiVersionInfo.d.ts.map +1 -1
- package/dist/src/transform/transformApiVersionInfo.js +12 -14
- package/dist/src/transform/transformApiVersionInfo.js.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.d.ts.map +1 -1
- package/dist/src/transform/transformHelperFunctionDetails.js +11 -14
- package/dist/src/transform/transformHelperFunctionDetails.js.map +1 -1
- package/dist/src/transform/transformParameters.d.ts +2 -2
- package/dist/src/transform/transformParameters.d.ts.map +1 -1
- package/dist/src/transform/transformParameters.js +32 -45
- package/dist/src/transform/transformParameters.js.map +1 -1
- package/dist/src/transform/transformPaths.d.ts +1 -1
- package/dist/src/transform/transformPaths.d.ts.map +1 -1
- package/dist/src/transform/transformPaths.js +19 -23
- package/dist/src/transform/transformPaths.js.map +1 -1
- package/dist/src/transform/transformResponses.d.ts +1 -1
- package/dist/src/transform/transformResponses.d.ts.map +1 -1
- package/dist/src/transform/transformResponses.js +21 -25
- package/dist/src/transform/transformResponses.js.map +1 -1
- package/dist/src/transform/transformSchemas.d.ts.map +1 -1
- package/dist/src/transform/transformSchemas.js +21 -32
- package/dist/src/transform/transformSchemas.js.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts +1 -1
- package/dist/src/transform/transformTelemetryInfo.d.ts.map +1 -1
- package/dist/src/transform/transformTelemetryInfo.js +3 -3
- package/dist/src/transform/transformTelemetryInfo.js.map +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts +1 -1
- package/dist/src/transform/transfromRLCOptions.d.ts.map +1 -1
- package/dist/src/transform/transfromRLCOptions.js +28 -39
- package/dist/src/transform/transfromRLCOptions.js.map +1 -1
- package/dist/src/utils/clientUtils.d.ts +1 -1
- package/dist/src/utils/clientUtils.d.ts.map +1 -1
- package/dist/src/utils/clientUtils.js +15 -23
- package/dist/src/utils/clientUtils.js.map +1 -1
- package/dist/src/utils/credentialUtils.d.ts +1 -1
- package/dist/src/utils/credentialUtils.d.ts.map +1 -1
- package/dist/src/utils/credentialUtils.js +4 -5
- package/dist/src/utils/credentialUtils.js.map +1 -1
- package/dist/src/utils/crossLanguageDef.d.ts.map +1 -1
- package/dist/src/utils/crossLanguageDef.js +11 -15
- package/dist/src/utils/crossLanguageDef.js.map +1 -1
- package/dist/src/utils/emitUtil.d.ts +1 -1
- package/dist/src/utils/emitUtil.d.ts.map +1 -1
- package/dist/src/utils/emitUtil.js +5 -7
- package/dist/src/utils/emitUtil.js.map +1 -1
- package/dist/src/utils/fileSystemUtils.d.ts +2 -0
- package/dist/src/utils/fileSystemUtils.d.ts.map +1 -1
- package/dist/src/utils/fileSystemUtils.js +26 -7
- package/dist/src/utils/fileSystemUtils.js.map +1 -1
- package/dist/src/utils/importHelper.d.ts.map +1 -1
- package/dist/src/utils/importHelper.js +3 -6
- package/dist/src/utils/importHelper.js.map +1 -1
- package/dist/src/utils/interfaces.d.ts +1 -1
- package/dist/src/utils/interfaces.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.d.ts.map +1 -1
- package/dist/src/utils/mediaTypes.js +7 -19
- package/dist/src/utils/mediaTypes.js.map +1 -1
- package/dist/src/utils/modelUtils.d.ts +5 -5
- package/dist/src/utils/modelUtils.d.ts.map +1 -1
- package/dist/src/utils/modelUtils.js +168 -257
- package/dist/src/utils/modelUtils.js.map +1 -1
- package/dist/src/utils/namespaceUtils.d.ts.map +1 -1
- package/dist/src/utils/namespaceUtils.js +6 -7
- package/dist/src/utils/namespaceUtils.js.map +1 -1
- package/dist/src/utils/operationUtil.d.ts +1 -1
- package/dist/src/utils/operationUtil.d.ts.map +1 -1
- package/dist/src/utils/operationUtil.js +60 -81
- package/dist/src/utils/operationUtil.js.map +1 -1
- package/dist/src/utils/parameterUtils.d.ts +1 -1
- package/dist/src/utils/parameterUtils.d.ts.map +1 -1
- package/dist/src/utils/parameterUtils.js +26 -33
- package/dist/src/utils/parameterUtils.js.map +1 -1
- package/dist/src/utils/resolve-project-root.js +2 -2
- package/dist/src/utils/resolve-project-root.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +38 -45
- package/src/contextManager.ts +6 -9
- package/src/framework/declaration.ts +18 -28
- package/src/framework/dependency.ts +1 -2
- package/src/framework/hooks/binder.ts +47 -120
- package/src/framework/hooks/sdkTypes.ts +27 -54
- package/src/framework/hooks/useDependencies.ts +2 -4
- package/src/framework/load-static-helpers.ts +28 -51
- package/src/framework/reference.ts +2 -5
- package/src/framework/sample.ts +9 -9
- package/src/index.ts +145 -185
- package/src/lib.ts +143 -158
- package/src/metaTree.ts +1 -1
- package/src/modular/buildClassicalClient.ts +83 -160
- package/src/modular/buildClassicalOperationGroups.ts +14 -39
- package/src/modular/buildClientContext.ts +54 -83
- package/src/modular/buildModularOptions.ts +4 -5
- package/src/modular/buildOperations.ts +46 -73
- package/src/modular/buildProjectFiles.ts +18 -47
- package/src/modular/buildRestorePoller.ts +27 -46
- package/src/modular/buildRootIndex.ts +86 -160
- package/src/modular/buildSubpathIndex.ts +35 -58
- package/src/modular/emitLoggerFile.ts +4 -9
- package/src/modular/emitModels.ts +136 -266
- package/src/modular/emitModelsOptions.ts +10 -16
- package/src/modular/emitSamples.ts +92 -180
- package/src/modular/emitTests.ts +28 -61
- package/src/modular/external-dependencies.ts +54 -54
- package/src/modular/helpers/classicalOperationHelpers.ts +73 -126
- package/src/modular/helpers/clientHelpers.ts +41 -88
- package/src/modular/helpers/clientOptionHelpers.ts +4 -11
- package/src/modular/helpers/exampleValueHelpers.ts +99 -215
- package/src/modular/helpers/namingHelpers.ts +12 -28
- package/src/modular/helpers/operationHelpers.ts +430 -757
- package/src/modular/helpers/typeHelpers.ts +11 -22
- package/src/modular/serialization/buildDeserializerFunction.ts +88 -122
- package/src/modular/serialization/buildSerializerFunction.ts +91 -129
- package/src/modular/serialization/buildXmlSerializerFunction.ts +104 -183
- package/src/modular/serialization/serializeUtils.ts +12 -22
- package/src/modular/static/rollup.test.config.js +11 -14
- package/src/modular/static/scripts/renameOutput.mjs +2 -2
- package/src/modular/static-helpers-metadata.ts +60 -60
- package/src/modular/type-expressions/get-credential-expression.ts +1 -1
- package/src/modular/type-expressions/get-enum-expression.ts +5 -10
- package/src/modular/type-expressions/get-model-expression.ts +13 -17
- package/src/modular/type-expressions/get-nullable-expression.ts +4 -5
- package/src/modular/type-expressions/get-type-expression.ts +8 -12
- package/src/modular/type-expressions/get-union-expression.ts +4 -4
- package/src/modular/type-expressions/utils.ts +1 -1
- package/src/rlc-common/buildClient.ts +70 -141
- package/src/rlc-common/buildClientDefinitions.ts +44 -87
- package/src/rlc-common/buildIndexFile.ts +78 -78
- package/src/rlc-common/buildIsUnexpectedHelper.ts +34 -41
- package/src/rlc-common/buildLogger.ts +7 -7
- package/src/rlc-common/buildMethodShortcuts.ts +9 -21
- package/src/rlc-common/buildObjectTypes.ts +79 -156
- package/src/rlc-common/buildPaginateHelper.ts +9 -12
- package/src/rlc-common/buildParameterTypes.ts +116 -137
- package/src/rlc-common/buildPollingHelper.ts +7 -7
- package/src/rlc-common/buildResponseTypes.ts +34 -57
- package/src/rlc-common/buildSamples.ts +3 -3
- package/src/rlc-common/buildSchemaType.ts +37 -29
- package/src/rlc-common/buildSerializeHelper.ts +5 -5
- package/src/rlc-common/buildTopLevelIndexFile.ts +12 -19
- package/src/rlc-common/helpers/apiVersionUtil.ts +5 -10
- package/src/rlc-common/helpers/importsUtil.ts +27 -30
- package/src/rlc-common/helpers/nameConstructors.ts +16 -50
- package/src/rlc-common/helpers/nameUtils.ts +19 -42
- package/src/rlc-common/helpers/operationHelpers.ts +14 -31
- package/src/rlc-common/helpers/pathUtils.ts +2 -7
- package/src/rlc-common/helpers/schemaHelpers.ts +4 -15
- package/src/rlc-common/helpers/shortcutMethods.ts +6 -15
- package/src/rlc-common/helpers/typeUtil.ts +4 -11
- package/src/rlc-common/helpers/valueGenerationUtil.ts +16 -39
- package/src/rlc-common/index.ts +28 -28
- package/src/rlc-common/interfaces.ts +3 -11
- package/src/rlc-common/metadata/buildApiExtractorConfig.ts +17 -24
- package/src/rlc-common/metadata/buildChangelogFile.ts +1 -1
- package/src/rlc-common/metadata/buildESLintConfig.ts +3 -5
- package/src/rlc-common/metadata/buildLicenseFile.ts +1 -1
- package/src/rlc-common/metadata/buildPackageFile.ts +27 -35
- package/src/rlc-common/metadata/buildReadmeFile.ts +16 -29
- package/src/rlc-common/metadata/buildRollupConfig.ts +5 -8
- package/src/rlc-common/metadata/buildSampleEnvFile.ts +2 -3
- package/src/rlc-common/metadata/buildTestConfig.ts +10 -10
- package/src/rlc-common/metadata/buildTsConfig.ts +32 -35
- package/src/rlc-common/metadata/buildVitestConfig.ts +4 -10
- package/src/rlc-common/metadata/buildWarpConfig.ts +3 -6
- package/src/rlc-common/metadata/packageJson/azurePackageCommon.ts +16 -25
- package/src/rlc-common/metadata/packageJson/buildAzureMonorepoPackage.ts +29 -50
- package/src/rlc-common/metadata/packageJson/buildAzureStandalonePackage.ts +20 -31
- package/src/rlc-common/metadata/packageJson/buildFlavorlessPackage.ts +11 -13
- package/src/rlc-common/metadata/packageJson/packageCommon.ts +32 -52
- package/src/rlc-common/test/buildKarmaConfig.ts +1 -1
- package/src/rlc-common/test/buildRecordedClient.ts +3 -3
- package/src/rlc-common/test/buildSampleTest.ts +3 -3
- package/src/rlc-common/test/buildSnippets.ts +6 -12
- package/src/rlc-common/transformSampleGroups.ts +54 -105
- package/src/testing/index.ts +2 -5
- package/src/transform/transform.ts +22 -34
- package/src/transform/transformApiVersionInfo.ts +17 -30
- package/src/transform/transformHelperFunctionDetails.ts +14 -26
- package/src/transform/transformParameters.ts +55 -105
- package/src/transform/transformPaths.ts +26 -43
- package/src/transform/transformResponses.ts +26 -33
- package/src/transform/transformSchemas.ts +15 -33
- package/src/transform/transformTelemetryInfo.ts +8 -14
- package/src/transform/transfromRLCOptions.ts +53 -116
- package/src/utils/clientUtils.ts +22 -41
- package/src/utils/credentialUtils.ts +8 -19
- package/src/utils/crossLanguageDef.ts +15 -34
- package/src/utils/emitUtil.ts +11 -17
- package/src/utils/fileSystemUtils.ts +30 -8
- package/src/utils/importHelper.ts +5 -10
- package/src/utils/interfaces.ts +1 -1
- package/src/utils/mediaTypes.ts +13 -34
- package/src/utils/modelUtils.ts +175 -384
- package/src/utils/namespaceUtils.ts +8 -24
- package/src/utils/operationUtil.ts +98 -190
- package/src/utils/parameterUtils.ts +31 -54
- package/src/utils/resolve-project-root.ts +3 -3
- package/static/static-helpers/cloudSettingHelpers.ts +4 -6
- package/static/static-helpers/multipartHelpers.ts +3 -3
- package/static/static-helpers/pagingHelpers.ts +28 -63
- package/static/static-helpers/pollingHelpers.ts +16 -29
- package/static/static-helpers/serialization/build-multi-collection.ts +1 -4
- package/static/static-helpers/serialization/check-prop-undefined.ts +1 -4
- package/static/static-helpers/serialization/get-binary-response-browser.mts +3 -1
- package/static/static-helpers/serialization/get-binary-response.ts +2 -2
- package/static/static-helpers/serialization/get-binary-stream-response-browser.mts +1 -3
- package/static/static-helpers/serialization/get-binary-stream-response.ts +2 -4
- package/static/static-helpers/serialization/serialize-record.ts +1 -1
- package/static/static-helpers/serialization/serializers.ts +4 -7
- package/static/static-helpers/serialization/xml-helpers.ts +42 -90
- package/static/static-helpers/simplePollerHelpers.ts +10 -19
- package/static/static-helpers/storageCompatResponse.ts +10 -27
- package/static/static-helpers/urlTemplate.ts +4 -7
- package/static/test-helpers/recordedClient.ts +5 -10
|
@@ -1,22 +1,21 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import {
|
|
4
|
-
import { KnownMediaType, extractMediaTypes, hasMediaType, isMediaTypeJsonMergePatch } from "../utils/mediaTypes.js";
|
|
5
|
-
import { getHttpOperationWithCache, isApiVersion } from "@azure-tools/typespec-client-generator-core";
|
|
3
|
+
import { getHttpOperationWithCache, isApiVersion, } from "@azure-tools/typespec-client-generator-core";
|
|
6
4
|
import { NoTarget, isVoidType } from "@typespec/compiler";
|
|
7
|
-
import { getBodyType, getCollectionFormat, getFormattedPropertyDoc, getImportedModelName, getSchemaForType, getTypeName, isArrayType, isBodyRequired } from "../utils/modelUtils.js";
|
|
8
|
-
import { getOperationGroupName, getOperationName, getSpecialSerializeInfo } from "../utils/operationUtil.js";
|
|
9
|
-
import { getParameterSerializationInfo } from "../utils/parameterUtils.js";
|
|
10
5
|
import { reportDiagnostic } from "../lib.js";
|
|
6
|
+
import { SchemaContext, } from "../rlc-common/index.js";
|
|
11
7
|
import { listOperationsUnderRLCClient } from "../utils/clientUtils.js";
|
|
8
|
+
import { KnownMediaType, extractMediaTypes, hasMediaType, isMediaTypeJsonMergePatch, } from "../utils/mediaTypes.js";
|
|
9
|
+
import { getBodyType, getCollectionFormat, getFormattedPropertyDoc, getImportedModelName, getSchemaForType, getTypeName, isArrayType, isBodyRequired, } from "../utils/modelUtils.js";
|
|
10
|
+
import { getOperationGroupName, getOperationName, getSpecialSerializeInfo, } from "../utils/operationUtil.js";
|
|
11
|
+
import { getParameterSerializationInfo } from "../utils/parameterUtils.js";
|
|
12
12
|
export function transformToParameterTypes(client, dpgContext, importDetails, apiVersionInfo) {
|
|
13
|
-
var _a;
|
|
14
13
|
const rlcParameters = [];
|
|
15
14
|
const outputImportedSet = new Set();
|
|
16
15
|
for (const op of listOperationsUnderRLCClient(client)) {
|
|
17
16
|
const route = getHttpOperationWithCache(dpgContext, op);
|
|
18
17
|
// ignore overload base operation
|
|
19
|
-
if (route.overloads &&
|
|
18
|
+
if (route.overloads && route.overloads?.length > 0) {
|
|
20
19
|
continue;
|
|
21
20
|
}
|
|
22
21
|
transformToParameterTypesForRoute(route);
|
|
@@ -29,13 +28,13 @@ export function transformToParameterTypes(client, dpgContext, importDetails, api
|
|
|
29
28
|
const rlcParameter = {
|
|
30
29
|
operationGroup: getOperationGroupName(dpgContext, route),
|
|
31
30
|
operationName: getOperationName(dpgContext, route.operation),
|
|
32
|
-
parameters: []
|
|
31
|
+
parameters: [],
|
|
33
32
|
};
|
|
34
33
|
const options = {
|
|
35
34
|
apiVersionInfo,
|
|
36
35
|
operationGroupName: rlcParameter.operationGroup,
|
|
37
36
|
operationName: rlcParameter.operationName,
|
|
38
|
-
importModels: outputImportedSet
|
|
37
|
+
importModels: outputImportedSet,
|
|
39
38
|
};
|
|
40
39
|
// transform query param
|
|
41
40
|
const queryParams = transformQueryParameters(dpgContext, parameters, options);
|
|
@@ -53,24 +52,23 @@ export function transformToParameterTypes(client, dpgContext, importDetails, api
|
|
|
53
52
|
}
|
|
54
53
|
rlcParameter.parameters.push({
|
|
55
54
|
parameters: [...queryParams, ...pathParams, ...headerParams],
|
|
56
|
-
body: bodyParameter
|
|
55
|
+
body: bodyParameter,
|
|
57
56
|
});
|
|
58
57
|
rlcParameters.push(rlcParameter);
|
|
59
58
|
}
|
|
60
59
|
return rlcParameters;
|
|
61
60
|
}
|
|
62
61
|
function getParameterMetadata(dpgContext, paramType, parameter, options) {
|
|
63
|
-
var _a, _b, _c;
|
|
64
62
|
const program = dpgContext.program;
|
|
65
|
-
const importedModels =
|
|
63
|
+
const importedModels = options.importModels ?? new Set();
|
|
66
64
|
const schemaContext = [SchemaContext.Exception, SchemaContext.Input];
|
|
67
65
|
const schema = getSchemaForType(dpgContext, parameter.param.type, {
|
|
68
66
|
usage: schemaContext,
|
|
69
67
|
needRef: false,
|
|
70
|
-
relevantProperty: parameter.param
|
|
68
|
+
relevantProperty: parameter.param,
|
|
71
69
|
});
|
|
72
70
|
const name = getParameterName(parameter.name);
|
|
73
|
-
let description =
|
|
71
|
+
let description = getFormattedPropertyDoc(program, parameter.param, schema) ?? "";
|
|
74
72
|
const format = getCollectionFormat(dpgContext, parameter);
|
|
75
73
|
if (isArrayType(schema) && format) {
|
|
76
74
|
const serializeInfo = getSpecialSerializeInfo(dpgContext, parameter.type, format);
|
|
@@ -83,7 +81,7 @@ function getParameterMetadata(dpgContext, paramType, parameter, options) {
|
|
|
83
81
|
description += `${description ? "\n" : ""}This parameter could be formatted as tsv collection string.`;
|
|
84
82
|
}
|
|
85
83
|
}
|
|
86
|
-
|
|
84
|
+
getImportedModelName(schema, schemaContext)?.forEach(importedModels.add, importedModels);
|
|
87
85
|
const serializationType = getParameterSerializationInfo(dpgContext, parameter, schema, options.operationGroupName, options.operationName);
|
|
88
86
|
return {
|
|
89
87
|
type: paramType,
|
|
@@ -94,8 +92,8 @@ function getParameterMetadata(dpgContext, paramType, parameter, options) {
|
|
|
94
92
|
typeName: serializationType.typeName,
|
|
95
93
|
required: !parameter.param.optional,
|
|
96
94
|
description,
|
|
97
|
-
wrapperType: serializationType.wrapperType
|
|
98
|
-
}
|
|
95
|
+
wrapperType: serializationType.wrapperType,
|
|
96
|
+
},
|
|
99
97
|
};
|
|
100
98
|
}
|
|
101
99
|
function getParameterName(name) {
|
|
@@ -113,19 +111,15 @@ function transformCookieParameters(dpgContext, parameters) {
|
|
|
113
111
|
code: "parameter-type-not-supported",
|
|
114
112
|
format: {
|
|
115
113
|
paramName: p.name,
|
|
116
|
-
paramType: p.type
|
|
114
|
+
paramType: p.type,
|
|
117
115
|
},
|
|
118
|
-
target: NoTarget
|
|
116
|
+
target: NoTarget,
|
|
119
117
|
});
|
|
120
118
|
});
|
|
121
119
|
}
|
|
122
120
|
function transformQueryParameters(dpgContext, parameters, options) {
|
|
123
|
-
const queryParameters = parameters.parameters.filter((p) =>
|
|
124
|
-
|
|
125
|
-
return p.type === "query" &&
|
|
126
|
-
!(isApiVersion(dpgContext, p.param) &&
|
|
127
|
-
((_a = options.apiVersionInfo) === null || _a === void 0 ? void 0 : _a.definedPosition) === "query");
|
|
128
|
-
});
|
|
121
|
+
const queryParameters = parameters.parameters.filter((p) => p.type === "query" &&
|
|
122
|
+
!(isApiVersion(dpgContext, p.param) && options.apiVersionInfo?.definedPosition === "query"));
|
|
129
123
|
if (!queryParameters.length) {
|
|
130
124
|
return [];
|
|
131
125
|
}
|
|
@@ -155,20 +149,18 @@ export function transformHeaderParameters(dpgContext, parameters, options) {
|
|
|
155
149
|
return headerParameters.map((qp) => getParameterMetadata(dpgContext, "header", qp, options));
|
|
156
150
|
}
|
|
157
151
|
function transformBodyParameters(dpgContext, parameters, headers, importedModels, inputBodyType) {
|
|
158
|
-
|
|
159
|
-
const bodyType = parameters.body && inputBodyType ? inputBodyType : (_a = parameters.body) === null || _a === void 0 ? void 0 : _a.type;
|
|
152
|
+
const bodyType = parameters.body && inputBodyType ? inputBodyType : parameters.body?.type;
|
|
160
153
|
if (!bodyType || isVoidType(bodyType)) {
|
|
161
154
|
return;
|
|
162
155
|
}
|
|
163
156
|
return transformRequestBody(dpgContext, bodyType, parameters, importedModels, headers);
|
|
164
157
|
}
|
|
165
158
|
function transformRequestBody(dpgContext, bodyType, parameters, importedModels, headers) {
|
|
166
|
-
|
|
167
|
-
const contentTypes = extractMediaTypes((_b = (_a = parameters.body) === null || _a === void 0 ? void 0 : _a.contentTypes) !== null && _b !== void 0 ? _b : []);
|
|
159
|
+
const contentTypes = extractMediaTypes(parameters.body?.contentTypes ?? []);
|
|
168
160
|
const schema = getSchemaForType(dpgContext, bodyType, {
|
|
169
161
|
mediaTypes: contentTypes,
|
|
170
162
|
isRequestBody: true,
|
|
171
|
-
usage: [SchemaContext.Input, SchemaContext.Exception]
|
|
163
|
+
usage: [SchemaContext.Input, SchemaContext.Exception],
|
|
172
164
|
});
|
|
173
165
|
const descriptions = getBodyDescriptions(dpgContext, schema, parameters);
|
|
174
166
|
const type = getRequestBodyType(schema, importedModels, headers);
|
|
@@ -182,31 +174,26 @@ function transformRequestBody(dpgContext, bodyType, parameters, importedModels,
|
|
|
182
174
|
type,
|
|
183
175
|
required: isBodyRequired(parameters),
|
|
184
176
|
description: descriptions.join("\n\n"),
|
|
185
|
-
isMultipartBody: hasMediaType(KnownMediaType.MultipartFormData, contentTypes) &&
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
]
|
|
177
|
+
isMultipartBody: hasMediaType(KnownMediaType.MultipartFormData, contentTypes) && contentTypes.length === 1,
|
|
178
|
+
oriSchema: schema,
|
|
179
|
+
},
|
|
180
|
+
],
|
|
190
181
|
};
|
|
191
182
|
}
|
|
192
183
|
function getRequestBodyType(bodySchema, importedModels, headers) {
|
|
193
|
-
var _a;
|
|
194
184
|
const schemaUsage = [SchemaContext.Input, SchemaContext.Exception];
|
|
195
|
-
const importedNames =
|
|
185
|
+
const importedNames = getImportedModelName(bodySchema, schemaUsage) ?? [];
|
|
196
186
|
importedNames.forEach(importedModels.add, importedModels);
|
|
197
187
|
let typeName = getTypeName(bodySchema, schemaUsage);
|
|
198
|
-
const contentTypes = headers
|
|
199
|
-
const hasMergeAndPatchType = isMediaTypeJsonMergePatch(contentTypes
|
|
200
|
-
if (hasMergeAndPatchType &&
|
|
201
|
-
Boolean(bodySchema.name) &&
|
|
202
|
-
bodySchema.properties) {
|
|
188
|
+
const contentTypes = headers?.filter((h) => h.name === "contentType").map((h) => h.param.type);
|
|
189
|
+
const hasMergeAndPatchType = isMediaTypeJsonMergePatch(contentTypes ?? []);
|
|
190
|
+
if (hasMergeAndPatchType && Boolean(bodySchema.name) && bodySchema.properties) {
|
|
203
191
|
typeName = `${typeName}ResourceMergeAndPatch`;
|
|
204
192
|
}
|
|
205
193
|
return typeName;
|
|
206
194
|
}
|
|
207
195
|
function getBodyDescriptions(dpgContext, bodySchema, parameters) {
|
|
208
|
-
|
|
209
|
-
const description = ((_a = parameters.body) === null || _a === void 0 ? void 0 : _a.property)
|
|
196
|
+
const description = parameters.body?.property
|
|
210
197
|
? getFormattedPropertyDoc(dpgContext.program, parameters.body.property, bodySchema)
|
|
211
198
|
: "";
|
|
212
199
|
return description ? [description] : [];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformParameters.js","sourceRoot":"","sources":["../../../src/transform/transformParameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,
|
|
1
|
+
{"version":3,"file":"transformParameters.js","sourceRoot":"","sources":["../../../src/transform/transformParameters.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAEL,yBAAyB,EACzB,YAAY,GACb,MAAM,6CAA6C,CAAC;AACrD,OAAO,EAAE,QAAQ,EAAQ,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAEhE,OAAO,EAAE,gBAAgB,EAAE,MAAM,WAAW,CAAC;AAC7C,OAAO,EAQL,aAAa,GACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EACL,cAAc,EACd,iBAAiB,EACjB,YAAY,EACZ,yB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AkB,EAClB,UAAmC;IAEnC,MAAM,WAAW,GAAG,UAAU,CAAC,IAAI,EAAE,QAAQ;QAC3C,CAAC,CAAC,uBAAuB,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,IAAI,CAAC,QAAQ,EAAE,UAAU,CAAC;QACnF,CAAC,CAAC,EAAE,CAAC;IACP,OAAO,WAAW,CAAC,CAAC,CAAC,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC,EAAE,CAAC;AAC1C,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Imports, Paths } from "../rlc-common/index.js";
|
|
2
1
|
import { SdkClient } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
+
import { Imports, Paths } from "../rlc-common/index.js";
|
|
3
3
|
import { SdkContext } from "../utils/interfaces.js";
|
|
4
4
|
export declare function transformPaths(client: SdkClient, dpgContext: SdkContext, importDetails: Imports): Paths;
|
|
5
5
|
//# sourceMappingURL=transformPaths.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformPaths.d.ts","sourceRoot":"","sources":["../../../src/transform/transformPaths.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transformPaths.d.ts","sourceRoot":"","sources":["../../../src/transform/transformPaths.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,SAAS,EAGV,MAAM,6CAA6C,CAAC;AAErD,OAAO,EACL,OAAO,EAGP,KAAK,EAIN,MAAM,wBAAwB,CAAC;AAehC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAGpD,wBAAgB,cAAc,CAC5B,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,OAAO,GACrB,KAAK,CAiBP"}
|
|
@@ -1,20 +1,19 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import { extractOperationLroDetail, getOperationGroupName, getOperationName, getOperationResponseTypes, getOperationStatuscode, getOperationSuccessStatus, isPagingOperation, sortedOperationResponses } from "../utils/operationUtil.js";
|
|
3
|
+
import { getHttpOperationWithCache, isApiVersion, } from "@azure-tools/typespec-client-generator-core";
|
|
4
|
+
import { SchemaContext, getParameterTypeName, getResponseTypeName, } from "../rlc-common/index.js";
|
|
6
5
|
import { getImportedModelName, getSchemaForType, isBodyRequired } from "../utils/modelUtils.js";
|
|
6
|
+
import { extractOperationLroDetail, getOperationGroupName, getOperationName, getOperationResponseTypes, getOperationStatuscode, getOperationSuccessStatus, isPagingOperation, sortedOperationResponses, } from "../utils/operationUtil.js";
|
|
7
7
|
import { getDoc } from "@typespec/compiler";
|
|
8
|
-
import { getParameterSerializationInfo } from "../utils/parameterUtils.js";
|
|
9
8
|
import { listOperationsUnderRLCClient } from "../utils/clientUtils.js";
|
|
9
|
+
import { getParameterSerializationInfo } from "../utils/parameterUtils.js";
|
|
10
10
|
export function transformPaths(client, dpgContext, importDetails) {
|
|
11
|
-
var _a;
|
|
12
11
|
const pathParamsImportedSet = new Set();
|
|
13
12
|
const paths = {};
|
|
14
13
|
for (const op of listOperationsUnderRLCClient(client)) {
|
|
15
14
|
const route = getHttpOperationWithCache(dpgContext, op);
|
|
16
15
|
// ignore overload base operation
|
|
17
|
-
if (route.overloads &&
|
|
16
|
+
if (route.overloads && route.overloads?.length > 0) {
|
|
18
17
|
continue;
|
|
19
18
|
}
|
|
20
19
|
transformOperation(dpgContext, route, paths, pathParamsImportedSet);
|
|
@@ -25,7 +24,6 @@ export function transformPaths(client, dpgContext, importDetails) {
|
|
|
25
24
|
return paths;
|
|
26
25
|
}
|
|
27
26
|
function transformOperation(dpgContext, route, paths, importSet) {
|
|
28
|
-
var _a, _b, _c, _d, _e, _f;
|
|
29
27
|
const program = dpgContext.program;
|
|
30
28
|
const respNames = [];
|
|
31
29
|
const operationGroupName = getOperationGroupName(dpgContext, route);
|
|
@@ -35,7 +33,7 @@ function transformOperation(dpgContext, route, paths, importSet) {
|
|
|
35
33
|
}
|
|
36
34
|
const responseTypes = getOperationResponseTypes(dpgContext, route);
|
|
37
35
|
const method = {
|
|
38
|
-
description:
|
|
36
|
+
description: getDoc(program, route.operation) ?? "",
|
|
39
37
|
hasOptionalOptions: !hasRequiredOptions(dpgContext, route.parameters),
|
|
40
38
|
optionsName: getParameterTypeName(operationGroupName, getOperationName(dpgContext, route.operation)),
|
|
41
39
|
responseTypes,
|
|
@@ -44,47 +42,45 @@ function transformOperation(dpgContext, route, paths, importSet) {
|
|
|
44
42
|
operationName: getOperationName(dpgContext, route.operation),
|
|
45
43
|
operationHelperDetail: {
|
|
46
44
|
lroDetails: extractOperationLroDetail(dpgContext, route, responseTypes, operationGroupName),
|
|
47
|
-
isPaging: isPagingOperation(dpgContext, route)
|
|
48
|
-
}
|
|
45
|
+
isPaging: isPagingOperation(dpgContext, route),
|
|
46
|
+
},
|
|
49
47
|
};
|
|
50
|
-
if (paths[route.path] !== undefined &&
|
|
51
|
-
!((_b = paths[route.path]) === null || _b === void 0 ? void 0 : _b.methods[route.verb])) {
|
|
48
|
+
if (paths[route.path] !== undefined && !paths[route.path]?.methods[route.verb]) {
|
|
52
49
|
paths[route.path].methods[route.verb] = [method];
|
|
53
50
|
}
|
|
54
|
-
else if (
|
|
55
|
-
|
|
51
|
+
else if (paths[route.path]?.methods[route.verb]) {
|
|
52
|
+
paths[route.path]?.methods[route.verb]?.push(method);
|
|
56
53
|
}
|
|
57
54
|
else {
|
|
58
55
|
paths[route.path] = {
|
|
59
|
-
description:
|
|
56
|
+
description: getDoc(program, route.operation) ?? "",
|
|
60
57
|
name: escapeCoreName(getOperationName(dpgContext, route.operation) || "Client"),
|
|
61
58
|
pathParameters: route.parameters.parameters
|
|
62
59
|
.filter((p) => p.type === "path")
|
|
63
60
|
.map((p) => {
|
|
64
|
-
var _a, _b, _c;
|
|
65
61
|
const schemaUsage = [SchemaContext.Input, SchemaContext.Exception];
|
|
66
62
|
const options = {
|
|
67
63
|
usage: schemaUsage,
|
|
68
64
|
needRef: false,
|
|
69
|
-
relevantProperty: p.param
|
|
65
|
+
relevantProperty: p.param,
|
|
70
66
|
};
|
|
71
67
|
const schema = p.param.sourceProperty
|
|
72
|
-
? getSchemaForType(dpgContext,
|
|
68
|
+
? getSchemaForType(dpgContext, p.param.sourceProperty?.type, options)
|
|
73
69
|
: getSchemaForType(dpgContext, p.param.type, options);
|
|
74
|
-
const importedNames =
|
|
70
|
+
const importedNames = getImportedModelName(schema, schemaUsage) ?? [];
|
|
75
71
|
importedNames.forEach(importSet.add, importSet);
|
|
76
72
|
const serializationType = getParameterSerializationInfo(dpgContext, p, schema, operationGroupName, method.operationName);
|
|
77
73
|
return {
|
|
78
74
|
name: p.name,
|
|
79
75
|
type: serializationType.typeName,
|
|
80
|
-
description:
|
|
81
|
-
wrapperType: serializationType.wrapperType
|
|
76
|
+
description: getDoc(program, p.param) ?? "",
|
|
77
|
+
wrapperType: serializationType.wrapperType,
|
|
82
78
|
};
|
|
83
79
|
}),
|
|
84
80
|
operationGroupName: getOperationGroupName(dpgContext, route),
|
|
85
81
|
methods: {
|
|
86
|
-
[route.verb]: [method]
|
|
87
|
-
}
|
|
82
|
+
[route.verb]: [method],
|
|
83
|
+
},
|
|
88
84
|
};
|
|
89
85
|
}
|
|
90
86
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformPaths.js","sourceRoot":"","sources":["../../../src/transform/transformPaths.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;
|
|
1
|
+
{"version":3,"file":"transformPaths.js","sourceRoot":"","sources":["../../../src/transform/transformPaths.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAEL,yBAAyB,EACzB,YAAY,GACb,MAAM,6CAA6C,CAAC;AAErD,OAAO,EAKL,aAAa,EACb,oBAAoB,EACpB,mBAAmB,GACpB,MAAM,wBAAwB,CAAC;AAChC,OAA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AS,EAAE,EAAE,CAAC,CAAC,YAAY,CAAC,UAAU,EAAE,SAAS,CAAC,KAAK,CAAC,CAAC;SACjE,MAAM,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,CAAC,CAAC,SAAS,CAAC,KAAK,CAAC;SACxC,IAAI,CAAC,CAAC,SAAS,EAAE,EAAE,CAAC,SAAS,CAAC,KAAK,CAAC,QAAQ,KAAK,KAAK,CAAC,CAAC;IAC3D,OAAO,mBAAmB,IAAI,4BAA4B,CAAC;AAC7D,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { Imports, OperationResponse } from "../rlc-common/index.js";
|
|
2
1
|
import { SdkClient } from "@azure-tools/typespec-client-generator-core";
|
|
2
|
+
import { Imports, OperationResponse } from "../rlc-common/index.js";
|
|
3
3
|
import { SdkContext } from "../utils/interfaces.js";
|
|
4
4
|
export declare function transformToResponseTypes(client: SdkClient, dpgContext: SdkContext, importDetails: Imports): OperationResponse[];
|
|
5
5
|
//# sourceMappingURL=transformResponses.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformResponses.d.ts","sourceRoot":"","sources":["../../../src/transform/transformResponses.ts"],"names":[],"mappings":"AAGA,OAAO,
|
|
1
|
+
{"version":3,"file":"transformResponses.d.ts","sourceRoot":"","sources":["../../../src/transform/transformResponses.ts"],"names":[],"mappings":"AAGA,OAAO,EAA6B,SAAS,EAAE,MAAM,6CAA6C,CAAC;AAGnG,OAAO,EAEL,OAAO,EACP,iBAAiB,EAKlB,MAAM,wBAAwB,CAAC;AAEhC,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAgBpD,wBAAgB,wBAAwB,CACtC,MAAM,EAAE,SAAS,EACjB,UAAU,EAAE,UAAU,EACtB,aAAa,EAAE,OAAO,GACrB,iBAAiB,EAAE,CAwDrB"}
|
|
@@ -1,19 +1,18 @@
|
|
|
1
1
|
// Copyright (c) Microsoft Corporation.
|
|
2
2
|
// Licensed under the MIT License.
|
|
3
|
-
import { getLroLogicalResponseName, SchemaContext } from "../rlc-common/index.js";
|
|
4
3
|
import { getHttpOperationWithCache } from "@azure-tools/typespec-client-generator-core";
|
|
5
4
|
import { getDoc, isVoidType } from "@typespec/compiler";
|
|
6
|
-
import {
|
|
7
|
-
import { getOperationGroupName, getOperationLroOverload, getOperationName, getOperationStatuscode, isBinaryPayload, sortedOperationResponses } from "../utils/operationUtil.js";
|
|
5
|
+
import { getLroLogicalResponseName, SchemaContext, } from "../rlc-common/index.js";
|
|
8
6
|
import { listOperationsUnderRLCClient } from "../utils/clientUtils.js";
|
|
7
|
+
import { getBinaryType, getImportedModelName, getSchemaForType, getTypeName, } from "../utils/modelUtils.js";
|
|
8
|
+
import { getOperationGroupName, getOperationLroOverload, getOperationName, getOperationStatuscode, isBinaryPayload, sortedOperationResponses, } from "../utils/operationUtil.js";
|
|
9
9
|
export function transformToResponseTypes(client, dpgContext, importDetails) {
|
|
10
|
-
var _a;
|
|
11
10
|
const rlcResponses = [];
|
|
12
11
|
const inputImportedSet = new Set();
|
|
13
12
|
for (const op of listOperationsUnderRLCClient(client)) {
|
|
14
13
|
const route = getHttpOperationWithCache(dpgContext, op);
|
|
15
14
|
// ignore overload base operation
|
|
16
|
-
if (route.overloads &&
|
|
15
|
+
if (route.overloads && route.overloads?.length > 0) {
|
|
17
16
|
continue;
|
|
18
17
|
}
|
|
19
18
|
transformToResponseTypesForRoute(route);
|
|
@@ -22,28 +21,27 @@ export function transformToResponseTypes(client, dpgContext, importDetails) {
|
|
|
22
21
|
importDetails.response.importsSet = inputImportedSet;
|
|
23
22
|
}
|
|
24
23
|
function transformToResponseTypesForRoute(route) {
|
|
25
|
-
var _a;
|
|
26
24
|
const rlcOperationUnit = {
|
|
27
25
|
operationGroup: getOperationGroupName(dpgContext, route),
|
|
28
26
|
operationName: getOperationName(dpgContext, route.operation),
|
|
29
27
|
path: route.path,
|
|
30
|
-
responses: []
|
|
28
|
+
responses: [],
|
|
31
29
|
};
|
|
32
30
|
const defaultSchemas = [], nonDefaultSchemas = [];
|
|
33
31
|
for (const resp of sortedOperationResponses(route.responses)) {
|
|
34
32
|
const statusCode = getOperationStatuscode(resp);
|
|
35
33
|
const rlcResponseUnit = {
|
|
36
34
|
statusCode,
|
|
37
|
-
description: resp.description
|
|
35
|
+
description: resp.description,
|
|
38
36
|
};
|
|
39
37
|
// transform header
|
|
40
38
|
const headers = transformHeaders(dpgContext, resp, inputImportedSet);
|
|
41
39
|
// transform body
|
|
42
|
-
const [body, schemas] =
|
|
40
|
+
const [body, schemas] = transformBody(dpgContext, resp, inputImportedSet) ?? [undefined, []];
|
|
43
41
|
rlcOperationUnit.responses.push({
|
|
44
42
|
...rlcResponseUnit,
|
|
45
43
|
headers,
|
|
46
|
-
body
|
|
44
|
+
body,
|
|
47
45
|
});
|
|
48
46
|
if (statusCode === "default") {
|
|
49
47
|
defaultSchemas.push(...schemas);
|
|
@@ -66,7 +64,6 @@ export function transformToResponseTypes(client, dpgContext, importDetails) {
|
|
|
66
64
|
* @returns rlc header schema
|
|
67
65
|
*/
|
|
68
66
|
function transformHeaders(dpgContext, response, importedModels) {
|
|
69
|
-
var _a, _b, _c, _d;
|
|
70
67
|
if (!response.responses.length) {
|
|
71
68
|
return;
|
|
72
69
|
}
|
|
@@ -76,9 +73,9 @@ function transformHeaders(dpgContext, response, importedModels) {
|
|
|
76
73
|
// It may be possible in principle to not error for identically declared
|
|
77
74
|
// headers.
|
|
78
75
|
for (const data of response.responses) {
|
|
79
|
-
const headers =
|
|
80
|
-
if (
|
|
81
|
-
headers["content-type"] =
|
|
76
|
+
const headers = data?.headers ?? {};
|
|
77
|
+
if (data.body?.contentTypeProperty) {
|
|
78
|
+
headers["content-type"] = data.body?.contentTypeProperty;
|
|
82
79
|
}
|
|
83
80
|
if (!headers || !Object.keys(headers).length) {
|
|
84
81
|
continue;
|
|
@@ -89,15 +86,15 @@ function transformHeaders(dpgContext, response, importedModels) {
|
|
|
89
86
|
}
|
|
90
87
|
const typeSchema = getSchemaForType(dpgContext, value.type, {
|
|
91
88
|
usage: [SchemaContext.Output],
|
|
92
|
-
relevantProperty: value
|
|
89
|
+
relevantProperty: value,
|
|
93
90
|
});
|
|
94
91
|
const type = getTypeName(typeSchema, [SchemaContext.Output]);
|
|
95
|
-
|
|
92
|
+
getImportedModelName(typeSchema, [SchemaContext.Output])?.forEach(importedModels.add, importedModels);
|
|
96
93
|
const header = {
|
|
97
94
|
name: `"${key.toLowerCase()}"`,
|
|
98
95
|
type,
|
|
99
|
-
required: !
|
|
100
|
-
description: getDoc(dpgContext.program, value)
|
|
96
|
+
required: !value?.optional,
|
|
97
|
+
description: getDoc(dpgContext.program, value),
|
|
101
98
|
};
|
|
102
99
|
rlcHeaders.set(header.name, header);
|
|
103
100
|
}
|
|
@@ -105,7 +102,6 @@ function transformHeaders(dpgContext, response, importedModels) {
|
|
|
105
102
|
return rlcHeaders.size ? Array.from(rlcHeaders.values()) : undefined;
|
|
106
103
|
}
|
|
107
104
|
function transformBody(dpgContext, response, importedModels) {
|
|
108
|
-
var _a;
|
|
109
105
|
if (!response.responses.length) {
|
|
110
106
|
return;
|
|
111
107
|
}
|
|
@@ -116,7 +112,7 @@ function transformBody(dpgContext, response, importedModels) {
|
|
|
116
112
|
let fromCore = false;
|
|
117
113
|
const schemas = [];
|
|
118
114
|
for (const data of response.responses) {
|
|
119
|
-
const body = data
|
|
115
|
+
const body = data?.body;
|
|
120
116
|
if (!body || isVoidType(body.type)) {
|
|
121
117
|
continue;
|
|
122
118
|
}
|
|
@@ -127,9 +123,9 @@ function transformBody(dpgContext, response, importedModels) {
|
|
|
127
123
|
continue;
|
|
128
124
|
}
|
|
129
125
|
const bodySchema = getSchemaForType(dpgContext, body.type, {
|
|
130
|
-
usage: [SchemaContext.Output]
|
|
126
|
+
usage: [SchemaContext.Output],
|
|
131
127
|
});
|
|
132
|
-
fromCore =
|
|
128
|
+
fromCore = bodySchema.fromCore ?? false;
|
|
133
129
|
const bodyType = getTypeName(bodySchema);
|
|
134
130
|
const importedNames = getImportedModelName(bodySchema);
|
|
135
131
|
if (importedNames && !fromCore) {
|
|
@@ -150,9 +146,9 @@ function transformBody(dpgContext, response, importedModels) {
|
|
|
150
146
|
name: "body",
|
|
151
147
|
type: [...typeSet].join("|"),
|
|
152
148
|
description: [...descriptions].join("\n\n"),
|
|
153
|
-
fromCore
|
|
149
|
+
fromCore,
|
|
154
150
|
},
|
|
155
|
-
schemas
|
|
151
|
+
schemas,
|
|
156
152
|
];
|
|
157
153
|
}
|
|
158
154
|
function transformLroLogicalResponse(dpgContext, route, operationGroupName, existingResponses) {
|
|
@@ -168,7 +164,7 @@ function transformLroLogicalResponse(dpgContext, route, operationGroupName, exis
|
|
|
168
164
|
statusCode: "200",
|
|
169
165
|
description: `The final response for long-running ${route.operation.name} operation`,
|
|
170
166
|
predefinedName: getLroLogicalResponseName(operationGroupName, getOperationName(dpgContext, route.operation)),
|
|
171
|
-
body: successResp
|
|
167
|
+
body: successResp?.body,
|
|
172
168
|
};
|
|
173
169
|
return logicalLROResponse;
|
|
174
170
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformResponses.js","sourceRoot":"","sources":["../../../src/transform/transformResponses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,
|
|
1
|
+
{"version":3,"file":"transformResponses.js","sourceRoot":"","sources":["../../../src/transform/transformResponses.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC,OAAO,EAAE,yBAAyB,EAAa,MAAM,6CAA6C,CAAC;AACnG,OAAO,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAExD,OAAO,EACL,yBAAyB,EAMzB,aAAa,GACd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,4BAA4B,EAAE,MAAM,yBAAyB,CAAC;AAEvE,OAAO,EACL,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,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EAAE,CAAC,CAAC,EAAE,CAAC,UAAU,GAAG,EAAE,CAAC,UAAU,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9D,MAAM,WAAW,GAAG,eAAe,CAAC,CAAC,CAAC,CAAC;IACvC,MAAM,kBAAkB,GAAqB;QAC3C,UAAU,EAAE,KAAK;QACjB,WAAW,EAAE,uCAAuC,KAAK,CAAC,SAAS,CAAC,IAAI,YAAY;QACpF,cAAc,EAAE,yBAAyB,CACvC,kBAAkB,EAClB,gBAAgB,CAAC,UAAU,EAAE,KAAK,CAAC,SAAS,CAAC,CAC9C;QACD,IAAI,EAAE,WAAW,EAAE,IAAI;KACxB,CAAC;IACF,OAAO,kBAAkB,CAAC;AAC5B,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transformSchemas.d.ts","sourceRoot":"","sources":["../../../src/transform/transformSchemas.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"transformSchemas.d.ts","sourceRoot":"","sources":["../../../src/transform/transformSchemas.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,SAAS,EAA6B,MAAM,6CAA6C,CAAC;AAgBnG,OAAO,EAAE,UAAU,EAAE,MAAM,wBAAwB,CAAC;AAEpD,wBAAgB,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,UAAU,EAAE,UAAU,SA8LzE"}
|