@pnp/cli-microsoft365 7.0.0-beta.c0afb7b → 7.0.0-beta.c2db9df
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/README.md +4 -4
- package/dist/cli/Cli.js +3 -3
- package/dist/m365/aad/commands/app/app-add.js +8 -8
- package/dist/m365/aad/commands/app/app-get.js +4 -1
- package/dist/m365/aad/commands/app/app-remove.js +3 -1
- package/dist/m365/aad/commands/app/app-role-add.js +9 -6
- package/dist/m365/aad/commands/app/app-role-list.js +4 -1
- package/dist/m365/aad/commands/app/app-role-remove.js +5 -2
- package/dist/m365/aad/commands/app/app-set.js +9 -6
- package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +7 -2
- package/dist/m365/aad/commands/group/group-get.js +4 -4
- package/dist/m365/aad/commands/group/group-list.js +1 -23
- package/dist/m365/aad/commands/m365group/m365group-add.js +12 -9
- package/dist/m365/aad/commands/m365group/m365group-recyclebinitem-remove.js +3 -1
- package/dist/m365/aad/commands/m365group/m365group-recyclebinitem-restore.js +4 -1
- package/dist/m365/aad/commands/m365group/m365group-teamify.js +4 -1
- package/dist/m365/aad/commands/policy/policy-list.js +5 -5
- package/dist/m365/aad/commands/sp/sp-add.js +4 -1
- package/dist/m365/aad/commands/sp/sp-get.js +4 -1
- package/dist/m365/aad/commands/user/user-get.js +7 -2
- package/dist/m365/booking/commands/business/business-get.js +4 -1
- package/dist/m365/cli/commands/cli-issue.js +5 -5
- package/dist/m365/cli/commands/config/config-get.js +5 -5
- package/dist/m365/cli/commands/config/config-reset.js +5 -5
- package/dist/m365/cli/commands/config/config-set.js +5 -5
- package/dist/m365/commands/login.js +5 -5
- package/dist/m365/commands/request.js +1 -1
- package/dist/m365/flow/commands/owner/owner-ensure.js +5 -5
- package/dist/m365/outlook/commands/message/message-list.js +4 -2
- package/dist/m365/outlook/commands/message/message-move.js +4 -2
- package/dist/m365/pa/commands/app/app-export.js +7 -7
- package/dist/m365/pa/commands/app/app-owner-set.js +5 -5
- package/dist/m365/pa/commands/app/app-permission-ensure.js +5 -5
- package/dist/m365/planner/commands/bucket/bucket-get.js +5 -1
- package/dist/m365/planner/commands/bucket/bucket-remove.js +3 -1
- package/dist/m365/planner/commands/bucket/bucket-set.js +4 -1
- package/dist/m365/planner/commands/task/task-add.js +17 -11
- package/dist/m365/planner/commands/task/task-get.js +42 -27
- package/dist/m365/planner/commands/task/task-list.js +26 -19
- package/dist/m365/planner/commands/task/task-remove.js +45 -37
- package/dist/m365/planner/commands/task/task-set.js +35 -23
- package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-get.js +4 -1
- package/dist/m365/pp/commands/card/card-get.js +3 -5
- package/dist/m365/pp/commands/chatbot/chatbot-get.js +3 -1
- package/dist/m365/pp/commands/managementapp/managementapp-add.js +4 -1
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +14 -14
- package/dist/m365/search/commands/externalconnection/externalconnection-remove.js +3 -1
- package/dist/m365/spfx/commands/package/package-generate.js +15 -15
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +55 -0
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.18.0-beta.5.js → doctor-1.18.0-rc.1.js} +2 -2
- package/dist/m365/spfx/commands/project/project-doctor.js +9 -9
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +157 -0
- package/dist/m365/spfx/commands/project/project-github-workflow-model.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002028_DEVDEP_microsoft_rush_stack_compiler_4_7.js +13 -0
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.18.0-beta.5.js → upgrade-1.18.0-rc.1.js} +35 -27
- package/dist/m365/spfx/commands/project/project-upgrade.js +14 -14
- package/dist/m365/spfx/commands/spfx-doctor.js +3 -3
- package/dist/m365/spfx/commands.js +1 -0
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +5 -5
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +5 -3
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.js +5 -5
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +2 -2
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +3 -2
- package/dist/m365/spo/commands/commandset/commandset-add.js +11 -11
- package/dist/m365/spo/commands/commandset/commandset-get.js +12 -10
- package/dist/m365/spo/commands/commandset/commandset-list.js +5 -5
- package/dist/m365/spo/commands/commandset/commandset-remove.js +7 -6
- package/dist/m365/spo/commands/commandset/commandset-set.js +14 -12
- package/dist/m365/spo/commands/customaction/customaction-get.js +5 -2
- package/dist/m365/spo/commands/customaction/customaction-remove.js +3 -1
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +3 -1
- package/dist/m365/spo/commands/file/file-get.js +9 -6
- package/dist/m365/spo/commands/file/file-sharinglink-add.js +8 -8
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +5 -5
- package/dist/m365/spo/commands/hubsite/hubsite-connect.js +7 -4
- package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +4 -1
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +3 -1
- package/dist/m365/spo/commands/list/list-add.js +4 -4
- package/dist/m365/spo/commands/list/list-set.js +4 -4
- package/dist/m365/spo/commands/listitem/listitem-add.js +1 -0
- package/dist/m365/spo/commands/listitem/listitem-set.js +3 -2
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +8 -8
- package/dist/m365/spo/commands/page/clientsidepages.js +18 -0
- package/dist/m365/spo/commands/page/page-get.js +1 -0
- package/dist/m365/spo/commands/page/page-list.js +4 -3
- package/dist/m365/spo/commands/page/page-section-add.js +56 -21
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +30 -32
- package/dist/m365/spo/commands/site/site-add.js +114 -161
- package/dist/m365/spo/commands/site/site-apppermission-add.js +15 -18
- package/dist/m365/spo/commands/site/site-apppermission-remove.js +34 -38
- package/dist/m365/spo/commands/site/site-apppermission-set.js +11 -14
- package/dist/m365/spo/commands/site/site-ensure.js +13 -66
- package/dist/m365/spo/commands/site/site-list.js +5 -7
- package/dist/m365/spo/commands/site/site-recyclebinitem-list.js +6 -6
- package/dist/m365/spo/commands/site/site-remove.js +166 -210
- package/dist/m365/spo/commands/site/site-set.js +121 -153
- package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +1 -1
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +8 -3
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-list.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.js +2 -1
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-set.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +8 -8
- package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +8 -3
- package/dist/m365/spo/commands/tenant/tenant-commandset-list.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-commandset-remove.js +3 -1
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +8 -8
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +4 -4
- package/dist/m365/spo/commands/term/term-get.js +6 -6
- package/dist/m365/spo/commands/web/web-roleinheritance-break.js +3 -3
- package/dist/m365/spo/commands/web/web-set.js +5 -5
- package/dist/m365/teams/commands/app/app-list.js +5 -5
- package/dist/m365/teams/commands/channel/channel-add.js +5 -1
- package/dist/m365/teams/commands/channel/channel-member-add.js +4 -2
- package/dist/m365/teams/commands/channel/channel-member-remove.js +3 -1
- package/dist/m365/teams/commands/channel/channel-member-set.js +4 -1
- package/dist/m365/teams/commands/chat/chat-get.js +7 -10
- package/dist/m365/teams/commands/chat/chat-member-add.js +5 -5
- package/dist/m365/teams/commands/chat/chat-message-send.js +8 -10
- package/dist/m365/teams/commands/funsettings/funsettings-set.js +4 -4
- package/dist/m365/teams/commands/guestsettings/guestsettings-set.js +4 -4
- package/dist/m365/teams/commands/membersettings/membersettings-set.js +4 -4
- package/dist/m365/teams/commands/messagingsettings/messagingsettings-set.js +5 -5
- package/dist/m365/teams/commands/team/team-clone.js +5 -10
- package/dist/m365/teams/commands/team/team-list.js +94 -30
- package/dist/m365/teams/commands/team/team-set.js +3 -3
- package/dist/m365/tenant/commands/info/info-get.js +83 -0
- package/dist/m365/tenant/commands.js +1 -0
- package/dist/m365/todo/commands/task/task-add.js +6 -6
- package/dist/m365/yammer/commands/message/message-list.js +5 -5
- package/dist/m365/yammer/commands/yammer-search.js +5 -5
- package/dist/utils/aadGroup.js +23 -3
- package/dist/utils/formatting.js +7 -0
- package/dist/utils/fsUtil.js +5 -0
- package/dist/utils/powerPlatform.js +1 -1
- package/dist/utils/spo.js +582 -0
- package/docs/docs/cmd/aad/group/group-get.mdx +5 -5
- package/docs/docs/cmd/aad/group/group-list.mdx +0 -11
- package/docs/docs/cmd/aad/policy/policy-list.mdx +5 -5
- package/docs/docs/cmd/cli/config/config-list.mdx +1 -1
- package/docs/docs/cmd/pa/app/app-export.mdx +5 -5
- package/docs/docs/cmd/planner/task/task-add.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-get.mdx +13 -4
- package/docs/docs/cmd/planner/task/task-list.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-remove.mdx +25 -8
- package/docs/docs/cmd/planner/task/task-set.mdx +22 -7
- package/docs/docs/cmd/spfx/project/project-github-workflow-add.mdx +94 -0
- package/docs/docs/cmd/spo/listitem/listitem-add.mdx +2 -5
- package/docs/docs/cmd/spo/listitem/listitem-set.mdx +2 -5
- package/docs/docs/cmd/spo/page/page-get.mdx +0 -1
- package/docs/docs/cmd/spo/page/page-list.mdx +0 -1
- package/docs/docs/cmd/spo/page/page-section-add.mdx +25 -1
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.mdx +2 -4
- package/docs/docs/cmd/spo/tenant/tenant-commandset-list.mdx +2 -4
- package/docs/docs/cmd/teams/team/team-clone.mdx +3 -3
- package/docs/docs/cmd/teams/team/team-list.mdx +47 -22
- package/docs/docs/cmd/tenant/info/info-get.mdx +101 -0
- package/npm-shrinkwrap.json +196 -193
- package/package.json +8 -12
|
@@ -9,6 +9,7 @@ import { spo } from '../../../../utils/spo.js';
|
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
10
10
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
12
13
|
class SpoApplicationCustomizerGetCommand extends SpoCommand {
|
|
13
14
|
get name() {
|
|
14
15
|
return commands.APPLICATIONCUSTOMIZER_GET;
|
|
@@ -69,12 +70,13 @@ class SpoApplicationCustomizerGetCommand extends SpoCommand {
|
|
|
69
70
|
if (customActions.length === 1) {
|
|
70
71
|
return customActions[0];
|
|
71
72
|
}
|
|
72
|
-
const
|
|
73
|
+
const identifier = options.title ? `title '${options.title}'` : `Client Side Component Id '${options.clientSideComponentId}'`;
|
|
73
74
|
if (customActions.length === 0) {
|
|
74
|
-
throw `No application customizer with ${
|
|
75
|
+
throw `No application customizer with ${identifier} found`;
|
|
75
76
|
}
|
|
76
77
|
else {
|
|
77
|
-
|
|
78
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', customActions);
|
|
79
|
+
return await Cli.handleMultipleResultsFound(`Multiple application customizers with ${identifier} found.`, resultAsKeyValuePair);
|
|
78
80
|
}
|
|
79
81
|
}
|
|
80
82
|
humanizeScope(scope) {
|
|
@@ -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 _SpoApplicationCustomizerListCommand_instances, _SpoApplicationCustomizerListCommand_initOptions, _SpoApplicationCustomizerListCommand_initTelemetry, _SpoApplicationCustomizerListCommand_initValidators;
|
|
6
|
+
var _SpoApplicationCustomizerListCommand_instances, _a, _SpoApplicationCustomizerListCommand_initOptions, _SpoApplicationCustomizerListCommand_initTelemetry, _SpoApplicationCustomizerListCommand_initValidators;
|
|
7
7
|
import { spo } from '../../../../utils/spo.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -33,12 +33,12 @@ class SpoApplicationCustomizerListCommand extends SpoCommand {
|
|
|
33
33
|
await logger.log(applicationCustomizers);
|
|
34
34
|
}
|
|
35
35
|
}
|
|
36
|
-
_SpoApplicationCustomizerListCommand_instances = new WeakSet(), _SpoApplicationCustomizerListCommand_initOptions = function _SpoApplicationCustomizerListCommand_initOptions() {
|
|
36
|
+
_a = SpoApplicationCustomizerListCommand, _SpoApplicationCustomizerListCommand_instances = new WeakSet(), _SpoApplicationCustomizerListCommand_initOptions = function _SpoApplicationCustomizerListCommand_initOptions() {
|
|
37
37
|
this.options.unshift({
|
|
38
38
|
option: '-u, --webUrl <webUrl>'
|
|
39
39
|
}, {
|
|
40
40
|
option: '-s, --scope [scope]',
|
|
41
|
-
autocomplete:
|
|
41
|
+
autocomplete: _a.scopes
|
|
42
42
|
});
|
|
43
43
|
}, _SpoApplicationCustomizerListCommand_initTelemetry = function _SpoApplicationCustomizerListCommand_initTelemetry() {
|
|
44
44
|
this.telemetry.push((args) => {
|
|
@@ -48,8 +48,8 @@ _SpoApplicationCustomizerListCommand_instances = new WeakSet(), _SpoApplicationC
|
|
|
48
48
|
});
|
|
49
49
|
}, _SpoApplicationCustomizerListCommand_initValidators = function _SpoApplicationCustomizerListCommand_initValidators() {
|
|
50
50
|
this.validators.push(async (args) => {
|
|
51
|
-
if (args.options.scope &&
|
|
52
|
-
return `${args.options.scope} is not a valid scope. Allowed values are ${
|
|
51
|
+
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
52
|
+
return `${args.options.scope} is not a valid scope. Allowed values are ${_a.scopes.join(', ')}`;
|
|
53
53
|
}
|
|
54
54
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
55
55
|
});
|
|
@@ -11,7 +11,6 @@ import SpoCommand from '../../../base/SpoCommand.js';
|
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
12
|
import { spo } from '../../../../utils/spo.js';
|
|
13
13
|
import { formatting } from '../../../../utils/formatting.js';
|
|
14
|
-
import os from 'os';
|
|
15
14
|
class SpoApplicationCustomizerRemoveCommand extends SpoCommand {
|
|
16
15
|
get name() {
|
|
17
16
|
return commands.APPLICATIONCUSTOMIZER_REMOVE;
|
|
@@ -80,7 +79,8 @@ class SpoApplicationCustomizerRemoveCommand extends SpoCommand {
|
|
|
80
79
|
throw `No application customizer with ${options.title && `title '${options.title}'` || options.clientSideComponentId && `ClientSideComponentId '${options.clientSideComponentId}'` || options.id && `id '${options.id}'`} found`;
|
|
81
80
|
}
|
|
82
81
|
if (appCustomizers.length > 1) {
|
|
83
|
-
|
|
82
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', appCustomizers);
|
|
83
|
+
return await Cli.handleMultipleResultsFound(`Multiple application customizer with ${options.title ? `title '${options.title}'` : `ClientSideComponentId '${options.clientSideComponentId}'`} found.`, resultAsKeyValuePair);
|
|
84
84
|
}
|
|
85
85
|
return appCustomizers[0];
|
|
86
86
|
}
|
|
@@ -10,7 +10,7 @@ import SpoCommand from '../../../base/SpoCommand.js';
|
|
|
10
10
|
import commands from '../../commands.js';
|
|
11
11
|
import { spo } from '../../../../utils/spo.js';
|
|
12
12
|
import { formatting } from '../../../../utils/formatting.js';
|
|
13
|
-
import
|
|
13
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
14
14
|
class SpoApplicationCustomizerSetCommand extends SpoCommand {
|
|
15
15
|
get name() {
|
|
16
16
|
return commands.APPLICATIONCUSTOMIZER_SET;
|
|
@@ -82,7 +82,8 @@ class SpoApplicationCustomizerSetCommand extends SpoCommand {
|
|
|
82
82
|
throw `No application customizer with ${title && `title '${title}'` || clientSideComponentId && `ClientSideComponentId '${clientSideComponentId}'` || id && `id '${id}'`} found`;
|
|
83
83
|
}
|
|
84
84
|
if (appCustomizers.length > 1) {
|
|
85
|
-
|
|
85
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', appCustomizers);
|
|
86
|
+
return await Cli.handleMultipleResultsFound(`Multiple application customizer with ${title ? `title '${title}'` : `ClientSideComponentId '${clientSideComponentId}'`} found.`, resultAsKeyValuePair);
|
|
86
87
|
}
|
|
87
88
|
return appCustomizers[0];
|
|
88
89
|
}
|
|
@@ -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 _SpoCommandSetAddCommand_instances, _SpoCommandSetAddCommand_initTelemetry, _SpoCommandSetAddCommand_initOptions, _SpoCommandSetAddCommand_initValidators;
|
|
6
|
+
var _SpoCommandSetAddCommand_instances, _a, _SpoCommandSetAddCommand_initTelemetry, _SpoCommandSetAddCommand_initOptions, _SpoCommandSetAddCommand_initValidators;
|
|
7
7
|
import commands from '../../commands.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -78,7 +78,7 @@ class SpoCommandSetAddCommand extends SpoCommand {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
_SpoCommandSetAddCommand_instances = new WeakSet(), _SpoCommandSetAddCommand_initTelemetry = function _SpoCommandSetAddCommand_initTelemetry() {
|
|
81
|
+
_a = SpoCommandSetAddCommand, _SpoCommandSetAddCommand_instances = new WeakSet(), _SpoCommandSetAddCommand_initTelemetry = function _SpoCommandSetAddCommand_initTelemetry() {
|
|
82
82
|
this.telemetry.push((args) => {
|
|
83
83
|
Object.assign(this.telemetryProperties, {
|
|
84
84
|
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
@@ -92,29 +92,29 @@ _SpoCommandSetAddCommand_instances = new WeakSet(), _SpoCommandSetAddCommand_ini
|
|
|
92
92
|
}, {
|
|
93
93
|
option: '-u, --webUrl <webUrl>'
|
|
94
94
|
}, {
|
|
95
|
-
option: '-l, --listType <listType>', autocomplete:
|
|
95
|
+
option: '-l, --listType <listType>', autocomplete: _a.listTypes
|
|
96
96
|
}, {
|
|
97
97
|
option: '-i, --clientSideComponentId <clientSideComponentId>'
|
|
98
98
|
}, {
|
|
99
99
|
option: '--clientSideComponentProperties [clientSideComponentProperties]'
|
|
100
100
|
}, {
|
|
101
|
-
option: '-s, --scope [scope]', autocomplete:
|
|
101
|
+
option: '-s, --scope [scope]', autocomplete: _a.scopes
|
|
102
102
|
}, {
|
|
103
|
-
option: '--location [location]', autocomplete:
|
|
103
|
+
option: '--location [location]', autocomplete: _a.locations
|
|
104
104
|
});
|
|
105
105
|
}, _SpoCommandSetAddCommand_initValidators = function _SpoCommandSetAddCommand_initValidators() {
|
|
106
106
|
this.validators.push(async (args) => {
|
|
107
107
|
if (args.options.clientSideComponentId && !validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
108
108
|
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
109
109
|
}
|
|
110
|
-
if (
|
|
111
|
-
return `${args.options.listType} is not a valid list type. Allowed values are ${
|
|
110
|
+
if (_a.listTypes.indexOf(args.options.listType) < 0) {
|
|
111
|
+
return `${args.options.listType} is not a valid list type. Allowed values are ${_a.listTypes.join(', ')}`;
|
|
112
112
|
}
|
|
113
|
-
if (args.options.scope &&
|
|
114
|
-
return `${args.options.scope} is not a valid scope. Allowed values are ${
|
|
113
|
+
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
114
|
+
return `${args.options.scope} is not a valid scope. Allowed values are ${_a.scopes.join(', ')}`;
|
|
115
115
|
}
|
|
116
|
-
if (args.options.location &&
|
|
117
|
-
return `${args.options.location} is not a valid location. Allowed values are ${
|
|
116
|
+
if (args.options.location && _a.locations.indexOf(args.options.location) < 0) {
|
|
117
|
+
return `${args.options.location} is not a valid location. Allowed values are ${_a.locations.join(', ')}`;
|
|
118
118
|
}
|
|
119
119
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
120
120
|
});
|
|
@@ -3,13 +3,13 @@ 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 _SpoCommandSetGetCommand_instances, _SpoCommandSetGetCommand_initTelemetry, _SpoCommandSetGetCommand_initOptions, _SpoCommandSetGetCommand_initValidators, _SpoCommandSetGetCommand_initOptionSets;
|
|
7
|
-
import os from 'os';
|
|
6
|
+
var _SpoCommandSetGetCommand_instances, _a, _SpoCommandSetGetCommand_initTelemetry, _SpoCommandSetGetCommand_initOptions, _SpoCommandSetGetCommand_initValidators, _SpoCommandSetGetCommand_initOptionSets;
|
|
8
7
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
8
|
import { spo } from '../../../../utils/spo.js';
|
|
10
9
|
import { validation } from '../../../../utils/validation.js';
|
|
11
10
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
11
|
import commands from '../../commands.js';
|
|
12
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
13
13
|
class SpoCommandSetGetCommand extends SpoCommand {
|
|
14
14
|
get name() {
|
|
15
15
|
return commands.COMMANDSET_GET;
|
|
@@ -35,7 +35,7 @@ class SpoCommandSetGetCommand extends SpoCommand {
|
|
|
35
35
|
if (commandSet === undefined) {
|
|
36
36
|
throw `Command set with id ${args.options.id} can't be found.`;
|
|
37
37
|
}
|
|
38
|
-
else if (!
|
|
38
|
+
else if (!_a.allowedCommandSetLocations.some(allowedLocation => allowedLocation === commandSet.Location)) {
|
|
39
39
|
throw `Custom action with id ${args.options.id} is not a command set.`;
|
|
40
40
|
}
|
|
41
41
|
await logger.log(commandSet);
|
|
@@ -58,7 +58,9 @@ class SpoCommandSetGetCommand extends SpoCommand {
|
|
|
58
58
|
throw `No command set with title '${args.options.title}' found.`;
|
|
59
59
|
}
|
|
60
60
|
else {
|
|
61
|
-
|
|
61
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', commandSets);
|
|
62
|
+
const commandSet = await Cli.handleMultipleResultsFound(`Multiple command sets with title '${args.options.title}' found.`, resultAsKeyValuePair);
|
|
63
|
+
logger.log(commandSet);
|
|
62
64
|
}
|
|
63
65
|
}
|
|
64
66
|
}
|
|
@@ -67,10 +69,10 @@ class SpoCommandSetGetCommand extends SpoCommand {
|
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
getBaseFilter() {
|
|
70
|
-
return `startswith(Location,'${
|
|
72
|
+
return `startswith(Location,'${_a.baseLocation}') and`;
|
|
71
73
|
}
|
|
72
74
|
}
|
|
73
|
-
_SpoCommandSetGetCommand_instances = new WeakSet(), _SpoCommandSetGetCommand_initTelemetry = function _SpoCommandSetGetCommand_initTelemetry() {
|
|
75
|
+
_a = SpoCommandSetGetCommand, _SpoCommandSetGetCommand_instances = new WeakSet(), _SpoCommandSetGetCommand_initTelemetry = function _SpoCommandSetGetCommand_initTelemetry() {
|
|
74
76
|
this.telemetry.push((args) => {
|
|
75
77
|
Object.assign(this.telemetryProperties, {
|
|
76
78
|
title: typeof args.options.title !== 'undefined',
|
|
@@ -90,7 +92,7 @@ _SpoCommandSetGetCommand_instances = new WeakSet(), _SpoCommandSetGetCommand_ini
|
|
|
90
92
|
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
91
93
|
}, {
|
|
92
94
|
option: '-s, --scope [scope]',
|
|
93
|
-
autocomplete:
|
|
95
|
+
autocomplete: _a.scopes
|
|
94
96
|
});
|
|
95
97
|
}, _SpoCommandSetGetCommand_initValidators = function _SpoCommandSetGetCommand_initValidators() {
|
|
96
98
|
this.validators.push(async (args) => {
|
|
@@ -100,8 +102,8 @@ _SpoCommandSetGetCommand_instances = new WeakSet(), _SpoCommandSetGetCommand_ini
|
|
|
100
102
|
if (args.options.clientSideComponentId && !validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
101
103
|
return `${args.options.clientSideComponentId} is not a valid GUID.`;
|
|
102
104
|
}
|
|
103
|
-
if (args.options.scope &&
|
|
104
|
-
return `${args.options.scope} is not a valid scope. Valid scopes are ${
|
|
105
|
+
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
106
|
+
return `${args.options.scope} is not a valid scope. Valid scopes are ${_a.scopes.join(', ')}`;
|
|
105
107
|
}
|
|
106
108
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
107
109
|
});
|
|
@@ -110,6 +112,6 @@ _SpoCommandSetGetCommand_instances = new WeakSet(), _SpoCommandSetGetCommand_ini
|
|
|
110
112
|
};
|
|
111
113
|
SpoCommandSetGetCommand.scopes = ['All', 'Site', 'Web'];
|
|
112
114
|
SpoCommandSetGetCommand.baseLocation = 'ClientSideExtension.ListViewCommandSet';
|
|
113
|
-
SpoCommandSetGetCommand.allowedCommandSetLocations = [
|
|
115
|
+
SpoCommandSetGetCommand.allowedCommandSetLocations = [_a.baseLocation, `${_a.baseLocation}.CommandBar`, `${_a.baseLocation}.ContextMenu`];
|
|
114
116
|
export default new SpoCommandSetGetCommand();
|
|
115
117
|
//# sourceMappingURL=commandset-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 _SpoCommandSetListCommand_instances, _SpoCommandSetListCommand_initTelemetry, _SpoCommandSetListCommand_initOptions, _SpoCommandSetListCommand_initValidators;
|
|
6
|
+
var _SpoCommandSetListCommand_instances, _a, _SpoCommandSetListCommand_initTelemetry, _SpoCommandSetListCommand_initOptions, _SpoCommandSetListCommand_initValidators;
|
|
7
7
|
import { spo } from '../../../../utils/spo.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -38,7 +38,7 @@ class SpoCommandSetListCommand extends SpoCommand {
|
|
|
38
38
|
}
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
_SpoCommandSetListCommand_instances = new WeakSet(), _SpoCommandSetListCommand_initTelemetry = function _SpoCommandSetListCommand_initTelemetry() {
|
|
41
|
+
_a = SpoCommandSetListCommand, _SpoCommandSetListCommand_instances = new WeakSet(), _SpoCommandSetListCommand_initTelemetry = function _SpoCommandSetListCommand_initTelemetry() {
|
|
42
42
|
this.telemetry.push((args) => {
|
|
43
43
|
Object.assign(this.telemetryProperties, {
|
|
44
44
|
scope: args.options.scope || 'All'
|
|
@@ -49,12 +49,12 @@ _SpoCommandSetListCommand_instances = new WeakSet(), _SpoCommandSetListCommand_i
|
|
|
49
49
|
option: '-u, --webUrl <webUrl>'
|
|
50
50
|
}, {
|
|
51
51
|
option: '-s, --scope [scope]',
|
|
52
|
-
autocomplete:
|
|
52
|
+
autocomplete: _a.scopes
|
|
53
53
|
});
|
|
54
54
|
}, _SpoCommandSetListCommand_initValidators = function _SpoCommandSetListCommand_initValidators() {
|
|
55
55
|
this.validators.push(async (args) => {
|
|
56
|
-
if (args.options.scope &&
|
|
57
|
-
return `${args.options.scope} is not a valid scope. Valid scopes are ${
|
|
56
|
+
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
57
|
+
return `${args.options.scope} is not a valid scope. Valid scopes are ${_a.scopes.join(', ')}`;
|
|
58
58
|
}
|
|
59
59
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
60
60
|
});
|
|
@@ -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 _SpoCommandSetRemoveCommand_instances, _SpoCommandSetRemoveCommand_initTelemetry, _SpoCommandSetRemoveCommand_initOptions, _SpoCommandSetRemoveCommand_initValidators, _SpoCommandSetRemoveCommand_initOptionSets;
|
|
6
|
+
var _SpoCommandSetRemoveCommand_instances, _a, _SpoCommandSetRemoveCommand_initTelemetry, _SpoCommandSetRemoveCommand_initOptions, _SpoCommandSetRemoveCommand_initValidators, _SpoCommandSetRemoveCommand_initOptionSets;
|
|
7
7
|
import commands from '../../commands.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
@@ -63,7 +63,8 @@ class SpoCommandSetRemoveCommand extends SpoCommand {
|
|
|
63
63
|
throw `No user commandsets with ${options.title && `title '${options.title}'` || options.clientSideComponentId && `ClientSideComponentId '${options.clientSideComponentId}'` || options.id && `id '${options.id}'`} found`;
|
|
64
64
|
}
|
|
65
65
|
if (commandSets.length > 1) {
|
|
66
|
-
|
|
66
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', commandSets);
|
|
67
|
+
return await Cli.handleMultipleResultsFound(`Multiple user commandsets with ${options.title ? `title '${options.title}'` : `ClientSideComponentId '${options.clientSideComponentId}'`} found.`, resultAsKeyValuePair);
|
|
67
68
|
}
|
|
68
69
|
return commandSets[0];
|
|
69
70
|
}
|
|
@@ -87,7 +88,7 @@ class SpoCommandSetRemoveCommand extends SpoCommand {
|
|
|
87
88
|
}
|
|
88
89
|
}
|
|
89
90
|
}
|
|
90
|
-
_SpoCommandSetRemoveCommand_instances = new WeakSet(), _SpoCommandSetRemoveCommand_initTelemetry = function _SpoCommandSetRemoveCommand_initTelemetry() {
|
|
91
|
+
_a = SpoCommandSetRemoveCommand, _SpoCommandSetRemoveCommand_instances = new WeakSet(), _SpoCommandSetRemoveCommand_initTelemetry = function _SpoCommandSetRemoveCommand_initTelemetry() {
|
|
91
92
|
this.telemetry.push((args) => {
|
|
92
93
|
Object.assign(this.telemetryProperties, {
|
|
93
94
|
title: typeof args.options.title !== 'undefined',
|
|
@@ -107,7 +108,7 @@ _SpoCommandSetRemoveCommand_instances = new WeakSet(), _SpoCommandSetRemoveComma
|
|
|
107
108
|
}, {
|
|
108
109
|
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
109
110
|
}, {
|
|
110
|
-
option: '-s, --scope [scope]', autocomplete:
|
|
111
|
+
option: '-s, --scope [scope]', autocomplete: _a.scopes
|
|
111
112
|
}, {
|
|
112
113
|
option: '-f, --force'
|
|
113
114
|
});
|
|
@@ -119,8 +120,8 @@ _SpoCommandSetRemoveCommand_instances = new WeakSet(), _SpoCommandSetRemoveComma
|
|
|
119
120
|
if (args.options.clientSideComponentId && !validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
120
121
|
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
121
122
|
}
|
|
122
|
-
if (args.options.scope &&
|
|
123
|
-
return `${args.options.scope} is not a valid scope. Allowed values are ${
|
|
123
|
+
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
124
|
+
return `${args.options.scope} is not a valid scope. Allowed values are ${_a.scopes.join(', ')}`;
|
|
124
125
|
}
|
|
125
126
|
return validation.isValidSharePointUrl(args.options.webUrl);
|
|
126
127
|
});
|
|
@@ -3,13 +3,14 @@ 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 _SpoCommandSetSetCommand_instances, _SpoCommandSetSetCommand_initTelemetry, _SpoCommandSetSetCommand_initOptions, _SpoCommandSetSetCommand_initValidators, _SpoCommandSetSetCommand_initOptionSets;
|
|
6
|
+
var _SpoCommandSetSetCommand_instances, _a, _SpoCommandSetSetCommand_initTelemetry, _SpoCommandSetSetCommand_initOptions, _SpoCommandSetSetCommand_initValidators, _SpoCommandSetSetCommand_initOptionSets;
|
|
7
7
|
import commands from '../../commands.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
10
10
|
import request from '../../../../request.js';
|
|
11
11
|
import { formatting } from '../../../../utils/formatting.js';
|
|
12
12
|
import { spo } from '../../../../utils/spo.js';
|
|
13
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
13
14
|
class SpoCommandSetSetCommand extends SpoCommand {
|
|
14
15
|
get name() {
|
|
15
16
|
return commands.COMMANDSET_SET;
|
|
@@ -84,7 +85,8 @@ class SpoCommandSetSetCommand extends SpoCommand {
|
|
|
84
85
|
throw `No user commandsets with ${options.title && `title '${options.title}'` || options.clientSideComponentId && `ClientSideComponentId '${options.clientSideComponentId}'` || options.id && `id '${options.id}'`} found`;
|
|
85
86
|
}
|
|
86
87
|
if (commandSets.length > 1) {
|
|
87
|
-
|
|
88
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', commandSets);
|
|
89
|
+
return await Cli.handleMultipleResultsFound(`Multiple user commandsets with ${options.title ? `title '${options.title}'` : `ClientSideComponentId '${options.clientSideComponentId}'`} found.`, resultAsKeyValuePair);
|
|
88
90
|
}
|
|
89
91
|
return commandSets[0];
|
|
90
92
|
}
|
|
@@ -109,7 +111,7 @@ class SpoCommandSetSetCommand extends SpoCommand {
|
|
|
109
111
|
}
|
|
110
112
|
}
|
|
111
113
|
}
|
|
112
|
-
_SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_initTelemetry = function _SpoCommandSetSetCommand_initTelemetry() {
|
|
114
|
+
_a = SpoCommandSetSetCommand, _SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_initTelemetry = function _SpoCommandSetSetCommand_initTelemetry() {
|
|
113
115
|
this.telemetry.push((args) => {
|
|
114
116
|
Object.assign(this.telemetryProperties, {
|
|
115
117
|
title: typeof args.options.title !== 'undefined',
|
|
@@ -136,13 +138,13 @@ _SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_ini
|
|
|
136
138
|
}, {
|
|
137
139
|
option: '--newTitle [newTitle]'
|
|
138
140
|
}, {
|
|
139
|
-
option: '-l, --listType [listType]', autocomplete:
|
|
141
|
+
option: '-l, --listType [listType]', autocomplete: _a.listTypes
|
|
140
142
|
}, {
|
|
141
143
|
option: '--clientSideComponentProperties [clientSideComponentProperties]'
|
|
142
144
|
}, {
|
|
143
|
-
option: '-s, --scope [scope]', autocomplete:
|
|
145
|
+
option: '-s, --scope [scope]', autocomplete: _a.scopes
|
|
144
146
|
}, {
|
|
145
|
-
option: '--location [location]', autocomplete:
|
|
147
|
+
option: '--location [location]', autocomplete: _a.locations
|
|
146
148
|
});
|
|
147
149
|
}, _SpoCommandSetSetCommand_initValidators = function _SpoCommandSetSetCommand_initValidators() {
|
|
148
150
|
this.validators.push(async (args) => {
|
|
@@ -155,14 +157,14 @@ _SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_ini
|
|
|
155
157
|
if (args.options.newClientSideComponentId && !validation.isValidGuid(args.options.newClientSideComponentId)) {
|
|
156
158
|
return `${args.options.newClientSideComponentId} is not a valid GUID`;
|
|
157
159
|
}
|
|
158
|
-
if (args.options.listType &&
|
|
159
|
-
return `${args.options.listType} is not a valid list type. Allowed values are ${
|
|
160
|
+
if (args.options.listType && _a.listTypes.indexOf(args.options.listType) < 0) {
|
|
161
|
+
return `${args.options.listType} is not a valid list type. Allowed values are ${_a.listTypes.join(', ')}`;
|
|
160
162
|
}
|
|
161
|
-
if (args.options.scope &&
|
|
162
|
-
return `${args.options.scope} is not a valid scope. Allowed values are ${
|
|
163
|
+
if (args.options.scope && _a.scopes.indexOf(args.options.scope) < 0) {
|
|
164
|
+
return `${args.options.scope} is not a valid scope. Allowed values are ${_a.scopes.join(', ')}`;
|
|
163
165
|
}
|
|
164
|
-
if (args.options.location &&
|
|
165
|
-
return `${args.options.location} is not a valid location. Allowed values are ${
|
|
166
|
+
if (args.options.location && _a.locations.indexOf(args.options.location) < 0) {
|
|
167
|
+
return `${args.options.location} is not a valid location. Allowed values are ${_a.locations.join(', ')}`;
|
|
166
168
|
}
|
|
167
169
|
if (!args.options.newTitle && !args.options.listType && !args.options.clientSideComponentProperties && !args.options.location && !args.options.newClientSideComponentId) {
|
|
168
170
|
return `Please specify option to be updated`;
|
|
@@ -4,6 +4,7 @@ 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 _SpoCustomActionGetCommand_instances, _SpoCustomActionGetCommand_initTelemetry, _SpoCustomActionGetCommand_initOptions, _SpoCustomActionGetCommand_initValidators, _SpoCustomActionGetCommand_initOptionSets;
|
|
7
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
7
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
8
9
|
import { spo } from '../../../../utils/spo.js';
|
|
9
10
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -71,7 +72,8 @@ class SpoCustomActionGetCommand extends SpoCommand {
|
|
|
71
72
|
if (customActions.length === 0) {
|
|
72
73
|
throw `No user custom action with title '${options.title}' found`;
|
|
73
74
|
}
|
|
74
|
-
|
|
75
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', customActions);
|
|
76
|
+
return await Cli.handleMultipleResultsFound(`Multiple user custom actions with title '${options.title}' found.`, resultAsKeyValuePair);
|
|
75
77
|
}
|
|
76
78
|
else {
|
|
77
79
|
const customActions = await spo.getCustomActions(options.webUrl, options.scope, `ClientSideComponentId eq guid'${options.clientSideComponentId}'`);
|
|
@@ -79,7 +81,8 @@ class SpoCustomActionGetCommand extends SpoCommand {
|
|
|
79
81
|
throw `No user custom action with ClientSideComponentId '${options.clientSideComponentId}' found`;
|
|
80
82
|
}
|
|
81
83
|
if (customActions.length > 1) {
|
|
82
|
-
|
|
84
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', customActions);
|
|
85
|
+
return await Cli.handleMultipleResultsFound(`Multiple user custom actions with ClientSideComponentId '${options.clientSideComponentId}' found.`, resultAsKeyValuePair);
|
|
83
86
|
}
|
|
84
87
|
return customActions[0];
|
|
85
88
|
}
|
|
@@ -72,7 +72,9 @@ class SpoCustomActionRemoveCommand extends SpoCommand {
|
|
|
72
72
|
if (customActions.length === 0) {
|
|
73
73
|
throw `No user custom action with title '${options.title}' found`;
|
|
74
74
|
}
|
|
75
|
-
|
|
75
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('Id', customActions);
|
|
76
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple user custom actions with title '${options.title}' found.`, resultAsKeyValuePair);
|
|
77
|
+
return result.Id;
|
|
76
78
|
}
|
|
77
79
|
async removeScopedCustomAction(options) {
|
|
78
80
|
const customActionId = await this.getCustomActionId(options);
|
|
@@ -4,6 +4,7 @@ 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 _SpoEventreceiverGetCommand_instances, _SpoEventreceiverGetCommand_initTelemetry, _SpoEventreceiverGetCommand_initOptions, _SpoEventreceiverGetCommand_initValidators, _SpoEventreceiverGetCommand_initOptionSets;
|
|
7
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
7
8
|
import request from '../../../../request.js';
|
|
8
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
10
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
@@ -75,7 +76,8 @@ class SpoEventreceiverGetCommand extends SpoCommand {
|
|
|
75
76
|
throw `The specified event receiver '${args.options.name}' does not exist.`;
|
|
76
77
|
}
|
|
77
78
|
if (res.value && res.value.length > 1) {
|
|
78
|
-
|
|
79
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('ReceiverId', res.value);
|
|
80
|
+
return await Cli.handleMultipleResultsFound(`Multiple event receivers with name '${args.options.name}' found.`, resultAsKeyValuePair);
|
|
79
81
|
}
|
|
80
82
|
return res.value[0];
|
|
81
83
|
}
|
|
@@ -103,6 +103,9 @@ class SpoFileGetCommand extends SpoCommand {
|
|
|
103
103
|
fileProperties.ListItemAllFields.RoleAssignments = response.value;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
+
if (args.options.asListItem) {
|
|
107
|
+
delete fileProperties.ListItemAllFields.ID;
|
|
108
|
+
}
|
|
106
109
|
await logger.log(args.options.asListItem ? fileProperties.ListItemAllFields : fileProperties);
|
|
107
110
|
}
|
|
108
111
|
}
|
|
@@ -115,12 +118,12 @@ class SpoFileGetCommand extends SpoCommand {
|
|
|
115
118
|
_SpoFileGetCommand_instances = new WeakSet(), _SpoFileGetCommand_initTelemetry = function _SpoFileGetCommand_initTelemetry() {
|
|
116
119
|
this.telemetry.push((args) => {
|
|
117
120
|
Object.assign(this.telemetryProperties, {
|
|
118
|
-
id:
|
|
119
|
-
url:
|
|
120
|
-
asString: args.options.asString
|
|
121
|
-
asListItem: args.options.asListItem
|
|
122
|
-
asFile: args.options.asFile
|
|
123
|
-
path:
|
|
121
|
+
id: typeof args.options.id !== 'undefined',
|
|
122
|
+
url: typeof args.options.url !== 'undefined',
|
|
123
|
+
asString: !!args.options.asString,
|
|
124
|
+
asListItem: !!args.options.asListItem,
|
|
125
|
+
asFile: !!args.options.asFile,
|
|
126
|
+
path: typeof args.options.path !== 'undefined',
|
|
124
127
|
withPermissions: !!args.options.withPermissions
|
|
125
128
|
});
|
|
126
129
|
});
|
|
@@ -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 _SpoFileSharingLinkAddCommand_instances, _SpoFileSharingLinkAddCommand_initTelemetry, _SpoFileSharingLinkAddCommand_initOptions, _SpoFileSharingLinkAddCommand_initValidators, _SpoFileSharingLinkAddCommand_initOptionSets;
|
|
6
|
+
var _SpoFileSharingLinkAddCommand_instances, _a, _SpoFileSharingLinkAddCommand_initTelemetry, _SpoFileSharingLinkAddCommand_initOptions, _SpoFileSharingLinkAddCommand_initValidators, _SpoFileSharingLinkAddCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { spo } from '../../../../utils/spo.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -50,7 +50,7 @@ class SpoFileSharingLinkAddCommand extends SpoCommand {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
_SpoFileSharingLinkAddCommand_instances = new WeakSet(), _SpoFileSharingLinkAddCommand_initTelemetry = function _SpoFileSharingLinkAddCommand_initTelemetry() {
|
|
53
|
+
_a = SpoFileSharingLinkAddCommand, _SpoFileSharingLinkAddCommand_instances = new WeakSet(), _SpoFileSharingLinkAddCommand_initTelemetry = function _SpoFileSharingLinkAddCommand_initTelemetry() {
|
|
54
54
|
this.telemetry.push((args) => {
|
|
55
55
|
Object.assign(this.telemetryProperties, {
|
|
56
56
|
fileId: typeof args.options.fileId !== 'undefined',
|
|
@@ -68,12 +68,12 @@ _SpoFileSharingLinkAddCommand_instances = new WeakSet(), _SpoFileSharingLinkAddC
|
|
|
68
68
|
option: '--fileUrl [fileUrl]'
|
|
69
69
|
}, {
|
|
70
70
|
option: '--type <type>',
|
|
71
|
-
autocomplete:
|
|
71
|
+
autocomplete: _a.types
|
|
72
72
|
}, {
|
|
73
73
|
option: '--expirationDateTime [expirationDateTime]'
|
|
74
74
|
}, {
|
|
75
75
|
option: '--scope [scope]',
|
|
76
|
-
autocomplete:
|
|
76
|
+
autocomplete: _a.scopes
|
|
77
77
|
});
|
|
78
78
|
}, _SpoFileSharingLinkAddCommand_initValidators = function _SpoFileSharingLinkAddCommand_initValidators() {
|
|
79
79
|
this.validators.push(async (args) => {
|
|
@@ -84,12 +84,12 @@ _SpoFileSharingLinkAddCommand_instances = new WeakSet(), _SpoFileSharingLinkAddC
|
|
|
84
84
|
if (args.options.fileId && !validation.isValidGuid(args.options.fileId)) {
|
|
85
85
|
return `${args.options.fileId} is not a valid GUID`;
|
|
86
86
|
}
|
|
87
|
-
if (
|
|
88
|
-
return `'${args.options.type}' is not a valid type. Allowed types are ${
|
|
87
|
+
if (_a.types.indexOf(args.options.type) < 0) {
|
|
88
|
+
return `'${args.options.type}' is not a valid type. Allowed types are ${_a.types.join(', ')}`;
|
|
89
89
|
}
|
|
90
90
|
if (args.options.scope &&
|
|
91
|
-
|
|
92
|
-
return `'${args.options.scope}' is not a valid scope. Allowed scopes are ${
|
|
91
|
+
_a.scopes.indexOf(args.options.scope) < 0) {
|
|
92
|
+
return `'${args.options.scope}' is not a valid scope. Allowed scopes are ${_a.scopes.join(', ')}`;
|
|
93
93
|
}
|
|
94
94
|
if (args.options.scope && args.options.scope !== 'anonymous' && args.options.expirationDateTime) {
|
|
95
95
|
return `Option expirationDateTime can only be used for links with scope 'anonymous'.`;
|
|
@@ -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 _SpoFileSharingLinkListCommand_instances, _SpoFileSharingLinkListCommand_initTelemetry, _SpoFileSharingLinkListCommand_initOptions, _SpoFileSharingLinkListCommand_initValidators, _SpoFileSharingLinkListCommand_initOptionSets;
|
|
6
|
+
var _SpoFileSharingLinkListCommand_instances, _a, _SpoFileSharingLinkListCommand_initTelemetry, _SpoFileSharingLinkListCommand_initOptions, _SpoFileSharingLinkListCommand_initValidators, _SpoFileSharingLinkListCommand_initOptionSets;
|
|
7
7
|
import { Cli } from '../../../../cli/Cli.js';
|
|
8
8
|
import { odata } from '../../../../utils/odata.js';
|
|
9
9
|
import { spo } from '../../../../utils/spo.js';
|
|
@@ -59,7 +59,7 @@ class SpoFileSharingLinkListCommand extends SpoCommand {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
_SpoFileSharingLinkListCommand_instances = new WeakSet(), _SpoFileSharingLinkListCommand_initTelemetry = function _SpoFileSharingLinkListCommand_initTelemetry() {
|
|
62
|
+
_a = SpoFileSharingLinkListCommand, _SpoFileSharingLinkListCommand_instances = new WeakSet(), _SpoFileSharingLinkListCommand_initTelemetry = function _SpoFileSharingLinkListCommand_initTelemetry() {
|
|
63
63
|
this.telemetry.push((args) => {
|
|
64
64
|
Object.assign(this.telemetryProperties, {
|
|
65
65
|
fileId: typeof args.options.fileId !== 'undefined',
|
|
@@ -76,7 +76,7 @@ _SpoFileSharingLinkListCommand_instances = new WeakSet(), _SpoFileSharingLinkLis
|
|
|
76
76
|
option: '--fileUrl [fileUrl]'
|
|
77
77
|
}, {
|
|
78
78
|
option: '-s, --scope [scope]',
|
|
79
|
-
autocomplete:
|
|
79
|
+
autocomplete: _a.allowedScopes
|
|
80
80
|
});
|
|
81
81
|
}, _SpoFileSharingLinkListCommand_initValidators = function _SpoFileSharingLinkListCommand_initValidators() {
|
|
82
82
|
this.validators.push(async (args) => {
|
|
@@ -87,8 +87,8 @@ _SpoFileSharingLinkListCommand_instances = new WeakSet(), _SpoFileSharingLinkLis
|
|
|
87
87
|
if (args.options.fileId && !validation.isValidGuid(args.options.fileId)) {
|
|
88
88
|
return `${args.options.fileId} is not a valid GUID`;
|
|
89
89
|
}
|
|
90
|
-
if (args.options.scope &&
|
|
91
|
-
return `'${args.options.scope}' is not a valid scope. Allowed values are: ${
|
|
90
|
+
if (args.options.scope && _a.allowedScopes.indexOf(args.options.scope) === -1) {
|
|
91
|
+
return `'${args.options.scope}' is not a valid scope. Allowed values are: ${_a.allowedScopes.join(',')}`;
|
|
92
92
|
}
|
|
93
93
|
return true;
|
|
94
94
|
});
|
|
@@ -9,6 +9,8 @@ import { spo } from '../../../../utils/spo.js';
|
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
10
10
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
13
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
12
14
|
class SpoHubSiteConnectCommand extends SpoCommand {
|
|
13
15
|
get name() {
|
|
14
16
|
return commands.HUBSITE_CONNECT;
|
|
@@ -31,8 +33,8 @@ class SpoHubSiteConnectCommand extends SpoCommand {
|
|
|
31
33
|
try {
|
|
32
34
|
const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
33
35
|
const hubSites = await this.getHubSites(spoAdminUrl);
|
|
34
|
-
const hubSite = this.getSpecificHubSite(hubSites, args.options.id, args.options.title, args.options.url);
|
|
35
|
-
const parentHubSite = this.getSpecificHubSite(hubSites, args.options.parentId, args.options.parentTitle, args.options.parentUrl);
|
|
36
|
+
const hubSite = await this.getSpecificHubSite(hubSites, args.options.id, args.options.title, args.options.url);
|
|
37
|
+
const parentHubSite = await this.getSpecificHubSite(hubSites, args.options.parentId, args.options.parentTitle, args.options.parentUrl);
|
|
36
38
|
const requestOptions = {
|
|
37
39
|
url: `${spoAdminUrl}/_api/HubSites/GetById('${hubSite.ID}')`,
|
|
38
40
|
headers: {
|
|
@@ -61,7 +63,7 @@ class SpoHubSiteConnectCommand extends SpoCommand {
|
|
|
61
63
|
const hubSites = await request.get(requestOptions);
|
|
62
64
|
return hubSites.value;
|
|
63
65
|
}
|
|
64
|
-
getSpecificHubSite(hubSites, id, title, url) {
|
|
66
|
+
async getSpecificHubSite(hubSites, id, title, url) {
|
|
65
67
|
let filteredHubSites = [];
|
|
66
68
|
if (id) {
|
|
67
69
|
filteredHubSites = hubSites.filter(site => site.ID.toLowerCase() === id.toLowerCase());
|
|
@@ -76,7 +78,8 @@ class SpoHubSiteConnectCommand extends SpoCommand {
|
|
|
76
78
|
throw `The specified hub site '${id || title || url}' does not exist.`;
|
|
77
79
|
}
|
|
78
80
|
if (filteredHubSites.length > 1) {
|
|
79
|
-
|
|
81
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('ID', filteredHubSites);
|
|
82
|
+
return await Cli.handleMultipleResultsFound(`Multiple hub sites with name '${title}' found.`, resultAsKeyValuePair);
|
|
80
83
|
}
|
|
81
84
|
return filteredHubSites[0];
|
|
82
85
|
}
|