@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,11 +3,13 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _TeamsTeamListCommand_instances, _TeamsTeamListCommand_initTelemetry, _TeamsTeamListCommand_initOptions;
|
|
6
|
+
var _TeamsTeamListCommand_instances, _TeamsTeamListCommand_initTelemetry, _TeamsTeamListCommand_initOptions, _TeamsTeamListCommand_initValidators, _TeamsTeamListCommand_initOptionSets, _TeamsTeamListCommand_initTypes;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { odata } from '../../../../utils/odata.js';
|
|
9
9
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
10
10
|
import commands from '../../commands.js';
|
|
11
|
+
import { validation } from '../../../../utils/validation.js';
|
|
12
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
11
13
|
class TeamsTeamListCommand extends GraphCommand {
|
|
12
14
|
get name() {
|
|
13
15
|
return commands.TEAM_LIST;
|
|
@@ -23,64 +25,126 @@ class TeamsTeamListCommand extends GraphCommand {
|
|
|
23
25
|
_TeamsTeamListCommand_instances.add(this);
|
|
24
26
|
__classPrivateFieldGet(this, _TeamsTeamListCommand_instances, "m", _TeamsTeamListCommand_initTelemetry).call(this);
|
|
25
27
|
__classPrivateFieldGet(this, _TeamsTeamListCommand_instances, "m", _TeamsTeamListCommand_initOptions).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _TeamsTeamListCommand_instances, "m", _TeamsTeamListCommand_initValidators).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _TeamsTeamListCommand_instances, "m", _TeamsTeamListCommand_initOptionSets).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _TeamsTeamListCommand_instances, "m", _TeamsTeamListCommand_initTypes).call(this);
|
|
26
31
|
}
|
|
27
32
|
async commandAction(logger, args) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
if (this.verbose) {
|
|
34
|
+
if (!args.options.joined && !args.options.associated) {
|
|
35
|
+
await logger.logToStderr(`Retrieving Microsoft Teams in the tenant...`);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const user = args.options.userId || args.options.userName || 'me';
|
|
39
|
+
await logger.logToStderr(`Retrieving Microsoft Teams ${args.options.joined ? 'joined by' : 'associated with'} ${user}...`);
|
|
40
|
+
}
|
|
31
41
|
}
|
|
32
42
|
try {
|
|
33
|
-
|
|
34
|
-
if (args.options.joined) {
|
|
35
|
-
|
|
43
|
+
let endpoint = `${this.resource}/v1.0`;
|
|
44
|
+
if (args.options.joined || args.options.associated) {
|
|
45
|
+
endpoint += args.options.userId || args.options.userName ? `/users/${args.options.userId || formatting.encodeQueryParameter(args.options.userName)}` : '/me';
|
|
46
|
+
endpoint += args.options.joined ? '/joinedTeams' : '/teamwork/associatedTeams';
|
|
47
|
+
endpoint += '?$select=id';
|
|
36
48
|
}
|
|
37
49
|
else {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}).map(g => this.getTeamFromGroup(g)));
|
|
41
|
-
await logger.log(teamItems);
|
|
50
|
+
// Get all team groups within the tenant
|
|
51
|
+
endpoint += `/groups?$select=id&$filter=resourceProvisioningOptions/Any(x:x eq 'Team')`;
|
|
42
52
|
}
|
|
53
|
+
const groupResponse = await odata.getAllItems(endpoint);
|
|
54
|
+
const groupIds = groupResponse.map(g => g.id);
|
|
55
|
+
if (this.verbose) {
|
|
56
|
+
await logger.logToStderr(`Retrieved ${groupIds.length} Microsoft Teams, getting additional information...`);
|
|
57
|
+
}
|
|
58
|
+
let teams = await this.getAllTeams(groupIds);
|
|
59
|
+
// Sort teams by display name
|
|
60
|
+
teams = teams.sort((x, y) => x.displayName.localeCompare(y.displayName));
|
|
61
|
+
await logger.log(teams);
|
|
43
62
|
}
|
|
44
63
|
catch (err) {
|
|
45
64
|
this.handleRejectedODataJsonPromise(err);
|
|
46
65
|
}
|
|
47
66
|
}
|
|
48
|
-
async
|
|
67
|
+
async getAllTeams(groupIds) {
|
|
68
|
+
const groupBatches = [];
|
|
69
|
+
for (let i = 0; groupIds.length > i; i += 20) {
|
|
70
|
+
groupBatches.push(groupIds.slice(i, i + 20));
|
|
71
|
+
}
|
|
72
|
+
const promises = groupBatches.map(g => this.getTeamsBatch(g));
|
|
73
|
+
const teams = await Promise.all(promises);
|
|
74
|
+
const result = teams.reduce((prev, val) => prev.concat(val), []);
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
async getTeamsBatch(groupIds) {
|
|
49
78
|
const requestOptions = {
|
|
50
|
-
url: `${this.resource}/v1.0
|
|
79
|
+
url: `${this.resource}/v1.0/$batch`,
|
|
51
80
|
headers: {
|
|
52
|
-
accept: 'application/json;odata.metadata=none'
|
|
81
|
+
accept: 'application/json;odata.metadata=none',
|
|
82
|
+
'content-type': 'application/json'
|
|
53
83
|
},
|
|
54
|
-
responseType: 'json'
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
description: group.description,
|
|
65
|
-
isArchived: undefined
|
|
66
|
-
};
|
|
84
|
+
responseType: 'json',
|
|
85
|
+
data: {
|
|
86
|
+
requests: groupIds.map((id, index) => ({
|
|
87
|
+
id: index.toString(),
|
|
88
|
+
method: 'GET',
|
|
89
|
+
headers: {
|
|
90
|
+
accept: 'application/json;odata.metadata=none'
|
|
91
|
+
},
|
|
92
|
+
url: `/teams/${id}`
|
|
93
|
+
}))
|
|
67
94
|
}
|
|
68
|
-
|
|
69
|
-
|
|
95
|
+
};
|
|
96
|
+
const response = await request.post(requestOptions);
|
|
97
|
+
// Throw error if any of the requests failed
|
|
98
|
+
for (const item of response.responses) {
|
|
99
|
+
if (item.status !== 200) {
|
|
100
|
+
throw item.body;
|
|
70
101
|
}
|
|
71
102
|
}
|
|
103
|
+
return response.responses.map(r => r.body);
|
|
72
104
|
}
|
|
73
105
|
}
|
|
74
106
|
_TeamsTeamListCommand_instances = new WeakSet(), _TeamsTeamListCommand_initTelemetry = function _TeamsTeamListCommand_initTelemetry() {
|
|
75
107
|
this.telemetry.push((args) => {
|
|
76
108
|
Object.assign(this.telemetryProperties, {
|
|
77
|
-
joined: args.options.joined
|
|
109
|
+
joined: !!args.options.joined,
|
|
110
|
+
associated: !!args.options.associated,
|
|
111
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
112
|
+
userName: typeof args.options.userName !== 'undefined'
|
|
78
113
|
});
|
|
79
114
|
});
|
|
80
115
|
}, _TeamsTeamListCommand_initOptions = function _TeamsTeamListCommand_initOptions() {
|
|
81
116
|
this.options.unshift({
|
|
82
117
|
option: '-j, --joined'
|
|
118
|
+
}, {
|
|
119
|
+
option: '-a, --associated'
|
|
120
|
+
}, {
|
|
121
|
+
option: '--userId [userId]'
|
|
122
|
+
}, {
|
|
123
|
+
option: '--userName [userName]'
|
|
124
|
+
});
|
|
125
|
+
}, _TeamsTeamListCommand_initValidators = function _TeamsTeamListCommand_initValidators() {
|
|
126
|
+
this.validators.push(async (args) => {
|
|
127
|
+
if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
|
|
128
|
+
return `${args.options.userId} is not a valid GUID for userId.`;
|
|
129
|
+
}
|
|
130
|
+
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
131
|
+
return `${args.options.userId} is not a valid UPN for userName.`;
|
|
132
|
+
}
|
|
133
|
+
if ((args.options.userId || args.options.userName) && !args.options.joined && !args.options.associated) {
|
|
134
|
+
return 'You must specify either joined or associated when specifying userId or userName.';
|
|
135
|
+
}
|
|
136
|
+
return true;
|
|
137
|
+
});
|
|
138
|
+
}, _TeamsTeamListCommand_initOptionSets = function _TeamsTeamListCommand_initOptionSets() {
|
|
139
|
+
this.optionSets.push({
|
|
140
|
+
options: ['joined', 'associated'],
|
|
141
|
+
runsWhen: (args) => !!args.options.joined || !!args.options.associated
|
|
142
|
+
}, {
|
|
143
|
+
options: ['userId', 'userName'],
|
|
144
|
+
runsWhen: (args) => typeof args.options.userId !== 'undefined' || typeof args.options.userName !== 'undefined'
|
|
83
145
|
});
|
|
146
|
+
}, _TeamsTeamListCommand_initTypes = function _TeamsTeamListCommand_initTypes() {
|
|
147
|
+
this.types.string.push('userId', 'userName');
|
|
84
148
|
};
|
|
85
149
|
export default new TeamsTeamListCommand();
|
|
86
150
|
//# sourceMappingURL=team-list.js.map
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _TeamsTeamSetCommand_instances, _TeamsTeamSetCommand_initTelemetry, _TeamsTeamSetCommand_initOptions, _TeamsTeamSetCommand_initValidators;
|
|
6
|
+
var _TeamsTeamSetCommand_instances, _a, _TeamsTeamSetCommand_initTelemetry, _TeamsTeamSetCommand_initOptions, _TeamsTeamSetCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -60,9 +60,9 @@ class TeamsTeamSetCommand extends GraphCommand {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
_TeamsTeamSetCommand_instances = new WeakSet(), _TeamsTeamSetCommand_initTelemetry = function _TeamsTeamSetCommand_initTelemetry() {
|
|
63
|
+
_a = TeamsTeamSetCommand, _TeamsTeamSetCommand_instances = new WeakSet(), _TeamsTeamSetCommand_initTelemetry = function _TeamsTeamSetCommand_initTelemetry() {
|
|
64
64
|
this.telemetry.push((args) => {
|
|
65
|
-
|
|
65
|
+
_a.props.forEach((p) => {
|
|
66
66
|
this.telemetryProperties[p] = typeof args.options[p] !== 'undefined';
|
|
67
67
|
});
|
|
68
68
|
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var _TenantInfoGetCommand_instances, _TenantInfoGetCommand_initTelemetry, _TenantInfoGetCommand_initOptions, _TenantInfoGetCommand_initValidators;
|
|
7
|
+
import auth from '../../../../Auth.js';
|
|
8
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
9
|
+
import request from '../../../../request.js';
|
|
10
|
+
import { accessToken } from '../../../../utils/accessToken.js';
|
|
11
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
12
|
+
import { validation } from '../../../../utils/validation.js';
|
|
13
|
+
import commands from '../../commands.js';
|
|
14
|
+
class TenantInfoGetCommand extends GraphCommand {
|
|
15
|
+
get name() {
|
|
16
|
+
return commands.INFO_GET;
|
|
17
|
+
}
|
|
18
|
+
get description() {
|
|
19
|
+
return 'Gets information about any tenant';
|
|
20
|
+
}
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
_TenantInfoGetCommand_instances.add(this);
|
|
24
|
+
__classPrivateFieldGet(this, _TenantInfoGetCommand_instances, "m", _TenantInfoGetCommand_initTelemetry).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _TenantInfoGetCommand_instances, "m", _TenantInfoGetCommand_initOptions).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _TenantInfoGetCommand_instances, "m", _TenantInfoGetCommand_initValidators).call(this);
|
|
27
|
+
}
|
|
28
|
+
async commandAction(logger, args) {
|
|
29
|
+
let domainName = args.options.domainName;
|
|
30
|
+
const tenantId = args.options.tenantId;
|
|
31
|
+
if (!domainName && !tenantId) {
|
|
32
|
+
const userName = accessToken.getUserNameFromAccessToken(auth.service.accessTokens[auth.defaultResource].accessToken);
|
|
33
|
+
domainName = userName.split('@')[1];
|
|
34
|
+
}
|
|
35
|
+
let requestUrl = `${this.resource}/v1.0/tenantRelationships/`;
|
|
36
|
+
if (tenantId) {
|
|
37
|
+
requestUrl += `findTenantInformationByTenantId(tenantId='${formatting.encodeQueryParameter(tenantId)}')`;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
requestUrl += `findTenantInformationByDomainName(domainName='${formatting.encodeQueryParameter(domainName)}')`;
|
|
41
|
+
}
|
|
42
|
+
const requestOptions = {
|
|
43
|
+
url: requestUrl,
|
|
44
|
+
headers: {
|
|
45
|
+
accept: 'application/json;odata.metadata=none'
|
|
46
|
+
},
|
|
47
|
+
responseType: 'json'
|
|
48
|
+
};
|
|
49
|
+
try {
|
|
50
|
+
const res = await request.get(requestOptions);
|
|
51
|
+
await logger.log(res);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
this.handleRejectedODataJsonPromise(err);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
_TenantInfoGetCommand_instances = new WeakSet(), _TenantInfoGetCommand_initTelemetry = function _TenantInfoGetCommand_initTelemetry() {
|
|
59
|
+
this.telemetry.push((args) => {
|
|
60
|
+
Object.assign(this.telemetryProperties, {
|
|
61
|
+
domainName: typeof args.options.domainName !== 'undefined',
|
|
62
|
+
tenantId: typeof args.options.tenantId !== 'undefined'
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}, _TenantInfoGetCommand_initOptions = function _TenantInfoGetCommand_initOptions() {
|
|
66
|
+
this.options.unshift({
|
|
67
|
+
option: '-d, --domainName [domainName]'
|
|
68
|
+
}, {
|
|
69
|
+
option: '-i, --tenantId [tenantId]'
|
|
70
|
+
});
|
|
71
|
+
}, _TenantInfoGetCommand_initValidators = function _TenantInfoGetCommand_initValidators() {
|
|
72
|
+
this.validators.push(async (args) => {
|
|
73
|
+
if (args.options.tenantId && !validation.isValidGuid(args.options.tenantId)) {
|
|
74
|
+
return `${args.options.tenantId} is not a valid GUID`;
|
|
75
|
+
}
|
|
76
|
+
if (args.options.tenantId && args.options.domainName) {
|
|
77
|
+
return `Specify either domainName or tenantId but not both`;
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
export default new TenantInfoGetCommand();
|
|
83
|
+
//# sourceMappingURL=info-get.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const prefix = 'tenant';
|
|
2
2
|
export default {
|
|
3
3
|
ID_GET: `${prefix} id get`,
|
|
4
|
+
INFO_GET: `${prefix} info get`,
|
|
4
5
|
REPORT_ACTIVEUSERCOUNTS: `${prefix} report activeusercounts`,
|
|
5
6
|
REPORT_ACTIVEUSERDETAIL: `${prefix} report activeuserdetail`,
|
|
6
7
|
REPORT_OFFICE365ACTIVATIONCOUNTS: `${prefix} report office365activationcounts`,
|
|
@@ -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 _TodoTaskAddCommand_instances, _TodoTaskAddCommand_initTelemetry, _TodoTaskAddCommand_initOptions, _TodoTaskAddCommand_initValidators, _TodoTaskAddCommand_initOptionSets;
|
|
6
|
+
var _TodoTaskAddCommand_instances, _a, _TodoTaskAddCommand_initTelemetry, _TodoTaskAddCommand_initOptions, _TodoTaskAddCommand_initValidators, _TodoTaskAddCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
@@ -27,7 +27,7 @@ class TodoTaskAddCommand extends GraphCommand {
|
|
|
27
27
|
const endpoint = `${this.resource}/v1.0`;
|
|
28
28
|
try {
|
|
29
29
|
const listId = await this.getTodoListId(args);
|
|
30
|
-
const status = args.options.status &&
|
|
30
|
+
const status = args.options.status && _a.allowedStatuses.filter(x => x.toLowerCase() === args.options.status.toLowerCase())[0];
|
|
31
31
|
const requestOptions = {
|
|
32
32
|
url: `${endpoint}/me/todo/lists/${listId}/tasks`,
|
|
33
33
|
headers: {
|
|
@@ -85,7 +85,7 @@ class TodoTaskAddCommand extends GraphCommand {
|
|
|
85
85
|
return taskList.id;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
_TodoTaskAddCommand_instances = new WeakSet(), _TodoTaskAddCommand_initTelemetry = function _TodoTaskAddCommand_initTelemetry() {
|
|
88
|
+
_a = TodoTaskAddCommand, _TodoTaskAddCommand_instances = new WeakSet(), _TodoTaskAddCommand_initTelemetry = function _TodoTaskAddCommand_initTelemetry() {
|
|
89
89
|
this.telemetry.push((args) => {
|
|
90
90
|
Object.assign(this.telemetryProperties, {
|
|
91
91
|
listId: typeof args.options.listId !== 'undefined',
|
|
@@ -128,7 +128,7 @@ _TodoTaskAddCommand_instances = new WeakSet(), _TodoTaskAddCommand_initTelemetry
|
|
|
128
128
|
option: '--startDateTime [startDateTime]'
|
|
129
129
|
}, {
|
|
130
130
|
option: '--status [status]',
|
|
131
|
-
autocomplete:
|
|
131
|
+
autocomplete: _a.allowedStatuses
|
|
132
132
|
});
|
|
133
133
|
}, _TodoTaskAddCommand_initValidators = function _TodoTaskAddCommand_initValidators() {
|
|
134
134
|
this.validators.push(async (args) => {
|
|
@@ -150,8 +150,8 @@ _TodoTaskAddCommand_instances = new WeakSet(), _TodoTaskAddCommand_initTelemetry
|
|
|
150
150
|
if (args.options.startDateTime && !validation.isValidISODateTime(args.options.startDateTime)) {
|
|
151
151
|
return `'${args.options.startDateTime}' is not a valid datetime.`;
|
|
152
152
|
}
|
|
153
|
-
if (args.options.status &&
|
|
154
|
-
return `${args.options.status} is not a valid value for status. Valid values are ${
|
|
153
|
+
if (args.options.status && _a.allowedStatuses.map(x => x.toLowerCase()).indexOf(args.options.status.toLowerCase()) === -1) {
|
|
154
|
+
return `${args.options.status} is not a valid value for status. Valid values are ${_a.allowedStatuses.join(', ')}`;
|
|
155
155
|
}
|
|
156
156
|
if (args.options.completedDateTime && args.options.status?.toLowerCase() !== 'completed') {
|
|
157
157
|
return `The completedDateTime option can only be used when the status option is set to completed`;
|
|
@@ -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 _YammerMessageListCommand_instances, _YammerMessageListCommand_initTelemetry, _YammerMessageListCommand_initOptions, _YammerMessageListCommand_initValidators;
|
|
6
|
+
var _YammerMessageListCommand_instances, _a, _YammerMessageListCommand_initTelemetry, _YammerMessageListCommand_initOptions, _YammerMessageListCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import YammerCommand from '../../../base/YammerCommand.js';
|
|
9
9
|
import commands from '../../commands.js';
|
|
@@ -117,7 +117,7 @@ class YammerMessageListCommand extends YammerCommand {
|
|
|
117
117
|
}
|
|
118
118
|
}
|
|
119
119
|
}
|
|
120
|
-
_YammerMessageListCommand_instances = new WeakSet(), _YammerMessageListCommand_initTelemetry = function _YammerMessageListCommand_initTelemetry() {
|
|
120
|
+
_a = YammerMessageListCommand, _YammerMessageListCommand_instances = new WeakSet(), _YammerMessageListCommand_initTelemetry = function _YammerMessageListCommand_initTelemetry() {
|
|
121
121
|
this.telemetry.push((args) => {
|
|
122
122
|
Object.assign(this.telemetryProperties, {
|
|
123
123
|
olderThanId: args.options.olderThanId !== undefined,
|
|
@@ -133,7 +133,7 @@ _YammerMessageListCommand_instances = new WeakSet(), _YammerMessageListCommand_i
|
|
|
133
133
|
option: '--olderThanId [olderThanId]'
|
|
134
134
|
}, {
|
|
135
135
|
option: '--feedType [feedType]',
|
|
136
|
-
autocomplete:
|
|
136
|
+
autocomplete: _a.feedTypes
|
|
137
137
|
}, {
|
|
138
138
|
option: '--groupId [groupId]'
|
|
139
139
|
}, {
|
|
@@ -151,8 +151,8 @@ _YammerMessageListCommand_instances = new WeakSet(), _YammerMessageListCommand_i
|
|
|
151
151
|
if (args.options.feedType && (args.options.groupId || args.options.threadId)) {
|
|
152
152
|
return `You cannot specify the feedType with groupId or threadId at the same time`;
|
|
153
153
|
}
|
|
154
|
-
if (args.options.feedType &&
|
|
155
|
-
return `${args.options.feedType} is not a valid value for the feedType option. Allowed values are ${
|
|
154
|
+
if (args.options.feedType && _a.feedTypes.indexOf(args.options.feedType) < 0) {
|
|
155
|
+
return `${args.options.feedType} is not a valid value for the feedType option. Allowed values are ${_a.feedTypes.join('|')}`;
|
|
156
156
|
}
|
|
157
157
|
if (args.options.olderThanId && typeof args.options.olderThanId !== 'number') {
|
|
158
158
|
return `${args.options.olderThanId} is not a number`;
|
|
@@ -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 _YammerSearchCommand_instances, _YammerSearchCommand_initTelemetry, _YammerSearchCommand_initOptions, _YammerSearchCommand_initValidators;
|
|
6
|
+
var _YammerSearchCommand_instances, _a, _YammerSearchCommand_initTelemetry, _YammerSearchCommand_initOptions, _YammerSearchCommand_initValidators;
|
|
7
7
|
import { Cli } from '../../../cli/Cli.js';
|
|
8
8
|
import request from '../../../request.js';
|
|
9
9
|
import { formatting } from '../../../utils/formatting.js';
|
|
@@ -169,7 +169,7 @@ class YammerSearchCommand extends YammerCommand {
|
|
|
169
169
|
}
|
|
170
170
|
}
|
|
171
171
|
}
|
|
172
|
-
_YammerSearchCommand_instances = new WeakSet(), _YammerSearchCommand_initTelemetry = function _YammerSearchCommand_initTelemetry() {
|
|
172
|
+
_a = YammerSearchCommand, _YammerSearchCommand_instances = new WeakSet(), _YammerSearchCommand_initTelemetry = function _YammerSearchCommand_initTelemetry() {
|
|
173
173
|
this.telemetry.push((args) => {
|
|
174
174
|
Object.assign(this.telemetryProperties, {
|
|
175
175
|
show: typeof args.options.show !== 'undefined',
|
|
@@ -181,7 +181,7 @@ _YammerSearchCommand_instances = new WeakSet(), _YammerSearchCommand_initTelemet
|
|
|
181
181
|
option: '--queryText <queryText>'
|
|
182
182
|
}, {
|
|
183
183
|
option: '--show [show]',
|
|
184
|
-
autocomplete:
|
|
184
|
+
autocomplete: _a.showOptions
|
|
185
185
|
}, {
|
|
186
186
|
option: '--limit [limit]'
|
|
187
187
|
});
|
|
@@ -196,8 +196,8 @@ _YammerSearchCommand_instances = new WeakSet(), _YammerSearchCommand_initTelemet
|
|
|
196
196
|
if (args.options.output !== 'json') {
|
|
197
197
|
if (typeof args.options.show !== 'undefined') {
|
|
198
198
|
const scope = args.options.show.toString().toLowerCase();
|
|
199
|
-
if (
|
|
200
|
-
return `${scope} is not a valid value for show. Allowed values are ${
|
|
199
|
+
if (_a.showOptions.indexOf(scope) < 0) {
|
|
200
|
+
return `${scope} is not a valid value for show. Allowed values are ${_a.showOptions.join(', ')}`;
|
|
201
201
|
}
|
|
202
202
|
}
|
|
203
203
|
}
|
package/dist/utils/aadGroup.js
CHANGED
|
@@ -1,13 +1,14 @@
|
|
|
1
1
|
import request from "../request.js";
|
|
2
2
|
import { formatting } from "./formatting.js";
|
|
3
3
|
import { odata } from "./odata.js";
|
|
4
|
+
import { Cli } from '../cli/Cli.js';
|
|
4
5
|
const graphResource = 'https://graph.microsoft.com';
|
|
5
6
|
export const aadGroup = {
|
|
6
7
|
/**
|
|
7
8
|
* Retrieve a single group.
|
|
8
9
|
* @param id Group ID.
|
|
9
10
|
*/
|
|
10
|
-
getGroupById(id) {
|
|
11
|
+
async getGroupById(id) {
|
|
11
12
|
const requestOptions = {
|
|
12
13
|
url: `${graphResource}/v1.0/groups/${id}`,
|
|
13
14
|
headers: {
|
|
@@ -21,7 +22,7 @@ export const aadGroup = {
|
|
|
21
22
|
* Get a list of groups by display name.
|
|
22
23
|
* @param displayName Group display name.
|
|
23
24
|
*/
|
|
24
|
-
getGroupsByDisplayName(displayName) {
|
|
25
|
+
async getGroupsByDisplayName(displayName) {
|
|
25
26
|
return odata.getAllItems(`${graphResource}/v1.0/groups?$filter=displayName eq '${formatting.encodeQueryParameter(displayName)}'`);
|
|
26
27
|
},
|
|
27
28
|
/**
|
|
@@ -36,7 +37,8 @@ export const aadGroup = {
|
|
|
36
37
|
throw Error(`The specified group '${displayName}' does not exist.`);
|
|
37
38
|
}
|
|
38
39
|
if (groups.length > 1) {
|
|
39
|
-
|
|
40
|
+
const resultAsKeyValuePair = formatting.convertArrayToHashTable('id', groups);
|
|
41
|
+
return await Cli.handleMultipleResultsFound(`Multiple groups with name '${displayName}' found.`, resultAsKeyValuePair);
|
|
40
42
|
}
|
|
41
43
|
return groups[0];
|
|
42
44
|
},
|
|
@@ -55,6 +57,24 @@ export const aadGroup = {
|
|
|
55
57
|
throw Error(`Multiple groups with name '${displayName}' found: ${groups.map(x => x.id).join(',')}.`);
|
|
56
58
|
}
|
|
57
59
|
return groups[0].id;
|
|
60
|
+
},
|
|
61
|
+
async setGroup(id, isPrivate, logger, verbose) {
|
|
62
|
+
if (verbose && logger) {
|
|
63
|
+
await logger.logToStderr(`Updating Microsoft 365 Group ${id}...`);
|
|
64
|
+
}
|
|
65
|
+
const update = {};
|
|
66
|
+
if (typeof isPrivate !== 'undefined') {
|
|
67
|
+
update.visibility = isPrivate ? 'Private' : 'Public';
|
|
68
|
+
}
|
|
69
|
+
const requestOptions = {
|
|
70
|
+
url: `${graphResource}/v1.0/groups/${id}`,
|
|
71
|
+
headers: {
|
|
72
|
+
'accept': 'application/json;odata.metadata=none'
|
|
73
|
+
},
|
|
74
|
+
responseType: 'json',
|
|
75
|
+
data: update
|
|
76
|
+
};
|
|
77
|
+
await request.patch(requestOptions);
|
|
58
78
|
}
|
|
59
79
|
};
|
|
60
80
|
//# sourceMappingURL=aadGroup.js.map
|
package/dist/utils/formatting.js
CHANGED
|
@@ -153,6 +153,13 @@ export const formatting = {
|
|
|
153
153
|
const success = primarySupported ? '✔' : '√';
|
|
154
154
|
const failure = primarySupported ? '✖' : '×';
|
|
155
155
|
return `${result === CheckStatus.Success ? chalk.green(success) : chalk.red(failure)} ${message}`;
|
|
156
|
+
},
|
|
157
|
+
convertArrayToHashTable(key, array) {
|
|
158
|
+
const resultAsKeyValuePair = {};
|
|
159
|
+
array.forEach((obj) => {
|
|
160
|
+
resultAsKeyValuePair[obj[key]] = obj;
|
|
161
|
+
});
|
|
162
|
+
return resultAsKeyValuePair;
|
|
156
163
|
}
|
|
157
164
|
};
|
|
158
165
|
//# sourceMappingURL=formatting.js.map
|
package/dist/utils/fsUtil.js
CHANGED
|
@@ -96,6 +96,11 @@ export const fsUtil = {
|
|
|
96
96
|
},
|
|
97
97
|
getRemoveCommand(command, shell) {
|
|
98
98
|
return removeFileCommands[shell][command];
|
|
99
|
+
},
|
|
100
|
+
ensureDirectory(path) {
|
|
101
|
+
if (!fs.existsSync(path)) {
|
|
102
|
+
fs.mkdirSync(path, { recursive: true });
|
|
103
|
+
}
|
|
99
104
|
}
|
|
100
105
|
};
|
|
101
106
|
//# sourceMappingURL=fsUtil.js.map
|
|
@@ -19,7 +19,7 @@ export const powerPlatform = {
|
|
|
19
19
|
};
|
|
20
20
|
try {
|
|
21
21
|
const response = await request.get(requestOptions);
|
|
22
|
-
return
|
|
22
|
+
return response.properties.linkedEnvironmentMetadata.instanceApiUrl;
|
|
23
23
|
}
|
|
24
24
|
catch (ex) {
|
|
25
25
|
throw Error(`The environment '${environment}' could not be retrieved. See the inner exception for more details: ${ex.message}`);
|