@microsoft/teamsfx-core 3.0.15 → 3.0.16-alpha.027c46bf2b.0
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 +0 -5
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +0 -5
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/httpProxy.d.ts +21 -0
- package/build/common/httpProxy.d.ts.map +1 -0
- package/build/common/httpProxy.js +117 -0
- package/build/common/httpProxy.js.map +1 -0
- package/build/common/mcpToolFetcher.d.ts +90 -0
- package/build/common/mcpToolFetcher.d.ts.map +1 -0
- package/build/common/mcpToolFetcher.js +404 -0
- package/build/common/mcpToolFetcher.js.map +1 -0
- package/build/common/odrProvider.d.ts +43 -0
- package/build/common/odrProvider.d.ts.map +1 -0
- package/build/common/odrProvider.js +154 -0
- package/build/common/odrProvider.js.map +1 -0
- package/build/common/openApiParserOptions.d.ts +3 -0
- package/build/common/openApiParserOptions.d.ts.map +1 -0
- package/build/common/openApiParserOptions.js +61 -0
- package/build/common/openApiParserOptions.js.map +1 -0
- package/build/common/secretmasker/dict.d.ts.map +1 -1
- package/build/common/secretmasker/dict.js +5 -2
- 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 +3 -0
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/impl/AzureZipDeployImpl.js +38 -3
- 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 +1 -0
- package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js +23 -0
- 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.d.ts.map +1 -1
- package/build/component/generator/declarativeAgent/helper.js +25 -2
- package/build/component/generator/declarativeAgent/helper.js.map +1 -1
- package/build/component/generator/generatorAction.d.ts +3 -1
- package/build/component/generator/generatorAction.d.ts.map +1 -1
- package/build/component/generator/generatorAction.js.map +1 -1
- package/build/component/generator/officeAddin/generator.d.ts +1 -0
- package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeAddin/generator.js +109 -2
- package/build/component/generator/officeAddin/generator.js.map +1 -1
- package/build/component/generator/openApiSpec/helper.d.ts +2 -3
- package/build/component/generator/openApiSpec/helper.d.ts.map +1 -1
- package/build/component/generator/openApiSpec/helper.js +19 -57
- package/build/component/generator/openApiSpec/helper.js.map +1 -1
- package/build/component/generator/templateHelper.d.ts +10 -2
- package/build/component/generator/templateHelper.d.ts.map +1 -1
- package/build/component/generator/templateHelper.js +16 -3
- package/build/component/generator/templateHelper.js.map +1 -1
- package/build/component/generator/templates/metadata/index.d.ts +15 -0
- package/build/component/generator/templates/metadata/index.d.ts.map +1 -1
- package/build/component/generator/templates/metadata/index.js +39 -0
- package/build/component/generator/templates/metadata/index.js.map +1 -1
- package/build/component/generator/templates/templateNames.d.ts +2 -0
- package/build/component/generator/templates/templateNames.d.ts.map +1 -1
- package/build/component/generator/templates/templateNames.js +2 -0
- 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 +6 -0
- package/build/component/generator/utils.js.map +1 -1
- package/build/component/generator/v4TemplateBridge.d.ts +4 -1
- package/build/component/generator/v4TemplateBridge.d.ts.map +1 -1
- package/build/component/generator/v4TemplateBridge.js +19 -3
- 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 +4 -1
- package/build/component/utils/fileOperation.js.map +1 -1
- package/build/component/utils/mcpAuthScaffolder.d.ts +28 -0
- package/build/component/utils/mcpAuthScaffolder.d.ts.map +1 -1
- package/build/component/utils/mcpAuthScaffolder.js +39 -4
- package/build/component/utils/mcpAuthScaffolder.js.map +1 -1
- package/build/component/utils/mcpToolFetcher.d.ts +1 -72
- package/build/component/utils/mcpToolFetcher.d.ts.map +1 -1
- package/build/component/utils/mcpToolFetcher.js +1 -227
- package/build/component/utils/mcpToolFetcher.js.map +1 -1
- package/build/component/utils/odrProvider.d.ts +1 -55
- package/build/component/utils/odrProvider.d.ts.map +1 -1
- package/build/component/utils/odrProvider.js +1 -101
- 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 +110 -3
- package/build/core/FxCore.declarativeAgent.js.map +1 -1
- package/build/core/FxCore.js +4 -6
- package/build/core/FxCore.js.map +1 -1
- package/build/core/createFrontDoorAdapters.d.ts +4 -27
- package/build/core/createFrontDoorAdapters.d.ts.map +1 -1
- package/build/core/createFrontDoorAdapters.js +17 -157
- package/build/core/createFrontDoorAdapters.js.map +1 -1
- package/build/core/createProjectFrontDoor.d.ts +10 -12
- package/build/core/createProjectFrontDoor.d.ts.map +1 -1
- package/build/core/createProjectFrontDoor.js +143 -106
- package/build/core/createProjectFrontDoor.js.map +1 -1
- package/build/core/modifyProjectFrontDoor.d.ts +0 -1
- package/build/core/modifyProjectFrontDoor.d.ts.map +1 -1
- package/build/core/modifyProjectFrontDoor.js +0 -2
- package/build/core/modifyProjectFrontDoor.js.map +1 -1
- package/build/index.d.ts +3 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +9 -1
- package/build/index.js.map +1 -1
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +2 -1
- package/build/question/create.js.map +1 -1
- package/build/question/inputs/AddKnowledgeInputs.d.ts.map +1 -1
- package/build/question/inputs/CreateProjectInputs.d.ts +4 -0
- 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 +14 -0
- package/build/question/options/CreateProjectOptions.js.map +1 -1
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +11 -1
- package/build/question/other.js.map +1 -1
- package/build/question/questionNames.d.ts +2 -0
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +2 -0
- package/build/question/questionNames.js.map +1 -1
- package/build/question/scaffold/constructNode.d.ts +3 -1
- package/build/question/scaffold/constructNode.d.ts.map +1 -1
- package/build/question/scaffold/constructNode.js +50 -0
- package/build/question/scaffold/constructNode.js.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.d.ts +2 -0
- package/build/question/scaffold/vsc/CapabilityOptions.d.ts.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.js +16 -0
- package/build/question/scaffold/vsc/CapabilityOptions.js.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts +19 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js +39 -7
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js.map +1 -1
- package/build/v4/buildTarget/parseSelector.d.ts +6 -2
- package/build/v4/buildTarget/parseSelector.d.ts.map +1 -1
- package/build/v4/buildTarget/parseSelector.js +58 -45
- package/build/v4/buildTarget/parseSelector.js.map +1 -1
- package/build/v4/buildTarget/resolveBuildTarget.d.ts +21 -7
- package/build/v4/buildTarget/resolveBuildTarget.d.ts.map +1 -1
- package/build/v4/buildTarget/resolveBuildTarget.js +97 -52
- package/build/v4/buildTarget/resolveBuildTarget.js.map +1 -1
- package/build/v4/collectInputs/collectInputs.d.ts +51 -10
- package/build/v4/collectInputs/collectInputs.d.ts.map +1 -1
- package/build/v4/collectInputs/collectInputs.js +287 -91
- 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 +2 -29
- 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 +2 -30
- package/build/v4/distribution/declarativePackage.js.map +1 -1
- package/build/v4/distribution/questionFragments.d.ts +11 -0
- package/build/v4/distribution/questionFragments.d.ts.map +1 -0
- package/build/v4/distribution/questionFragments.js +130 -0
- package/build/v4/distribution/questionFragments.js.map +1 -0
- package/build/v4/engineVersion.d.ts +7 -0
- package/build/v4/engineVersion.d.ts.map +1 -0
- package/build/v4/engineVersion.js +12 -0
- package/build/v4/engineVersion.js.map +1 -0
- package/build/v4/expression/evaluateExpression.d.ts +13 -0
- package/build/v4/expression/evaluateExpression.d.ts.map +1 -1
- package/build/v4/expression/evaluateExpression.js +57 -0
- package/build/v4/expression/evaluateExpression.js.map +1 -1
- package/build/v4/index.d.ts +7 -0
- package/build/v4/index.d.ts.map +1 -1
- package/build/v4/index.js +7 -0
- package/build/v4/index.js.map +1 -1
- package/build/v4/inspection/scaffoldCatalog.d.ts +28 -0
- package/build/v4/inspection/scaffoldCatalog.d.ts.map +1 -0
- package/build/v4/inspection/scaffoldCatalog.js +66 -0
- package/build/v4/inspection/scaffoldCatalog.js.map +1 -0
- package/build/v4/inspection/scaffoldMetadataSource.d.ts +6 -0
- package/build/v4/inspection/scaffoldMetadataSource.d.ts.map +1 -0
- package/build/v4/inspection/scaffoldMetadataSource.js +78 -0
- package/build/v4/inspection/scaffoldMetadataSource.js.map +1 -0
- package/build/v4/mcp/mcpAuthAction.d.ts +36 -0
- package/build/v4/mcp/mcpAuthAction.d.ts.map +1 -0
- package/build/v4/mcp/mcpAuthAction.js +177 -0
- package/build/v4/mcp/mcpAuthAction.js.map +1 -0
- package/build/v4/mcp/mcpAuthScaffold.d.ts +37 -0
- package/build/v4/mcp/mcpAuthScaffold.d.ts.map +1 -0
- package/build/v4/mcp/mcpAuthScaffold.js +162 -0
- package/build/v4/mcp/mcpAuthScaffold.js.map +1 -0
- 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 +27 -5
- package/build/v4/pipeline/runScaffoldPipeline.d.ts.map +1 -1
- package/build/v4/pipeline/runScaffoldPipeline.js +64 -10
- package/build/v4/pipeline/runScaffoldPipeline.js.map +1 -1
- package/build/v4/providers/createOptionsProviders.d.ts +11 -0
- package/build/v4/providers/createOptionsProviders.d.ts.map +1 -0
- package/build/v4/providers/createOptionsProviders.js +268 -0
- package/build/v4/providers/createOptionsProviders.js.map +1 -0
- package/build/v4/renderContext/buildRenderContext.d.ts.map +1 -1
- package/build/v4/renderContext/buildRenderContext.js +4 -6
- package/build/v4/renderContext/buildRenderContext.js.map +1 -1
- package/build/v4/runtime/generalSensitivityLabel.d.ts +5 -0
- package/build/v4/runtime/generalSensitivityLabel.d.ts.map +1 -0
- package/build/v4/runtime/generalSensitivityLabel.js +36 -0
- package/build/v4/runtime/generalSensitivityLabel.js.map +1 -0
- package/build/v4/runtime/inMemoryRuntime.d.ts +7 -1
- package/build/v4/runtime/inMemoryRuntime.d.ts.map +1 -1
- package/build/v4/runtime/inMemoryRuntime.js +25 -3
- 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 +64 -8
- package/build/v4/runtime/packageParse.js.map +1 -1
- package/build/v4/runtime/realRuntime.d.ts +3 -1
- package/build/v4/runtime/realRuntime.d.ts.map +1 -1
- package/build/v4/runtime/realRuntime.js +3 -2
- 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 +13 -4
- package/build/v4/runtime/renderMustache.js.map +1 -1
- package/build/v4/runtime/runtimeRegistry.d.ts +12 -3
- package/build/v4/runtime/runtimeRegistry.d.ts.map +1 -1
- package/build/v4/runtime/runtimeRegistry.js +123 -17
- package/build/v4/runtime/runtimeRegistry.js.map +1 -1
- package/build/v4/runtime/scaffold.d.ts +1 -0
- package/build/v4/runtime/scaffold.d.ts.map +1 -1
- package/build/v4/runtime/scaffold.js +1 -20
- 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 +3 -111
- package/build/v4/runtime/steps/daAction.js.map +1 -1
- package/build/v4/runtime/steps/daSensitivity.d.ts +14 -0
- package/build/v4/runtime/steps/daSensitivity.d.ts.map +1 -0
- package/build/v4/runtime/steps/daSensitivity.js +50 -0
- package/build/v4/runtime/steps/daSensitivity.js.map +1 -0
- package/build/v4/runtime/steps/mcpAuth.d.ts +5 -2
- package/build/v4/runtime/steps/mcpAuth.d.ts.map +1 -1
- package/build/v4/runtime/steps/mcpAuth.js +37 -66
- package/build/v4/runtime/steps/mcpAuth.js.map +1 -1
- package/build/v4/runtime/steps/mcpLocal.d.ts +0 -4
- package/build/v4/runtime/steps/mcpLocal.d.ts.map +1 -1
- package/build/v4/runtime/steps/mcpLocal.js +11 -31
- 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 +14 -32
- 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 +39 -51
- 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 +7 -12
- 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 +85 -566
- package/build/v4/runtime/steps/openApi.js.map +1 -1
- package/build/v4/runtime/steps/openApiCustomApi.d.ts +5 -0
- package/build/v4/runtime/steps/openApiCustomApi.d.ts.map +1 -0
- package/build/v4/runtime/steps/openApiCustomApi.js +385 -0
- package/build/v4/runtime/steps/openApiCustomApi.js.map +1 -0
- package/build/v4/runtime/whitelist.d.ts +27 -0
- package/build/v4/runtime/whitelist.d.ts.map +1 -1
- package/build/v4/runtime/whitelist.js +156 -1
- package/build/v4/runtime/whitelist.js.map +1 -1
- package/build/v4/runtime/withTempDirectory.d.ts +10 -0
- package/build/v4/runtime/withTempDirectory.d.ts.map +1 -0
- package/build/v4/runtime/withTempDirectory.js +41 -0
- package/build/v4/runtime/withTempDirectory.js.map +1 -0
- package/build/v4/surface/createFloorTail.d.ts +12 -0
- package/build/v4/surface/createFloorTail.d.ts.map +1 -0
- package/build/v4/surface/createFloorTail.js +138 -0
- package/build/v4/surface/createFloorTail.js.map +1 -0
- package/build/v4/surface/createInputs.d.ts +25 -3
- package/build/v4/surface/createInputs.d.ts.map +1 -1
- package/build/v4/surface/createInputs.js +54 -431
- package/build/v4/surface/createInputs.js.map +1 -1
- package/build/v4/surface/createSelectorWalk.d.ts +8 -3
- package/build/v4/surface/createSelectorWalk.d.ts.map +1 -1
- package/build/v4/surface/createSelectorWalk.js +21 -11
- package/build/v4/surface/createSelectorWalk.js.map +1 -1
- package/build/v4/surface/deriveCreateOptions.d.ts.map +1 -1
- package/build/v4/surface/deriveCreateOptions.js +5 -2
- package/build/v4/surface/deriveCreateOptions.js.map +1 -1
- package/build/v4/surface/localizePrompt.d.ts +11 -0
- package/build/v4/surface/localizePrompt.d.ts.map +1 -0
- package/build/v4/surface/localizePrompt.js +32 -0
- package/build/v4/surface/localizePrompt.js.map +1 -0
- package/build/v4/surface/modifySelectorWalk.d.ts.map +1 -1
- package/build/v4/surface/modifySelectorWalk.js +0 -3
- 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 +45 -45
- package/build/v4/surface/uiPromptUI.js.map +1 -1
- package/build/v4/validation/capabilityCatalog.d.ts +8 -0
- package/build/v4/validation/capabilityCatalog.d.ts.map +1 -0
- package/build/v4/validation/capabilityCatalog.js +62 -0
- package/build/v4/validation/capabilityCatalog.js.map +1 -0
- package/build/v4/validation/templateArchiveValidation.d.ts +15 -0
- package/build/v4/validation/templateArchiveValidation.d.ts.map +1 -0
- package/build/v4/validation/templateArchiveValidation.js +297 -0
- package/build/v4/validation/templateArchiveValidation.js.map +1 -0
- package/build/v4/validation/validateTemplatePackage.d.ts +21 -2
- package/build/v4/validation/validateTemplatePackage.d.ts.map +1 -1
- package/build/v4/validation/validateTemplatePackage.js +155 -31
- package/build/v4/validation/validateTemplatePackage.js.map +1 -1
- package/build/v4/validators/createInputValidators.d.ts +7 -0
- package/build/v4/validators/createInputValidators.d.ts.map +1 -0
- package/build/v4/validators/createInputValidators.js +77 -0
- package/build/v4/validators/createInputValidators.js.map +1 -0
- package/build/v4/validators/mcpCredentialValidators.d.ts +5 -0
- package/build/v4/validators/mcpCredentialValidators.d.ts.map +1 -0
- package/build/v4/validators/mcpCredentialValidators.js +13 -0
- package/build/v4/validators/mcpCredentialValidators.js.map +1 -0
- package/build/v4/validators/mcpServerUrlValidator.d.ts +9 -0
- package/build/v4/validators/mcpServerUrlValidator.d.ts.map +1 -0
- package/build/v4/validators/mcpServerUrlValidator.js +15 -0
- package/build/v4/validators/mcpServerUrlValidator.js.map +1 -0
- package/package.json +29 -23
- package/resource/package.nls.cs.json +56 -54
- package/resource/package.nls.de.json +56 -54
- package/resource/package.nls.es.json +55 -53
- package/resource/package.nls.fr.json +56 -54
- package/resource/package.nls.it.json +55 -53
- package/resource/package.nls.ja.json +56 -54
- package/resource/package.nls.json +10 -3
- package/resource/package.nls.ko.json +56 -54
- package/resource/package.nls.pl.json +56 -54
- package/resource/package.nls.pt-BR.json +56 -54
- package/resource/package.nls.ru.json +56 -54
- package/resource/package.nls.tr.json +56 -54
- package/resource/package.nls.zh-Hans.json +56 -54
- package/resource/package.nls.zh-Hant.json +56 -54
- package/resource/templates/package.nls.cs.json +22 -9
- package/resource/templates/package.nls.de.json +22 -9
- package/resource/templates/package.nls.es.json +22 -9
- package/resource/templates/package.nls.fr.json +22 -9
- package/resource/templates/package.nls.it.json +22 -9
- package/resource/templates/package.nls.ja.json +22 -9
- package/resource/templates/package.nls.json +16 -3
- package/resource/templates/package.nls.ko.json +22 -9
- package/resource/templates/package.nls.pl.json +22 -9
- package/resource/templates/package.nls.pt-BR.json +22 -9
- package/resource/templates/package.nls.ru.json +22 -9
- package/resource/templates/package.nls.tr.json +22 -9
- package/resource/templates/package.nls.zh-Hans.json +22 -9
- package/resource/templates/package.nls.zh-Hant.json +22 -9
- package/resource/templates/package.nls.zh-cn.json +7 -1
- package/resource/templates/package.nls.zh-tw.json +7 -1
- 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 +16 -2
- package/templates/metadata.zip +0 -0
- package/templates/ui/wizardNode.json +24 -0
- package/templates/v4/create-selector.json +30 -5
- package/templates/v4/floor.json +1 -1
- package/templates/v4/modify-selector.json +1 -6
- package/templates/v4/templates-metadata.zip +0 -0
- package/templates/v4/templates.zip +0 -0
- package/templates/configs/local/typescript/.gitignore +0 -1
- package/templates/configs/playground/typescript/.gitignore +0 -4
|
@@ -0,0 +1,297 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.validateDeclarativePackageArchive = validateDeclarativePackageArchive;
|
|
6
|
+
exports.validateDeclarativeTemplateArchive = validateDeclarativeTemplateArchive;
|
|
7
|
+
const tslib_1 = require("tslib");
|
|
8
|
+
const adm_zip_1 = tslib_1.__importDefault(require("adm-zip"));
|
|
9
|
+
const ajv_1 = tslib_1.__importDefault(require("ajv"));
|
|
10
|
+
const neverthrow_1 = require("neverthrow");
|
|
11
|
+
const validateTemplatePackage_1 = require("./validateTemplatePackage");
|
|
12
|
+
const capabilityCatalog_1 = require("./capabilityCatalog");
|
|
13
|
+
const CALLER_FLOOR = ["appName", "language"];
|
|
14
|
+
const VALUE_TOKEN = /\{\{\s*[#^\/]?\s*([A-Za-z_][A-Za-z0-9_.]*)\s*\}\}/g;
|
|
15
|
+
function archiveError(errors, name, message) {
|
|
16
|
+
return errors.system(name, message);
|
|
17
|
+
}
|
|
18
|
+
function packageError(errors, name, message) {
|
|
19
|
+
return errors.user(name, message);
|
|
20
|
+
}
|
|
21
|
+
function packageIdFromEntry(kind, name) {
|
|
22
|
+
const prefix = `v4/${kind}/`;
|
|
23
|
+
if (!name.startsWith(prefix)) {
|
|
24
|
+
return undefined;
|
|
25
|
+
}
|
|
26
|
+
const relative = name.slice(prefix.length);
|
|
27
|
+
for (const suffix of ["/descriptor.json", "/questions.json", "/pipeline.json"]) {
|
|
28
|
+
if (relative.endsWith(suffix)) {
|
|
29
|
+
const id = relative.slice(0, -suffix.length);
|
|
30
|
+
return id.length > 0 ? id : undefined;
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const contentIndex = relative.indexOf("/content/");
|
|
34
|
+
return contentIndex > 0 ? relative.slice(0, contentIndex) : undefined;
|
|
35
|
+
}
|
|
36
|
+
function openArchive(bytes, errors) {
|
|
37
|
+
let zip;
|
|
38
|
+
try {
|
|
39
|
+
zip = new adm_zip_1.default(bytes);
|
|
40
|
+
}
|
|
41
|
+
catch {
|
|
42
|
+
return (0, neverthrow_1.err)(archiveError(errors, "TemplatePackageCorrupt", "The template package is not a valid archive."));
|
|
43
|
+
}
|
|
44
|
+
const entries = new Map();
|
|
45
|
+
const packageIds = {
|
|
46
|
+
create: new Set(),
|
|
47
|
+
modify: new Set(),
|
|
48
|
+
};
|
|
49
|
+
const presentIds = { create: [], modify: [] };
|
|
50
|
+
try {
|
|
51
|
+
for (const entry of zip.getEntries()) {
|
|
52
|
+
if (entry.isDirectory) {
|
|
53
|
+
continue;
|
|
54
|
+
}
|
|
55
|
+
const name = entry.entryName.replace(/\\/g, "/");
|
|
56
|
+
entries.set(name, entry.getData());
|
|
57
|
+
for (const kind of ["create", "modify"]) {
|
|
58
|
+
const id = packageIdFromEntry(kind, name);
|
|
59
|
+
if (id !== undefined) {
|
|
60
|
+
packageIds[kind].add(id);
|
|
61
|
+
if (name === `v4/${kind}/${id}/descriptor.json`) {
|
|
62
|
+
presentIds[kind].push(id);
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch {
|
|
69
|
+
return (0, neverthrow_1.err)(archiveError(errors, "TemplatePackageCorrupt", "The template package could not be read."));
|
|
70
|
+
}
|
|
71
|
+
presentIds.create.sort();
|
|
72
|
+
presentIds.modify.sort();
|
|
73
|
+
return (0, neverthrow_1.ok)({
|
|
74
|
+
zip,
|
|
75
|
+
entries,
|
|
76
|
+
packageIds: {
|
|
77
|
+
create: [...packageIds.create].sort(),
|
|
78
|
+
modify: [...packageIds.modify].sort(),
|
|
79
|
+
},
|
|
80
|
+
presentIds,
|
|
81
|
+
});
|
|
82
|
+
}
|
|
83
|
+
function parseJson(data, file, errors) {
|
|
84
|
+
try {
|
|
85
|
+
const parsed = JSON.parse(data.toString("utf8"));
|
|
86
|
+
return (0, neverthrow_1.ok)(parsed);
|
|
87
|
+
}
|
|
88
|
+
catch {
|
|
89
|
+
return (0, neverthrow_1.err)(archiveError(errors, "PackageFileInvalid", `The template package file "${file}" is not valid JSON.`));
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
function parseOptionalJson(archive, file, errors) {
|
|
93
|
+
const data = archive.entries.get(file);
|
|
94
|
+
return data === undefined ? (0, neverthrow_1.ok)(undefined) : parseJson(data, file, errors);
|
|
95
|
+
}
|
|
96
|
+
function isAnySchema(value) {
|
|
97
|
+
return (typeof value === "boolean" ||
|
|
98
|
+
(typeof value === "object" && value !== null && !Array.isArray(value)));
|
|
99
|
+
}
|
|
100
|
+
function schemaValidator(ajv, validate) {
|
|
101
|
+
return (data) => validate(data) ? undefined : ajv.errorsText(validate.errors, { separator: "; " });
|
|
102
|
+
}
|
|
103
|
+
function compileSchemas(archive, errors) {
|
|
104
|
+
const schemaFiles = [
|
|
105
|
+
["descriptor", "v4/schema/descriptor.schema.json"],
|
|
106
|
+
["question", "v4/schema/questions.schema.json"],
|
|
107
|
+
["pipeline", "v4/schema/pipeline.schema.json"],
|
|
108
|
+
["selector", "v4/schema/selector.schema.json"],
|
|
109
|
+
];
|
|
110
|
+
const schemas = {};
|
|
111
|
+
for (const [name, file] of schemaFiles) {
|
|
112
|
+
const data = archive.entries.get(file);
|
|
113
|
+
if (data === undefined) {
|
|
114
|
+
return (0, neverthrow_1.err)(archiveError(errors, "PackageFileMissing", `The template package is missing "${file}".`));
|
|
115
|
+
}
|
|
116
|
+
const parsed = parseJson(data, file, errors);
|
|
117
|
+
if (parsed.isErr()) {
|
|
118
|
+
return (0, neverthrow_1.err)(parsed.error);
|
|
119
|
+
}
|
|
120
|
+
if (!isAnySchema(parsed.value)) {
|
|
121
|
+
return (0, neverthrow_1.err)(archiveError(errors, "TemplateSchemaInvalid", `The template schema "${file}" is invalid.`));
|
|
122
|
+
}
|
|
123
|
+
schemas[name] = parsed.value;
|
|
124
|
+
}
|
|
125
|
+
const descriptor = schemas.descriptor;
|
|
126
|
+
const question = schemas.question;
|
|
127
|
+
const pipeline = schemas.pipeline;
|
|
128
|
+
const selector = schemas.selector;
|
|
129
|
+
if (descriptor === undefined ||
|
|
130
|
+
question === undefined ||
|
|
131
|
+
pipeline === undefined ||
|
|
132
|
+
selector === undefined) {
|
|
133
|
+
return (0, neverthrow_1.err)(archiveError(errors, "TemplateSchemaInvalid", "The template package schema set is incomplete."));
|
|
134
|
+
}
|
|
135
|
+
try {
|
|
136
|
+
const ajv = new ajv_1.default({ allErrors: true, strict: false });
|
|
137
|
+
ajv.addSchema(question);
|
|
138
|
+
return (0, neverthrow_1.ok)({
|
|
139
|
+
descriptor: schemaValidator(ajv, ajv.compile(descriptor)),
|
|
140
|
+
question: schemaValidator(ajv, ajv.getSchema("https://aka.ms/m365atk/v4/questions.schema.json") ?? ajv.compile(question)),
|
|
141
|
+
pipeline: schemaValidator(ajv, ajv.compile(pipeline)),
|
|
142
|
+
selector: schemaValidator(ajv, ajv.compile(selector)),
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
catch {
|
|
146
|
+
return (0, neverthrow_1.err)(archiveError(errors, "TemplateSchemaInvalid", "The template package schemas could not be compiled."));
|
|
147
|
+
}
|
|
148
|
+
}
|
|
149
|
+
function isSafeRelativePath(relativePath) {
|
|
150
|
+
if (relativePath.startsWith("/") ||
|
|
151
|
+
relativePath.startsWith("\\") ||
|
|
152
|
+
/^[A-Za-z]:/.test(relativePath)) {
|
|
153
|
+
return false;
|
|
154
|
+
}
|
|
155
|
+
return relativePath
|
|
156
|
+
.replace(/\\/g, "/")
|
|
157
|
+
.split("/")
|
|
158
|
+
.every((segment) => segment.length > 0 && segment !== "." && segment !== "..");
|
|
159
|
+
}
|
|
160
|
+
function validateSelectors(archive, schemas, errors) {
|
|
161
|
+
for (const kind of ["create", "modify"]) {
|
|
162
|
+
const file = `v4/${kind}/selector.json`;
|
|
163
|
+
const selector = parseOptionalJson(archive, file, errors);
|
|
164
|
+
if (selector.isErr()) {
|
|
165
|
+
return (0, neverthrow_1.err)(selector.error);
|
|
166
|
+
}
|
|
167
|
+
const schemaError = schemas.selector(selector.value);
|
|
168
|
+
if (schemaError !== undefined) {
|
|
169
|
+
return (0, neverthrow_1.err)(packageError(errors, validateTemplatePackage_1.VALIDATE_SCHEMA, `${file}: selector.json failed schema validation: ${schemaError}`));
|
|
170
|
+
}
|
|
171
|
+
}
|
|
172
|
+
return (0, neverthrow_1.ok)(undefined);
|
|
173
|
+
}
|
|
174
|
+
function extractPlaceholders(value, output) {
|
|
175
|
+
for (const match of value.matchAll(VALUE_TOKEN)) {
|
|
176
|
+
if (match.index !== undefined && match.index > 0 && value[match.index - 1] === "$") {
|
|
177
|
+
continue;
|
|
178
|
+
}
|
|
179
|
+
output.add(match[1]);
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
function loadContent(archive, locator, errors) {
|
|
183
|
+
const prefix = `v4/${locator.kind}/${locator.templateId}/content/`;
|
|
184
|
+
const raw = [];
|
|
185
|
+
const validation = [];
|
|
186
|
+
for (const [name, data] of archive.entries) {
|
|
187
|
+
if (!name.startsWith(prefix)) {
|
|
188
|
+
continue;
|
|
189
|
+
}
|
|
190
|
+
const relativePath = name.slice(prefix.length);
|
|
191
|
+
if (!isSafeRelativePath(relativePath)) {
|
|
192
|
+
return (0, neverthrow_1.err)(archiveError(errors, "TemplatePackageUnsafePath", `The resolved template package contains an unsafe entry path: "${name}".`));
|
|
193
|
+
}
|
|
194
|
+
const placeholders = new Set();
|
|
195
|
+
if (relativePath.endsWith(".tpl")) {
|
|
196
|
+
extractPlaceholders(relativePath, placeholders);
|
|
197
|
+
extractPlaceholders(data.toString("utf8"), placeholders);
|
|
198
|
+
}
|
|
199
|
+
raw.push({ path: relativePath, data });
|
|
200
|
+
validation.push({ path: relativePath, placeholders: [...placeholders].sort() });
|
|
201
|
+
}
|
|
202
|
+
raw.sort((left, right) => left.path.localeCompare(right.path));
|
|
203
|
+
validation.sort((left, right) => left.path.localeCompare(right.path));
|
|
204
|
+
return (0, neverthrow_1.ok)({ raw, validation: validation.length === 0 ? undefined : validation });
|
|
205
|
+
}
|
|
206
|
+
function validateOpenedPackage(archive, schemas, locator, mode, engineVersion, errors) {
|
|
207
|
+
const root = `v4/${locator.kind}/${locator.templateId}/`;
|
|
208
|
+
const descriptor = parseOptionalJson(archive, `${root}descriptor.json`, errors);
|
|
209
|
+
if (descriptor.isErr()) {
|
|
210
|
+
return (0, neverthrow_1.err)(descriptor.error);
|
|
211
|
+
}
|
|
212
|
+
const questions = parseOptionalJson(archive, `${root}questions.json`, errors);
|
|
213
|
+
if (questions.isErr()) {
|
|
214
|
+
return (0, neverthrow_1.err)(questions.error);
|
|
215
|
+
}
|
|
216
|
+
const pipeline = parseOptionalJson(archive, `${root}pipeline.json`, errors);
|
|
217
|
+
if (pipeline.isErr()) {
|
|
218
|
+
return (0, neverthrow_1.err)(pipeline.error);
|
|
219
|
+
}
|
|
220
|
+
const createSelector = parseOptionalJson(archive, "v4/create/selector.json", errors);
|
|
221
|
+
if (createSelector.isErr()) {
|
|
222
|
+
return (0, neverthrow_1.err)(createSelector.error);
|
|
223
|
+
}
|
|
224
|
+
const modifySelector = parseOptionalJson(archive, "v4/modify/selector.json", errors);
|
|
225
|
+
if (modifySelector.isErr()) {
|
|
226
|
+
return (0, neverthrow_1.err)(modifySelector.error);
|
|
227
|
+
}
|
|
228
|
+
const content = loadContent(archive, locator, errors);
|
|
229
|
+
if (content.isErr()) {
|
|
230
|
+
return (0, neverthrow_1.err)(content.error);
|
|
231
|
+
}
|
|
232
|
+
const validation = (0, validateTemplatePackage_1.validateTemplatePackage)(locator.kind, locator.templateId, mode, {
|
|
233
|
+
userError: (name, message) => errors.user(name, message),
|
|
234
|
+
descriptor: () => descriptor.value,
|
|
235
|
+
questions: () => questions.value,
|
|
236
|
+
pipeline: () => pipeline.value,
|
|
237
|
+
content: () => content.value.validation,
|
|
238
|
+
selector: (kind) => (kind === "create" ? createSelector.value : modifySelector.value),
|
|
239
|
+
schemas,
|
|
240
|
+
capabilityFloor: capabilityCatalog_1.templateCapabilityFloor,
|
|
241
|
+
capabilityOutputs: capabilityCatalog_1.templateCapabilityOutputs,
|
|
242
|
+
engineVersion: () => engineVersion,
|
|
243
|
+
callerFloor: () => CALLER_FLOOR,
|
|
244
|
+
presentTemplateIds: (kind) => archive.presentIds[kind],
|
|
245
|
+
});
|
|
246
|
+
if (validation.isErr()) {
|
|
247
|
+
return (0, neverthrow_1.err)(validation.error);
|
|
248
|
+
}
|
|
249
|
+
return (0, neverthrow_1.ok)({
|
|
250
|
+
descriptor: validation.value.descriptor,
|
|
251
|
+
pipeline: pipeline.value,
|
|
252
|
+
content: content.value.raw,
|
|
253
|
+
});
|
|
254
|
+
}
|
|
255
|
+
/** Validate and open one declarative package from final channel archive bytes. */
|
|
256
|
+
function validateDeclarativePackageArchive(bytes, locator, mode, engineVersion, errors) {
|
|
257
|
+
const archive = openArchive(bytes, errors);
|
|
258
|
+
if (archive.isErr()) {
|
|
259
|
+
return (0, neverthrow_1.err)(archive.error);
|
|
260
|
+
}
|
|
261
|
+
const schemas = compileSchemas(archive.value, errors);
|
|
262
|
+
if (schemas.isErr()) {
|
|
263
|
+
return (0, neverthrow_1.err)(schemas.error);
|
|
264
|
+
}
|
|
265
|
+
const selectors = validateSelectors(archive.value, schemas.value, errors);
|
|
266
|
+
if (selectors.isErr()) {
|
|
267
|
+
return (0, neverthrow_1.err)(selectors.error);
|
|
268
|
+
}
|
|
269
|
+
return validateOpenedPackage(archive.value, schemas.value, locator, mode, engineVersion, errors);
|
|
270
|
+
}
|
|
271
|
+
/** Validate every authored create/modify package in final channel archive bytes. */
|
|
272
|
+
function validateDeclarativeTemplateArchive(bytes, mode, engineVersion, errors) {
|
|
273
|
+
const archive = openArchive(bytes, errors);
|
|
274
|
+
if (archive.isErr()) {
|
|
275
|
+
return (0, neverthrow_1.err)(archive.error);
|
|
276
|
+
}
|
|
277
|
+
const schemas = compileSchemas(archive.value, errors);
|
|
278
|
+
if (schemas.isErr()) {
|
|
279
|
+
return (0, neverthrow_1.err)(schemas.error);
|
|
280
|
+
}
|
|
281
|
+
const selectors = validateSelectors(archive.value, schemas.value, errors);
|
|
282
|
+
if (selectors.isErr()) {
|
|
283
|
+
return (0, neverthrow_1.err)(selectors.error);
|
|
284
|
+
}
|
|
285
|
+
const validated = [];
|
|
286
|
+
for (const kind of ["create", "modify"]) {
|
|
287
|
+
for (const templateId of archive.value.packageIds[kind]) {
|
|
288
|
+
const result = validateOpenedPackage(archive.value, schemas.value, { kind, templateId }, mode, engineVersion, errors);
|
|
289
|
+
if (result.isErr()) {
|
|
290
|
+
return (0, neverthrow_1.err)(result.error);
|
|
291
|
+
}
|
|
292
|
+
validated.push(`${kind}/${templateId}`);
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
return (0, neverthrow_1.ok)(validated);
|
|
296
|
+
}
|
|
297
|
+
//# sourceMappingURL=templateArchiveValidation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"templateArchiveValidation.js","sourceRoot":"","sources":["../../../src/v4/validation/templateArchiveValidation.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAuXlC,8EAoBC;AAGD,gFAoCC;;AA/aD,8DAA6B;AAC7B,sDAAsB;AAEtB,2CAAqC;AAIrC,uEAAqF;AAOrF,2DAAyF;AAEzF,MAAM,YAAY,GAAG,CAAC,SAAS,EAAE,UAAU,CAAC,CAAC;AAC7C,MAAM,WAAW,GAAG,oDAAoD,CAAC;AAsBzE,SAAS,YAAY,CAAC,MAAmC,EAAE,IAAY,EAAE,OAAe;IACtF,OAAO,MAAM,CAAC,MAAM,CAAC,I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Q,EAAE,QAAQ,CAAU,EAAE,CAAC;QACjD,KAAK,MAAM,UAAU,IAAI,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,IAAI,CAAC,EAAE,CAAC;YACxD,MAAM,MAAM,GAAG,qBAAqB,CAClC,OAAO,CAAC,KAAK,EACb,OAAO,CAAC,KAAK,EACb,EAAE,IAAI,EAAE,UAAU,EAAE,EACpB,IAAI,EACJ,aAAa,EACb,MAAM,CACP,CAAC;YACF,IAAI,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;gBACnB,OAAO,IAAA,gBAAG,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC3B,CAAC;YACD,SAAS,CAAC,IAAI,CAAC,GAAG,IAAI,IAAI,UAAU,EAAE,CAAC,CAAC;QAC1C,CAAC;IACH,CAAC;IACD,OAAO,IAAA,eAAE,EAAC,SAAS,CAAC,CAAC;AACvB,CAAC"}
|
|
@@ -1,5 +1,7 @@
|
|
|
1
|
-
import { FxError } from "@microsoft/teamsfx-api";
|
|
2
|
-
import { Result } from "neverthrow";
|
|
1
|
+
import type { FxError } from "@microsoft/teamsfx-api";
|
|
2
|
+
import type { Result } from "neverthrow";
|
|
3
|
+
/** Create one caller-owned, author-fixable validation failure. */
|
|
4
|
+
export type TemplatePackageErrorFactory = (name: string, message: string) => FxError;
|
|
3
5
|
/** Package namespace. */
|
|
4
6
|
export type PackageKind = "create" | "modify";
|
|
5
7
|
/** Validation mode; only `load` compares this engine against `minEngineVersion`. */
|
|
@@ -11,8 +13,12 @@ export interface ContentFile {
|
|
|
11
13
|
}
|
|
12
14
|
/** JSON-schema validator face; `undefined` means valid. */
|
|
13
15
|
export type SchemaValidator = (data: unknown) => string | undefined;
|
|
16
|
+
/** Template-visible extension-point categories with source-owned introduction versions. */
|
|
17
|
+
export type CapabilityKind = "step" | "provider" | "validator";
|
|
14
18
|
/** Narrow validation port; schema, package, and engine-context data stay injected. */
|
|
15
19
|
export interface TemplatePackagePort {
|
|
20
|
+
/** Adapt an author-fixable diagnosis to the caller's concrete error type. */
|
|
21
|
+
userError: TemplatePackageErrorFactory;
|
|
16
22
|
/** The package's parsed `descriptor.json`, or `undefined` when absent. */
|
|
17
23
|
descriptor(): unknown | undefined;
|
|
18
24
|
/** The package's parsed `questions.json`, or `undefined` when absent. */
|
|
@@ -27,8 +33,13 @@ export interface TemplatePackagePort {
|
|
|
27
33
|
schemas: {
|
|
28
34
|
descriptor: SchemaValidator;
|
|
29
35
|
question: SchemaValidator;
|
|
36
|
+
pipeline: SchemaValidator;
|
|
30
37
|
selector: SchemaValidator;
|
|
31
38
|
};
|
|
39
|
+
/** The engine introduction version for a named capability; `undefined` means unknown. */
|
|
40
|
+
capabilityFloor(kind: CapabilityKind, id: string): string | undefined;
|
|
41
|
+
/** Output names a capability may add to the render context. */
|
|
42
|
+
capabilityOutputs(kind: CapabilityKind, id: string): string[];
|
|
32
43
|
/** The consuming engine's SemVer (the `load`-mode reverse gate). */
|
|
33
44
|
engineVersion(): string;
|
|
34
45
|
/** The closed caller-injected identifier names (`appName`, the `language` axis, …). */
|
|
@@ -59,6 +70,14 @@ export declare const VALIDATE_KIND_OVERLAP = "TemplatePackageKindOverlap";
|
|
|
59
70
|
export declare const VALIDATE_MIN_ENGINE_MISSING = "TemplatePackageMinEngineVersionMissing";
|
|
60
71
|
/** `UserError` name: `engineVersion < minEngineVersion` — the engine is too old. */
|
|
61
72
|
export declare const VALIDATE_ENGINE_TOO_OLD = "TemplatePackageEngineTooOld";
|
|
73
|
+
/** `UserError` name: a package or consuming engine version is not valid SemVer. */
|
|
74
|
+
export declare const VALIDATE_ENGINE_VERSION_INVALID = "TemplatePackageEngineVersionInvalid";
|
|
75
|
+
/** `UserError` name: package data references a capability absent from the engine catalogue. */
|
|
76
|
+
export declare const VALIDATE_UNKNOWN_CAPABILITY = "TemplatePackageUnknownCapability";
|
|
77
|
+
/** `UserError` name: `minEngineVersion` predates a referenced capability. */
|
|
78
|
+
export declare const VALIDATE_CAPABILITY_FLOOR = "TemplatePackageCapabilityFloor";
|
|
79
|
+
/** Apply the package's reverse engine-version gate before any content is rendered. */
|
|
80
|
+
export declare function validateMinEngineVersion(kind: PackageKind, id: string, descriptor: unknown, engineVersion: string, userError: TemplatePackageErrorFactory): Result<string, FxError>;
|
|
62
81
|
/** Validate one `<kind>/<id>` package before any content is rendered. */
|
|
63
82
|
export declare function validateTemplatePackage(kind: PackageKind, id: string, mode: ValidateMode, port: TemplatePackagePort): Result<ValidatedPackage, FxError>;
|
|
64
83
|
//# sourceMappingURL=validateTemplatePackage.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validateTemplatePackage.d.ts","sourceRoot":"","sources":["../../../src/v4/validation/validateTemplatePackage.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,
|
|
1
|
+
{"version":3,"file":"validateTemplatePackage.d.ts","sourceRoot":"","sources":["../../../src/v4/validation/validateTemplatePackage.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AAEtD,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,YAAY,CAAC;AAOzC,kEAAkE;AAClE,MAAM,MAAM,2BAA2B,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;AAErF,yBAAyB;AACzB,MAAM,MAAM,WAAW,GAAG,QAAQ,GAAG,QAAQ,CAAC;AAE9C,oFAAoF;AACpF,MAAM,MAAM,YAAY,GAAG,OAAO,GAAG,MAAM,CAAC;AAE5C,gEAAgE;AAChE,MAAM,WAAW,WAAW;IAC1B,IAAI,EAAE,MAAM,CAAC;IACb,YAAY,EAAE,MAAM,EAAE,CAAC;CACxB;AAED,2DAA2D;AAC3D,MAAM,MAAM,eAAe,GAAG,CAAC,IAAI,EAAE,OAAO,KAAK,MAAM,GAAG,SAAS,CAAC;AAEpE,2FAA2F;AAC3F,MAAM,MAAM,cAAc,GAAG,MAA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O,MAAM,sBAAsB,gCAAgC,CAAC;AACpE,+DAA+D;AAC/D,eAAO,MAAM,eAAe,0BAA0B,CAAC;AACvD,4FAA4F;AAC5F,eAAO,MAAM,0BAA0B,oCAAoC,CAAC;AAC5E,6FAA6F;AAC7F,eAAO,MAAM,uBAAuB,iCAAiC,CAAC;AACtE,iGAAiG;AACjG,eAAO,MAAM,qBAAqB,+BAA+B,CAAC;AAClE,oFAAoF;AACpF,eAAO,MAAM,2BAA2B,2CAA2C,CAAC;AACpF,oFAAoF;AACpF,eAAO,MAAM,uBAAuB,gCAAgC,CAAC;AACrE,mFAAmF;AACnF,eAAO,MAAM,+BAA+B,wCAAwC,CAAC;AACrF,+FAA+F;AAC/F,eAAO,MAAM,2BAA2B,qCAAqC,CAAC;AAC9E,6EAA6E;AAC7E,eAAO,MAAM,yBAAyB,mCAAmC,CAAC;AA4I1E,sFAAsF;AACtF,wBAAgB,wBAAwB,CACtC,IAAI,EAAE,WAAW,EACjB,EAAE,EAAE,MAAM,EACV,UAAU,EAAE,OAAO,EACnB,aAAa,EAAE,MAAM,EACrB,SAAS,EAAE,2BAA2B,GACrC,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CA+BzB;AAED,yEAAyE;AACzE,wBAAgB,uBAAuB,CACrC,IAAI,EAAE,WAAW,EACjB,EAAE,EAAE,MAAM,EACV,IAAI,EAAE,YAAY,EAClB,IAAI,EAAE,mBAAmB,GACxB,MAAM,CAAC,gBAAgB,EAAE,OAAO,CAAC,CA0MnC"}
|
|
@@ -2,12 +2,14 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.VALIDATE_ENGINE_TOO_OLD = exports.VALIDATE_MIN_ENGINE_MISSING = exports.VALIDATE_KIND_OVERLAP = exports.VALIDATE_DANGLING_ROUTE = exports.VALIDATE_PLACEHOLDER_DRIFT = exports.VALIDATE_SCHEMA = exports.VALIDATE_REQUIRED_FILE = void 0;
|
|
5
|
+
exports.VALIDATE_CAPABILITY_FLOOR = exports.VALIDATE_UNKNOWN_CAPABILITY = exports.VALIDATE_ENGINE_VERSION_INVALID = exports.VALIDATE_ENGINE_TOO_OLD = exports.VALIDATE_MIN_ENGINE_MISSING = exports.VALIDATE_KIND_OVERLAP = exports.VALIDATE_DANGLING_ROUTE = exports.VALIDATE_PLACEHOLDER_DRIFT = exports.VALIDATE_SCHEMA = exports.VALIDATE_REQUIRED_FILE = void 0;
|
|
6
|
+
exports.validateMinEngineVersion = validateMinEngineVersion;
|
|
6
7
|
exports.validateTemplatePackage = validateTemplatePackage;
|
|
7
|
-
const
|
|
8
|
+
const tslib_1 = require("tslib");
|
|
8
9
|
const neverthrow_1 = require("neverthrow");
|
|
10
|
+
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
9
11
|
/** Pure v4 template-package validation gate. See validate-template-package spec and ADR-0015. */
|
|
10
|
-
const
|
|
12
|
+
const MUSTACHE_VALUE = /\{\{\s*([A-Za-z_][A-Za-z0-9_.]*)\s*\}\}/g;
|
|
11
13
|
/** `UserError` name: a required package file (`descriptor`/`questions`/`pipeline`) is absent. */
|
|
12
14
|
exports.VALIDATE_REQUIRED_FILE = "TemplatePackageRequiredFile";
|
|
13
15
|
/** `UserError` name: a package file failed its JSON schema. */
|
|
@@ -22,9 +24,12 @@ exports.VALIDATE_KIND_OVERLAP = "TemplatePackageKindOverlap";
|
|
|
22
24
|
exports.VALIDATE_MIN_ENGINE_MISSING = "TemplatePackageMinEngineVersionMissing";
|
|
23
25
|
/** `UserError` name: `engineVersion < minEngineVersion` — the engine is too old. */
|
|
24
26
|
exports.VALIDATE_ENGINE_TOO_OLD = "TemplatePackageEngineTooOld";
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
27
|
+
/** `UserError` name: a package or consuming engine version is not valid SemVer. */
|
|
28
|
+
exports.VALIDATE_ENGINE_VERSION_INVALID = "TemplatePackageEngineVersionInvalid";
|
|
29
|
+
/** `UserError` name: package data references a capability absent from the engine catalogue. */
|
|
30
|
+
exports.VALIDATE_UNKNOWN_CAPABILITY = "TemplatePackageUnknownCapability";
|
|
31
|
+
/** `UserError` name: `minEngineVersion` predates a referenced capability. */
|
|
32
|
+
exports.VALIDATE_CAPABILITY_FLOOR = "TemplatePackageCapabilityFloor";
|
|
28
33
|
function isRecord(v) {
|
|
29
34
|
return typeof v === "object" && v !== null && !Array.isArray(v);
|
|
30
35
|
}
|
|
@@ -58,29 +63,111 @@ function v4RouteIds(selectorData) {
|
|
|
58
63
|
}
|
|
59
64
|
return ids;
|
|
60
65
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
66
|
+
function validateEngineVersion(pkg, field, version, userError) {
|
|
67
|
+
if (semver_1.default.valid(version) !== version) {
|
|
68
|
+
return (0, neverthrow_1.err)(userError(exports.VALIDATE_ENGINE_VERSION_INVALID, `${pkg}: ${field} '${version}' is not valid SemVer`));
|
|
69
|
+
}
|
|
70
|
+
return (0, neverthrow_1.ok)(version);
|
|
71
|
+
}
|
|
72
|
+
function validatorReference(validation) {
|
|
73
|
+
const id = typeof validation === "string"
|
|
74
|
+
? validation
|
|
75
|
+
: isRecord(validation)
|
|
76
|
+
? getString(validation, "use")
|
|
77
|
+
: undefined;
|
|
78
|
+
return id === undefined ? undefined : { kind: "validator", id };
|
|
79
|
+
}
|
|
80
|
+
function capabilityReferences(questions, pipeline) {
|
|
81
|
+
const references = [];
|
|
82
|
+
if (isRecord(questions)) {
|
|
83
|
+
for (const question of getArray(questions, "questions") ?? []) {
|
|
84
|
+
if (!isRecord(question)) {
|
|
85
|
+
continue;
|
|
86
|
+
}
|
|
87
|
+
const provider = getString(question, "optionsFrom");
|
|
88
|
+
if (provider !== undefined) {
|
|
89
|
+
references.push({ kind: "provider", id: provider });
|
|
90
|
+
}
|
|
91
|
+
const validator = validatorReference(question.validation);
|
|
92
|
+
if (validator !== undefined) {
|
|
93
|
+
references.push(validator);
|
|
94
|
+
}
|
|
95
|
+
const inputBoxValidator = validatorReference(getRecord(question, "inputBoxConfig")?.validation);
|
|
96
|
+
if (inputBoxValidator !== undefined) {
|
|
97
|
+
references.push(inputBoxValidator);
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
if (isRecord(pipeline)) {
|
|
102
|
+
for (const step of getArray(pipeline, "steps") ?? []) {
|
|
103
|
+
if (!isRecord(step)) {
|
|
104
|
+
continue;
|
|
105
|
+
}
|
|
106
|
+
const id = getString(step, "step");
|
|
107
|
+
if (id !== undefined) {
|
|
108
|
+
references.push({ kind: "step", id });
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
return references;
|
|
113
|
+
}
|
|
114
|
+
function pipelinePlaceholderReferences(pipeline) {
|
|
115
|
+
const references = new Set();
|
|
116
|
+
if (!isRecord(pipeline)) {
|
|
117
|
+
return [];
|
|
118
|
+
}
|
|
119
|
+
for (const step of getArray(pipeline, "steps") ?? []) {
|
|
120
|
+
if (!isRecord(step)) {
|
|
121
|
+
continue;
|
|
122
|
+
}
|
|
123
|
+
const withParams = getRecord(step, "with");
|
|
124
|
+
if (withParams === undefined) {
|
|
125
|
+
continue;
|
|
126
|
+
}
|
|
127
|
+
for (const value of Object.values(withParams)) {
|
|
128
|
+
const strings = typeof value === "string" ? [value] : Array.isArray(value) ? value : [];
|
|
129
|
+
for (const item of strings) {
|
|
130
|
+
if (typeof item !== "string") {
|
|
131
|
+
continue;
|
|
132
|
+
}
|
|
133
|
+
for (const match of item.matchAll(MUSTACHE_VALUE)) {
|
|
134
|
+
if (match.index !== undefined && match.index > 0 && item[match.index - 1] === "$") {
|
|
135
|
+
continue;
|
|
136
|
+
}
|
|
137
|
+
references.add(match[1]);
|
|
138
|
+
}
|
|
139
|
+
}
|
|
68
140
|
}
|
|
69
141
|
}
|
|
70
|
-
return
|
|
142
|
+
return [...references];
|
|
71
143
|
}
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
const
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
144
|
+
/** Apply the package's reverse engine-version gate before any content is rendered. */
|
|
145
|
+
function validateMinEngineVersion(kind, id, descriptor, engineVersion, userError) {
|
|
146
|
+
const pkg = `${kind}/${id}`;
|
|
147
|
+
if (!isRecord(descriptor)) {
|
|
148
|
+
return (0, neverthrow_1.err)(userError(exports.VALIDATE_SCHEMA, `${pkg}: descriptor.json must be a JSON object`));
|
|
149
|
+
}
|
|
150
|
+
const minEngineVersion = getString(descriptor, "minEngineVersion");
|
|
151
|
+
if (minEngineVersion === undefined) {
|
|
152
|
+
return (0, neverthrow_1.err)(userError(exports.VALIDATE_MIN_ENGINE_MISSING, `${pkg}: descriptor.json must declare minEngineVersion (the reverse compatibility signal)`));
|
|
153
|
+
}
|
|
154
|
+
const validMinimum = validateEngineVersion(pkg, "minEngineVersion", minEngineVersion, userError);
|
|
155
|
+
if (validMinimum.isErr()) {
|
|
156
|
+
return (0, neverthrow_1.err)(validMinimum.error);
|
|
157
|
+
}
|
|
158
|
+
const validEngine = validateEngineVersion(pkg, "engineVersion", engineVersion, userError);
|
|
159
|
+
if (validEngine.isErr()) {
|
|
160
|
+
return (0, neverthrow_1.err)(validEngine.error);
|
|
161
|
+
}
|
|
162
|
+
if (semver_1.default.lt(engineVersion, minEngineVersion)) {
|
|
163
|
+
return (0, neverthrow_1.err)(userError(exports.VALIDATE_ENGINE_TOO_OLD, `${pkg}: requires engine ${minEngineVersion}, but this engine is ${engineVersion}; upgrade the engine (no silent fallback)`));
|
|
164
|
+
}
|
|
165
|
+
return (0, neverthrow_1.ok)(minEngineVersion);
|
|
80
166
|
}
|
|
81
167
|
/** Validate one `<kind>/<id>` package before any content is rendered. */
|
|
82
168
|
function validateTemplatePackage(kind, id, mode, port) {
|
|
83
169
|
const pkg = `${kind}/${id}`;
|
|
170
|
+
const userError = (name, message) => port.userError(name, message);
|
|
84
171
|
// descriptor / questions / pipeline are required; `content/` is optional.
|
|
85
172
|
const descriptor = port.descriptor();
|
|
86
173
|
const questions = port.questions();
|
|
@@ -107,10 +194,37 @@ function validateTemplatePackage(kind, id, mode, port) {
|
|
|
107
194
|
if (qSchemaErr !== undefined) {
|
|
108
195
|
return (0, neverthrow_1.err)(userError(exports.VALIDATE_SCHEMA, `${pkg}: questions.json failed schema validation: ${qSchemaErr}`));
|
|
109
196
|
}
|
|
197
|
+
const pSchemaErr = port.schemas.pipeline(pipeline);
|
|
198
|
+
if (pSchemaErr !== undefined) {
|
|
199
|
+
return (0, neverthrow_1.err)(userError(exports.VALIDATE_SCHEMA, `${pkg}: pipeline.json failed schema validation: ${pSchemaErr}`));
|
|
200
|
+
}
|
|
110
201
|
const sSchemaErr = port.schemas.selector(selectorData);
|
|
111
202
|
if (sSchemaErr !== undefined) {
|
|
112
203
|
return (0, neverthrow_1.err)(userError(exports.VALIDATE_SCHEMA, `${pkg}: selector.json failed schema validation: ${sSchemaErr}`));
|
|
113
204
|
}
|
|
205
|
+
const minEngineVersion = getString(descriptor, "minEngineVersion");
|
|
206
|
+
if (minEngineVersion === undefined) {
|
|
207
|
+
return (0, neverthrow_1.err)(userError(exports.VALIDATE_MIN_ENGINE_MISSING, `${pkg}: descriptor.json must declare minEngineVersion (the reverse compatibility signal)`));
|
|
208
|
+
}
|
|
209
|
+
const validMinimum = validateEngineVersion(pkg, "minEngineVersion", minEngineVersion, userError);
|
|
210
|
+
if (validMinimum.isErr()) {
|
|
211
|
+
return (0, neverthrow_1.err)(validMinimum.error);
|
|
212
|
+
}
|
|
213
|
+
const derivedVars = [];
|
|
214
|
+
for (const reference of capabilityReferences(questions, pipeline)) {
|
|
215
|
+
const floor = port.capabilityFloor(reference.kind, reference.id);
|
|
216
|
+
if (floor === undefined) {
|
|
217
|
+
return (0, neverthrow_1.err)(userError(exports.VALIDATE_UNKNOWN_CAPABILITY, `${pkg}: ${reference.kind} '${reference.id}' is not a registered template capability`));
|
|
218
|
+
}
|
|
219
|
+
if (semver_1.default.lt(minEngineVersion, floor)) {
|
|
220
|
+
return (0, neverthrow_1.err)(userError(exports.VALIDATE_CAPABILITY_FLOOR, `${pkg}: ${reference.kind} '${reference.id}' requires minEngineVersion ${floor}, but descriptor.json declares ${minEngineVersion}`));
|
|
221
|
+
}
|
|
222
|
+
if (reference.kind === "provider") {
|
|
223
|
+
for (const output of port.capabilityOutputs(reference.kind, reference.id)) {
|
|
224
|
+
derivedVars.push(`derived.${reference.id}.${output}`);
|
|
225
|
+
}
|
|
226
|
+
}
|
|
227
|
+
}
|
|
114
228
|
// Placeholder closure: every token has a producer, and every required var is consumed.
|
|
115
229
|
const replaceMapVars = [];
|
|
116
230
|
const requiredVars = [];
|
|
@@ -145,9 +259,20 @@ function validateTemplatePackage(kind, id, mode, port) {
|
|
|
145
259
|
}
|
|
146
260
|
}
|
|
147
261
|
}
|
|
148
|
-
const mayReference = new Set([
|
|
262
|
+
const mayReference = new Set([
|
|
263
|
+
...replaceMapVars,
|
|
264
|
+
...answerVars,
|
|
265
|
+
...derivedVars,
|
|
266
|
+
...port.callerFloor(),
|
|
267
|
+
]);
|
|
149
268
|
const contentFiles = port.content() ?? [];
|
|
150
269
|
const contentTokens = new Set();
|
|
270
|
+
for (const token of pipelinePlaceholderReferences(pipeline)) {
|
|
271
|
+
contentTokens.add(token);
|
|
272
|
+
if (!mayReference.has(token)) {
|
|
273
|
+
return (0, neverthrow_1.err)(userError(exports.VALIDATE_PLACEHOLDER_DRIFT, `${pkg}: pipeline.json references '{{${token}}}', which no replaceMap entry, question, or caller-injected identifier produces`));
|
|
274
|
+
}
|
|
275
|
+
}
|
|
151
276
|
for (const file of contentFiles) {
|
|
152
277
|
for (const token of file.placeholders) {
|
|
153
278
|
contentTokens.add(token);
|
|
@@ -158,7 +283,7 @@ function validateTemplatePackage(kind, id, mode, port) {
|
|
|
158
283
|
}
|
|
159
284
|
for (const v of requiredVars) {
|
|
160
285
|
if (!contentTokens.has(v)) {
|
|
161
|
-
return (0, neverthrow_1.err)(userError(exports.VALIDATE_PLACEHOLDER_DRIFT, `${pkg}: emits required render var '${v}' that no
|
|
286
|
+
return (0, neverthrow_1.err)(userError(exports.VALIDATE_PLACEHOLDER_DRIFT, `${pkg}: emits required render var '${v}' that no render surface consumes`));
|
|
162
287
|
}
|
|
163
288
|
}
|
|
164
289
|
// Every v4 route must resolve to a present descriptor; kinds stay disjoint.
|
|
@@ -177,13 +302,12 @@ function validateTemplatePackage(kind, id, mode, port) {
|
|
|
177
302
|
}
|
|
178
303
|
}
|
|
179
304
|
// The reverse gate is explicit.
|
|
180
|
-
const
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
return (0, neverthrow_1.err)(userError(exports.VALIDATE_ENGINE_TOO_OLD, `${pkg}: requires engine ${minEngineVersion}, but this engine is ${port.engineVersion()}; upgrade the engine (no silent fallback)`));
|
|
305
|
+
const minEngineResult = mode === "load"
|
|
306
|
+
? validateMinEngineVersion(kind, id, descriptor, port.engineVersion(), userError)
|
|
307
|
+
: (0, neverthrow_1.ok)(minEngineVersion);
|
|
308
|
+
if (minEngineResult.isErr()) {
|
|
309
|
+
return (0, neverthrow_1.err)(minEngineResult.error);
|
|
186
310
|
}
|
|
187
|
-
return (0, neverthrow_1.ok)({ descriptor, minEngineVersion, contentFiles });
|
|
311
|
+
return (0, neverthrow_1.ok)({ descriptor, minEngineVersion: minEngineResult.value, contentFiles });
|
|
188
312
|
}
|
|
189
313
|
//# sourceMappingURL=validateTemplatePackage.js.map
|