@pnp/cli-microsoft365 11.9.0-beta.93bd508 → 11.9.0-beta.9bd71dd
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/.devcontainer/Dockerfile +2 -2
- package/.devproxy/api-specs/sharepoint.yaml +84 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/m365/entra/commands/approleassignment/approleassignment-add.js +23 -48
- package/dist/m365/entra/commands/approleassignment/approleassignment-list.js +20 -43
- package/dist/m365/entra/commands/approleassignment/approleassignment-remove.js +24 -51
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-add.js +20 -43
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-get.js +20 -43
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-list.js +9 -25
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-remove.js +21 -50
- package/dist/m365/entra/commands/groupsetting/groupsetting-add.js +9 -25
- package/dist/m365/entra/commands/groupsetting/groupsetting-get.js +8 -24
- package/dist/m365/entra/commands/groupsetting/groupsetting-list.js +6 -0
- package/dist/m365/entra/commands/groupsetting/groupsetting-remove.js +9 -33
- package/dist/m365/entra/commands/groupsetting/groupsetting-set.js +8 -24
- package/dist/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-get.js +19 -38
- package/dist/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-list.js +6 -0
- package/dist/m365/entra/commands/pim/pim-role-assignment-add.js +68 -114
- package/dist/m365/entra/commands/pim/pim-role-assignment-eligibility-list.js +28 -55
- package/dist/m365/entra/commands/pim/pim-role-assignment-list.js +30 -57
- package/dist/m365/entra/commands/pim/pim-role-assignment-remove.js +50 -90
- package/dist/m365/entra/commands/pim/pim-role-request-list.js +36 -69
- package/dist/m365/entra/commands/policy/policy-list.js +13 -56
- package/dist/m365/entra/commands/user/user-add.js +39 -118
- package/dist/m365/entra/commands/user/user-get.js +24 -49
- package/dist/m365/entra/commands/user/user-groupmembership-list.js +25 -48
- package/dist/m365/entra/commands/user/user-guest-add.js +14 -39
- package/dist/m365/entra/commands/user/user-hibp.js +12 -34
- package/dist/m365/entra/commands/user/user-license-add.js +23 -42
- package/dist/m365/entra/commands/user/user-license-list.js +21 -42
- package/dist/m365/entra/commands/user/user-license-remove.js +25 -47
- package/dist/m365/entra/commands/user/user-list.js +12 -39
- package/dist/m365/entra/commands/user/user-password-validate.js +8 -15
- package/dist/m365/entra/commands/user/user-recyclebinitem-clear.js +8 -22
- package/dist/m365/entra/commands/user/user-recyclebinitem-remove.js +9 -33
- package/dist/m365/entra/commands/user/user-recyclebinitem-restore.js +8 -24
- package/dist/m365/entra/commands/user/user-registrationdetails-list.js +43 -113
- package/dist/m365/entra/commands/user/user-remove.js +22 -42
- package/dist/m365/entra/commands/user/user-set.js +69 -149
- package/dist/m365/entra/commands/user/user-signin-list.js +22 -51
- package/dist/m365/external/commands/connection/connection-add.js +40 -65
- package/dist/m365/external/commands/connection/connection-doctor.js +14 -30
- package/dist/m365/external/commands/connection/connection-get.js +19 -28
- package/dist/m365/external/commands/connection/connection-remove.js +20 -25
- package/dist/m365/external/commands/connection/connection-schema-add.js +53 -42
- package/dist/m365/external/commands/connection/connection-urltoitemresolver-add.js +12 -23
- package/dist/m365/external/commands/item/item-add.js +37 -60
- package/dist/m365/file/commands/convert/convert-pdf.js +18 -33
- package/dist/m365/file/commands/file-add.js +28 -34
- package/dist/m365/file/commands/file-copy.js +18 -34
- package/dist/m365/file/commands/file-list.js +18 -24
- package/dist/m365/file/commands/file-move.js +22 -35
- package/dist/m365/flow/commands/flow-disable.js +10 -26
- package/dist/m365/flow/commands/flow-enable.js +10 -26
- package/dist/m365/flow/commands/flow-export.js +45 -71
- package/dist/m365/flow/commands/flow-get.js +10 -26
- package/dist/m365/flow/commands/flow-list.js +17 -48
- package/dist/m365/flow/commands/flow-remove.js +11 -38
- package/dist/m365/flow/commands/owner/owner-ensure.js +30 -65
- package/dist/m365/flow/commands/owner/owner-list.js +10 -35
- package/dist/m365/flow/commands/owner/owner-remove.js +30 -61
- package/dist/m365/flow/commands/run/run-cancel.js +11 -37
- package/dist/m365/flow/commands/run/run-get.js +12 -43
- package/dist/m365/flow/commands/run/run-list.js +29 -61
- package/dist/m365/flow/commands/run/run-resubmit.js +11 -37
- package/dist/m365/graph/commands/changelog/changelog-list.js +68 -67
- package/dist/m365/graph/commands/schemaextension/schemaextension-add.js +25 -31
- package/dist/m365/graph/commands/schemaextension/schemaextension-get.js +8 -15
- package/dist/m365/graph/commands/schemaextension/schemaextension-list.js +26 -50
- package/dist/m365/graph/commands/schemaextension/schemaextension-remove.js +9 -24
- package/dist/m365/graph/commands/schemaextension/schemaextension-set.js +32 -53
- package/dist/m365/graph/commands/subscription/subscription-add.js +63 -89
- package/dist/m365/outlook/commands/calendar/calendar-list.js +64 -0
- package/dist/m365/outlook/commands/mail/mail-send.js +55 -84
- package/dist/m365/outlook/commands/message/message-get.js +27 -27
- package/dist/m365/outlook/commands/message/message-list.js +53 -80
- package/dist/m365/outlook/commands/message/message-move.js +43 -40
- package/dist/m365/outlook/commands/message/message-remove.js +17 -45
- package/dist/m365/outlook/commands.js +1 -0
- package/dist/m365/spo/commands/list/list-sensitivitylabel-remove.js +83 -0
- package/dist/m365/spo/commands.js +1 -0
- package/docs/docs/cmd/outlook/calendar/calendar-list.mdx +155 -0
- package/docs/docs/cmd/spo/list/list-sensitivitylabel-remove.mdx +77 -0
- package/npm-shrinkwrap.json +7 -0
- package/package.json +1 -1
|
@@ -1,14 +1,18 @@
|
|
|
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 _EntraUserRemoveCommand_instances, _EntraUserRemoveCommand_initTelemetry, _EntraUserRemoveCommand_initOptions, _EntraUserRemoveCommand_initOptionSets, _EntraUserRemoveCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import commands from '../../commands.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { validation } from '../../../../utils/validation.js';
|
|
10
6
|
import { cli } from '../../../../cli/cli.js';
|
|
11
7
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
id: z.uuid().optional(),
|
|
11
|
+
userName: z.string().refine(name => validation.isValidUserPrincipalName(name), {
|
|
12
|
+
error: e => `'${e.input}' is not a valid user principal name (UPN).`
|
|
13
|
+
}).optional(),
|
|
14
|
+
force: z.boolean().optional().alias('f')
|
|
15
|
+
});
|
|
12
16
|
class EntraUserRemoveCommand extends GraphCommand {
|
|
13
17
|
get name() {
|
|
14
18
|
return commands.USER_REMOVE;
|
|
@@ -16,13 +20,18 @@ class EntraUserRemoveCommand extends GraphCommand {
|
|
|
16
20
|
get description() {
|
|
17
21
|
return 'Removes a specific user';
|
|
18
22
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
23
|
+
get schema() {
|
|
24
|
+
return options;
|
|
25
|
+
}
|
|
26
|
+
getRefinedSchema(schema) {
|
|
27
|
+
return schema
|
|
28
|
+
.refine(options => [options.id, options.userName].filter(o => o !== undefined).length === 1, {
|
|
29
|
+
error: `Specify either 'id' or 'userName'.`,
|
|
30
|
+
params: {
|
|
31
|
+
customCode: 'optionSet',
|
|
32
|
+
options: ['id', 'userName']
|
|
33
|
+
}
|
|
34
|
+
});
|
|
26
35
|
}
|
|
27
36
|
async commandAction(logger, args) {
|
|
28
37
|
if (this.verbose) {
|
|
@@ -54,34 +63,5 @@ class EntraUserRemoveCommand extends GraphCommand {
|
|
|
54
63
|
}
|
|
55
64
|
}
|
|
56
65
|
}
|
|
57
|
-
_EntraUserRemoveCommand_instances = new WeakSet(), _EntraUserRemoveCommand_initTelemetry = function _EntraUserRemoveCommand_initTelemetry() {
|
|
58
|
-
this.telemetry.push((args) => {
|
|
59
|
-
Object.assign(this.telemetryProperties, {
|
|
60
|
-
id: typeof args.options.id !== 'undefined',
|
|
61
|
-
userName: typeof args.options.userName !== 'undefined',
|
|
62
|
-
force: !!args.options.force
|
|
63
|
-
});
|
|
64
|
-
});
|
|
65
|
-
}, _EntraUserRemoveCommand_initOptions = function _EntraUserRemoveCommand_initOptions() {
|
|
66
|
-
this.options.unshift({
|
|
67
|
-
option: '--id [id]'
|
|
68
|
-
}, {
|
|
69
|
-
option: '--userName [userName]'
|
|
70
|
-
}, {
|
|
71
|
-
option: '-f, --force'
|
|
72
|
-
});
|
|
73
|
-
}, _EntraUserRemoveCommand_initOptionSets = function _EntraUserRemoveCommand_initOptionSets() {
|
|
74
|
-
this.optionSets.push({ options: ['id', 'userName'] });
|
|
75
|
-
}, _EntraUserRemoveCommand_initValidators = function _EntraUserRemoveCommand_initValidators() {
|
|
76
|
-
this.validators.push(async (args) => {
|
|
77
|
-
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
78
|
-
return `${args.options.id} is not a valid GUID`;
|
|
79
|
-
}
|
|
80
|
-
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
81
|
-
return `${args.options.userName} is not a valid user principal name (UPN)`;
|
|
82
|
-
}
|
|
83
|
-
return true;
|
|
84
|
-
});
|
|
85
|
-
};
|
|
86
66
|
export default new EntraUserRemoveCommand();
|
|
87
67
|
//# sourceMappingURL=user-remove.js.map
|
|
@@ -1,16 +1,39 @@
|
|
|
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 _EntraUserSetCommand_instances, _EntraUserSetCommand_initTelemetry, _EntraUserSetCommand_initOptions, _EntraUserSetCommand_initTypes, _EntraUserSetCommand_initValidators, _EntraUserSetCommand_initOptionSets;
|
|
1
|
+
import { z } from 'zod';
|
|
7
2
|
import auth from '../../../../Auth.js';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import { accessToken } from '../../../../utils/accessToken.js';
|
|
10
6
|
import { formatting } from '../../../../utils/formatting.js';
|
|
11
7
|
import { validation } from '../../../../utils/validation.js';
|
|
12
8
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
13
9
|
import commands from '../../commands.js';
|
|
10
|
+
export const options = z.looseObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
id: z.uuid().optional().alias('i'),
|
|
13
|
+
userName: z.string().refine(name => validation.isValidUserPrincipalName(name), {
|
|
14
|
+
error: e => `'${e.input}' is not a valid userName.`
|
|
15
|
+
}).optional().alias('n'),
|
|
16
|
+
accountEnabled: z.boolean().optional(),
|
|
17
|
+
resetPassword: z.boolean().optional(),
|
|
18
|
+
forceChangePasswordNextSignIn: z.boolean().optional(),
|
|
19
|
+
forceChangePasswordNextSignInWithMfa: z.boolean().optional(),
|
|
20
|
+
currentPassword: z.string().optional(),
|
|
21
|
+
newPassword: z.string().optional(),
|
|
22
|
+
displayName: z.string().optional(),
|
|
23
|
+
firstName: z.string().max(64, { error: `The max length for the firstName option is 64 characters.` }).optional(),
|
|
24
|
+
lastName: z.string().max(64, { error: `The max length for the lastName option is 64 characters.` }).optional(),
|
|
25
|
+
usageLocation: z.string().regex(/^[a-zA-Z]{2}$/, { error: e => `'${e.input}' is not a valid usageLocation.` }).optional(),
|
|
26
|
+
officeLocation: z.string().optional(),
|
|
27
|
+
jobTitle: z.string().max(128, { error: `The max length for the jobTitle option is 128 characters.` }).optional(),
|
|
28
|
+
companyName: z.string().max(64, { error: `The max length for the companyName option is 64 characters.` }).optional(),
|
|
29
|
+
department: z.string().max(64, { error: `The max length for the department option is 64 characters.` }).optional(),
|
|
30
|
+
preferredLanguage: z.string().min(2, { error: e => `'${e.input}' is not a valid preferredLanguage.` }).optional(),
|
|
31
|
+
managerUserId: z.uuid().optional(),
|
|
32
|
+
managerUserName: z.string().refine(name => validation.isValidUserPrincipalName(name), {
|
|
33
|
+
error: e => `'${e.input}' is not a valid user principal name.`
|
|
34
|
+
}).optional(),
|
|
35
|
+
removeManager: z.boolean().optional()
|
|
36
|
+
});
|
|
14
37
|
class EntraUserSetCommand extends GraphCommand {
|
|
15
38
|
get name() {
|
|
16
39
|
return commands.USER_SET;
|
|
@@ -21,14 +44,45 @@ class EntraUserSetCommand extends GraphCommand {
|
|
|
21
44
|
allowUnknownOptions() {
|
|
22
45
|
return true;
|
|
23
46
|
}
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
47
|
+
get schema() {
|
|
48
|
+
return options;
|
|
49
|
+
}
|
|
50
|
+
getRefinedSchema(schema) {
|
|
51
|
+
return schema
|
|
52
|
+
.refine(options => [options.id, options.userName].filter(o => o !== undefined).length === 1, {
|
|
53
|
+
error: `Specify either 'id' or 'userName'.`,
|
|
54
|
+
params: {
|
|
55
|
+
customCode: 'optionSet',
|
|
56
|
+
options: ['id', 'userName']
|
|
57
|
+
}
|
|
58
|
+
})
|
|
59
|
+
.refine(options => {
|
|
60
|
+
if (!options.managerUserId && !options.managerUserName && !options.removeManager) {
|
|
61
|
+
return true;
|
|
62
|
+
}
|
|
63
|
+
return [options.managerUserId, options.managerUserName, options.removeManager].filter(o => o !== undefined).length === 1;
|
|
64
|
+
}, {
|
|
65
|
+
error: `Specify either 'managerUserId', 'managerUserName', or 'removeManager'.`,
|
|
66
|
+
params: {
|
|
67
|
+
customCode: 'optionSet',
|
|
68
|
+
options: ['managerUserId', 'managerUserName', 'removeManager']
|
|
69
|
+
}
|
|
70
|
+
})
|
|
71
|
+
.refine(options => !(!options.resetPassword && ((options.currentPassword && !options.newPassword) || (options.newPassword && !options.currentPassword))), {
|
|
72
|
+
error: `Specify both currentPassword and newPassword when you want to change your password.`
|
|
73
|
+
})
|
|
74
|
+
.refine(options => !(options.resetPassword && options.currentPassword), {
|
|
75
|
+
error: `When resetting a user's password, don't specify the current password.`
|
|
76
|
+
})
|
|
77
|
+
.refine(options => !(options.resetPassword && !options.newPassword), {
|
|
78
|
+
error: `When resetting a user's password, specify the new password to set for the user, using the newPassword option.`
|
|
79
|
+
})
|
|
80
|
+
.refine(options => !(options.forceChangePasswordNextSignIn && !options.resetPassword), {
|
|
81
|
+
error: `The option forceChangePasswordNextSignIn can only be used in combination with the resetPassword option.`
|
|
82
|
+
})
|
|
83
|
+
.refine(options => !(options.forceChangePasswordNextSignInWithMfa && !options.resetPassword), {
|
|
84
|
+
error: `The option forceChangePasswordNextSignInWithMfa can only be used in combination with the resetPassword option.`
|
|
85
|
+
});
|
|
32
86
|
}
|
|
33
87
|
async commandAction(logger, args) {
|
|
34
88
|
try {
|
|
@@ -93,7 +147,7 @@ class EntraUserSetCommand extends GraphCommand {
|
|
|
93
147
|
preferredLanguage: options.preferredLanguage,
|
|
94
148
|
accountEnabled: options.accountEnabled
|
|
95
149
|
};
|
|
96
|
-
this.
|
|
150
|
+
this.addUnknownOptionsToPayloadZod(requestBody, options);
|
|
97
151
|
if (options.resetPassword) {
|
|
98
152
|
requestBody.passwordProfile = {
|
|
99
153
|
forceChangePasswordNextSignIn: options.forceChangePasswordNextSignIn || false,
|
|
@@ -149,139 +203,5 @@ class EntraUserSetCommand extends GraphCommand {
|
|
|
149
203
|
await request.delete(managerRequestOptions);
|
|
150
204
|
}
|
|
151
205
|
}
|
|
152
|
-
_EntraUserSetCommand_instances = new WeakSet(), _EntraUserSetCommand_initTelemetry = function _EntraUserSetCommand_initTelemetry() {
|
|
153
|
-
this.telemetry.push((args) => {
|
|
154
|
-
Object.assign(this.telemetryProperties, {
|
|
155
|
-
id: typeof args.options.id !== 'undefined',
|
|
156
|
-
userName: typeof args.options.userName !== 'undefined',
|
|
157
|
-
accountEnabled: !!args.options.accountEnabled,
|
|
158
|
-
resetPassword: !!args.options.resetPassword,
|
|
159
|
-
forceChangePasswordNextSignIn: !!args.options.forceChangePasswordNextSignIn,
|
|
160
|
-
currentPassword: typeof args.options.currentPassword !== 'undefined',
|
|
161
|
-
newPassword: typeof args.options.newPassword !== 'undefined',
|
|
162
|
-
displayName: typeof args.options.displayName !== 'undefined',
|
|
163
|
-
firstName: typeof args.options.firstName !== 'undefined',
|
|
164
|
-
lastName: typeof args.options.lastName !== 'undefined',
|
|
165
|
-
forceChangePasswordNextSignInWithMfa: !!args.options.forceChangePasswordNextSignInWithMfa,
|
|
166
|
-
usageLocation: typeof args.options.usageLocation !== 'undefined',
|
|
167
|
-
officeLocation: typeof args.options.officeLocation !== 'undefined',
|
|
168
|
-
jobTitle: typeof args.options.jobTitle !== 'undefined',
|
|
169
|
-
companyName: typeof args.options.companyName !== 'undefined',
|
|
170
|
-
department: typeof args.options.department !== 'undefined',
|
|
171
|
-
preferredLanguage: typeof args.options.preferredLanguage !== 'undefined',
|
|
172
|
-
managerUserId: typeof args.options.managerUserId !== 'undefined',
|
|
173
|
-
managerUserName: typeof args.options.managerUserName !== 'undefined',
|
|
174
|
-
removeManager: typeof args.options.removeManager !== 'undefined'
|
|
175
|
-
});
|
|
176
|
-
});
|
|
177
|
-
}, _EntraUserSetCommand_initOptions = function _EntraUserSetCommand_initOptions() {
|
|
178
|
-
this.options.unshift({
|
|
179
|
-
option: '-i, --id [id]'
|
|
180
|
-
}, {
|
|
181
|
-
option: '-n, --userName [userName]'
|
|
182
|
-
}, {
|
|
183
|
-
option: '--accountEnabled [accountEnabled]',
|
|
184
|
-
autocomplete: ['true', 'false']
|
|
185
|
-
}, {
|
|
186
|
-
option: '--resetPassword'
|
|
187
|
-
}, {
|
|
188
|
-
option: '--forceChangePasswordNextSignIn'
|
|
189
|
-
}, {
|
|
190
|
-
option: '--currentPassword [currentPassword]'
|
|
191
|
-
}, {
|
|
192
|
-
option: '--newPassword [newPassword]'
|
|
193
|
-
}, {
|
|
194
|
-
option: '--displayName [displayName]'
|
|
195
|
-
}, {
|
|
196
|
-
option: '--firstName [firstName]'
|
|
197
|
-
}, {
|
|
198
|
-
option: '--lastName [lastName]'
|
|
199
|
-
}, {
|
|
200
|
-
option: '--forceChangePasswordNextSignInWithMfa'
|
|
201
|
-
}, {
|
|
202
|
-
option: '--usageLocation [usageLocation]'
|
|
203
|
-
}, {
|
|
204
|
-
option: '--officeLocation [officeLocation]'
|
|
205
|
-
}, {
|
|
206
|
-
option: '--jobTitle [jobTitle]'
|
|
207
|
-
}, {
|
|
208
|
-
option: '--companyName [companyName]'
|
|
209
|
-
}, {
|
|
210
|
-
option: '--department [department]'
|
|
211
|
-
}, {
|
|
212
|
-
option: '--preferredLanguage [preferredLanguage]'
|
|
213
|
-
}, {
|
|
214
|
-
option: '--managerUserId [managerUserId]'
|
|
215
|
-
}, {
|
|
216
|
-
option: '--managerUserName [managerUserName]'
|
|
217
|
-
}, {
|
|
218
|
-
option: '--removeManager'
|
|
219
|
-
});
|
|
220
|
-
}, _EntraUserSetCommand_initTypes = function _EntraUserSetCommand_initTypes() {
|
|
221
|
-
this.types.boolean.push('accountEnabled');
|
|
222
|
-
}, _EntraUserSetCommand_initValidators = function _EntraUserSetCommand_initValidators() {
|
|
223
|
-
this.validators.push(async (args) => {
|
|
224
|
-
if (args.options.id &&
|
|
225
|
-
!validation.isValidGuid(args.options.id)) {
|
|
226
|
-
return `${args.options.id} is not a valid GUID`;
|
|
227
|
-
}
|
|
228
|
-
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
229
|
-
return `${args.options.userName} is not a valid userName`;
|
|
230
|
-
}
|
|
231
|
-
if (!args.options.resetPassword && ((args.options.currentPassword && !args.options.newPassword) || (args.options.newPassword && !args.options.currentPassword))) {
|
|
232
|
-
return `Specify both currentPassword and newPassword when you want to change your password`;
|
|
233
|
-
}
|
|
234
|
-
if (args.options.resetPassword && args.options.currentPassword) {
|
|
235
|
-
return `When resetting a user's password, don't specify the current password`;
|
|
236
|
-
}
|
|
237
|
-
if (args.options.resetPassword && !args.options.newPassword) {
|
|
238
|
-
return `When resetting a user's password, specify the new password to set for the user, using the newPassword option`;
|
|
239
|
-
}
|
|
240
|
-
if (args.options.firstName && args.options.firstName.length > 64) {
|
|
241
|
-
return `The max lenght for the firstName option is 64 characters`;
|
|
242
|
-
}
|
|
243
|
-
if (args.options.lastName && args.options.lastName.length > 64) {
|
|
244
|
-
return `The max lenght for the lastName option is 64 characters`;
|
|
245
|
-
}
|
|
246
|
-
if (args.options.forceChangePasswordNextSignIn && !args.options.resetPassword) {
|
|
247
|
-
return `The option forceChangePasswordNextSignIn can only be used in combination with the resetPassword option`;
|
|
248
|
-
}
|
|
249
|
-
if (args.options.forceChangePasswordNextSignInWithMfa && !args.options.resetPassword) {
|
|
250
|
-
return `The option forceChangePasswordNextSignInWithMfa can only be used in combination with the resetPassword option`;
|
|
251
|
-
}
|
|
252
|
-
if (args.options.usageLocation) {
|
|
253
|
-
const regex = new RegExp('^[a-zA-Z]{2}$');
|
|
254
|
-
if (!regex.test(args.options.usageLocation)) {
|
|
255
|
-
return `'${args.options.usageLocation}' is not a valid usageLocation.`;
|
|
256
|
-
}
|
|
257
|
-
}
|
|
258
|
-
if (args.options.jobTitle && args.options.jobTitle.length > 128) {
|
|
259
|
-
return `The max lenght for the jobTitle option is 128 characters`;
|
|
260
|
-
}
|
|
261
|
-
if (args.options.companyName && args.options.companyName.length > 64) {
|
|
262
|
-
return `The max lenght for the companyName option is 64 characters`;
|
|
263
|
-
}
|
|
264
|
-
if (args.options.department && args.options.department.length > 64) {
|
|
265
|
-
return `The max lenght for the department option is 64 characters`;
|
|
266
|
-
}
|
|
267
|
-
if (args.options.preferredLanguage && args.options.preferredLanguage.length < 2) {
|
|
268
|
-
return `'${args.options.preferredLanguage}' is not a valid preferredLanguage`;
|
|
269
|
-
}
|
|
270
|
-
if (args.options.managerUserName && !validation.isValidUserPrincipalName(args.options.managerUserName)) {
|
|
271
|
-
return `'${args.options.managerUserName}' is not a valid user principal name`;
|
|
272
|
-
}
|
|
273
|
-
if (args.options.managerUserId && !validation.isValidGuid(args.options.managerUserId)) {
|
|
274
|
-
return `'${args.options.managerUserId}' is not a valid GUID`;
|
|
275
|
-
}
|
|
276
|
-
return true;
|
|
277
|
-
});
|
|
278
|
-
}, _EntraUserSetCommand_initOptionSets = function _EntraUserSetCommand_initOptionSets() {
|
|
279
|
-
this.optionSets.push({
|
|
280
|
-
options: ['id', 'userName']
|
|
281
|
-
}, {
|
|
282
|
-
options: ['managerUserId', 'managerUserName', 'removeManager'],
|
|
283
|
-
runsWhen: (args) => args.options.managerUserId || args.options.managerUserName || args.options.removeManager
|
|
284
|
-
});
|
|
285
|
-
};
|
|
286
206
|
export default new EntraUserSetCommand();
|
|
287
207
|
//# sourceMappingURL=user-set.js.map
|
|
@@ -1,14 +1,19 @@
|
|
|
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 _EntraUserSigninListCommand_instances, _EntraUserSigninListCommand_initTelemetry, _EntraUserSigninListCommand_initOptions, _EntraUserSigninListCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { formatting } from '../../../../utils/formatting.js';
|
|
8
4
|
import { odata } from '../../../../utils/odata.js';
|
|
9
5
|
import { validation } from '../../../../utils/validation.js';
|
|
10
6
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
7
|
import commands from '../../commands.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
userName: z.string().refine(name => validation.isValidUserPrincipalName(name), {
|
|
11
|
+
error: e => `'${e.input}' is not a valid userName.`
|
|
12
|
+
}).optional().alias('n'),
|
|
13
|
+
userId: z.uuid().optional(),
|
|
14
|
+
appDisplayName: z.string().optional(),
|
|
15
|
+
appId: z.uuid().optional()
|
|
16
|
+
});
|
|
12
17
|
class EntraUserSigninListCommand extends GraphCommand {
|
|
13
18
|
get name() {
|
|
14
19
|
return commands.USER_SIGNIN_LIST;
|
|
@@ -16,12 +21,17 @@ class EntraUserSigninListCommand extends GraphCommand {
|
|
|
16
21
|
get description() {
|
|
17
22
|
return 'Retrieves the Entra ID user sign-ins for the tenant';
|
|
18
23
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
get schema() {
|
|
25
|
+
return options;
|
|
26
|
+
}
|
|
27
|
+
getRefinedSchema(schema) {
|
|
28
|
+
return schema
|
|
29
|
+
.refine(options => !(options.userId && options.userName), {
|
|
30
|
+
error: `Specify either 'userId' or 'userName', but not both.`
|
|
31
|
+
})
|
|
32
|
+
.refine(options => !(options.appId && options.appDisplayName), {
|
|
33
|
+
error: `Specify either 'appId' or 'appDisplayName', but not both.`
|
|
34
|
+
});
|
|
25
35
|
}
|
|
26
36
|
defaultProperties() {
|
|
27
37
|
return ['id', 'userPrincipalName', 'appId', 'appDisplayName', 'createdDateTime'];
|
|
@@ -50,44 +60,5 @@ class EntraUserSigninListCommand extends GraphCommand {
|
|
|
50
60
|
}
|
|
51
61
|
}
|
|
52
62
|
}
|
|
53
|
-
_EntraUserSigninListCommand_instances = new WeakSet(), _EntraUserSigninListCommand_initTelemetry = function _EntraUserSigninListCommand_initTelemetry() {
|
|
54
|
-
this.telemetry.push((args) => {
|
|
55
|
-
Object.assign(this.telemetryProperties, {
|
|
56
|
-
userName: typeof args.options.userName !== 'undefined',
|
|
57
|
-
userId: typeof args.options.userId !== 'undefined',
|
|
58
|
-
appDisplayName: typeof args.options.appDisplayName !== 'undefined',
|
|
59
|
-
appId: typeof args.options.appId !== 'undefined'
|
|
60
|
-
});
|
|
61
|
-
});
|
|
62
|
-
}, _EntraUserSigninListCommand_initOptions = function _EntraUserSigninListCommand_initOptions() {
|
|
63
|
-
this.options.unshift({
|
|
64
|
-
option: '-n, --userName [userName]'
|
|
65
|
-
}, {
|
|
66
|
-
option: '--userId [userId]'
|
|
67
|
-
}, {
|
|
68
|
-
option: '--appDisplayName [appDisplayName]'
|
|
69
|
-
}, {
|
|
70
|
-
option: '--appId [appId]'
|
|
71
|
-
});
|
|
72
|
-
}, _EntraUserSigninListCommand_initValidators = function _EntraUserSigninListCommand_initValidators() {
|
|
73
|
-
this.validators.push(async (args) => {
|
|
74
|
-
if (args.options.userId && args.options.userName) {
|
|
75
|
-
return 'Specify either userId or userName, but not both';
|
|
76
|
-
}
|
|
77
|
-
if (args.options.appId && args.options.appDisplayName) {
|
|
78
|
-
return 'Specify either appId or appDisplayName, but not both';
|
|
79
|
-
}
|
|
80
|
-
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
81
|
-
return `${args.options.userName} is not a valid userName`;
|
|
82
|
-
}
|
|
83
|
-
if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
|
|
84
|
-
return `${args.options.userId} is not a valid GUID`;
|
|
85
|
-
}
|
|
86
|
-
if (args.options.appId && !validation.isValidGuid(args.options.appId)) {
|
|
87
|
-
return `${args.options.appId} is not a valid GUID`;
|
|
88
|
-
}
|
|
89
|
-
return true;
|
|
90
|
-
});
|
|
91
|
-
};
|
|
92
63
|
export default new EntraUserSigninListCommand();
|
|
93
64
|
//# sourceMappingURL=user-signin-list.js.map
|
|
@@ -1,12 +1,44 @@
|
|
|
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 _ExternalConnectionAddCommand_instances, _ExternalConnectionAddCommand_initTelemetry, _ExternalConnectionAddCommand_initOptions, _ExternalConnectionAddCommand_initValidators;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import request from '../../../../request.js';
|
|
8
4
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
9
5
|
import commands from '../../commands.js';
|
|
6
|
+
const invalidIds = ['None',
|
|
7
|
+
'Directory',
|
|
8
|
+
'Exchange',
|
|
9
|
+
'ExchangeArchive',
|
|
10
|
+
'LinkedIn',
|
|
11
|
+
'Mailbox',
|
|
12
|
+
'OneDriveBusiness',
|
|
13
|
+
'SharePoint',
|
|
14
|
+
'Teams',
|
|
15
|
+
'Yammer',
|
|
16
|
+
'Connectors',
|
|
17
|
+
'TaskFabric',
|
|
18
|
+
'PowerBI',
|
|
19
|
+
'Assistant',
|
|
20
|
+
'TopicEngine',
|
|
21
|
+
'MSFT_All_Connectors'
|
|
22
|
+
];
|
|
23
|
+
export const options = z.strictObject({
|
|
24
|
+
...globalOptionsZod.shape,
|
|
25
|
+
id: z.string()
|
|
26
|
+
.min(3, 'ID must be between 3 and 32 characters in length.')
|
|
27
|
+
.max(32, 'ID must be between 3 and 32 characters in length.')
|
|
28
|
+
.refine(id => !/[^\w]|_/g.test(id), {
|
|
29
|
+
message: 'ID must only contain alphanumeric characters.'
|
|
30
|
+
})
|
|
31
|
+
.refine(id => !(id.length > 9 && id.startsWith('Microsoft')), {
|
|
32
|
+
message: 'ID cannot begin with Microsoft'
|
|
33
|
+
})
|
|
34
|
+
.refine(id => !invalidIds.includes(id), {
|
|
35
|
+
message: `ID cannot be one of the following values: ${invalidIds.join(', ')}.`
|
|
36
|
+
})
|
|
37
|
+
.alias('i'),
|
|
38
|
+
name: z.string().alias('n'),
|
|
39
|
+
description: z.string().alias('d'),
|
|
40
|
+
authorizedAppIds: z.string().optional()
|
|
41
|
+
});
|
|
10
42
|
class ExternalConnectionAddCommand extends GraphCommand {
|
|
11
43
|
get name() {
|
|
12
44
|
return commands.CONNECTION_ADD;
|
|
@@ -17,12 +49,8 @@ class ExternalConnectionAddCommand extends GraphCommand {
|
|
|
17
49
|
alias() {
|
|
18
50
|
return [commands.EXTERNALCONNECTION_ADD];
|
|
19
51
|
}
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
_ExternalConnectionAddCommand_instances.add(this);
|
|
23
|
-
__classPrivateFieldGet(this, _ExternalConnectionAddCommand_instances, "m", _ExternalConnectionAddCommand_initTelemetry).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _ExternalConnectionAddCommand_instances, "m", _ExternalConnectionAddCommand_initOptions).call(this);
|
|
25
|
-
__classPrivateFieldGet(this, _ExternalConnectionAddCommand_instances, "m", _ExternalConnectionAddCommand_initValidators).call(this);
|
|
52
|
+
get schema() {
|
|
53
|
+
return options;
|
|
26
54
|
}
|
|
27
55
|
async commandAction(logger, args) {
|
|
28
56
|
let appIds = [];
|
|
@@ -54,58 +82,5 @@ class ExternalConnectionAddCommand extends GraphCommand {
|
|
|
54
82
|
}
|
|
55
83
|
}
|
|
56
84
|
}
|
|
57
|
-
_ExternalConnectionAddCommand_instances = new WeakSet(), _ExternalConnectionAddCommand_initTelemetry = function _ExternalConnectionAddCommand_initTelemetry() {
|
|
58
|
-
this.telemetry.push((args) => {
|
|
59
|
-
Object.assign(this.telemetryProperties, {
|
|
60
|
-
authorizedAppIds: typeof args.options.authorizedAppIds !== 'undefined'
|
|
61
|
-
});
|
|
62
|
-
});
|
|
63
|
-
}, _ExternalConnectionAddCommand_initOptions = function _ExternalConnectionAddCommand_initOptions() {
|
|
64
|
-
this.options.unshift({
|
|
65
|
-
option: '-i, --id <id>'
|
|
66
|
-
}, {
|
|
67
|
-
option: '-n, --name <name>'
|
|
68
|
-
}, {
|
|
69
|
-
option: '-d, --description <description>'
|
|
70
|
-
}, {
|
|
71
|
-
option: '--authorizedAppIds [authorizedAppIds]'
|
|
72
|
-
});
|
|
73
|
-
}, _ExternalConnectionAddCommand_initValidators = function _ExternalConnectionAddCommand_initValidators() {
|
|
74
|
-
this.validators.push(async (args) => {
|
|
75
|
-
const id = args.options.id;
|
|
76
|
-
if (id.length < 3 || id.length > 32) {
|
|
77
|
-
return 'ID must be between 3 and 32 characters in length.';
|
|
78
|
-
}
|
|
79
|
-
const alphaNumericRegEx = /[^\w]|_/g;
|
|
80
|
-
if (alphaNumericRegEx.test(id)) {
|
|
81
|
-
return 'ID must only contain alphanumeric characters.';
|
|
82
|
-
}
|
|
83
|
-
if (id.length > 9 &&
|
|
84
|
-
id.startsWith('Microsoft')) {
|
|
85
|
-
return 'ID cannot begin with Microsoft';
|
|
86
|
-
}
|
|
87
|
-
const invalidIds = ['None',
|
|
88
|
-
'Directory',
|
|
89
|
-
'Exchange',
|
|
90
|
-
'ExchangeArchive',
|
|
91
|
-
'LinkedIn',
|
|
92
|
-
'Mailbox',
|
|
93
|
-
'OneDriveBusiness',
|
|
94
|
-
'SharePoint',
|
|
95
|
-
'Teams',
|
|
96
|
-
'Yammer',
|
|
97
|
-
'Connectors',
|
|
98
|
-
'TaskFabric',
|
|
99
|
-
'PowerBI',
|
|
100
|
-
'Assistant',
|
|
101
|
-
'TopicEngine',
|
|
102
|
-
'MSFT_All_Connectors'
|
|
103
|
-
];
|
|
104
|
-
if (invalidIds.indexOf(id) > -1) {
|
|
105
|
-
return `ID cannot be one of the following values: ${invalidIds.join(', ')}.`;
|
|
106
|
-
}
|
|
107
|
-
return true;
|
|
108
|
-
});
|
|
109
|
-
};
|
|
110
85
|
export default new ExternalConnectionAddCommand();
|
|
111
86
|
//# sourceMappingURL=connection-add.js.map
|
|
@@ -1,27 +1,29 @@
|
|
|
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 _ExternalConnectionDoctorCommand_instances, _a, _ExternalConnectionDoctorCommand_initOptions, _ExternalConnectionDoctorCommand_initValidators;
|
|
7
1
|
import os from 'os';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
8
4
|
import request from '../../../../request.js';
|
|
9
5
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
10
6
|
import commands from '../../commands.js';
|
|
11
7
|
import { CheckStatus, formatting } from '../../../../utils/formatting.js';
|
|
8
|
+
const supportedUx = ['copilot', 'search', 'all'];
|
|
9
|
+
export const options = z.strictObject({
|
|
10
|
+
...globalOptionsZod.shape,
|
|
11
|
+
id: z.string().alias('i'),
|
|
12
|
+
ux: z.enum(supportedUx).optional()
|
|
13
|
+
});
|
|
12
14
|
class ExternalConnectionDoctorCommand extends GraphCommand {
|
|
15
|
+
constructor() {
|
|
16
|
+
super(...arguments);
|
|
17
|
+
this.checksStatus = [];
|
|
18
|
+
}
|
|
13
19
|
get name() {
|
|
14
20
|
return commands.CONNECTION_DOCTOR;
|
|
15
21
|
}
|
|
16
22
|
get description() {
|
|
17
23
|
return 'Checks if the external connection is correctly configured for use with the specified Microsoft 365 experience';
|
|
18
24
|
}
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
_ExternalConnectionDoctorCommand_instances.add(this);
|
|
22
|
-
this.checksStatus = [];
|
|
23
|
-
__classPrivateFieldGet(this, _ExternalConnectionDoctorCommand_instances, "m", _ExternalConnectionDoctorCommand_initOptions).call(this);
|
|
24
|
-
__classPrivateFieldGet(this, _ExternalConnectionDoctorCommand_instances, "m", _ExternalConnectionDoctorCommand_initValidators).call(this);
|
|
25
|
+
get schema() {
|
|
26
|
+
return options;
|
|
25
27
|
}
|
|
26
28
|
async commandAction(logger, args) {
|
|
27
29
|
const ux = args.options.ux ?? 'all';
|
|
@@ -388,23 +390,5 @@ class ExternalConnectionDoctorCommand extends GraphCommand {
|
|
|
388
390
|
};
|
|
389
391
|
}
|
|
390
392
|
}
|
|
391
|
-
_a = ExternalConnectionDoctorCommand, _ExternalConnectionDoctorCommand_instances = new WeakSet(), _ExternalConnectionDoctorCommand_initOptions = function _ExternalConnectionDoctorCommand_initOptions() {
|
|
392
|
-
this.options.unshift({
|
|
393
|
-
option: '-i, --id <id>'
|
|
394
|
-
}, {
|
|
395
|
-
option: '--ux [ux]',
|
|
396
|
-
autocomplete: _a.supportedUx
|
|
397
|
-
});
|
|
398
|
-
}, _ExternalConnectionDoctorCommand_initValidators = function _ExternalConnectionDoctorCommand_initValidators() {
|
|
399
|
-
this.validators.push(async (args) => {
|
|
400
|
-
if (args.options.ux) {
|
|
401
|
-
if (!_a.supportedUx.find(u => u === args.options.ux)) {
|
|
402
|
-
return `${args.options.ux} is not a valid UX. Allowed values are ${_a.supportedUx.join(', ')}`;
|
|
403
|
-
}
|
|
404
|
-
}
|
|
405
|
-
return true;
|
|
406
|
-
});
|
|
407
|
-
};
|
|
408
|
-
ExternalConnectionDoctorCommand.supportedUx = ['copilot', 'search', 'all'];
|
|
409
393
|
export default new ExternalConnectionDoctorCommand();
|
|
410
394
|
//# sourceMappingURL=connection-doctor.js.map
|