@pnp/cli-microsoft365 10.0.0-beta.e925c1c → 10.0.0
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/.eslintrc.cjs +1 -0
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +6 -4
- package/dist/AuthServer.js +7 -7
- package/dist/Command.js +4 -1
- package/dist/api.js +1 -1
- package/dist/appInsights.js +6 -4
- package/dist/config.js +1 -0
- package/dist/m365/base/PowerAutomateCommand.js +1 -1
- package/dist/m365/cli/commands/cli-doctor.js +2 -2
- package/dist/m365/cli/commands/config/config-set.js +0 -1
- package/dist/m365/cli/commands.js +1 -2
- package/dist/m365/commands/login.js +122 -69
- package/dist/m365/commands/setup.js +1 -1
- package/dist/m365/commands/setupPresets.js +2 -4
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-add.js +0 -5
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-get.js +0 -5
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-list.js +0 -5
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-add.js +0 -5
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-get.js +0 -5
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-member-list.js +0 -5
- package/dist/m365/entra/commands/administrativeunit/administrativeunit-remove.js +0 -5
- package/dist/m365/entra/commands/app/app-add.js +0 -5
- package/dist/m365/entra/commands/app/app-get.js +0 -5
- package/dist/m365/entra/commands/app/app-list.js +0 -5
- package/dist/m365/entra/commands/app/app-permission-add.js +0 -5
- package/dist/m365/entra/commands/app/app-remove.js +0 -5
- package/dist/m365/entra/commands/app/app-role-add.js +0 -5
- package/dist/m365/entra/commands/app/app-role-list.js +0 -5
- package/dist/m365/entra/commands/app/app-role-remove.js +0 -5
- package/dist/m365/entra/commands/app/app-set.js +0 -5
- package/dist/m365/entra/commands/approleassignment/approleassignment-add.js +0 -5
- package/dist/m365/entra/commands/approleassignment/approleassignment-list.js +0 -5
- package/dist/m365/entra/commands/approleassignment/approleassignment-remove.js +0 -5
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-add.js +0 -5
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-get.js +0 -5
- package/dist/m365/entra/commands/enterpriseapp/enterpriseapp-list.js +0 -5
- package/dist/m365/entra/commands/group/group-add.js +0 -4
- package/dist/m365/entra/commands/group/group-get.js +0 -5
- package/dist/m365/entra/commands/group/group-list.js +0 -5
- package/dist/m365/entra/commands/group/{group-user-add.js → group-member-add.js} +18 -18
- package/dist/m365/entra/commands/group/{group-user-list.js → group-member-list.js} +16 -21
- package/dist/m365/entra/commands/group/{group-user-set.js → group-member-set.js} +19 -19
- package/dist/m365/entra/commands/group/group-remove.js +0 -5
- package/dist/m365/entra/commands/groupsetting/groupsetting-add.js +0 -5
- package/dist/m365/entra/commands/groupsetting/groupsetting-get.js +0 -5
- package/dist/m365/entra/commands/groupsetting/groupsetting-list.js +0 -5
- package/dist/m365/entra/commands/groupsetting/groupsetting-remove.js +0 -5
- package/dist/m365/entra/commands/groupsetting/groupsetting-set.js +0 -5
- package/dist/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-get.js +0 -5
- package/dist/m365/entra/commands/groupsettingtemplate/groupsettingtemplate-list.js +0 -5
- package/dist/m365/entra/commands/license/license-list.js +0 -5
- package/dist/m365/entra/commands/m365group/m365group-add.js +0 -5
- package/dist/m365/entra/commands/m365group/m365group-conversation-list.js +0 -5
- package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +0 -5
- package/dist/m365/entra/commands/m365group/m365group-get.js +0 -5
- package/dist/m365/entra/commands/m365group/m365group-list.js +0 -5
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-clear.js +0 -5
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +0 -5
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-remove.js +0 -5
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-restore.js +0 -5
- package/dist/m365/entra/commands/m365group/m365group-remove.js +0 -5
- package/dist/m365/entra/commands/m365group/m365group-renew.js +0 -5
- package/dist/m365/entra/commands/m365group/m365group-report-activitycounts.js +0 -4
- package/dist/m365/entra/commands/m365group/m365group-report-activitydetail.js +0 -4
- package/dist/m365/entra/commands/m365group/m365group-report-activityfilecounts.js +0 -4
- package/dist/m365/entra/commands/m365group/m365group-report-activitygroupcounts.js +0 -4
- package/dist/m365/entra/commands/m365group/m365group-report-activitystorage.js +0 -4
- package/dist/m365/entra/commands/m365group/m365group-set.js +159 -86
- package/dist/m365/entra/commands/m365group/m365group-teamify.js +0 -5
- package/dist/m365/entra/commands/m365group/m365group-user-add.js +5 -18
- package/dist/m365/entra/commands/m365group/m365group-user-list.js +0 -5
- package/dist/m365/entra/commands/m365group/m365group-user-remove.js +84 -62
- package/dist/m365/entra/commands/m365group/m365group-user-set.js +3 -15
- package/dist/m365/entra/commands/oauth2grant/oauth2grant-add.js +0 -5
- package/dist/m365/entra/commands/oauth2grant/oauth2grant-list.js +3 -17
- package/dist/m365/entra/commands/oauth2grant/oauth2grant-remove.js +0 -5
- package/dist/m365/entra/commands/oauth2grant/oauth2grant-set.js +0 -5
- package/dist/m365/entra/commands/policy/policy-list.js +0 -5
- package/dist/m365/entra/commands/siteclassification/siteclassification-disable.js +0 -5
- package/dist/m365/entra/commands/siteclassification/siteclassification-enable.js +0 -5
- package/dist/m365/entra/commands/siteclassification/siteclassification-get.js +0 -5
- package/dist/m365/entra/commands/siteclassification/siteclassification-set.js +0 -5
- package/dist/m365/entra/commands/user/user-add.js +0 -5
- package/dist/m365/entra/commands/user/user-get.js +0 -5
- package/dist/m365/entra/commands/user/user-guest-add.js +0 -5
- package/dist/m365/entra/commands/user/user-hibp.js +0 -5
- package/dist/m365/entra/commands/user/user-license-add.js +0 -5
- package/dist/m365/entra/commands/user/user-license-list.js +0 -5
- package/dist/m365/entra/commands/user/user-license-remove.js +0 -5
- package/dist/m365/entra/commands/user/user-list.js +0 -5
- package/dist/m365/entra/commands/user/user-password-validate.js +0 -5
- package/dist/m365/entra/commands/user/user-recyclebinitem-clear.js +0 -5
- package/dist/m365/entra/commands/user/user-recyclebinitem-list.js +0 -5
- package/dist/m365/entra/commands/user/user-recyclebinitem-remove.js +0 -5
- package/dist/m365/entra/commands/user/user-recyclebinitem-restore.js +0 -5
- package/dist/m365/entra/commands/user/user-registrationdetails-list.js +0 -4
- package/dist/m365/entra/commands/user/user-remove.js +0 -5
- package/dist/m365/entra/commands/user/user-set.js +0 -5
- package/dist/m365/entra/commands/user/user-signin-list.js +0 -5
- package/dist/m365/entra/commands.js +3 -3
- package/dist/m365/external/commands/item/item-add.js +2 -5
- package/dist/m365/file/commands/file-move.js +135 -0
- package/dist/m365/file/commands.js +2 -1
- package/dist/m365/flow/commands/environment/environment-get.js +1 -1
- package/dist/m365/flow/commands/environment/environment-list.js +2 -2
- package/dist/m365/flow/commands/flow-disable.js +1 -1
- package/dist/m365/flow/commands/flow-enable.js +1 -1
- package/dist/m365/flow/commands/flow-export.js +17 -16
- package/dist/m365/flow/commands/flow-get.js +1 -1
- package/dist/m365/flow/commands/flow-list.js +1 -1
- package/dist/m365/flow/commands/flow-remove.js +1 -1
- package/dist/m365/flow/commands/owner/owner-ensure.js +1 -1
- package/dist/m365/flow/commands/owner/owner-list.js +1 -1
- package/dist/m365/flow/commands/owner/owner-remove.js +1 -1
- package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-list.js +47 -0
- package/dist/m365/flow/commands/recyclebinitem/recyclebinitem-restore.js +48 -0
- package/dist/m365/flow/commands/run/run-cancel.js +1 -1
- package/dist/m365/flow/commands/run/run-get.js +1 -1
- package/dist/m365/flow/commands/run/run-list.js +1 -1
- package/dist/m365/flow/commands/run/run-resubmit.js +2 -2
- package/dist/m365/flow/commands.js +2 -0
- package/dist/m365/pa/commands/app/app-list.js +1 -6
- package/dist/m365/pa/commands/connector/connector-list.js +1 -6
- package/dist/m365/pa/commands/environment/environment-list.js +1 -1
- package/dist/m365/pp/commands/environment/environment-list.js +1 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.20.0.js +27 -0
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN002021_DEVDEP_rushstack_eslint_config.js +10 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +2 -1
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.20.0.js +59 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +2 -1
- package/dist/m365/spfx/commands/spfx-doctor.js +15 -0
- package/dist/m365/spo/commands/app/app-instance-list.js +3 -18
- package/dist/m365/spo/commands/app/app-list.js +1 -8
- package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +8 -8
- package/dist/m365/spo/commands/contenttype/contenttype-field-set.js +2 -2
- package/dist/m365/spo/commands/feature/feature-list.js +1 -8
- package/dist/m365/spo/commands/file/file-copy.js +11 -7
- package/dist/m365/spo/commands/file/file-move.js +55 -33
- package/dist/m365/spo/commands/file/file-remove.js +7 -1
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +17 -54
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +13 -40
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +5 -13
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +5 -13
- package/dist/m365/spo/commands/folder/folder-copy.js +43 -35
- package/dist/m365/spo/commands/folder/folder-move.js +43 -35
- package/dist/m365/spo/commands/folder/folder-sharinglink-add.js +143 -0
- package/dist/m365/spo/commands/folder/folder-sharinglink-clear.js +111 -0
- package/dist/m365/spo/commands/folder/folder-sharinglink-remove.js +95 -0
- package/dist/m365/spo/commands/folder/folder-sharinglink-set.js +90 -0
- package/dist/m365/spo/commands/group/group-member-add.js +3 -23
- package/dist/m365/spo/commands/group/group-member-remove.js +1 -18
- package/dist/m365/spo/commands/list/list-get.js +17 -4
- package/dist/m365/spo/commands/list/list-remove.js +14 -4
- package/dist/m365/spo/commands/list/list-webhook-list.js +1 -6
- package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +1 -8
- package/dist/m365/spo/commands/page/page-list.js +1 -1
- package/dist/m365/spo/commands/page/page-publish.js +54 -0
- package/dist/m365/spo/commands/page/page-remove.js +37 -16
- package/dist/m365/spo/commands/page/page-section-add.js +185 -34
- package/dist/m365/spo/commands/page/page-template-list.js +1 -3
- package/dist/m365/spo/commands/site/SiteAdmin.js +2 -0
- package/dist/m365/spo/commands/site/site-admin-add.js +252 -0
- package/dist/m365/spo/commands/site/site-admin-list.js +10 -36
- package/dist/m365/spo/commands/site/site-admin-remove.js +194 -0
- package/dist/m365/spo/commands/site/site-sharingpermission-set.js +68 -0
- package/dist/m365/spo/commands/sitescript/sitescript-get.js +3 -2
- package/dist/m365/spo/commands/sitescript/sitescript-list.js +1 -3
- package/dist/m365/spo/commands/tenant/SPOTenantSitePropertiesEnumerable.js +2 -0
- package/dist/m365/spo/commands/tenant/TenantSiteProperties.js +2 -0
- package/dist/m365/spo/commands/{site/site-list.js → tenant/tenant-site-list.js} +15 -12
- package/dist/m365/spo/commands/tenant/tenant-site-membership-list.js +118 -0
- package/dist/m365/spo/commands/{site/site-rename.js → tenant/tenant-site-rename.js} +29 -32
- package/dist/m365/spo/commands/theme/theme-list.js +1 -1
- package/dist/m365/spo/commands/user/user-ensure.js +1 -11
- package/dist/m365/spo/commands/user/user-get.js +67 -9
- package/dist/m365/spo/commands/userprofile/userprofile-get.js +1 -1
- package/dist/m365/spo/commands/web/web-clientsidewebpart-list.js +1 -6
- package/dist/m365/spo/commands.js +11 -1
- package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +56 -0
- package/dist/m365/spp/commands/model/model-list.js +57 -0
- package/dist/m365/spp/commands.js +6 -0
- package/dist/m365/teams/MeetingTranscript.js +2 -0
- package/dist/m365/teams/commands/cache/cache-remove.js +74 -34
- package/dist/m365/teams/commands/channel/channel-get.js +15 -50
- package/dist/m365/teams/commands/meeting/meeting-transcript-get.js +152 -0
- package/dist/m365/teams/commands/tab/tab-list.js +5 -3
- package/dist/m365/teams/commands/team/team-get.js +16 -21
- package/dist/m365/teams/commands.js +1 -0
- package/dist/m365/viva/commands/engage/Community.js +2 -0
- package/dist/m365/viva/commands/engage/engage-community-list.js +28 -0
- package/dist/m365/viva/commands/engage/engage-community-user-list.js +98 -0
- package/dist/m365/viva/commands.js +2 -0
- package/dist/request.js +46 -61
- package/dist/settingsNames.js +0 -1
- package/dist/telemetryRunner.js +2 -2
- package/dist/utils/spo.js +166 -29
- package/dist/utils/spp.js +22 -0
- package/dist/utils/teams.js +47 -5
- package/dist/utils/timersUtil.js +13 -0
- package/dist/utils/urlUtil.js +8 -0
- package/dist/utils/vivaEngage.js +61 -0
- package/dist/utils/zod.js +12 -3
- package/docs/docs/_clisettings.mdx +0 -1
- package/docs/docs/cmd/cli/cli-doctor.mdx +24 -23
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-add.mdx +0 -6
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-get.mdx +0 -6
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-list.mdx +0 -6
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-add.mdx +0 -6
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-get.mdx +0 -6
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-member-list.mdx +0 -6
- package/docs/docs/cmd/entra/administrativeunit/administrativeunit-remove.mdx +0 -6
- package/docs/docs/cmd/entra/app/app-add.mdx +0 -1
- package/docs/docs/cmd/entra/app/app-get.mdx +0 -1
- package/docs/docs/cmd/entra/app/app-list.mdx +0 -1
- package/docs/docs/cmd/entra/app/app-permission-add.mdx +0 -1
- package/docs/docs/cmd/entra/app/app-permission-list.mdx +0 -6
- package/docs/docs/cmd/entra/app/app-remove.mdx +0 -1
- package/docs/docs/cmd/entra/app/app-role-add.mdx +0 -1
- package/docs/docs/cmd/entra/app/app-role-list.mdx +0 -1
- package/docs/docs/cmd/entra/app/app-role-remove.mdx +0 -1
- package/docs/docs/cmd/entra/app/app-set.mdx +0 -1
- package/docs/docs/cmd/entra/approleassignment/approleassignment-add.mdx +0 -6
- package/docs/docs/cmd/entra/approleassignment/approleassignment-list.mdx +0 -6
- package/docs/docs/cmd/entra/approleassignment/approleassignment-remove.mdx +0 -6
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-add.mdx +0 -1
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-get.mdx +0 -1
- package/docs/docs/cmd/entra/enterpriseapp/enterpriseapp-list.mdx +0 -1
- package/docs/docs/cmd/entra/group/group-add.mdx +0 -6
- package/docs/docs/cmd/entra/group/group-get.mdx +0 -6
- package/docs/docs/cmd/entra/group/group-list.mdx +0 -6
- package/docs/docs/cmd/entra/group/group-member-add.mdx +62 -0
- package/docs/docs/cmd/entra/group/{group-user-list.mdx → group-member-list.mdx} +14 -20
- package/docs/docs/cmd/entra/group/group-member-set.mdx +62 -0
- package/docs/docs/cmd/entra/group/group-remove.mdx +0 -6
- package/docs/docs/cmd/entra/groupsetting/groupsetting-add.mdx +0 -6
- package/docs/docs/cmd/entra/groupsetting/groupsetting-get.mdx +0 -6
- package/docs/docs/cmd/entra/groupsetting/groupsetting-list.mdx +0 -6
- package/docs/docs/cmd/entra/groupsetting/groupsetting-remove.mdx +0 -6
- package/docs/docs/cmd/entra/groupsetting/groupsetting-set.mdx +0 -6
- package/docs/docs/cmd/entra/groupsettingtemplate/groupsettingtemplate-get.mdx +0 -6
- package/docs/docs/cmd/entra/groupsettingtemplate/groupsettingtemplate-list.mdx +0 -6
- package/docs/docs/cmd/entra/license/license-list.mdx +0 -6
- package/docs/docs/cmd/entra/m365group/m365group-add.mdx +0 -6
- package/docs/docs/cmd/entra/m365group/m365group-conversation-list.mdx +0 -6
- package/docs/docs/cmd/entra/m365group/m365group-conversation-post-list.mdx +0 -6
- package/docs/docs/cmd/entra/m365group/m365group-get.mdx +0 -6
- package/docs/docs/cmd/entra/m365group/m365group-list.mdx +0 -6
- package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-clear.mdx +0 -6
- package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-list.mdx +0 -6
- package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-remove.mdx +0 -6
- package/docs/docs/cmd/entra/m365group/m365group-recyclebinitem-restore.mdx +0 -6
- package/docs/docs/cmd/entra/m365group/m365group-remove.mdx +0 -6
- package/docs/docs/cmd/entra/m365group/m365group-renew.mdx +0 -6
- package/docs/docs/cmd/entra/m365group/m365group-report-activitycounts.mdx +0 -6
- package/docs/docs/cmd/entra/m365group/m365group-report-activitydetail.mdx +0 -6
- package/docs/docs/cmd/entra/m365group/m365group-report-activityfilecounts.mdx +0 -6
- package/docs/docs/cmd/entra/m365group/m365group-report-activitygroupcounts.mdx +2 -8
- package/docs/docs/cmd/entra/m365group/m365group-report-activitystorage.mdx +3 -9
- package/docs/docs/cmd/entra/m365group/m365group-set.mdx +38 -23
- package/docs/docs/cmd/entra/m365group/m365group-teamify.mdx +5 -11
- package/docs/docs/cmd/entra/m365group/m365group-user-add.mdx +5 -14
- package/docs/docs/cmd/entra/m365group/m365group-user-list.mdx +0 -12
- package/docs/docs/cmd/entra/m365group/m365group-user-remove.mdx +26 -21
- package/docs/docs/cmd/entra/m365group/m365group-user-set.mdx +4 -17
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-add.mdx +3 -9
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-list.mdx +1 -7
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-remove.mdx +4 -10
- package/docs/docs/cmd/entra/oauth2grant/oauth2grant-set.mdx +3 -9
- package/docs/docs/cmd/entra/policy/policy-list.mdx +3 -9
- package/docs/docs/cmd/entra/siteclassification/siteclassification-disable.mdx +3 -9
- package/docs/docs/cmd/entra/siteclassification/siteclassification-enable.mdx +7 -13
- package/docs/docs/cmd/entra/siteclassification/siteclassification-get.mdx +1 -7
- package/docs/docs/cmd/entra/siteclassification/siteclassification-set.mdx +8 -14
- package/docs/docs/cmd/entra/user/user-add.mdx +4 -10
- package/docs/docs/cmd/entra/user/user-get.mdx +7 -13
- package/docs/docs/cmd/entra/user/user-guest-add.mdx +3 -9
- package/docs/docs/cmd/entra/user/user-hibp.mdx +2 -8
- package/docs/docs/cmd/entra/user/user-license-add.mdx +0 -6
- package/docs/docs/cmd/entra/user/user-license-list.mdx +0 -6
- package/docs/docs/cmd/entra/user/user-license-remove.mdx +2 -8
- package/docs/docs/cmd/entra/user/user-list.mdx +1 -7
- package/docs/docs/cmd/entra/user/user-password-validate.mdx +1 -7
- package/docs/docs/cmd/entra/user/user-recyclebinitem-clear.mdx +2 -8
- package/docs/docs/cmd/entra/user/user-recyclebinitem-list.mdx +0 -6
- package/docs/docs/cmd/entra/user/user-recyclebinitem-remove.mdx +2 -8
- package/docs/docs/cmd/entra/user/user-recyclebinitem-restore.mdx +0 -6
- package/docs/docs/cmd/entra/user/user-registrationdetails-list.mdx +7 -13
- package/docs/docs/cmd/entra/user/user-remove.mdx +2 -8
- package/docs/docs/cmd/entra/user/user-set.mdx +0 -6
- package/docs/docs/cmd/entra/user/user-signin-list.mdx +9 -15
- package/docs/docs/cmd/external/item/item-add.mdx +3 -3
- package/docs/docs/cmd/file/file-move.mdx +79 -0
- package/docs/docs/cmd/flow/recyclebinitem/recyclebinitem-list.mdx +132 -0
- package/docs/docs/cmd/flow/recyclebinitem/recyclebinitem-restore.mdx +55 -0
- package/docs/docs/cmd/login.mdx +9 -0
- package/docs/docs/cmd/setup.mdx +1 -3
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-get.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-origin-add.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-origin-list.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-origin-remove.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-policy-list.mdx +1 -1
- package/docs/docs/cmd/spo/cdn/cdn-policy-set.mdx +1 -1
- package/docs/docs/cmd/spo/contenttype/contenttype-field-remove.mdx +7 -7
- package/docs/docs/cmd/spo/contenttype/contenttype-field-set.mdx +2 -2
- package/docs/docs/cmd/spo/externaluser/externaluser-list.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-move.mdx +116 -11
- package/docs/docs/cmd/spo/file/file-remove.mdx +13 -4
- package/docs/docs/cmd/spo/folder/folder-copy.mdx +84 -13
- package/docs/docs/cmd/spo/folder/folder-move.mdx +84 -13
- package/docs/docs/cmd/spo/folder/folder-sharinglink-add.mdx +125 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-clear.mdx +50 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-remove.mdx +50 -0
- package/docs/docs/cmd/spo/folder/folder-sharinglink-set.mdx +116 -0
- package/docs/docs/cmd/spo/group/group-member-add.mdx +8 -14
- package/docs/docs/cmd/spo/group/group-member-remove.mdx +5 -11
- package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-get.mdx +1 -1
- package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-set.mdx +1 -1
- package/docs/docs/cmd/spo/homesite/homesite-remove.mdx +1 -1
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-get.mdx +1 -1
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.mdx +1 -1
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-set.mdx +1 -1
- package/docs/docs/cmd/spo/list/list-remove.mdx +10 -1
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.mdx +1 -1
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.mdx +1 -1
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.mdx +1 -1
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-list.mdx +1 -1
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-remove.mdx +1 -1
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-set.mdx +1 -1
- package/docs/docs/cmd/spo/page/page-publish.mdx +41 -0
- package/docs/docs/cmd/spo/page/page-remove.mdx +30 -12
- package/docs/docs/cmd/spo/page/page-section-add.mdx +57 -2
- package/docs/docs/cmd/spo/site/site-admin-add.mdx +67 -0
- package/docs/docs/cmd/spo/site/site-admin-list.mdx +64 -12
- package/docs/docs/cmd/spo/site/site-admin-remove.mdx +67 -0
- package/docs/docs/cmd/spo/site/site-appcatalog-add.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-appcatalog-remove.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-commsite-enable.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-set.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-sharingpermission-set.mdx +58 -0
- package/docs/docs/cmd/spo/sitescript/sitescript-get.mdx +14 -1
- package/docs/docs/cmd/spo/storageentity/storageentity-remove.mdx +1 -1
- package/docs/docs/cmd/spo/storageentity/storageentity-set.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-appcatalog-add.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-appcatalogurl-get.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-list.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-remove.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-settings-list.mdx +1 -1
- package/docs/docs/cmd/spo/{site/site-list.mdx → tenant/tenant-site-list.mdx} +19 -11
- package/docs/docs/cmd/spo/tenant/tenant-site-membership-list.mdx +122 -0
- package/docs/docs/cmd/spo/{site/site-rename.mdx → tenant/tenant-site-rename.mdx} +7 -7
- package/docs/docs/cmd/spo/theme/theme-apply.mdx +1 -1
- package/docs/docs/cmd/spo/theme/theme-get.mdx +1 -1
- package/docs/docs/cmd/spo/theme/theme-list.mdx +1 -1
- package/docs/docs/cmd/spo/theme/theme-remove.mdx +1 -1
- package/docs/docs/cmd/spo/theme/theme-set.mdx +1 -1
- package/docs/docs/cmd/spo/user/user-ensure.mdx +2 -5
- package/docs/docs/cmd/spo/user/user-get.mdx +35 -9
- package/docs/docs/cmd/spp/contentcenter/contentcenter-list.mdx +287 -0
- package/docs/docs/cmd/spp/model/model-list.mdx +140 -0
- package/docs/docs/cmd/teams/cache/cache-remove.mdx +10 -1
- package/docs/docs/cmd/teams/meeting/meeting-transcript-get.mdx +132 -0
- package/docs/docs/cmd/teams/tab/tab-list.mdx +1 -2
- package/docs/docs/cmd/viva/engage/engage-community-list.mdx +81 -0
- package/docs/docs/cmd/viva/engage/engage-community-user-list.mdx +123 -0
- package/npm-shrinkwrap.json +2215 -717
- package/package.json +21 -22
- package/dist/m365/cli/commands/cli-reconsent.js +0 -29
- package/dist/m365/entra/aadCommands.js +0 -89
- package/docs/docs/cmd/cli/cli-reconsent.mdx +0 -62
- package/docs/docs/cmd/entra/group/group-user-add.mdx +0 -62
- package/docs/docs/cmd/entra/group/group-user-set.mdx +0 -62
|
@@ -17,6 +17,9 @@ class SpoSiteAdminListCommand extends SpoCommand {
|
|
|
17
17
|
get description() {
|
|
18
18
|
return 'Lists all administrators of a specific SharePoint site';
|
|
19
19
|
}
|
|
20
|
+
defaultProperties() {
|
|
21
|
+
return ['Id', 'LoginName', 'Title', 'PrincipalTypeString'];
|
|
22
|
+
}
|
|
20
23
|
constructor() {
|
|
21
24
|
super();
|
|
22
25
|
_SpoSiteAdminListCommand_instances.add(this);
|
|
@@ -46,20 +49,16 @@ class SpoSiteAdminListCommand extends SpoCommand {
|
|
|
46
49
|
const requestOptions = {
|
|
47
50
|
url: `${adminUrl}/_api/SPO.Tenant/GetSiteAdministrators?siteId='${siteId}'`,
|
|
48
51
|
headers: {
|
|
49
|
-
accept: 'application/json;odata=nometadata'
|
|
50
|
-
|
|
51
|
-
|
|
52
|
+
accept: 'application/json;odata=nometadata'
|
|
53
|
+
},
|
|
54
|
+
responseType: 'json'
|
|
52
55
|
};
|
|
53
56
|
const response = await request.post(requestOptions);
|
|
54
|
-
const
|
|
55
|
-
const
|
|
56
|
-
const mappedResult = responseContent.value.map((u) => ({
|
|
57
|
-
Id: null,
|
|
57
|
+
const primaryAdminLoginName = await spo.getPrimaryAdminLoginNameAsAdmin(adminUrl, siteId, logger, this.verbose);
|
|
58
|
+
const mappedResult = response.value.map((u) => ({
|
|
58
59
|
Email: u.email,
|
|
59
60
|
LoginName: u.loginName,
|
|
60
61
|
Title: u.name,
|
|
61
|
-
PrincipalType: null,
|
|
62
|
-
PrincipalTypeString: null,
|
|
63
62
|
IsPrimaryAdmin: u.loginName === primaryAdminLoginName
|
|
64
63
|
}));
|
|
65
64
|
await logger.log(mappedResult);
|
|
@@ -72,32 +71,19 @@ class SpoSiteAdminListCommand extends SpoCommand {
|
|
|
72
71
|
}
|
|
73
72
|
return match[1];
|
|
74
73
|
}
|
|
75
|
-
async getPrimaryAdminLoginNameFromAdmin(adminUrl, siteId) {
|
|
76
|
-
const requestOptions = {
|
|
77
|
-
url: `${adminUrl}/_api/SPO.Tenant/sites('${siteId}')?$select=OwnerLoginName`,
|
|
78
|
-
headers: {
|
|
79
|
-
accept: 'application/json;odata=nometadata',
|
|
80
|
-
'content-type': 'application/json;charset=utf-8'
|
|
81
|
-
}
|
|
82
|
-
};
|
|
83
|
-
const response = await request.get(requestOptions);
|
|
84
|
-
const responseContent = JSON.parse(response);
|
|
85
|
-
return responseContent.OwnerLoginName;
|
|
86
|
-
}
|
|
87
74
|
async callAction(logger, args) {
|
|
88
75
|
if (this.verbose) {
|
|
89
76
|
await logger.logToStderr('Retrieving site administrators...');
|
|
90
77
|
}
|
|
91
78
|
const requestOptions = {
|
|
92
79
|
url: `${args.options.siteUrl}/_api/web/siteusers?$filter=IsSiteAdmin eq true`,
|
|
93
|
-
method: 'GET',
|
|
94
80
|
headers: {
|
|
95
81
|
'accept': 'application/json;odata=nometadata'
|
|
96
82
|
},
|
|
97
83
|
responseType: 'json'
|
|
98
84
|
};
|
|
99
85
|
const responseContent = await request.get(requestOptions);
|
|
100
|
-
const primaryOwnerLogin = await
|
|
86
|
+
const primaryOwnerLogin = await spo.getPrimaryOwnerLoginFromSite(args.options.siteUrl, logger, this.verbose);
|
|
101
87
|
const mappedResult = responseContent.value.map((u) => ({
|
|
102
88
|
Id: u.Id,
|
|
103
89
|
LoginName: u.LoginName,
|
|
@@ -109,23 +95,10 @@ class SpoSiteAdminListCommand extends SpoCommand {
|
|
|
109
95
|
}));
|
|
110
96
|
await logger.log(mappedResult);
|
|
111
97
|
}
|
|
112
|
-
async getPrimaryOwnerLoginFromSite(siteUrl) {
|
|
113
|
-
const requestOptions = {
|
|
114
|
-
url: `${siteUrl}/_api/site/owner`,
|
|
115
|
-
method: 'GET',
|
|
116
|
-
headers: {
|
|
117
|
-
'accept': 'application/json;odata=nometadata'
|
|
118
|
-
},
|
|
119
|
-
responseType: 'json'
|
|
120
|
-
};
|
|
121
|
-
const responseContent = await request.get(requestOptions);
|
|
122
|
-
return responseContent?.LoginName ?? null;
|
|
123
|
-
}
|
|
124
98
|
}
|
|
125
99
|
_SpoSiteAdminListCommand_instances = new WeakSet(), _SpoSiteAdminListCommand_initTelemetry = function _SpoSiteAdminListCommand_initTelemetry() {
|
|
126
100
|
this.telemetry.push((args) => {
|
|
127
101
|
Object.assign(this.telemetryProperties, {
|
|
128
|
-
siteUrl: typeof args.options.siteUrl !== 'undefined',
|
|
129
102
|
asAdmin: !!args.options.asAdmin
|
|
130
103
|
});
|
|
131
104
|
});
|
|
@@ -139,6 +112,7 @@ _SpoSiteAdminListCommand_instances = new WeakSet(), _SpoSiteAdminListCommand_ini
|
|
|
139
112
|
this.validators.push(async (args) => validation.isValidSharePointUrl(args.options.siteUrl));
|
|
140
113
|
}, _SpoSiteAdminListCommand_initTypes = function _SpoSiteAdminListCommand_initTypes() {
|
|
141
114
|
this.types.string.push('siteUrl');
|
|
115
|
+
this.types.boolean.push('asAdmin');
|
|
142
116
|
};
|
|
143
117
|
export default new SpoSiteAdminListCommand();
|
|
144
118
|
//# sourceMappingURL=site-admin-list.js.map
|
|
@@ -0,0 +1,194 @@
|
|
|
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 _SpoSiteAdminRemoveCommand_instances, _SpoSiteAdminRemoveCommand_initTelemetry, _SpoSiteAdminRemoveCommand_initOptions, _SpoSiteAdminRemoveCommand_initValidators, _SpoSiteAdminRemoveCommand_initOptionSets, _SpoSiteAdminRemoveCommand_initTypes;
|
|
7
|
+
import { cli } from '../../../../cli/cli.js';
|
|
8
|
+
import request from '../../../../request.js';
|
|
9
|
+
import { entraGroup } from '../../../../utils/entraGroup.js';
|
|
10
|
+
import { entraUser } from '../../../../utils/entraUser.js';
|
|
11
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
12
|
+
import { spo } from '../../../../utils/spo.js';
|
|
13
|
+
import { validation } from '../../../../utils/validation.js';
|
|
14
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
15
|
+
import commands from '../../commands.js';
|
|
16
|
+
class SpoSiteAdminRemoveCommand extends SpoCommand {
|
|
17
|
+
get name() {
|
|
18
|
+
return commands.SITE_ADMIN_REMOVE;
|
|
19
|
+
}
|
|
20
|
+
get description() {
|
|
21
|
+
return 'Removes a user or group as site collection administrator';
|
|
22
|
+
}
|
|
23
|
+
constructor() {
|
|
24
|
+
super();
|
|
25
|
+
_SpoSiteAdminRemoveCommand_instances.add(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SpoSiteAdminRemoveCommand_instances, "m", _SpoSiteAdminRemoveCommand_initTelemetry).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SpoSiteAdminRemoveCommand_instances, "m", _SpoSiteAdminRemoveCommand_initOptions).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoSiteAdminRemoveCommand_instances, "m", _SpoSiteAdminRemoveCommand_initValidators).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoSiteAdminRemoveCommand_instances, "m", _SpoSiteAdminRemoveCommand_initOptionSets).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _SpoSiteAdminRemoveCommand_instances, "m", _SpoSiteAdminRemoveCommand_initTypes).call(this);
|
|
31
|
+
}
|
|
32
|
+
async commandAction(logger, args) {
|
|
33
|
+
try {
|
|
34
|
+
if (!args.options.force) {
|
|
35
|
+
const principalToDelete = args.options.groupId || args.options.groupName ? 'group' : 'user';
|
|
36
|
+
const result = await cli.promptForConfirmation({ message: `Are you sure you want to remove specified ${principalToDelete} from the site administrators list ${args.options.siteUrl}?` });
|
|
37
|
+
if (!result) {
|
|
38
|
+
return;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
const loginNameToRemove = await this.getCorrectLoginName(args.options);
|
|
42
|
+
if (args.options.asAdmin) {
|
|
43
|
+
await this.callActionAsAdmin(logger, args, loginNameToRemove);
|
|
44
|
+
return;
|
|
45
|
+
}
|
|
46
|
+
await this.callAction(logger, args, loginNameToRemove);
|
|
47
|
+
}
|
|
48
|
+
catch (err) {
|
|
49
|
+
this.handleRejectedODataJsonPromise(err);
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
async callActionAsAdmin(logger, args, loginNameToRemove) {
|
|
53
|
+
if (this.verbose) {
|
|
54
|
+
await logger.logToStderr('Removing site administrator as an administrator...');
|
|
55
|
+
}
|
|
56
|
+
const adminUrl = await spo.getSpoAdminUrl(logger, this.debug);
|
|
57
|
+
const siteId = await this.getSiteId(args.options.siteUrl, logger);
|
|
58
|
+
const primaryAdminLoginName = await spo.getPrimaryAdminLoginNameAsAdmin(adminUrl, siteId, logger, this.verbose);
|
|
59
|
+
if (loginNameToRemove === primaryAdminLoginName) {
|
|
60
|
+
throw 'You cannot remove the primary site collection administrator.';
|
|
61
|
+
}
|
|
62
|
+
const existingAdmins = await this.getSiteAdmins(adminUrl, siteId);
|
|
63
|
+
const adminsToSet = existingAdmins.filter(u => u.loginName.toLowerCase() !== loginNameToRemove.toLowerCase());
|
|
64
|
+
await this.setSiteAdminsAsAdmin(adminUrl, siteId, adminsToSet);
|
|
65
|
+
}
|
|
66
|
+
async getSiteId(siteUrl, logger) {
|
|
67
|
+
const siteGraphId = await spo.getSiteId(siteUrl, logger, this.verbose);
|
|
68
|
+
const match = siteGraphId.match(/,([a-f0-9\-]{36}),/i);
|
|
69
|
+
if (!match) {
|
|
70
|
+
throw `Site with URL ${siteUrl} not found`;
|
|
71
|
+
}
|
|
72
|
+
return match[1];
|
|
73
|
+
}
|
|
74
|
+
async getSiteAdmins(adminUrl, siteId) {
|
|
75
|
+
const requestOptions = {
|
|
76
|
+
url: `${adminUrl}/_api/SPO.Tenant/GetSiteAdministrators?siteId='${siteId}'`,
|
|
77
|
+
headers: {
|
|
78
|
+
accept: 'application/json;odata=nometadata',
|
|
79
|
+
'content-type': 'application/json;charset=utf-8'
|
|
80
|
+
},
|
|
81
|
+
responseType: 'json'
|
|
82
|
+
};
|
|
83
|
+
const response = await request.post(requestOptions);
|
|
84
|
+
return response.value;
|
|
85
|
+
}
|
|
86
|
+
async getCorrectLoginName(options) {
|
|
87
|
+
if (options.userId || options.userName) {
|
|
88
|
+
const userPrincipalName = options.userName ? options.userName : await entraUser.getUpnByUserId(options.userId);
|
|
89
|
+
if (userPrincipalName) {
|
|
90
|
+
return `i:0#.f|membership|${userPrincipalName}`;
|
|
91
|
+
}
|
|
92
|
+
throw 'User not found.';
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
const group = options.groupId ? await entraGroup.getGroupById(options.groupId) : await entraGroup.getGroupByDisplayName(options.groupName);
|
|
96
|
+
//for entra groups, M365 groups have an associated email and security groups don't
|
|
97
|
+
if (group?.mail) {
|
|
98
|
+
//M365 group is prefixed with c:0o.c|federateddirectoryclaimprovider
|
|
99
|
+
return `c:0o.c|federateddirectoryclaimprovider|${group.id}`;
|
|
100
|
+
}
|
|
101
|
+
else {
|
|
102
|
+
//security group is prefixed with c:0t.c|tenant
|
|
103
|
+
return `c:0t.c|tenant|${group?.id}`;
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
async setSiteAdminsAsAdmin(adminUrl, siteId, admins) {
|
|
108
|
+
const requestOptions = {
|
|
109
|
+
url: `${adminUrl}/_api/SPOInternalUseOnly.Tenant/SetSiteSecondaryAdministrators`,
|
|
110
|
+
headers: {
|
|
111
|
+
accept: 'application/json;odata=nometadata',
|
|
112
|
+
'content-type': 'application/json;charset=utf-8'
|
|
113
|
+
},
|
|
114
|
+
data: {
|
|
115
|
+
secondaryAdministratorsFieldsData: {
|
|
116
|
+
siteId: siteId,
|
|
117
|
+
secondaryAdministratorLoginNames: admins.map(u => u.loginName)
|
|
118
|
+
}
|
|
119
|
+
},
|
|
120
|
+
responseType: 'json'
|
|
121
|
+
};
|
|
122
|
+
await request.post(requestOptions);
|
|
123
|
+
}
|
|
124
|
+
async callAction(logger, args, loginNameToRemove) {
|
|
125
|
+
if (this.verbose) {
|
|
126
|
+
await logger.logToStderr('Removing site administrator...');
|
|
127
|
+
}
|
|
128
|
+
const primaryOwnerLogin = await spo.getPrimaryOwnerLoginFromSite(args.options.siteUrl, logger, this.verbose);
|
|
129
|
+
if (loginNameToRemove === primaryOwnerLogin) {
|
|
130
|
+
throw 'You cannot remove the primary site collection administrator.';
|
|
131
|
+
}
|
|
132
|
+
const requestOptions = {
|
|
133
|
+
url: `${args.options.siteUrl}/_api/web/siteusers('${formatting.encodeQueryParameter(loginNameToRemove)}')`,
|
|
134
|
+
headers: {
|
|
135
|
+
'accept': 'application/json',
|
|
136
|
+
'X-Http-Method': 'MERGE',
|
|
137
|
+
'If-Match': '*'
|
|
138
|
+
},
|
|
139
|
+
data: { IsSiteAdmin: false },
|
|
140
|
+
responseType: 'json'
|
|
141
|
+
};
|
|
142
|
+
await request.post(requestOptions);
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
_SpoSiteAdminRemoveCommand_instances = new WeakSet(), _SpoSiteAdminRemoveCommand_initTelemetry = function _SpoSiteAdminRemoveCommand_initTelemetry() {
|
|
146
|
+
this.telemetry.push((args) => {
|
|
147
|
+
Object.assign(this.telemetryProperties, {
|
|
148
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
149
|
+
userName: typeof args.options.userName !== 'undefined',
|
|
150
|
+
groupId: typeof args.options.groupId !== 'undefined',
|
|
151
|
+
groupName: typeof args.options.groupName !== 'undefined',
|
|
152
|
+
force: !!args.options.force,
|
|
153
|
+
asAdmin: !!args.options.asAdmin
|
|
154
|
+
});
|
|
155
|
+
});
|
|
156
|
+
}, _SpoSiteAdminRemoveCommand_initOptions = function _SpoSiteAdminRemoveCommand_initOptions() {
|
|
157
|
+
this.options.unshift({
|
|
158
|
+
option: '-u, --siteUrl <siteUrl>'
|
|
159
|
+
}, {
|
|
160
|
+
option: '--userId [userId]'
|
|
161
|
+
}, {
|
|
162
|
+
option: '--userName [userName]'
|
|
163
|
+
}, {
|
|
164
|
+
option: '--groupId [groupId]'
|
|
165
|
+
}, {
|
|
166
|
+
option: '--groupName [groupName]'
|
|
167
|
+
}, {
|
|
168
|
+
option: '--asAdmin'
|
|
169
|
+
}, {
|
|
170
|
+
option: '-f, --force'
|
|
171
|
+
});
|
|
172
|
+
}, _SpoSiteAdminRemoveCommand_initValidators = function _SpoSiteAdminRemoveCommand_initValidators() {
|
|
173
|
+
this.validators.push(async (args) => {
|
|
174
|
+
if (args.options.userId &&
|
|
175
|
+
!validation.isValidGuid(args.options.userId)) {
|
|
176
|
+
return `${args.options.userId} is not a valid GUID`;
|
|
177
|
+
}
|
|
178
|
+
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
179
|
+
return `${args.options.userName} is not a valid userName`;
|
|
180
|
+
}
|
|
181
|
+
if (args.options.groupId &&
|
|
182
|
+
!validation.isValidGuid(args.options.groupId)) {
|
|
183
|
+
return `${args.options.groupId} is not a valid GUID`;
|
|
184
|
+
}
|
|
185
|
+
return validation.isValidSharePointUrl(args.options.siteUrl);
|
|
186
|
+
});
|
|
187
|
+
}, _SpoSiteAdminRemoveCommand_initOptionSets = function _SpoSiteAdminRemoveCommand_initOptionSets() {
|
|
188
|
+
this.optionSets.push({ options: ['userId', 'userName', 'groupId', 'groupName'] });
|
|
189
|
+
}, _SpoSiteAdminRemoveCommand_initTypes = function _SpoSiteAdminRemoveCommand_initTypes() {
|
|
190
|
+
this.types.string.push('siteUrl', 'userId', 'userName', 'groupId', 'groupName');
|
|
191
|
+
this.types.boolean.push('force', 'asAdmin');
|
|
192
|
+
};
|
|
193
|
+
export default new SpoSiteAdminRemoveCommand();
|
|
194
|
+
//# sourceMappingURL=site-admin-remove.js.map
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
+
import { z } from 'zod';
|
|
4
|
+
import { zod } from '../../../../utils/zod.js';
|
|
5
|
+
import commands from '../../commands.js';
|
|
6
|
+
import { validation } from '../../../../utils/validation.js';
|
|
7
|
+
import request from '../../../../request.js';
|
|
8
|
+
const options = globalOptionsZod
|
|
9
|
+
.extend({
|
|
10
|
+
siteUrl: zod.alias('u', z.string()
|
|
11
|
+
.refine(url => validation.isValidSharePointUrl(url) === true, url => ({
|
|
12
|
+
message: `'${url}' is not a valid SharePoint Online site URL.`
|
|
13
|
+
}))),
|
|
14
|
+
capability: z.enum(['full', 'limited', 'ownersOnly'])
|
|
15
|
+
})
|
|
16
|
+
.strict();
|
|
17
|
+
class SpoSiteSharingPermissionSetCommand extends SpoCommand {
|
|
18
|
+
get name() {
|
|
19
|
+
return commands.SITE_SHARINGPERMISSION_SET;
|
|
20
|
+
}
|
|
21
|
+
get description() {
|
|
22
|
+
return 'Controls how a site and its components can be shared';
|
|
23
|
+
}
|
|
24
|
+
get schema() {
|
|
25
|
+
return options;
|
|
26
|
+
}
|
|
27
|
+
async commandAction(logger, args) {
|
|
28
|
+
try {
|
|
29
|
+
if (this.verbose) {
|
|
30
|
+
await logger.logToStderr(`Updating sharing permissions for site '${args.options.siteUrl}'...`);
|
|
31
|
+
}
|
|
32
|
+
const { capability } = args.options;
|
|
33
|
+
if (this.verbose) {
|
|
34
|
+
await logger.logToStderr(`Updating site sharing permissions...`);
|
|
35
|
+
}
|
|
36
|
+
const requestOptionsWeb = {
|
|
37
|
+
url: `${args.options.siteUrl}/_api/Web`,
|
|
38
|
+
headers: {
|
|
39
|
+
accept: 'application/json;odata=nometadata'
|
|
40
|
+
},
|
|
41
|
+
responseType: 'json',
|
|
42
|
+
data: {
|
|
43
|
+
MembersCanShare: capability === 'full' || capability === 'limited'
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
await request.patch(requestOptionsWeb);
|
|
47
|
+
if (this.verbose) {
|
|
48
|
+
await logger.logToStderr(`Updating associated member group sharing permissions...`);
|
|
49
|
+
}
|
|
50
|
+
const requestOptionsMemberGroup = {
|
|
51
|
+
url: `${args.options.siteUrl}/_api/Web/AssociatedMemberGroup`,
|
|
52
|
+
headers: {
|
|
53
|
+
accept: 'application/json;odata=nometadata'
|
|
54
|
+
},
|
|
55
|
+
responseType: 'json',
|
|
56
|
+
data: {
|
|
57
|
+
AllowMembersEditMembership: capability === 'full'
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
await request.patch(requestOptionsMemberGroup);
|
|
61
|
+
}
|
|
62
|
+
catch (err) {
|
|
63
|
+
this.handleRejectedODataJsonPromise(err);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
export default new SpoSiteSharingPermissionSetCommand();
|
|
68
|
+
//# sourceMappingURL=site-sharingpermission-set.js.map
|
|
@@ -37,8 +37,9 @@ class SpoSiteScriptGetCommand extends SpoCommand {
|
|
|
37
37
|
responseType: 'json'
|
|
38
38
|
};
|
|
39
39
|
const response = await request.post(requestOptions);
|
|
40
|
-
|
|
41
|
-
|
|
40
|
+
response.Content = JSON.parse(response.Content);
|
|
41
|
+
if (args.options.content) {
|
|
42
|
+
await logger.log(response.Content);
|
|
42
43
|
return;
|
|
43
44
|
}
|
|
44
45
|
await logger.log(response);
|
|
@@ -22,9 +22,7 @@ class SpoSiteScriptListCommand extends SpoCommand {
|
|
|
22
22
|
responseType: 'json'
|
|
23
23
|
};
|
|
24
24
|
const res = await request.post(requestOptions);
|
|
25
|
-
|
|
26
|
-
await logger.log(res.value);
|
|
27
|
-
}
|
|
25
|
+
await logger.log(res.value);
|
|
28
26
|
}
|
|
29
27
|
catch (err) {
|
|
30
28
|
this.handleRejectedODataJsonPromise(err);
|
|
@@ -3,16 +3,16 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var
|
|
6
|
+
var _SpoTenantSiteListCommand_instances, _SpoTenantSiteListCommand_initTelemetry, _SpoTenantSiteListCommand_initOptions, _SpoTenantSiteListCommand_initValidators;
|
|
7
7
|
import config from '../../../../config.js';
|
|
8
8
|
import request from '../../../../request.js';
|
|
9
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
10
|
import { spo } from '../../../../utils/spo.js';
|
|
11
11
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
|
-
class
|
|
13
|
+
class SpoTenantSiteListCommand extends SpoCommand {
|
|
14
14
|
get name() {
|
|
15
|
-
return commands.
|
|
15
|
+
return commands.TENANT_SITE_LIST;
|
|
16
16
|
}
|
|
17
17
|
get description() {
|
|
18
18
|
return 'Lists sites of the given type';
|
|
@@ -22,10 +22,13 @@ class SpoSiteListCommand extends SpoCommand {
|
|
|
22
22
|
}
|
|
23
23
|
constructor() {
|
|
24
24
|
super();
|
|
25
|
-
|
|
26
|
-
__classPrivateFieldGet(this,
|
|
27
|
-
__classPrivateFieldGet(this,
|
|
28
|
-
__classPrivateFieldGet(this,
|
|
25
|
+
_SpoTenantSiteListCommand_instances.add(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SpoTenantSiteListCommand_instances, "m", _SpoTenantSiteListCommand_initTelemetry).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SpoTenantSiteListCommand_instances, "m", _SpoTenantSiteListCommand_initOptions).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoTenantSiteListCommand_instances, "m", _SpoTenantSiteListCommand_initValidators).call(this);
|
|
29
|
+
}
|
|
30
|
+
alias() {
|
|
31
|
+
return [commands.SITE_LIST];
|
|
29
32
|
}
|
|
30
33
|
async commandAction(logger, args) {
|
|
31
34
|
const webTemplate = this.getWebTemplateId(args.options);
|
|
@@ -86,7 +89,7 @@ class SpoSiteListCommand extends SpoCommand {
|
|
|
86
89
|
}
|
|
87
90
|
}
|
|
88
91
|
}
|
|
89
|
-
|
|
92
|
+
_SpoTenantSiteListCommand_instances = new WeakSet(), _SpoTenantSiteListCommand_initTelemetry = function _SpoTenantSiteListCommand_initTelemetry() {
|
|
90
93
|
this.telemetry.push((args) => {
|
|
91
94
|
Object.assign(this.telemetryProperties, {
|
|
92
95
|
webTemplate: args.options.webTemplate,
|
|
@@ -95,7 +98,7 @@ _SpoSiteListCommand_instances = new WeakSet(), _SpoSiteListCommand_initTelemetry
|
|
|
95
98
|
includeOneDriveSites: typeof args.options.includeOneDriveSites !== 'undefined'
|
|
96
99
|
});
|
|
97
100
|
});
|
|
98
|
-
},
|
|
101
|
+
}, _SpoTenantSiteListCommand_initOptions = function _SpoTenantSiteListCommand_initOptions() {
|
|
99
102
|
this.options.unshift({
|
|
100
103
|
option: '-t, --type [type]',
|
|
101
104
|
autocomplete: ['TeamSite', 'CommunicationSite']
|
|
@@ -106,7 +109,7 @@ _SpoSiteListCommand_instances = new WeakSet(), _SpoSiteListCommand_initTelemetry
|
|
|
106
109
|
}, {
|
|
107
110
|
option: '--includeOneDriveSites'
|
|
108
111
|
});
|
|
109
|
-
},
|
|
112
|
+
}, _SpoTenantSiteListCommand_initValidators = function _SpoTenantSiteListCommand_initValidators() {
|
|
110
113
|
this.validators.push(async (args) => {
|
|
111
114
|
if (args.options.type && args.options.webTemplate) {
|
|
112
115
|
return 'Specify either type or webTemplate, but not both';
|
|
@@ -123,5 +126,5 @@ _SpoSiteListCommand_instances = new WeakSet(), _SpoSiteListCommand_initTelemetry
|
|
|
123
126
|
return true;
|
|
124
127
|
});
|
|
125
128
|
};
|
|
126
|
-
export default new
|
|
127
|
-
//# sourceMappingURL=site-list.js.map
|
|
129
|
+
export default new SpoTenantSiteListCommand();
|
|
130
|
+
//# sourceMappingURL=tenant-site-list.js.map
|
|
@@ -0,0 +1,118 @@
|
|
|
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 _SpoTenantSiteMembershipListCommand_instances, _a, _SpoTenantSiteMembershipListCommand_initTelemetry, _SpoTenantSiteMembershipListCommand_initOptions, _SpoTenantSiteMembershipListCommand_initValidators, _SpoTenantSiteMembershipListCommand_initTypes;
|
|
7
|
+
import { odata } from '../../../../utils/odata.js';
|
|
8
|
+
import { spo } from '../../../../utils/spo.js';
|
|
9
|
+
import { validation } from '../../../../utils/validation.js';
|
|
10
|
+
import SpoCommand from '../../../base/SpoCommand.js';
|
|
11
|
+
import commands from '../../commands.js';
|
|
12
|
+
class SpoTenantSiteMembershipListCommand extends SpoCommand {
|
|
13
|
+
get name() {
|
|
14
|
+
return commands.TENANT_SITE_MEMBERSHIP_LIST;
|
|
15
|
+
}
|
|
16
|
+
get description() {
|
|
17
|
+
return `Retrieves information about default site groups' membership`;
|
|
18
|
+
}
|
|
19
|
+
defaultProperties() {
|
|
20
|
+
return ['email', 'name', 'userPrincipalName', 'associatedGroupType'];
|
|
21
|
+
}
|
|
22
|
+
constructor() {
|
|
23
|
+
super();
|
|
24
|
+
_SpoTenantSiteMembershipListCommand_instances.add(this);
|
|
25
|
+
__classPrivateFieldGet(this, _SpoTenantSiteMembershipListCommand_instances, "m", _SpoTenantSiteMembershipListCommand_initTelemetry).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SpoTenantSiteMembershipListCommand_instances, "m", _SpoTenantSiteMembershipListCommand_initOptions).call(this);
|
|
27
|
+
__classPrivateFieldGet(this, _SpoTenantSiteMembershipListCommand_instances, "m", _SpoTenantSiteMembershipListCommand_initValidators).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _SpoTenantSiteMembershipListCommand_instances, "m", _SpoTenantSiteMembershipListCommand_initTypes).call(this);
|
|
29
|
+
}
|
|
30
|
+
;
|
|
31
|
+
async commandAction(logger, args) {
|
|
32
|
+
try {
|
|
33
|
+
const spoAdminUrl = await spo.getSpoAdminUrl(logger, this.verbose);
|
|
34
|
+
const roleIds = this.getRoleIds(args.options.role);
|
|
35
|
+
const tenantSiteProperties = await spo.getSiteAdminPropertiesByUrl(args.options.siteUrl, false, logger, this.verbose);
|
|
36
|
+
const response = await odata.getAllItems(`${spoAdminUrl}/_api/SPO.Tenant/sites/GetSiteUserGroups?siteId='${tenantSiteProperties.SiteId}'&userGroupIds=[${roleIds}]`);
|
|
37
|
+
const result = args.options.output === 'json' ? this.mapResult(response, args.options.role) : this.mapListResult(response, args.options.role);
|
|
38
|
+
await logger.log(result);
|
|
39
|
+
}
|
|
40
|
+
catch (err) {
|
|
41
|
+
this.handleRejectedODataJsonPromise(err);
|
|
42
|
+
}
|
|
43
|
+
}
|
|
44
|
+
getRoleIds(role) {
|
|
45
|
+
switch (role?.toLowerCase()) {
|
|
46
|
+
case 'owner':
|
|
47
|
+
return '0';
|
|
48
|
+
case 'member':
|
|
49
|
+
return '1';
|
|
50
|
+
case 'visitor':
|
|
51
|
+
return '2';
|
|
52
|
+
default:
|
|
53
|
+
return '0,1,2';
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
mapResult(response, role) {
|
|
57
|
+
switch (role?.toLowerCase()) {
|
|
58
|
+
case 'owner':
|
|
59
|
+
return { AssociatedOwnerGroup: response[0].userGroup };
|
|
60
|
+
case 'member':
|
|
61
|
+
return { AssociatedMemberGroup: response[0].userGroup };
|
|
62
|
+
case 'visitor':
|
|
63
|
+
return { AssociatedVisitorGroup: response[0].userGroup };
|
|
64
|
+
default:
|
|
65
|
+
return {
|
|
66
|
+
AssociatedOwnerGroup: response[0].userGroup,
|
|
67
|
+
AssociatedMemberGroup: response[1].userGroup,
|
|
68
|
+
AssociatedVisitorGroup: response[2].userGroup
|
|
69
|
+
};
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
mapListResult(response, role) {
|
|
73
|
+
const mapGroup = (groupIndex, groupType) => response[groupIndex].userGroup.map(user => ({
|
|
74
|
+
...user,
|
|
75
|
+
associatedGroupType: groupType
|
|
76
|
+
}));
|
|
77
|
+
switch (role?.toLowerCase()) {
|
|
78
|
+
case 'owner':
|
|
79
|
+
return mapGroup(0, 'Owner');
|
|
80
|
+
case 'member':
|
|
81
|
+
return mapGroup(0, 'Member');
|
|
82
|
+
case 'visitor':
|
|
83
|
+
return mapGroup(0, 'Visitor');
|
|
84
|
+
default:
|
|
85
|
+
return [
|
|
86
|
+
...mapGroup(0, 'Owner'),
|
|
87
|
+
...mapGroup(1, 'Member'),
|
|
88
|
+
...mapGroup(2, 'Visitor')
|
|
89
|
+
];
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
_a = SpoTenantSiteMembershipListCommand, _SpoTenantSiteMembershipListCommand_instances = new WeakSet(), _SpoTenantSiteMembershipListCommand_initTelemetry = function _SpoTenantSiteMembershipListCommand_initTelemetry() {
|
|
94
|
+
this.telemetry.push((args) => {
|
|
95
|
+
Object.assign(this.telemetryProperties, {
|
|
96
|
+
role: typeof args.options.role !== 'undefined'
|
|
97
|
+
});
|
|
98
|
+
});
|
|
99
|
+
}, _SpoTenantSiteMembershipListCommand_initOptions = function _SpoTenantSiteMembershipListCommand_initOptions() {
|
|
100
|
+
this.options.unshift({
|
|
101
|
+
option: '-u, --siteUrl <siteUrl>'
|
|
102
|
+
}, {
|
|
103
|
+
option: '-r, --role [role]',
|
|
104
|
+
autocomplete: _a.RoleNames
|
|
105
|
+
});
|
|
106
|
+
}, _SpoTenantSiteMembershipListCommand_initValidators = function _SpoTenantSiteMembershipListCommand_initValidators() {
|
|
107
|
+
this.validators.push(async (args) => {
|
|
108
|
+
if (args.options.role && !_a.RoleNames.some(roleName => roleName.toLocaleLowerCase() === args.options.role.toLocaleLowerCase())) {
|
|
109
|
+
return `'${args.options.role}' is not a valid value for option 'role'. Valid values are: ${_a.RoleNames.join(', ')}`;
|
|
110
|
+
}
|
|
111
|
+
return validation.isValidSharePointUrl(args.options.siteUrl);
|
|
112
|
+
});
|
|
113
|
+
}, _SpoTenantSiteMembershipListCommand_initTypes = function _SpoTenantSiteMembershipListCommand_initTypes() {
|
|
114
|
+
this.types.string.push('role', 'siteUrl');
|
|
115
|
+
};
|
|
116
|
+
SpoTenantSiteMembershipListCommand.RoleNames = ['Owner', 'Member', 'Visitor'];
|
|
117
|
+
export default new SpoTenantSiteMembershipListCommand();
|
|
118
|
+
//# sourceMappingURL=tenant-site-membership-list.js.map
|