@pnp/cli-microsoft365 6.4.0-beta.3946b02 → 6.4.0-beta.6b65014

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.
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
+ };
16
+ var _FlowOwnerAddCommand_instances, _FlowOwnerAddCommand_initTelemetry, _FlowOwnerAddCommand_initOptions, _FlowOwnerAddCommand_initOptionSets, _FlowOwnerAddCommand_initValidators;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const request_1 = require("../../../../request");
19
+ const aadGroup_1 = require("../../../../utils/aadGroup");
20
+ const aadUser_1 = require("../../../../utils/aadUser");
21
+ const formatting_1 = require("../../../../utils/formatting");
22
+ const validation_1 = require("../../../../utils/validation");
23
+ const AzmgmtCommand_1 = require("../../../base/AzmgmtCommand");
24
+ const commands_1 = require("../../commands");
25
+ class FlowOwnerAddCommand extends AzmgmtCommand_1.default {
26
+ get name() {
27
+ return commands_1.default.OWNER_ADD;
28
+ }
29
+ get description() {
30
+ return 'Assigns permissions to a Power Automate flow';
31
+ }
32
+ constructor() {
33
+ super();
34
+ _FlowOwnerAddCommand_instances.add(this);
35
+ __classPrivateFieldGet(this, _FlowOwnerAddCommand_instances, "m", _FlowOwnerAddCommand_initTelemetry).call(this);
36
+ __classPrivateFieldGet(this, _FlowOwnerAddCommand_instances, "m", _FlowOwnerAddCommand_initOptions).call(this);
37
+ __classPrivateFieldGet(this, _FlowOwnerAddCommand_instances, "m", _FlowOwnerAddCommand_initValidators).call(this);
38
+ __classPrivateFieldGet(this, _FlowOwnerAddCommand_instances, "m", _FlowOwnerAddCommand_initOptionSets).call(this);
39
+ }
40
+ commandAction(logger, args) {
41
+ return __awaiter(this, void 0, void 0, function* () {
42
+ try {
43
+ if (this.verbose) {
44
+ logger.logToStderr(`Assigning permissions for ${args.options.userId || args.options.userName || args.options.groupId || args.options.groupName} with permissions ${args.options.roleName} to Power Automate flow ${args.options.flowName}`);
45
+ }
46
+ let id = '';
47
+ if (args.options.userId) {
48
+ id = args.options.userId;
49
+ }
50
+ else if (args.options.userName) {
51
+ id = yield aadUser_1.aadUser.getUserIdByUpn(args.options.userName);
52
+ }
53
+ else if (args.options.groupId) {
54
+ id = args.options.groupId;
55
+ }
56
+ else {
57
+ id = yield aadGroup_1.aadGroup.getGroupIdByDisplayName(args.options.groupName);
58
+ }
59
+ let type;
60
+ if (args.options.userId || args.options.userName) {
61
+ type = 'User';
62
+ }
63
+ else {
64
+ type = 'Group';
65
+ }
66
+ const requestOptions = {
67
+ url: `${this.resource}providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting_1.formatting.encodeQueryParameter(args.options.flowName)}/modifyPermissions?api-version=2016-11-01`,
68
+ headers: {
69
+ accept: 'application/json'
70
+ },
71
+ data: {
72
+ put: [
73
+ {
74
+ properties: {
75
+ principal: {
76
+ id: id,
77
+ type: type
78
+ },
79
+ roleName: args.options.roleName
80
+ }
81
+ }
82
+ ]
83
+ },
84
+ responseType: 'json'
85
+ };
86
+ yield request_1.default.post(requestOptions);
87
+ }
88
+ catch (err) {
89
+ this.handleRejectedODataJsonPromise(err);
90
+ }
91
+ });
92
+ }
93
+ }
94
+ _FlowOwnerAddCommand_instances = new WeakSet(), _FlowOwnerAddCommand_initTelemetry = function _FlowOwnerAddCommand_initTelemetry() {
95
+ this.telemetry.push((args) => {
96
+ Object.assign(this.telemetryProperties, {
97
+ asAdmin: !!args.options.asAdmin,
98
+ userId: typeof args.options.userId !== 'undefined',
99
+ userName: typeof args.options.userName !== 'undefined',
100
+ groupId: typeof args.options.groupId !== 'undefined',
101
+ groupName: typeof args.options.groupName !== 'undefined'
102
+ });
103
+ });
104
+ }, _FlowOwnerAddCommand_initOptions = function _FlowOwnerAddCommand_initOptions() {
105
+ this.options.unshift({
106
+ option: '-e, --environmentName <environmentName>'
107
+ }, {
108
+ option: '-f, --flowName <flowName>'
109
+ }, {
110
+ option: '--userId [userId]'
111
+ }, {
112
+ option: '--userName [userName]'
113
+ }, {
114
+ option: '--groupId [groupId]'
115
+ }, {
116
+ option: '--groupName [groupName]'
117
+ }, {
118
+ option: '--roleName <roleName>',
119
+ autocomplete: FlowOwnerAddCommand.allowedRoleNames
120
+ }, {
121
+ option: '--asAdmin'
122
+ });
123
+ }, _FlowOwnerAddCommand_initOptionSets = function _FlowOwnerAddCommand_initOptionSets() {
124
+ this.optionSets.push({ options: ['userId', 'userName', 'groupId', 'groupName'] });
125
+ }, _FlowOwnerAddCommand_initValidators = function _FlowOwnerAddCommand_initValidators() {
126
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
127
+ if (!validation_1.validation.isValidGuid(args.options.flowName)) {
128
+ return `${args.options.flowName} is not a valid GUID.`;
129
+ }
130
+ if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
131
+ return `${args.options.userId} is not a valid GUID.`;
132
+ }
133
+ if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
134
+ return `${args.options.userName} is not a valid userName.`;
135
+ }
136
+ if (args.options.groupId && !validation_1.validation.isValidGuid(args.options.groupId)) {
137
+ return `${args.options.groupId} is not a valid GUID.`;
138
+ }
139
+ if (FlowOwnerAddCommand.allowedRoleNames.indexOf(args.options.roleName) === -1) {
140
+ return `${args.options.roleName} is not a valid roleName. Valid values are: ${FlowOwnerAddCommand.allowedRoleNames.join(', ')}`;
141
+ }
142
+ return true;
143
+ }));
144
+ };
145
+ FlowOwnerAddCommand.allowedRoleNames = ['CanView', 'CanEdit'];
146
+ module.exports = new FlowOwnerAddCommand();
147
+ //# sourceMappingURL=owner-add.js.map
@@ -0,0 +1,147 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
+ };
16
+ var _FlowOwnerRemoveCommand_instances, _FlowOwnerRemoveCommand_initTelemetry, _FlowOwnerRemoveCommand_initOptions, _FlowOwnerRemoveCommand_initValidators, _FlowOwnerRemoveCommand_initOptionSets;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const Cli_1 = require("../../../../cli/Cli");
19
+ const request_1 = require("../../../../request");
20
+ const aadGroup_1 = require("../../../../utils/aadGroup");
21
+ const aadUser_1 = require("../../../../utils/aadUser");
22
+ const formatting_1 = require("../../../../utils/formatting");
23
+ const validation_1 = require("../../../../utils/validation");
24
+ const AzmgmtCommand_1 = require("../../../base/AzmgmtCommand");
25
+ const commands_1 = require("../../commands");
26
+ class FlowOwnerRemoveCommand extends AzmgmtCommand_1.default {
27
+ get name() {
28
+ return commands_1.default.OWNER_REMOVE;
29
+ }
30
+ get description() {
31
+ return 'Removes owner permissions to a Power Automate flow';
32
+ }
33
+ constructor() {
34
+ super();
35
+ _FlowOwnerRemoveCommand_instances.add(this);
36
+ __classPrivateFieldGet(this, _FlowOwnerRemoveCommand_instances, "m", _FlowOwnerRemoveCommand_initTelemetry).call(this);
37
+ __classPrivateFieldGet(this, _FlowOwnerRemoveCommand_instances, "m", _FlowOwnerRemoveCommand_initOptions).call(this);
38
+ __classPrivateFieldGet(this, _FlowOwnerRemoveCommand_instances, "m", _FlowOwnerRemoveCommand_initValidators).call(this);
39
+ __classPrivateFieldGet(this, _FlowOwnerRemoveCommand_instances, "m", _FlowOwnerRemoveCommand_initOptionSets).call(this);
40
+ }
41
+ commandAction(logger, args) {
42
+ return __awaiter(this, void 0, void 0, function* () {
43
+ try {
44
+ if (this.verbose) {
45
+ logger.logToStderr(`Removing owner ${args.options.userId || args.options.userName || args.options.groupId || args.options.groupName} from flow ${args.options.flowName} in environment ${args.options.environmentName}`);
46
+ }
47
+ const removeFlowOwner = () => __awaiter(this, void 0, void 0, function* () {
48
+ let idToRemove = '';
49
+ if (args.options.userId) {
50
+ idToRemove = args.options.userId;
51
+ }
52
+ else if (args.options.userName) {
53
+ idToRemove = yield aadUser_1.aadUser.getUserIdByUpn(args.options.userName);
54
+ }
55
+ else if (args.options.groupId) {
56
+ idToRemove = args.options.groupId;
57
+ }
58
+ else {
59
+ idToRemove = yield aadGroup_1.aadGroup.getGroupIdByDisplayName(args.options.groupName);
60
+ }
61
+ const requestOptions = {
62
+ url: `${this.resource}providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting_1.formatting.encodeQueryParameter(args.options.flowName)}/modifyPermissions?api-version=2016-11-01`,
63
+ headers: {
64
+ accept: 'application/json'
65
+ },
66
+ data: {
67
+ delete: [
68
+ {
69
+ id: idToRemove
70
+ }
71
+ ]
72
+ },
73
+ responseType: 'json'
74
+ };
75
+ yield request_1.default.post(requestOptions);
76
+ });
77
+ if (args.options.confirm) {
78
+ yield removeFlowOwner();
79
+ }
80
+ else {
81
+ const result = yield Cli_1.Cli.prompt({
82
+ type: 'confirm',
83
+ name: 'continue',
84
+ default: false,
85
+ message: `Are you sure you want to remove owner '${args.options.groupId || args.options.groupName || args.options.userId || args.options.userName}' from the specified flow?`
86
+ });
87
+ if (result.continue) {
88
+ yield removeFlowOwner();
89
+ }
90
+ }
91
+ }
92
+ catch (err) {
93
+ this.handleRejectedODataJsonPromise(err);
94
+ }
95
+ });
96
+ }
97
+ }
98
+ _FlowOwnerRemoveCommand_instances = new WeakSet(), _FlowOwnerRemoveCommand_initTelemetry = function _FlowOwnerRemoveCommand_initTelemetry() {
99
+ this.telemetry.push((args) => {
100
+ Object.assign(this.telemetryProperties, {
101
+ userId: typeof args.options.userId !== 'undefined',
102
+ userName: typeof args.options.userName !== 'undefined',
103
+ groupId: typeof args.options.groupId !== 'undefined',
104
+ groupName: typeof args.options.groupName !== 'undefined',
105
+ asAdmin: !!args.options.asAdmin,
106
+ confirm: !!args.options.confirm
107
+ });
108
+ });
109
+ }, _FlowOwnerRemoveCommand_initOptions = function _FlowOwnerRemoveCommand_initOptions() {
110
+ this.options.unshift({
111
+ option: '-e, --environmentName <environmentName>'
112
+ }, {
113
+ option: '-f, --flowName <flowName>'
114
+ }, {
115
+ option: '--userId [userId]'
116
+ }, {
117
+ option: '--userName [userName]'
118
+ }, {
119
+ option: '--groupId [groupId]'
120
+ }, {
121
+ option: '--groupName [groupName]'
122
+ }, {
123
+ option: '--asAdmin'
124
+ }, {
125
+ option: '--confirm'
126
+ });
127
+ }, _FlowOwnerRemoveCommand_initValidators = function _FlowOwnerRemoveCommand_initValidators() {
128
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
129
+ if (!validation_1.validation.isValidGuid(args.options.flowName)) {
130
+ return `${args.options.flowName} is not a valid GUID.`;
131
+ }
132
+ if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
133
+ return `${args.options.userId} is not a valid GUID.`;
134
+ }
135
+ if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
136
+ return `${args.options.userName} is not a valid userName.`;
137
+ }
138
+ if (args.options.groupId && !validation_1.validation.isValidGuid(args.options.groupId)) {
139
+ return `${args.options.groupId} is not a valid GUID.`;
140
+ }
141
+ return true;
142
+ }));
143
+ }, _FlowOwnerRemoveCommand_initOptionSets = function _FlowOwnerRemoveCommand_initOptionSets() {
144
+ this.optionSets.push({ options: ['userId', 'userName', 'groupId', 'groupName'] });
145
+ };
146
+ module.exports = new FlowOwnerRemoveCommand();
147
+ //# sourceMappingURL=owner-remove.js.map
@@ -42,7 +42,7 @@ class FlowRunListCommand extends AzmgmtItemsListCommand_1.AzmgmtItemsListCommand
42
42
  if (this.verbose) {
43
43
  logger.logToStderr(`Retrieving list of runs for Microsoft Flow ${args.options.flowName}...`);
44
44
  }
45
- let url = `${this.resource}providers/Microsoft.ProcessSimple/environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting_1.formatting.encodeQueryParameter(args.options.flowName)}/runs?api-version=2016-11-01`;
45
+ let url = `${this.resource}providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting_1.formatting.encodeQueryParameter(args.options.flowName)}/runs?api-version=2016-11-01`;
46
46
  const filters = this.getFilters(args.options);
47
47
  if (filters.length > 0) {
48
48
  url += `&$filter=${filters.join(' and ')}`;
@@ -86,7 +86,8 @@ _FlowRunListCommand_instances = new WeakSet(), _FlowRunListCommand_initTelemetry
86
86
  Object.assign(this.telemetryProperties, {
87
87
  status: typeof args.options.status !== 'undefined',
88
88
  triggerStartTime: typeof args.options.triggerStartTime !== 'undefined',
89
- triggerEndTime: typeof args.options.triggerEndTime !== 'undefined'
89
+ triggerEndTime: typeof args.options.triggerEndTime !== 'undefined',
90
+ asAdmin: !!args.options.asAdmin
90
91
  });
91
92
  });
92
93
  }, _FlowRunListCommand_initOptions = function _FlowRunListCommand_initOptions() {
@@ -101,6 +102,8 @@ _FlowRunListCommand_instances = new WeakSet(), _FlowRunListCommand_initTelemetry
101
102
  option: '--triggerStartTime [triggerStartTime]'
102
103
  }, {
103
104
  option: '--triggerEndTime [triggerEndTime]'
105
+ }, {
106
+ option: '--asAdmin'
104
107
  });
105
108
  }, _FlowRunListCommand_initValidators = function _FlowRunListCommand_initValidators() {
106
109
  this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
@@ -11,7 +11,9 @@ exports.default = {
11
11
  EXPORT: `${prefix} export`,
12
12
  GET: `${prefix} get`,
13
13
  LIST: `${prefix} list`,
14
+ OWNER_ADD: `${prefix} owner add`,
14
15
  OWNER_LIST: `${prefix} owner list`,
16
+ OWNER_REMOVE: `${prefix} owner remove`,
15
17
  REMOVE: `${prefix} remove`,
16
18
  RUN_CANCEL: `${prefix} run cancel`,
17
19
  RUN_GET: `${prefix} run get`,
@@ -0,0 +1,98 @@
1
+ "use strict";
2
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
+ return new (P || (P = Promise))(function (resolve, reject) {
5
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
9
+ });
10
+ };
11
+ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
12
+ if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
13
+ if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
14
+ return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
15
+ };
16
+ var _PlannerRosterMemberGetCommand_instances, _PlannerRosterMemberGetCommand_initTelemetry, _PlannerRosterMemberGetCommand_initOptions, _PlannerRosterMemberGetCommand_initOptionSets, _PlannerRosterMemberGetCommand_initValidators;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const request_1 = require("../../../../request");
19
+ const validation_1 = require("../../../../utils/validation");
20
+ const GraphCommand_1 = require("../../../base/GraphCommand");
21
+ const commands_1 = require("../../commands");
22
+ const aadUser_1 = require("../../../../utils/aadUser");
23
+ class PlannerRosterMemberGetCommand extends GraphCommand_1.default {
24
+ get name() {
25
+ return commands_1.default.ROSTER_MEMBER_GET;
26
+ }
27
+ get description() {
28
+ return 'Gets a member of the specified Microsoft Planner Roster';
29
+ }
30
+ constructor() {
31
+ super();
32
+ _PlannerRosterMemberGetCommand_instances.add(this);
33
+ __classPrivateFieldGet(this, _PlannerRosterMemberGetCommand_instances, "m", _PlannerRosterMemberGetCommand_initTelemetry).call(this);
34
+ __classPrivateFieldGet(this, _PlannerRosterMemberGetCommand_instances, "m", _PlannerRosterMemberGetCommand_initOptions).call(this);
35
+ __classPrivateFieldGet(this, _PlannerRosterMemberGetCommand_instances, "m", _PlannerRosterMemberGetCommand_initValidators).call(this);
36
+ __classPrivateFieldGet(this, _PlannerRosterMemberGetCommand_instances, "m", _PlannerRosterMemberGetCommand_initOptionSets).call(this);
37
+ }
38
+ commandAction(logger, args) {
39
+ return __awaiter(this, void 0, void 0, function* () {
40
+ if (this.verbose) {
41
+ logger.logToStderr(`Retrieving member ${args.options.userName || args.options.userId} from the Microsoft Planner Roster`);
42
+ }
43
+ try {
44
+ const userId = yield this.getUserId(args);
45
+ const requestOptions = {
46
+ url: `${this.resource}/beta/planner/rosters/${args.options.rosterId}/members/${userId}`,
47
+ headers: {
48
+ accept: 'application/json;odata.metadata=none'
49
+ },
50
+ responseType: 'json'
51
+ };
52
+ const response = yield request_1.default.get(requestOptions);
53
+ logger.log(response);
54
+ }
55
+ catch (err) {
56
+ this.handleRejectedODataJsonPromise(err);
57
+ }
58
+ });
59
+ }
60
+ getUserId(args) {
61
+ return __awaiter(this, void 0, void 0, function* () {
62
+ if (args.options.userId) {
63
+ return args.options.userId;
64
+ }
65
+ return aadUser_1.aadUser.getUserIdByUpn(args.options.userName);
66
+ });
67
+ }
68
+ }
69
+ _PlannerRosterMemberGetCommand_instances = new WeakSet(), _PlannerRosterMemberGetCommand_initTelemetry = function _PlannerRosterMemberGetCommand_initTelemetry() {
70
+ this.telemetry.push((args) => {
71
+ Object.assign(this.telemetryProperties, {
72
+ userId: typeof args.options.userId !== 'undefined',
73
+ userName: typeof args.options.userName !== 'undefined'
74
+ });
75
+ });
76
+ }, _PlannerRosterMemberGetCommand_initOptions = function _PlannerRosterMemberGetCommand_initOptions() {
77
+ this.options.unshift({
78
+ option: '--rosterId <rosterId>'
79
+ }, {
80
+ option: '--userId [userId]'
81
+ }, {
82
+ option: '--userName [userName]'
83
+ });
84
+ }, _PlannerRosterMemberGetCommand_initOptionSets = function _PlannerRosterMemberGetCommand_initOptionSets() {
85
+ this.optionSets.push({ options: ['userId', 'userName'] });
86
+ }, _PlannerRosterMemberGetCommand_initValidators = function _PlannerRosterMemberGetCommand_initValidators() {
87
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
88
+ if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
89
+ return `${args.options.userId} is not a valid GUID`;
90
+ }
91
+ if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
92
+ return `${args.options.userName} is not a valid userName`;
93
+ }
94
+ return true;
95
+ }));
96
+ };
97
+ module.exports = new PlannerRosterMemberGetCommand();
98
+ //# sourceMappingURL=roster-member-get.js.map
@@ -15,6 +15,7 @@ exports.default = {
15
15
  ROSTER_ADD: `${prefix} roster add`,
16
16
  ROSTER_GET: `${prefix} roster get`,
17
17
  ROSTER_MEMBER_ADD: `${prefix} roster member add`,
18
+ ROSTER_MEMBER_GET: `${prefix} roster member get`,
18
19
  ROSTER_MEMBER_LIST: `${prefix} roster member list`,
19
20
  ROSTER_MEMBER_REMOVE: `${prefix} roster member remove`,
20
21
  ROSTER_REMOVE: `${prefix} roster remove`,
@@ -77,14 +77,26 @@ class SpoCustomActionGetCommand extends SpoCommand_1.default {
77
77
  }
78
78
  return customAction;
79
79
  }
80
- const customActions = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `Title eq '${formatting_1.formatting.encodeQueryParameter(options.title)}'`);
81
- if (customActions.length === 1) {
82
- return customActions[0];
80
+ else if (options.title) {
81
+ const customActions = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `Title eq '${formatting_1.formatting.encodeQueryParameter(options.title)}'`);
82
+ if (customActions.length === 1) {
83
+ return customActions[0];
84
+ }
85
+ if (customActions.length === 0) {
86
+ throw `No user custom action with title '${options.title}' found`;
87
+ }
88
+ throw `Multiple user custom actions with title '${options.title}' found. Please disambiguate using IDs: ${customActions.map(a => a.Id).join(', ')}`;
83
89
  }
84
- if (customActions.length === 0) {
85
- throw `No user custom action with title '${options.title}' found`;
90
+ else {
91
+ const customActions = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `ClientSideComponentId eq guid'${options.clientSideComponentId}'`);
92
+ if (customActions.length === 0) {
93
+ throw `No user custom action with ClientSideComponentId '${options.clientSideComponentId}' found`;
94
+ }
95
+ if (customActions.length > 1) {
96
+ throw `Multiple user custom actions with ClientSideComponentId '${options.clientSideComponentId}' found. Please disambiguate using IDs: ${customActions.map((customAction) => customAction.Id).join(', ')}`;
97
+ }
98
+ return customActions[0];
86
99
  }
87
- throw `Multiple user custom actions with title '${options.title}' found. Please disambiguate using IDs: ${customActions.map(a => a.Id).join(', ')}`;
88
100
  });
89
101
  }
90
102
  humanizeScope(scope) {
@@ -100,6 +112,9 @@ class SpoCustomActionGetCommand extends SpoCommand_1.default {
100
112
  _SpoCustomActionGetCommand_instances = new WeakSet(), _SpoCustomActionGetCommand_initTelemetry = function _SpoCustomActionGetCommand_initTelemetry() {
101
113
  this.telemetry.push((args) => {
102
114
  Object.assign(this.telemetryProperties, {
115
+ id: typeof args.options.id !== 'undefined',
116
+ title: typeof args.options.title !== 'undefined',
117
+ clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
103
118
  scope: args.options.scope || 'All'
104
119
  });
105
120
  });
@@ -108,6 +123,8 @@ _SpoCustomActionGetCommand_instances = new WeakSet(), _SpoCustomActionGetCommand
108
123
  option: '-i, --id [id]'
109
124
  }, {
110
125
  option: '-t, --title [title]'
126
+ }, {
127
+ option: '-c, --clientSideComponentId [clientSideComponentId]'
111
128
  }, {
112
129
  option: '-u, --webUrl <webUrl>'
113
130
  }, {
@@ -130,10 +147,13 @@ _SpoCustomActionGetCommand_instances = new WeakSet(), _SpoCustomActionGetCommand
130
147
  return `${args.options.scope} is not a valid custom action scope. Allowed values are Site|Web|All`;
131
148
  }
132
149
  }
150
+ if (args.options.clientSideComponentId && validation_1.validation.isValidGuid(args.options.clientSideComponentId) === false) {
151
+ return `${args.options.clientSideComponentId} is not a valid GUID.`;
152
+ }
133
153
  return true;
134
154
  }));
135
155
  }, _SpoCustomActionGetCommand_initOptionSets = function _SpoCustomActionGetCommand_initOptionSets() {
136
- this.optionSets.push({ options: ['id', 'title'] });
156
+ this.optionSets.push({ options: ['id', 'title', 'clientSideComponentId'] });
137
157
  };
138
158
  module.exports = new SpoCustomActionGetCommand();
139
159
  //# sourceMappingURL=customaction-get.js.map
@@ -55,7 +55,7 @@ class SpoFileMoveCommand extends SpoCommand_1.default {
55
55
  // A user might enter folder instead of file as source url by mistake
56
56
  // then there are edge cases when deleteIfAlreadyExists flag is set
57
57
  // the user can receive misleading error message.
58
- this.fileExists(tenantUrl, webUrl, args.options.sourceUrl);
58
+ yield this.fileExists(tenantUrl, webUrl, args.options.sourceUrl);
59
59
  if (args.options.deleteIfAlreadyExists) {
60
60
  // try delete target file, if deleteIfAlreadyExists flag is set
61
61
  const filename = args.options.sourceUrl.replace(/^.*[\\\/]/, '');
@@ -106,7 +106,7 @@ class SpoListAddCommand extends SpoCommand_1.default {
106
106
  mapRequestBody(options) {
107
107
  const requestBody = {
108
108
  Title: options.title,
109
- BaseTemplate: ListTemplateType_1.ListTemplateType[options.baseTemplate.trim()].valueOf()
109
+ BaseTemplate: options.baseTemplate ? ListTemplateType_1.ListTemplateType[options.baseTemplate.trim()].valueOf() : ListTemplateType_1.ListTemplateType.GenericList
110
110
  };
111
111
  if (options.description) {
112
112
  requestBody.Description = options.description;
@@ -148,7 +148,7 @@ class SpoListAddCommand extends SpoCommand_1.default {
148
148
  requestBody.DisableGridEditing = options.disableGridEditing;
149
149
  }
150
150
  if (options.draftVersionVisibility) {
151
- requestBody.DraftVersionVisibility = options.draftVersionVisibility;
151
+ requestBody.DraftVersionVisibility = DraftVisibilityType_1.DraftVisibilityType[options.draftVersionVisibility.trim()];
152
152
  }
153
153
  if (options.emailAlias) {
154
154
  requestBody.EmailAlias = options.emailAlias;
@@ -226,7 +226,7 @@ class SpoListAddCommand extends SpoCommand_1.default {
226
226
  requestBody.IsApplicationList = options.isApplicationList;
227
227
  }
228
228
  if (options.listExperienceOptions) {
229
- requestBody.ListExperienceOptions = options.listExperienceOptions;
229
+ requestBody.ListExperienceOptions = ListExperience_1.ListExperience[options.listExperienceOptions.trim()];
230
230
  }
231
231
  if (options.majorVersionLimit) {
232
232
  requestBody.MajorVersionLimit = options.majorVersionLimit;
@@ -296,6 +296,7 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
296
296
  const telemetryProps = {};
297
297
  // add properties with identifiable data
298
298
  [
299
+ 'baseTemplate',
299
300
  'description',
300
301
  'templateFeatureId',
301
302
  'schemaXml',
@@ -342,7 +343,7 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
342
343
  this.options.unshift({
343
344
  option: '-t, --title <title>'
344
345
  }, {
345
- option: '--baseTemplate <baseTemplate>',
346
+ option: '--baseTemplate [baseTemplate]',
346
347
  autocomplete: this.listTemplateTypeMap
347
348
  }, {
348
349
  option: '-u, --webUrl <webUrl>'
@@ -520,9 +521,11 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
520
521
  if (isValidSharePointUrl !== true) {
521
522
  return isValidSharePointUrl;
522
523
  }
523
- const template = ListTemplateType_1.ListTemplateType[args.options.baseTemplate.trim()];
524
- if (!template) {
525
- return `${args.options.baseTemplate} is not a valid baseTemplate value`;
524
+ if (args.options.baseTemplate) {
525
+ const template = ListTemplateType_1.ListTemplateType[args.options.baseTemplate.trim()];
526
+ if (!template) {
527
+ return `${args.options.baseTemplate} is not a valid baseTemplate value`;
528
+ }
526
529
  }
527
530
  if (args.options.templateFeatureId &&
528
531
  !validation_1.validation.isValidGuid(args.options.templateFeatureId)) {
@@ -538,7 +541,7 @@ _SpoListAddCommand_instances = new WeakSet(), _SpoListAddCommand_initTelemetry =
538
541
  }
539
542
  if (args.options.draftVersionVisibility) {
540
543
  const draftType = DraftVisibilityType_1.DraftVisibilityType[args.options.draftVersionVisibility.trim()];
541
- if (!draftType) {
544
+ if (draftType === undefined) {
542
545
  return `${args.options.draftVersionVisibility} is not a valid draftVisibilityType value`;
543
546
  }
544
547
  }
@@ -150,7 +150,7 @@ class SpoListSetCommand extends SpoCommand_1.default {
150
150
  requestBody.DisableGridEditing = options.disableGridEditing;
151
151
  }
152
152
  if (options.draftVersionVisibility) {
153
- requestBody.DraftVersionVisibility = options.draftVersionVisibility;
153
+ requestBody.DraftVersionVisibility = DraftVisibilityType_1.DraftVisibilityType[options.draftVersionVisibility.trim()];
154
154
  }
155
155
  if (options.emailAlias) {
156
156
  requestBody.EmailAlias = options.emailAlias;
@@ -228,7 +228,7 @@ class SpoListSetCommand extends SpoCommand_1.default {
228
228
  requestBody.IsApplicationList = options.isApplicationList;
229
229
  }
230
230
  if (options.listExperienceOptions) {
231
- requestBody.ListExperienceOptions = options.listExperienceOptions;
231
+ requestBody.ListExperienceOptions = ListExperience_1.ListExperience[options.listExperienceOptions.trim()];
232
232
  }
233
233
  if (options.majorVersionLimit) {
234
234
  requestBody.MajorVersionLimit = options.majorVersionLimit;
@@ -545,7 +545,7 @@ _SpoListSetCommand_instances = new WeakSet(), _SpoListSetCommand_initTelemetry =
545
545
  }
546
546
  if (args.options.draftVersionVisibility) {
547
547
  const draftType = DraftVisibilityType_1.DraftVisibilityType[args.options.draftVersionVisibility.trim()];
548
- if (!draftType) {
548
+ if (draftType === undefined) {
549
549
  return `${args.options.draftVersionVisibility} is not a valid draftVisibilityType value`;
550
550
  }
551
551
  }
@@ -53,6 +53,24 @@ exports.aadGroup = {
53
53
  }
54
54
  return groups[0];
55
55
  });
56
+ },
57
+ /**
58
+ * Get id of a group by its display name.
59
+ * @param displayName Group display name.
60
+ * @throws Error when group was not found.
61
+ * @throws Error when multiple groups with the same name were found.
62
+ */
63
+ getGroupIdByDisplayName(displayName) {
64
+ return __awaiter(this, void 0, void 0, function* () {
65
+ const groups = yield odata_1.odata.getAllItems(`${graphResource}/v1.0/groups?$filter=displayName eq '${formatting_1.formatting.encodeQueryParameter(displayName)}'&$select=id`);
66
+ if (!groups.length) {
67
+ throw Error(`The specified group '${displayName}' does not exist.`);
68
+ }
69
+ if (groups.length > 1) {
70
+ throw Error(`Multiple groups with name '${displayName}' found: ${groups.map(x => x.id).join(',')}.`);
71
+ }
72
+ return groups[0].id;
73
+ });
56
74
  }
57
75
  };
58
76
  //# sourceMappingURL=aadGroup.js.map
@@ -0,0 +1,61 @@
1
+ # flow owner add
2
+
3
+ Assigns permissions to a Power Automate flow
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 flow owner add [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-e, --environmentName <environmentName>`
14
+ : The name of the environment.
15
+
16
+ `-f, --flowName <flowName>`
17
+ : The name of the Power Automate flow.
18
+
19
+ `--userId [userId]`
20
+ : The ID of the user. Specify either `userId`, `userName`, `groupId` or `groupName`.
21
+
22
+ `--userName [userName]`
23
+ : User principal name of the user. Specify either `userId`, `userName`, `groupId` or `groupName`.
24
+
25
+ `--groupId [groupId]`
26
+ : The ID of the group. Specify either `userId`, `userName`, `groupId` or `groupName`.
27
+
28
+ `--groupName [groupName]`
29
+ : The name of the group. Specify either `userId`, `userName`, `groupId` or `groupName`.
30
+
31
+ `--roleName <roleName>`
32
+ : Access level for the user on the flow. Valid options are `CanView` or `CanEdit`.
33
+
34
+ `--asAdmin`
35
+ : Run the command as admin.
36
+
37
+ --8<-- "docs/cmd/_global.md"
38
+
39
+ ## Examples
40
+
41
+ Assign owner permissions to a specific Power Automate flow for a user with ID
42
+
43
+ ```sh
44
+ m365 flow owner add --userId 5c241023-2ba5-4ea8-a516-a2481a3e6c51 --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72 --roleName CanEdit
45
+ ```
46
+
47
+ Assign owner permissions to a specific Power Automate flow for a user with UPN
48
+
49
+ ```sh
50
+ m365 flow owner add --userName "john.doe@contoso.com" --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72 --roleName CanEdit
51
+ ```
52
+
53
+ Assign owner permissions to a specific Power Automate flow for a group
54
+
55
+ ```sh
56
+ m365 flow owner add --groupId 8d4d9f32-1ab0-4f81-9054-efbb1759e8e6 --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72 --roleName CanEdit
57
+ ```
58
+
59
+ ## Response
60
+
61
+ The command won't return a response on success.
@@ -0,0 +1,67 @@
1
+ # flow owner remove
2
+
3
+ Removes owner permissions to a Power Automate flow
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 flow owner remove [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `-e, --environmentName <environmentName>`
14
+ : The name of the environment.
15
+
16
+ `-f, --flowName <flowName>`
17
+ : The name of the Power Automate flow.
18
+
19
+ `--userId [userId]`
20
+ : The ID of the user. Specify either `userId`, `userName`, `groupId` or `groupName`.
21
+
22
+ `--userName [userName]`
23
+ : User principal name of the user. Specify either `userId`, `userName`, `groupId` or `groupName`.
24
+
25
+ `--groupId [groupId]`
26
+ : The ID of the group. Specify either `userId`, `userName`, `groupId` or `groupName`.
27
+
28
+ `--groupName [groupName]`
29
+ : The name of the group. Specify either `userId`, `userName`, `groupId` or `groupName`.
30
+
31
+ `--asAdmin`
32
+ : Run the command as admin.
33
+
34
+ `--confirm`
35
+ : Don't prompt for confirmation.
36
+
37
+ --8<-- "docs/cmd/_global.md"
38
+
39
+ ## Examples
40
+
41
+ Remove owner permissions from a specific Power Automate flow for a user by ID without prompting for confirmation
42
+
43
+ ```sh
44
+ m365 flow owner remove --userId 5c241023-2ba5-4ea8-a516-a2481a3e6c51 --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72 --confirm
45
+ ```
46
+
47
+ Remove owner permissions from a specific Power Automate flow for a user by UPN as admin
48
+
49
+ ```sh
50
+ m365 flow owner remove --userName john.doe@contoso.com --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72 --asAdmin
51
+ ```
52
+
53
+ Remove owner permissions from a specific Power Automate flow for a group by ID
54
+
55
+ ```sh
56
+ m365 flow owner remove --groupId 5c241023-2ba5-4ea8-a516-a2481a3e6c51 --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72
57
+ ```
58
+
59
+ Remove owner permissions from a specific Power Automate flow for a group by name as admin
60
+
61
+ ```sh
62
+ m365 flow owner remove --groupName "Test group" --environmentName Default-c5a5d746-3520-453f-8a69-780f8e44917e --flowName 72f2be4a-78c1-4220-a048-dbf557296a72 --asAdmin
63
+ ```
64
+
65
+ ## Response
66
+
67
+ The command won't return a response on success.
@@ -25,6 +25,9 @@ m365 flow run list [options]
25
25
  `--triggerEndTime [triggerEndTime]`
26
26
  : Time indicating the exclusive end of a time range of flow runs to return. This should be defined as a valid ISO 8601 string (2021-12-16T18:28:48.6964197Z).
27
27
 
28
+ `--asAdmin`
29
+ : Run the command as admin. Use this flag when targeting flows you don't own.
30
+
28
31
  --8<-- "docs/cmd/_global.md"
29
32
 
30
33
  ## Remarks
@@ -56,6 +59,12 @@ List runs of the specified Microsoft Flow between a specific time range
56
59
  m365 flow run list --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --flowName 5923cb07-ce1a-4a5c-ab81-257ce820109a --triggerStartTime 2023-01-21T18:19:00Z --triggerEndTime 2023-01-22T00:00:00Z
57
60
  ```
58
61
 
62
+ List runs of the specified Microsoft Flow owned by another user
63
+
64
+ ```sh
65
+ m365 flow run list --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --flowName 5923cb07-ce1a-4a5c-ab81-257ce820109a --asAdmin
66
+ ```
67
+
59
68
  ## Response
60
69
 
61
70
  ### Standard response
@@ -123,3 +132,22 @@ m365 flow run list --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c
123
132
  name,startTime,status
124
133
  08585329112602833828909892130CU17,2022-11-17T14:33:45.2763872Z,Running
125
134
  ```
135
+
136
+ === "Markdown"
137
+
138
+ ```md
139
+ # flow run list --environmentName "Default-de348bc7-1aeb-4406-8cb3-97db021cadb4" --flowName "08585329112602833828909892130CU17"
140
+
141
+ Date: 1/3/2023
142
+
143
+ ## 08585329112602833828909892130CU17 (/providers/Microsoft.ProcessSimple/environments/Default-de348bc7-1aeb-4406-8cb3-97db021cadb4/flows/170fb67e-a514-4d84-8727-582022bd13a9/runs/08585329112602833828909892130CU17)
144
+
145
+ Property | Value
146
+ ---------|-------
147
+ name | 08585329112602833828909892130CU17
148
+ id | /providers/Microsoft.ProcessSimple/environments/Default-de348bc7-1aeb-4406-8cb3-97db021cadb4/flows/170fb67e-a514-4d84-8727-582022bd13a9/runs/08585329112602833828909892130CU17
149
+ type | Microsoft.ProcessSimple/environments/flows/runs
150
+ properties | {"startTime":"2022-11-17T14:33:45.2763872Z","status":"Running","correlation":{"clientTrackingId":"08585329112602833829909892130CU00"},"trigger":{"name":"When_a_new_response_is_submitted","inputsLink":{"uri":"https://prod-08.centralindia.logic.azure.com:443/workflows/f7bf8f6b5c494e63bfc21b54087a596e/runs/08585329112602833828909892130CU17/contents/TriggerInputs?api-version=2016-06-01&se=2022-11-17T18%3A00%3A00.0000000Z&sp=%2Fruns%2F08585329112602833828909892130CU17%2Fcontents%2FTriggerInputs%2Fread&sv=1.0&sig=jmdMRWvY7uGoxTmqd3_a2bJtegXuVyuKTKKUVLiwh38","contentVersion":"6ZrBBE+MJg7IvhMgyJLMmA==","contentSize":349,"contentHash":{"algorithm":"md5","value":"6ZrBBE+MJg7IvhMgyJLMmA=="}},"outputsLink":{"uri":"https://prod-08.centralindia.logic.azure.com:443/workflows/f7bf8f6b5c494e63bfc21b54087a596e/runs/08585329112602833828909892130CU17/contents/TriggerOutputs?api-version=2016-06-01&se=2022-11-17T18%3A00%3A00.0000000Z&sp=%2Fruns%2F08585329112602833828909892130CU17%2Fcontents%2FTriggerOutputs%2Fread&sv=1.0&sig=Y3qqjuWrrcQJrmF7uvm6LVzQy5w-dNOFWJ8Yt8khXvA","contentVersion":"Z/4a8tfYygNAR1xpc44iww==","contentSize":493,"contentHash":{"algorithm":"md5","value":"Z/4a8tfYygNAR1xpc44iww=="}},"startTime":"2022-11-17T14:33:45.1914506Z","endTime":"2022-11-17T14:33:45.1914506Z","originHistoryName":"08585329112602833829909892130CU00","correlation":{"clientTrackingId":"08585329112602833829909892130CU00"},"status":"Succeeded"}}
151
+ startTime | 2022-11-17T14:33:45.2763872Z
152
+ status | Running
153
+ ```
@@ -0,0 +1,87 @@
1
+ # planner roster member get
2
+
3
+ Gets a member of the specified Microsoft Planner Roster
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 planner roster member get [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--rosterId <rosterId>`
14
+ : ID of the Planner Roster.
15
+
16
+ `--userId [userId]`
17
+ : User's Azure AD ID. Specify either `userId` or `userName` but not both.
18
+
19
+ `--userName [userName]`
20
+ : User's UPN (user principal name, e.g. johndoe@example.com). Specify either `userId` or `userName` but not both.
21
+
22
+ --8<-- "docs/cmd/_global.md"
23
+
24
+ ## Remarks
25
+
26
+ !!! attention
27
+ This command is based on an API that is currently in preview and is subject to change once the API reached general availability.
28
+
29
+ ## Examples
30
+
31
+ Gets a specific user by user name as member of the Planner Roster
32
+
33
+ ```sh
34
+ m365 planner roster member get --rosterId tYqYlNd6eECmsNhN_fcq85cAGAnd --userName john.doe@contoso.com
35
+ ```
36
+
37
+ Gets a specific user by ID as member of the Planner Roster
38
+
39
+ ```sh
40
+ m365 planner roster member get --rosterId tYqYlNd6eECmsNhN_fcq85cAGAnd --userId d049a857-f1c3-4fb3-a629-d8cfb3bd7275
41
+ ```
42
+
43
+ ## Response
44
+
45
+ === "JSON"
46
+
47
+ ```json
48
+ {
49
+ "id": "b3a1be03-54a5-43d2-b4fb-6562fe9bec0b",
50
+ "userId": "2056d2f6-3257-4253-8cfc-b73393e414e5",
51
+ "tenantId": "5b7b813c-2339-48cd-8c51-bd4fcb269420",
52
+ "roles": []
53
+ }
54
+ ```
55
+
56
+ === "Text"
57
+
58
+ ```text
59
+ id : b3a1be03-54a5-43d2-b4fb-6562fe9bec0b
60
+ roles : []
61
+ tenantId: 5b7b813c-2339-48cd-8c51-bd4fcb269420
62
+ userId : 2056d2f6-3257-4253-8cfc-b73393e414e5
63
+ ```
64
+
65
+ === "CSV"
66
+
67
+ ```csv
68
+ id,userId,tenantId,roles
69
+ b3a1be03-54a5-43d2-b4fb-6562fe9bec0b,2056d2f6-3257-4253-8cfc-b73393e414e5,5b7b813c-2339-48cd-8c51-bd4fcb269420,[]
70
+ ```
71
+
72
+ === "Markdown"
73
+
74
+ ```md
75
+ # planner roster member get --rosterId "tYqYlNd6eECmsNhN_fcq85cAGAnd" --userId "2056d2f6-3257-4253-8cfc-b73393e414e5"
76
+
77
+ Date: 18/2/2023
78
+
79
+ ## b3a1be03-54a5-43d2-b4fb-6562fe9bec0b
80
+
81
+ Property | Value
82
+ ---------|-------
83
+ id | b3a1be03-54a5-43d2-b4fb-6562fe9bec0b
84
+ userId | 2056d2f6-3257-4253-8cfc-b73393e414e5
85
+ tenantId | 5b7b813c-2339-48cd-8c51-bd4fcb269420
86
+ roles | []
87
+ ```
@@ -11,10 +11,13 @@ m365 spo customaction get [options]
11
11
  ## Options
12
12
 
13
13
  `-i, --id [id]`
14
- : ID of the user custom action to retrieve information for. Specify either `id` or `title`
14
+ : ID of the user custom action to retrieve information for. Specify either `id`, `title` or `clientSideComponentId`
15
15
 
16
16
  `-t, --title [title]`
17
- : Title of the user custom action to retrieve information for. Specify either `id` or `title`
17
+ : Title of the user custom action to retrieve information for. Specify either `id`, `title` or `clientSideComponentId`
18
+
19
+ `-c, --clientSideComponentId [clientSideComponentId]`
20
+ : clientSideComponentId of the user custom action to retrieve information for. Specify either `id`, `title` or `clientSideComponentId`
18
21
 
19
22
  `-u, --webUrl <webUrl>`
20
23
  : Url of the site or site collection to retrieve the custom action from
@@ -26,34 +29,133 @@ m365 spo customaction get [options]
26
29
 
27
30
  ## Remarks
28
31
 
29
- If the command finds multiple user custom actions with the specified title, it will prompt you to disambiguate which user custom action it should use, listing the discovered IDs.
32
+ If the command finds multiple user custom actions with the specified `title` or `clientSideComponentId`, it will prompt you to disambiguate which user custom action it should get, listing the discovered IDs.
30
33
 
31
34
  ## Examples
32
35
 
33
- Return details about the user custom action with ID _058140e3-0e37-44fc-a1d3-79c487d371a3_ located in site or site collection _https://contoso.sharepoint.com/sites/test_
36
+ Return details about the user custom action based on the id and a given url
34
37
 
35
38
  ```sh
36
39
  m365 spo customaction get --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --webUrl https://contoso.sharepoint.com/sites/test
37
40
  ```
38
41
 
39
- Return details about the user custom action with Title _YourAppCustomizer_ located in site or site collection _https://contoso.sharepoint.com/sites/test_
42
+ Return details about the user custom action based on the title and a given url
40
43
 
41
44
  ```sh
42
45
  m365 spo customaction get --title "YourAppCustomizer" --webUrl https://contoso.sharepoint.com/sites/test
43
46
  ```
44
47
 
45
- Return details about the user custom action with ID _058140e3-0e37-44fc-a1d3-79c487d371a3_ located in site collection _https://contoso.sharepoint.com/sites/test_
48
+ Return details about the user custom action based on the clientSideComponentId and a given url
49
+
50
+ ```sh
51
+ m365 spo customaction get --clientSideComponentId "34a019f9-6198-4053-a3b6-fbdea9a107fd" --webUrl https://contoso.sharepoint.com/sites/test
52
+ ```
53
+
54
+ Return details about the user custom action based on the id and a given url and the scope
46
55
 
47
56
  ```sh
48
- m365 spo customaction get --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --webUrl https://contoso.sharepoint.com/sites/test --scope Site
57
+ m365 spo customaction get --id "058140e3-0e37-44fc-a1d3-79c487d371a3" --webUrl https://contoso.sharepoint.com/sites/test --scope Site
49
58
  ```
50
59
 
51
- Return details about the user custom action with ID _058140e3-0e37-44fc-a1d3-79c487d371a3_ located in site _https://contoso.sharepoint.com/sites/test_
60
+ Return details about the user custom action based on the id and a given url and the scope
52
61
 
53
62
  ```sh
54
- m365 spo customaction get --id 058140e3-0e37-44fc-a1d3-79c487d371a3 --webUrl https://contoso.sharepoint.com/sites/test --scope Web
63
+ m365 spo customaction get --id "058140e3-0e37-44fc-a1d3-79c487d371a3" --webUrl https://contoso.sharepoint.com/sites/test --scope Web
55
64
  ```
56
65
 
57
- ## More information
66
+ Return details about the user custom action based on the id and a given url and the scope
67
+
68
+ ```sh
69
+ m365 spo customaction get --id "058140e3-0e37-44fc-a1d3-79c487d371a3" --webUrl https://contoso.sharepoint.com/sites/test --scope Web
70
+ ```
58
71
 
59
- - UserCustomAction REST API resources: [https://msdn.microsoft.com/en-us/library/office/dn531432.aspx#bk_UserCustomAction](https://msdn.microsoft.com/en-us/library/office/dn531432.aspx#bk_UserCustomAction)
72
+ ## Response
73
+
74
+ === "JSON"
75
+
76
+ ```json
77
+ {
78
+ "ClientSideComponentId": "34a019f9-6198-4053-a3b6-fbdea9a107fd",
79
+ "ClientSideComponentProperties": "{\"sampleTextOne\":\"One item is selected in the list.\", \"sampleTextTwo\":\"This command is always visible.\"}",
80
+ "CommandUIExtension": null,
81
+ "Description": null,
82
+ "Group": null,
83
+ "Id": "158cb0d1-8703-4a36-866d-84aed8233bd3",
84
+ "ImageUrl": null,
85
+ "Location": "ClientSideExtension.ListViewCommandSet.CommandBar",
86
+ "Name": "{158cb0d1-8703-4a36-866d-84aed8233bd3}",
87
+ "RegistrationId": "100",
88
+ "RegistrationType": 1,
89
+ "Rights": "{\"High\":0,\"Low\":0}",
90
+ "Scope": "Web",
91
+ "ScriptBlock": null,
92
+ "ScriptSrc": null,
93
+ "Sequence": 65536,
94
+ "Title": "ExtensionTraining",
95
+ "Url": null,
96
+ "VersionOfUserCustomAction": "1.0.1.0"
97
+ }
98
+ ```
99
+
100
+ === "Text"
101
+
102
+ ```text
103
+ ClientSideComponentId : 34a019f9-6198-4053-a3b6-fbdea9a107fd
104
+ ClientSideComponentProperties: {"sampleTextOne":"One item is selected in the list.", "sampleTextTwo":"This command is always visible."}
105
+ CommandUIExtension : null
106
+ Description : null
107
+ Group : null
108
+ Id : 158cb0d1-8703-4a36-866d-84aed8233bd3
109
+ ImageUrl : null
110
+ Location : ClientSideExtension.ListViewCommandSet.CommandBar
111
+ Name : {158cb0d1-8703-4a36-866d-84aed8233bd3}
112
+ RegistrationId : 100
113
+ RegistrationType : 1
114
+ Rights : {"High":0,"Low":0}
115
+ Scope : Web
116
+ ScriptBlock : null
117
+ ScriptSrc : null
118
+ Sequence : 65536
119
+ Title : ExtensionTraining
120
+ Url : null
121
+ VersionOfUserCustomAction : 1.0.1.0
122
+ ```
123
+
124
+ === "CSV"
125
+
126
+ ```csv
127
+ ClientSideComponentId,ClientSideComponentProperties,CommandUIExtension,Description,Group,Id,ImageUrl,Location,Name,RegistrationId,RegistrationType,Rights,Scope,ScriptBlock,ScriptSrc,Sequence,Title,Url,VersionOfUserCustomAction
128
+ 34a019f9-6198-4053-a3b6-fbdea9a107fd,"{""sampleTextOne"":""One item is selected in the list."", ""sampleTextTwo"":""This command is always visible.""}",,,,158cb0d1-8703-4a36-866d-84aed8233bd3,,ClientSideExtension.ListViewCommandSet.CommandBar,{158cb0d1-8703-4a36-866d-84aed8233bd3},100,1,"{""High"":0,""Low"":0}",Web,,,65536,ExtensionTraining,,1.0.1.0
129
+ ```
130
+
131
+ === "Markdown"
132
+
133
+ ```md
134
+ # spo customaction get --webUrl "https://contoso.sharepoint.com" --clientSideComponentId "34a019f9-6198-4053-a3b6-fbdea9a107fd" --scope "Web"
135
+
136
+ Date: 27/1/2023
137
+
138
+ ## ExtensionTraining (158cb0d1-8703-4a36-866d-84aed8233bd3)
139
+
140
+ Property | Value
141
+ ---------|-------
142
+ ClientSideComponentId | 34a019f9-6198-4053-a3b6-fbdea9a107fd
143
+ ClientSideComponentProperties | {"sampleTextOne":"One item is selected in the list.", "sampleTextTwo":"This command is always visible."}
144
+ CommandUIExtension | null
145
+ Description | null
146
+ Group | null
147
+ Id | 158cb0d1-8703-4a36-866d-84aed8233bd3
148
+ ImageUrl | null
149
+ Location | ClientSideExtension.ListViewCommandSet.CommandBar
150
+ Name | {158cb0d1-8703-4a36-866d-84aed8233bd3}
151
+ RegistrationId | 100
152
+ RegistrationType | 1
153
+ Rights | {"High":0,"Low":0}
154
+ Scope | Web
155
+ ScriptBlock | null
156
+ ScriptSrc | null
157
+ Sequence | 65536
158
+ Title | ExtensionTraining
159
+ Url | null
160
+ VersionOfUserCustomAction | 1.0.1.0
161
+ ```
@@ -13,8 +13,8 @@ m365 spo list add [options]
13
13
  `-t, --title <title>`
14
14
  : Title of the list to add.
15
15
 
16
- `--baseTemplate <baseTemplate>`
17
- : The list definition type on which the list is based. Allowed values `Announcements`, `Contacts`, `CustomGrid`, `DataSources`,`DiscussionBoard`, `DocumentLibrary`, `Events`, `GanttTasks`, `GenericList`, `IssuesTracking`, `Links`, `NoCodeWorkflows`,`PictureLibrary`, `Survey`, `Tasks`, `WebPageLibrary`, `WorkflowHistory`, `WorkflowProcess`, `XmlForm`. Default `GenericList`.
16
+ `--baseTemplate [baseTemplate]`
17
+ : The list definition type on which the list is based. Allowed values `Announcements`, `Contacts`, `CustomGrid`, `DataSources`,`DiscussionBoard`, `DocumentLibrary`, `Events`, `GanttTasks`, `GenericList`, `IssuesTracking`, `Links`, `NoCodeWorkflows`,`PictureLibrary`, `Survey`, `Tasks`, `WebPageLibrary`, `WorkflowHistory`, `WorkflowProcess`, `XmlForm`. Default value is `GenericList`.
18
18
 
19
19
  `-u, --webUrl <webUrl>`
20
20
  : URL of the site where the list should be added.
@@ -59,7 +59,7 @@ m365 spo list set [options]
59
59
  : Property for assigning or retrieving grid editing on the list. Valid values are `true`, `false`.
60
60
 
61
61
  `--draftVersionVisibility [draftVersionVisibility]`
62
- : Value that specifies the minimum permission required to view minor versions and drafts within the list. Allowed values `Reader`, `Author`, `Approver`. Default `Reader`.
62
+ : Value that specifies the minimum permission required to view minor versions and drafts within the list. Allowed values `Reader`, `Author`, `Approver`.
63
63
 
64
64
  `--emailAlias [emailAlias]`
65
65
  : If e-mail notification is enabled, gets or sets the e-mail address to use tonotify to the owner of an item when an assignment has changed or the item has been updated.
@@ -137,7 +137,7 @@ m365 spo list set [options]
137
137
  : Indicates whether this list should be treated as a top level navigation object or not.
138
138
 
139
139
  `--listExperienceOptions [listExperienceOptions]`
140
- : Gets or sets the list experience for the list. Allowed values `Auto`, `NewExperience`, `ClassicExperience`. Default `Auto`.
140
+ : Gets or sets the list experience for the list. Allowed values `Auto`, `NewExperience`, `ClassicExperience`.
141
141
 
142
142
  `--majorVersionLimit [majorVersionLimit]`
143
143
  : Gets or sets the maximum number of major versions allowed for an item in a document library that uses version control with major versions only.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "6.4.0-beta.3946b02",
3
+ "version": "6.4.0-beta.6b65014",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",