@microsoft/teamsfx-core 1.2.2-alpha.01a113d2.0 → 1.2.2-alpha.4ce002ea.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/common/local/constants.d.ts +0 -1
- package/build/common/local/constants.d.ts.map +1 -1
- package/build/common/local/constants.js +0 -1
- package/build/common/local/constants.js.map +1 -1
- package/build/common/local/localEnvManager.js +1 -1
- package/build/common/local/localEnvManager.js.map +1 -1
- package/build/common/local/portChecker.d.ts +2 -2
- package/build/common/local/portChecker.d.ts.map +1 -1
- package/build/common/local/portChecker.js +18 -5
- package/build/common/local/portChecker.js.map +1 -1
- package/build/common/local/taskDefinition.d.ts +0 -7
- package/build/common/local/taskDefinition.d.ts.map +1 -1
- package/build/common/local/taskDefinition.js +1 -51
- package/build/common/local/taskDefinition.js.map +1 -1
- package/build/common/localSettingsConstants.d.ts +2 -1
- package/build/common/localSettingsConstants.d.ts.map +1 -1
- package/build/common/localSettingsConstants.js +3 -2
- package/build/common/localSettingsConstants.js.map +1 -1
- package/build/common/localSettingsProvider.d.ts +3 -3
- package/build/common/localSettingsProvider.d.ts.map +1 -1
- package/build/common/localSettingsProvider.js +13 -11
- package/build/common/localSettingsProvider.js.map +1 -1
- package/build/common/permissionInterface.d.ts +1 -3
- package/build/common/permissionInterface.d.ts.map +1 -1
- package/build/common/permissionInterface.js +0 -2
- package/build/common/permissionInterface.js.map +1 -1
- package/build/common/projectSettingsValidator.d.ts +4 -0
- package/build/common/projectSettingsValidator.d.ts.map +1 -0
- package/build/common/projectSettingsValidator.js +65 -0
- package/build/common/projectSettingsValidator.js.map +1 -0
- package/build/common/telemetry.d.ts +3 -1
- package/build/common/telemetry.d.ts.map +1 -1
- package/build/common/telemetry.js +2 -0
- package/build/common/telemetry.js.map +1 -1
- package/build/common/template-utils/templatesActions.js +2 -2
- package/build/common/template-utils/templatesUtils.d.ts +2 -1
- package/build/common/template-utils/templatesUtils.d.ts.map +1 -1
- package/build/common/template-utils/templatesUtils.js +25 -7
- package/build/common/template-utils/templatesUtils.js.map +1 -1
- package/build/common/tools.d.ts +0 -4
- package/build/common/tools.d.ts.map +1 -1
- package/build/common/tools.js +1 -8
- package/build/common/tools.js.map +1 -1
- package/build/core/error.d.ts +2 -0
- package/build/core/error.d.ts.map +1 -1
- package/build/core/error.js +10 -2
- package/build/core/error.js.map +1 -1
- package/build/core/index.d.ts +0 -1
- package/build/core/index.d.ts.map +1 -1
- package/build/core/index.js +5 -25
- package/build/core/index.js.map +1 -1
- package/build/core/middleware/CommonErrorHandlerMW.d.ts +14 -0
- package/build/core/middleware/CommonErrorHandlerMW.d.ts.map +1 -0
- package/build/core/middleware/CommonErrorHandlerMW.js +55 -0
- package/build/core/middleware/CommonErrorHandlerMW.js.map +1 -0
- package/build/core/middleware/envInfoLoader.d.ts.map +1 -1
- package/build/core/middleware/envInfoLoader.js +2 -1
- package/build/core/middleware/envInfoLoader.js.map +1 -1
- package/build/core/middleware/localSettingsLoader.d.ts.map +1 -1
- package/build/core/middleware/localSettingsLoader.js +4 -2
- package/build/core/middleware/localSettingsLoader.js.map +1 -1
- package/build/core/middleware/projectMigrator.d.ts.map +1 -1
- package/build/core/middleware/projectMigrator.js +1 -5
- package/build/core/middleware/projectMigrator.js.map +1 -1
- package/build/core/middleware/projectSettingsLoader.d.ts.map +1 -1
- package/build/core/middleware/projectSettingsLoader.js +1 -1
- package/build/core/middleware/projectSettingsLoader.js.map +1 -1
- package/build/core/pvm/broker.d.ts +24 -0
- package/build/core/pvm/broker.d.ts.map +1 -0
- package/build/core/pvm/broker.js +93 -0
- package/build/core/pvm/broker.js.map +1 -0
- package/build/core/pvm/constant.d.ts +9 -0
- package/build/core/pvm/constant.d.ts.map +1 -0
- package/build/core/pvm/constant.js +12 -0
- package/build/core/pvm/constant.js.map +1 -0
- package/build/core/pvm/depot.d.ts +43 -0
- package/build/core/pvm/depot.d.ts.map +1 -0
- package/build/core/pvm/depot.js +242 -0
- package/build/core/pvm/depot.js.map +1 -0
- package/build/core/pvm/pvm.d.ts +50 -0
- package/build/core/pvm/pvm.d.ts.map +1 -0
- package/build/core/pvm/pvm.js +92 -0
- package/build/core/pvm/pvm.js.map +1 -0
- package/build/core/pvm/type.d.ts +11 -0
- package/build/core/pvm/type.d.ts.map +1 -0
- package/build/core/pvm/type.js +3 -0
- package/build/core/pvm/type.js.map +1 -0
- package/build/core/pvm/utility.d.ts +2 -0
- package/build/core/pvm/utility.d.ts.map +1 -0
- package/build/core/pvm/utility.js +10 -0
- package/build/core/pvm/utility.js.map +1 -0
- package/build/core/tools.d.ts.map +1 -1
- package/build/core/tools.js +2 -6
- package/build/core/tools.js.map +1 -1
- package/build/plugins/resource/aad/aadAppClient.d.ts +8 -8
- package/build/plugins/resource/aad/aadAppClient.d.ts.map +1 -1
- package/build/plugins/resource/aad/aadAppClient.js +29 -29
- package/build/plugins/resource/aad/aadAppClient.js.map +1 -1
- package/build/plugins/resource/aad/index.d.ts +1 -0
- package/build/plugins/resource/aad/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/index.js +1 -0
- package/build/plugins/resource/aad/index.js.map +1 -1
- package/build/plugins/resource/aad/plugin.d.ts +4 -3
- package/build/plugins/resource/aad/plugin.d.ts.map +1 -1
- package/build/plugins/resource/aad/plugin.js +13 -13
- package/build/plugins/resource/aad/plugin.js.map +1 -1
- package/build/plugins/resource/aad/utils/common.d.ts +6 -4
- package/build/plugins/resource/aad/utils/common.d.ts.map +1 -1
- package/build/plugins/resource/aad/utils/common.js +60 -21
- package/build/plugins/resource/aad/utils/common.js.map +1 -1
- package/build/plugins/resource/aad/utils/configs.d.ts +9 -1
- package/build/plugins/resource/aad/utils/configs.d.ts.map +1 -1
- package/build/plugins/resource/aad/utils/configs.js +232 -0
- package/build/plugins/resource/aad/utils/configs.js.map +1 -1
- package/build/plugins/resource/aad/utils/telemetry.d.ts +0 -1
- package/build/plugins/resource/aad/utils/telemetry.d.ts.map +1 -1
- package/build/plugins/resource/aad/utils/telemetry.js +10 -17
- package/build/plugins/resource/aad/utils/telemetry.js.map +1 -1
- package/build/plugins/resource/aad/utils/tokenProvider.d.ts +6 -2
- package/build/plugins/resource/aad/utils/tokenProvider.d.ts.map +1 -1
- package/build/plugins/resource/aad/utils/tokenProvider.js +11 -11
- package/build/plugins/resource/aad/utils/tokenProvider.js.map +1 -1
- package/build/plugins/resource/aad/v2/index.d.ts +10 -11
- package/build/plugins/resource/aad/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/aad/v2/index.js.map +1 -1
- package/build/plugins/resource/aad/v3/index.d.ts +24 -0
- package/build/plugins/resource/aad/v3/index.d.ts.map +1 -0
- package/build/plugins/resource/aad/v3/index.js +248 -0
- package/build/plugins/resource/aad/v3/index.js.map +1 -0
- package/build/plugins/resource/appstudio/manifestTemplate.d.ts +1 -1
- package/build/plugins/resource/appstudio/manifestTemplate.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/manifestTemplate.js +11 -3
- package/build/plugins/resource/appstudio/manifestTemplate.js.map +1 -1
- package/build/plugins/resource/appstudio/plugin.js +2 -2
- package/build/plugins/resource/appstudio/plugin.js.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts +8 -4
- package/build/plugins/resource/appstudio/utils/telemetry.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/utils/telemetry.js +13 -12
- package/build/plugins/resource/appstudio/utils/telemetry.js.map +1 -1
- package/build/plugins/resource/appstudio/v3/index.d.ts +10 -1
- package/build/plugins/resource/appstudio/v3/index.d.ts.map +1 -1
- package/build/plugins/resource/appstudio/v3/index.js +36 -2
- package/build/plugins/resource/appstudio/v3/index.js.map +1 -1
- package/build/plugins/resource/bot/aadRegistration.d.ts.map +1 -1
- package/build/plugins/resource/bot/aadRegistration.js +5 -4
- package/build/plugins/resource/bot/aadRegistration.js.map +1 -1
- package/build/plugins/resource/bot/enums/programmingLanguage.d.ts +2 -1
- package/build/plugins/resource/bot/enums/programmingLanguage.d.ts.map +1 -1
- package/build/plugins/resource/bot/enums/programmingLanguage.js +1 -0
- package/build/plugins/resource/bot/enums/programmingLanguage.js.map +1 -1
- package/build/plugins/resource/bot/index.js +3 -2
- package/build/plugins/resource/bot/index.js.map +1 -1
- package/build/plugins/resource/frontend/index.d.ts.map +1 -1
- package/build/plugins/resource/frontend/index.js +3 -2
- package/build/plugins/resource/frontend/index.js.map +1 -1
- package/build/plugins/resource/frontend/resources/templateInfo.d.ts +4 -3
- package/build/plugins/resource/frontend/resources/templateInfo.d.ts.map +1 -1
- package/build/plugins/resource/frontend/resources/templateInfo.js +8 -7
- package/build/plugins/resource/frontend/resources/templateInfo.js.map +1 -1
- package/build/plugins/resource/localdebug/constants.d.ts +0 -1
- package/build/plugins/resource/localdebug/constants.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/constants.js +0 -1
- package/build/plugins/resource/localdebug/constants.js.map +1 -1
- package/build/plugins/resource/localdebug/v2/index.d.ts.map +1 -1
- package/build/plugins/resource/localdebug/v2/index.js +1 -4
- package/build/plugins/resource/localdebug/v2/index.js.map +1 -1
- package/build/plugins/resource/simpleauth/plugin.d.ts.map +1 -1
- package/build/plugins/resource/simpleauth/plugin.js +2 -2
- package/build/plugins/resource/simpleauth/plugin.js.map +1 -1
- package/build/plugins/resource/utils4v2.d.ts +15 -16
- package/build/plugins/resource/utils4v2.d.ts.map +1 -1
- package/build/plugins/resource/utils4v2.js.map +1 -1
- package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/arm.js +25 -13
- package/build/plugins/solution/fx-solution/arm.js.map +1 -1
- package/build/plugins/solution/fx-solution/constants.d.ts +2 -4
- package/build/plugins/solution/fx-solution/constants.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/constants.js +3 -5
- package/build/plugins/solution/fx-solution/constants.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/provisionLocal.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/debug/provisionLocal.js +12 -4
- package/build/plugins/solution/fx-solution/debug/provisionLocal.js.map +1 -1
- package/build/plugins/solution/fx-solution/debug/util/tasks.js +1 -4
- package/build/plugins/solution/fx-solution/debug/util/tasks.js.map +1 -1
- package/build/plugins/solution/fx-solution/solution.d.ts +0 -1
- package/build/plugins/solution/fx-solution/solution.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/solution.js +0 -10
- package/build/plugins/solution/fx-solution/solution.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/checkPermission.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/checkPermission.js +25 -13
- package/build/plugins/solution/fx-solution/v2/checkPermission.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/grantPermission.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/grantPermission.js +26 -14
- package/build/plugins/solution/fx-solution/v2/grantPermission.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/listCollaborator.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/listCollaborator.js +20 -10
- package/build/plugins/solution/fx-solution/v2/listCollaborator.js.map +1 -1
- package/build/plugins/solution/fx-solution/v2/solution.d.ts +0 -1
- package/build/plugins/solution/fx-solution/v2/solution.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v2/solution.js +0 -2
- package/build/plugins/solution/fx-solution/v2/solution.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/addResource.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/addResource.js +13 -10
- package/build/plugins/solution/fx-solution/v3/addResource.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/constants.js +1 -1
- package/build/plugins/solution/fx-solution/v3/constants.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/provision.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/provision.js +5 -0
- package/build/plugins/solution/fx-solution/v3/provision.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/provisionLocal.d.ts.map +1 -1
- package/build/plugins/solution/fx-solution/v3/provisionLocal.js +17 -36
- package/build/plugins/solution/fx-solution/v3/provisionLocal.js.map +1 -1
- package/build/plugins/solution/fx-solution/v3/solutionGlobalVars.d.ts +5 -0
- package/build/plugins/solution/fx-solution/v3/solutionGlobalVars.d.ts.map +1 -0
- package/build/plugins/solution/fx-solution/v3/solutionGlobalVars.js +10 -0
- package/build/plugins/solution/fx-solution/v3/solutionGlobalVars.js.map +1 -0
- package/package.json +7 -3
- package/resource/strings.json +28 -1
- package/templates/plugins/solution/{main.bicep → mainConfig.bicep} +0 -12
- package/templates/plugins/solution/mainProvision.bicep +10 -0
- package/build/plugins/solution/fx-solution/v2/listAllCollaborators.d.ts +0 -5
- package/build/plugins/solution/fx-solution/v2/listAllCollaborators.d.ts.map +0 -1
- package/build/plugins/solution/fx-solution/v2/listAllCollaborators.js +0 -118
- package/build/plugins/solution/fx-solution/v2/listAllCollaborators.js.map +0 -1
package/resource/strings.json
CHANGED
|
@@ -61,7 +61,34 @@
|
|
|
61
61
|
"Collaboration": {
|
|
62
62
|
"ListCollaboratorsSuccess": "List M365 Teams App%s owners success, you can view it in Teams Toolkit output window",
|
|
63
63
|
"WithAadApp": "(With AAD App)",
|
|
64
|
-
"FailedToListCollaborators": "Failed to list Teams App owners for the project.\nError details: \n"
|
|
64
|
+
"FailedToListCollaborators": "Failed to list Teams App owners for the project.\nError details: \n",
|
|
65
|
+
"GrantingPermission": "Granting permission",
|
|
66
|
+
"EmailCannotBeEmptyOrSame":"Collaborator's email cannot be null or same as current user",
|
|
67
|
+
"CannotFindUserInCurrentTenant":"Cannot find user in current tenant, please check whether your email address is correct",
|
|
68
|
+
"GrantPermissionForUser":"Grant permission for user",
|
|
69
|
+
"FailedToGetEnvName": "Failed to get env name.",
|
|
70
|
+
"AccountToGrantPermission": "Account to grant permission: ",
|
|
71
|
+
"StartingGrantPermission":"Starting grant permission for environment: ",
|
|
72
|
+
"TenantId": "Tenant ID: ",
|
|
73
|
+
"FailedToGrantPermission":"Failed to grant permission for the below resources to user: %s.\n Resource details: \n",
|
|
74
|
+
"PermissionHasBeenGrantTo":"permission has been granted to ",
|
|
75
|
+
"GrantPermissionResourceId": ", Resource ID: ",
|
|
76
|
+
"SharePointTip":"\nIf added user is not a SharePoint App Catalog site admin, you need to manually setup access policy via SharePoint admin center, please refer to this link for more details: ",
|
|
77
|
+
"AzureTip":"\nIf added user cannot access Azure resources, you need to manually setup access policy via Azure portal, please refer to this link for more details: ",
|
|
78
|
+
"ListingM365Permission": "Listing M365 permissions\n",
|
|
79
|
+
"AccountUsedToCheck":"Account used to check: ",
|
|
80
|
+
"StartingListAllTeamsAppOwners": "Starting list all teams app owners for environment: ",
|
|
81
|
+
"M365TeamsAppId": "M365 Teams App (ID: ",
|
|
82
|
+
"SsoAadAppId":"), SSO AAD App (ID: ",
|
|
83
|
+
"TeamsAppOwner": "Teams App Owner: ",
|
|
84
|
+
"NotOwnerOfSsoAadApp":"(Not owner of SSO AAD app)",
|
|
85
|
+
"FailedToConvertProfile": "failed to convert profile ",
|
|
86
|
+
"StaringCheckPermission": "Starting check permission for environment: ",
|
|
87
|
+
"FailedToCheckPermission": "Failed to check permission for the below resources.\n Resource details: \n",
|
|
88
|
+
"CheckPermissionResourceId": "Resource ID: ",
|
|
89
|
+
"Undefined": "undefined",
|
|
90
|
+
"ResourceName": ", Resource Name: ",
|
|
91
|
+
"Permission": ", Permission: "
|
|
65
92
|
}
|
|
66
93
|
},
|
|
67
94
|
"plugins": {
|
|
@@ -1,13 +1,3 @@
|
|
|
1
|
-
@secure()
|
|
2
|
-
param provisionParameters object
|
|
3
|
-
|
|
4
|
-
module provision './provision.bicep' = {
|
|
5
|
-
name: 'provisionResources'
|
|
6
|
-
params: {
|
|
7
|
-
provisionParameters: provisionParameters
|
|
8
|
-
}
|
|
9
|
-
}
|
|
10
|
-
|
|
11
1
|
module teamsFxConfig './config.bicep' = {
|
|
12
2
|
name: 'addTeamsFxConfigurations'
|
|
13
3
|
params: {
|
|
@@ -15,6 +5,4 @@ module teamsFxConfig './config.bicep' = {
|
|
|
15
5
|
provisionOutputs: provision
|
|
16
6
|
}
|
|
17
7
|
}
|
|
18
|
-
|
|
19
|
-
output provisionOutput object = provision
|
|
20
8
|
output teamsFxConfigurationOutput object = contains(reference(resourceId('Microsoft.Resources/deployments', teamsFxConfig.name), '2020-06-01'), 'outputs') ? teamsFxConfig : {}
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import { FxError, Result } from "@microsoft/teamsfx-api";
|
|
2
|
-
import { ListCollaboratorResult } from "../../../../common";
|
|
3
|
-
import { CollabApiParam } from "./collaborationUtil";
|
|
4
|
-
export declare function listAllCollaborators(param: CollabApiParam): Promise<Result<Record<string, ListCollaboratorResult>, FxError>>;
|
|
5
|
-
//# sourceMappingURL=listAllCollaborators.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listAllCollaborators.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/solution/fx-solution/v2/listAllCollaborators.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,EAIP,MAAM,EAMP,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAKL,sBAAsB,EAEvB,MAAM,oBAAoB,CAAC;AAY5B,OAAO,EAAE,cAAc,EAAqB,MAAM,qBAAqB,CAAC;AA2JxE,wBAAsB,oBAAoB,CACxC,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,sBAAsB,CAAC,EAAE,OAAO,CAAC,CAAC,CAyClE"}
|
|
@@ -1,118 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.listAllCollaborators = void 0;
|
|
4
|
-
const teamsfx_api_1 = require("@microsoft/teamsfx-api");
|
|
5
|
-
const common_1 = require("../../../../common");
|
|
6
|
-
const constants_1 = require("../constants");
|
|
7
|
-
const util_1 = require("../utils/util");
|
|
8
|
-
const collaborationUtil_1 = require("./collaborationUtil");
|
|
9
|
-
const __1 = require("../../../..");
|
|
10
|
-
const listCollaborator_1 = require("./listCollaborator");
|
|
11
|
-
async function listAllCollaboratorsImpl(param, projectPath, cryptoProvider, telemetryReporter, ui, graphTokenProvider, platform) {
|
|
12
|
-
var _a, _b;
|
|
13
|
-
telemetryReporter === null || telemetryReporter === void 0 ? void 0 : telemetryReporter.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.ListAllCollaboratorsStart, {
|
|
14
|
-
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
15
|
-
});
|
|
16
|
-
const collaboratorsResult = {};
|
|
17
|
-
const envs = await __1.environmentManager.listEnvConfigs(projectPath);
|
|
18
|
-
if (envs.isErr()) {
|
|
19
|
-
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ListAllCollaborators, envs.error, telemetryReporter));
|
|
20
|
-
}
|
|
21
|
-
const result = await collaborationUtil_1.CollaborationUtil.getCurrentUserInfo(graphTokenProvider);
|
|
22
|
-
if (result.isErr()) {
|
|
23
|
-
return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ListAllCollaborators, result.error, telemetryReporter));
|
|
24
|
-
}
|
|
25
|
-
const userInfo = result.value;
|
|
26
|
-
for (const env of envs.value) {
|
|
27
|
-
try {
|
|
28
|
-
const envInfo = await __1.environmentManager.loadEnvInfo(projectPath, cryptoProvider, env);
|
|
29
|
-
if (envInfo.isErr()) {
|
|
30
|
-
throw envInfo.error;
|
|
31
|
-
}
|
|
32
|
-
const stateResult = collaborationUtil_1.CollaborationUtil.getCurrentCollaborationState(envInfo.value.state, result.value);
|
|
33
|
-
if (stateResult.state != common_1.CollaborationState.OK) {
|
|
34
|
-
if (platform === teamsfx_api_1.Platform.CLI) {
|
|
35
|
-
ui === null || ui === void 0 ? void 0 : ui.showMessage("warn", stateResult.message, false);
|
|
36
|
-
}
|
|
37
|
-
collaboratorsResult[env] = {
|
|
38
|
-
state: stateResult.state,
|
|
39
|
-
message: stateResult.message,
|
|
40
|
-
};
|
|
41
|
-
continue;
|
|
42
|
-
}
|
|
43
|
-
const [results, errors] = param.apiVersion === 1
|
|
44
|
-
? await listCollaborator_1.executeListCollaboratorV1(param.ctx, userInfo)
|
|
45
|
-
: await listCollaborator_1.executeListCollaboratorV2(param.ctx, param.inputs, param.envInfo, param.tokenProvider, userInfo);
|
|
46
|
-
let errorMsg = "";
|
|
47
|
-
if (errors.length > 0) {
|
|
48
|
-
errorMsg += `Failed to list collaborator for the project.\n Error details: \n`;
|
|
49
|
-
for (const fxError of errors) {
|
|
50
|
-
errorMsg += fxError.error.message + "\n";
|
|
51
|
-
}
|
|
52
|
-
}
|
|
53
|
-
if (errorMsg) {
|
|
54
|
-
collaboratorsResult[env] = {
|
|
55
|
-
state: common_1.CollaborationState.ERROR,
|
|
56
|
-
error: teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ListAllCollaborators, teamsfx_api_1.returnUserError(new Error(errorMsg), constants_1.SolutionSource, constants_1.SolutionError.FailedToListCollaborator), telemetryReporter)),
|
|
57
|
-
};
|
|
58
|
-
continue;
|
|
59
|
-
}
|
|
60
|
-
const teamsAppOwners = results[0].isErr() ? [] : results[0].value;
|
|
61
|
-
const aadOwners = results[1].isErr() ? [] : results[1].value;
|
|
62
|
-
const collaborators = [];
|
|
63
|
-
for (const teamsAppOwner of teamsAppOwners) {
|
|
64
|
-
const aadOwner = aadOwners.find((owner) => owner.userObjectId === teamsAppOwner.userObjectId);
|
|
65
|
-
collaborators.push({
|
|
66
|
-
// For guest account, aadOwner.userPrincipalName will be user's email, and is easy to read.
|
|
67
|
-
userPrincipalName: (_b = (_a = aadOwner === null || aadOwner === void 0 ? void 0 : aadOwner.userPrincipalName) !== null && _a !== void 0 ? _a : teamsAppOwner.userPrincipalName) !== null && _b !== void 0 ? _b : teamsAppOwner.userObjectId,
|
|
68
|
-
userObjectId: teamsAppOwner.userObjectId,
|
|
69
|
-
isAadOwner: aadOwner ? true : false,
|
|
70
|
-
aadResourceId: aadOwner ? aadOwner.resourceId : undefined,
|
|
71
|
-
teamsAppResourceId: teamsAppOwner.resourceId,
|
|
72
|
-
});
|
|
73
|
-
}
|
|
74
|
-
const aadOwnerCount = collaborators.filter((collaborator) => collaborator.aadResourceId && collaborator.isAadOwner).length;
|
|
75
|
-
telemetryReporter === null || telemetryReporter === void 0 ? void 0 : telemetryReporter.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.ListAllCollaborators, {
|
|
76
|
-
[constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
|
|
77
|
-
[constants_1.SolutionTelemetryProperty.Success]: constants_1.SolutionTelemetrySuccess.Yes,
|
|
78
|
-
[constants_1.SolutionTelemetryProperty.CollaboratorCount]: collaborators.length.toString(),
|
|
79
|
-
[constants_1.SolutionTelemetryProperty.AadOwnerCount]: aadOwnerCount.toString(),
|
|
80
|
-
[constants_1.SolutionTelemetryProperty.Env]: common_1.getHashedEnv(env),
|
|
81
|
-
});
|
|
82
|
-
collaboratorsResult[env] = {
|
|
83
|
-
collaborators: collaborators,
|
|
84
|
-
state: common_1.CollaborationState.OK,
|
|
85
|
-
};
|
|
86
|
-
}
|
|
87
|
-
catch (error) {
|
|
88
|
-
collaboratorsResult[env] = {
|
|
89
|
-
state: common_1.CollaborationState.ERROR,
|
|
90
|
-
error: teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ListAllCollaborators, teamsfx_api_1.returnUserError(error, constants_1.SolutionSource, constants_1.SolutionError.FailedToListCollaborator), telemetryReporter)),
|
|
91
|
-
};
|
|
92
|
-
}
|
|
93
|
-
}
|
|
94
|
-
return teamsfx_api_1.ok(collaboratorsResult);
|
|
95
|
-
}
|
|
96
|
-
async function listAllCollaborators(param) {
|
|
97
|
-
var _a, _b;
|
|
98
|
-
if (param.apiVersion === 1) {
|
|
99
|
-
const telemetryReporter = param.ctx.telemetryReporter;
|
|
100
|
-
const ui = param.ctx.ui;
|
|
101
|
-
const graphTokenProvider = param.ctx.graphTokenProvider;
|
|
102
|
-
const platform = (_a = param.ctx.answers) === null || _a === void 0 ? void 0 : _a.platform;
|
|
103
|
-
const projectPath = param.ctx.root;
|
|
104
|
-
if (!projectPath) {
|
|
105
|
-
return teamsfx_api_1.err(teamsfx_api_1.returnSystemError(new Error(`projectPath is undefined`), constants_1.PluginNames.SOLUTION, constants_1.SolutionError.InternelError));
|
|
106
|
-
}
|
|
107
|
-
return listAllCollaboratorsImpl(param, projectPath, param.ctx.cryptoProvider, telemetryReporter, ui, graphTokenProvider, platform);
|
|
108
|
-
}
|
|
109
|
-
else {
|
|
110
|
-
const telemetryReporter = param.ctx.telemetryReporter;
|
|
111
|
-
const ui = param.ctx.userInteraction;
|
|
112
|
-
const graphTokenProvider = param.tokenProvider.graphTokenProvider;
|
|
113
|
-
const platform = (_b = param.inputs) === null || _b === void 0 ? void 0 : _b.platform;
|
|
114
|
-
return listAllCollaboratorsImpl(param, param.inputs.projectPath, param.ctx.cryptoProvider, telemetryReporter, ui, graphTokenProvider, platform);
|
|
115
|
-
}
|
|
116
|
-
}
|
|
117
|
-
exports.listAllCollaborators = listAllCollaborators;
|
|
118
|
-
//# sourceMappingURL=listAllCollaborators.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"listAllCollaborators.js","sourceRoot":"","sources":["../../../../../src/plugins/solution/fx-solution/v2/listAllCollaborators.ts"],"names":[],"mappings":";;;AAAA,wDAYgC;AAChC,+CAO4B;AAE5B,4CAQsB;AACtB,wCAAkE;AAClE,2DAAwE;AACxE,mCAAiD;AACjD,yDAA0F;AAE1F,KAAK,UAAU,wBAAwB,CACrC,KAAqB,EACrB,WAAmB,EACnB,cAA8B,EAC9B,iBAAqC,EACrC,EAAoB,EACpB,kBAAuC,EACvC,QAAiB;;IAEjB,iBAAiB,aAA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