@pnp/cli-microsoft365 5.0.0-beta.460e9b7 → 5.0.0-beta.4aa3f65

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/dist/api.d.ts ADDED
@@ -0,0 +1,11 @@
1
+ export interface CommandOutput {
2
+ error?: {
3
+ message: string;
4
+ code?: number;
5
+ }
6
+ stdout: string;
7
+ stderr: string;
8
+ }
9
+
10
+ export declare function executeCommand(commandName: string, options: any): Promise<CommandOutput>;
11
+ export declare function on(eventName: string, listener: (...args: any[]) => void): void;
package/dist/api.js ADDED
@@ -0,0 +1,17 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.executeCommand = void 0;
4
+ const cli_1 = require("./cli");
5
+ const path = require("path");
6
+ function executeCommand(commandName, options, listener) {
7
+ const cli = cli_1.Cli.getInstance();
8
+ cli.commandsFolder = path.join(__dirname, 'm365');
9
+ cli.commands = [];
10
+ cli.loadCommandFromArgs(commandName.split(' '));
11
+ if (cli.commands.length !== 1) {
12
+ return Promise.reject(`Command not found: ${commandName}`);
13
+ }
14
+ return cli_1.Cli.executeCommandWithOutput(cli.commands[0].command, { options: options !== null && options !== void 0 ? options : {} }, listener);
15
+ }
16
+ exports.executeCommand = executeCommand;
17
+ //# sourceMappingURL=api.js.map
package/dist/cli/Cli.js CHANGED
@@ -189,23 +189,38 @@ class Cli {
189
189
  });
190
190
  });
191
191
  }
192
- static executeCommandWithOutput(command, args) {
192
+ static executeCommandWithOutput(command, args, listener) {
193
193
  return new Promise((resolve, reject) => {
194
194
  const log = [];
195
195
  const logErr = [];
196
196
  const logger = {
197
197
  log: (message) => {
198
- log.push(Cli.formatOutput(message, args.options));
198
+ const formattedMessage = Cli.formatOutput(message, args.options);
199
+ if (listener && listener.stdout) {
200
+ listener.stdout(formattedMessage);
201
+ }
202
+ log.push(formattedMessage);
199
203
  },
200
204
  logRaw: (message) => {
201
- log.push(Cli.formatOutput(message, args.options));
205
+ const formattedMessage = Cli.formatOutput(message, args.options);
206
+ if (listener && listener.stdout) {
207
+ listener.stdout(formattedMessage);
208
+ }
209
+ log.push(formattedMessage);
202
210
  },
203
211
  logToStderr: (message) => {
212
+ if (listener && listener.stderr) {
213
+ listener.stderr(message);
214
+ }
204
215
  logErr.push(message);
205
216
  }
206
217
  };
207
218
  if (args.options.debug) {
208
- logErr.push(`Executing command ${command.name} with options ${JSON.stringify(args)}`);
219
+ const message = `Executing command ${command.name} with options ${JSON.stringify(args)}`;
220
+ if (listener && listener.stderr) {
221
+ listener.stderr(message);
222
+ }
223
+ logErr.push(message);
209
224
  }
210
225
  // store the current command name, if any and set the name to the name of
211
226
  // the command to execute
@@ -105,21 +105,49 @@ class AadAppAddCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
105
105
  if (!args.options.manifest) {
106
106
  return Promise.resolve(appInfo);
107
107
  }
108
- const manifest = JSON.parse(args.options.manifest);
108
+ const v2Manifest = JSON.parse(args.options.manifest);
109
109
  // remove properties that might be coming from the original app that was
110
110
  // used to create the manifest and which can't be updated
111
- delete manifest.id;
112
- delete manifest.appId;
113
- delete manifest.publisherDomain;
111
+ delete v2Manifest.id;
112
+ delete v2Manifest.appId;
113
+ delete v2Manifest.publisherDomain;
114
114
  // Azure Portal returns v2 manifest whereas the Graph API expects a v1.6
115
- const transformedManifest = this.transformManifest(manifest);
115
+ const graphManifest = this.transformManifest(v2Manifest);
116
116
  const updateAppRequestOptions = {
117
117
  url: `${this.resource}/v1.0/myorganization/applications/${appInfo.id}`,
118
118
  headers: {
119
119
  'content-type': 'application/json'
120
120
  },
121
121
  responseType: 'json',
122
- data: transformedManifest
122
+ data: graphManifest
123
+ };
124
+ return request_1.default
125
+ .patch(updateAppRequestOptions)
126
+ .then(_ => this.updatePreAuthorizedAppsFromManifest(v2Manifest, appInfo))
127
+ .then(_ => Promise.resolve(appInfo));
128
+ }
129
+ updatePreAuthorizedAppsFromManifest(manifest, appInfo) {
130
+ if (!manifest ||
131
+ !manifest.preAuthorizedApplications ||
132
+ manifest.preAuthorizedApplications.length === 0) {
133
+ return Promise.resolve(appInfo);
134
+ }
135
+ const graphManifest = {
136
+ api: {
137
+ preAuthorizedApplications: manifest.preAuthorizedApplications
138
+ }
139
+ };
140
+ graphManifest.api.preAuthorizedApplications.forEach((p) => {
141
+ p.delegatedPermissionIds = p.permissionIds;
142
+ delete p.permissionIds;
143
+ });
144
+ const updateAppRequestOptions = {
145
+ url: `${this.resource}/v1.0/myorganization/applications/${appInfo.id}`,
146
+ headers: {
147
+ 'content-type': 'application/json'
148
+ },
149
+ responseType: 'json',
150
+ data: graphManifest
123
151
  };
124
152
  return request_1.default
125
153
  .patch(updateAppRequestOptions)
@@ -180,8 +208,16 @@ class AadAppAddCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
180
208
  delete graphManifest.oauth2AllowIdTokenImplicitFlow;
181
209
  graphManifest.api.oauth2PermissionScopes = v2Manifest.oauth2Permissions;
182
210
  delete graphManifest.oauth2Permissions;
211
+ if (graphManifest.api.oauth2PermissionScopes) {
212
+ graphManifest.api.oauth2PermissionScopes.forEach((scope) => {
213
+ delete scope.lang;
214
+ delete scope.origin;
215
+ });
216
+ }
183
217
  delete graphManifest.oauth2RequiredPostResponse;
184
- graphManifest.api.preAuthorizedApplications = v2Manifest.preAuthorizedApplications;
218
+ // MS Graph doesn't support creating OAuth2 permissions and pre-authorized
219
+ // apps in one request. This is why we need to remove it here and do it in
220
+ // the next request
185
221
  delete graphManifest.preAuthorizedApplications;
186
222
  if (v2Manifest.replyUrlsWithType) {
187
223
  v2Manifest.replyUrlsWithType.forEach((urlWithType) => {
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const request_1 = require("../../../../request");
4
+ const GraphItemsListCommand_1 = require("../../../base/GraphItemsListCommand");
5
+ const commands_1 = require("../../commands");
6
+ class PlannerTaskDetailsGetCommand extends GraphItemsListCommand_1.GraphItemsListCommand {
7
+ get name() {
8
+ return commands_1.default.TASK_DETAILS_GET;
9
+ }
10
+ get description() {
11
+ return 'Retrieve the details of the specified planner task';
12
+ }
13
+ commandAction(logger, args, cb) {
14
+ const requestOptions = {
15
+ url: `${this.resource}/v1.0/planner/tasks/${encodeURIComponent(args.options.taskId)}/details`,
16
+ headers: {
17
+ accept: 'application/json;odata.metadata=none'
18
+ },
19
+ responseType: 'json'
20
+ };
21
+ request_1.default
22
+ .get(requestOptions)
23
+ .then((res) => {
24
+ logger.log(res);
25
+ cb();
26
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
27
+ }
28
+ options() {
29
+ const options = [
30
+ {
31
+ option: '-i, --taskId <taskId>'
32
+ }
33
+ ];
34
+ const parentOptions = super.options();
35
+ return options.concat(parentOptions);
36
+ }
37
+ }
38
+ module.exports = new PlannerTaskDetailsGetCommand();
39
+ //# sourceMappingURL=task-details-get.js.map
@@ -0,0 +1,37 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const request_1 = require("../../../../request");
4
+ const GraphCommand_1 = require("../../../base/GraphCommand");
5
+ const commands_1 = require("../../commands");
6
+ class PlannerTaskGetCommand extends GraphCommand_1.default {
7
+ get name() {
8
+ return commands_1.default.TASK_GET;
9
+ }
10
+ get description() {
11
+ return 'Retrieve the the specified planner task';
12
+ }
13
+ commandAction(logger, args, cb) {
14
+ const requestOptions = {
15
+ url: `${this.resource}/v1.0/planner/tasks/${encodeURIComponent(args.options.id)}`,
16
+ headers: {
17
+ accept: 'application/json;odata.metadata=none'
18
+ },
19
+ responseType: 'json'
20
+ };
21
+ request_1.default
22
+ .get(requestOptions)
23
+ .then((res) => {
24
+ logger.log(res);
25
+ cb();
26
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
27
+ }
28
+ options() {
29
+ const options = [
30
+ { option: '-i, --id <id>' }
31
+ ];
32
+ const parentOptions = super.options();
33
+ return options.concat(parentOptions);
34
+ }
35
+ }
36
+ module.exports = new PlannerTaskGetCommand();
37
+ //# sourceMappingURL=task-get.js.map
@@ -25,25 +25,40 @@ class PlannerTaskListCommand extends GraphItemsListCommand_1.GraphItemsListComma
25
25
  return ['id', 'title', 'startDateTime', 'dueDateTime', 'completedDateTime'];
26
26
  }
27
27
  commandAction(logger, args, cb) {
28
- const bucketId = args.options.bucketId;
29
28
  const bucketName = args.options.bucketName;
30
- const planId = args.options.planId;
29
+ let bucketId = args.options.bucketId;
31
30
  const planName = args.options.planName;
31
+ let planId = args.options.planId;
32
+ let taskItems = [];
32
33
  if (bucketId || bucketName) {
33
34
  this
34
35
  .getBucketId(args)
35
- .then((bucketId) => this.getAllItems(`${this.resource}/v1.0/planner/buckets/${bucketId}/tasks`, logger, true))
36
+ .then((retrievedBucketId) => {
37
+ bucketId = retrievedBucketId;
38
+ return this.getAllItems(`${this.resource}/v1.0/planner/buckets/${bucketId}/tasks`, logger, true);
39
+ })
36
40
  .then(() => {
37
- logger.log(this.items);
41
+ taskItems = this.items;
42
+ return this.getAllItems(`${this.resource}/beta/planner/buckets/${bucketId}/tasks`, logger, true);
43
+ })
44
+ .then(() => {
45
+ logger.log(this.mergeTaskPriority(taskItems, this.items));
38
46
  cb();
39
47
  }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
40
48
  }
41
49
  else if (planId || planName) {
42
50
  this
43
51
  .getPlanId(args)
44
- .then((planId) => this.getAllItems(`${this.resource}/v1.0/planner/plans/${planId}/tasks`, logger, true))
52
+ .then((retrievedPlanId) => {
53
+ planId = retrievedPlanId;
54
+ return this.getAllItems(`${this.resource}/v1.0/planner/plans/${planId}/tasks`, logger, true);
55
+ })
56
+ .then(() => {
57
+ taskItems = this.items;
58
+ return this.getAllItems(`${this.resource}/beta/planner/plans/${planId}/tasks`, logger, true);
59
+ })
45
60
  .then(() => {
46
- logger.log(this.items);
61
+ logger.log(this.mergeTaskPriority(taskItems, this.items));
47
62
  cb();
48
63
  }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
49
64
  }
@@ -51,7 +66,11 @@ class PlannerTaskListCommand extends GraphItemsListCommand_1.GraphItemsListComma
51
66
  this
52
67
  .getAllItems(`${this.resource}/v1.0/me/planner/tasks`, logger, true)
53
68
  .then(() => {
54
- logger.log(this.items);
69
+ taskItems = this.items;
70
+ return this.getAllItems(`${this.resource}/beta/me/planner/tasks`, logger, true);
71
+ })
72
+ .then(() => {
73
+ logger.log(this.mergeTaskPriority(taskItems, this.items));
55
74
  cb();
56
75
  }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
57
76
  }
@@ -125,6 +144,17 @@ class PlannerTaskListCommand extends GraphItemsListCommand_1.GraphItemsListComma
125
144
  return Promise.resolve(group.id);
126
145
  });
127
146
  }
147
+ mergeTaskPriority(taskItems, betaTaskItems) {
148
+ const findBetaTask = (id) => betaTaskItems.find(task => task.id === id);
149
+ taskItems.forEach(task => {
150
+ const betaTaskItem = findBetaTask(task.id);
151
+ if (betaTaskItem) {
152
+ const { priority } = betaTaskItem;
153
+ Object.assign(task, { priority });
154
+ }
155
+ });
156
+ return taskItems;
157
+ }
128
158
  options() {
129
159
  const options = [
130
160
  {
@@ -8,6 +8,8 @@ exports.default = {
8
8
  PLAN_GET: `${prefix} plan get`,
9
9
  PLAN_LIST: `${prefix} plan list`,
10
10
  TASK_ADD: `${prefix} task add`,
11
+ TASK_DETAILS_GET: `${prefix} task details get`,
12
+ TASK_GET: `${prefix} task get`,
11
13
  TASK_LIST: `${prefix} task list`,
12
14
  TASK_SET: `${prefix} task set`
13
15
  };
@@ -28,32 +28,32 @@ const FN006006_CFG_PS_features_1 = require("./rules/FN006006_CFG_PS_features");
28
28
  const FN010001_YORC_version_1 = require("./rules/FN010001_YORC_version");
29
29
  const FN014008_CODE_launch_hostedWorkbench_type_1 = require("./rules/FN014008_CODE_launch_hostedWorkbench_type");
30
30
  module.exports = [
31
- new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.14.0-beta.5'),
32
- new FN001002_DEP_microsoft_sp_lodash_subset_1.FN001002_DEP_microsoft_sp_lodash_subset('1.14.0-beta.5'),
33
- new FN001003_DEP_microsoft_sp_office_ui_fabric_core_1.FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.14.0-beta.5'),
34
- new FN001004_DEP_microsoft_sp_webpart_base_1.FN001004_DEP_microsoft_sp_webpart_base('1.14.0-beta.5'),
35
- new FN001011_DEP_microsoft_sp_dialog_1.FN001011_DEP_microsoft_sp_dialog('1.14.0-beta.5'),
36
- new FN001012_DEP_microsoft_sp_application_base_1.FN001012_DEP_microsoft_sp_application_base('1.14.0-beta.5'),
37
- new FN001013_DEP_microsoft_decorators_1.FN001013_DEP_microsoft_decorators('1.14.0-beta.5'),
38
- new FN001014_DEP_microsoft_sp_listview_extensibility_1.FN001014_DEP_microsoft_sp_listview_extensibility('1.14.0-beta.5'),
39
- new FN001021_DEP_microsoft_sp_property_pane_1.FN001021_DEP_microsoft_sp_property_pane('1.14.0-beta.5'),
40
- new FN001023_DEP_microsoft_sp_component_base_1.FN001023_DEP_microsoft_sp_component_base('1.14.0-beta.5'),
41
- new FN001024_DEP_microsoft_sp_diagnostics_1.FN001024_DEP_microsoft_sp_diagnostics('1.14.0-beta.5'),
42
- new FN001025_DEP_microsoft_sp_dynamic_data_1.FN001025_DEP_microsoft_sp_dynamic_data('1.14.0-beta.5'),
43
- new FN001026_DEP_microsoft_sp_extension_base_1.FN001026_DEP_microsoft_sp_extension_base('1.14.0-beta.5'),
44
- new FN001027_DEP_microsoft_sp_http_1.FN001027_DEP_microsoft_sp_http('1.14.0-beta.5'),
45
- new FN001028_DEP_microsoft_sp_list_subscription_1.FN001028_DEP_microsoft_sp_list_subscription('1.14.0-beta.5'),
46
- new FN001029_DEP_microsoft_sp_loader_1.FN001029_DEP_microsoft_sp_loader('1.14.0-beta.5'),
47
- new FN001030_DEP_microsoft_sp_module_interfaces_1.FN001030_DEP_microsoft_sp_module_interfaces('1.14.0-beta.5'),
48
- new FN001031_DEP_microsoft_sp_odata_types_1.FN001031_DEP_microsoft_sp_odata_types('1.14.0-beta.5'),
49
- new FN001032_DEP_microsoft_sp_page_context_1.FN001032_DEP_microsoft_sp_page_context('1.14.0-beta.5'),
50
- new FN002001_DEVDEP_microsoft_sp_build_web_1.FN002001_DEVDEP_microsoft_sp_build_web('1.14.0-beta.5'),
51
- new FN002002_DEVDEP_microsoft_sp_module_interfaces_1.FN002002_DEVDEP_microsoft_sp_module_interfaces('1.14.0-beta.5'),
52
- new FN002009_DEVDEP_microsoft_sp_tslint_rules_1.FN002009_DEVDEP_microsoft_sp_tslint_rules('1.14.0-beta.5'),
53
- new FN006004_CFG_PS_developer_1.FN006004_CFG_PS_developer('1.14.0-beta.5'),
31
+ new FN001001_DEP_microsoft_sp_core_library_1.FN001001_DEP_microsoft_sp_core_library('1.14.0-rc.2'),
32
+ new FN001002_DEP_microsoft_sp_lodash_subset_1.FN001002_DEP_microsoft_sp_lodash_subset('1.14.0-rc.2'),
33
+ new FN001003_DEP_microsoft_sp_office_ui_fabric_core_1.FN001003_DEP_microsoft_sp_office_ui_fabric_core('1.14.0-rc.2'),
34
+ new FN001004_DEP_microsoft_sp_webpart_base_1.FN001004_DEP_microsoft_sp_webpart_base('1.14.0-rc.2'),
35
+ new FN001011_DEP_microsoft_sp_dialog_1.FN001011_DEP_microsoft_sp_dialog('1.14.0-rc.2'),
36
+ new FN001012_DEP_microsoft_sp_application_base_1.FN001012_DEP_microsoft_sp_application_base('1.14.0-rc.2'),
37
+ new FN001013_DEP_microsoft_decorators_1.FN001013_DEP_microsoft_decorators('1.14.0-rc.2'),
38
+ new FN001014_DEP_microsoft_sp_listview_extensibility_1.FN001014_DEP_microsoft_sp_listview_extensibility('1.14.0-rc.2'),
39
+ new FN001021_DEP_microsoft_sp_property_pane_1.FN001021_DEP_microsoft_sp_property_pane('1.14.0-rc.2'),
40
+ new FN001023_DEP_microsoft_sp_component_base_1.FN001023_DEP_microsoft_sp_component_base('1.14.0-rc.2'),
41
+ new FN001024_DEP_microsoft_sp_diagnostics_1.FN001024_DEP_microsoft_sp_diagnostics('1.14.0-rc.2'),
42
+ new FN001025_DEP_microsoft_sp_dynamic_data_1.FN001025_DEP_microsoft_sp_dynamic_data('1.14.0-rc.2'),
43
+ new FN001026_DEP_microsoft_sp_extension_base_1.FN001026_DEP_microsoft_sp_extension_base('1.14.0-rc.2'),
44
+ new FN001027_DEP_microsoft_sp_http_1.FN001027_DEP_microsoft_sp_http('1.14.0-rc.2'),
45
+ new FN001028_DEP_microsoft_sp_list_subscription_1.FN001028_DEP_microsoft_sp_list_subscription('1.14.0-rc.2'),
46
+ new FN001029_DEP_microsoft_sp_loader_1.FN001029_DEP_microsoft_sp_loader('1.14.0-rc.2'),
47
+ new FN001030_DEP_microsoft_sp_module_interfaces_1.FN001030_DEP_microsoft_sp_module_interfaces('1.14.0-rc.2'),
48
+ new FN001031_DEP_microsoft_sp_odata_types_1.FN001031_DEP_microsoft_sp_odata_types('1.14.0-rc.2'),
49
+ new FN001032_DEP_microsoft_sp_page_context_1.FN001032_DEP_microsoft_sp_page_context('1.14.0-rc.2'),
50
+ new FN002001_DEVDEP_microsoft_sp_build_web_1.FN002001_DEVDEP_microsoft_sp_build_web('1.14.0-rc.2'),
51
+ new FN002002_DEVDEP_microsoft_sp_module_interfaces_1.FN002002_DEVDEP_microsoft_sp_module_interfaces('1.14.0-rc.2'),
52
+ new FN002009_DEVDEP_microsoft_sp_tslint_rules_1.FN002009_DEVDEP_microsoft_sp_tslint_rules('1.14.0-rc.2'),
53
+ new FN006004_CFG_PS_developer_1.FN006004_CFG_PS_developer('1.14.0-rc.2'),
54
54
  new FN006005_CFG_PS_metadata_1.FN006005_CFG_PS_metadata(),
55
55
  new FN006006_CFG_PS_features_1.FN006006_CFG_PS_features(),
56
- new FN010001_YORC_version_1.FN010001_YORC_version('1.14.0-beta.5'),
56
+ new FN010001_YORC_version_1.FN010001_YORC_version('1.14.0-rc.2'),
57
57
  new FN014008_CODE_launch_hostedWorkbench_type_1.FN014008_CODE_launch_hostedWorkbench_type('pwa-chrome')
58
58
  ];
59
- //# sourceMappingURL=upgrade-1.14.0-beta.5.js.map
59
+ //# sourceMappingURL=upgrade-1.14.0-rc.2.js.map
@@ -45,7 +45,7 @@ class SpfxProjectUpgradeCommand extends base_project_command_1.BaseProjectComman
45
45
  '1.12.1',
46
46
  '1.13.0',
47
47
  '1.13.1',
48
- '1.14.0-beta.5'
48
+ '1.14.0-rc.2'
49
49
  ];
50
50
  }
51
51
  get name() {
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ const cli_1 = require("../../../../cli");
4
+ const request_1 = require("../../../../request");
5
+ const SpoCommand_1 = require("../../../base/SpoCommand");
6
+ const commands_1 = require("../../commands");
7
+ class SpoGroupUserRemoveCommand extends SpoCommand_1.default {
8
+ get name() {
9
+ return commands_1.default.GROUP_USER_REMOVE;
10
+ }
11
+ get description() {
12
+ return 'Removes the specified user from a SharePoint group';
13
+ }
14
+ getTelemetryProperties(args) {
15
+ const telemetryProps = super.getTelemetryProperties(args);
16
+ telemetryProps.groupId = (!(!args.options.groupId)).toString();
17
+ telemetryProps.groupName = (!(!args.options.groupName)).toString();
18
+ telemetryProps.confirm = (!(!args.options.confirm)).toString();
19
+ return telemetryProps;
20
+ }
21
+ commandAction(logger, args, cb) {
22
+ const removeUserfromSPGroup = () => {
23
+ if (this.verbose) {
24
+ logger.logToStderr(`Removing User with Username ${args.options.userName} from Group: ${args.options.groupId ? args.options.groupId : args.options.groupName}`);
25
+ }
26
+ const loginName = `i:0#.f|membership|${args.options.userName}`;
27
+ const requestUrl = `${args.options.webUrl}/_api/web/sitegroups/${args.options.groupId
28
+ ? `GetById('${encodeURIComponent(args.options.groupId)}')`
29
+ : `GetByName('${encodeURIComponent(args.options.groupName)}')`}/users/removeByLoginName(@LoginName)?@LoginName='${encodeURIComponent(loginName)}'`;
30
+ const requestOptions = {
31
+ url: requestUrl,
32
+ headers: {
33
+ 'accept': 'application/json;odata=nometadata'
34
+ },
35
+ responseType: 'json'
36
+ };
37
+ request_1.default
38
+ .post(requestOptions)
39
+ .then(() => {
40
+ cb();
41
+ }, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
42
+ };
43
+ if (args.options.confirm) {
44
+ if (this.debug) {
45
+ logger.logToStderr('Confirmation bypassed by entering confirm option. Removing the user from SharePoint Group...');
46
+ }
47
+ removeUserfromSPGroup();
48
+ }
49
+ else {
50
+ cli_1.Cli.prompt({
51
+ type: 'confirm',
52
+ name: 'continue',
53
+ default: false,
54
+ message: `Are you sure you want to remove user User ${args.options.userName} from SharePoint group?`
55
+ }, (result) => {
56
+ if (!result.continue) {
57
+ cb();
58
+ }
59
+ else {
60
+ removeUserfromSPGroup();
61
+ }
62
+ });
63
+ }
64
+ }
65
+ options() {
66
+ const options = [
67
+ {
68
+ option: '-u, --webUrl <webUrl>'
69
+ },
70
+ {
71
+ option: '--groupId [groupId]'
72
+ },
73
+ {
74
+ option: '--groupName [groupName]'
75
+ },
76
+ {
77
+ option: '--userName <userName>'
78
+ },
79
+ {
80
+ option: '--confirm'
81
+ }
82
+ ];
83
+ const parentOptions = super.options();
84
+ return options.concat(parentOptions);
85
+ }
86
+ validate(args) {
87
+ if (args.options.groupId && args.options.groupName) {
88
+ return 'Use either "groupName" or "groupId", but not both';
89
+ }
90
+ if (!args.options.groupId && !args.options.groupName) {
91
+ return 'Either "groupName" or "groupId" is required';
92
+ }
93
+ if (args.options.groupId && isNaN(args.options.groupId)) {
94
+ return `Specified "groupId" ${args.options.groupId} is not valid`;
95
+ }
96
+ return SpoCommand_1.default.isValidSharePointUrl(args.options.webUrl);
97
+ }
98
+ }
99
+ module.exports = new SpoGroupUserRemoveCommand();
100
+ //# sourceMappingURL=group-user-remove.js.map
@@ -64,6 +64,7 @@ exports.default = {
64
64
  GROUP_REMOVE: `${prefix} group remove`,
65
65
  GROUP_USER_ADD: `${prefix} group user add`,
66
66
  GROUP_USER_LIST: `${prefix} group user list`,
67
+ GROUP_USER_REMOVE: `${prefix} group user remove`,
67
68
  HIDEDEFAULTTHEMES_GET: `${prefix} hidedefaultthemes get`,
68
69
  HIDEDEFAULTTHEMES_SET: `${prefix} hidedefaultthemes set`,
69
70
  HOMESITE_GET: `${prefix} homesite get`,
@@ -0,0 +1,24 @@
1
+ # planner task details get
2
+
3
+ Retrieve the details of the specified planner task
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 planner task details get [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-i, --taskId <taskId>`
14
+ : ID of the task to retrieve details from
15
+
16
+ --8<-- "docs/cmd/_global.md"
17
+
18
+ ## Examples
19
+
20
+ Retrieve the details of the specified planner task
21
+
22
+ ```sh
23
+ m365 planner task details get --taskId 'vzCcZoOv-U27PwydxHB8opcADJo-'
24
+ ```
@@ -0,0 +1,24 @@
1
+ # planner task get
2
+
3
+ Retrieve the the specified planner task
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 planner task get [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-i, --id <id>`
14
+ : ID of the task to retrieve details from
15
+
16
+ --8<-- "docs/cmd/_global.md"
17
+
18
+ ## Examples
19
+
20
+ Retrieve the the specified planner task
21
+
22
+ ```sh
23
+ m365 planner task get --id 'vzCcZoOv-U27PwydxHB8opcADJo-'
24
+ ```
@@ -30,6 +30,11 @@ m365 planner task list [options]
30
30
 
31
31
  --8<-- "docs/cmd/_global.md"
32
32
 
33
+ ## Remarks
34
+
35
+ !!! attention
36
+ This command uses API that is currently in preview to enrich the results with the `priority` field. Keep in mind that this preview API is subject to change once the API reached general availability.
37
+
33
38
  ## Examples
34
39
 
35
40
  List tasks for the currently logged in user
@@ -30,14 +30,14 @@ The `id` must be at least 3 and no more than 32 characters long. It can contain
30
30
 
31
31
  ## Examples
32
32
 
33
- Adds a new external connection with name and description of test
33
+ Adds a new external connection with name and description of test app
34
34
 
35
35
  ```sh
36
- m365 search externalconnection add --id MyApp --name "My application" --description "Description of your application"
36
+ m365 search externalconnection add --id MyApp --name "Test" --description "Test"
37
37
  ```
38
38
 
39
39
  Adds a new external connection with a limited number of authorized apps
40
40
 
41
41
  ```sh
42
- m365 search externalconnection add --id MyApp --name "My application" --description "Description of your application" --authorizedAppIds "00000000-0000-0000-0000-000000000000,00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"
42
+ m365 search externalconnection add --id MyApp --name "Test" --description "Test" --authorizedAppIds "00000000-0000-0000-0000-000000000000,00000000-0000-0000-0000-000000000001,00000000-0000-0000-0000-000000000002"
43
43
  ```
@@ -0,0 +1,39 @@
1
+ # spo group user remove
2
+
3
+ Removes the specified user from a SharePoint group
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 spo group user remove [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-u, --webUrl <webUrl>`
14
+ : URL of the site where the SharePoint group is available
15
+
16
+ `--groupId [groupId]`
17
+ : Id of the SharePoint group from which user has to be removed from. Use either `groupName` or `groupId`, but not both
18
+
19
+ `--groupName [groupName]`
20
+ : Name of the SharePoint group from which user has to be removed from. Use either `groupName` or `groupId`, but not both
21
+
22
+ `--userName <userName>`
23
+ : User's UPN (user principal name, eg. megan.bowen@contoso.com).
24
+
25
+ --8<-- "docs/cmd/_global.md"
26
+
27
+ ## Examples
28
+
29
+ Remove a user from SharePoint group with id _5_ available on the web _https://contoso.sharepoint.com/sites/SiteA_
30
+
31
+ ```sh
32
+ m365 spo group user remove --webUrl https://contoso.sharepoint.com/sites/SiteA --groupId 5 --userName "Alex.Wilber@contoso.com"
33
+ ```
34
+
35
+ Remove a user from SharePoint group with Name _Site A Visitors_ available on the web _https://contoso.sharepoint.com/sites/SiteA_
36
+
37
+ ```sh
38
+ m365 spo group user remove --webUrl https://contoso.sharepoint.com/sites/SiteA --groupName "Site A Visitors" --userName "Alex.Wilber@contoso.com"
39
+ ```
@@ -16,7 +16,7 @@ m365 teams channel get [options]
16
16
  `--teamName [teamName]`
17
17
  : The display name of the team to which the channel belongs to. Specify either teamId or teamName but not both
18
18
 
19
- `-c, --channelId <channelId>`
19
+ `-c, --channelId [channelId]`
20
20
  : The ID of the channel for which to retrieve more information. Specify either channelId or channelName but not both
21
21
 
22
22
  `--channelName [channelName]`