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

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 (24) hide show
  1. package/allCommands.json +1 -1
  2. package/allCommandsFull.json +1 -1
  3. package/dist/m365/spo/commands/site/site-list.js +60 -49
  4. package/dist/m365/spo/commands/storageentity/storageentity-get.js +23 -17
  5. package/dist/m365/spo/commands/storageentity/storageentity-list.js +39 -36
  6. package/dist/m365/spo/commands/storageentity/storageentity-remove.js +26 -33
  7. package/dist/m365/spo/commands/storageentity/storageentity-set.js +26 -36
  8. package/dist/m365/teams/commands/channel/channel-list.js +2 -6
  9. package/dist/m365/teams/commands/channel/channel-member-add.js +2 -6
  10. package/dist/m365/teams/commands/channel/channel-member-list.js +2 -6
  11. package/dist/m365/teams/commands/channel/channel-member-remove.js +2 -6
  12. package/dist/m365/teams/commands/channel/channel-member-set.js +2 -6
  13. package/dist/m365/teams/commands/channel/channel-remove.js +2 -8
  14. package/dist/m365/teams/commands/channel/channel-set.js +2 -8
  15. package/dist/m365/teams/commands/tab/tab-get.js +2 -6
  16. package/dist/m365/teams/commands/team/team-archive.js +2 -6
  17. package/dist/m365/teams/commands/team/team-remove.js +2 -6
  18. package/dist/m365/teams/commands/team/team-unarchive.js +2 -6
  19. package/docs/docs/cmd/spo/site/site-list.mdx +22 -1
  20. package/docs/docs/cmd/spo/storageentity/storageentity-get.mdx +11 -2
  21. package/docs/docs/cmd/spo/storageentity/storageentity-list.mdx +9 -3
  22. package/docs/docs/cmd/spo/storageentity/storageentity-remove.mdx +6 -6
  23. package/docs/docs/cmd/spo/storageentity/storageentity-set.mdx +10 -4
  24. package/package.json +1 -1
@@ -5,8 +5,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
5
5
  };
6
6
  var _TeamsChannelMemberSetCommand_instances, _TeamsChannelMemberSetCommand_initTelemetry, _TeamsChannelMemberSetCommand_initOptions, _TeamsChannelMemberSetCommand_initValidators, _TeamsChannelMemberSetCommand_initOptionSets;
7
7
  import request from '../../../../request.js';
8
- import { entraGroup } from '../../../../utils/entraGroup.js';
9
8
  import { formatting } from '../../../../utils/formatting.js';
9
+ import { teams } from '../../../../utils/teams.js';
10
10
  import { validation } from '../../../../utils/validation.js';
11
11
  import GraphCommand from '../../../base/GraphCommand.js';
12
12
  import commands from '../../commands.js';
@@ -56,11 +56,7 @@ class TeamsChannelMemberSetCommand extends GraphCommand {
56
56
  if (args.options.teamId) {
57
57
  return args.options.teamId;
58
58
  }
59
- const group = await entraGroup.getGroupByDisplayName(args.options.teamName);
60
- if (group.resourceProvisioningOptions.indexOf('Team') === -1) {
61
- throw `The specified team does not exist in the Microsoft Teams`;
62
- }
63
- return group.id;
59
+ return teams.getTeamIdByDisplayName(args.options.teamName);
64
60
  }
65
61
  async getChannelId(args) {
66
62
  if (args.options.channelId) {
@@ -6,8 +6,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
6
6
  var _TeamsChannelRemoveCommand_instances, _TeamsChannelRemoveCommand_initTelemetry, _TeamsChannelRemoveCommand_initOptions, _TeamsChannelRemoveCommand_initValidators, _TeamsChannelRemoveCommand_initOptionSets;
7
7
  import { cli } from '../../../../cli/cli.js';
8
8
  import request from '../../../../request.js';
9
- import { entraGroup } from '../../../../utils/entraGroup.js';
10
9
  import { formatting } from '../../../../utils/formatting.js';
10
+ import { teams } from '../../../../utils/teams.js';
11
11
  import { validation } from '../../../../utils/validation.js';
12
12
  import GraphCommand from '../../../base/GraphCommand.js';
13
13
  import commands from '../../commands.js';
@@ -63,13 +63,7 @@ class TeamsChannelRemoveCommand extends GraphCommand {
63
63
  if (args.options.teamId) {
64
64
  return args.options.teamId;
65
65
  }
66
- const group = await entraGroup.getGroupByDisplayName(args.options.teamName);
67
- if (group.resourceProvisioningOptions.indexOf('Team') === -1) {
68
- throw 'The specified team does not exist';
69
- }
70
- else {
71
- return group.id;
72
- }
66
+ return teams.getTeamIdByDisplayName(args.options.teamName);
73
67
  }
74
68
  async getChannelId(args) {
75
69
  if (args.options.id) {
@@ -5,8 +5,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
5
5
  };
6
6
  var _TeamsChannelSetCommand_instances, _TeamsChannelSetCommand_initTelemetry, _TeamsChannelSetCommand_initOptions, _TeamsChannelSetCommand_initValidators, _TeamsChannelSetCommand_initOptionSets;
7
7
  import request from '../../../../request.js';
8
- import { entraGroup } from '../../../../utils/entraGroup.js';
9
8
  import { formatting } from '../../../../utils/formatting.js';
9
+ import { teams } from '../../../../utils/teams.js';
10
10
  import { validation } from '../../../../utils/validation.js';
11
11
  import GraphCommand from '../../../base/GraphCommand.js';
12
12
  import commands from '../../commands.js';
@@ -58,13 +58,7 @@ class TeamsChannelSetCommand extends GraphCommand {
58
58
  if (args.options.teamId) {
59
59
  return args.options.teamId;
60
60
  }
61
- const group = await entraGroup.getGroupByDisplayName(args.options.teamName);
62
- if (group.resourceProvisioningOptions.indexOf('Team') === -1) {
63
- throw 'The specified team does not exist';
64
- }
65
- else {
66
- return group.id;
67
- }
61
+ return teams.getTeamIdByDisplayName(args.options.teamName);
68
62
  }
69
63
  async getChannelId(teamId, args) {
70
64
  if (args.options.id) {
@@ -5,8 +5,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
5
5
  };
6
6
  var _TeamsTabGetCommand_instances, _TeamsTabGetCommand_initTelemetry, _TeamsTabGetCommand_initOptions, _TeamsTabGetCommand_initValidators, _TeamsTabGetCommand_initOptionSets;
7
7
  import request from '../../../../request.js';
8
- import { entraGroup } from '../../../../utils/entraGroup.js';
9
8
  import { formatting } from '../../../../utils/formatting.js';
9
+ import { teams } from '../../../../utils/teams.js';
10
10
  import { validation } from '../../../../utils/validation.js';
11
11
  import GraphCommand from '../../../base/GraphCommand.js';
12
12
  import commands from '../../commands.js';
@@ -31,11 +31,7 @@ class TeamsTabGetCommand extends GraphCommand {
31
31
  if (args.options.teamId) {
32
32
  return args.options.teamId;
33
33
  }
34
- const group = await entraGroup.getGroupByDisplayName(args.options.teamName);
35
- if (group.resourceProvisioningOptions.indexOf('Team') === -1) {
36
- throw 'The specified team does not exist in the Microsoft Teams';
37
- }
38
- return group.id;
34
+ return teams.getTeamIdByDisplayName(args.options.teamName);
39
35
  }
40
36
  async getChannelId(args) {
41
37
  if (args.options.channelId) {
@@ -5,8 +5,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
5
5
  };
6
6
  var _TeamsTeamArchiveCommand_instances, _TeamsTeamArchiveCommand_initTelemetry, _TeamsTeamArchiveCommand_initOptions, _TeamsTeamArchiveCommand_initValidators, _TeamsTeamArchiveCommand_initOptionSets;
7
7
  import request from '../../../../request.js';
8
- import { entraGroup } from '../../../../utils/entraGroup.js';
9
8
  import { formatting } from '../../../../utils/formatting.js';
9
+ import { teams } from '../../../../utils/teams.js';
10
10
  import { validation } from '../../../../utils/validation.js';
11
11
  import GraphCommand from '../../../base/GraphCommand.js';
12
12
  import commands from '../../commands.js';
@@ -29,11 +29,7 @@ class TeamsTeamArchiveCommand extends GraphCommand {
29
29
  if (args.options.id) {
30
30
  return args.options.id;
31
31
  }
32
- const group = await entraGroup.getGroupByDisplayName(args.options.name);
33
- if (group.resourceProvisioningOptions.indexOf('Team') === -1) {
34
- throw 'The specified team does not exist in the Microsoft Teams';
35
- }
36
- return group.id;
32
+ return teams.getTeamIdByDisplayName(args.options.name);
37
33
  }
38
34
  async commandAction(logger, args) {
39
35
  const siteReadOnlyForMembers = args.options.shouldSetSpoSiteReadOnlyForMembers === true;
@@ -6,8 +6,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
6
6
  var _TeamsTeamRemoveCommand_instances, _TeamsTeamRemoveCommand_initTelemetry, _TeamsTeamRemoveCommand_initOptions, _TeamsTeamRemoveCommand_initValidators, _TeamsTeamRemoveCommand_initOptionSets;
7
7
  import { cli } from '../../../../cli/cli.js';
8
8
  import request from '../../../../request.js';
9
- import { entraGroup } from '../../../../utils/entraGroup.js';
10
9
  import { formatting } from '../../../../utils/formatting.js';
10
+ import { teams } from '../../../../utils/teams.js';
11
11
  import { validation } from '../../../../utils/validation.js';
12
12
  import GraphCommand from '../../../base/GraphCommand.js';
13
13
  import commands from '../../commands.js';
@@ -30,11 +30,7 @@ class TeamsTeamRemoveCommand extends GraphCommand {
30
30
  if (args.options.id) {
31
31
  return args.options.id;
32
32
  }
33
- const group = await entraGroup.getGroupByDisplayName(args.options.name);
34
- if (group.resourceProvisioningOptions.indexOf('Team') === -1) {
35
- throw `The specified team does not exist in the Microsoft Teams`;
36
- }
37
- return group.id;
33
+ return teams.getTeamIdByDisplayName(args.options.name);
38
34
  }
39
35
  async commandAction(logger, args) {
40
36
  const removeTeam = async () => {
@@ -5,8 +5,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
5
5
  };
6
6
  var _TeamsTeamUnarchiveCommand_instances, _TeamsTeamUnarchiveCommand_initOptions, _TeamsTeamUnarchiveCommand_initValidators, _TeamsTeamUnarchiveCommand_initOptionSets;
7
7
  import request from '../../../../request.js';
8
- import { entraGroup } from '../../../../utils/entraGroup.js';
9
8
  import { formatting } from '../../../../utils/formatting.js';
9
+ import { teams } from '../../../../utils/teams.js';
10
10
  import { validation } from '../../../../utils/validation.js';
11
11
  import GraphCommand from '../../../base/GraphCommand.js';
12
12
  import commands from '../../commands.js';
@@ -28,11 +28,7 @@ class TeamsTeamUnarchiveCommand extends GraphCommand {
28
28
  if (args.options.id) {
29
29
  return args.options.id;
30
30
  }
31
- const group = await entraGroup.getGroupByDisplayName(args.options.name);
32
- if (group.resourceProvisioningOptions.indexOf('Team') === -1) {
33
- throw 'The specified team does not exist in the Microsoft Teams';
34
- }
35
- return group.id;
31
+ return teams.getTeamIdByDisplayName(args.options.name);
36
32
  }
37
33
  async commandAction(logger, args) {
38
34
  const endpoint = `${this.resource}/v1.0`;
@@ -16,7 +16,10 @@ m365 spo site list [options]
16
16
 
17
17
  ```md definition-list
18
18
  `-t, --type [type]`
19
- : convenience option for type of sites to list. Allowed values are `TeamSite,CommunicationSite`.
19
+ : convenience option for type of sites to list. Allowed values are `TeamSite` and `CommunicationSite`.
20
+
21
+ `--state [state]`
22
+ : option to filter sites by their archived state. Allowed values are `active`, `fullyArchived`, `recentlyArchived` and `archived`.
20
23
 
21
24
  `--webTemplate [webTemplate]`
22
25
  : type of sites to list. To be used with values like `GROUP#0` and `SITEPAGEPUBLISHING#0`. Specify either `type` or `webTemplate`, but not both.
@@ -31,6 +34,12 @@ m365 spo site list [options]
31
34
  <Global />
32
35
 
33
36
  ## Remarks
37
+ When providing a value for option `state`, consider the following:
38
+
39
+ - `active`: return sites that are not archived
40
+ - `fullyArchived`: return sites that are fully archived (longer than 7 days)
41
+ - `recentlyArchived`: return sites that are recently archived (within 7 days)
42
+ - `archived`: return both recently archived and fully archived sites
34
43
 
35
44
  Using the `--filter` option you can specify which sites you want to retrieve. For example, to get sites with _project_ in their URL, use `Url -like 'project'` as the filter.
36
45
 
@@ -76,6 +85,18 @@ List all sites in the currently connected tenant including OneDrive sites.
76
85
  m365 spo site list --withOneDriveSites
77
86
  ```
78
87
 
88
+ List all active (non-archived) sites in the currently connected tenant.
89
+
90
+ ```sh
91
+ m365 spo site list --state active
92
+ ```
93
+
94
+ List all archived sites in the currently connected tenant.
95
+
96
+ ```sh
97
+ m365 spo site list --state archived
98
+ ```
99
+
79
100
  ## Response
80
101
 
81
102
  <Tabs>
@@ -17,22 +17,31 @@ m365 spo storageentity get [options]
17
17
  ```md definition-list
18
18
  `-k, --key <key>`
19
19
  : Name of the tenant property to retrieve
20
+
21
+ `-u, --appCatalogUrl [appCatalogUrl]`
22
+ : URL of the app catalog site. If not specified, the tenant app catalog URL will be used.
20
23
  ```
21
24
 
22
25
  <Global />
23
26
 
24
27
  ## Remarks
25
28
 
26
- Tenant properties are stored in the app catalog site associated with the site to which you are currently connected. When retrieving the specified tenant property, SharePoint will automatically find the associated app catalog and try to retrieve the property from it.
29
+ Tenant properties are stored in the app catalog site associated with the site to which you are currently connected. When retrieving the specified tenant property, SharePoint will use the specified app catalog URL or automatically resolve the tenant app catalog URL.
27
30
 
28
31
  ## Examples
29
32
 
30
- Show the value, description and comment of the _AnalyticsId_ tenant property
33
+ Show the value, description and comment of the _AnalyticsId_ tenant property using the tenant app catalog
31
34
 
32
35
  ```sh
33
36
  m365 spo storageentity get -k AnalyticsId
34
37
  ```
35
38
 
39
+ Show the value, description and comment of the _AnalyticsId_ tenant property from a specific app catalog site
40
+
41
+ ```sh
42
+ m365 spo storageentity get -k AnalyticsId -u https://contoso.sharepoint.com/sites/appcatalog
43
+ ```
44
+
36
45
  ## Response
37
46
 
38
47
  <Tabs>
@@ -15,18 +15,24 @@ m365 spo storageentity list [options]
15
15
  ## Options
16
16
 
17
17
  ```md definition-list
18
- `-u, --appCatalogUrl <appCatalogUrl>`
19
- : URL of the app catalog site
18
+ `-u, --appCatalogUrl [appCatalogUrl]`
19
+ : URL of the app catalog site. If not specified, the tenant app catalog URL will be used.
20
20
  ```
21
21
 
22
22
  <Global />
23
23
 
24
24
  ## Remarks
25
25
 
26
- Tenant properties are stored in the app catalog site. To list all tenant properties, you have to specify the absolute URL of the app catalog site. If you specify an incorrect URL, or the site at the given URL is not an app catalog site, no properties will be retrieved.
26
+ Tenant properties are stored in the app catalog site. To list all tenant properties, you can specify the absolute URL of the app catalog site. If not specified, the command will automatically resolve the tenant app catalog URL. If you specify an incorrect URL, or the site at the given URL is not an app catalog site, no properties will be retrieved.
27
27
 
28
28
  ## Examples
29
29
 
30
+ List all tenant properties using the tenant app catalog
31
+
32
+ ```sh
33
+ m365 spo storageentity list
34
+ ```
35
+
30
36
  List all tenant properties stored in the _https://contoso.sharepoint.com/sites/appcatalog_ app catalog site
31
37
 
32
38
  ```sh
@@ -13,8 +13,8 @@ m365 spo storageentity remove [options]
13
13
  ## Options
14
14
 
15
15
  ```md definition-list
16
- `-u, --appCatalogUrl <appCatalogUrl>`
17
- : URL of the app catalog site
16
+ `-u, --appCatalogUrl [appCatalogUrl]`
17
+ : URL of the app catalog site. If not specified, the tenant app catalog URL will be used.
18
18
 
19
19
  `-k, --key <key>`
20
20
  : Name of the tenant property to retrieve
@@ -27,7 +27,7 @@ m365 spo storageentity remove [options]
27
27
 
28
28
  ## Remarks
29
29
 
30
- Tenant properties are stored in the app catalog site associated with that tenant. To remove a property, you have to specify the absolute URL of the app catalog site. If you specify the URL of a site different than the app catalog, you will get an access denied error.
30
+ Tenant properties are stored in the app catalog site associated with that tenant. To remove a property, you can specify the absolute URL of the app catalog site. If not specified, the command will automatically resolve the tenant app catalog URL. If you specify the URL of a site different than the app catalog, you will get an access denied error.
31
31
 
32
32
  :::info
33
33
 
@@ -37,13 +37,13 @@ To use this command you must be either **SharePoint Administrator** or **Global
37
37
 
38
38
  ## Examples
39
39
 
40
- Remove the _AnalyticsId_ tenant property. Yields a confirmation prompt before actually removing the property
40
+ Remove the _AnalyticsId_ tenant property using the tenant app catalog. Yields a confirmation prompt before actually removing the property
41
41
 
42
42
  ```sh
43
- m365 spo storageentity remove -k AnalyticsId -u https://contoso.sharepoint.com/sites/appcatalog
43
+ m365 spo storageentity remove -k AnalyticsId
44
44
  ```
45
45
 
46
- Remove the _AnalyticsId_ tenant property. Suppresses the confirmation prompt
46
+ Remove the _AnalyticsId_ tenant property from a specific app catalog. Suppresses the confirmation prompt
47
47
 
48
48
  ```sh
49
49
  m365 spo storageentity remove -k AnalyticsId --force -u https://contoso.sharepoint.com/sites/appcatalog
@@ -13,8 +13,8 @@ m365 spo storageentity set [options]
13
13
  ## Options
14
14
 
15
15
  ```md definition-list
16
- `-u, --appCatalogUrl <appCatalogUrl>`
17
- : URL of the app catalog site
16
+ `-u, --appCatalogUrl [appCatalogUrl]`
17
+ : URL of the app catalog site. If not specified, the tenant app catalog URL will be used.
18
18
 
19
19
  `-k, --key <key>`
20
20
  : Name of the tenant property to retrieve
@@ -33,7 +33,7 @@ m365 spo storageentity set [options]
33
33
 
34
34
  ## Remarks
35
35
 
36
- Tenant properties are stored in the app catalog site associated with that tenant. To set a property, you have to specify the absolute URL of the app catalog site without a trailing slash. If you specify the URL with trailing slash you get the error `The managed path sites/apps is not a managed path in this tenant.`
36
+ Tenant properties are stored in the app catalog site associated with that tenant. To set a property, you can specify the absolute URL of the app catalog site without a trailing slash. If not specified, the command will automatically resolve the tenant app catalog URL. If you specify the URL with trailing slash you get the error `The managed path sites/apps is not a managed path in this tenant.`
37
37
 
38
38
  If you specify the URL of a site different than the app catalog, you will get an access denied error.
39
39
 
@@ -45,7 +45,13 @@ To use this command you must be either **SharePoint Administrator** or **Global
45
45
 
46
46
  ## Examples
47
47
 
48
- Set _123_ as the value of the _AnalyticsId_ tenant property. Also include a description and a comment for additional clarification of the usage of the property.
48
+ Set _123_ as the value of the _AnalyticsId_ tenant property using the tenant app catalog
49
+
50
+ ```sh
51
+ m365 spo storageentity set -k AnalyticsId -v 123 -d 'Web analytics ID' -c 'Use on all sites'
52
+ ```
53
+
54
+ Set _123_ as the value of the _AnalyticsId_ tenant property on a specific app catalog site
49
55
 
50
56
  ```sh
51
57
  m365 spo storageentity set -k AnalyticsId -v 123 -d 'Web analytics ID' -c 'Use on all sites' -u https://contoso.sharepoint.com/sites/appcatalog
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pnp/cli-microsoft365",
3
- "version": "12.0.0-beta.0be7d8d",
3
+ "version": "12.0.0-beta.e4f7675",
4
4
  "description": "Manage Microsoft 365 and SharePoint Framework projects on any platform",
5
5
  "license": "MIT",
6
6
  "main": "./dist/api.js",