@pnp/cli-microsoft365 6.4.0-beta.6b65014 → 6.4.0-beta.8c5ba0e
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +12 -1
- package/dist/m365/aad/commands/user/user-get.js +3 -0
- package/dist/m365/aad/commands/user/user-set.js +3 -0
- package/dist/m365/aad/commands/user/user-signin-list.js +3 -0
- package/dist/m365/planner/commands/roster/roster-member-add.js +3 -0
- package/dist/m365/purview/commands/retentionevent/retentionevent-add.js +138 -0
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +48 -14
- package/dist/m365/purview/commands.js +1 -0
- package/dist/m365/spfx/commands/spfx-doctor.js +43 -29
- package/dist/m365/spo/commands/group/group-member-add.js +54 -95
- package/dist/m365/spo/commands/navigation/navigation-node-add.js +5 -4
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +5 -1
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +118 -0
- package/dist/m365/spo/commands/user/user-ensure.js +105 -0
- package/dist/m365/spo/commands.js +2 -0
- package/dist/utils/aadUser.js +37 -0
- package/dist/utils/md.js +7 -0
- package/dist/utils/spo.js +32 -0
- package/docs/docs/cmd/cli/completion/completion-clink-update.md +4 -4
- package/docs/docs/cmd/onenote/page/page-list.md +1 -1
- package/docs/docs/cmd/outlook/mail/mail-send.md +7 -3
- package/docs/docs/cmd/outlook/message/message-get.md +143 -0
- package/docs/docs/cmd/outlook/message/message-list.md +119 -0
- package/docs/docs/cmd/outlook/message/message-move.md +4 -0
- package/docs/docs/cmd/outlook/report/report-mailactivitycounts.md +40 -0
- package/docs/docs/cmd/outlook/report/report-mailactivityusercounts.md +40 -0
- package/docs/docs/cmd/outlook/report/report-mailactivityuserdetail.md +45 -0
- package/docs/docs/cmd/outlook/report/report-mailappusageappsusercounts.md +43 -0
- package/docs/docs/cmd/outlook/report/report-mailappusageusercounts.md +44 -0
- package/docs/docs/cmd/outlook/report/report-mailappusageuserdetail.md +48 -0
- package/docs/docs/cmd/outlook/report/report-mailappusageversionsusercounts.md +41 -0
- package/docs/docs/cmd/outlook/report/report-mailboxusagedetail.md +49 -0
- package/docs/docs/cmd/outlook/report/report-mailboxusagemailboxcount.md +37 -0
- package/docs/docs/cmd/outlook/report/report-mailboxusagequotastatusmailboxcounts.md +40 -0
- package/docs/docs/cmd/outlook/report/report-mailboxusagestorage.md +36 -0
- package/docs/docs/cmd/outlook/room/room-list.md +81 -0
- package/docs/docs/cmd/outlook/roomlist/roomlist-list.md +58 -0
- package/docs/docs/cmd/planner/plan/plan-add.md +3 -3
- package/docs/docs/cmd/planner/plan/plan-set.md +73 -7
- package/docs/docs/cmd/planner/roster/roster-add.md +16 -1
- package/docs/docs/cmd/planner/task/task-add.md +230 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-add.md +55 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-list.md +55 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-remove.md +4 -0
- package/docs/docs/cmd/planner/task/task-get.md +131 -0
- package/docs/docs/cmd/planner/task/task-list.md +92 -0
- package/docs/docs/cmd/planner/task/task-reference-add.md +46 -0
- package/docs/docs/cmd/planner/task/task-reference-list.md +46 -0
- package/docs/docs/cmd/planner/task/task-reference-remove.md +4 -0
- package/docs/docs/cmd/planner/task/task-remove.md +4 -0
- package/docs/docs/cmd/planner/task/task-set.md +230 -0
- package/docs/docs/cmd/planner/tenant/tenant-settings-list.md +55 -0
- package/docs/docs/cmd/planner/tenant/tenant-settings-set.md +55 -0
- package/docs/docs/cmd/pp/card/card-get.md +2 -2
- package/docs/docs/cmd/pp/card/card-list.md +2 -2
- package/docs/docs/cmd/purview/retentionevent/retentionevent-add.md +149 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.md +7 -7
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.md +12 -0
- package/docs/docs/cmd/skype/report/report-activitycounts.md +38 -0
- package/docs/docs/cmd/skype/report/report-activityusercounts.md +38 -0
- package/docs/docs/cmd/skype/report/report-activityuserdetail.md +67 -0
- package/docs/docs/cmd/spfx/project/project-doctor.md +3 -3
- package/docs/docs/cmd/spfx/project/project-externalize.md +3 -3
- package/docs/docs/cmd/spfx/project/project-permissions-grant.md +21 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.md +3 -3
- package/docs/docs/cmd/spfx/spfx-doctor.md +3 -3
- package/docs/docs/cmd/spo/cdn/cdn-get.md +6 -6
- package/docs/docs/cmd/spo/cdn/cdn-origin-add.md +3 -3
- package/docs/docs/cmd/spo/cdn/cdn-origin-list.md +3 -3
- package/docs/docs/cmd/spo/cdn/cdn-origin-remove.md +3 -3
- package/docs/docs/cmd/spo/cdn/cdn-policy-list.md +3 -3
- package/docs/docs/cmd/spo/cdn/cdn-policy-set.md +3 -3
- package/docs/docs/cmd/spo/cdn/cdn-set.md +3 -3
- package/docs/docs/cmd/spo/externaluser/externaluser-list.md +2 -0
- package/docs/docs/cmd/spo/group/group-member-add.md +22 -0
- package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-get.md +2 -0
- package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-set.md +2 -0
- package/docs/docs/cmd/spo/homesite/homesite-remove.md +2 -0
- package/docs/docs/cmd/spo/homesite/homesite-set.md +2 -0
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-get.md +2 -0
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.md +2 -0
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-set.md +3 -3
- package/docs/docs/cmd/spo/listitem/listitem-add.md +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-batch-add.md +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-set.md +1 -1
- package/docs/docs/cmd/spo/navigation/navigation-node-add.md +2 -2
- package/docs/docs/cmd/spo/navigation/navigation-node-set.md +1 -1
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.md +2 -0
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.md +2 -0
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.md +2 -0
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-list.md +2 -0
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-remove.md +2 -0
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-set.md +3 -3
- package/docs/docs/cmd/spo/site/site-appcatalog-add.md +2 -0
- package/docs/docs/cmd/spo/site/site-appcatalog-remove.md +3 -3
- package/docs/docs/cmd/spo/site/site-commsite-enable.md +2 -0
- package/docs/docs/cmd/spo/site/site-list.md +3 -3
- package/docs/docs/cmd/spo/site/site-remove.md +3 -3
- package/docs/docs/cmd/spo/site/site-rename.md +3 -3
- package/docs/docs/cmd/spo/site/site-set.md +5 -5
- package/docs/docs/cmd/spo/storageentity/storageentity-remove.md +3 -3
- package/docs/docs/cmd/spo/storageentity/storageentity-set.md +3 -3
- package/docs/docs/cmd/spo/tenant/tenant-appcatalog-add.md +3 -3
- package/docs/docs/cmd/spo/tenant/tenant-appcatalogurl-get.md +2 -0
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.md +3 -3
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-get.md +142 -0
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-list.md +2 -0
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-remove.md +3 -3
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-restore.md +3 -3
- package/docs/docs/cmd/spo/tenant/tenant-settings-list.md +2 -0
- package/docs/docs/cmd/spo/tenant/tenant-settings-set.md +2 -0
- package/docs/docs/cmd/spo/term/term-add.md +3 -3
- package/docs/docs/cmd/spo/term/term-get.md +3 -3
- package/docs/docs/cmd/spo/term/term-group-add.md +2 -0
- package/docs/docs/cmd/spo/term/term-group-get.md +2 -0
- package/docs/docs/cmd/spo/term/term-group-list.md +2 -0
- package/docs/docs/cmd/spo/term/term-list.md +3 -1
- package/docs/docs/cmd/spo/term/term-set-add.md +3 -3
- package/docs/docs/cmd/spo/term/term-set-get.md +2 -0
- package/docs/docs/cmd/spo/term/term-set-list.md +2 -0
- package/docs/docs/cmd/spo/theme/theme-apply.md +3 -3
- package/docs/docs/cmd/spo/theme/theme-get.md +2 -0
- package/docs/docs/cmd/spo/theme/theme-list.md +2 -0
- package/docs/docs/cmd/spo/theme/theme-remove.md +2 -0
- package/docs/docs/cmd/spo/theme/theme-set.md +3 -3
- package/docs/docs/cmd/spo/user/user-ensure.md +109 -0
- package/docs/docs/cmd/teams/channel/channel-get.md +1 -1
- package/docs/docs/cmd/teams/message/message-get.md +39 -4
- package/docs/docs/cmd/teams/message/message-list.md +41 -6
- package/docs/docs/cmd/teams/message/message-reply-list.md +39 -4
- package/docs/docs/cmd/teams/messagingsettings/messagingsettings-list.md +20 -2
- package/docs/docs/cmd/teams/messagingsettings/messagingsettings-set.md +8 -8
- package/docs/docs/cmd/teams/report/report-deviceusagedistributionusercounts.md +12 -5
- package/docs/docs/cmd/teams/report/report-deviceusageusercounts.md +13 -6
- package/docs/docs/cmd/teams/report/report-deviceusageuserdetail.md +14 -7
- package/docs/docs/cmd/teams/report/report-directroutingcalls.md +13 -6
- package/docs/docs/cmd/teams/report/report-pstncalls.md +13 -6
- package/docs/docs/cmd/teams/report/report-useractivitycounts.md +13 -6
- package/docs/docs/cmd/teams/report/report-useractivityusercounts.md +13 -6
- package/docs/docs/cmd/teams/report/report-useractivityuserdetail.md +13 -6
- package/docs/docs/cmd/teams/tab/tab-add.md +16 -0
- package/docs/docs/cmd/teams/tab/tab-get.md +17 -0
- package/docs/docs/cmd/teams/tab/tab-list.md +19 -0
- package/docs/docs/cmd/teams/team/team-add.md +77 -8
- package/docs/docs/cmd/teams/team/team-app-list.md +18 -2
- package/docs/docs/cmd/teams/team/team-archive.md +2 -2
- package/docs/docs/cmd/teams/team/team-clone.md +8 -8
- package/docs/docs/cmd/teams/team/team-get.md +34 -4
- package/docs/docs/cmd/teams/team/team-list.md +34 -3
- package/docs/docs/cmd/teams/team/team-remove.md +3 -3
- package/docs/docs/cmd/teams/team/team-set.md +8 -8
- package/docs/docs/cmd/teams/team/team-unarchive.md +3 -2
- package/docs/docs/cmd/teams/user/user-app-add.md +3 -3
- package/docs/docs/cmd/teams/user/user-app-list.md +18 -2
- package/docs/docs/cmd/teams/user/user-app-remove.md +4 -4
- package/docs/docs/cmd/teams/user/user-list.md +21 -4
- package/npm-shrinkwrap.json +277 -192
- package/package.json +13 -13
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
alt="GitHub" />
|
|
16
16
|
</a>
|
|
17
17
|
|
|
18
|
-
<a href="https://discord.
|
|
18
|
+
<a href="https://discord.gg/35HTFJ544b">
|
|
19
19
|
<img src="https://img.shields.io/badge/Discord-Join-7289da?style=flat-square"
|
|
20
20
|
alt="Discord" />
|
|
21
21
|
</a>
|
|
@@ -213,6 +213,17 @@ If you want to get involved with helping us grow the CLI, whether that is sugges
|
|
|
213
213
|
|
|
214
214
|
Checkout our [Wiki](https://github.com/pnp/cli-microsoft365/wiki) for guides on how to contribute to this project.
|
|
215
215
|
|
|
216
|
+
## Need Help?
|
|
217
|
+
|
|
218
|
+
<h4 align="center">
|
|
219
|
+
Join our community
|
|
220
|
+
</h4>
|
|
221
|
+
<p align="center">
|
|
222
|
+
<a href="https://discord.gg/35HTFJ544b">
|
|
223
|
+
<img alt="Discord" src="./docs/docs/images/discord-logo.png" width="100"/>
|
|
224
|
+
</a>
|
|
225
|
+
</p>
|
|
226
|
+
|
|
216
227
|
## Microsoft 365 Platform Community
|
|
217
228
|
|
|
218
229
|
CLI for Microsoft 365 is a [Microsoft 365 Platform Community](https://pnp.github.io) (PnP) project. Microsoft 365 Platform Community is a virtual team consisting of Microsoft employees and community members focused on helping the community make the best use of Microsoft products. CLI for Microsoft 365 is an open-source project not affiliated with Microsoft and not covered by Microsoft support. If you experience any issues using the CLI, please submit an issue in the [issues list](https://github.com/pnp/cli-microsoft365/issues).
|
|
@@ -101,6 +101,9 @@ _AadUserGetCommand_instances = new WeakSet(), _AadUserGetCommand_initTelemetry =
|
|
|
101
101
|
!validation_1.validation.isValidGuid(args.options.id)) {
|
|
102
102
|
return `${args.options.id} is not a valid GUID`;
|
|
103
103
|
}
|
|
104
|
+
if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
|
|
105
|
+
return `${args.options.userName} is not a valid userName`;
|
|
106
|
+
}
|
|
104
107
|
return true;
|
|
105
108
|
}));
|
|
106
109
|
}, _AadUserGetCommand_initOptionSets = function _AadUserGetCommand_initOptionSets() {
|
|
@@ -170,6 +170,9 @@ _AadUserSetCommand_instances = new WeakSet(), _AadUserSetCommand_initTelemetry =
|
|
|
170
170
|
!validation_1.validation.isValidGuid(args.options.objectId)) {
|
|
171
171
|
return `${args.options.objectId} is not a valid GUID`;
|
|
172
172
|
}
|
|
173
|
+
if (args.options.userPrincipalName && !validation_1.validation.isValidUserPrincipalName(args.options.userPrincipalName)) {
|
|
174
|
+
return `${args.options.userPrincipalName} is not a valid userPrincipalName`;
|
|
175
|
+
}
|
|
173
176
|
if (!args.options.resetPassword && ((args.options.currentPassword && !args.options.newPassword) || (args.options.newPassword && !args.options.currentPassword))) {
|
|
174
177
|
return `Specify both currentPassword and newPassword when you want to change your password`;
|
|
175
178
|
}
|
|
@@ -90,6 +90,9 @@ _AadUserSigninListCommand_instances = new WeakSet(), _AadUserSigninListCommand_i
|
|
|
90
90
|
if (args.options.appId && args.options.appDisplayName) {
|
|
91
91
|
return 'Specify either appId or appDisplayName, but not both';
|
|
92
92
|
}
|
|
93
|
+
if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
|
|
94
|
+
return `${args.options.userName} is not a valid userName`;
|
|
95
|
+
}
|
|
93
96
|
if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
|
|
94
97
|
return `${args.options.userId} is not a valid GUID`;
|
|
95
98
|
}
|
|
@@ -106,6 +106,9 @@ _PlannerRosterMemberAddCommand_instances = new WeakSet(), _PlannerRosterMemberAd
|
|
|
106
106
|
if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
|
|
107
107
|
return `${args.options.userId} is not a valid GUID`;
|
|
108
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
|
+
}
|
|
109
112
|
return true;
|
|
110
113
|
}));
|
|
111
114
|
};
|
|
@@ -0,0 +1,138 @@
|
|
|
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 _PurviewRetentionEventAddCommand_instances, _PurviewRetentionEventAddCommand_initOptions, _PurviewRetentionEventAddCommand_initValidators, _PurviewRetentionEventAddCommand_initTelemetry, _PurviewRetentionEventAddCommand_initOptionSets;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
19
|
+
const commands_1 = require("../../commands");
|
|
20
|
+
const accessToken_1 = require("../../../../utils/accessToken");
|
|
21
|
+
const Auth_1 = require("../../../../Auth");
|
|
22
|
+
const request_1 = require("../../../../request");
|
|
23
|
+
const validation_1 = require("../../../../utils/validation");
|
|
24
|
+
const odata_1 = require("../../../../utils/odata");
|
|
25
|
+
class PurviewRetentionEventAddCommand extends GraphCommand_1.default {
|
|
26
|
+
get name() {
|
|
27
|
+
return commands_1.default.RETENTIONEVENT_ADD;
|
|
28
|
+
}
|
|
29
|
+
get description() {
|
|
30
|
+
return 'Create a retention event';
|
|
31
|
+
}
|
|
32
|
+
constructor() {
|
|
33
|
+
super();
|
|
34
|
+
_PurviewRetentionEventAddCommand_instances.add(this);
|
|
35
|
+
__classPrivateFieldGet(this, _PurviewRetentionEventAddCommand_instances, "m", _PurviewRetentionEventAddCommand_initTelemetry).call(this);
|
|
36
|
+
__classPrivateFieldGet(this, _PurviewRetentionEventAddCommand_instances, "m", _PurviewRetentionEventAddCommand_initOptions).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _PurviewRetentionEventAddCommand_instances, "m", _PurviewRetentionEventAddCommand_initValidators).call(this);
|
|
38
|
+
__classPrivateFieldGet(this, _PurviewRetentionEventAddCommand_instances, "m", _PurviewRetentionEventAddCommand_initOptionSets).call(this);
|
|
39
|
+
}
|
|
40
|
+
commandAction(logger, args) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
if (accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken)) {
|
|
43
|
+
this.handleError('This command does not support application permissions.');
|
|
44
|
+
}
|
|
45
|
+
if (this.verbose) {
|
|
46
|
+
logger.logToStderr(`Creating retention event...`);
|
|
47
|
+
}
|
|
48
|
+
const eventQueries = [];
|
|
49
|
+
if (args.options.assetIds) {
|
|
50
|
+
eventQueries.push({ queryType: "files", query: args.options.assetIds });
|
|
51
|
+
}
|
|
52
|
+
if (args.options.keywords) {
|
|
53
|
+
eventQueries.push({ queryType: "messages", query: args.options.keywords });
|
|
54
|
+
}
|
|
55
|
+
const eventTypeId = yield this.getEventTypeId(logger, args);
|
|
56
|
+
const data = {
|
|
57
|
+
'retentionEventType@odata.bind': `https://graph.microsoft.com/beta/security/triggerTypes/retentionEventTypes/${eventTypeId}`,
|
|
58
|
+
displayName: args.options.displayName,
|
|
59
|
+
description: args.options.description,
|
|
60
|
+
eventQueries: eventQueries,
|
|
61
|
+
eventTriggerDateTime: args.options.triggerDateTime
|
|
62
|
+
};
|
|
63
|
+
try {
|
|
64
|
+
const requestOptions = {
|
|
65
|
+
url: `${this.resource}/beta/security/triggers/retentionEvents`,
|
|
66
|
+
headers: {
|
|
67
|
+
accept: 'application/json;odata.metadata=none'
|
|
68
|
+
},
|
|
69
|
+
responseType: 'json',
|
|
70
|
+
data: data
|
|
71
|
+
};
|
|
72
|
+
const res = yield request_1.default.post(requestOptions);
|
|
73
|
+
logger.log(res);
|
|
74
|
+
}
|
|
75
|
+
catch (err) {
|
|
76
|
+
this.handleRejectedODataJsonPromise(err);
|
|
77
|
+
}
|
|
78
|
+
});
|
|
79
|
+
}
|
|
80
|
+
getEventTypeId(logger, args) {
|
|
81
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
if (args.options.eventTypeId) {
|
|
83
|
+
return args.options.eventTypeId;
|
|
84
|
+
}
|
|
85
|
+
if (this.verbose) {
|
|
86
|
+
logger.logToStderr(`Retrieving the event type id for event type ${args.options.eventTypeName}`);
|
|
87
|
+
}
|
|
88
|
+
const items = yield odata_1.odata.getAllItems(`${this.resource}/beta/security/triggerTypes/retentionEventTypes`);
|
|
89
|
+
const eventTypes = items.filter((x) => x.displayName === args.options.eventTypeName);
|
|
90
|
+
if (eventTypes.length === 0) {
|
|
91
|
+
throw `The specified event type '${args.options.eventTypeName}' does not exist.`;
|
|
92
|
+
}
|
|
93
|
+
return eventTypes[0].id;
|
|
94
|
+
});
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
_PurviewRetentionEventAddCommand_instances = new WeakSet(), _PurviewRetentionEventAddCommand_initOptions = function _PurviewRetentionEventAddCommand_initOptions() {
|
|
98
|
+
this.options.unshift({
|
|
99
|
+
option: '-n, --displayName <displayName>'
|
|
100
|
+
}, {
|
|
101
|
+
option: '-i, --eventTypeId [eventTypeId]'
|
|
102
|
+
}, {
|
|
103
|
+
option: '-e, --eventTypeName [eventTypeName]'
|
|
104
|
+
}, {
|
|
105
|
+
option: '-d, --description [description]'
|
|
106
|
+
}, {
|
|
107
|
+
option: '--triggerDateTime [triggerDateTime]'
|
|
108
|
+
}, {
|
|
109
|
+
option: '-a, --assetIds [assetIds]'
|
|
110
|
+
}, {
|
|
111
|
+
option: '-k, --keywords [keywords]'
|
|
112
|
+
});
|
|
113
|
+
}, _PurviewRetentionEventAddCommand_initValidators = function _PurviewRetentionEventAddCommand_initValidators() {
|
|
114
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
115
|
+
if (args.options.triggerDateTime && !validation_1.validation.isValidISODateTime(args.options.triggerDateTime)) {
|
|
116
|
+
return 'The triggerDateTime is not a valid ISO date string';
|
|
117
|
+
}
|
|
118
|
+
if (!args.options.assetIds && !args.options.keywords) {
|
|
119
|
+
return 'Specify assetIds and/or keywords, but at least one.';
|
|
120
|
+
}
|
|
121
|
+
return true;
|
|
122
|
+
}));
|
|
123
|
+
}, _PurviewRetentionEventAddCommand_initTelemetry = function _PurviewRetentionEventAddCommand_initTelemetry() {
|
|
124
|
+
this.telemetry.push((args) => {
|
|
125
|
+
Object.assign(this.telemetryProperties, {
|
|
126
|
+
description: typeof args.options.description !== 'undefined',
|
|
127
|
+
triggerDateTime: typeof args.options.triggerDateTime !== 'undefined',
|
|
128
|
+
eventTypeId: typeof args.options.eventTypeId !== 'undefined',
|
|
129
|
+
eventTypeName: typeof args.options.eventTypeName !== 'undefined',
|
|
130
|
+
assetIds: typeof args.options.assetIds !== 'undefined',
|
|
131
|
+
keywords: typeof args.options.keywords !== 'undefined'
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}, _PurviewRetentionEventAddCommand_initOptionSets = function _PurviewRetentionEventAddCommand_initOptionSets() {
|
|
135
|
+
this.optionSets.push({ options: ['eventTypeId', 'eventTypeName'] });
|
|
136
|
+
};
|
|
137
|
+
module.exports = new PurviewRetentionEventAddCommand();
|
|
138
|
+
//# sourceMappingURL=retentionevent-add.js.map
|
|
@@ -13,13 +13,14 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
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
14
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
15
|
};
|
|
16
|
-
var _PurviewRetentionLabelAddCommand_instances, _PurviewRetentionLabelAddCommand_initTelemetry, _PurviewRetentionLabelAddCommand_initOptions, _PurviewRetentionLabelAddCommand_initValidators;
|
|
16
|
+
var _PurviewRetentionLabelAddCommand_instances, _PurviewRetentionLabelAddCommand_initTelemetry, _PurviewRetentionLabelAddCommand_initOptions, _PurviewRetentionLabelAddCommand_initValidators, _PurviewRetentionLabelAddCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const Auth_1 = require("../../../../Auth");
|
|
19
19
|
const request_1 = require("../../../../request");
|
|
20
20
|
const accessToken_1 = require("../../../../utils/accessToken");
|
|
21
21
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
22
22
|
const commands_1 = require("../../commands");
|
|
23
|
+
const odata_1 = require("../../../../utils/odata");
|
|
23
24
|
class PurviewRetentionLabelAddCommand extends GraphCommand_1.default {
|
|
24
25
|
get name() {
|
|
25
26
|
return commands_1.default.RETENTIONLABEL_ADD;
|
|
@@ -33,6 +34,7 @@ class PurviewRetentionLabelAddCommand extends GraphCommand_1.default {
|
|
|
33
34
|
__classPrivateFieldGet(this, _PurviewRetentionLabelAddCommand_instances, "m", _PurviewRetentionLabelAddCommand_initTelemetry).call(this);
|
|
34
35
|
__classPrivateFieldGet(this, _PurviewRetentionLabelAddCommand_instances, "m", _PurviewRetentionLabelAddCommand_initOptions).call(this);
|
|
35
36
|
__classPrivateFieldGet(this, _PurviewRetentionLabelAddCommand_instances, "m", _PurviewRetentionLabelAddCommand_initValidators).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _PurviewRetentionLabelAddCommand_instances, "m", _PurviewRetentionLabelAddCommand_initOptionSets).call(this);
|
|
36
38
|
}
|
|
37
39
|
commandAction(logger, args) {
|
|
38
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -52,6 +54,10 @@ class PurviewRetentionLabelAddCommand extends GraphCommand_1.default {
|
|
|
52
54
|
},
|
|
53
55
|
defaultRecordBehavior: defaultRecordBehavior
|
|
54
56
|
};
|
|
57
|
+
if (args.options.retentionTrigger === 'dateOfEvent') {
|
|
58
|
+
const eventTypeId = yield this.getEventTypeId(args, logger);
|
|
59
|
+
requestBody['retentionEventType@odata.bind'] = `https://graph.microsoft.com/beta/security/triggerTypes/retentionEventTypes/${eventTypeId}`;
|
|
60
|
+
}
|
|
55
61
|
if (args.options.descriptionForAdmins) {
|
|
56
62
|
if (this.verbose) {
|
|
57
63
|
logger.logToStderr(`Using '${args.options.descriptionForAdmins}' as descriptionForAdmins`);
|
|
@@ -87,6 +93,22 @@ class PurviewRetentionLabelAddCommand extends GraphCommand_1.default {
|
|
|
87
93
|
}
|
|
88
94
|
});
|
|
89
95
|
}
|
|
96
|
+
getEventTypeId(args, logger) {
|
|
97
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
98
|
+
if (args.options.eventTypeId) {
|
|
99
|
+
return args.options.eventTypeId;
|
|
100
|
+
}
|
|
101
|
+
if (this.verbose) {
|
|
102
|
+
logger.logToStderr(`Retrieving the event type id for event type ${args.options.eventTypeName}`);
|
|
103
|
+
}
|
|
104
|
+
const eventTypes = yield odata_1.odata.getAllItems(`${this.resource}/beta/security/triggerTypes/retentionEventTypes`);
|
|
105
|
+
const filteredEventTypes = eventTypes.filter((eventType) => eventType.displayName === args.options.eventTypeName);
|
|
106
|
+
if (filteredEventTypes.length === 0) {
|
|
107
|
+
throw `The specified retention event type '${args.options.eventTypeName}' does not exist.`;
|
|
108
|
+
}
|
|
109
|
+
return filteredEventTypes[0].id;
|
|
110
|
+
});
|
|
111
|
+
}
|
|
90
112
|
}
|
|
91
113
|
_PurviewRetentionLabelAddCommand_instances = new WeakSet(), _PurviewRetentionLabelAddCommand_initTelemetry = function _PurviewRetentionLabelAddCommand_initTelemetry() {
|
|
92
114
|
this.telemetry.push((args) => {
|
|
@@ -95,7 +117,9 @@ _PurviewRetentionLabelAddCommand_instances = new WeakSet(), _PurviewRetentionLab
|
|
|
95
117
|
defaultRecordBehavior: typeof args.options.defaultRecordBehavior !== 'undefined',
|
|
96
118
|
descriptionForUsers: typeof args.options.descriptionForUsers !== 'undefined',
|
|
97
119
|
descriptionForAdmins: typeof args.options.descriptionForAdmins !== 'undefined',
|
|
98
|
-
labelToBeApplied: typeof args.options.labelToBeApplied !== 'undefined'
|
|
120
|
+
labelToBeApplied: typeof args.options.labelToBeApplied !== 'undefined',
|
|
121
|
+
eventTypeId: typeof args.options.eventTypeId !== 'undefined',
|
|
122
|
+
eventTypeName: typeof args.options.eventTypeName !== 'undefined'
|
|
99
123
|
});
|
|
100
124
|
});
|
|
101
125
|
}, _PurviewRetentionLabelAddCommand_initOptions = function _PurviewRetentionLabelAddCommand_initOptions() {
|
|
@@ -103,46 +127,56 @@ _PurviewRetentionLabelAddCommand_instances = new WeakSet(), _PurviewRetentionLab
|
|
|
103
127
|
option: '-n, --displayName <displayName>'
|
|
104
128
|
}, {
|
|
105
129
|
option: '--behaviorDuringRetentionPeriod <behaviorDuringRetentionPeriod>',
|
|
106
|
-
autocomplete:
|
|
130
|
+
autocomplete: PurviewRetentionLabelAddCommand.behaviorDuringRetentionPeriods
|
|
107
131
|
}, {
|
|
108
132
|
option: '--actionAfterRetentionPeriod <actionAfterRetentionPeriod>',
|
|
109
|
-
autocomplete:
|
|
133
|
+
autocomplete: PurviewRetentionLabelAddCommand.actionAfterRetentionPeriods
|
|
110
134
|
}, {
|
|
111
135
|
option: '--retentionDuration <retentionDuration>'
|
|
112
136
|
}, {
|
|
113
137
|
option: '-t, --retentionTrigger [retentionTrigger]',
|
|
114
|
-
autocomplete:
|
|
138
|
+
autocomplete: PurviewRetentionLabelAddCommand.retentionTriggers
|
|
115
139
|
}, {
|
|
116
140
|
option: '--defaultRecordBehavior [defaultRecordBehavior]',
|
|
117
|
-
autocomplete:
|
|
141
|
+
autocomplete: PurviewRetentionLabelAddCommand.defaultRecordBehavior
|
|
118
142
|
}, {
|
|
119
143
|
option: '--descriptionForUsers [descriptionForUsers]'
|
|
120
144
|
}, {
|
|
121
145
|
option: '--descriptionForAdmins [descriptionForAdmins]'
|
|
122
146
|
}, {
|
|
123
147
|
option: '--labelToBeApplied [labelToBeApplied]'
|
|
148
|
+
}, {
|
|
149
|
+
option: '--eventTypeId [eventTypeId]'
|
|
150
|
+
}, {
|
|
151
|
+
option: '--eventTypeName [eventTypeName]'
|
|
124
152
|
});
|
|
125
153
|
}, _PurviewRetentionLabelAddCommand_initValidators = function _PurviewRetentionLabelAddCommand_initValidators() {
|
|
126
154
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
127
155
|
if (isNaN(args.options.retentionDuration)) {
|
|
128
156
|
return `Specified retentionDuration ${args.options.retentionDuration} is not a number`;
|
|
129
157
|
}
|
|
130
|
-
if (
|
|
131
|
-
return `${args.options.behaviorDuringRetentionPeriod} is not a valid behavior of a document with the label. Allowed values are
|
|
158
|
+
if (PurviewRetentionLabelAddCommand.behaviorDuringRetentionPeriods.indexOf(args.options.behaviorDuringRetentionPeriod) === -1) {
|
|
159
|
+
return `${args.options.behaviorDuringRetentionPeriod} is not a valid behavior of a document with the label. Allowed values are ${PurviewRetentionLabelAddCommand.behaviorDuringRetentionPeriods.join(', ')}`;
|
|
132
160
|
}
|
|
133
|
-
if (
|
|
134
|
-
return `${args.options.actionAfterRetentionPeriod} is not a valid action to take on a document with the label. Allowed values are
|
|
161
|
+
if (PurviewRetentionLabelAddCommand.actionAfterRetentionPeriods.indexOf(args.options.actionAfterRetentionPeriod) === -1) {
|
|
162
|
+
return `${args.options.actionAfterRetentionPeriod} is not a valid action to take on a document with the label. Allowed values are ${PurviewRetentionLabelAddCommand.actionAfterRetentionPeriods.join(', ')}`;
|
|
135
163
|
}
|
|
136
164
|
if (args.options.retentionTrigger &&
|
|
137
|
-
|
|
138
|
-
return `${args.options.retentionTrigger} is not a valid action retention duration calculation. Allowed values are
|
|
165
|
+
PurviewRetentionLabelAddCommand.retentionTriggers.indexOf(args.options.retentionTrigger) === -1) {
|
|
166
|
+
return `${args.options.retentionTrigger} is not a valid action retention duration calculation. Allowed values are ${PurviewRetentionLabelAddCommand.retentionTriggers.join(', ')}`;
|
|
139
167
|
}
|
|
140
168
|
if (args.options.defaultRecordBehavior &&
|
|
141
|
-
|
|
142
|
-
return `${args.options.defaultRecordBehavior} is not a valid state of a record label. Allowed values are
|
|
169
|
+
PurviewRetentionLabelAddCommand.defaultRecordBehavior.indexOf(args.options.defaultRecordBehavior) === -1) {
|
|
170
|
+
return `${args.options.defaultRecordBehavior} is not a valid state of a record label. Allowed values are ${PurviewRetentionLabelAddCommand.defaultRecordBehavior.join(', ')}`;
|
|
143
171
|
}
|
|
144
172
|
return true;
|
|
145
173
|
}));
|
|
174
|
+
}, _PurviewRetentionLabelAddCommand_initOptionSets = function _PurviewRetentionLabelAddCommand_initOptionSets() {
|
|
175
|
+
this.optionSets.push({ options: ['eventTypeId', 'eventTypeName'], runsWhen(args) { return args.options.retentionTrigger === 'dateOfEvent'; } });
|
|
146
176
|
};
|
|
177
|
+
PurviewRetentionLabelAddCommand.behaviorDuringRetentionPeriods = ['doNotRetain', 'retain', 'retainAsRecord', 'retainAsRegulatoryRecord'];
|
|
178
|
+
PurviewRetentionLabelAddCommand.actionAfterRetentionPeriods = ['none', 'delete', 'startDispositionReview'];
|
|
179
|
+
PurviewRetentionLabelAddCommand.retentionTriggers = ['dateLabeled', 'dateCreated', 'dateModified', 'dateOfEvent'];
|
|
180
|
+
PurviewRetentionLabelAddCommand.defaultRecordBehavior = ['startLocked', 'startUnlocked'];
|
|
147
181
|
module.exports = new PurviewRetentionLabelAddCommand();
|
|
148
182
|
//# sourceMappingURL=retentionlabel-add.js.map
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
const prefix = 'purview';
|
|
4
4
|
exports.default = {
|
|
5
5
|
AUDITLOG_LIST: `${prefix} auditlog list`,
|
|
6
|
+
RETENTIONEVENT_ADD: `${prefix} retentionevent add`,
|
|
6
7
|
RETENTIONEVENT_GET: `${prefix} retentionevent get`,
|
|
7
8
|
RETENTIONEVENT_LIST: `${prefix} retentionevent list`,
|
|
8
9
|
RETENTIONEVENT_REMOVE: `${prefix} retentionevent remove`,
|
|
@@ -18,8 +18,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
const chalk = require("chalk");
|
|
19
19
|
const child_process = require("child_process");
|
|
20
20
|
const semver_1 = require("semver");
|
|
21
|
-
const AnonymousCommand_1 = require("../../base/AnonymousCommand");
|
|
22
21
|
const commands_1 = require("../commands");
|
|
22
|
+
const base_project_command_1 = require("./project/base-project-command");
|
|
23
23
|
/**
|
|
24
24
|
* Has the particular check passed or failed
|
|
25
25
|
*/
|
|
@@ -64,7 +64,7 @@ var SharePointVersion;
|
|
|
64
64
|
SharePointVersion[SharePointVersion["SPO"] = 4] = "SPO";
|
|
65
65
|
SharePointVersion[SharePointVersion["All"] = 7] = "All";
|
|
66
66
|
})(SharePointVersion || (SharePointVersion = {}));
|
|
67
|
-
class SpfxDoctorCommand extends
|
|
67
|
+
class SpfxDoctorCommand extends base_project_command_1.BaseProjectCommand {
|
|
68
68
|
get allowedOutputs() {
|
|
69
69
|
return ['text'];
|
|
70
70
|
}
|
|
@@ -479,6 +479,7 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
479
479
|
if (!args.options.output) {
|
|
480
480
|
args.options.output = 'text';
|
|
481
481
|
}
|
|
482
|
+
this.projectRootPath = this.getProjectRoot(process.cwd());
|
|
482
483
|
logger.log(' ');
|
|
483
484
|
logger.log('CLI for Microsoft 365 SharePoint Framework doctor');
|
|
484
485
|
logger.log('Verifying configuration of your system for working with the SharePoint Framework');
|
|
@@ -557,9 +558,11 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
557
558
|
});
|
|
558
559
|
}
|
|
559
560
|
checkSharePointFrameworkVersion(spfxVersionRequested, fixes, logger) {
|
|
560
|
-
return this
|
|
561
|
-
|
|
562
|
-
|
|
561
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
562
|
+
let spfxVersionDetected = this.getSPFxVersionFromYoRcFile(logger);
|
|
563
|
+
if (!spfxVersionDetected) {
|
|
564
|
+
spfxVersionDetected = yield this.getPackageVersion('@microsoft/generator-sharepoint', PackageSearchMode.GlobalOnly, HandlePromise.Continue, logger);
|
|
565
|
+
}
|
|
563
566
|
const versionCheck = {
|
|
564
567
|
range: spfxVersionRequested,
|
|
565
568
|
fix: `npm i -g @microsoft/generator-sharepoint@${spfxVersionRequested}`
|
|
@@ -625,39 +628,50 @@ class SpfxDoctorCommand extends AnonymousCommand_1.default {
|
|
|
625
628
|
spVersionStringToEnum(sp) {
|
|
626
629
|
return SharePointVersion[sp.toUpperCase()];
|
|
627
630
|
}
|
|
631
|
+
getSPFxVersionFromYoRcFile(logger) {
|
|
632
|
+
if (this.projectRootPath !== null) {
|
|
633
|
+
const spfxVersion = this.getProjectVersion();
|
|
634
|
+
if (spfxVersion) {
|
|
635
|
+
if (this.debug) {
|
|
636
|
+
logger.logToStderr(`SPFx version retrieved from .yo-rc.json file. Retrieved version: ${spfxVersion}`);
|
|
637
|
+
}
|
|
638
|
+
return spfxVersion;
|
|
639
|
+
}
|
|
640
|
+
}
|
|
641
|
+
return undefined;
|
|
642
|
+
}
|
|
628
643
|
getSharePointFrameworkVersion(logger) {
|
|
629
|
-
return
|
|
630
|
-
|
|
631
|
-
|
|
644
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
645
|
+
let spfxVersion = this.getSPFxVersionFromYoRcFile(logger);
|
|
646
|
+
if (spfxVersion) {
|
|
647
|
+
return spfxVersion;
|
|
632
648
|
}
|
|
633
|
-
|
|
634
|
-
.getPackageVersion('@microsoft/sp-core-library', PackageSearchMode.LocalOnly, HandlePromise.Fail, logger)
|
|
635
|
-
.then((version) => {
|
|
649
|
+
try {
|
|
650
|
+
spfxVersion = yield this.getPackageVersion('@microsoft/sp-core-library', PackageSearchMode.LocalOnly, HandlePromise.Fail, logger);
|
|
636
651
|
if (this.debug) {
|
|
637
|
-
logger.logToStderr(`Found @microsoft/sp-core-library@${
|
|
652
|
+
logger.logToStderr(`Found @microsoft/sp-core-library@${spfxVersion}`);
|
|
638
653
|
}
|
|
639
|
-
return
|
|
640
|
-
}
|
|
641
|
-
|
|
654
|
+
return spfxVersion;
|
|
655
|
+
}
|
|
656
|
+
catch (_a) {
|
|
642
657
|
if (this.debug) {
|
|
643
658
|
logger.logToStderr(`@microsoft/sp-core-library not found. Search for @microsoft/generator-sharepoint local or global...`);
|
|
644
659
|
}
|
|
645
|
-
|
|
646
|
-
|
|
647
|
-
.then((version) => {
|
|
648
|
-
resolve(version);
|
|
649
|
-
})
|
|
650
|
-
.catch((error) => {
|
|
651
|
-
if (this.debug) {
|
|
652
|
-
logger.logToStderr('@microsoft/generator-sharepoint not found');
|
|
653
|
-
}
|
|
654
|
-
if (error && error.indexOf('ENOENT') > -1) {
|
|
655
|
-
reject('npm not found');
|
|
660
|
+
try {
|
|
661
|
+
return yield this.getPackageVersion('@microsoft/generator-sharepoint', PackageSearchMode.LocalAndGlobal, HandlePromise.Fail, logger);
|
|
656
662
|
}
|
|
657
|
-
|
|
658
|
-
|
|
663
|
+
catch (error) {
|
|
664
|
+
if (this.debug) {
|
|
665
|
+
logger.logToStderr('@microsoft/generator-sharepoint not found');
|
|
666
|
+
}
|
|
667
|
+
if (error && error.indexOf('ENOENT') > -1) {
|
|
668
|
+
throw 'npm not found';
|
|
669
|
+
}
|
|
670
|
+
else {
|
|
671
|
+
return '';
|
|
672
|
+
}
|
|
659
673
|
}
|
|
660
|
-
}
|
|
674
|
+
}
|
|
661
675
|
});
|
|
662
676
|
}
|
|
663
677
|
getPackageVersion(packageName, searchMode, handlePromise, logger) {
|