@pnp/cli-microsoft365 6.7.0 → 6.8.0-beta.62006d7

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,102 @@
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 _PlannerRosterPlanListCommand_instances, _PlannerRosterPlanListCommand_initTelemetry, _PlannerRosterPlanListCommand_initOptions, _PlannerRosterPlanListCommand_initValidators, _PlannerRosterPlanListCommand_initOptionSets;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const Auth_1 = require("../../../../Auth");
19
+ const GraphCommand_1 = require("../../../base/GraphCommand");
20
+ const commands_1 = require("../../commands");
21
+ const validation_1 = require("../../../../utils/validation");
22
+ const accessToken_1 = require("../../../../utils/accessToken");
23
+ const odata_1 = require("../../../../utils/odata");
24
+ class PlannerRosterPlanListCommand extends GraphCommand_1.default {
25
+ get name() {
26
+ return commands_1.default.ROSTER_PLAN_LIST;
27
+ }
28
+ get description() {
29
+ return 'Lists all Microsoft Planner Roster plans for a specific user';
30
+ }
31
+ constructor() {
32
+ super();
33
+ _PlannerRosterPlanListCommand_instances.add(this);
34
+ __classPrivateFieldGet(this, _PlannerRosterPlanListCommand_instances, "m", _PlannerRosterPlanListCommand_initTelemetry).call(this);
35
+ __classPrivateFieldGet(this, _PlannerRosterPlanListCommand_instances, "m", _PlannerRosterPlanListCommand_initOptions).call(this);
36
+ __classPrivateFieldGet(this, _PlannerRosterPlanListCommand_instances, "m", _PlannerRosterPlanListCommand_initValidators).call(this);
37
+ __classPrivateFieldGet(this, _PlannerRosterPlanListCommand_instances, "m", _PlannerRosterPlanListCommand_initOptionSets).call(this);
38
+ }
39
+ defaultProperties() {
40
+ return ['id', 'title', 'createdDateTime', 'owner'];
41
+ }
42
+ commandAction(logger, args) {
43
+ return __awaiter(this, void 0, void 0, function* () {
44
+ const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
45
+ if (isAppOnlyAccessToken && !args.options.userId && !args.options.userName) {
46
+ this.handleError(`Specify at least 'userId' or 'userName' when using application permissions.`);
47
+ }
48
+ else if (!isAppOnlyAccessToken && (args.options.userId || args.options.userName)) {
49
+ this.handleError(`The options 'userId' or 'userName' cannot be used when obtaining Microsoft Planner Roster plans using delegated permissions.`);
50
+ }
51
+ if (this.verbose) {
52
+ logger.logToStderr(`Retrieving Microsoft Planner Roster plans for user: ${args.options.userId || args.options.userName || 'current user'}.`);
53
+ }
54
+ let requestUrl = `${this.resource}/beta/`;
55
+ if (args.options.userId || args.options.userName) {
56
+ requestUrl += `users/${args.options.userId || args.options.userName}`;
57
+ }
58
+ else {
59
+ requestUrl += 'me';
60
+ }
61
+ requestUrl += `/planner/rosterPlans`;
62
+ try {
63
+ const items = yield odata_1.odata.getAllItems(requestUrl);
64
+ logger.log(items);
65
+ }
66
+ catch (err) {
67
+ this.handleRejectedODataJsonPromise(err);
68
+ }
69
+ });
70
+ }
71
+ }
72
+ _PlannerRosterPlanListCommand_instances = new WeakSet(), _PlannerRosterPlanListCommand_initTelemetry = function _PlannerRosterPlanListCommand_initTelemetry() {
73
+ this.telemetry.push((args) => {
74
+ Object.assign(this.telemetryProperties, {
75
+ userId: typeof args.options.userId !== 'undefined',
76
+ userName: typeof args.options.userName !== 'undefined'
77
+ });
78
+ });
79
+ }, _PlannerRosterPlanListCommand_initOptions = function _PlannerRosterPlanListCommand_initOptions() {
80
+ this.options.unshift({
81
+ option: '--userId [userId]'
82
+ }, {
83
+ option: '--userName [userName]'
84
+ });
85
+ }, _PlannerRosterPlanListCommand_initValidators = function _PlannerRosterPlanListCommand_initValidators() {
86
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
87
+ if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
88
+ return `${args.options.userId} is not a valid GUID`;
89
+ }
90
+ if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
91
+ return `${args.options.userName} is not a valid user principal name (UPN)`;
92
+ }
93
+ return true;
94
+ }));
95
+ }, _PlannerRosterPlanListCommand_initOptionSets = function _PlannerRosterPlanListCommand_initOptionSets() {
96
+ this.optionSets.push({
97
+ options: ['userId', 'userName'],
98
+ runsWhen: (args) => args.options.userId || args.options.userName
99
+ });
100
+ };
101
+ module.exports = new PlannerRosterPlanListCommand();
102
+ //# sourceMappingURL=roster-plan-list.js.map
@@ -18,6 +18,7 @@ exports.default = {
18
18
  ROSTER_MEMBER_GET: `${prefix} roster member get`,
19
19
  ROSTER_MEMBER_LIST: `${prefix} roster member list`,
20
20
  ROSTER_MEMBER_REMOVE: `${prefix} roster member remove`,
21
+ ROSTER_PLAN_LIST: `${prefix} roster plan list`,
21
22
  ROSTER_REMOVE: `${prefix} roster remove`,
22
23
  TASK_ADD: `${prefix} task add`,
23
24
  TASK_CHECKLISTITEM_ADD: `${prefix} task checklistitem add`,
@@ -418,6 +418,9 @@ _SpoTenantSettingsSetCommand_instances = new WeakSet(), _SpoTenantSettingsSetCom
418
418
  }, {
419
419
  option: '--DisableCustomAppAuthentication [DisableCustomAppAuthentication]',
420
420
  autocomplete: ['true', 'false']
421
+ }, {
422
+ option: '--CommentsOnListItemsDisabled [CommentsOnListItemsDisabled]',
423
+ autocomplete: ['true', 'false']
421
424
  }, {
422
425
  option: '--EnableAzureADB2BIntegration [EnableAzureADB2BIntegration]',
423
426
  autocomplete: ['true', 'false']
@@ -504,6 +507,7 @@ SpoTenantSettingsSetCommand.booleanOptions = [
504
507
  'ShowNGSCDialogForSyncOnODB',
505
508
  'SyncPrivacyProfileProperties',
506
509
  'DisableCustomAppAuthentication',
510
+ 'CommentsOnListItemsDisabled',
507
511
  'EnableAzureADB2BIntegration',
508
512
  'SyncAadB2BManagementPolicy'
509
513
  ];
@@ -0,0 +1,124 @@
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 _TeamsMeetingTranscriptListCommand_instances, _TeamsMeetingTranscriptListCommand_initTelemetry, _TeamsMeetingTranscriptListCommand_initOptions, _TeamsMeetingTranscriptListCommand_initValidators, _TeamsMeetingTranscriptListCommand_initOptionSets;
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ const Auth_1 = require("../../../../Auth");
19
+ const GraphCommand_1 = require("../../../base/GraphCommand");
20
+ const commands_1 = require("../../commands");
21
+ const odata_1 = require("../../../../utils/odata");
22
+ const validation_1 = require("../../../../utils/validation");
23
+ const accessToken_1 = require("../../../../utils/accessToken");
24
+ const aadUser_1 = require("../../../../utils/aadUser");
25
+ class TeamsMeetingTranscriptListCommand extends GraphCommand_1.default {
26
+ get name() {
27
+ return commands_1.default.MEETING_TRANSCRIPT_LIST;
28
+ }
29
+ get description() {
30
+ return 'Lists all transcripts for a given meeting';
31
+ }
32
+ defaultProperties() {
33
+ return ['id', 'createdDateTime'];
34
+ }
35
+ constructor() {
36
+ super();
37
+ _TeamsMeetingTranscriptListCommand_instances.add(this);
38
+ __classPrivateFieldGet(this, _TeamsMeetingTranscriptListCommand_instances, "m", _TeamsMeetingTranscriptListCommand_initTelemetry).call(this);
39
+ __classPrivateFieldGet(this, _TeamsMeetingTranscriptListCommand_instances, "m", _TeamsMeetingTranscriptListCommand_initOptions).call(this);
40
+ __classPrivateFieldGet(this, _TeamsMeetingTranscriptListCommand_instances, "m", _TeamsMeetingTranscriptListCommand_initValidators).call(this);
41
+ __classPrivateFieldGet(this, _TeamsMeetingTranscriptListCommand_instances, "m", _TeamsMeetingTranscriptListCommand_initOptionSets).call(this);
42
+ }
43
+ commandAction(logger, args) {
44
+ return __awaiter(this, void 0, void 0, function* () {
45
+ try {
46
+ const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
47
+ if (this.verbose) {
48
+ logger.logToStderr(`Retrieving transcript list for the given meeting...`);
49
+ }
50
+ let requestUrl = `${this.resource}/beta/`;
51
+ if (isAppOnlyAccessToken) {
52
+ if (!args.options.userId && !args.options.userName && !args.options.email) {
53
+ throw `The option 'userId', 'userName' or 'email' is required when retrieving meeting transcripts list using app only permissions`;
54
+ }
55
+ requestUrl += 'users/';
56
+ if (args.options.userId) {
57
+ requestUrl += args.options.userId;
58
+ }
59
+ else if (args.options.userName) {
60
+ requestUrl += args.options.userName;
61
+ }
62
+ else if (args.options.email) {
63
+ if (this.verbose) {
64
+ logger.logToStderr(`Getting user ID for user with email '${args.options.email}'.`);
65
+ }
66
+ const userId = yield aadUser_1.aadUser.getUserIdByEmail(args.options.email);
67
+ requestUrl += userId;
68
+ }
69
+ }
70
+ else {
71
+ if (args.options.userId || args.options.userName || args.options.email) {
72
+ throw `The options 'userId', 'userName' and 'email' cannot be used while retrieving meeting transcripts using delegated permissions`;
73
+ }
74
+ requestUrl += `me`;
75
+ }
76
+ requestUrl += `/onlineMeetings/${args.options.meetingId}/transcripts`;
77
+ const res = yield odata_1.odata.getAllItems(requestUrl);
78
+ logger.log(res);
79
+ }
80
+ catch (err) {
81
+ this.handleRejectedODataJsonPromise(err);
82
+ }
83
+ });
84
+ }
85
+ }
86
+ _TeamsMeetingTranscriptListCommand_instances = new WeakSet(), _TeamsMeetingTranscriptListCommand_initTelemetry = function _TeamsMeetingTranscriptListCommand_initTelemetry() {
87
+ this.telemetry.push((args) => {
88
+ Object.assign(this.telemetryProperties, {
89
+ userId: typeof args.options.userId !== 'undefined',
90
+ userName: typeof args.options.userName !== 'undefined',
91
+ email: typeof args.options.email !== 'undefined'
92
+ });
93
+ });
94
+ }, _TeamsMeetingTranscriptListCommand_initOptions = function _TeamsMeetingTranscriptListCommand_initOptions() {
95
+ this.options.unshift({
96
+ option: '-u, --userId [userId]'
97
+ }, {
98
+ option: '-n, --userName [userName]'
99
+ }, {
100
+ option: '--email [email]'
101
+ }, {
102
+ option: '-m, --meetingId <meetingId>'
103
+ });
104
+ }, _TeamsMeetingTranscriptListCommand_initValidators = function _TeamsMeetingTranscriptListCommand_initValidators() {
105
+ this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
106
+ if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
107
+ return `${args.options.userId} is not a valid Guid`;
108
+ }
109
+ if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
110
+ return `${args.options.userName} is not a valid user principal name (UPN)`;
111
+ }
112
+ if (args.options.email && !validation_1.validation.isValidUserPrincipalName(args.options.email)) {
113
+ return `${args.options.email} is not a valid email`;
114
+ }
115
+ return true;
116
+ }));
117
+ }, _TeamsMeetingTranscriptListCommand_initOptionSets = function _TeamsMeetingTranscriptListCommand_initOptionSets() {
118
+ this.optionSets.push({
119
+ options: ['userId', 'userName', 'email'],
120
+ runsWhen: (args) => args.options.userId || args.options.userName || args.options.email
121
+ });
122
+ };
123
+ module.exports = new TeamsMeetingTranscriptListCommand();
124
+ //# sourceMappingURL=meeting-transcript-list.js.map
@@ -30,6 +30,7 @@ exports.default = {
30
30
  MEETING_ATTENDANCEREPORT_LIST: `${prefix} meeting attendancereport list`,
31
31
  MEETING_GET: `${prefix} meeting get`,
32
32
  MEETING_LIST: `${prefix} meeting list`,
33
+ MEETING_TRANSCRIPT_LIST: `${prefix} meeting transcript list`,
33
34
  MEMBERSETTINGS_LIST: `${prefix} membersettings list`,
34
35
  MEMBERSETTINGS_SET: `${prefix} membersettings set`,
35
36
  MESSAGE_GET: `${prefix} message get`,
@@ -0,0 +1,109 @@
1
+ # planner roster plan list
2
+
3
+ Lists all Microsoft Planner Roster plans for a specific user
4
+
5
+ ## Usage
6
+
7
+ ```sh
8
+ m365 planner roster plan list [options]
9
+ ```
10
+
11
+ ## Options
12
+
13
+ `--userId [userId]`
14
+ : User's Azure AD ID. Specify either `userId` or `userName` but not both. Specify this option only when using application permissions.
15
+
16
+ `--userName [userName]`
17
+ : User's UPN (user principal name, e.g. johndoe@example.com). Specify either `userId` or `userName` but not both. Specify this option only when using application permissions.
18
+
19
+ --8<-- "docs/cmd/_global.md"
20
+
21
+ ## Remarks
22
+
23
+ !!! attention
24
+ This command is based on an API that is currently in preview and is subject to change once the API reached general availability.
25
+
26
+ ## Examples
27
+
28
+ List all Planner plans contained in a Roster where the current logged in user is member of.
29
+
30
+ ```sh
31
+ m365 planner roster plan list
32
+ ```
33
+
34
+ List all Planner plans contained in a Roster where specific user is member of by its UPN.
35
+
36
+ ```sh
37
+ m365 planner roster plan list --userName john.doe@contoso.com
38
+ ```
39
+
40
+ List all Planner plans contained in a Roster where specific user is member of by its Id.
41
+
42
+ ```sh
43
+ m365 planner roster plan list --userId 59f80e08-24b1-41f8-8586-16765fd830d3
44
+ ```
45
+
46
+ ## Response
47
+
48
+ === "JSON"
49
+
50
+ ```json
51
+ [
52
+ {
53
+ "createdDateTime": "2023-04-06T14:41:49.8676617Z",
54
+ "owner": "59f80e08-24b1-41f8-8586-16765fd830d3",
55
+ "title": "My Planner Plan",
56
+ "creationSource": null,
57
+ "id": "_5GY9MJpZU2vb3DC46CP3MkACr8m",
58
+ "createdBy": {
59
+ "user": {
60
+ "displayName": null,
61
+ "id": "59f80e08-24b1-41f8-8586-16765fd830d3"
62
+ },
63
+ "application": {
64
+ "displayName": null,
65
+ "id": "31359c7f-bd7e-475c-86db-fdb8c937548e"
66
+ }
67
+ },
68
+ "container": {
69
+ "containerId": "_5GY9MJpZU2vb3DC46CP3MkACr8m",
70
+ "type": "unknownFutureValue",
71
+ "url": "https://graph.microsoft.com/beta/planner/rosters/_5GY9MJpZU2vb3DC46CP3MkACr8m"
72
+ },
73
+ "contexts": {},
74
+ "sharedWithContainers": []
75
+ }
76
+ ]
77
+ ```
78
+
79
+ === "Text"
80
+
81
+ ```text
82
+ id title createdDateTime owner
83
+ ---------------------------- --------------- ---------------------------- ------------------------------------
84
+ _5GY9MJpZU2vb3DC46CP3MkACr8m My Planner Plan 2023-04-06T14:41:49.8676617Z 59f80e08-24b1-41f8-8586-16765fd830d3
85
+ ```
86
+
87
+ === "CSV"
88
+
89
+ ```csv
90
+ createdDateTime,owner,title,id
91
+ 2023-04-06T14:41:49.8676617Z,59f80e08-24b1-41f8-8586-16765fd830d3,My Planner Plan,_5GY9MJpZU2vb3DC46CP3MkACr8m
92
+ ```
93
+
94
+ === "Markdown"
95
+
96
+ ```md
97
+ # planner roster plan list --userId "59f80e08-24b1-41f8-8586-16765fd830d3"
98
+
99
+ Date: 4/8/2023
100
+
101
+ ## My Planner Plan (_5GY9MJpZU2vb3DC46CP3MkACr8m)
102
+
103
+ Property | Value
104
+ ---------|-------
105
+ createdDateTime | 2023-04-06T14:41:49.8676617Z
106
+ owner | 59f80e08-24b1-41f8-8586-16765fd830d3
107
+ title | My Planner Plan
108
+ id | \_5GY9MJpZU2vb3DC46CP3MkACr8m
109
+ ```
@@ -33,11 +33,11 @@ If the specified url doesn't refer to an existing site collection, you will get
33
33
  Enable site feature
34
34
 
35
35
  ```sh
36
- m365 spo feature enable --url https://contoso.sharepoint.com/sites/sales --featureId 915c240e-a6cc-49b8-8b2c-0bff8b553ed3 --scope Site
36
+ m365 spo feature enable --webUrl https://contoso.sharepoint.com/sites/sales --id 915c240e-a6cc-49b8-8b2c-0bff8b553ed3 --scope Site
37
37
  ```
38
38
 
39
39
  Enable web feature (with force to overwrite feature with same id)
40
40
 
41
41
  ```sh
42
- m365 spo feature enable --url https://contoso.sharepoint.com/sites/sales --featureId 00bfea71-5932-4f9c-ad71-1557e5751100 --scope Web --force
42
+ m365 spo feature enable --webUrl https://contoso.sharepoint.com/sites/sales --id 00bfea71-5932-4f9c-ad71-1557e5751100 --scope Web --force
43
43
  ```