@pnp/cli-microsoft365 12.0.0-beta.0be7d8d → 12.0.0-beta.c9bd7f3

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.
Files changed (89) hide show
  1. package/allCommands.json +1 -1
  2. package/allCommandsFull.json +1 -1
  3. package/dist/Auth.js +2 -6
  4. package/dist/auth/FileTokenStorage.js +0 -3
  5. package/dist/auth/msalCachePlugin.js +201 -12
  6. package/dist/m365/commands/logout.js +2 -4
  7. package/dist/m365/entra/commands/m365group/m365group-remove.js +9 -2
  8. package/dist/m365/spe/commands/container/container-remove.js +6 -7
  9. package/dist/m365/spo/commands/file/file-archive.js +1 -1
  10. package/dist/m365/spo/commands/file/file-remove.js +5 -5
  11. package/dist/m365/spo/commands/file/file-unarchive.js +1 -1
  12. package/dist/m365/spo/commands/folder/folder-archive.js +1 -1
  13. package/dist/m365/spo/commands/folder/folder-remove.js +5 -5
  14. package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-get.js +5 -0
  15. package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-set.js +8 -26
  16. package/dist/m365/spo/commands/homesite/homesite-list.js +5 -0
  17. package/dist/m365/spo/commands/list/list-remove.js +4 -4
  18. package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +5 -4
  19. package/dist/m365/spo/commands/listitem/listitem-remove.js +8 -5
  20. package/dist/m365/spo/commands/page/page-remove.js +7 -7
  21. package/dist/m365/spo/commands/site/site-list.js +60 -49
  22. package/dist/m365/spo/commands/site/site-remove.js +12 -6
  23. package/dist/m365/spo/commands/spo-get.js +5 -0
  24. package/dist/m365/spo/commands/spo-set.js +10 -21
  25. package/dist/m365/spo/commands/storageentity/storageentity-get.js +23 -17
  26. package/dist/m365/spo/commands/storageentity/storageentity-list.js +39 -36
  27. package/dist/m365/spo/commands/storageentity/storageentity-remove.js +26 -33
  28. package/dist/m365/spo/commands/storageentity/storageentity-set.js +26 -36
  29. package/dist/m365/spo/commands/user/user-ensure.js +24 -60
  30. package/dist/m365/spo/commands/user/user-get.js +25 -65
  31. package/dist/m365/spo/commands/user/user-list.js +10 -18
  32. package/dist/m365/spo/commands/user/user-remove.js +26 -68
  33. package/dist/m365/spo/commands/userprofile/userprofile-get.js +10 -23
  34. package/dist/m365/spo/commands/userprofile/userprofile-set.js +10 -19
  35. package/dist/m365/spo/commands/web/web-add.js +20 -55
  36. package/dist/m365/spo/commands/web/web-clientsidewebpart-list.js +10 -18
  37. package/dist/m365/spo/commands/web/web-get.js +12 -30
  38. package/dist/m365/spo/commands/web/web-installedlanguage-list.js +10 -18
  39. package/dist/m365/spo/commands/web/web-list.js +10 -18
  40. package/dist/m365/spo/commands/web/web-reindex.js +10 -18
  41. package/dist/m365/spo/commands/web/web-remove.js +11 -27
  42. package/dist/m365/spo/commands/web/web-retentionlabel-list.js +10 -18
  43. package/dist/m365/spo/commands/web/web-roleassignment-add.js +40 -64
  44. package/dist/m365/spo/commands/web/web-roleassignment-remove.js +31 -58
  45. package/dist/m365/spo/commands/web/web-roleinheritance-break.js +12 -36
  46. package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +11 -29
  47. package/dist/m365/spo/commands/web/web-set.js +26 -96
  48. package/dist/m365/spo/commands.js +0 -4
  49. package/dist/m365/teams/commands/channel/channel-list.js +2 -6
  50. package/dist/m365/teams/commands/channel/channel-member-add.js +2 -6
  51. package/dist/m365/teams/commands/channel/channel-member-list.js +2 -6
  52. package/dist/m365/teams/commands/channel/channel-member-remove.js +2 -6
  53. package/dist/m365/teams/commands/channel/channel-member-set.js +2 -6
  54. package/dist/m365/teams/commands/channel/channel-remove.js +2 -8
  55. package/dist/m365/teams/commands/channel/channel-set.js +2 -8
  56. package/dist/m365/teams/commands/tab/tab-get.js +2 -6
  57. package/dist/m365/teams/commands/team/team-archive.js +2 -6
  58. package/dist/m365/teams/commands/team/team-remove.js +2 -6
  59. package/dist/m365/teams/commands/team/team-unarchive.js +2 -6
  60. package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +6 -3
  61. package/docs/docs/cmd/spe/container/container-remove.mdx +5 -5
  62. package/docs/docs/cmd/spo/file/file-archive.mdx +8 -0
  63. package/docs/docs/cmd/spo/file/file-remove.mdx +4 -4
  64. package/docs/docs/cmd/spo/file/file-unarchive.mdx +8 -0
  65. package/docs/docs/cmd/spo/folder/folder-archive.mdx +6 -0
  66. package/docs/docs/cmd/spo/folder/folder-remove.mdx +4 -4
  67. package/docs/docs/cmd/spo/list/list-remove.mdx +4 -4
  68. package/docs/docs/cmd/spo/listitem/listitem-batch-remove.mdx +8 -2
  69. package/docs/docs/cmd/spo/listitem/listitem-remove.mdx +8 -2
  70. package/docs/docs/cmd/spo/page/page-remove.mdx +4 -4
  71. package/docs/docs/cmd/spo/site/site-apppermission-add.mdx +52 -21
  72. package/docs/docs/cmd/spo/site/site-list.mdx +22 -1
  73. package/docs/docs/cmd/spo/site/site-remove.mdx +5 -2
  74. package/docs/docs/cmd/spo/storageentity/storageentity-get.mdx +11 -2
  75. package/docs/docs/cmd/spo/storageentity/storageentity-list.mdx +9 -3
  76. package/docs/docs/cmd/spo/storageentity/storageentity-remove.mdx +6 -6
  77. package/docs/docs/cmd/spo/storageentity/storageentity-set.mdx +10 -4
  78. package/docs/docs/cmd/teams/app/app-install.mdx +21 -0
  79. package/docs/docs/cmd/teams/app/app-list.mdx +19 -0
  80. package/docs/docs/cmd/teams/app/app-publish.mdx +17 -0
  81. package/docs/docs/cmd/teams/app/app-remove.mdx +19 -0
  82. package/docs/docs/cmd/teams/app/app-uninstall.mdx +21 -0
  83. package/docs/docs/cmd/teams/app/app-update.mdx +19 -0
  84. package/npm-shrinkwrap.json +432 -0
  85. package/package.json +6 -1
  86. package/dist/m365/spo/commands/web/web-rule-list.js +0 -111
  87. package/dist/m365/spo/commands/web/web-rule-remove.js +0 -57
  88. package/docs/docs/cmd/spo/web/web-rule-list.mdx +0 -193
  89. package/docs/docs/cmd/spo/web/web-rule-remove.mdx +0 -71
@@ -1,111 +0,0 @@
1
- import { z } from 'zod';
2
- import { cli } from '../../../../cli/cli.js';
3
- import { globalOptionsZod } from '../../../../Command.js';
4
- import { entraUser } from '../../../../utils/entraUser.js';
5
- import { formatting } from '../../../../utils/formatting.js';
6
- import { odata } from '../../../../utils/odata.js';
7
- import { spo } from '../../../../utils/spo.js';
8
- import { validation } from '../../../../utils/validation.js';
9
- import SpoCommand from '../../../base/SpoCommand.js';
10
- import commands from '../../commands.js';
11
- export const options = z.strictObject({
12
- ...globalOptionsZod.shape,
13
- webUrl: z.string().alias('u')
14
- .refine(url => validation.isValidSharePointUrl(url) === true, {
15
- error: e => `'${e.input}' is not a valid SharePoint site URL.`
16
- }),
17
- listId: z.uuid().optional(),
18
- listUrl: z.string().optional(),
19
- listTitle: z.string().optional(),
20
- userName: z.string().optional().refine(upn => typeof upn === 'undefined' || validation.isValidUserPrincipalName(upn), {
21
- error: e => `'${e.input}' is not a valid UPN.`
22
- }),
23
- userId: z.uuid().optional()
24
- });
25
- class SpoWebRuleListCommand extends SpoCommand {
26
- get name() {
27
- return commands.WEB_RULE_LIST;
28
- }
29
- get description() {
30
- return 'Lists all SharePoint list alerts';
31
- }
32
- alias() {
33
- return [commands.WEB_ALERT_LIST];
34
- }
35
- defaultProperties() {
36
- return ['ID', 'Title', 'UserPrincipalName'];
37
- }
38
- get schema() {
39
- return options;
40
- }
41
- getRefinedSchema(schema) {
42
- return schema
43
- .refine(options => [options.listId, options.listUrl, options.listTitle].filter(x => x !== undefined).length <= 1, {
44
- error: `Specify either listId, listUrl, or listTitle, but not more than one.`,
45
- params: {
46
- customCode: 'optionSet',
47
- options: ['listId', 'listUrl', 'listTitle']
48
- }
49
- })
50
- .refine(options => [options.userName, options.userId].filter(x => x !== undefined).length <= 1, {
51
- error: `Specify either userName or userId, but not both.`,
52
- params: {
53
- customCode: 'optionSet',
54
- options: ['userName', 'userId']
55
- }
56
- });
57
- }
58
- async commandAction(logger, args) {
59
- if (this.verbose) {
60
- const listParams = args.options.listId || args.options.listTitle || args.options.listUrl;
61
- const userParams = args.options.userName || args.options.userId;
62
- let message = `Retrieving alerts from site '${args.options.webUrl}'`;
63
- if (listParams) {
64
- message += ` for list '${listParams}'`;
65
- }
66
- if (userParams) {
67
- message += `${listParams ? ' and' : ''} for user '${userParams}'`;
68
- }
69
- await logger.logToStderr(`${message}...`);
70
- }
71
- let requestUrl = `${args.options.webUrl}/_api/web/alerts?$expand=List,User,List/Rootfolder,Item&$select=*,List/Id,List/Title,List/Rootfolder/ServerRelativeUrl,Item/ID,Item/FileRef,Item/Guid`;
72
- const filters = [];
73
- let listId;
74
- if (args.options.listId) {
75
- listId = args.options.listId;
76
- }
77
- else if (args.options.listUrl || args.options.listTitle) {
78
- listId = await spo.getListId(args.options.webUrl, args.options.listTitle, args.options.listUrl, logger, this.verbose);
79
- }
80
- if (listId) {
81
- filters.push(`List/Id eq guid'${formatting.encodeQueryParameter(listId)}'`);
82
- }
83
- if (args.options.userName) {
84
- filters.push(`User/UserPrincipalName eq '${formatting.encodeQueryParameter(args.options.userName)}'`);
85
- }
86
- else if (args.options.userId) {
87
- const userPrincipalName = await entraUser.getUpnByUserId(args.options.userId);
88
- filters.push(`User/UserPrincipalName eq '${formatting.encodeQueryParameter(userPrincipalName)}'`);
89
- }
90
- if (filters.length > 0) {
91
- requestUrl += `&$filter=${filters.join(' and ')}`;
92
- }
93
- try {
94
- const res = await odata.getAllItems(requestUrl);
95
- res.forEach(alert => {
96
- if (alert.Item) {
97
- delete alert.Item['ID'];
98
- }
99
- if (cli.shouldTrimOutput(args.options.output)) {
100
- alert.UserPrincipalName = alert.User?.UserPrincipalName;
101
- }
102
- });
103
- await logger.log(res);
104
- }
105
- catch (err) {
106
- this.handleRejectedODataJsonPromise(err);
107
- }
108
- }
109
- }
110
- export default new SpoWebRuleListCommand();
111
- //# sourceMappingURL=web-rule-list.js.map
@@ -1,57 +0,0 @@
1
- import { z } from 'zod';
2
- import { cli } from '../../../../cli/cli.js';
3
- import { globalOptionsZod } from '../../../../Command.js';
4
- import request from '../../../../request.js';
5
- import { formatting } from '../../../../utils/formatting.js';
6
- import { validation } from '../../../../utils/validation.js';
7
- import SpoCommand from '../../../base/SpoCommand.js';
8
- import commands from '../../commands.js';
9
- const options = z.strictObject({
10
- ...globalOptionsZod.shape,
11
- webUrl: z.string().alias('u')
12
- .refine(url => validation.isValidSharePointUrl(url) === true, {
13
- error: e => `'${e.input}' is not a valid SharePoint URL.`
14
- }),
15
- id: z.uuid(),
16
- force: z.boolean().optional().alias('f')
17
- });
18
- class SpoWebRuleRemoveCommand extends SpoCommand {
19
- get name() {
20
- return commands.WEB_RULE_REMOVE;
21
- }
22
- get description() {
23
- return 'Removes an alert from a SharePoint list';
24
- }
25
- alias() {
26
- return [commands.WEB_ALERT_REMOVE];
27
- }
28
- get schema() {
29
- return options;
30
- }
31
- async commandAction(logger, args) {
32
- if (!args.options.force) {
33
- const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove the alert with id '${args.options.id}' from site '${args.options.webUrl}'?` });
34
- if (!result) {
35
- return;
36
- }
37
- }
38
- try {
39
- if (this.verbose) {
40
- await logger.logToStderr(`Removing alert with ID '${args.options.id}' from site '${args.options.webUrl}'...`);
41
- }
42
- const requestOptions = {
43
- url: `${args.options.webUrl}/_api/web/Alerts/DeleteAlert('${formatting.encodeQueryParameter(args.options.id)}')`,
44
- headers: {
45
- accept: 'application/json;odata=nometadata'
46
- },
47
- responseType: 'json'
48
- };
49
- await request.delete(requestOptions);
50
- }
51
- catch (err) {
52
- this.handleRejectedODataJsonPromise(err);
53
- }
54
- }
55
- }
56
- export default new SpoWebRuleRemoveCommand();
57
- //# sourceMappingURL=web-rule-remove.js.map
@@ -1,193 +0,0 @@
1
- import Global from '../../_global.mdx';
2
- import Tabs from '@theme/Tabs';
3
- import TabItem from '@theme/TabItem';
4
-
5
- # spo web rule list
6
-
7
- Lists all SharePoint list alerts
8
-
9
- ## Usage
10
-
11
- ```sh
12
- m365 spo web rule list [options]
13
- ```
14
-
15
- ## Alias
16
-
17
- ```sh
18
- m365 spo web alert list
19
- ```
20
-
21
- ## Options
22
-
23
- ```md definition-list
24
- `-u, --webUrl <webUrl>`
25
- : The URL of the SharePoint site.
26
-
27
- `--listId [listId]`
28
- : The ID of the SharePoint list. Specify either `listId`, `listUrl`, or `listTitle`, but not more than one.
29
-
30
- `--listUrl [listUrl]`
31
- : The URL of the SharePoint list. Specify either `listId`, `listUrl`, or `listTitle`, but not more than one.
32
-
33
- `--listTitle [listTitle]`
34
- : The title of the SharePoint list. Specify either `listId`, `listUrl`, or `listTitle`, but not more than one.
35
-
36
- `--userName [userName]`
37
- : The user name to filter alerts for. Specify either `userName` or `userId`, but not both.
38
-
39
- `--userId [userId]`
40
- : The user ID to filter alerts for. Specify either `userName` or `userId`, but not both.
41
- ```
42
-
43
- <Global />
44
-
45
- ## Permissions
46
-
47
- <Tabs>
48
- <TabItem value="Delegated">
49
-
50
- | Resource | Permissions |
51
- |------------|----------------------|
52
- | SharePoint | AllSites.FullControl |
53
-
54
- </TabItem>
55
- <TabItem value="Application">
56
-
57
- | Resource | Permissions |
58
- |------------|-----------------------|
59
- | SharePoint | Sites.FullControl.All |
60
-
61
- </TabItem>
62
- </Tabs>
63
-
64
- ## Examples
65
-
66
- List all alerts for a SharePoint site:
67
-
68
- ```sh
69
- m365 spo web rule list --webUrl https://contoso.sharepoint.com/sites/Marketing
70
- ```
71
-
72
- List alerts for a SharePoint list by listUrl:
73
-
74
- ```sh
75
- m365 spo web rule list --webUrl https://contoso.sharepoint.com/sites/Marketing --listUrl /sites/Marketing/lists/Tasks
76
- ```
77
-
78
- List alerts for a specific user by userId:
79
-
80
- ```sh
81
- m365 spo web rule list --webUrl https://contoso.sharepoint.com/sites/Marketing --userId 7cbb4c8d-8e4d-4d2e-9c6f-3f1d8b2e6a0e
82
- ```
83
-
84
- List alerts for a specific list by title and user by username:
85
-
86
- ```sh
87
- m365 spo web rule list --webUrl https://contoso.sharepoint.com/sites/Marketing --listTitle "Tasks" --userName jane.doe@contoso.com
88
- ```
89
-
90
- ## Response
91
-
92
- <Tabs>
93
- <TabItem value="JSON">
94
-
95
- ```json
96
- [
97
- {
98
- "AlertFrequency": 0,
99
- "AlertTemplateName": "SPAlertTemplateType.DocumentLibrary",
100
- "AlertType": 1,
101
- "AlwaysNotify": false,
102
- "DeliveryChannels": 1,
103
- "EventType": -1,
104
- "Filter": "",
105
- "ID": "c52b4bf0-add0-4323-b670-f765bb46337b",
106
- "Properties": [
107
- {
108
- "Key": "dispformurl",
109
- "Value": "Shared Documents/Forms/DispForm.aspx",
110
- "ValueType": "Edm.String"
111
- }
112
- ],
113
- "Status": 0,
114
- "Title": "Documents: ProjectPlan.docx",
115
- "UserId": 9,
116
- "Item": {
117
- "Id": 37326,
118
- "FileRef": "/sites/marketing/Shared Documents/ProjectPlan.docx",
119
- "GUID": "ef5cc60b-71c0-4357-a291-14274234efde"
120
- },
121
- "List": {
122
- "Id": "6b4f195c-02da-47f4-8237-065b96258cf3",
123
- "Title": "Documents",
124
- "RootFolder": {
125
- "ServerRelativeUrl": "/sites/marketing/Shared Documents"
126
- }
127
- },
128
- "User": {
129
- "Id": 9,
130
- "IsHiddenInUI": false,
131
- "LoginName": "i:0#.f|membership|jane.doe@contoso.onmicrosoft.com",
132
- "Title": "Jane Doe",
133
- "PrincipalType": 1,
134
- "Email": "jane.doe@contoso.onmicrosoft.com",
135
- "Expiration": "",
136
- "IsEmailAuthenticationGuestUser": false,
137
- "IsShareByEmailGuestUser": false,
138
- "IsSiteAdmin": false,
139
- "UserId": {
140
- "NameId": "10037ffeaed549a5",
141
- "NameIdIssuer": "urn:federation:microsoftonline"
142
- },
143
- "UserPrincipalName": "jane.doe@contoso.onmicrosoft.com"
144
- }
145
- }
146
- ]
147
- ```
148
-
149
- </TabItem>
150
- <TabItem value="Text">
151
-
152
- ```txt
153
- ID Title UserPrincipalName
154
- ------------------------------------ --------------------------- --------------------
155
- fa5115ee-0c72-4d17-9fda-ee2451ba1c6d Documents: ProjectPlan.docx jane.doe@contoso.com
156
- ```
157
-
158
- </TabItem>
159
- <TabItem value="CSV">
160
-
161
- ```csv
162
- AlertFrequency,AlertTemplateName,AlertType,AlwaysNotify,DeliveryChannels,EventType,Filter,ID,Status,Title,UserId,UserPrincipalName
163
- 0,SPAlertTemplateType.DocumentLibrary,1,0,1,-1,,fa5115ee-0c72-4d17-9fda-ee2451ba1c6d,0,Documents: ProjectPlan.docx,6,jane.doe@contoso.com
164
- ```
165
-
166
- </TabItem>
167
- <TabItem value="Markdown">
168
-
169
- ```md
170
- # spo web rule list --webUrl "https://contoso.sharepoint.com/sites/marketing" --listUrl "/sites/marketing/Shared Documents"
171
-
172
- Date: 10/6/2025
173
-
174
- ## Documents: ProjectPlan.docx (c52b4bf0-add0-4323-b670-f765bb46337b)
175
-
176
- Property | Value
177
- ---------|-------
178
- AlertFrequency | 0
179
- AlertTemplateName | SPAlertTemplateType.DocumentLibrary
180
- AlertType | 1
181
- AlwaysNotify | false
182
- DeliveryChannels | 1
183
- EventType | -1
184
- Filter |
185
- ID | c52b4bf0-add0-4323-b670-f765bb46337b
186
- Status | 0
187
- Title | Documents: ProjectPlan.docx
188
- UserId | 9
189
- UserPrincipalName | jane.doe@contoso.com
190
- ```
191
-
192
- </TabItem>
193
- </Tabs>
@@ -1,71 +0,0 @@
1
- import Global from '../../_global.mdx';
2
- import Tabs from '@theme/Tabs';
3
- import TabItem from '@theme/TabItem';
4
-
5
- # spo web rule remove
6
-
7
- Removes an alert from a SharePoint list
8
-
9
- ## Usage
10
-
11
- ```sh
12
- m365 spo web rule remove [options]
13
- ```
14
-
15
- ## Alias
16
-
17
- ```sh
18
- m365 spo web alert remove
19
- ```
20
-
21
- ## Options
22
-
23
- ```md definition-list
24
- `-u, --webUrl <webUrl>`
25
- : The URL of the SharePoint site.
26
-
27
- `--id <id>`
28
- : The ID of the alert.
29
-
30
- `-f, --force`
31
- : Don't prompt for confirmation.
32
- ```
33
-
34
- <Global />
35
-
36
- ## Permissions
37
-
38
- <Tabs>
39
- <TabItem value="Delegated">
40
-
41
- | Resource | Permissions |
42
- |------------|----------------------|
43
- | SharePoint | AllSites.FullControl |
44
-
45
- </TabItem>
46
- <TabItem value="Application">
47
-
48
- | Resource | Permissions |
49
- |------------|-----------------------|
50
- | SharePoint | Sites.FullControl.All |
51
-
52
- </TabItem>
53
- </Tabs>
54
-
55
- ## Examples
56
-
57
- Remove an alert by ID
58
-
59
- ```sh
60
- m365 spo web rule remove --webUrl https://contoso.sharepoint.com/sites/Marketing --id 7cbb4c8d-8e4d-4d2e-9c6f-3f1d8b2e6a0e
61
- ```
62
-
63
- Remove another alert without confirmation
64
-
65
- ```sh
66
- m365 spo web rule remove --webUrl https://contoso.sharepoint.com/sites/Marketing --id 2b6f1c8a-3e6a-4c7e-b8c0-7bf4c8e6d7f1 --force
67
- ```
68
-
69
- ## Response
70
-
71
- The command won't return a response on success.