@pnp/cli-microsoft365 7.0.0-beta.093ef31 → 7.0.0-beta.18ce559
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/Auth.js +10 -1
- package/dist/Command.js +2 -2
- package/dist/cli/Cli.js +4 -4
- 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 +4 -1
- 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 +8 -5
- package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +11 -6
- package/dist/m365/aad/commands/approleassignment/approleassignment-remove.js +4 -4
- 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/group/group-remove.js +98 -0
- package/dist/m365/aad/commands/m365group/m365group-add.js +21 -12
- package/dist/m365/aad/commands/m365group/m365group-conversation-list.js +5 -0
- package/dist/m365/aad/commands/m365group/m365group-conversation-post-list.js +4 -0
- package/dist/m365/aad/commands/m365group/m365group-get.js +4 -3
- 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-remove.js +5 -0
- package/dist/m365/aad/commands/m365group/m365group-renew.js +5 -0
- package/dist/m365/aad/commands/m365group/m365group-set.js +5 -0
- package/dist/m365/aad/commands/m365group/m365group-teamify.js +14 -6
- package/dist/m365/aad/commands/m365group/m365group-user-add.js +5 -0
- package/dist/m365/aad/commands/m365group/m365group-user-list.js +5 -0
- package/dist/m365/aad/commands/m365group/m365group-user-remove.js +5 -0
- package/dist/m365/aad/commands/m365group/m365group-user-set.js +5 -0
- 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/aad/commands.js +1 -0
- package/dist/m365/booking/commands/business/business-get.js +4 -1
- package/dist/m365/commands/login.js +2 -2
- package/dist/m365/flow/commands/flow-export.js +13 -13
- package/dist/m365/graph/commands/subscription/subscription-add.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/connector/connector-export.js +5 -5
- package/dist/m365/planner/commands/bucket/bucket-add.js +4 -1
- package/dist/m365/planner/commands/bucket/bucket-get.js +9 -2
- package/dist/m365/planner/commands/bucket/bucket-list.js +4 -1
- package/dist/m365/planner/commands/bucket/bucket-remove.js +7 -2
- package/dist/m365/planner/commands/bucket/bucket-set.js +8 -2
- package/dist/m365/planner/commands/plan/plan-add.js +4 -1
- package/dist/m365/planner/commands/plan/plan-get.js +4 -1
- package/dist/m365/planner/commands/plan/plan-list.js +4 -1
- package/dist/m365/planner/commands/plan/plan-remove.js +4 -1
- package/dist/m365/planner/commands/plan/plan-set.js +4 -1
- package/dist/m365/planner/commands/roster/roster-get.js +4 -1
- package/dist/m365/planner/commands/roster/roster-member-add.js +4 -1
- package/dist/m365/planner/commands/roster/roster-member-get.js +4 -1
- package/dist/m365/planner/commands/roster/roster-member-list.js +4 -1
- package/dist/m365/planner/commands/roster/roster-member-remove.js +4 -1
- package/dist/m365/planner/commands/roster/roster-plan-list.js +4 -1
- package/dist/m365/planner/commands/roster/roster-remove.js +4 -1
- package/dist/m365/planner/commands/task/task-add.js +4 -1
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +4 -1
- package/dist/m365/planner/commands/task/task-checklistitem-list.js +4 -1
- package/dist/m365/planner/commands/task/task-checklistitem-remove.js +4 -1
- package/dist/m365/planner/commands/task/task-get.js +11 -3
- package/dist/m365/planner/commands/task/task-list.js +10 -2
- package/dist/m365/planner/commands/task/task-reference-add.js +4 -1
- package/dist/m365/planner/commands/task/task-reference-list.js +4 -1
- package/dist/m365/planner/commands/task/task-reference-remove.js +4 -1
- package/dist/m365/planner/commands/task/task-remove.js +10 -4
- package/dist/m365/planner/commands/task/task-set.js +4 -1
- 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/chatbot/chatbot-list.js +2 -2
- package/dist/m365/pp/commands/managementapp/managementapp-add.js +4 -1
- package/dist/m365/search/commands/externalconnection/externalconnection-remove.js +3 -1
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.18.0-beta.5.js → doctor-1.18.0.js} +2 -2
- package/dist/m365/spfx/commands/project/project-doctor.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001022_DEP_office_ui_fabric_react.js +1 -1
- 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.js} +35 -27
- package/dist/m365/spfx/commands/project/project-upgrade.js +13 -15
- package/dist/m365/spfx/commands/spfx-doctor.js +3 -3
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +5 -3
- 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-get.js +4 -2
- package/dist/m365/spo/commands/commandset/commandset-remove.js +2 -1
- package/dist/m365/spo/commands/commandset/commandset-set.js +3 -1
- 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 +11 -8
- package/dist/m365/spo/commands/file/file-remove.js +2 -2
- package/dist/m365/spo/commands/file/file-version-clear.js +2 -2
- package/dist/m365/spo/commands/file/file-version-get.js +2 -2
- package/dist/m365/spo/commands/file/file-version-list.js +2 -2
- package/dist/m365/spo/commands/file/file-version-remove.js +2 -2
- package/dist/m365/spo/commands/file/file-version-restore.js +2 -2
- package/dist/m365/spo/commands/group/group-member-add.js +24 -24
- 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/listitem/listitem-add.js +1 -0
- package/dist/m365/spo/commands/listitem/listitem-attachment-add.js +127 -0
- package/dist/m365/spo/commands/listitem/listitem-attachment-get.js +97 -0
- package/dist/m365/spo/commands/listitem/listitem-attachment-remove.js +121 -0
- package/dist/m365/spo/commands/listitem/listitem-attachment-set.js +115 -0
- package/dist/m365/spo/commands/listitem/listitem-set.js +3 -2
- 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/page/page-set.js +13 -2
- package/dist/m365/spo/commands/site/site-commsite-enable.js +34 -5
- package/dist/m365/spo/commands/site/site-list.js +5 -7
- 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-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/term/term-get.js +6 -6
- package/dist/m365/spo/commands/user/user-get.js +10 -10
- package/dist/m365/spo/commands.js +4 -0
- package/dist/m365/teams/commands/app/app-remove.js +49 -15
- package/dist/m365/teams/commands/channel/channel-add.js +5 -1
- package/dist/m365/teams/commands/channel/channel-member-add.js +12 -10
- 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-message-send.js +8 -10
- 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/tenant/commands/info/info-get.js +83 -0
- package/dist/m365/tenant/commands.js +1 -0
- package/dist/utils/aadGroup.js +21 -3
- package/dist/utils/formatting.js +7 -0
- package/dist/utils/powerPlatform.js +1 -1
- package/docs/docs/_clisettings.mdx +1 -1
- package/docs/docs/cmd/aad/app/app-set.mdx +15 -15
- package/docs/docs/cmd/aad/approleassignment/approleassignment-add.mdx +9 -9
- package/docs/docs/cmd/aad/approleassignment/approleassignment-remove.mdx +10 -10
- 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/group/group-remove.mdx +44 -0
- package/docs/docs/cmd/aad/m365group/m365group-add.mdx +13 -3
- 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/flow/flow-export.mdx +11 -11
- package/docs/docs/cmd/graph/subscription/subscription-add.mdx +10 -10
- package/docs/docs/cmd/pa/app/app-export.mdx +5 -5
- package/docs/docs/cmd/pa/connector/connector-export.mdx +3 -3
- package/docs/docs/cmd/pp/chatbot/chatbot-list.mdx +4 -4
- package/docs/docs/cmd/pp/solution/solution-publisher-get.mdx +2 -2
- package/docs/docs/cmd/pp/solution/solution-publisher-remove.mdx +2 -2
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-get.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-remove.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-version-clear.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-version-get.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-version-list.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-version-remove.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-version-restore.mdx +2 -2
- package/docs/docs/cmd/spo/group/group-member-add.mdx +27 -27
- package/docs/docs/cmd/spo/list/list-contenttype-remove.mdx +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-add.mdx +2 -5
- package/docs/docs/cmd/spo/listitem/listitem-attachment-add.mdx +110 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-get.mdx +104 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-remove.mdx +58 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-set.mdx +58 -0
- 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/page/page-set.mdx +23 -0
- package/docs/docs/cmd/spo/site/site-commsite-enable.mdx +11 -2
- 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/spo/user/user-get.mdx +8 -8
- package/docs/docs/cmd/teams/app/app-remove.mdx +9 -6
- package/docs/docs/cmd/teams/channel/channel-member-add.mdx +4 -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 +24 -24
- package/package.json +8 -12
|
@@ -9,6 +9,7 @@ import { formatting } from '../../../../utils/formatting.js';
|
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
10
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
12
13
|
class AadM365GroupRecycleBinItemRestoreCommand extends GraphCommand {
|
|
13
14
|
get name() {
|
|
14
15
|
return commands.M365GROUP_RECYCLEBINITEM_RESTORE;
|
|
@@ -69,7 +70,9 @@ class AadM365GroupRecycleBinItemRestoreCommand extends GraphCommand {
|
|
|
69
70
|
throw `The specified group '${displayName || mailNickname}' does not exist.`;
|
|
70
71
|
}
|
|
71
72
|
if (groups.length > 1) {
|
|
72
|
-
|
|
73
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', groups);
|
|
74
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple groups with name '${displayName || mailNickname}' found.`, resultAsKeyValuePair);
|
|
75
|
+
return result.id;
|
|
73
76
|
}
|
|
74
77
|
return groups[0].id;
|
|
75
78
|
}
|
|
@@ -6,6 +6,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
6
6
|
var _AadM365GroupRemoveCommand_instances, _AadM365GroupRemoveCommand_initTelemetry, _AadM365GroupRemoveCommand_initOptions, _AadM365GroupRemoveCommand_initValidators;
|
|
7
7
|
import { Cli } from '../../../../cli/Cli.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
|
+
import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
9
10
|
import { validation } from '../../../../utils/validation.js';
|
|
10
11
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
12
|
import commands from '../../commands.js';
|
|
@@ -29,6 +30,10 @@ class AadM365GroupRemoveCommand extends GraphCommand {
|
|
|
29
30
|
await logger.logToStderr(`Removing Microsoft 365 Group: ${args.options.id}...`);
|
|
30
31
|
}
|
|
31
32
|
try {
|
|
33
|
+
const isUnifiedGroup = await aadGroup.isUnifiedGroup(args.options.id);
|
|
34
|
+
if (!isUnifiedGroup) {
|
|
35
|
+
throw Error(`Specified group with id '${args.options.id}' is not a Microsoft 365 group.`);
|
|
36
|
+
}
|
|
32
37
|
const requestOptions = {
|
|
33
38
|
url: `${this.resource}/v1.0/groups/${args.options.id}`,
|
|
34
39
|
headers: {
|
|
@@ -5,6 +5,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
};
|
|
6
6
|
var _AadM365GroupRenewCommand_instances, _AadM365GroupRenewCommand_initOptions, _AadM365GroupRenewCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
|
+
import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
8
9
|
import { validation } from '../../../../utils/validation.js';
|
|
9
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
10
11
|
import commands from '../../commands.js';
|
|
@@ -26,6 +27,10 @@ class AadM365GroupRenewCommand extends GraphCommand {
|
|
|
26
27
|
await logger.logToStderr(`Renewing Microsoft 365 group's expiration: ${args.options.id}...`);
|
|
27
28
|
}
|
|
28
29
|
try {
|
|
30
|
+
const isUnifiedGroup = await aadGroup.isUnifiedGroup(args.options.id);
|
|
31
|
+
if (!isUnifiedGroup) {
|
|
32
|
+
throw Error(`Specified group with id '${args.options.id}' is not a Microsoft 365 group.`);
|
|
33
|
+
}
|
|
29
34
|
const requestOptions = {
|
|
30
35
|
url: `${this.resource}/v1.0/groups/${args.options.id}/renew/`,
|
|
31
36
|
headers: {
|
|
@@ -11,6 +11,7 @@ import request from '../../../../request.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 { aadGroup } from '../../../../utils/aadGroup.js';
|
|
14
15
|
class AadM365GroupSetCommand extends GraphCommand {
|
|
15
16
|
get name() {
|
|
16
17
|
return commands.M365GROUP_SET;
|
|
@@ -29,6 +30,10 @@ class AadM365GroupSetCommand extends GraphCommand {
|
|
|
29
30
|
}
|
|
30
31
|
async commandAction(logger, args) {
|
|
31
32
|
try {
|
|
33
|
+
const isUnifiedGroup = await aadGroup.isUnifiedGroup(args.options.id);
|
|
34
|
+
if (!isUnifiedGroup) {
|
|
35
|
+
throw Error(`Specified group with id '${args.options.id}' is not a Microsoft 365 group.`);
|
|
36
|
+
}
|
|
32
37
|
if (args.options.displayName || args.options.description || typeof args.options.isPrivate !== 'undefined') {
|
|
33
38
|
if (this.verbose) {
|
|
34
39
|
await logger.logToStderr(`Updating Microsoft 365 Group ${args.options.id}...`);
|
|
@@ -4,7 +4,9 @@ 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 _AadM365GroupTeamifyCommand_instances, _AadM365GroupTeamifyCommand_initTelemetry, _AadM365GroupTeamifyCommand_initOptions, _AadM365GroupTeamifyCommand_initValidators, _AadM365GroupTeamifyCommand_initOptionSets;
|
|
7
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
7
8
|
import request from '../../../../request.js';
|
|
9
|
+
import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
8
10
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
11
|
import { validation } from '../../../../utils/validation.js';
|
|
10
12
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
@@ -24,12 +26,12 @@ class AadM365GroupTeamifyCommand extends GraphCommand {
|
|
|
24
26
|
__classPrivateFieldGet(this, _AadM365GroupTeamifyCommand_instances, "m", _AadM365GroupTeamifyCommand_initValidators).call(this);
|
|
25
27
|
__classPrivateFieldGet(this, _AadM365GroupTeamifyCommand_instances, "m", _AadM365GroupTeamifyCommand_initOptionSets).call(this);
|
|
26
28
|
}
|
|
27
|
-
async getGroupId(
|
|
28
|
-
if (
|
|
29
|
-
return
|
|
29
|
+
async getGroupId(options) {
|
|
30
|
+
if (options.id) {
|
|
31
|
+
return options.id;
|
|
30
32
|
}
|
|
31
33
|
const requestOptions = {
|
|
32
|
-
url: `${this.resource}/v1.0/groups?$filter=mailNickname eq '${formatting.encodeQueryParameter(
|
|
34
|
+
url: `${this.resource}/v1.0/groups?$filter=mailNickname eq '${formatting.encodeQueryParameter(options.mailNickname)}'`,
|
|
33
35
|
headers: {
|
|
34
36
|
accept: 'application/json;odata.metadata=none'
|
|
35
37
|
},
|
|
@@ -41,12 +43,19 @@ class AadM365GroupTeamifyCommand extends GraphCommand {
|
|
|
41
43
|
throw `The specified Microsoft 365 Group does not exist`;
|
|
42
44
|
}
|
|
43
45
|
if (response.value.length > 1) {
|
|
44
|
-
|
|
46
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', response.value);
|
|
47
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple Microsoft 365 Groups with name '${options.mailNickname}' found.`, resultAsKeyValuePair);
|
|
48
|
+
return result.id;
|
|
45
49
|
}
|
|
46
50
|
return groupItem.id;
|
|
47
51
|
}
|
|
48
52
|
async commandAction(logger, args) {
|
|
49
53
|
try {
|
|
54
|
+
const groupId = await this.getGroupId(args.options);
|
|
55
|
+
const isUnifiedGroup = await aadGroup.isUnifiedGroup(groupId);
|
|
56
|
+
if (!isUnifiedGroup) {
|
|
57
|
+
throw Error(`Specified group with id '${groupId}' is not a Microsoft 365 group.`);
|
|
58
|
+
}
|
|
50
59
|
const data = {
|
|
51
60
|
"memberSettings": {
|
|
52
61
|
"allowCreatePrivateChannels": true,
|
|
@@ -61,7 +70,6 @@ class AadM365GroupTeamifyCommand extends GraphCommand {
|
|
|
61
70
|
"giphyContentRating": "strict"
|
|
62
71
|
}
|
|
63
72
|
};
|
|
64
|
-
const groupId = await this.getGroupId(args);
|
|
65
73
|
const requestOptions = {
|
|
66
74
|
url: `${this.resource}/v1.0/groups/${formatting.encodeQueryParameter(groupId)}/team`,
|
|
67
75
|
headers: {
|
|
@@ -5,6 +5,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
5
5
|
};
|
|
6
6
|
var _AadM365GroupUserAddCommand_instances, _AadM365GroupUserAddCommand_initTelemetry, _AadM365GroupUserAddCommand_initOptions, _AadM365GroupUserAddCommand_initValidators, _AadM365GroupUserAddCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
|
+
import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
8
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
10
|
import { validation } from '../../../../utils/validation.js';
|
|
10
11
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
@@ -31,6 +32,10 @@ class AadM365GroupUserAddCommand extends GraphCommand {
|
|
|
31
32
|
async commandAction(logger, args) {
|
|
32
33
|
try {
|
|
33
34
|
const providedGroupId = (typeof args.options.groupId !== 'undefined') ? args.options.groupId : args.options.teamId;
|
|
35
|
+
const isUnifiedGroup = await aadGroup.isUnifiedGroup(providedGroupId);
|
|
36
|
+
if (!isUnifiedGroup) {
|
|
37
|
+
throw Error(`Specified group with id '${providedGroupId}' is not a Microsoft 365 group.`);
|
|
38
|
+
}
|
|
34
39
|
let requestOptions = {
|
|
35
40
|
url: `${this.resource}/v1.0/users/${formatting.encodeQueryParameter(args.options.userName)}/id`,
|
|
36
41
|
headers: {
|
|
@@ -8,6 +8,7 @@ import { odata } from '../../../../utils/odata.js';
|
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
10
10
|
import commands from '../../commands.js';
|
|
11
|
+
import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
11
12
|
class AadM365GroupUserListCommand extends GraphCommand {
|
|
12
13
|
get name() {
|
|
13
14
|
return commands.M365GROUP_USER_LIST;
|
|
@@ -24,6 +25,10 @@ class AadM365GroupUserListCommand extends GraphCommand {
|
|
|
24
25
|
}
|
|
25
26
|
async commandAction(logger, args) {
|
|
26
27
|
try {
|
|
28
|
+
const isUnifiedGroup = await aadGroup.isUnifiedGroup(args.options.groupId);
|
|
29
|
+
if (!isUnifiedGroup) {
|
|
30
|
+
throw Error(`Specified group with id '${args.options.groupId}' is not a Microsoft 365 group.`);
|
|
31
|
+
}
|
|
27
32
|
let users = await this.getOwners(args.options.groupId, logger);
|
|
28
33
|
if (args.options.role !== 'Owner') {
|
|
29
34
|
const membersAndGuests = await this.getMembersAndGuests(args.options.groupId, logger);
|
|
@@ -6,6 +6,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
6
6
|
var _AadM365GroupUserRemoveCommand_instances, _AadM365GroupUserRemoveCommand_initTelemetry, _AadM365GroupUserRemoveCommand_initOptions, _AadM365GroupUserRemoveCommand_initValidators, _AadM365GroupUserRemoveCommand_initOptionSets;
|
|
7
7
|
import { Cli } from '../../../../cli/Cli.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
|
+
import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
9
10
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
11
|
import { validation } from '../../../../utils/validation.js';
|
|
11
12
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
@@ -33,6 +34,10 @@ class AadM365GroupUserRemoveCommand extends GraphCommand {
|
|
|
33
34
|
const groupId = (typeof args.options.groupId !== 'undefined') ? args.options.groupId : args.options.teamId;
|
|
34
35
|
const removeUser = async () => {
|
|
35
36
|
try {
|
|
37
|
+
const isUnifiedGroup = await aadGroup.isUnifiedGroup(groupId);
|
|
38
|
+
if (!isUnifiedGroup) {
|
|
39
|
+
throw Error(`Specified group with id '${groupId}' is not a Microsoft 365 group.`);
|
|
40
|
+
}
|
|
36
41
|
// retrieve user
|
|
37
42
|
const user = await request.get({
|
|
38
43
|
url: `${this.resource}/v1.0/users/${formatting.encodeQueryParameter(args.options.userName)}/id`,
|
|
@@ -10,6 +10,7 @@ import { validation } from '../../../../utils/validation.js';
|
|
|
10
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
11
|
import teamsCommands from '../../../teams/commands.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
|
+
import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
13
14
|
class AadM365GroupUserSetCommand extends GraphCommand {
|
|
14
15
|
get name() {
|
|
15
16
|
return commands.M365GROUP_USER_SET;
|
|
@@ -31,6 +32,10 @@ class AadM365GroupUserSetCommand extends GraphCommand {
|
|
|
31
32
|
async commandAction(logger, args) {
|
|
32
33
|
try {
|
|
33
34
|
const groupId = (typeof args.options.groupId !== 'undefined') ? args.options.groupId : args.options.teamId;
|
|
35
|
+
const isUnifiedGroup = await aadGroup.isUnifiedGroup(groupId);
|
|
36
|
+
if (!isUnifiedGroup) {
|
|
37
|
+
throw Error(`Specified group with id '${groupId}' is not a Microsoft 365 group.`);
|
|
38
|
+
}
|
|
34
39
|
let users = await this.getOwners(groupId, logger);
|
|
35
40
|
const membersAndGuests = await this.getMembersAndGuests(groupId, logger);
|
|
36
41
|
users = users.concat(membersAndGuests);
|
|
@@ -9,6 +9,7 @@ import { formatting } from '../../../../utils/formatting.js';
|
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
10
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
12
13
|
class AadSpAddCommand extends GraphCommand {
|
|
13
14
|
get name() {
|
|
14
15
|
return commands.SP_ADD;
|
|
@@ -48,7 +49,9 @@ class AadSpAddCommand extends GraphCommand {
|
|
|
48
49
|
throw `The specified Azure AD app doesn't exist`;
|
|
49
50
|
}
|
|
50
51
|
if (response.value.length > 1) {
|
|
51
|
-
|
|
52
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('appId', response.value);
|
|
53
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple Azure AD apps with name '${args.options.appName}' found.`, resultAsKeyValuePair);
|
|
54
|
+
return result.appId;
|
|
52
55
|
}
|
|
53
56
|
return spItem.appId;
|
|
54
57
|
}
|
|
@@ -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 _AadSpGetCommand_instances, _AadSpGetCommand_initTelemetry, _AadSpGetCommand_initOptions, _AadSpGetCommand_initValidators, _AadSpGetCommand_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 { validation } from '../../../../utils/validation.js';
|
|
@@ -48,7 +49,9 @@ class AadSpGetCommand extends GraphCommand {
|
|
|
48
49
|
throw `The specified Azure AD app does not exist`;
|
|
49
50
|
}
|
|
50
51
|
if (response.value.length > 1) {
|
|
51
|
-
|
|
52
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', response.value);
|
|
53
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple Azure AD apps with name '${args.options.appDisplayName}' found.`, resultAsKeyValuePair);
|
|
54
|
+
return result.id;
|
|
52
55
|
}
|
|
53
56
|
return spItem.id;
|
|
54
57
|
}
|
|
@@ -9,6 +9,7 @@ import { formatting } from '../../../../utils/formatting.js';
|
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
10
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
12
13
|
class AadUserGetCommand extends GraphCommand {
|
|
13
14
|
get name() {
|
|
14
15
|
return commands.USER_GET;
|
|
@@ -57,9 +58,13 @@ class AadUserGetCommand extends GraphCommand {
|
|
|
57
58
|
throw `The specified user with ${identifier} does not exist`;
|
|
58
59
|
}
|
|
59
60
|
if (res.value.length > 1) {
|
|
60
|
-
|
|
61
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', res.value);
|
|
62
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple users with ${identifier} found.`, resultAsKeyValuePair);
|
|
63
|
+
await logger.log(result);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
await logger.log(res.value[0]);
|
|
61
67
|
}
|
|
62
|
-
await logger.log(res.value[0]);
|
|
63
68
|
}
|
|
64
69
|
catch (err) {
|
|
65
70
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -13,6 +13,7 @@ export default {
|
|
|
13
13
|
APPROLEASSIGNMENT_REMOVE: `${prefix} approleassignment remove`,
|
|
14
14
|
GROUP_GET: `${prefix} group get`,
|
|
15
15
|
GROUP_LIST: `${prefix} group list`,
|
|
16
|
+
GROUP_REMOVE: `${prefix} group remove`,
|
|
16
17
|
GROUPSETTING_ADD: `${prefix} groupsetting add`,
|
|
17
18
|
GROUPSETTING_GET: `${prefix} groupsetting get`,
|
|
18
19
|
GROUPSETTING_LIST: `${prefix} groupsetting list`,
|
|
@@ -8,6 +8,7 @@ import request from '../../../../request.js';
|
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
10
10
|
import commands from '../../commands.js';
|
|
11
|
+
import { Cli } from '../../../../cli/Cli.js';
|
|
11
12
|
class BookingBusinessGetCommand extends GraphCommand {
|
|
12
13
|
get name() {
|
|
13
14
|
return commands.BUSINESS_GET;
|
|
@@ -60,7 +61,9 @@ class BookingBusinessGetCommand extends GraphCommand {
|
|
|
60
61
|
throw `The specified business with name ${options.name} does not exist.`;
|
|
61
62
|
}
|
|
62
63
|
if (bookingBusinesses.length > 1) {
|
|
63
|
-
|
|
64
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', bookingBusinesses);
|
|
65
|
+
const result = await Cli.handleMultipleResultsFound(`Multiple businesses with name '${options.name}' found.`, resultAsKeyValuePair);
|
|
66
|
+
return result.id;
|
|
64
67
|
}
|
|
65
68
|
return bookingBusinesses[0].id;
|
|
66
69
|
}
|
|
@@ -80,7 +80,7 @@ class LoginCommand extends Command {
|
|
|
80
80
|
throw new CommandError(error.message);
|
|
81
81
|
}
|
|
82
82
|
if (this.debug) {
|
|
83
|
-
await logger.
|
|
83
|
+
await logger.log({
|
|
84
84
|
connectedAs: accessToken.getUserNameFromAccessToken(auth.service.accessTokens[auth.defaultResource].accessToken),
|
|
85
85
|
authType: AuthType[auth.service.authType],
|
|
86
86
|
appId: auth.service.appId,
|
|
@@ -90,7 +90,7 @@ class LoginCommand extends Command {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
else {
|
|
93
|
-
await logger.
|
|
93
|
+
await logger.log({
|
|
94
94
|
connectedAs: accessToken.getUserNameFromAccessToken(auth.service.accessTokens[auth.defaultResource].accessToken),
|
|
95
95
|
authType: AuthType[auth.service.authType],
|
|
96
96
|
appId: auth.service.appId,
|
|
@@ -29,7 +29,7 @@ class FlowExportCommand extends PowerPlatformCommand {
|
|
|
29
29
|
let filenameFromApi = '';
|
|
30
30
|
const formatArgument = args.options.format ? args.options.format.toLowerCase() : '';
|
|
31
31
|
if (this.verbose) {
|
|
32
|
-
await logger.logToStderr(`Retrieving package resources for Microsoft Flow ${args.options.
|
|
32
|
+
await logger.logToStderr(`Retrieving package resources for Microsoft Flow ${args.options.name}...`);
|
|
33
33
|
}
|
|
34
34
|
try {
|
|
35
35
|
let res;
|
|
@@ -46,7 +46,7 @@ class FlowExportCommand extends PowerPlatformCommand {
|
|
|
46
46
|
},
|
|
47
47
|
data: {
|
|
48
48
|
"baseResourceIds": [
|
|
49
|
-
`/providers/Microsoft.Flow/flows/${args.options.
|
|
49
|
+
`/providers/Microsoft.Flow/flows/${args.options.name}`
|
|
50
50
|
]
|
|
51
51
|
},
|
|
52
52
|
responseType: 'json'
|
|
@@ -57,11 +57,11 @@ class FlowExportCommand extends PowerPlatformCommand {
|
|
|
57
57
|
throw res.errors[0].message;
|
|
58
58
|
}
|
|
59
59
|
if (this.verbose) {
|
|
60
|
-
await logger.logToStderr(`Initiating package export for Microsoft Flow ${args.options.
|
|
60
|
+
await logger.logToStderr(`Initiating package export for Microsoft Flow ${args.options.name}...`);
|
|
61
61
|
}
|
|
62
62
|
let requestOptions = {
|
|
63
63
|
url: formatArgument === 'json' ?
|
|
64
|
-
`https://management.azure.com/providers/Microsoft.ProcessSimple/environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.
|
|
64
|
+
`https://management.azure.com/providers/Microsoft.ProcessSimple/environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01`
|
|
65
65
|
: `${this.resource}/providers/Microsoft.BusinessAppPlatform/environments/${formatting.encodeQueryParameter(args.options.environmentName)}/exportPackage?api-version=2016-11-01`,
|
|
66
66
|
headers: {
|
|
67
67
|
accept: 'application/json'
|
|
@@ -78,7 +78,7 @@ class FlowExportCommand extends PowerPlatformCommand {
|
|
|
78
78
|
});
|
|
79
79
|
requestOptions['data'] = {
|
|
80
80
|
"includedResourceIds": [
|
|
81
|
-
`/providers/Microsoft.Flow/flows/${args.options.
|
|
81
|
+
`/providers/Microsoft.Flow/flows/${args.options.name}`
|
|
82
82
|
],
|
|
83
83
|
"details": {
|
|
84
84
|
"displayName": args.options.packageDisplayName,
|
|
@@ -91,7 +91,7 @@ class FlowExportCommand extends PowerPlatformCommand {
|
|
|
91
91
|
}
|
|
92
92
|
res = formatArgument === 'json' ? await request.get(requestOptions) : await request.post(requestOptions);
|
|
93
93
|
if (this.verbose) {
|
|
94
|
-
await logger.logToStderr(`Getting file for Microsoft Flow ${args.options.
|
|
94
|
+
await logger.logToStderr(`Getting file for Microsoft Flow ${args.options.name}...`);
|
|
95
95
|
}
|
|
96
96
|
const downloadFileUrl = formatArgument === 'json' ? '' : res.packageLink.value;
|
|
97
97
|
const filenameRegEx = /([^\/]+\.zip)/i;
|
|
@@ -105,7 +105,7 @@ class FlowExportCommand extends PowerPlatformCommand {
|
|
|
105
105
|
}
|
|
106
106
|
requestOptions = {
|
|
107
107
|
url: formatArgument === 'json' ?
|
|
108
|
-
`https://management.azure.com/providers/Microsoft.ProcessSimple/environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.
|
|
108
|
+
`https://management.azure.com/providers/Microsoft.ProcessSimple/environments/${formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting.encodeQueryParameter(args.options.name)}/exportToARMTemplate?api-version=2016-11-01`
|
|
109
109
|
: downloadFileUrl,
|
|
110
110
|
// Set responseType to arraybuffer, otherwise binary data will be encoded
|
|
111
111
|
// to utf8 and binary data is corrupt
|
|
@@ -149,27 +149,27 @@ _FlowExportCommand_instances = new WeakSet(), _FlowExportCommand_initTelemetry =
|
|
|
149
149
|
});
|
|
150
150
|
}, _FlowExportCommand_initOptions = function _FlowExportCommand_initOptions() {
|
|
151
151
|
this.options.unshift({
|
|
152
|
-
option: '-
|
|
152
|
+
option: '-n, --name <name>'
|
|
153
153
|
}, {
|
|
154
154
|
option: '-e, --environmentName <environmentName>'
|
|
155
155
|
}, {
|
|
156
|
-
option: '-
|
|
156
|
+
option: '-d, --packageDisplayName [packageDisplayName]'
|
|
157
157
|
}, {
|
|
158
|
-
option: '
|
|
158
|
+
option: '--packageDescription [packageDescription]'
|
|
159
159
|
}, {
|
|
160
160
|
option: '-c, --packageCreatedBy [packageCreatedBy]'
|
|
161
161
|
}, {
|
|
162
162
|
option: '-s, --packageSourceEnvironment [packageSourceEnvironment]'
|
|
163
163
|
}, {
|
|
164
|
-
option: '--format [format]'
|
|
164
|
+
option: '-f, --format [format]'
|
|
165
165
|
}, {
|
|
166
166
|
option: '-p, --path [path]'
|
|
167
167
|
});
|
|
168
168
|
}, _FlowExportCommand_initValidators = function _FlowExportCommand_initValidators() {
|
|
169
169
|
this.validators.push(async (args) => {
|
|
170
170
|
const lowerCaseFormat = args.options.format ? args.options.format.toLowerCase() : '';
|
|
171
|
-
if (!validation.isValidGuid(args.options.
|
|
172
|
-
return `${args.options.
|
|
171
|
+
if (!validation.isValidGuid(args.options.name)) {
|
|
172
|
+
return `${args.options.name} is not a valid GUID`;
|
|
173
173
|
}
|
|
174
174
|
if (args.options.format && (lowerCaseFormat !== 'json' && lowerCaseFormat !== 'zip')) {
|
|
175
175
|
return 'Option format must be json or zip. Default is zip';
|
|
@@ -43,7 +43,7 @@ class GraphSubscriptionAddCommand extends GraphCommand {
|
|
|
43
43
|
}
|
|
44
44
|
async commandAction(logger, args) {
|
|
45
45
|
const data = {
|
|
46
|
-
changeType: args.options.
|
|
46
|
+
changeType: args.options.changeTypes,
|
|
47
47
|
resource: args.options.resource,
|
|
48
48
|
notificationUrl: args.options.notificationUrl,
|
|
49
49
|
expirationDateTime: await this.getExpirationDateTimeOrDefault(logger, args)
|
|
@@ -121,7 +121,7 @@ class GraphSubscriptionAddCommand extends GraphCommand {
|
|
|
121
121
|
_GraphSubscriptionAddCommand_instances = new WeakSet(), _GraphSubscriptionAddCommand_initTelemetry = function _GraphSubscriptionAddCommand_initTelemetry() {
|
|
122
122
|
this.telemetry.push((args) => {
|
|
123
123
|
Object.assign(this.telemetryProperties, {
|
|
124
|
-
|
|
124
|
+
changeTypes: args.options.changeTypes,
|
|
125
125
|
expirationDateTime: typeof args.options.expirationDateTime !== 'undefined',
|
|
126
126
|
clientState: typeof args.options.clientState !== 'undefined'
|
|
127
127
|
});
|
|
@@ -132,7 +132,7 @@ _GraphSubscriptionAddCommand_instances = new WeakSet(), _GraphSubscriptionAddCom
|
|
|
132
132
|
}, {
|
|
133
133
|
option: '-u, --notificationUrl <notificationUrl>'
|
|
134
134
|
}, {
|
|
135
|
-
option: '-c, --
|
|
135
|
+
option: '-c, --changeTypes <changeTypes>',
|
|
136
136
|
autocomplete: ['created', 'updated', 'deleted']
|
|
137
137
|
}, {
|
|
138
138
|
option: '-e, --expirationDateTime [expirationDateTime]'
|
|
@@ -144,8 +144,8 @@ _GraphSubscriptionAddCommand_instances = new WeakSet(), _GraphSubscriptionAddCom
|
|
|
144
144
|
if (args.options.notificationUrl.indexOf('https://') !== 0) {
|
|
145
145
|
return `The specified notification URL '${args.options.notificationUrl}' does not start with 'https://'`;
|
|
146
146
|
}
|
|
147
|
-
if (!this.isValidChangeTypes(args.options.
|
|
148
|
-
return `The specified
|
|
147
|
+
if (!this.isValidChangeTypes(args.options.changeTypes)) {
|
|
148
|
+
return `The specified changeTypes are invalid. Valid options are 'created', 'updated' and 'deleted'`;
|
|
149
149
|
}
|
|
150
150
|
if (args.options.expirationDateTime && !validation.isValidISODateTime(args.options.expirationDateTime)) {
|
|
151
151
|
return 'The expirationDateTime is not a valid ISO date string';
|
|
@@ -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';
|
|
@@ -29,9 +29,9 @@ class PaConnectorExportCommand extends PowerAppsCommand {
|
|
|
29
29
|
__classPrivateFieldGet(this, _PaConnectorExportCommand_instances, "m", _PaConnectorExportCommand_initValidators).call(this);
|
|
30
30
|
}
|
|
31
31
|
async commandAction(logger, args) {
|
|
32
|
-
const outputFolder = path.resolve(args.options.outputFolder || '.', args.options.
|
|
32
|
+
const outputFolder = path.resolve(args.options.outputFolder || '.', args.options.name);
|
|
33
33
|
const requestOptions = {
|
|
34
|
-
url: `${this.resource}/providers/Microsoft.PowerApps/apis/${formatting.encodeQueryParameter(args.options.
|
|
34
|
+
url: `${this.resource}/providers/Microsoft.PowerApps/apis/${formatting.encodeQueryParameter(args.options.name)}?api-version=2016-11-01&$filter=environment%20eq%20%27${formatting.encodeQueryParameter(args.options.environmentName)}%27%20and%20IsCustomApi%20eq%20%27True%27`,
|
|
35
35
|
headers: {
|
|
36
36
|
accept: 'application/json'
|
|
37
37
|
},
|
|
@@ -53,7 +53,7 @@ class PaConnectorExportCommand extends PowerAppsCommand {
|
|
|
53
53
|
const settings = {
|
|
54
54
|
apiDefinition: "apiDefinition.swagger.json",
|
|
55
55
|
apiProperties: "apiProperties.json",
|
|
56
|
-
connectorId: args.options.
|
|
56
|
+
connectorId: args.options.name,
|
|
57
57
|
environment: args.options.environmentName,
|
|
58
58
|
icon: "icon.png",
|
|
59
59
|
powerAppsApiVersion: "2016-11-01",
|
|
@@ -157,7 +157,7 @@ _PaConnectorExportCommand_instances = new WeakSet(), _PaConnectorExportCommand_i
|
|
|
157
157
|
this.options.unshift({
|
|
158
158
|
option: '-e, --environmentName <environmentName>'
|
|
159
159
|
}, {
|
|
160
|
-
option: '-
|
|
160
|
+
option: '-n, --name <name>'
|
|
161
161
|
}, {
|
|
162
162
|
option: '--outputFolder [outputFolder]'
|
|
163
163
|
});
|
|
@@ -167,7 +167,7 @@ _PaConnectorExportCommand_instances = new WeakSet(), _PaConnectorExportCommand_i
|
|
|
167
167
|
!fs.existsSync(path.resolve(args.options.outputFolder))) {
|
|
168
168
|
return `Specified output folder ${args.options.outputFolder} doesn't exist`;
|
|
169
169
|
}
|
|
170
|
-
const outputFolder = path.resolve(args.options.outputFolder || '.', args.options.
|
|
170
|
+
const outputFolder = path.resolve(args.options.outputFolder || '.', args.options.name);
|
|
171
171
|
if (fs.existsSync(outputFolder)) {
|
|
172
172
|
return `Connector output folder ${outputFolder} already exists`;
|
|
173
173
|
}
|
|
@@ -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 _PlannerBucketAddCommand_instances, _PlannerBucketAddCommand_initTelemetry, _PlannerBucketAddCommand_initOptions, _PlannerBucketAddCommand_initValidators, _PlannerBucketAddCommand_initOptionSets;
|
|
6
|
+
var _PlannerBucketAddCommand_instances, _PlannerBucketAddCommand_initTelemetry, _PlannerBucketAddCommand_initOptions, _PlannerBucketAddCommand_initValidators, _PlannerBucketAddCommand_initOptionSets, _PlannerBucketAddCommand_initTypes;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { aadGroup } from '../../../../utils/aadGroup.js';
|
|
9
9
|
import { planner } from '../../../../utils/planner.js';
|
|
@@ -27,6 +27,7 @@ class PlannerBucketAddCommand extends GraphCommand {
|
|
|
27
27
|
__classPrivateFieldGet(this, _PlannerBucketAddCommand_instances, "m", _PlannerBucketAddCommand_initOptions).call(this);
|
|
28
28
|
__classPrivateFieldGet(this, _PlannerBucketAddCommand_instances, "m", _PlannerBucketAddCommand_initValidators).call(this);
|
|
29
29
|
__classPrivateFieldGet(this, _PlannerBucketAddCommand_instances, "m", _PlannerBucketAddCommand_initOptionSets).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _PlannerBucketAddCommand_instances, "m", _PlannerBucketAddCommand_initTypes).call(this);
|
|
30
31
|
}
|
|
31
32
|
async commandAction(logger, args) {
|
|
32
33
|
try {
|
|
@@ -109,6 +110,8 @@ _PlannerBucketAddCommand_instances = new WeakSet(), _PlannerBucketAddCommand_ini
|
|
|
109
110
|
options: ['ownerGroupId', 'ownerGroupName'],
|
|
110
111
|
runsWhen: (args) => args.options.planTitle !== undefined
|
|
111
112
|
});
|
|
113
|
+
}, _PlannerBucketAddCommand_initTypes = function _PlannerBucketAddCommand_initTypes() {
|
|
114
|
+
this.types.string.push('name', 'planId', 'planTitle', 'ownerGroupId', 'ownerGroupName', 'orderHint', 'rosterId ');
|
|
112
115
|
};
|
|
113
116
|
export default new PlannerBucketAddCommand();
|
|
114
117
|
//# sourceMappingURL=bucket-add.js.map
|