@pnp/cli-microsoft365 12.0.0-beta.d654135 → 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/.devproxy/generate-openapi-spec.json +1 -1
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +19 -2
- package/dist/cli/cli.js +3 -0
- package/dist/googleAnalytics.js +96 -0
- package/dist/m365/cli/commands/cli-consent.js +9 -2
- 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/spfx/commands/SpfxCompatibilityMatrix.js +15 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.0.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012021_TSC_excludeDirectories.js +43 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027002_OVERRIDES_qs.js +33 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027003_OVERRIDES_uuid.js +33 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.24.0.js +77 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +2 -1
- package/dist/m365/spo/commands/app/app-add.js +35 -56
- package/dist/m365/spo/commands/app/app-deploy.js +41 -59
- package/dist/m365/spo/commands/app/app-get.js +40 -56
- package/dist/m365/spo/commands/app/app-install.js +20 -41
- package/dist/m365/spo/commands/app/app-instance-list.js +12 -24
- package/dist/m365/spo/commands/app/app-list.js +26 -44
- package/dist/m365/spo/commands/app/app-remove.js +32 -52
- package/dist/m365/spo/commands/app/app-retract.js +32 -51
- package/dist/m365/spo/commands/app/app-teamspackage-download.js +35 -54
- package/dist/m365/spo/commands/app/app-uninstall.js +21 -44
- package/dist/m365/spo/commands/app/app-upgrade.js +20 -41
- package/dist/m365/spo/commands/commandset/commandset-add.js +17 -59
- package/dist/m365/spo/commands/commandset/commandset-get.js +24 -62
- package/dist/m365/spo/commands/commandset/commandset-list.js +11 -34
- package/dist/m365/spo/commands/commandset/commandset-remove.js +21 -54
- package/dist/m365/spo/commands/commandset/commandset-set.js +30 -83
- package/dist/m365/spo/commands/feature/feature-disable.js +20 -50
- package/dist/m365/spo/commands/feature/feature-enable.js +22 -50
- package/dist/m365/spo/commands/feature/feature-list.js +11 -36
- package/dist/m365/spo/commands/field/field-add.js +33 -62
- package/dist/m365/spo/commands/field/field-get.js +30 -57
- package/dist/m365/spo/commands/field/field-list.js +21 -46
- package/dist/m365/spo/commands/field/field-remove.js +32 -63
- package/dist/m365/spo/commands/field/field-set.js +34 -66
- package/dist/m365/spo/commands/file/file-get.js +4 -3
- package/dist/m365/spo/commands/folder/folder-unarchive.js +90 -0
- package/dist/m365/spo/commands/hubsite/hubsite-connect.js +38 -63
- package/dist/m365/spo/commands/hubsite/hubsite-data-get.js +11 -27
- package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +25 -47
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +25 -37
- package/dist/m365/spo/commands/hubsite/hubsite-list.js +12 -24
- package/dist/m365/spo/commands/hubsite/hubsite-register.js +10 -18
- package/dist/m365/spo/commands/hubsite/hubsite-rights-grant.js +14 -32
- package/dist/m365/spo/commands/hubsite/hubsite-rights-revoke.js +12 -29
- package/dist/m365/spo/commands/hubsite/hubsite-set.js +19 -46
- package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +11 -27
- 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 -79
- 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/navigation/navigation-node-add.js +74 -120
- package/dist/m365/spo/commands/navigation/navigation-node-get.js +4 -13
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +53 -114
- package/dist/m365/spo/commands/page/page-unpublish.js +53 -0
- package/dist/m365/spo/commands/sitescript/sitescript-add.js +22 -37
- package/dist/m365/spo/commands/sitescript/sitescript-get.js +9 -26
- package/dist/m365/spo/commands/sitescript/sitescript-list.js +5 -0
- package/dist/m365/spo/commands/sitescript/sitescript-remove.js +9 -33
- package/dist/m365/spo/commands/sitescript/sitescript-set.js +29 -56
- 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/spo/commands.js +3 -1
- package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +5 -0
- package/dist/m365/spp/commands/model/model-get.js +25 -45
- package/dist/m365/spp/commands/model/model-list.js +12 -23
- package/dist/m365/spp/commands/model/model-remove.js +25 -45
- package/dist/m365/teams/commands/channel/channel-add.js +46 -57
- package/dist/m365/teams/commands/channel/channel-get.js +41 -48
- package/dist/m365/teams/commands/channel/channel-list.js +28 -42
- package/dist/m365/teams/commands/channel/channel-member-add.js +53 -54
- package/dist/m365/teams/commands/channel/channel-member-list.js +47 -55
- package/dist/m365/teams/commands/channel/channel-member-remove.js +62 -62
- package/dist/m365/teams/commands/channel/channel-member-set.js +61 -65
- package/dist/m365/teams/commands/channel/channel-remove.js +47 -49
- package/dist/m365/teams/commands/channel/channel-set.js +47 -54
- package/dist/m365/teams/commands/chat/chat-get.js +30 -45
- package/dist/m365/teams/commands/chat/chat-list.js +22 -42
- package/dist/m365/teams/commands/chat/chat-member-add.js +43 -64
- package/dist/m365/teams/commands/chat/chat-member-list.js +10 -23
- package/dist/m365/teams/commands/chat/chat-member-remove.js +28 -50
- package/dist/m365/teams/commands/chat/chat-message-send.js +32 -55
- package/dist/m365/teams/commands/meeting/meeting-add.js +57 -68
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-get.js +33 -58
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +14 -38
- package/dist/m365/teams/commands/meeting/meeting-get.js +14 -38
- package/dist/m365/teams/commands/meeting/meeting-list.js +34 -59
- package/dist/m365/teams/commands/meeting/meeting-transcript-get.js +34 -58
- package/dist/m365/teams/commands/meeting/meeting-transcript-list.js +29 -50
- package/dist/m365/teams/commands/message/message-get.js +19 -30
- package/dist/m365/teams/commands/message/message-list.js +26 -43
- package/dist/m365/teams/commands/message/message-remove.js +43 -58
- package/dist/m365/teams/commands/message/message-reply-list.js +19 -30
- package/dist/m365/teams/commands/message/message-restore.js +40 -50
- package/dist/m365/teams/commands/message/message-send.js +19 -30
- 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/m365/util/commands/accesstoken/accesstoken-get.js +10 -28
- package/dist/telemetry.js +7 -11
- package/dist/utils/spo.js +40 -3
- package/dist/utils/urlUtil.js +2 -2
- package/dist/utils/zod.js +4 -4
- package/docs/docs/cmd/login.mdx +15 -2
- package/docs/docs/cmd/spe/container/container-permission-remove.mdx +78 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-archive.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-checkin.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-checkout.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-copy.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-get.mdx +6 -6
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +22 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +24 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +22 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +22 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +24 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +22 -1
- package/docs/docs/cmd/spo/file/file-unarchive.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-clear.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-keep.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-list.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-restore.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-archive.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-copy.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-get.mdx +2 -2
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +22 -1
- package/docs/docs/cmd/spo/folder/folder-sharinglink-clear.mdx +23 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-get.mdx +21 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-list.mdx +22 -1
- package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +24 -1
- package/docs/docs/cmd/spo/folder/folder-sharinglink-set.mdx +21 -0
- package/docs/docs/cmd/spo/folder/folder-unarchive.mdx +76 -0
- package/docs/docs/cmd/spo/listitem/listitem-get.mdx +0 -6
- package/docs/docs/cmd/spo/navigation/navigation-node-add.mdx +45 -30
- package/docs/docs/cmd/spo/navigation/navigation-node-get.mdx +64 -42
- package/docs/docs/cmd/spo/navigation/navigation-node-set.mdx +10 -8
- package/docs/docs/cmd/spo/page/page-unpublish.mdx +63 -0
- package/docs/docs/cmd/spp/model/model-get.mdx +1 -1
- package/docs/docs/cmd/spp/model/model-remove.mdx +1 -1
- package/docs/docs/cmd/teams/tab/tab-add.mdx +19 -0
- package/docs/docs/cmd/teams/tab/tab-get.mdx +19 -0
- package/docs/docs/cmd/teams/tab/tab-list.mdx +19 -0
- package/docs/docs/cmd/teams/tab/tab-remove.mdx +21 -0
- package/docs/docs/cmd/viva/engage/engage-message-add.mdx +17 -0
- package/docs/docs/cmd/viva/engage/engage-message-get.mdx +17 -0
- package/docs/docs/cmd/viva/engage/engage-message-list.mdx +17 -0
- package/docs/docs/cmd/viva/engage/engage-message-remove.mdx +19 -0
- package/npm-shrinkwrap.json +324 -3116
- package/package.json +18 -35
- package/dist/appInsights.js +0 -43
|
@@ -1,12 +1,8 @@
|
|
|
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 _EntraM365GroupSetCommand_instances, _EntraM365GroupSetCommand_initTelemetry, _EntraM365GroupSetCommand_initOptions, _EntraM365GroupSetCommand_initOptionSets, _EntraM365GroupSetCommand_initTypes, _EntraM365GroupSetCommand_initValidators;
|
|
7
1
|
import { setTimeout } from 'timers/promises';
|
|
8
2
|
import fs from 'fs';
|
|
9
3
|
import path from 'path';
|
|
4
|
+
import { z } from 'zod';
|
|
5
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
10
6
|
import request from '../../../../request.js';
|
|
11
7
|
import { validation } from '../../../../utils/validation.js';
|
|
12
8
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
@@ -17,22 +13,97 @@ import auth from '../../../../Auth.js';
|
|
|
17
13
|
import { entraUser } from '../../../../utils/entraUser.js';
|
|
18
14
|
import { formatting } from '../../../../utils/formatting.js';
|
|
19
15
|
import { odata } from '../../../../utils/odata.js';
|
|
16
|
+
export const options = z.strictObject({
|
|
17
|
+
...globalOptionsZod.shape,
|
|
18
|
+
id: z.uuid().optional().alias('i'),
|
|
19
|
+
displayName: z.string().optional().alias('n'),
|
|
20
|
+
newDisplayName: z.string().optional(),
|
|
21
|
+
description: z.string().optional().alias('d'),
|
|
22
|
+
ownerIds: z.string()
|
|
23
|
+
.refine(ids => validation.isValidGuidArray(ids) === true, {
|
|
24
|
+
error: e => `The following GUIDs are invalid for the option 'ownerIds': ${validation.isValidGuidArray(e.input)}.`
|
|
25
|
+
}).optional(),
|
|
26
|
+
ownerUserNames: z.string()
|
|
27
|
+
.refine(names => validation.isValidUserPrincipalNameArray(names) === true, {
|
|
28
|
+
error: e => `The following user principal names are invalid for the option 'ownerUserNames': ${validation.isValidUserPrincipalNameArray(e.input)}.`
|
|
29
|
+
}).optional(),
|
|
30
|
+
memberIds: z.string()
|
|
31
|
+
.refine(ids => validation.isValidGuidArray(ids) === true, {
|
|
32
|
+
error: e => `The following GUIDs are invalid for the option 'memberIds': ${validation.isValidGuidArray(e.input)}.`
|
|
33
|
+
}).optional(),
|
|
34
|
+
memberUserNames: z.string()
|
|
35
|
+
.refine(names => validation.isValidUserPrincipalNameArray(names) === true, {
|
|
36
|
+
error: e => `The following user principal names are invalid for the option 'memberUserNames': ${validation.isValidUserPrincipalNameArray(e.input)}.`
|
|
37
|
+
}).optional(),
|
|
38
|
+
isPrivate: z.boolean().optional(),
|
|
39
|
+
logoPath: z.string()
|
|
40
|
+
.refine(logoPath => {
|
|
41
|
+
const fullPath = path.resolve(logoPath);
|
|
42
|
+
return fs.existsSync(fullPath) && !fs.lstatSync(fullPath).isDirectory();
|
|
43
|
+
}, {
|
|
44
|
+
error: e => {
|
|
45
|
+
const fullPath = path.resolve(e.input);
|
|
46
|
+
return fs.existsSync(fullPath) ? `Path '${fullPath}' points to a directory` : `File '${fullPath}' not found`;
|
|
47
|
+
}
|
|
48
|
+
})
|
|
49
|
+
.optional()
|
|
50
|
+
.alias('l'),
|
|
51
|
+
allowExternalSenders: z.boolean().optional(),
|
|
52
|
+
autoSubscribeNewMembers: z.boolean().optional(),
|
|
53
|
+
hideFromAddressLists: z.boolean().optional(),
|
|
54
|
+
hideFromOutlookClients: z.boolean().optional()
|
|
55
|
+
});
|
|
20
56
|
class EntraM365GroupSetCommand extends GraphCommand {
|
|
57
|
+
constructor() {
|
|
58
|
+
super(...arguments);
|
|
59
|
+
this.pollingInterval = 500;
|
|
60
|
+
}
|
|
21
61
|
get name() {
|
|
22
62
|
return commands.M365GROUP_SET;
|
|
23
63
|
}
|
|
24
64
|
get description() {
|
|
25
65
|
return 'Updates Microsoft 365 Group properties';
|
|
26
66
|
}
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
67
|
+
get schema() {
|
|
68
|
+
return options;
|
|
69
|
+
}
|
|
70
|
+
getRefinedSchema(schema) {
|
|
71
|
+
return schema
|
|
72
|
+
.refine(opts => [opts.id, opts.displayName].filter(o => o !== undefined).length === 1, {
|
|
73
|
+
error: 'Use one of the following options: id or displayName.',
|
|
74
|
+
params: {
|
|
75
|
+
customCode: 'optionSet',
|
|
76
|
+
options: ['id', 'displayName']
|
|
77
|
+
}
|
|
78
|
+
})
|
|
79
|
+
.refine(opts => !(opts.ownerIds && opts.ownerUserNames), {
|
|
80
|
+
error: 'Use one of the following options: ownerIds or ownerUserNames.',
|
|
81
|
+
params: {
|
|
82
|
+
customCode: 'optionSet',
|
|
83
|
+
options: ['ownerIds', 'ownerUserNames']
|
|
84
|
+
}
|
|
85
|
+
})
|
|
86
|
+
.refine(opts => !(opts.memberIds && opts.memberUserNames), {
|
|
87
|
+
error: 'Use one of the following options: memberIds or memberUserNames.',
|
|
88
|
+
params: {
|
|
89
|
+
customCode: 'optionSet',
|
|
90
|
+
options: ['memberIds', 'memberUserNames']
|
|
91
|
+
}
|
|
92
|
+
})
|
|
93
|
+
.refine(opts => !!opts.newDisplayName ||
|
|
94
|
+
opts.description !== undefined ||
|
|
95
|
+
opts.ownerIds !== undefined ||
|
|
96
|
+
opts.ownerUserNames !== undefined ||
|
|
97
|
+
opts.memberIds !== undefined ||
|
|
98
|
+
opts.memberUserNames !== undefined ||
|
|
99
|
+
opts.isPrivate !== undefined ||
|
|
100
|
+
opts.logoPath !== undefined ||
|
|
101
|
+
opts.allowExternalSenders !== undefined ||
|
|
102
|
+
opts.autoSubscribeNewMembers !== undefined ||
|
|
103
|
+
opts.hideFromAddressLists !== undefined ||
|
|
104
|
+
opts.hideFromOutlookClients !== undefined, {
|
|
105
|
+
error: 'Specify at least one option to update.'
|
|
106
|
+
});
|
|
36
107
|
}
|
|
37
108
|
async commandAction(logger, args) {
|
|
38
109
|
try {
|
|
@@ -220,132 +291,6 @@ class EntraM365GroupSetCommand extends GraphCommand {
|
|
|
220
291
|
return requestOptions;
|
|
221
292
|
}
|
|
222
293
|
}
|
|
223
|
-
_EntraM365GroupSetCommand_instances = new WeakSet(), _EntraM365GroupSetCommand_initTelemetry = function _EntraM365GroupSetCommand_initTelemetry() {
|
|
224
|
-
this.telemetry.push((args) => {
|
|
225
|
-
Object.assign(this.telemetryProperties, {
|
|
226
|
-
id: typeof args.options.id !== 'undefined',
|
|
227
|
-
displayName: typeof args.options.displayName !== 'undefined',
|
|
228
|
-
newDisplayName: typeof args.options.newDisplayName !== 'undefined',
|
|
229
|
-
description: typeof args.options.description !== 'undefined',
|
|
230
|
-
ownerIds: typeof args.options.ownerIds !== 'undefined',
|
|
231
|
-
ownerUserNames: typeof args.options.ownerUserNames !== 'undefined',
|
|
232
|
-
memberIds: typeof args.options.memberIds !== 'undefined',
|
|
233
|
-
memberUserNames: typeof args.options.memberUserNames !== 'undefined',
|
|
234
|
-
isPrivate: !!args.options.isPrivate,
|
|
235
|
-
logoPath: typeof args.options.logoPath !== 'undefined',
|
|
236
|
-
allowExternalSenders: !!args.options.allowExternalSenders,
|
|
237
|
-
autoSubscribeNewMembers: !!args.options.autoSubscribeNewMembers,
|
|
238
|
-
hideFromAddressLists: !!args.options.hideFromAddressLists,
|
|
239
|
-
hideFromOutlookClients: !!args.options.hideFromOutlookClients
|
|
240
|
-
});
|
|
241
|
-
});
|
|
242
|
-
}, _EntraM365GroupSetCommand_initOptions = function _EntraM365GroupSetCommand_initOptions() {
|
|
243
|
-
this.options.unshift({
|
|
244
|
-
option: '-i, --id [id]'
|
|
245
|
-
}, {
|
|
246
|
-
option: '-n, --displayName [displayName]'
|
|
247
|
-
}, {
|
|
248
|
-
option: '--newDisplayName [newDisplayName]'
|
|
249
|
-
}, {
|
|
250
|
-
option: '-d, --description [description]'
|
|
251
|
-
}, {
|
|
252
|
-
option: '--ownerIds [ownerIds]'
|
|
253
|
-
}, {
|
|
254
|
-
option: '--ownerUserNames [ownerUserNames]'
|
|
255
|
-
}, {
|
|
256
|
-
option: '--memberIds [memberIds]'
|
|
257
|
-
}, {
|
|
258
|
-
option: '--memberUserNames [memberUserNames]'
|
|
259
|
-
}, {
|
|
260
|
-
option: '--isPrivate [isPrivate]',
|
|
261
|
-
autocomplete: ['true', 'false']
|
|
262
|
-
}, {
|
|
263
|
-
option: '-l, --logoPath [logoPath]'
|
|
264
|
-
}, {
|
|
265
|
-
option: '--allowExternalSenders [allowExternalSenders]',
|
|
266
|
-
autocomplete: ['true', 'false']
|
|
267
|
-
}, {
|
|
268
|
-
option: '--autoSubscribeNewMembers [autoSubscribeNewMembers]',
|
|
269
|
-
autocomplete: ['true', 'false']
|
|
270
|
-
}, {
|
|
271
|
-
option: '--hideFromAddressLists [hideFromAddressLists]',
|
|
272
|
-
autocomplete: ['true', 'false']
|
|
273
|
-
}, {
|
|
274
|
-
option: '--hideFromOutlookClients [hideFromOutlookClients]',
|
|
275
|
-
autocomplete: ['true', 'false']
|
|
276
|
-
});
|
|
277
|
-
}, _EntraM365GroupSetCommand_initOptionSets = function _EntraM365GroupSetCommand_initOptionSets() {
|
|
278
|
-
this.optionSets.push({ options: ['id', 'displayName'] });
|
|
279
|
-
this.optionSets.push({
|
|
280
|
-
options: ['ownerIds', 'ownerUserNames'],
|
|
281
|
-
runsWhen: (args) => {
|
|
282
|
-
return args.options.ownerIds !== undefined || args.options.ownerUserNames !== undefined;
|
|
283
|
-
}
|
|
284
|
-
});
|
|
285
|
-
this.optionSets.push({
|
|
286
|
-
options: ['memberIds', 'memberUserNames'],
|
|
287
|
-
runsWhen: (args) => {
|
|
288
|
-
return args.options.memberIds !== undefined || args.options.memberUserNames !== undefined;
|
|
289
|
-
}
|
|
290
|
-
});
|
|
291
|
-
}, _EntraM365GroupSetCommand_initTypes = function _EntraM365GroupSetCommand_initTypes() {
|
|
292
|
-
this.types.boolean.push('isPrivate', 'allowEternalSenders', 'autoSubscribeNewMembers', 'hideFromAddressLists', 'hideFromOutlookClients');
|
|
293
|
-
this.types.string.push('id', 'displayName', 'newDisplayName', 'description', 'ownerIds', 'ownerUserNames', 'memberIds', 'memberUserNames', 'logoPath');
|
|
294
|
-
}, _EntraM365GroupSetCommand_initValidators = function _EntraM365GroupSetCommand_initValidators() {
|
|
295
|
-
this.validators.push(async (args) => {
|
|
296
|
-
if (!args.options.newDisplayName &&
|
|
297
|
-
args.options.description === undefined &&
|
|
298
|
-
args.options.ownerIds === undefined &&
|
|
299
|
-
args.options.ownerUserNames === undefined &&
|
|
300
|
-
args.options.memberIds === undefined &&
|
|
301
|
-
args.options.memberUserNames === undefined &&
|
|
302
|
-
args.options.isPrivate === undefined &&
|
|
303
|
-
args.options.logoPath === undefined &&
|
|
304
|
-
args.options.allowExternalSenders === undefined &&
|
|
305
|
-
args.options.autoSubscribeNewMembers === undefined &&
|
|
306
|
-
args.options.hideFromAddressLists === undefined &&
|
|
307
|
-
args.options.hideFromOutlookClients === undefined) {
|
|
308
|
-
return 'Specify at least one option to update.';
|
|
309
|
-
}
|
|
310
|
-
if (args.options.id && !validation.isValidGuid(args.options.id)) {
|
|
311
|
-
return `${args.options.id} is not a valid GUID`;
|
|
312
|
-
}
|
|
313
|
-
if (args.options.ownerIds) {
|
|
314
|
-
const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.ownerIds);
|
|
315
|
-
if (isValidGUIDArrayResult !== true) {
|
|
316
|
-
return `The following GUIDs are invalid for the option 'ownerIds': ${isValidGUIDArrayResult}.`;
|
|
317
|
-
}
|
|
318
|
-
}
|
|
319
|
-
if (args.options.ownerUserNames) {
|
|
320
|
-
const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.ownerUserNames);
|
|
321
|
-
if (isValidUPNArrayResult !== true) {
|
|
322
|
-
return `The following user principal names are invalid for the option 'ownerUserNames': ${isValidUPNArrayResult}.`;
|
|
323
|
-
}
|
|
324
|
-
}
|
|
325
|
-
if (args.options.memberIds) {
|
|
326
|
-
const isValidGUIDArrayResult = validation.isValidGuidArray(args.options.memberIds);
|
|
327
|
-
if (isValidGUIDArrayResult !== true) {
|
|
328
|
-
return `The following GUIDs are invalid for the option 'memberIds': ${isValidGUIDArrayResult}.`;
|
|
329
|
-
}
|
|
330
|
-
}
|
|
331
|
-
if (args.options.memberUserNames) {
|
|
332
|
-
const isValidUPNArrayResult = validation.isValidUserPrincipalNameArray(args.options.memberUserNames);
|
|
333
|
-
if (isValidUPNArrayResult !== true) {
|
|
334
|
-
return `The following user principal names are invalid for the option 'memberUserNames': ${isValidUPNArrayResult}.`;
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
if (args.options.logoPath) {
|
|
338
|
-
const fullPath = path.resolve(args.options.logoPath);
|
|
339
|
-
if (!fs.existsSync(fullPath)) {
|
|
340
|
-
return `File '${fullPath}' not found`;
|
|
341
|
-
}
|
|
342
|
-
if (fs.lstatSync(fullPath).isDirectory()) {
|
|
343
|
-
return `Path '${fullPath}' points to a directory`;
|
|
344
|
-
}
|
|
345
|
-
}
|
|
346
|
-
return true;
|
|
347
|
-
});
|
|
348
|
-
};
|
|
349
294
|
EntraM365GroupSetCommand.numRepeat = 15;
|
|
350
295
|
export default new EntraM365GroupSetCommand();
|
|
351
296
|
//# sourceMappingURL=m365group-set.js.map
|
|
@@ -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
|