@pnp/cli-microsoft365 6.7.0-beta.54db310 → 6.7.0-beta.7321771

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 (57) hide show
  1. package/.devcontainer/Dockerfile +1 -1
  2. package/README.md +10 -10
  3. package/dist/Auth.js +75 -4
  4. package/dist/AuthServer.js +2 -1
  5. package/dist/Command.js +56 -7
  6. package/dist/m365/aad/commands/user/user-set.js +145 -30
  7. package/dist/m365/base/AzmgmtCommand.js +11 -0
  8. package/dist/m365/base/PowerAppsCommand.js +11 -0
  9. package/dist/m365/base/PowerPlatformCommand.js +11 -0
  10. package/dist/m365/commands/login.js +17 -1
  11. package/dist/m365/commands/status.js +4 -2
  12. package/dist/m365/flow/commands/run/run-get.js +31 -1
  13. package/dist/m365/spo/commands/file/file-list.js +108 -32
  14. package/dist/m365/spo/commands/folder/folder-list.js +73 -16
  15. package/dist/m365/spo/commands/listitem/listitem-list.js +113 -55
  16. package/dist/m365/spo/commands/site/site-recyclebinitem-clear.js +115 -0
  17. package/dist/m365/spo/commands.js +1 -0
  18. package/dist/request.js +7 -0
  19. package/dist/utils/misc.js +11 -0
  20. package/docs/docs/cmd/aad/user/user-set.md +53 -8
  21. package/docs/docs/cmd/flow/run/run-get.md +110 -9
  22. package/docs/docs/cmd/login.md +5 -2
  23. package/docs/docs/cmd/planner/task/task-add.md +3 -1
  24. package/docs/docs/cmd/planner/task/task-set.md +6 -4
  25. package/docs/docs/cmd/spo/file/file-list.md +87 -2
  26. package/docs/docs/cmd/spo/folder/folder-list.md +36 -1
  27. package/docs/docs/cmd/spo/listitem/listitem-list.md +22 -8
  28. package/docs/docs/cmd/spo/site/site-recyclebinitem-clear.md +45 -0
  29. package/docs/docs/cmd/spo/spo-get.md +12 -0
  30. package/docs/docs/cmd/spo/spo-search.md +16 -3
  31. package/docs/docs/cmd/spo/user/user-ensure.md +1 -2
  32. package/docs/docs/cmd/spo/user/user-get.md +24 -0
  33. package/docs/docs/cmd/spo/user/user-list.md +27 -3
  34. package/docs/docs/cmd/spo/userprofile/userprofile-get.md +21 -0
  35. package/docs/docs/cmd/spo/web/web-add.md +24 -0
  36. package/docs/docs/cmd/spo/web/web-clientsidewebpart-list.md +16 -0
  37. package/docs/docs/cmd/spo/web/web-get.md +124 -0
  38. package/docs/docs/cmd/spo/web/web-installedlanguage-list.md +16 -0
  39. package/docs/docs/cmd/spo/web/web-list.md +16 -0
  40. package/docs/docs/cmd/spo/web/web-retentionlabel-list.md +29 -2
  41. package/docs/docs/cmd/tenant/id/id-get.md +6 -0
  42. package/docs/docs/cmd/tenant/report/report-activeusercounts.md +7 -0
  43. package/docs/docs/cmd/tenant/report/report-activeuserdetail.md +7 -0
  44. package/docs/docs/cmd/tenant/report/report-office365activationcounts.md +7 -0
  45. package/docs/docs/cmd/tenant/report/report-office365activationsusercounts.md +7 -0
  46. package/docs/docs/cmd/tenant/report/report-office365activationsuserdetail.md +7 -0
  47. package/docs/docs/cmd/tenant/report/report-servicesusercounts.md +7 -0
  48. package/docs/docs/cmd/tenant/security/security-alerts-list.md +23 -0
  49. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.md +32 -0
  50. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.md +32 -0
  51. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-get.md +26 -0
  52. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-healthissue-list.md +26 -0
  53. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-get.md +22 -0
  54. package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-message-list.md +22 -0
  55. package/package.json +3 -1
  56. package/dist/m365/spo/commands/file/FilePropertiesCollection.js +0 -3
  57. package/dist/m365/spo/commands/folder/FileFolderCollection.js +0 -3
@@ -18,6 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
18
18
  const Cli_1 = require("../../../../cli/Cli");
19
19
  const request_1 = require("../../../../request");
20
20
  const formatting_1 = require("../../../../utils/formatting");
21
+ const odata_1 = require("../../../../utils/odata");
21
22
  const spo_1 = require("../../../../utils/spo");
22
23
  const urlUtil_1 = require("../../../../utils/urlUtil");
23
24
  const validation_1 = require("../../../../utils/validation");
@@ -41,63 +42,94 @@ class SpoListItemListCommand extends SpoCommand_1.default {
41
42
  }
42
43
  commandAction(logger, args) {
43
44
  return __awaiter(this, void 0, void 0, function* () {
44
- let requestUrl = `${args.options.webUrl}/_api/web`;
45
+ let listApiUrl = `${args.options.webUrl}/_api/web`;
45
46
  if (args.options.listId) {
46
- requestUrl += `/lists(guid'${formatting_1.formatting.encodeQueryParameter(args.options.listId)}')`;
47
+ listApiUrl += `/lists(guid'${formatting_1.formatting.encodeQueryParameter(args.options.listId)}')`;
47
48
  }
48
49
  else if (args.options.listTitle) {
49
- requestUrl += `/lists/getByTitle('${formatting_1.formatting.encodeQueryParameter(args.options.listTitle)}')`;
50
+ listApiUrl += `/lists/getByTitle('${formatting_1.formatting.encodeQueryParameter(args.options.listTitle)}')`;
50
51
  }
51
52
  else if (args.options.listUrl) {
52
53
  const listServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
53
- requestUrl += `/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')`;
54
- }
55
- let formDigestValue = '';
56
- const fieldsArray = args.options.fields ? args.options.fields.split(",")
57
- : (!args.options.output || Cli_1.Cli.shouldTrimOutput(args.options.output)) ? ["Title", "Id"] : [];
58
- const fieldsWithSlash = fieldsArray.filter(item => item.includes('/'));
59
- const fieldsToExpand = fieldsWithSlash.map(e => e.split('/')[0]);
60
- const expandFieldsArray = fieldsToExpand.filter((item, pos) => fieldsToExpand.indexOf(item) === pos);
54
+ listApiUrl += `/GetList('${formatting_1.formatting.encodeQueryParameter(listServerRelativeUrl)}')`;
55
+ }
61
56
  try {
62
- if (args.options.camlQuery) {
63
- if (this.debug) {
64
- logger.logToStderr(`getting request digest for query request`);
57
+ const listItems = args.options.camlQuery
58
+ ? yield this.getItemsUsingCAMLQuery(logger, args.options, listApiUrl)
59
+ : yield this.getItems(logger, args.options, listApiUrl);
60
+ listItems.forEach(v => delete v['ID']);
61
+ logger.log(listItems);
62
+ }
63
+ catch (err) {
64
+ this.handleRejectedODataJsonPromise(err);
65
+ }
66
+ });
67
+ }
68
+ getItems(logger, options, listApiUrl) {
69
+ return __awaiter(this, void 0, void 0, function* () {
70
+ if (this.verbose) {
71
+ logger.logToStderr(`Getting list items`);
72
+ }
73
+ const queryParams = [];
74
+ const fieldsArray = options.fields ? options.fields.split(",")
75
+ : (!options.output || Cli_1.Cli.shouldTrimOutput(options.output)) ? ["Title", "Id"] : [];
76
+ const expandFieldsArray = this.getExpandFieldsArray(fieldsArray);
77
+ const skipTokenId = yield this.getLastItemIdForPage(logger, options, listApiUrl);
78
+ queryParams.push(`$top=${options.pageSize || 5000}`);
79
+ if (options.filter) {
80
+ queryParams.push(`$filter=${encodeURIComponent(options.filter)}`);
81
+ }
82
+ if (expandFieldsArray.length > 0) {
83
+ queryParams.push(`$expand=${expandFieldsArray.join(",")}`);
84
+ }
85
+ if (fieldsArray.length > 0) {
86
+ queryParams.push(`$select=${formatting_1.formatting.encodeQueryParameter(fieldsArray.join(","))}`);
87
+ }
88
+ if (skipTokenId !== undefined) {
89
+ queryParams.push(`$skiptoken=Paged=TRUE%26p_ID=${skipTokenId}`);
90
+ }
91
+ // If skiptoken is not found, then we are past the last page
92
+ if (options.pageNumber && Number(options.pageNumber) > 0 && skipTokenId === undefined) {
93
+ return [];
94
+ }
95
+ if (!options.pageSize) {
96
+ return yield odata_1.odata.getAllItems(`${listApiUrl}/items?${queryParams.join('&')}`);
97
+ }
98
+ else {
99
+ const requestOptions = {
100
+ url: `${listApiUrl}/items?${queryParams.join('&')}`,
101
+ headers: {
102
+ 'accept': 'application/json;odata=nometadata'
103
+ },
104
+ responseType: 'json'
105
+ };
106
+ const listItemCollection = yield request_1.default.get(requestOptions);
107
+ return listItemCollection.value;
108
+ }
109
+ });
110
+ }
111
+ getItemsUsingCAMLQuery(logger, options, listApiUrl) {
112
+ return __awaiter(this, void 0, void 0, function* () {
113
+ const formDigestValue = (yield spo_1.spo.getRequestDigest(options.webUrl)).FormDigestValue;
114
+ if (this.verbose) {
115
+ logger.logToStderr(`Getting list items using CAML query`);
116
+ }
117
+ const items = [];
118
+ let skipTokenId = undefined;
119
+ do {
120
+ const requestBody = {
121
+ "query": {
122
+ "ViewXml": options.camlQuery,
123
+ "AllowIncrementalResults": true
65
124
  }
66
- const res = yield spo_1.spo.getRequestDigest(args.options.webUrl);
67
- formDigestValue = res.FormDigestValue;
68
- }
69
- let res;
70
- if (args.options.pageNumber && Number(args.options.pageNumber) > 0) {
71
- const rowLimit = `$top=${Number(args.options.pageSize) * Number(args.options.pageNumber)}`;
72
- const filter = args.options.filter ? `$filter=${encodeURIComponent(args.options.filter)}` : ``;
73
- const fieldSelect = `?$select=Id&${rowLimit}&${filter}`;
74
- const requestOptions = {
75
- url: `${requestUrl}/items${fieldSelect}`,
76
- headers: {
77
- 'accept': 'application/json;odata=nometadata',
78
- 'X-RequestDigest': formDigestValue
79
- },
80
- responseType: 'json'
125
+ };
126
+ if (skipTokenId !== undefined) {
127
+ requestBody.query.ListItemCollectionPosition = {
128
+ "PagingInfo": `Paged=TRUE&p_ID=${skipTokenId}`
81
129
  };
82
- res = yield request_1.default.get(requestOptions);
83
130
  }
84
- const skipTokenId = (res && res.value && res.value.length && res.value[res.value.length - 1]) ? res.value[res.value.length - 1].Id : 0;
85
- const skipToken = (args.options.pageNumber && Number(args.options.pageNumber) > 0 && skipTokenId > 0) ? `$skiptoken=Paged=TRUE%26p_ID=${res.value[res.value.length - 1].Id}` : ``;
86
- const rowLimit = args.options.pageSize ? `$top=${args.options.pageSize}` : ``;
87
- const filter = args.options.filter ? `$filter=${encodeURIComponent(args.options.filter)}` : ``;
88
- const fieldExpand = expandFieldsArray.length > 0 ? `&$expand=${expandFieldsArray.join(",")}` : ``;
89
- const fieldSelect = fieldsArray.length > 0 ?
90
- `?$select=${formatting_1.formatting.encodeQueryParameter(fieldsArray.join(","))}${fieldExpand}&${rowLimit}&${skipToken}&${filter}` :
91
- `?${rowLimit}&${skipToken}&${filter}`;
92
- const requestBody = args.options.camlQuery ?
93
- {
94
- "query": {
95
- "ViewXml": args.options.camlQuery
96
- }
97
- }
98
- : ``;
99
131
  const requestOptions = {
100
- url: `${requestUrl}/${args.options.camlQuery ? `GetItems` : `items${fieldSelect}`}`,
132
+ url: `${listApiUrl}/GetItems`,
101
133
  headers: {
102
134
  'accept': 'application/json;odata=nometadata',
103
135
  'X-RequestDigest': formDigestValue
@@ -105,13 +137,39 @@ class SpoListItemListCommand extends SpoCommand_1.default {
105
137
  responseType: 'json',
106
138
  data: requestBody
107
139
  };
108
- const listItemInstances = args.options.camlQuery ? yield request_1.default.post(requestOptions) : yield request_1.default.get(requestOptions);
109
- listItemInstances.value.forEach(v => delete v['ID']);
110
- logger.log(listItemInstances.value);
140
+ const listItemInstances = yield request_1.default.post(requestOptions);
141
+ skipTokenId = listItemInstances.value.length > 0 ? listItemInstances.value[listItemInstances.value.length - 1].Id : undefined;
142
+ items.push(...listItemInstances.value);
143
+ } while (skipTokenId !== undefined);
144
+ return items;
145
+ });
146
+ }
147
+ getExpandFieldsArray(fieldsArray) {
148
+ const fieldsWithSlash = fieldsArray.filter(item => item.includes('/'));
149
+ const fieldsToExpand = fieldsWithSlash.map(e => e.split('/')[0]);
150
+ const expandFieldsArray = fieldsToExpand.filter((item, pos) => fieldsToExpand.indexOf(item) === pos);
151
+ return expandFieldsArray;
152
+ }
153
+ getLastItemIdForPage(logger, options, listApiUrl) {
154
+ var _a;
155
+ return __awaiter(this, void 0, void 0, function* () {
156
+ if (!options.pageNumber || Number(options.pageNumber) === 0) {
157
+ return undefined;
111
158
  }
112
- catch (err) {
113
- this.handleRejectedODataJsonPromise(err);
159
+ if (this.verbose) {
160
+ logger.logToStderr(`Getting skipToken Id for page ${options.pageNumber}`);
114
161
  }
162
+ const rowLimit = `$top=${Number(options.pageSize) * Number(options.pageNumber)}`;
163
+ const filter = options.filter ? `$filter=${encodeURIComponent(options.filter)}` : ``;
164
+ const requestOptions = {
165
+ url: `${listApiUrl}/items?$select=Id&${rowLimit}&${filter}`,
166
+ headers: {
167
+ 'accept': 'application/json;odata=nometadata'
168
+ },
169
+ responseType: 'json'
170
+ };
171
+ const response = yield request_1.default.get(requestOptions);
172
+ return (_a = response.value[response.value.length - 1]) === null || _a === void 0 ? void 0 : _a.Id;
115
173
  });
116
174
  }
117
175
  }
@@ -155,16 +213,16 @@ _SpoListItemListCommand_instances = new WeakSet(), _SpoListItemListCommand_initT
155
213
  return isValidSharePointUrl;
156
214
  }
157
215
  if (args.options.camlQuery && args.options.fields) {
158
- return `Specify camlQuery or fields but not both`;
216
+ return `You cannot use the fields-option when specifying a camlQuery`;
159
217
  }
160
218
  if (args.options.camlQuery && args.options.pageSize) {
161
- return `Specify camlQuery or pageSize but not both`;
219
+ return `You cannot use the pageSize-option when specifying a camlQuery`;
162
220
  }
163
221
  if (args.options.camlQuery && args.options.pageNumber) {
164
- return `Specify camlQuery or pageNumber but not both`;
222
+ return `You cannot use the pageNumber-option when specifying a camlQuery`;
165
223
  }
166
224
  if (args.options.pageSize && isNaN(Number(args.options.pageSize))) {
167
- return `pageSize must be numeric`;
225
+ return `pageSize ${args.options.pageSize} must be numeric`;
168
226
  }
169
227
  if (args.options.pageNumber && !args.options.pageSize) {
170
228
  return `pageSize must be specified if pageNumber is specified`;
@@ -0,0 +1,115 @@
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 _SpoSiteRecycleBinItemClearCommand_instances, _SpoSiteRecycleBinItemClearCommand_initTelemetry, _SpoSiteRecycleBinItemClearCommand_initOptions, _SpoSiteRecycleBinItemClearCommand_initValidators;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const Cli_1 = require("../../../../cli/Cli");
19
+ const request_1 = require("../../../../request");
20
+ const validation_1 = require("../../../../utils/validation");
21
+ const SpoCommand_1 = require("../../../base/SpoCommand");
22
+ const commands_1 = require("../../commands");
23
+ class SpoSiteRecycleBinItemClearCommand extends SpoCommand_1.default {
24
+ get name() {
25
+ return commands_1.default.SITE_RECYCLEBINITEM_CLEAR;
26
+ }
27
+ get description() {
28
+ return 'Permanently removes all items in a site recycle bin';
29
+ }
30
+ constructor() {
31
+ super();
32
+ _SpoSiteRecycleBinItemClearCommand_instances.add(this);
33
+ __classPrivateFieldGet(this, _SpoSiteRecycleBinItemClearCommand_instances, "m", _SpoSiteRecycleBinItemClearCommand_initTelemetry).call(this);
34
+ __classPrivateFieldGet(this, _SpoSiteRecycleBinItemClearCommand_instances, "m", _SpoSiteRecycleBinItemClearCommand_initOptions).call(this);
35
+ __classPrivateFieldGet(this, _SpoSiteRecycleBinItemClearCommand_instances, "m", _SpoSiteRecycleBinItemClearCommand_initValidators).call(this);
36
+ }
37
+ commandAction(logger, args) {
38
+ return __awaiter(this, void 0, void 0, function* () {
39
+ if (args.options.confirm) {
40
+ yield this.clearRecycleBin(args, logger);
41
+ }
42
+ else {
43
+ const result = yield Cli_1.Cli.prompt({
44
+ type: 'confirm',
45
+ name: 'continue',
46
+ default: false,
47
+ message: `Are you sure you want to clear the recycle bin of site ${args.options.siteUrl}?`
48
+ });
49
+ if (result.continue) {
50
+ yield this.clearRecycleBin(args, logger);
51
+ }
52
+ }
53
+ });
54
+ }
55
+ clearRecycleBin(args, logger) {
56
+ return __awaiter(this, void 0, void 0, function* () {
57
+ try {
58
+ if (this.verbose) {
59
+ logger.logToStderr(`Permanently removing all items in recycle bin of site ${args.options.siteUrl}...`);
60
+ }
61
+ const requestOptions = {
62
+ headers: {
63
+ accept: 'application/json;odata=nometadata'
64
+ },
65
+ responseType: 'json'
66
+ };
67
+ if (args.options.secondary) {
68
+ if (this.verbose) {
69
+ logger.logToStderr('Removing all items from the second-stage recycle bin');
70
+ }
71
+ requestOptions.url = `${args.options.siteUrl}/_api/site/RecycleBin/DeleteAllSecondStageItems`;
72
+ }
73
+ else {
74
+ if (this.verbose) {
75
+ logger.logToStderr('Removing all items from the first-stage recycle bin');
76
+ }
77
+ requestOptions.url = `${args.options.siteUrl}/_api/web/RecycleBin/DeleteAll`;
78
+ }
79
+ const result = yield request_1.default.post(requestOptions);
80
+ if (result['odata.null'] !== true) {
81
+ throw result;
82
+ }
83
+ }
84
+ catch (err) {
85
+ this.handleRejectedODataJsonPromise(err);
86
+ }
87
+ });
88
+ }
89
+ }
90
+ _SpoSiteRecycleBinItemClearCommand_instances = new WeakSet(), _SpoSiteRecycleBinItemClearCommand_initTelemetry = function _SpoSiteRecycleBinItemClearCommand_initTelemetry() {
91
+ this.telemetry.push((args) => {
92
+ Object.assign(this.telemetryProperties, {
93
+ secondary: !!args.options.secondary,
94
+ confirm: !!args.options.confirm
95
+ });
96
+ });
97
+ }, _SpoSiteRecycleBinItemClearCommand_initOptions = function _SpoSiteRecycleBinItemClearCommand_initOptions() {
98
+ this.options.unshift({
99
+ option: '-u, --siteUrl <siteUrl>'
100
+ }, {
101
+ option: '--secondary'
102
+ }, {
103
+ option: '--confirm'
104
+ });
105
+ }, _SpoSiteRecycleBinItemClearCommand_initValidators = function _SpoSiteRecycleBinItemClearCommand_initValidators() {
106
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
107
+ const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.siteUrl);
108
+ if (isValidSharePointUrl !== true) {
109
+ return isValidSharePointUrl;
110
+ }
111
+ return true;
112
+ }));
113
+ };
114
+ module.exports = new SpoSiteRecycleBinItemClearCommand();
115
+ //# sourceMappingURL=site-recyclebinitem-clear.js.map
@@ -247,6 +247,7 @@ exports.default = {
247
247
  SITE_HUBSITE_THEME_SYNC: `${prefix} site hubsite theme sync`,
248
248
  SITE_LIST: `${prefix} site list`,
249
249
  SITE_INPLACERECORDSMANAGEMENT_SET: `${prefix} site inplacerecordsmanagement set`,
250
+ SITE_RECYCLEBINITEM_CLEAR: `${prefix} site recyclebinitem clear`,
250
251
  SITE_RECYCLEBINITEM_LIST: `${prefix} site recyclebinitem list`,
251
252
  SITE_RECYCLEBINITEM_RESTORE: `${prefix} site recyclebinitem restore`,
252
253
  SITE_REMOVE: `${prefix} site remove`,
package/dist/request.js CHANGED
@@ -123,6 +123,7 @@ class Request {
123
123
  if (!this._logger) {
124
124
  return Promise.reject('Logger not set on the request object');
125
125
  }
126
+ this.updateRequestForCloudType(options, Auth_1.default.service.cloudType);
126
127
  return new Promise((_resolve, _reject) => {
127
128
  (() => {
128
129
  if (options.headers && options.headers['x-anonymous']) {
@@ -181,6 +182,12 @@ class Request {
181
182
  });
182
183
  });
183
184
  }
185
+ updateRequestForCloudType(options, cloudType) {
186
+ const url = new URL(options.url);
187
+ const hostname = `${url.protocol}//${url.hostname}`;
188
+ const cloudUrl = Auth_1.Auth.getEndpointForResource(hostname, cloudType);
189
+ options.url = options.url.replace(hostname, cloudUrl);
190
+ }
184
191
  }
185
192
  exports.default = new Request();
186
193
  //# sourceMappingURL=request.js.map
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.misc = void 0;
4
+ exports.misc = {
5
+ getEnums(en) {
6
+ return Object
7
+ .keys(en)
8
+ .filter(k => isNaN(parseInt(k)));
9
+ }
10
+ };
11
+ //# sourceMappingURL=misc.js.map
@@ -25,17 +25,56 @@ m365 aad user set [options]
25
25
  `--forceChangePasswordNextSignIn`
26
26
  : If specified, the user will have to change his password the next time they log in. Can only be set in combination with `resetPassword`.
27
27
 
28
+ `--forceChangePasswordNextSignInWithMfa`
29
+ : Whether the user should change his/her password on the next login and setup MFA. Can only be set in combination with `resetPassword`.
30
+
28
31
  `--currentPassword [currentPassword]`
29
32
  : Current password of the user that is signed in. If this parameter is set, `newPassword` is mandatory. Can't be combined with `resetPassword`.
30
33
 
31
34
  `--newPassword [newPassword]`
32
35
  : New password to be set. Must be set when specifying either `resetPassword` or `currentPassword`.
33
36
 
37
+ `--displayName [displayName]`
38
+ : The name to display in the address book for the user.
39
+
40
+ `--firstName [firstName]`
41
+ : The given name (first name) of the user. Maximum length is 64 characters.
42
+
43
+ `--lastName [lastName]`
44
+ : The user's surname (family name or last name). Maximum length is 64 characters.
45
+
46
+ `--usageLocation [usageLocation]`
47
+ : A two letter [country code](https://learn.microsoft.com/en-us/partner-center/commercial-marketplace-co-sell-location-codes#country-and-region-codes) (ISO standard 3166). Required for users that will be assigned licenses.
48
+
49
+ `--officeLocation [officeLocation]`
50
+ : The office location in the user's place of business.
51
+
52
+ `--jobTitle [jobTitle]`
53
+ : The user's job title. Maximum length is 128 characters.
54
+
55
+ `--companyName [companyName]`
56
+ : The company name which the user is associated. The maximum length is 64 characters.
57
+
58
+ `--department [department]`
59
+ : The name for the department in which the user works. Maximum length is 64 characters.
60
+
61
+ `--preferredLanguage [preferredLanguage]`
62
+ : The preferred language for the user. Should follow [ISO 639-1 Code](https://learn.microsoft.com/en-us/openspecs/office_standards/ms-oe376/6c085406-a698-4e12-9d4d-c3b0ee3dbc4a). Example: `en-US`.
63
+
64
+ `--managerUserId [managerUserId]`
65
+ : User ID of the user's manager. Specify `managerUserId`, `managerUserName` or `removeManager` but not both.
66
+
67
+ `--managerUserName [managerUserName]`
68
+ : User principal name of the manager. Specify `managerUserId`, `managerUserName` or `removeManager` but not both.
69
+
70
+ `--removeManager`
71
+ : Remove currently set manager. The user will have no manager when this flag is set. Specify `managerUserId`, `managerUserName` or `removeManager` but not both.
72
+
34
73
  --8<-- "docs/cmd/_global.md"
35
74
 
36
75
  ## Remarks
37
76
 
38
- You can update information of a user, either by specifying that user's id (`objectId`) or user name (`userPrincipalName`), but not both.
77
+ This command allows using unknown options.
39
78
 
40
79
  If the user with the specified id or user name doesn't exist, you will get a `Resource 'xyz' does not exist or one of its queried reference-property objects are not present.` error.
41
80
 
@@ -50,7 +89,7 @@ m365 aad user set --objectId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --Department I
50
89
  Update multiple properties of user with name _steve@contoso.onmicrosoft.com_
51
90
 
52
91
  ```sh
53
- m365 aad user set --userPrincipalName steve@contoso.onmicrosoft.com --Department "Sales & Marketing" --CompanyName Contoso
92
+ m365 aad user set --userPrincipalName steve@contoso.onmicrosoft.com --firstName John --lastName Doe --jobTitle "Sales Manager" --companyName Contoso --department Sales --officeLocation "New York"
54
93
  ```
55
94
 
56
95
  Enable user with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_
@@ -65,12 +104,6 @@ Disable user with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_
65
104
  m365 aad user set --objectId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --accountEnabled false
66
105
  ```
67
106
 
68
- Enable user with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_
69
-
70
- ```sh
71
- m365 aad user set --objectId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --accountEnabled true
72
- ```
73
-
74
107
  Reset password of a given user by userPrincipalName and require the user to change the password on the next sign in
75
108
 
76
109
  ```sh
@@ -83,6 +116,18 @@ Change password of the currently logged in user
83
116
  m365 aad user set --objectId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --currentPassword SLBF5gnRtyYc --newPassword 6NLUId79Lc24
84
117
  ```
85
118
 
119
+ Updates a user with a manager
120
+
121
+ ```sh
122
+ m365 aad user set --displayName "John Doe" --userName "john.doe@contoso.com" --managerUserName "adele@contoso.com"
123
+ ```
124
+
125
+ Updates a user by removing its manager
126
+
127
+ ```sh
128
+ m365 aad user set --userName "john.doe@contoso.com" --removeManager
129
+ ```
130
+
86
131
  ## Response
87
132
 
88
133
  The command won't return a response on success.
@@ -19,6 +19,9 @@ m365 flow run get [options]
19
19
  `-e, --environmentName <environmentName>`
20
20
  : The name of the environment where the flow is located
21
21
 
22
+ `--includeTriggerInformation`
23
+ : If specified, include information about the trigger details
24
+
22
25
  --8<-- "docs/cmd/_global.md"
23
26
 
24
27
  ## Remarks
@@ -32,6 +35,8 @@ If the Microsoft Flow with the name you specified doesn't exist, you will get th
32
35
 
33
36
  If the run with the name you specified doesn't exist, you will get the `The provided workflow run name is not valid.` error.
34
37
 
38
+ If the option `includeTriggerInformation` is specified, but the trigger does not contain an outputsLink such as for example with a `Recurrence` trigger, this option will be ignored.
39
+
35
40
  ## Examples
36
41
 
37
42
  Get information about the given run of the specified Power Automate flow
@@ -40,6 +45,11 @@ Get information about the given run of the specified Power Automate flow
40
45
  m365 flow run get --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --flowName 5923cb07-ce1a-4a5c-ab81-257ce820109a --name 08586653536760200319026785874CU62
41
46
  ```
42
47
 
48
+ Get information about the given run of the specified Power Automate flow including trigger information
49
+
50
+ ```sh
51
+ m365 flow run get --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --flowName 5923cb07-ce1a-4a5c-ab81-257ce820109a --name 08586653536760200319026785874CU62 --includeTriggerInformation
52
+ ```
43
53
 
44
54
  ## Response
45
55
 
@@ -61,7 +71,7 @@ m365 flow run get --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5
61
71
  "trigger": {
62
72
  "name": "When_a_new_response_is_submitted",
63
73
  "inputsLink": {
64
- "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",
74
+ "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=",
65
75
  "contentVersion": "6ZrBBE+MJg7IvhMgyJLMmA==",
66
76
  "contentSize": 349,
67
77
  "contentHash": {
@@ -70,7 +80,7 @@ m365 flow run get --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5
70
80
  }
71
81
  },
72
82
  "outputsLink": {
73
- "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",
83
+ "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=",
74
84
  "contentVersion": "Z/4a8tfYygNAR1xpc44iww==",
75
85
  "contentSize": 493,
76
86
  "contentHash": {
@@ -97,17 +107,108 @@ m365 flow run get --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5
97
107
  === "Text"
98
108
 
99
109
  ```text
100
- endTime :
101
- name : 08585329112602833828909892130CU17
102
- startTime : 2022-11-17T14:33:45.2763872Z
103
- status : Running
104
- triggerName: When_a_new_response_is_submitted
110
+ endTime : 2023-03-04T09:05:22.5880202Z
111
+ name : 08585236861638480597867166179CU104
112
+ startTime : 2023-03-04T09:05:21.8066368Z
113
+ status : Succeeded
114
+ triggerName: When_an_email_is_flagged_(V4)
105
115
  ```
106
116
 
107
117
  === "CSV"
108
118
 
109
119
  ```csv
110
120
  name,startTime,endTime,status,triggerName
111
- 08585329112602833828909892130CU17,2022-11-17T14:33:45.2763872Z,,Running,When_a_new_response_is_submitted
121
+ 08585236861638480597867166179CU104,2023-03-04T09:05:21.8066368Z,2023-03-04T09:05:22.5880202Z,Succeeded,When_an_email_is_flagged_(V4)
122
+ ```
123
+
124
+ === "Markdown"
125
+
126
+ ```md
127
+ # flow run get --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --flowName 5923cb07-ce1a-4a5c-ab81-257ce820109a --name 08586653536760200319026785874CU62
128
+
129
+ Date: 04/03/2023
130
+
131
+ ## 08586653536760200319026785874CU62 (/providers/Microsoft.ProcessSimple/environments/Default-d87a7535-dd31-4437-bfe1-95340acd55c5/flows/5923cb07-ce1a-4a5c-ab81-257ce820109a/runs/08586653536760200319026785874CU62)
132
+
133
+ Property | Value
134
+ ---------|-------
135
+ name | 08586653536760200319026785874CU62
136
+ id | /providers/Microsoft.ProcessSimple/environments/Default-e1dd4023-a656-480a-8a0e-c1b1eec51e1d/flows/c3c707b5-fefd-4f7a-a96c-b8e0d5ca3cc1/runs/08585208964855963748594654409CU47
137
+ type | Microsoft.ProcessSimple/environments/flows/runs
138
+ startTime | 2023-03-04T09:05:21.8066368Z
139
+ endTime | 2023-03-04T09:05:22.5880202Z
140
+ status | Succeeded
141
+ triggerName | When\_an\_email\_is\_flagged\_(V4)
142
+ ```
143
+
144
+ ### `includeTriggerInformation` response
145
+
146
+ When using the option `includeTriggerInformation`, the response for the json-output will differ.
147
+
148
+ === "JSON"
149
+
150
+ ```json
151
+ {
152
+ "name": "08585236861638480597867166179CU104",
153
+ "id": "/providers/Microsoft.ProcessSimple/environments/Default-e1dd4023-a656-480a-8a0e-c1b1eec51e1d/flows/24335774-daf6-4183-acb7-f5155c2cd2fe/runs/08585236861638480597867166179CU104",
154
+ "type": "Microsoft.ProcessSimple/environments/flows/runs",
155
+ "properties": {
156
+ "startTime": "2023-03-04T09:05:21.8066368Z",
157
+ "endTime": "2023-03-04T09:05:22.5880202Z",
158
+ "status": "Succeeded",
159
+ "correlation": {
160
+ "clientTrackingId": "08585236861638480598867166179CU131"
161
+ },
162
+ "trigger": {
163
+ "name": "When_an_email_is_flagged_(V4)",
164
+ "inputsLink": {
165
+ "uri": "https://prod-130.westeurope.logic.azure.com:443/workflows/3ebadb794f6641e0b7f4fda131cdfb0b/runs/08585236861638480597867166179CU104/contents/TriggerInputs?api-version=2016-06-01&se=2023-03-04T14%3A00%3A00.0000000Z&sp=%2Fruns%2F08585236861638480597867166179CU104%2Fcontents%2FTriggerInputs%2Fread&sv=1.0&sig=",
166
+ "contentVersion": "2v/VLXFrKV6JvwSdcN7aHg==",
167
+ "contentSize": 343,
168
+ "contentHash": {
169
+ "algorithm": "md5",
170
+ "value": "2v/VLXFrKV6JvwSdcN7aHg=="
171
+ }
172
+ },
173
+ "outputsLink": {
174
+ "uri": "https://prod-130.westeurope.logic.azure.com:443/workflows/3ebadb794f6641e0b7f4fda131cdfb0b/runs/08585236861638480597867166179CU104/contents/TriggerOutputs?api-version=2016-06-01&se=2023-03-04T14%3A00%3A00.0000000Z&sp=%2Fruns%2F08585236861638480597867166179CU104%2Fcontents%2FTriggerOutputs%2Fread&sv=1.0&sig=",
175
+ "contentVersion": "AHZEeWNlQ0bLe48yDmpzrQ==",
176
+ "contentSize": 3478,
177
+ "contentHash": {
178
+ "algorithm": "md5",
179
+ "value": "AHZEeWNlQ0bLe48yDmpzrQ=="
180
+ }
181
+ },
182
+ "startTime": "2023-03-04T09:05:21.6192576Z",
183
+ "endTime": "2023-03-04T09:05:21.7442626Z",
184
+ "scheduledTime": "2023-03-04T09:05:21.573561Z",
185
+ "originHistoryName": "08585236861638480598867166179CU131",
186
+ "correlation": {
187
+ "clientTrackingId": "08585236861638480598867166179CU131"
188
+ },
189
+ "code": "OK",
190
+ "status": "Succeeded"
191
+ }
192
+ },
193
+ "startTime": "2023-03-04T09:05:21.8066368Z",
194
+ "endTime": "2023-03-04T09:05:22.5880202Z",
195
+ "status": "Succeeded",
196
+ "triggerName": "When_an_email_is_flagged_(V4)",
197
+ "triggerInformation": {
198
+ "from": "john@contoso.com",
199
+ "toRecipients": "doe@contoso.com",
200
+ "subject": "Dummy email",
201
+ "body": "<html><head>\r\\\n<meta http-equiv=\"Content-Type\" content=\"text/html; charset=utf-8\"></head><body><p>This is dummy content</p></body></html>",
202
+ "importance": "normal",
203
+ "bodyPreview": "This is dummy content",
204
+ "hasAttachments": false,
205
+ "id": "AAMkADgzN2Q1NThiLTI0NjYtNGIxYS05MDdjLTg1OWQxNzgwZGM2ZgBGAAAAAAC6jQfUzacTSIHqMw2yacnUBwBiOC8xvYmdT6G2E_hLMK5kAAAAAAEMAABiOC8xvYmdT6G2E_hLMK5kAALUqy81AAA=",
206
+ "internetMessageId": "<DB7PR03MB5018879914324FC65695809FE1AD9@DB7PR03MB5018.eurprd03.prod.outlook.com>",
207
+ "conversationId": "AAQkADgzN2Q1NThiLTI0NjYtNGIxYS05MDdjLTg1OWQxNzgwZGM2ZgAQAMqP9zsK8a1CnIYEgHclLTk=",
208
+ "receivedDateTime": "2023-03-01T15:06:57+00:00",
209
+ "isRead": false,
210
+ "attachments": [],
211
+ "isHtml": true
212
+ }
213
+ }
112
214
  ```
113
-