@pnp/cli-microsoft365 12.0.0-beta.d58fb77 → 12.0.0-beta.e3af9f8
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/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +4 -1
- package/dist/cli/cli.js +3 -0
- package/dist/m365/entra/commands/m365group/m365group-add.js +52 -97
- package/dist/m365/entra/commands/m365group/m365group-conversation-list.js +20 -33
- package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +20 -39
- package/dist/m365/entra/commands/m365group/m365group-get.js +20 -41
- package/dist/m365/entra/commands/m365group/m365group-list.js +11 -31
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-clear.js +8 -22
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +9 -25
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-remove.js +21 -43
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-restore.js +21 -41
- package/dist/m365/entra/commands/m365group/m365group-remove.js +25 -46
- package/dist/m365/entra/commands/m365group/m365group-renew.js +19 -32
- package/dist/m365/entra/commands/m365group/m365group-set.js +86 -141
- package/dist/m365/entra/commands/m365group/m365group-teamify.js +20 -43
- package/dist/m365/entra/commands/m365group/m365group-user-add.js +44 -77
- package/dist/m365/entra/commands/m365group/m365group-user-list.js +28 -55
- package/dist/m365/entra/commands/m365group/m365group-user-remove.js +37 -74
- package/dist/m365/entra/commands/m365group/m365group-user-set.js +45 -77
- package/dist/m365/spe/commands/container/container-permission-remove.js +94 -0
- package/dist/m365/spe/commands.js +1 -0
- package/dist/m365/spo/commands/listitem/listitem-add.js +27 -55
- package/dist/m365/spo/commands/listitem/listitem-attachment-add.js +30 -58
- package/dist/m365/spo/commands/listitem/listitem-attachment-get.js +27 -52
- package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +26 -50
- package/dist/m365/spo/commands/listitem/listitem-attachment-remove.js +28 -55
- package/dist/m365/spo/commands/listitem/listitem-attachment-set.js +30 -57
- package/dist/m365/spo/commands/listitem/listitem-batch-add.js +36 -58
- package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +68 -92
- package/dist/m365/spo/commands/listitem/listitem-batch-set.js +37 -57
- package/dist/m365/spo/commands/listitem/listitem-get.js +45 -68
- package/dist/m365/spo/commands/listitem/listitem-isrecord.js +31 -55
- package/dist/m365/spo/commands/listitem/listitem-list.js +47 -81
- package/dist/m365/spo/commands/listitem/listitem-record-declare.js +37 -60
- package/dist/m365/spo/commands/listitem/listitem-record-lock.js +30 -52
- package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +31 -52
- package/dist/m365/spo/commands/listitem/listitem-record-unlock.js +30 -52
- package/dist/m365/spo/commands/listitem/listitem-remove.js +33 -61
- package/dist/m365/spo/commands/listitem/listitem-retentionlabel-ensure.js +46 -67
- package/dist/m365/spo/commands/listitem/listitem-retentionlabel-remove.js +33 -56
- package/dist/m365/spo/commands/listitem/listitem-roleassignment-add.js +55 -98
- package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +48 -74
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +33 -56
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +31 -53
- package/dist/m365/spo/commands/listitem/listitem-set.js +33 -58
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-add.js +8 -1
- package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +8 -1
- package/dist/m365/teams/commands/report/report-deviceusagedistributionusercounts.js +10 -0
- package/dist/m365/teams/commands/report/report-deviceusageusercounts.js +10 -0
- package/dist/m365/teams/commands/report/report-deviceusageuserdetail.js +22 -0
- package/dist/m365/teams/commands/report/report-directroutingcalls.js +19 -39
- package/dist/m365/teams/commands/report/report-pstncalls.js +19 -39
- package/dist/m365/teams/commands/report/report-useractivitycounts.js +10 -0
- package/dist/m365/teams/commands/report/report-useractivityusercounts.js +10 -0
- package/dist/m365/teams/commands/report/report-useractivityuserdetail.js +22 -0
- package/dist/m365/teams/commands/tab/tab-add.js +23 -49
- package/dist/m365/teams/commands/tab/tab-get.js +55 -56
- package/dist/m365/teams/commands/tab/tab-list.js +17 -28
- package/dist/m365/teams/commands/tab/tab-remove.js +23 -42
- package/dist/m365/teams/commands/team/team-add.js +76 -114
- package/dist/m365/teams/commands/team/team-app-list.js +23 -36
- package/dist/m365/teams/commands/team/team-archive.js +24 -39
- package/dist/m365/teams/commands/team/team-clone.js +28 -62
- package/dist/m365/teams/commands/team/team-get.js +23 -36
- package/dist/m365/teams/commands/team/team-list.js +43 -57
- package/dist/m365/teams/commands/team/team-remove.js +24 -37
- package/dist/m365/teams/commands/team/team-set.js +23 -52
- package/dist/m365/teams/commands/team/team-unarchive.js +23 -28
- package/dist/m365/teams/commands/user/user-app-add.js +40 -49
- package/dist/m365/teams/commands/user/user-app-list.js +26 -39
- package/dist/m365/teams/commands/user/user-app-remove.js +37 -49
- package/dist/m365/teams/commands/user/user-app-upgrade.js +36 -52
- package/dist/m365/teams/commands/user/user-list.js +17 -39
- package/dist/m365/tenant/commands/report/report-activeusercounts.js +2 -1
- package/dist/m365/tenant/commands/report/report-activeuserdetail.js +2 -1
- package/dist/m365/tenant/commands/report/report-office365activationcounts.js +9 -0
- package/dist/m365/tenant/commands/report/report-office365activationsusercounts.js +9 -0
- package/dist/m365/tenant/commands/report/report-office365activationsuserdetail.js +9 -0
- package/dist/m365/tenant/commands/report/report-servicesusercounts.js +2 -1
- package/dist/m365/tenant/commands/report/report-settings-get.js +5 -0
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-get.js +9 -20
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-list.js +8 -20
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-get.js +8 -15
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +8 -15
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-get.js +12 -26
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +8 -22
- package/dist/utils/zod.js +4 -4
- package/docs/docs/cmd/spe/container/container-permission-remove.mdx +78 -0
- package/package.json +1 -1
|
@@ -1,15 +1,16 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _EntraM365GroupTeamifyCommand_instances, _EntraM365GroupTeamifyCommand_initTelemetry, _EntraM365GroupTeamifyCommand_initOptions, _EntraM365GroupTeamifyCommand_initValidators, _EntraM365GroupTeamifyCommand_initOptionSets, _EntraM365GroupTeamifyCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
9
5
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
-
import { validation } from '../../../../utils/validation.js';
|
|
11
6
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
7
|
import commands from '../../commands.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
id: z.uuid().optional().alias('i'),
|
|
11
|
+
displayName: z.string().optional().alias('n'),
|
|
12
|
+
mailNickname: z.string().optional()
|
|
13
|
+
});
|
|
13
14
|
class EntraM365GroupTeamifyCommand extends GraphCommand {
|
|
14
15
|
get name() {
|
|
15
16
|
return commands.M365GROUP_TEAMIFY;
|
|
@@ -17,14 +18,18 @@ class EntraM365GroupTeamifyCommand extends GraphCommand {
|
|
|
17
18
|
get description() {
|
|
18
19
|
return 'Creates a new Microsoft Teams team under existing Microsoft 365 group';
|
|
19
20
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
21
|
+
get schema() {
|
|
22
|
+
return options;
|
|
23
|
+
}
|
|
24
|
+
getRefinedSchema(schema) {
|
|
25
|
+
return schema
|
|
26
|
+
.refine(opts => [opts.id, opts.displayName, opts.mailNickname].filter(o => o !== undefined).length === 1, {
|
|
27
|
+
error: 'Use one of the following options: id, displayName or mailNickname.',
|
|
28
|
+
params: {
|
|
29
|
+
customCode: 'optionSet',
|
|
30
|
+
options: ['id', 'displayName', 'mailNickname']
|
|
31
|
+
}
|
|
32
|
+
});
|
|
28
33
|
}
|
|
29
34
|
async getGroupId(options) {
|
|
30
35
|
if (options.id) {
|
|
@@ -71,33 +76,5 @@ class EntraM365GroupTeamifyCommand extends GraphCommand {
|
|
|
71
76
|
}
|
|
72
77
|
}
|
|
73
78
|
}
|
|
74
|
-
_EntraM365GroupTeamifyCommand_instances = new WeakSet(), _EntraM365GroupTeamifyCommand_initTelemetry = function _EntraM365GroupTeamifyCommand_initTelemetry() {
|
|
75
|
-
this.telemetry.push((args) => {
|
|
76
|
-
Object.assign(this.telemetryProperties, {
|
|
77
|
-
id: typeof args.options.id !== 'undefined',
|
|
78
|
-
mailNickname: typeof args.options.mailNickname !== 'undefined',
|
|
79
|
-
displayName: typeof args.options.displayName !== 'undefined'
|
|
80
|
-
});
|
|
81
|
-
});
|
|
82
|
-
}, _EntraM365GroupTeamifyCommand_initOptions = function _EntraM365GroupTeamifyCommand_initOptions() {
|
|
83
|
-
this.options.unshift({
|
|
84
|
-
option: '-i, --id [id]'
|
|
85
|
-
}, {
|
|
86
|
-
option: '-n, --displayName [displayName]'
|
|
87
|
-
}, {
|
|
88
|
-
option: '--mailNickname [mailNickname]'
|
|
89
|
-
});
|
|
90
|
-
}, _EntraM365GroupTeamifyCommand_initValidators = function _EntraM365GroupTeamifyCommand_initValidators() {
|
|
91
|
-
this.validators.push(async (args) => {
|
|
92
|
-
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
93
|
-
return `${args.options.id} is not a valid GUID`;
|
|
94
|
-
}
|
|
95
|
-
return true;
|
|
96
|
-
});
|
|
97
|
-
}, _EntraM365GroupTeamifyCommand_initOptionSets = function _EntraM365GroupTeamifyCommand_initOptionSets() {
|
|
98
|
-
this.optionSets.push({ options: ['id', 'displayName', 'mailNickname'] });
|
|
99
|
-
}, _EntraM365GroupTeamifyCommand_initTypes = function _EntraM365GroupTeamifyCommand_initTypes() {
|
|
100
|
-
this.types.string.push('id', 'displayName', 'mailNickname');
|
|
101
|
-
};
|
|
102
79
|
export default new EntraM365GroupTeamifyCommand();
|
|
103
80
|
//# sourceMappingURL=m365group-teamify.js.map
|
|
@@ -1,16 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _EntraM365GroupUserAddCommand_instances, _EntraM365GroupUserAddCommand_initTelemetry, _EntraM365GroupUserAddCommand_initOptions, _EntraM365GroupUserAddCommand_initValidators, _EntraM365GroupUserAddCommand_initOptionSets, _EntraM365GroupUserAddCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
9
|
-
import {
|
|
5
|
+
import { entraUser } from '../../../../utils/entraUser.js';
|
|
10
6
|
import { formatting } from '../../../../utils/formatting.js';
|
|
7
|
+
import { validation } from '../../../../utils/validation.js';
|
|
8
|
+
import { zod } from '../../../../utils/zod.js';
|
|
11
9
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
|
-
import { entraUser } from '../../../../utils/entraUser.js';
|
|
13
10
|
import commands from '../../commands.js';
|
|
11
|
+
const RoleEnum = {
|
|
12
|
+
owner: 'owner',
|
|
13
|
+
member: 'member'
|
|
14
|
+
};
|
|
15
|
+
export const options = z.strictObject({
|
|
16
|
+
...globalOptionsZod.shape,
|
|
17
|
+
ids: z.string()
|
|
18
|
+
.refine(ids => validation.isValidGuidArray(ids) === true, {
|
|
19
|
+
error: e => `The following GUIDs are invalid for the option 'ids': ${validation.isValidGuidArray(e.input)}.`
|
|
20
|
+
}).optional(),
|
|
21
|
+
userNames: z.string()
|
|
22
|
+
.refine(names => validation.isValidUserPrincipalNameArray(names) === true, {
|
|
23
|
+
error: e => `The following user principal names are invalid for the option 'userNames': ${validation.isValidUserPrincipalNameArray(e.input)}.`
|
|
24
|
+
}).optional(),
|
|
25
|
+
groupId: z.uuid().optional().alias('i'),
|
|
26
|
+
groupName: z.string().optional(),
|
|
27
|
+
teamId: z.uuid().optional(),
|
|
28
|
+
teamName: z.string().optional(),
|
|
29
|
+
role: zod.coercedEnum(RoleEnum).optional().alias('r')
|
|
30
|
+
});
|
|
14
31
|
class EntraM365GroupUserAddCommand extends GraphCommand {
|
|
15
32
|
get name() {
|
|
16
33
|
return commands.M365GROUP_USER_ADD;
|
|
@@ -18,15 +35,25 @@ class EntraM365GroupUserAddCommand extends GraphCommand {
|
|
|
18
35
|
get description() {
|
|
19
36
|
return 'Adds user to specified Microsoft 365 Group or Microsoft Teams team';
|
|
20
37
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
get schema() {
|
|
39
|
+
return options;
|
|
40
|
+
}
|
|
41
|
+
getRefinedSchema(schema) {
|
|
42
|
+
return schema
|
|
43
|
+
.refine(opts => [opts.groupId, opts.groupName, opts.teamId, opts.teamName].filter(o => o !== undefined).length === 1, {
|
|
44
|
+
error: 'Use one of the following options: groupId, groupName, teamId or teamName.',
|
|
45
|
+
params: {
|
|
46
|
+
customCode: 'optionSet',
|
|
47
|
+
options: ['groupId', 'groupName', 'teamId', 'teamName']
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
.refine(opts => [opts.ids, opts.userNames].filter(o => o !== undefined).length === 1, {
|
|
51
|
+
error: 'Use one of the following options: ids or userNames.',
|
|
52
|
+
params: {
|
|
53
|
+
customCode: 'optionSet',
|
|
54
|
+
options: ['ids', 'userNames']
|
|
55
|
+
}
|
|
56
|
+
});
|
|
30
57
|
}
|
|
31
58
|
async commandAction(logger, args) {
|
|
32
59
|
try {
|
|
@@ -103,65 +130,5 @@ class EntraM365GroupUserAddCommand extends GraphCommand {
|
|
|
103
130
|
}
|
|
104
131
|
}
|
|
105
132
|
}
|
|
106
|
-
_EntraM365GroupUserAddCommand_instances = new WeakSet(), _EntraM365GroupUserAddCommand_initTelemetry = function _EntraM365GroupUserAddCommand_initTelemetry() {
|
|
107
|
-
this.telemetry.push((args) => {
|
|
108
|
-
Object.assign(this.telemetryProperties, {
|
|
109
|
-
role: args.options.role !== 'undefined',
|
|
110
|
-
teamId: typeof args.options.teamId !== 'undefined',
|
|
111
|
-
groupId: typeof args.options.groupId !== 'undefined',
|
|
112
|
-
teamName: typeof args.options.teamName !== 'undefined',
|
|
113
|
-
groupName: typeof args.options.groupName !== 'undefined',
|
|
114
|
-
ids: typeof args.options.ids !== 'undefined',
|
|
115
|
-
userNames: typeof args.options.userNames !== 'undefined'
|
|
116
|
-
});
|
|
117
|
-
});
|
|
118
|
-
}, _EntraM365GroupUserAddCommand_initOptions = function _EntraM365GroupUserAddCommand_initOptions() {
|
|
119
|
-
this.options.unshift({
|
|
120
|
-
option: '--ids [ids]'
|
|
121
|
-
}, {
|
|
122
|
-
option: '--userNames [userNames]'
|
|
123
|
-
}, {
|
|
124
|
-
option: '-i, --groupId [groupId]'
|
|
125
|
-
}, {
|
|
126
|
-
option: '--groupName [groupName]'
|
|
127
|
-
}, {
|
|
128
|
-
option: '--teamId [teamId]'
|
|
129
|
-
}, {
|
|
130
|
-
option: '--teamName [teamName]'
|
|
131
|
-
}, {
|
|
132
|
-
option: '-r, --role [role]',
|
|
133
|
-
autocomplete: this.allowedRoles
|
|
134
|
-
});
|
|
135
|
-
}, _EntraM365GroupUserAddCommand_initValidators = function _EntraM365GroupUserAddCommand_initValidators() {
|
|
136
|
-
this.validators.push(async (args) => {
|
|
137
|
-
if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
|
|
138
|
-
return `'${args.options.teamId}' is not a valid GUID for option 'teamId'.`;
|
|
139
|
-
}
|
|
140
|
-
if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
|
|
141
|
-
return `'${args.options.groupId}' is not a valid GUID for option 'groupId'.`;
|
|
142
|
-
}
|
|
143
|
-
if (args.options.ids) {
|
|
144
|
-
const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.ids);
|
|
145
|
-
if (isValidGUIDArrayResult !== true) {
|
|
146
|
-
return `The following GUIDs are invalid for the option 'ids': ${isValidGUIDArrayResult}.`;
|
|
147
|
-
}
|
|
148
|
-
}
|
|
149
|
-
if (args.options.userNames) {
|
|
150
|
-
const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.userNames);
|
|
151
|
-
if (isValidUPNArrayResult !== true) {
|
|
152
|
-
return `The following user principal names are invalid for the option 'userNames': ${isValidUPNArrayResult}.`;
|
|
153
|
-
}
|
|
154
|
-
}
|
|
155
|
-
if (args.options.role && !this.allowedRoles.some(role => role.toLowerCase() === args.options.role.toLowerCase())) {
|
|
156
|
-
return `'${args.options.role}' is not a valid role. Allowed values are: ${this.allowedRoles.join(',')}`;
|
|
157
|
-
}
|
|
158
|
-
return true;
|
|
159
|
-
});
|
|
160
|
-
}, _EntraM365GroupUserAddCommand_initOptionSets = function _EntraM365GroupUserAddCommand_initOptionSets() {
|
|
161
|
-
this.optionSets.push({ options: ['groupId', 'groupName', 'teamId', 'teamName'] });
|
|
162
|
-
this.optionSets.push({ options: ['ids', 'userNames'] });
|
|
163
|
-
}, _EntraM365GroupUserAddCommand_initTypes = function _EntraM365GroupUserAddCommand_initTypes() {
|
|
164
|
-
this.types.string.push('ids', 'userNames', 'groupId', 'groupName', 'teamId', 'teamName', 'role');
|
|
165
|
-
};
|
|
166
133
|
export default new EntraM365GroupUserAddCommand();
|
|
167
134
|
//# sourceMappingURL=m365group-user-add.js.map
|
|
@@ -1,14 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _EntraM365GroupUserListCommand_instances, _EntraM365GroupUserListCommand_initTelemetry, _EntraM365GroupUserListCommand_initOptions, _EntraM365GroupUserListCommand_initOptionSets, _EntraM365GroupUserListCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
+
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
7
4
|
import { odata } from '../../../../utils/odata.js';
|
|
8
|
-
import {
|
|
5
|
+
import { zod } from '../../../../utils/zod.js';
|
|
9
6
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
10
7
|
import commands from '../../commands.js';
|
|
11
|
-
|
|
8
|
+
const RoleEnum = {
|
|
9
|
+
Owner: 'Owner',
|
|
10
|
+
Member: 'Member'
|
|
11
|
+
};
|
|
12
|
+
export const options = z.strictObject({
|
|
13
|
+
...globalOptionsZod.shape,
|
|
14
|
+
filter: z.string().optional().alias('f'),
|
|
15
|
+
groupId: z.uuid().optional().alias('i'),
|
|
16
|
+
groupDisplayName: z.string().optional().alias('n'),
|
|
17
|
+
properties: z.string().optional().alias('p'),
|
|
18
|
+
role: zod.coercedEnum(RoleEnum).optional().alias('r')
|
|
19
|
+
});
|
|
12
20
|
class EntraM365GroupUserListCommand extends GraphCommand {
|
|
13
21
|
get name() {
|
|
14
22
|
return commands.M365GROUP_USER_LIST;
|
|
@@ -16,13 +24,18 @@ class EntraM365GroupUserListCommand extends GraphCommand {
|
|
|
16
24
|
get description() {
|
|
17
25
|
return "Lists users for the specified Microsoft 365 group";
|
|
18
26
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
27
|
+
get schema() {
|
|
28
|
+
return options;
|
|
29
|
+
}
|
|
30
|
+
getRefinedSchema(schema) {
|
|
31
|
+
return schema
|
|
32
|
+
.refine(opts => [opts.groupId, opts.groupDisplayName].filter(o => o !== undefined).length === 1, {
|
|
33
|
+
error: 'Use one of the following options: groupId or groupDisplayName.',
|
|
34
|
+
params: {
|
|
35
|
+
customCode: 'optionSet',
|
|
36
|
+
options: ['groupId', 'groupDisplayName']
|
|
37
|
+
}
|
|
38
|
+
});
|
|
26
39
|
}
|
|
27
40
|
async commandAction(logger, args) {
|
|
28
41
|
try {
|
|
@@ -103,45 +116,5 @@ class EntraM365GroupUserListCommand extends GraphCommand {
|
|
|
103
116
|
}
|
|
104
117
|
}
|
|
105
118
|
}
|
|
106
|
-
_EntraM365GroupUserListCommand_instances = new WeakSet(), _EntraM365GroupUserListCommand_initTelemetry = function _EntraM365GroupUserListCommand_initTelemetry() {
|
|
107
|
-
this.telemetry.push((args) => {
|
|
108
|
-
Object.assign(this.telemetryProperties, {
|
|
109
|
-
groupId: typeof args.options.groupId !== 'undefined',
|
|
110
|
-
groupDisplayName: typeof args.options.groupDisplayName !== 'undefined',
|
|
111
|
-
role: typeof args.options.role !== 'undefined',
|
|
112
|
-
properties: typeof args.options.properties !== 'undefined',
|
|
113
|
-
filter: typeof args.options.filter !== 'undefined'
|
|
114
|
-
});
|
|
115
|
-
});
|
|
116
|
-
}, _EntraM365GroupUserListCommand_initOptions = function _EntraM365GroupUserListCommand_initOptions() {
|
|
117
|
-
this.options.unshift({
|
|
118
|
-
option: "-i, --groupId [groupId]"
|
|
119
|
-
}, {
|
|
120
|
-
option: "-n, --groupDisplayName [groupDisplayName]"
|
|
121
|
-
}, {
|
|
122
|
-
option: "-r, --role [type]",
|
|
123
|
-
autocomplete: ["Owner", "Member"]
|
|
124
|
-
}, {
|
|
125
|
-
option: "-p, --properties [properties]"
|
|
126
|
-
}, {
|
|
127
|
-
option: "-f, --filter [filter]"
|
|
128
|
-
});
|
|
129
|
-
}, _EntraM365GroupUserListCommand_initOptionSets = function _EntraM365GroupUserListCommand_initOptionSets() {
|
|
130
|
-
this.optionSets.push({
|
|
131
|
-
options: ['groupId', 'groupDisplayName']
|
|
132
|
-
});
|
|
133
|
-
}, _EntraM365GroupUserListCommand_initValidators = function _EntraM365GroupUserListCommand_initValidators() {
|
|
134
|
-
this.validators.push(async (args) => {
|
|
135
|
-
if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
|
|
136
|
-
return `${args.options.groupId} is not a valid GUID`;
|
|
137
|
-
}
|
|
138
|
-
if (args.options.role) {
|
|
139
|
-
if (['Owner', 'Member'].indexOf(args.options.role) === -1) {
|
|
140
|
-
return `${args.options.role} is not a valid role value. Allowed values Owner|Member`;
|
|
141
|
-
}
|
|
142
|
-
}
|
|
143
|
-
return true;
|
|
144
|
-
});
|
|
145
|
-
};
|
|
146
119
|
export default new EntraM365GroupUserListCommand();
|
|
147
120
|
//# sourceMappingURL=m365group-user-list.js.map
|
|
@@ -1,10 +1,6 @@
|
|
|
1
|
-
|
|
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 _EntraM365GroupUserRemoveCommand_instances, _EntraM365GroupUserRemoveCommand_initTelemetry, _EntraM365GroupUserRemoveCommand_initOptions, _EntraM365GroupUserRemoveCommand_initValidators, _EntraM365GroupUserRemoveCommand_initOptionSets, _EntraM365GroupUserRemoveCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import { cli } from '../../../../cli/cli.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
10
6
|
import { entraUser } from '../../../../utils/entraUser.js';
|
|
@@ -12,6 +8,22 @@ import { formatting } from '../../../../utils/formatting.js';
|
|
|
12
8
|
import { validation } from '../../../../utils/validation.js';
|
|
13
9
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
14
10
|
import commands from '../../commands.js';
|
|
11
|
+
export const options = z.strictObject({
|
|
12
|
+
...globalOptionsZod.shape,
|
|
13
|
+
teamId: z.uuid().optional(),
|
|
14
|
+
teamName: z.string().optional(),
|
|
15
|
+
groupId: z.uuid().optional().alias('i'),
|
|
16
|
+
groupName: z.string().optional(),
|
|
17
|
+
ids: z.string()
|
|
18
|
+
.refine(ids => validation.isValidGuidArray(ids) === true, {
|
|
19
|
+
error: e => `The following GUIDs are invalid for the option 'ids': ${validation.isValidGuidArray(e.input)}.`
|
|
20
|
+
}).optional(),
|
|
21
|
+
userNames: z.string()
|
|
22
|
+
.refine(names => validation.isValidUserPrincipalNameArray(names) === true, {
|
|
23
|
+
error: e => `The following user principal names are invalid for the option 'userNames': ${validation.isValidUserPrincipalNameArray(e.input)}.`
|
|
24
|
+
}).optional(),
|
|
25
|
+
force: z.boolean().optional().alias('f')
|
|
26
|
+
});
|
|
15
27
|
class EntraM365GroupUserRemoveCommand extends GraphCommand {
|
|
16
28
|
get name() {
|
|
17
29
|
return commands.M365GROUP_USER_REMOVE;
|
|
@@ -19,14 +31,25 @@ class EntraM365GroupUserRemoveCommand extends GraphCommand {
|
|
|
19
31
|
get description() {
|
|
20
32
|
return 'Removes the specified user from specified Microsoft 365 Group or Microsoft Teams team';
|
|
21
33
|
}
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
34
|
+
get schema() {
|
|
35
|
+
return options;
|
|
36
|
+
}
|
|
37
|
+
getRefinedSchema(schema) {
|
|
38
|
+
return schema
|
|
39
|
+
.refine(opts => [opts.groupId, opts.teamId, opts.groupName, opts.teamName].filter(o => o !== undefined).length === 1, {
|
|
40
|
+
error: 'Use one of the following options: groupId, teamId, groupName or teamName.',
|
|
41
|
+
params: {
|
|
42
|
+
customCode: 'optionSet',
|
|
43
|
+
options: ['groupId', 'teamId', 'groupName', 'teamName']
|
|
44
|
+
}
|
|
45
|
+
})
|
|
46
|
+
.refine(opts => [opts.ids, opts.userNames].filter(o => o !== undefined).length === 1, {
|
|
47
|
+
error: 'Use one of the following options: ids or userNames.',
|
|
48
|
+
params: {
|
|
49
|
+
customCode: 'optionSet',
|
|
50
|
+
options: ['ids', 'userNames']
|
|
51
|
+
}
|
|
52
|
+
});
|
|
30
53
|
}
|
|
31
54
|
async commandAction(logger, args) {
|
|
32
55
|
const removeUser = async () => {
|
|
@@ -94,65 +117,5 @@ class EntraM365GroupUserRemoveCommand extends GraphCommand {
|
|
|
94
117
|
}
|
|
95
118
|
}
|
|
96
119
|
}
|
|
97
|
-
_EntraM365GroupUserRemoveCommand_instances = new WeakSet(), _EntraM365GroupUserRemoveCommand_initTelemetry = function _EntraM365GroupUserRemoveCommand_initTelemetry() {
|
|
98
|
-
this.telemetry.push((args) => {
|
|
99
|
-
Object.assign(this.telemetryProperties, {
|
|
100
|
-
force: !!args.options.force,
|
|
101
|
-
teamId: typeof args.options.teamId !== 'undefined',
|
|
102
|
-
groupId: typeof args.options.groupId !== 'undefined',
|
|
103
|
-
teamName: typeof args.options.teamName !== 'undefined',
|
|
104
|
-
groupName: typeof args.options.groupName !== 'undefined',
|
|
105
|
-
ids: typeof args.options.ids !== 'undefined',
|
|
106
|
-
userNames: typeof args.options.userNames !== 'undefined'
|
|
107
|
-
});
|
|
108
|
-
});
|
|
109
|
-
}, _EntraM365GroupUserRemoveCommand_initOptions = function _EntraM365GroupUserRemoveCommand_initOptions() {
|
|
110
|
-
this.options.unshift({
|
|
111
|
-
option: '-i, --groupId [groupId]'
|
|
112
|
-
}, {
|
|
113
|
-
option: '--groupName [groupName]'
|
|
114
|
-
}, {
|
|
115
|
-
option: '--teamId [teamId]'
|
|
116
|
-
}, {
|
|
117
|
-
option: '--teamName [teamName]'
|
|
118
|
-
}, {
|
|
119
|
-
option: '--ids [ids]'
|
|
120
|
-
}, {
|
|
121
|
-
option: '--userNames [userNames]'
|
|
122
|
-
}, {
|
|
123
|
-
option: '-f, --force'
|
|
124
|
-
});
|
|
125
|
-
}, _EntraM365GroupUserRemoveCommand_initValidators = function _EntraM365GroupUserRemoveCommand_initValidators() {
|
|
126
|
-
this.validators.push(async (args) => {
|
|
127
|
-
if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
|
|
128
|
-
return `${args.options.teamId} is not a valid GUID for option 'teamId'.`;
|
|
129
|
-
}
|
|
130
|
-
if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
|
|
131
|
-
return `${args.options.groupId} is not a valid GUID for option 'groupId'.`;
|
|
132
|
-
}
|
|
133
|
-
if (args.options.ids) {
|
|
134
|
-
const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.ids);
|
|
135
|
-
if (isValidGUIDArrayResult !== true) {
|
|
136
|
-
return `The following GUIDs are invalid for the option 'ids': ${isValidGUIDArrayResult}.`;
|
|
137
|
-
}
|
|
138
|
-
}
|
|
139
|
-
if (args.options.userNames) {
|
|
140
|
-
const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.userNames);
|
|
141
|
-
if (isValidUPNArrayResult !== true) {
|
|
142
|
-
return `The following user principal names are invalid for the option 'userNames': ${isValidUPNArrayResult}.`;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
return true;
|
|
146
|
-
});
|
|
147
|
-
}, _EntraM365GroupUserRemoveCommand_initOptionSets = function _EntraM365GroupUserRemoveCommand_initOptionSets() {
|
|
148
|
-
this.optionSets.push({
|
|
149
|
-
options: ['groupId', 'teamId', 'groupName', 'teamName']
|
|
150
|
-
}, {
|
|
151
|
-
options: ['ids', 'userNames']
|
|
152
|
-
});
|
|
153
|
-
}, _EntraM365GroupUserRemoveCommand_initTypes = function _EntraM365GroupUserRemoveCommand_initTypes() {
|
|
154
|
-
this.types.string.push('groupId', 'groupName', 'teamId', 'teamName', 'ids', 'userNames');
|
|
155
|
-
this.types.boolean.push('force');
|
|
156
|
-
};
|
|
157
120
|
export default new EntraM365GroupUserRemoveCommand();
|
|
158
121
|
//# sourceMappingURL=m365group-user-remove.js.map
|
|
@@ -1,16 +1,33 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _EntraM365GroupUserSetCommand_instances, _EntraM365GroupUserSetCommand_initTelemetry, _EntraM365GroupUserSetCommand_initOptions, _EntraM365GroupUserSetCommand_initValidators, _EntraM365GroupUserSetCommand_initOptionSets, _EntraM365GroupUserSetCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
|
-
import {
|
|
4
|
+
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
5
|
+
import { entraUser } from '../../../../utils/entraUser.js';
|
|
9
6
|
import { formatting } from '../../../../utils/formatting.js';
|
|
7
|
+
import { validation } from '../../../../utils/validation.js';
|
|
10
8
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
9
|
import commands from '../../commands.js';
|
|
12
|
-
import {
|
|
13
|
-
|
|
10
|
+
import { zod } from '../../../../utils/zod.js';
|
|
11
|
+
const RoleEnum = {
|
|
12
|
+
owner: 'owner',
|
|
13
|
+
member: 'member'
|
|
14
|
+
};
|
|
15
|
+
export const options = z.strictObject({
|
|
16
|
+
...globalOptionsZod.shape,
|
|
17
|
+
ids: z.string()
|
|
18
|
+
.refine(ids => validation.isValidGuidArray(ids) === true, {
|
|
19
|
+
error: e => `The following GUIDs are invalid for the option 'ids': ${validation.isValidGuidArray(e.input)}.`
|
|
20
|
+
}).optional(),
|
|
21
|
+
userNames: z.string()
|
|
22
|
+
.refine(names => validation.isValidUserPrincipalNameArray(names) === true, {
|
|
23
|
+
error: e => `The following user principal names are invalid for the option 'userNames': ${validation.isValidUserPrincipalNameArray(e.input)}.`
|
|
24
|
+
}).optional(),
|
|
25
|
+
groupId: z.uuid().optional().alias('i'),
|
|
26
|
+
groupName: z.string().optional(),
|
|
27
|
+
teamId: z.uuid().optional(),
|
|
28
|
+
teamName: z.string().optional(),
|
|
29
|
+
role: zod.coercedEnum(RoleEnum).alias('r')
|
|
30
|
+
});
|
|
14
31
|
class EntraM365GroupUserSetCommand extends GraphCommand {
|
|
15
32
|
get name() {
|
|
16
33
|
return commands.M365GROUP_USER_SET;
|
|
@@ -18,15 +35,25 @@ class EntraM365GroupUserSetCommand extends GraphCommand {
|
|
|
18
35
|
get description() {
|
|
19
36
|
return 'Updates role of the specified user in the specified Microsoft 365 Group or Microsoft Teams team';
|
|
20
37
|
}
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
38
|
+
get schema() {
|
|
39
|
+
return options;
|
|
40
|
+
}
|
|
41
|
+
getRefinedSchema(schema) {
|
|
42
|
+
return schema
|
|
43
|
+
.refine(opts => [opts.groupId, opts.groupName, opts.teamId, opts.teamName].filter(o => o !== undefined).length === 1, {
|
|
44
|
+
error: 'Use one of the following options: groupId, groupName, teamId or teamName.',
|
|
45
|
+
params: {
|
|
46
|
+
customCode: 'optionSet',
|
|
47
|
+
options: ['groupId', 'groupName', 'teamId', 'teamName']
|
|
48
|
+
}
|
|
49
|
+
})
|
|
50
|
+
.refine(opts => [opts.ids, opts.userNames].filter(o => o !== undefined).length === 1, {
|
|
51
|
+
error: 'Use one of the following options: ids or userNames.',
|
|
52
|
+
params: {
|
|
53
|
+
customCode: 'optionSet',
|
|
54
|
+
options: ['ids', 'userNames']
|
|
55
|
+
}
|
|
56
|
+
});
|
|
30
57
|
}
|
|
31
58
|
async commandAction(logger, args) {
|
|
32
59
|
try {
|
|
@@ -159,64 +186,5 @@ class EntraM365GroupUserSetCommand extends GraphCommand {
|
|
|
159
186
|
return requestOptions;
|
|
160
187
|
}
|
|
161
188
|
}
|
|
162
|
-
_EntraM365GroupUserSetCommand_instances = new WeakSet(), _EntraM365GroupUserSetCommand_initTelemetry = function _EntraM365GroupUserSetCommand_initTelemetry() {
|
|
163
|
-
this.telemetry.push((args) => {
|
|
164
|
-
Object.assign(this.telemetryProperties, {
|
|
165
|
-
teamId: typeof args.options.teamId !== 'undefined',
|
|
166
|
-
teamName: typeof args.options.teamName !== 'undefined',
|
|
167
|
-
groupId: typeof args.options.groupId !== 'undefined',
|
|
168
|
-
groupName: typeof args.options.groupName !== 'undefined',
|
|
169
|
-
ids: typeof args.options.ids !== 'undefined',
|
|
170
|
-
userNames: typeof args.options.userNames !== 'undefined'
|
|
171
|
-
});
|
|
172
|
-
});
|
|
173
|
-
}, _EntraM365GroupUserSetCommand_initOptions = function _EntraM365GroupUserSetCommand_initOptions() {
|
|
174
|
-
this.options.unshift({
|
|
175
|
-
option: '--ids [ids]'
|
|
176
|
-
}, {
|
|
177
|
-
option: '--userNames [userNames]'
|
|
178
|
-
}, {
|
|
179
|
-
option: '-i, --groupId [groupId]'
|
|
180
|
-
}, {
|
|
181
|
-
option: '--groupName [groupName]'
|
|
182
|
-
}, {
|
|
183
|
-
option: '--teamId [teamId]'
|
|
184
|
-
}, {
|
|
185
|
-
option: '--teamName [teamName]'
|
|
186
|
-
}, {
|
|
187
|
-
option: '-r, --role <role>',
|
|
188
|
-
autocomplete: this.allowedRoles
|
|
189
|
-
});
|
|
190
|
-
}, _EntraM365GroupUserSetCommand_initValidators = function _EntraM365GroupUserSetCommand_initValidators() {
|
|
191
|
-
this.validators.push(async (args) => {
|
|
192
|
-
if (args.options.teamId && !validation.isValidGuid(args.options.teamId)) {
|
|
193
|
-
return `'${args.options.teamId}' is not a valid GUID for option 'teamId'.`;
|
|
194
|
-
}
|
|
195
|
-
if (args.options.groupId && !validation.isValidGuid(args.options.groupId)) {
|
|
196
|
-
return `'${args.options.groupId}' is not a valid GUID for option 'groupId'.`;
|
|
197
|
-
}
|
|
198
|
-
if (args.options.ids) {
|
|
199
|
-
const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.ids);
|
|
200
|
-
if (isValidGUIDArrayResult !== true) {
|
|
201
|
-
return `The following GUIDs are invalid for the option 'ids': ${isValidGUIDArrayResult}.`;
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
if (args.options.userNames) {
|
|
205
|
-
const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.userNames);
|
|
206
|
-
if (isValidUPNArrayResult !== true) {
|
|
207
|
-
return `The following user principal names are invalid for the option 'userNames': ${isValidUPNArrayResult}.`;
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
if (args.options.role && !this.allowedRoles.some(role => role.toLowerCase() === args.options.role.toLowerCase())) {
|
|
211
|
-
return `'${args.options.role}' is not a valid role. Allowed values are: ${this.allowedRoles.join(',')}`;
|
|
212
|
-
}
|
|
213
|
-
return true;
|
|
214
|
-
});
|
|
215
|
-
}, _EntraM365GroupUserSetCommand_initOptionSets = function _EntraM365GroupUserSetCommand_initOptionSets() {
|
|
216
|
-
this.optionSets.push({ options: ['groupId', 'groupName', 'teamId', 'teamName'] });
|
|
217
|
-
this.optionSets.push({ options: ['ids', 'userNames'] });
|
|
218
|
-
}, _EntraM365GroupUserSetCommand_initTypes = function _EntraM365GroupUserSetCommand_initTypes() {
|
|
219
|
-
this.types.string.push('ids', 'userNames', 'groupId', 'groupName', 'teamId', 'teamName', 'role');
|
|
220
|
-
};
|
|
221
189
|
export default new EntraM365GroupUserSetCommand();
|
|
222
190
|
//# sourceMappingURL=m365group-user-set.js.map
|