@microsoft/teamsfx-core 1.0.0 → 1.0.1-alpha.fa070464.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.
Files changed (135) hide show
  1. package/build/common/armInterface.d.ts +1 -0
  2. package/build/common/armInterface.d.ts.map +1 -1
  3. package/build/core/error.d.ts +1 -0
  4. package/build/core/error.d.ts.map +1 -1
  5. package/build/core/error.js +5 -1
  6. package/build/core/error.js.map +1 -1
  7. package/build/core/index.d.ts.map +1 -1
  8. package/build/core/index.js +41 -4
  9. package/build/core/index.js.map +1 -1
  10. package/build/core/middleware/envInfoWriter.d.ts.map +1 -1
  11. package/build/core/middleware/envInfoWriter.js +2 -0
  12. package/build/core/middleware/envInfoWriter.js.map +1 -1
  13. package/build/plugins/resource/aad/v2/index.d.ts +3 -0
  14. package/build/plugins/resource/aad/v2/index.d.ts.map +1 -1
  15. package/build/plugins/resource/aad/v2/index.js +9 -0
  16. package/build/plugins/resource/aad/v2/index.js.map +1 -1
  17. package/build/plugins/resource/appstudio/index.d.ts.map +1 -1
  18. package/build/plugins/resource/appstudio/index.js +15 -5
  19. package/build/plugins/resource/appstudio/index.js.map +1 -1
  20. package/build/plugins/resource/appstudio/interfaces/IAppDefinition.d.ts +6 -2
  21. package/build/plugins/resource/appstudio/interfaces/IAppDefinition.d.ts.map +1 -1
  22. package/build/plugins/resource/appstudio/plugin.d.ts +1 -1
  23. package/build/plugins/resource/appstudio/plugin.d.ts.map +1 -1
  24. package/build/plugins/resource/appstudio/plugin.js +123 -36
  25. package/build/plugins/resource/appstudio/plugin.js.map +1 -1
  26. package/build/plugins/resource/appstudio/utils/telemetry.d.ts +1 -0
  27. package/build/plugins/resource/appstudio/utils/telemetry.d.ts.map +1 -1
  28. package/build/plugins/resource/appstudio/utils/telemetry.js +1 -0
  29. package/build/plugins/resource/appstudio/utils/telemetry.js.map +1 -1
  30. package/build/plugins/resource/appstudio/v2/index.d.ts +3 -0
  31. package/build/plugins/resource/appstudio/v2/index.d.ts.map +1 -1
  32. package/build/plugins/resource/appstudio/v2/index.js +9 -0
  33. package/build/plugins/resource/appstudio/v2/index.js.map +1 -1
  34. package/build/plugins/resource/index.d.ts +1 -0
  35. package/build/plugins/resource/index.d.ts.map +1 -1
  36. package/build/plugins/resource/index.js +1 -0
  37. package/build/plugins/resource/index.js.map +1 -1
  38. package/build/plugins/resource/keyvault/constants.d.ts +35 -0
  39. package/build/plugins/resource/keyvault/constants.d.ts.map +1 -0
  40. package/build/plugins/resource/keyvault/constants.js +42 -0
  41. package/build/plugins/resource/keyvault/constants.js.map +1 -0
  42. package/build/plugins/resource/keyvault/index.d.ts +14 -0
  43. package/build/plugins/resource/keyvault/index.d.ts.map +1 -0
  44. package/build/plugins/resource/keyvault/index.js +60 -0
  45. package/build/plugins/resource/keyvault/index.js.map +1 -0
  46. package/build/plugins/resource/keyvault/plugin.d.ts +6 -0
  47. package/build/plugins/resource/keyvault/plugin.d.ts.map +1 -0
  48. package/build/plugins/resource/keyvault/plugin.js +31 -0
  49. package/build/plugins/resource/keyvault/plugin.js.map +1 -0
  50. package/build/plugins/resource/keyvault/result.d.ts +9 -0
  51. package/build/plugins/resource/keyvault/result.d.ts.map +1 -0
  52. package/build/plugins/resource/keyvault/result.js +21 -0
  53. package/build/plugins/resource/keyvault/result.js.map +1 -0
  54. package/build/plugins/resource/keyvault/utils/telemetry.d.ts +17 -0
  55. package/build/plugins/resource/keyvault/utils/telemetry.d.ts.map +1 -0
  56. package/build/plugins/resource/keyvault/utils/telemetry.js +45 -0
  57. package/build/plugins/resource/keyvault/utils/telemetry.js.map +1 -0
  58. package/build/plugins/resource/simpleauth/v2/index.d.ts +7 -6
  59. package/build/plugins/resource/simpleauth/v2/index.d.ts.map +1 -1
  60. package/build/plugins/resource/simpleauth/v2/index.js +12 -6
  61. package/build/plugins/resource/simpleauth/v2/index.js.map +1 -1
  62. package/build/plugins/resource/utils4v2.d.ts +2 -1
  63. package/build/plugins/resource/utils4v2.d.ts.map +1 -1
  64. package/build/plugins/resource/utils4v2.js +26 -1
  65. package/build/plugins/resource/utils4v2.js.map +1 -1
  66. package/build/plugins/solution/fx-solution/ResourcePluginContainer.d.ts +1 -0
  67. package/build/plugins/solution/fx-solution/ResourcePluginContainer.d.ts.map +1 -1
  68. package/build/plugins/solution/fx-solution/ResourcePluginContainer.js +1 -0
  69. package/build/plugins/solution/fx-solution/ResourcePluginContainer.js.map +1 -1
  70. package/build/plugins/solution/fx-solution/arm.d.ts.map +1 -1
  71. package/build/plugins/solution/fx-solution/arm.js +41 -22
  72. package/build/plugins/solution/fx-solution/arm.js.map +1 -1
  73. package/build/plugins/solution/fx-solution/commonQuestions.d.ts.map +1 -1
  74. package/build/plugins/solution/fx-solution/commonQuestions.js.map +1 -1
  75. package/build/plugins/solution/fx-solution/constants.d.ts +1 -1
  76. package/build/plugins/solution/fx-solution/constants.d.ts.map +1 -1
  77. package/build/plugins/solution/fx-solution/constants.js +2 -2
  78. package/build/plugins/solution/fx-solution/constants.js.map +1 -1
  79. package/build/plugins/solution/fx-solution/question.d.ts +2 -1
  80. package/build/plugins/solution/fx-solution/question.d.ts.map +1 -1
  81. package/build/plugins/solution/fx-solution/question.js +10 -3
  82. package/build/plugins/solution/fx-solution/question.js.map +1 -1
  83. package/build/plugins/solution/fx-solution/solution.d.ts +1 -3
  84. package/build/plugins/solution/fx-solution/solution.d.ts.map +1 -1
  85. package/build/plugins/solution/fx-solution/solution.js +33 -544
  86. package/build/plugins/solution/fx-solution/solution.js.map +1 -1
  87. package/build/plugins/solution/fx-solution/v2/adaptor.d.ts +3 -0
  88. package/build/plugins/solution/fx-solution/v2/adaptor.d.ts.map +1 -1
  89. package/build/plugins/solution/fx-solution/v2/adaptor.js +45 -7
  90. package/build/plugins/solution/fx-solution/v2/adaptor.js.map +1 -1
  91. package/build/plugins/solution/fx-solution/v2/checkPermission.d.ts +5 -0
  92. package/build/plugins/solution/fx-solution/v2/checkPermission.d.ts.map +1 -0
  93. package/build/plugins/solution/fx-solution/v2/checkPermission.js +185 -0
  94. package/build/plugins/solution/fx-solution/v2/checkPermission.js.map +1 -0
  95. package/build/plugins/solution/fx-solution/v2/collaborationUtil.d.ts +20 -0
  96. package/build/plugins/solution/fx-solution/v2/collaborationUtil.d.ts.map +1 -0
  97. package/build/plugins/solution/fx-solution/v2/collaborationUtil.js +83 -0
  98. package/build/plugins/solution/fx-solution/v2/collaborationUtil.js.map +1 -0
  99. package/build/plugins/solution/fx-solution/v2/executor.d.ts +1 -0
  100. package/build/plugins/solution/fx-solution/v2/executor.d.ts.map +1 -1
  101. package/build/plugins/solution/fx-solution/v2/executor.js +17 -1
  102. package/build/plugins/solution/fx-solution/v2/executor.js.map +1 -1
  103. package/build/plugins/solution/fx-solution/v2/getQuestions.d.ts.map +1 -1
  104. package/build/plugins/solution/fx-solution/v2/getQuestions.js +2 -1
  105. package/build/plugins/solution/fx-solution/v2/getQuestions.js.map +1 -1
  106. package/build/plugins/solution/fx-solution/v2/grantPermission.d.ts +5 -0
  107. package/build/plugins/solution/fx-solution/v2/grantPermission.d.ts.map +1 -0
  108. package/build/plugins/solution/fx-solution/v2/grantPermission.js +200 -0
  109. package/build/plugins/solution/fx-solution/v2/grantPermission.js.map +1 -0
  110. package/build/plugins/solution/fx-solution/v2/listAllCollaborators.d.ts +5 -0
  111. package/build/plugins/solution/fx-solution/v2/listAllCollaborators.d.ts.map +1 -0
  112. package/build/plugins/solution/fx-solution/v2/listAllCollaborators.js +118 -0
  113. package/build/plugins/solution/fx-solution/v2/listAllCollaborators.js.map +1 -0
  114. package/build/plugins/solution/fx-solution/v2/listCollaborator.d.ts +8 -0
  115. package/build/plugins/solution/fx-solution/v2/listCollaborator.d.ts.map +1 -0
  116. package/build/plugins/solution/fx-solution/v2/listCollaborator.js +195 -0
  117. package/build/plugins/solution/fx-solution/v2/listCollaborator.js.map +1 -0
  118. package/build/plugins/solution/fx-solution/v2/provision.d.ts.map +1 -1
  119. package/build/plugins/solution/fx-solution/v2/provision.js +23 -6
  120. package/build/plugins/solution/fx-solution/v2/provision.js.map +1 -1
  121. package/build/plugins/solution/fx-solution/v2/solution.d.ts +4 -0
  122. package/build/plugins/solution/fx-solution/v2/solution.d.ts.map +1 -1
  123. package/build/plugins/solution/fx-solution/v2/solution.js +8 -0
  124. package/build/plugins/solution/fx-solution/v2/solution.js.map +1 -1
  125. package/build/plugins/solution/fx-solution/v2/utils.d.ts +3 -1
  126. package/build/plugins/solution/fx-solution/v2/utils.d.ts.map +1 -1
  127. package/build/plugins/solution/fx-solution/v2/utils.js +6 -1
  128. package/build/plugins/solution/fx-solution/v2/utils.js.map +1 -1
  129. package/package.json +4 -3
  130. package/resource/strings.json +1 -0
  131. package/templates/plugins/resource/bot/bicep/botConfiguration.template.bicep +10 -0
  132. package/templates/plugins/resource/function/bicep/functionConfiguration.template.bicep +5 -0
  133. package/templates/plugins/resource/keyvault/bicep/keyVaultProvision.template.bicep +53 -0
  134. package/templates/plugins/resource/keyvault/bicep/provision.template.bicep +13 -0
  135. package/templates/plugins/resource/simpleauth/bicep/simpleAuthConfiguration.template.bicep +5 -0
@@ -0,0 +1,200 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.grantPermission = 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 executor_1 = require("../executor");
9
+ const ResourcePluginContainer_1 = require("../ResourcePluginContainer");
10
+ const utils4v2_1 = require("../../../resource/utils4v2");
11
+ const executor_2 = require("./executor");
12
+ const collaborationUtil_1 = require("./collaborationUtil");
13
+ const utils_1 = require("./utils");
14
+ const __1 = require("..");
15
+ async function grantPermissionImpl(param, envState, envName, telemetryReporter, ui, graphTokenProvider, logProvider, platform, email) {
16
+ var _a, _b;
17
+ telemetryReporter === null || telemetryReporter === void 0 ? void 0 : telemetryReporter.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.GrantPermissionStart, {
18
+ [constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
19
+ });
20
+ const progressBar = ui === null || ui === void 0 ? void 0 : ui.createProgressBar("Granting permission", 1);
21
+ try {
22
+ const result = await collaborationUtil_1.CollaborationUtil.getCurrentUserInfo(graphTokenProvider);
23
+ if (result.isErr()) {
24
+ return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.GrantPermission, result.error, telemetryReporter));
25
+ }
26
+ const stateResult = collaborationUtil_1.CollaborationUtil.getCurrentCollaborationState(envState, result.value);
27
+ if (stateResult.state != common_1.CollaborationState.OK) {
28
+ if (platform === teamsfx_api_1.Platform.CLI) {
29
+ ui === null || ui === void 0 ? void 0 : ui.showMessage("warn", stateResult.message, false);
30
+ }
31
+ else if (platform === teamsfx_api_1.Platform.VSCode) {
32
+ logProvider === null || logProvider === void 0 ? void 0 : logProvider.warning(stateResult.message);
33
+ }
34
+ return teamsfx_api_1.ok({
35
+ state: stateResult.state,
36
+ message: stateResult.message,
37
+ });
38
+ }
39
+ if (!email || email === result.value.userPrincipalName) {
40
+ return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.GrantPermission, teamsfx_api_1.returnUserError(new Error("Collaborator's email cannot be null or same as current user"), constants_1.SolutionSource, constants_1.SolutionError.EmailCannotBeEmptyOrSame), telemetryReporter));
41
+ }
42
+ const userInfo = await collaborationUtil_1.CollaborationUtil.getUserInfo(graphTokenProvider, email);
43
+ if (!userInfo) {
44
+ return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.GrantPermission, teamsfx_api_1.returnUserError(new Error("Cannot find user in current tenant, please check whether your email address is correct"), constants_1.SolutionSource, constants_1.SolutionError.CannotFindUserInCurrentTenant), telemetryReporter));
45
+ }
46
+ progressBar === null || progressBar === void 0 ? void 0 : progressBar.start();
47
+ progressBar === null || progressBar === void 0 ? void 0 : progressBar.next(`Grant permission for user ${email}`);
48
+ if (platform === teamsfx_api_1.Platform.CLI) {
49
+ const aadAppTenantId = (_a = envState.get(constants_1.PluginNames.SOLUTION)) === null || _a === void 0 ? void 0 : _a.get(__1.REMOTE_TEAMS_APP_TENANT_ID);
50
+ if (!envName) {
51
+ return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.GrantPermission, teamsfx_api_1.returnSystemError(new Error("Failed to get env name."), constants_1.SolutionSource, constants_1.SolutionError.FailedToGetEnvName), telemetryReporter));
52
+ }
53
+ const message = [
54
+ { content: `Account to grant permission: `, color: teamsfx_api_1.Colors.BRIGHT_WHITE },
55
+ { content: userInfo.userPrincipalName + "\n", color: teamsfx_api_1.Colors.BRIGHT_MAGENTA },
56
+ {
57
+ content: `Starting grant permission for environment: `,
58
+ color: teamsfx_api_1.Colors.BRIGHT_WHITE,
59
+ },
60
+ { content: `${envName}\n`, color: teamsfx_api_1.Colors.BRIGHT_MAGENTA },
61
+ { content: `Tenant ID: `, color: teamsfx_api_1.Colors.BRIGHT_WHITE },
62
+ { content: aadAppTenantId + "\n", color: teamsfx_api_1.Colors.BRIGHT_MAGENTA },
63
+ ];
64
+ ui === null || ui === void 0 ? void 0 : ui.showMessage("info", message, false);
65
+ }
66
+ const [permissions, errors] = param.apiVersion === 1
67
+ ? await executeGrantPermissionsV1(param.ctx, userInfo)
68
+ : await executeGrantPermissionsV2(param.ctx, param.inputs, param.envInfo, param.tokenProvider, userInfo);
69
+ let errorMsg = "";
70
+ if (errors.length > 0) {
71
+ errorMsg += `Failed to grant permission for the below resources to user: ${email}.\n Resource details: \n`;
72
+ for (const fxError of errors) {
73
+ errorMsg += fxError.error.message + "\n";
74
+ }
75
+ }
76
+ if (platform === teamsfx_api_1.Platform.CLI) {
77
+ for (const permission of permissions) {
78
+ const message = [
79
+ { content: `${(_b = permission.roles) === null || _b === void 0 ? void 0 : _b.join(",")} `, color: teamsfx_api_1.Colors.BRIGHT_MAGENTA },
80
+ { content: "permission has been granted to ", color: teamsfx_api_1.Colors.BRIGHT_WHITE },
81
+ { content: permission.name, color: teamsfx_api_1.Colors.BRIGHT_MAGENTA },
82
+ { content: ", Resource ID: ", color: teamsfx_api_1.Colors.BRIGHT_WHITE },
83
+ { content: `${permission.resourceId}`, color: teamsfx_api_1.Colors.BRIGHT_MAGENTA },
84
+ ];
85
+ ui === null || ui === void 0 ? void 0 : ui.showMessage("info", message, false);
86
+ }
87
+ ui === null || ui === void 0 ? void 0 : ui.showMessage("info", `\nSkip grant permission for Azure resources. You may want to handle that via Azure portal. `, false);
88
+ if (errorMsg) {
89
+ ui === null || ui === void 0 ? void 0 : ui.showMessage("error", errorMsg, false);
90
+ }
91
+ }
92
+ if (errorMsg) {
93
+ return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.GrantPermission, teamsfx_api_1.returnUserError(new Error(errorMsg), constants_1.SolutionSource, constants_1.SolutionError.FailedToGrantPermission), telemetryReporter));
94
+ }
95
+ telemetryReporter === null || telemetryReporter === void 0 ? void 0 : telemetryReporter.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.GrantPermission, {
96
+ [constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
97
+ [constants_1.SolutionTelemetryProperty.Success]: constants_1.SolutionTelemetrySuccess.Yes,
98
+ });
99
+ return teamsfx_api_1.ok({
100
+ state: common_1.CollaborationState.OK,
101
+ userInfo: userInfo,
102
+ permissions,
103
+ });
104
+ }
105
+ finally {
106
+ await (progressBar === null || progressBar === void 0 ? void 0 : progressBar.end(true));
107
+ }
108
+ }
109
+ async function grantPermission(param) {
110
+ var _a, _b, _c, _d;
111
+ if (param.apiVersion === 1) {
112
+ const envState = param.ctx.envInfo.state;
113
+ const envName = param.ctx.envInfo.envName;
114
+ const telemetryReporter = param.ctx.telemetryReporter;
115
+ const ui = param.ctx.ui;
116
+ const graphTokenProvider = param.ctx.graphTokenProvider;
117
+ const logProvider = param.ctx.logProvider;
118
+ const platform = (_a = param.ctx.answers) === null || _a === void 0 ? void 0 : _a.platform;
119
+ const email = (_b = param.ctx.answers) === null || _b === void 0 ? void 0 : _b.email;
120
+ return grantPermissionImpl(param, envState, envName, telemetryReporter, ui, graphTokenProvider, logProvider, platform, email);
121
+ }
122
+ else {
123
+ const configMap = teamsfx_api_1.ConfigMap.fromJSON(param.envInfo.state);
124
+ if (!configMap) {
125
+ return teamsfx_api_1.err(teamsfx_api_1.returnSystemError(new Error(`failed to convert profile ${JSON.stringify(param.envInfo.state)}`), constants_1.PluginNames.SOLUTION, constants_1.SolutionError.InternelError));
126
+ }
127
+ const envState = utils4v2_1.flattenConfigMap(configMap);
128
+ const envName = param.envInfo.envName;
129
+ const telemetryReporter = param.ctx.telemetryReporter;
130
+ const ui = param.ctx.userInteraction;
131
+ const graphTokenProvider = param.tokenProvider.graphTokenProvider;
132
+ const logProvider = param.ctx.logProvider;
133
+ const platform = (_c = param.inputs) === null || _c === void 0 ? void 0 : _c.platform;
134
+ const email = (_d = param.inputs) === null || _d === void 0 ? void 0 : _d.email;
135
+ return grantPermissionImpl(param, envState, envName, telemetryReporter, ui, graphTokenProvider, logProvider, platform, email);
136
+ }
137
+ }
138
+ exports.grantPermission = grantPermission;
139
+ // Execute plugins' grantPermission() using legacy API
140
+ async function executeGrantPermissionsV1(ctx, userInfo) {
141
+ var _a;
142
+ const plugins = ResourcePluginContainer_1.getActivatedResourcePlugins((_a = ctx.projectSettings) === null || _a === void 0 ? void 0 : _a.solutionSettings);
143
+ const pluginsWithCtx = utils_1.getPluginAndContextArray(ctx, plugins);
144
+ const grantPermissionWithCtx = pluginsWithCtx.map(([plugin, context]) => {
145
+ return [
146
+ (plugin === null || plugin === void 0 ? void 0 : plugin.grantPermission)
147
+ ? (ctx) => plugin.grantPermission.bind(plugin)(ctx, userInfo)
148
+ : undefined,
149
+ context,
150
+ plugin.name,
151
+ ];
152
+ });
153
+ const results = await executor_1.executeConcurrently("", grantPermissionWithCtx);
154
+ const permissions = [];
155
+ const errors = [];
156
+ for (const result of results) {
157
+ if (result.isErr()) {
158
+ errors.push(result);
159
+ continue;
160
+ }
161
+ if (result && result.value) {
162
+ for (const res of result.value) {
163
+ permissions.push(res);
164
+ }
165
+ }
166
+ }
167
+ return [permissions, errors];
168
+ }
169
+ // Execute plugins' grantPermission() using v2 API
170
+ async function executeGrantPermissionsV2(ctx, inputs, envInfo, tokenProvider, userInfo) {
171
+ var _a;
172
+ const plugins = ResourcePluginContainer_1.getActivatedV2ResourcePlugins((_a = ctx.projectSetting) === null || _a === void 0 ? void 0 : _a.solutionSettings);
173
+ const thunks = plugins
174
+ .filter((plugin) => !!plugin.grantPermission)
175
+ .map((plugin) => {
176
+ return {
177
+ pluginName: `${plugin.name}`,
178
+ taskName: "grantPermission",
179
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
180
+ thunk: () => plugin.grantPermission(ctx, inputs, envInfo, tokenProvider, userInfo),
181
+ };
182
+ });
183
+ const result = await executor_2.executeConcurrently(thunks, ctx.logProvider);
184
+ let permissions;
185
+ let errors;
186
+ if (result.kind === "success") {
187
+ permissions = result.output.map((entry) => entry.result);
188
+ errors = [];
189
+ }
190
+ else if (result.kind === "partialSuccess") {
191
+ permissions = result.output.map((entry) => entry.result);
192
+ errors = [teamsfx_api_1.err(result.error)];
193
+ }
194
+ else {
195
+ permissions = [];
196
+ errors = [teamsfx_api_1.err(result.error)];
197
+ }
198
+ return [permissions, errors];
199
+ }
200
+ //# sourceMappingURL=grantPermission.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"grantPermission.js","sourceRoot":"","sources":["../../../../../src/plugins/solution/fx-solution/v2/grantPermission.ts"],"names":[],"mappings":";;;AAAA,wDAqBgC;AAChC,+CAA+F;AAE/F,4CAQsB;AAEtB,wCAAkE;AAClE,0CAAyE;AACzE,wEAGoC;AACpC,yDAA8D;AAC9D,yCAA8F;AAC9F,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L,UAAU,EAAE,GAAG,MAAM,CAAC,IAAI,EAAE;YAC5B,QAAQ,EAAE,iBAAiB;YAC3B,oEAAoE;YACpE,KAAK,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,eAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC;SACpF,CAAC;IACJ,CAAC,CAAC,CAAC;IAEL,MAAM,MAAM,GAAG,MAAM,8BAA6B,CAAC,MAAM,EAAE,GAAG,CAAC,WAAW,CAAC,CAAC;IAE5E,IAAI,WAAiC,CAAC;IACtC,IAAI,MAA2B,CAAC;IAChC,IAAI,MAAM,CAAC,IAAI,KAAK,SAAS,EAAE;QAC7B,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAA4B,CAAC,CAAC;QAC/E,MAAM,GAAG,EAAE,CAAC;KACb;SAAM,IAAI,MAAM,CAAC,IAAI,KAAK,gBAAgB,EAAE;QAC3C,WAAW,GAAG,MAAM,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,CAAC,MAA4B,CAAC,CAAC;QAC/E,MAAM,GAAG,CAAC,iBAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;KAC9B;SAAM;QACL,WAAW,GAAG,EAAE,CAAC;QACjB,MAAM,GAAG,CAAC,iBAAG,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;KAC9B;IAED,OAAO,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;AAC/B,CAAC"}
@@ -0,0 +1,5 @@
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
@@ -0,0 +1 @@
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"}
@@ -0,0 +1,118 @@
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
@@ -0,0 +1 @@
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,aAAjB,iBAAiB,uBAAjB,iBAAiB,CAAE,kBAAkB,CAAC,kCAAsB,CAAC,yBAAyB,EAAE;QACtF,CAAC,qCAAyB,CAAC,SAAS,CAAC,EAAE,0CAA8B;K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AG,CAAC,cAAc,EACxB,iBAAiB,EACjB,EAAE,EACF,kBAAkB,EAClB,QAAQ,CACT,CAAC;KACH;SAAM;QACL,MAAM,iBAAiB,GAAG,KAAK,CAAC,GAAG,CAAC,iBAAiB,CAAC;QACtD,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC;QACrC,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC;QAClE,MAAM,QAAQ,GAAG,MAAA,KAAK,CAAC,MAAM,0CAAE,QAAQ,CAAC;QAExC,OAAO,wBAAwB,CAC7B,KAAK,EACL,KAAK,CAAC,MAAM,CAAC,WAAW,EACxB,KAAK,CAAC,GAAG,CAAC,cAAc,EACxB,iBAAiB,EACjB,EAAE,EACF,kBAAkB,EAClB,QAAQ,CACT,CAAC;KACH;AACH,CAAC;AA3CD,oDA2CC"}
@@ -0,0 +1,8 @@
1
+ import { FxError, Result, SolutionContext, v2, Err, TokenProvider } from "@microsoft/teamsfx-api";
2
+ import { ListCollaboratorResult } from "../../../../common";
3
+ import { IUserList } from "../../../resource/appstudio/interfaces/IAppDefinition";
4
+ import { CollabApiParam } from "./collaborationUtil";
5
+ export declare function executeListCollaboratorV2(ctx: v2.Context, inputs: v2.InputsWithProjectPath, envInfo: v2.DeepReadonly<v2.EnvInfoV2>, tokenProvider: TokenProvider, userInfo: IUserList): Promise<[Result<any, FxError>[], Err<any, FxError>[]]>;
6
+ export declare function executeListCollaboratorV1(ctx: SolutionContext, userInfo: IUserList): Promise<[Result<any, FxError>[], Err<any, FxError>[]]>;
7
+ export declare function listCollaborator(param: CollabApiParam): Promise<Result<ListCollaboratorResult, FxError>>;
8
+ //# sourceMappingURL=listCollaborator.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listCollaborator.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/solution/fx-solution/v2/listCollaborator.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,OAAO,EAKP,MAAM,EAGN,eAAe,EACf,EAAE,EAEF,GAAG,EACH,aAAa,EAOd,MAAM,wBAAwB,CAAC;AAChC,OAAO,EAKL,sBAAsB,EAEvB,MAAM,oBAAoB,CAAC;AAC5B,OAAO,EAAE,SAAS,EAAE,MAAM,uDAAuD,CAAC;AAelF,OAAO,EAAE,cAAc,EAAqB,MAAM,qBAAqB,CAAC;AAMxE,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,EAAE,CAAC,qBAAqB,EAChC,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,SAAS,CAAC,EACtC,aAAa,EAAE,aAAa,EAC5B,QAAQ,EAAE,SAAS,GAClB,OAAO,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CA0BxD;AAED,wBAAsB,yBAAyB,CAC7C,GAAG,EAAE,eAAe,EACpB,QAAQ,EAAE,SAAS,GAClB,OAAO,CAAC,CAAC,MAAM,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,EAAE,GAAG,CAAC,GAAG,EAAE,OAAO,CAAC,EAAE,CAAC,CAAC,CA4BxD;AA0KD,wBAAsB,gBAAgB,CACpC,KAAK,EAAE,cAAc,GACpB,OAAO,CAAC,MAAM,CAAC,sBAAsB,EAAE,OAAO,CAAC,CAAC,CAgDlD"}
@@ -0,0 +1,195 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.listCollaborator = exports.executeListCollaboratorV1 = exports.executeListCollaboratorV2 = 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 executor_1 = require("../executor");
9
+ const ResourcePluginContainer_1 = require("../ResourcePluginContainer");
10
+ const executor_2 = require("./executor");
11
+ const collaborationUtil_1 = require("./collaborationUtil");
12
+ const utils_1 = require("./utils");
13
+ const typedi_1 = require("typedi");
14
+ const utils4v2_1 = require("../../../resource/utils4v2");
15
+ const __1 = require("..");
16
+ async function executeListCollaboratorV2(ctx, inputs, envInfo, tokenProvider, userInfo) {
17
+ const plugins = [
18
+ typedi_1.Container.get(ResourcePluginContainer_1.ResourcePluginsV2.AppStudioPlugin),
19
+ typedi_1.Container.get(ResourcePluginContainer_1.ResourcePluginsV2.AadPlugin),
20
+ ];
21
+ const thunks = plugins
22
+ .filter((plugin) => !!plugin.listCollaborator)
23
+ .map((plugin) => {
24
+ return {
25
+ pluginName: `${plugin.name}`,
26
+ taskName: "listCollaborator",
27
+ thunk: () =>
28
+ // eslint-disable-next-line @typescript-eslint/no-non-null-assertion
29
+ plugin.listCollaborator(ctx, inputs, envInfo, tokenProvider, userInfo),
30
+ };
31
+ });
32
+ const results = await executor_2.executeThunks(thunks, ctx.logProvider);
33
+ const errors = [];
34
+ for (const r of results) {
35
+ if (r.isErr()) {
36
+ errors.push(r);
37
+ }
38
+ }
39
+ return [results, errors];
40
+ }
41
+ exports.executeListCollaboratorV2 = executeListCollaboratorV2;
42
+ async function executeListCollaboratorV1(ctx, userInfo) {
43
+ const pluginsWithCtx = utils_1.getPluginAndContextArray(ctx, [
44
+ typedi_1.Container.get(ResourcePluginContainer_1.ResourcePlugins.AppStudioPlugin),
45
+ typedi_1.Container.get(ResourcePluginContainer_1.ResourcePlugins.AadPlugin),
46
+ ]);
47
+ const listCollaboratorWithCtx = pluginsWithCtx.map(([plugin, context]) => {
48
+ return [
49
+ (plugin === null || plugin === void 0 ? void 0 : plugin.listCollaborator)
50
+ ? (ctx) => plugin.listCollaborator.bind(plugin)(ctx, userInfo)
51
+ : undefined,
52
+ context,
53
+ plugin.name,
54
+ ];
55
+ });
56
+ const results = await executor_1.executeConcurrently("", listCollaboratorWithCtx);
57
+ const errors = [];
58
+ for (const result of results) {
59
+ if (result.isErr()) {
60
+ errors.push(result);
61
+ }
62
+ }
63
+ return [results, errors];
64
+ }
65
+ exports.executeListCollaboratorV1 = executeListCollaboratorV1;
66
+ async function listCollaboratorImpl(param, envState, envName, telemetryReporter, ui, graphTokenProvider, logProvider, platform) {
67
+ var _a, _b, _c, _d, _e, _f, _g;
68
+ telemetryReporter === null || telemetryReporter === void 0 ? void 0 : telemetryReporter.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.ListCollaboratorStart, {
69
+ [constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
70
+ });
71
+ const result = await collaborationUtil_1.CollaborationUtil.getCurrentUserInfo(graphTokenProvider);
72
+ if (result.isErr()) {
73
+ return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ListCollaborator, result.error, telemetryReporter));
74
+ }
75
+ const stateResult = collaborationUtil_1.CollaborationUtil.getCurrentCollaborationState(envState, result.value);
76
+ if (stateResult.state != common_1.CollaborationState.OK) {
77
+ if (platform === teamsfx_api_1.Platform.CLI) {
78
+ ui === null || ui === void 0 ? void 0 : ui.showMessage("warn", stateResult.message, false);
79
+ }
80
+ else if (platform === teamsfx_api_1.Platform.VSCode) {
81
+ logProvider === null || logProvider === void 0 ? void 0 : logProvider.warning(stateResult.message);
82
+ }
83
+ return teamsfx_api_1.ok({
84
+ state: stateResult.state,
85
+ message: stateResult.message,
86
+ });
87
+ }
88
+ const userInfo = result.value;
89
+ if (!envName) {
90
+ return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ListCollaborator, teamsfx_api_1.returnSystemError(new Error("Failed to get env name."), constants_1.SolutionSource, constants_1.SolutionError.FailedToGetEnvName), telemetryReporter));
91
+ }
92
+ const [results, errors] = param.apiVersion === 1
93
+ ? await executeListCollaboratorV1(param.ctx, userInfo)
94
+ : await executeListCollaboratorV2(param.ctx, param.inputs, param.envInfo, param.tokenProvider, userInfo);
95
+ let errorMsg = "";
96
+ if (errors.length > 0) {
97
+ errorMsg += `Failed to list collaborator for the project.\n Error details: \n`;
98
+ for (const fxError of errors) {
99
+ errorMsg += fxError.error.message + "\n";
100
+ }
101
+ }
102
+ if (errorMsg) {
103
+ return teamsfx_api_1.err(util_1.sendErrorTelemetryThenReturnError(constants_1.SolutionTelemetryEvent.ListCollaborator, teamsfx_api_1.returnUserError(new Error(errorMsg), constants_1.SolutionSource, constants_1.SolutionError.FailedToListCollaborator), telemetryReporter));
104
+ }
105
+ const teamsAppOwners = results[0].isErr() ? [] : results[0].value;
106
+ const aadOwners = results[1].isErr() ? [] : results[1].value;
107
+ const collaborators = [];
108
+ const teamsAppId = (_b = (_a = teamsAppOwners[0]) === null || _a === void 0 ? void 0 : _a.resourceId) !== null && _b !== void 0 ? _b : "";
109
+ const aadAppId = (_d = (_c = aadOwners[0]) === null || _c === void 0 ? void 0 : _c.resourceId) !== null && _d !== void 0 ? _d : "";
110
+ const aadAppTenantId = (_e = envState.get(constants_1.PluginNames.SOLUTION)) === null || _e === void 0 ? void 0 : _e.get(__1.REMOTE_TEAMS_APP_TENANT_ID);
111
+ for (const teamsAppOwner of teamsAppOwners) {
112
+ const aadOwner = aadOwners.find((owner) => owner.userObjectId === teamsAppOwner.userObjectId);
113
+ collaborators.push({
114
+ // For guest account, aadOwner.userPrincipalName will be user's email, and is easy to read.
115
+ userPrincipalName: (_g = (_f = aadOwner === null || aadOwner === void 0 ? void 0 : aadOwner.userPrincipalName) !== null && _f !== void 0 ? _f : teamsAppOwner.userPrincipalName) !== null && _g !== void 0 ? _g : teamsAppOwner.userObjectId,
116
+ userObjectId: teamsAppOwner.userObjectId,
117
+ isAadOwner: aadOwner ? true : false,
118
+ aadResourceId: aadOwner ? aadOwner.resourceId : undefined,
119
+ teamsAppResourceId: teamsAppOwner.resourceId,
120
+ });
121
+ }
122
+ if (platform === teamsfx_api_1.Platform.CLI || platform === teamsfx_api_1.Platform.VSCode) {
123
+ const message = [
124
+ { content: `Listing M365 permissions\n`, color: teamsfx_api_1.Colors.BRIGHT_WHITE },
125
+ { content: `Account used to check: `, color: teamsfx_api_1.Colors.BRIGHT_WHITE },
126
+ { content: userInfo.userPrincipalName + "\n", color: teamsfx_api_1.Colors.BRIGHT_MAGENTA },
127
+ {
128
+ content: `Starting list all teams app owners for environment: `,
129
+ color: teamsfx_api_1.Colors.BRIGHT_WHITE,
130
+ },
131
+ { content: `${envName}\n`, color: teamsfx_api_1.Colors.BRIGHT_MAGENTA },
132
+ { content: `Tenant ID: `, color: teamsfx_api_1.Colors.BRIGHT_WHITE },
133
+ { content: aadAppTenantId + "\n", color: teamsfx_api_1.Colors.BRIGHT_MAGENTA },
134
+ { content: `M365 Teams App (ID: `, color: teamsfx_api_1.Colors.BRIGHT_WHITE },
135
+ { content: teamsAppId, color: teamsfx_api_1.Colors.BRIGHT_MAGENTA },
136
+ { content: `), SSO AAD App (ID: `, color: teamsfx_api_1.Colors.BRIGHT_WHITE },
137
+ { content: aadAppId, color: teamsfx_api_1.Colors.BRIGHT_MAGENTA },
138
+ { content: `)\n`, color: teamsfx_api_1.Colors.BRIGHT_WHITE },
139
+ ];
140
+ for (const collaborator of collaborators) {
141
+ message.push({ content: `Teams App Owner: `, color: teamsfx_api_1.Colors.BRIGHT_WHITE }, { content: collaborator.userPrincipalName, color: teamsfx_api_1.Colors.BRIGHT_MAGENTA }, { content: `. `, color: teamsfx_api_1.Colors.BRIGHT_WHITE });
142
+ if (!collaborator.isAadOwner) {
143
+ message.push({ content: `(Not owner of SSO AAD app)`, color: teamsfx_api_1.Colors.BRIGHT_YELLOW });
144
+ }
145
+ message.push({ content: "\n", color: teamsfx_api_1.Colors.BRIGHT_WHITE });
146
+ }
147
+ if (platform === teamsfx_api_1.Platform.CLI) {
148
+ ui === null || ui === void 0 ? void 0 : ui.showMessage("info", message, false);
149
+ }
150
+ else if (platform === teamsfx_api_1.Platform.VSCode) {
151
+ logProvider === null || logProvider === void 0 ? void 0 : logProvider.info(message);
152
+ }
153
+ }
154
+ const aadOwnerCount = collaborators.filter((collaborator) => collaborator.aadResourceId && collaborator.isAadOwner).length;
155
+ telemetryReporter === null || telemetryReporter === void 0 ? void 0 : telemetryReporter.sendTelemetryEvent(constants_1.SolutionTelemetryEvent.ListCollaborator, {
156
+ [constants_1.SolutionTelemetryProperty.Component]: constants_1.SolutionTelemetryComponentName,
157
+ [constants_1.SolutionTelemetryProperty.Success]: constants_1.SolutionTelemetrySuccess.Yes,
158
+ [constants_1.SolutionTelemetryProperty.CollaboratorCount]: collaborators.length.toString(),
159
+ [constants_1.SolutionTelemetryProperty.AadOwnerCount]: aadOwnerCount.toString(),
160
+ [constants_1.SolutionTelemetryProperty.Env]: common_1.getHashedEnv(envName),
161
+ });
162
+ return teamsfx_api_1.ok({
163
+ collaborators: collaborators,
164
+ state: common_1.CollaborationState.OK,
165
+ });
166
+ }
167
+ async function listCollaborator(param) {
168
+ var _a, _b;
169
+ if (param.apiVersion === 1) {
170
+ const envState = param.ctx.envInfo.state;
171
+ const envName = param.ctx.envInfo.envName;
172
+ const telemetryReporter = param.ctx.telemetryReporter;
173
+ const ui = param.ctx.ui;
174
+ const graphTokenProvider = param.ctx.graphTokenProvider;
175
+ const logProvider = param.ctx.logProvider;
176
+ const platform = (_a = param.ctx.answers) === null || _a === void 0 ? void 0 : _a.platform;
177
+ return listCollaboratorImpl(param, envState, envName, telemetryReporter, ui, graphTokenProvider, logProvider, platform);
178
+ }
179
+ else {
180
+ const configMap = teamsfx_api_1.ConfigMap.fromJSON(param.envInfo.state);
181
+ if (!configMap) {
182
+ return teamsfx_api_1.err(teamsfx_api_1.returnSystemError(new Error(`failed to convert profile ${JSON.stringify(param.envInfo.state)}`), constants_1.PluginNames.SOLUTION, constants_1.SolutionError.InternelError));
183
+ }
184
+ const envState = utils4v2_1.flattenConfigMap(configMap);
185
+ const envName = param.envInfo.envName;
186
+ const telemetryReporter = param.ctx.telemetryReporter;
187
+ const ui = param.ctx.userInteraction;
188
+ const graphTokenProvider = param.tokenProvider.graphTokenProvider;
189
+ const logProvider = param.ctx.logProvider;
190
+ const platform = (_b = param.inputs) === null || _b === void 0 ? void 0 : _b.platform;
191
+ return listCollaboratorImpl(param, envState, envName, telemetryReporter, ui, graphTokenProvider, logProvider, platform);
192
+ }
193
+ }
194
+ exports.listCollaborator = listCollaborator;
195
+ //# sourceMappingURL=listCollaborator.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"listCollaborator.js","sourceRoot":"","sources":["../../../../../src/plugins/solution/fx-solution/v2/listCollaborator.ts"],"names":[],"mappings":";;;AAAA,wDAqBgC;AAChC,+CAO4B;AAE5B,4CAQsB;AAEtB,wCAAkE;AAClE,0CAAyE;AACzE,wEAAgF;AAChF,yCAAuD;AACvD,2DAAwE;AACxE,mCAAmD;AACnD,mCAAmC;AACnC,yDAA8D;AAC9D,0BAAgD;AAEzC,KAAK,UAAU,yBAAyB,CAC7C,GAAe,EACf,MAAgC,EAChC,OAAsC,EACtC,aAA4B,EAC5B,QAAmB;IAEnB,MAAM,OAAO,GAAwB;QACnC,kBAAS,CAAC,GAAG,CAAoB,2CAAiB,CAAC,eAAe,CAAC;QACnE,kBAAS,CAAC,GAAG,CAAoB,2CAAiB,CAAC,SAAS,CAAC;KAC9D,CAAC;IAEF,MAAM,MAAM,GAAuB,OAAO;SACvC,MAAM,CAAC,CAAC,MAAM,EAAE,EAAE,CAAC,CAAC,CAAC,MAAM,CAAC,gBAAgB,CAAC;SAC7C,GAAG,CAAC,CAAC,MAAM,EAAE,EAAE;QACd,OAAO;YACL,UAAU,EAAE,GAAG,MAAM,CAAC,IAAI,EAAE;YAC5B,QAAQ,EAAE,kBAAkB;YAC5B,KAAK,EAAE,GAAG,EAAE;YACV,oEAAoE;YACpE,MAAM,CAAC,gBAAiB,CAAC,GAAG,EAAE,MAAM,EAAE,OAAO,EAAE,aAAa,EAAE,QAAQ,CAAC;SAC1E,CAAC;IACJ,CAAC,CAAC,CAAC;IAEL,MAAM,OAAO,GAAG,MAAM,wBAA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AC,iBAAiB,CAAC;QACtD,MAAM,EAAE,GAAG,KAAK,CAAC,GAAG,CAAC,eAAe,CAAC;QACrC,MAAM,kBAAkB,GAAG,KAAK,CAAC,aAAa,CAAC,kBAAkB,CAAC;QAClE,MAAM,WAAW,GAAG,KAAK,CAAC,GAAG,CAAC,WAAW,CAAC;QAC1C,MAAM,QAAQ,GAAG,MAAA,KAAK,CAAC,MAAM,0CAAE,QAAQ,CAAC;QACxC,OAAO,oBAAoB,CACzB,KAAK,EACL,QAAQ,EACR,OAAO,EACP,iBAAiB,EACjB,EAAE,EACF,kBAAkB,EAClB,WAAW,EACX,QAAQ,CACT,CAAC;KACH;AACH,CAAC;AAlDD,4CAkDC"}
@@ -1 +1 @@
1
- {"version":3,"file":"provision.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/solution/fx-solution/v2/provision.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EACF,MAAM,EACN,OAAO,EACP,MAAM,EAIN,aAAa,EACb,IAAI,EACJ,eAAe,EAEhB,MAAM,wBAAwB,CAAC;AAmChC,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,SAAS,CAAC,EACtC,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC,CAkM3D;AAED,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CA8CjG"}
1
+ {"version":3,"file":"provision.d.ts","sourceRoot":"","sources":["../../../../../src/plugins/solution/fx-solution/v2/provision.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,EAAE,EACF,MAAM,EACN,OAAO,EACP,MAAM,EAIN,aAAa,EACb,IAAI,EACJ,eAAe,EAEhB,MAAM,wBAAwB,CAAC;AAmChC,wBAAsB,iBAAiB,CACrC,GAAG,EAAE,EAAE,CAAC,OAAO,EACf,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,EAAE,CAAC,YAAY,CAAC,EAAE,CAAC,SAAS,CAAC,EACtC,aAAa,EAAE,aAAa,GAC3B,OAAO,CAAC,EAAE,CAAC,QAAQ,CAAC,EAAE,CAAC,uBAAuB,EAAE,OAAO,CAAC,CAAC,CA+M3D;AAED,wBAAsB,sBAAsB,CAAC,GAAG,EAAE,eAAe,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC,CA8CjG"}