@microsoft/teamsfx-core 3.1.3 → 3.1.4-alpha.1df35c7d32.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 +1 -4
- 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.map +1 -1
- package/build/component/utils/envUtil.js +7 -6
- 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/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/collectInputs/collectInputs.d.ts.map +1 -1
- package/build/v4/collectInputs/collectInputs.js +91 -215
- 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/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 +2 -0
- package/build/v4/pipeline/runScaffoldPipeline.d.ts.map +1 -1
- package/build/v4/pipeline/runScaffoldPipeline.js +5 -4
- 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 +60 -0
- package/build/v4/providers/createLanguageOptionsProvider.js.map +1 -0
- package/build/v4/providers/createOptionsProviders.d.ts +2 -1
- package/build/v4/providers/createOptionsProviders.d.ts.map +1 -1
- package/build/v4/providers/createOptionsProviders.js +5 -1
- 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/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/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/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/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.map +1 -1
- package/build/v4/runtime/steps/daAction.js +14 -18
- package/build/v4/runtime/steps/daAction.js.map +1 -1
- package/build/v4/runtime/steps/daSensitivity.d.ts.map +1 -1
- package/build/v4/runtime/steps/daSensitivity.js +10 -11
- package/build/v4/runtime/steps/daSensitivity.js.map +1 -1
- package/build/v4/runtime/steps/mcpAuth.d.ts.map +1 -1
- package/build/v4/runtime/steps/mcpAuth.js +40 -48
- package/build/v4/runtime/steps/mcpAuth.js.map +1 -1
- package/build/v4/runtime/steps/mcpLocal.d.ts.map +1 -1
- package/build/v4/runtime/steps/mcpLocal.js +17 -30
- package/build/v4/runtime/steps/mcpLocal.js.map +1 -1
- package/build/v4/runtime/steps/mcpStatic.d.ts.map +1 -1
- package/build/v4/runtime/steps/mcpStatic.js +31 -38
- 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 +43 -167
- 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 +14 -19
- 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 +41 -101
- 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 +11 -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 +17 -3
- 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/validation/capabilityCatalog.d.ts +1 -1
- package/build/v4/validation/capabilityCatalog.d.ts.map +1 -1
- package/build/v4/validation/capabilityCatalog.js +11 -1
- 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 +1 -1
- 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/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
|
@@ -2,234 +2,28 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.PACKAGE_PARSE_ERROR = void 0;
|
|
5
|
+
exports.parseDeclaredKeys = exports.PACKAGE_PARSE_ERROR = void 0;
|
|
6
|
+
exports.prepareTemplate = prepareTemplate;
|
|
6
7
|
exports.parseReplaceMap = parseReplaceMap;
|
|
7
|
-
exports.parseDeclaredKeys = parseDeclaredKeys;
|
|
8
8
|
exports.parsePipeline = parsePipeline;
|
|
9
|
+
const tslib_1 = require("tslib");
|
|
9
10
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
10
|
-
const
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
return new teamsfx_api_1.SystemError({ source: SOURCE, name: exports.PACKAGE_PARSE_ERROR, message });
|
|
11
|
+
const parser = tslib_1.__importStar(require("../validation/packageParse"));
|
|
12
|
+
var packageParse_1 = require("../validation/packageParse");
|
|
13
|
+
Object.defineProperty(exports, "PACKAGE_PARSE_ERROR", { enumerable: true, get: function () { return packageParse_1.PACKAGE_PARSE_ERROR; } });
|
|
14
|
+
Object.defineProperty(exports, "parseDeclaredKeys", { enumerable: true, get: function () { return packageParse_1.parseDeclaredKeys; } });
|
|
15
|
+
function systemError(name, message) {
|
|
16
|
+
return new teamsfx_api_1.SystemError({ source: "Scaffold", name, message });
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
20
|
-
}
|
|
21
|
-
/** Read a record field as a string, or `undefined` when absent / non-string. */
|
|
22
|
-
function stringField(record, key) {
|
|
23
|
-
const value = record[key];
|
|
24
|
-
return typeof value === "string" ? value : undefined;
|
|
25
|
-
}
|
|
26
|
-
/** Discriminate one `replaceMap` entry by its present producer key (`const`/`from`/`expr`/`when`). */
|
|
27
|
-
function toReplaceMapEntry(item) {
|
|
28
|
-
if (!isRecord(item)) {
|
|
29
|
-
return undefined;
|
|
30
|
-
}
|
|
31
|
-
const varName = stringField(item, "var");
|
|
32
|
-
if (varName === undefined) {
|
|
33
|
-
return undefined;
|
|
34
|
-
}
|
|
35
|
-
const constVal = stringField(item, "const");
|
|
36
|
-
if (constVal !== undefined) {
|
|
37
|
-
return { var: varName, const: constVal };
|
|
38
|
-
}
|
|
39
|
-
const fromVal = stringField(item, "from");
|
|
40
|
-
if (fromVal !== undefined) {
|
|
41
|
-
return { var: varName, from: fromVal };
|
|
42
|
-
}
|
|
43
|
-
const exprVal = stringField(item, "expr");
|
|
44
|
-
if (exprVal !== undefined) {
|
|
45
|
-
return { var: varName, expr: exprVal };
|
|
46
|
-
}
|
|
47
|
-
const whenVal = stringField(item, "when");
|
|
48
|
-
const valueVal = stringField(item, "value");
|
|
49
|
-
if (whenVal !== undefined && valueVal !== undefined) {
|
|
50
|
-
return { var: varName, when: whenVal, value: valueVal };
|
|
51
|
-
}
|
|
52
|
-
return undefined;
|
|
18
|
+
function prepareTemplate(raw) {
|
|
19
|
+
return parser.prepareTemplate(raw, systemError);
|
|
53
20
|
}
|
|
54
21
|
/** Extract `descriptor.replaceMap` as a typed entry list (absent ⇒ empty). */
|
|
55
22
|
function parseReplaceMap(descriptor) {
|
|
56
|
-
|
|
57
|
-
return (0, neverthrow_1.err)(systemError("descriptor.json must be a JSON object"));
|
|
58
|
-
}
|
|
59
|
-
const raw = descriptor.replaceMap;
|
|
60
|
-
if (raw === undefined) {
|
|
61
|
-
return (0, neverthrow_1.ok)([]);
|
|
62
|
-
}
|
|
63
|
-
if (!Array.isArray(raw)) {
|
|
64
|
-
return (0, neverthrow_1.err)(systemError("descriptor.replaceMap must be an array"));
|
|
65
|
-
}
|
|
66
|
-
const entries = [];
|
|
67
|
-
for (const item of raw) {
|
|
68
|
-
const entry = toReplaceMapEntry(item);
|
|
69
|
-
if (entry === undefined) {
|
|
70
|
-
return (0, neverthrow_1.err)(systemError(`invalid replaceMap entry: ${JSON.stringify(item)}`));
|
|
71
|
-
}
|
|
72
|
-
entries.push(entry);
|
|
73
|
-
}
|
|
74
|
-
return (0, neverthrow_1.ok)(entries);
|
|
75
|
-
}
|
|
76
|
-
/** Extract declared option ids used to seed the render-context identifier domain. */
|
|
77
|
-
function parseDeclaredKeys(descriptor) {
|
|
78
|
-
if (!isRecord(descriptor)) {
|
|
79
|
-
return [];
|
|
80
|
-
}
|
|
81
|
-
const optionsSchema = descriptor.optionsSchema;
|
|
82
|
-
if (!isRecord(optionsSchema)) {
|
|
83
|
-
return [];
|
|
84
|
-
}
|
|
85
|
-
const properties = optionsSchema.properties;
|
|
86
|
-
if (!isRecord(properties)) {
|
|
87
|
-
return [];
|
|
88
|
-
}
|
|
89
|
-
return Object.keys(properties);
|
|
90
|
-
}
|
|
91
|
-
function toStringArray(raw) {
|
|
92
|
-
if (!Array.isArray(raw)) {
|
|
93
|
-
return undefined;
|
|
94
|
-
}
|
|
95
|
-
const out = [];
|
|
96
|
-
for (const value of raw) {
|
|
97
|
-
if (typeof value !== "string") {
|
|
98
|
-
return undefined;
|
|
99
|
-
}
|
|
100
|
-
out.push(value);
|
|
101
|
-
}
|
|
102
|
-
return out;
|
|
103
|
-
}
|
|
104
|
-
/** Coerce a `with` block to `StepParams` (string | boolean | string[] values only). */
|
|
105
|
-
function toStepParams(raw) {
|
|
106
|
-
if (!isRecord(raw)) {
|
|
107
|
-
return undefined;
|
|
108
|
-
}
|
|
109
|
-
const params = {};
|
|
110
|
-
for (const [key, value] of Object.entries(raw)) {
|
|
111
|
-
if (typeof value === "string" || typeof value === "boolean") {
|
|
112
|
-
params[key] = value;
|
|
113
|
-
continue;
|
|
114
|
-
}
|
|
115
|
-
const stringArray = toStringArray(value);
|
|
116
|
-
if (stringArray === undefined) {
|
|
117
|
-
return undefined;
|
|
118
|
-
}
|
|
119
|
-
params[key] = stringArray;
|
|
120
|
-
}
|
|
121
|
-
return params;
|
|
122
|
-
}
|
|
123
|
-
function applyConditionalMetadata(item, target, rejectMalformedWhen) {
|
|
124
|
-
const comment = stringField(item, "comment");
|
|
125
|
-
if (comment !== undefined) {
|
|
126
|
-
target.comment = comment;
|
|
127
|
-
}
|
|
128
|
-
const when = stringField(item, "when");
|
|
129
|
-
if (when !== undefined) {
|
|
130
|
-
target.when = when;
|
|
131
|
-
}
|
|
132
|
-
else if (rejectMalformedWhen && item.when !== undefined) {
|
|
133
|
-
return false;
|
|
134
|
-
}
|
|
135
|
-
return true;
|
|
136
|
-
}
|
|
137
|
-
function toPipelineStep(item) {
|
|
138
|
-
if (!isRecord(item)) {
|
|
139
|
-
return undefined;
|
|
140
|
-
}
|
|
141
|
-
const stepName = stringField(item, "step");
|
|
142
|
-
if (stepName === undefined) {
|
|
143
|
-
return undefined;
|
|
144
|
-
}
|
|
145
|
-
const result = { step: stepName };
|
|
146
|
-
if (!applyConditionalMetadata(item, result, false)) {
|
|
147
|
-
return undefined;
|
|
148
|
-
}
|
|
149
|
-
if (item.with !== undefined) {
|
|
150
|
-
const params = toStepParams(item.with);
|
|
151
|
-
if (params === undefined) {
|
|
152
|
-
return undefined;
|
|
153
|
-
}
|
|
154
|
-
result.with = params;
|
|
155
|
-
}
|
|
156
|
-
if (item.produces !== undefined) {
|
|
157
|
-
const produces = toStringArray(item.produces);
|
|
158
|
-
if (produces === undefined) {
|
|
159
|
-
return undefined;
|
|
160
|
-
}
|
|
161
|
-
result.produces = produces;
|
|
162
|
-
}
|
|
163
|
-
return result;
|
|
164
|
-
}
|
|
165
|
-
function toRenderFilter(item) {
|
|
166
|
-
if (!isRecord(item)) {
|
|
167
|
-
return undefined;
|
|
168
|
-
}
|
|
169
|
-
const exclude = toStringArray(item.exclude);
|
|
170
|
-
if (exclude === undefined) {
|
|
171
|
-
return undefined;
|
|
172
|
-
}
|
|
173
|
-
const result = { exclude };
|
|
174
|
-
if (!applyConditionalMetadata(item, result, true)) {
|
|
175
|
-
return undefined;
|
|
176
|
-
}
|
|
177
|
-
return result;
|
|
178
|
-
}
|
|
179
|
-
function toPipelineRender(raw) {
|
|
180
|
-
if (!isRecord(raw)) {
|
|
181
|
-
return undefined;
|
|
182
|
-
}
|
|
183
|
-
const result = {};
|
|
184
|
-
if (raw.filters !== undefined) {
|
|
185
|
-
if (!Array.isArray(raw.filters)) {
|
|
186
|
-
return undefined;
|
|
187
|
-
}
|
|
188
|
-
const filters = [];
|
|
189
|
-
for (const item of raw.filters) {
|
|
190
|
-
const filter = toRenderFilter(item);
|
|
191
|
-
if (filter === undefined) {
|
|
192
|
-
return undefined;
|
|
193
|
-
}
|
|
194
|
-
filters.push(filter);
|
|
195
|
-
}
|
|
196
|
-
result.filters = filters;
|
|
197
|
-
}
|
|
198
|
-
return result;
|
|
23
|
+
return parser.parseReplaceMap(descriptor, systemError);
|
|
199
24
|
}
|
|
200
25
|
/** Extract a parsed `pipeline.json` as a typed `Pipeline`. */
|
|
201
26
|
function parsePipeline(raw) {
|
|
202
|
-
|
|
203
|
-
return (0, neverthrow_1.err)(systemError("pipeline.json must be a JSON object"));
|
|
204
|
-
}
|
|
205
|
-
const name = stringField(raw, "pipeline");
|
|
206
|
-
if (name === undefined) {
|
|
207
|
-
return (0, neverthrow_1.err)(systemError("pipeline.pipeline (the orchestration name) is required"));
|
|
208
|
-
}
|
|
209
|
-
if (!Array.isArray(raw.steps)) {
|
|
210
|
-
return (0, neverthrow_1.err)(systemError("pipeline.steps must be an array"));
|
|
211
|
-
}
|
|
212
|
-
const steps = [];
|
|
213
|
-
for (const item of raw.steps) {
|
|
214
|
-
const step = toPipelineStep(item);
|
|
215
|
-
if (step === undefined) {
|
|
216
|
-
return (0, neverthrow_1.err)(systemError(`invalid pipeline step: ${JSON.stringify(item)}`));
|
|
217
|
-
}
|
|
218
|
-
steps.push(step);
|
|
219
|
-
}
|
|
220
|
-
const comment = stringField(raw, "comment");
|
|
221
|
-
let render;
|
|
222
|
-
if (raw.render !== undefined) {
|
|
223
|
-
render = toPipelineRender(raw.render);
|
|
224
|
-
if (render === undefined) {
|
|
225
|
-
return (0, neverthrow_1.err)(systemError(`invalid pipeline render: ${JSON.stringify(raw.render)}`));
|
|
226
|
-
}
|
|
227
|
-
}
|
|
228
|
-
return (0, neverthrow_1.ok)({
|
|
229
|
-
pipeline: name,
|
|
230
|
-
...(comment !== undefined ? { comment } : {}),
|
|
231
|
-
...(render !== undefined ? { render } : {}),
|
|
232
|
-
steps,
|
|
233
|
-
});
|
|
27
|
+
return parser.parsePipeline(raw, systemError);
|
|
234
28
|
}
|
|
235
29
|
//# sourceMappingURL=packageParse.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"packageParse.js","sourceRoot":"","sources":["../../../src/v4/runtime/packageParse.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;
|
|
1
|
+
{"version":3,"file":"packageParse.js","sourceRoot":"","sources":["../../../src/v4/runtime/packageParse.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;AAkBlC,0CAMC;AAGD,0CAEC;AAGD,sCAEC;;AAhCD,wDAAqD;AAMrD,2EAAqD;AAGrD,2DAAoF;AAA3E,mHAAA,mBAAmB,OAAA;AAAE,iHAAA,iBAAiB,OAAA;AAG/C,SAAS,WAAW,CAAC,IAAY,EAAE,OAAe;IAChD,OAAO,IAAI,yBAAW,CAAC,EAAE,MAAM,EAAE,UAAU,EAAE,IAAI,EAAE,OAAO,EAAE,CAAC,CAAC;AAChE,CAAC;AAED,SAAgB,eAAe,CAAC,GAI/B;IACC,OAAO,MAAM,CAAC,eAAe,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;AAClD,CAAC;AAED,8EAA8E;AAC9E,SAAgB,eAAe,CAAC,UAAmB;IACjD,OAAO,MAAM,CAAC,eAAe,CAAC,UAAU,EAAE,WAAW,CAAC,CAAC;AACzD,CAAC;AAED,8DAA8D;AAC9D,SAAgB,aAAa,CAAC,GAAY;IACxC,OAAO,MAAM,CAAC,aAAa,CAAC,GAAG,EAAE,WAAW,CAAC,CAAC;AAChD,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderFragment.d.ts","sourceRoot":"","sources":["../../../src/v4/runtime/renderFragment.ts"],"names":[],"mappings":"AAKA,wBAAgB,cAAc,CAAC,KAAK,EAAE,SAAS,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAE/E"}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Copyright (c) Microsoft Corporation.
|
|
3
|
+
// Licensed under the MIT license.
|
|
4
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
+
exports.renderFragment = renderFragment;
|
|
6
|
+
const tslib_1 = require("tslib");
|
|
7
|
+
const mustache_1 = tslib_1.__importDefault(require("mustache"));
|
|
8
|
+
function renderFragment(lines, values) {
|
|
9
|
+
return mustache_1.default.render(lines.join("\n"), values, undefined, { escape: (value) => value });
|
|
10
|
+
}
|
|
11
|
+
//# sourceMappingURL=renderFragment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"renderFragment.js","sourceRoot":"","sources":["../../../src/v4/runtime/renderFragment.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;AAIlC,wCAEC;;AAJD,gEAAgC;AAEhC,SAAgB,cAAc,CAAC,KAAwB,EAAE,MAAc;IACrE,OAAO,kBAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,EAAE,MAAM,EAAE,SAAS,EAAE,EAAE,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,EAAE,CAAC,CAAC;AAC5F,CAAC"}
|
|
@@ -3,6 +3,7 @@ import { Result } from "neverthrow";
|
|
|
3
3
|
import { Answers, CallerFloor, TemplateFileEntry } from "../model/dataModel";
|
|
4
4
|
import { ExpressionRuntimePort } from "../expression/evaluateExpression";
|
|
5
5
|
import { PipelineRuntimePort, ScaffoldOutcome, TargetDir } from "../pipeline/runScaffoldPipeline";
|
|
6
|
+
import { PreparedTemplate } from "./packageParse";
|
|
6
7
|
/** v4 scaffold composition over an injected runtime. See create-mcp-server spec. */
|
|
7
8
|
/** The two ports `scaffold` composes. */
|
|
8
9
|
export interface ScaffoldRuntime {
|
|
@@ -28,4 +29,5 @@ export interface ScaffoldRequest {
|
|
|
28
29
|
}
|
|
29
30
|
/** Scaffold one template package against an injected runtime. */
|
|
30
31
|
export declare function scaffold(request: ScaffoldRequest, runtime: ScaffoldRuntime): Promise<Result<ScaffoldOutcome, FxError>>;
|
|
32
|
+
export declare function scaffoldPrepared(template: PreparedTemplate, request: Pick<ScaffoldRequest, "answers" | "callerFloor" | "targetDir">, runtime: ScaffoldRuntime): Promise<Result<ScaffoldOutcome, FxError>>;
|
|
31
33
|
//# sourceMappingURL=scaffold.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../src/v4/runtime/scaffold.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAO,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,SAAS,EAEV,MAAM,iCAAiC,CAAC;
|
|
1
|
+
{"version":3,"file":"scaffold.d.ts","sourceRoot":"","sources":["../../../src/v4/runtime/scaffold.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,OAAO,EAAE,MAAM,wBAAwB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAO,MAAM,YAAY,CAAC;AACzC,OAAO,EAAE,OAAO,EAAE,WAAW,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAC7E,OAAO,EAAE,qBAAqB,EAAE,MAAM,kCAAkC,CAAC;AAEzE,OAAO,EACL,mBAAmB,EACnB,eAAe,EACf,SAAS,EAEV,MAAM,iCAAiC,CAAC;AACzC,OAAO,EAAE,gBAAgB,EAAmB,MAAM,gBAAgB,CAAC;AAInE,oFAAoF;AAEpF,yCAAyC;AACzC,MAAM,WAAW,eAAe;IAC9B,uFAAuF;IACvF,QAAQ,EAAE,qBAAqB,CAAC;IAChC,2FAA2F;IAC3F,IAAI,EAAE,mBAAmB,CAAC;CAC3B;AAED,wCAAwC;AACxC,MAAM,WAAW,eAAe;IAC9B,0FAA0F;IAC1F,UAAU,EAAE,OAAO,CAAC;IACpB,4CAA4C;IAC5C,QAAQ,EAAE,OAAO,CAAC;IAClB,yEAAyE;IACzE,OAAO,EAAE,iBAAiB,EAAE,CAAC;IAC7B,4DAA4D;IAC5D,OAAO,EAAE,OAAO,CAAC;IACjB,gFAAgF;IAChF,WAAW,EAAE,WAAW,CAAC;IACzB,wFAAwF;IACxF,SAAS,EAAE,SAAS,CAAC;CACtB;AAED,iEAAiE;AACjE,wBAAsB,QAAQ,CAC5B,OAAO,EAAE,eAAe,EACxB,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CAM3C;AAED,wBAAsB,gBAAgB,CACpC,QAAQ,EAAE,gBAAgB,EAC1B,OAAO,EAAE,IAAI,CAAC,eAAe,EAAE,SAAS,GAAG,aAAa,GAAG,WAAW,CAAC,EACvE,OAAO,EAAE,eAAe,GACvB,OAAO,CAAC,MAAM,CAAC,eAAe,EAAE,OAAO,CAAC,CAAC,CA6B3C"}
|
|
@@ -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,UAAU,CAAC,YAAY,CACjC,CAAC;IACF,IAAI,QAAQ,CAAC,KAAK,EAAE,EAAE,CAAC;QACrB,OAAO,IAAA,gBAAG,EAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;IAC7B,CAAC;IACD,sFAAsF;IACtF,MAAM,UAAU,GAAG;QACjB,GAAG,IAAA,yCAAyB,EAAC,QAAQ,CAAC,UAAU,EAAE,QAAQ,CAAC,QAAQ,EAAE,QAAQ,CAAC,KAAK,CAAC;QACpF,GAAG,OAAO,CAAC,WAAW;KACvB,CAAC;IAEF,oDAAoD;IACpD,MAAM,QAAQ,GAAG,OAAO,CAAC,WAAW,CAAC,QAAQ,IAAI,uCAAe,CAAC;IACjE,MAAM,OAAO,GAAG,IAAA,2CAAmB,EAAC,QAAQ,CAAC,UAAU,CAAC,SAAS,EAAE,QAAQ,CAAC,OAAO,EAAE,QAAQ,CAAC,CAAC;IAE/F,OAAO,IAAA,yCAAmB,EACxB,QAAQ,CAAC,QAAQ,EACjB,OAAO,EACP,UAAU,EACV,OAAO,CAAC,SAAS,EACjB,OAAO,CAAC,IAAI,CACb,CAAC;AACJ,CAAC"}
|
|
@@ -1 +1 @@
|
|
|
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,
|
|
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,mBAAmB,CAAC,UAAmB;IAC9C,IAAI,QAAQ,CAAC,UAAU,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,UAAU,CAAC,SAAS,CAAC,EAAE,CAAC;QAChE,MAAM,SAAS,GAAG,UAAU,CAAC,SAAS,CAAC,MAAM,CAC3C,CAAC,KAAK,EAAmB,EAAE,CAAC,OAAO,KAAK,KAAK,QAAQ,CACtD,CAAC;QACF,IAAI,SAAS,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;YACzB,OAAO,SAAS,CAAC;QACnB,CAAC;IACH,CAAC;IACD,OAAO,CAAC,uBAAe,CAAC,CAAC;AAC3B,CAAC;AAED,iFAAiF;AACjF,SAAgB,qBAAqB,CACnC,UAAmB,EACnB,OAA4B,EAC5B,QAAgB;IAEhB,OAAO,mBAAmB,CAAC,mBAAmB,CAAC,UAAU,CAAC,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;AACjF,CAAC;AAED,SAAgB,mBAAmB,CACjC,SAAmB,EACnB,OAA4B,EAC5B,QAAgB;IAEhB,qFAAqF;IACrF,IAAI,SAAS,CAAC,QAAQ,CAAC,uBAAe,CAAC,EAAE,CAAC;QACxC,OAAO,OAAO,CAAC;IACjB,CAAC;IACD,kEAAkE;IAClE,MAAM,MAAM,GAAG,GAAG,QAAQ,GAAG,CAAC;IAC9B,MAAM,QAAQ,GAAwB,EAAE,CAAC;IACzC,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;QAC5B,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,MAAM,CAAC,EAAE,CAAC;YAClC,QAAQ,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,KAAK,CAAC,IAAI,EAAE,CAAC,CAAC;QAC7E,CAAC;IACH,CAAC;IACD,OAAO,QAAQ,CAAC;AAClB,CAAC"}
|
|
@@ -0,0 +1,197 @@
|
|
|
1
|
+
{
|
|
2
|
+
"agent": {
|
|
3
|
+
"$schema": "https://developer.microsoft.com/json-schemas/copilot/declarative-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
|
+
}
|