@microsoft/teamsfx-core 3.0.4 → 3.0.5-alpha.1d492cee1.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 +8 -4
- package/build/client/graphClient.d.ts.map +1 -1
- package/build/client/graphClient.js +35 -8
- package/build/client/graphClient.js.map +1 -1
- package/build/client/interfaces/GetGroupResponse.d.ts +6 -0
- package/build/client/interfaces/GetGroupResponse.d.ts.map +1 -0
- package/build/client/interfaces/GetGroupResponse.js +5 -0
- package/build/client/interfaces/GetGroupResponse.js.map +1 -0
- package/build/client/interfaces/GetUserResponse.d.ts +7 -0
- package/build/client/interfaces/GetUserResponse.d.ts.map +1 -0
- package/build/client/interfaces/GetUserResponse.js +5 -0
- package/build/client/interfaces/GetUserResponse.js.map +1 -0
- package/build/client/teamsDevPortalClient.js +1 -1
- package/build/client/teamsDevPortalClient.js.map +1 -1
- package/build/common/constants.d.ts +2 -0
- package/build/common/constants.d.ts.map +1 -1
- package/build/common/constants.js +3 -1
- package/build/common/constants.js.map +1 -1
- package/build/common/daSpecParser.js +1 -1
- package/build/common/daSpecParser.js.map +1 -1
- package/build/common/featureFlags.js +4 -4
- package/build/common/featureFlags.js.map +1 -1
- package/build/common/kiotaClient.d.ts.map +1 -1
- package/build/common/kiotaClient.js +17 -7
- package/build/common/kiotaClient.js.map +1 -1
- package/build/common/permissionInterface.d.ts +6 -0
- package/build/common/permissionInterface.d.ts.map +1 -1
- package/build/common/projectTypeChecker.d.ts +1 -0
- package/build/common/projectTypeChecker.d.ts.map +1 -1
- package/build/common/projectTypeChecker.js +14 -1
- package/build/common/projectTypeChecker.js.map +1 -1
- package/build/common/stringUtils.d.ts.map +1 -1
- package/build/common/stringUtils.js +2 -1
- package/build/common/stringUtils.js.map +1 -1
- package/build/common/templates-config.json +8 -6
- package/build/common/tools.d.ts +4 -0
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +58 -1
- package/build/common/tools.js.map +1 -1
- package/build/common/wrappedAxiosClient.d.ts.map +1 -1
- package/build/common/wrappedAxiosClient.js +0 -1
- package/build/common/wrappedAxiosClient.js.map +1 -1
- package/build/component/configManager/validator.d.ts.map +1 -1
- package/build/component/configManager/validator.js +2 -0
- package/build/component/configManager/validator.js.map +1 -1
- package/build/component/coordinator/index.d.ts +0 -1
- package/build/component/coordinator/index.d.ts.map +1 -1
- package/build/component/coordinator/index.js +54 -58
- package/build/component/coordinator/index.js.map +1 -1
- package/build/component/deps-checker/constant/helpLink.d.ts +2 -0
- package/build/component/deps-checker/constant/helpLink.d.ts.map +1 -1
- package/build/component/deps-checker/constant/helpLink.js +3 -1
- package/build/component/deps-checker/constant/helpLink.js.map +1 -1
- package/build/component/deps-checker/constant/message.d.ts +44 -11
- package/build/component/deps-checker/constant/message.d.ts.map +1 -1
- package/build/component/deps-checker/constant/message.js +48 -13
- package/build/component/deps-checker/constant/message.js.map +1 -1
- package/build/component/deps-checker/internal/dotnetChecker.d.ts.map +1 -1
- package/build/component/deps-checker/internal/dotnetChecker.js +4 -1
- package/build/component/deps-checker/internal/dotnetChecker.js.map +1 -1
- package/build/component/deps-checker/internal/funcToolChecker.d.ts.map +1 -1
- package/build/component/deps-checker/internal/funcToolChecker.js +8 -5
- package/build/component/deps-checker/internal/funcToolChecker.js.map +1 -1
- package/build/component/deps-checker/internal/testToolChecker.d.ts.map +1 -1
- package/build/component/deps-checker/internal/testToolChecker.js +16 -10
- package/build/component/deps-checker/internal/testToolChecker.js.map +1 -1
- package/build/component/driver/deploy/azure/azureStaticWebAppGetDeploymentTokenDriver.d.ts.map +1 -1
- package/build/component/driver/deploy/azure/azureStaticWebAppGetDeploymentTokenDriver.js +10 -12
- package/build/component/driver/deploy/azure/azureStaticWebAppGetDeploymentTokenDriver.js.map +1 -1
- package/build/component/driver/index.d.ts +19 -20
- package/build/component/driver/index.d.ts.map +1 -1
- package/build/component/driver/index.js +19 -20
- package/build/component/driver/index.js.map +1 -1
- package/build/component/driver/m365/acquire.d.ts +3 -0
- package/build/component/driver/m365/acquire.d.ts.map +1 -1
- package/build/component/driver/m365/acquire.js +29 -19
- package/build/component/driver/m365/acquire.js.map +1 -1
- package/build/component/driver/share/utils.d.ts +5 -1
- package/build/component/driver/share/utils.d.ts.map +1 -1
- package/build/component/driver/share/utils.js +23 -22
- package/build/component/driver/share/utils.js.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.d.ts.map +1 -1
- package/build/component/driver/teamsApp/createAppPackage.js +81 -80
- package/build/component/driver/teamsApp/createAppPackage.js.map +1 -1
- package/build/component/driver/teamsApp/teamsappMgr.d.ts.map +1 -1
- package/build/component/driver/teamsApp/teamsappMgr.js +3 -0
- package/build/component/driver/teamsApp/teamsappMgr.js.map +1 -1
- package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.d.ts +3 -3
- package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.js +8 -13
- package/build/component/driver/teamsApp/utils/CopilotGptManifestUtils.js.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts +2 -2
- package/build/component/driver/teamsApp/utils/ManifestUtils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/ManifestUtils.js +10 -5
- package/build/component/driver/teamsApp/utils/ManifestUtils.js.map +1 -1
- package/build/component/driver/teamsApp/utils/PluginManifestUtils.d.ts +1 -1
- package/build/component/driver/teamsApp/utils/PluginManifestUtils.d.ts.map +1 -1
- package/build/component/driver/teamsApp/utils/PluginManifestUtils.js +5 -2
- package/build/component/driver/teamsApp/utils/PluginManifestUtils.js.map +1 -1
- package/build/component/driver/teamsApp/validate.d.ts +3 -3
- package/build/component/driver/teamsApp/validate.d.ts.map +1 -1
- package/build/component/driver/teamsApp/validate.js +67 -86
- package/build/component/driver/teamsApp/validate.js.map +1 -1
- package/build/component/driver/util/utils.d.ts.map +1 -1
- package/build/component/driver/util/utils.js +6 -4
- package/build/component/driver/util/utils.js.map +1 -1
- package/build/component/feature/collaboration.d.ts +7 -1
- package/build/component/feature/collaboration.d.ts.map +1 -1
- package/build/component/feature/collaboration.js +84 -1
- package/build/component/feature/collaboration.js.map +1 -1
- package/build/component/generator/combinedProject/generator.d.ts.map +1 -1
- package/build/component/generator/combinedProject/generator.js +2 -1
- package/build/component/generator/combinedProject/generator.js.map +1 -1
- package/build/component/generator/declarativeAgent/generator.d.ts.map +1 -1
- package/build/component/generator/declarativeAgent/generator.js +2 -1
- package/build/component/generator/declarativeAgent/generator.js.map +1 -1
- package/build/component/generator/defaultGenerator.d.ts.map +1 -1
- package/build/component/generator/defaultGenerator.js +6 -5
- package/build/component/generator/defaultGenerator.js.map +1 -1
- package/build/component/generator/generator.d.ts +1 -1
- package/build/component/generator/generator.d.ts.map +1 -1
- package/build/component/generator/generator.js +4 -3
- package/build/component/generator/generator.js.map +1 -1
- package/build/component/generator/generatorAction.d.ts +2 -1
- package/build/component/generator/generatorAction.d.ts.map +1 -1
- package/build/component/generator/generatorAction.js +1 -1
- package/build/component/generator/generatorAction.js.map +1 -1
- package/build/component/generator/officeAddin/generator.js.map +1 -1
- package/build/component/generator/officeAddin/metaOSHelper.d.ts.map +1 -1
- package/build/component/generator/officeAddin/metaOSHelper.js +44 -5
- package/build/component/generator/officeAddin/metaOSHelper.js.map +1 -1
- package/build/component/generator/openApiSpec/common.d.ts.map +1 -1
- package/build/component/generator/openApiSpec/common.js +2 -1
- package/build/component/generator/openApiSpec/common.js.map +1 -1
- package/build/component/generator/openApiSpec/helper.d.ts.map +1 -1
- package/build/component/generator/openApiSpec/helper.js +132 -98
- package/build/component/generator/openApiSpec/helper.js.map +1 -1
- package/build/component/generator/other/ssrTabGenerator.d.ts.map +1 -1
- package/build/component/generator/other/ssrTabGenerator.js +2 -1
- package/build/component/generator/other/ssrTabGenerator.js.map +1 -1
- package/build/component/generator/other/tdpGenerator.d.ts.map +1 -1
- package/build/component/generator/other/tdpGenerator.js +2 -1
- package/build/component/generator/other/tdpGenerator.js.map +1 -1
- package/build/component/generator/spfx/spfxGenerator.d.ts +1 -1
- package/build/component/generator/spfx/spfxGenerator.d.ts.map +1 -1
- package/build/component/generator/spfx/spfxGenerator.js +12 -9
- package/build/component/generator/spfx/spfxGenerator.js.map +1 -1
- package/build/component/generator/spfx/utils/constants.d.ts +2 -0
- package/build/component/generator/spfx/utils/constants.d.ts.map +1 -1
- package/build/component/generator/spfx/utils/constants.js +2 -0
- package/build/component/generator/spfx/utils/constants.js.map +1 -1
- package/build/component/generator/templates/metadata/tab.js +4 -4
- package/build/component/generator/templates/metadata/tab.js.map +1 -1
- package/build/component/generator/templates/metadata/vs.d.ts.map +1 -1
- package/build/component/generator/templates/metadata/vs.js +0 -12
- package/build/component/generator/templates/metadata/vs.js.map +1 -1
- package/build/component/generator/templates/templateNames.d.ts +1 -3
- package/build/component/generator/templates/templateNames.d.ts.map +1 -1
- package/build/component/generator/templates/templateNames.js +1 -3
- 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 +8 -6
- package/build/component/generator/templates/templateReplaceMap.js.map +1 -1
- package/build/component/generator/utils.d.ts +3 -3
- package/build/component/generator/utils.d.ts.map +1 -1
- package/build/component/generator/utils.js +24 -7
- package/build/component/generator/utils.js.map +1 -1
- package/build/component/m365/constants.d.ts +1 -0
- package/build/component/m365/constants.d.ts.map +1 -1
- package/build/component/m365/constants.js +2 -1
- package/build/component/m365/constants.js.map +1 -1
- package/build/component/m365/interface.d.ts +6 -5
- package/build/component/m365/interface.d.ts.map +1 -1
- package/build/component/m365/interface.js +6 -5
- package/build/component/m365/interface.js.map +1 -1
- package/build/component/m365/packageService.d.ts +13 -3
- package/build/component/m365/packageService.d.ts.map +1 -1
- package/build/component/m365/packageService.js +175 -15
- package/build/component/m365/packageService.js.map +1 -1
- package/build/component/resource/botService/errors.d.ts +1 -1
- package/build/component/resource/botService/errors.d.ts.map +1 -1
- package/build/component/resource/botService/errors.js +2 -2
- package/build/component/resource/botService/errors.js.map +1 -1
- package/build/component/resource/botService/messages.d.ts +1 -1
- package/build/component/resource/botService/messages.d.ts.map +1 -1
- package/build/component/resource/botService/messages.js +6 -1
- package/build/component/resource/botService/messages.js.map +1 -1
- package/build/core/FxCore.d.ts +0 -3
- package/build/core/FxCore.d.ts.map +1 -1
- package/build/core/FxCore.js +40 -65
- package/build/core/FxCore.js.map +1 -1
- package/build/core/collaborator.d.ts +1 -0
- package/build/core/collaborator.d.ts.map +1 -1
- package/build/core/collaborator.js +55 -3
- package/build/core/collaborator.js.map +1 -1
- package/build/core/middleware/utils/debug/taskMigrator.js +1 -1
- package/build/core/share.d.ts +9 -0
- package/build/core/share.d.ts.map +1 -0
- package/build/core/share.js +118 -0
- package/build/core/share.js.map +1 -0
- package/build/error/depCheck.d.ts +4 -1
- package/build/error/depCheck.d.ts.map +1 -1
- package/build/error/depCheck.js +3 -3
- package/build/error/depCheck.js.map +1 -1
- package/build/index.d.ts +1 -0
- package/build/index.d.ts.map +1 -1
- package/build/index.js +3 -1
- package/build/index.js.map +1 -1
- package/build/question/collaborator.d.ts +6 -0
- package/build/question/collaborator.d.ts.map +1 -0
- package/build/question/collaborator.js +166 -0
- package/build/question/collaborator.js.map +1 -0
- package/build/question/constants.d.ts +1 -0
- package/build/question/constants.d.ts.map +1 -1
- package/build/question/constants.js +8 -19
- package/build/question/constants.js.map +1 -1
- package/build/question/generator.d.ts.map +1 -1
- package/build/question/generator.js +2 -0
- package/build/question/generator.js.map +1 -1
- package/build/question/index.d.ts.map +1 -1
- package/build/question/index.js +6 -4
- package/build/question/index.js.map +1 -1
- package/build/question/inputs/AddPluginInputs.d.ts +1 -5
- package/build/question/inputs/AddPluginInputs.d.ts.map +1 -1
- package/build/question/inputs/RegeneratePluginInputs.d.ts +16 -0
- package/build/question/inputs/RegeneratePluginInputs.d.ts.map +1 -0
- package/build/question/inputs/RegeneratePluginInputs.js +5 -0
- package/build/question/inputs/RegeneratePluginInputs.js.map +1 -0
- package/build/question/inputs/ShareInputs.d.ts +6 -4
- package/build/question/inputs/ShareInputs.d.ts.map +1 -1
- package/build/question/inputs/index.d.ts +12 -11
- package/build/question/inputs/index.d.ts.map +1 -1
- package/build/question/inputs/index.js +12 -11
- package/build/question/inputs/index.js.map +1 -1
- package/build/question/options/AddPluginOptions.d.ts.map +1 -1
- package/build/question/options/AddPluginOptions.js +1 -11
- 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/RegeneratePluginOptions.d.ts +10 -0
- package/build/question/options/RegeneratePluginOptions.d.ts.map +1 -0
- package/build/question/options/RegeneratePluginOptions.js +28 -0
- package/build/question/options/RegeneratePluginOptions.js.map +1 -0
- package/build/question/options/SPFxAddWebpartOptions.js +1 -1
- package/build/question/options/SPFxAddWebpartOptions.js.map +1 -1
- package/build/question/options/ShareOptions.d.ts.map +1 -1
- package/build/question/options/ShareOptions.js +12 -5
- package/build/question/options/ShareOptions.js.map +1 -1
- package/build/question/options/index.d.ts +1 -0
- package/build/question/options/index.d.ts.map +1 -1
- package/build/question/options/index.js +1 -0
- package/build/question/options/index.js.map +1 -1
- package/build/question/other.d.ts +2 -8
- package/build/question/other.d.ts.map +1 -1
- package/build/question/other.js +12 -279
- package/build/question/other.js.map +1 -1
- package/build/question/questionNames.d.ts +3 -4
- package/build/question/questionNames.d.ts.map +1 -1
- package/build/question/questionNames.js +3 -4
- package/build/question/questionNames.js.map +1 -1
- package/build/question/scaffold/vs/createRootNode.d.ts +0 -1
- package/build/question/scaffold/vs/createRootNode.d.ts.map +1 -1
- package/build/question/scaffold/vs/createRootNode.js +0 -11
- package/build/question/scaffold/vs/createRootNode.js.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.d.ts +0 -1
- package/build/question/scaffold/vsc/CapabilityOptions.d.ts.map +1 -1
- package/build/question/scaffold/vsc/CapabilityOptions.js +1 -9
- package/build/question/scaffold/vsc/CapabilityOptions.js.map +1 -1
- package/build/question/scaffold/vsc/daProjectTypeNode.d.ts.map +1 -1
- package/build/question/scaffold/vsc/daProjectTypeNode.js +0 -14
- package/build/question/scaffold/vsc/daProjectTypeNode.js.map +1 -1
- package/build/question/share.d.ts +22 -0
- package/build/question/share.d.ts.map +1 -0
- package/build/question/share.js +165 -0
- package/build/question/share.js.map +1 -0
- package/build/tsconfig.tsbuildinfo +1 -1
- package/package.json +5 -5
- package/resource/package.nls.cs.json +68 -57
- package/resource/package.nls.de.json +68 -57
- package/resource/package.nls.es.json +68 -57
- package/resource/package.nls.fr.json +68 -57
- package/resource/package.nls.it.json +68 -57
- package/resource/package.nls.ja.json +68 -57
- package/resource/package.nls.json +29 -23
- package/resource/package.nls.ko.json +68 -57
- package/resource/package.nls.pl.json +68 -57
- package/resource/package.nls.pt-BR.json +68 -57
- package/resource/package.nls.ru.json +68 -57
- package/resource/package.nls.tr.json +68 -57
- package/resource/package.nls.zh-Hans.json +68 -57
- package/resource/package.nls.zh-Hant.json +68 -57
- package/resource/yaml-schema/v1.10/yaml.schema.json +2058 -0
- package/resource/yaml-schema/v1.9/yaml.schema.json +2107 -0
- package/resource/yaml-schema/yaml.schema.json +6 -55
- 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/V3/Bot/SSO/BotAuthenticationOptions.cs +44 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/IIdentityClientAdapter.cs +21 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/ITeamsInfo.cs +24 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/IdentityClientAdapter.cs +30 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/SsoDialog.cs +12 -9
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/SsoOperations.cs +2 -2
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/TeamsBotSsoPrompt.cs +423 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/TeamsBotSsoPromptSettings.cs +41 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/TeamsBotSsoPromptTokenResponse.cs +21 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/TeamsInfoWrapper.cs +20 -0
- package/templates/plugins/resource/aad/auth/V3/Bot/SSO/TeamsSsoBot.cs +6 -5
- package/templates/plugins/resource/aad/auth/bot/js/public/auth-end.html +60 -49
- package/templates/plugins/resource/aad/auth/bot/ts/public/auth-end.html +60 -49
- package/build/component/driver/share/shareToOthers.d.ts +0 -17
- package/build/component/driver/share/shareToOthers.d.ts.map +0 -1
- package/build/component/driver/share/shareToOthers.js +0 -127
- package/build/component/driver/share/shareToOthers.js.map +0 -1
|
@@ -2,24 +2,25 @@
|
|
|
2
2
|
// Copyright (c) Microsoft Corporation.
|
|
3
3
|
// Licensed under the MIT license.
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
5
|
-
exports.M365TitleAcquireDriver = void 0;
|
|
5
|
+
exports.M365TitleAcquireDriver = exports.actionName = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const fs = tslib_1.__importStar(require("fs-extra"));
|
|
8
8
|
const typedi_1 = require("typedi");
|
|
9
9
|
const lib_1 = require("@feathersjs/hooks/lib");
|
|
10
10
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
11
11
|
const localizeUtils_1 = require("../../../common/localizeUtils");
|
|
12
|
+
const common_1 = require("../../../error/common");
|
|
12
13
|
const packageService_1 = require("../../m365/packageService");
|
|
13
14
|
const serviceConstant_1 = require("../../m365/serviceConstant");
|
|
14
|
-
const common_1 = require("../../../error/common");
|
|
15
15
|
const common_2 = require("../../utils/common");
|
|
16
16
|
const constants_1 = require("../aad/utility/constants");
|
|
17
17
|
const addStartAndEndTelemetry_1 = require("../middleware/addStartAndEndTelemetry");
|
|
18
|
-
|
|
18
|
+
exports.actionName = "teamsApp/extendToM365";
|
|
19
19
|
const helpLink = "https://aka.ms/teamsfx-actions/teamsapp-extendToM365";
|
|
20
20
|
const outputKeys = {
|
|
21
21
|
titleId: "titleId",
|
|
22
22
|
appId: "appId",
|
|
23
|
+
shareLink: "shareLink",
|
|
23
24
|
};
|
|
24
25
|
let M365TitleAcquireDriver = class M365TitleAcquireDriver {
|
|
25
26
|
constructor() {
|
|
@@ -30,7 +31,7 @@ let M365TitleAcquireDriver = class M365TitleAcquireDriver {
|
|
|
30
31
|
return (0, common_2.wrapRun)(async () => {
|
|
31
32
|
const result = await this.handler(args, context);
|
|
32
33
|
return result.output;
|
|
33
|
-
}, actionName);
|
|
34
|
+
}, exports.actionName);
|
|
34
35
|
}
|
|
35
36
|
async execute(args, ctx, outputEnvVarNames) {
|
|
36
37
|
let summaries = [];
|
|
@@ -38,7 +39,7 @@ let M365TitleAcquireDriver = class M365TitleAcquireDriver {
|
|
|
38
39
|
const result = await this.handler(args, ctx, outputEnvVarNames);
|
|
39
40
|
summaries = result.summaries;
|
|
40
41
|
return result.output;
|
|
41
|
-
}, actionName);
|
|
42
|
+
}, exports.actionName);
|
|
42
43
|
return {
|
|
43
44
|
result: outputResult,
|
|
44
45
|
summaries,
|
|
@@ -51,7 +52,7 @@ let M365TitleAcquireDriver = class M365TitleAcquireDriver {
|
|
|
51
52
|
this.validateOutputEnvVarNames(outputEnvVarNames);
|
|
52
53
|
const appPackagePath = (0, common_2.getAbsolutePath)(args.appPackagePath, context.projectPath);
|
|
53
54
|
if (!(await fs.pathExists(appPackagePath))) {
|
|
54
|
-
throw new common_1.FileNotFoundError(actionName, appPackagePath, helpLink);
|
|
55
|
+
throw new common_1.FileNotFoundError(exports.actionName, appPackagePath, helpLink);
|
|
55
56
|
}
|
|
56
57
|
// get sideloading service settings
|
|
57
58
|
const sideloadingServiceEndpoint = (_a = process.env.SIDELOADING_SERVICE_ENDPOINT) !== null && _a !== void 0 ? _a : serviceConstant_1.MosServiceEndpoint;
|
|
@@ -64,23 +65,26 @@ let M365TitleAcquireDriver = class M365TitleAcquireDriver {
|
|
|
64
65
|
throw sideloadingTokenRes.error;
|
|
65
66
|
}
|
|
66
67
|
const sideloadingToken = sideloadingTokenRes.value;
|
|
67
|
-
const sideloadingRes = await packageService.sideLoading(sideloadingToken, appPackagePath);
|
|
68
|
+
const sideloadingRes = await packageService.sideLoading(sideloadingToken, appPackagePath, args.scope);
|
|
69
|
+
const mapping = new Map();
|
|
70
|
+
mapping.set(outputEnvVarNames.get(outputKeys.titleId), sideloadingRes[0]);
|
|
71
|
+
mapping.set(outputEnvVarNames.get(outputKeys.appId), sideloadingRes[1]);
|
|
72
|
+
if (outputEnvVarNames === null || outputEnvVarNames === void 0 ? void 0 : outputEnvVarNames.get(outputKeys.shareLink)) {
|
|
73
|
+
mapping.set(outputEnvVarNames.get(outputKeys.shareLink), sideloadingRes[2]);
|
|
74
|
+
}
|
|
68
75
|
return {
|
|
69
|
-
output:
|
|
70
|
-
[outputEnvVarNames.get(outputKeys.titleId), sideloadingRes[0]],
|
|
71
|
-
[outputEnvVarNames.get(outputKeys.appId), sideloadingRes[1]],
|
|
72
|
-
]),
|
|
76
|
+
output: mapping,
|
|
73
77
|
summaries: [(0, localizeUtils_1.getLocalizedString)("driver.m365.acquire.summary", sideloadingRes[0])],
|
|
74
78
|
};
|
|
75
79
|
}
|
|
76
80
|
catch (error) {
|
|
77
81
|
if (error instanceof teamsfx_api_1.UserError || error instanceof teamsfx_api_1.SystemError) {
|
|
78
|
-
(_c = context.logProvider) === null || _c === void 0 ? void 0 : _c.error((0, localizeUtils_1.getLocalizedString)(constants_1.logMessageKeys.failExecuteDriver, actionName, error.displayMessage));
|
|
82
|
+
(_c = context.logProvider) === null || _c === void 0 ? void 0 : _c.error((0, localizeUtils_1.getLocalizedString)(constants_1.logMessageKeys.failExecuteDriver, exports.actionName, error.displayMessage));
|
|
79
83
|
throw error;
|
|
80
84
|
}
|
|
81
85
|
const message = JSON.stringify(error);
|
|
82
|
-
(_d = context.logProvider) === null || _d === void 0 ? void 0 : _d.error((0, localizeUtils_1.getLocalizedString)(constants_1.logMessageKeys.failExecuteDriver, actionName, message));
|
|
83
|
-
throw (0, common_1.assembleError)(error, actionName);
|
|
86
|
+
(_d = context.logProvider) === null || _d === void 0 ? void 0 : _d.error((0, localizeUtils_1.getLocalizedString)(constants_1.logMessageKeys.failExecuteDriver, exports.actionName, message));
|
|
87
|
+
throw (0, common_1.assembleError)(error, exports.actionName);
|
|
84
88
|
}
|
|
85
89
|
}
|
|
86
90
|
validateArgs(args) {
|
|
@@ -88,30 +92,36 @@ let M365TitleAcquireDriver = class M365TitleAcquireDriver {
|
|
|
88
92
|
if (!args.appPackagePath || typeof args.appPackagePath !== "string") {
|
|
89
93
|
invalidParameters.push("appPackagePath");
|
|
90
94
|
}
|
|
95
|
+
if (args.scope &&
|
|
96
|
+
!Object.values(packageService_1.AppScope)
|
|
97
|
+
.map((v) => v.toLowerCase())
|
|
98
|
+
.includes(args.scope)) {
|
|
99
|
+
invalidParameters.push("scope");
|
|
100
|
+
}
|
|
91
101
|
if (invalidParameters.length > 0) {
|
|
92
|
-
throw new common_1.InvalidActionInputError(actionName, invalidParameters, helpLink);
|
|
102
|
+
throw new common_1.InvalidActionInputError(exports.actionName, invalidParameters, helpLink);
|
|
93
103
|
}
|
|
94
104
|
}
|
|
95
105
|
validateOutputEnvVarNames(outputEnvVarNames) {
|
|
96
106
|
if (!(outputEnvVarNames === null || outputEnvVarNames === void 0 ? void 0 : outputEnvVarNames.get(outputKeys.titleId)) || !outputEnvVarNames.get(outputKeys.appId)) {
|
|
97
|
-
throw new common_1.InvalidActionInputError(actionName, ["writeToEnvironmentFile"], helpLink);
|
|
107
|
+
throw new common_1.InvalidActionInputError(exports.actionName, ["writeToEnvironmentFile"], helpLink);
|
|
98
108
|
}
|
|
99
109
|
}
|
|
100
110
|
};
|
|
101
111
|
tslib_1.__decorate([
|
|
102
|
-
(0, lib_1.hooks)([(0, addStartAndEndTelemetry_1.addStartAndEndTelemetry)(actionName, actionName)]),
|
|
112
|
+
(0, lib_1.hooks)([(0, addStartAndEndTelemetry_1.addStartAndEndTelemetry)(exports.actionName, exports.actionName)]),
|
|
103
113
|
tslib_1.__metadata("design:type", Function),
|
|
104
114
|
tslib_1.__metadata("design:paramtypes", [Object, Object]),
|
|
105
115
|
tslib_1.__metadata("design:returntype", Promise)
|
|
106
116
|
], M365TitleAcquireDriver.prototype, "run", null);
|
|
107
117
|
tslib_1.__decorate([
|
|
108
|
-
(0, lib_1.hooks)([(0, addStartAndEndTelemetry_1.addStartAndEndTelemetry)(actionName, actionName)]),
|
|
118
|
+
(0, lib_1.hooks)([(0, addStartAndEndTelemetry_1.addStartAndEndTelemetry)(exports.actionName, exports.actionName)]),
|
|
109
119
|
tslib_1.__metadata("design:type", Function),
|
|
110
120
|
tslib_1.__metadata("design:paramtypes", [Object, Object, Map]),
|
|
111
121
|
tslib_1.__metadata("design:returntype", Promise)
|
|
112
122
|
], M365TitleAcquireDriver.prototype, "execute", null);
|
|
113
123
|
M365TitleAcquireDriver = tslib_1.__decorate([
|
|
114
|
-
(0, typedi_1.Service)(actionName) // DO NOT MODIFY the service name
|
|
124
|
+
(0, typedi_1.Service)(exports.actionName) // DO NOT MODIFY the service name
|
|
115
125
|
], M365TitleAcquireDriver);
|
|
116
126
|
exports.M365TitleAcquireDriver = M365TitleAcquireDriver;
|
|
117
127
|
//# sourceMappingURL=acquire.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"acquire.js","sourceRoot":"","sources":["../../../../src/component/driver/m365/acquire.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,qDAA+B;AAC/B,mCAAiC;AAEjC,+CAA8C;AAC9C,wDAAiF;AAEjF,iEAAmE;AACnE,
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,CAAC,iCAAiC;GACzC,sBAAsB,CAwHlC;AAxHY,wDAAsB"}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
1
|
import { FxError, Result } from "@microsoft/teamsfx-api";
|
|
2
|
-
export declare function parseShareAppActionYamlConfig(projectPath: string): Promise<Result<
|
|
2
|
+
export declare function parseShareAppActionYamlConfig(projectPath: string): Promise<Result<{
|
|
3
|
+
teamsappId: string;
|
|
4
|
+
titleId: string;
|
|
5
|
+
appId: string;
|
|
6
|
+
}, FxError>>;
|
|
3
7
|
//# sourceMappingURL=utils.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/component/driver/share/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAO,OAAO,EAAM,MAAM,EAA+B,MAAM,wBAAwB,CAAC;
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../../../src/component/driver/share/utils.ts"],"names":[],"mappings":"AAGA,OAAO,EAAO,OAAO,EAAM,MAAM,EAA+B,MAAM,wBAAwB,CAAC;AAc/F,wBAAsB,6BAA6B,CACjD,WAAW,EAAE,MAAM,GAClB,OAAO,CAAC,MAAM,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,OAAO,EAAE,MAAM,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,EAAE,OAAO,CAAC,CAAC,CAsGlF"}
|
|
@@ -5,35 +5,36 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
5
5
|
exports.parseShareAppActionYamlConfig = void 0;
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
8
|
-
const
|
|
9
|
-
const
|
|
8
|
+
const adm_zip_1 = tslib_1.__importDefault(require("adm-zip"));
|
|
9
|
+
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
10
|
+
const path_1 = tslib_1.__importDefault(require("path"));
|
|
10
11
|
const localizeUtils_1 = require("../../../common/localizeUtils");
|
|
11
|
-
const envUtil_1 = require("../../utils/envUtil");
|
|
12
12
|
const lifecycle_1 = require("../../configManager/lifecycle");
|
|
13
|
-
const
|
|
14
|
-
const
|
|
13
|
+
const envUtil_1 = require("../../utils/envUtil");
|
|
14
|
+
const metadataUtil_1 = require("../../utils/metadataUtil");
|
|
15
|
+
const pathUtils_1 = require("../../utils/pathUtils");
|
|
16
|
+
const acquire_1 = require("../m365/acquire");
|
|
15
17
|
const constants_1 = require("../teamsApp/constants");
|
|
16
|
-
|
|
17
|
-
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
18
|
-
// Read teamsapp.yaml and get the value of teamsapp id, shared title id, and shared app id
|
|
19
|
-
// Output [teamsapp id, shared title id, shared app id]
|
|
18
|
+
// Read m365agents.yaml and get the value of shared title id, and shared app id
|
|
20
19
|
async function parseShareAppActionYamlConfig(projectPath) {
|
|
21
|
-
var _a, _b, _c;
|
|
20
|
+
var _a, _b, _c, _d, _e;
|
|
22
21
|
const templatePath = pathUtils_1.pathUtils.getYmlFilePath(projectPath, "dev");
|
|
23
22
|
const maybeProjectModel = await metadataUtil_1.metadataUtil.parse(templatePath);
|
|
24
23
|
if (maybeProjectModel.isErr()) {
|
|
25
24
|
return (0, teamsfx_api_1.err)(maybeProjectModel.error);
|
|
26
25
|
}
|
|
27
26
|
const projectModel = maybeProjectModel.value;
|
|
28
|
-
if (!projectModel.
|
|
29
|
-
|
|
27
|
+
if ((!projectModel.provision || !projectModel.provision.driverDefs) &&
|
|
28
|
+
(!projectModel.deploy || !projectModel.deploy.driverDefs)) {
|
|
29
|
+
return (0, teamsfx_api_1.err)(new teamsfx_api_1.UserError("FxCore", "Share", (0, localizeUtils_1.getLocalizedString)("error.share.yamlConfigNotFound")));
|
|
30
30
|
}
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
|
|
31
|
+
const extendToM365Action = ((_a = projectModel.provision) === null || _a === void 0 ? void 0 : _a.driverDefs.find((d) => d.uses === acquire_1.actionName)) ||
|
|
32
|
+
((_b = projectModel.deploy) === null || _b === void 0 ? void 0 : _b.driverDefs.find((d) => d.uses === acquire_1.actionName));
|
|
33
|
+
if (!extendToM365Action) {
|
|
34
|
+
return (0, teamsfx_api_1.err)(new teamsfx_api_1.UserError("FxCore", "Share", (0, localizeUtils_1.getLocalizedString)("error.share.shareActionConfigNotFound", acquire_1.actionName)));
|
|
34
35
|
}
|
|
35
36
|
// 1. get manifest id
|
|
36
|
-
const appPackagePath = (
|
|
37
|
+
const appPackagePath = (_c = extendToM365Action.with) === null || _c === void 0 ? void 0 : _c.appPackagePath;
|
|
37
38
|
if (!appPackagePath) {
|
|
38
39
|
return (0, teamsfx_api_1.err)(new teamsfx_api_1.UserError("FxCore", "Share to Users", (0, localizeUtils_1.getLocalizedString)("error.share.appPackageConfigNotFound")));
|
|
39
40
|
}
|
|
@@ -41,7 +42,7 @@ async function parseShareAppActionYamlConfig(projectPath) {
|
|
|
41
42
|
if (readEnvRes.isErr()) {
|
|
42
43
|
return (0, teamsfx_api_1.err)(readEnvRes.error);
|
|
43
44
|
}
|
|
44
|
-
const resolvedDriver = (0, lifecycle_1.resolve)(
|
|
45
|
+
const resolvedDriver = (0, lifecycle_1.resolve)(extendToM365Action, [], []);
|
|
45
46
|
const resolvedAppPackagePath = path_1.default.resolve(projectPath, resolvedDriver.with.appPackagePath);
|
|
46
47
|
if (!fs_extra_1.default.existsSync(resolvedAppPackagePath)) {
|
|
47
48
|
return (0, teamsfx_api_1.err)(new teamsfx_api_1.UserError("FxCore", "Share", (0, localizeUtils_1.getLocalizedString)("error.share.appPackageNotFound", resolvedAppPackagePath)));
|
|
@@ -57,18 +58,18 @@ async function parseShareAppActionYamlConfig(projectPath) {
|
|
|
57
58
|
return (0, teamsfx_api_1.err)(new teamsfx_api_1.UserError("FxCore", "Share to Users", (0, localizeUtils_1.getLocalizedString)("error.share.manifestIdNotFound")));
|
|
58
59
|
}
|
|
59
60
|
// 2. get shared title id and shared app id
|
|
60
|
-
const sharedTitleIdEnvName = (
|
|
61
|
-
const sharedAppIdEnvName = (
|
|
61
|
+
const sharedTitleIdEnvName = (_d = extendToM365Action.writeToEnvironmentFile) === null || _d === void 0 ? void 0 : _d.titleId;
|
|
62
|
+
const sharedAppIdEnvName = (_e = extendToM365Action.writeToEnvironmentFile) === null || _e === void 0 ? void 0 : _e.appId;
|
|
62
63
|
if (!sharedTitleIdEnvName || !sharedAppIdEnvName) {
|
|
63
|
-
return (0, teamsfx_api_1.err)(new teamsfx_api_1.UserError("FxCore", "Share
|
|
64
|
+
return (0, teamsfx_api_1.err)(new teamsfx_api_1.UserError("FxCore", "Share", (0, localizeUtils_1.getLocalizedString)("error.share.sharedConfigNotFound")));
|
|
64
65
|
}
|
|
65
66
|
// env file has already been loaded before calling this function.
|
|
66
67
|
const sharedTitleId = process.env[sharedTitleIdEnvName];
|
|
67
68
|
const sharedAppId = process.env[sharedAppIdEnvName];
|
|
68
69
|
if (!sharedTitleId || !sharedAppId) {
|
|
69
|
-
return (0, teamsfx_api_1.err)(new teamsfx_api_1.UserError("FxCore", "Share
|
|
70
|
+
return (0, teamsfx_api_1.err)(new teamsfx_api_1.UserError("FxCore", "Share", (0, localizeUtils_1.getLocalizedString)("error.share.sharedIdNotFound", sharedTitleId, sharedAppId)));
|
|
70
71
|
}
|
|
71
|
-
return (0, teamsfx_api_1.ok)(
|
|
72
|
+
return (0, teamsfx_api_1.ok)({ teamsappId: manifestId, titleId: sharedTitleId, appId: sharedAppId });
|
|
72
73
|
}
|
|
73
74
|
exports.parseShareAppActionYamlConfig = parseShareAppActionYamlConfig;
|
|
74
75
|
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../src/component/driver/share/utils.ts"],"names":[],"mappings":";AAAA,uCAAuC;AACvC,kCAAkC;;;;AAElC,wDAA+F;AAC/F,
|
|
1
|
+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AAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,WAAW,EAAE,CAAC,CAAC;AACpF,CAAC;AAxGD,sEAwGC"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"createAppPackage.d.ts","sourceRoot":"","sources":["../../../../src/component/driver/teamsApp/createAppPackage.ts"],"names":[],"mappings":"AAIA,OAAO,
|
|
1
|
+
{"version":3,"file":"createAppPackage.d.ts","sourceRoot":"","sources":["../../../../src/component/driver/teamsApp/createAppPackage.ts"],"names":[],"mappings":"AAIA,OAAO,EAML,OAAO,EAGP,MAAM,EAKP,MAAM,wBAAwB,CAAC;AAchC,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AACxD,OAAO,EAAE,eAAe,EAAE,UAAU,EAAE,MAAM,yBAAyB,CAAC;AAGtE,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,EAAE,oBAAoB,EAAE,MAAM,mCAAmC,CAAC;AAKzE,eAAO,MAAM,UAAU,2BAA2B,CAAC;AAEnD,qBACa,sBAAuB,YAAW,UAAU;IACvD,WAAW,SAA4E;IACvF,QAAQ,CAAC,aAAa,SAEpB;IAEW,OAAO,CAClB,IAAI,EAAE,oBAAoB,EAC1B,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,eAAe,CAAC;IAad,KAAK,CAChB,IAAI,EAAE,oBAAoB,EAC1B,OAAO,EAAE,iBAAiB,GACzB,OAAO,CAAC,MAAM,CAAC,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,OAAO,CAAC,CAAC;mBA6U3B,aAAa;IASlC,OAAO,CAAC,YAAY;YAwBN,sBAAsB;IAsBpC;;;;;;;;OAQG;YACW,SAAS;IA4HvB;;;;;;;OAOG;YACW,qBAAqB;YAuCrB,mBAAmB;IA+BjC,OAAO,CAAC,YAAY;YAIN,aAAa;YASb,2BAA2B;CA0C1C"}
|
|
@@ -10,22 +10,23 @@ const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
|
10
10
|
const adm_zip_1 = tslib_1.__importDefault(require("adm-zip"));
|
|
11
11
|
const fs_extra_1 = tslib_1.__importDefault(require("fs-extra"));
|
|
12
12
|
const path = tslib_1.__importStar(require("path"));
|
|
13
|
-
const
|
|
13
|
+
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
14
14
|
const typedi_1 = require("typedi");
|
|
15
|
-
const
|
|
15
|
+
const uuid = tslib_1.__importStar(require("uuid"));
|
|
16
|
+
const featureFlags_1 = require("../../../common/featureFlags");
|
|
16
17
|
const globalVars_1 = require("../../../common/globalVars");
|
|
18
|
+
const localizeUtils_1 = require("../../../common/localizeUtils");
|
|
17
19
|
const common_1 = require("../../../error/common");
|
|
20
|
+
const teamsApp_1 = require("../../../error/teamsApp");
|
|
21
|
+
const common_2 = require("../../utils/common");
|
|
22
|
+
const envFunctionUtils_1 = require("../../utils/envFunctionUtils");
|
|
18
23
|
const addStartAndEndTelemetry_1 = require("../middleware/addStartAndEndTelemetry");
|
|
24
|
+
const utils_1 = require("../util/utils");
|
|
19
25
|
const wrapUtil_1 = require("../util/wrapUtil");
|
|
20
26
|
const constants_1 = require("./constants");
|
|
21
|
-
const ManifestUtils_1 = require("./utils/ManifestUtils");
|
|
22
|
-
const teamsApp_1 = require("../../../error/teamsApp");
|
|
23
|
-
const utils_1 = require("./utils/utils");
|
|
24
27
|
const CopilotGptManifestUtils_1 = require("./utils/CopilotGptManifestUtils");
|
|
25
|
-
const
|
|
26
|
-
const
|
|
27
|
-
const featureFlags_1 = require("../../../common/featureFlags");
|
|
28
|
-
const utils_2 = require("../util/utils");
|
|
28
|
+
const ManifestUtils_1 = require("./utils/ManifestUtils");
|
|
29
|
+
const utils_2 = require("./utils/utils");
|
|
29
30
|
exports.actionName = "teamsApp/zipAppPackage";
|
|
30
31
|
let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDriver {
|
|
31
32
|
constructor() {
|
|
@@ -41,7 +42,7 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
|
|
|
41
42
|
};
|
|
42
43
|
}
|
|
43
44
|
async build(args, context) {
|
|
44
|
-
var _a, _b;
|
|
45
|
+
var _a, _b, _c, _d, _e, _f, _g, _h, _j;
|
|
45
46
|
const result = this.validateArgs(args);
|
|
46
47
|
if (result.isErr()) {
|
|
47
48
|
return (0, teamsfx_api_1.err)(result.error);
|
|
@@ -79,55 +80,74 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
|
|
|
79
80
|
}
|
|
80
81
|
await fs_extra_1.default.mkdir(jsonFileDir, { recursive: true });
|
|
81
82
|
const appDirectory = path.dirname(hasTTKGeneratedFolder ? generatedFolder : manifestPath);
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
if (!(await fs_extra_1.default.pathExists(outlineFile))) {
|
|
93
|
-
const error = new common_1.FileNotFoundError(exports.actionName, outlineFile, "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage");
|
|
94
|
-
return (0, teamsfx_api_1.err)(error);
|
|
83
|
+
// check and include all relative file paths in manifest
|
|
84
|
+
const relativeFiles = [manifest.icons.color, manifest.icons.outline];
|
|
85
|
+
const manifestVersion = manifest.manifestVersion === "devPreview"
|
|
86
|
+
? semver_1.default.coerce("1.19.0") // for MetaOS WXP, fallback the `devPreview` ver as `1.19.0` to enable following logics
|
|
87
|
+
: semver_1.default.coerce(manifest.manifestVersion); // ensure manifestVersion is a valid semver
|
|
88
|
+
if (manifestVersion && semver_1.default.gte(manifestVersion, "1.21.0")) {
|
|
89
|
+
const color32x32 = manifest.icons.color32x32;
|
|
90
|
+
if (color32x32) {
|
|
91
|
+
relativeFiles.push(color32x32);
|
|
92
|
+
}
|
|
95
93
|
}
|
|
96
|
-
const
|
|
97
|
-
|
|
98
|
-
|
|
94
|
+
for (const file of relativeFiles) {
|
|
95
|
+
const filePath = path.resolve(appDirectory, file);
|
|
96
|
+
if (!(await fs_extra_1.default.pathExists(filePath))) {
|
|
97
|
+
const error = new common_1.FileNotFoundError(exports.actionName, filePath, "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage");
|
|
98
|
+
return (0, teamsfx_api_1.err)(error);
|
|
99
|
+
}
|
|
100
|
+
const fileRelativePath = path.relative(appDirectory, filePath);
|
|
101
|
+
if (fileRelativePath.startsWith("..")) {
|
|
102
|
+
return (0, teamsfx_api_1.err)(new teamsApp_1.InvalidFileOutsideOfTheDirectotryError(filePath));
|
|
103
|
+
}
|
|
99
104
|
}
|
|
100
105
|
// pre-check existence
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
manifest.localizationInfo
|
|
104
|
-
|
|
106
|
+
let additionalLanguages;
|
|
107
|
+
if (manifestVersion && semver_1.default.gte(manifestVersion, "1.5.0")) {
|
|
108
|
+
additionalLanguages = (_a = manifest.localizationInfo) === null || _a === void 0 ? void 0 : _a.additionalLanguages;
|
|
109
|
+
}
|
|
110
|
+
let composeExtensionType;
|
|
111
|
+
let apiSpecificationFile;
|
|
112
|
+
let commands;
|
|
113
|
+
if (manifestVersion && semver_1.default.gte(manifestVersion, "1.17.0")) {
|
|
114
|
+
composeExtensionType = (_c = (_b = manifest
|
|
115
|
+
.composeExtensions) === null || _b === void 0 ? void 0 : _b[0]) === null || _c === void 0 ? void 0 : _c.composeExtensionType;
|
|
116
|
+
apiSpecificationFile = (_e = (_d = manifest
|
|
117
|
+
.composeExtensions) === null || _d === void 0 ? void 0 : _d[0]) === null || _e === void 0 ? void 0 : _e.apiSpecificationFile;
|
|
118
|
+
commands = (_g = (_f = manifest.composeExtensions) === null || _f === void 0 ? void 0 : _f[0]) === null || _g === void 0 ? void 0 : _g.commands;
|
|
119
|
+
}
|
|
120
|
+
let defaultLanguageFile;
|
|
121
|
+
let declarativeAgents;
|
|
122
|
+
if (manifestVersion && semver_1.default.gte(manifestVersion, "1.19.0")) {
|
|
123
|
+
defaultLanguageFile = (_h = manifest.localizationInfo) === null || _h === void 0 ? void 0 : _h.defaultLanguageFile;
|
|
124
|
+
declarativeAgents = (_j = manifest.copilotAgents) === null || _j === void 0 ? void 0 : _j.declarativeAgents;
|
|
125
|
+
}
|
|
126
|
+
if (additionalLanguages && additionalLanguages.length > 0) {
|
|
127
|
+
for (const language of additionalLanguages) {
|
|
105
128
|
const file = language.file;
|
|
106
|
-
const fileName =
|
|
129
|
+
const fileName = path.join(appDirectory, file);
|
|
107
130
|
if (!(await fs_extra_1.default.pathExists(fileName))) {
|
|
108
131
|
return (0, teamsfx_api_1.err)(new common_1.FileNotFoundError(exports.actionName, fileName, "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage"));
|
|
109
132
|
}
|
|
110
133
|
}
|
|
111
134
|
}
|
|
112
|
-
if (
|
|
113
|
-
const
|
|
114
|
-
const fileName = `${appDirectory}/${file}`;
|
|
135
|
+
if (defaultLanguageFile) {
|
|
136
|
+
const fileName = path.join(appDirectory, defaultLanguageFile);
|
|
115
137
|
if (!(await fs_extra_1.default.pathExists(fileName))) {
|
|
116
138
|
return (0, teamsfx_api_1.err)(new common_1.FileNotFoundError(exports.actionName, fileName, "https://aka.ms/teamsfx-actions/teamsapp-zipAppPackage"));
|
|
117
139
|
}
|
|
118
140
|
}
|
|
119
141
|
const zip = new adm_zip_1.default();
|
|
120
142
|
zip.addFile(constants_1.Constants.MANIFEST_FILE, Buffer.from(JSON.stringify(manifest, null, 4)));
|
|
121
|
-
//
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
143
|
+
// icon images, relative path
|
|
144
|
+
for (const icon of relativeFiles) {
|
|
145
|
+
const dir = path.dirname(icon);
|
|
146
|
+
zip.addLocalFile(path.resolve(appDirectory, icon), dir === "." ? "" : dir);
|
|
147
|
+
}
|
|
126
148
|
// localization file
|
|
127
|
-
if (
|
|
128
|
-
|
|
129
|
-
manifest.localizationInfo.additionalLanguages.length > 0) {
|
|
130
|
-
for (const language of manifest.localizationInfo.additionalLanguages) {
|
|
149
|
+
if (additionalLanguages && additionalLanguages.length > 0) {
|
|
150
|
+
for (const language of additionalLanguages) {
|
|
131
151
|
const file = language.file;
|
|
132
152
|
const fileName = path.resolve(appDirectory, file);
|
|
133
153
|
const relativePath = path.relative(appDirectory, fileName);
|
|
@@ -143,9 +163,8 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
|
|
|
143
163
|
}
|
|
144
164
|
}
|
|
145
165
|
}
|
|
146
|
-
if (
|
|
147
|
-
const
|
|
148
|
-
const fileName = path.resolve(appDirectory, file);
|
|
166
|
+
if (defaultLanguageFile) {
|
|
167
|
+
const fileName = path.resolve(appDirectory, defaultLanguageFile);
|
|
149
168
|
const relativePath = path.relative(appDirectory, fileName);
|
|
150
169
|
if (relativePath.startsWith("..")) {
|
|
151
170
|
return (0, teamsfx_api_1.err)(new teamsApp_1.InvalidFileOutsideOfTheDirectotryError(fileName));
|
|
@@ -159,21 +178,18 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
|
|
|
159
178
|
}
|
|
160
179
|
}
|
|
161
180
|
// API ME, API specification and Adaptive card templates
|
|
162
|
-
if (
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
manifest.composeExtensions[0].apiSpecificationFile) {
|
|
166
|
-
const apiSpecificationFile = path.resolve(appDirectory, manifest.composeExtensions[0].apiSpecificationFile);
|
|
167
|
-
const checkExistenceRes = await this.validateReferencedFile(apiSpecificationFile, appDirectory);
|
|
181
|
+
if (composeExtensionType == "apiBased" && apiSpecificationFile) {
|
|
182
|
+
const apiSpecificationFilePath = path.resolve(appDirectory, apiSpecificationFile);
|
|
183
|
+
const checkExistenceRes = await this.validateReferencedFile(apiSpecificationFilePath, appDirectory);
|
|
168
184
|
if (checkExistenceRes.isErr()) {
|
|
169
185
|
return (0, teamsfx_api_1.err)(checkExistenceRes.error);
|
|
170
186
|
}
|
|
171
|
-
const addFileWithVariableRes = await this.addFileWithVariable(zip,
|
|
187
|
+
const addFileWithVariableRes = await this.addFileWithVariable(zip, apiSpecificationFile, apiSpecificationFilePath, envFunctionUtils_1.ManifestType.ApiSpec, context);
|
|
172
188
|
if (addFileWithVariableRes.isErr()) {
|
|
173
189
|
return (0, teamsfx_api_1.err)(addFileWithVariableRes.error);
|
|
174
190
|
}
|
|
175
|
-
if (
|
|
176
|
-
for (const command of
|
|
191
|
+
if (commands && commands.length > 0) {
|
|
192
|
+
for (const command of commands) {
|
|
177
193
|
if (command.apiResponseRenderingTemplateFile) {
|
|
178
194
|
const adaptiveCardFile = path.resolve(appDirectory, command.apiResponseRenderingTemplateFile);
|
|
179
195
|
const checkExistenceRes = await this.validateReferencedFile(adaptiveCardFile, appDirectory);
|
|
@@ -186,27 +202,14 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
|
|
|
186
202
|
}
|
|
187
203
|
}
|
|
188
204
|
}
|
|
189
|
-
const plugins = manifest.copilotExtensions
|
|
190
|
-
? manifest.copilotExtensions.plugins
|
|
191
|
-
: (_a = manifest.copilotAgents) === null || _a === void 0 ? void 0 : _a.plugins;
|
|
192
|
-
if ((plugins === null || plugins === void 0 ? void 0 : plugins.length) && plugins[0].file) {
|
|
193
|
-
// API plugin
|
|
194
|
-
const addFilesRes = await this.addPlugin(zip, plugins[0].file, appDirectory, context, !shouldwriteAllManifest ? undefined : jsonFileDir);
|
|
195
|
-
if (addFilesRes.isErr()) {
|
|
196
|
-
return (0, teamsfx_api_1.err)(addFilesRes.error);
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
const declarativeCopilots = manifest.copilotExtensions
|
|
200
|
-
? manifest.copilotExtensions.declarativeCopilots
|
|
201
|
-
: (_b = manifest.copilotAgents) === null || _b === void 0 ? void 0 : _b.declarativeAgents;
|
|
202
205
|
// Copilot GPT
|
|
203
|
-
if ((
|
|
204
|
-
const declarativeAgentManifestFile = path.resolve(hasTTKGeneratedFolder ? generatedFolder : appDirectory,
|
|
206
|
+
if ((declarativeAgents === null || declarativeAgents === void 0 ? void 0 : declarativeAgents.length) && declarativeAgents[0].file) {
|
|
207
|
+
const declarativeAgentManifestFile = path.resolve(hasTTKGeneratedFolder ? generatedFolder : appDirectory, declarativeAgents[0].file);
|
|
205
208
|
const checkExistenceRes = await this.validateReferencedFile(declarativeAgentManifestFile, appDirectory);
|
|
206
209
|
if (checkExistenceRes.isErr()) {
|
|
207
210
|
return (0, teamsfx_api_1.err)(checkExistenceRes.error);
|
|
208
211
|
}
|
|
209
|
-
const addFileWithVariableRes = await this.addFileWithVariable(zip,
|
|
212
|
+
const addFileWithVariableRes = await this.addFileWithVariable(zip, declarativeAgents[0].file, declarativeAgentManifestFile, envFunctionUtils_1.ManifestType.DeclarativeCopilotManifest, context, shouldwriteAllManifest
|
|
210
213
|
? path.join(jsonFileDir, path.relative(appDirectory, declarativeAgentManifestFile))
|
|
211
214
|
: undefined);
|
|
212
215
|
if (addFileWithVariableRes.isErr()) {
|
|
@@ -220,8 +223,8 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
|
|
|
220
223
|
for (const pluginFile of pluginFiles) {
|
|
221
224
|
const pluginFileAbsolutePath = path.resolve(path.dirname(declarativeAgentManifestFile), pluginFile);
|
|
222
225
|
const pluginFileRelativePath = path.relative(hasTTKGeneratedFolder ? generatedFolder : appDirectory, pluginFileAbsolutePath);
|
|
223
|
-
const useForwardSlash =
|
|
224
|
-
const addPluginRes = await this.addPlugin(zip, (0,
|
|
226
|
+
const useForwardSlash = declarativeAgents[0].file.concat(pluginFile).includes("/");
|
|
227
|
+
const addPluginRes = await this.addPlugin(zip, (0, utils_2.normalizePath)(pluginFileRelativePath, useForwardSlash), hasTTKGeneratedFolder ? generatedFolder : appDirectory, context, !shouldwriteAllManifest ? undefined : jsonFileDir, hasTTKGeneratedFolder ? appDirectory : undefined);
|
|
225
228
|
if (addPluginRes.isErr()) {
|
|
226
229
|
return (0, teamsfx_api_1.err)(addPluginRes.error);
|
|
227
230
|
}
|
|
@@ -252,10 +255,8 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
|
|
|
252
255
|
if (checkExistenceRes.isErr()) {
|
|
253
256
|
return (0, teamsfx_api_1.err)(checkExistenceRes.error);
|
|
254
257
|
}
|
|
255
|
-
const
|
|
256
|
-
|
|
257
|
-
return (0, teamsfx_api_1.err)(addKnowledgeRes.error);
|
|
258
|
-
}
|
|
258
|
+
const dir = path.dirname(file);
|
|
259
|
+
zip.addLocalFile(knowledgeFileAbsolutePath, dir === "." ? "" : dir);
|
|
259
260
|
}
|
|
260
261
|
}
|
|
261
262
|
}
|
|
@@ -279,7 +280,7 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
|
|
|
279
280
|
}
|
|
280
281
|
static async expandEnvVars(filePath, ctx, manifestType) {
|
|
281
282
|
const content = await fs_extra_1.default.readFile(filePath, "utf8");
|
|
282
|
-
return (0,
|
|
283
|
+
return (0, utils_2.getResolvedManifest)(content, filePath, manifestType, ctx);
|
|
283
284
|
}
|
|
284
285
|
validateArgs(args) {
|
|
285
286
|
const invalidParams = [];
|
|
@@ -358,7 +359,7 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
|
|
|
358
359
|
context.logProvider.warning((0, localizeUtils_1.getLocalizedString)("plugins.appstudio.createPackage.aiPlugin.containsUnderscore", pluginRelativePath));
|
|
359
360
|
}
|
|
360
361
|
if (containExternalAdaptiveCard) {
|
|
361
|
-
await (0,
|
|
362
|
+
await (0, utils_1.updateVersionForTeamsAppYamlFile)(context.projectPath);
|
|
362
363
|
}
|
|
363
364
|
if (namespaceContainsUnderscore || containExternalAdaptiveCard) {
|
|
364
365
|
tempFolder = path.join(appDirectory, ".tmp");
|
|
@@ -412,7 +413,7 @@ let CreateAppPackageDriver = CreateAppPackageDriver_1 = class CreateAppPackageDr
|
|
|
412
413
|
}
|
|
413
414
|
const entryName = path.relative(appDirectory, specFile);
|
|
414
415
|
const useForwardSlash = pluginFile.concat(runtime.spec.url).includes("/");
|
|
415
|
-
const addFileWithVariableRes = await this.addFileWithVariable(zip, (0,
|
|
416
|
+
const addFileWithVariableRes = await this.addFileWithVariable(zip, (0, utils_2.normalizePath)(entryName, useForwardSlash), specFile, envFunctionUtils_1.ManifestType.ApiSpec, context);
|
|
416
417
|
if (addFileWithVariableRes.isErr()) {
|
|
417
418
|
return (0, teamsfx_api_1.err)(addFileWithVariableRes.error);
|
|
418
419
|
}
|