@pnp/cli-microsoft365 12.0.0-beta.1752794 → 12.0.0-beta.445fe0a
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/allCommands.json +1 -1
- package/allCommandsFull.json +1 -1
- package/dist/Auth.js +19 -2
- package/dist/Command.js +11 -8
- package/dist/cli/cli.js +34 -18
- package/dist/config.js +2 -0
- package/dist/m365/cli/commands/cli-consent.js +9 -2
- package/dist/m365/entra/commands/agent/agent-blueprint-list.js +52 -0
- package/dist/m365/entra/commands/agent/agent-blueprintprincipal-list.js +56 -0
- package/dist/m365/entra/commands/m365group/m365group-add.js +52 -97
- package/dist/m365/entra/commands/m365group/m365group-conversation-list.js +20 -33
- package/dist/m365/entra/commands/m365group/m365group-conversation-post-list.js +20 -39
- package/dist/m365/entra/commands/m365group/m365group-get.js +20 -41
- package/dist/m365/entra/commands/m365group/m365group-list.js +11 -31
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-clear.js +8 -22
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-list.js +9 -25
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-remove.js +21 -43
- package/dist/m365/entra/commands/m365group/m365group-recyclebinitem-restore.js +21 -41
- package/dist/m365/entra/commands/m365group/m365group-remove.js +25 -46
- package/dist/m365/entra/commands/m365group/m365group-renew.js +19 -32
- package/dist/m365/entra/commands/m365group/m365group-set.js +86 -141
- package/dist/m365/entra/commands/m365group/m365group-teamify.js +20 -43
- package/dist/m365/entra/commands/m365group/m365group-user-add.js +44 -77
- package/dist/m365/entra/commands/m365group/m365group-user-list.js +28 -55
- package/dist/m365/entra/commands/m365group/m365group-user-remove.js +37 -74
- package/dist/m365/entra/commands/m365group/m365group-user-set.js +45 -77
- package/dist/m365/entra/commands.js +2 -0
- package/dist/m365/graph/commands/schemaextension/schemaextension-list.js +14 -16
- package/dist/m365/outlook/commands/calendargroup/calendargroup-add.js +97 -0
- package/dist/m365/outlook/commands/event/event-add.js +324 -0
- package/dist/m365/outlook/commands.js +2 -0
- package/dist/m365/spe/commands/container/container-activate.js +8 -16
- package/dist/m365/spe/commands/container/container-list.js +21 -42
- package/dist/m365/spe/commands/container/container-permission-add.js +114 -0
- package/dist/m365/spe/commands/container/container-permission-remove.js +94 -0
- package/dist/m365/spe/commands/container/container-permission-set.js +90 -0
- package/dist/m365/spe/commands/containertype/containertype-list.js +5 -0
- package/dist/m365/spe/commands.js +3 -0
- package/dist/m365/spfx/commands/SpfxCompatibilityMatrix.js +30 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.0.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.24.1.js +19 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +3 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN012021_TSC_excludeDirectories.js +43 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027002_OVERRIDES_qs.js +33 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027003_OVERRIDES_uuid.js +33 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN027004_OVERRIDES_serialize_javascript.js +34 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.24.0.js +77 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.24.1.js +57 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +3 -1
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +38 -71
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +25 -59
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.js +11 -34
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +25 -54
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +52 -83
- package/dist/m365/spo/commands/apppage/apppage-add.js +21 -39
- package/dist/m365/spo/commands/apppage/apppage-set.js +20 -30
- package/dist/m365/spo/commands/commandset/commandset-add.js +17 -59
- package/dist/m365/spo/commands/commandset/commandset-get.js +24 -62
- package/dist/m365/spo/commands/commandset/commandset-list.js +11 -34
- package/dist/m365/spo/commands/commandset/commandset-remove.js +21 -54
- package/dist/m365/spo/commands/commandset/commandset-set.js +30 -83
- package/dist/m365/spo/commands/contenttype/contenttype-add.js +22 -51
- package/dist/m365/spo/commands/contenttype/contenttype-field-list.js +38 -62
- package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +25 -54
- package/dist/m365/spo/commands/contenttype/contenttype-field-set.js +20 -43
- package/dist/m365/spo/commands/contenttype/contenttype-get.js +29 -54
- package/dist/m365/spo/commands/contenttype/contenttype-list.js +13 -30
- package/dist/m365/spo/commands/contenttype/contenttype-remove.js +24 -39
- package/dist/m365/spo/commands/contenttype/contenttype-set.js +42 -63
- package/dist/m365/spo/commands/contenttype/contenttype-sync.js +37 -59
- package/dist/m365/spo/commands/contenttypehub/contenttypehub-get.js +5 -0
- package/dist/m365/spo/commands/customaction/customaction-add.js +124 -145
- package/dist/m365/spo/commands/customaction/customaction-clear.js +12 -43
- package/dist/m365/spo/commands/customaction/customaction-get.js +28 -59
- package/dist/m365/spo/commands/customaction/customaction-list.js +12 -42
- package/dist/m365/spo/commands/customaction/customaction-remove.js +26 -54
- package/dist/m365/spo/commands/customaction/customaction-set.js +75 -132
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +39 -65
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-list.js +28 -56
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-remove.js +40 -68
- package/dist/m365/spo/commands/externaluser/externaluser-list.js +29 -80
- package/dist/m365/spo/commands/group/group-add.js +19 -60
- package/dist/m365/spo/commands/group/group-get.js +32 -45
- package/dist/m365/spo/commands/group/group-list.js +13 -27
- package/dist/m365/spo/commands/group/group-member-add.js +52 -84
- package/dist/m365/spo/commands/group/group-member-list.js +24 -38
- package/dist/m365/spo/commands/group/group-member-remove.js +49 -68
- package/dist/m365/spo/commands/group/group-remove.js +25 -45
- package/dist/m365/spo/commands/group/group-set.js +36 -79
- package/dist/m365/spo/commands/knowledgehub/knowledgehub-get.js +5 -0
- package/dist/m365/spo/commands/knowledgehub/knowledgehub-remove.js +8 -22
- package/dist/m365/spo/commands/knowledgehub/knowledgehub-set.js +10 -18
- package/dist/m365/spo/commands/listitem/listitem-add.js +27 -55
- package/dist/m365/spo/commands/listitem/listitem-attachment-add.js +30 -58
- package/dist/m365/spo/commands/listitem/listitem-attachment-get.js +27 -52
- package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +26 -50
- package/dist/m365/spo/commands/listitem/listitem-attachment-remove.js +28 -55
- package/dist/m365/spo/commands/listitem/listitem-attachment-set.js +30 -57
- package/dist/m365/spo/commands/listitem/listitem-batch-add.js +36 -58
- package/dist/m365/spo/commands/listitem/listitem-batch-remove.js +68 -92
- package/dist/m365/spo/commands/listitem/listitem-batch-set.js +37 -57
- package/dist/m365/spo/commands/listitem/listitem-get.js +45 -68
- package/dist/m365/spo/commands/listitem/listitem-isrecord.js +31 -55
- package/dist/m365/spo/commands/listitem/listitem-list.js +47 -81
- package/dist/m365/spo/commands/listitem/listitem-record-declare.js +37 -60
- package/dist/m365/spo/commands/listitem/listitem-record-lock.js +30 -52
- package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +31 -52
- package/dist/m365/spo/commands/listitem/listitem-record-unlock.js +30 -52
- package/dist/m365/spo/commands/listitem/listitem-remove.js +33 -61
- package/dist/m365/spo/commands/listitem/listitem-retentionlabel-ensure.js +46 -67
- package/dist/m365/spo/commands/listitem/listitem-retentionlabel-remove.js +33 -56
- package/dist/m365/spo/commands/listitem/listitem-roleassignment-add.js +55 -98
- package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +48 -74
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +33 -56
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +31 -53
- package/dist/m365/spo/commands/listitem/listitem-set.js +33 -58
- package/dist/m365/spo/commands/navigation/navigation-node-add.js +74 -120
- package/dist/m365/spo/commands/navigation/navigation-node-get.js +4 -13
- package/dist/m365/spo/commands/navigation/navigation-node-list.js +1 -1
- package/dist/m365/spo/commands/navigation/navigation-node-remove.js +13 -47
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +53 -114
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +15 -49
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-list.js +6 -1
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.js +9 -17
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-list.js +5 -0
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-remove.js +11 -27
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-set.js +10 -18
- package/dist/m365/spo/commands/page/page-column-list.js +7 -8
- package/dist/m365/spo/commands/page/page-section-list.js +15 -17
- package/dist/m365/spo/commands/page/page-unpublish.js +53 -0
- package/dist/m365/spo/commands/propertybag/propertybag-get.js +14 -29
- package/dist/m365/spo/commands/propertybag/propertybag-list.js +13 -27
- package/dist/m365/spo/commands/propertybag/propertybag-remove.js +15 -32
- package/dist/m365/spo/commands/propertybag/propertybag-set.js +15 -31
- package/dist/m365/spo/commands/roledefinition/roledefinition-add.js +45 -44
- package/dist/m365/spo/commands/roledefinition/roledefinition-get.js +14 -25
- package/dist/m365/spo/commands/roledefinition/roledefinition-list.js +12 -18
- package/dist/m365/spo/commands/roledefinition/roledefinition-remove.js +15 -35
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-add.js +9 -17
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-list.js +5 -0
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-revoke.js +9 -17
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-approve.js +29 -39
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-deny.js +10 -23
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-list.js +5 -0
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +19 -28
- package/dist/m365/spo/commands/sitedesign/sitedesign-add.js +24 -59
- package/dist/m365/spo/commands/sitedesign/sitedesign-apply.js +10 -34
- package/dist/m365/spo/commands/sitedesign/sitedesign-get.js +19 -36
- package/dist/m365/spo/commands/sitedesign/sitedesign-list.js +8 -0
- package/dist/m365/spo/commands/sitedesign/sitedesign-remove.js +9 -32
- package/dist/m365/spo/commands/sitedesign/sitedesign-rights-grant.js +10 -31
- package/dist/m365/spo/commands/sitedesign/sitedesign-rights-list.js +8 -23
- package/dist/m365/spo/commands/sitedesign/sitedesign-rights-revoke.js +10 -34
- package/dist/m365/spo/commands/sitedesign/sitedesign-run-list.js +9 -38
- package/dist/m365/spo/commands/sitedesign/sitedesign-run-status-get.js +9 -29
- package/dist/m365/spo/commands/sitedesign/sitedesign-set.js +27 -80
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-get.js +8 -23
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-list.js +8 -18
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-remove.js +9 -32
- package/dist/m365/spo/commands/sitescript/sitescript-add.js +22 -37
- package/dist/m365/spo/commands/sitescript/sitescript-get.js +9 -26
- package/dist/m365/spo/commands/sitescript/sitescript-list.js +5 -0
- package/dist/m365/spo/commands/sitescript/sitescript-remove.js +9 -33
- package/dist/m365/spo/commands/sitescript/sitescript-set.js +29 -56
- package/dist/m365/spo/commands/spo-search.js +43 -116
- package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +15 -46
- package/dist/m365/spo/commands/tenant/tenant-appcatalogurl-get.js +5 -0
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-add.js +20 -57
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +25 -49
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-list.js +5 -1
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.js +25 -49
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-set.js +47 -79
- package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +23 -54
- package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +25 -50
- package/dist/m365/spo/commands/tenant/tenant-commandset-list.js +5 -1
- package/dist/m365/spo/commands/tenant/tenant-commandset-remove.js +25 -49
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +41 -65
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-list.js +5 -0
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-remove.js +10 -30
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-restore.js +8 -21
- package/dist/m365/spo/commands/tenant/tenant-settings-list.js +5 -0
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +104 -386
- package/dist/m365/spo/commands/term/term-add.js +95 -110
- package/dist/m365/spo/commands/term/term-get.js +63 -75
- package/dist/m365/spo/commands/term/term-group-add.js +11 -41
- package/dist/m365/spo/commands/term/term-group-get.js +16 -47
- package/dist/m365/spo/commands/term/term-group-list.js +16 -42
- package/dist/m365/spo/commands/term/term-list.js +42 -57
- package/dist/m365/spo/commands/term/term-set-add.js +50 -71
- package/dist/m365/spo/commands/term/term-set-get.js +41 -58
- package/dist/m365/spo/commands/term/term-set-list.js +22 -56
- package/dist/m365/spo/commands/theme/theme-apply.js +27 -43
- package/dist/m365/spo/commands/theme/theme-get.js +8 -15
- package/dist/m365/spo/commands/theme/theme-list.js +5 -0
- package/dist/m365/spo/commands/theme/theme-remove.js +9 -24
- package/dist/m365/spo/commands/theme/theme-set.js +12 -34
- package/dist/m365/spo/commands.js +1 -0
- package/dist/m365/spp/commands/contentcenter/contentcenter-list.js +5 -0
- package/dist/m365/spp/commands/model/model-get.js +25 -45
- package/dist/m365/spp/commands/model/model-list.js +12 -23
- package/dist/m365/spp/commands/model/model-remove.js +25 -45
- package/dist/m365/teams/commands/app/app-install.js +35 -44
- package/dist/m365/teams/commands/app/app-list.js +8 -33
- package/dist/m365/teams/commands/app/app-publish.js +21 -27
- package/dist/m365/teams/commands/app/app-remove.js +22 -39
- package/dist/m365/teams/commands/app/app-uninstall.js +12 -34
- package/dist/m365/teams/commands/app/app-update.js +35 -45
- package/dist/m365/teams/commands/funsettings/funsettings-list.js +12 -23
- package/dist/m365/teams/commands/funsettings/funsettings-set.js +18 -54
- package/dist/m365/teams/commands/guestsettings/guestsettings-list.js +12 -23
- package/dist/m365/teams/commands/guestsettings/guestsettings-set.js +15 -40
- package/dist/m365/teams/commands/meeting/meeting-add.js +57 -68
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-get.js +33 -58
- package/dist/m365/teams/commands/meeting/meeting-attendancereport-list.js +14 -38
- package/dist/m365/teams/commands/meeting/meeting-get.js +14 -38
- package/dist/m365/teams/commands/meeting/meeting-list.js +34 -59
- package/dist/m365/teams/commands/meeting/meeting-transcript-get.js +34 -58
- package/dist/m365/teams/commands/meeting/meeting-transcript-list.js +29 -50
- package/dist/m365/teams/commands/membersettings/membersettings-list.js +12 -23
- package/dist/m365/teams/commands/membersettings/membersettings-set.js +18 -49
- package/dist/m365/teams/commands/message/message-get.js +19 -30
- package/dist/m365/teams/commands/message/message-list.js +26 -43
- package/dist/m365/teams/commands/message/message-remove.js +43 -58
- package/dist/m365/teams/commands/message/message-reply-list.js +19 -30
- package/dist/m365/teams/commands/message/message-restore.js +40 -50
- package/dist/m365/teams/commands/message/message-send.js +19 -30
- package/dist/m365/teams/commands/messagingsettings/messagingsettings-list.js +12 -23
- package/dist/m365/teams/commands/messagingsettings/messagingsettings-set.js +18 -60
- package/dist/m365/teams/commands/report/report-deviceusagedistributionusercounts.js +10 -0
- package/dist/m365/teams/commands/report/report-deviceusageusercounts.js +10 -0
- package/dist/m365/teams/commands/report/report-deviceusageuserdetail.js +22 -0
- package/dist/m365/teams/commands/report/report-directroutingcalls.js +19 -39
- package/dist/m365/teams/commands/report/report-pstncalls.js +19 -39
- package/dist/m365/teams/commands/report/report-useractivitycounts.js +10 -0
- package/dist/m365/teams/commands/report/report-useractivityusercounts.js +10 -0
- package/dist/m365/teams/commands/report/report-useractivityuserdetail.js +22 -0
- package/dist/m365/teams/commands/tab/tab-add.js +23 -49
- package/dist/m365/teams/commands/tab/tab-get.js +55 -56
- package/dist/m365/teams/commands/tab/tab-list.js +17 -28
- package/dist/m365/teams/commands/tab/tab-remove.js +23 -42
- package/dist/m365/teams/commands/team/team-add.js +76 -114
- package/dist/m365/teams/commands/team/team-app-list.js +23 -36
- package/dist/m365/teams/commands/team/team-archive.js +24 -39
- package/dist/m365/teams/commands/team/team-clone.js +28 -62
- package/dist/m365/teams/commands/team/team-get.js +23 -36
- package/dist/m365/teams/commands/team/team-list.js +43 -57
- package/dist/m365/teams/commands/team/team-remove.js +24 -37
- package/dist/m365/teams/commands/team/team-set.js +23 -52
- package/dist/m365/teams/commands/team/team-unarchive.js +23 -28
- package/dist/m365/teams/commands/user/user-app-add.js +40 -49
- package/dist/m365/teams/commands/user/user-app-list.js +26 -39
- package/dist/m365/teams/commands/user/user-app-remove.js +37 -49
- package/dist/m365/teams/commands/user/user-app-upgrade.js +36 -52
- package/dist/m365/teams/commands/user/user-list.js +17 -39
- package/dist/m365/tenant/commands/id/id-get.js +8 -22
- package/dist/m365/tenant/commands/info/info-get.js +23 -36
- package/dist/m365/tenant/commands/people/people-profilecardproperty-add.js +67 -55
- package/dist/m365/tenant/commands/people/people-profilecardproperty-get.js +11 -24
- package/dist/m365/tenant/commands/people/people-profilecardproperty-list.js +5 -0
- package/dist/m365/tenant/commands/people/people-profilecardproperty-remove.js +12 -33
- package/dist/m365/tenant/commands/people/people-profilecardproperty-set.js +31 -51
- package/dist/m365/tenant/commands/people/people-pronouns-get.js +5 -0
- package/dist/m365/tenant/commands/people/profileCardProperties.js +10 -7
- package/dist/m365/tenant/commands/report/report-activeusercounts.js +2 -1
- package/dist/m365/tenant/commands/report/report-activeuserdetail.js +2 -1
- package/dist/m365/tenant/commands/report/report-office365activationcounts.js +9 -0
- package/dist/m365/tenant/commands/report/report-office365activationsusercounts.js +9 -0
- package/dist/m365/tenant/commands/report/report-office365activationsuserdetail.js +9 -0
- package/dist/m365/tenant/commands/report/report-servicesusercounts.js +2 -1
- package/dist/m365/tenant/commands/report/report-settings-get.js +5 -0
- package/dist/m365/tenant/commands/security/security-alerts-list.js +8 -20
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-get.js +9 -20
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-list.js +8 -20
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-get.js +8 -15
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +8 -15
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-get.js +12 -26
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +8 -22
- package/dist/utils/calendar.js +1 -1
- package/dist/utils/formatting.js +16 -0
- package/dist/utils/pid.js +7 -16
- package/dist/utils/spe.js +1 -1
- package/dist/utils/spo.js +39 -0
- package/dist/utils/validation.js +36 -0
- package/dist/utils/zod.js +18 -7
- package/docs/docs/cmd/entra/agent/agent-blueprint-list.mdx +175 -0
- package/docs/docs/cmd/entra/agent/agent-blueprintprincipal-list.mdx +156 -0
- package/docs/docs/cmd/login.mdx +15 -2
- package/docs/docs/cmd/outlook/calendargroup/calendargroup-add.mdx +126 -0
- package/docs/docs/cmd/outlook/event/event-add.mdx +390 -0
- package/docs/docs/cmd/spe/container/container-add.mdx +0 -8
- package/docs/docs/cmd/spe/container/container-list.mdx +0 -8
- package/docs/docs/cmd/spe/container/container-permission-add.mdx +140 -0
- package/docs/docs/cmd/spe/container/container-permission-remove.mdx +78 -0
- package/docs/docs/cmd/spe/container/container-permission-set.mdx +78 -0
- package/docs/docs/cmd/spe/container/container-recyclebinitem-list.mdx +0 -8
- package/docs/docs/cmd/spe/container/container-recyclebinitem-restore.mdx +0 -8
- package/docs/docs/cmd/spe/container/container-remove.mdx +0 -8
- package/docs/docs/cmd/spe/containertype/containertype-add.mdx +1 -1
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-set.mdx +1 -1
- package/docs/docs/cmd/spo/externaluser/externaluser-list.mdx +17 -30
- package/docs/docs/cmd/spo/navigation/navigation-node-add.mdx +45 -30
- package/docs/docs/cmd/spo/navigation/navigation-node-get.mdx +64 -42
- package/docs/docs/cmd/spo/navigation/navigation-node-set.mdx +10 -8
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.mdx +0 -21
- package/docs/docs/cmd/spo/page/page-unpublish.mdx +63 -0
- package/docs/docs/cmd/teams/tab/tab-add.mdx +19 -0
- package/docs/docs/cmd/teams/tab/tab-get.mdx +19 -0
- package/docs/docs/cmd/teams/tab/tab-list.mdx +19 -0
- package/docs/docs/cmd/teams/tab/tab-remove.mdx +21 -0
- package/docs/docs/cmd/viva/engage/engage-message-add.mdx +17 -0
- package/docs/docs/cmd/viva/engage/engage-message-get.mdx +17 -0
- package/docs/docs/cmd/viva/engage/engage-message-list.mdx +17 -0
- package/docs/docs/cmd/viva/engage/engage-message-remove.mdx +19 -0
- package/package.json +4 -6
|
@@ -0,0 +1,324 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
3
|
+
import commands from '../../commands.js';
|
|
4
|
+
import { validation } from '../../../../utils/validation.js';
|
|
5
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
6
|
+
import request from '../../../../request.js';
|
|
7
|
+
import { calendar } from '../../../../utils/calendar.js';
|
|
8
|
+
import fs from 'fs';
|
|
9
|
+
import { accessToken } from '../../../../utils/accessToken.js';
|
|
10
|
+
import auth from '../../../../Auth.js';
|
|
11
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
12
|
+
const bodyContentTypes = ['Text', 'HTML'];
|
|
13
|
+
const importances = ['low', 'normal', 'high'];
|
|
14
|
+
const onlineMeetingProviders = ['teamsForBusiness', 'skypeForBusiness', 'skypeForConsumer', 'unknown'];
|
|
15
|
+
const sensitivities = ['normal', 'personal', 'private', 'confidential'];
|
|
16
|
+
const showAsStatuses = ['free', 'tentative', 'busy', 'oof', 'workingElsewhere', 'unknown'];
|
|
17
|
+
export const options = z.strictObject({
|
|
18
|
+
...globalOptionsZod.shape,
|
|
19
|
+
subject: z.string().trim().min(1, 'Subject cannot be empty.'),
|
|
20
|
+
start: z.string().refine(date => validation.isValidGraphDateTime(date), {
|
|
21
|
+
error: e => `'${e.input}' is not a valid date.`
|
|
22
|
+
}),
|
|
23
|
+
end: z.string().refine(date => validation.isValidGraphDateTime(date), {
|
|
24
|
+
error: e => `'${e.input}' is not a valid date.`
|
|
25
|
+
}),
|
|
26
|
+
userId: z.string().refine(id => validation.isValidGuid(id), {
|
|
27
|
+
error: e => `'${e.input}' is not a valid GUID.`
|
|
28
|
+
}).optional(),
|
|
29
|
+
userName: z.string().refine(name => validation.isValidUserPrincipalName(name), {
|
|
30
|
+
error: e => `'${e.input}' is not a valid UPN.`
|
|
31
|
+
}).optional(),
|
|
32
|
+
calendarId: z.string().optional(),
|
|
33
|
+
calendarName: z.string().optional(),
|
|
34
|
+
allowNewTimeProposals: z.boolean().optional().default(true),
|
|
35
|
+
bodyContents: z.string().optional(),
|
|
36
|
+
bodyContentType: z.preprocess(val => {
|
|
37
|
+
const target = String(val).toLowerCase();
|
|
38
|
+
return bodyContentTypes.find(t => t.toLowerCase() === target) ?? val;
|
|
39
|
+
}, z.enum(bodyContentTypes)).optional().default('HTML'),
|
|
40
|
+
categories: z.string()
|
|
41
|
+
.transform(value => value.split(',').map(category => category.trim()))
|
|
42
|
+
.refine(values => values.every(Boolean), {
|
|
43
|
+
error: 'Categories cannot contain empty entries.'
|
|
44
|
+
})
|
|
45
|
+
.optional(),
|
|
46
|
+
hideAttendees: z.boolean().optional().default(false),
|
|
47
|
+
importance: z.preprocess(val => {
|
|
48
|
+
const target = String(val).toLowerCase();
|
|
49
|
+
return importances.find(t => t.toLowerCase() === target) ?? val;
|
|
50
|
+
}, z.enum(importances)).optional(),
|
|
51
|
+
isAllDay: z.boolean().optional().default(false),
|
|
52
|
+
isOnlineMeeting: z.boolean().optional().default(false),
|
|
53
|
+
isReminderOn: z.boolean().optional().default(true),
|
|
54
|
+
location: z.string().optional(),
|
|
55
|
+
locationEmailAddress: z.string().refine(name => validation.isValidUserPrincipalName(name), {
|
|
56
|
+
error: e => `'${e.input}' is not a valid email address.`
|
|
57
|
+
}).optional(),
|
|
58
|
+
locations: z.string()
|
|
59
|
+
.transform(value => value.split(',').map(location => location.trim()))
|
|
60
|
+
.refine(values => values.every(Boolean), {
|
|
61
|
+
error: 'Locations cannot contain empty entries.'
|
|
62
|
+
})
|
|
63
|
+
.optional(),
|
|
64
|
+
onlineMeetingProvider: z.preprocess(val => {
|
|
65
|
+
const target = String(val).toLowerCase();
|
|
66
|
+
return onlineMeetingProviders.find(t => t.toLowerCase() === target) ?? val;
|
|
67
|
+
}, z.enum(onlineMeetingProviders)).optional().default('unknown'),
|
|
68
|
+
optionalAttendees: z.string()
|
|
69
|
+
.refine(names => validation.isValidUserPrincipalNameArray(names) === true, {
|
|
70
|
+
error: e => `The following attendees names are invalid for the option 'optionalAttendees': ${validation.isValidUserPrincipalNameArray(e.input)}.`
|
|
71
|
+
}).transform((value) => value.split(',').map(String)).optional(),
|
|
72
|
+
recurrence: z.string().optional(),
|
|
73
|
+
reminderMinutesBeforeStart: z.number().refine(minutes => Number.isInteger(minutes) && minutes >= 0, {
|
|
74
|
+
error: () => 'The number of reminder minutes must be a positive number or 0.'
|
|
75
|
+
}).optional(),
|
|
76
|
+
requiredAttendees: z.string()
|
|
77
|
+
.refine(names => validation.isValidUserPrincipalNameArray(names) === true, {
|
|
78
|
+
error: e => `The following attendees names are invalid for the option 'requiredAttendees': ${validation.isValidUserPrincipalNameArray(e.input)}.`
|
|
79
|
+
}).transform((value) => value.split(',').map(String)).optional(),
|
|
80
|
+
resources: z.string()
|
|
81
|
+
.refine(names => validation.isValidUserPrincipalNameArray(names) === true, {
|
|
82
|
+
error: e => `The following attendees names are invalid for the option 'resources': ${validation.isValidUserPrincipalNameArray(e.input)}.`
|
|
83
|
+
}).transform((value) => value.split(',').map(String)).optional(),
|
|
84
|
+
responseRequested: z.boolean().optional().default(true),
|
|
85
|
+
sensitivity: z.preprocess(val => {
|
|
86
|
+
const target = String(val).toLowerCase();
|
|
87
|
+
return sensitivities.find(t => t.toLowerCase() === target) ?? val;
|
|
88
|
+
}, z.enum(sensitivities)).optional(),
|
|
89
|
+
showAs: z.preprocess(val => {
|
|
90
|
+
const target = String(val).toLowerCase();
|
|
91
|
+
return showAsStatuses.find(t => t.toLowerCase() === target) ?? val;
|
|
92
|
+
}, z.enum(showAsStatuses)).optional().default('busy'),
|
|
93
|
+
timeZone: z.string().optional().default('UTC'),
|
|
94
|
+
transactionId: z.string().optional()
|
|
95
|
+
});
|
|
96
|
+
class OutlookEventAddCommand extends GraphCommand {
|
|
97
|
+
get name() {
|
|
98
|
+
return commands.EVENT_ADD;
|
|
99
|
+
}
|
|
100
|
+
get description() {
|
|
101
|
+
return `Create an event in the default calendar or a specific calendar of a user`;
|
|
102
|
+
}
|
|
103
|
+
get schema() {
|
|
104
|
+
return options;
|
|
105
|
+
}
|
|
106
|
+
getRefinedSchema(schema) {
|
|
107
|
+
return schema
|
|
108
|
+
.refine(options => !(options.calendarId && options.calendarName), {
|
|
109
|
+
error: 'Specify either calendarId or calendarName, but not both.'
|
|
110
|
+
})
|
|
111
|
+
.refine(options => !(options.location && options.locations), {
|
|
112
|
+
error: 'Specify either location or locations, but not both.'
|
|
113
|
+
})
|
|
114
|
+
.refine(options => !(options.userId && options.userName), {
|
|
115
|
+
error: 'Specify either userId or userName, but not both.'
|
|
116
|
+
})
|
|
117
|
+
.refine(options => !options.isAllDay || (options.start.endsWith('T00:00:00') && options.end.endsWith('T00:00:00')), {
|
|
118
|
+
error: 'When isAllDay is true, start and end must be set to midnight.'
|
|
119
|
+
})
|
|
120
|
+
.refine(options => !(options.reminderMinutesBeforeStart !== undefined && !options.isReminderOn), {
|
|
121
|
+
error: 'When reminderMinutesBeforeStart is specified, isReminderOn must be true.'
|
|
122
|
+
})
|
|
123
|
+
.refine(options => !(options.locationEmailAddress && !options.location), {
|
|
124
|
+
error: 'When locationEmailAddress is specified, location must be also specified.'
|
|
125
|
+
})
|
|
126
|
+
.refine(options => new Date(options.start).getTime() < new Date(options.end).getTime(), {
|
|
127
|
+
error: 'Start date must be before end date.'
|
|
128
|
+
})
|
|
129
|
+
.refine(options => !options.isOnlineMeeting || options.onlineMeetingProvider !== 'unknown', {
|
|
130
|
+
error: 'Specify onlineMeetingProvider when isOnlineMeeting is true.'
|
|
131
|
+
})
|
|
132
|
+
.refine(options => options.isOnlineMeeting || options.onlineMeetingProvider === 'unknown', {
|
|
133
|
+
error: 'onlineMeetingProvider can only be specified when isOnlineMeeting is true.'
|
|
134
|
+
});
|
|
135
|
+
}
|
|
136
|
+
async commandAction(logger, args) {
|
|
137
|
+
const isAppOnlyAccessToken = accessToken.isAppOnlyAccessToken(auth.connection.accessTokens[auth.defaultResource].accessToken);
|
|
138
|
+
let principalUrl = '';
|
|
139
|
+
const token = auth.connection.accessTokens[auth.defaultResource].accessToken;
|
|
140
|
+
if (isAppOnlyAccessToken) {
|
|
141
|
+
if (!args.options.userId && !args.options.userName) {
|
|
142
|
+
throw `The option 'userId' or 'userName' is required when creating an event using application permissions.`;
|
|
143
|
+
}
|
|
144
|
+
}
|
|
145
|
+
else {
|
|
146
|
+
if (args.options.userId) {
|
|
147
|
+
const currentUserId = accessToken.getUserIdFromAccessToken(token);
|
|
148
|
+
if (args.options.userId.toLowerCase() !== currentUserId.toLowerCase()) {
|
|
149
|
+
throw `You can only create your own events when using delegated permissions. The specified userId '${args.options.userId}' does not match the current user '${currentUserId}'.`;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
if (args.options.userName) {
|
|
153
|
+
const currentUserName = accessToken.getUserNameFromAccessToken(token);
|
|
154
|
+
if (args.options.userName.toLowerCase() !== currentUserName.toLowerCase()) {
|
|
155
|
+
throw `You can only create your own events when using delegated permissions. The specified userName '${args.options.userName}' does not match the current user '${currentUserName}'.`;
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
}
|
|
159
|
+
let userIdentifier;
|
|
160
|
+
if (args.options.userId || args.options.userName) {
|
|
161
|
+
userIdentifier = args.options.userId ?? args.options.userName;
|
|
162
|
+
principalUrl += `users('${formatting.encodeQueryParameter(userIdentifier)}')`;
|
|
163
|
+
}
|
|
164
|
+
else {
|
|
165
|
+
userIdentifier = accessToken.getUserNameFromAccessToken(token);
|
|
166
|
+
principalUrl += 'me';
|
|
167
|
+
}
|
|
168
|
+
if (this.verbose) {
|
|
169
|
+
await logger.logToStderr(`Creating event for user ${userIdentifier}...`);
|
|
170
|
+
}
|
|
171
|
+
let calendarId = args.options.calendarId;
|
|
172
|
+
if (args.options.calendarName) {
|
|
173
|
+
calendarId = (await calendar.getUserCalendarByName(userIdentifier, args.options.calendarName)).id;
|
|
174
|
+
}
|
|
175
|
+
let requestUrl = `${this.resource}/v1.0/${principalUrl}`;
|
|
176
|
+
if (calendarId) {
|
|
177
|
+
requestUrl += `/calendars/${formatting.encodeQueryParameter(calendarId)}/events`;
|
|
178
|
+
}
|
|
179
|
+
else {
|
|
180
|
+
requestUrl += '/events';
|
|
181
|
+
}
|
|
182
|
+
const body = {};
|
|
183
|
+
body.subject = args.options.subject;
|
|
184
|
+
body.start = {
|
|
185
|
+
dateTime: args.options.start
|
|
186
|
+
};
|
|
187
|
+
body.end = {
|
|
188
|
+
dateTime: args.options.end
|
|
189
|
+
};
|
|
190
|
+
if (args.options.bodyContents !== undefined) {
|
|
191
|
+
const bodyContents = args.options.bodyContents.startsWith('@')
|
|
192
|
+
? fs.readFileSync(args.options.bodyContents.substring(1), 'utf8')
|
|
193
|
+
: args.options.bodyContents;
|
|
194
|
+
body.body = {
|
|
195
|
+
contentType: args.options.bodyContentType === 'Text' ? 'text' : 'html',
|
|
196
|
+
content: bodyContents
|
|
197
|
+
};
|
|
198
|
+
}
|
|
199
|
+
if (!args.options.allowNewTimeProposals) {
|
|
200
|
+
body.allowNewTimeProposals = args.options.allowNewTimeProposals;
|
|
201
|
+
}
|
|
202
|
+
if (args.options.categories) {
|
|
203
|
+
body.categories = args.options.categories;
|
|
204
|
+
}
|
|
205
|
+
if (args.options.hideAttendees) {
|
|
206
|
+
body.hideAttendees = args.options.hideAttendees;
|
|
207
|
+
}
|
|
208
|
+
if (args.options.importance) {
|
|
209
|
+
body.importance = args.options.importance;
|
|
210
|
+
}
|
|
211
|
+
if (args.options.isAllDay) {
|
|
212
|
+
body.isAllDay = args.options.isAllDay;
|
|
213
|
+
}
|
|
214
|
+
if (args.options.isOnlineMeeting) {
|
|
215
|
+
body.isOnlineMeeting = args.options.isOnlineMeeting;
|
|
216
|
+
}
|
|
217
|
+
if (!args.options.isReminderOn) {
|
|
218
|
+
body.isReminderOn = false;
|
|
219
|
+
}
|
|
220
|
+
if (args.options.location || args.options.locationEmailAddress) {
|
|
221
|
+
const location = {};
|
|
222
|
+
if (args.options.location) {
|
|
223
|
+
location.displayName = args.options.location;
|
|
224
|
+
}
|
|
225
|
+
if (args.options.locationEmailAddress) {
|
|
226
|
+
location.locationEmailAddress = args.options.locationEmailAddress;
|
|
227
|
+
}
|
|
228
|
+
body.location = location;
|
|
229
|
+
}
|
|
230
|
+
if (args.options.locations) {
|
|
231
|
+
const locations = args.options.locations.map(displayName => ({
|
|
232
|
+
displayName
|
|
233
|
+
}));
|
|
234
|
+
body.locations = locations;
|
|
235
|
+
}
|
|
236
|
+
if (args.options.onlineMeetingProvider !== 'unknown') {
|
|
237
|
+
body.onlineMeetingProvider = args.options.onlineMeetingProvider;
|
|
238
|
+
}
|
|
239
|
+
if (args.options.optionalAttendees || args.options.requiredAttendees || args.options.resources) {
|
|
240
|
+
const attendees = [];
|
|
241
|
+
const resolveAttendee = (value) => {
|
|
242
|
+
const attendee = value.trim();
|
|
243
|
+
if (attendee.toLowerCase() !== '@meusername') {
|
|
244
|
+
return attendee;
|
|
245
|
+
}
|
|
246
|
+
if (isAppOnlyAccessToken) {
|
|
247
|
+
throw `It's not possible to use ${attendee} with application permissions`;
|
|
248
|
+
}
|
|
249
|
+
return accessToken.getUserNameFromAccessToken(token);
|
|
250
|
+
};
|
|
251
|
+
if (args.options.optionalAttendees) {
|
|
252
|
+
args.options.optionalAttendees.forEach(value => attendees.push({
|
|
253
|
+
emailAddress: {
|
|
254
|
+
address: resolveAttendee(value)
|
|
255
|
+
},
|
|
256
|
+
type: 'optional'
|
|
257
|
+
}));
|
|
258
|
+
}
|
|
259
|
+
if (args.options.requiredAttendees) {
|
|
260
|
+
args.options.requiredAttendees.forEach(value => attendees.push({
|
|
261
|
+
emailAddress: {
|
|
262
|
+
address: resolveAttendee(value)
|
|
263
|
+
},
|
|
264
|
+
type: 'required'
|
|
265
|
+
}));
|
|
266
|
+
}
|
|
267
|
+
if (args.options.resources) {
|
|
268
|
+
args.options.resources.forEach(value => attendees.push({
|
|
269
|
+
emailAddress: {
|
|
270
|
+
address: resolveAttendee(value)
|
|
271
|
+
},
|
|
272
|
+
type: 'resource'
|
|
273
|
+
}));
|
|
274
|
+
}
|
|
275
|
+
body.attendees = attendees;
|
|
276
|
+
}
|
|
277
|
+
if (args.options.recurrence) {
|
|
278
|
+
if (args.options.recurrence.startsWith('@')) {
|
|
279
|
+
const fileRecurrence = fs.readFileSync(args.options.recurrence.replace('@', ''), 'utf8');
|
|
280
|
+
body.recurrence = JSON.parse(fileRecurrence);
|
|
281
|
+
}
|
|
282
|
+
else {
|
|
283
|
+
body.recurrence = JSON.parse(args.options.recurrence);
|
|
284
|
+
}
|
|
285
|
+
}
|
|
286
|
+
if (args.options.isReminderOn && args.options.reminderMinutesBeforeStart !== undefined) {
|
|
287
|
+
body.reminderMinutesBeforeStart = args.options.reminderMinutesBeforeStart;
|
|
288
|
+
}
|
|
289
|
+
if (!args.options.responseRequested) {
|
|
290
|
+
body.responseRequested = false;
|
|
291
|
+
}
|
|
292
|
+
if (args.options.sensitivity) {
|
|
293
|
+
body.sensitivity = args.options.sensitivity;
|
|
294
|
+
}
|
|
295
|
+
if (args.options.showAs !== 'busy') {
|
|
296
|
+
body.showAs = args.options.showAs;
|
|
297
|
+
}
|
|
298
|
+
if (args.options.timeZone) {
|
|
299
|
+
body.start.timeZone = args.options.timeZone;
|
|
300
|
+
body.end.timeZone = args.options.timeZone;
|
|
301
|
+
}
|
|
302
|
+
if (args.options.transactionId) {
|
|
303
|
+
body.transactionId = args.options.transactionId;
|
|
304
|
+
}
|
|
305
|
+
const requestOptions = {
|
|
306
|
+
url: requestUrl,
|
|
307
|
+
headers: {
|
|
308
|
+
accept: 'application/json;odata.metadata=none',
|
|
309
|
+
'content-type': 'application/json'
|
|
310
|
+
},
|
|
311
|
+
responseType: 'json',
|
|
312
|
+
data: body
|
|
313
|
+
};
|
|
314
|
+
try {
|
|
315
|
+
const result = await request.post(requestOptions);
|
|
316
|
+
await logger.log(result);
|
|
317
|
+
}
|
|
318
|
+
catch (err) {
|
|
319
|
+
this.handleRejectedODataJsonPromise(err);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
}
|
|
323
|
+
export default new OutlookEventAddCommand();
|
|
324
|
+
//# sourceMappingURL=event-add.js.map
|
|
@@ -5,10 +5,12 @@ export default {
|
|
|
5
5
|
CALENDAR_LIST: `${prefix} calendar list`,
|
|
6
6
|
CALENDAR_REMOVE: `${prefix} calendar remove`,
|
|
7
7
|
CALENDAR_SET: `${prefix} calendar set`,
|
|
8
|
+
CALENDARGROUP_ADD: `${prefix} calendargroup add`,
|
|
8
9
|
CALENDARGROUP_GET: `${prefix} calendargroup get`,
|
|
9
10
|
CALENDARGROUP_LIST: `${prefix} calendargroup list`,
|
|
10
11
|
CALENDARGROUP_REMOVE: `${prefix} calendargroup remove`,
|
|
11
12
|
CALENDARGROUP_SET: `${prefix} calendargroup set`,
|
|
13
|
+
EVENT_ADD: `${prefix} event add`,
|
|
12
14
|
EVENT_CANCEL: `${prefix} event cancel`,
|
|
13
15
|
EVENT_GET: `${prefix} event get`,
|
|
14
16
|
EVENT_LIST: `${prefix} event list`,
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _SpeContainerActivateCommand_instances, _SpeContainerActivateCommand_initOptions, _SpeContainerActivateCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
8
4
|
import commands from '../../commands.js';
|
|
9
5
|
import request from '../../../../request.js';
|
|
10
6
|
import { formatting } from '../../../../utils/formatting.js';
|
|
7
|
+
export const options = z.strictObject({
|
|
8
|
+
...globalOptionsZod.shape,
|
|
9
|
+
id: z.string().alias('i')
|
|
10
|
+
});
|
|
11
11
|
class SpeContainerActivateCommand extends GraphCommand {
|
|
12
12
|
get name() {
|
|
13
13
|
return commands.CONTAINER_ACTIVATE;
|
|
@@ -15,11 +15,8 @@ class SpeContainerActivateCommand extends GraphCommand {
|
|
|
15
15
|
get description() {
|
|
16
16
|
return 'Activates a container';
|
|
17
17
|
}
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
_SpeContainerActivateCommand_instances.add(this);
|
|
21
|
-
__classPrivateFieldGet(this, _SpeContainerActivateCommand_instances, "m", _SpeContainerActivateCommand_initOptions).call(this);
|
|
22
|
-
__classPrivateFieldGet(this, _SpeContainerActivateCommand_instances, "m", _SpeContainerActivateCommand_initTypes).call(this);
|
|
18
|
+
get schema() {
|
|
19
|
+
return options;
|
|
23
20
|
}
|
|
24
21
|
async commandAction(logger, args) {
|
|
25
22
|
if (this.verbose) {
|
|
@@ -41,10 +38,5 @@ class SpeContainerActivateCommand extends GraphCommand {
|
|
|
41
38
|
}
|
|
42
39
|
}
|
|
43
40
|
}
|
|
44
|
-
_SpeContainerActivateCommand_instances = new WeakSet(), _SpeContainerActivateCommand_initOptions = function _SpeContainerActivateCommand_initOptions() {
|
|
45
|
-
this.options.unshift({ option: '-i, --id <id>' });
|
|
46
|
-
}, _SpeContainerActivateCommand_initTypes = function _SpeContainerActivateCommand_initTypes() {
|
|
47
|
-
this.types.string.push('id');
|
|
48
|
-
};
|
|
49
41
|
export default new SpeContainerActivateCommand();
|
|
50
42
|
//# sourceMappingURL=container-activate.js.map
|
|
@@ -1,34 +1,38 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
-
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
-
};
|
|
6
|
-
var _SpeContainerListCommand_instances, _SpeContainerListCommand_initTelemetry, _SpeContainerListCommand_initOptions, _SpeContainerListCommand_initValidators, _SpeContainerListCommand_initOptionSets, _SpeContainerListCommand_initTypes;
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
7
3
|
import { formatting } from '../../../../utils/formatting.js';
|
|
8
4
|
import { odata } from '../../../../utils/odata.js';
|
|
9
|
-
import { validation } from '../../../../utils/validation.js';
|
|
10
5
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
11
6
|
import commands from '../../commands.js';
|
|
12
7
|
import { spe } from '../../../../utils/spe.js';
|
|
8
|
+
export const options = z.strictObject({
|
|
9
|
+
...globalOptionsZod.shape,
|
|
10
|
+
containerTypeId: z.guid().optional(),
|
|
11
|
+
containerTypeName: z.string().optional()
|
|
12
|
+
});
|
|
13
13
|
class SpeContainerListCommand extends GraphCommand {
|
|
14
14
|
get name() {
|
|
15
15
|
return commands.CONTAINER_LIST;
|
|
16
16
|
}
|
|
17
17
|
get description() {
|
|
18
|
-
return 'Lists
|
|
18
|
+
return 'Lists containers of a specific Container Type';
|
|
19
|
+
}
|
|
20
|
+
get schema() {
|
|
21
|
+
return options;
|
|
22
|
+
}
|
|
23
|
+
getRefinedSchema(schema) {
|
|
24
|
+
return schema
|
|
25
|
+
.refine(opts => [opts.containerTypeId, opts.containerTypeName].filter(o => o !== undefined).length === 1, {
|
|
26
|
+
message: 'Specify one of the following options: containerTypeId, containerTypeName.',
|
|
27
|
+
params: {
|
|
28
|
+
customCode: 'optionSet',
|
|
29
|
+
options: ['containerTypeId', 'containerTypeName']
|
|
30
|
+
}
|
|
31
|
+
});
|
|
19
32
|
}
|
|
20
33
|
defaultProperties() {
|
|
21
34
|
return ['id', 'displayName', 'containerTypeId', 'createdDateTime'];
|
|
22
35
|
}
|
|
23
|
-
constructor() {
|
|
24
|
-
super();
|
|
25
|
-
_SpeContainerListCommand_instances.add(this);
|
|
26
|
-
__classPrivateFieldGet(this, _SpeContainerListCommand_instances, "m", _SpeContainerListCommand_initTelemetry).call(this);
|
|
27
|
-
__classPrivateFieldGet(this, _SpeContainerListCommand_instances, "m", _SpeContainerListCommand_initOptions).call(this);
|
|
28
|
-
__classPrivateFieldGet(this, _SpeContainerListCommand_instances, "m", _SpeContainerListCommand_initValidators).call(this);
|
|
29
|
-
__classPrivateFieldGet(this, _SpeContainerListCommand_instances, "m", _SpeContainerListCommand_initOptionSets).call(this);
|
|
30
|
-
__classPrivateFieldGet(this, _SpeContainerListCommand_instances, "m", _SpeContainerListCommand_initTypes).call(this);
|
|
31
|
-
}
|
|
32
36
|
async commandAction(logger, args) {
|
|
33
37
|
try {
|
|
34
38
|
if (this.verbose) {
|
|
@@ -49,30 +53,5 @@ class SpeContainerListCommand extends GraphCommand {
|
|
|
49
53
|
return spe.getContainerTypeIdByName(options.containerTypeName);
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
|
-
_SpeContainerListCommand_instances = new WeakSet(), _SpeContainerListCommand_initTelemetry = function _SpeContainerListCommand_initTelemetry() {
|
|
53
|
-
this.telemetry.push((args) => {
|
|
54
|
-
Object.assign(this.telemetryProperties, {
|
|
55
|
-
containerTypeId: typeof args.options.containerTypeId !== 'undefined',
|
|
56
|
-
containerTypeName: typeof args.options.containerTypeName !== 'undefined'
|
|
57
|
-
});
|
|
58
|
-
});
|
|
59
|
-
}, _SpeContainerListCommand_initOptions = function _SpeContainerListCommand_initOptions() {
|
|
60
|
-
this.options.unshift({
|
|
61
|
-
option: '--containerTypeId [containerTypeId]'
|
|
62
|
-
}, {
|
|
63
|
-
option: '--containerTypeName [containerTypeName]'
|
|
64
|
-
});
|
|
65
|
-
}, _SpeContainerListCommand_initValidators = function _SpeContainerListCommand_initValidators() {
|
|
66
|
-
this.validators.push(async (args) => {
|
|
67
|
-
if (args.options.containerTypeId && !validation.isValidGuid(args.options.containerTypeId)) {
|
|
68
|
-
return `${args.options.containerTypeId} is not a valid GUID`;
|
|
69
|
-
}
|
|
70
|
-
return true;
|
|
71
|
-
});
|
|
72
|
-
}, _SpeContainerListCommand_initOptionSets = function _SpeContainerListCommand_initOptionSets() {
|
|
73
|
-
this.optionSets.push({ options: ['containerTypeId', 'containerTypeName'] });
|
|
74
|
-
}, _SpeContainerListCommand_initTypes = function _SpeContainerListCommand_initTypes() {
|
|
75
|
-
this.types.string.push('containerTypeId', 'containerTypeName');
|
|
76
|
-
};
|
|
77
56
|
export default new SpeContainerListCommand();
|
|
78
57
|
//# sourceMappingURL=container-list.js.map
|
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
import { globalOptionsZod } from '../../../../Command.js';
|
|
3
|
+
import commands from '../../commands.js';
|
|
4
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
5
|
+
import { validation } from '../../../../utils/validation.js';
|
|
6
|
+
import { spe } from '../../../../utils/spe.js';
|
|
7
|
+
import request from '../../../../request.js';
|
|
8
|
+
import { entraUser } from '../../../../utils/entraUser.js';
|
|
9
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
10
|
+
export const options = z.strictObject({
|
|
11
|
+
...globalOptionsZod.shape,
|
|
12
|
+
containerId: z.string().alias('i').optional(),
|
|
13
|
+
containerName: z.string().alias('n').optional(),
|
|
14
|
+
containerTypeId: z.uuid().optional(),
|
|
15
|
+
containerTypeName: z.string().optional(),
|
|
16
|
+
roles: z.string().transform((value) => value.split(',').map(role => role.trim())).pipe(z.enum(['reader', 'writer', 'manager', 'owner']).array()).alias('r'),
|
|
17
|
+
userId: z.string().refine(id => validation.isValidGuid(id), {
|
|
18
|
+
error: e => `'${e.input}' is not a valid GUID.`
|
|
19
|
+
}).optional(),
|
|
20
|
+
userName: z.string().refine(name => validation.isValidUserPrincipalName(name), {
|
|
21
|
+
error: e => `'${e.input}' is not a valid UPN.`
|
|
22
|
+
}).optional()
|
|
23
|
+
});
|
|
24
|
+
class SpeContainerPermissionAddCommand extends GraphCommand {
|
|
25
|
+
get name() {
|
|
26
|
+
return commands.CONTAINER_PERMISSION_ADD;
|
|
27
|
+
}
|
|
28
|
+
get description() {
|
|
29
|
+
return 'Adds permission to SharePoint Embedded Container for a specified user';
|
|
30
|
+
}
|
|
31
|
+
get schema() {
|
|
32
|
+
return options;
|
|
33
|
+
}
|
|
34
|
+
getRefinedSchema(schema) {
|
|
35
|
+
return schema
|
|
36
|
+
.refine((options) => [options.containerId, options.containerName].filter(o => o !== undefined).length >= 1, {
|
|
37
|
+
error: 'Use one of the following options: containerId or containerName.',
|
|
38
|
+
params: { customCode: 'optionSet', options: ['containerId', 'containerName'] }
|
|
39
|
+
})
|
|
40
|
+
.refine((options) => [options.containerId, options.containerName].filter(o => o !== undefined).length <= 1, {
|
|
41
|
+
error: 'Use one of the following options: containerId or containerName.'
|
|
42
|
+
})
|
|
43
|
+
.refine((options) => [options.userId, options.userName].filter(o => o !== undefined).length >= 1, {
|
|
44
|
+
error: 'Use one of the following options: userId or userName.',
|
|
45
|
+
params: { customCode: 'optionSet', options: ['userId', 'userName'] }
|
|
46
|
+
})
|
|
47
|
+
.refine((options) => [options.userId, options.userName].filter(o => o !== undefined).length <= 1, {
|
|
48
|
+
error: 'Use one of the following options: userId or userName.'
|
|
49
|
+
})
|
|
50
|
+
.refine((options) => !options.containerName || [options.containerTypeId, options.containerTypeName].filter(o => o !== undefined).length >= 1, {
|
|
51
|
+
error: 'Use one of the following options when specifying the container name: containerTypeId or containerTypeName.',
|
|
52
|
+
params: { customCode: 'optionSet', options: ['containerTypeId', 'containerTypeName'] }
|
|
53
|
+
})
|
|
54
|
+
.refine((options) => !options.containerName || [options.containerTypeId, options.containerTypeName].filter(o => o !== undefined).length <= 1, {
|
|
55
|
+
error: 'Use one of the following options when specifying the container name: containerTypeId or containerTypeName.'
|
|
56
|
+
})
|
|
57
|
+
.refine((options) => options.containerName || [options.containerTypeId, options.containerTypeName].filter(o => o !== undefined).length === 0, {
|
|
58
|
+
error: 'Options containerTypeId and containerTypeName are only required when adding permissions to a container by name.'
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
async commandAction(logger, args) {
|
|
62
|
+
try {
|
|
63
|
+
const containerId = await this.getContainerId(args.options, logger);
|
|
64
|
+
if (this.verbose) {
|
|
65
|
+
await logger.logToStderr(`Adding permissions to container with ID '${containerId}'...`);
|
|
66
|
+
}
|
|
67
|
+
let userName = args.options.userName;
|
|
68
|
+
if (args.options.userId) {
|
|
69
|
+
userName = await entraUser.getUpnByUserId(args.options.userId);
|
|
70
|
+
}
|
|
71
|
+
const requestOptions = {
|
|
72
|
+
url: `${this.resource}/v1.0/storage/fileStorage/containers/${formatting.encodeQueryParameter(containerId)}/permissions`,
|
|
73
|
+
headers: {
|
|
74
|
+
accept: 'application/json;odata.metadata=none'
|
|
75
|
+
},
|
|
76
|
+
responseType: 'json',
|
|
77
|
+
data: {
|
|
78
|
+
roles: args.options.roles,
|
|
79
|
+
grantedToV2: {
|
|
80
|
+
user: {
|
|
81
|
+
userPrincipalName: userName
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
};
|
|
86
|
+
const container = await request.post(requestOptions);
|
|
87
|
+
await logger.log(container);
|
|
88
|
+
}
|
|
89
|
+
catch (err) {
|
|
90
|
+
this.handleRejectedODataJsonPromise(err);
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
async getContainerId(options, logger) {
|
|
94
|
+
if (options.containerId) {
|
|
95
|
+
return options.containerId;
|
|
96
|
+
}
|
|
97
|
+
const containerTypeId = await this.getContainerTypeId(options, logger);
|
|
98
|
+
if (this.verbose) {
|
|
99
|
+
await logger.logToStderr(`Getting container ID for container with name '${options.containerName}'...`);
|
|
100
|
+
}
|
|
101
|
+
return spe.getContainerIdByName(containerTypeId, options.containerName);
|
|
102
|
+
}
|
|
103
|
+
async getContainerTypeId(options, logger) {
|
|
104
|
+
if (options.containerTypeId) {
|
|
105
|
+
return options.containerTypeId;
|
|
106
|
+
}
|
|
107
|
+
if (this.verbose) {
|
|
108
|
+
await logger.logToStderr(`Getting container type with name '${options.containerTypeName}'...`);
|
|
109
|
+
}
|
|
110
|
+
return spe.getContainerTypeIdByName(options.containerTypeName);
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
export default new SpeContainerPermissionAddCommand();
|
|
114
|
+
//# sourceMappingURL=container-permission-add.js.map
|