@pnp/cli-microsoft365 12.0.0-beta.8dff3ac → 12.0.0-beta.d654135

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.
@@ -1,6 +1,6 @@
1
1
  import { globalOptionsZod } from '../../../../Command.js';
2
2
  import { z } from 'zod';
3
- import { odata } from '../../../../utils/odata.js';
3
+ import { spo } from '../../../../utils/spo.js';
4
4
  import { validation } from '../../../../utils/validation.js';
5
5
  import SpoCommand from '../../../base/SpoCommand.js';
6
6
  import commands from '../../commands.js';
@@ -21,7 +21,7 @@ class SpoNavigationNodeListCommand extends SpoCommand {
21
21
  return 'Lists nodes from the specified site navigation';
22
22
  }
23
23
  defaultProperties() {
24
- return ['Id', 'Title', 'Url'];
24
+ return ['Key', 'Title', 'SimpleUrl'];
25
25
  }
26
26
  get schema() {
27
27
  return options;
@@ -31,8 +31,10 @@ class SpoNavigationNodeListCommand extends SpoCommand {
31
31
  await logger.logToStderr(`Retrieving navigation nodes...`);
32
32
  }
33
33
  try {
34
- const res = await odata.getAllItems(`${args.options.webUrl}/_api/web/navigation/${args.options.location.toLowerCase()}?$expand=Children,Children/Children,Children/Children/Children`);
35
- await logger.log(res);
34
+ const menuState = args.options.location === 'TopNavigationBar'
35
+ ? await spo.getTopNavigationMenuState(args.options.webUrl)
36
+ : await spo.getQuickLaunchMenuState(args.options.webUrl);
37
+ await logger.log(menuState.Nodes);
36
38
  }
37
39
  catch (err) {
38
40
  this.handleRejectedODataJsonPromise(err);
@@ -0,0 +1,47 @@
1
+ import { z } from 'zod';
2
+ import { globalOptionsZod } from '../../../../Command.js';
3
+ import request from '../../../../request.js';
4
+ import { formatting } from '../../../../utils/formatting.js';
5
+ import { validation } from '../../../../utils/validation.js';
6
+ import SpoCommand from '../../../base/SpoCommand.js';
7
+ import commands from '../../commands.js';
8
+ const options = z.strictObject({
9
+ ...globalOptionsZod.shape,
10
+ webUrl: z.string().alias('u')
11
+ .refine(url => validation.isValidSharePointUrl(url) === true, {
12
+ error: e => `'${e.input}' is not a valid SharePoint URL.`
13
+ }),
14
+ id: z.uuid()
15
+ });
16
+ class SpoWebRuleGetCommand extends SpoCommand {
17
+ get name() {
18
+ return commands.WEB_RULE_GET;
19
+ }
20
+ get description() {
21
+ return 'Retrieves details of a specific rule from a SharePoint site list';
22
+ }
23
+ get schema() {
24
+ return options;
25
+ }
26
+ async commandAction(logger, args) {
27
+ try {
28
+ if (this.verbose) {
29
+ await logger.logToStderr(`Retrieving rule with id '${args.options.id}' from site '${args.options.webUrl}'...`);
30
+ }
31
+ const requestOptions = {
32
+ url: `${args.options.webUrl}/_api/web/alerts/GetById('${formatting.encodeQueryParameter(args.options.id)}')?$expand=List,User,List/Rootfolder&$select=*,List/Id,List/Title,List/Rootfolder/ServerRelativeUrl`,
33
+ headers: {
34
+ accept: 'application/json;odata=nometadata'
35
+ },
36
+ responseType: 'json'
37
+ };
38
+ const res = await request.get(requestOptions);
39
+ await logger.log(res);
40
+ }
41
+ catch (err) {
42
+ this.handleRejectedODataJsonPromise(err);
43
+ }
44
+ }
45
+ }
46
+ export default new SpoWebRuleGetCommand();
47
+ //# sourceMappingURL=web-rule-get.js.map
@@ -377,6 +377,7 @@ export default {
377
377
  WEB_ROLEASSIGNMENT_ADD: `${prefix} web roleassignment add`,
378
378
  WEB_ROLEINHERITANCE_BREAK: `${prefix} web roleinheritance break`,
379
379
  WEB_ROLEINHERITANCE_RESET: `${prefix} web roleinheritance reset`,
380
+ WEB_RULE_GET: `${prefix} web rule get`,
380
381
  WEB_RULE_LIST: `${prefix} web rule list`,
381
382
  WEB_RULE_REMOVE: `${prefix} web rule remove`,
382
383
  WEB_SET: `${prefix} web set`
@@ -69,27 +69,35 @@ m365 spo navigation node list --webUrl https://contoso.sharepoint.com/sites/Mark
69
69
  "5786b8e8-c495-4734-b345-756733960730"
70
70
  ],
71
71
  "CurrentLCID": 1033,
72
- "Id": 2032,
73
- "IsDocLib": true,
74
- "IsExternal": true,
75
- "IsVisible": true,
76
- "ListTemplateType": 0,
77
- "Title": "Navigation Link",
78
- "Url": "https://contoso.sharepoint.com",
79
- "Children": [
72
+ "CustomProperties": [],
73
+ "FriendlyUrlSegment": "",
74
+ "IsDeleted": false,
75
+ "IsHidden": false,
76
+ "IsTitleForExistingLanguage": false,
77
+ "Key": "2032",
78
+ "Nodes": [
80
79
  {
81
- "AudienceIds": null,
80
+ "AudienceIds": [],
82
81
  "CurrentLCID": 1033,
83
- "Id": 2033,
84
- "IsDocLib": true,
85
- "IsExternal": true,
86
- "IsVisible": true,
87
- "ListTemplateType": 0,
82
+ "CustomProperties": [],
83
+ "FriendlyUrlSegment": "",
84
+ "IsDeleted": false,
85
+ "IsHidden": false,
86
+ "IsTitleForExistingLanguage": false,
87
+ "Key": "2033",
88
+ "Nodes": [],
89
+ "NodeType": 0,
90
+ "OpenInNewWindow": true,
91
+ "SimpleUrl": "https://microsoft365.com",
88
92
  "Title": "Microsoft 365",
89
- "Url": "https://microsoft365.com",
90
- "Children": []
93
+ "Translations": []
91
94
  }
92
- ]
95
+ ],
96
+ "NodeType": 0,
97
+ "OpenInNewWindow": false,
98
+ "SimpleUrl": "https://contoso.sharepoint.com",
99
+ "Title": "Navigation Link",
100
+ "Translations": []
93
101
  }
94
102
  ]
95
103
  ```
@@ -98,7 +106,7 @@ m365 spo navigation node list --webUrl https://contoso.sharepoint.com/sites/Mark
98
106
  <TabItem value="Text">
99
107
 
100
108
  ```text
101
- Id Title Url
109
+ Key Title SimpleUrl
102
110
  ---- --------------- ------------------------------
103
111
  2032 Navigation Link https://contoso.sharepoint.com
104
112
  ```
@@ -107,8 +115,8 @@ m365 spo navigation node list --webUrl https://contoso.sharepoint.com/sites/Mark
107
115
  <TabItem value="CSV">
108
116
 
109
117
  ```csv
110
- Id,Title,Url
111
- 2032,Navigation Link,https://contoso.sharepoint.com
118
+ CurrentLCID,FriendlyUrlSegment,IsDeleted,IsHidden,IsTitleForExistingLanguage,Key,NodeType,OpenInNewWindow,SimpleUrl,Title
119
+ 1033,,0,0,0,2032,0,0,https://contoso.sharepoint.com,Navigation Link
112
120
  ```
113
121
 
114
122
  </TabItem>
@@ -119,18 +127,20 @@ m365 spo navigation node list --webUrl https://contoso.sharepoint.com/sites/Mark
119
127
 
120
128
  Date: 27/1/2023
121
129
 
122
- ## Home (1031)
130
+ ## Navigation Link
123
131
 
124
132
  Property | Value
125
133
  ---------|-------
126
134
  CurrentLCID | 1033
127
- Id | 2032
128
- IsDocLib | true
129
- IsExternal | false
130
- IsVisible | true
131
- ListTemplateType | 0
135
+ FriendlyUrlSegment |
136
+ IsDeleted | false
137
+ IsHidden | false
138
+ IsTitleForExistingLanguage | false
139
+ Key | 2032
140
+ NodeType | 0
141
+ OpenInNewWindow | false
142
+ SimpleUrl | https://contoso.sharepoint.com
132
143
  Title | Navigation Link
133
- Url | https://contoso.sharepoint.com
134
144
  ```
135
145
 
136
146
  </TabItem>
@@ -0,0 +1,108 @@
1
+ import Global from '../../_global.mdx';
2
+ import Tabs from '@theme/Tabs';
3
+ import TabItem from '@theme/TabItem';
4
+
5
+ # spo web rule get
6
+
7
+ Retrieves information about a specific alert from a SharePoint list
8
+
9
+ ## Usage
10
+
11
+ ```sh
12
+ m365 spo web rule get [options]
13
+ ```
14
+
15
+ ## Options
16
+
17
+ ```md definition-list
18
+ `-u, --webUrl <webUrl>`
19
+ : The URL of the SharePoint site.
20
+
21
+ `--id <id>`
22
+ : The ID of the rule.
23
+ ```
24
+
25
+ <Global />
26
+
27
+ ## Permissions
28
+
29
+ <Tabs>
30
+ <TabItem value="Delegated">
31
+
32
+ | Resource | Permissions |
33
+ |-----------------|----------------------|
34
+ | SharePoint | AllSites.FullControl |
35
+ | Microsoft Graph | User.ReadBasic.All |
36
+
37
+ </TabItem>
38
+ <TabItem value="Application">
39
+
40
+ | Resource | Permissions |
41
+ |-----------------|-----------------------|
42
+ | SharePoint | Sites.FullControl.All |
43
+ | Microsoft Graph | User.ReadBasic.All |
44
+
45
+ </TabItem>
46
+ </Tabs>
47
+
48
+ ## Examples
49
+
50
+ Retrieve a rule by ID
51
+
52
+ ```sh
53
+ m365 spo web rule get --webUrl https://contoso.sharepoint.com/sites/Marketing --id 7cbb4c8d-8e4d-4d2e-9c6f-3f1d8b2e6a0e
54
+ ```
55
+
56
+ ## Response
57
+
58
+ <Tabs>
59
+ <TabItem value="JSON">
60
+
61
+ ```json
62
+ {
63
+ "AlertFrequency": 0,
64
+ "AlertTemplateName": "SPAlertTemplateType.DocumentLibrary",
65
+ "AlertType": 0,
66
+ "AlwaysNotify": false,
67
+ "DeliveryChannels": 1,
68
+ "EventType": -1,
69
+ "Filter": "",
70
+ "ID": "7cbb4c8d-8e4d-4d2e-9c6f-3f1d8b2e6a0e",
71
+ "Status": 0,
72
+ "Title": "Marketing documents",
73
+ "UserId": 8,
74
+ "List": {
75
+ "Id": "39d9e102-9e8f-4e74-8f17-84a92f972fcf",
76
+ "Title": "Documents",
77
+ "RootFolder": {
78
+ "ServerRelativeUrl": "/sites/Marketing/Shared Documents"
79
+ }
80
+ },
81
+ "User": {
82
+ "Id": 8,
83
+ "UserPrincipalName": "jane.doe@contoso.com"
84
+ }
85
+ }
86
+ ```
87
+
88
+ </TabItem>
89
+ <TabItem value="Text">
90
+
91
+ ```text
92
+ AlertFrequency : 0
93
+ AlertTemplateName: SPAlertTemplateType.DocumentLibrary
94
+ AlertType : 0
95
+ AlwaysNotify : false
96
+ DeliveryChannels : 1
97
+ EventType : -1
98
+ Filter :
99
+ ID : 7cbb4c8d-8e4d-4d2e-9c6f-3f1d8b2e6a0e
100
+ Status : 0
101
+ Title : Marketing documents
102
+ UserId : 8
103
+ List : {"Id":"39d9e102-9e8f-4e74-8f17-84a92f972fcf","Title":"Documents","RootFolder":{"ServerRelativeUrl":"/sites/Marketing/Shared Documents"}}
104
+ User : {"Id":8,"UserPrincipalName":"jane.doe@contoso.com"}
105
+ ```
106
+
107
+ </TabItem>
108
+ </Tabs>
@@ -44,6 +44,25 @@ When adding an attribute to a profile card, it takes up to 24 hours for the addi
44
44
 
45
45
  :::
46
46
 
47
+ ## Permissions
48
+
49
+ <Tabs>
50
+ <TabItem value="Delegated">
51
+
52
+ | Resource | Permissions |
53
+ |-----------------|------------------------------|
54
+ | Microsoft Graph | PeopleSettings.ReadWrite.All |
55
+
56
+ </TabItem>
57
+ <TabItem value="Application">
58
+
59
+ | Resource | Permissions |
60
+ |-----------------|------------------------------|
61
+ | Microsoft Graph | PeopleSettings.ReadWrite.All |
62
+
63
+ </TabItem>
64
+ </Tabs>
65
+
47
66
  ## Examples
48
67
 
49
68
  Add the UPN as a profile property to the profile cards properties
@@ -29,6 +29,25 @@ To use this command you must be either **Tenant Administrator** or **Global Admi
29
29
 
30
30
  :::
31
31
 
32
+ ## Permissions
33
+
34
+ <Tabs>
35
+ <TabItem value="Delegated">
36
+
37
+ | Resource | Permissions |
38
+ |-----------------|-------------------------|
39
+ | Microsoft Graph | PeopleSettings.Read.All |
40
+
41
+ </TabItem>
42
+ <TabItem value="Application">
43
+
44
+ | Resource | Permissions |
45
+ |-----------------|-------------------------|
46
+ | Microsoft Graph | PeopleSettings.Read.All |
47
+
48
+ </TabItem>
49
+ </Tabs>
50
+
32
51
  ## Examples
33
52
 
34
53
  Retrieve information about a specific profile card property
@@ -24,6 +24,25 @@ To use this command you must be either **Tenant Administrator** or **Global Admi
24
24
 
25
25
  :::
26
26
 
27
+ ## Permissions
28
+
29
+ <Tabs>
30
+ <TabItem value="Delegated">
31
+
32
+ | Resource | Permissions |
33
+ |-----------------|-------------------------|
34
+ | Microsoft Graph | PeopleSettings.Read.All |
35
+
36
+ </TabItem>
37
+ <TabItem value="Application">
38
+
39
+ | Resource | Permissions |
40
+ |-----------------|-------------------------|
41
+ | Microsoft Graph | PeopleSettings.Read.All |
42
+
43
+ </TabItem>
44
+ </Tabs>
45
+
27
46
  ## Examples
28
47
 
29
48
  Lists all profile card properties
@@ -38,6 +38,25 @@ When removing an attribute from a profile card, it takes up to 24 hours for the
38
38
 
39
39
  :::
40
40
 
41
+ ## Permissions
42
+
43
+ <Tabs>
44
+ <TabItem value="Delegated">
45
+
46
+ | Resource | Permissions |
47
+ |-----------------|------------------------------|
48
+ | Microsoft Graph | PeopleSettings.ReadWrite.All |
49
+
50
+ </TabItem>
51
+ <TabItem value="Application">
52
+
53
+ | Resource | Permissions |
54
+ |-----------------|------------------------------|
55
+ | Microsoft Graph | PeopleSettings.ReadWrite.All |
56
+
57
+ </TabItem>
58
+ </Tabs>
59
+
41
60
  ## Examples
42
61
 
43
62
  Removes the UPN as a profile property from the profile cards
@@ -44,6 +44,25 @@ When updating an attribute to a profile card, it takes up to 24 hours for the ad
44
44
 
45
45
  :::
46
46
 
47
+ ## Permissions
48
+
49
+ <Tabs>
50
+ <TabItem value="Delegated">
51
+
52
+ | Resource | Permissions |
53
+ |-----------------|------------------------------|
54
+ | Microsoft Graph | PeopleSettings.ReadWrite.All |
55
+
56
+ </TabItem>
57
+ <TabItem value="Application">
58
+
59
+ | Resource | Permissions |
60
+ |-----------------|------------------------------|
61
+ | Microsoft Graph | PeopleSettings.ReadWrite.All |
62
+
63
+ </TabItem>
64
+ </Tabs>
65
+
47
66
  ## Examples
48
67
 
49
68
  Updates a custom extension attribute to Cost Center
@@ -24,6 +24,25 @@ m365 tenant serviceannouncement health get [options]
24
24
 
25
25
  <Global />
26
26
 
27
+ ## Permissions
28
+
29
+ <Tabs>
30
+ <TabItem value="Delegated">
31
+
32
+ | Resource | Permissions |
33
+ |-----------------|------------------------|
34
+ | Microsoft Graph | ServiceHealth.Read.All |
35
+
36
+ </TabItem>
37
+ <TabItem value="Application">
38
+
39
+ | Resource | Permissions |
40
+ |-----------------|------------------------|
41
+ | Microsoft Graph | ServiceHealth.Read.All |
42
+
43
+ </TabItem>
44
+ </Tabs>
45
+
27
46
  ## Examples
28
47
 
29
48
  Get the health report for the service _Exchange Online_
@@ -21,6 +21,25 @@ m365 tenant serviceannouncement health list [options]
21
21
 
22
22
  <Global />
23
23
 
24
+ ## Permissions
25
+
26
+ <Tabs>
27
+ <TabItem value="Delegated">
28
+
29
+ | Resource | Permissions |
30
+ |-----------------|------------------------|
31
+ | Microsoft Graph | ServiceHealth.Read.All |
32
+
33
+ </TabItem>
34
+ <TabItem value="Application">
35
+
36
+ | Resource | Permissions |
37
+ |-----------------|------------------------|
38
+ | Microsoft Graph | ServiceHealth.Read.All |
39
+
40
+ </TabItem>
41
+ </Tabs>
42
+
24
43
  ## Examples
25
44
 
26
45
  Get the health report of all subscribed services for a tenant
@@ -21,6 +21,25 @@ m365 tenant serviceannouncement healthissue get [options]
21
21
 
22
22
  <Global />
23
23
 
24
+ ## Permissions
25
+
26
+ <Tabs>
27
+ <TabItem value="Delegated">
28
+
29
+ | Resource | Permissions |
30
+ |-----------------|------------------------|
31
+ | Microsoft Graph | ServiceHealth.Read.All |
32
+
33
+ </TabItem>
34
+ <TabItem value="Application">
35
+
36
+ | Resource | Permissions |
37
+ |-----------------|------------------------|
38
+ | Microsoft Graph | ServiceHealth.Read.All |
39
+
40
+ </TabItem>
41
+ </Tabs>
42
+
24
43
  ## Examples
25
44
 
26
45
  Gets information about issue with ID _MO226784_
@@ -21,6 +21,25 @@ m365 tenant serviceannouncement healthissue list [options]
21
21
 
22
22
  <Global />
23
23
 
24
+ ## Permissions
25
+
26
+ <Tabs>
27
+ <TabItem value="Delegated">
28
+
29
+ | Resource | Permissions |
30
+ |-----------------|------------------------|
31
+ | Microsoft Graph | ServiceHealth.Read.All |
32
+
33
+ </TabItem>
34
+ <TabItem value="Application">
35
+
36
+ | Resource | Permissions |
37
+ |-----------------|------------------------|
38
+ | Microsoft Graph | ServiceHealth.Read.All |
39
+
40
+ </TabItem>
41
+ </Tabs>
42
+
24
43
  ## Examples
25
44
 
26
45
  Get service health issues of all services in Microsoft 365
@@ -21,6 +21,25 @@ m365 tenant serviceannouncement message get [options]
21
21
 
22
22
  <Global />
23
23
 
24
+ ## Permissions
25
+
26
+ <Tabs>
27
+ <TabItem value="Delegated">
28
+
29
+ | Resource | Permissions |
30
+ |-----------------|-------------------------|
31
+ | Microsoft Graph | ServiceMessage.Read.All |
32
+
33
+ </TabItem>
34
+ <TabItem value="Application">
35
+
36
+ | Resource | Permissions |
37
+ |-----------------|-------------------------|
38
+ | Microsoft Graph | ServiceMessage.Read.All |
39
+
40
+ </TabItem>
41
+ </Tabs>
42
+
24
43
  ## Examples
25
44
 
26
45
  Get service update message with ID MC001337
@@ -21,6 +21,25 @@ m365 tenant serviceannouncement message list [options]
21
21
 
22
22
  <Global />
23
23
 
24
+ ## Permissions
25
+
26
+ <Tabs>
27
+ <TabItem value="Delegated">
28
+
29
+ | Resource | Permissions |
30
+ |-----------------|-------------------------|
31
+ | Microsoft Graph | ServiceMessage.Read.All |
32
+
33
+ </TabItem>
34
+ <TabItem value="Application">
35
+
36
+ | Resource | Permissions |
37
+ |-----------------|-------------------------|
38
+ | Microsoft Graph | ServiceMessage.Read.All |
39
+
40
+ </TabItem>
41
+ </Tabs>
42
+
24
43
  ## Examples
25
44
 
26
45
  Get service update messages of all services in Microsoft 365