@pnp/cli-microsoft365 9.0.0-beta.2f8dd1e → 9.0.0-beta.39e78b2
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/.eslintrc.cjs +1 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +10 -18
- package/dist/Command.js +50 -5
- package/dist/chili/chili.js +0 -23
- package/dist/cli/cli.js +100 -100
- package/dist/config.js +1 -1
- package/dist/m365/app/commands/permission/permission-add.js +9 -9
- package/dist/m365/cli/commands/cli-consent.js +3 -7
- package/dist/m365/commands/login.js +49 -96
- package/dist/m365/commands/setup.js +0 -4
- 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/enterpriseapp/enterpriseapp-remove.js +123 -0
- package/dist/m365/entra/commands/group/group-set.js +256 -0
- 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-set.js +66 -29
- 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/MultitenantOrganization.js +2 -0
- package/dist/m365/entra/commands/multitenant/multitenant-add.js +65 -0
- package/dist/m365/entra/commands/multitenant/multitenant-get.js +32 -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 +7 -0
- package/dist/m365/external/commands/connection/connection-doctor.js +10 -24
- package/dist/m365/flow/commands/flow-get.js +1 -1
- package/dist/m365/flow/commands/flow-list.js +23 -24
- package/dist/m365/graph/commands/subscription/subscription-add.js +4 -2
- package/dist/m365/onenote/commands/notebook/notebook-add.js +132 -0
- package/dist/m365/onenote/commands.js +1 -0
- 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/spe/ContainerTypeProperties.js +2 -0
- package/dist/m365/spe/commands/containertype/containertype-list.js +49 -0
- package/dist/m365/spe/commands.js +2 -1
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +1 -1
- package/dist/m365/spfx/commands/project/base-project-command.js +36 -126
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +1 -10
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +16 -22
- package/dist/m365/spo/commands/cdn/cdn-get.js +12 -15
- package/dist/m365/spo/commands/cdn/cdn-set.js +6 -4
- package/dist/m365/spo/commands/commandset/commandset-get.js +31 -17
- package/dist/m365/spo/commands/contenttype/contenttype-field-list.js +124 -0
- package/dist/m365/spo/commands/field/field-list.js +1 -1
- 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/group/group-member-add.js +103 -99
- 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/page/page-clientsidewebpart-add.js +2 -3
- package/dist/m365/spo/commands/page/page-text-add.js +2 -3
- package/dist/m365/spo/commands/site/site-appcatalog-remove.js +48 -24
- package/dist/m365/spo/commands/site/site-get.js +12 -16
- package/dist/m365/spo/commands/site/site-remove.js +1 -7
- package/dist/m365/spo/commands/spo-search.js +3 -4
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +19 -5
- package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +20 -6
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-restore.js +2 -22
- package/dist/m365/spo/commands.js +3 -1
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-get.js +119 -0
- package/dist/m365/teams/commands/message/message-remove.js +112 -0
- package/dist/m365/teams/commands/message/message-restore.js +106 -0
- package/dist/m365/teams/commands.js +3 -0
- package/dist/m365/viva/commands/engage/engage-community-add.js +166 -0
- package/dist/m365/viva/commands/engage/engage-group-list.js +0 -5
- package/dist/m365/viva/commands/engage/engage-group-user-add.js +0 -5
- package/dist/m365/viva/commands/engage/engage-group-user-remove.js +0 -5
- package/dist/m365/viva/commands/engage/engage-message-add.js +0 -5
- package/dist/m365/viva/commands/engage/engage-message-get.js +0 -5
- package/dist/m365/viva/commands/engage/engage-message-like-set.js +0 -5
- package/dist/m365/viva/commands/engage/engage-message-list.js +0 -5
- package/dist/m365/viva/commands/engage/engage-message-remove.js +0 -5
- package/dist/m365/viva/commands/engage/engage-network-list.js +0 -5
- package/dist/m365/viva/commands/engage/engage-report-activitycounts.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-activityusercounts.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-activityuserdetail.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-deviceusagedistributionusercounts.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-deviceusageusercounts.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-deviceusageuserdetail.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitycounts.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitydetail.js +0 -8
- package/dist/m365/viva/commands/engage/engage-report-groupsactivitygroupcounts.js +0 -8
- package/dist/m365/viva/commands/engage/engage-search.js +0 -5
- package/dist/m365/viva/commands/engage/engage-user-get.js +0 -5
- package/dist/m365/viva/commands/engage/engage-user-list.js +0 -5
- package/dist/m365/viva/commands.js +1 -0
- package/dist/utils/drive.js +61 -0
- package/dist/utils/formatting.js +30 -1
- package/dist/utils/spo.js +143 -6
- package/dist/utils/teams.js +49 -0
- package/dist/utils/validation.js +19 -0
- package/dist/utils/zod.js +124 -0
- package/docs/docs/cmd/app/permission/permission-add.mdx +5 -5
- package/docs/docs/cmd/cli/cli-consent.mdx +1 -1
- 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/enterpriseapp/enterpriseapp-remove.mdx +65 -0
- package/docs/docs/cmd/entra/group/group-add.mdx +0 -4
- package/docs/docs/cmd/entra/group/group-set.mdx +89 -0
- 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-set.mdx +37 -7
- 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-get.mdx +94 -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/external/connection/connection-doctor.mdx +9 -9
- package/docs/docs/cmd/flow/flow-get.mdx +149 -283
- package/docs/docs/cmd/flow/flow-list.mdx +114 -56
- package/docs/docs/cmd/graph/subscription/subscription-add.mdx +18 -0
- package/docs/docs/cmd/onenote/notebook/notebook-add.mdx +169 -0
- 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 +102 -0
- 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 +88 -38
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-list.mdx +22 -28
- package/docs/docs/cmd/spo/cdn/cdn-set.mdx +3 -3
- package/docs/docs/cmd/spo/commandset/commandset-get.mdx +75 -24
- package/docs/docs/cmd/spo/commandset/commandset-list.mdx +26 -32
- package/docs/docs/cmd/spo/contenttype/contenttype-field-list.mdx +172 -0
- package/docs/docs/cmd/spo/contenttype/contenttype-list.mdx +3 -3
- package/docs/docs/cmd/spo/field/field-list.mdx +3 -3
- 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/group/group-member-add.mdx +34 -27
- 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-applicationcustomizer-get.mdx +79 -30
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.mdx +20 -19
- package/docs/docs/cmd/spo/tenant/tenant-commandset-get.mdx +84 -38
- package/docs/docs/cmd/spo/tenant/tenant-commandset-list.mdx +20 -19
- 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/docs/docs/cmd/teams/meeting/meeting-attendancereport-get.mdx +138 -0
- package/docs/docs/cmd/teams/meeting/meeting-list.mdx +7 -3
- package/docs/docs/cmd/teams/message/message-remove.mdx +64 -0
- package/docs/docs/cmd/teams/message/message-restore.mdx +62 -0
- package/docs/docs/cmd/viva/engage/engage-community-add.mdx +168 -0
- package/npm-shrinkwrap.json +986 -1326
- package/package.json +27 -24
- package/dist/m365/viva/commands/engage/yammerCommands.js +0 -25
|
@@ -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
|
|
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _SpoPageClientSideWebPartAddCommand_instances, _SpoPageClientSideWebPartAddCommand_initTelemetry, _SpoPageClientSideWebPartAddCommand_initOptions, _SpoPageClientSideWebPartAddCommand_initValidators, _SpoPageClientSideWebPartAddCommand_initOptionSets;
|
|
7
|
-
import { isNumber } from 'util';
|
|
8
7
|
import { v4 } from 'uuid';
|
|
9
8
|
import request from '../../../../request.js';
|
|
10
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -370,10 +369,10 @@ _SpoPageClientSideWebPartAddCommand_instances = new WeakSet(), _SpoPageClientSid
|
|
|
370
369
|
.webPartData}. Error: ${e}`;
|
|
371
370
|
}
|
|
372
371
|
}
|
|
373
|
-
if (args.options.section && (!
|
|
372
|
+
if (args.options.section && (!Number.isInteger(args.options.section) || args.options.section < 1)) {
|
|
374
373
|
return 'The value of parameter section must be 1 or higher';
|
|
375
374
|
}
|
|
376
|
-
if (args.options.column && (!
|
|
375
|
+
if (args.options.column && (!Number.isInteger(args.options.column) || args.options.column < 1)) {
|
|
377
376
|
return 'The value of parameter column must be 1 or higher';
|
|
378
377
|
}
|
|
379
378
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _SpoPageTextAddCommand_instances, _SpoPageTextAddCommand_initTelemetry, _SpoPageTextAddCommand_initOptions, _SpoPageTextAddCommand_initValidators;
|
|
7
|
-
import { isNumber } from 'util';
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
8
|
import { spo } from '../../../../utils/spo.js';
|
|
10
9
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
@@ -119,10 +118,10 @@ _SpoPageTextAddCommand_instances = new WeakSet(), _SpoPageTextAddCommand_initTel
|
|
|
119
118
|
});
|
|
120
119
|
}, _SpoPageTextAddCommand_initValidators = function _SpoPageTextAddCommand_initValidators() {
|
|
121
120
|
this.validators.push(async (args) => {
|
|
122
|
-
if (args.options.section && (!
|
|
121
|
+
if (args.options.section && (!Number.isInteger(args.options.section) || args.options.section < 1)) {
|
|
123
122
|
return 'The value of parameter section must be 1 or higher';
|
|
124
123
|
}
|
|
125
|
-
if (args.options.column && (!
|
|
124
|
+
if (args.options.column && (!Number.isInteger(args.options.column) || args.options.column < 1)) {
|
|
126
125
|
return 'The value of parameter column must be 1 or higher';
|
|
127
126
|
}
|
|
128
127
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
@@ -3,7 +3,8 @@ 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 _SpoSiteAppCatalogRemoveCommand_instances, _SpoSiteAppCatalogRemoveCommand_initOptions, _SpoSiteAppCatalogRemoveCommand_initValidators;
|
|
6
|
+
var _SpoSiteAppCatalogRemoveCommand_instances, _SpoSiteAppCatalogRemoveCommand_initTelemetry, _SpoSiteAppCatalogRemoveCommand_initOptions, _SpoSiteAppCatalogRemoveCommand_initValidators, _SpoSiteAppCatalogRemoveCommand_initTypes;
|
|
7
|
+
import { cli } from '../../../../cli/cli.js';
|
|
7
8
|
import config from '../../../../config.js';
|
|
8
9
|
import request from '../../../../request.js';
|
|
9
10
|
import { formatting } from '../../../../utils/formatting.js';
|
|
@@ -21,47 +22,70 @@ class SpoSiteAppCatalogRemoveCommand extends SpoCommand {
|
|
|
21
22
|
constructor() {
|
|
22
23
|
super();
|
|
23
24
|
_SpoSiteAppCatalogRemoveCommand_instances.add(this);
|
|
25
|
+
__classPrivateFieldGet(this, _SpoSiteAppCatalogRemoveCommand_instances, "m", _SpoSiteAppCatalogRemoveCommand_initTelemetry).call(this);
|
|
24
26
|
__classPrivateFieldGet(this, _SpoSiteAppCatalogRemoveCommand_instances, "m", _SpoSiteAppCatalogRemoveCommand_initOptions).call(this);
|
|
25
27
|
__classPrivateFieldGet(this, _SpoSiteAppCatalogRemoveCommand_instances, "m", _SpoSiteAppCatalogRemoveCommand_initValidators).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoSiteAppCatalogRemoveCommand_instances, "m", _SpoSiteAppCatalogRemoveCommand_initTypes).call(this);
|
|
26
29
|
}
|
|
27
30
|
async commandAction(logger, args) {
|
|
28
|
-
const
|
|
29
|
-
|
|
30
|
-
const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
31
|
-
const requestDigest = await spo.getRequestDigest(spoAdminUrl);
|
|
31
|
+
const removeSiteAppcatalog = async () => {
|
|
32
|
+
const url = args.options.siteUrl;
|
|
32
33
|
if (this.verbose) {
|
|
33
34
|
await logger.logToStderr(`Disabling site collection app catalog...`);
|
|
34
35
|
}
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
36
|
+
try {
|
|
37
|
+
const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
38
|
+
const requestDigest = await spo.getRequestDigest(spoAdminUrl);
|
|
39
|
+
const requestOptions = {
|
|
40
|
+
url: `${spoAdminUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
41
|
+
headers: {
|
|
42
|
+
'X-RequestDigest': requestDigest.FormDigestValue
|
|
43
|
+
},
|
|
44
|
+
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="50" ObjectPathId="49" /><ObjectPath Id="52" ObjectPathId="51" /><ObjectPath Id="54" ObjectPathId="53" /><ObjectPath Id="56" ObjectPathId="55" /><ObjectPath Id="58" ObjectPathId="57" /><Method Name="Remove" Id="59" ObjectPathId="57"><Parameters><Parameter Type="String">${formatting.escapeXml(url)}</Parameter></Parameters></Method></Actions><ObjectPaths><Constructor Id="49" TypeId="{268004ae-ef6b-4e9b-8425-127220d84719}" /><Method Id="51" ParentId="49" Name="GetSiteByUrl"><Parameters><Parameter Type="String">${formatting.escapeXml(url)}</Parameter></Parameters></Method><Property Id="53" ParentId="51" Name="RootWeb" /><Property Id="55" ParentId="53" Name="TenantAppCatalog" /><Property Id="57" ParentId="55" Name="SiteCollectionAppCatalogsSites" /></ObjectPaths></Request>`
|
|
45
|
+
};
|
|
46
|
+
const res = await request.post(requestOptions);
|
|
47
|
+
const json = JSON.parse(res);
|
|
48
|
+
const response = json[0];
|
|
49
|
+
if (response.ErrorInfo) {
|
|
50
|
+
throw response.ErrorInfo.ErrorMessage;
|
|
51
|
+
}
|
|
52
|
+
else {
|
|
53
|
+
if (this.verbose) {
|
|
54
|
+
await logger.logToStderr('Site collection app catalog disabled');
|
|
55
|
+
}
|
|
51
56
|
}
|
|
52
57
|
}
|
|
58
|
+
catch (err) {
|
|
59
|
+
this.handleRejectedPromise(err);
|
|
60
|
+
}
|
|
61
|
+
};
|
|
62
|
+
if (args.options.force) {
|
|
63
|
+
await removeSiteAppcatalog();
|
|
53
64
|
}
|
|
54
|
-
|
|
55
|
-
|
|
65
|
+
else {
|
|
66
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove the app catalog from ${args.options.siteUrl}?` });
|
|
67
|
+
if (result) {
|
|
68
|
+
await removeSiteAppcatalog();
|
|
69
|
+
}
|
|
56
70
|
}
|
|
57
71
|
}
|
|
58
72
|
}
|
|
59
|
-
_SpoSiteAppCatalogRemoveCommand_instances = new WeakSet(),
|
|
73
|
+
_SpoSiteAppCatalogRemoveCommand_instances = new WeakSet(), _SpoSiteAppCatalogRemoveCommand_initTelemetry = function _SpoSiteAppCatalogRemoveCommand_initTelemetry() {
|
|
74
|
+
this.telemetry.push((args) => {
|
|
75
|
+
Object.assign(this.telemetryProperties, {
|
|
76
|
+
force: !!args.options.force
|
|
77
|
+
});
|
|
78
|
+
});
|
|
79
|
+
}, _SpoSiteAppCatalogRemoveCommand_initOptions = function _SpoSiteAppCatalogRemoveCommand_initOptions() {
|
|
60
80
|
this.options.unshift({
|
|
61
81
|
option: '-u, --siteUrl <siteUrl>'
|
|
82
|
+
}, {
|
|
83
|
+
option: '-f, --force'
|
|
62
84
|
});
|
|
63
85
|
}, _SpoSiteAppCatalogRemoveCommand_initValidators = function _SpoSiteAppCatalogRemoveCommand_initValidators() {
|
|
64
86
|
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.siteUrl));
|
|
87
|
+
}, _SpoSiteAppCatalogRemoveCommand_initTypes = function _SpoSiteAppCatalogRemoveCommand_initTypes() {
|
|
88
|
+
this.types.string.push('siteUrl');
|
|
65
89
|
};
|
|
66
90
|
export default new SpoSiteAppCatalogRemoveCommand();
|
|
67
91
|
//# sourceMappingURL=site-appcatalog-remove.js.map
|
|
@@ -1,13 +1,17 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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 _SpoSiteGetCommand_instances, _SpoSiteGetCommand_initOptions, _SpoSiteGetCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { validation } from '../../../../utils/validation.js';
|
|
5
|
+
import { zod } from '../../../../utils/zod.js';
|
|
9
6
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
7
|
import commands from '../../commands.js';
|
|
8
|
+
const options = globalOptionsZod
|
|
9
|
+
.extend({
|
|
10
|
+
url: zod.alias('u', z.string().refine(url => validation.isValidSharePointUrl(url) === true, {
|
|
11
|
+
message: 'Specify a valid SharePoint site URL'
|
|
12
|
+
}))
|
|
13
|
+
})
|
|
14
|
+
.strict();
|
|
11
15
|
class SpoSiteGetCommand extends SpoCommand {
|
|
12
16
|
get name() {
|
|
13
17
|
return commands.SITE_GET;
|
|
@@ -15,11 +19,8 @@ class SpoSiteGetCommand extends SpoCommand {
|
|
|
15
19
|
get description() {
|
|
16
20
|
return 'Gets information about the specific site collection';
|
|
17
21
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpoSiteGetCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpoSiteGetCommand_instances, "m", _SpoSiteGetCommand_initOptions).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpoSiteGetCommand_instances, "m", _SpoSiteGetCommand_initValidators).call(this);
|
|
22
|
+
get schema() {
|
|
23
|
+
return options;
|
|
23
24
|
}
|
|
24
25
|
async commandAction(logger, args) {
|
|
25
26
|
const requestOptions = {
|
|
@@ -38,10 +39,5 @@ class SpoSiteGetCommand extends SpoCommand {
|
|
|
38
39
|
}
|
|
39
40
|
}
|
|
40
41
|
}
|
|
41
|
-
_SpoSiteGetCommand_instances = new WeakSet(), _SpoSiteGetCommand_initOptions = function _SpoSiteGetCommand_initOptions() {
|
|
42
|
-
this.options.unshift({ option: '-u, --url <url>' });
|
|
43
|
-
}, _SpoSiteGetCommand_initValidators = function _SpoSiteGetCommand_initValidators() {
|
|
44
|
-
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.url));
|
|
45
|
-
};
|
|
46
42
|
export default new SpoSiteGetCommand();
|
|
47
43
|
//# sourceMappingURL=site-get.js.map
|
|
@@ -31,9 +31,6 @@ class SpoSiteRemoveCommand extends SpoCommand {
|
|
|
31
31
|
__classPrivateFieldGet(this, _SpoSiteRemoveCommand_instances, "m", _SpoSiteRemoveCommand_initTypes).call(this);
|
|
32
32
|
}
|
|
33
33
|
async commandAction(logger, args) {
|
|
34
|
-
if (args.options.wait) {
|
|
35
|
-
await this.warn(logger, `Option 'wait' is deprecated and will be removed in the next major release.`);
|
|
36
|
-
}
|
|
37
34
|
if (args.options.force) {
|
|
38
35
|
await this.removeSite(logger, args.options);
|
|
39
36
|
}
|
|
@@ -196,7 +193,6 @@ _SpoSiteRemoveCommand_instances = new WeakSet(), _SpoSiteRemoveCommand_initTelem
|
|
|
196
193
|
Object.assign(this.telemetryProperties, {
|
|
197
194
|
skipRecycleBin: !!args.options.skipRecycleBin,
|
|
198
195
|
fromRecycleBin: !!args.options.fromRecycleBin,
|
|
199
|
-
wait: !!args.options.wait,
|
|
200
196
|
force: !!args.options.force
|
|
201
197
|
});
|
|
202
198
|
});
|
|
@@ -207,8 +203,6 @@ _SpoSiteRemoveCommand_instances = new WeakSet(), _SpoSiteRemoveCommand_initTelem
|
|
|
207
203
|
option: '--skipRecycleBin'
|
|
208
204
|
}, {
|
|
209
205
|
option: '--fromRecycleBin'
|
|
210
|
-
}, {
|
|
211
|
-
option: '--wait'
|
|
212
206
|
}, {
|
|
213
207
|
option: '-f, --force'
|
|
214
208
|
});
|
|
@@ -230,7 +224,7 @@ _SpoSiteRemoveCommand_instances = new WeakSet(), _SpoSiteRemoveCommand_initTelem
|
|
|
230
224
|
});
|
|
231
225
|
}, _SpoSiteRemoveCommand_initTypes = function _SpoSiteRemoveCommand_initTypes() {
|
|
232
226
|
this.types.string.push('url');
|
|
233
|
-
this.types.boolean.push('skipRecycleBin', 'fromRecycleBin', '
|
|
227
|
+
this.types.boolean.push('skipRecycleBin', 'fromRecycleBin', 'force');
|
|
234
228
|
};
|
|
235
229
|
export default new SpoSiteRemoveCommand();
|
|
236
230
|
//# sourceMappingURL=site-remove.js.map
|
|
@@ -4,7 +4,6 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
6
|
var _SpoSearchCommand_instances, _SpoSearchCommand_initTelemetry, _SpoSearchCommand_initOptions, _SpoSearchCommand_initValidators;
|
|
7
|
-
import { isNumber } from 'util';
|
|
8
7
|
import { cli } from '../../../cli/cli.js';
|
|
9
8
|
import request from '../../../request.js';
|
|
10
9
|
import { formatting } from '../../../utils/formatting.js';
|
|
@@ -266,16 +265,16 @@ _SpoSearchCommand_instances = new WeakSet(), _SpoSearchCommand_initTelemetry = f
|
|
|
266
265
|
if (args.options.sortList && !/^([a-z0-9_]+:(ascending|descending))(,([a-z0-9_]+:(ascending|descending)))*$/gi.test(args.options.sortList)) {
|
|
267
266
|
return `sortlist parameter value '${args.options.sortList}' does not match the required pattern (=comma-separated list of '<property>:(ascending|descending)'-pattern)`;
|
|
268
267
|
}
|
|
269
|
-
if (args.options.rowLimit && !
|
|
268
|
+
if (args.options.rowLimit && !Number.isInteger(args.options.rowLimit)) {
|
|
270
269
|
return `${args.options.rowLimit} is not a valid number`;
|
|
271
270
|
}
|
|
272
|
-
if (args.options.startRow && !
|
|
271
|
+
if (args.options.startRow && !Number.isInteger(args.options.startRow)) {
|
|
273
272
|
return `${args.options.startRow} is not a valid number`;
|
|
274
273
|
}
|
|
275
274
|
if (args.options.startRow && args.options.allResults) {
|
|
276
275
|
return 'You cannot specify startRow when allResults is set';
|
|
277
276
|
}
|
|
278
|
-
if (args.options.culture && !
|
|
277
|
+
if (args.options.culture && !Number.isInteger(args.options.culture)) {
|
|
279
278
|
return `${args.options.culture} is not a valid number`;
|
|
280
279
|
}
|
|
281
280
|
return true;
|
|
@@ -3,7 +3,7 @@ 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 _SpoTenantApplicationCustomizerGetCommand_instances, _SpoTenantApplicationCustomizerGetCommand_initTelemetry, _SpoTenantApplicationCustomizerGetCommand_initOptions, _SpoTenantApplicationCustomizerGetCommand_initValidators, _SpoTenantApplicationCustomizerGetCommand_initOptionSets;
|
|
6
|
+
var _SpoTenantApplicationCustomizerGetCommand_instances, _SpoTenantApplicationCustomizerGetCommand_initTelemetry, _SpoTenantApplicationCustomizerGetCommand_initOptions, _SpoTenantApplicationCustomizerGetCommand_initValidators, _SpoTenantApplicationCustomizerGetCommand_initOptionSets, _SpoTenantApplicationCustomizerGetCommand_initTypes;
|
|
7
7
|
import { formatting } from '../../../../utils/formatting.js';
|
|
8
8
|
import { odata } from '../../../../utils/odata.js';
|
|
9
9
|
import { spo } from '../../../../utils/spo.js';
|
|
@@ -26,6 +26,7 @@ class SpoTenantApplicationCustomizerGetCommand extends SpoCommand {
|
|
|
26
26
|
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initOptions).call(this);
|
|
27
27
|
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initValidators).call(this);
|
|
28
28
|
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initOptionSets).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoTenantApplicationCustomizerGetCommand_instances, "m", _SpoTenantApplicationCustomizerGetCommand_initTypes).call(this);
|
|
29
30
|
}
|
|
30
31
|
async commandAction(logger, args) {
|
|
31
32
|
try {
|
|
@@ -50,13 +51,20 @@ class SpoTenantApplicationCustomizerGetCommand extends SpoCommand {
|
|
|
50
51
|
throw 'The specified application customizer was not found';
|
|
51
52
|
}
|
|
52
53
|
listItemInstances.forEach(v => delete v['ID']);
|
|
54
|
+
let listItemInstance;
|
|
53
55
|
if (listItemInstances.length > 1) {
|
|
54
56
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', listItemInstances);
|
|
55
|
-
|
|
56
|
-
await logger.log(result);
|
|
57
|
+
listItemInstance = await cli.handleMultipleResultsFound(`Multiple application customizers with ${args.options.title || args.options.clientSideComponentId} were found.`, resultAsKeyValuePair);
|
|
57
58
|
}
|
|
58
59
|
else {
|
|
59
|
-
|
|
60
|
+
listItemInstance = listItemInstances[0];
|
|
61
|
+
}
|
|
62
|
+
if (!args.options.tenantWideExtensionComponentProperties) {
|
|
63
|
+
await logger.log(listItemInstance);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const properties = formatting.tryParseJson(listItemInstance.TenantWideExtensionComponentProperties);
|
|
67
|
+
await logger.log(properties);
|
|
60
68
|
}
|
|
61
69
|
}
|
|
62
70
|
else {
|
|
@@ -73,7 +81,8 @@ _SpoTenantApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoTenantA
|
|
|
73
81
|
Object.assign(this.telemetryProperties, {
|
|
74
82
|
title: typeof args.options.title !== 'undefined',
|
|
75
83
|
id: typeof args.options.id !== 'undefined',
|
|
76
|
-
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined'
|
|
84
|
+
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
85
|
+
tenantWideExtensionComponentProperties: !!args.options.tenantWideExtensionComponentProperties
|
|
77
86
|
});
|
|
78
87
|
});
|
|
79
88
|
}, _SpoTenantApplicationCustomizerGetCommand_initOptions = function _SpoTenantApplicationCustomizerGetCommand_initOptions() {
|
|
@@ -83,6 +92,8 @@ _SpoTenantApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoTenantA
|
|
|
83
92
|
option: '-i, --id [id]'
|
|
84
93
|
}, {
|
|
85
94
|
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
95
|
+
}, {
|
|
96
|
+
option: '-p, --tenantWideExtensionComponentProperties'
|
|
86
97
|
});
|
|
87
98
|
}, _SpoTenantApplicationCustomizerGetCommand_initValidators = function _SpoTenantApplicationCustomizerGetCommand_initValidators() {
|
|
88
99
|
this.validators.push(async (args) => {
|
|
@@ -96,6 +107,9 @@ _SpoTenantApplicationCustomizerGetCommand_instances = new WeakSet(), _SpoTenantA
|
|
|
96
107
|
});
|
|
97
108
|
}, _SpoTenantApplicationCustomizerGetCommand_initOptionSets = function _SpoTenantApplicationCustomizerGetCommand_initOptionSets() {
|
|
98
109
|
this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
|
|
110
|
+
}, _SpoTenantApplicationCustomizerGetCommand_initTypes = function _SpoTenantApplicationCustomizerGetCommand_initTypes() {
|
|
111
|
+
this.types.string.push('title', 'id', 'clientSideComponentId');
|
|
112
|
+
this.types.boolean.push('tenantWideExtensionComponentProperties');
|
|
99
113
|
};
|
|
100
114
|
export default new SpoTenantApplicationCustomizerGetCommand();
|
|
101
115
|
//# sourceMappingURL=tenant-applicationcustomizer-get.js.map
|
|
@@ -3,7 +3,7 @@ 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 _SpoTenantCommandSetGetCommand_instances, _SpoTenantCommandSetGetCommand_initTelemetry, _SpoTenantCommandSetGetCommand_initOptions, _SpoTenantCommandSetGetCommand_initValidators, _SpoTenantCommandSetGetCommand_initOptionSets;
|
|
6
|
+
var _SpoTenantCommandSetGetCommand_instances, _SpoTenantCommandSetGetCommand_initTelemetry, _SpoTenantCommandSetGetCommand_initOptions, _SpoTenantCommandSetGetCommand_initValidators, _SpoTenantCommandSetGetCommand_initOptionSets, _SpoTenantCommandSetGetCommand_initTypes;
|
|
7
7
|
import { cli } from '../../../../cli/cli.js';
|
|
8
8
|
import { CommandError } from '../../../../Command.js';
|
|
9
9
|
import request from '../../../../request.js';
|
|
@@ -27,6 +27,7 @@ class SpoTenantCommandSetGetCommand extends SpoCommand {
|
|
|
27
27
|
__classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initOptions).call(this);
|
|
28
28
|
__classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initValidators).call(this);
|
|
29
29
|
__classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initOptionSets).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _SpoTenantCommandSetGetCommand_instances, "m", _SpoTenantCommandSetGetCommand_initTypes).call(this);
|
|
30
31
|
}
|
|
31
32
|
async commandAction(logger, args) {
|
|
32
33
|
const appCatalogUrl = await spo.getTenantAppCatalogUrl(logger, this.debug);
|
|
@@ -47,7 +48,7 @@ class SpoTenantCommandSetGetCommand extends SpoCommand {
|
|
|
47
48
|
const reqOptions = {
|
|
48
49
|
url: `${appCatalogUrl}/_api/web/GetList('${formatting.encodeQueryParameter(listServerRelativeUrl)}')/items?$filter=${filter}`,
|
|
49
50
|
headers: {
|
|
50
|
-
|
|
51
|
+
accept: 'application/json;odata=nometadata'
|
|
51
52
|
},
|
|
52
53
|
responseType: 'json'
|
|
53
54
|
};
|
|
@@ -55,13 +56,20 @@ class SpoTenantCommandSetGetCommand extends SpoCommand {
|
|
|
55
56
|
const listItemInstances = await request.get(reqOptions);
|
|
56
57
|
if (listItemInstances?.value.length > 0) {
|
|
57
58
|
listItemInstances.value.forEach(v => delete v['ID']);
|
|
59
|
+
let listItemInstance;
|
|
58
60
|
if (listItemInstances.value.length > 1) {
|
|
59
61
|
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', listItemInstances.value);
|
|
60
|
-
|
|
61
|
-
await logger.log(result);
|
|
62
|
+
listItemInstance = await cli.handleMultipleResultsFound(`Multiple ListView Command Sets with ${args.options.title || args.options.clientSideComponentId} were found.`, resultAsKeyValuePair);
|
|
62
63
|
}
|
|
63
64
|
else {
|
|
64
|
-
|
|
65
|
+
listItemInstance = listItemInstances.value[0];
|
|
66
|
+
}
|
|
67
|
+
if (!args.options.tenantWideExtensionComponentProperties) {
|
|
68
|
+
await logger.log(listItemInstance);
|
|
69
|
+
}
|
|
70
|
+
else {
|
|
71
|
+
const properties = formatting.tryParseJson(listItemInstance.TenantWideExtensionComponentProperties);
|
|
72
|
+
await logger.log(properties);
|
|
65
73
|
}
|
|
66
74
|
}
|
|
67
75
|
else {
|
|
@@ -78,7 +86,8 @@ _SpoTenantCommandSetGetCommand_instances = new WeakSet(), _SpoTenantCommandSetGe
|
|
|
78
86
|
Object.assign(this.telemetryProperties, {
|
|
79
87
|
title: typeof args.options.title !== 'undefined',
|
|
80
88
|
id: typeof args.options.id !== 'undefined',
|
|
81
|
-
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined'
|
|
89
|
+
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
90
|
+
tenantWideExtensionComponentProperties: !!args.options.tenantWideExtensionComponentProperties
|
|
82
91
|
});
|
|
83
92
|
});
|
|
84
93
|
}, _SpoTenantCommandSetGetCommand_initOptions = function _SpoTenantCommandSetGetCommand_initOptions() {
|
|
@@ -88,6 +97,8 @@ _SpoTenantCommandSetGetCommand_instances = new WeakSet(), _SpoTenantCommandSetGe
|
|
|
88
97
|
option: '-i, --id [id]'
|
|
89
98
|
}, {
|
|
90
99
|
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
100
|
+
}, {
|
|
101
|
+
option: '-p, --tenantWideExtensionComponentProperties'
|
|
91
102
|
});
|
|
92
103
|
}, _SpoTenantCommandSetGetCommand_initValidators = function _SpoTenantCommandSetGetCommand_initValidators() {
|
|
93
104
|
this.validators.push(async (args) => {
|
|
@@ -101,6 +112,9 @@ _SpoTenantCommandSetGetCommand_instances = new WeakSet(), _SpoTenantCommandSetGe
|
|
|
101
112
|
});
|
|
102
113
|
}, _SpoTenantCommandSetGetCommand_initOptionSets = function _SpoTenantCommandSetGetCommand_initOptionSets() {
|
|
103
114
|
this.optionSets.push({ options: ['title', 'id', 'clientSideComponentId'] });
|
|
115
|
+
}, _SpoTenantCommandSetGetCommand_initTypes = function _SpoTenantCommandSetGetCommand_initTypes() {
|
|
116
|
+
this.types.string.push('title', 'id', 'clientSideComponentId');
|
|
117
|
+
this.types.boolean.push('tenantWideExtensionComponentProperties');
|
|
104
118
|
};
|
|
105
119
|
export default new SpoTenantCommandSetGetCommand();
|
|
106
120
|
//# sourceMappingURL=tenant-commandset-get.js.map
|