@pnp/cli-microsoft365 6.2.0 → 6.3.0-beta.3f7129c
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/Auth.js +0 -18
- package/dist/m365/file/commands/convert/convert-pdf.js +7 -6
- package/dist/m365/flow/commands/run/run-list.js +55 -3
- package/dist/m365/onenote/commands/notebook/notebook-list.js +2 -16
- package/dist/m365/onenote/commands/page/page-list.js +2 -16
- package/dist/m365/outlook/commands/mail/mail-send.js +3 -2
- package/dist/m365/outlook/commands/message/message-get.js +4 -3
- package/dist/m365/planner/commands/roster/roster-add.js +47 -0
- package/dist/m365/planner/commands/roster/roster-remove.js +88 -0
- package/dist/m365/planner/commands.js +2 -0
- package/dist/m365/spo/commands/navigation/navigation-node-add.js +17 -3
- package/dist/m365/spo/commands/navigation/navigation-node-list.js +4 -7
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +118 -0
- package/dist/m365/spo/commands/site/site-apppermission-add.js +2 -14
- package/dist/m365/spo/commands/site/site-apppermission-get.js +2 -14
- package/dist/m365/spo/commands/site/site-apppermission-list.js +2 -14
- package/dist/m365/spo/commands/site/site-apppermission-remove.js +2 -14
- package/dist/m365/spo/commands/site/site-apppermission-set.js +2 -14
- package/dist/m365/spo/commands/web/web-set.js +11 -4
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/teams/commands/chat/chat-list.js +4 -4
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +5 -5
- package/dist/m365/teams/commands/meeting/meeting-get.js +5 -5
- package/dist/m365/teams/commands/meeting/meeting-list.js +4 -3
- package/dist/utils/accessToken.js +1 -1
- package/dist/utils/spo.js +27 -0
- package/docs/docs/cmd/aad/app/app-list.md +3 -0
- package/docs/docs/cmd/aad/user/user-set.md +1 -1
- package/docs/docs/cmd/flow/run/run-list.md +21 -0
- package/docs/docs/cmd/planner/plan/plan-remove.md +4 -0
- package/docs/docs/cmd/planner/roster/roster-add.md +60 -0
- package/docs/docs/cmd/planner/roster/roster-remove.md +48 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-list.md +2 -2
- package/docs/docs/cmd/spo/listitem/listitem-isrecord.md +2 -2
- package/docs/docs/cmd/spo/navigation/navigation-node-add.md +18 -3
- package/docs/docs/cmd/spo/navigation/navigation-node-list.md +30 -0
- package/docs/docs/cmd/spo/navigation/navigation-node-remove.md +1 -1
- package/docs/docs/cmd/spo/navigation/navigation-node-set.md +59 -0
- package/docs/docs/cmd/spo/web/web-set.md +9 -0
- package/npm-shrinkwrap.json +2 -2
- package/package.json +2 -2
|
@@ -17,6 +17,7 @@ var _SpoSiteAppPermissionAddCommand_instances, _SpoSiteAppPermissionAddCommand_i
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
19
|
const formatting_1 = require("../../../../utils/formatting");
|
|
20
|
+
const spo_1 = require("../../../../utils/spo");
|
|
20
21
|
const validation_1 = require("../../../../utils/validation");
|
|
21
22
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
22
23
|
const commands_1 = require("../../commands");
|
|
@@ -37,19 +38,6 @@ class SpoSiteAppPermissionAddCommand extends GraphCommand_1.default {
|
|
|
37
38
|
__classPrivateFieldGet(this, _SpoSiteAppPermissionAddCommand_instances, "m", _SpoSiteAppPermissionAddCommand_initValidators).call(this);
|
|
38
39
|
__classPrivateFieldGet(this, _SpoSiteAppPermissionAddCommand_instances, "m", _SpoSiteAppPermissionAddCommand_initOptionSets).call(this);
|
|
39
40
|
}
|
|
40
|
-
getSpoSiteId(args) {
|
|
41
|
-
const url = new URL(args.options.siteUrl);
|
|
42
|
-
const requestOptions = {
|
|
43
|
-
url: `${this.resource}/v1.0/sites/${url.hostname}:${url.pathname}`,
|
|
44
|
-
headers: {
|
|
45
|
-
accept: 'application/json;odata.metadata=none'
|
|
46
|
-
},
|
|
47
|
-
responseType: 'json'
|
|
48
|
-
};
|
|
49
|
-
return request_1.default
|
|
50
|
-
.get(requestOptions)
|
|
51
|
-
.then((site) => site.id);
|
|
52
|
-
}
|
|
53
41
|
getAppInfo(args) {
|
|
54
42
|
if (args.options.appId && args.options.appDisplayName) {
|
|
55
43
|
return Promise.resolve({
|
|
@@ -136,7 +124,7 @@ class SpoSiteAppPermissionAddCommand extends GraphCommand_1.default {
|
|
|
136
124
|
commandAction(logger, args) {
|
|
137
125
|
return __awaiter(this, void 0, void 0, function* () {
|
|
138
126
|
try {
|
|
139
|
-
this.siteId = yield
|
|
127
|
+
this.siteId = yield spo_1.spo.getSpoGraphSiteId(args.options.siteUrl);
|
|
140
128
|
const appInfo = yield this.getAppInfo(args);
|
|
141
129
|
let permission = yield this.addPermissions(args, appInfo);
|
|
142
130
|
if (this.roleNeedsElevation(args.options.permission)) {
|
|
@@ -16,6 +16,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _SpoSiteAppPermissionGetCommand_instances, _SpoSiteAppPermissionGetCommand_initOptions, _SpoSiteAppPermissionGetCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
|
+
const spo_1 = require("../../../../utils/spo");
|
|
19
20
|
const validation_1 = require("../../../../utils/validation");
|
|
20
21
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
21
22
|
const commands_1 = require("../../commands");
|
|
@@ -32,19 +33,6 @@ class SpoSiteAppPermissionGetCommand extends GraphCommand_1.default {
|
|
|
32
33
|
__classPrivateFieldGet(this, _SpoSiteAppPermissionGetCommand_instances, "m", _SpoSiteAppPermissionGetCommand_initOptions).call(this);
|
|
33
34
|
__classPrivateFieldGet(this, _SpoSiteAppPermissionGetCommand_instances, "m", _SpoSiteAppPermissionGetCommand_initValidators).call(this);
|
|
34
35
|
}
|
|
35
|
-
getSpoSiteId(args) {
|
|
36
|
-
const url = new URL(args.options.siteUrl);
|
|
37
|
-
const requestOptions = {
|
|
38
|
-
url: `${this.resource}/v1.0/sites/${url.hostname}:${url.pathname}`,
|
|
39
|
-
headers: {
|
|
40
|
-
accept: 'application/json;odata.metadata=none'
|
|
41
|
-
},
|
|
42
|
-
responseType: 'json'
|
|
43
|
-
};
|
|
44
|
-
return request_1.default
|
|
45
|
-
.get(requestOptions)
|
|
46
|
-
.then((site) => site.id);
|
|
47
|
-
}
|
|
48
36
|
getApplicationPermission(args, siteId) {
|
|
49
37
|
const requestOptions = {
|
|
50
38
|
url: `${this.resource}/v1.0/sites/${siteId}/permissions/${args.options.id}`,
|
|
@@ -58,7 +46,7 @@ class SpoSiteAppPermissionGetCommand extends GraphCommand_1.default {
|
|
|
58
46
|
commandAction(logger, args) {
|
|
59
47
|
return __awaiter(this, void 0, void 0, function* () {
|
|
60
48
|
try {
|
|
61
|
-
const siteId = yield
|
|
49
|
+
const siteId = yield spo_1.spo.getSpoGraphSiteId(args.options.siteUrl);
|
|
62
50
|
const permissionObject = yield this.getApplicationPermission(args, siteId);
|
|
63
51
|
const transposed = [];
|
|
64
52
|
permissionObject.grantedToIdentities.forEach((permissionEntity) => {
|
|
@@ -16,6 +16,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _SpoSiteAppPermissionListCommand_instances, _SpoSiteAppPermissionListCommand_initTelemetry, _SpoSiteAppPermissionListCommand_initOptions, _SpoSiteAppPermissionListCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
|
+
const spo_1 = require("../../../../utils/spo");
|
|
19
20
|
const validation_1 = require("../../../../utils/validation");
|
|
20
21
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
21
22
|
const commands_1 = require("../../commands");
|
|
@@ -34,19 +35,6 @@ class SpoSiteAppPermissionListCommand extends GraphCommand_1.default {
|
|
|
34
35
|
__classPrivateFieldGet(this, _SpoSiteAppPermissionListCommand_instances, "m", _SpoSiteAppPermissionListCommand_initOptions).call(this);
|
|
35
36
|
__classPrivateFieldGet(this, _SpoSiteAppPermissionListCommand_instances, "m", _SpoSiteAppPermissionListCommand_initValidators).call(this);
|
|
36
37
|
}
|
|
37
|
-
getSpoSiteId(args) {
|
|
38
|
-
const url = new URL(args.options.siteUrl);
|
|
39
|
-
const requestOptions = {
|
|
40
|
-
url: `${this.resource}/v1.0/sites/${url.hostname}:${url.pathname}`,
|
|
41
|
-
headers: {
|
|
42
|
-
accept: 'application/json;odata.metadata=none'
|
|
43
|
-
},
|
|
44
|
-
responseType: 'json'
|
|
45
|
-
};
|
|
46
|
-
return request_1.default
|
|
47
|
-
.get(requestOptions)
|
|
48
|
-
.then((site) => site.id);
|
|
49
|
-
}
|
|
50
38
|
getFilteredPermissions(args, permissions) {
|
|
51
39
|
let filterProperty = 'displayName';
|
|
52
40
|
let filterValue = args.options.appDisplayName;
|
|
@@ -95,7 +83,7 @@ class SpoSiteAppPermissionListCommand extends GraphCommand_1.default {
|
|
|
95
83
|
commandAction(logger, args) {
|
|
96
84
|
return __awaiter(this, void 0, void 0, function* () {
|
|
97
85
|
try {
|
|
98
|
-
this.siteId = yield
|
|
86
|
+
this.siteId = yield spo_1.spo.getSpoGraphSiteId(args.options.siteUrl);
|
|
99
87
|
const permRes = yield this.getPermissions();
|
|
100
88
|
let permissions = permRes.value;
|
|
101
89
|
if (args.options.appId || args.options.appDisplayName) {
|
|
@@ -17,6 +17,7 @@ var _SpoSiteAppPermissionRemoveCommand_instances, _SpoSiteAppPermissionRemoveCom
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const Cli_1 = require("../../../../cli/Cli");
|
|
19
19
|
const request_1 = require("../../../../request");
|
|
20
|
+
const spo_1 = require("../../../../utils/spo");
|
|
20
21
|
const validation_1 = require("../../../../utils/validation");
|
|
21
22
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
22
23
|
const commands_1 = require("../../commands");
|
|
@@ -36,19 +37,6 @@ class SpoSiteAppPermissionRemoveCommand extends GraphCommand_1.default {
|
|
|
36
37
|
__classPrivateFieldGet(this, _SpoSiteAppPermissionRemoveCommand_instances, "m", _SpoSiteAppPermissionRemoveCommand_initValidators).call(this);
|
|
37
38
|
__classPrivateFieldGet(this, _SpoSiteAppPermissionRemoveCommand_instances, "m", _SpoSiteAppPermissionRemoveCommand_initOptionSets).call(this);
|
|
38
39
|
}
|
|
39
|
-
getSpoSiteId(args) {
|
|
40
|
-
const url = new URL(args.options.siteUrl);
|
|
41
|
-
const requestOptions = {
|
|
42
|
-
url: `${this.resource}/v1.0/sites/${url.hostname}:${url.pathname}`,
|
|
43
|
-
headers: {
|
|
44
|
-
accept: 'application/json;odata.metadata=none'
|
|
45
|
-
},
|
|
46
|
-
responseType: 'json'
|
|
47
|
-
};
|
|
48
|
-
return request_1.default
|
|
49
|
-
.get(requestOptions)
|
|
50
|
-
.then((site) => site.id);
|
|
51
|
-
}
|
|
52
40
|
getPermissions() {
|
|
53
41
|
const requestOptions = {
|
|
54
42
|
url: `${this.resource}/v1.0/sites/${this.siteId}/permissions`,
|
|
@@ -98,7 +86,7 @@ class SpoSiteAppPermissionRemoveCommand extends GraphCommand_1.default {
|
|
|
98
86
|
return __awaiter(this, void 0, void 0, function* () {
|
|
99
87
|
const removeSiteAppPermission = () => __awaiter(this, void 0, void 0, function* () {
|
|
100
88
|
try {
|
|
101
|
-
this.siteId = yield
|
|
89
|
+
this.siteId = yield spo_1.spo.getSpoGraphSiteId(args.options.siteUrl);
|
|
102
90
|
const permissionIdsToRemove = yield this.getPermissionIds(args);
|
|
103
91
|
const tasks = [];
|
|
104
92
|
for (const permissionId of permissionIdsToRemove) {
|
|
@@ -16,6 +16,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _SpoSiteAppPermissionSetCommand_instances, _SpoSiteAppPermissionSetCommand_initTelemetry, _SpoSiteAppPermissionSetCommand_initOptions, _SpoSiteAppPermissionSetCommand_initValidators, _SpoSiteAppPermissionSetCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
|
+
const spo_1 = require("../../../../utils/spo");
|
|
19
20
|
const validation_1 = require("../../../../utils/validation");
|
|
20
21
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
21
22
|
const commands_1 = require("../../commands");
|
|
@@ -36,19 +37,6 @@ class SpoSiteAppPermissionSetCommand extends GraphCommand_1.default {
|
|
|
36
37
|
__classPrivateFieldGet(this, _SpoSiteAppPermissionSetCommand_instances, "m", _SpoSiteAppPermissionSetCommand_initValidators).call(this);
|
|
37
38
|
__classPrivateFieldGet(this, _SpoSiteAppPermissionSetCommand_instances, "m", _SpoSiteAppPermissionSetCommand_initOptionSets).call(this);
|
|
38
39
|
}
|
|
39
|
-
getSpoSiteId(args) {
|
|
40
|
-
const url = new URL(args.options.siteUrl);
|
|
41
|
-
const siteRequestOptions = {
|
|
42
|
-
url: `${this.resource}/v1.0/sites/${url.hostname}:${url.pathname}`,
|
|
43
|
-
headers: {
|
|
44
|
-
accept: 'application/json;odata.metadata=none'
|
|
45
|
-
},
|
|
46
|
-
responseType: 'json'
|
|
47
|
-
};
|
|
48
|
-
return request_1.default
|
|
49
|
-
.get(siteRequestOptions)
|
|
50
|
-
.then((site) => site.id);
|
|
51
|
-
}
|
|
52
40
|
getFilteredPermissions(args, permissions) {
|
|
53
41
|
let filterProperty = 'displayName';
|
|
54
42
|
let filterValue = args.options.appDisplayName;
|
|
@@ -85,7 +73,7 @@ class SpoSiteAppPermissionSetCommand extends GraphCommand_1.default {
|
|
|
85
73
|
commandAction(logger, args) {
|
|
86
74
|
return __awaiter(this, void 0, void 0, function* () {
|
|
87
75
|
try {
|
|
88
|
-
this.siteId = yield
|
|
76
|
+
this.siteId = yield spo_1.spo.getSpoGraphSiteId(args.options.siteUrl);
|
|
89
77
|
const sitePermissionId = yield this.getPermission(args);
|
|
90
78
|
const requestOptions = {
|
|
91
79
|
url: `${this.resource}/v1.0/sites/${this.siteId}/permissions/${sitePermissionId}`,
|
|
@@ -62,6 +62,9 @@ class SpoWebSetCommand extends SpoCommand_1.default {
|
|
|
62
62
|
if (typeof args.options.footerEnabled !== 'undefined') {
|
|
63
63
|
payload.FooterEnabled = args.options.footerEnabled;
|
|
64
64
|
}
|
|
65
|
+
if (typeof args.options.navAudienceTargetingEnabled !== 'undefined') {
|
|
66
|
+
payload.NavAudienceTargetingEnabled = args.options.navAudienceTargetingEnabled;
|
|
67
|
+
}
|
|
65
68
|
if (typeof args.options.searchScope !== 'undefined') {
|
|
66
69
|
const searchScope = args.options.searchScope.toLowerCase();
|
|
67
70
|
payload.SearchScope = SpoWebSetCommand.searchScopeOptions.indexOf(searchScope);
|
|
@@ -96,11 +99,12 @@ _SpoWebSetCommand_instances = new WeakSet(), _SpoWebSetCommand_initTelemetry = f
|
|
|
96
99
|
description: typeof args.options.description !== 'undefined',
|
|
97
100
|
headerEmphasis: typeof args.options.headerEmphasis !== 'undefined',
|
|
98
101
|
headerLayout: typeof args.options.headerLayout !== 'undefined',
|
|
99
|
-
megaMenuEnabled: args.options.megaMenuEnabled,
|
|
102
|
+
megaMenuEnabled: typeof args.options.megaMenuEnabled !== 'undefined',
|
|
100
103
|
siteLogoUrl: typeof args.options.siteLogoUrl !== 'undefined',
|
|
101
104
|
title: typeof args.options.title !== 'undefined',
|
|
102
|
-
quickLaunchEnabled: args.options.quickLaunchEnabled,
|
|
103
|
-
footerEnabled: args.options.footerEnabled,
|
|
105
|
+
quickLaunchEnabled: typeof args.options.quickLaunchEnabled !== 'undefined',
|
|
106
|
+
footerEnabled: typeof args.options.footerEnabled !== 'undefined',
|
|
107
|
+
navAudienceTargetingEnabled: typeof args.options.navAudienceTargetingEnabled !== 'undefined',
|
|
104
108
|
searchScope: args.options.searchScope !== 'undefined'
|
|
105
109
|
});
|
|
106
110
|
this.trackUnknownOptions(this.telemetryProperties, args.options);
|
|
@@ -129,12 +133,15 @@ _SpoWebSetCommand_instances = new WeakSet(), _SpoWebSetCommand_initTelemetry = f
|
|
|
129
133
|
}, {
|
|
130
134
|
option: '--footerEnabled [footerEnabled]',
|
|
131
135
|
autocomplete: ['true', 'false']
|
|
136
|
+
}, {
|
|
137
|
+
option: '--navAudienceTargetingEnabled [navAudienceTargetingEnabled]',
|
|
138
|
+
autocomplete: ['true', 'false']
|
|
132
139
|
}, {
|
|
133
140
|
option: '--searchScope [searchScope]',
|
|
134
141
|
autocomplete: SpoWebSetCommand.searchScopeOptions
|
|
135
142
|
});
|
|
136
143
|
}, _SpoWebSetCommand_initTypes = function _SpoWebSetCommand_initTypes() {
|
|
137
|
-
this.types.boolean.push('megaMenuEnabled', 'footerEnabled', 'quickLaunchEnabled');
|
|
144
|
+
this.types.boolean.push('megaMenuEnabled', 'footerEnabled', 'quickLaunchEnabled', 'navAudienceTargetingEnabled');
|
|
138
145
|
}, _SpoWebSetCommand_initValidators = function _SpoWebSetCommand_initValidators() {
|
|
139
146
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
140
147
|
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.url);
|
|
@@ -167,6 +167,7 @@ exports.default = {
|
|
|
167
167
|
NAVIGATION_NODE_ADD: `${prefix} navigation node add`,
|
|
168
168
|
NAVIGATION_NODE_LIST: `${prefix} navigation node list`,
|
|
169
169
|
NAVIGATION_NODE_REMOVE: `${prefix} navigation node remove`,
|
|
170
|
+
NAVIGATION_NODE_SET: `${prefix} navigation node set`,
|
|
170
171
|
ORGASSETSLIBRARY_ADD: `${prefix} orgassetslibrary add`,
|
|
171
172
|
ORGASSETSLIBRARY_LIST: `${prefix} orgassetslibrary list`,
|
|
172
173
|
ORGASSETSLIBRARY_REMOVE: `${prefix} orgassetslibrary remove`,
|
|
@@ -41,14 +41,14 @@ class TeamsChatListCommand extends GraphCommand_1.default {
|
|
|
41
41
|
}
|
|
42
42
|
commandAction(logger, args) {
|
|
43
43
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
|
-
const
|
|
45
|
-
if (
|
|
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
46
|
throw `The option 'userId' or 'userName' is required when obtaining chats using app only permissions`;
|
|
47
47
|
}
|
|
48
|
-
else if (!
|
|
48
|
+
else if (!isAppOnlyAccessToken && (args.options.userId || args.options.userName)) {
|
|
49
49
|
throw `The options 'userId' or 'userName' cannot be used when obtaining chats using delegated permissions`;
|
|
50
50
|
}
|
|
51
|
-
let requestUrl = `${this.resource}/v1.0/${!
|
|
51
|
+
let requestUrl = `${this.resource}/v1.0/${!isAppOnlyAccessToken ? 'me' : `users/${args.options.userId || args.options.userName}`}/chats`;
|
|
52
52
|
if (args.options.type) {
|
|
53
53
|
requestUrl += `?$filter=chatType eq '${args.options.type}'`;
|
|
54
54
|
}
|
|
@@ -42,19 +42,19 @@ class TeamsMeetingAttendancereportListCommand extends GraphCommand_1.default {
|
|
|
42
42
|
}
|
|
43
43
|
commandAction(logger, args) {
|
|
44
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
-
const
|
|
46
|
-
if (
|
|
45
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
46
|
+
if (isAppOnlyAccessToken && !args.options.userId && !args.options.userName && !args.options.email) {
|
|
47
47
|
this.handleError(`The option 'userId', 'userName' or 'email' is required when retrieving meeting attendance report using app only permissions`);
|
|
48
48
|
}
|
|
49
|
-
else if (!
|
|
49
|
+
else if (!isAppOnlyAccessToken && (args.options.userId || args.options.userName || args.options.email)) {
|
|
50
50
|
this.handleError(`The options 'userId', 'userName' and 'email' cannot be used when retrieving meeting attendance reports using delegated permissions`);
|
|
51
51
|
}
|
|
52
52
|
try {
|
|
53
53
|
if (this.verbose) {
|
|
54
|
-
logger.logToStderr(`Retrieving attendance report for ${
|
|
54
|
+
logger.logToStderr(`Retrieving attendance report for ${isAppOnlyAccessToken ? 'specific user' : 'currently logged in user'}`);
|
|
55
55
|
}
|
|
56
56
|
let requestUrl = `${this.resource}/v1.0/`;
|
|
57
|
-
if (
|
|
57
|
+
if (isAppOnlyAccessToken) {
|
|
58
58
|
requestUrl += 'users/';
|
|
59
59
|
if (args.options.userId) {
|
|
60
60
|
requestUrl += args.options.userId;
|
|
@@ -53,23 +53,23 @@ class TeamsMeetingGetCommand extends GraphCommand_1.default {
|
|
|
53
53
|
}
|
|
54
54
|
commandAction(logger, args) {
|
|
55
55
|
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
-
const
|
|
57
|
-
if (
|
|
56
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
57
|
+
if (isAppOnlyAccessToken) {
|
|
58
58
|
if (!args.options.userId && !args.options.userName && !args.options.email) {
|
|
59
59
|
this.handleError(`The option 'userId', 'userName' or 'email' is required when retrieving meetings using app only permissions`);
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
else {
|
|
63
|
-
if (!
|
|
63
|
+
if (!isAppOnlyAccessToken && (args.options.userId || args.options.userName || args.options.email)) {
|
|
64
64
|
this.handleError(`The options 'userId', 'userName' and 'email' cannot be used when retrieving meetings using delegated permissions`);
|
|
65
65
|
}
|
|
66
66
|
}
|
|
67
67
|
if (this.verbose) {
|
|
68
|
-
logger.logToStderr(`Retrieving meeting for ${
|
|
68
|
+
logger.logToStderr(`Retrieving meeting for ${isAppOnlyAccessToken ? 'specific user' : 'currently logged in user'}`);
|
|
69
69
|
}
|
|
70
70
|
try {
|
|
71
71
|
let requestUrl = `${this.resource}/v1.0/`;
|
|
72
|
-
if (
|
|
72
|
+
if (isAppOnlyAccessToken) {
|
|
73
73
|
requestUrl += 'users/';
|
|
74
74
|
if (args.options.userId) {
|
|
75
75
|
requestUrl += args.options.userId;
|
|
@@ -22,6 +22,7 @@ const commands_1 = require("../../commands");
|
|
|
22
22
|
const odata_1 = require("../../../../utils/odata");
|
|
23
23
|
const validation_1 = require("../../../../utils/validation");
|
|
24
24
|
const AadUserGetCommand = require("../../../aad/commands/user/user-get");
|
|
25
|
+
const accessToken_1 = require("../../../../utils/accessToken");
|
|
25
26
|
class TeamsMeetingListCommand extends GraphCommand_1.default {
|
|
26
27
|
get name() {
|
|
27
28
|
return commands_1.default.MEETING_LIST;
|
|
@@ -42,12 +43,12 @@ class TeamsMeetingListCommand extends GraphCommand_1.default {
|
|
|
42
43
|
commandAction(logger, args) {
|
|
43
44
|
return __awaiter(this, void 0, void 0, function* () {
|
|
44
45
|
try {
|
|
45
|
-
const
|
|
46
|
+
const isAppOnlyAccessToken = accessToken_1.accessToken.isAppOnlyAccessToken(Auth_1.default.service.accessTokens[this.resource].accessToken);
|
|
46
47
|
if (this.verbose) {
|
|
47
|
-
logger.logToStderr(`Retrieving meetings for ${
|
|
48
|
+
logger.logToStderr(`Retrieving meetings for ${isAppOnlyAccessToken ? 'specific user' : 'currently logged in user'}`);
|
|
48
49
|
}
|
|
49
50
|
let requestUrl = `${this.resource}/v1.0/`;
|
|
50
|
-
if (
|
|
51
|
+
if (isAppOnlyAccessToken) {
|
|
51
52
|
if (!args.options.userId && !args.options.userName && !args.options.email) {
|
|
52
53
|
throw `The option 'userId', 'userName' or 'email' is required when retrieving meetings using app only permissions`;
|
|
53
54
|
}
|
|
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.accessToken = void 0;
|
|
4
4
|
exports.accessToken = {
|
|
5
5
|
isAppOnlyAccessToken(accessToken) {
|
|
6
|
-
let isAppOnlyAccessToken
|
|
6
|
+
let isAppOnlyAccessToken;
|
|
7
7
|
if (!accessToken || accessToken.length === 0) {
|
|
8
8
|
return isAppOnlyAccessToken;
|
|
9
9
|
}
|
package/dist/utils/spo.js
CHANGED
|
@@ -1,4 +1,13 @@
|
|
|
1
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
|
+
};
|
|
2
11
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
12
|
exports.spo = void 0;
|
|
4
13
|
const url = require("url");
|
|
@@ -237,6 +246,24 @@ exports.spo = {
|
|
|
237
246
|
});
|
|
238
247
|
});
|
|
239
248
|
},
|
|
249
|
+
/**
|
|
250
|
+
* Returns the Graph id of a site
|
|
251
|
+
* @param webUrl web url e.g. https://contoso.sharepoint.com/sites/site1
|
|
252
|
+
*/
|
|
253
|
+
getSpoGraphSiteId(webUrl) {
|
|
254
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
255
|
+
const url = new URL(webUrl);
|
|
256
|
+
const requestOptions = {
|
|
257
|
+
url: `https://graph.microsoft.com/v1.0/sites/${url.hostname}:${url.pathname}?$select=id`,
|
|
258
|
+
headers: {
|
|
259
|
+
'accept': 'application/json;odata.metadata=none'
|
|
260
|
+
},
|
|
261
|
+
responseType: 'json'
|
|
262
|
+
};
|
|
263
|
+
const result = yield request_1.default.get(requestOptions);
|
|
264
|
+
return result.id;
|
|
265
|
+
});
|
|
266
|
+
},
|
|
240
267
|
/**
|
|
241
268
|
* Ensures the folder path exists
|
|
242
269
|
* @param webFullUrl web full url e.g. https://contoso.sharepoint.com/sites/site1
|
|
@@ -23,6 +23,7 @@ m365 aad app list
|
|
|
23
23
|
## Response
|
|
24
24
|
|
|
25
25
|
=== "JSON"
|
|
26
|
+
|
|
26
27
|
```json
|
|
27
28
|
[
|
|
28
29
|
{
|
|
@@ -136,6 +137,7 @@ m365 aad app list
|
|
|
136
137
|
```
|
|
137
138
|
|
|
138
139
|
=== "Text"
|
|
140
|
+
|
|
139
141
|
```text
|
|
140
142
|
appId id displayName signInAudience
|
|
141
143
|
------------------------------------ ------------------------------------ ----------------------------------------------------------------------- ----------------------------------
|
|
@@ -143,6 +145,7 @@ m365 aad app list
|
|
|
143
145
|
```
|
|
144
146
|
|
|
145
147
|
=== "CSV"
|
|
148
|
+
|
|
146
149
|
```csv
|
|
147
150
|
appId,id,displayName,signInAudience
|
|
148
151
|
61ed4fab-a861-4307-bb87-a6a53dbe39f5,ff2798f7-1c7a-4607-8a7b-3d5e0c18c756,TestAppPermissions,AzureADMyOrg
|
|
@@ -83,6 +83,6 @@ Change password of the currently logged in user
|
|
|
83
83
|
m365 aad user set --objectId 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --currentPassword SLBF5gnRtyYc --newPassword 6NLUId79Lc24
|
|
84
84
|
```
|
|
85
85
|
|
|
86
|
-
|
|
86
|
+
## Response
|
|
87
87
|
|
|
88
88
|
The command won't return a response on success.
|
|
@@ -16,6 +16,15 @@ m365 flow run list [options]
|
|
|
16
16
|
`-e, --environmentName <environmentName>`
|
|
17
17
|
: The name of the environment to which the flow belongs
|
|
18
18
|
|
|
19
|
+
`--status [status]`
|
|
20
|
+
: Filter the results to only flow runs with a given status: `Succeeded`, `Running`, `Failed` or `Cancelled`. By default all flow runs are listed.
|
|
21
|
+
|
|
22
|
+
`--triggerStartTime [triggerStartTime]`
|
|
23
|
+
: Time indicating the inclusive start 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).
|
|
24
|
+
|
|
25
|
+
`--triggerEndTime [triggerEndTime]`
|
|
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
|
+
|
|
19
28
|
--8<-- "docs/cmd/_global.md"
|
|
20
29
|
|
|
21
30
|
## Remarks
|
|
@@ -35,6 +44,18 @@ List runs of the specified Microsoft Flow
|
|
|
35
44
|
m365 flow run list --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --flowName 5923cb07-ce1a-4a5c-ab81-257ce820109a
|
|
36
45
|
```
|
|
37
46
|
|
|
47
|
+
List runs of the specified Microsoft Flow with a specific status
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
m365 flow run list --environmentName Default-d87a7535-dd31-4437-bfe1-95340acd55c5 --flowName 5923cb07-ce1a-4a5c-ab81-257ce820109a --status Running
|
|
51
|
+
```
|
|
52
|
+
|
|
53
|
+
List runs of the specified Microsoft Flow between a specific time range
|
|
54
|
+
|
|
55
|
+
```sh
|
|
56
|
+
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
|
+
```
|
|
58
|
+
|
|
38
59
|
## Response
|
|
39
60
|
|
|
40
61
|
### Standard response
|
|
@@ -27,6 +27,10 @@ m365 planner plan remove [options]
|
|
|
27
27
|
|
|
28
28
|
--8<-- "docs/cmd/_global.md"
|
|
29
29
|
|
|
30
|
+
## Remarks
|
|
31
|
+
|
|
32
|
+
If you wish to delete a Planner plan contained within a Planner Roster, you'll have to remove the roster using [planner roster remove](../roster/roster-remove.md).
|
|
33
|
+
|
|
30
34
|
## Examples
|
|
31
35
|
|
|
32
36
|
Removes the Microsoft Planner plan by ID
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
# planner roster add
|
|
2
|
+
|
|
3
|
+
Creates a new Microsoft Planner Roster
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 planner roster add [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
--8<-- "docs/cmd/_global.md"
|
|
14
|
+
|
|
15
|
+
## Remarks
|
|
16
|
+
|
|
17
|
+
!!! attention
|
|
18
|
+
The Roster will be automatically deleted when it doesn't contain a plan 24 hours after its creation. Membership information will be completely erased within 30 days of this deletion.
|
|
19
|
+
|
|
20
|
+
!!! attention
|
|
21
|
+
This command is based on an API that is currently in preview and is subject to change once the API reached general availability.
|
|
22
|
+
|
|
23
|
+
!!! important
|
|
24
|
+
To be able to create a new Roster, the Planner Roster creation tenant setting should be enabled. Use the [planner tenant settings list](../tenant/tenant-settings-list.md) command to check if this setting is enabled for your tenant.
|
|
25
|
+
|
|
26
|
+
## Examples
|
|
27
|
+
|
|
28
|
+
Creates a new Microsoft Planner Roster
|
|
29
|
+
|
|
30
|
+
```sh
|
|
31
|
+
m365 planner roster add
|
|
32
|
+
```
|
|
33
|
+
|
|
34
|
+
## Response
|
|
35
|
+
|
|
36
|
+
=== "JSON"
|
|
37
|
+
|
|
38
|
+
```json
|
|
39
|
+
{
|
|
40
|
+
"id": "e6fmvM_yi0OJgvmepE5uj5cAE6qX",
|
|
41
|
+
"assignedSensitivityLabel": null
|
|
42
|
+
}
|
|
43
|
+
```
|
|
44
|
+
|
|
45
|
+
=== "Text"
|
|
46
|
+
|
|
47
|
+
```text
|
|
48
|
+
assignedSensitivityLabel: null
|
|
49
|
+
id : e6fmvM_yi0OJgvmepE5uj5cAE6qX
|
|
50
|
+
```
|
|
51
|
+
|
|
52
|
+
=== "CSV"
|
|
53
|
+
|
|
54
|
+
```csv
|
|
55
|
+
id,assignedSensitivityLabel
|
|
56
|
+
e6fmvM_yi0OJgvmepE5uj5cAE6qX,
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
## Additional information
|
|
60
|
+
Rosters are a new type of container for Microsoft Planner plans. This enables users to create a Planner plan without the need to create a new Microsoft 365 group (with a mailbox, SharePoint site, ...). Access to Roster-contained plans is controlled by the members on the Roster. A Planner Roster can contain only 1 plan.
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
# planner roster remove
|
|
2
|
+
|
|
3
|
+
Removes a Microsoft Planner Roster
|
|
4
|
+
|
|
5
|
+
## Usage
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
m365 planner roster remove [options]
|
|
9
|
+
```
|
|
10
|
+
|
|
11
|
+
## Options
|
|
12
|
+
|
|
13
|
+
`--id <id>`
|
|
14
|
+
: ID of the Planner Roster.
|
|
15
|
+
|
|
16
|
+
`--confirm`
|
|
17
|
+
: Don't prompt for confirmation.
|
|
18
|
+
|
|
19
|
+
--8<-- "docs/cmd/_global.md"
|
|
20
|
+
|
|
21
|
+
## Remarks
|
|
22
|
+
|
|
23
|
+
!!! attention
|
|
24
|
+
Deleting a Planner Roster will also delete the plan within the Roster.
|
|
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
|
+
Removes a Planner Roster
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
m365 planner roster remove --id tYqYlNd6eECmsNhN_fcq85cAGAnd
|
|
35
|
+
```
|
|
36
|
+
|
|
37
|
+
Removes a Planner Roster without confirmation prompt
|
|
38
|
+
|
|
39
|
+
```sh
|
|
40
|
+
m365 planner roster remove --id tYqYlNd6eECmsNhN_fcq85cAGAnd --confirm
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Response
|
|
44
|
+
|
|
45
|
+
The command won't return a response on success.
|
|
46
|
+
|
|
47
|
+
## Additional information
|
|
48
|
+
Rosters are a new type of container for Microsoft Planner plans. This enables users to create a Planner plan without the need to create a new Microsoft 365 group (with a mailbox, SharePoint site, ...). Access to Roster-contained plans is controlled by the members on the Roster. A Planner Roster can contain only 1 plan.
|
|
@@ -14,10 +14,10 @@ m365 spo listitem attachment list [options]
|
|
|
14
14
|
URL of the site from which the item should be retrieved
|
|
15
15
|
|
|
16
16
|
`--listId [listId]`
|
|
17
|
-
: ID of the list where the item should be
|
|
17
|
+
: ID of the list where the item should be retrieved. Specify either `listTitle`, `listId` or `listUrl`
|
|
18
18
|
|
|
19
19
|
`--listTitle [listTitle]`
|
|
20
|
-
: Title of the list where the item should be
|
|
20
|
+
: Title of the list where the item should be retrieved. Specify either `listTitle`, `listId` or `listUrl`
|
|
21
21
|
|
|
22
22
|
`--listUrl [listUrl]`
|
|
23
23
|
: Server- or site-relative URL of the list. Specify either `listTitle`, `listId` or `listUrl`
|
|
@@ -17,10 +17,10 @@ m365 spo listitem isrecord [options]
|
|
|
17
17
|
: The ID of the list item to check if it is a record
|
|
18
18
|
|
|
19
19
|
`-l, --listId [listId]`
|
|
20
|
-
: ID of the list where the item should be
|
|
20
|
+
: ID of the list where the item should be checked. Specify either `listTitle`, `listId` or `listUrl`
|
|
21
21
|
|
|
22
22
|
`-t, --listTitle [listTitle]`
|
|
23
|
-
: Title of the list where the item should be
|
|
23
|
+
: Title of the list where the item should be checked. Specify either `listTitle`, `listId` or `listUrl`
|
|
24
24
|
|
|
25
25
|
`--listUrl [listUrl]`
|
|
26
26
|
: Server- or site-relative URL of the list. Specify either `listTitle`, `listId` or `listUrl`
|