@pnp/cli-microsoft365 12.0.0-beta.d654135 → 12.0.0-beta.f682e10

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 (41) hide show
  1. package/.devproxy/generate-openapi-spec.json +1 -1
  2. package/allCommands.json +1 -1
  3. package/allCommandsFull.json +1 -1
  4. package/dist/googleAnalytics.js +96 -0
  5. package/dist/m365/spo/commands/file/file-get.js +4 -3
  6. package/dist/m365/spo/commands/folder/folder-unarchive.js +90 -0
  7. package/dist/m365/spo/commands/listitem/listitem-get.js +1 -12
  8. package/dist/m365/spo/commands.js +2 -1
  9. package/dist/m365/teams/commands/channel/channel-add.js +46 -57
  10. package/dist/m365/teams/commands/channel/channel-get.js +41 -48
  11. package/dist/m365/teams/commands/channel/channel-list.js +28 -42
  12. package/dist/m365/teams/commands/channel/channel-member-add.js +53 -54
  13. package/dist/m365/teams/commands/channel/channel-member-list.js +47 -55
  14. package/dist/m365/teams/commands/channel/channel-member-remove.js +62 -62
  15. package/dist/m365/teams/commands/channel/channel-member-set.js +61 -65
  16. package/dist/m365/teams/commands/channel/channel-remove.js +47 -49
  17. package/dist/m365/teams/commands/channel/channel-set.js +47 -54
  18. package/dist/m365/util/commands/accesstoken/accesstoken-get.js +10 -28
  19. package/dist/telemetry.js +7 -11
  20. package/dist/utils/spo.js +1 -3
  21. package/dist/utils/urlUtil.js +2 -2
  22. package/docs/docs/cmd/spo/file/file-archive.mdx +1 -1
  23. package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +21 -0
  24. package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +23 -0
  25. package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +21 -0
  26. package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +21 -0
  27. package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +23 -0
  28. package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +21 -0
  29. package/docs/docs/cmd/spo/file/file-unarchive.mdx +1 -1
  30. package/docs/docs/cmd/spo/folder/folder-archive.mdx +1 -1
  31. package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +21 -0
  32. package/docs/docs/cmd/spo/folder/folder-sharinglink-clear.mdx +23 -0
  33. package/docs/docs/cmd/spo/folder/folder-sharinglink-get.mdx +21 -0
  34. package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +21 -0
  35. package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +23 -0
  36. package/docs/docs/cmd/spo/folder/folder-sharinglink-set.mdx +21 -0
  37. package/docs/docs/cmd/spo/folder/folder-unarchive.mdx +76 -0
  38. package/docs/docs/cmd/spo/listitem/listitem-get.mdx +0 -6
  39. package/npm-shrinkwrap.json +324 -3116
  40. package/package.json +15 -30
  41. package/dist/appInsights.js +0 -43
@@ -1,9 +1,3 @@
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 _TeamsChannelRemoveCommand_instances, _TeamsChannelRemoveCommand_initTelemetry, _TeamsChannelRemoveCommand_initOptions, _TeamsChannelRemoveCommand_initValidators, _TeamsChannelRemoveCommand_initOptionSets;
7
1
  import { cli } from '../../../../cli/cli.js';
8
2
  import request from '../../../../request.js';
9
3
  import { formatting } from '../../../../utils/formatting.js';
@@ -11,21 +5,60 @@ import { teams } from '../../../../utils/teams.js';
11
5
  import { validation } from '../../../../utils/validation.js';
12
6
  import GraphCommand from '../../../base/GraphCommand.js';
13
7
  import commands from '../../commands.js';
8
+ import { globalOptionsZod } from '../../../../Command.js';
9
+ import { z } from 'zod';
10
+ export const options = z.strictObject({
11
+ ...globalOptionsZod.shape,
12
+ id: z.string()
13
+ .refine(val => validation.isValidTeamsChannelId(val), {
14
+ message: 'The value is not a valid Teams channel id.'
15
+ })
16
+ .optional()
17
+ .alias('i'),
18
+ name: z.string()
19
+ .optional()
20
+ .alias('n'),
21
+ teamId: z.string()
22
+ .refine(val => validation.isValidGuid(val), {
23
+ message: 'The value must be a valid GUID.'
24
+ })
25
+ .optional(),
26
+ teamName: z.string()
27
+ .optional(),
28
+ force: z.boolean()
29
+ .optional()
30
+ .alias('f')
31
+ });
14
32
  class TeamsChannelRemoveCommand extends GraphCommand {
33
+ constructor() {
34
+ super(...arguments);
35
+ this.teamId = "";
36
+ }
15
37
  get name() {
16
38
  return commands.CHANNEL_REMOVE;
17
39
  }
18
40
  get description() {
19
41
  return 'Removes the specified channel in the Microsoft Teams team';
20
42
  }
21
- constructor() {
22
- super();
23
- _TeamsChannelRemoveCommand_instances.add(this);
24
- this.teamId = "";
25
- __classPrivateFieldGet(this, _TeamsChannelRemoveCommand_instances, "m", _TeamsChannelRemoveCommand_initTelemetry).call(this);
26
- __classPrivateFieldGet(this, _TeamsChannelRemoveCommand_instances, "m", _TeamsChannelRemoveCommand_initOptions).call(this);
27
- __classPrivateFieldGet(this, _TeamsChannelRemoveCommand_instances, "m", _TeamsChannelRemoveCommand_initValidators).call(this);
28
- __classPrivateFieldGet(this, _TeamsChannelRemoveCommand_instances, "m", _TeamsChannelRemoveCommand_initOptionSets).call(this);
43
+ get schema() {
44
+ return options;
45
+ }
46
+ getRefinedSchema(schema) {
47
+ return schema
48
+ .refine(opts => [opts.id, opts.name].filter(x => x !== undefined).length === 1, {
49
+ message: 'Specify either id or name, but not both.',
50
+ params: {
51
+ customCode: 'optionSet',
52
+ options: ['id', 'name']
53
+ }
54
+ })
55
+ .refine(opts => [opts.teamId, opts.teamName].filter(x => x !== undefined).length === 1, {
56
+ message: 'Specify either teamId or teamName, but not both.',
57
+ params: {
58
+ customCode: 'optionSet',
59
+ options: ['teamId', 'teamName']
60
+ }
61
+ });
29
62
  }
30
63
  async commandAction(logger, args) {
31
64
  const removeChannel = async () => {
@@ -84,40 +117,5 @@ class TeamsChannelRemoveCommand extends GraphCommand {
84
117
  return channelItem.id;
85
118
  }
86
119
  }
87
- _TeamsChannelRemoveCommand_instances = new WeakSet(), _TeamsChannelRemoveCommand_initTelemetry = function _TeamsChannelRemoveCommand_initTelemetry() {
88
- this.telemetry.push((args) => {
89
- Object.assign(this.telemetryProperties, {
90
- id: typeof args.options.id !== 'undefined',
91
- name: typeof args.options.name !== 'undefined',
92
- teamId: typeof args.options.teamId !== 'undefined',
93
- teamName: typeof args.options.teamName !== 'undefined',
94
- force: (!(!args.options.force)).toString()
95
- });
96
- });
97
- }, _TeamsChannelRemoveCommand_initOptions = function _TeamsChannelRemoveCommand_initOptions() {
98
- this.options.unshift({
99
- option: '--teamId [teamId]'
100
- }, {
101
- option: '--teamName [teamName]'
102
- }, {
103
- option: '-i, --id [id]'
104
- }, {
105
- option: '-n, --name [name]'
106
- }, {
107
- option: '-f, --force'
108
- });
109
- }, _TeamsChannelRemoveCommand_initValidators = function _TeamsChannelRemoveCommand_initValidators() {
110
- this.validators.push(async (args) => {
111
- if (args.options.id && !validation.isValidTeamsChannelId(args.options.id)) {
112
- return `${args.options.id} is not a valid Teams channel id`;
113
- }
114
- if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
115
- return `${args.options.teamId} is not a valid GUID`;
116
- }
117
- return true;
118
- });
119
- }, _TeamsChannelRemoveCommand_initOptionSets = function _TeamsChannelRemoveCommand_initOptionSets() {
120
- this.optionSets.push({ options: ['id', 'name'] }, { options: ['teamId', 'teamName'] });
121
- };
122
120
  export default new TeamsChannelRemoveCommand();
123
121
  //# sourceMappingURL=channel-remove.js.map
@@ -1,15 +1,37 @@
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 _TeamsChannelSetCommand_instances, _TeamsChannelSetCommand_initTelemetry, _TeamsChannelSetCommand_initOptions, _TeamsChannelSetCommand_initValidators, _TeamsChannelSetCommand_initOptionSets;
7
1
  import request from '../../../../request.js';
8
2
  import { formatting } from '../../../../utils/formatting.js';
9
3
  import { teams } from '../../../../utils/teams.js';
10
4
  import { validation } from '../../../../utils/validation.js';
11
5
  import GraphCommand from '../../../base/GraphCommand.js';
12
6
  import commands from '../../commands.js';
7
+ import { globalOptionsZod } from '../../../../Command.js';
8
+ import { z } from 'zod';
9
+ export const options = z.strictObject({
10
+ ...globalOptionsZod.shape,
11
+ id: z.string()
12
+ .refine(val => validation.isValidTeamsChannelId(val), {
13
+ message: 'The value is not a valid Teams channel id.'
14
+ })
15
+ .optional()
16
+ .alias('i'),
17
+ name: z.string()
18
+ .refine(val => val.toLowerCase() !== 'general', {
19
+ message: 'General channel cannot be updated.'
20
+ })
21
+ .optional()
22
+ .alias('n'),
23
+ description: z.string()
24
+ .optional(),
25
+ newName: z.string()
26
+ .optional(),
27
+ teamId: z.string()
28
+ .refine(val => validation.isValidGuid(val), {
29
+ message: 'The value must be a valid GUID.'
30
+ })
31
+ .optional(),
32
+ teamName: z.string()
33
+ .optional()
34
+ });
13
35
  class TeamsChannelSetCommand extends GraphCommand {
14
36
  get name() {
15
37
  return commands.CHANNEL_SET;
@@ -17,13 +39,25 @@ class TeamsChannelSetCommand extends GraphCommand {
17
39
  get description() {
18
40
  return 'Updates properties of the specified channel in the given Microsoft Teams team';
19
41
  }
20
- constructor() {
21
- super();
22
- _TeamsChannelSetCommand_instances.add(this);
23
- __classPrivateFieldGet(this, _TeamsChannelSetCommand_instances, "m", _TeamsChannelSetCommand_initTelemetry).call(this);
24
- __classPrivateFieldGet(this, _TeamsChannelSetCommand_instances, "m", _TeamsChannelSetCommand_initOptions).call(this);
25
- __classPrivateFieldGet(this, _TeamsChannelSetCommand_instances, "m", _TeamsChannelSetCommand_initValidators).call(this);
26
- __classPrivateFieldGet(this, _TeamsChannelSetCommand_instances, "m", _TeamsChannelSetCommand_initOptionSets).call(this);
42
+ get schema() {
43
+ return options;
44
+ }
45
+ getRefinedSchema(schema) {
46
+ return schema
47
+ .refine(opts => [opts.id, opts.name].filter(x => x !== undefined).length === 1, {
48
+ message: 'Specify either id or name, but not both.',
49
+ params: {
50
+ customCode: 'optionSet',
51
+ options: ['id', 'name']
52
+ }
53
+ })
54
+ .refine(opts => [opts.teamId, opts.teamName].filter(x => x !== undefined).length === 1, {
55
+ message: 'Specify either teamId or teamName, but not both.',
56
+ params: {
57
+ customCode: 'optionSet',
58
+ options: ['teamId', 'teamName']
59
+ }
60
+ });
27
61
  }
28
62
  async commandAction(logger, args) {
29
63
  try {
@@ -79,46 +113,5 @@ class TeamsChannelSetCommand extends GraphCommand {
79
113
  return channelItem.id;
80
114
  }
81
115
  }
82
- _TeamsChannelSetCommand_instances = new WeakSet(), _TeamsChannelSetCommand_initTelemetry = function _TeamsChannelSetCommand_initTelemetry() {
83
- this.telemetry.push((args) => {
84
- Object.assign(this.telemetryProperties, {
85
- id: typeof args.options.id !== 'undefined',
86
- name: typeof args.options.name !== 'undefined',
87
- teamId: typeof args.options.teamId !== 'undefined',
88
- teamName: typeof args.options.teamName !== 'undefined',
89
- newName: typeof args.options.newName !== 'undefined',
90
- description: typeof args.options.description !== 'undefined'
91
- });
92
- });
93
- }, _TeamsChannelSetCommand_initOptions = function _TeamsChannelSetCommand_initOptions() {
94
- this.options.unshift({
95
- option: '--teamId [teamId]'
96
- }, {
97
- option: '--teamName [teamName]'
98
- }, {
99
- option: '-i, --id [id]'
100
- }, {
101
- option: '-n, --name [name]'
102
- }, {
103
- option: '--newName [newName]'
104
- }, {
105
- option: '--description [description]'
106
- });
107
- }, _TeamsChannelSetCommand_initValidators = function _TeamsChannelSetCommand_initValidators() {
108
- this.validators.push(async (args) => {
109
- if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
110
- return `${args.options.teamId} is not a valid GUID`;
111
- }
112
- if (args.options.id && !validation.isValidTeamsChannelId(args.options.id)) {
113
- return `${args.options.id} is not a valid Teams channel id`;
114
- }
115
- if (args.options.name && args.options.name.toLowerCase() === "general") {
116
- return 'General channel cannot be updated';
117
- }
118
- return true;
119
- });
120
- }, _TeamsChannelSetCommand_initOptionSets = function _TeamsChannelSetCommand_initOptionSets() {
121
- this.optionSets.push({ options: ['id', 'name'] }, { options: ['teamId', 'teamName'] });
122
- };
123
116
  export default new TeamsChannelSetCommand();
124
117
  //# sourceMappingURL=channel-set.js.map
@@ -1,13 +1,14 @@
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 _UtilAccessTokenGetCommand_instances, _UtilAccessTokenGetCommand_initTelemetry, _UtilAccessTokenGetCommand_initOptions;
1
+ import { z } from 'zod';
7
2
  import auth, { Auth } from '../../../../Auth.js';
8
- import Command from '../../../../Command.js';
3
+ import Command, { globalOptionsZod } from '../../../../Command.js';
9
4
  import commands from '../../commands.js';
10
5
  import { accessToken } from '../../../../utils/accessToken.js';
6
+ export const options = z.strictObject({
7
+ ...globalOptionsZod.shape,
8
+ resource: z.string().alias('r'),
9
+ new: z.boolean().optional(),
10
+ decoded: z.boolean().optional()
11
+ });
11
12
  class UtilAccessTokenGetCommand extends Command {
12
13
  get name() {
13
14
  return commands.ACCESSTOKEN_GET;
@@ -15,11 +16,8 @@ class UtilAccessTokenGetCommand extends Command {
15
16
  get description() {
16
17
  return 'Gets access token for the specified resource';
17
18
  }
18
- constructor() {
19
- super();
20
- _UtilAccessTokenGetCommand_instances.add(this);
21
- __classPrivateFieldGet(this, _UtilAccessTokenGetCommand_instances, "m", _UtilAccessTokenGetCommand_initTelemetry).call(this);
22
- __classPrivateFieldGet(this, _UtilAccessTokenGetCommand_instances, "m", _UtilAccessTokenGetCommand_initOptions).call(this);
19
+ get schema() {
20
+ return options;
23
21
  }
24
22
  async commandAction(logger, args) {
25
23
  let resource = args.options.resource;
@@ -49,21 +47,5 @@ class UtilAccessTokenGetCommand extends Command {
49
47
  }
50
48
  }
51
49
  }
52
- _UtilAccessTokenGetCommand_instances = new WeakSet(), _UtilAccessTokenGetCommand_initTelemetry = function _UtilAccessTokenGetCommand_initTelemetry() {
53
- this.telemetry.push((args) => {
54
- Object.assign(this.telemetryProperties, {
55
- new: args.options.new,
56
- decoded: args.options.decoded
57
- });
58
- });
59
- }, _UtilAccessTokenGetCommand_initOptions = function _UtilAccessTokenGetCommand_initOptions() {
60
- this.options.unshift({
61
- option: '-r, --resource <resource>'
62
- }, {
63
- option: '--new'
64
- }, {
65
- option: '--decoded'
66
- });
67
- };
68
50
  export default new UtilAccessTokenGetCommand();
69
51
  //# sourceMappingURL=accesstoken-get.js.map
package/dist/telemetry.js CHANGED
@@ -1,25 +1,21 @@
1
- import appInsights from './appInsights.js';
2
1
  import { cli } from './cli/cli.js';
2
+ import { googleAnalytics } from './googleAnalytics.js';
3
3
  import { settingsNames } from './settingsNames.js';
4
4
  import { pid } from './utils/pid.js';
5
5
  import { session } from './utils/session.js';
6
6
  async function trackTelemetry(object) {
7
7
  try {
8
8
  const { commandName, properties, exception } = object;
9
- appInsights.commonProperties.shell = pid.getProcessName(process.ppid) || '';
10
- appInsights.context.tags[appInsights.context.keys.sessionId] = session.getId(process.ppid);
9
+ const context = {
10
+ shell: pid.getProcessName(process.ppid) || '',
11
+ sessionId: session.getId(process.ppid)
12
+ };
11
13
  if (exception) {
12
- appInsights.trackException({
13
- exception
14
- });
14
+ await googleAnalytics.trackException(exception, context);
15
15
  }
16
16
  else {
17
- appInsights.trackEvent({
18
- name: commandName,
19
- properties
20
- });
17
+ await googleAnalytics.trackEvent(commandName, properties, context);
21
18
  }
22
- await appInsights.flush();
23
19
  }
24
20
  catch {
25
21
  // Do nothing
package/dist/utils/spo.js CHANGED
@@ -1250,9 +1250,7 @@ export const spo = {
1250
1250
  // Neither properties nor contentTypeName provided, no need to proceed
1251
1251
  throw 'Either properties or contentTypeName must be provided for systemUpdateListItem.';
1252
1252
  }
1253
- const parsedUrl = new URL(absoluteListUrl);
1254
- const serverRelativeSiteMatch = absoluteListUrl.match(new RegExp('/sites/[^/]+'));
1255
- const webUrl = `${parsedUrl.protocol}//${parsedUrl.host}${serverRelativeSiteMatch ?? ''}`;
1253
+ const webUrl = absoluteListUrl.substring(0, absoluteListUrl.indexOf('/_api/'));
1256
1254
  if (verbose && logger) {
1257
1255
  await logger.logToStderr(`Getting list id...`);
1258
1256
  }
@@ -165,8 +165,8 @@ export const urlUtil = {
165
165
  */
166
166
  getTargetSiteAbsoluteUrl(webUrl, url) {
167
167
  const fullUrl = url.startsWith('https://') ? url : urlUtil.getAbsoluteUrl(webUrl, url);
168
- // Pattern to match SharePoint URLs
169
- const urlPattern = /https:\/\/[\w-]+\.sharepoint\.com\/(teams|sites|personal)\/([\w-]+)/;
168
+ // Pattern to match SharePoint site collection URLs on any of the supported managed paths
169
+ const urlPattern = /^https:\/\/[\w-]+\.sharepoint\.com\/(teams|sites|personal)\/[^/?#]+/i;
170
170
  const match = fullUrl.match(urlPattern);
171
171
  if (match) {
172
172
  // If a match is found, return the matched URL
@@ -22,7 +22,7 @@ m365 spo file archive [options]
22
22
  : The server- or site-relative decoded URL of the file to archive. Specify either `url` or `id`, but not both.
23
23
 
24
24
  `-i, --id [id]`
25
- : The UniqueId (GUID) of the file to archive. Specify either `url` or `id`, but not both.
25
+ : The unique ID (GUID) of the file to archive. Specify either `url` or `id`, but not both.
26
26
 
27
27
  `-f, --force`
28
28
  : Don't prompt for confirmation.
@@ -36,6 +36,27 @@ m365 spo file sharinglink add [options]
36
36
 
37
37
  <Global />
38
38
 
39
+ ## Permissions
40
+
41
+ <Tabs>
42
+ <TabItem value="Delegated">
43
+
44
+ | Resource | Permissions |
45
+ |-----------------|-----------------|
46
+ | Microsoft Graph | Files.ReadWrite |
47
+ | SharePoint | AllSites.Read |
48
+
49
+ </TabItem>
50
+ <TabItem value="Application">
51
+
52
+ | Resource | Permissions |
53
+ |-----------------|---------------------|
54
+ | Microsoft Graph | Files.ReadWrite.All |
55
+ | SharePoint | Sites.Read.All |
56
+
57
+ </TabItem>
58
+ </Tabs>
59
+
39
60
  ## Examples
40
61
 
41
62
  Creates a sharing link of a specific type for a file by id.
@@ -1,4 +1,6 @@
1
1
  import Global from '../../_global.mdx';
2
+ import Tabs from '@theme/Tabs';
3
+ import TabItem from '@theme/TabItem';
2
4
 
3
5
  # spo file sharinglink clear
4
6
 
@@ -31,6 +33,27 @@ m365 spo file sharinglink clear [options]
31
33
 
32
34
  <Global />
33
35
 
36
+ ## Permissions
37
+
38
+ <Tabs>
39
+ <TabItem value="Delegated">
40
+
41
+ | Resource | Permissions |
42
+ |-----------------|-----------------|
43
+ | Microsoft Graph | Files.ReadWrite |
44
+ | SharePoint | AllSites.Read |
45
+
46
+ </TabItem>
47
+ <TabItem value="Application">
48
+
49
+ | Resource | Permissions |
50
+ |-----------------|---------------------|
51
+ | Microsoft Graph | Files.ReadWrite.All |
52
+ | SharePoint | Sites.Read.All |
53
+
54
+ </TabItem>
55
+ </Tabs>
56
+
34
57
  ## Examples
35
58
 
36
59
  Removes all sharing links from a file specified by id without prompting for confirmation.
@@ -30,6 +30,27 @@ m365 spo file sharinglink get [options]
30
30
 
31
31
  <Global />
32
32
 
33
+ ## Permissions
34
+
35
+ <Tabs>
36
+ <TabItem value="Delegated">
37
+
38
+ | Resource | Permissions |
39
+ |-----------------|---------------|
40
+ | Microsoft Graph | Files.Read |
41
+ | SharePoint | AllSites.Read |
42
+
43
+ </TabItem>
44
+ <TabItem value="Application">
45
+
46
+ | Resource | Permissions |
47
+ |-----------------|----------------|
48
+ | Microsoft Graph | Files.Read.All |
49
+ | SharePoint | Sites.Read.All |
50
+
51
+ </TabItem>
52
+ </Tabs>
53
+
33
54
  ## Examples
34
55
 
35
56
  Gets a specific sharing link of a file by id.
@@ -30,6 +30,27 @@ m365 spo file sharinglink list [options]
30
30
 
31
31
  <Global />
32
32
 
33
+ ## Permissions
34
+
35
+ <Tabs>
36
+ <TabItem value="Delegated">
37
+
38
+ | Resource | Permissions |
39
+ |-----------------|---------------|
40
+ | Microsoft Graph | Files.Read |
41
+ | SharePoint | AllSites.Read |
42
+
43
+ </TabItem>
44
+ <TabItem value="Application">
45
+
46
+ | Resource | Permissions |
47
+ |-----------------|----------------|
48
+ | Microsoft Graph | Files.Read.All |
49
+ | SharePoint | Sites.Read.All |
50
+
51
+ </TabItem>
52
+ </Tabs>
53
+
33
54
  ## Examples
34
55
 
35
56
  List sharing links of a file by id.
@@ -1,4 +1,6 @@
1
1
  import Global from '../../_global.mdx';
2
+ import Tabs from '@theme/Tabs';
3
+ import TabItem from '@theme/TabItem';
2
4
 
3
5
  # spo file sharinglink remove
4
6
 
@@ -31,6 +33,27 @@ m365 spo file sharinglink remove [options]
31
33
 
32
34
  <Global />
33
35
 
36
+ ## Permissions
37
+
38
+ <Tabs>
39
+ <TabItem value="Delegated">
40
+
41
+ | Resource | Permissions |
42
+ |-----------------|-----------------|
43
+ | Microsoft Graph | Files.ReadWrite |
44
+ | SharePoint | AllSites.Read |
45
+
46
+ </TabItem>
47
+ <TabItem value="Application">
48
+
49
+ | Resource | Permissions |
50
+ |-----------------|---------------------|
51
+ | Microsoft Graph | Files.ReadWrite.All |
52
+ | SharePoint | Sites.Read.All |
53
+
54
+ </TabItem>
55
+ </Tabs>
56
+
34
57
  ## Examples
35
58
 
36
59
  Removes a specific sharing link from a file by id without prompting for confirmation.
@@ -33,6 +33,27 @@ m365 spo file sharinglink set [options]
33
33
 
34
34
  <Global />
35
35
 
36
+ ## Permissions
37
+
38
+ <Tabs>
39
+ <TabItem value="Delegated">
40
+
41
+ | Resource | Permissions |
42
+ |-----------------|-----------------|
43
+ | Microsoft Graph | Files.ReadWrite |
44
+ | SharePoint | AllSites.Read |
45
+
46
+ </TabItem>
47
+ <TabItem value="Application">
48
+
49
+ | Resource | Permissions |
50
+ |-----------------|---------------------|
51
+ | Microsoft Graph | Files.ReadWrite.All |
52
+ | SharePoint | Sites.Read.All |
53
+
54
+ </TabItem>
55
+ </Tabs>
56
+
36
57
  ## Examples
37
58
 
38
59
  Updates an anonymous sharing link from a file by a specified site-relative URL with the expirationDateTime parameter.
@@ -22,7 +22,7 @@ m365 spo file unarchive [options]
22
22
  : The server- or site-relative decoded URL of the file to unarchive. Specify either `url` or `id`, but not both.
23
23
 
24
24
  `-i, --id [id]`
25
- : The UniqueId (GUID) of the file to unarchive. Specify either `url` or `id`, but not both.
25
+ : The unique ID (GUID) of the file to unarchive. Specify either `url` or `id`, but not both.
26
26
 
27
27
  `-f, --force`
28
28
  : Don't prompt for confirmation.
@@ -22,7 +22,7 @@ m365 spo folder archive [options]
22
22
  : The server- or site-relative decoded URL of the folder to archive. Specify either `url` or `id`, but not both.
23
23
 
24
24
  `-i, --id [id]`
25
- : The UniqueId (GUID) of the folder to archive. Specify either `url` or `id`, but not both.
25
+ : The unique ID (GUID) of the folder to archive. Specify either `url` or `id`, but not both.
26
26
 
27
27
  `-f, --force`
28
28
  : Don't prompt for confirmation.
@@ -42,6 +42,27 @@ m365 spo folder sharinglink add [options]
42
42
 
43
43
  <Global />
44
44
 
45
+ ## Permissions
46
+
47
+ <Tabs>
48
+ <TabItem value="Delegated">
49
+
50
+ | Resource | Permissions |
51
+ |-----------------|---------------------------------|
52
+ | Microsoft Graph | Files.ReadWrite, Sites.Read.All |
53
+ | SharePoint | AllSites.Read |
54
+
55
+ </TabItem>
56
+ <TabItem value="Application">
57
+
58
+ | Resource | Permissions |
59
+ |-----------------|-------------------------------------|
60
+ | Microsoft Graph | Files.ReadWrite.All, Sites.Read.All |
61
+ | SharePoint | Sites.Read.All |
62
+
63
+ </TabItem>
64
+ </Tabs>
65
+
45
66
  ## Examples
46
67
 
47
68
  Creates a view-only anonymous sharing link of a folder by id.
@@ -1,4 +1,6 @@
1
1
  import Global from '../../_global.mdx';
2
+ import Tabs from '@theme/Tabs';
3
+ import TabItem from '@theme/TabItem';
2
4
 
3
5
  # spo folder sharinglink clear
4
6
 
@@ -31,6 +33,27 @@ m365 spo folder sharinglink clear [options]
31
33
 
32
34
  <Global />
33
35
 
36
+ ## Permissions
37
+
38
+ <Tabs>
39
+ <TabItem value="Delegated">
40
+
41
+ | Resource | Permissions |
42
+ |-----------------|---------------------------------|
43
+ | Microsoft Graph | Files.ReadWrite, Sites.Read.All |
44
+ | SharePoint | AllSites.Read |
45
+
46
+ </TabItem>
47
+ <TabItem value="Application">
48
+
49
+ | Resource | Permissions |
50
+ |-----------------|-------------------------------------|
51
+ | Microsoft Graph | Files.ReadWrite.All, Sites.Read.All |
52
+ | SharePoint | Sites.Read.All |
53
+
54
+ </TabItem>
55
+ </Tabs>
56
+
34
57
  ## Examples
35
58
 
36
59
  Removes all sharing links from a folder specified by id without prompting for confirmation.
@@ -30,6 +30,27 @@ m365 spo folder sharinglink get [options]
30
30
 
31
31
  <Global />
32
32
 
33
+ ## Permissions
34
+
35
+ <Tabs>
36
+ <TabItem value="Delegated">
37
+
38
+ | Resource | Permissions |
39
+ |-----------------|----------------------------|
40
+ | Microsoft Graph | Files.Read, Sites.Read.All |
41
+ | SharePoint | AllSites.Read |
42
+
43
+ </TabItem>
44
+ <TabItem value="Application">
45
+
46
+ | Resource | Permissions |
47
+ |-----------------|--------------------------------|
48
+ | Microsoft Graph | Files.Read.All, Sites.Read.All |
49
+ | SharePoint | Sites.Read.All |
50
+
51
+ </TabItem>
52
+ </Tabs>
53
+
33
54
  ## Examples
34
55
 
35
56
  Gets a specific sharing link of a folder by id.