@microsoft/teamsfx-core 3.0.0-alpha.09e5fe9da.0 → 3.0.0-alpha.0fa12bc9d.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/graphClient.d.ts +13 -1
- package/build/client/graphClient.d.ts.map +1 -1
- package/build/client/graphClient.js +140 -1
- package/build/client/graphClient.js.map +1 -1
- package/build/client/interfaces/ListSensitivityCacheValue.d.ts +6 -0
- package/build/client/interfaces/ListSensitivityCacheValue.d.ts.map +1 -0
- package/build/client/interfaces/ListSensitivityCacheValue.js +5 -0
- package/build/client/interfaces/ListSensitivityCacheValue.js.map +1 -0
- package/build/client/teamsDevPortalClient.d.ts.map +1 -1
- package/build/client/teamsDevPortalClient.js +1 -1
- package/build/client/teamsDevPortalClient.js.map +1 -1
- package/build/common/constants.d.ts +1 -0
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +2 -1
- package/build/common/constants.js.map +1 -1
- package/build/common/daSpecParser.d.ts +5 -2
- package/build/common/daSpecParser.d.ts.map +1 -1
- package/build/common/daSpecParser.js +152 -59
- package/build/common/daSpecParser.js.map +1 -1
- package/build/common/featureFlags.d.ts +0 -10
- package/build/common/featureFlags.d.ts.map +1 -1
- package/build/common/featureFlags.js +0 -10
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/kiotaClient.d.ts +2 -2
- package/build/common/kiotaClient.d.ts.map +1 -1
- package/build/common/kiotaClient.js +13 -1
- package/build/common/kiotaClient.js.map +1 -1
- package/build/common/projectSettingsHelper.d.ts.map +1 -1
- package/build/common/projectSettingsHelper.js +7 -6
- package/build/common/projectSettingsHelper.js.map +1 -1
- package/build/common/projectTypeChecker.d.ts.map +1 -1
- package/build/common/projectTypeChecker.js +4 -3
- package/build/common/projectTypeChecker.js.map +1 -1
- package/build/common/telemetry.d.ts +2 -1
- package/build/common/telemetry.d.ts.map +1 -1
- package/build/common/telemetry.js +1 -0
- package/build/common/telemetry.js.map +1 -1
- package/build/common/templates-config.json +1 -1
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +4 -0
- package/build/common/tools.js.map +1 -1
- package/build/common/versionMetadata.d.ts +5 -0
- package/build/common/versionMetadata.d.ts.map +1 -1
- package/build/common/versionMetadata.js +33 -10
- package/build/common/versionMetadata.js.map +1 -1
- package/build/common/wrappedAxiosClient.d.ts.map +1 -1
- package/build/common/wrappedAxiosClient.js +3 -0
- package/build/common/wrappedAxiosClient.js.map +1 -1
- package/build/component/configManager/constant.d.ts +2 -1
- package/build/component/configManager/constant.d.ts.map +1 -1
- package/build/component/configManager/constant.js +1 -0
- package/build/component/configManager/constant.js.map +1 -1
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +16 -15
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/deps-checker/internal/testToolChecker.d.ts.map +1 -1
- package/build/component/deps-checker/internal/testToolChecker.js +1 -1
- package/build/component/deps-checker/internal/testToolChecker.js.map +1 -1
- package/build/component/driver/aad/permissions/permissions.json +1009 -1009
- package/build/component/driver/deploy/spfx/error/noValidAppCatelogError.d.ts.map +1 -1
- package/build/component/driver/deploy/spfx/error/noValidAppCatelogError.js +3 -2
- package/build/component/driver/deploy/spfx/error/noValidAppCatelogError.js.map +1 -1
- package/build/component/driver/devChannel/errors.d.ts +5 -0
- package/build/component/driver/devChannel/errors.d.ts.map +1 -0
- package/build/component/driver/devChannel/errors.js +19 -0
- package/build/component/driver/devChannel/errors.js.map +1 -0
- package/build/component/driver/devChannel/installApp.d.ts.map +1 -1
- package/build/component/driver/devChannel/installApp.js +7 -0
- package/build/component/driver/devChannel/installApp.js.map +1 -1
- package/build/component/driver/devTool/installDriver.js +1 -1
- package/build/component/driver/devTool/installDriver.js.map +1 -1
- package/build/component/driver/share/utils.js +1 -1
- package/build/component/driver/share/utils.js.map +1 -1
- package/build/component/driver/teamsApp/configure.d.ts.map +1 -1
- package/build/component/driver/teamsApp/configure.js +1 -1
- package/build/component/driver/teamsApp/configure.js.map +1 -1
- package/build/component/driver/teamsApp/constants.d.ts +1 -1
- package/build/component/driver/teamsApp/constants.d.ts.map +1 -1
- package/build/component/driver/teamsApp/constants.js +2 -2
- package/build/component/driver/teamsApp/constants.js.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts +1 -0
- package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js +23 -10
- package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/syncManifest.js +1 -1
- package/build/component/driver/teamsApp/syncManifest.js.map +1 -1
- package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.d.ts +4 -1
- package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.js +43 -1
- package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.js.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts +44 -0
- package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.js +122 -30
- package/build/component/driver/teamsApp/utils/ManifestUtils.js.map +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validateAppPackage.js +3 -2
- package/build/component/driver/teamsApp/validateAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/validateTestCases.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validateTestCases.js +3 -2
- package/build/component/driver/teamsApp/validateTestCases.js.map +1 -1
- package/build/component/driver/typeSpec/compile.d.ts +1 -1
- package/build/component/driver/typeSpec/compile.d.ts.map +1 -1
- package/build/component/driver/typeSpec/compile.js +13 -14
- package/build/component/driver/typeSpec/compile.js.map +1 -1
- package/build/component/driver/util/utils.d.ts.map +1 -1
- package/build/component/driver/util/utils.js +4 -9
- package/build/component/driver/util/utils.js.map +1 -1
- package/build/component/generator/combinedProject/generator.d.ts +18 -0
- package/build/component/generator/combinedProject/generator.d.ts.map +1 -0
- package/build/component/generator/combinedProject/generator.js +78 -0
- package/build/component/generator/combinedProject/generator.js.map +1 -0
- package/build/component/generator/declarativeAgent/generator.d.ts +0 -1
- package/build/component/generator/declarativeAgent/generator.d.ts.map +1 -1
- package/build/component/generator/declarativeAgent/generator.js +2 -43
- package/build/component/generator/declarativeAgent/generator.js.map +1 -1
- package/build/component/generator/declarativeAgent/helper.js +3 -3
- package/build/component/generator/declarativeAgent/helper.js.map +1 -1
- package/build/component/generator/defaultGenerator.d.ts.map +1 -1
- package/build/component/generator/defaultGenerator.js +5 -1
- package/build/component/generator/defaultGenerator.js.map +1 -1
- package/build/component/generator/generatorProvider.d.ts.map +1 -1
- package/build/component/generator/generatorProvider.js +6 -4
- package/build/component/generator/generatorProvider.js.map +1 -1
- package/build/component/generator/officeAddin/generator.d.ts.map +1 -1
- package/build/component/generator/officeAddin/generator.js +1 -1
- package/build/component/generator/officeAddin/generator.js.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.d.ts.map +1 -1
- package/build/component/generator/officeAddin/helperMethods.js +2 -2
- package/build/component/generator/officeAddin/helperMethods.js.map +1 -1
- package/build/component/generator/openApiSpec/declarativeAgentGenerator.d.ts.map +1 -1
- package/build/component/generator/openApiSpec/declarativeAgentGenerator.js +11 -0
- package/build/component/generator/openApiSpec/declarativeAgentGenerator.js.map +1 -1
- package/build/component/generator/openApiSpec/helper.d.ts +1 -1
- package/build/component/generator/openApiSpec/helper.d.ts.map +1 -1
- package/build/component/generator/openApiSpec/helper.js +28 -25
- package/build/component/generator/openApiSpec/helper.js.map +1 -1
- package/build/component/generator/templates/metadata/agentForTeams.d.ts +3 -0
- package/build/component/generator/templates/metadata/agentForTeams.d.ts.map +1 -0
- package/build/component/generator/templates/metadata/{cea.js → agentForTeams.js} +3 -9
- package/build/component/generator/templates/metadata/agentForTeams.js.map +1 -0
- package/build/component/generator/templates/metadata/{cea.d.ts → customEngineAgent.d.ts} +1 -1
- package/build/component/generator/templates/metadata/customEngineAgent.d.ts.map +1 -0
- package/build/component/generator/templates/metadata/customEngineAgent.js +39 -0
- package/build/component/generator/templates/metadata/customEngineAgent.js.map +1 -0
- package/build/component/generator/templates/metadata/da.d.ts.map +1 -1
- package/build/component/generator/templates/metadata/da.js +6 -0
- package/build/component/generator/templates/metadata/da.js.map +1 -1
- package/build/component/generator/templates/metadata/index.d.ts.map +1 -1
- package/build/component/generator/templates/metadata/index.js +7 -4
- package/build/component/generator/templates/metadata/index.js.map +1 -1
- package/build/component/generator/templates/templateInfo.d.ts +1 -0
- package/build/component/generator/templates/templateInfo.d.ts.map +1 -1
- package/build/component/generator/templates/templateNames.d.ts +3 -1
- package/build/component/generator/templates/templateNames.d.ts.map +1 -1
- package/build/component/generator/templates/templateNames.js +5 -2
- package/build/component/generator/templates/templateNames.js.map +1 -1
- package/build/component/generator/templates/templateReplaceMap.d.ts.map +1 -1
- package/build/component/generator/templates/templateReplaceMap.js +2 -0
- package/build/component/generator/templates/templateReplaceMap.js.map +1 -1
- package/build/component/generator/utils.d.ts +2 -0
- package/build/component/generator/utils.d.ts.map +1 -1
- package/build/component/generator/utils.js +50 -1
- package/build/component/generator/utils.js.map +1 -1
- package/build/component/local/constants.d.ts +1 -0
- package/build/component/local/constants.d.ts.map +1 -1
- package/build/component/local/constants.js +1 -0
- package/build/component/local/constants.js.map +1 -1
- package/build/component/m365/serviceConstant.d.ts.map +1 -1
- package/build/component/m365/serviceConstant.js +10 -0
- package/build/component/m365/serviceConstant.js.map +1 -1
- package/build/component/migrate.d.ts.map +1 -1
- package/build/component/migrate.js +1 -2
- package/build/component/migrate.js.map +1 -1
- package/build/component/utils/metadataUtil.d.ts +3 -3
- package/build/component/utils/metadataUtil.d.ts.map +1 -1
- package/build/component/utils/metadataUtil.js +12 -12
- package/build/component/utils/metadataUtil.js.map +1 -1
- package/build/component/utils/pathUtils.d.ts +1 -1
- package/build/component/utils/pathUtils.d.ts.map +1 -1
- package/build/component/utils/pathUtils.js +4 -2
- package/build/component/utils/pathUtils.js.map +1 -1
- package/build/component/utils/settingsUtil.js.map +1 -1
- package/build/core/FxCore.d.ts +8 -2
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +156 -24
- package/build/core/FxCore.js.map +1 -1
- package/build/core/environment.d.ts +1 -1
- package/build/core/environment.d.ts.map +1 -1
- package/build/core/environment.js +11 -10
- package/build/core/environment.js.map +1 -1
- package/build/core/environmentName.d.ts +2 -0
- package/build/core/environmentName.d.ts.map +1 -1
- package/build/core/environmentName.js +5 -1
- package/build/core/environmentName.js.map +1 -1
- package/build/core/middleware/projectMigratorV3.d.ts.map +1 -1
- package/build/core/middleware/projectMigratorV3.js +2 -2
- package/build/core/middleware/projectMigratorV3.js.map +1 -1
- package/build/core/middleware/projectSettingsLoader.d.ts.map +1 -1
- package/build/core/middleware/projectSettingsLoader.js +2 -1
- package/build/core/middleware/projectSettingsLoader.js.map +1 -1
- package/build/core/middleware/retry.d.ts +3 -0
- package/build/core/middleware/retry.d.ts.map +1 -0
- package/build/core/middleware/retry.js +30 -0
- package/build/core/middleware/retry.js.map +1 -0
- package/build/core/middleware/utils/v3MigrationUtils.js +1 -1
- package/build/core/middleware/utils/v3MigrationUtils.js.map +1 -1
- package/build/error/common.d.ts +15 -0
- package/build/error/common.d.ts.map +1 -1
- package/build/error/common.js +71 -12
- package/build/error/common.js.map +1 -1
- package/build/index.d.ts +12 -10
- package/build/index.d.ts.map +1 -1
- package/build/index.js +28 -15
- package/build/index.js.map +1 -1
- package/build/question/constants.d.ts +2 -204
- package/build/question/constants.d.ts.map +1 -1
- package/build/question/constants.js +6 -681
- package/build/question/constants.js.map +1 -1
- package/build/question/create.d.ts +5 -10
- package/build/question/create.d.ts.map +1 -1
- package/build/question/create.js +237 -604
- package/build/question/create.js.map +1 -1
- package/build/question/index.d.ts +1 -1
- package/build/question/index.d.ts.map +1 -1
- package/build/question/index.js +3 -4
- package/build/question/index.js.map +1 -1
- package/build/question/inputs/AddKnowledgeInputs.d.ts +2 -2
- package/build/question/inputs/AddKnowledgeInputs.d.ts.map +1 -1
- package/build/question/inputs/SyncManifestInputs.d.ts +1 -1
- package/build/question/inputs/SyncManifestInputs.d.ts.map +1 -1
- package/build/question/inputs/ValidateTeamsAppInputs.d.ts +1 -1
- package/build/question/inputs/ValidateTeamsAppInputs.d.ts.map +1 -1
- package/build/question/options/AddKnowledgeOptions.js +4 -4
- package/build/question/options/AddKnowledgeOptions.js.map +1 -1
- package/build/question/options/AddPluginOptions.js +2 -2
- package/build/question/options/AddPluginOptions.js.map +1 -1
- package/build/question/options/CreateProjectOptions.js +1 -1
- package/build/question/options/CreateProjectOptions.js.map +1 -1
- package/build/question/options/CreateSampleProjectOptions.js +1 -1
- package/build/question/options/CreateSampleProjectOptions.js.map +1 -1
- package/build/question/options/PermissionGrantOptions.js +1 -1
- package/build/question/options/PermissionGrantOptions.js.map +1 -1
- package/build/question/options/PermissionListOptions.js +1 -1
- package/build/question/options/PermissionListOptions.js.map +1 -1
- package/build/question/options/PreviewTeamsAppOptions.js +1 -1
- package/build/question/options/PreviewTeamsAppOptions.js.map +1 -1
- package/build/question/options/SPFxAddWebpartOptions.js +2 -2
- package/build/question/options/SPFxAddWebpartOptions.js.map +1 -1
- package/build/question/options/SelectTeamsManifestOptions.js +1 -1
- package/build/question/options/SelectTeamsManifestOptions.js.map +1 -1
- package/build/question/options/SyncManifestOptions.js +1 -1
- package/build/question/options/SyncManifestOptions.js.map +1 -1
- package/build/question/options/ValidateTeamsAppOptions.js +2 -2
- package/build/question/options/ValidateTeamsAppOptions.js.map +1 -1
- package/build/question/other.d.ts +1 -0
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +46 -25
- package/build/question/other.js.map +1 -1
- package/build/question/questionNames.d.ts +131 -0
- package/build/question/questionNames.d.ts.map +1 -0
- package/build/question/questionNames.js +137 -0
- package/build/question/questionNames.js.map +1 -0
- package/build/question/scaffold/vs/createRootNode.d.ts +1 -0
- package/build/question/scaffold/vs/createRootNode.d.ts.map +1 -1
- package/build/question/scaffold/vs/createRootNode.js +18 -10
- package/build/question/scaffold/vs/createRootNode.js.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.d.ts +13 -2
- package/build/question/scaffold/vsc/CapabilityOptions.d.ts.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.js +84 -20
- package/build/question/scaffold/vsc/CapabilityOptions.js.map +1 -1
- package/build/question/scaffold/vsc/ProjectTypeOptions.d.ts +10 -9
- package/build/question/scaffold/vsc/ProjectTypeOptions.d.ts.map +1 -1
- package/build/question/scaffold/vsc/ProjectTypeOptions.js +30 -35
- package/build/question/scaffold/vsc/ProjectTypeOptions.js.map +1 -1
- package/build/question/scaffold/vsc/{customAgentProjectTypeNode.d.ts → agentForTeamsNode.d.ts} +2 -2
- package/build/question/scaffold/vsc/agentForTeamsNode.d.ts.map +1 -0
- package/build/question/scaffold/vsc/{customAgentProjectTypeNode.js → agentForTeamsNode.js} +18 -18
- package/build/question/scaffold/vsc/agentForTeamsNode.js.map +1 -0
- package/build/question/scaffold/vsc/createFromTdpNode.d.ts +1 -7
- package/build/question/scaffold/vsc/createFromTdpNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/createFromTdpNode.js +17 -51
- package/build/question/scaffold/vsc/createFromTdpNode.js.map +1 -1
- package/build/question/scaffold/vsc/createRootNode.d.ts +1 -0
- package/build/question/scaffold/vsc/createRootNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/createRootNode.js +67 -31
- package/build/question/scaffold/vsc/createRootNode.js.map +1 -1
- package/build/question/scaffold/vsc/customEngineAgentNode.d.ts +3 -0
- package/build/question/scaffold/vsc/customEngineAgentNode.d.ts.map +1 -0
- package/build/question/scaffold/vsc/customEngineAgentNode.js +30 -0
- package/build/question/scaffold/vsc/customEngineAgentNode.js.map +1 -0
- package/build/question/scaffold/vsc/daProjectTypeNode.d.ts +2 -1
- package/build/question/scaffold/vsc/daProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/daProjectTypeNode.js +17 -12
- package/build/question/scaffold/vsc/daProjectTypeNode.js.map +1 -1
- package/build/question/scaffold/vsc/graphConnectorProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/graphConnectorProjectTypeNode.js +11 -2
- package/build/question/scaffold/vsc/graphConnectorProjectTypeNode.js.map +1 -1
- package/build/question/scaffold/vsc/officeAddinProjectTypeNode.js +9 -9
- package/build/question/scaffold/vsc/officeAddinProjectTypeNode.js.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts +12 -2
- package/build/question/scaffold/vsc/teamsProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js +110 -62
- package/build/question/scaffold/vsc/teamsProjectTypeNode.js.map +1 -1
- package/build/question/utils.d.ts +3 -0
- package/build/question/utils.d.ts.map +1 -0
- package/build/question/utils.js +13 -0
- package/build/question/utils.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/build/ui/visitor.d.ts.map +1 -1
- package/build/ui/visitor.js +25 -41
- package/build/ui/visitor.js.map +1 -1
- package/package.json +9 -6
- package/resource/package.nls.cs.json +153 -124
- package/resource/package.nls.de.json +153 -124
- package/resource/package.nls.es.json +153 -124
- package/resource/package.nls.fr.json +153 -124
- package/resource/package.nls.it.json +153 -124
- package/resource/package.nls.ja.json +153 -124
- package/resource/package.nls.json +131 -113
- package/resource/package.nls.ko.json +153 -124
- package/resource/package.nls.pl.json +153 -124
- package/resource/package.nls.pt-BR.json +153 -124
- package/resource/package.nls.ru.json +153 -124
- package/resource/package.nls.tr.json +153 -124
- package/resource/package.nls.zh-Hans.json +153 -124
- package/resource/package.nls.zh-Hant.json +153 -124
- package/resource/yaml-schema/v1.8/yaml.schema.json +34 -34
- package/resource/yaml-schema/yaml.schema.json +34 -34
- 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/plugins/resource/aad/auth/bot/README.md +5 -5
- package/templates/plugins/resource/aad/auth/bot/README.txt +3 -3
- package/templates/plugins/resource/aad/auth/tab/README.md +2 -2
- package/templates/plugins/resource/aad/auth/tab/README.txt +2 -2
- package/build/client/graphAPIClient.d.ts +0 -19
- package/build/client/graphAPIClient.d.ts.map +0 -1
- package/build/client/graphAPIClient.js +0 -128
- package/build/client/graphAPIClient.js.map +0 -1
- package/build/component/driver/typeSpec/error/reProvisionError.d.ts +0 -5
- package/build/component/driver/typeSpec/error/reProvisionError.d.ts.map +0 -1
- package/build/component/driver/typeSpec/error/reProvisionError.js +0 -21
- package/build/component/driver/typeSpec/error/reProvisionError.js.map +0 -1
- package/build/component/generator/templates/metadata/cea.d.ts.map +0 -1
- package/build/component/generator/templates/metadata/cea.js.map +0 -1
- package/build/question/scaffold/vsc/customAgentProjectTypeNode.d.ts.map +0 -1
- package/build/question/scaffold/vsc/customAgentProjectTypeNode.js.map +0 -1
package/build/question/create.js
CHANGED
|
@@ -2,246 +2,62 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.
|
|
5
|
+
exports.createSampleProjectQuestionNode = exports.GCConnectionIdQuestion = exports.GCNameQuestion = exports.searchTypeQuestion = exports.webContentQuestion = exports.GCInputQuestion = exports.GCListQuestion = exports.GCItemQuestion = exports.oneDriveSharePointItemConfirmQuestion = exports.oneDriveSharePointItemQuestion = exports.addKnowledgeStartQuestion = exports.pluginApiSpecQuestion = exports.pluginManifestQuestion = exports.selectApiOperationForRegenerateQuestion = exports.selectOpenAPISpecFromPluginQuestion = exports.selectExistingPluginManifestQuestion = exports.apiPluginStartQuestion = exports.azureOpenAIDeploymentNameQuestion = exports.azureOpenAIEndpointQuestion = exports.azureOpenAIKeyQuestion = exports.openAIKeyQuestion = exports.apiOperationQuestion = exports.apiAuthQuestion = exports.apiSpecLocationQuestion = exports.selectOpenApiSpecQuestion = exports.searchOpenAPISpecQueryQuestion = exports.apiSpecTypeSelectQuestion = exports.selectBotIdsQuestion = exports.selectTabsContentUrlQuestion = exports.selectTabWebsiteUrlQuestion = exports.getTabWebsiteOptions = exports.appNameQuestion = exports.getSolutionName = exports.folderQuestion = exports.SPFxImportFolderQuestion = exports.SPFxWebpartNameQuestion = exports.SPFxFrameworkQuestion = exports.SPFxPackageSelectQuestion = exports.SPFxSolutionQuestion = exports.getProjectTypeAndCapability = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const m365_spec_parser_1 = require("@microsoft/m365-spec-parser");
|
|
8
8
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
9
9
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
10
10
|
const jsonschema = tslib_1.__importStar(require("jsonschema"));
|
|
11
|
-
const lodash_1 = require("lodash");
|
|
12
11
|
const os = tslib_1.__importStar(require("os"));
|
|
13
12
|
const path = tslib_1.__importStar(require("path"));
|
|
14
13
|
const constants_1 = require("../common/constants");
|
|
15
14
|
const correlator_1 = require("../common/correlator");
|
|
16
|
-
const
|
|
15
|
+
const daSpecParser_1 = require("../common/daSpecParser");
|
|
17
16
|
const globalVars_1 = require("../common/globalVars");
|
|
17
|
+
const kiotaClient_1 = require("../common/kiotaClient");
|
|
18
18
|
const localizeUtils_1 = require("../common/localizeUtils");
|
|
19
19
|
const samples_1 = require("../common/samples");
|
|
20
20
|
const stringUtils_1 = require("../common/stringUtils");
|
|
21
21
|
const telemetry_1 = require("../common/telemetry");
|
|
22
22
|
const PluginManifestUtils_1 = require("../component/driver/teamsApp/utils/PluginManifestUtils");
|
|
23
23
|
const utils_1 = require("../component/driver/teamsApp/utils/utils");
|
|
24
|
+
const constant_1 = require("../component/generator/constant");
|
|
24
25
|
const helper_1 = require("../component/generator/declarativeAgent/helper");
|
|
25
26
|
const helper_2 = require("../component/generator/openApiSpec/helper");
|
|
26
27
|
const error_1 = require("../component/generator/spfx/error");
|
|
27
28
|
const constants_2 = require("../component/generator/spfx/utils/constants");
|
|
28
29
|
const utils_2 = require("../component/generator/spfx/utils/utils");
|
|
30
|
+
const templateNames_1 = require("../component/generator/templates/templateNames");
|
|
29
31
|
const error_2 = require("../error");
|
|
30
32
|
const constants_3 = require("./constants");
|
|
31
|
-
const
|
|
32
|
-
const
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
function projectTypeQuestion() {
|
|
36
|
-
const staticOptions = [
|
|
37
|
-
constants_3.ProjectTypeOptions.bot(teamsfx_api_1.Platform.CLI),
|
|
38
|
-
constants_3.ProjectTypeOptions.tab(teamsfx_api_1.Platform.CLI),
|
|
39
|
-
constants_3.ProjectTypeOptions.me(teamsfx_api_1.Platform.CLI),
|
|
40
|
-
constants_3.ProjectTypeOptions.outlookAddin(teamsfx_api_1.Platform.CLI),
|
|
41
|
-
];
|
|
42
|
-
return {
|
|
43
|
-
name: constants_3.QuestionNames.ProjectType,
|
|
44
|
-
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.title"),
|
|
45
|
-
type: "singleSelect",
|
|
46
|
-
staticOptions: staticOptions,
|
|
47
|
-
dynamicOptions: (inputs) => {
|
|
48
|
-
var _a;
|
|
49
|
-
const staticOptions = [];
|
|
50
|
-
staticOptions.push(constants_3.ProjectTypeOptions.Agent(inputs.platform));
|
|
51
|
-
if ((0, constants_3.getRuntime)(inputs) === constants_3.RuntimeOptions.NodeJS().id) {
|
|
52
|
-
staticOptions.push(constants_3.ProjectTypeOptions.customCopilot(inputs.platform));
|
|
53
|
-
}
|
|
54
|
-
staticOptions.push(constants_3.ProjectTypeOptions.bot(inputs.platform), constants_3.ProjectTypeOptions.tab(inputs.platform), constants_3.ProjectTypeOptions.me(inputs.platform));
|
|
55
|
-
if (isFromDevPortal(inputs)) {
|
|
56
|
-
const projectType = (_a = getProjectTypeAndCapability(inputs.teamsAppFromTdp)) === null || _a === void 0 ? void 0 : _a.projectType;
|
|
57
|
-
if (projectType) {
|
|
58
|
-
return [projectType];
|
|
59
|
-
}
|
|
60
|
-
}
|
|
61
|
-
else if ((0, constants_3.getRuntime)(inputs) === constants_3.RuntimeOptions.NodeJS().id) {
|
|
62
|
-
if (featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.OfficeMetaOS)) {
|
|
63
|
-
staticOptions.push(constants_3.ProjectTypeOptions.officeMetaOS(inputs.platform));
|
|
64
|
-
}
|
|
65
|
-
else {
|
|
66
|
-
staticOptions.push(constants_3.ProjectTypeOptions.outlookAddin(inputs.platform));
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
if (inputs.platform === teamsfx_api_1.Platform.VSCode &&
|
|
70
|
-
featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.ChatParticipantUIEntries) &&
|
|
71
|
-
!inputs.teamsAppFromTdp) {
|
|
72
|
-
staticOptions.push(constants_3.ProjectTypeOptions.startWithGithubCopilot());
|
|
73
|
-
}
|
|
74
|
-
return staticOptions;
|
|
75
|
-
},
|
|
76
|
-
placeholder: (0, localizeUtils_1.getLocalizedString)("core.getCreateNewOrFromSampleQuestion.placeholder"),
|
|
77
|
-
forgetLastValue: true,
|
|
78
|
-
skipSingleOption: true,
|
|
79
|
-
};
|
|
80
|
-
}
|
|
81
|
-
exports.projectTypeQuestion = projectTypeQuestion;
|
|
33
|
+
const CapabilityOptions_1 = require("./scaffold/vsc/CapabilityOptions");
|
|
34
|
+
const ProjectTypeOptions_1 = require("./scaffold/vsc/ProjectTypeOptions");
|
|
35
|
+
const utils_3 = require("./utils");
|
|
36
|
+
const ManifestUtils_1 = require("../component/driver/teamsApp/utils/ManifestUtils");
|
|
82
37
|
function getProjectTypeAndCapability(teamsApp) {
|
|
83
38
|
// tab with bot, tab with message extension, tab with bot and message extension
|
|
84
39
|
if ((0, utils_1.needTabAndBotCode)(teamsApp)) {
|
|
85
|
-
return { projectType: "tab-bot-type", templateId:
|
|
40
|
+
return { projectType: "tab-bot-type", templateId: CapabilityOptions_1.TdpCapabilityOptions.nonSsoTabAndBot().id };
|
|
86
41
|
}
|
|
87
42
|
// tab only
|
|
88
43
|
if ((0, utils_1.needTabCode)(teamsApp)) {
|
|
89
|
-
return { projectType: "tab-type", templateId:
|
|
44
|
+
return { projectType: "tab-type", templateId: CapabilityOptions_1.TdpCapabilityOptions.nonSsoTab().id };
|
|
90
45
|
}
|
|
91
46
|
// bot and message extension
|
|
92
47
|
if ((0, utils_1.isBotAndBotBasedMessageExtension)(teamsApp)) {
|
|
93
|
-
return { projectType: "bot-me-type", templateId:
|
|
48
|
+
return { projectType: "bot-me-type", templateId: CapabilityOptions_1.TdpCapabilityOptions.botAndMe().id };
|
|
94
49
|
}
|
|
95
50
|
// bot based message extension
|
|
96
51
|
if ((0, utils_1.isBotBasedMessageExtension)(teamsApp)) {
|
|
97
|
-
return { projectType: "me-type", templateId:
|
|
52
|
+
return { projectType: "me-type", templateId: CapabilityOptions_1.TdpCapabilityOptions.me().id };
|
|
98
53
|
}
|
|
99
54
|
// bot
|
|
100
55
|
if ((0, utils_1.isBot)(teamsApp)) {
|
|
101
|
-
return { projectType: "bot-type", templateId:
|
|
56
|
+
return { projectType: "bot-type", templateId: CapabilityOptions_1.BotCapabilityOptions.basicBot().id };
|
|
102
57
|
}
|
|
103
58
|
return undefined;
|
|
104
59
|
}
|
|
105
60
|
exports.getProjectTypeAndCapability = getProjectTypeAndCapability;
|
|
106
|
-
function isFromDevPortal(inputs) {
|
|
107
|
-
return !!(inputs === null || inputs === void 0 ? void 0 : inputs.teamsAppFromTdp);
|
|
108
|
-
}
|
|
109
|
-
exports.isFromDevPortal = isFromDevPortal;
|
|
110
|
-
function capabilityQuestion() {
|
|
111
|
-
return {
|
|
112
|
-
name: constants_3.QuestionNames.Capabilities,
|
|
113
|
-
title: (inputs) => {
|
|
114
|
-
const projectType = inputs[constants_3.QuestionNames.ProjectType];
|
|
115
|
-
switch (projectType) {
|
|
116
|
-
case constants_3.ProjectTypeOptions.bot().id:
|
|
117
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.bot.title");
|
|
118
|
-
case constants_3.ProjectTypeOptions.tab().id:
|
|
119
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.tab.title");
|
|
120
|
-
case constants_3.ProjectTypeOptions.me().id:
|
|
121
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.messageExtension.title");
|
|
122
|
-
case constants_3.ProjectTypeOptions.outlookAddin().id:
|
|
123
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.outlookAddin.title");
|
|
124
|
-
case constants_3.ProjectTypeOptions.officeMetaOS().id:
|
|
125
|
-
case constants_3.ProjectTypeOptions.Agent().id:
|
|
126
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.copilotExtension.title");
|
|
127
|
-
case constants_3.ProjectTypeOptions.customCopilot().id:
|
|
128
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.customCopilot.title");
|
|
129
|
-
default:
|
|
130
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createCapabilityQuestion.titleNew");
|
|
131
|
-
}
|
|
132
|
-
},
|
|
133
|
-
cliDescription: "Specifies the Microsoft Teams App capability.",
|
|
134
|
-
cliName: constants_3.CliQuestionName.Capability,
|
|
135
|
-
cliShortName: "c",
|
|
136
|
-
cliChoiceListCommand: "teamsapp list templates",
|
|
137
|
-
type: "singleSelect",
|
|
138
|
-
staticOptions: constants_3.CapabilityOptions.staticAll(),
|
|
139
|
-
dynamicOptions: (inputs) => {
|
|
140
|
-
var _a;
|
|
141
|
-
// from dev portal
|
|
142
|
-
if (isFromDevPortal(inputs)) {
|
|
143
|
-
const capability = (_a = getProjectTypeAndCapability(inputs.teamsAppFromTdp)) === null || _a === void 0 ? void 0 : _a.templateId;
|
|
144
|
-
if (capability) {
|
|
145
|
-
return [capability];
|
|
146
|
-
}
|
|
147
|
-
}
|
|
148
|
-
// dotnet capabilities
|
|
149
|
-
if (inputs.platform === teamsfx_api_1.Platform.VS) {
|
|
150
|
-
return constants_3.CapabilityOptions.dotnetCaps(inputs);
|
|
151
|
-
}
|
|
152
|
-
if (inputs.nonInteractive && inputs.platform === teamsfx_api_1.Platform.CLI) {
|
|
153
|
-
//cli non-interactive mode the choice list is the same as staticOptions
|
|
154
|
-
return constants_3.CapabilityOptions.all(inputs);
|
|
155
|
-
}
|
|
156
|
-
// capabilities if VSC or CLI interactive mode
|
|
157
|
-
const projectType = inputs[constants_3.QuestionNames.ProjectType];
|
|
158
|
-
if (projectType === constants_3.ProjectTypeOptions.bot().id) {
|
|
159
|
-
return constants_3.CapabilityOptions.bots(inputs);
|
|
160
|
-
}
|
|
161
|
-
else if (projectType === constants_3.ProjectTypeOptions.tab().id) {
|
|
162
|
-
return constants_3.CapabilityOptions.tabs();
|
|
163
|
-
}
|
|
164
|
-
else if (projectType === constants_3.ProjectTypeOptions.me().id) {
|
|
165
|
-
return constants_3.CapabilityOptions.mes();
|
|
166
|
-
}
|
|
167
|
-
else if (constants_3.ProjectTypeOptions.officeAddinAllIds().includes(projectType)) {
|
|
168
|
-
return constants_3.CapabilityOptions.officeAddinCapabilities(projectType);
|
|
169
|
-
}
|
|
170
|
-
else if (projectType === constants_3.ProjectTypeOptions.Agent().id) {
|
|
171
|
-
return constants_3.CapabilityOptions.agents();
|
|
172
|
-
}
|
|
173
|
-
else if (projectType === constants_3.ProjectTypeOptions.customCopilot().id) {
|
|
174
|
-
return constants_3.CapabilityOptions.customCopilots();
|
|
175
|
-
}
|
|
176
|
-
else {
|
|
177
|
-
return constants_3.CapabilityOptions.all(inputs);
|
|
178
|
-
}
|
|
179
|
-
},
|
|
180
|
-
placeholder: (inputs) => {
|
|
181
|
-
if (inputs[constants_3.QuestionNames.ProjectType] === constants_3.ProjectTypeOptions.Agent().id) {
|
|
182
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.copilotExtension.placeholder");
|
|
183
|
-
}
|
|
184
|
-
else if (inputs[constants_3.QuestionNames.ProjectType] === constants_3.ProjectTypeOptions.customCopilot().id) {
|
|
185
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.customCopilot.placeholder");
|
|
186
|
-
}
|
|
187
|
-
return (0, localizeUtils_1.getLocalizedString)("core.createCapabilityQuestion.placeholder");
|
|
188
|
-
},
|
|
189
|
-
forgetLastValue: true,
|
|
190
|
-
skipSingleOption: (inputs) => {
|
|
191
|
-
const projectType = inputs[constants_3.QuestionNames.ProjectType];
|
|
192
|
-
if (projectType === constants_3.ProjectTypeOptions.Agent().id) {
|
|
193
|
-
return true;
|
|
194
|
-
}
|
|
195
|
-
return isFromDevPortal(inputs);
|
|
196
|
-
},
|
|
197
|
-
};
|
|
198
|
-
}
|
|
199
|
-
exports.capabilityQuestion = capabilityQuestion;
|
|
200
|
-
function meArchitectureQuestion() {
|
|
201
|
-
return {
|
|
202
|
-
name: constants_3.QuestionNames.MeArchitectureType,
|
|
203
|
-
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.meArchitecture.title"),
|
|
204
|
-
cliDescription: "Architecture of Search Based Message Extension.",
|
|
205
|
-
cliShortName: "m",
|
|
206
|
-
type: "singleSelect",
|
|
207
|
-
staticOptions: constants_3.MeArchitectureOptions.staticAll(),
|
|
208
|
-
dynamicOptions: (inputs) => {
|
|
209
|
-
return constants_3.MeArchitectureOptions.all();
|
|
210
|
-
},
|
|
211
|
-
default: constants_3.MeArchitectureOptions.newApi().id,
|
|
212
|
-
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.copilotExtension.placeholder"),
|
|
213
|
-
forgetLastValue: true,
|
|
214
|
-
skipSingleOption: true,
|
|
215
|
-
};
|
|
216
|
-
}
|
|
217
|
-
exports.meArchitectureQuestion = meArchitectureQuestion;
|
|
218
|
-
function botTriggerQuestion() {
|
|
219
|
-
return {
|
|
220
|
-
name: constants_3.QuestionNames.BotTrigger,
|
|
221
|
-
title: (0, localizeUtils_1.getLocalizedString)("plugins.bot.questionHostTypeTrigger.title"),
|
|
222
|
-
cliDescription: "Specifies the trigger for `Chat Notification Message` app template.",
|
|
223
|
-
cliShortName: "t",
|
|
224
|
-
type: "singleSelect",
|
|
225
|
-
staticOptions: constants_3.NotificationTriggerOptions.all(),
|
|
226
|
-
dynamicOptions: (inputs) => {
|
|
227
|
-
const runtime = (0, constants_3.getRuntime)(inputs);
|
|
228
|
-
return [
|
|
229
|
-
runtime === constants_3.RuntimeOptions.DotNet().id
|
|
230
|
-
? constants_3.NotificationTriggerOptions.appServiceForVS()
|
|
231
|
-
: constants_3.NotificationTriggerOptions.appService(),
|
|
232
|
-
...constants_3.NotificationTriggerOptions.functionsTriggers(),
|
|
233
|
-
];
|
|
234
|
-
},
|
|
235
|
-
default: (inputs) => {
|
|
236
|
-
const runtime = (0, constants_3.getRuntime)(inputs);
|
|
237
|
-
return runtime === constants_3.RuntimeOptions.DotNet().id
|
|
238
|
-
? constants_3.NotificationTriggerOptions.appServiceForVS().id
|
|
239
|
-
: constants_3.NotificationTriggerOptions.appService().id;
|
|
240
|
-
},
|
|
241
|
-
placeholder: (0, localizeUtils_1.getLocalizedString)("plugins.bot.questionHostTypeTrigger.placeholder"),
|
|
242
|
-
};
|
|
243
|
-
}
|
|
244
|
-
exports.botTriggerQuestion = botTriggerQuestion;
|
|
245
61
|
function SPFxSolutionQuestion() {
|
|
246
62
|
return {
|
|
247
63
|
type: "singleSelect",
|
|
@@ -382,71 +198,6 @@ function SPFxImportFolderQuestion(hasDefaultFunc = false) {
|
|
|
382
198
|
};
|
|
383
199
|
}
|
|
384
200
|
exports.SPFxImportFolderQuestion = SPFxImportFolderQuestion;
|
|
385
|
-
function getLanguageOptions(inputs) {
|
|
386
|
-
const runtime = (0, constants_3.getRuntime)(inputs);
|
|
387
|
-
// dotnet runtime only supports C#
|
|
388
|
-
if (runtime === constants_3.RuntimeOptions.DotNet().id) {
|
|
389
|
-
return [{ id: constants_3.ProgrammingLanguage.CSharp, label: "C#" }];
|
|
390
|
-
}
|
|
391
|
-
const capabilities = inputs[constants_3.QuestionNames.Capabilities];
|
|
392
|
-
if (capabilities === constants_3.CapabilityOptions.SPFxTab().id) {
|
|
393
|
-
// SPFx only supports typescript
|
|
394
|
-
return [{ id: constants_3.ProgrammingLanguage.TS, label: "TypeScript" }];
|
|
395
|
-
}
|
|
396
|
-
else if (constants_3.capabilitiesHavePythonOption.includes(inputs[capabilities] ? inputs[capabilities] : capabilities) &&
|
|
397
|
-
!(capabilities == constants_3.CapabilityOptions.customCopilotRag().id &&
|
|
398
|
-
inputs[constants_3.CapabilityOptions.customCopilotRag().id] == constants_3.CustomCopilotRagOptions.microsoft365().id)) {
|
|
399
|
-
// support python language
|
|
400
|
-
return [
|
|
401
|
-
{ id: constants_3.ProgrammingLanguage.JS, label: "JavaScript" },
|
|
402
|
-
{ id: constants_3.ProgrammingLanguage.TS, label: "TypeScript" },
|
|
403
|
-
{ id: constants_3.ProgrammingLanguage.PY, label: "Python" },
|
|
404
|
-
];
|
|
405
|
-
}
|
|
406
|
-
else {
|
|
407
|
-
// other cases
|
|
408
|
-
return [
|
|
409
|
-
{ id: constants_3.ProgrammingLanguage.JS, label: "JavaScript" },
|
|
410
|
-
{ id: constants_3.ProgrammingLanguage.TS, label: "TypeScript" },
|
|
411
|
-
];
|
|
412
|
-
}
|
|
413
|
-
}
|
|
414
|
-
exports.getLanguageOptions = getLanguageOptions;
|
|
415
|
-
function programmingLanguageQuestion() {
|
|
416
|
-
const programmingLanguageQuestion = {
|
|
417
|
-
name: constants_3.QuestionNames.ProgrammingLanguage,
|
|
418
|
-
cliShortName: "l",
|
|
419
|
-
title: (0, localizeUtils_1.getLocalizedString)("core.ProgrammingLanguageQuestion.title"),
|
|
420
|
-
type: "singleSelect",
|
|
421
|
-
staticOptions: [
|
|
422
|
-
{ id: constants_3.ProgrammingLanguage.JS, label: "JavaScript" },
|
|
423
|
-
{ id: constants_3.ProgrammingLanguage.TS, label: "TypeScript" },
|
|
424
|
-
{ id: constants_3.ProgrammingLanguage.CSharp, label: "C#" },
|
|
425
|
-
{ id: constants_3.ProgrammingLanguage.PY, label: "Python" },
|
|
426
|
-
],
|
|
427
|
-
dynamicOptions: getLanguageOptions,
|
|
428
|
-
default: (inputs) => {
|
|
429
|
-
return getLanguageOptions(inputs)[0].id;
|
|
430
|
-
},
|
|
431
|
-
placeholder: (inputs) => {
|
|
432
|
-
const runtime = (0, constants_3.getRuntime)(inputs);
|
|
433
|
-
// dotnet
|
|
434
|
-
if (runtime === constants_3.RuntimeOptions.DotNet().id) {
|
|
435
|
-
return "";
|
|
436
|
-
}
|
|
437
|
-
const capabilities = inputs[constants_3.QuestionNames.Capabilities];
|
|
438
|
-
// SPFx
|
|
439
|
-
if (capabilities === constants_3.CapabilityOptions.SPFxTab().id) {
|
|
440
|
-
return (0, localizeUtils_1.getLocalizedString)("core.ProgrammingLanguageQuestion.placeholder.spfx");
|
|
441
|
-
}
|
|
442
|
-
// other
|
|
443
|
-
return (0, localizeUtils_1.getLocalizedString)("core.ProgrammingLanguageQuestion.placeholder");
|
|
444
|
-
},
|
|
445
|
-
skipSingleOption: true,
|
|
446
|
-
};
|
|
447
|
-
return programmingLanguageQuestion;
|
|
448
|
-
}
|
|
449
|
-
exports.programmingLanguageQuestion = programmingLanguageQuestion;
|
|
450
201
|
function folderQuestion() {
|
|
451
202
|
return {
|
|
452
203
|
type: "folder",
|
|
@@ -545,7 +296,7 @@ function sampleSelectQuestion() {
|
|
|
545
296
|
type: "singleSelect",
|
|
546
297
|
name: constants_3.QuestionNames.Samples,
|
|
547
298
|
cliName: "sample-name",
|
|
548
|
-
cliDescription: "Specifies the
|
|
299
|
+
cliDescription: "Specifies the app sample name.",
|
|
549
300
|
cliChoiceListCommand: "teamsapp list samples",
|
|
550
301
|
skipValidation: true,
|
|
551
302
|
cliType: "argument",
|
|
@@ -599,17 +350,6 @@ function sampleSelectQuestion() {
|
|
|
599
350
|
],
|
|
600
351
|
};
|
|
601
352
|
}
|
|
602
|
-
function runtimeQuestion() {
|
|
603
|
-
return {
|
|
604
|
-
type: "singleSelect",
|
|
605
|
-
name: constants_3.QuestionNames.Runtime,
|
|
606
|
-
title: (0, localizeUtils_1.getLocalizedString)("core.getRuntimeQuestion.title"),
|
|
607
|
-
staticOptions: [constants_3.RuntimeOptions.NodeJS(), constants_3.RuntimeOptions.DotNet()],
|
|
608
|
-
default: constants_3.RuntimeOptions.NodeJS().id,
|
|
609
|
-
placeholder: (0, localizeUtils_1.getLocalizedString)("core.getRuntimeQuestion.placeholder"),
|
|
610
|
-
cliHidden: true,
|
|
611
|
-
};
|
|
612
|
-
}
|
|
613
353
|
const defaultTabLocalHostUrl = "https://localhost:53000/index.html#/tab";
|
|
614
354
|
const tabContentUrlOptionItem = (tab) => {
|
|
615
355
|
return {
|
|
@@ -635,6 +375,7 @@ function getTabWebsiteOptions(inputs) {
|
|
|
635
375
|
}
|
|
636
376
|
return [];
|
|
637
377
|
}
|
|
378
|
+
exports.getTabWebsiteOptions = getTabWebsiteOptions;
|
|
638
379
|
function selectTabWebsiteUrlQuestion() {
|
|
639
380
|
return {
|
|
640
381
|
type: "multiSelect",
|
|
@@ -935,7 +676,8 @@ function apiOperationQuestion(includeExistingAPIs = true, isAddPlugin = false) {
|
|
|
935
676
|
if (input.length < 1 ||
|
|
936
677
|
(input.length > 10 &&
|
|
937
678
|
inputs[constants_3.QuestionNames.CustomCopilotRag] !== constants_3.CustomCopilotRagOptions.customApi().id &&
|
|
938
|
-
inputs[constants_3.QuestionNames.ProjectType] !==
|
|
679
|
+
inputs[constants_3.QuestionNames.ProjectType] !== ProjectTypeOptions_1.ProjectTypeOptions.copilotAgentOptionId &&
|
|
680
|
+
inputs[constants_3.QuestionNames.ActionType] !== constants_3.ActionStartOptions.apiSpec().id)) {
|
|
939
681
|
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.apiSpec.operation.invalidMessage", input.length, 10);
|
|
940
682
|
}
|
|
941
683
|
const operations = inputs.supportedApisFromApiSpec;
|
|
@@ -1085,34 +827,23 @@ function azureOpenAIDeploymentNameQuestion() {
|
|
|
1085
827
|
};
|
|
1086
828
|
}
|
|
1087
829
|
exports.azureOpenAIDeploymentNameQuestion = azureOpenAIDeploymentNameQuestion;
|
|
1088
|
-
function declarativeCopilotPluginQuestion() {
|
|
1089
|
-
return {
|
|
1090
|
-
type: "singleSelect",
|
|
1091
|
-
name: constants_3.QuestionNames.WithPlugin,
|
|
1092
|
-
title: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.declarativeCopilot.title"),
|
|
1093
|
-
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.declarativeCopilot.placeholder"),
|
|
1094
|
-
cliDescription: "Whether to add API plugin for your declarative Copilot.",
|
|
1095
|
-
staticOptions: constants_3.DeclarativeCopilotTypeOptions.all(),
|
|
1096
|
-
default: constants_3.DeclarativeCopilotTypeOptions.noPlugin().id,
|
|
1097
|
-
};
|
|
1098
|
-
}
|
|
1099
830
|
function apiPluginStartQuestion(doesProjectExists) {
|
|
1100
831
|
return {
|
|
1101
832
|
type: "singleSelect",
|
|
1102
833
|
name: constants_3.QuestionNames.ActionType,
|
|
1103
834
|
title: (inputs) => {
|
|
1104
|
-
return inputs[constants_3.QuestionNames.Capabilities] ===
|
|
835
|
+
return inputs[constants_3.QuestionNames.Capabilities] === CapabilityOptions_1.DACapabilityOptions.declarativeAgent().id ||
|
|
1105
836
|
doesProjectExists
|
|
1106
837
|
? (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.addApiPlugin.title")
|
|
1107
838
|
: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.createApiPlugin.title");
|
|
1108
839
|
},
|
|
1109
840
|
placeholder: (inputs) => {
|
|
1110
|
-
return inputs[constants_3.QuestionNames.Capabilities] ===
|
|
841
|
+
return inputs[constants_3.QuestionNames.Capabilities] === CapabilityOptions_1.DACapabilityOptions.declarativeAgent().id ||
|
|
1111
842
|
doesProjectExists
|
|
1112
843
|
? (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.addApiPlugin.placeholder")
|
|
1113
844
|
: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.projectType.copilotExtension.placeholder");
|
|
1114
845
|
},
|
|
1115
|
-
cliDescription: "
|
|
846
|
+
cliDescription: "Action type.",
|
|
1116
847
|
staticOptions: constants_3.ActionStartOptions.staticAll(doesProjectExists),
|
|
1117
848
|
dynamicOptions: (inputs) => {
|
|
1118
849
|
return constants_3.ActionStartOptions.all(inputs, doesProjectExists);
|
|
@@ -1121,6 +852,146 @@ function apiPluginStartQuestion(doesProjectExists) {
|
|
|
1121
852
|
};
|
|
1122
853
|
}
|
|
1123
854
|
exports.apiPluginStartQuestion = apiPluginStartQuestion;
|
|
855
|
+
function selectExistingPluginManifestQuestion() {
|
|
856
|
+
return {
|
|
857
|
+
type: "singleSelect",
|
|
858
|
+
name: constants_3.QuestionNames.SelectPluginManifest,
|
|
859
|
+
title: (0, localizeUtils_1.getLocalizedString)("core.regenerateQuestion.selectPluginManifestTitle"),
|
|
860
|
+
cliDescription: "Select plugin manifest file.",
|
|
861
|
+
staticOptions: [],
|
|
862
|
+
onDidSelection: (item, inputs) => {
|
|
863
|
+
inputs[constants_3.QuestionNames.SelectPluginId] = item.data;
|
|
864
|
+
},
|
|
865
|
+
dynamicOptions: async (inputs) => {
|
|
866
|
+
var _a, _b, _c;
|
|
867
|
+
if (!inputs.projectPath) {
|
|
868
|
+
throw new Error("projectPath is undefined");
|
|
869
|
+
}
|
|
870
|
+
const options = [];
|
|
871
|
+
const manifestPath = path.join(inputs.projectPath, teamsfx_api_1.AppPackageFolderName, teamsfx_api_1.ManifestTemplateFileName);
|
|
872
|
+
inputs[constants_3.QuestionNames.ManifestPath] = manifestPath;
|
|
873
|
+
const manifestRes = await ManifestUtils_1.manifestUtils._readAppManifest(manifestPath);
|
|
874
|
+
if (manifestRes.isErr()) {
|
|
875
|
+
throw manifestRes.error;
|
|
876
|
+
}
|
|
877
|
+
const manifest = manifestRes.value;
|
|
878
|
+
const declarativeAgentPathRelativePath = (_c = (_b = (_a = manifest === null || manifest === void 0 ? void 0 : manifest.copilotAgents) === null || _a === void 0 ? void 0 : _a.declarativeAgents) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.file;
|
|
879
|
+
if (!declarativeAgentPathRelativePath) {
|
|
880
|
+
throw new error_2.DeclarativeAgentPathNotFoundError(manifestPath);
|
|
881
|
+
}
|
|
882
|
+
const declarativeAgentPath = path.join(inputs.projectPath, teamsfx_api_1.AppPackageFolderName, declarativeAgentPathRelativePath);
|
|
883
|
+
const declarativeAgentJson = (await fs_extra_1.default.readJSON(declarativeAgentPath));
|
|
884
|
+
const actions = declarativeAgentJson.actions;
|
|
885
|
+
if (!actions || actions.length === 0) {
|
|
886
|
+
throw new error_2.ActionNotFoundError(declarativeAgentPath);
|
|
887
|
+
}
|
|
888
|
+
for (const action of actions) {
|
|
889
|
+
const actionName = action.file;
|
|
890
|
+
options.push({
|
|
891
|
+
id: path.join(inputs.projectPath, teamsfx_api_1.AppPackageFolderName, actionName),
|
|
892
|
+
label: path.basename(actionName),
|
|
893
|
+
data: action.id,
|
|
894
|
+
});
|
|
895
|
+
}
|
|
896
|
+
return options;
|
|
897
|
+
},
|
|
898
|
+
};
|
|
899
|
+
}
|
|
900
|
+
exports.selectExistingPluginManifestQuestion = selectExistingPluginManifestQuestion;
|
|
901
|
+
function selectOpenAPISpecFromPluginQuestion() {
|
|
902
|
+
return {
|
|
903
|
+
type: "singleSelect",
|
|
904
|
+
name: constants_3.QuestionNames.SelectOpenAPISpecFromPlugin,
|
|
905
|
+
title: (0, localizeUtils_1.getLocalizedString)("core.regenerateQuestion.selectOpenAPISpecFromPluginTitle"),
|
|
906
|
+
cliDescription: "Select OpenAPI description document file.",
|
|
907
|
+
staticOptions: [],
|
|
908
|
+
onDidSelection: (itemOrId, inputs) => {
|
|
909
|
+
inputs[constants_3.QuestionNames.ActionType] = constants_3.DeclarativeAgentApiSpecOptionId;
|
|
910
|
+
},
|
|
911
|
+
dynamicOptions: async (inputs) => {
|
|
912
|
+
var _a;
|
|
913
|
+
const pluginPath = inputs[constants_3.QuestionNames.SelectPluginManifest];
|
|
914
|
+
const options = [];
|
|
915
|
+
const pluginManifest = await fs_extra_1.default.readJSON(inputs[constants_3.QuestionNames.SelectPluginManifest]);
|
|
916
|
+
const specUrlMap = new Map();
|
|
917
|
+
(_a = pluginManifest.runtimes) === null || _a === void 0 ? void 0 : _a.forEach((runtime) => {
|
|
918
|
+
if (runtime.spec) {
|
|
919
|
+
const specPath = runtime.spec.url;
|
|
920
|
+
const functions = runtime.run_for_functions;
|
|
921
|
+
if (specUrlMap.has(specPath)) {
|
|
922
|
+
const existingValue = specUrlMap.get(specPath);
|
|
923
|
+
if (existingValue) {
|
|
924
|
+
existingValue.push(...(functions !== null && functions !== void 0 ? functions : []));
|
|
925
|
+
}
|
|
926
|
+
}
|
|
927
|
+
else {
|
|
928
|
+
specUrlMap.set(specPath, functions !== null && functions !== void 0 ? functions : []);
|
|
929
|
+
}
|
|
930
|
+
}
|
|
931
|
+
});
|
|
932
|
+
specUrlMap.forEach((value, key) => {
|
|
933
|
+
const specAbsolutePath = path.join(path.dirname(pluginPath), key);
|
|
934
|
+
options.push({
|
|
935
|
+
id: specAbsolutePath,
|
|
936
|
+
label: key,
|
|
937
|
+
});
|
|
938
|
+
});
|
|
939
|
+
if (options.length === 0) {
|
|
940
|
+
throw new error_2.SpecNotFoundError(pluginPath);
|
|
941
|
+
}
|
|
942
|
+
return options;
|
|
943
|
+
},
|
|
944
|
+
};
|
|
945
|
+
}
|
|
946
|
+
exports.selectOpenAPISpecFromPluginQuestion = selectOpenAPISpecFromPluginQuestion;
|
|
947
|
+
function selectApiOperationForRegenerateQuestion() {
|
|
948
|
+
return {
|
|
949
|
+
type: "multiSelect",
|
|
950
|
+
name: constants_3.QuestionNames.ApiOperation,
|
|
951
|
+
title: (0, localizeUtils_1.getLocalizedString)("core.regenerateQuestion.selectApiOperationForRegenerateTitle"),
|
|
952
|
+
cliDescription: "Select operation(s) Copilot can interact with.",
|
|
953
|
+
cliShortName: "o",
|
|
954
|
+
placeholder: (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.apiSpec.operation.plugin.placeholder"),
|
|
955
|
+
forgetLastValue: true,
|
|
956
|
+
staticOptions: [],
|
|
957
|
+
validation: {
|
|
958
|
+
validFunc: (input, inputs) => {
|
|
959
|
+
const operations = inputs.supportedApisFromApiSpec;
|
|
960
|
+
const serverUrls = new Set();
|
|
961
|
+
for (const inputItem of input) {
|
|
962
|
+
const operation = operations.find((op) => op.id === inputItem);
|
|
963
|
+
if (operation) {
|
|
964
|
+
serverUrls.add(operation.data.serverUrl);
|
|
965
|
+
}
|
|
966
|
+
}
|
|
967
|
+
if (serverUrls.size > 1) {
|
|
968
|
+
return (0, localizeUtils_1.getLocalizedString)("core.createProjectQuestion.apiSpec.operation.multipleServer", Array.from(serverUrls).join(", "));
|
|
969
|
+
}
|
|
970
|
+
},
|
|
971
|
+
},
|
|
972
|
+
dynamicOptions: async (inputs) => {
|
|
973
|
+
const specUrl = inputs[constants_3.QuestionNames.SelectOpenAPISpecFromPlugin] + ".original";
|
|
974
|
+
if (!(await fs_extra_1.default.pathExists(specUrl))) {
|
|
975
|
+
throw new error_2.OriginalSpecNotFoundError(specUrl);
|
|
976
|
+
}
|
|
977
|
+
inputs[constants_3.QuestionNames.ApiSpecLocation] = specUrl;
|
|
978
|
+
const context = (0, globalVars_1.createContext)();
|
|
979
|
+
const res = await (0, helper_2.listOperations)(context, specUrl, inputs, true, false);
|
|
980
|
+
if (res.isOk()) {
|
|
981
|
+
inputs.supportedApisFromApiSpec = res.value;
|
|
982
|
+
}
|
|
983
|
+
else {
|
|
984
|
+
throw res.error;
|
|
985
|
+
}
|
|
986
|
+
if (!inputs.supportedApisFromApiSpec || inputs.supportedApisFromApiSpec.length === 0) {
|
|
987
|
+
throw new error_2.EmptyOptionError(constants_3.QuestionNames.ApiOperation, "question");
|
|
988
|
+
}
|
|
989
|
+
const operations = inputs.supportedApisFromApiSpec;
|
|
990
|
+
return operations;
|
|
991
|
+
},
|
|
992
|
+
};
|
|
993
|
+
}
|
|
994
|
+
exports.selectApiOperationForRegenerateQuestion = selectApiOperationForRegenerateQuestion;
|
|
1124
995
|
function pluginManifestQuestion() {
|
|
1125
996
|
const correlationId = correlator_1.Correlator.getId();
|
|
1126
997
|
return {
|
|
@@ -1325,15 +1196,13 @@ function GCInputQuestion() {
|
|
|
1325
1196
|
type: "text",
|
|
1326
1197
|
name: constants_3.QuestionNames.GCInput,
|
|
1327
1198
|
title: (0, localizeUtils_1.getLocalizedString)("core.GCInputQuestion.title"),
|
|
1328
|
-
cliDescription: "a connection ID for
|
|
1199
|
+
cliDescription: "a connection ID for Copilot Connector",
|
|
1329
1200
|
forgetLastValue: true,
|
|
1330
|
-
|
|
1201
|
+
validation: {
|
|
1331
1202
|
validFunc: (input, inputs) => {
|
|
1332
|
-
if (!
|
|
1333
|
-
|
|
1203
|
+
if (!input || input.trim().length === 0) {
|
|
1204
|
+
return "Please enter a connection ID for Copilot Connector.";
|
|
1334
1205
|
}
|
|
1335
|
-
process.env[constants_3.QuestionNames.GCInput] = input;
|
|
1336
|
-
return;
|
|
1337
1206
|
},
|
|
1338
1207
|
},
|
|
1339
1208
|
};
|
|
@@ -1390,289 +1259,92 @@ function GCNameQuestion() {
|
|
|
1390
1259
|
name: constants_3.QuestionNames.GCName,
|
|
1391
1260
|
title: (0, localizeUtils_1.getLocalizedString)("core.GCNameQuestion.title"),
|
|
1392
1261
|
placeholder: (0, localizeUtils_1.getLocalizedString)("core.GCNameQuestion.placeholder"),
|
|
1393
|
-
cliDescription: "a
|
|
1262
|
+
cliDescription: "a name for Copilot Connector",
|
|
1394
1263
|
forgetLastValue: true,
|
|
1395
1264
|
additionalValidationOnAccept: {
|
|
1396
1265
|
validFunc: (input, inputs) => {
|
|
1397
|
-
|
|
1398
|
-
throw new Error("inputs is undefined"); // should never happen
|
|
1399
|
-
}
|
|
1400
|
-
process.env[constants_3.QuestionNames.GCName] = input;
|
|
1401
|
-
inputs[constants_3.QuestionNames.TemplateName] = templateNames_1.TemplateNames.GraphConnector;
|
|
1266
|
+
inputs = (0, utils_3.ensureInputs)(inputs);
|
|
1402
1267
|
inputs[constants_3.QuestionNames.ProgrammingLanguage] = constants_3.ProgrammingLanguage.TS;
|
|
1403
|
-
|
|
1268
|
+
// Set template name and app name for Copilot Connector Template
|
|
1269
|
+
if (inputs[constants_3.QuestionNames.ProjectType] !== ProjectTypeOptions_1.ProjectTypeOptions.copilotAgentOptionId) {
|
|
1270
|
+
inputs[constants_3.QuestionNames.TemplateName] = templateNames_1.TemplateNames.GraphConnector;
|
|
1271
|
+
inputs[constants_3.QuestionNames.AppName] = input;
|
|
1272
|
+
}
|
|
1404
1273
|
return;
|
|
1405
1274
|
},
|
|
1406
1275
|
},
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
1412
|
-
|
|
1413
|
-
|
|
1414
|
-
|
|
1415
|
-
|
|
1416
|
-
|
|
1417
|
-
|
|
1418
|
-
|
|
1419
|
-
|
|
1420
|
-
// SPFx sub-tree
|
|
1421
|
-
condition: { equals: constants_3.CapabilityOptions.SPFxTab().id },
|
|
1422
|
-
data: SPFxSolutionQuestion(),
|
|
1423
|
-
children: [
|
|
1424
|
-
{
|
|
1425
|
-
data: { type: "group" },
|
|
1426
|
-
children: [
|
|
1427
|
-
{ data: SPFxPackageSelectQuestion() },
|
|
1428
|
-
{ data: SPFxFrameworkQuestion() },
|
|
1429
|
-
{ data: SPFxWebpartNameQuestion() },
|
|
1430
|
-
],
|
|
1431
|
-
condition: { equals: "new" },
|
|
1432
|
-
},
|
|
1433
|
-
{
|
|
1434
|
-
data: SPFxImportFolderQuestion(),
|
|
1435
|
-
condition: { equals: "import" },
|
|
1436
|
-
},
|
|
1437
|
-
],
|
|
1438
|
-
},
|
|
1439
|
-
{
|
|
1440
|
-
// office addin import sub-tree (capabilities=office-addin-import | outlook-addin-import)
|
|
1441
|
-
condition: {
|
|
1442
|
-
enum: [
|
|
1443
|
-
constants_3.CapabilityOptions.outlookAddinImport().id,
|
|
1444
|
-
constants_3.CapabilityOptions.officeAddinImport().id,
|
|
1445
|
-
],
|
|
1446
|
-
},
|
|
1447
|
-
data: { type: "group", name: constants_3.QuestionNames.OfficeAddinImport },
|
|
1448
|
-
children: [
|
|
1449
|
-
{
|
|
1450
|
-
data: {
|
|
1451
|
-
type: "folder",
|
|
1452
|
-
name: constants_3.QuestionNames.OfficeAddinFolder,
|
|
1453
|
-
title: "Existing add-in project folder",
|
|
1454
|
-
},
|
|
1455
|
-
},
|
|
1456
|
-
{
|
|
1457
|
-
data: {
|
|
1458
|
-
type: "singleFile",
|
|
1459
|
-
name: constants_3.QuestionNames.OfficeAddinManifest,
|
|
1460
|
-
title: "Select import project manifest file",
|
|
1461
|
-
},
|
|
1462
|
-
},
|
|
1463
|
-
],
|
|
1464
|
-
},
|
|
1465
|
-
{
|
|
1466
|
-
// Search ME sub-tree
|
|
1467
|
-
condition: { equals: constants_3.CapabilityOptions.m365SearchMe().id },
|
|
1468
|
-
data: meArchitectureQuestion(),
|
|
1469
|
-
},
|
|
1470
|
-
{
|
|
1471
|
-
condition: { equals: constants_3.CapabilityOptions.declarativeAgent().id },
|
|
1472
|
-
data: declarativeCopilotPluginQuestion(),
|
|
1473
|
-
},
|
|
1474
|
-
{
|
|
1475
|
-
condition: (inputs) => {
|
|
1476
|
-
return (inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.apiPlugin().id ||
|
|
1477
|
-
inputs[constants_3.QuestionNames.WithPlugin] === constants_3.DeclarativeCopilotTypeOptions.withPlugin().id);
|
|
1478
|
-
},
|
|
1479
|
-
data: apiPluginStartQuestion(),
|
|
1480
|
-
},
|
|
1481
|
-
{
|
|
1482
|
-
condition: (inputs) => {
|
|
1483
|
-
return inputs[constants_3.QuestionNames.ActionType] === constants_3.ActionStartOptions.existingPlugin().id;
|
|
1484
|
-
},
|
|
1485
|
-
data: { type: "group", name: constants_3.QuestionNames.ImportPlugin },
|
|
1486
|
-
children: [
|
|
1487
|
-
{
|
|
1488
|
-
data: pluginManifestQuestion(),
|
|
1489
|
-
},
|
|
1490
|
-
{
|
|
1491
|
-
data: pluginApiSpecQuestion(),
|
|
1492
|
-
},
|
|
1493
|
-
],
|
|
1494
|
-
},
|
|
1495
|
-
{
|
|
1496
|
-
condition: (inputs) => {
|
|
1497
|
-
return (inputs[constants_3.QuestionNames.MeArchitectureType] == constants_3.MeArchitectureOptions.newApi().id ||
|
|
1498
|
-
inputs[constants_3.QuestionNames.ActionType] == constants_3.ActionStartOptions.newApi().id);
|
|
1499
|
-
},
|
|
1500
|
-
data: apiAuthQuestion(),
|
|
1501
|
-
},
|
|
1502
|
-
{
|
|
1503
|
-
condition: (inputs) => {
|
|
1504
|
-
return inputs[constants_3.QuestionNames.Capabilities] == constants_3.CapabilityOptions.customCopilotRag().id;
|
|
1505
|
-
},
|
|
1506
|
-
data: customCopilotRagQuestion(),
|
|
1507
|
-
},
|
|
1508
|
-
{
|
|
1509
|
-
// from API spec
|
|
1510
|
-
condition: (inputs) => {
|
|
1511
|
-
return ((inputs[constants_3.QuestionNames.ActionType] === constants_3.ActionStartOptions.apiSpec().id ||
|
|
1512
|
-
inputs[constants_3.QuestionNames.MeArchitectureType] === constants_3.MeArchitectureOptions.apiSpec().id ||
|
|
1513
|
-
inputs[constants_3.QuestionNames.CustomCopilotRag] === constants_3.CustomCopilotRagOptions.customApi().id) &&
|
|
1514
|
-
!(
|
|
1515
|
-
// Only skip this project when need to rediect to Kiota: 1. Feature flag enabled 2. Creating plugin/declarative copilot from existing spec
|
|
1516
|
-
(featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.KiotaIntegration) &&
|
|
1517
|
-
inputs[constants_3.QuestionNames.ActionType] === constants_3.ActionStartOptions.apiSpec().id &&
|
|
1518
|
-
(inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.apiPlugin().id ||
|
|
1519
|
-
inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.declarativeAgent().id))));
|
|
1520
|
-
},
|
|
1521
|
-
data: { type: "group", name: constants_3.QuestionNames.FromExistingApi },
|
|
1522
|
-
children: [
|
|
1523
|
-
{
|
|
1524
|
-
data: apiSpecLocationQuestion(),
|
|
1525
|
-
},
|
|
1526
|
-
{
|
|
1527
|
-
data: apiOperationQuestion(),
|
|
1528
|
-
condition: (inputs) => {
|
|
1529
|
-
return !inputs[constants_3.QuestionNames.ActionManifestPath];
|
|
1530
|
-
},
|
|
1531
|
-
},
|
|
1532
|
-
],
|
|
1533
|
-
},
|
|
1534
|
-
{
|
|
1535
|
-
condition: (inputs) => {
|
|
1536
|
-
return (inputs[constants_3.QuestionNames.Capabilities] == constants_3.CapabilityOptions.customCopilotAssistant().id);
|
|
1537
|
-
},
|
|
1538
|
-
data: customCopilotAssistantQuestion(),
|
|
1539
|
-
},
|
|
1540
|
-
{
|
|
1541
|
-
// programming language
|
|
1542
|
-
data: programmingLanguageQuestion(),
|
|
1543
|
-
condition: (inputs) => {
|
|
1544
|
-
return ((!!inputs[constants_3.QuestionNames.Capabilities] &&
|
|
1545
|
-
inputs[constants_3.QuestionNames.WithPlugin] !== constants_3.DeclarativeCopilotTypeOptions.noPlugin().id &&
|
|
1546
|
-
inputs[constants_3.QuestionNames.ActionType] !== constants_3.ActionStartOptions.apiSpec().id &&
|
|
1547
|
-
inputs[constants_3.QuestionNames.ActionType] !== constants_3.ActionStartOptions.existingPlugin().id &&
|
|
1548
|
-
inputs[constants_3.QuestionNames.MeArchitectureType] !== constants_3.MeArchitectureOptions.apiSpec().id &&
|
|
1549
|
-
inputs[constants_3.QuestionNames.ProjectType] !== constants_3.ProjectTypeOptions.officeMetaOS().id &&
|
|
1550
|
-
inputs[constants_3.QuestionNames.ProjectType] !== constants_3.ProjectTypeOptions.outlookAddin().id) ||
|
|
1551
|
-
(0, constants_3.getRuntime)(inputs) === constants_3.RuntimeOptions.DotNet().id);
|
|
1552
|
-
},
|
|
1553
|
-
},
|
|
1554
|
-
{
|
|
1555
|
-
condition: (inputs) => {
|
|
1556
|
-
return (inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.customCopilotBasic().id ||
|
|
1557
|
-
inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.customCopilotRag().id ||
|
|
1558
|
-
inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.customCopilotAssistant().id ||
|
|
1559
|
-
inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.customCopilotWeather().id);
|
|
1560
|
-
},
|
|
1561
|
-
data: llmServiceQuestion(),
|
|
1562
|
-
children: [
|
|
1563
|
-
{
|
|
1564
|
-
condition: { equals: "llm-service-azure-openai" },
|
|
1565
|
-
data: azureOpenAIKeyQuestion(),
|
|
1566
|
-
children: [
|
|
1567
|
-
{
|
|
1568
|
-
condition: (inputs) => {
|
|
1569
|
-
var _a;
|
|
1570
|
-
return ((_a = inputs[constants_3.QuestionNames.AzureOpenAIKey]) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
1571
|
-
},
|
|
1572
|
-
data: azureOpenAIEndpointQuestion(),
|
|
1573
|
-
children: [
|
|
1574
|
-
{
|
|
1575
|
-
condition: (inputs) => {
|
|
1576
|
-
var _a;
|
|
1577
|
-
return ((_a = inputs[constants_3.QuestionNames.AzureOpenAIEndpoint]) === null || _a === void 0 ? void 0 : _a.length) > 0;
|
|
1578
|
-
},
|
|
1579
|
-
data: azureOpenAIDeploymentNameQuestion(),
|
|
1580
|
-
},
|
|
1581
|
-
],
|
|
1582
|
-
},
|
|
1583
|
-
],
|
|
1584
|
-
},
|
|
1585
|
-
{
|
|
1586
|
-
condition: { equals: "llm-service-openai" },
|
|
1587
|
-
data: openAIKeyQuestion(),
|
|
1588
|
-
},
|
|
1589
|
-
],
|
|
1590
|
-
},
|
|
1591
|
-
{
|
|
1592
|
-
// root folder
|
|
1593
|
-
data: folderQuestion(),
|
|
1594
|
-
condition: (inputs) => {
|
|
1595
|
-
// Only skip this project when need to rediect to Kiota: 1. Feature flag enabled 2. Creating plugin/declarative copilot from existing spec 3. No plugin manifest path
|
|
1596
|
-
return !(featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.KiotaIntegration) &&
|
|
1597
|
-
inputs[constants_3.QuestionNames.ActionType] === constants_3.ActionStartOptions.apiSpec().id &&
|
|
1598
|
-
(inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.apiPlugin().id ||
|
|
1599
|
-
inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.declarativeAgent().id) &&
|
|
1600
|
-
!inputs[constants_3.QuestionNames.ActionManifestPath]);
|
|
1601
|
-
},
|
|
1602
|
-
},
|
|
1603
|
-
{
|
|
1604
|
-
// app name
|
|
1605
|
-
data: appNameQuestion(),
|
|
1606
|
-
condition: (inputs) => {
|
|
1607
|
-
// Only skip this project when need to rediect to Kiota: 1. Feature flag enabled 2. Creating plugin/declarative copilot from existing spec 3. No plugin manifest path
|
|
1608
|
-
return !(featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.KiotaIntegration) &&
|
|
1609
|
-
inputs[constants_3.QuestionNames.ActionType] === constants_3.ActionStartOptions.apiSpec().id &&
|
|
1610
|
-
(inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.apiPlugin().id ||
|
|
1611
|
-
inputs[constants_3.QuestionNames.Capabilities] === constants_3.CapabilityOptions.declarativeAgent().id) &&
|
|
1612
|
-
!inputs[constants_3.QuestionNames.ActionManifestPath]);
|
|
1613
|
-
},
|
|
1276
|
+
validation: {
|
|
1277
|
+
validFunc: (input, inputs) => {
|
|
1278
|
+
if (!input || input.trim().length === 0) {
|
|
1279
|
+
return "Please enter a Copilot Connector name.";
|
|
1280
|
+
}
|
|
1281
|
+
inputs = (0, utils_3.ensureInputs)(inputs);
|
|
1282
|
+
if (inputs[constants_3.QuestionNames.ProjectType] !== ProjectTypeOptions_1.ProjectTypeOptions.copilotAgentOptionId) {
|
|
1283
|
+
// Copilot Connector Template will use the name as app name, which has a minimum length of 2.
|
|
1284
|
+
if (input.trim().length < 2) {
|
|
1285
|
+
return "Please enter a Copilot Connector name with minimum two characters.";
|
|
1286
|
+
}
|
|
1287
|
+
}
|
|
1288
|
+
return undefined;
|
|
1614
1289
|
},
|
|
1615
|
-
],
|
|
1616
|
-
condition: (inputs) => {
|
|
1617
|
-
return inputs[constants_3.QuestionNames.ProjectType] !== constants_3.ProjectTypeOptions.startWithGithubCopilot().id;
|
|
1618
1290
|
},
|
|
1619
1291
|
};
|
|
1620
|
-
return node;
|
|
1621
1292
|
}
|
|
1622
|
-
exports.
|
|
1623
|
-
function
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1631
|
-
|
|
1632
|
-
{
|
|
1633
|
-
|
|
1634
|
-
|
|
1635
|
-
|
|
1636
|
-
|
|
1637
|
-
|
|
1638
|
-
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
|
|
1642
|
-
|
|
1643
|
-
|
|
1644
|
-
|
|
1645
|
-
|
|
1646
|
-
|
|
1647
|
-
|
|
1648
|
-
|
|
1649
|
-
|
|
1650
|
-
|
|
1651
|
-
|
|
1652
|
-
|
|
1653
|
-
|
|
1654
|
-
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
1666
|
-
|
|
1667
|
-
|
|
1668
|
-
|
|
1669
|
-
|
|
1293
|
+
exports.GCNameQuestion = GCNameQuestion;
|
|
1294
|
+
function GCConnectionIdQuestion() {
|
|
1295
|
+
return {
|
|
1296
|
+
type: "text",
|
|
1297
|
+
name: constants_3.QuestionNames.GCConnectionId,
|
|
1298
|
+
title: (0, localizeUtils_1.getLocalizedString)("core.GCConnectionIdQuestion.title"),
|
|
1299
|
+
placeholder: (0, localizeUtils_1.getLocalizedString)("core.GCConnectionIdQuestion.placeholder"),
|
|
1300
|
+
cliDescription: "a connection id for Copilot Connector",
|
|
1301
|
+
forgetLastValue: true,
|
|
1302
|
+
validation: {
|
|
1303
|
+
validFunc: (input, inputs) => {
|
|
1304
|
+
// Developer-provided unique ID
|
|
1305
|
+
// Must be between 3 and 32 characters in length
|
|
1306
|
+
// Must only contain alphanumeric characters
|
|
1307
|
+
// Cannot begin with Microsoft or some disallowed id values
|
|
1308
|
+
// https://learn.microsoft.com/en-us/graph/api/resources/externalconnectors-externalconnection?view=graph-rest-1.0#properties
|
|
1309
|
+
if (!input || input.trim().length < 3) {
|
|
1310
|
+
return (0, localizeUtils_1.getLocalizedString)("core.GCConnectionIdQuestion.validation.minlength");
|
|
1311
|
+
}
|
|
1312
|
+
if (input.trim().length > 32) {
|
|
1313
|
+
return (0, localizeUtils_1.getLocalizedString)("core.GCConnectionIdQuestion.validation.maxlength");
|
|
1314
|
+
}
|
|
1315
|
+
if (!/^[a-zA-Z0-9]+$/.test(input)) {
|
|
1316
|
+
return (0, localizeUtils_1.getLocalizedString)("core.GCConnectionIdQuestion.validation.pattern");
|
|
1317
|
+
}
|
|
1318
|
+
const disallowedConnectorIds = [
|
|
1319
|
+
"Microsoft",
|
|
1320
|
+
"None",
|
|
1321
|
+
"Directory",
|
|
1322
|
+
"Exchange",
|
|
1323
|
+
"ExchangeArchive",
|
|
1324
|
+
"LinkedIn",
|
|
1325
|
+
"Mailbox",
|
|
1326
|
+
"OneDriveBusiness",
|
|
1327
|
+
"SharePoint",
|
|
1328
|
+
"Teams",
|
|
1329
|
+
"Yammer",
|
|
1330
|
+
"Connectors",
|
|
1331
|
+
"TaskFabric",
|
|
1332
|
+
"PowerBI",
|
|
1333
|
+
"Assistant",
|
|
1334
|
+
"TopicEngine",
|
|
1335
|
+
"MSFT_All_Connectors",
|
|
1336
|
+
];
|
|
1337
|
+
// Check if the input starts with any of the beginner strings and find the first match
|
|
1338
|
+
const matchedBeginner = disallowedConnectorIds.find((item) => input.toLowerCase().startsWith(item.toLocaleLowerCase()));
|
|
1339
|
+
if (matchedBeginner) {
|
|
1340
|
+
return (0, localizeUtils_1.getLocalizedString)("core.GCConnectionIdQuestion.validation.specialBeginner", matchedBeginner);
|
|
1341
|
+
}
|
|
1342
|
+
return undefined;
|
|
1670
1343
|
},
|
|
1671
|
-
|
|
1344
|
+
},
|
|
1672
1345
|
};
|
|
1673
|
-
return createProjectQuestion;
|
|
1674
1346
|
}
|
|
1675
|
-
exports.
|
|
1347
|
+
exports.GCConnectionIdQuestion = GCConnectionIdQuestion;
|
|
1676
1348
|
function createSampleProjectQuestionNode() {
|
|
1677
1349
|
return {
|
|
1678
1350
|
data: sampleSelectQuestion(),
|
|
@@ -1684,43 +1356,4 @@ function createSampleProjectQuestionNode() {
|
|
|
1684
1356
|
};
|
|
1685
1357
|
}
|
|
1686
1358
|
exports.createSampleProjectQuestionNode = createSampleProjectQuestionNode;
|
|
1687
|
-
function createProjectCliHelpNode() {
|
|
1688
|
-
const node = (0, lodash_1.cloneDeep)(createProjectQuestionNode());
|
|
1689
|
-
const deleteNames = [
|
|
1690
|
-
constants_3.QuestionNames.ProjectType,
|
|
1691
|
-
constants_3.QuestionNames.OfficeAddinImport,
|
|
1692
|
-
constants_3.QuestionNames.OfficeAddinHost,
|
|
1693
|
-
constants_3.QuestionNames.RepalceTabUrl,
|
|
1694
|
-
constants_3.QuestionNames.ReplaceBotIds,
|
|
1695
|
-
constants_3.QuestionNames.Samples,
|
|
1696
|
-
];
|
|
1697
|
-
if (!featureFlags_1.featureFlagManager.getBooleanValue(featureFlags_1.FeatureFlags.CLIDotNet)) {
|
|
1698
|
-
deleteNames.push(constants_3.QuestionNames.Runtime);
|
|
1699
|
-
}
|
|
1700
|
-
trimQuestionTreeForCliHelp(node, deleteNames);
|
|
1701
|
-
return node;
|
|
1702
|
-
}
|
|
1703
|
-
exports.createProjectCliHelpNode = createProjectCliHelpNode;
|
|
1704
|
-
function trimQuestionTreeForCliHelp(node, deleteNames) {
|
|
1705
|
-
if (node.children) {
|
|
1706
|
-
node.children = node.children.filter((child) => !child.data.name || !deleteNames.includes(child.data.name));
|
|
1707
|
-
for (const child of node.children) {
|
|
1708
|
-
trimQuestionTreeForCliHelp(child, deleteNames);
|
|
1709
|
-
}
|
|
1710
|
-
}
|
|
1711
|
-
}
|
|
1712
|
-
function pickSubTree(node, name) {
|
|
1713
|
-
if (node.data.name === name) {
|
|
1714
|
-
return node;
|
|
1715
|
-
}
|
|
1716
|
-
let found;
|
|
1717
|
-
if (node.children) {
|
|
1718
|
-
for (const child of node.children) {
|
|
1719
|
-
found = pickSubTree(child, name);
|
|
1720
|
-
if (found)
|
|
1721
|
-
return found;
|
|
1722
|
-
}
|
|
1723
|
-
}
|
|
1724
|
-
return undefined;
|
|
1725
|
-
}
|
|
1726
1359
|
//# sourceMappingURL=create.js.map
|