@microsoft/teamsfx-core 3.0.15-beta.2026072312.0 → 3.0.15
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/build/client/aadAppClient.d.ts.map +1 -1
- package/build/client/aadAppClient.js +6 -6
- package/build/client/aadAppClient.js.map +1 -1
- package/build/common/featureFlags.d.ts +5 -0
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +5 -0
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/secretmasker/dict.d.ts.map +1 -1
- package/build/common/secretmasker/dict.js +2 -5
- package/build/common/secretmasker/dict.js.map +1 -1
- package/build/common/secretmasker/feature.js.map +1 -1
- package/build/common/templates-config.json +4 -4
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/deps-checker/internal/dotnetChecker.js.map +1 -1
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.d.ts +0 -3
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js +3 -38
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js.map +1 -1
- package/build/component/driver/script/scriptDriver.js +1 -1
- package/build/component/driver/script/scriptDriver.js.map +1 -1
- package/build/component/driver/teamsApp/create.d.ts.map +1 -1
- package/build/component/driver/teamsApp/create.js +3 -3
- package/build/component/driver/teamsApp/create.js.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts +0 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js +0 -23
- package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.js.map +1 -1
- package/build/component/generator/declarativeAgent/helper.js.map +1 -1
- package/build/component/generator/officeAddin/generator.d.ts +0 -1
- package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeAddin/generator.js +2 -109
- package/build/component/generator/officeAddin/generator.js.map +1 -1
- package/build/component/generator/openApiSpec/helper.d.ts +3 -2
- package/build/component/generator/openApiSpec/helper.d.ts.map +1 -1
- package/build/component/generator/openApiSpec/helper.js +56 -6
- package/build/component/generator/openApiSpec/helper.js.map +1 -1
- package/build/component/generator/templateHelper.d.ts +2 -10
- package/build/component/generator/templateHelper.d.ts.map +1 -1
- package/build/component/generator/templateHelper.js +3 -16
- package/build/component/generator/templateHelper.js.map +1 -1
- package/build/component/generator/templates/templateNames.d.ts +0 -2
- package/build/component/generator/templates/templateNames.d.ts.map +1 -1
- package/build/component/generator/templates/templateNames.js +0 -2
- package/build/component/generator/templates/templateNames.js.map +1 -1
- package/build/component/generator/utils.d.ts.map +1 -1
- package/build/component/generator/utils.js +0 -6
- package/build/component/generator/utils.js.map +1 -1
- package/build/component/generator/v4TemplateBridge.d.ts +1 -4
- package/build/component/generator/v4TemplateBridge.d.ts.map +1 -1
- package/build/component/generator/v4TemplateBridge.js +3 -11
- package/build/component/generator/v4TemplateBridge.js.map +1 -1
- package/build/component/utils/envUtil.d.ts.map +1 -1
- package/build/component/utils/envUtil.js +2 -2
- package/build/component/utils/envUtil.js.map +1 -1
- package/build/component/utils/fileOperation.d.ts.map +1 -1
- package/build/component/utils/fileOperation.js +1 -4
- package/build/component/utils/fileOperation.js.map +1 -1
- package/build/component/utils/mcpAuthScaffolder.d.ts.map +1 -1
- package/build/component/utils/mcpAuthScaffolder.js.map +1 -1
- package/build/component/utils/mcpToolFetcher.d.ts +72 -1
- package/build/component/utils/mcpToolFetcher.d.ts.map +1 -1
- package/build/component/utils/mcpToolFetcher.js +227 -1
- package/build/component/utils/mcpToolFetcher.js.map +1 -1
- package/build/component/utils/odrProvider.d.ts +55 -1
- package/build/component/utils/odrProvider.d.ts.map +1 -1
- package/build/component/utils/odrProvider.js +101 -1
- package/build/component/utils/odrProvider.js.map +1 -1
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.declarativeAgent.d.ts.map +1 -1
- package/build/core/FxCore.declarativeAgent.js +0 -41
- package/build/core/FxCore.declarativeAgent.js.map +1 -1
- package/build/core/FxCore.js +5 -3
- package/build/core/FxCore.js.map +1 -1
- package/build/core/createFrontDoorAdapters.d.ts +25 -1
- package/build/core/createFrontDoorAdapters.d.ts.map +1 -1
- package/build/core/createFrontDoorAdapters.js +155 -4
- package/build/core/createFrontDoorAdapters.js.map +1 -1
- package/build/core/createProjectFrontDoor.d.ts +12 -10
- package/build/core/createProjectFrontDoor.d.ts.map +1 -1
- package/build/core/createProjectFrontDoor.js +106 -141
- package/build/core/createProjectFrontDoor.js.map +1 -1
- package/build/core/modifyProjectFrontDoor.d.ts +1 -0
- package/build/core/modifyProjectFrontDoor.d.ts.map +1 -1
- package/build/core/modifyProjectFrontDoor.js +2 -0
- package/build/core/modifyProjectFrontDoor.js.map +1 -1
- package/build/index.d.ts.map +1 -1
- package/build/index.js +0 -2
- package/build/index.js.map +1 -1
- package/build/question/inputs/AddKnowledgeInputs.d.ts.map +1 -1
- package/build/question/inputs/CreateProjectInputs.d.ts +0 -4
- package/build/question/inputs/CreateProjectInputs.d.ts.map +1 -1
- package/build/question/options/CreateProjectOptions.d.ts.map +1 -1
- package/build/question/options/CreateProjectOptions.js +0 -14
- package/build/question/options/CreateProjectOptions.js.map +1 -1
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +1 -2
- package/build/question/other.js.map +1 -1
- package/build/question/questionNames.d.ts +0 -2
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +0 -2
- package/build/question/questionNames.js.map +1 -1
- package/build/question/scaffold/constructNode.d.ts +1 -3
- package/build/question/scaffold/constructNode.d.ts.map +1 -1
- package/build/question/scaffold/constructNode.js +0 -50
- package/build/question/scaffold/constructNode.js.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.d.ts +0 -2
- package/build/question/scaffold/vsc/CapabilityOptions.d.ts.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.js +0 -16
- package/build/question/scaffold/vsc/CapabilityOptions.js.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js +7 -0
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js.map +1 -1
- package/build/v4/buildTarget/parseSelector.d.ts +2 -6
- package/build/v4/buildTarget/parseSelector.d.ts.map +1 -1
- package/build/v4/buildTarget/parseSelector.js +45 -58
- package/build/v4/buildTarget/parseSelector.js.map +1 -1
- package/build/v4/buildTarget/resolveBuildTarget.d.ts +7 -21
- package/build/v4/buildTarget/resolveBuildTarget.d.ts.map +1 -1
- package/build/v4/buildTarget/resolveBuildTarget.js +52 -97
- package/build/v4/buildTarget/resolveBuildTarget.js.map +1 -1
- package/build/v4/collectInputs/collectInputs.d.ts +9 -50
- package/build/v4/collectInputs/collectInputs.d.ts.map +1 -1
- package/build/v4/collectInputs/collectInputs.js +91 -274
- package/build/v4/collectInputs/collectInputs.js.map +1 -1
- package/build/v4/distribution/createQuestions.d.ts.map +1 -1
- package/build/v4/distribution/createQuestions.js +29 -2
- package/build/v4/distribution/createQuestions.js.map +1 -1
- package/build/v4/distribution/declarativePackage.d.ts.map +1 -1
- package/build/v4/distribution/declarativePackage.js +30 -2
- package/build/v4/distribution/declarativePackage.js.map +1 -1
- package/build/v4/expression/evaluateExpression.d.ts +0 -13
- package/build/v4/expression/evaluateExpression.d.ts.map +1 -1
- package/build/v4/expression/evaluateExpression.js +0 -57
- package/build/v4/expression/evaluateExpression.js.map +1 -1
- package/build/v4/index.d.ts +0 -7
- package/build/v4/index.d.ts.map +1 -1
- package/build/v4/index.js +0 -7
- package/build/v4/index.js.map +1 -1
- package/build/v4/model/dataModel.d.ts +1 -1
- package/build/v4/model/dataModel.d.ts.map +1 -1
- package/build/v4/pipeline/runScaffoldPipeline.d.ts +4 -20
- package/build/v4/pipeline/runScaffoldPipeline.d.ts.map +1 -1
- package/build/v4/pipeline/runScaffoldPipeline.js +9 -61
- package/build/v4/pipeline/runScaffoldPipeline.js.map +1 -1
- package/build/v4/renderContext/buildRenderContext.d.ts.map +1 -1
- package/build/v4/renderContext/buildRenderContext.js +2 -1
- package/build/v4/renderContext/buildRenderContext.js.map +1 -1
- package/build/v4/runtime/inMemoryRuntime.d.ts +1 -4
- package/build/v4/runtime/inMemoryRuntime.d.ts.map +1 -1
- package/build/v4/runtime/inMemoryRuntime.js +3 -22
- package/build/v4/runtime/inMemoryRuntime.js.map +1 -1
- package/build/v4/runtime/packageParse.d.ts.map +1 -1
- package/build/v4/runtime/packageParse.js +8 -64
- package/build/v4/runtime/packageParse.js.map +1 -1
- package/build/v4/runtime/realRuntime.d.ts +1 -2
- package/build/v4/runtime/realRuntime.d.ts.map +1 -1
- package/build/v4/runtime/realRuntime.js +2 -3
- package/build/v4/runtime/realRuntime.js.map +1 -1
- package/build/v4/runtime/renderMustache.d.ts.map +1 -1
- package/build/v4/runtime/renderMustache.js +4 -13
- package/build/v4/runtime/renderMustache.js.map +1 -1
- package/build/v4/runtime/runtimeRegistry.d.ts +3 -12
- package/build/v4/runtime/runtimeRegistry.d.ts.map +1 -1
- package/build/v4/runtime/runtimeRegistry.js +17 -123
- package/build/v4/runtime/runtimeRegistry.js.map +1 -1
- package/build/v4/runtime/scaffold.d.ts +0 -1
- package/build/v4/runtime/scaffold.d.ts.map +1 -1
- package/build/v4/runtime/scaffold.js +20 -1
- package/build/v4/runtime/scaffold.js.map +1 -1
- package/build/v4/runtime/steps/daAction.d.ts.map +1 -1
- package/build/v4/runtime/steps/daAction.js +111 -3
- package/build/v4/runtime/steps/daAction.js.map +1 -1
- package/build/v4/runtime/steps/mcpAuth.d.ts +2 -5
- package/build/v4/runtime/steps/mcpAuth.d.ts.map +1 -1
- package/build/v4/runtime/steps/mcpAuth.js +66 -37
- package/build/v4/runtime/steps/mcpAuth.js.map +1 -1
- package/build/v4/runtime/steps/mcpLocal.d.ts +4 -0
- package/build/v4/runtime/steps/mcpLocal.d.ts.map +1 -1
- package/build/v4/runtime/steps/mcpLocal.js +31 -11
- package/build/v4/runtime/steps/mcpLocal.js.map +1 -1
- package/build/v4/runtime/steps/mcpStatic.d.ts +1 -1
- package/build/v4/runtime/steps/mcpStatic.d.ts.map +1 -1
- package/build/v4/runtime/steps/mcpStatic.js +32 -14
- package/build/v4/runtime/steps/mcpStatic.js.map +1 -1
- package/build/v4/runtime/steps/metaOs.d.ts.map +1 -1
- package/build/v4/runtime/steps/metaOs.js +51 -39
- package/build/v4/runtime/steps/metaOs.js.map +1 -1
- package/build/v4/runtime/steps/officeAddin.d.ts.map +1 -1
- package/build/v4/runtime/steps/officeAddin.js +12 -7
- package/build/v4/runtime/steps/officeAddin.js.map +1 -1
- package/build/v4/runtime/steps/openApi.d.ts.map +1 -1
- package/build/v4/runtime/steps/openApi.js +555 -47
- package/build/v4/runtime/steps/openApi.js.map +1 -1
- package/build/v4/surface/createInputs.d.ts +3 -25
- package/build/v4/surface/createInputs.d.ts.map +1 -1
- package/build/v4/surface/createInputs.js +431 -54
- package/build/v4/surface/createInputs.js.map +1 -1
- package/build/v4/surface/createSelectorWalk.d.ts +3 -8
- package/build/v4/surface/createSelectorWalk.d.ts.map +1 -1
- package/build/v4/surface/createSelectorWalk.js +11 -21
- package/build/v4/surface/createSelectorWalk.js.map +1 -1
- package/build/v4/surface/modifySelectorWalk.d.ts.map +1 -1
- package/build/v4/surface/modifySelectorWalk.js +3 -0
- package/build/v4/surface/modifySelectorWalk.js.map +1 -1
- package/build/v4/surface/uiPromptUI.d.ts.map +1 -1
- package/build/v4/surface/uiPromptUI.js +41 -36
- package/build/v4/surface/uiPromptUI.js.map +1 -1
- package/build/v4/validation/validateTemplatePackage.d.ts +2 -21
- package/build/v4/validation/validateTemplatePackage.d.ts.map +1 -1
- package/build/v4/validation/validateTemplatePackage.js +31 -155
- package/build/v4/validation/validateTemplatePackage.js.map +1 -1
- package/package.json +20 -26
- package/resource/package.nls.cs.json +0 -1
- package/resource/package.nls.de.json +54 -55
- package/resource/package.nls.es.json +0 -1
- package/resource/package.nls.fr.json +0 -1
- package/resource/package.nls.it.json +0 -1
- package/resource/package.nls.ja.json +0 -1
- package/resource/package.nls.json +0 -2
- package/resource/package.nls.ko.json +0 -1
- package/resource/package.nls.pl.json +0 -1
- package/resource/package.nls.pt-BR.json +0 -1
- package/resource/package.nls.ru.json +0 -1
- package/resource/package.nls.tr.json +0 -1
- package/resource/package.nls.zh-Hans.json +0 -1
- package/resource/package.nls.zh-Hant.json +0 -1
- package/resource/templates/package.nls.cs.json +2 -9
- package/resource/templates/package.nls.de.json +2 -9
- package/resource/templates/package.nls.es.json +2 -9
- package/resource/templates/package.nls.fr.json +2 -9
- package/resource/templates/package.nls.it.json +2 -9
- package/resource/templates/package.nls.ja.json +2 -9
- package/resource/templates/package.nls.json +3 -16
- package/resource/templates/package.nls.ko.json +2 -9
- package/resource/templates/package.nls.pl.json +2 -9
- package/resource/templates/package.nls.pt-BR.json +2 -9
- package/resource/templates/package.nls.ru.json +2 -9
- package/resource/templates/package.nls.tr.json +2 -9
- package/resource/templates/package.nls.zh-Hans.json +2 -9
- package/resource/templates/package.nls.zh-Hant.json +2 -9
- package/resource/templates/package.nls.zh-cn.json +1 -7
- package/resource/templates/package.nls.zh-tw.json +1 -7
- package/templates/configs/local/typescript/.gitignore +1 -0
- package/templates/configs/playground/typescript/.gitignore +4 -0
- package/templates/fallback/common.zip +0 -0
- package/templates/fallback/csharp.zip +0 -0
- package/templates/fallback/js.zip +0 -0
- package/templates/fallback/python.zip +0 -0
- package/templates/fallback/ts.zip +0 -0
- package/templates/metadata/allTemplates.json +2 -16
- package/templates/metadata.zip +0 -0
- package/templates/ui/wizardNode.json +0 -24
- package/templates/v4/create-selector.json +5 -12
- package/templates/v4/floor.json +1 -1
- package/templates/v4/modify-selector.json +6 -1
- package/templates/v4/templates-metadata.zip +0 -0
- package/templates/v4/templates.zip +0 -0
- package/build/common/httpProxy.d.ts +0 -21
- package/build/common/httpProxy.d.ts.map +0 -1
- package/build/common/httpProxy.js +0 -117
- package/build/common/httpProxy.js.map +0 -1
- package/build/common/mcpToolFetcher.d.ts +0 -31
- package/build/common/mcpToolFetcher.d.ts.map +0 -1
- package/build/common/mcpToolFetcher.js +0 -182
- package/build/common/mcpToolFetcher.js.map +0 -1
- package/build/common/odrProvider.d.ts +0 -43
- package/build/common/odrProvider.d.ts.map +0 -1
- package/build/common/odrProvider.js +0 -154
- package/build/common/odrProvider.js.map +0 -1
- package/build/common/openApiParserOptions.d.ts +0 -3
- package/build/common/openApiParserOptions.d.ts.map +0 -1
- package/build/common/openApiParserOptions.js +0 -61
- package/build/common/openApiParserOptions.js.map +0 -1
- package/build/v4/distribution/questionFragments.d.ts +0 -11
- package/build/v4/distribution/questionFragments.d.ts.map +0 -1
- package/build/v4/distribution/questionFragments.js +0 -130
- package/build/v4/distribution/questionFragments.js.map +0 -1
- package/build/v4/engineVersion.d.ts +0 -7
- package/build/v4/engineVersion.d.ts.map +0 -1
- package/build/v4/engineVersion.js +0 -12
- package/build/v4/engineVersion.js.map +0 -1
- package/build/v4/inspection/scaffoldCatalog.d.ts +0 -28
- package/build/v4/inspection/scaffoldCatalog.d.ts.map +0 -1
- package/build/v4/inspection/scaffoldCatalog.js +0 -66
- package/build/v4/inspection/scaffoldCatalog.js.map +0 -1
- package/build/v4/inspection/scaffoldMetadataSource.d.ts +0 -6
- package/build/v4/inspection/scaffoldMetadataSource.d.ts.map +0 -1
- package/build/v4/inspection/scaffoldMetadataSource.js +0 -78
- package/build/v4/inspection/scaffoldMetadataSource.js.map +0 -1
- package/build/v4/mcp/mcpAuthAction.d.ts +0 -28
- package/build/v4/mcp/mcpAuthAction.d.ts.map +0 -1
- package/build/v4/mcp/mcpAuthAction.js +0 -162
- package/build/v4/mcp/mcpAuthAction.js.map +0 -1
- package/build/v4/mcp/mcpAuthScaffold.d.ts +0 -37
- package/build/v4/mcp/mcpAuthScaffold.d.ts.map +0 -1
- package/build/v4/mcp/mcpAuthScaffold.js +0 -140
- package/build/v4/mcp/mcpAuthScaffold.js.map +0 -1
- package/build/v4/providers/createOptionsProviders.d.ts +0 -11
- package/build/v4/providers/createOptionsProviders.d.ts.map +0 -1
- package/build/v4/providers/createOptionsProviders.js +0 -268
- package/build/v4/providers/createOptionsProviders.js.map +0 -1
- package/build/v4/runtime/generalSensitivityLabel.d.ts +0 -5
- package/build/v4/runtime/generalSensitivityLabel.d.ts.map +0 -1
- package/build/v4/runtime/generalSensitivityLabel.js +0 -36
- package/build/v4/runtime/generalSensitivityLabel.js.map +0 -1
- package/build/v4/runtime/steps/daSensitivity.d.ts +0 -14
- package/build/v4/runtime/steps/daSensitivity.d.ts.map +0 -1
- package/build/v4/runtime/steps/daSensitivity.js +0 -50
- package/build/v4/runtime/steps/daSensitivity.js.map +0 -1
- package/build/v4/runtime/steps/openApiCustomApi.d.ts +0 -5
- package/build/v4/runtime/steps/openApiCustomApi.d.ts.map +0 -1
- package/build/v4/runtime/steps/openApiCustomApi.js +0 -385
- package/build/v4/runtime/steps/openApiCustomApi.js.map +0 -1
- package/build/v4/runtime/withTempDirectory.d.ts +0 -10
- package/build/v4/runtime/withTempDirectory.d.ts.map +0 -1
- package/build/v4/runtime/withTempDirectory.js +0 -41
- package/build/v4/runtime/withTempDirectory.js.map +0 -1
- package/build/v4/surface/createFloorTail.d.ts +0 -12
- package/build/v4/surface/createFloorTail.d.ts.map +0 -1
- package/build/v4/surface/createFloorTail.js +0 -138
- package/build/v4/surface/createFloorTail.js.map +0 -1
- package/build/v4/surface/localizePrompt.d.ts +0 -11
- package/build/v4/surface/localizePrompt.d.ts.map +0 -1
- package/build/v4/surface/localizePrompt.js +0 -32
- package/build/v4/surface/localizePrompt.js.map +0 -1
- package/build/v4/validation/capabilityCatalog.d.ts +0 -8
- package/build/v4/validation/capabilityCatalog.d.ts.map +0 -1
- package/build/v4/validation/capabilityCatalog.js +0 -61
- package/build/v4/validation/capabilityCatalog.js.map +0 -1
- package/build/v4/validation/templateArchiveValidation.d.ts +0 -15
- package/build/v4/validation/templateArchiveValidation.d.ts.map +0 -1
- package/build/v4/validation/templateArchiveValidation.js +0 -297
- package/build/v4/validation/templateArchiveValidation.js.map +0 -1
- package/build/v4/validators/createInputValidators.d.ts +0 -7
- package/build/v4/validators/createInputValidators.d.ts.map +0 -1
- package/build/v4/validators/createInputValidators.js +0 -75
- package/build/v4/validators/createInputValidators.js.map +0 -1
- package/build/v4/validators/mcpCredentialValidators.d.ts +0 -5
- package/build/v4/validators/mcpCredentialValidators.d.ts.map +0 -1
- package/build/v4/validators/mcpCredentialValidators.js +0 -13
- package/build/v4/validators/mcpCredentialValidators.js.map +0 -1
|
@@ -4,11 +4,9 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.BUILD_TARGET_WALK_CANCELLED = exports.BUILD_TARGET_MISSING_DIMENSION = exports.BUILD_TARGET_NO_MATCHING_ROUTE = exports.BUILD_TARGET_DANGLING_V4_ROUTE = exports.BUILD_TARGET_MALFORMED_ROUTE = exports.BUILD_TARGET_UNKNOWN_TEMPLATE = void 0;
|
|
6
6
|
exports.v4RouteRegistryFromSelector = v4RouteRegistryFromSelector;
|
|
7
|
-
exports.validateSelectorRouteShape = validateSelectorRouteShape;
|
|
8
7
|
exports.resolveBuildTarget = resolveBuildTarget;
|
|
9
8
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
10
9
|
const neverthrow_1 = require("neverthrow");
|
|
11
|
-
const collectInputs_1 = require("../collectInputs/collectInputs");
|
|
12
10
|
const evaluateExpression_1 = require("../expression/evaluateExpression");
|
|
13
11
|
/** v4 selector resolution. See resolve-build-target spec and ADR-0014. */
|
|
14
12
|
const SOURCE = "Scaffold";
|
|
@@ -59,6 +57,7 @@ function buildScope(declared, answers) {
|
|
|
59
57
|
function malformedRouteReason(r) {
|
|
60
58
|
const has = {
|
|
61
59
|
templateId: r.templateId !== undefined,
|
|
60
|
+
v3Adapter: r.v3Adapter !== undefined,
|
|
62
61
|
coreMethod: r.coreMethod !== undefined,
|
|
63
62
|
action: r.action !== undefined,
|
|
64
63
|
};
|
|
@@ -67,41 +66,42 @@ function malformedRouteReason(r) {
|
|
|
67
66
|
if (!has.templateId) {
|
|
68
67
|
return "engine 'v4' requires 'templateId'";
|
|
69
68
|
}
|
|
69
|
+
if (has.v3Adapter || has.coreMethod || has.action) {
|
|
70
|
+
return "engine 'v4' must not carry 'v3Adapter' / 'coreMethod' / 'action'";
|
|
71
|
+
}
|
|
72
|
+
return undefined;
|
|
73
|
+
case "v3":
|
|
74
|
+
if (!has.v3Adapter) {
|
|
75
|
+
return "engine 'v3' requires 'v3Adapter'";
|
|
76
|
+
}
|
|
70
77
|
if (has.coreMethod || has.action) {
|
|
71
|
-
return "engine '
|
|
78
|
+
return "engine 'v3' must not carry 'coreMethod' / 'action'";
|
|
72
79
|
}
|
|
73
80
|
return undefined;
|
|
74
81
|
case "v3-core-method":
|
|
75
82
|
if (!has.coreMethod) {
|
|
76
83
|
return "engine 'v3-core-method' requires 'coreMethod'";
|
|
77
84
|
}
|
|
78
|
-
if (has.templateId || has.action) {
|
|
79
|
-
return "engine 'v3-core-method' must not carry 'templateId' / 'action'";
|
|
85
|
+
if (has.templateId || has.v3Adapter || has.action) {
|
|
86
|
+
return "engine 'v3-core-method' must not carry 'templateId' / 'v3Adapter' / 'action'";
|
|
80
87
|
}
|
|
81
88
|
return undefined;
|
|
82
89
|
case "surface-action":
|
|
83
90
|
if (!has.action) {
|
|
84
91
|
return "engine 'surface-action' requires 'action'";
|
|
85
92
|
}
|
|
86
|
-
if (has.templateId || has.coreMethod) {
|
|
87
|
-
return "engine 'surface-action' must not carry 'templateId' / 'coreMethod'";
|
|
93
|
+
if (has.templateId || has.v3Adapter || has.coreMethod) {
|
|
94
|
+
return "engine 'surface-action' must not carry 'templateId' / 'v3Adapter' / 'coreMethod'";
|
|
88
95
|
}
|
|
89
96
|
return undefined;
|
|
90
97
|
}
|
|
91
98
|
}
|
|
92
|
-
/** Validate only a selector route's engine-specific key shape. */
|
|
93
|
-
function validateSelectorRouteShape(route) {
|
|
94
|
-
const reason = malformedRouteReason(route);
|
|
95
|
-
return reason === undefined
|
|
96
|
-
? (0, neverthrow_1.ok)(undefined)
|
|
97
|
-
: (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_MALFORMED_ROUTE, `selector route has invalid shape: ${reason}`));
|
|
98
|
-
}
|
|
99
99
|
/** Validate the routing table before matching any route. */
|
|
100
100
|
function validateRoutes(routes, port) {
|
|
101
101
|
for (const r of routes) {
|
|
102
|
-
const
|
|
103
|
-
if (
|
|
104
|
-
return (0, neverthrow_1.err)(
|
|
102
|
+
const reason = malformedRouteReason(r);
|
|
103
|
+
if (reason !== undefined) {
|
|
104
|
+
return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_MALFORMED_ROUTE, `route '${r.when}': ${reason}`));
|
|
105
105
|
}
|
|
106
106
|
if (r.engine === "v4" && r.templateId !== undefined && !port.v4Registry(r.templateId)) {
|
|
107
107
|
return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_DANGLING_V4_ROUTE, `route '${r.when}' targets v4 templateId '${r.templateId}', but no descriptor for it is present`));
|
|
@@ -109,93 +109,47 @@ function validateRoutes(routes, port) {
|
|
|
109
109
|
}
|
|
110
110
|
return (0, neverthrow_1.ok)(undefined);
|
|
111
111
|
}
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
properties[question.name] = {};
|
|
123
|
-
}
|
|
124
|
-
return { properties };
|
|
125
|
-
}
|
|
126
|
-
function q1PromptUi(interactive, port) {
|
|
127
|
-
return {
|
|
128
|
-
async ask(question, _options, step = 1) {
|
|
129
|
-
if (!interactive) {
|
|
130
|
-
return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_MISSING_DIMENSION, `required dimension '${question.name}' was not provided (non-interactive)`));
|
|
131
|
-
}
|
|
132
|
-
const outcome = await port.prompt({ name: question.name, condition: question.condition }, step);
|
|
133
|
-
if (outcome.kind === "back" && step <= 1) {
|
|
134
|
-
return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_WALK_CANCELLED, "the create selector was cancelled"));
|
|
135
|
-
}
|
|
136
|
-
return (0, neverthrow_1.ok)(outcome);
|
|
137
|
-
},
|
|
138
|
-
askMulti() {
|
|
139
|
-
return Promise.resolve((0, neverthrow_1.err)(new teamsfx_api_1.SystemError({
|
|
140
|
-
source: SOURCE,
|
|
141
|
-
name: "BuildTargetMultiSelectUnsupported",
|
|
142
|
-
message: "selector dimensions do not support multi-select questions",
|
|
143
|
-
})));
|
|
144
|
-
},
|
|
145
|
-
};
|
|
146
|
-
}
|
|
147
|
-
function buildCollectPort(interactive, port) {
|
|
148
|
-
return {
|
|
149
|
-
ui: q1PromptUi(interactive, port),
|
|
150
|
-
optionsProvider: () => undefined,
|
|
151
|
-
validator: () => undefined,
|
|
152
|
-
evaluate: (node, scope) => (0, evaluateExpression_1.evaluateExpression)(node, scope, exprPort(port)),
|
|
153
|
-
};
|
|
154
|
-
}
|
|
155
|
-
function scalarAnswers(selector, answers, port) {
|
|
156
|
-
const normalized = {};
|
|
157
|
-
const declared = selector.questions.map((question) => question.name);
|
|
158
|
-
for (const question of selector.questions) {
|
|
159
|
-
if (question.condition !== undefined) {
|
|
160
|
-
const gate = (0, evaluateExpression_1.evaluateExpression)(question.condition, buildScope(declared, normalized), exprPort(port));
|
|
112
|
+
/** Walk Q1 with prefill support and back history for prompted dimensions. */
|
|
113
|
+
async function walkWithPrefill(selector, prefilled, interactive, port) {
|
|
114
|
+
const declared = selector.questions.map((q) => q.name);
|
|
115
|
+
let answers = {};
|
|
116
|
+
const history = [];
|
|
117
|
+
let index = 0;
|
|
118
|
+
while (index < selector.questions.length) {
|
|
119
|
+
const q = selector.questions[index];
|
|
120
|
+
if (q.condition !== undefined) {
|
|
121
|
+
const gate = (0, evaluateExpression_1.evaluateExpression)(q.condition, buildScope(declared, answers), exprPort(port));
|
|
161
122
|
if (gate.isErr()) {
|
|
162
123
|
return (0, neverthrow_1.err)(gate.error);
|
|
163
124
|
}
|
|
164
125
|
if (gate.value !== true) {
|
|
126
|
+
index++;
|
|
165
127
|
continue;
|
|
166
128
|
}
|
|
167
129
|
}
|
|
168
|
-
|
|
169
|
-
|
|
130
|
+
if (prefilled[q.name] !== undefined) {
|
|
131
|
+
answers[q.name] = prefilled[q.name];
|
|
132
|
+
index++;
|
|
170
133
|
continue;
|
|
171
134
|
}
|
|
172
|
-
if (
|
|
173
|
-
return (0, neverthrow_1.err)(
|
|
174
|
-
source: SOURCE,
|
|
175
|
-
name: "BuildTargetNonScalarAnswer",
|
|
176
|
-
message: `selector dimension '${question.name}' resolved to a non-scalar answer`,
|
|
177
|
-
}));
|
|
135
|
+
if (!interactive) {
|
|
136
|
+
return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_MISSING_DIMENSION, `required dimension '${q.name}' was not provided (non-interactive)`));
|
|
178
137
|
}
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
138
|
+
const outcome = await port.prompt(q, history.length + 1);
|
|
139
|
+
if (outcome.kind === "back") {
|
|
140
|
+
const restore = history.pop();
|
|
141
|
+
if (restore === undefined) {
|
|
142
|
+
return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_WALK_CANCELLED, "the create selector was cancelled"));
|
|
143
|
+
}
|
|
144
|
+
answers = restore.snapshot;
|
|
145
|
+
index = restore.index;
|
|
146
|
+
continue;
|
|
147
|
+
}
|
|
148
|
+
history.push({ index, snapshot: { ...answers } });
|
|
149
|
+
answers[q.name] = outcome.value;
|
|
150
|
+
index++;
|
|
188
151
|
}
|
|
189
|
-
|
|
190
|
-
// `backable` is off for Q1, so a back past the first prompt errors in the prompt face (WCS-17)
|
|
191
|
-
// rather than returning a top-level back; the `done` branch is the live path.
|
|
192
|
-
return outcome.kind === "done"
|
|
193
|
-
? scalarAnswers(selector, outcome.answers, port).map((answers) => ({
|
|
194
|
-
answers,
|
|
195
|
-
history: outcome.history,
|
|
196
|
-
promptCount: outcome.promptCount,
|
|
197
|
-
}))
|
|
198
|
-
: (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_WALK_CANCELLED, "the create selector was cancelled"));
|
|
152
|
+
return (0, neverthrow_1.ok)(answers);
|
|
199
153
|
}
|
|
200
154
|
/** Match the first route whose `when` predicate is true against the collected answers. */
|
|
201
155
|
function matchRoute(selector, answers, port) {
|
|
@@ -215,6 +169,7 @@ function matchRoute(selector, answers, port) {
|
|
|
215
169
|
function dispatchRoute(r, port) {
|
|
216
170
|
switch (r.engine) {
|
|
217
171
|
case "v4":
|
|
172
|
+
case "v3":
|
|
218
173
|
if (r.templateId === undefined) {
|
|
219
174
|
return (0, neverthrow_1.err)(userError(exports.BUILD_TARGET_MALFORMED_ROUTE, `route '${r.when}': missing 'templateId'`));
|
|
220
175
|
}
|
|
@@ -235,18 +190,18 @@ function dispatchRoute(r, port) {
|
|
|
235
190
|
}
|
|
236
191
|
}
|
|
237
192
|
/** Resolve a create/modify selector walk into a dispatched `BuildTarget`. */
|
|
238
|
-
async function resolveBuildTarget(selector, prefilled, interactive, port
|
|
193
|
+
async function resolveBuildTarget(selector, prefilled, interactive, port) {
|
|
239
194
|
// Validate the whole routing table before any route match.
|
|
240
195
|
const routesOk = validateRoutes(selector.routes, port);
|
|
241
196
|
if (routesOk.isErr()) {
|
|
242
197
|
return (0, neverthrow_1.err)(routesOk.error);
|
|
243
198
|
}
|
|
244
199
|
// One prefill-aware walk covers interactive and non-interactive resolution.
|
|
245
|
-
const walked = await
|
|
200
|
+
const walked = await walkWithPrefill(selector, prefilled, interactive, port);
|
|
246
201
|
if (walked.isErr()) {
|
|
247
202
|
return (0, neverthrow_1.err)(walked.error);
|
|
248
203
|
}
|
|
249
|
-
const
|
|
204
|
+
const answers = walked.value;
|
|
250
205
|
const matched = matchRoute(selector, answers, port);
|
|
251
206
|
if (matched.isErr()) {
|
|
252
207
|
return (0, neverthrow_1.err)(matched.error);
|
|
@@ -255,6 +210,6 @@ async function resolveBuildTarget(selector, prefilled, interactive, port, option
|
|
|
255
210
|
if (dispatched.isErr()) {
|
|
256
211
|
return (0, neverthrow_1.err)(dispatched.error);
|
|
257
212
|
}
|
|
258
|
-
return (0, neverthrow_1.ok)({ ...dispatched.value, answers
|
|
213
|
+
return (0, neverthrow_1.ok)({ ...dispatched.value, answers });
|
|
259
214
|
}
|
|
260
215
|
//# sourceMappingURL=resolveBuildTarget.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"resolveBuildTarget.js","sourceRoot":"","sources":["../../../src/v4/buildTarget/resolveBuildTarget.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;
|
|
1
|
+
{"version":3,"file":"resolveBuildTarget.js","sourceRoot":"","sources":["../../../src/v4/buildTarget/resolveBuildTarget.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA2ClC,kEAQC;AAuPD,gDA6BC;AArUD,wDAA4D;AAC5D,2CAA6C;AAC7C,yEAM0C;AAE1C,0EAA0E;AAE1E,MAAM,MAAM,GAAG,UAAU,CAAC;AA4B1B,oEAAoE;AACpE,SAAgB,2BAA2B,CAAC,IAAkB;IAC5D,MAAM,WAAW,GAAG,IAAI,GAAG,EAAU,CAAC;IACtC,KAAK,MAAM,KAAK,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;QAChC,IAAI,KAAK,CAAC,MAAM,KAAK,IAAI,IAAI,KAAK,CAAC,UAAU,KAAK,SAAS,EAAE,CAAC;YAC5D,WAAW,CAAC,GAAG,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC;QACpC,CAAC;IACH,CAAC;IACD,O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,WAAoB,EACpB,IAAuB;IAEvB,2DAA2D;IAC3D,MAAM,QAAQ,GAAG,cAAc,CAAC,QAAQ,CAAC,MAAM,EAAE,IAAI,CAAC,CAAC;IACvD,IAAI,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;QACrB,OAAO,IAAA,gBAAG,EAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IAED,4EAA4E;IAC5E,MAAM,MAAM,GAAG,MAAM,eAAe,CAAC,QAAQ,EAAE,SAAS,EAAE,WAAW,EAAE,IAAI,CAAC,CAAC;IAC7E,IAAI,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;QACnB,OAAO,IAAA,gBAAG,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IACD,MAAM,OAAO,GAAG,MAAM,CAAC,KAAK,CAAC;IAE7B,MAAM,OAAO,GAAG,UAAU,CAAC,QAAQ,EAAE,OAAO,EAAE,IAAI,CAAC,CAAC;IACpD,IAAI,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC;QACpB,OAAO,IAAA,gBAAG,EAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC5B,CAAC;IACD,MAAM,UAAU,GAAG,aAAa,CAAC,OAAO,CAAC,KAAK,EAAE,IAAI,CAAC,CAAC;IACtD,IAAI,UAAU,CAAC,KAAK,EAAE,EAAE,CAAC;QACvB,OAAO,IAAA,gBAAG,EAAC,UAAU,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;IAED,OAAO,IAAA,eAAE,EAAC,EAAE,GAAG,UAAU,CAAC,KAAK,EAAE,OAAO,EAAE,CAAC,CAAC;AAC9C,CAAC"}
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { FxError } from "@microsoft/teamsfx-api";
|
|
2
2
|
import { Result } from "neverthrow";
|
|
3
|
-
import {
|
|
3
|
+
import { EvalValue, ExpressionNode, Scope } from "../expression/evaluateExpression";
|
|
4
4
|
import { Answers } from "../model/dataModel";
|
|
5
|
+
/** An authored visibility / value guard — the same closed form the evaluator parses. */
|
|
6
|
+
export type ConditionNode = ExpressionNode;
|
|
5
7
|
/** Identity-only option; computed values flow through provider `derived.*`. */
|
|
6
8
|
export interface OptionItem {
|
|
7
9
|
id: string;
|
|
@@ -9,7 +11,6 @@ export interface OptionItem {
|
|
|
9
11
|
description?: string;
|
|
10
12
|
detail?: string;
|
|
11
13
|
groupName?: string;
|
|
12
|
-
iconPath?: string;
|
|
13
14
|
condition?: ConditionNode;
|
|
14
15
|
keyPrefix?: string;
|
|
15
16
|
}
|
|
@@ -40,7 +41,6 @@ export interface QuestionSpec {
|
|
|
40
41
|
placeholder?: string;
|
|
41
42
|
prompt?: string;
|
|
42
43
|
default?: string;
|
|
43
|
-
password?: boolean;
|
|
44
44
|
filters?: Record<string, string[]>;
|
|
45
45
|
inputOptionItem?: OptionItem;
|
|
46
46
|
inputBoxConfig?: InputBoxConfig;
|
|
@@ -71,43 +71,13 @@ export interface OptionsProvider {
|
|
|
71
71
|
/** Engine-registered validator: an error message, or `undefined` when valid. */
|
|
72
72
|
export type Validator = (value: string, answers: Answers) => string | undefined | Promise<string | undefined>;
|
|
73
73
|
export type PromptValidation = (value: string) => string | undefined | Promise<string | undefined>;
|
|
74
|
-
/** One prompt's outcome: a chosen value
|
|
74
|
+
/** One prompt's outcome: a chosen value or the host's `back` request. */
|
|
75
75
|
export type Asked<T> = {
|
|
76
76
|
kind: "value";
|
|
77
77
|
value: T;
|
|
78
|
-
} | {
|
|
79
|
-
kind: "skip";
|
|
80
|
-
value: T;
|
|
81
|
-
} | {
|
|
82
|
-
kind: "back";
|
|
83
|
-
};
|
|
84
|
-
/** One resumable walk's history entry (opaque to cross-phase callers). */
|
|
85
|
-
export interface WalkHistoryEntry {
|
|
86
|
-
pos: number;
|
|
87
|
-
answers: Answers;
|
|
88
|
-
}
|
|
89
|
-
/** The resumable walk's outcome: a completed answer set, or a `back` handed to the caller. */
|
|
90
|
-
export type WalkOutcome = {
|
|
91
|
-
kind: "done";
|
|
92
|
-
answers: Answers;
|
|
93
|
-
history: WalkHistoryEntry[];
|
|
94
|
-
promptCount: number;
|
|
95
78
|
} | {
|
|
96
79
|
kind: "back";
|
|
97
|
-
history: WalkHistoryEntry[];
|
|
98
|
-
promptCount: number;
|
|
99
80
|
};
|
|
100
|
-
/** Options for the resumable walk (the cross-phase back primitive; see collect-inputs INV-9). */
|
|
101
|
-
export interface WalkOptions {
|
|
102
|
-
/** Added to the 1-based shown step so a later phase continues an earlier phase's numbering. */
|
|
103
|
-
baseStep?: number;
|
|
104
|
-
/** Resume a prior walk by re-entering its last prompted question via `back`. */
|
|
105
|
-
resume?: {
|
|
106
|
-
history: WalkHistoryEntry[];
|
|
107
|
-
};
|
|
108
|
-
/** When true, a `back` past the first prompt returns `{ kind: "back" }` instead of cancelling. */
|
|
109
|
-
backable?: boolean;
|
|
110
|
-
}
|
|
111
81
|
/** Surface-neutral prompt driver. */
|
|
112
82
|
export interface PromptUI {
|
|
113
83
|
/** Render one scalar question. */
|
|
@@ -122,30 +92,19 @@ export interface CollectInputsPort {
|
|
|
122
92
|
validator(name: string): Validator | undefined;
|
|
123
93
|
evaluate(node: ConditionNode, scope: Scope): Result<EvalValue, FxError>;
|
|
124
94
|
}
|
|
95
|
+
export interface CollectInputsOptions {
|
|
96
|
+
appendLanguage?: boolean;
|
|
97
|
+
}
|
|
125
98
|
/** `SystemError` names for engine-side input collection breaks. */
|
|
126
99
|
export declare const INPUT_BOTH_OPTION_SOURCES = "InputBothOptionSources";
|
|
127
100
|
export declare const INPUT_UNKNOWN_PROVIDER = "InputUnknownProvider";
|
|
128
101
|
export declare const INPUT_UNKNOWN_VALIDATOR = "InputUnknownValidator";
|
|
129
102
|
export declare const INPUT_FORWARD_DERIVED_REFERENCE = "InputForwardDerivedReference";
|
|
130
103
|
export declare const INPUT_PROVIDER_FAILED = "InputProviderFailed";
|
|
131
|
-
export declare const INPUT_PROVIDER_DERIVED_SCHEMA_VIOLATION = "InputProviderDerivedSchemaViolation";
|
|
132
104
|
/** `UserError` name for input validation failures. */
|
|
133
105
|
export declare const INPUT_VALIDATION_FAILED = "InputValidationFailed";
|
|
134
106
|
/** `UserError` name for cancelling the walk from the first prompt. */
|
|
135
107
|
export declare const INPUT_WALK_CANCELLED = "InputWalkCancelled";
|
|
136
|
-
/**
|
|
137
|
-
|
|
138
|
-
* back primitive (collect-inputs INV-9). `baseStep` offsets the shown step so a
|
|
139
|
-
* later phase continues an earlier phase's numbering; `backable` turns a `back`
|
|
140
|
-
* past the first prompt into a `{ kind: "back" }` outcome instead of cancelling;
|
|
141
|
-
* `resume` re-enters a prior walk's history at its last prompted question.
|
|
142
|
-
*/
|
|
143
|
-
export declare function walkInputs(questions: QuestionSpec[], optionsSchema: OptionsSchema, entryParams: Answers, port: CollectInputsPort, walkOptions?: WalkOptions): Promise<Result<WalkOutcome, FxError>>;
|
|
144
|
-
/**
|
|
145
|
-
* Walk one template's questions into the resolved answer object — the stable
|
|
146
|
-
* non-resumable entry over {@link walkInputs} (no step offset, no resume,
|
|
147
|
-
* `backable` off), so a `back` past the first prompt cancels (INPUT-18) and the
|
|
148
|
-
* result is the plain answer object. Preserves the pre-cross-phase contract.
|
|
149
|
-
*/
|
|
150
|
-
export declare function collectInputs(questions: QuestionSpec[], optionsSchema: OptionsSchema, entryParams: Answers, port: CollectInputsPort): Promise<Result<Answers, FxError>>;
|
|
108
|
+
/** Walk one template's questions into the resolved answer object. */
|
|
109
|
+
export declare function collectInputs(questions: QuestionSpec[], optionsSchema: OptionsSchema, entryParams: Answers, languages: string[], port: CollectInputsPort, options?: CollectInputsOptions): Promise<Result<Answers, FxError>>;
|
|
151
110
|
//# sourceMappingURL=collectInputs.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"collectInputs.d.ts","sourceRoot":"","sources":["../../../src/v4/collectInputs/collectInputs.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAA0B,MAAM,wBAAwB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