@pnp/cli-microsoft365 10.9.0-beta.bc13e90 → 10.10.0-beta.1bb5ba0
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/.devcontainer/Dockerfile +1 -1
- package/.devproxy/api-specs/sharepoint-admin.yaml +67 -0
- package/.devproxy/api-specs/sharepoint.yaml +230 -0
- package/.devproxy/devproxyrc.json +48 -0
- package/.devproxy/generate-openapi-spec.json +24 -0
- package/.devproxy/spo-csom-types.json +54 -0
- package/.eslintrc.cjs +8 -0
- package/Dockerfile +3 -3
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/cli/cli.js +2 -2
- package/dist/m365/app/commands/permission/permission-add.js +8 -1
- package/dist/m365/base/SpoCommand.js +1 -0
- package/dist/m365/entra/commands/app/app-permission-add.js +5 -18
- package/dist/m365/entra/commands/m365group/m365group-get.js +16 -3
- package/dist/m365/entra/commands/m365group/m365group-list.js +7 -1
- package/dist/m365/entra/commands/organization/organization-set.js +104 -0
- package/dist/m365/entra/commands/pim/pim-role-assignment-eligibility-list.js +9 -3
- package/dist/m365/entra/commands/pim/pim-role-assignment-list.js +9 -3
- package/dist/m365/entra/commands/pim/pim-role-request-list.js +9 -3
- package/dist/m365/entra/commands.js +1 -0
- package/dist/m365/file/commands/file-copy.js +2 -2
- package/dist/m365/file/commands/file-move.js +1 -1
- package/dist/m365/flow/commands/flow-list.js +14 -7
- package/dist/m365/flow/commands/run/run-get.js +1 -1
- package/dist/m365/graph/commands/subscription/subscription-add.js +10 -3
- package/dist/m365/planner/commands/tenant/tenant-settings-list.js +0 -3
- package/dist/m365/pp/commands/solution/solution-publisher-list.js +8 -1
- package/dist/m365/purview/commands/threatassessment/threatassessment-get.js +9 -2
- package/dist/m365/spo/commands/contenttype/contenttype-add.js +3 -65
- package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +5 -50
- package/dist/m365/spo/commands/contenttype/contenttype-field-set.js +4 -48
- package/dist/m365/spo/commands/contenttype/contenttype-set.js +8 -58
- package/dist/m365/spo/commands/contenttype/contenttype-sync.js +2 -2
- package/dist/m365/spo/commands/file/file-move.js +8 -2
- package/dist/m365/spo/commands/folder/folder-sharinglink-add.js +1 -1
- package/dist/m365/spo/commands/folder/folder-sharinglink-clear.js +1 -1
- package/dist/m365/spo/commands/folder/folder-sharinglink-get.js +1 -1
- package/dist/m365/spo/commands/folder/folder-sharinglink-list.js +1 -1
- package/dist/m365/spo/commands/folder/folder-sharinglink-remove.js +1 -1
- package/dist/m365/spo/commands/folder/folder-sharinglink-set.js +1 -1
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +14 -5
- package/dist/m365/spo/commands/hubsite/hubsite-list.js +9 -2
- package/dist/m365/spo/commands/list/list-view-add.js +140 -87
- package/dist/m365/spo/commands/listitem/listitem-batch-set.js +3 -27
- package/dist/m365/spo/commands/page/Page.js +16 -1
- package/dist/m365/spo/commands/page/clientsidepages.js +53 -17
- package/dist/m365/spo/commands/page/page-add.js +1 -1
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +2 -8
- package/dist/m365/spo/commands/page/page-control-remove.js +99 -0
- package/dist/m365/spo/commands/page/page-control-set.js +1 -1
- package/dist/m365/spo/commands/page/page-header-set.js +9 -40
- package/dist/m365/spo/commands/page/page-publish.js +2 -10
- package/dist/m365/spo/commands/page/page-section-add.js +75 -21
- package/dist/m365/spo/commands/page/page-set.js +1 -1
- package/dist/m365/spo/commands/site/site-admin-add.js +1 -12
- package/dist/m365/spo/commands/site/site-set.js +2 -2
- package/dist/m365/spo/commands/tenant/tenant-site-list.js +16 -5
- package/dist/m365/spo/commands/term/term-list.js +10 -3
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/teams/commands/chat/chat-member-add.js +10 -4
- package/dist/m365/viva/commands/engage/engage-community-remove.js +99 -0
- package/dist/m365/viva/commands/engage/engage-network-list.js +8 -2
- package/dist/m365/viva/commands.js +1 -0
- package/dist/utils/entraServicePrincipal.js +21 -0
- package/dist/utils/md.js +3 -3
- package/dist/utils/spo.js +87 -3
- package/docs/docs/cmd/_global.mdx +1 -1
- package/docs/docs/cmd/entra/m365group/m365group-get.mdx +8 -5
- package/docs/docs/cmd/entra/m365group/m365group-list.mdx +14 -12
- package/docs/docs/cmd/entra/organization/organization-set.mdx +84 -0
- package/docs/docs/cmd/entra/pim/pim-role-assignment-eligibility-list.mdx +7 -4
- package/docs/docs/cmd/entra/pim/pim-role-assignment-list.mdx +9 -6
- package/docs/docs/cmd/entra/pim/pim-role-request-list.mdx +7 -4
- package/docs/docs/cmd/flow/flow-list.mdx +8 -5
- package/docs/docs/cmd/flow/run/run-get.mdx +1 -1
- package/docs/docs/cmd/graph/subscription/subscription-add.mdx +6 -3
- package/docs/docs/cmd/planner/bucket/bucket-add.mdx +19 -0
- package/docs/docs/cmd/planner/bucket/bucket-get.mdx +19 -0
- package/docs/docs/cmd/planner/bucket/bucket-list.mdx +19 -0
- package/docs/docs/cmd/planner/bucket/bucket-remove.mdx +21 -0
- package/docs/docs/cmd/planner/bucket/bucket-set.mdx +21 -0
- package/docs/docs/cmd/planner/plan/plan-add.mdx +19 -0
- package/docs/docs/cmd/planner/plan/plan-get.mdx +19 -0
- package/docs/docs/cmd/planner/plan/plan-list.mdx +19 -0
- package/docs/docs/cmd/planner/plan/plan-remove.mdx +21 -0
- package/docs/docs/cmd/planner/plan/plan-set.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-add.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-get.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-member-add.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-member-get.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-member-list.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-member-remove.mdx +21 -0
- package/docs/docs/cmd/planner/roster/roster-plan-list.mdx +19 -0
- package/docs/docs/cmd/planner/roster/roster-remove.mdx +21 -0
- package/docs/docs/cmd/planner/task/task-add.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-add.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-list.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-remove.mdx +21 -0
- package/docs/docs/cmd/planner/task/task-get.mdx +27 -0
- package/docs/docs/cmd/planner/task/task-list.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-reference-add.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-reference-list.mdx +19 -0
- package/docs/docs/cmd/planner/task/task-reference-remove.mdx +21 -0
- package/docs/docs/cmd/planner/task/task-remove.mdx +21 -0
- package/docs/docs/cmd/planner/task/task-set.mdx +19 -0
- package/docs/docs/cmd/planner/tenant/tenant-settings-list.mdx +44 -7
- package/docs/docs/cmd/planner/tenant/tenant-settings-set.mdx +43 -8
- package/docs/docs/cmd/pp/solution/solution-publisher-list.mdx +7 -4
- package/docs/docs/cmd/purview/threatassessment/threatassessment-get.mdx +7 -4
- package/docs/docs/cmd/spo/file/file-move.mdx +4 -1
- package/docs/docs/cmd/spo/hubsite/hubsite-get.mdx +6 -3
- package/docs/docs/cmd/spo/hubsite/hubsite-list.mdx +7 -4
- package/docs/docs/cmd/spo/list/list-add.mdx +1 -1
- package/docs/docs/cmd/spo/list/list-set.mdx +2 -2
- package/docs/docs/cmd/spo/list/list-view-add.mdx +53 -10
- package/docs/docs/cmd/spo/page/page-control-remove.mdx +56 -0
- package/docs/docs/cmd/spo/page/page-section-add.mdx +22 -2
- package/docs/docs/cmd/spo/tenant/tenant-site-list.mdx +10 -7
- package/docs/docs/cmd/spo/term/term-list.mdx +7 -4
- package/docs/docs/cmd/teams/chat/chat-member-add.mdx +6 -3
- package/docs/docs/cmd/viva/engage/engage-community-remove.mdx +61 -0
- package/docs/docs/cmd/viva/engage/engage-network-list.mdx +7 -4
- package/npm-shrinkwrap.json +2390 -587
- package/package.json +20 -17
|
@@ -0,0 +1,99 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
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");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var _VivaEngageCommunityRemoveCommand_instances, _VivaEngageCommunityRemoveCommand_initTelemetry, _VivaEngageCommunityRemoveCommand_initOptions, _VivaEngageCommunityRemoveCommand_initValidators, _VivaEngageCommunityRemoveCommand_initOptionSets, _VivaEngageCommunityRemoveCommand_initTypes;
|
|
7
|
+
import { cli } from '../../../../cli/cli.js';
|
|
8
|
+
import request from '../../../../request.js';
|
|
9
|
+
import { validation } from '../../../../utils/validation.js';
|
|
10
|
+
import { vivaEngage } from '../../../../utils/vivaEngage.js';
|
|
11
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
|
+
import commands from '../../commands.js';
|
|
13
|
+
class VivaEngageCommunityRemoveCommand extends GraphCommand {
|
|
14
|
+
get name() {
|
|
15
|
+
return commands.ENGAGE_COMMUNITY_REMOVE;
|
|
16
|
+
}
|
|
17
|
+
get description() {
|
|
18
|
+
return 'Removes a Viva Engage community';
|
|
19
|
+
}
|
|
20
|
+
constructor() {
|
|
21
|
+
super();
|
|
22
|
+
_VivaEngageCommunityRemoveCommand_instances.add(this);
|
|
23
|
+
__classPrivateFieldGet(this, _VivaEngageCommunityRemoveCommand_instances, "m", _VivaEngageCommunityRemoveCommand_initTelemetry).call(this);
|
|
24
|
+
__classPrivateFieldGet(this, _VivaEngageCommunityRemoveCommand_instances, "m", _VivaEngageCommunityRemoveCommand_initOptions).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _VivaEngageCommunityRemoveCommand_instances, "m", _VivaEngageCommunityRemoveCommand_initValidators).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _VivaEngageCommunityRemoveCommand_instances, "m", _VivaEngageCommunityRemoveCommand_initOptionSets).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _VivaEngageCommunityRemoveCommand_instances, "m", _VivaEngageCommunityRemoveCommand_initTypes).call(this);
|
|
28
|
+
}
|
|
29
|
+
async commandAction(logger, args) {
|
|
30
|
+
const removeCommunity = async () => {
|
|
31
|
+
try {
|
|
32
|
+
let communityId = args.options.id;
|
|
33
|
+
if (args.options.displayName) {
|
|
34
|
+
communityId = (await vivaEngage.getCommunityByDisplayName(args.options.displayName, ['id'])).id;
|
|
35
|
+
}
|
|
36
|
+
else if (args.options.entraGroupId) {
|
|
37
|
+
communityId = (await vivaEngage.getCommunityByEntraGroupId(args.options.entraGroupId, ['id'])).id;
|
|
38
|
+
}
|
|
39
|
+
if (args.options.verbose) {
|
|
40
|
+
await logger.logToStderr(`Removing Viva Engage community with ID ${communityId}...`);
|
|
41
|
+
}
|
|
42
|
+
const requestOptions = {
|
|
43
|
+
url: `${this.resource}/v1.0/employeeExperience/communities/${communityId}`,
|
|
44
|
+
headers: {
|
|
45
|
+
accept: 'application/json;odata.metadata=none'
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
await request.delete(requestOptions);
|
|
49
|
+
}
|
|
50
|
+
catch (err) {
|
|
51
|
+
this.handleRejectedODataJsonPromise(err);
|
|
52
|
+
}
|
|
53
|
+
};
|
|
54
|
+
if (args.options.force) {
|
|
55
|
+
await removeCommunity();
|
|
56
|
+
}
|
|
57
|
+
else {
|
|
58
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove Viva Engage community '${args.options.id || args.options.displayName || args.options.entraGroupId}'?` });
|
|
59
|
+
if (result) {
|
|
60
|
+
await removeCommunity();
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
}
|
|
65
|
+
_VivaEngageCommunityRemoveCommand_instances = new WeakSet(), _VivaEngageCommunityRemoveCommand_initTelemetry = function _VivaEngageCommunityRemoveCommand_initTelemetry() {
|
|
66
|
+
this.telemetry.push((args) => {
|
|
67
|
+
Object.assign(this.telemetryProperties, {
|
|
68
|
+
id: args.options.id !== 'undefined',
|
|
69
|
+
displayName: args.options.displayName !== 'undefined',
|
|
70
|
+
entraGroupId: args.options.entraGroupId !== 'undefined',
|
|
71
|
+
force: !!args.options.force
|
|
72
|
+
});
|
|
73
|
+
});
|
|
74
|
+
}, _VivaEngageCommunityRemoveCommand_initOptions = function _VivaEngageCommunityRemoveCommand_initOptions() {
|
|
75
|
+
this.options.unshift({
|
|
76
|
+
option: '-i, --id [id]'
|
|
77
|
+
}, {
|
|
78
|
+
option: '-n, --displayName [displayName]'
|
|
79
|
+
}, {
|
|
80
|
+
option: '--entraGroupId [entraGroupId]'
|
|
81
|
+
}, {
|
|
82
|
+
option: '-f, --force'
|
|
83
|
+
});
|
|
84
|
+
}, _VivaEngageCommunityRemoveCommand_initValidators = function _VivaEngageCommunityRemoveCommand_initValidators() {
|
|
85
|
+
this.validators.push(async (args) => {
|
|
86
|
+
if (args.options.entraGroupId && !validation.isValidGuid(args.options.entraGroupId)) {
|
|
87
|
+
return `${args.options.entraGroupId} is not a valid GUID for the option 'entraGroupId'.`;
|
|
88
|
+
}
|
|
89
|
+
return true;
|
|
90
|
+
});
|
|
91
|
+
}, _VivaEngageCommunityRemoveCommand_initOptionSets = function _VivaEngageCommunityRemoveCommand_initOptionSets() {
|
|
92
|
+
this.optionSets.push({
|
|
93
|
+
options: ['id', 'displayName', 'entraGroupId']
|
|
94
|
+
});
|
|
95
|
+
}, _VivaEngageCommunityRemoveCommand_initTypes = function _VivaEngageCommunityRemoveCommand_initTypes() {
|
|
96
|
+
this.types.string.push('id', 'displayName', 'entraGroupId');
|
|
97
|
+
};
|
|
98
|
+
export default new VivaEngageCommunityRemoveCommand();
|
|
99
|
+
//# sourceMappingURL=engage-community-remove.js.map
|
|
@@ -24,6 +24,9 @@ class VivaEngageNetworkListCommand extends VivaEngageCommand {
|
|
|
24
24
|
__classPrivateFieldGet(this, _VivaEngageNetworkListCommand_instances, "m", _VivaEngageNetworkListCommand_initOptions).call(this);
|
|
25
25
|
}
|
|
26
26
|
async commandAction(logger, args) {
|
|
27
|
+
if (args.options.includeSuspended) {
|
|
28
|
+
await this.warn(logger, `Parameter 'includeSuspended' is deprecated. Please use 'withSuspended' instead`);
|
|
29
|
+
}
|
|
27
30
|
const requestOptions = {
|
|
28
31
|
url: `${this.resource}/v1/networks/current.json`,
|
|
29
32
|
headers: {
|
|
@@ -32,7 +35,7 @@ class VivaEngageNetworkListCommand extends VivaEngageCommand {
|
|
|
32
35
|
},
|
|
33
36
|
responseType: 'json',
|
|
34
37
|
data: {
|
|
35
|
-
includeSuspended: args.options.includeSuspended !== undefined && args.options.includeSuspended !== false
|
|
38
|
+
includeSuspended: (args.options.includeSuspended !== undefined && args.options.includeSuspended !== false) || (args.options.withSuspended !== undefined && args.options.withSuspended !== false)
|
|
36
39
|
}
|
|
37
40
|
};
|
|
38
41
|
try {
|
|
@@ -47,12 +50,15 @@ class VivaEngageNetworkListCommand extends VivaEngageCommand {
|
|
|
47
50
|
_VivaEngageNetworkListCommand_instances = new WeakSet(), _VivaEngageNetworkListCommand_initTelemetry = function _VivaEngageNetworkListCommand_initTelemetry() {
|
|
48
51
|
this.telemetry.push((args) => {
|
|
49
52
|
Object.assign(this.telemetryProperties, {
|
|
50
|
-
includeSuspended: args.options.includeSuspended
|
|
53
|
+
includeSuspended: args.options.includeSuspended,
|
|
54
|
+
withSuspended: args.options.withSuspended
|
|
51
55
|
});
|
|
52
56
|
});
|
|
53
57
|
}, _VivaEngageNetworkListCommand_initOptions = function _VivaEngageNetworkListCommand_initOptions() {
|
|
54
58
|
this.options.unshift({
|
|
55
59
|
option: '--includeSuspended'
|
|
60
|
+
}, {
|
|
61
|
+
option: '--withSuspended'
|
|
56
62
|
});
|
|
57
63
|
};
|
|
58
64
|
export default new VivaEngageNetworkListCommand();
|
|
@@ -4,6 +4,7 @@ export default {
|
|
|
4
4
|
ENGAGE_COMMUNITY_ADD: `${prefix} engage community add`,
|
|
5
5
|
ENGAGE_COMMUNITY_GET: `${prefix} engage community get`,
|
|
6
6
|
ENGAGE_COMMUNITY_LIST: `${prefix} engage community list`,
|
|
7
|
+
ENGAGE_COMMUNITY_REMOVE: `${prefix} engage community remove`,
|
|
7
8
|
ENGAGE_COMMUNITY_SET: `${prefix} engage community set`,
|
|
8
9
|
ENGAGE_COMMUNITY_USER_ADD: `${prefix} engage community user add`,
|
|
9
10
|
ENGAGE_COMMUNITY_USER_LIST: `${prefix} engage community user list`,
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { odata } from './odata.js';
|
|
2
2
|
import { formatting } from './formatting.js';
|
|
3
3
|
import { cli } from '../cli/cli.js';
|
|
4
|
+
import request from '../request.js';
|
|
4
5
|
export const entraServicePrincipal = {
|
|
5
6
|
/**
|
|
6
7
|
* Get service principal by its appId
|
|
@@ -52,6 +53,26 @@ export const entraServicePrincipal = {
|
|
|
52
53
|
url += `?$select=${properties}`;
|
|
53
54
|
}
|
|
54
55
|
return odata.getAllItems(url);
|
|
56
|
+
},
|
|
57
|
+
/**
|
|
58
|
+
* Create a new service principal for the specified application.
|
|
59
|
+
* @param appId Application ID of the application for which to create a service principal.
|
|
60
|
+
* @returns The created service principal.
|
|
61
|
+
*/
|
|
62
|
+
async createServicePrincipal(appId) {
|
|
63
|
+
const url = `https://graph.microsoft.com/v1.0/servicePrincipals`;
|
|
64
|
+
const requestOptions = {
|
|
65
|
+
url: url,
|
|
66
|
+
headers: {
|
|
67
|
+
accept: 'application/json;odata.metadata=none',
|
|
68
|
+
'content-type': 'application/json;odata=nometadata'
|
|
69
|
+
},
|
|
70
|
+
data: {
|
|
71
|
+
appId
|
|
72
|
+
},
|
|
73
|
+
responseType: 'json'
|
|
74
|
+
};
|
|
75
|
+
return await request.post(requestOptions);
|
|
55
76
|
}
|
|
56
77
|
};
|
|
57
78
|
//# sourceMappingURL=entraServicePrincipal.js.map
|
package/dist/utils/md.js
CHANGED
|
@@ -13,8 +13,8 @@ function convertHeadings(md) {
|
|
|
13
13
|
});
|
|
14
14
|
}
|
|
15
15
|
function convertAdmonitions(md) {
|
|
16
|
-
const regex = new RegExp(
|
|
17
|
-
return md.replace(regex, (_, label, title, content) => label.toLocaleUpperCase() + (title ? EOL + EOL + title : '') + EOL + EOL + content.trim());
|
|
16
|
+
const regex = new RegExp(/^([ \t]*):::(\w+)(?:\[([^\]]+)\])?([\s\S]*?)^\1:::$/, 'gm');
|
|
17
|
+
return md.replace(regex, (_, indent, label, title, content) => indent + label.toLocaleUpperCase() + (title ? EOL + EOL + indent + title : '') + EOL + EOL + indent + content.trim());
|
|
18
18
|
}
|
|
19
19
|
function includeContent(md, rootFolder) {
|
|
20
20
|
const mdxImports = [
|
|
@@ -49,7 +49,7 @@ function convertHyperlinks(md) {
|
|
|
49
49
|
function convertContentTabs(md) {
|
|
50
50
|
return md
|
|
51
51
|
.replace(/<TabItem value="([^"]+)">/gm, '$1')
|
|
52
|
-
.replace(
|
|
52
|
+
.replace(/.*\n?<\/?(Tabs|TabItem)>.*\n?/g, '')
|
|
53
53
|
.replace(/```(?:\w+)?\s*([\s\S]*?)\s*```/g, '$1')
|
|
54
54
|
.trim();
|
|
55
55
|
}
|
package/dist/utils/spo.js
CHANGED
|
@@ -1403,13 +1403,13 @@ export const spo = {
|
|
|
1403
1403
|
await request.post(requestOptions);
|
|
1404
1404
|
},
|
|
1405
1405
|
/**
|
|
1406
|
-
* Retrieves the site ID for a given web URL.
|
|
1406
|
+
* Retrieves the site ID for a given web URL by the MS Graph.
|
|
1407
1407
|
* @param webUrl The web URL for which to retrieve the site ID.
|
|
1408
1408
|
* @param logger The logger object.
|
|
1409
1409
|
* @param verbose Set for verbose logging
|
|
1410
|
-
* @returns
|
|
1410
|
+
* @returns The site ID as a string.
|
|
1411
1411
|
*/
|
|
1412
|
-
async
|
|
1412
|
+
async getSiteIdByMSGraph(webUrl, logger, verbose) {
|
|
1413
1413
|
if (verbose && logger) {
|
|
1414
1414
|
await logger.logToStderr(`Getting site id for URL: ${webUrl}...`);
|
|
1415
1415
|
}
|
|
@@ -1424,6 +1424,90 @@ export const spo = {
|
|
|
1424
1424
|
const site = await request.get(requestOptions);
|
|
1425
1425
|
return site.id;
|
|
1426
1426
|
},
|
|
1427
|
+
/**
|
|
1428
|
+
* Retrieves the SharePoint Online site ID for the specified web URL by the SharePoint REST API.
|
|
1429
|
+
* @param webUrl The web URL of the SharePoint Online site to retrieve the site ID for.
|
|
1430
|
+
* @param logger The logger object.
|
|
1431
|
+
* @param verbose Set for verbose logging
|
|
1432
|
+
* @returns The site ID as a string.
|
|
1433
|
+
*/
|
|
1434
|
+
async getSiteIdBySPApi(webUrl, logger, verbose) {
|
|
1435
|
+
if (verbose && logger) {
|
|
1436
|
+
await logger.logToStderr(`Getting site id for URL: ${webUrl}...`);
|
|
1437
|
+
}
|
|
1438
|
+
const requestOptions = {
|
|
1439
|
+
url: `${webUrl}/_api/site?$select=Id`,
|
|
1440
|
+
headers: {
|
|
1441
|
+
accept: 'application/json;odata=nometadata'
|
|
1442
|
+
},
|
|
1443
|
+
responseType: 'json'
|
|
1444
|
+
};
|
|
1445
|
+
const siteResponse = await request.get(requestOptions);
|
|
1446
|
+
return siteResponse.Id;
|
|
1447
|
+
},
|
|
1448
|
+
/**
|
|
1449
|
+
* Retrieves the id of a SharePoint web for the specified web URL.
|
|
1450
|
+
* @param webUrl The web URL for which to retrieve the web ID.
|
|
1451
|
+
* @param logger The logger object for logging messages.
|
|
1452
|
+
* @param verbose Set to true for verbose logging.
|
|
1453
|
+
* @returns The web ID as a string.
|
|
1454
|
+
*/
|
|
1455
|
+
async getWebId(webUrl, logger, verbose) {
|
|
1456
|
+
if (verbose && logger) {
|
|
1457
|
+
await logger.logToStderr(`Getting web id for URL: ${webUrl}...`);
|
|
1458
|
+
}
|
|
1459
|
+
const requestOptions = {
|
|
1460
|
+
url: `${webUrl}/_api/web?$select=Id`,
|
|
1461
|
+
headers: {
|
|
1462
|
+
accept: 'application/json;odata=nometadata'
|
|
1463
|
+
},
|
|
1464
|
+
responseType: 'json'
|
|
1465
|
+
};
|
|
1466
|
+
const webResponse = await request.get(requestOptions);
|
|
1467
|
+
return webResponse.Id;
|
|
1468
|
+
},
|
|
1469
|
+
/**
|
|
1470
|
+
* Retrieves the ID of a SharePoint list by its title or URL.
|
|
1471
|
+
* @param webUrl The base URL of the SharePoint site.
|
|
1472
|
+
* @param listTitle The title of the list (optional).
|
|
1473
|
+
* @param listUrl The server-relative URL of the list (optional).
|
|
1474
|
+
* @param logger The logger object for logging messages (optional).
|
|
1475
|
+
* @param verbose Set to true for verbose logging (optional).
|
|
1476
|
+
* @returns The list ID as a string.
|
|
1477
|
+
*/
|
|
1478
|
+
async getListId(webUrl, listTitle, listUrl, logger, verbose) {
|
|
1479
|
+
if (verbose && logger) {
|
|
1480
|
+
await logger.logToStderr(`Retrieving list id...`);
|
|
1481
|
+
}
|
|
1482
|
+
if (!listTitle && !listUrl) {
|
|
1483
|
+
throw new Error('Either listTitle or listUrl must be provided.');
|
|
1484
|
+
}
|
|
1485
|
+
let listId = '';
|
|
1486
|
+
if (listTitle) {
|
|
1487
|
+
const requestOptions = {
|
|
1488
|
+
url: `${webUrl}/_api/web/lists/getByTitle('${formatting.encodeQueryParameter(listTitle)}')?$select=Id`,
|
|
1489
|
+
headers: {
|
|
1490
|
+
accept: 'application/json;odata=nometadata'
|
|
1491
|
+
},
|
|
1492
|
+
responseType: 'json'
|
|
1493
|
+
};
|
|
1494
|
+
const listResponse = await request.get(requestOptions);
|
|
1495
|
+
listId = listResponse.Id;
|
|
1496
|
+
}
|
|
1497
|
+
else if (listUrl) {
|
|
1498
|
+
const listServerRelativeUrl = urlUtil.getServerRelativePath(webUrl, listUrl);
|
|
1499
|
+
const requestOptions = {
|
|
1500
|
+
url: `${webUrl}/_api/web/GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')?$select=Id`,
|
|
1501
|
+
headers: {
|
|
1502
|
+
accept: 'application/json;odata=nometadata'
|
|
1503
|
+
},
|
|
1504
|
+
responseType: 'json'
|
|
1505
|
+
};
|
|
1506
|
+
const listResponse = await request.get(requestOptions);
|
|
1507
|
+
listId = listResponse.Id;
|
|
1508
|
+
}
|
|
1509
|
+
return listId;
|
|
1510
|
+
},
|
|
1427
1511
|
/**
|
|
1428
1512
|
* Retrieves the server-relative URL of a folder.
|
|
1429
1513
|
* @param webUrl Web URL
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
```md definition-list
|
|
2
2
|
`-h, --help [help]`
|
|
3
|
-
: Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are `options`, `examples`, `remarks`, `response`, `full`. Default is `options`.
|
|
3
|
+
: Output usage information. Optionally, specify which section of command's help you want to see. Allowed values are `options`, `examples`, `remarks`, `permissions`, `response`, `full`. Default is `options`.
|
|
4
4
|
|
|
5
5
|
`--query [query]`
|
|
6
6
|
: JMESPath query string. See [http://jmespath.org/](http://jmespath.org/) for more information and examples.
|
|
@@ -22,29 +22,32 @@ m365 entra m365group get [options]
|
|
|
22
22
|
: Display name of the Microsoft 365 Group or Microsoft Teams team to retrieve information for. Specify either `id` or `displayName`, but not both.
|
|
23
23
|
|
|
24
24
|
`--includeSiteUrl`
|
|
25
|
-
: Set to retrieve the site URL for the group
|
|
25
|
+
: (deprecated. Use option `withSiteUrl` instead) Set to retrieve the site URL for the group.
|
|
26
|
+
|
|
27
|
+
`--withSiteUrl`
|
|
28
|
+
: Set to retrieve the site URL for the group.
|
|
26
29
|
```
|
|
27
30
|
|
|
28
31
|
<Global />
|
|
29
32
|
|
|
30
33
|
## Examples
|
|
31
34
|
|
|
32
|
-
Get information about the Microsoft 365 Group with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_
|
|
35
|
+
Get information about the Microsoft 365 Group with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_.
|
|
33
36
|
|
|
34
37
|
```sh
|
|
35
38
|
m365 entra m365group get --id 1caf7dcd-7e83-4c3a-94f7-932a1299c844
|
|
36
39
|
```
|
|
37
40
|
|
|
38
|
-
Get information about the Microsoft 365 Group with displayName _Finance_
|
|
41
|
+
Get information about the Microsoft 365 Group with displayName _Finance_.
|
|
39
42
|
|
|
40
43
|
```sh
|
|
41
44
|
m365 entra m365group get --displayName Finance
|
|
42
45
|
```
|
|
43
46
|
|
|
44
|
-
Get information about the Microsoft 365 Group with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_ and also retrieve the URL of the corresponding SharePoint site
|
|
47
|
+
Get information about the Microsoft 365 Group with id _1caf7dcd-7e83-4c3a-94f7-932a1299c844_ and also retrieve the URL of the corresponding SharePoint site.
|
|
45
48
|
|
|
46
49
|
```sh
|
|
47
|
-
m365 entra m365group get --id 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --
|
|
50
|
+
m365 entra m365group get --id 1caf7dcd-7e83-4c3a-94f7-932a1299c844 --withSiteUrl
|
|
48
51
|
```
|
|
49
52
|
|
|
50
53
|
## Response
|
|
@@ -16,54 +16,56 @@ m365 entra m365group list [options]
|
|
|
16
16
|
|
|
17
17
|
```md definition-list
|
|
18
18
|
`-d, --displayName [displayName]`
|
|
19
|
-
: Retrieve only groups with displayName starting with the specified value
|
|
19
|
+
: Retrieve only groups with displayName starting with the specified value.
|
|
20
20
|
|
|
21
21
|
`-m, --mailNickname [displayName]`
|
|
22
|
-
: Retrieve only groups with mailNickname starting with the specified value
|
|
22
|
+
: Retrieve only groups with mailNickname starting with the specified value.
|
|
23
23
|
|
|
24
24
|
`--includeSiteUrl`
|
|
25
|
-
: Set to retrieve the site URL for each group
|
|
25
|
+
: (deprecated. Use option `withSiteUrl` instead) Set to retrieve the site URL for each group.
|
|
26
|
+
|
|
27
|
+
`--withSiteUrl`
|
|
28
|
+
: Set to retrieve the site URL for each group.
|
|
26
29
|
|
|
27
30
|
`--orphaned`
|
|
28
|
-
: Set to only retrieve groups without owners
|
|
31
|
+
: Set to only retrieve groups without owners.
|
|
29
32
|
```
|
|
30
33
|
|
|
31
34
|
<Global />
|
|
32
35
|
|
|
33
36
|
## Remarks
|
|
34
37
|
|
|
35
|
-
Using the `--
|
|
38
|
+
Using the `--withSiteUrl` option, you can retrieve the URL of the site associated with the particular Microsoft 365 Group. If you however retrieve too many groups and will try to get their site URLs, you will most likely get an error as the command will get throttled, issuing too many requests, too frequently. If you get an error, consider narrowing down the result set using the `--displayName` and `--mailNickname` filters.
|
|
36
39
|
|
|
37
40
|
Using the `--orphaned` option, you can retrieve Microsoft 365 Groups without owners.
|
|
38
41
|
|
|
39
42
|
## Examples
|
|
40
43
|
|
|
41
|
-
List all Microsoft 365 Groups in the tenant
|
|
44
|
+
List all Microsoft 365 Groups in the tenant.
|
|
42
45
|
|
|
43
46
|
```sh
|
|
44
47
|
m365 entra m365group list
|
|
45
48
|
```
|
|
46
49
|
|
|
47
|
-
List Microsoft 365 Groups with display name starting with _Project_
|
|
50
|
+
List Microsoft 365 Groups with display name starting with _Project_.
|
|
48
51
|
|
|
49
52
|
```sh
|
|
50
53
|
m365 entra m365group list --displayName Project
|
|
51
54
|
```
|
|
52
55
|
|
|
53
|
-
List Microsoft 365 Groups mail nick name starting with _team_
|
|
56
|
+
List Microsoft 365 Groups mail nick name starting with _team_.
|
|
54
57
|
|
|
55
58
|
```sh
|
|
56
59
|
m365 entra m365group list --mailNickname team
|
|
57
60
|
```
|
|
58
61
|
|
|
59
|
-
List Microsoft 365 Groups with display name starting with _Project_ including
|
|
60
|
-
the URL of the corresponding SharePoint site
|
|
62
|
+
List Microsoft 365 Groups with display name starting with _Project_ including the URL of the corresponding SharePoint site.
|
|
61
63
|
|
|
62
64
|
```sh
|
|
63
|
-
m365 entra m365group list --displayName Project --
|
|
65
|
+
m365 entra m365group list --displayName Project --withSiteUrl
|
|
64
66
|
```
|
|
65
67
|
|
|
66
|
-
List Microsoft 365 Groups without owners
|
|
68
|
+
List Microsoft 365 Groups without owners.
|
|
67
69
|
|
|
68
70
|
```sh
|
|
69
71
|
m365 entra m365group list --orphaned
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
import Global from '/docs/cmd/_global.mdx';
|
|
2
|
+
import Tabs from '@theme/Tabs';
|
|
3
|
+
import TabItem from '@theme/TabItem';
|
|
4
|
+
|
|
5
|
+
# entra organization set
|
|
6
|
+
|
|
7
|
+
Updates info about the organization
|
|
8
|
+
|
|
9
|
+
## Usage
|
|
10
|
+
|
|
11
|
+
```sh
|
|
12
|
+
m365 entra organization set [options]
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Options
|
|
16
|
+
|
|
17
|
+
```md definition-list
|
|
18
|
+
`-i, --id [id]`
|
|
19
|
+
: The id of the organization. Specify either `id` or `displayName`, but not both.
|
|
20
|
+
|
|
21
|
+
`-d, --displayName [displayName]`
|
|
22
|
+
: The name of the organization. Specify either `id` or `displayName`, but not both.
|
|
23
|
+
|
|
24
|
+
`--marketingNotificationEmails [marketingNotificationEmails]`
|
|
25
|
+
: The comma separated list of marketing notification emails.
|
|
26
|
+
|
|
27
|
+
`--securityComplianceNotificationMails [securityComplianceNotificationMails]`
|
|
28
|
+
: The comma separated list of security compliance notification emails.
|
|
29
|
+
|
|
30
|
+
`--securityComplianceNotificationPhones [securityComplianceNotificationPhones]`
|
|
31
|
+
: The comma separated list of security compliance notification phones.
|
|
32
|
+
|
|
33
|
+
`--technicalNotificationMails [technicalNotificationMails]`
|
|
34
|
+
: The comma separated list of technical notification emails.
|
|
35
|
+
|
|
36
|
+
`--contactEmail [contactEmail]`
|
|
37
|
+
: A valid smtp email address for the privacy statement contact
|
|
38
|
+
|
|
39
|
+
`--statementUrl [statementUrl]`
|
|
40
|
+
: The URL that directs to the company's privacy statement
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
<Global />
|
|
44
|
+
|
|
45
|
+
## Permissions
|
|
46
|
+
|
|
47
|
+
<Tabs>
|
|
48
|
+
<TabItem value="Delegated">
|
|
49
|
+
|
|
50
|
+
| Resource | Permissions |
|
|
51
|
+
|-----------------|--------------------------------------------------|
|
|
52
|
+
| Microsoft Graph | Organization.ReadWrite.All |
|
|
53
|
+
|
|
54
|
+
</TabItem>
|
|
55
|
+
<TabItem value="Application">
|
|
56
|
+
|
|
57
|
+
| Resource | Permissions |
|
|
58
|
+
|-----------------|----------------------------------------------------------|
|
|
59
|
+
| Microsoft Graph | Organization.ReadWrite.All |
|
|
60
|
+
|
|
61
|
+
</TabItem>
|
|
62
|
+
</Tabs>
|
|
63
|
+
|
|
64
|
+
## Examples
|
|
65
|
+
|
|
66
|
+
Updates properties of an organization specified by id
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
m365 entra organization set --id 84841066-274d-4ec0-a5c1-276be684bdd3 --marketingNotificationEmails 'marketing@contoso.com'
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
Updates properties of an organization specified by displayName
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
m365 entra organization set --displayName Contoso --marketingNotificationEmails 'marketing@contoso.com'
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
## Response
|
|
79
|
+
|
|
80
|
+
The command won't return a response on success
|
|
81
|
+
|
|
82
|
+
## More information
|
|
83
|
+
|
|
84
|
+
- Organization: https://learn.microsoft.com/graph/api/organization-update
|
|
@@ -28,6 +28,9 @@ m365 entra pim role assignment eligibility list [options]
|
|
|
28
28
|
: Display name of the group for which to list eligible roles. Specify either `userId`, `userName`, `groupId` or `groupName`. If not specified, all eligible roles will be listed.
|
|
29
29
|
|
|
30
30
|
`--includePrincipalDetails`
|
|
31
|
+
: (deprecated. Use option `withPrincipalDetails` instead) An optional flag to include details of the principals that were eligible for a role.
|
|
32
|
+
|
|
33
|
+
`--withPrincipalDetails`
|
|
31
34
|
: An optional flag to include details of the principals that were eligible for a role.
|
|
32
35
|
```
|
|
33
36
|
|
|
@@ -50,7 +53,7 @@ m365 entra pim role assignment eligibility list --userId '@meID'
|
|
|
50
53
|
Get a list of eligible roles for any user with principal details.
|
|
51
54
|
|
|
52
55
|
```sh
|
|
53
|
-
m365 entra pim role assignment eligibility list --
|
|
56
|
+
m365 entra pim role assignment eligibility list --withPrincipalDetails
|
|
54
57
|
```
|
|
55
58
|
|
|
56
59
|
## Response
|
|
@@ -121,9 +124,9 @@ m365 entra pim role assignment eligibility list --includePrincipalDetails
|
|
|
121
124
|
</TabItem>
|
|
122
125
|
</Tabs>
|
|
123
126
|
|
|
124
|
-
### `
|
|
127
|
+
### `withPrincipalDetails` response
|
|
125
128
|
|
|
126
|
-
When we make use of the option `
|
|
129
|
+
When we make use of the option `withPrincipalDetails` the response will differ.
|
|
127
130
|
|
|
128
131
|
<Tabs>
|
|
129
132
|
<TabItem value="JSON">
|
|
@@ -183,7 +186,7 @@ When we make use of the option `includePrincipalDetails` the response will diffe
|
|
|
183
186
|
<TabItem value="Markdown">
|
|
184
187
|
|
|
185
188
|
```md
|
|
186
|
-
# entra pim role assignment eligibility list --
|
|
189
|
+
# entra pim role assignment eligibility list --withPrincipalDetails "true"
|
|
187
190
|
|
|
188
191
|
Date: 4/8/2024
|
|
189
192
|
|
|
@@ -31,7 +31,10 @@ m365 entra pim role assignment list [options]
|
|
|
31
31
|
: An optional ISO 8601 formatted date filter to search from.
|
|
32
32
|
|
|
33
33
|
`--includePrincipalDetails`
|
|
34
|
-
: An optional flag to include details of the principals that were assigned a role
|
|
34
|
+
: (deprecated. Use option `withPrincipalDetails` instead) An optional flag to include details of the principals that were assigned a role.
|
|
35
|
+
|
|
36
|
+
`--withPrincipalDetails`
|
|
37
|
+
: An optional flag to include details of the principals that were assigned a role.
|
|
35
38
|
```
|
|
36
39
|
|
|
37
40
|
<Global />
|
|
@@ -50,7 +53,7 @@ Get a list of Entra role assignments for the current user.
|
|
|
50
53
|
m365 entra pim role assignment list --userId '@meID'
|
|
51
54
|
```
|
|
52
55
|
|
|
53
|
-
Get a list of Entra role assignments since the first of January 2024
|
|
56
|
+
Get a list of Entra role assignments since the first of January 2024.
|
|
54
57
|
|
|
55
58
|
```sh
|
|
56
59
|
m365 entra pim role assignment list --startDateTime 2024-01-01T00:00:00Z
|
|
@@ -59,7 +62,7 @@ m365 entra pim role assignment list --startDateTime 2024-01-01T00:00:00Z
|
|
|
59
62
|
Get a list of Entra role assignments with principal details.
|
|
60
63
|
|
|
61
64
|
```sh
|
|
62
|
-
m365 entra pim role assignment list --
|
|
65
|
+
m365 entra pim role assignment list --withPrincipalDetails
|
|
63
66
|
```
|
|
64
67
|
|
|
65
68
|
## Response
|
|
@@ -135,9 +138,9 @@ m365 entra pim role assignment list --includePrincipalDetails
|
|
|
135
138
|
</TabItem>
|
|
136
139
|
</Tabs>
|
|
137
140
|
|
|
138
|
-
### `
|
|
141
|
+
### `withPrincipalDetails` response
|
|
139
142
|
|
|
140
|
-
When we make use of the option `
|
|
143
|
+
When we make use of the option `withPrincipalDetails` the response will differ.
|
|
141
144
|
|
|
142
145
|
<Tabs>
|
|
143
146
|
<TabItem value="JSON">
|
|
@@ -201,7 +204,7 @@ When we make use of the option `includePrincipalDetails` the response will diffe
|
|
|
201
204
|
<TabItem value="Markdown">
|
|
202
205
|
|
|
203
206
|
```md
|
|
204
|
-
# entra pim role assignment list --
|
|
207
|
+
# entra pim role assignment list --withPrincipalDetails "true"
|
|
205
208
|
|
|
206
209
|
Date: 3/31/2024
|
|
207
210
|
|
|
@@ -34,6 +34,9 @@ m365 entra pim role request list [options]
|
|
|
34
34
|
: An optional value to filter the list of requests. Allowed values are: `Canceled`, `Denied`, `Failed`, `Granted`, `PendingAdminDecision`, `PendingApproval`, `PendingProvisioning`, `PendingScheduleCreation`, `Provisioned`, `Revoked`, and `ScheduleCreated`.
|
|
35
35
|
|
|
36
36
|
`--includePrincipalDetails`
|
|
37
|
+
: (deprecated. Use option `withPrincipalDetails` instead) An optional flag to include details of the principals that were assigned a role.
|
|
38
|
+
|
|
39
|
+
`--withPrincipalDetails`
|
|
37
40
|
: An optional flag to include details of the principals that were assigned a role.
|
|
38
41
|
```
|
|
39
42
|
|
|
@@ -62,7 +65,7 @@ m365 entra pim role request list --createdDateTime 2024-01-01T00:00:00Z
|
|
|
62
65
|
Get a list of PIM requests with principal details.
|
|
63
66
|
|
|
64
67
|
```sh
|
|
65
|
-
m365 entra pim role request list --
|
|
68
|
+
m365 entra pim role request list --withPrincipalDetails
|
|
66
69
|
```
|
|
67
70
|
|
|
68
71
|
Get a list of PIM requests with pending approvals.
|
|
@@ -158,9 +161,9 @@ m365 entra pim role request list --status PendingApproval
|
|
|
158
161
|
</TabItem>
|
|
159
162
|
</Tabs>
|
|
160
163
|
|
|
161
|
-
### `
|
|
164
|
+
### `withPrincipalDetails` response
|
|
162
165
|
|
|
163
|
-
When we make use of the option `
|
|
166
|
+
When we make use of the option `withPrincipalDetails` the response will differ.
|
|
164
167
|
|
|
165
168
|
<Tabs>
|
|
166
169
|
<TabItem value="JSON">
|
|
@@ -238,7 +241,7 @@ When we make use of the option `includePrincipalDetails` the response will diffe
|
|
|
238
241
|
<TabItem value="Markdown">
|
|
239
242
|
|
|
240
243
|
```md
|
|
241
|
-
# entra pim role request list --
|
|
244
|
+
# entra pim role request list --withPrincipalDetails "true"
|
|
242
245
|
|
|
243
246
|
Date: 5/30/2024
|
|
244
247
|
|