@microsoft/teamsfx-core 3.1.3 → 3.1.4-alpha.17203f2e50.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/devPortalClient.d.ts +43 -0
- package/build/client/devPortalClient.d.ts.map +1 -0
- package/build/client/devPortalClient.js +626 -0
- package/build/client/devPortalClient.js.map +1 -0
- package/build/client/graphClient.d.ts +1 -0
- package/build/client/graphClient.d.ts.map +1 -1
- package/build/client/graphClient.js +17 -2
- package/build/client/graphClient.js.map +1 -1
- package/build/client/teamsDevPortalClient.d.ts +14 -21
- package/build/client/teamsDevPortalClient.d.ts.map +1 -1
- package/build/client/teamsDevPortalClient.js +65 -112
- package/build/client/teamsDevPortalClient.js.map +1 -1
- package/build/client/teamsDevPortalClientProvider.d.ts +6 -0
- package/build/client/teamsDevPortalClientProvider.d.ts.map +1 -0
- package/build/client/teamsDevPortalClientProvider.js +76 -0
- package/build/client/teamsDevPortalClientProvider.js.map +1 -0
- package/build/common/featureFlags.d.ts +7 -2
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +8 -3
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/localizeUtils.d.ts +1 -0
- package/build/common/localizeUtils.d.ts.map +1 -1
- package/build/common/localizeUtils.js +10 -0
- package/build/common/localizeUtils.js.map +1 -1
- package/build/common/templates-config.json +4 -4
- package/build/common/tools.js +2 -2
- package/build/common/tools.js.map +1 -1
- package/build/common/utils.d.ts.map +1 -1
- package/build/common/utils.js +1 -0
- package/build/common/utils.js.map +1 -1
- package/build/common/wrappedAxiosClient.d.ts.map +1 -1
- package/build/common/wrappedAxiosClient.js +87 -27
- package/build/common/wrappedAxiosClient.js.map +1 -1
- package/build/component/configManager/actionInjector.d.ts +13 -3
- package/build/component/configManager/actionInjector.d.ts.map +1 -1
- package/build/component/configManager/actionInjector.js +88 -5
- package/build/component/configManager/actionInjector.js.map +1 -1
- package/build/component/driver/interface/commonArgs.d.ts +1 -0
- package/build/component/driver/interface/commonArgs.d.ts.map +1 -1
- package/build/component/driver/teamsApp/appStudio.d.ts.map +1 -1
- package/build/component/driver/teamsApp/appStudio.js +10 -6
- package/build/component/driver/teamsApp/appStudio.js.map +1 -1
- package/build/component/driver/teamsApp/configure.d.ts.map +1 -1
- package/build/component/driver/teamsApp/configure.js +12 -8
- package/build/component/driver/teamsApp/configure.js.map +1 -1
- package/build/component/driver/teamsApp/constants.d.ts +1 -0
- package/build/component/driver/teamsApp/constants.d.ts.map +1 -1
- package/build/component/driver/teamsApp/constants.js +1 -0
- package/build/component/driver/teamsApp/constants.js.map +1 -1
- package/build/component/driver/teamsApp/create.d.ts.map +1 -1
- package/build/component/driver/teamsApp/create.js +28 -26
- package/build/component/driver/teamsApp/create.js.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/interfaces/appdefinitions/appUser.d.ts +1 -0
- package/build/component/driver/teamsApp/interfaces/appdefinitions/appUser.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/telemetry.d.ts +0 -1
- package/build/component/driver/teamsApp/utils/telemetry.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/telemetry.js +0 -1
- package/build/component/driver/teamsApp/utils/telemetry.js.map +1 -1
- package/build/component/driver/teamsApp/utils/utils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/utils.js +1 -18
- package/build/component/driver/teamsApp/utils/utils.js.map +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.js +3 -3
- package/build/component/driver/teamsApp/validateAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/validateTestCases.js +4 -4
- package/build/component/driver/teamsApp/validateTestCases.js.map +1 -1
- package/build/component/driver/util/utils.d.ts.map +1 -1
- package/build/component/driver/util/utils.js +1 -0
- package/build/component/driver/util/utils.js.map +1 -1
- package/build/component/feature/collaboration.js +4 -4
- package/build/component/feature/collaboration.js.map +1 -1
- package/build/component/generator/openApiSpec/helper.d.ts +2 -2
- package/build/component/generator/openApiSpec/helper.d.ts.map +1 -1
- package/build/component/generator/openApiSpec/helper.js +65 -5
- package/build/component/generator/openApiSpec/helper.js.map +1 -1
- package/build/component/generator/openPlugin/authResolver.d.ts +2 -2
- package/build/component/generator/openPlugin/authResolver.d.ts.map +1 -1
- package/build/component/generator/openPlugin/authResolver.js +17 -7
- package/build/component/generator/openPlugin/authResolver.js.map +1 -1
- package/build/component/generator/openPlugin/errors.d.ts +4 -0
- package/build/component/generator/openPlugin/errors.d.ts.map +1 -0
- package/build/component/generator/openPlugin/errors.js +13 -0
- package/build/component/generator/openPlugin/errors.js.map +1 -0
- package/build/component/generator/openPlugin/exporter.d.ts +9 -6
- package/build/component/generator/openPlugin/exporter.d.ts.map +1 -1
- package/build/component/generator/openPlugin/exporter.js +502 -53
- package/build/component/generator/openPlugin/exporter.js.map +1 -1
- package/build/component/generator/openPlugin/fileSystem.d.ts +28 -0
- package/build/component/generator/openPlugin/fileSystem.d.ts.map +1 -0
- package/build/component/generator/openPlugin/fileSystem.js +181 -0
- package/build/component/generator/openPlugin/fileSystem.js.map +1 -0
- package/build/component/generator/openPlugin/iconStrategy.d.ts.map +1 -1
- package/build/component/generator/openPlugin/iconStrategy.js +30 -14
- package/build/component/generator/openPlugin/iconStrategy.js.map +1 -1
- package/build/component/generator/openPlugin/importer.d.ts.map +1 -1
- package/build/component/generator/openPlugin/importer.js +75 -12
- package/build/component/generator/openPlugin/importer.js.map +1 -1
- package/build/component/generator/openPlugin/mapper.d.ts +3 -2
- package/build/component/generator/openPlugin/mapper.d.ts.map +1 -1
- package/build/component/generator/openPlugin/mapper.js +188 -29
- package/build/component/generator/openPlugin/mapper.js.map +1 -1
- package/build/component/generator/openPlugin/parser.d.ts.map +1 -1
- package/build/component/generator/openPlugin/parser.js +264 -70
- package/build/component/generator/openPlugin/parser.js.map +1 -1
- package/build/component/generator/openPlugin/skillValidation.d.ts +2 -0
- package/build/component/generator/openPlugin/skillValidation.d.ts.map +1 -0
- package/build/component/generator/openPlugin/skillValidation.js +63 -0
- package/build/component/generator/openPlugin/skillValidation.js.map +1 -0
- package/build/component/generator/openPlugin/spec.d.ts +67 -0
- package/build/component/generator/openPlugin/spec.d.ts.map +1 -0
- package/build/component/generator/openPlugin/spec.js +157 -0
- package/build/component/generator/openPlugin/spec.js.map +1 -0
- package/build/component/generator/openPlugin/textUtils.d.ts +1 -1
- package/build/component/generator/openPlugin/textUtils.d.ts.map +1 -1
- package/build/component/generator/openPlugin/textUtils.js +8 -7
- package/build/component/generator/openPlugin/textUtils.js.map +1 -1
- package/build/component/generator/openPlugin/types.d.ts +76 -14
- package/build/component/generator/openPlugin/types.d.ts.map +1 -1
- package/build/component/generator/openPlugin/validation.d.ts +17 -0
- package/build/component/generator/openPlugin/validation.d.ts.map +1 -0
- package/build/component/generator/openPlugin/validation.js +563 -0
- package/build/component/generator/openPlugin/validation.js.map +1 -0
- package/build/component/generator/v4TemplateBridge.d.ts +1 -1
- package/build/component/generator/v4TemplateBridge.d.ts.map +1 -1
- package/build/component/generator/v4TemplateBridge.js +11 -6
- package/build/component/generator/v4TemplateBridge.js.map +1 -1
- package/build/component/middleware/questionMW.d.ts.map +1 -1
- package/build/component/middleware/questionMW.js +2 -0
- package/build/component/middleware/questionMW.js.map +1 -1
- package/build/component/resource/botService/botRegistration/botFrameworkRegistration.js +4 -4
- package/build/component/resource/botService/botRegistration/botFrameworkRegistration.js.map +1 -1
- package/build/component/utils/common.d.ts +1 -9
- package/build/component/utils/common.d.ts.map +1 -1
- package/build/component/utils/common.js +7 -37
- package/build/component/utils/common.js.map +1 -1
- package/build/component/utils/envFunctionUtils.d.ts +3 -8
- package/build/component/utils/envFunctionUtils.d.ts.map +1 -1
- package/build/component/utils/envFunctionUtils.js +46 -131
- package/build/component/utils/envFunctionUtils.js.map +1 -1
- package/build/component/utils/envUtil.d.ts +1 -1
- package/build/component/utils/envUtil.d.ts.map +1 -1
- package/build/component/utils/envUtil.js +17 -8
- package/build/component/utils/envUtil.js.map +1 -1
- package/build/component/utils/mcpAuthScaffolder.d.ts +6 -0
- package/build/component/utils/mcpAuthScaffolder.d.ts.map +1 -1
- package/build/component/utils/mcpAuthScaffolder.js +17 -7
- package/build/component/utils/mcpAuthScaffolder.js.map +1 -1
- package/build/component/utils/pathUtils.d.ts +4 -4
- package/build/component/utils/pathUtils.d.ts.map +1 -1
- package/build/component/utils/pathUtils.js +17 -8
- package/build/component/utils/pathUtils.js.map +1 -1
- package/build/component/utils/settingsUtil.d.ts +1 -1
- package/build/component/utils/settingsUtil.d.ts.map +1 -1
- package/build/component/utils/settingsUtil.js +3 -3
- package/build/component/utils/settingsUtil.js.map +1 -1
- package/build/core/FxCore.d.ts +3 -2
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.declarativeAgent.d.ts +8 -2
- package/build/core/FxCore.declarativeAgent.d.ts.map +1 -1
- package/build/core/FxCore.declarativeAgent.js +109 -6
- package/build/core/FxCore.declarativeAgent.js.map +1 -1
- package/build/core/FxCore.js +49 -9
- package/build/core/FxCore.js.map +1 -1
- package/build/core/FxCore.openPlugin.d.ts +7 -6
- package/build/core/FxCore.openPlugin.d.ts.map +1 -1
- package/build/core/FxCore.openPlugin.js +7 -6
- package/build/core/FxCore.openPlugin.js.map +1 -1
- package/build/error/common.d.ts +9 -0
- package/build/error/common.d.ts.map +1 -1
- package/build/error/common.js +40 -1
- package/build/error/common.js.map +1 -1
- package/build/index.d.ts +2 -2
- package/build/index.d.ts.map +1 -1
- package/build/index.js +6 -5
- package/build/index.js.map +1 -1
- package/build/question/generator.d.ts.map +1 -1
- package/build/question/generator.js +9 -9
- package/build/question/generator.js.map +1 -1
- package/build/question/inputs/AddAuthActionInputs.d.ts +6 -0
- package/build/question/inputs/AddAuthActionInputs.d.ts.map +1 -1
- package/build/question/inputs/AddPluginInputs.d.ts +15 -1
- package/build/question/inputs/AddPluginInputs.d.ts.map +1 -1
- package/build/question/options/AddAuthActionOptions.d.ts.map +1 -1
- package/build/question/options/AddAuthActionOptions.js +19 -0
- package/build/question/options/AddAuthActionOptions.js.map +1 -1
- package/build/question/options/AddPluginOptions.d.ts.map +1 -1
- package/build/question/options/AddPluginOptions.js +45 -1
- package/build/question/options/AddPluginOptions.js.map +1 -1
- package/build/question/options/ExportOpenPluginOptions.js +2 -2
- package/build/question/options/ExportOpenPluginOptions.js.map +1 -1
- package/build/question/options/ImportOpenPluginOptions.js +4 -4
- package/build/question/options/ImportOpenPluginOptions.js.map +1 -1
- package/build/question/other.d.ts +2 -0
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +174 -8
- package/build/question/other.js.map +1 -1
- package/build/question/questionNames.d.ts +6 -0
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +6 -0
- package/build/question/questionNames.js.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.d.ts.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.js +5 -2
- package/build/question/scaffold/vsc/CapabilityOptions.js.map +1 -1
- package/build/question/scaffold/vsc/rootNode.js +1 -1
- package/build/question/scaffold/vsc/rootNode.js.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts +2 -0
- package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js +31 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js.map +1 -1
- package/build/question/share.js +2 -2
- package/build/question/share.js.map +1 -1
- package/build/ui/visitor.d.ts.map +1 -1
- package/build/ui/visitor.js +1 -0
- package/build/ui/visitor.js.map +1 -1
- package/build/v4/capabilities/declarations.d.ts +140 -0
- package/build/v4/capabilities/declarations.d.ts.map +1 -0
- package/build/v4/capabilities/declarations.js +59 -0
- package/build/v4/capabilities/declarations.js.map +1 -0
- package/build/v4/collectInputs/collectInputs.d.ts +1 -0
- package/build/v4/collectInputs/collectInputs.d.ts.map +1 -1
- package/build/v4/collectInputs/collectInputs.js +113 -222
- package/build/v4/collectInputs/collectInputs.js.map +1 -1
- package/build/v4/distribution/declarativePackage.d.ts +2 -2
- package/build/v4/distribution/declarativePackage.d.ts.map +1 -1
- package/build/v4/distribution/declarativePackage.js +2 -1
- package/build/v4/distribution/declarativePackage.js.map +1 -1
- package/build/v4/distribution/descriptorLanguages.d.ts +9 -0
- package/build/v4/distribution/descriptorLanguages.d.ts.map +1 -0
- package/build/v4/distribution/descriptorLanguages.js +44 -0
- package/build/v4/distribution/descriptorLanguages.js.map +1 -0
- package/build/v4/distribution/packageDir.d.ts +6 -1
- package/build/v4/distribution/packageDir.d.ts.map +1 -1
- package/build/v4/distribution/packageDir.js +6 -1
- package/build/v4/distribution/packageDir.js.map +1 -1
- package/build/v4/engineVersion.d.ts +1 -1
- package/build/v4/engineVersion.js +1 -1
- package/build/v4/expression/evaluateExpression.d.ts.map +1 -1
- package/build/v4/expression/evaluateExpression.js +15 -13
- package/build/v4/expression/evaluateExpression.js.map +1 -1
- package/build/v4/mcp/mcpAuthAction.d.ts +2 -1
- package/build/v4/mcp/mcpAuthAction.d.ts.map +1 -1
- package/build/v4/mcp/mcpAuthAction.js +32 -5
- package/build/v4/mcp/mcpAuthAction.js.map +1 -1
- package/build/v4/mcp/mcpAuthScaffold.d.ts +3 -0
- package/build/v4/mcp/mcpAuthScaffold.d.ts.map +1 -1
- package/build/v4/mcp/mcpAuthScaffold.js +63 -40
- package/build/v4/mcp/mcpAuthScaffold.js.map +1 -1
- package/build/v4/pipeline/defineStep.d.ts +10 -0
- package/build/v4/pipeline/defineStep.d.ts.map +1 -0
- package/build/v4/pipeline/defineStep.js +28 -0
- package/build/v4/pipeline/defineStep.js.map +1 -0
- package/build/v4/pipeline/runScaffoldPipeline.d.ts +3 -7
- package/build/v4/pipeline/runScaffoldPipeline.d.ts.map +1 -1
- package/build/v4/pipeline/runScaffoldPipeline.js +26 -16
- package/build/v4/pipeline/runScaffoldPipeline.js.map +1 -1
- package/build/v4/pipeline/stepParams.d.ts +4 -0
- package/build/v4/pipeline/stepParams.d.ts.map +1 -0
- package/build/v4/pipeline/stepParams.js +17 -0
- package/build/v4/pipeline/stepParams.js.map +1 -0
- package/build/v4/providers/createLanguageOptionsProvider.d.ts +13 -0
- package/build/v4/providers/createLanguageOptionsProvider.d.ts.map +1 -0
- package/build/v4/providers/createLanguageOptionsProvider.js +61 -0
- package/build/v4/providers/createLanguageOptionsProvider.js.map +1 -0
- package/build/v4/providers/createOptionsProviders.d.ts +3 -1
- package/build/v4/providers/createOptionsProviders.d.ts.map +1 -1
- package/build/v4/providers/createOptionsProviders.js +67 -61
- package/build/v4/providers/createOptionsProviders.js.map +1 -1
- package/build/v4/runtime/compatibility/index.d.ts +4 -0
- package/build/v4/runtime/compatibility/index.d.ts.map +1 -0
- package/build/v4/runtime/compatibility/index.js +11 -0
- package/build/v4/runtime/compatibility/index.js.map +1 -0
- package/build/v4/runtime/compatibility/legacyOpenApiSearch.d.ts +4 -0
- package/build/v4/runtime/compatibility/legacyOpenApiSearch.d.ts.map +1 -0
- package/build/v4/runtime/compatibility/legacyOpenApiSearch.js +26 -0
- package/build/v4/runtime/compatibility/legacyOpenApiSearch.js.map +1 -0
- package/build/v4/runtime/functions/assets/officeAddin.json +48 -0
- package/build/v4/runtime/functions/generic.d.ts +10 -0
- package/build/v4/runtime/functions/generic.d.ts.map +1 -0
- package/build/v4/runtime/functions/generic.js +25 -0
- package/build/v4/runtime/functions/generic.js.map +1 -0
- package/build/v4/runtime/functions/mcp.d.ts +8 -0
- package/build/v4/runtime/functions/mcp.d.ts.map +1 -0
- package/build/v4/runtime/functions/mcp.js +28 -0
- package/build/v4/runtime/functions/mcp.js.map +1 -0
- package/build/v4/runtime/functions/officeAddin.d.ts +27 -0
- package/build/v4/runtime/functions/officeAddin.d.ts.map +1 -0
- package/build/v4/runtime/functions/officeAddin.js +120 -0
- package/build/v4/runtime/functions/officeAddin.js.map +1 -0
- package/build/v4/runtime/inMemoryRuntime.d.ts.map +1 -1
- package/build/v4/runtime/inMemoryRuntime.js +7 -0
- package/build/v4/runtime/inMemoryRuntime.js.map +1 -1
- package/build/v4/runtime/packageParse.d.ts +13 -8
- package/build/v4/runtime/packageParse.d.ts.map +1 -1
- package/build/v4/runtime/packageParse.js +13 -219
- package/build/v4/runtime/packageParse.js.map +1 -1
- package/build/v4/runtime/realRuntime.d.ts.map +1 -1
- package/build/v4/runtime/realRuntime.js +44 -5
- package/build/v4/runtime/realRuntime.js.map +1 -1
- package/build/v4/runtime/renderFragment.d.ts +2 -0
- package/build/v4/runtime/renderFragment.d.ts.map +1 -0
- package/build/v4/runtime/renderFragment.js +11 -0
- package/build/v4/runtime/renderFragment.js.map +1 -0
- package/build/v4/runtime/runtimeRegistry.d.ts +4 -4
- package/build/v4/runtime/runtimeRegistry.d.ts.map +1 -1
- package/build/v4/runtime/runtimeRegistry.js +9 -106
- package/build/v4/runtime/runtimeRegistry.js.map +1 -1
- package/build/v4/runtime/scaffold.d.ts +2 -0
- package/build/v4/runtime/scaffold.d.ts.map +1 -1
- package/build/v4/runtime/scaffold.js +15 -12
- package/build/v4/runtime/scaffold.js.map +1 -1
- package/build/v4/runtime/scaffoldFromPackageDir.d.ts.map +1 -1
- package/build/v4/runtime/scaffoldFromPackageDir.js +1 -4
- package/build/v4/runtime/scaffoldFromPackageDir.js.map +1 -1
- package/build/v4/runtime/selectLanguageContent.d.ts +1 -0
- package/build/v4/runtime/selectLanguageContent.d.ts.map +1 -1
- package/build/v4/runtime/selectLanguageContent.js +5 -1
- package/build/v4/runtime/selectLanguageContent.js.map +1 -1
- package/build/v4/runtime/services/daManifestService.d.ts +9 -0
- package/build/v4/runtime/services/daManifestService.d.ts.map +1 -0
- package/build/v4/runtime/services/daManifestService.js +102 -0
- package/build/v4/runtime/services/daManifestService.js.map +1 -0
- package/build/v4/runtime/steps/assets/metaOs.json +197 -0
- package/build/v4/runtime/steps/assets/openApiAuth.json +33 -0
- package/build/v4/runtime/steps/assets/openApiCustomApi.json +141 -0
- package/build/v4/runtime/steps/daAction.d.ts +3 -1
- package/build/v4/runtime/steps/daAction.d.ts.map +1 -1
- package/build/v4/runtime/steps/daAction.js +25 -25
- package/build/v4/runtime/steps/daAction.js.map +1 -1
- package/build/v4/runtime/steps/daSensitivity.d.ts +3 -2
- package/build/v4/runtime/steps/daSensitivity.d.ts.map +1 -1
- package/build/v4/runtime/steps/daSensitivity.js +16 -16
- package/build/v4/runtime/steps/daSensitivity.js.map +1 -1
- package/build/v4/runtime/steps/mcpAuth.d.ts +2 -2
- package/build/v4/runtime/steps/mcpAuth.d.ts.map +1 -1
- package/build/v4/runtime/steps/mcpAuth.js +43 -50
- package/build/v4/runtime/steps/mcpAuth.js.map +1 -1
- package/build/v4/runtime/steps/mcpLocal.d.ts +1 -1
- package/build/v4/runtime/steps/mcpLocal.d.ts.map +1 -1
- package/build/v4/runtime/steps/mcpLocal.js +19 -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 +33 -39
- package/build/v4/runtime/steps/mcpStatic.js.map +1 -1
- package/build/v4/runtime/steps/metaOs.d.ts +2 -2
- package/build/v4/runtime/steps/metaOs.d.ts.map +1 -1
- package/build/v4/runtime/steps/metaOs.js +46 -169
- package/build/v4/runtime/steps/metaOs.js.map +1 -1
- package/build/v4/runtime/steps/officeAddin.d.ts +1 -1
- package/build/v4/runtime/steps/officeAddin.d.ts.map +1 -1
- package/build/v4/runtime/steps/officeAddin.js +16 -20
- package/build/v4/runtime/steps/officeAddin.js.map +1 -1
- package/build/v4/runtime/steps/openApi.d.ts +2 -2
- package/build/v4/runtime/steps/openApi.d.ts.map +1 -1
- package/build/v4/runtime/steps/openApi.js +46 -112
- package/build/v4/runtime/steps/openApi.js.map +1 -1
- package/build/v4/runtime/steps/openApiAuth.d.ts +9 -0
- package/build/v4/runtime/steps/openApiAuth.d.ts.map +1 -0
- package/build/v4/runtime/steps/openApiAuth.js +51 -0
- package/build/v4/runtime/steps/openApiAuth.js.map +1 -0
- package/build/v4/runtime/steps/openApiCustomApi.d.ts.map +1 -1
- package/build/v4/runtime/steps/openApiCustomApi.js +9 -119
- package/build/v4/runtime/steps/openApiCustomApi.js.map +1 -1
- package/build/v4/runtime/whitelist.d.ts +4 -38
- package/build/v4/runtime/whitelist.d.ts.map +1 -1
- package/build/v4/runtime/whitelist.js +30 -190
- package/build/v4/runtime/whitelist.js.map +1 -1
- package/build/v4/surface/createFloorTail.d.ts +2 -2
- package/build/v4/surface/createFloorTail.d.ts.map +1 -1
- package/build/v4/surface/createFloorTail.js +5 -22
- package/build/v4/surface/createFloorTail.js.map +1 -1
- package/build/v4/surface/createInputs.d.ts +2 -2
- package/build/v4/surface/createInputs.d.ts.map +1 -1
- package/build/v4/surface/createInputs.js +17 -44
- package/build/v4/surface/createInputs.js.map +1 -1
- package/build/v4/surface/createSelectorWalk.d.ts.map +1 -1
- package/build/v4/surface/createSelectorWalk.js +2 -56
- package/build/v4/surface/createSelectorWalk.js.map +1 -1
- package/build/v4/surface/localizePrompt.d.ts +2 -0
- package/build/v4/surface/localizePrompt.d.ts.map +1 -1
- package/build/v4/surface/localizePrompt.js +0 -1
- package/build/v4/surface/localizePrompt.js.map +1 -1
- package/build/v4/surface/modifySelectorWalk.d.ts.map +1 -1
- package/build/v4/surface/modifySelectorWalk.js +2 -52
- package/build/v4/surface/modifySelectorWalk.js.map +1 -1
- package/build/v4/surface/selectorPresentation.d.ts +5 -0
- package/build/v4/surface/selectorPresentation.d.ts.map +1 -0
- package/build/v4/surface/selectorPresentation.js +78 -0
- package/build/v4/surface/selectorPresentation.js.map +1 -0
- package/build/v4/validation/capabilityCatalog.d.ts +2 -2
- package/build/v4/validation/capabilityCatalog.d.ts.map +1 -1
- package/build/v4/validation/capabilityCatalog.js +9 -46
- package/build/v4/validation/capabilityCatalog.js.map +1 -1
- package/build/v4/validation/packageParse.d.ts +27 -0
- package/build/v4/validation/packageParse.d.ts.map +1 -0
- package/build/v4/validation/packageParse.js +247 -0
- package/build/v4/validation/packageParse.js.map +1 -0
- package/build/v4/validation/templateArchiveValidation.d.ts +2 -2
- package/build/v4/validation/templateArchiveValidation.d.ts.map +1 -1
- package/build/v4/validation/templateArchiveValidation.js +7 -2
- package/build/v4/validation/templateArchiveValidation.js.map +1 -1
- package/build/v4/validation/validateTemplatePackage.d.ts +3 -2
- package/build/v4/validation/validateTemplatePackage.d.ts.map +1 -1
- package/build/v4/validation/validateTemplatePackage.js +23 -3
- package/build/v4/validation/validateTemplatePackage.js.map +1 -1
- package/build/v4/validators/createInputValidators.d.ts.map +1 -1
- package/build/v4/validators/createInputValidators.js +9 -8
- package/build/v4/validators/createInputValidators.js.map +1 -1
- package/package.json +37 -37
- package/resource/package.nls.json +35 -1
- 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.zip +0 -0
- package/templates/ui/tdpNode.json +1 -1
- package/templates/ui/wizardNode.json +1 -1
- package/templates/v4/create-selector.json +2 -2
- package/templates/v4/floor.json +1 -1
- package/templates/v4/templates-metadata.zip +0 -0
- package/templates/v4/templates.zip +0 -0
|
@@ -3,32 +3,35 @@
|
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.scaffold = scaffold;
|
|
6
|
+
exports.scaffoldPrepared = scaffoldPrepared;
|
|
6
7
|
const neverthrow_1 = require("neverthrow");
|
|
7
8
|
const buildRenderContext_1 = require("../renderContext/buildRenderContext");
|
|
8
9
|
const runScaffoldPipeline_1 = require("../pipeline/runScaffoldPipeline");
|
|
9
10
|
const packageParse_1 = require("./packageParse");
|
|
10
11
|
const selectLanguageContent_1 = require("./selectLanguageContent");
|
|
12
|
+
const compatibility_1 = require("./compatibility");
|
|
11
13
|
/** Scaffold one template package against an injected runtime. */
|
|
12
14
|
async function scaffold(request, runtime) {
|
|
13
|
-
const
|
|
14
|
-
if (
|
|
15
|
-
return (0, neverthrow_1.err)(
|
|
16
|
-
}
|
|
17
|
-
const pipeline = (0, packageParse_1.parsePipeline)(request.pipeline);
|
|
18
|
-
if (pipeline.isErr()) {
|
|
19
|
-
return (0, neverthrow_1.err)(pipeline.error);
|
|
15
|
+
const template = (0, packageParse_1.prepareTemplate)(request);
|
|
16
|
+
if (template.isErr()) {
|
|
17
|
+
return (0, neverthrow_1.err)(template.error);
|
|
20
18
|
}
|
|
19
|
+
return scaffoldPrepared(template.value, request, runtime);
|
|
20
|
+
}
|
|
21
|
+
async function scaffoldPrepared(template, request, runtime) {
|
|
21
22
|
// Declared option ids let skipped answers render as empty instead of undeclared.
|
|
22
|
-
const
|
|
23
|
-
const baseVars = (0, buildRenderContext_1.buildRenderContext)(replaceMap.value, request.answers, request.callerFloor, runtime.exprPort, declaredKeys);
|
|
23
|
+
const baseVars = (0, buildRenderContext_1.buildRenderContext)(template.descriptor.replaceMap, request.answers, request.callerFloor, runtime.exprPort, template.descriptor.declaredKeys);
|
|
24
24
|
if (baseVars.isErr()) {
|
|
25
25
|
return (0, neverthrow_1.err)(baseVars.error);
|
|
26
26
|
}
|
|
27
27
|
// Overlay caller floor last so render can resolve floor tokens such as `{{appName}}`.
|
|
28
|
-
const renderVars = {
|
|
28
|
+
const renderVars = {
|
|
29
|
+
...(0, compatibility_1.applyLegacyRenderBindings)(template.descriptor, template.pipeline, baseVars.value),
|
|
30
|
+
...request.callerFloor,
|
|
31
|
+
};
|
|
29
32
|
// Select the active language subtree before render.
|
|
30
33
|
const language = request.callerFloor.language || selectLanguageContent_1.COMMON_LANGUAGE;
|
|
31
|
-
const content = (0, selectLanguageContent_1.
|
|
32
|
-
return (0, runScaffoldPipeline_1.runScaffoldPipeline)(pipeline
|
|
34
|
+
const content = (0, selectLanguageContent_1.selectLanguageFiles)(template.descriptor.languages, template.content, language);
|
|
35
|
+
return (0, runScaffoldPipeline_1.runScaffoldPipeline)(template.pipeline, content, renderVars, request.targetDir, runtime.port);
|
|
33
36
|
}
|
|
34
37
|
//# sourceMappingURL=scaffold.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../../src/v4/runtime/scaffold.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;
|
|
1
|
+
{"version":3,"file":"scaffold.js","sourceRoot":"","sources":["../../../src/v4/runtime/scaffold.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AA4ClC,4BASC;AAED,4CAiCC;AArFD,2CAAyC;AAGzC,4EAAyE;AACzE,yEAKyC;AACzC,iDAAmE;AACnE,mEAA+E;AAC/E,mDAA4D;AA4B5D,iEAAiE;AAC1D,KAAK,UAAU,QAAQ,CAC5B,OAAwB,EACxB,OAAwB;IAExB,MAAM,QAAQ,GAAG,IAAA,8BAAe,EAAC,OAAO,CAAC,CAAC;IAC1C,IAAI,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;QACrB,OAAO,IAAA,gBAAG,EAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IACD,OAAO,gBAAgB,CAAC,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;AAC5D,CAAC;AAEM,KAAK,UAAU,gBAAgB,CACpC,QAA0B,EAC1B,OAAuE,EACvE,OAAwB;IAExB,iFAAiF;IACjF,MAAM,QAAQ,GAAG,IAAA,uCAAkB,EACjC,QAAQ,CAAC,UAAU,CAAC,UAAU,EAC9B,OAAO,CAAC,OAAO,EACf,OAAO,CAAC,WAAW,EACnB,OAAO,CAAC,QAAQ,EAChB,QAAQ,CAAC,UAA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AI,EAAE,MAAM,KAAK,OAAO,GACrC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,
|
|
1
|
+
{"version":3,"file":"scaffoldFromPackageDir.d.ts","sourceRoot":"","sources":["../../../src/v4/runtime/scaffoldFromPackageDir.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAe,MAAM,wBAAwB,CAAC;AAC9D,OAAO,EAAE,MAAM,EAAO,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,eAAe,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AAkB7E,yEAAyE;AACzE,wBAAsB,sBAAsB,CAC1C,UAAU,EAAE,MAAM,EAClB,OAAO,EAAE,OAAO,EAChB,WAAW,EAAE,WAAW,EACxB,SAAS,EAAE,SAAS,EACpB,UAAU,CAAC,EAAE,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GACrC,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAmB3C"}
|
|
@@ -27,10 +27,7 @@ async function scaffoldFromPackageDir(packageDir, answers, callerFloor, targetDi
|
|
|
27
27
|
}
|
|
28
28
|
try {
|
|
29
29
|
const runtime = (0, realRuntime_1.createRealRuntime)(targetDir.path, flagReader);
|
|
30
|
-
return await (0, scaffold_1.
|
|
31
|
-
descriptor: loaded.value.descriptor,
|
|
32
|
-
pipeline: loaded.value.pipeline,
|
|
33
|
-
content: loaded.value.content,
|
|
30
|
+
return await (0, scaffold_1.scaffoldPrepared)(loaded.value.template, {
|
|
34
31
|
answers,
|
|
35
32
|
callerFloor,
|
|
36
33
|
targetDir,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffoldFromPackageDir.js","sourceRoot":"","sources":["../../../src/v4/runtime/scaffoldFromPackageDir.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAwBlC,
|
|
1
|
+
{"version":3,"file":"scaffoldFromPackageDir.js","sourceRoot":"","sources":["../../../src/v4/runtime/scaffoldFromPackageDir.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAwBlC,wDAyBC;AA/CD,wDAA8D;AAC9D,2CAAyC;AAGzC,2DAA4D;AAC5D,+CAAkD;AAClD,yCAA8C;AAE9C,MAAM,MAAM,GAAG,UAAU,CAAC;AAE1B,SAAS,sBAAsB,CAAC,KAAc;IAC5C,IAAI,KAAK,YAAY,yBAAW,EAAE,CAAC;QACjC,OAAO,KAAK,CAAC;IACf,CAAC;IACD,OAAO,IAAI,yBAAW,CAAC;QACrB,MAAM,EAAE,MAAM;QACd,IAAI,EAAE,8BAA8B;QACpC,OAAO,EAAE,yDAAyD;KACnE,CAAC,CAAC;AACL,CAAC;AAED,yEAAyE;AAClE,KAAK,UAAU,sBAAsB,CAC1C,UAAkB,EAClB,OAAgB,EAChB,WAAwB,EACxB,SAAoB,EACpB,UAAsC;IAEtC,MAAM,MAAM,GAAG,IAAA,2BAAc,EAAC,UAAU,CAAC,CAAC;IAC1C,IAAI,MAAM,CAAC,KAAK,EAAE,EAAE,CAAC;QACnB,OAAO,IAAA,gBAAG,EAAC,MAAM,CAAC,KAAK,CAAC,CAAC;IAC3B,CAAC;IACD,IAAI,CAAC;QACH,MAAM,OAAO,GAAG,IAAA,+BAAiB,EAAC,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;QAC9D,OAAO,MAAM,IAAA,2BAAgB,EAC3B,MAAM,CAAC,KAAK,CAAC,QAAQ,EACrB;YACE,OAAO;YACP,WAAW;YACX,SAAS;SACV,EACD,OAAO,CACR,CAAC;IACJ,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,OAAO,IAAA,gBAAG,EAAC,sBAAsB,CAAC,KAAK,CAAC,CAAC,CAAC;IAC5C,CAAC;AACH,CAAC"}
|
|
@@ -4,4 +4,5 @@ import { TemplateFileEntry } from "../model/dataModel";
|
|
|
4
4
|
export declare const COMMON_LANGUAGE = "common";
|
|
5
5
|
/** Select the content subtree the render phase should consume for `language`. */
|
|
6
6
|
export declare function selectLanguageContent(descriptor: unknown, content: TemplateFileEntry[], language: string): TemplateFileEntry[];
|
|
7
|
+
export declare function selectLanguageFiles(languages: string[], content: TemplateFileEntry[], language: string): TemplateFileEntry[];
|
|
7
8
|
//# sourceMappingURL=selectLanguageContent.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectLanguageContent.d.ts","sourceRoot":"","sources":["../../../src/v4/runtime/selectLanguageContent.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,0FAA0F;AAE1F,gEAAgE;AAChE,eAAO,MAAM,eAAe,WAAW,CAAC;AAmBxC,iFAAiF;AACjF,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,OAAO,EACnB,OAAO,EAAE,iBAAiB,EAAE,EAC5B,QAAQ,EAAE,MAAM,GACf,iBAAiB,EAAE,CAcrB"}
|
|
1
|
+
{"version":3,"file":"selectLanguageContent.d.ts","sourceRoot":"","sources":["../../../src/v4/runtime/selectLanguageContent.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEvD,0FAA0F;AAE1F,gEAAgE;AAChE,eAAO,MAAM,eAAe,WAAW,CAAC;AAmBxC,iFAAiF;AACjF,wBAAgB,qBAAqB,CACnC,UAAU,EAAE,OAAO,EACnB,OAAO,EAAE,iBAAiB,EAAE,EAC5B,QAAQ,EAAE,MAAM,GACf,iBAAiB,EAAE,CAErB;AAED,wBAAgB,mBAAmB,CACjC,SAAS,EAAE,MAAM,EAAE,EACnB,OAAO,EAAE,iBAAiB,EAAE,EAC5B,QAAQ,EAAE,MAAM,GACf,iBAAiB,EAAE,CAcrB"}
|
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
5
|
exports.COMMON_LANGUAGE = void 0;
|
|
6
6
|
exports.selectLanguageContent = selectLanguageContent;
|
|
7
|
+
exports.selectLanguageFiles = selectLanguageFiles;
|
|
7
8
|
/** Select the active language subtree before render. See select-language-content spec. */
|
|
8
9
|
/** The reserved language id for language-agnostic templates. */
|
|
9
10
|
exports.COMMON_LANGUAGE = "common";
|
|
@@ -22,8 +23,11 @@ function descriptorLanguages(descriptor) {
|
|
|
22
23
|
}
|
|
23
24
|
/** Select the content subtree the render phase should consume for `language`. */
|
|
24
25
|
function selectLanguageContent(descriptor, content, language) {
|
|
26
|
+
return selectLanguageFiles(descriptorLanguages(descriptor), content, language);
|
|
27
|
+
}
|
|
28
|
+
function selectLanguageFiles(languages, content, language) {
|
|
25
29
|
// A `["common"]` package is never partitioned, regardless of the requested language.
|
|
26
|
-
if (
|
|
30
|
+
if (languages.includes(exports.COMMON_LANGUAGE)) {
|
|
27
31
|
return content;
|
|
28
32
|
}
|
|
29
33
|
// A partitioned package keeps only the selected language subtree.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"selectLanguageContent.js","sourceRoot":"","sources":["../../../src/v4/runtime/selectLanguageContent.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA2BlC,
|
|
1
|
+
{"version":3,"file":"selectLanguageContent.js","sourceRoot":"","sources":["../../../src/v4/runtime/selectLanguageContent.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AA2BlC,sDAMC;AAED,kDAkBC;AAjDD,0FAA0F;AAE1F,gEAAgE;AACnD,QAAA,eAAe,GAAG,QAAQ,CAAC;AAExC,SAAS,QAAQ,CAAC,KAAc;IAC9B,OAAO,OAAO,KAAK,KAAK,QAAQ,IAAI,KAAK,KAAK,IAAI,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;AAC9E,CAAC;AAED,2FAA2F;AAC3F,SAAS,mBA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
|
|
1
|
+
import { FxError } from "@microsoft/teamsfx-api";
|
|
2
|
+
import { Result } from "neverthrow";
|
|
3
|
+
import type { StepContext } from "../../pipeline/runScaffoldPipeline";
|
|
4
|
+
export interface DaManifestService {
|
|
5
|
+
registerDeclarativeAgentAction(io: Pick<StepContext, "read" | "write">, teamsManifestPath: string, pluginManifestPath: string): Result<void, FxError>;
|
|
6
|
+
setSensitivityLabel(io: Pick<StepContext, "read" | "write">, manifestPath: string, id: string): Result<void, FxError>;
|
|
7
|
+
}
|
|
8
|
+
export declare const daManifestService: DaManifestService;
|
|
9
|
+
//# sourceMappingURL=daManifestService.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daManifestService.d.ts","sourceRoot":"","sources":["../../../../src/v4/runtime/services/daManifestService.ts"],"names":[],"mappings":"AAGA,OAAO,EAEL,OAAO,EAGR,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAAE,MAAM,EAAW,MAAM,YAAY,CAAC;AAE7C,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oCAAoC,CAAC;AAEtE,MAAM,WAAW,iBAAiB;IAChC,8BAA8B,CAC5B,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,EACvC,iBAAiB,EAAE,MAAM,EACzB,kBAAkB,EAAE,MAAM,GACzB,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;IACzB,mBAAmB,CACjB,EAAE,EAAE,IAAI,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,EACvC,YAAY,EAAE,MAAM,EACpB,EAAE,EAAE,MAAM,GACT,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;CAC1B;AA4JD,eAAO,MAAM,iBAAiB,EAAE,iBAG/B,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.daManifestService = void 0;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
8
|
+
const neverthrow_1 = require("neverthrow");
|
|
9
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
10
|
+
function manifestError(name, message, cause) {
|
|
11
|
+
return cause instanceof Error
|
|
12
|
+
? new teamsfx_api_1.SystemError({ source: "Scaffold", name, message, error: cause })
|
|
13
|
+
: new teamsfx_api_1.SystemError({ source: "Scaffold", name, message });
|
|
14
|
+
}
|
|
15
|
+
function normalizeTargetPath(entryPath) {
|
|
16
|
+
return entryPath.replace(/\\/g, "/");
|
|
17
|
+
}
|
|
18
|
+
function resolveSiblingPath(baseFile, relativeFile) {
|
|
19
|
+
return normalizeTargetPath(path_1.default.posix.normalize(path_1.default.posix.join(path_1.default.posix.dirname(baseFile), relativeFile)));
|
|
20
|
+
}
|
|
21
|
+
function pluginFileRelativeToAgent(agentManifestPath, pluginManifestPath) {
|
|
22
|
+
return normalizeTargetPath(path_1.default.posix.relative(path_1.default.posix.dirname(agentManifestPath), pluginManifestPath));
|
|
23
|
+
}
|
|
24
|
+
function actionId(pluginManifestPath) {
|
|
25
|
+
const basename = path_1.default.posix.basename(pluginManifestPath, path_1.default.posix.extname(pluginManifestPath));
|
|
26
|
+
return basename.startsWith("ai-plugin-") ? basename.substring("ai-plugin-".length) : basename;
|
|
27
|
+
}
|
|
28
|
+
function readManifest(io, filePath, missingErrorName, readErrorName) {
|
|
29
|
+
try {
|
|
30
|
+
const contents = io.read(filePath);
|
|
31
|
+
return contents === undefined
|
|
32
|
+
? (0, neverthrow_1.err)(manifestError(missingErrorName, `Cannot read '${filePath}'.`))
|
|
33
|
+
: (0, neverthrow_1.ok)(contents);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
return (0, neverthrow_1.err)(manifestError(readErrorName, `Cannot read '${filePath}'.`, error));
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
function registerDeclarativeAgentAction(io, teamsManifestPath, pluginManifestPath) {
|
|
40
|
+
const teamsManifestContents = readManifest(io, teamsManifestPath, "DaActionTeamsManifestMissing", "DaActionTeamsManifestReadFailed");
|
|
41
|
+
if (teamsManifestContents.isErr()) {
|
|
42
|
+
return (0, neverthrow_1.err)(teamsManifestContents.error);
|
|
43
|
+
}
|
|
44
|
+
let teamsManifest;
|
|
45
|
+
try {
|
|
46
|
+
teamsManifest = teamsfx_api_1.TeamsManifestWrapper.fromJSON(teamsManifestContents.value.toString("utf8"));
|
|
47
|
+
}
|
|
48
|
+
catch {
|
|
49
|
+
return (0, neverthrow_1.err)(manifestError("DaActionTeamsManifestInvalid", `'${teamsManifestPath}' is not valid JSON.`));
|
|
50
|
+
}
|
|
51
|
+
const agentFile = teamsManifest.getDeclarativeAgentPaths()[0];
|
|
52
|
+
if (agentFile === undefined) {
|
|
53
|
+
return (0, neverthrow_1.err)(manifestError("DaActionManifestFileMissing", `The Teams manifest '${teamsManifestPath}' does not reference a declarative agent manifest.`));
|
|
54
|
+
}
|
|
55
|
+
const agentManifestPath = resolveSiblingPath(teamsManifestPath, agentFile);
|
|
56
|
+
const agentManifestContents = readManifest(io, agentManifestPath, "DaActionManifestMissing", "DaActionManifestReadFailed");
|
|
57
|
+
if (agentManifestContents.isErr()) {
|
|
58
|
+
return (0, neverthrow_1.err)(agentManifestContents.error);
|
|
59
|
+
}
|
|
60
|
+
let agentManifest;
|
|
61
|
+
try {
|
|
62
|
+
agentManifest = teamsfx_api_1.DeclarativeAgentManifestWrapper.fromJSON(agentManifestContents.value.toString("utf8"));
|
|
63
|
+
}
|
|
64
|
+
catch {
|
|
65
|
+
return (0, neverthrow_1.err)(manifestError("DaActionManifestInvalid", `'${agentManifestPath}' is not valid JSON.`));
|
|
66
|
+
}
|
|
67
|
+
agentManifest.upsertAction(actionId(pluginManifestPath), pluginFileRelativeToAgent(agentManifestPath, pluginManifestPath));
|
|
68
|
+
try {
|
|
69
|
+
io.write(agentManifestPath, Buffer.from(agentManifest.toJSON(), "utf8"));
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
return (0, neverthrow_1.err)(manifestError("DaActionManifestWriteFailed", `Cannot write '${agentManifestPath}'.`, error));
|
|
73
|
+
}
|
|
74
|
+
return (0, neverthrow_1.ok)(undefined);
|
|
75
|
+
}
|
|
76
|
+
function setSensitivityLabel(io, manifestPath, id) {
|
|
77
|
+
const contents = readManifest(io, manifestPath, "DaSensitivityLabelManifestMissing", "DaSensitivityLabelManifestReadFailed");
|
|
78
|
+
if (contents.isErr()) {
|
|
79
|
+
return (0, neverthrow_1.err)(contents.error);
|
|
80
|
+
}
|
|
81
|
+
let serialized;
|
|
82
|
+
try {
|
|
83
|
+
const wrapper = teamsfx_api_1.DeclarativeAgentManifestWrapper.fromJSON(contents.value.toString("utf8"));
|
|
84
|
+
wrapper.setSensitivityLabel(id);
|
|
85
|
+
serialized = Buffer.from(wrapper.toJSON(), "utf8");
|
|
86
|
+
}
|
|
87
|
+
catch (error) {
|
|
88
|
+
return (0, neverthrow_1.err)(manifestError("DaSensitivityLabelManifestInvalid", "the Declarative Agent manifest to label is invalid", error));
|
|
89
|
+
}
|
|
90
|
+
try {
|
|
91
|
+
io.write(manifestPath, serialized);
|
|
92
|
+
return (0, neverthrow_1.ok)(undefined);
|
|
93
|
+
}
|
|
94
|
+
catch (error) {
|
|
95
|
+
return (0, neverthrow_1.err)(manifestError("DaSensitivityLabelManifestWriteFailed", `Cannot write '${manifestPath}'.`, error));
|
|
96
|
+
}
|
|
97
|
+
}
|
|
98
|
+
exports.daManifestService = {
|
|
99
|
+
registerDeclarativeAgentAction,
|
|
100
|
+
setSensitivityLabel,
|
|
101
|
+
};
|
|
102
|
+
//# sourceMappingURL=daManifestService.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"daManifestService.js","sourceRoot":"","sources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arative-agent/v1.4/schema.json",
|
|
4
|
+
"version": "v1.4",
|
|
5
|
+
"name": "Add-in Skill + Agent for {{appName}}",
|
|
6
|
+
"description": "You are an agent for working with add-in. You can work with any cells, not only well formatted table.",
|
|
7
|
+
"instructions": "You are an agent for working with add-in. You can work with any cells, not only well formatted table.",
|
|
8
|
+
"conversation_starters": [
|
|
9
|
+
{
|
|
10
|
+
"title": "Change cell color (for excel)",
|
|
11
|
+
"text": "Change the cell below A2 to the color of grass. Tell me how long it took in seconds."
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
"title": "Add footer (for word)",
|
|
15
|
+
"text": "Add a footer with message 'Hello Agent!'. Tell me how long it took in seconds."
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"title": "Add text to slide (for powerpoint)",
|
|
19
|
+
"text": "Please add text 'Hello PPT!' to the slide. Tell me how long it took in seconds."
|
|
20
|
+
}
|
|
21
|
+
],
|
|
22
|
+
"actions": [
|
|
23
|
+
{
|
|
24
|
+
"id": "alchemyPlugin",
|
|
25
|
+
"file": "{{actionFilename}}"
|
|
26
|
+
}
|
|
27
|
+
]
|
|
28
|
+
},
|
|
29
|
+
"plugin": {
|
|
30
|
+
"$schema": "https://developer.microsoft.com/json-schemas/copilot/plugin/v2.3/schema.json",
|
|
31
|
+
"schema_version": "v2.3",
|
|
32
|
+
"name_for_human": "Add-in Skill + Agent for {{appName}}",
|
|
33
|
+
"description_for_human": "Get answer for user's question related to Microsoft 365 products",
|
|
34
|
+
"namespace": "AddInFunctions",
|
|
35
|
+
"functions": [
|
|
36
|
+
{
|
|
37
|
+
"name": "{{word}}",
|
|
38
|
+
"description": "Action addfooter: take in arg a JSON object, with a footer message in the field 'Footer'.",
|
|
39
|
+
"parameters": {
|
|
40
|
+
"type": "object",
|
|
41
|
+
"properties": {
|
|
42
|
+
"Footer": {
|
|
43
|
+
"type": "string",
|
|
44
|
+
"description": "example message to be added to footer",
|
|
45
|
+
"default": "Declarative Agent Footer"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"required": ["Footer"]
|
|
49
|
+
},
|
|
50
|
+
"states": {
|
|
51
|
+
"reasoning": {
|
|
52
|
+
"description": "",
|
|
53
|
+
"instructions": ""
|
|
54
|
+
},
|
|
55
|
+
"responding": {
|
|
56
|
+
"description": "",
|
|
57
|
+
"instructions": "reply"
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
"name": "{{excel}}",
|
|
63
|
+
"description": "Action fillcolor: take in arg a JSON object, a cell location and a color in hex. Cell location is a single cell.",
|
|
64
|
+
"parameters": {
|
|
65
|
+
"type": "object",
|
|
66
|
+
"properties": {
|
|
67
|
+
"Cell": {
|
|
68
|
+
"type": "string",
|
|
69
|
+
"description": "example cell location",
|
|
70
|
+
"default": "B7"
|
|
71
|
+
},
|
|
72
|
+
"Color": {
|
|
73
|
+
"type": "string",
|
|
74
|
+
"description": "example color in hex",
|
|
75
|
+
"default": "#30d5c8"
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"required": ["Cell", "Color"]
|
|
79
|
+
},
|
|
80
|
+
"states": {
|
|
81
|
+
"reasoning": {
|
|
82
|
+
"description": "",
|
|
83
|
+
"instructions": ""
|
|
84
|
+
},
|
|
85
|
+
"responding": {
|
|
86
|
+
"description": "",
|
|
87
|
+
"instructions": "reply"
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
},
|
|
91
|
+
{
|
|
92
|
+
"name": "{{powerpoint}}",
|
|
93
|
+
"description": "Action addtexttoslide: take in arg a JSON object, a text to be added to a slide.",
|
|
94
|
+
"parameters": {
|
|
95
|
+
"type": "object",
|
|
96
|
+
"properties": {
|
|
97
|
+
"Text": {
|
|
98
|
+
"type": "string",
|
|
99
|
+
"description": "example text to be added to a slide",
|
|
100
|
+
"default": "hello declarative agent"
|
|
101
|
+
}
|
|
102
|
+
},
|
|
103
|
+
"required": ["Text"]
|
|
104
|
+
},
|
|
105
|
+
"states": {
|
|
106
|
+
"reasoning": {
|
|
107
|
+
"description": "",
|
|
108
|
+
"instructions": ""
|
|
109
|
+
},
|
|
110
|
+
"responding": {
|
|
111
|
+
"description": "",
|
|
112
|
+
"instructions": "reply"
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
],
|
|
117
|
+
"runtimes": [
|
|
118
|
+
{
|
|
119
|
+
"type": "LocalPlugin",
|
|
120
|
+
"spec": {
|
|
121
|
+
"local_endpoint": "Microsoft.Office.Addin"
|
|
122
|
+
},
|
|
123
|
+
"run_for_functions": ["{{word}}", "{{excel}}", "{{powerpoint}}"]
|
|
124
|
+
}
|
|
125
|
+
]
|
|
126
|
+
},
|
|
127
|
+
"commandHandlerCode": [
|
|
128
|
+
"",
|
|
129
|
+
"/* global Office */",
|
|
130
|
+
"/* global Word, Excel, PowerPoint, performance, console */",
|
|
131
|
+
"",
|
|
132
|
+
"async function addFooter(message) {",
|
|
133
|
+
" await Word.run(async (context) => {",
|
|
134
|
+
" context.document.sections",
|
|
135
|
+
" .getFirst()",
|
|
136
|
+
" .getFooter(Word.HeaderFooterType.primary)",
|
|
137
|
+
" .insertParagraph(`From Agent: ${message}`, \"End\");",
|
|
138
|
+
"",
|
|
139
|
+
" await context.sync();",
|
|
140
|
+
" });",
|
|
141
|
+
"}",
|
|
142
|
+
"",
|
|
143
|
+
"async function fillColor(cell, color) {",
|
|
144
|
+
" await Excel.run(async (context) => {",
|
|
145
|
+
" context.workbook.worksheets.getActiveWorksheet().getRange(cell).format.fill.color = color;",
|
|
146
|
+
" await context.sync();",
|
|
147
|
+
" });",
|
|
148
|
+
"}",
|
|
149
|
+
"",
|
|
150
|
+
"async function addTextToSlide(text) {",
|
|
151
|
+
" await PowerPoint.run(async (context) => {",
|
|
152
|
+
" context.presentation.slides.getItemAt(0).shapes.addTextBox(text, {",
|
|
153
|
+
" left: Math.random() * 200,",
|
|
154
|
+
" top: Math.random() * 200,",
|
|
155
|
+
" height: 150,",
|
|
156
|
+
" width: 150,",
|
|
157
|
+
" });",
|
|
158
|
+
" await context.sync();",
|
|
159
|
+
" });",
|
|
160
|
+
"}",
|
|
161
|
+
"",
|
|
162
|
+
"Office.onReady((info) => {",
|
|
163
|
+
" if (info.host === Office.HostType.Word) {",
|
|
164
|
+
" Office.actions.associate(\"{{word}}\", async (message) => {",
|
|
165
|
+
" const start = performance.now();",
|
|
166
|
+
" const { Footer: footer } = JSON.parse(message);",
|
|
167
|
+
" await addFooter(footer);",
|
|
168
|
+
" const duration = performance.now() - start;",
|
|
169
|
+
" const result = `Demo add-in: Footer added! completed in ${duration.toFixed(0)} ms.`;",
|
|
170
|
+
" console.log(`Returning result: \"${result}\"`);",
|
|
171
|
+
" return result;",
|
|
172
|
+
" });",
|
|
173
|
+
" } else if (info.host === Office.HostType.Excel) {",
|
|
174
|
+
" Office.actions.associate(\"{{excel}}\", async (message) => {",
|
|
175
|
+
" const start = performance.now();",
|
|
176
|
+
" const { Cell: cell, Color: color } = JSON.parse(message);",
|
|
177
|
+
" await fillColor(cell, color);",
|
|
178
|
+
" const duration = performance.now() - start;",
|
|
179
|
+
" const result = `Demo add-in: Action completed! completed in ${duration.toFixed(0)} ms.`;",
|
|
180
|
+
" console.log(`Returning result: \"${result}\"`);",
|
|
181
|
+
" return result;",
|
|
182
|
+
" });",
|
|
183
|
+
" } else if (info.host === Office.HostType.PowerPoint) {",
|
|
184
|
+
" Office.actions.associate(\"{{powerpoint}}\", async (message) => {",
|
|
185
|
+
" const start = performance.now();",
|
|
186
|
+
" const { Text: text } = JSON.parse(message);",
|
|
187
|
+
" await addTextToSlide(text);",
|
|
188
|
+
" const duration = performance.now() - start;",
|
|
189
|
+
" const result = `Demo add-in: text added to slide! completed in ${duration.toFixed(0)} ms.`;",
|
|
190
|
+
" console.log(`Returning result: \"${result}\"`);",
|
|
191
|
+
" return result;",
|
|
192
|
+
" });",
|
|
193
|
+
" }",
|
|
194
|
+
"});",
|
|
195
|
+
""
|
|
196
|
+
]
|
|
197
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
{
|
|
2
|
+
"apiKey": [
|
|
3
|
+
"# Register API KEY",
|
|
4
|
+
"uses: apiKey/register",
|
|
5
|
+
"with:",
|
|
6
|
+
" # Name of the API Key",
|
|
7
|
+
" name: ''",
|
|
8
|
+
" # app ID",
|
|
9
|
+
" appId: ${{TEAMS_APP_ID}}",
|
|
10
|
+
" # Path to OpenAPI description document",
|
|
11
|
+
" apiSpecPath: ''",
|
|
12
|
+
"# Write the registration information of API Key into environment file for",
|
|
13
|
+
"# the specified environment variable(s).",
|
|
14
|
+
"writeToEnvironmentFile:",
|
|
15
|
+
" registrationId: ''"
|
|
16
|
+
],
|
|
17
|
+
"oauth2": [
|
|
18
|
+
"uses: oauth/register",
|
|
19
|
+
"with:",
|
|
20
|
+
" name: ''",
|
|
21
|
+
" flow: authorizationCode",
|
|
22
|
+
" # app ID",
|
|
23
|
+
" appId: ${{TEAMS_APP_ID}}",
|
|
24
|
+
" # Path to OpenAPI description document",
|
|
25
|
+
" apiSpecPath: ''",
|
|
26
|
+
" # Use below property to change token exchange behaviour, BasicAuthorizationHeader: token exchange is done via HTTP headers. PostRequestBody: token exchange is done via request body",
|
|
27
|
+
" # tokenExchangeMethodType: BasicAuthorizationHeader",
|
|
28
|
+
" # Uncomment below property to use proof key for code exchange (PKCE)",
|
|
29
|
+
" # isPKCEEnabled: true",
|
|
30
|
+
"writeToEnvironmentFile:",
|
|
31
|
+
" configurationId: ''"
|
|
32
|
+
]
|
|
33
|
+
}
|
|
@@ -0,0 +1,141 @@
|
|
|
1
|
+
{
|
|
2
|
+
"functionDefinitionCode": {
|
|
3
|
+
"javascript": [
|
|
4
|
+
".function(",
|
|
5
|
+
" functionDefs.{{operationId}}.name,",
|
|
6
|
+
" functionDefs.{{operationId}}.description,",
|
|
7
|
+
" functionDefs.{{operationId}}.parameters,",
|
|
8
|
+
" async (parameter) => {",
|
|
9
|
+
" const result = await functionHandlers.{{operationId}}Handler(parameter);",
|
|
10
|
+
" if(result) {",
|
|
11
|
+
" await send(result);",
|
|
12
|
+
" return \"result showed\";",
|
|
13
|
+
" } else {",
|
|
14
|
+
" return \"no result\";",
|
|
15
|
+
" }",
|
|
16
|
+
" }",
|
|
17
|
+
" )"
|
|
18
|
+
],
|
|
19
|
+
"typescript": [
|
|
20
|
+
".function(",
|
|
21
|
+
" functionDefs.{{operationId}}.name,",
|
|
22
|
+
" functionDefs.{{operationId}}.description,",
|
|
23
|
+
" functionDefs.{{operationId}}.parameters,",
|
|
24
|
+
" async (parameter) => {",
|
|
25
|
+
" const result = await functionHandlers.{{operationId}}Handler(parameter);",
|
|
26
|
+
" if(result) {",
|
|
27
|
+
" await send(result);",
|
|
28
|
+
" return \"result showed\";",
|
|
29
|
+
" } else {",
|
|
30
|
+
" return \"no result\";",
|
|
31
|
+
" }",
|
|
32
|
+
" }",
|
|
33
|
+
" )"
|
|
34
|
+
],
|
|
35
|
+
"python": [
|
|
36
|
+
".with_function(",
|
|
37
|
+
" Function(",
|
|
38
|
+
" name=function_defs[\"{{operationId}}\"][\"name\"],",
|
|
39
|
+
" description=function_defs[\"{{operationId}}\"][\"description\"],",
|
|
40
|
+
" parameter_schema=function_defs[\"{{operationId}}\"][\"parameters\"],",
|
|
41
|
+
" handler=make_handler({{operationId}}, ctx)",
|
|
42
|
+
" )",
|
|
43
|
+
" )"
|
|
44
|
+
]
|
|
45
|
+
},
|
|
46
|
+
"functionHandlerCode": {
|
|
47
|
+
"javascript": [
|
|
48
|
+
"const {{operationId}}Handler = async (",
|
|
49
|
+
" parameters",
|
|
50
|
+
") => {",
|
|
51
|
+
" const client = await api.getClient();",
|
|
52
|
+
" // Add authentication configuration for the client",
|
|
53
|
+
" const apiPath = client.paths[\"{{pathUrl}}\"];",
|
|
54
|
+
" if (apiPath && apiPath.{{method}}) {",
|
|
55
|
+
" const result = await apiPath.{{method}}(parameters.path, parameters.body, {",
|
|
56
|
+
" params: parameters.query,",
|
|
57
|
+
" });",
|
|
58
|
+
" if (!result || !result.data) {",
|
|
59
|
+
" throw new Error(\"Get empty result from api call.\");",
|
|
60
|
+
" }",
|
|
61
|
+
" const cardName = \"{{operationId}}\".replace(/[^a-zA-Z0-9]/g, \"_\");",
|
|
62
|
+
" const cardTemplatePath = path.join(__dirname, '../adaptiveCards', cardName + '.json');",
|
|
63
|
+
" if (await fs.exists(cardTemplatePath)){",
|
|
64
|
+
" const card = generateAdaptiveCard(cardTemplatePath, result);",
|
|
65
|
+
" return card;",
|
|
66
|
+
" } else {",
|
|
67
|
+
" return JSON.stringify(result.data);",
|
|
68
|
+
" }",
|
|
69
|
+
" } else {",
|
|
70
|
+
" return \"\";",
|
|
71
|
+
" }",
|
|
72
|
+
"",
|
|
73
|
+
"};",
|
|
74
|
+
"",
|
|
75
|
+
"module.exports = { {{operationId}}Handler };"
|
|
76
|
+
],
|
|
77
|
+
"typescript": [
|
|
78
|
+
"export const {{operationId}}Handler = async (",
|
|
79
|
+
" parameter: any",
|
|
80
|
+
") => {",
|
|
81
|
+
" const client = await api.getClient();",
|
|
82
|
+
" // Add authentication configuration for the client",
|
|
83
|
+
" const apiPath = client.paths[\"{{pathUrl}}\"];",
|
|
84
|
+
" if (apiPath && apiPath.{{method}}) {",
|
|
85
|
+
" const result = await apiPath.{{method}}(parameter.path, parameter.body, {",
|
|
86
|
+
" params: parameter.query,",
|
|
87
|
+
" });",
|
|
88
|
+
" if (!result || !result.data) {",
|
|
89
|
+
" throw new Error(\"Get empty result from api call.\");",
|
|
90
|
+
" }",
|
|
91
|
+
" const cardName = \"{{operationId}}\".replace(/[^a-zA-Z0-9]/g, \"_\");",
|
|
92
|
+
" const cardTemplatePath = path.join(__dirname, '../adaptiveCards', cardName + '.json');",
|
|
93
|
+
" if (await fs.exists(cardTemplatePath)){",
|
|
94
|
+
" const card = generateAdaptiveCard(cardTemplatePath, result);",
|
|
95
|
+
" return card;",
|
|
96
|
+
" } else {",
|
|
97
|
+
" return JSON.stringify(result.data);",
|
|
98
|
+
" }",
|
|
99
|
+
" } else {",
|
|
100
|
+
" return \"\";",
|
|
101
|
+
" }",
|
|
102
|
+
" ",
|
|
103
|
+
"};"
|
|
104
|
+
],
|
|
105
|
+
"python": [
|
|
106
|
+
"async def {{operationId}}(",
|
|
107
|
+
" parameters,",
|
|
108
|
+
"):",
|
|
109
|
+
" path = getattr(parameters, \"path\", {})",
|
|
110
|
+
" body = getattr(parameters, \"body\", None)",
|
|
111
|
+
" query = getattr(parameters, \"query\", {}) or {}",
|
|
112
|
+
" resp = client.{{operationId}}(**path, json=body, _headers={}, _params=query, _cookies={})",
|
|
113
|
+
"",
|
|
114
|
+
" if resp.status_code != 200:",
|
|
115
|
+
" return resp.reason",
|
|
116
|
+
" else:",
|
|
117
|
+
" card_template_path = os.path.join(current_dir, 'adaptiveCards/{{operationId}}.json')",
|
|
118
|
+
" if not os.path.exists(card_template_path):",
|
|
119
|
+
" json_resoponse_str = resp.text",
|
|
120
|
+
" return json_resoponse_str",
|
|
121
|
+
" else:",
|
|
122
|
+
" with open(card_template_path) as card_template_file:",
|
|
123
|
+
" adaptive_card_template = card_template_file.read()",
|
|
124
|
+
"",
|
|
125
|
+
" renderer = AdaptiveCardRenderer(adaptive_card_template)",
|
|
126
|
+
"",
|
|
127
|
+
" json_resoponse_str = resp.text",
|
|
128
|
+
" rendered_card_str = renderer.render(json_resoponse_str)",
|
|
129
|
+
" rendered_card_json = json.loads(rendered_card_str)",
|
|
130
|
+
" return AdaptiveCard.model_validate(rendered_card_json)",
|
|
131
|
+
" "
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"instructions": [
|
|
135
|
+
"The following is a conversation with an AI assistant.",
|
|
136
|
+
"The assistant can help to call APIs for the open api spec file{{description}}",
|
|
137
|
+
"If the API doesn't require parameters, invoke it with default JSON object {{emptyArgs}}.",
|
|
138
|
+
"",
|
|
139
|
+
""
|
|
140
|
+
]
|
|
141
|
+
}
|
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
import { RegisteredStep } from "../../pipeline/runScaffoldPipeline";
|
|
2
|
+
import { DaManifestService } from "../services/daManifestService";
|
|
2
3
|
/** Engine step name `da-action/register-plugin-manifest`. */
|
|
3
|
-
export declare const STEP_REGISTER_PLUGIN_MANIFEST
|
|
4
|
+
export declare const STEP_REGISTER_PLUGIN_MANIFEST: string;
|
|
5
|
+
export declare function createDaActionRegisterPluginManifestStep(manifests?: DaManifestService): RegisteredStep;
|
|
4
6
|
/** Registered step for adding a rendered API plugin manifest as a DA action. */
|
|
5
7
|
export declare const daActionRegisterPluginManifest: RegisteredStep;
|
|
6
8
|
//# sourceMappingURL=daAction.d.ts.map
|