@pnp/cli-microsoft365 9.0.0-beta.d6b190a → 9.0.0-beta.e69e8d0
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/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +1 -1
- package/dist/config.js +1 -1
- package/dist/m365/app/commands/permission/permission-add.js +9 -9
- package/dist/m365/commands/status.js +2 -2
- package/dist/m365/connection/commands/connection-remove.js +6 -2
- package/dist/m365/connection/commands/connection-set.js +4 -1
- package/dist/m365/connection/commands/connection-use.js +25 -4
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-add.js +13 -13
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-get.js +18 -18
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-list.js +1 -1
- package/dist/m365/entra/commands/group/group-user-list.js +4 -4
- package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +4 -4
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +3 -3
- package/dist/m365/entra/commands/m365group/m365group-user-add.js +109 -32
- package/dist/m365/entra/commands/m365group/m365group-user-list.js +6 -9
- package/dist/m365/entra/commands/m365group/m365group-user-set.js +159 -84
- package/dist/m365/entra/commands/multitenant/multitenant-add.js +65 -0
- package/dist/m365/entra/commands/multitenant/multitenant-remove.js +118 -0
- package/dist/m365/entra/commands/multitenant/multitenant-set.js +72 -0
- package/dist/m365/entra/commands.js +3 -0
- package/dist/m365/flow/commands/flow-get.js +1 -1
- package/dist/m365/outlook/commands/message/message-get.js +11 -11
- package/dist/m365/pa/commands/app/app-export.js +13 -7
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +1 -1
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +1 -10
- package/dist/m365/spo/commands/file/file-copy.js +55 -34
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +1 -1
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +1 -1
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +1 -1
- package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +1 -1
- package/dist/m365/spo/commands/folder/folder-set.js +0 -4
- package/dist/m365/spo/commands/folder/folder-sharinglink-get.js +86 -0
- package/dist/m365/spo/commands/folder/folder-sharinglink-list.js +110 -0
- package/dist/m365/spo/commands/list/ListInstance.js +6 -1
- package/dist/m365/spo/commands/list/list-get.js +9 -3
- package/dist/m365/spo/commands/list/list-list.js +1 -4
- package/dist/m365/spo/commands/list/list-roleassignment-add.js +46 -21
- package/dist/m365/spo/commands/list/list-roleassignment-remove.js +48 -46
- package/dist/m365/spo/commands/site/site-appcatalog-remove.js +48 -24
- package/dist/m365/spo/commands/site/site-remove.js +1 -7
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-restore.js +2 -22
- package/dist/m365/spo/commands.js +2 -1
- package/dist/utils/drive.js +61 -0
- package/dist/utils/spo.js +143 -6
- package/docs/docs/cmd/app/permission/permission-add.mdx +5 -5
- package/docs/docs/cmd/connection/connection-use.mdx +8 -2
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx +12 -12
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx +14 -14
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-list.mdx +5 -5
- package/docs/docs/cmd/entra/group/group-user-list.mdx +7 -7
- package/docs/docs/cmd/entra/m365group/m365group-conversation-post-list.mdx +5 -5
- package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-list.mdx +3 -3
- package/docs/docs/cmd/entra/m365group/m365group-user-add.mdx +28 -10
- package/docs/docs/cmd/entra/m365group/m365group-user-list.mdx +1 -1
- package/docs/docs/cmd/entra/m365group/m365group-user-set.mdx +35 -11
- package/docs/docs/cmd/entra/multitenant/multitenant-add.mdx +107 -0
- package/docs/docs/cmd/entra/multitenant/multitenant-remove.mdx +58 -0
- package/docs/docs/cmd/entra/multitenant/multitenant-set.mdx +53 -0
- package/docs/docs/cmd/flow/flow-get.mdx +149 -283
- package/docs/docs/cmd/outlook/message/message-get.mdx +5 -5
- package/docs/docs/cmd/pa/app/app-export.mdx +15 -9
- package/docs/docs/cmd/planner/plan/plan-remove.mdx +1 -1
- package/docs/docs/cmd/spe/containertype/containertype-list.mdx +24 -53
- package/docs/docs/cmd/spfx/project/project-github-workflow-add.mdx +11 -12
- package/docs/docs/cmd/spo/app/app-uninstall.mdx +1 -1
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-get.mdx +4 -4
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-list.mdx +4 -4
- package/docs/docs/cmd/spo/file/file-copy.mdx +119 -12
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +2 -2
- package/docs/docs/cmd/spo/folder/folder-set.mdx +0 -6
- package/docs/docs/cmd/spo/folder/folder-sharinglink-get.mdx +110 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +114 -0
- package/docs/docs/cmd/spo/list/list-get.mdx +6 -0
- package/docs/docs/cmd/spo/list/list-list.mdx +5 -7
- package/docs/docs/cmd/spo/list/list-roleassignment-add.mdx +15 -3
- package/docs/docs/cmd/spo/list/list-roleassignment-remove.mdx +15 -3
- package/docs/docs/cmd/spo/listitem/listitem-retentionlabel-ensure.mdx +4 -4
- package/docs/docs/cmd/spo/listitem/listitem-retentionlabel-remove.mdx +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-roleassignment-add.mdx +9 -9
- package/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.mdx +7 -7
- package/docs/docs/cmd/spo/site/site-appcatalog-remove.mdx +11 -2
- package/docs/docs/cmd/spo/site/site-recyclebinitem-list.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-remove.mdx +0 -3
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-restore.mdx +2 -49
- package/docs/docs/cmd/spo/web/web-roleassignment-add.mdx +1 -1
- package/docs/docs/cmd/spo/web/web-roleassignment-remove.mdx +1 -1
- package/npm-shrinkwrap.json +572 -477
- package/package.json +22 -22
|
@@ -0,0 +1,86 @@
|
|
|
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 _SpoFolderSharingLinkGetCommand_instances, _SpoFolderSharingLinkGetCommand_initTelemetry, _SpoFolderSharingLinkGetCommand_initOptions, _SpoFolderSharingLinkGetCommand_initOptionSets, _SpoFolderSharingLinkGetCommand_initValidators, _SpoFolderSharingLinkGetCommand_initTypes;
|
|
7
|
+
import request from '../../../../request.js';
|
|
8
|
+
import { spo } from '../../../../utils/spo.js';
|
|
9
|
+
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
10
|
+
import { validation } from '../../../../utils/validation.js';
|
|
11
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
|
+
import commands from '../../commands.js';
|
|
13
|
+
import { drive as driveItem } from '../../../../utils/drive.js';
|
|
14
|
+
class SpoFolderSharingLinkGetCommand extends SpoCommand {
|
|
15
|
+
get name() {
|
|
16
|
+
return commands.FOLDER_SHARINGLINK_GET;
|
|
17
|
+
}
|
|
18
|
+
get description() {
|
|
19
|
+
return 'Gets details about a specific sharing link on a folder';
|
|
20
|
+
}
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
_SpoFolderSharingLinkGetCommand_instances.add(this);
|
|
24
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkGetCommand_instances, "m", _SpoFolderSharingLinkGetCommand_initTelemetry).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkGetCommand_instances, "m", _SpoFolderSharingLinkGetCommand_initOptions).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkGetCommand_instances, "m", _SpoFolderSharingLinkGetCommand_initOptionSets).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkGetCommand_instances, "m", _SpoFolderSharingLinkGetCommand_initValidators).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkGetCommand_instances, "m", _SpoFolderSharingLinkGetCommand_initTypes).call(this);
|
|
29
|
+
}
|
|
30
|
+
async commandAction(logger, args) {
|
|
31
|
+
if (this.verbose) {
|
|
32
|
+
await logger.logToStderr(`Retrieving sharing link on folder ${args.options.folderId || args.options.folderUrl}...`);
|
|
33
|
+
}
|
|
34
|
+
try {
|
|
35
|
+
const relFolderUrl = await spo.getFolderServerRelativeUrl(args.options.webUrl, args.options.folderUrl, args.options.folderId);
|
|
36
|
+
const absoluteFolderUrl = urlUtil.getAbsoluteUrl(args.options.webUrl, relFolderUrl);
|
|
37
|
+
const folderUrl = new URL(absoluteFolderUrl);
|
|
38
|
+
const siteId = await spo.getSiteId(args.options.webUrl);
|
|
39
|
+
const drive = await driveItem.getDriveByUrl(siteId, folderUrl);
|
|
40
|
+
const itemId = await driveItem.getDriveItemId(drive, folderUrl);
|
|
41
|
+
const requestUrl = `https://graph.microsoft.com/v1.0/drives/${drive.id}/items/${itemId}/permissions/${args.options.id}`;
|
|
42
|
+
const requestOptions = {
|
|
43
|
+
url: requestUrl,
|
|
44
|
+
headers: {
|
|
45
|
+
'accept': 'application/json;odata.metadata=none'
|
|
46
|
+
},
|
|
47
|
+
responseType: 'json'
|
|
48
|
+
};
|
|
49
|
+
const permission = await request.get(requestOptions);
|
|
50
|
+
await logger.log(permission);
|
|
51
|
+
}
|
|
52
|
+
catch (err) {
|
|
53
|
+
this.handleRejectedODataJsonPromise(err);
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
_SpoFolderSharingLinkGetCommand_instances = new WeakSet(), _SpoFolderSharingLinkGetCommand_initTelemetry = function _SpoFolderSharingLinkGetCommand_initTelemetry() {
|
|
58
|
+
this.telemetry.push((args) => {
|
|
59
|
+
Object.assign(this.telemetryProperties, {
|
|
60
|
+
folderUrl: typeof args.options.folderUrl !== 'undefined',
|
|
61
|
+
folderId: typeof args.options.folderId !== 'undefined'
|
|
62
|
+
});
|
|
63
|
+
});
|
|
64
|
+
}, _SpoFolderSharingLinkGetCommand_initOptions = function _SpoFolderSharingLinkGetCommand_initOptions() {
|
|
65
|
+
this.options.unshift({ option: '-u, --webUrl <webUrl>' }, { option: '--folderUrl [folderUrl]' }, { option: '--folderId [folderId]' }, { option: '-i, --id <id>' });
|
|
66
|
+
}, _SpoFolderSharingLinkGetCommand_initOptionSets = function _SpoFolderSharingLinkGetCommand_initOptionSets() {
|
|
67
|
+
this.optionSets.push({ options: ['folderUrl', 'folderId'] });
|
|
68
|
+
}, _SpoFolderSharingLinkGetCommand_initValidators = function _SpoFolderSharingLinkGetCommand_initValidators() {
|
|
69
|
+
this.validators.push(async (args) => {
|
|
70
|
+
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
71
|
+
if (isValidSharePointUrl !== true) {
|
|
72
|
+
return isValidSharePointUrl;
|
|
73
|
+
}
|
|
74
|
+
if (args.options.folderId && !validation.isValidGuid(args.options.folderId)) {
|
|
75
|
+
return `${args.options.folderId} is not a valid GUID for option 'folderId'.`;
|
|
76
|
+
}
|
|
77
|
+
if (!validation.isValidGuid(args.options.id)) {
|
|
78
|
+
return `${args.options.id} is not a valid GUID for option 'id'.`;
|
|
79
|
+
}
|
|
80
|
+
return true;
|
|
81
|
+
});
|
|
82
|
+
}, _SpoFolderSharingLinkGetCommand_initTypes = function _SpoFolderSharingLinkGetCommand_initTypes() {
|
|
83
|
+
this.types.string.push('webUrl', 'folderUrl', 'folderId', 'id');
|
|
84
|
+
};
|
|
85
|
+
export default new SpoFolderSharingLinkGetCommand();
|
|
86
|
+
//# sourceMappingURL=folder-sharinglink-get.js.map
|
|
@@ -0,0 +1,110 @@
|
|
|
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 _SpoFolderSharingLinkListCommand_instances, _SpoFolderSharingLinkListCommand_initTelemetry, _SpoFolderSharingLinkListCommand_initOptions, _SpoFolderSharingLinkListCommand_initOptionSets, _SpoFolderSharingLinkListCommand_initValidators, _SpoFolderSharingLinkListCommand_initTypes;
|
|
7
|
+
import { cli } from '../../../../cli/cli.js';
|
|
8
|
+
import { spo } from '../../../../utils/spo.js';
|
|
9
|
+
import { odata } from '../../../../utils/odata.js';
|
|
10
|
+
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
11
|
+
import { drive } from '../../../../utils/drive.js';
|
|
12
|
+
import { validation } from '../../../../utils/validation.js';
|
|
13
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
14
|
+
import commands from '../../commands.js';
|
|
15
|
+
class SpoFolderSharingLinkListCommand extends SpoCommand {
|
|
16
|
+
get name() {
|
|
17
|
+
return commands.FOLDER_SHARINGLINK_LIST;
|
|
18
|
+
}
|
|
19
|
+
get description() {
|
|
20
|
+
return 'Lists all the sharing links of a specific folder';
|
|
21
|
+
}
|
|
22
|
+
defaultProperties() {
|
|
23
|
+
return ['id', 'scope', 'roles', 'link'];
|
|
24
|
+
}
|
|
25
|
+
constructor() {
|
|
26
|
+
super();
|
|
27
|
+
_SpoFolderSharingLinkListCommand_instances.add(this);
|
|
28
|
+
this.allowedScopes = ['anonymous', 'users', 'organization'];
|
|
29
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkListCommand_instances, "m", _SpoFolderSharingLinkListCommand_initTelemetry).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkListCommand_instances, "m", _SpoFolderSharingLinkListCommand_initOptions).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkListCommand_instances, "m", _SpoFolderSharingLinkListCommand_initOptionSets).call(this);
|
|
32
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkListCommand_instances, "m", _SpoFolderSharingLinkListCommand_initValidators).call(this);
|
|
33
|
+
__classPrivateFieldGet(this, _SpoFolderSharingLinkListCommand_instances, "m", _SpoFolderSharingLinkListCommand_initTypes).call(this);
|
|
34
|
+
}
|
|
35
|
+
async commandAction(logger, args) {
|
|
36
|
+
if (this.verbose) {
|
|
37
|
+
await logger.logToStderr(`Retrieving sharing links for folder ${args.options.folderId || args.options.folderUrl}...`);
|
|
38
|
+
}
|
|
39
|
+
try {
|
|
40
|
+
const relFolderUrl = await spo.getFolderServerRelativeUrl(args.options.webUrl, args.options.folderUrl, args.options.folderId, logger, args.options.verbose);
|
|
41
|
+
const absoluteFolderUrl = urlUtil.getAbsoluteUrl(args.options.webUrl, relFolderUrl);
|
|
42
|
+
const folderUrl = new URL(absoluteFolderUrl);
|
|
43
|
+
const siteId = await spo.getSiteId(args.options.webUrl);
|
|
44
|
+
const driveDetails = await drive.getDriveByUrl(siteId, folderUrl, logger, args.options.verbose);
|
|
45
|
+
const itemId = await drive.getDriveItemId(driveDetails, folderUrl, logger, args.options.verbose);
|
|
46
|
+
let requestUrl = `https://graph.microsoft.com/v1.0/drives/${driveDetails.id}/items/${itemId}/permissions?$filter=Link ne null`;
|
|
47
|
+
if (args.options.scope) {
|
|
48
|
+
requestUrl += ` and Link/Scope eq '${args.options.scope}'`;
|
|
49
|
+
}
|
|
50
|
+
const sharingLinks = await odata.getAllItems(requestUrl);
|
|
51
|
+
// remove grantedToIdentities from the sharing link object
|
|
52
|
+
const filteredSharingLinks = sharingLinks.map(link => {
|
|
53
|
+
// eslint-disable-next-line @typescript-eslint/no-unused-vars
|
|
54
|
+
const { grantedToIdentities, ...filteredLink } = link;
|
|
55
|
+
return filteredLink;
|
|
56
|
+
});
|
|
57
|
+
if (!args.options.output || !cli.shouldTrimOutput(args.options.output)) {
|
|
58
|
+
await logger.log(filteredSharingLinks);
|
|
59
|
+
}
|
|
60
|
+
else {
|
|
61
|
+
//converted to text friendly output
|
|
62
|
+
await logger.log(filteredSharingLinks.map(i => {
|
|
63
|
+
return {
|
|
64
|
+
id: i.id,
|
|
65
|
+
roles: i.roles.join(','),
|
|
66
|
+
link: i.link.webUrl,
|
|
67
|
+
scope: i.link.scope
|
|
68
|
+
};
|
|
69
|
+
}));
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
catch (err) {
|
|
73
|
+
this.handleRejectedODataJsonPromise(err);
|
|
74
|
+
}
|
|
75
|
+
}
|
|
76
|
+
}
|
|
77
|
+
_SpoFolderSharingLinkListCommand_instances = new WeakSet(), _SpoFolderSharingLinkListCommand_initTelemetry = function _SpoFolderSharingLinkListCommand_initTelemetry() {
|
|
78
|
+
this.telemetry.push((args) => {
|
|
79
|
+
Object.assign(this.telemetryProperties, {
|
|
80
|
+
folderUrl: typeof args.options.folderUrl !== 'undefined',
|
|
81
|
+
folderId: typeof args.options.folderId !== 'undefined',
|
|
82
|
+
scope: typeof args.options.scope !== 'undefined'
|
|
83
|
+
});
|
|
84
|
+
});
|
|
85
|
+
}, _SpoFolderSharingLinkListCommand_initOptions = function _SpoFolderSharingLinkListCommand_initOptions() {
|
|
86
|
+
this.options.unshift({ option: '-u, --webUrl <webUrl>' }, { option: '--folderUrl [folderUrl]' }, { option: '--folderId [folderId]' }, {
|
|
87
|
+
option: '-s, --scope [scope]',
|
|
88
|
+
autocomplete: this.allowedScopes
|
|
89
|
+
});
|
|
90
|
+
}, _SpoFolderSharingLinkListCommand_initOptionSets = function _SpoFolderSharingLinkListCommand_initOptionSets() {
|
|
91
|
+
this.optionSets.push({ options: ['folderUrl', 'folderId'] });
|
|
92
|
+
}, _SpoFolderSharingLinkListCommand_initValidators = function _SpoFolderSharingLinkListCommand_initValidators() {
|
|
93
|
+
this.validators.push(async (args) => {
|
|
94
|
+
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
95
|
+
if (isValidSharePointUrl !== true) {
|
|
96
|
+
return isValidSharePointUrl;
|
|
97
|
+
}
|
|
98
|
+
if (args.options.folderId && !validation.isValidGuid(args.options.folderId)) {
|
|
99
|
+
return `${args.options.folderId} is not a valid GUID`;
|
|
100
|
+
}
|
|
101
|
+
if (args.options.scope && !this.allowedScopes.some(scope => scope === args.options.scope)) {
|
|
102
|
+
return `'${args.options.scope}' is not a valid scope. Allowed values are: ${this.allowedScopes.join(',')}`;
|
|
103
|
+
}
|
|
104
|
+
return true;
|
|
105
|
+
});
|
|
106
|
+
}, _SpoFolderSharingLinkListCommand_initTypes = function _SpoFolderSharingLinkListCommand_initTypes() {
|
|
107
|
+
this.types.string.push('webUrl', 'folderUrl', 'folderId', 'scope');
|
|
108
|
+
};
|
|
109
|
+
export default new SpoFolderSharingLinkListCommand();
|
|
110
|
+
//# sourceMappingURL=folder-sharinglink-list.js.map
|
|
@@ -1,2 +1,7 @@
|
|
|
1
|
-
export
|
|
1
|
+
export var DefaultTrimModeType;
|
|
2
|
+
(function (DefaultTrimModeType) {
|
|
3
|
+
DefaultTrimModeType[DefaultTrimModeType["NoExpiration"] = 0] = "NoExpiration";
|
|
4
|
+
DefaultTrimModeType[DefaultTrimModeType["ExpireAfter"] = 1] = "ExpireAfter";
|
|
5
|
+
DefaultTrimModeType[DefaultTrimModeType["AutoExpiration"] = 2] = "AutoExpiration";
|
|
6
|
+
})(DefaultTrimModeType || (DefaultTrimModeType = {}));
|
|
2
7
|
//# sourceMappingURL=ListInstance.js.map
|
|
@@ -10,6 +10,7 @@ import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
|
10
10
|
import { validation } from '../../../../utils/validation.js';
|
|
11
11
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
|
+
import { DefaultTrimModeType } from "./ListInstance.js";
|
|
13
14
|
import { ListPrincipalType } from './ListPrincipalType.js';
|
|
14
15
|
class SpoListGetCommand extends SpoCommand {
|
|
15
16
|
get name() {
|
|
@@ -49,9 +50,11 @@ class SpoListGetCommand extends SpoCommand {
|
|
|
49
50
|
if (fieldsProperties.expandProperties.length > 0) {
|
|
50
51
|
queryParams.push(`$expand=${fieldsProperties.expandProperties.join(',')}`);
|
|
51
52
|
}
|
|
52
|
-
|
|
53
|
+
if (queryParams.length === 0) {
|
|
54
|
+
queryParams.push(`$expand=VersionPolicies`);
|
|
55
|
+
}
|
|
53
56
|
const requestOptions = {
|
|
54
|
-
url: `${requestUrl}
|
|
57
|
+
url: `${requestUrl}?${queryParams.join('&')}`,
|
|
55
58
|
headers: {
|
|
56
59
|
'accept': 'application/json;odata=nometadata'
|
|
57
60
|
},
|
|
@@ -64,6 +67,9 @@ class SpoListGetCommand extends SpoCommand {
|
|
|
64
67
|
r.Member.PrincipalTypeString = ListPrincipalType[r.Member.PrincipalType];
|
|
65
68
|
});
|
|
66
69
|
}
|
|
70
|
+
if (listInstance.VersionPolicies) {
|
|
71
|
+
listInstance.VersionPolicies.DefaultTrimModeValue = DefaultTrimModeType[listInstance.VersionPolicies.DefaultTrimMode];
|
|
72
|
+
}
|
|
67
73
|
await logger.log(listInstance);
|
|
68
74
|
}
|
|
69
75
|
catch (err) {
|
|
@@ -74,7 +80,7 @@ class SpoListGetCommand extends SpoCommand {
|
|
|
74
80
|
const selectProperties = [];
|
|
75
81
|
let expandProperties = [];
|
|
76
82
|
if (withPermissions) {
|
|
77
|
-
expandProperties = ['HasUniqueRoleAssignments', 'RoleAssignments/Member', 'RoleAssignments/RoleDefinitionBindings'];
|
|
83
|
+
expandProperties = ['HasUniqueRoleAssignments', 'RoleAssignments/Member', 'RoleAssignments/RoleDefinitionBindings', 'VersionPolicies'];
|
|
78
84
|
}
|
|
79
85
|
if (properties) {
|
|
80
86
|
properties.split(',').forEach((property) => {
|
|
@@ -16,7 +16,7 @@ class SpoListListCommand extends SpoCommand {
|
|
|
16
16
|
return 'Lists all available list in the specified site';
|
|
17
17
|
}
|
|
18
18
|
defaultProperties() {
|
|
19
|
-
return ['Title', '
|
|
19
|
+
return ['Title', 'Id'];
|
|
20
20
|
}
|
|
21
21
|
constructor() {
|
|
22
22
|
super();
|
|
@@ -36,9 +36,6 @@ class SpoListListCommand extends SpoCommand {
|
|
|
36
36
|
queryParams.push(`$filter=${args.options.filter}`);
|
|
37
37
|
}
|
|
38
38
|
const listInstances = await odata.getAllItems(`${args.options.webUrl}/_api/web/lists?${queryParams.join('&')}`);
|
|
39
|
-
listInstances.forEach(l => {
|
|
40
|
-
l.Url = l.RootFolder.ServerRelativeUrl;
|
|
41
|
-
});
|
|
42
39
|
await logger.log(listInstances);
|
|
43
40
|
}
|
|
44
41
|
catch (err) {
|
|
@@ -3,8 +3,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
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
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoListRoleAssignmentAddCommand_instances, _SpoListRoleAssignmentAddCommand_initTelemetry, _SpoListRoleAssignmentAddCommand_initOptions, _SpoListRoleAssignmentAddCommand_initValidators, _SpoListRoleAssignmentAddCommand_initOptionSets;
|
|
6
|
+
var _SpoListRoleAssignmentAddCommand_instances, _SpoListRoleAssignmentAddCommand_initTelemetry, _SpoListRoleAssignmentAddCommand_initOptions, _SpoListRoleAssignmentAddCommand_initValidators, _SpoListRoleAssignmentAddCommand_initOptionSets, _SpoListRoleAssignmentAddCommand_initTypes;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
|
+
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
8
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
10
|
import { spo } from '../../../../utils/spo.js';
|
|
10
11
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
@@ -25,6 +26,7 @@ class SpoListRoleAssignmentAddCommand extends SpoCommand {
|
|
|
25
26
|
__classPrivateFieldGet(this, _SpoListRoleAssignmentAddCommand_instances, "m", _SpoListRoleAssignmentAddCommand_initOptions).call(this);
|
|
26
27
|
__classPrivateFieldGet(this, _SpoListRoleAssignmentAddCommand_instances, "m", _SpoListRoleAssignmentAddCommand_initValidators).call(this);
|
|
27
28
|
__classPrivateFieldGet(this, _SpoListRoleAssignmentAddCommand_instances, "m", _SpoListRoleAssignmentAddCommand_initOptionSets).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoListRoleAssignmentAddCommand_instances, "m", _SpoListRoleAssignmentAddCommand_initTypes).call(this);
|
|
28
30
|
}
|
|
29
31
|
async commandAction(logger, args) {
|
|
30
32
|
if (this.verbose) {
|
|
@@ -42,39 +44,48 @@ class SpoListRoleAssignmentAddCommand extends SpoCommand {
|
|
|
42
44
|
const listServerRelativeUrl = urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
|
|
43
45
|
requestUrl += `GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')/`;
|
|
44
46
|
}
|
|
45
|
-
|
|
47
|
+
const roleDefinitionId = await this.getRoleDefinitionId(args.options, logger);
|
|
48
|
+
let principalId = args.options.principalId;
|
|
46
49
|
if (args.options.upn) {
|
|
47
|
-
const user = await spo.
|
|
48
|
-
|
|
49
|
-
await this.addRoleAssignment(requestUrl, logger, args.options);
|
|
50
|
+
const user = await spo.ensureUser(args.options.webUrl, args.options.upn);
|
|
51
|
+
principalId = user.Id;
|
|
50
52
|
}
|
|
51
53
|
else if (args.options.groupName) {
|
|
52
54
|
const group = await spo.getGroupByName(args.options.webUrl, args.options.groupName, logger, this.verbose);
|
|
53
|
-
|
|
54
|
-
await this.addRoleAssignment(requestUrl, logger, args.options);
|
|
55
|
+
principalId = group.Id;
|
|
55
56
|
}
|
|
56
|
-
else {
|
|
57
|
-
|
|
57
|
+
else if (args.options.entraGroupId || args.options.entraGroupName) {
|
|
58
|
+
if (this.verbose) {
|
|
59
|
+
await logger.logToStderr('Retrieving group information...');
|
|
60
|
+
}
|
|
61
|
+
let group;
|
|
62
|
+
if (args.options.entraGroupId) {
|
|
63
|
+
group = await entraGroup.getGroupById(args.options.entraGroupId);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
group = await entraGroup.getGroupByDisplayName(args.options.entraGroupName);
|
|
67
|
+
}
|
|
68
|
+
const siteUser = await spo.ensureEntraGroup(args.options.webUrl, group);
|
|
69
|
+
principalId = siteUser.Id;
|
|
58
70
|
}
|
|
71
|
+
await this.addRoleAssignment(requestUrl, principalId, roleDefinitionId);
|
|
59
72
|
}
|
|
60
73
|
catch (err) {
|
|
61
74
|
this.handleRejectedODataJsonPromise(err);
|
|
62
75
|
}
|
|
63
76
|
}
|
|
64
|
-
async addRoleAssignment(requestUrl,
|
|
77
|
+
async addRoleAssignment(requestUrl, principalId, roleDefinitionId) {
|
|
65
78
|
const requestOptions = {
|
|
66
|
-
url: `${requestUrl}roleassignments/addroleassignment(principalid='${
|
|
67
|
-
method: 'POST',
|
|
79
|
+
url: `${requestUrl}roleassignments/addroleassignment(principalid='${principalId}',roledefid='${roleDefinitionId}')`,
|
|
68
80
|
headers: {
|
|
69
|
-
|
|
70
|
-
'content-type': 'application/json'
|
|
81
|
+
accept: 'application/json;odata=nometadata'
|
|
71
82
|
},
|
|
72
83
|
responseType: 'json'
|
|
73
84
|
};
|
|
74
85
|
return request.post(requestOptions);
|
|
75
86
|
}
|
|
76
87
|
async getRoleDefinitionId(options, logger) {
|
|
77
|
-
if (
|
|
88
|
+
if (options.roleDefinitionId) {
|
|
78
89
|
return options.roleDefinitionId;
|
|
79
90
|
}
|
|
80
91
|
const roleDefinition = await spo.getRoleDefinitionByName(options.webUrl, options.roleDefinitionName, logger, this.verbose);
|
|
@@ -90,6 +101,8 @@ _SpoListRoleAssignmentAddCommand_instances = new WeakSet(), _SpoListRoleAssignme
|
|
|
90
101
|
principalId: typeof args.options.principalId !== 'undefined',
|
|
91
102
|
upn: typeof args.options.upn !== 'undefined',
|
|
92
103
|
groupName: typeof args.options.groupName !== 'undefined',
|
|
104
|
+
entraGroupId: typeof args.options.entraGroupId !== 'undefined',
|
|
105
|
+
entraGroupName: typeof args.options.entraGroupName !== 'undefined',
|
|
93
106
|
roleDefinitionId: typeof args.options.roleDefinitionId !== 'undefined',
|
|
94
107
|
roleDefinitionName: typeof args.options.roleDefinitionName !== 'undefined'
|
|
95
108
|
});
|
|
@@ -109,6 +122,10 @@ _SpoListRoleAssignmentAddCommand_instances = new WeakSet(), _SpoListRoleAssignme
|
|
|
109
122
|
option: '--upn [upn]'
|
|
110
123
|
}, {
|
|
111
124
|
option: '--groupName [groupName]'
|
|
125
|
+
}, {
|
|
126
|
+
option: '--entraGroupId [entraGroupId]'
|
|
127
|
+
}, {
|
|
128
|
+
option: '--entraGroupName [entraGroupName]'
|
|
112
129
|
}, {
|
|
113
130
|
option: '--roleDefinitionId [roleDefinitionId]'
|
|
114
131
|
}, {
|
|
@@ -121,18 +138,26 @@ _SpoListRoleAssignmentAddCommand_instances = new WeakSet(), _SpoListRoleAssignme
|
|
|
121
138
|
return isValidSharePointUrl;
|
|
122
139
|
}
|
|
123
140
|
if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
|
|
124
|
-
return
|
|
141
|
+
return `'${args.options.listId}' is not a valid GUID for option listId.`;
|
|
142
|
+
}
|
|
143
|
+
if (args.options.upn && !validation.isValidUserPrincipalName(args.options.upn)) {
|
|
144
|
+
return `'${args.options.upn}' is not a valid user principal name for option upn.`;
|
|
145
|
+
}
|
|
146
|
+
if (args.options.principalId && !validation.isValidPositiveInteger(args.options.principalId)) {
|
|
147
|
+
return `Specified principalId '${args.options.principalId}' is not a valid number.`;
|
|
125
148
|
}
|
|
126
|
-
if (args.options.
|
|
127
|
-
return `
|
|
149
|
+
if (args.options.entraGroupId && !validation.isValidGuid(args.options.entraGroupId)) {
|
|
150
|
+
return `'${args.options.entraGroupId}' is not a valid GUID for option entraGroupId.`;
|
|
128
151
|
}
|
|
129
|
-
if (args.options.roleDefinitionId &&
|
|
130
|
-
return `Specified roleDefinitionId ${args.options.roleDefinitionId} is not a number
|
|
152
|
+
if (args.options.roleDefinitionId && !validation.isValidPositiveInteger(args.options.roleDefinitionId)) {
|
|
153
|
+
return `Specified roleDefinitionId '${args.options.roleDefinitionId}' is not a valid number.`;
|
|
131
154
|
}
|
|
132
155
|
return true;
|
|
133
156
|
});
|
|
134
157
|
}, _SpoListRoleAssignmentAddCommand_initOptionSets = function _SpoListRoleAssignmentAddCommand_initOptionSets() {
|
|
135
|
-
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] }, { options: ['principalId', 'upn', 'groupName'] }, { options: ['roleDefinitionId', 'roleDefinitionName'] });
|
|
158
|
+
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] }, { options: ['principalId', 'upn', 'groupName', 'entraGroupId', 'entraGroupName'] }, { options: ['roleDefinitionId', 'roleDefinitionName'] });
|
|
159
|
+
}, _SpoListRoleAssignmentAddCommand_initTypes = function _SpoListRoleAssignmentAddCommand_initTypes() {
|
|
160
|
+
this.types.string.push('webUrl', 'listId', 'listTitle', 'listUrl', 'upn', 'groupName', 'entraGroupId', 'entraGroupName', 'roleDefinitionName');
|
|
136
161
|
};
|
|
137
162
|
export default new SpoListRoleAssignmentAddCommand();
|
|
138
163
|
//# sourceMappingURL=list-roleassignment-add.js.map
|
|
@@ -3,16 +3,16 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
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
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _SpoListRoleAssignmentRemoveCommand_instances, _SpoListRoleAssignmentRemoveCommand_initTelemetry, _SpoListRoleAssignmentRemoveCommand_initOptions, _SpoListRoleAssignmentRemoveCommand_initValidators, _SpoListRoleAssignmentRemoveCommand_initOptionSets;
|
|
6
|
+
var _SpoListRoleAssignmentRemoveCommand_instances, _SpoListRoleAssignmentRemoveCommand_initTelemetry, _SpoListRoleAssignmentRemoveCommand_initOptions, _SpoListRoleAssignmentRemoveCommand_initValidators, _SpoListRoleAssignmentRemoveCommand_initOptionSets, _SpoListRoleAssignmentRemoveCommand_initTypes;
|
|
7
7
|
import { cli } from '../../../../cli/cli.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
+
import { spo } from '../../../../utils/spo.js';
|
|
10
11
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
11
12
|
import { validation } from '../../../../utils/validation.js';
|
|
12
13
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
13
14
|
import commands from '../../commands.js';
|
|
14
|
-
import
|
|
15
|
-
import spoUserGetCommand from '../user/user-get.js';
|
|
15
|
+
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
16
16
|
class SpoListRoleAssignmentRemoveCommand extends SpoCommand {
|
|
17
17
|
get name() {
|
|
18
18
|
return commands.LIST_ROLEASSIGNMENT_REMOVE;
|
|
@@ -27,11 +27,12 @@ class SpoListRoleAssignmentRemoveCommand extends SpoCommand {
|
|
|
27
27
|
__classPrivateFieldGet(this, _SpoListRoleAssignmentRemoveCommand_instances, "m", _SpoListRoleAssignmentRemoveCommand_initOptions).call(this);
|
|
28
28
|
__classPrivateFieldGet(this, _SpoListRoleAssignmentRemoveCommand_instances, "m", _SpoListRoleAssignmentRemoveCommand_initValidators).call(this);
|
|
29
29
|
__classPrivateFieldGet(this, _SpoListRoleAssignmentRemoveCommand_instances, "m", _SpoListRoleAssignmentRemoveCommand_initOptionSets).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _SpoListRoleAssignmentRemoveCommand_instances, "m", _SpoListRoleAssignmentRemoveCommand_initTypes).call(this);
|
|
30
31
|
}
|
|
31
32
|
async commandAction(logger, args) {
|
|
32
33
|
const removeRoleAssignment = async () => {
|
|
33
34
|
if (this.verbose) {
|
|
34
|
-
await logger.logToStderr(`Removing role assignment from list
|
|
35
|
+
await logger.logToStderr(`Removing role assignment from list '${args.options.listId || args.options.listTitle || args.options.listUrl}' of site ${args.options.webUrl}...`);
|
|
35
36
|
}
|
|
36
37
|
try {
|
|
37
38
|
let requestUrl = `${args.options.webUrl}/_api/web/`;
|
|
@@ -45,17 +46,30 @@ class SpoListRoleAssignmentRemoveCommand extends SpoCommand {
|
|
|
45
46
|
const listServerRelativeUrl = urlUtil.getServerRelativePath(args.options.webUrl, args.options.listUrl);
|
|
46
47
|
requestUrl += `GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')/`;
|
|
47
48
|
}
|
|
49
|
+
let principalId = args.options.principalId;
|
|
48
50
|
if (args.options.upn) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
+
const user = await spo.ensureUser(args.options.webUrl, args.options.upn);
|
|
52
|
+
principalId = user.Id;
|
|
51
53
|
}
|
|
52
54
|
else if (args.options.groupName) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
+
const spGroup = await spo.getGroupByName(args.options.webUrl, args.options.groupName, logger, this.verbose);
|
|
56
|
+
principalId = spGroup.Id;
|
|
55
57
|
}
|
|
56
|
-
else {
|
|
57
|
-
|
|
58
|
+
else if (args.options.entraGroupId || args.options.entraGroupName) {
|
|
59
|
+
if (this.verbose) {
|
|
60
|
+
await logger.logToStderr('Retrieving group information...');
|
|
61
|
+
}
|
|
62
|
+
let group;
|
|
63
|
+
if (args.options.entraGroupId) {
|
|
64
|
+
group = await entraGroup.getGroupById(args.options.entraGroupId);
|
|
65
|
+
}
|
|
66
|
+
else {
|
|
67
|
+
group = await entraGroup.getGroupByDisplayName(args.options.entraGroupName);
|
|
68
|
+
}
|
|
69
|
+
const siteUser = await spo.ensureEntraGroup(args.options.webUrl, group);
|
|
70
|
+
principalId = siteUser.Id;
|
|
58
71
|
}
|
|
72
|
+
await this.removeRoleAssignment(requestUrl, principalId);
|
|
59
73
|
}
|
|
60
74
|
catch (err) {
|
|
61
75
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -65,49 +79,22 @@ class SpoListRoleAssignmentRemoveCommand extends SpoCommand {
|
|
|
65
79
|
await removeRoleAssignment();
|
|
66
80
|
}
|
|
67
81
|
else {
|
|
68
|
-
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove role assignment from list ${args.options.listId || args.options.listTitle
|
|
82
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove role assignment from the specified user of list '${args.options.listId || args.options.listTitle || args.options.listUrl}'?` });
|
|
69
83
|
if (result) {
|
|
70
84
|
await removeRoleAssignment();
|
|
71
85
|
}
|
|
72
86
|
}
|
|
73
87
|
}
|
|
74
|
-
async removeRoleAssignment(requestUrl,
|
|
88
|
+
async removeRoleAssignment(requestUrl, principalId) {
|
|
75
89
|
const requestOptions = {
|
|
76
|
-
url: `${requestUrl}roleassignments/removeroleassignment(principalid='${
|
|
77
|
-
method: 'POST',
|
|
90
|
+
url: `${requestUrl}roleassignments/removeroleassignment(principalid='${principalId}')`,
|
|
78
91
|
headers: {
|
|
79
|
-
|
|
80
|
-
'content-type': 'application/json'
|
|
92
|
+
accept: 'application/json;odata=nometadata'
|
|
81
93
|
},
|
|
82
94
|
responseType: 'json'
|
|
83
95
|
};
|
|
84
96
|
return request.post(requestOptions);
|
|
85
97
|
}
|
|
86
|
-
async getGroupPrincipalId(options) {
|
|
87
|
-
const groupGetCommandOptions = {
|
|
88
|
-
webUrl: options.webUrl,
|
|
89
|
-
name: options.groupName,
|
|
90
|
-
output: 'json',
|
|
91
|
-
debug: this.debug,
|
|
92
|
-
verbose: this.verbose
|
|
93
|
-
};
|
|
94
|
-
const output = await cli.executeCommandWithOutput(spoGroupGetCommand, { options: { ...groupGetCommandOptions, _: [] } });
|
|
95
|
-
const getGroupOutput = JSON.parse(output.stdout);
|
|
96
|
-
return getGroupOutput.Id;
|
|
97
|
-
}
|
|
98
|
-
async getUserPrincipalId(options) {
|
|
99
|
-
const userGetCommandOptions = {
|
|
100
|
-
webUrl: options.webUrl,
|
|
101
|
-
email: options.upn,
|
|
102
|
-
id: undefined,
|
|
103
|
-
output: 'json',
|
|
104
|
-
debug: this.debug,
|
|
105
|
-
verbose: this.verbose
|
|
106
|
-
};
|
|
107
|
-
const output = await cli.executeCommandWithOutput(spoUserGetCommand, { options: { ...userGetCommandOptions, _: [] } });
|
|
108
|
-
const getUserOutput = JSON.parse(output.stdout);
|
|
109
|
-
return getUserOutput.Id;
|
|
110
|
-
}
|
|
111
98
|
}
|
|
112
99
|
_SpoListRoleAssignmentRemoveCommand_instances = new WeakSet(), _SpoListRoleAssignmentRemoveCommand_initTelemetry = function _SpoListRoleAssignmentRemoveCommand_initTelemetry() {
|
|
113
100
|
this.telemetry.push((args) => {
|
|
@@ -118,7 +105,9 @@ _SpoListRoleAssignmentRemoveCommand_instances = new WeakSet(), _SpoListRoleAssig
|
|
|
118
105
|
principalId: typeof args.options.principalId !== 'undefined',
|
|
119
106
|
upn: typeof args.options.upn !== 'undefined',
|
|
120
107
|
groupName: typeof args.options.groupName !== 'undefined',
|
|
121
|
-
|
|
108
|
+
entraGroupId: typeof args.options.entraGroupId !== 'undefined',
|
|
109
|
+
entraGroupName: typeof args.options.entraGroupName !== 'undefined',
|
|
110
|
+
force: !!args.options.force
|
|
122
111
|
});
|
|
123
112
|
});
|
|
124
113
|
}, _SpoListRoleAssignmentRemoveCommand_initOptions = function _SpoListRoleAssignmentRemoveCommand_initOptions() {
|
|
@@ -136,6 +125,10 @@ _SpoListRoleAssignmentRemoveCommand_instances = new WeakSet(), _SpoListRoleAssig
|
|
|
136
125
|
option: '--upn [upn]'
|
|
137
126
|
}, {
|
|
138
127
|
option: '--groupName [groupName]'
|
|
128
|
+
}, {
|
|
129
|
+
option: '--entraGroupId [entraGroupId]'
|
|
130
|
+
}, {
|
|
131
|
+
option: '--entraGroupName [entraGroupName]'
|
|
139
132
|
}, {
|
|
140
133
|
option: '-f, --force'
|
|
141
134
|
});
|
|
@@ -146,15 +139,24 @@ _SpoListRoleAssignmentRemoveCommand_instances = new WeakSet(), _SpoListRoleAssig
|
|
|
146
139
|
return isValidSharePointUrl;
|
|
147
140
|
}
|
|
148
141
|
if (args.options.listId && !validation.isValidGuid(args.options.listId)) {
|
|
149
|
-
return
|
|
142
|
+
return `'${args.options.listId}' is not a valid GUID for option listId.`;
|
|
143
|
+
}
|
|
144
|
+
if (args.options.upn && !validation.isValidUserPrincipalName(args.options.upn)) {
|
|
145
|
+
return `'${args.options.upn}' is not a valid user principal name for option upn.`;
|
|
146
|
+
}
|
|
147
|
+
if (args.options.principalId && !validation.isValidPositiveInteger(args.options.principalId)) {
|
|
148
|
+
return `'${args.options.principalId}' is not a valid number for option principalId.`;
|
|
150
149
|
}
|
|
151
|
-
if (args.options.
|
|
152
|
-
return `
|
|
150
|
+
if (args.options.entraGroupId && !validation.isValidGuid(args.options.entraGroupId)) {
|
|
151
|
+
return `'${args.options.entraGroupId}' is not a valid GUID for option entraGroupId.`;
|
|
153
152
|
}
|
|
154
153
|
return true;
|
|
155
154
|
});
|
|
156
155
|
}, _SpoListRoleAssignmentRemoveCommand_initOptionSets = function _SpoListRoleAssignmentRemoveCommand_initOptionSets() {
|
|
157
|
-
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] }, { options: ['principalId', 'upn', 'groupName'] });
|
|
156
|
+
this.optionSets.push({ options: ['listId', 'listTitle', 'listUrl'] }, { options: ['principalId', 'upn', 'groupName', 'entraGroupId', 'entraGroupName'] });
|
|
157
|
+
}, _SpoListRoleAssignmentRemoveCommand_initTypes = function _SpoListRoleAssignmentRemoveCommand_initTypes() {
|
|
158
|
+
this.types.string.push('webUrl', 'listId', 'listTitle', 'listUrl', 'upn', 'groupName', 'entraGroupId', 'entraGroupName');
|
|
159
|
+
this.types.boolean.push('force');
|
|
158
160
|
};
|
|
159
161
|
export default new SpoListRoleAssignmentRemoveCommand();
|
|
160
162
|
//# sourceMappingURL=list-roleassignment-remove.js.map
|