@pnp/cli-microsoft365 10.0.0-beta.48e9f7d → 10.0.0-beta.558f289
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 +17 -16
- 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/cli/cli.js +14 -0
- package/dist/config.js +61 -5
- package/dist/m365/base/PowerAutomateCommand.js +1 -1
- package/dist/m365/base/SpoCommand.js +1 -1
- package/dist/m365/cli/commands/cli-consent.js +2 -2
- package/dist/m365/cli/commands/cli-doctor.js +4 -4
- package/dist/m365/cli/commands/config/config-set.js +12 -4
- package/dist/m365/cli/commands.js +1 -2
- package/dist/m365/commands/login.js +133 -61
- package/dist/m365/commands/setup.js +256 -33
- package/dist/m365/commands/setupPresets.js +2 -4
- package/dist/m365/connection/commands/connection-list.js +4 -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 +51 -292
- 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 +6 -1
- package/dist/telemetryRunner.js +2 -2
- package/dist/utils/entraApp.js +283 -0
- 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 +6 -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 +17 -6
- 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 +20 -21
- package/dist/m365/cli/commands/cli-reconsent.js +0 -30
- 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
|
@@ -9,10 +9,9 @@ import { v4 } from 'uuid';
|
|
|
9
9
|
import auth from '../../../../Auth.js';
|
|
10
10
|
import request from '../../../../request.js';
|
|
11
11
|
import { accessToken } from '../../../../utils/accessToken.js';
|
|
12
|
-
import {
|
|
12
|
+
import { entraApp } from '../../../../utils/entraApp.js';
|
|
13
13
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
14
14
|
import commands from '../../commands.js';
|
|
15
|
-
import aadCommands from '../../aadCommands.js';
|
|
16
15
|
class EntraAppAddCommand extends GraphCommand {
|
|
17
16
|
get name() {
|
|
18
17
|
return commands.APP_ADD;
|
|
@@ -20,31 +19,48 @@ class EntraAppAddCommand extends GraphCommand {
|
|
|
20
19
|
get description() {
|
|
21
20
|
return 'Creates new Entra app registration';
|
|
22
21
|
}
|
|
23
|
-
alias() {
|
|
24
|
-
return [aadCommands.APP_ADD, commands.APPREGISTRATION_ADD];
|
|
25
|
-
}
|
|
26
22
|
constructor() {
|
|
27
23
|
super();
|
|
28
24
|
_EntraAppAddCommand_instances.add(this);
|
|
29
25
|
this.appName = '';
|
|
30
|
-
this.appPermissions = [];
|
|
31
26
|
__classPrivateFieldGet(this, _EntraAppAddCommand_instances, "m", _EntraAppAddCommand_initTelemetry).call(this);
|
|
32
27
|
__classPrivateFieldGet(this, _EntraAppAddCommand_instances, "m", _EntraAppAddCommand_initOptions).call(this);
|
|
33
28
|
__classPrivateFieldGet(this, _EntraAppAddCommand_instances, "m", _EntraAppAddCommand_initValidators).call(this);
|
|
34
29
|
__classPrivateFieldGet(this, _EntraAppAddCommand_instances, "m", _EntraAppAddCommand_initOptionSets).call(this);
|
|
35
30
|
}
|
|
36
31
|
async commandAction(logger, args) {
|
|
37
|
-
|
|
32
|
+
if (!args.options.name && this.manifest) {
|
|
33
|
+
args.options.name = this.manifest.name;
|
|
34
|
+
}
|
|
35
|
+
this.appName = args.options.name;
|
|
38
36
|
try {
|
|
39
|
-
const apis = await
|
|
40
|
-
|
|
37
|
+
const apis = await entraApp.resolveApis({
|
|
38
|
+
options: args.options,
|
|
39
|
+
manifest: this.manifest,
|
|
40
|
+
logger,
|
|
41
|
+
verbose: this.verbose,
|
|
42
|
+
debug: this.debug
|
|
43
|
+
});
|
|
44
|
+
let appInfo = await entraApp.createAppRegistration({
|
|
45
|
+
options: args.options,
|
|
46
|
+
apis,
|
|
47
|
+
logger,
|
|
48
|
+
verbose: this.verbose,
|
|
49
|
+
debug: this.debug
|
|
50
|
+
});
|
|
41
51
|
// based on the assumption that we're adding Microsoft Entra app to the current
|
|
42
52
|
// directory. If we in the future extend the command with allowing
|
|
43
53
|
// users to create Microsoft Entra app in a different directory, we'll need to
|
|
44
54
|
// adjust this
|
|
45
55
|
appInfo.tenantId = accessToken.getTenantIdFromAccessToken(auth.connection.accessTokens[auth.defaultResource].accessToken);
|
|
46
56
|
appInfo = await this.updateAppFromManifest(args, appInfo);
|
|
47
|
-
appInfo = await
|
|
57
|
+
appInfo = await entraApp.grantAdminConsent({
|
|
58
|
+
appInfo,
|
|
59
|
+
appPermissions: entraApp.appPermissions,
|
|
60
|
+
adminConsent: args.options.grantAdminConsent,
|
|
61
|
+
logger,
|
|
62
|
+
debug: this.debug
|
|
63
|
+
});
|
|
48
64
|
appInfo = await this.configureUri(args, appInfo, logger);
|
|
49
65
|
appInfo = await this.configureSecret(args, appInfo, logger);
|
|
50
66
|
const _appInfo = await this.saveAppInfo(args, appInfo, logger);
|
|
@@ -62,128 +78,45 @@ class EntraAppAddCommand extends GraphCommand {
|
|
|
62
78
|
this.handleRejectedODataJsonPromise(err);
|
|
63
79
|
}
|
|
64
80
|
}
|
|
65
|
-
async
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
signInAudience: args.options.multitenant ? 'AzureADMultipleOrgs' : 'AzureADMyOrg'
|
|
69
|
-
};
|
|
70
|
-
if (!applicationInfo.displayName && this.manifest) {
|
|
71
|
-
applicationInfo.displayName = this.manifest.name;
|
|
72
|
-
}
|
|
73
|
-
this.appName = applicationInfo.displayName;
|
|
74
|
-
if (apis.length > 0) {
|
|
75
|
-
applicationInfo.requiredResourceAccess = apis;
|
|
76
|
-
}
|
|
77
|
-
if (args.options.redirectUris) {
|
|
78
|
-
applicationInfo[args.options.platform] = {
|
|
79
|
-
redirectUris: args.options.redirectUris.split(',').map(u => u.trim())
|
|
80
|
-
};
|
|
81
|
-
}
|
|
82
|
-
if (args.options.implicitFlow) {
|
|
83
|
-
if (!applicationInfo.web) {
|
|
84
|
-
applicationInfo.web = {};
|
|
85
|
-
}
|
|
86
|
-
applicationInfo.web.implicitGrantSettings = {
|
|
87
|
-
enableAccessTokenIssuance: true,
|
|
88
|
-
enableIdTokenIssuance: true
|
|
89
|
-
};
|
|
90
|
-
}
|
|
91
|
-
if (args.options.certificateFile || args.options.certificateBase64Encoded) {
|
|
92
|
-
const certificateBase64Encoded = await this.getCertificateBase64Encoded(args, logger);
|
|
93
|
-
const newKeyCredential = {
|
|
94
|
-
type: "AsymmetricX509Cert",
|
|
95
|
-
usage: "Verify",
|
|
96
|
-
displayName: args.options.certificateDisplayName,
|
|
97
|
-
key: certificateBase64Encoded
|
|
98
|
-
};
|
|
99
|
-
applicationInfo.keyCredentials = [newKeyCredential];
|
|
100
|
-
}
|
|
101
|
-
if (args.options.allowPublicClientFlows) {
|
|
102
|
-
applicationInfo.isFallbackPublicClient = true;
|
|
81
|
+
async configureSecret(args, appInfo, logger) {
|
|
82
|
+
if (!args.options.withSecret || (appInfo.secrets && appInfo.secrets.length > 0)) {
|
|
83
|
+
return appInfo;
|
|
103
84
|
}
|
|
104
85
|
if (this.verbose) {
|
|
105
|
-
await logger.logToStderr(`
|
|
106
|
-
}
|
|
107
|
-
const createApplicationRequestOptions = {
|
|
108
|
-
url: `${this.resource}/v1.0/myorganization/applications`,
|
|
109
|
-
headers: {
|
|
110
|
-
accept: 'application/json;odata.metadata=none'
|
|
111
|
-
},
|
|
112
|
-
responseType: 'json',
|
|
113
|
-
data: applicationInfo
|
|
114
|
-
};
|
|
115
|
-
return request.post(createApplicationRequestOptions);
|
|
116
|
-
}
|
|
117
|
-
async grantAdminConsent(appInfo, adminConsent, logger) {
|
|
118
|
-
if (!adminConsent || this.appPermissions.length === 0) {
|
|
119
|
-
return appInfo;
|
|
86
|
+
await logger.logToStderr(`Configure Microsoft Entra app secret...`);
|
|
120
87
|
}
|
|
121
|
-
const
|
|
122
|
-
if (
|
|
123
|
-
|
|
88
|
+
const secret = await this.createSecret({ appObjectId: appInfo.id });
|
|
89
|
+
if (!appInfo.secrets) {
|
|
90
|
+
appInfo.secrets = [];
|
|
124
91
|
}
|
|
125
|
-
|
|
126
|
-
this.appPermissions.forEach(async (permission) => {
|
|
127
|
-
if (permission.scope.length > 0) {
|
|
128
|
-
tasks.push(this.grantOAuth2Permission(sp.id, permission.resourceId, permission.scope.join(' ')));
|
|
129
|
-
if (this.debug) {
|
|
130
|
-
await logger.logToStderr(`Admin consent granted for following resource ${permission.resourceId}, with delegated permissions: ${permission.scope.join(',')}`);
|
|
131
|
-
}
|
|
132
|
-
}
|
|
133
|
-
permission.resourceAccess.filter(access => access.type === "Role").forEach(async (access) => {
|
|
134
|
-
tasks.push(this.addRoleToServicePrincipal(sp.id, permission.resourceId, access.id));
|
|
135
|
-
if (this.debug) {
|
|
136
|
-
await logger.logToStderr(`Admin consent granted for following resource ${permission.resourceId}, with application permission: ${access.id}`);
|
|
137
|
-
}
|
|
138
|
-
});
|
|
139
|
-
});
|
|
140
|
-
await Promise.all(tasks);
|
|
92
|
+
appInfo.secrets.push(secret);
|
|
141
93
|
return appInfo;
|
|
142
94
|
}
|
|
143
|
-
async
|
|
95
|
+
async createSecret({ appObjectId, displayName = undefined, expirationDate = undefined }) {
|
|
96
|
+
let secretExpirationDate = expirationDate;
|
|
97
|
+
if (!secretExpirationDate) {
|
|
98
|
+
secretExpirationDate = new Date();
|
|
99
|
+
secretExpirationDate.setFullYear(secretExpirationDate.getFullYear() + 1);
|
|
100
|
+
}
|
|
101
|
+
const secretName = displayName ?? 'Default';
|
|
144
102
|
const requestOptions = {
|
|
145
|
-
url: `${this.resource}/v1.0/myorganization/
|
|
146
|
-
headers: {
|
|
147
|
-
'Content-Type': 'application/json'
|
|
148
|
-
},
|
|
149
|
-
responseType: 'json',
|
|
150
|
-
data: {
|
|
151
|
-
appRoleId: appRoleId,
|
|
152
|
-
principalId: objectId,
|
|
153
|
-
resourceId: resourceId
|
|
154
|
-
}
|
|
155
|
-
};
|
|
156
|
-
return request.post(requestOptions);
|
|
157
|
-
}
|
|
158
|
-
async grantOAuth2Permission(appId, resourceId, scopeName) {
|
|
159
|
-
const grantAdminConsentApplicationRequestOptions = {
|
|
160
|
-
url: `${this.resource}/v1.0/myorganization/oauth2PermissionGrants`,
|
|
103
|
+
url: `${this.resource}/v1.0/myorganization/applications/${appObjectId}/addPassword`,
|
|
161
104
|
headers: {
|
|
162
|
-
|
|
105
|
+
'content-type': 'application/json'
|
|
163
106
|
},
|
|
164
107
|
responseType: 'json',
|
|
165
108
|
data: {
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
scope: scopeName
|
|
109
|
+
passwordCredential: {
|
|
110
|
+
displayName: secretName,
|
|
111
|
+
endDateTime: secretExpirationDate.toISOString()
|
|
112
|
+
}
|
|
171
113
|
}
|
|
172
114
|
};
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
url: `${this.resource}/v1.0/myorganization/servicePrincipals`,
|
|
178
|
-
headers: {
|
|
179
|
-
'content-type': 'application/json'
|
|
180
|
-
},
|
|
181
|
-
data: {
|
|
182
|
-
appId: appId
|
|
183
|
-
},
|
|
184
|
-
responseType: 'json'
|
|
115
|
+
const response = await request.post(requestOptions);
|
|
116
|
+
return {
|
|
117
|
+
displayName: secretName,
|
|
118
|
+
value: response.secretText
|
|
185
119
|
};
|
|
186
|
-
return request.post(requestOptions);
|
|
187
120
|
}
|
|
188
121
|
async updateAppFromManifest(args, appInfo) {
|
|
189
122
|
if (!args.options.manifest) {
|
|
@@ -423,180 +356,6 @@ class EntraAppAddCommand extends GraphCommand {
|
|
|
423
356
|
await request.patch(requestOptions);
|
|
424
357
|
return appInfo;
|
|
425
358
|
}
|
|
426
|
-
async resolveApis(args, logger) {
|
|
427
|
-
if (!args.options.apisDelegated && !args.options.apisApplication
|
|
428
|
-
&& (typeof this.manifest?.requiredResourceAccess === 'undefined' || this.manifest.requiredResourceAccess.length === 0)) {
|
|
429
|
-
return [];
|
|
430
|
-
}
|
|
431
|
-
if (this.verbose) {
|
|
432
|
-
await logger.logToStderr('Resolving requested APIs...');
|
|
433
|
-
}
|
|
434
|
-
const servicePrincipals = await odata.getAllItems(`${this.resource}/v1.0/myorganization/servicePrincipals?$select=appId,appRoles,id,oauth2PermissionScopes,servicePrincipalNames`);
|
|
435
|
-
let resolvedApis = [];
|
|
436
|
-
try {
|
|
437
|
-
if (args.options.apisDelegated || args.options.apisApplication) {
|
|
438
|
-
resolvedApis = await this.getRequiredResourceAccessForApis(servicePrincipals, args.options.apisDelegated, 'Scope', logger);
|
|
439
|
-
if (this.verbose) {
|
|
440
|
-
await logger.logToStderr(`Resolved delegated permissions: ${JSON.stringify(resolvedApis, null, 2)}`);
|
|
441
|
-
}
|
|
442
|
-
const resolvedApplicationApis = await this.getRequiredResourceAccessForApis(servicePrincipals, args.options.apisApplication, 'Role', logger);
|
|
443
|
-
if (this.verbose) {
|
|
444
|
-
await logger.logToStderr(`Resolved application permissions: ${JSON.stringify(resolvedApplicationApis, null, 2)}`);
|
|
445
|
-
}
|
|
446
|
-
// merge resolved application APIs onto resolved delegated APIs
|
|
447
|
-
resolvedApplicationApis.forEach(resolvedRequiredResource => {
|
|
448
|
-
const requiredResource = resolvedApis.find(api => api.resourceAppId === resolvedRequiredResource.resourceAppId);
|
|
449
|
-
if (requiredResource) {
|
|
450
|
-
requiredResource.resourceAccess.push(...resolvedRequiredResource.resourceAccess);
|
|
451
|
-
}
|
|
452
|
-
else {
|
|
453
|
-
resolvedApis.push(resolvedRequiredResource);
|
|
454
|
-
}
|
|
455
|
-
});
|
|
456
|
-
}
|
|
457
|
-
else {
|
|
458
|
-
const manifestApis = this.manifest.requiredResourceAccess;
|
|
459
|
-
manifestApis.forEach(manifestApi => {
|
|
460
|
-
resolvedApis.push(manifestApi);
|
|
461
|
-
const app = servicePrincipals.find(servicePrincipals => servicePrincipals.appId === manifestApi.resourceAppId);
|
|
462
|
-
if (app) {
|
|
463
|
-
manifestApi.resourceAccess.forEach((res => {
|
|
464
|
-
const resourceAccessPermission = {
|
|
465
|
-
id: res.id,
|
|
466
|
-
type: res.type
|
|
467
|
-
};
|
|
468
|
-
const oAuthValue = app.oauth2PermissionScopes.find(scp => scp.id === res.id)?.value;
|
|
469
|
-
this.updateAppPermissions(app.id, resourceAccessPermission, oAuthValue);
|
|
470
|
-
}));
|
|
471
|
-
}
|
|
472
|
-
});
|
|
473
|
-
}
|
|
474
|
-
if (this.verbose) {
|
|
475
|
-
await logger.logToStderr(`Merged delegated and application permissions: ${JSON.stringify(resolvedApis, null, 2)}`);
|
|
476
|
-
await logger.logToStderr(`App role assignments: ${JSON.stringify(this.appPermissions.flatMap(permission => permission.resourceAccess.filter(access => access.type === "Role")), null, 2)}`);
|
|
477
|
-
await logger.logToStderr(`OAuth2 permissions: ${JSON.stringify(this.appPermissions.flatMap(permission => permission.scope), null, 2)}`);
|
|
478
|
-
}
|
|
479
|
-
return resolvedApis;
|
|
480
|
-
}
|
|
481
|
-
catch (e) {
|
|
482
|
-
throw e;
|
|
483
|
-
}
|
|
484
|
-
}
|
|
485
|
-
async getRequiredResourceAccessForApis(servicePrincipals, apis, scopeType, logger) {
|
|
486
|
-
if (!apis) {
|
|
487
|
-
return [];
|
|
488
|
-
}
|
|
489
|
-
const resolvedApis = [];
|
|
490
|
-
const requestedApis = apis.split(',').map(a => a.trim());
|
|
491
|
-
for (const api of requestedApis) {
|
|
492
|
-
const pos = api.lastIndexOf('/');
|
|
493
|
-
const permissionName = api.substr(pos + 1);
|
|
494
|
-
const servicePrincipalName = api.substr(0, pos);
|
|
495
|
-
if (this.debug) {
|
|
496
|
-
await logger.logToStderr(`Resolving ${api}...`);
|
|
497
|
-
await logger.logToStderr(`Permission name: ${permissionName}`);
|
|
498
|
-
await logger.logToStderr(`Service principal name: ${servicePrincipalName}`);
|
|
499
|
-
}
|
|
500
|
-
const servicePrincipal = servicePrincipals.find(sp => (sp.servicePrincipalNames.indexOf(servicePrincipalName) > -1 ||
|
|
501
|
-
sp.servicePrincipalNames.indexOf(`${servicePrincipalName}/`) > -1));
|
|
502
|
-
if (!servicePrincipal) {
|
|
503
|
-
throw `Service principal ${servicePrincipalName} not found`;
|
|
504
|
-
}
|
|
505
|
-
const scopesOfType = scopeType === 'Scope' ? servicePrincipal.oauth2PermissionScopes : servicePrincipal.appRoles;
|
|
506
|
-
const permission = scopesOfType.find(scope => scope.value === permissionName);
|
|
507
|
-
if (!permission) {
|
|
508
|
-
throw `Permission ${permissionName} for service principal ${servicePrincipalName} not found`;
|
|
509
|
-
}
|
|
510
|
-
let resolvedApi = resolvedApis.find(a => a.resourceAppId === servicePrincipal.appId);
|
|
511
|
-
if (!resolvedApi) {
|
|
512
|
-
resolvedApi = {
|
|
513
|
-
resourceAppId: servicePrincipal.appId,
|
|
514
|
-
resourceAccess: []
|
|
515
|
-
};
|
|
516
|
-
resolvedApis.push(resolvedApi);
|
|
517
|
-
}
|
|
518
|
-
const resourceAccessPermission = {
|
|
519
|
-
id: permission.id,
|
|
520
|
-
type: scopeType
|
|
521
|
-
};
|
|
522
|
-
resolvedApi.resourceAccess.push(resourceAccessPermission);
|
|
523
|
-
this.updateAppPermissions(servicePrincipal.id, resourceAccessPermission, permission.value);
|
|
524
|
-
}
|
|
525
|
-
return resolvedApis;
|
|
526
|
-
}
|
|
527
|
-
updateAppPermissions(spId, resourceAccessPermission, oAuth2PermissionValue) {
|
|
528
|
-
// During API resolution, we store globally both app role assignments and oauth2permissions
|
|
529
|
-
// So that we'll be able to parse them during the admin consent process
|
|
530
|
-
let existingPermission = this.appPermissions.find(oauth => oauth.resourceId === spId);
|
|
531
|
-
if (!existingPermission) {
|
|
532
|
-
existingPermission = {
|
|
533
|
-
resourceId: spId,
|
|
534
|
-
resourceAccess: [],
|
|
535
|
-
scope: []
|
|
536
|
-
};
|
|
537
|
-
this.appPermissions.push(existingPermission);
|
|
538
|
-
}
|
|
539
|
-
if (resourceAccessPermission.type === 'Scope' && oAuth2PermissionValue && !existingPermission.scope.find(scp => scp === oAuth2PermissionValue)) {
|
|
540
|
-
existingPermission.scope.push(oAuth2PermissionValue);
|
|
541
|
-
}
|
|
542
|
-
if (!existingPermission.resourceAccess.find(res => res.id === resourceAccessPermission.id)) {
|
|
543
|
-
existingPermission.resourceAccess.push(resourceAccessPermission);
|
|
544
|
-
}
|
|
545
|
-
}
|
|
546
|
-
async configureSecret(args, appInfo, logger) {
|
|
547
|
-
if (!args.options.withSecret || (appInfo.secrets && appInfo.secrets.length > 0)) {
|
|
548
|
-
return appInfo;
|
|
549
|
-
}
|
|
550
|
-
if (this.verbose) {
|
|
551
|
-
await logger.logToStderr(`Configure Microsoft Entra app secret...`);
|
|
552
|
-
}
|
|
553
|
-
const secret = await this.createSecret({ appObjectId: appInfo.id });
|
|
554
|
-
if (!appInfo.secrets) {
|
|
555
|
-
appInfo.secrets = [];
|
|
556
|
-
}
|
|
557
|
-
appInfo.secrets.push(secret);
|
|
558
|
-
return appInfo;
|
|
559
|
-
}
|
|
560
|
-
async createSecret({ appObjectId, displayName = undefined, expirationDate = undefined }) {
|
|
561
|
-
let secretExpirationDate = expirationDate;
|
|
562
|
-
if (!secretExpirationDate) {
|
|
563
|
-
secretExpirationDate = new Date();
|
|
564
|
-
secretExpirationDate.setFullYear(secretExpirationDate.getFullYear() + 1);
|
|
565
|
-
}
|
|
566
|
-
const secretName = displayName ?? 'Default';
|
|
567
|
-
const requestOptions = {
|
|
568
|
-
url: `${this.resource}/v1.0/myorganization/applications/${appObjectId}/addPassword`,
|
|
569
|
-
headers: {
|
|
570
|
-
'content-type': 'application/json'
|
|
571
|
-
},
|
|
572
|
-
responseType: 'json',
|
|
573
|
-
data: {
|
|
574
|
-
passwordCredential: {
|
|
575
|
-
displayName: secretName,
|
|
576
|
-
endDateTime: secretExpirationDate.toISOString()
|
|
577
|
-
}
|
|
578
|
-
}
|
|
579
|
-
};
|
|
580
|
-
const response = await request.post(requestOptions);
|
|
581
|
-
return {
|
|
582
|
-
displayName: secretName,
|
|
583
|
-
value: response.secretText
|
|
584
|
-
};
|
|
585
|
-
}
|
|
586
|
-
async getCertificateBase64Encoded(args, logger) {
|
|
587
|
-
if (args.options.certificateBase64Encoded) {
|
|
588
|
-
return args.options.certificateBase64Encoded;
|
|
589
|
-
}
|
|
590
|
-
if (this.debug) {
|
|
591
|
-
await logger.logToStderr(`Reading existing ${args.options.certificateFile}...`);
|
|
592
|
-
}
|
|
593
|
-
try {
|
|
594
|
-
return fs.readFileSync(args.options.certificateFile, { encoding: 'base64' });
|
|
595
|
-
}
|
|
596
|
-
catch (e) {
|
|
597
|
-
throw new Error(`Error reading certificate file: ${e}. Please add the certificate using base64 option '--certificateBase64Encoded'.`);
|
|
598
|
-
}
|
|
599
|
-
}
|
|
600
359
|
async saveAppInfo(args, appInfo, logger) {
|
|
601
360
|
if (!args.options.save) {
|
|
602
361
|
return appInfo;
|
|
@@ -11,7 +11,6 @@ import { validation } from '../../../../utils/validation.js';
|
|
|
11
11
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
13
|
import { cli } from '../../../../cli/cli.js';
|
|
14
|
-
import aadCommands from '../../aadCommands.js';
|
|
15
14
|
class EntraAppGetCommand extends GraphCommand {
|
|
16
15
|
get name() {
|
|
17
16
|
return commands.APP_GET;
|
|
@@ -19,9 +18,6 @@ class EntraAppGetCommand extends GraphCommand {
|
|
|
19
18
|
get description() {
|
|
20
19
|
return 'Gets an Entra app registration';
|
|
21
20
|
}
|
|
22
|
-
alias() {
|
|
23
|
-
return [aadCommands.APP_GET, commands.APPREGISTRATION_GET];
|
|
24
|
-
}
|
|
25
21
|
constructor() {
|
|
26
22
|
super();
|
|
27
23
|
_EntraAppGetCommand_instances.add(this);
|
|
@@ -31,7 +27,6 @@ class EntraAppGetCommand extends GraphCommand {
|
|
|
31
27
|
__classPrivateFieldGet(this, _EntraAppGetCommand_instances, "m", _EntraAppGetCommand_initOptionSets).call(this);
|
|
32
28
|
}
|
|
33
29
|
async commandAction(logger, args) {
|
|
34
|
-
await this.showDeprecationWarning(logger, aadCommands.APP_GET, commands.APP_GET);
|
|
35
30
|
try {
|
|
36
31
|
const appObjectId = await this.getAppObjectId(args);
|
|
37
32
|
const appInfo = await this.getAppInfo(appObjectId);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { odata } from "../../../../utils/odata.js";
|
|
2
2
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
3
|
import commands from '../../commands.js';
|
|
4
|
-
import aadCommands from '../../aadCommands.js';
|
|
5
4
|
class EntraAppListCommand extends GraphCommand {
|
|
6
5
|
get name() {
|
|
7
6
|
return commands.APP_LIST;
|
|
@@ -9,14 +8,10 @@ class EntraAppListCommand extends GraphCommand {
|
|
|
9
8
|
get description() {
|
|
10
9
|
return 'Retrieves a list of Entra app registrations';
|
|
11
10
|
}
|
|
12
|
-
alias() {
|
|
13
|
-
return [aadCommands.APP_LIST, commands.APPREGISTRATION_LIST];
|
|
14
|
-
}
|
|
15
11
|
defaultProperties() {
|
|
16
12
|
return ['appId', 'id', 'displayName', "signInAudience"];
|
|
17
13
|
}
|
|
18
14
|
async commandAction(logger) {
|
|
19
|
-
await this.showDeprecationWarning(logger, aadCommands.APP_LIST, commands.APP_LIST);
|
|
20
15
|
try {
|
|
21
16
|
const results = await odata.getAllItems(`${this.resource}/v1.0/applications`);
|
|
22
17
|
await logger.log(results);
|
|
@@ -9,7 +9,6 @@ import GraphCommand from "../../../base/GraphCommand.js";
|
|
|
9
9
|
import commands from "../../commands.js";
|
|
10
10
|
import request from "../../../../request.js";
|
|
11
11
|
import { validation } from "../../../../utils/validation.js";
|
|
12
|
-
import aadCommands from "../../aadCommands.js";
|
|
13
12
|
import { formatting } from "../../../../utils/formatting.js";
|
|
14
13
|
import { cli } from "../../../../cli/cli.js";
|
|
15
14
|
var ScopeType;
|
|
@@ -24,9 +23,6 @@ class EntraAppPermissionAddCommand extends GraphCommand {
|
|
|
24
23
|
get description() {
|
|
25
24
|
return 'Adds the specified application and/or delegated permissions to a specified Microsoft Entra app';
|
|
26
25
|
}
|
|
27
|
-
alias() {
|
|
28
|
-
return [aadCommands.APP_PERMISSION_ADD, commands.APPREGISTRATION_PERMISSION_ADD];
|
|
29
|
-
}
|
|
30
26
|
constructor() {
|
|
31
27
|
super();
|
|
32
28
|
_EntraAppPermissionAddCommand_instances.add(this);
|
|
@@ -36,7 +32,6 @@ class EntraAppPermissionAddCommand extends GraphCommand {
|
|
|
36
32
|
__classPrivateFieldGet(this, _EntraAppPermissionAddCommand_instances, "m", _EntraAppPermissionAddCommand_initOptionSets).call(this);
|
|
37
33
|
}
|
|
38
34
|
async commandAction(logger, args) {
|
|
39
|
-
await this.showDeprecationWarning(logger, aadCommands.APP_PERMISSION_ADD, commands.APP_PERMISSION_ADD);
|
|
40
35
|
try {
|
|
41
36
|
const appObject = await this.getAppObject(args.options);
|
|
42
37
|
const servicePrincipals = await this.getServicePrincipals();
|
|
@@ -9,7 +9,6 @@ import request from '../../../../request.js';
|
|
|
9
9
|
import { formatting } from '../../../../utils/formatting.js';
|
|
10
10
|
import { validation } from '../../../../utils/validation.js';
|
|
11
11
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
|
-
import aadCommands from '../../aadCommands.js';
|
|
13
12
|
import commands from '../../commands.js';
|
|
14
13
|
class EntraAppRemoveCommand extends GraphCommand {
|
|
15
14
|
get name() {
|
|
@@ -18,9 +17,6 @@ class EntraAppRemoveCommand extends GraphCommand {
|
|
|
18
17
|
get description() {
|
|
19
18
|
return 'Removes an Entra app registration';
|
|
20
19
|
}
|
|
21
|
-
alias() {
|
|
22
|
-
return [aadCommands.APP_REMOVE, commands.APPREGISTRATION_REMOVE];
|
|
23
|
-
}
|
|
24
20
|
constructor() {
|
|
25
21
|
super();
|
|
26
22
|
_EntraAppRemoveCommand_instances.add(this);
|
|
@@ -30,7 +26,6 @@ class EntraAppRemoveCommand extends GraphCommand {
|
|
|
30
26
|
__classPrivateFieldGet(this, _EntraAppRemoveCommand_instances, "m", _EntraAppRemoveCommand_initOptionSets).call(this);
|
|
31
27
|
}
|
|
32
28
|
async commandAction(logger, args) {
|
|
33
|
-
await this.showDeprecationWarning(logger, aadCommands.APP_REMOVE, commands.APP_REMOVE);
|
|
34
29
|
const deleteApp = async () => {
|
|
35
30
|
try {
|
|
36
31
|
const objectId = await this.getObjectId(args, logger);
|
|
@@ -10,7 +10,6 @@ import { formatting } from '../../../../utils/formatting.js';
|
|
|
10
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
12
|
import { cli } from '../../../../cli/cli.js';
|
|
13
|
-
import aadCommands from '../../aadCommands.js';
|
|
14
13
|
class EntraAppRoleAddCommand extends GraphCommand {
|
|
15
14
|
get name() {
|
|
16
15
|
return commands.APP_ROLE_ADD;
|
|
@@ -18,9 +17,6 @@ class EntraAppRoleAddCommand extends GraphCommand {
|
|
|
18
17
|
get description() {
|
|
19
18
|
return 'Adds role to the specified Entra app registration';
|
|
20
19
|
}
|
|
21
|
-
alias() {
|
|
22
|
-
return [aadCommands.APP_ROLE_ADD, commands.APPREGISTRATION_ROLE_ADD];
|
|
23
|
-
}
|
|
24
20
|
constructor() {
|
|
25
21
|
super();
|
|
26
22
|
_EntraAppRoleAddCommand_instances.add(this);
|
|
@@ -30,7 +26,6 @@ class EntraAppRoleAddCommand extends GraphCommand {
|
|
|
30
26
|
__classPrivateFieldGet(this, _EntraAppRoleAddCommand_instances, "m", _EntraAppRoleAddCommand_initOptionSets).call(this);
|
|
31
27
|
}
|
|
32
28
|
async commandAction(logger, args) {
|
|
33
|
-
await this.showDeprecationWarning(logger, aadCommands.APP_ROLE_ADD, commands.APP_ROLE_ADD);
|
|
34
29
|
try {
|
|
35
30
|
const appId = await this.getAppObjectId(args, logger);
|
|
36
31
|
const appInfo = await this.getAppInfo(appId, logger);
|
|
@@ -10,7 +10,6 @@ import { odata } from '../../../../utils/odata.js';
|
|
|
10
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
12
|
import { cli } from '../../../../cli/cli.js';
|
|
13
|
-
import aadCommands from '../../aadCommands.js';
|
|
14
13
|
class EntraAppRoleListCommand extends GraphCommand {
|
|
15
14
|
get name() {
|
|
16
15
|
return commands.APP_ROLE_LIST;
|
|
@@ -18,9 +17,6 @@ class EntraAppRoleListCommand extends GraphCommand {
|
|
|
18
17
|
get description() {
|
|
19
18
|
return 'Gets Entra app registration roles';
|
|
20
19
|
}
|
|
21
|
-
alias() {
|
|
22
|
-
return [aadCommands.APP_ROLE_LIST, commands.APPREGISTRATION_ROLE_LIST];
|
|
23
|
-
}
|
|
24
20
|
constructor() {
|
|
25
21
|
super();
|
|
26
22
|
_EntraAppRoleListCommand_instances.add(this);
|
|
@@ -32,7 +28,6 @@ class EntraAppRoleListCommand extends GraphCommand {
|
|
|
32
28
|
return ['displayName', 'description', 'id'];
|
|
33
29
|
}
|
|
34
30
|
async commandAction(logger, args) {
|
|
35
|
-
await this.showDeprecationWarning(logger, aadCommands.APP_ROLE_LIST, commands.APP_ROLE_LIST);
|
|
36
31
|
try {
|
|
37
32
|
const objectId = await this.getAppObjectId(args, logger);
|
|
38
33
|
const appRoles = await odata.getAllItems(`${this.resource}/v1.0/myorganization/applications/${objectId}/appRoles`);
|
|
@@ -10,7 +10,6 @@ import { formatting } from "../../../../utils/formatting.js";
|
|
|
10
10
|
import { validation } from '../../../../utils/validation.js';
|
|
11
11
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
|
-
import aadCommands from "../../aadCommands.js";
|
|
14
13
|
class EntraAppRoleRemoveCommand extends GraphCommand {
|
|
15
14
|
get name() {
|
|
16
15
|
return commands.APP_ROLE_REMOVE;
|
|
@@ -18,9 +17,6 @@ class EntraAppRoleRemoveCommand extends GraphCommand {
|
|
|
18
17
|
get description() {
|
|
19
18
|
return 'Removes role from the specified Entra app registration';
|
|
20
19
|
}
|
|
21
|
-
alias() {
|
|
22
|
-
return [aadCommands.APP_ROLE_REMOVE, commands.APPREGISTRATION_ROLE_REMOVE];
|
|
23
|
-
}
|
|
24
20
|
constructor() {
|
|
25
21
|
super();
|
|
26
22
|
_EntraAppRoleRemoveCommand_instances.add(this);
|
|
@@ -30,7 +26,6 @@ class EntraAppRoleRemoveCommand extends GraphCommand {
|
|
|
30
26
|
__classPrivateFieldGet(this, _EntraAppRoleRemoveCommand_instances, "m", _EntraAppRoleRemoveCommand_initOptionSets).call(this);
|
|
31
27
|
}
|
|
32
28
|
async commandAction(logger, args) {
|
|
33
|
-
await this.showDeprecationWarning(logger, aadCommands.APP_ROLE_REMOVE, commands.APP_ROLE_REMOVE);
|
|
34
29
|
const deleteAppRole = async () => {
|
|
35
30
|
try {
|
|
36
31
|
await this.processAppRoleDelete(logger, args);
|
|
@@ -10,7 +10,6 @@ import { formatting } from '../../../../utils/formatting.js';
|
|
|
10
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
12
|
import { cli } from '../../../../cli/cli.js';
|
|
13
|
-
import aadCommands from '../../aadCommands.js';
|
|
14
13
|
class EntraAppSetCommand extends GraphCommand {
|
|
15
14
|
get name() {
|
|
16
15
|
return commands.APP_SET;
|
|
@@ -18,9 +17,6 @@ class EntraAppSetCommand extends GraphCommand {
|
|
|
18
17
|
get description() {
|
|
19
18
|
return 'Updates Entra app registration';
|
|
20
19
|
}
|
|
21
|
-
alias() {
|
|
22
|
-
return [aadCommands.APP_SET, commands.APPREGISTRATION_SET];
|
|
23
|
-
}
|
|
24
20
|
constructor() {
|
|
25
21
|
super();
|
|
26
22
|
_EntraAppSetCommand_instances.add(this);
|
|
@@ -31,7 +27,6 @@ class EntraAppSetCommand extends GraphCommand {
|
|
|
31
27
|
__classPrivateFieldGet(this, _EntraAppSetCommand_instances, "m", _EntraAppSetCommand_initTypes).call(this);
|
|
32
28
|
}
|
|
33
29
|
async commandAction(logger, args) {
|
|
34
|
-
await this.showDeprecationWarning(logger, aadCommands.APP_SET, commands.APP_SET);
|
|
35
30
|
try {
|
|
36
31
|
let objectId = await this.getAppObjectId(args, logger);
|
|
37
32
|
objectId = await this.configureUri(args, objectId, logger);
|
|
@@ -11,7 +11,6 @@ import { validation } from '../../../../utils/validation.js';
|
|
|
11
11
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
12
12
|
import commands from '../../commands.js';
|
|
13
13
|
import { cli } from '../../../../cli/cli.js';
|
|
14
|
-
import aadCommands from '../../aadCommands.js';
|
|
15
14
|
class EntraAppRoleAssignmentAddCommand extends GraphCommand {
|
|
16
15
|
get name() {
|
|
17
16
|
return commands.APPROLEASSIGNMENT_ADD;
|
|
@@ -19,9 +18,6 @@ class EntraAppRoleAssignmentAddCommand extends GraphCommand {
|
|
|
19
18
|
get description() {
|
|
20
19
|
return 'Adds service principal permissions also known as scopes and app role assignments for specified Microsoft Entra application registration';
|
|
21
20
|
}
|
|
22
|
-
alias() {
|
|
23
|
-
return [aadCommands.APPROLEASSIGNMENT_ADD];
|
|
24
|
-
}
|
|
25
21
|
constructor() {
|
|
26
22
|
super();
|
|
27
23
|
_EntraAppRoleAssignmentAddCommand_instances.add(this);
|
|
@@ -31,7 +27,6 @@ class EntraAppRoleAssignmentAddCommand extends GraphCommand {
|
|
|
31
27
|
__classPrivateFieldGet(this, _EntraAppRoleAssignmentAddCommand_instances, "m", _EntraAppRoleAssignmentAddCommand_initOptionSets).call(this);
|
|
32
28
|
}
|
|
33
29
|
async commandAction(logger, args) {
|
|
34
|
-
await this.showDeprecationWarning(logger, aadCommands.APPROLEASSIGNMENT_ADD, commands.APPROLEASSIGNMENT_ADD);
|
|
35
30
|
let objectId = '';
|
|
36
31
|
let queryFilter = '';
|
|
37
32
|
if (args.options.appId) {
|
|
@@ -9,7 +9,6 @@ import { formatting } from '../../../../utils/formatting.js';
|
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
10
10
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
11
|
import commands from '../../commands.js';
|
|
12
|
-
import aadCommands from '../../aadCommands.js';
|
|
13
12
|
class EntraAppRoleAssignmentListCommand extends GraphCommand {
|
|
14
13
|
get name() {
|
|
15
14
|
return commands.APPROLEASSIGNMENT_LIST;
|
|
@@ -17,9 +16,6 @@ class EntraAppRoleAssignmentListCommand extends GraphCommand {
|
|
|
17
16
|
get description() {
|
|
18
17
|
return 'Lists app role assignments for the specified application registration';
|
|
19
18
|
}
|
|
20
|
-
alias() {
|
|
21
|
-
return [aadCommands.APPROLEASSIGNMENT_LIST];
|
|
22
|
-
}
|
|
23
19
|
constructor() {
|
|
24
20
|
super();
|
|
25
21
|
_EntraAppRoleAssignmentListCommand_instances.add(this);
|
|
@@ -32,7 +28,6 @@ class EntraAppRoleAssignmentListCommand extends GraphCommand {
|
|
|
32
28
|
return ['resourceDisplayName', 'roleName'];
|
|
33
29
|
}
|
|
34
30
|
async commandAction(logger, args) {
|
|
35
|
-
await this.showDeprecationWarning(logger, aadCommands.APPROLEASSIGNMENT_LIST, commands.APPROLEASSIGNMENT_LIST);
|
|
36
31
|
try {
|
|
37
32
|
const spAppRoleAssignments = await this.getAppRoleAssignments(args.options);
|
|
38
33
|
// the role assignment has an appRoleId but no name. To get the name,
|