@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
|
@@ -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 _CliIssueCommand_instances, _CliIssueCommand_initTelemetry, _CliIssueCommand_initOptions, _CliIssueCommand_initValidators;
|
|
6
|
+
var _CliIssueCommand_instances, _a, _CliIssueCommand_initTelemetry, _CliIssueCommand_initOptions, _CliIssueCommand_initValidators;
|
|
7
7
|
import { browserUtil } from '../../../utils/browserUtil.js';
|
|
8
8
|
import AnonymousCommand from '../../base/AnonymousCommand.js';
|
|
9
9
|
import commands from '../commands.js';
|
|
@@ -38,7 +38,7 @@ class CliIssueCommand extends AnonymousCommand {
|
|
|
38
38
|
await logger.log(issueLink);
|
|
39
39
|
}
|
|
40
40
|
}
|
|
41
|
-
_CliIssueCommand_instances = new WeakSet(), _CliIssueCommand_initTelemetry = function _CliIssueCommand_initTelemetry() {
|
|
41
|
+
_a = CliIssueCommand, _CliIssueCommand_instances = new WeakSet(), _CliIssueCommand_initTelemetry = function _CliIssueCommand_initTelemetry() {
|
|
42
42
|
this.telemetry.push((args) => {
|
|
43
43
|
Object.assign(this.telemetryProperties, {
|
|
44
44
|
type: args.options.type
|
|
@@ -47,12 +47,12 @@ _CliIssueCommand_instances = new WeakSet(), _CliIssueCommand_initTelemetry = fun
|
|
|
47
47
|
}, _CliIssueCommand_initOptions = function _CliIssueCommand_initOptions() {
|
|
48
48
|
this.options.unshift({
|
|
49
49
|
option: '-t, --type <type>',
|
|
50
|
-
autocomplete:
|
|
50
|
+
autocomplete: _a.issueType
|
|
51
51
|
});
|
|
52
52
|
}, _CliIssueCommand_initValidators = function _CliIssueCommand_initValidators() {
|
|
53
53
|
this.validators.push(async (args) => {
|
|
54
|
-
if (
|
|
55
|
-
return `${args.options.type} is not a valid Issue type. Allowed values are ${
|
|
54
|
+
if (_a.issueType.indexOf(args.options.type) < 0) {
|
|
55
|
+
return `${args.options.type} is not a valid Issue type. Allowed values are ${_a.issueType.join(', ')}`;
|
|
56
56
|
}
|
|
57
57
|
return true;
|
|
58
58
|
});
|
|
@@ -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 _CliConfigGetCommand_instances, _CliConfigGetCommand_initTelemetry, _CliConfigGetCommand_initOptions, _CliConfigGetCommand_initValidators;
|
|
6
|
+
var _CliConfigGetCommand_instances, _a, _CliConfigGetCommand_initTelemetry, _CliConfigGetCommand_initOptions, _CliConfigGetCommand_initValidators;
|
|
7
7
|
import { Cli } from "../../../../cli/Cli.js";
|
|
8
8
|
import { settingsNames } from "../../../../settingsNames.js";
|
|
9
9
|
import AnonymousCommand from "../../../base/AnonymousCommand.js";
|
|
@@ -26,7 +26,7 @@ class CliConfigGetCommand extends AnonymousCommand {
|
|
|
26
26
|
await logger.log(Cli.getInstance().config.get(args.options.key));
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
|
-
_CliConfigGetCommand_instances = new WeakSet(), _CliConfigGetCommand_initTelemetry = function _CliConfigGetCommand_initTelemetry() {
|
|
29
|
+
_a = CliConfigGetCommand, _CliConfigGetCommand_instances = new WeakSet(), _CliConfigGetCommand_initTelemetry = function _CliConfigGetCommand_initTelemetry() {
|
|
30
30
|
this.telemetry.push((args) => {
|
|
31
31
|
Object.assign(this.telemetryProperties, {
|
|
32
32
|
key: args.options.key
|
|
@@ -35,12 +35,12 @@ _CliConfigGetCommand_instances = new WeakSet(), _CliConfigGetCommand_initTelemet
|
|
|
35
35
|
}, _CliConfigGetCommand_initOptions = function _CliConfigGetCommand_initOptions() {
|
|
36
36
|
this.options.unshift({
|
|
37
37
|
option: '-k, --key <key>',
|
|
38
|
-
autocomplete:
|
|
38
|
+
autocomplete: _a.optionNames
|
|
39
39
|
});
|
|
40
40
|
}, _CliConfigGetCommand_initValidators = function _CliConfigGetCommand_initValidators() {
|
|
41
41
|
this.validators.push(async (args) => {
|
|
42
|
-
if (
|
|
43
|
-
return `${args.options.key} is not a valid setting. Allowed values: ${
|
|
42
|
+
if (_a.optionNames.indexOf(args.options.key) < 0) {
|
|
43
|
+
return `${args.options.key} is not a valid setting. Allowed values: ${_a.optionNames.join(', ')}`;
|
|
44
44
|
}
|
|
45
45
|
return true;
|
|
46
46
|
});
|
|
@@ -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 _CliConfigResetCommand_instances, _CliConfigResetCommand_initTelemetry, _CliConfigResetCommand_initOptions, _CliConfigResetCommand_initValidators;
|
|
6
|
+
var _CliConfigResetCommand_instances, _a, _CliConfigResetCommand_initTelemetry, _CliConfigResetCommand_initOptions, _CliConfigResetCommand_initValidators;
|
|
7
7
|
import { Cli } from "../../../../cli/Cli.js";
|
|
8
8
|
import { settingsNames } from "../../../../settingsNames.js";
|
|
9
9
|
import AnonymousCommand from "../../../base/AnonymousCommand.js";
|
|
@@ -31,7 +31,7 @@ class CliConfigResetCommand extends AnonymousCommand {
|
|
|
31
31
|
}
|
|
32
32
|
}
|
|
33
33
|
}
|
|
34
|
-
_CliConfigResetCommand_instances = new WeakSet(), _CliConfigResetCommand_initTelemetry = function _CliConfigResetCommand_initTelemetry() {
|
|
34
|
+
_a = CliConfigResetCommand, _CliConfigResetCommand_instances = new WeakSet(), _CliConfigResetCommand_initTelemetry = function _CliConfigResetCommand_initTelemetry() {
|
|
35
35
|
this.telemetry.push((args) => {
|
|
36
36
|
Object.assign(this.telemetryProperties, {
|
|
37
37
|
key: args.options.key
|
|
@@ -40,13 +40,13 @@ _CliConfigResetCommand_instances = new WeakSet(), _CliConfigResetCommand_initTel
|
|
|
40
40
|
}, _CliConfigResetCommand_initOptions = function _CliConfigResetCommand_initOptions() {
|
|
41
41
|
this.options.unshift({
|
|
42
42
|
option: '-k, --key [key]',
|
|
43
|
-
autocomplete:
|
|
43
|
+
autocomplete: _a.optionNames
|
|
44
44
|
});
|
|
45
45
|
}, _CliConfigResetCommand_initValidators = function _CliConfigResetCommand_initValidators() {
|
|
46
46
|
this.validators.push(async (args) => {
|
|
47
47
|
if (args.options.key) {
|
|
48
|
-
if (
|
|
49
|
-
return `${args.options.key} is not a valid setting. Allowed values: ${
|
|
48
|
+
if (_a.optionNames.indexOf(args.options.key) < 0) {
|
|
49
|
+
return `${args.options.key} is not a valid setting. Allowed values: ${_a.optionNames.join(', ')}`;
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
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 _CliConfigSetCommand_instances, _CliConfigSetCommand_initTelemetry, _CliConfigSetCommand_initOptions, _CliConfigSetCommand_initValidators;
|
|
6
|
+
var _CliConfigSetCommand_instances, _a, _CliConfigSetCommand_initTelemetry, _CliConfigSetCommand_initOptions, _CliConfigSetCommand_initValidators;
|
|
7
7
|
import { Cli } from "../../../../cli/Cli.js";
|
|
8
8
|
import { settingsNames } from "../../../../settingsNames.js";
|
|
9
9
|
import AnonymousCommand from "../../../base/AnonymousCommand.js";
|
|
@@ -44,21 +44,21 @@ class CliConfigSetCommand extends AnonymousCommand {
|
|
|
44
44
|
Cli.getInstance().config.set(args.options.key, value);
|
|
45
45
|
}
|
|
46
46
|
}
|
|
47
|
-
_CliConfigSetCommand_instances = new WeakSet(), _CliConfigSetCommand_initTelemetry = function _CliConfigSetCommand_initTelemetry() {
|
|
47
|
+
_a = CliConfigSetCommand, _CliConfigSetCommand_instances = new WeakSet(), _CliConfigSetCommand_initTelemetry = function _CliConfigSetCommand_initTelemetry() {
|
|
48
48
|
this.telemetry.push((args) => {
|
|
49
49
|
this.telemetryProperties[args.options.key] = args.options.value;
|
|
50
50
|
});
|
|
51
51
|
}, _CliConfigSetCommand_initOptions = function _CliConfigSetCommand_initOptions() {
|
|
52
52
|
this.options.unshift({
|
|
53
53
|
option: '-k, --key <key>',
|
|
54
|
-
autocomplete:
|
|
54
|
+
autocomplete: _a.optionNames
|
|
55
55
|
}, {
|
|
56
56
|
option: '-v, --value <value>'
|
|
57
57
|
});
|
|
58
58
|
}, _CliConfigSetCommand_initValidators = function _CliConfigSetCommand_initValidators() {
|
|
59
59
|
this.validators.push(async (args) => {
|
|
60
|
-
if (
|
|
61
|
-
return `${args.options.key} is not a valid setting. Allowed values: ${
|
|
60
|
+
if (_a.optionNames.indexOf(args.options.key) < 0) {
|
|
61
|
+
return `${args.options.key} is not a valid setting. Allowed values: ${_a.optionNames.join(', ')}`;
|
|
62
62
|
}
|
|
63
63
|
const allowedOutputs = ['text', 'json', 'csv', 'md', 'none'];
|
|
64
64
|
if (args.options.key === settingsNames.output &&
|
|
@@ -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 _LoginCommand_instances, _LoginCommand_initTelemetry, _LoginCommand_initOptions, _LoginCommand_initValidators;
|
|
6
|
+
var _LoginCommand_instances, _a, _LoginCommand_initTelemetry, _LoginCommand_initOptions, _LoginCommand_initValidators;
|
|
7
7
|
import fs from 'fs';
|
|
8
8
|
import auth, { AuthType, CloudType } from '../../Auth.js';
|
|
9
9
|
import Command, { CommandError } from '../../Command.js';
|
|
@@ -123,7 +123,7 @@ class LoginCommand extends Command {
|
|
|
123
123
|
await this.commandAction(logger, args);
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
|
-
_LoginCommand_instances = new WeakSet(), _LoginCommand_initTelemetry = function _LoginCommand_initTelemetry() {
|
|
126
|
+
_a = LoginCommand, _LoginCommand_instances = new WeakSet(), _LoginCommand_initTelemetry = function _LoginCommand_initTelemetry() {
|
|
127
127
|
this.telemetry.push((args) => {
|
|
128
128
|
Object.assign(this.telemetryProperties, {
|
|
129
129
|
authType: args.options.authType || 'deviceCode',
|
|
@@ -133,7 +133,7 @@ _LoginCommand_instances = new WeakSet(), _LoginCommand_initTelemetry = function
|
|
|
133
133
|
}, _LoginCommand_initOptions = function _LoginCommand_initOptions() {
|
|
134
134
|
this.options.unshift({
|
|
135
135
|
option: '-t, --authType [authType]',
|
|
136
|
-
autocomplete:
|
|
136
|
+
autocomplete: _a.allowedAuthTypes
|
|
137
137
|
}, {
|
|
138
138
|
option: '-u, --userName [userName]'
|
|
139
139
|
}, {
|
|
@@ -178,8 +178,8 @@ _LoginCommand_instances = new WeakSet(), _LoginCommand_initTelemetry = function
|
|
|
178
178
|
}
|
|
179
179
|
}
|
|
180
180
|
if (args.options.authType &&
|
|
181
|
-
|
|
182
|
-
return `'${args.options.authType}' is not a valid authentication type. Allowed authentication types are ${
|
|
181
|
+
_a.allowedAuthTypes.indexOf(args.options.authType) < 0) {
|
|
182
|
+
return `'${args.options.authType}' is not a valid authentication type. Allowed authentication types are ${_a.allowedAuthTypes.join(', ')}`;
|
|
183
183
|
}
|
|
184
184
|
if (args.options.authType === 'secret') {
|
|
185
185
|
if (!args.options.secret) {
|
|
@@ -6,10 +6,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
6
6
|
var _RequestCommand_instances, _RequestCommand_initTelemetry, _RequestCommand_initOptions, _RequestCommand_initValidators;
|
|
7
7
|
import fs from 'fs';
|
|
8
8
|
import path from 'path';
|
|
9
|
+
import auth from '../../Auth.js';
|
|
9
10
|
import Command from '../../Command.js';
|
|
10
11
|
import request from '../../request.js';
|
|
11
12
|
import commands from './commands.js';
|
|
12
|
-
import auth from '../../Auth.js';
|
|
13
13
|
class RequestCommand extends Command {
|
|
14
14
|
get name() {
|
|
15
15
|
return commands.REQUEST;
|
|
@@ -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 _FlowOwnerEnsureCommand_instances, _FlowOwnerEnsureCommand_initTelemetry, _FlowOwnerEnsureCommand_initOptions, _FlowOwnerEnsureCommand_initOptionSets, _FlowOwnerEnsureCommand_initValidators;
|
|
6
|
+
var _FlowOwnerEnsureCommand_instances, _a, _FlowOwnerEnsureCommand_initTelemetry, _FlowOwnerEnsureCommand_initOptions, _FlowOwnerEnsureCommand_initOptionSets, _FlowOwnerEnsureCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
9
9
|
import { aadUser } from '../../../../utils/aadUser.js';
|
|
@@ -78,7 +78,7 @@ class FlowOwnerEnsureCommand extends AzmgmtCommand {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
}
|
|
81
|
-
_FlowOwnerEnsureCommand_instances = new WeakSet(), _FlowOwnerEnsureCommand_initTelemetry = function _FlowOwnerEnsureCommand_initTelemetry() {
|
|
81
|
+
_a = FlowOwnerEnsureCommand, _FlowOwnerEnsureCommand_instances = new WeakSet(), _FlowOwnerEnsureCommand_initTelemetry = function _FlowOwnerEnsureCommand_initTelemetry() {
|
|
82
82
|
this.telemetry.push((args) => {
|
|
83
83
|
Object.assign(this.telemetryProperties, {
|
|
84
84
|
asAdmin: !!args.options.asAdmin,
|
|
@@ -103,7 +103,7 @@ _FlowOwnerEnsureCommand_instances = new WeakSet(), _FlowOwnerEnsureCommand_initT
|
|
|
103
103
|
option: '--groupName [groupName]'
|
|
104
104
|
}, {
|
|
105
105
|
option: '--roleName <roleName>',
|
|
106
|
-
autocomplete:
|
|
106
|
+
autocomplete: _a.allowedRoleNames
|
|
107
107
|
}, {
|
|
108
108
|
option: '--asAdmin'
|
|
109
109
|
});
|
|
@@ -123,8 +123,8 @@ _FlowOwnerEnsureCommand_instances = new WeakSet(), _FlowOwnerEnsureCommand_initT
|
|
|
123
123
|
if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
|
|
124
124
|
return `${args.options.groupId} is not a valid GUID.`;
|
|
125
125
|
}
|
|
126
|
-
if (
|
|
127
|
-
return `${args.options.roleName} is not a valid roleName. Valid values are: ${
|
|
126
|
+
if (_a.allowedRoleNames.indexOf(args.options.roleName) === -1) {
|
|
127
|
+
return `${args.options.roleName} is not a valid roleName. Valid values are: ${_a.allowedRoleNames.join(', ')}`;
|
|
128
128
|
}
|
|
129
129
|
return true;
|
|
130
130
|
});
|
|
@@ -4,13 +4,13 @@ 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 _OutlookMessageListCommand_instances, _OutlookMessageListCommand_initTelemetry, _OutlookMessageListCommand_initOptions, _OutlookMessageListCommand_initOptionSets;
|
|
7
|
-
import os from 'os';
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
9
|
import { odata } from '../../../../utils/odata.js';
|
|
11
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
11
|
import commands from '../../commands.js';
|
|
13
12
|
import { Outlook } from '../../Outlook.js';
|
|
13
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
14
14
|
class OutlookMessageListCommand extends GraphCommand {
|
|
15
15
|
get name() {
|
|
16
16
|
return commands.MESSAGE_LIST;
|
|
@@ -61,7 +61,9 @@ class OutlookMessageListCommand extends GraphCommand {
|
|
|
61
61
|
throw `Folder with name '${args.options.folderName}' not found`;
|
|
62
62
|
}
|
|
63
63
|
if (response.value.length > 1) {
|
|
64
|
-
|
|
64
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', response.value);
|
|
65
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple folders with name '${args.options.folderName}' found.`, resultAsKeyValuePair);
|
|
66
|
+
return result.id;
|
|
65
67
|
}
|
|
66
68
|
return response.value[0].id;
|
|
67
69
|
}
|
|
@@ -4,12 +4,12 @@ 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 _OutlookMessageMoveCommand_instances, _OutlookMessageMoveCommand_initTelemetry, _OutlookMessageMoveCommand_initOptions, _OutlookMessageMoveCommand_initOptionSets;
|
|
7
|
-
import os from 'os';
|
|
8
7
|
import request from '../../../../request.js';
|
|
9
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
9
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
10
|
import commands from '../../commands.js';
|
|
12
11
|
import { Outlook } from '../../Outlook.js';
|
|
12
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
13
13
|
class OutlookMessageMoveCommand extends GraphCommand {
|
|
14
14
|
get name() {
|
|
15
15
|
return commands.MESSAGE_MOVE;
|
|
@@ -66,7 +66,9 @@ class OutlookMessageMoveCommand extends GraphCommand {
|
|
|
66
66
|
throw `Folder with name '${folderName}' not found`;
|
|
67
67
|
}
|
|
68
68
|
if (response.value.length > 1) {
|
|
69
|
-
|
|
69
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', response.value);
|
|
70
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple folders with name '${folderName}' found.`, resultAsKeyValuePair);
|
|
71
|
+
return result.id;
|
|
70
72
|
}
|
|
71
73
|
return response.value[0].id;
|
|
72
74
|
}
|
|
@@ -69,7 +69,7 @@ class PaAppExportCommand extends PowerPlatformCommand {
|
|
|
69
69
|
},
|
|
70
70
|
data: {
|
|
71
71
|
baseResourceIds: [
|
|
72
|
-
`/providers/Microsoft.PowerApps/apps/${args.options.
|
|
72
|
+
`/providers/Microsoft.PowerApps/apps/${args.options.name}`
|
|
73
73
|
]
|
|
74
74
|
},
|
|
75
75
|
responseType: 'json'
|
|
@@ -82,7 +82,7 @@ class PaAppExportCommand extends PowerPlatformCommand {
|
|
|
82
82
|
}
|
|
83
83
|
async exportPackage(args, logger) {
|
|
84
84
|
if (this.verbose) {
|
|
85
|
-
await logger.logToStderr(`Initiating package export for Microsoft Power App ${args.options.
|
|
85
|
+
await logger.logToStderr(`Initiating package export for Microsoft Power App ${args.options.name}...`);
|
|
86
86
|
}
|
|
87
87
|
const resources = await this.getPackageResources(args, logger);
|
|
88
88
|
const requestOptions = {
|
|
@@ -93,7 +93,7 @@ class PaAppExportCommand extends PowerPlatformCommand {
|
|
|
93
93
|
responseType: 'json',
|
|
94
94
|
data: {
|
|
95
95
|
includedResourceIds: [
|
|
96
|
-
`/providers/Microsoft.PowerApps/apps/${args.options.
|
|
96
|
+
`/providers/Microsoft.PowerApps/apps/${args.options.name}`
|
|
97
97
|
],
|
|
98
98
|
details: {
|
|
99
99
|
creator: args.options.packageCreatedBy,
|
|
@@ -148,11 +148,11 @@ _PaAppExportCommand_instances = new WeakSet(), _PaAppExportCommand_initTelemetry
|
|
|
148
148
|
});
|
|
149
149
|
}, _PaAppExportCommand_initOptions = function _PaAppExportCommand_initOptions() {
|
|
150
150
|
this.options.unshift({
|
|
151
|
-
option: '-
|
|
151
|
+
option: '-n, --name <name>'
|
|
152
152
|
}, {
|
|
153
153
|
option: '-e, --environmentName <environmentName>'
|
|
154
154
|
}, {
|
|
155
|
-
option: '
|
|
155
|
+
option: '--packageDisplayName [packageDisplayName]'
|
|
156
156
|
}, {
|
|
157
157
|
option: '-d, --packageDescription [packageDescription]'
|
|
158
158
|
}, {
|
|
@@ -164,8 +164,8 @@ _PaAppExportCommand_instances = new WeakSet(), _PaAppExportCommand_initTelemetry
|
|
|
164
164
|
});
|
|
165
165
|
}, _PaAppExportCommand_initValidators = function _PaAppExportCommand_initValidators() {
|
|
166
166
|
this.validators.push(async (args) => {
|
|
167
|
-
if (
|
|
168
|
-
return `${args.options.
|
|
167
|
+
if (!validation.isValidGuid(args.options.name)) {
|
|
168
|
+
return `${args.options.name} is not a valid GUID for option name`;
|
|
169
169
|
}
|
|
170
170
|
if (args.options.path && !fs.existsSync(path.dirname(args.options.path))) {
|
|
171
171
|
return 'Specified path where to save the file does not exist';
|
|
@@ -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 _PaAppOwnerSetCommand_instances, _PaAppOwnerSetCommand_initTelemetry, _PaAppOwnerSetCommand_initOptions, _PaAppOwnerSetCommand_initValidators, _PaAppOwnerSetCommand_initOptionSets;
|
|
6
|
+
var _PaAppOwnerSetCommand_instances, _a, _PaAppOwnerSetCommand_initTelemetry, _PaAppOwnerSetCommand_initOptions, _PaAppOwnerSetCommand_initValidators, _PaAppOwnerSetCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { aadUser } from '../../../../utils/aadUser.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -55,7 +55,7 @@ class PaAppOwnerSetCommand extends PowerAppsCommand {
|
|
|
55
55
|
return aadUser.getUserIdByUpn(options.userName);
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
|
-
_PaAppOwnerSetCommand_instances = new WeakSet(), _PaAppOwnerSetCommand_initTelemetry = function _PaAppOwnerSetCommand_initTelemetry() {
|
|
58
|
+
_a = PaAppOwnerSetCommand, _PaAppOwnerSetCommand_instances = new WeakSet(), _PaAppOwnerSetCommand_initTelemetry = function _PaAppOwnerSetCommand_initTelemetry() {
|
|
59
59
|
this.telemetry.push((args) => {
|
|
60
60
|
Object.assign(this.telemetryProperties, {
|
|
61
61
|
userId: typeof args.options.userId !== 'undefined',
|
|
@@ -74,7 +74,7 @@ _PaAppOwnerSetCommand_instances = new WeakSet(), _PaAppOwnerSetCommand_initTelem
|
|
|
74
74
|
option: '--userName [userName]'
|
|
75
75
|
}, {
|
|
76
76
|
option: '--roleForOldAppOwner [roleForOldAppOwner]',
|
|
77
|
-
autocomplete:
|
|
77
|
+
autocomplete: _a.roleForOldAppOwner
|
|
78
78
|
});
|
|
79
79
|
}, _PaAppOwnerSetCommand_initValidators = function _PaAppOwnerSetCommand_initValidators() {
|
|
80
80
|
this.validators.push(async (args) => {
|
|
@@ -87,8 +87,8 @@ _PaAppOwnerSetCommand_instances = new WeakSet(), _PaAppOwnerSetCommand_initTelem
|
|
|
87
87
|
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
88
88
|
return `${args.options.userName} is not a valid UPN for userName`;
|
|
89
89
|
}
|
|
90
|
-
if (args.options.roleForOldAppOwner &&
|
|
91
|
-
return `${args.options.roleForOldAppOwner} is not a valid roleForOldAppOwner. Allowed values are: ${
|
|
90
|
+
if (args.options.roleForOldAppOwner && _a.roleForOldAppOwner.indexOf(args.options.roleForOldAppOwner) < 0) {
|
|
91
|
+
return `${args.options.roleForOldAppOwner} is not a valid roleForOldAppOwner. Allowed values are: ${_a.roleForOldAppOwner.join(', ')}`;
|
|
92
92
|
}
|
|
93
93
|
return true;
|
|
94
94
|
});
|
|
@@ -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 _PaAppPermissionEnsureCommand_instances, _PaAppPermissionEnsureCommand_initTelemetry, _PaAppPermissionEnsureCommand_initOptions, _PaAppPermissionEnsureCommand_initValidators, _PaAppPermissionEnsureCommand_initOptionSets, _PaAppPermissionEnsureCommand_initTypes;
|
|
6
|
+
var _PaAppPermissionEnsureCommand_instances, _a, _PaAppPermissionEnsureCommand_initTelemetry, _PaAppPermissionEnsureCommand_initOptions, _PaAppPermissionEnsureCommand_initValidators, _PaAppPermissionEnsureCommand_initOptionSets, _PaAppPermissionEnsureCommand_initTypes;
|
|
7
7
|
import Auth from '../../../../Auth.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
9
|
import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
@@ -88,7 +88,7 @@ class PaAppPermissionEnsureCommand extends PowerAppsCommand {
|
|
|
88
88
|
return accessToken.getTenantIdFromAccessToken(Auth.service.accessTokens[Auth.defaultResource].accessToken);
|
|
89
89
|
}
|
|
90
90
|
}
|
|
91
|
-
_PaAppPermissionEnsureCommand_instances = new WeakSet(), _PaAppPermissionEnsureCommand_initTelemetry = function _PaAppPermissionEnsureCommand_initTelemetry() {
|
|
91
|
+
_a = PaAppPermissionEnsureCommand, _PaAppPermissionEnsureCommand_instances = new WeakSet(), _PaAppPermissionEnsureCommand_initTelemetry = function _PaAppPermissionEnsureCommand_initTelemetry() {
|
|
92
92
|
this.telemetry.push((args) => {
|
|
93
93
|
Object.assign(this.telemetryProperties, {
|
|
94
94
|
userId: typeof args.options.userId !== 'undefined',
|
|
@@ -106,7 +106,7 @@ _PaAppPermissionEnsureCommand_instances = new WeakSet(), _PaAppPermissionEnsureC
|
|
|
106
106
|
option: '--appName <appName>'
|
|
107
107
|
}, {
|
|
108
108
|
option: '--roleName <roleName>',
|
|
109
|
-
autocomplete:
|
|
109
|
+
autocomplete: _a.roleNames
|
|
110
110
|
}, {
|
|
111
111
|
option: '--userId [userId]'
|
|
112
112
|
}, {
|
|
@@ -138,8 +138,8 @@ _PaAppPermissionEnsureCommand_instances = new WeakSet(), _PaAppPermissionEnsureC
|
|
|
138
138
|
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
139
139
|
return `${args.options.userName} is not a valid user principal name (UPN) for userName.`;
|
|
140
140
|
}
|
|
141
|
-
if (
|
|
142
|
-
return `${args.options.roleName} is not a valid roleName. Allowed values are: ${
|
|
141
|
+
if (_a.roleNames.indexOf(args.options.roleName) < 0) {
|
|
142
|
+
return `${args.options.roleName} is not a valid roleName. Allowed values are: ${_a.roleNames.join(', ')}.`;
|
|
143
143
|
}
|
|
144
144
|
if (args.options.environmentName && !args.options.asAdmin) {
|
|
145
145
|
return 'Specifying environmentName is only allowed when using asAdmin.';
|
|
@@ -10,6 +10,8 @@ import { planner } from '../../../../utils/planner.js';
|
|
|
10
10
|
import { validation } from '../../../../utils/validation.js';
|
|
11
11
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
14
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
13
15
|
class PlannerBucketGetCommand extends GraphCommand {
|
|
14
16
|
get name() {
|
|
15
17
|
return commands.BUCKET_GET;
|
|
@@ -54,7 +56,9 @@ class PlannerBucketGetCommand extends GraphCommand {
|
|
|
54
56
|
throw `The specified bucket ${name} does not exist`;
|
|
55
57
|
}
|
|
56
58
|
if (filteredBuckets.length > 1) {
|
|
57
|
-
|
|
59
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', filteredBuckets);
|
|
60
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple buckets with name '${name}' found.`, resultAsKeyValuePair);
|
|
61
|
+
return result.id.toString();
|
|
58
62
|
}
|
|
59
63
|
return filteredBuckets[0].id.toString();
|
|
60
64
|
}
|
|
@@ -11,6 +11,7 @@ import { planner } from '../../../../utils/planner.js';
|
|
|
11
11
|
import { validation } from '../../../../utils/validation.js';
|
|
12
12
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
13
13
|
import commands from '../../commands.js';
|
|
14
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
14
15
|
class PlannerBucketRemoveCommand extends GraphCommand {
|
|
15
16
|
get name() {
|
|
16
17
|
return commands.BUCKET_REMOVE;
|
|
@@ -84,7 +85,8 @@ class PlannerBucketRemoveCommand extends GraphCommand {
|
|
|
84
85
|
throw `The specified bucket ${args.options.name} does not exist`;
|
|
85
86
|
}
|
|
86
87
|
if (filteredBuckets.length > 1) {
|
|
87
|
-
|
|
88
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', filteredBuckets);
|
|
89
|
+
return await Cli.handleMultipleResultsFound(`Multiple buckets with name '${args.options.name}' found.`, resultAsKeyValuePair);
|
|
88
90
|
}
|
|
89
91
|
return filteredBuckets[0];
|
|
90
92
|
}
|
|
@@ -10,6 +10,8 @@ import { planner } from '../../../../utils/planner.js';
|
|
|
10
10
|
import { validation } from '../../../../utils/validation.js';
|
|
11
11
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
14
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
13
15
|
class PlannerBucketSetCommand extends GraphCommand {
|
|
14
16
|
get name() {
|
|
15
17
|
return commands.BUCKET_SET;
|
|
@@ -75,7 +77,8 @@ class PlannerBucketSetCommand extends GraphCommand {
|
|
|
75
77
|
throw `The specified bucket ${args.options.name} does not exist`;
|
|
76
78
|
}
|
|
77
79
|
if (filteredBuckets.length > 1) {
|
|
78
|
-
|
|
80
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', filteredBuckets);
|
|
81
|
+
return await Cli.handleMultipleResultsFound(`Multiple buckets with name '${args.options.name}' found.`, resultAsKeyValuePair);
|
|
79
82
|
}
|
|
80
83
|
return filteredBuckets[0];
|
|
81
84
|
}
|
|
@@ -141,9 +141,15 @@ class PlannerTaskAddCommand extends GraphCommand {
|
|
|
141
141
|
if (args.options.planId) {
|
|
142
142
|
return args.options.planId;
|
|
143
143
|
}
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
144
|
+
if (args.options.rosterId) {
|
|
145
|
+
const plan = await planner.getPlanByRosterId(args.options.rosterId);
|
|
146
|
+
return plan.id;
|
|
147
|
+
}
|
|
148
|
+
else {
|
|
149
|
+
const groupId = await this.getGroupId(args);
|
|
150
|
+
const plan = await planner.getPlanByTitle(args.options.planTitle, groupId);
|
|
151
|
+
return plan.id;
|
|
152
|
+
}
|
|
147
153
|
}
|
|
148
154
|
async getGroupId(args) {
|
|
149
155
|
if (args.options.ownerGroupId) {
|
|
@@ -187,6 +193,7 @@ _PlannerTaskAddCommand_instances = new WeakSet(), _PlannerTaskAddCommand_initTel
|
|
|
187
193
|
Object.assign(this.telemetryProperties, {
|
|
188
194
|
planId: typeof args.options.planId !== 'undefined',
|
|
189
195
|
planTitle: typeof args.options.planTitle !== 'undefined',
|
|
196
|
+
rosterId: typeof args.options.rosterId !== 'undefined',
|
|
190
197
|
ownerGroupId: typeof args.options.ownerGroupId !== 'undefined',
|
|
191
198
|
ownerGroupName: typeof args.options.ownerGroupName !== 'undefined',
|
|
192
199
|
bucketId: typeof args.options.bucketId !== 'undefined',
|
|
@@ -205,7 +212,7 @@ _PlannerTaskAddCommand_instances = new WeakSet(), _PlannerTaskAddCommand_initTel
|
|
|
205
212
|
});
|
|
206
213
|
});
|
|
207
214
|
}, _PlannerTaskAddCommand_initOptions = function _PlannerTaskAddCommand_initOptions() {
|
|
208
|
-
this.options.unshift({ option: '-t, --title <title>' }, { option: '--planId [planId]' }, { option: '--planTitle [planTitle]' }, { option: '--ownerGroupId [ownerGroupId]' }, { option: '--ownerGroupName [ownerGroupName]' }, { option: '--bucketId [bucketId]' }, { option: '--bucketName [bucketName]' }, { option: '--startDateTime [startDateTime]' }, { option: '--dueDateTime [dueDateTime]' }, { option: '--percentComplete [percentComplete]' }, { option: '--assignedToUserIds [assignedToUserIds]' }, { option: '--assignedToUserNames [assignedToUserNames]' }, { option: '--assigneePriority [assigneePriority]' }, { option: '--description [description]' }, {
|
|
215
|
+
this.options.unshift({ option: '-t, --title <title>' }, { option: '--planId [planId]' }, { option: '--planTitle [planTitle]' }, { option: '--rosterId [rosterId]' }, { option: '--ownerGroupId [ownerGroupId]' }, { option: '--ownerGroupName [ownerGroupName]' }, { option: '--bucketId [bucketId]' }, { option: '--bucketName [bucketName]' }, { option: '--startDateTime [startDateTime]' }, { option: '--dueDateTime [dueDateTime]' }, { option: '--percentComplete [percentComplete]' }, { option: '--assignedToUserIds [assignedToUserIds]' }, { option: '--assignedToUserNames [assignedToUserNames]' }, { option: '--assigneePriority [assigneePriority]' }, { option: '--description [description]' }, {
|
|
209
216
|
option: '--appliedCategories [appliedCategories]',
|
|
210
217
|
autocomplete: this.allowedAppliedCategories
|
|
211
218
|
}, {
|
|
@@ -214,12 +221,6 @@ _PlannerTaskAddCommand_instances = new WeakSet(), _PlannerTaskAddCommand_initTel
|
|
|
214
221
|
}, { option: '--orderHint [orderHint]' }, { option: '--priority [priority]', autocomplete: taskPriority.priorityValues });
|
|
215
222
|
}, _PlannerTaskAddCommand_initValidators = function _PlannerTaskAddCommand_initValidators() {
|
|
216
223
|
this.validators.push(async (args) => {
|
|
217
|
-
if (args.options.planTitle && !args.options.ownerGroupId && !args.options.ownerGroupName) {
|
|
218
|
-
return 'Specify either ownerGroupId or ownerGroupName when using planTitle';
|
|
219
|
-
}
|
|
220
|
-
if (args.options.planTitle && args.options.ownerGroupId && args.options.ownerGroupName) {
|
|
221
|
-
return 'Specify either ownerGroupId or ownerGroupName when using planTitle but not both';
|
|
222
|
-
}
|
|
223
224
|
if (args.options.ownerGroupId && !validation.isValidGuid(args.options.ownerGroupId)) {
|
|
224
225
|
return `${args.options.ownerGroupId} is not a valid GUID`;
|
|
225
226
|
}
|
|
@@ -260,7 +261,12 @@ _PlannerTaskAddCommand_instances = new WeakSet(), _PlannerTaskAddCommand_initTel
|
|
|
260
261
|
return true;
|
|
261
262
|
});
|
|
262
263
|
}, _PlannerTaskAddCommand_initOptionSets = function _PlannerTaskAddCommand_initOptionSets() {
|
|
263
|
-
this.optionSets.push({ options: ['planId', 'planTitle'] }, { options: ['bucketId', 'bucketName'] }
|
|
264
|
+
this.optionSets.push({ options: ['planId', 'planTitle', 'rosterId'] }, { options: ['bucketId', 'bucketName'] }, {
|
|
265
|
+
options: ['ownerGroupId', 'ownerGroupName'],
|
|
266
|
+
runsWhen: (args) => {
|
|
267
|
+
return args.options.planTitle !== undefined;
|
|
268
|
+
}
|
|
269
|
+
});
|
|
264
270
|
};
|
|
265
271
|
export default new PlannerTaskAddCommand();
|
|
266
272
|
//# sourceMappingURL=task-add.js.map
|