@pnp/cli-microsoft365 7.0.0-beta.f1037e1 → 7.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.cjs +1 -3
- package/README.md +4 -4
- package/dist/Auth.js +12 -2
- package/dist/Command.js +3 -3
- package/dist/GlobalOptions.js +1 -7
- package/dist/cli/Cli.js +24 -7
- package/dist/m365/aad/commands/app/app-add.js +8 -8
- package/dist/m365/aad/commands/app/app-get.js +4 -1
- package/dist/m365/aad/commands/app/app-remove.js +3 -1
- package/dist/m365/aad/commands/app/app-role-add.js +9 -6
- package/dist/m365/aad/commands/app/app-role-list.js +4 -1
- package/dist/m365/aad/commands/app/app-role-remove.js +5 -2
- package/dist/m365/aad/commands/app/app-set.js +13 -10
- package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +11 -6
- package/dist/m365/aad/commands/approleassignment/approleassignment-remove.js +4 -4
- package/dist/m365/aad/commands/group/group-get.js +4 -4
- package/dist/m365/aad/commands/group/group-list.js +1 -23
- package/dist/m365/aad/commands/group/group-remove.js +98 -0
- package/dist/m365/aad/commands/{o365group/o365group-add.js → m365group/m365group-add.js} +38 -29
- package/dist/m365/aad/commands/{o365group/o365group-conversation-list.js → m365group/m365group-conversation-list.js} +15 -10
- package/dist/m365/aad/commands/{o365group/o365group-conversation-post-list.js → m365group/m365group-conversation-post-list.js} +18 -14
- package/dist/m365/aad/commands/{o365group/o365group-get.js → m365group/m365group-get.js} +14 -10
- package/dist/m365/aad/commands/{o365group/o365group-list.js → m365group/m365group-list.js} +13 -28
- package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-clear.js → m365group/m365group-recyclebinitem-clear.js} +15 -15
- package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-list.js → m365group/m365group-recyclebinitem-list.js} +10 -10
- package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-remove.js → m365group/m365group-recyclebinitem-remove.js} +17 -15
- package/dist/m365/aad/commands/{o365group/o365group-recyclebinitem-restore.js → m365group/m365group-recyclebinitem-restore.js} +18 -15
- package/dist/m365/aad/commands/{o365group/o365group-remove.js → m365group/m365group-remove.js} +17 -12
- package/dist/m365/aad/commands/{o365group/o365group-renew.js → m365group/m365group-renew.js} +15 -10
- package/dist/m365/aad/commands/{o365group/o365group-report-activitycounts.js → m365group/m365group-report-activitycounts.js} +4 -4
- package/dist/m365/aad/commands/{o365group/o365group-report-activitydetail.js → m365group/m365group-report-activitydetail.js} +4 -4
- package/dist/m365/aad/commands/{o365group/o365group-report-activityfilecounts.js → m365group/m365group-report-activityfilecounts.js} +4 -4
- package/dist/m365/aad/commands/{o365group/o365group-report-activitygroupcounts.js → m365group/m365group-report-activitygroupcounts.js} +4 -4
- package/dist/m365/aad/commands/{o365group/o365group-report-activitystorage.js → m365group/m365group-report-activitystorage.js} +4 -4
- package/dist/m365/aad/commands/{o365group/o365group-set.js → m365group/m365group-set.js} +22 -17
- package/dist/m365/aad/commands/{o365group/o365group-teamify.js → m365group/m365group-teamify.js} +28 -20
- package/dist/m365/aad/commands/{o365group/o365group-user-add.js → m365group/m365group-user-add.js} +19 -14
- package/dist/m365/aad/commands/{o365group/o365group-user-list.js → m365group/m365group-user-list.js} +17 -12
- package/dist/m365/aad/commands/{o365group/o365group-user-remove.js → m365group/m365group-user-remove.js} +19 -14
- package/dist/m365/aad/commands/{o365group/o365group-user-set.js → m365group/m365group-user-set.js} +20 -15
- package/dist/m365/aad/commands/policy/policy-list.js +5 -5
- package/dist/m365/aad/commands/sp/sp-add.js +4 -1
- package/dist/m365/aad/commands/sp/sp-get.js +4 -1
- package/dist/m365/aad/commands/user/user-get.js +7 -2
- package/dist/m365/aad/commands.js +23 -22
- package/dist/m365/booking/commands/business/business-get.js +4 -1
- package/dist/m365/cli/commands/cli-issue.js +5 -5
- package/dist/m365/cli/commands/config/config-get.js +5 -5
- package/dist/m365/cli/commands/config/config-list.js +16 -0
- package/dist/m365/cli/commands/config/config-reset.js +5 -5
- package/dist/m365/cli/commands/config/config-set.js +5 -5
- package/dist/m365/cli/commands.js +1 -0
- package/dist/m365/commands/login.js +7 -7
- package/dist/m365/commands/request.js +1 -1
- package/dist/m365/flow/commands/flow-export.js +13 -13
- package/dist/m365/flow/commands/owner/owner-ensure.js +5 -5
- package/dist/m365/graph/commands/subscription/subscription-add.js +5 -5
- package/dist/m365/outlook/commands/message/message-list.js +4 -2
- package/dist/m365/outlook/commands/message/message-move.js +4 -2
- package/dist/m365/pa/commands/app/app-export.js +7 -7
- package/dist/m365/pa/commands/app/app-owner-set.js +5 -5
- package/dist/m365/pa/commands/app/app-permission-ensure.js +162 -0
- package/dist/m365/pa/commands/app/app-permission-list.js +2 -2
- package/dist/m365/pa/commands/app/app-permission-remove.js +153 -0
- package/dist/m365/pa/commands/connector/connector-export.js +5 -5
- package/dist/m365/pa/commands.js +3 -4
- package/dist/m365/planner/commands/bucket/bucket-add.js +6 -3
- package/dist/m365/planner/commands/bucket/bucket-get.js +11 -4
- package/dist/m365/planner/commands/bucket/bucket-list.js +6 -3
- package/dist/m365/planner/commands/bucket/bucket-remove.js +9 -4
- package/dist/m365/planner/commands/bucket/bucket-set.js +10 -4
- package/dist/m365/planner/commands/plan/plan-add.js +4 -1
- package/dist/m365/planner/commands/plan/plan-get.js +5 -3
- package/dist/m365/planner/commands/plan/plan-list.js +8 -6
- package/dist/m365/planner/commands/plan/plan-remove.js +4 -1
- package/dist/m365/planner/commands/plan/plan-set.js +6 -3
- package/dist/m365/planner/commands/roster/roster-get.js +4 -1
- package/dist/m365/planner/commands/roster/roster-member-add.js +4 -1
- package/dist/m365/planner/commands/roster/roster-member-get.js +4 -1
- package/dist/m365/planner/commands/roster/roster-member-list.js +4 -1
- package/dist/m365/planner/commands/roster/roster-member-remove.js +4 -1
- package/dist/m365/planner/commands/roster/roster-plan-list.js +4 -1
- package/dist/m365/planner/commands/roster/roster-remove.js +4 -1
- package/dist/m365/planner/commands/task/task-add.js +21 -12
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +4 -1
- package/dist/m365/planner/commands/task/task-checklistitem-list.js +4 -1
- package/dist/m365/planner/commands/task/task-checklistitem-remove.js +4 -1
- package/dist/m365/planner/commands/task/task-get.js +46 -28
- package/dist/m365/planner/commands/task/task-list.js +34 -19
- package/dist/m365/planner/commands/task/task-reference-add.js +4 -1
- package/dist/m365/planner/commands/task/task-reference-list.js +4 -1
- package/dist/m365/planner/commands/task/task-reference-remove.js +4 -1
- package/dist/m365/planner/commands/task/task-remove.js +49 -38
- package/dist/m365/planner/commands/task/task-set.js +38 -23
- package/dist/m365/pp/commands/aibuildermodel/aibuildermodel-get.js +4 -1
- package/dist/m365/pp/commands/card/card-get.js +3 -5
- package/dist/m365/pp/commands/chatbot/chatbot-get.js +3 -1
- package/dist/m365/pp/commands/chatbot/chatbot-list.js +2 -2
- package/dist/m365/pp/commands/managementapp/managementapp-add.js +4 -1
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +14 -14
- package/dist/m365/search/commands/externalconnection/externalconnection-remove.js +3 -1
- package/dist/m365/spfx/commands/package/package-generate.js +15 -15
- package/dist/m365/spfx/commands/project/DeployWorkflow.js +55 -0
- package/dist/m365/spfx/commands/project/project-doctor/{doctor-1.18.0-beta.1.js → doctor-1.18.0.js} +2 -2
- package/dist/m365/spfx/commands/project/project-doctor.js +9 -9
- package/dist/m365/spfx/commands/project/project-externalize/rules/PnPJsRule.js +2 -2
- package/dist/m365/spfx/commands/project/project-github-workflow-add.js +157 -0
- package/dist/m365/spfx/commands/project/project-github-workflow-model.js +2 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001022_DEP_office_ui_fabric_react.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002028_DEVDEP_microsoft_rush_stack_compiler_4_7.js +13 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.15.2.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/{upgrade-1.18.0-beta.1.js → upgrade-1.18.0.js} +35 -27
- package/dist/m365/spfx/commands/project/project-upgrade.js +26 -28
- package/dist/m365/spfx/commands/spfx-doctor.js +76 -106
- package/dist/m365/spfx/commands.js +1 -0
- package/dist/m365/spo/commands/app/SpoAppBaseCommand.js +27 -26
- package/dist/m365/spo/commands/app/app-add.js +9 -9
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-add.js +5 -5
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-get.js +5 -3
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-list.js +5 -5
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-remove.js +2 -2
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +3 -2
- package/dist/m365/spo/commands/commandset/commandset-add.js +11 -11
- package/dist/m365/spo/commands/commandset/commandset-get.js +12 -10
- package/dist/m365/spo/commands/commandset/commandset-list.js +5 -5
- package/dist/m365/spo/commands/commandset/commandset-remove.js +7 -6
- package/dist/m365/spo/commands/commandset/commandset-set.js +14 -12
- package/dist/m365/spo/commands/customaction/customaction-get.js +5 -2
- package/dist/m365/spo/commands/customaction/customaction-remove.js +3 -1
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +3 -1
- package/dist/m365/spo/commands/file/file-add.js +13 -13
- package/dist/m365/spo/commands/file/file-checkin.js +1 -1
- package/dist/m365/spo/commands/file/file-checkout.js +1 -1
- package/dist/m365/spo/commands/file/file-copy.js +36 -4
- package/dist/m365/spo/commands/file/file-get.js +11 -8
- package/dist/m365/spo/commands/file/file-list.js +4 -4
- package/dist/m365/spo/commands/file/file-move.js +74 -98
- package/dist/m365/spo/commands/file/file-remove.js +8 -8
- package/dist/m365/spo/commands/file/file-rename.js +2 -2
- package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +1 -1
- package/dist/m365/spo/commands/file/file-retentionlabel-remove.js +1 -1
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +1 -1
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +1 -1
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +1 -1
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +1 -1
- package/dist/m365/spo/commands/file/file-sharinglink-add.js +8 -8
- package/dist/m365/spo/commands/file/file-sharinglink-list.js +5 -5
- package/dist/m365/spo/commands/file/file-version-clear.js +3 -3
- package/dist/m365/spo/commands/file/file-version-get.js +3 -3
- package/dist/m365/spo/commands/file/file-version-list.js +3 -3
- package/dist/m365/spo/commands/file/file-version-remove.js +3 -3
- package/dist/m365/spo/commands/file/file-version-restore.js +3 -3
- package/dist/m365/spo/commands/folder/folder-add.js +2 -4
- package/dist/m365/spo/commands/folder/folder-copy.js +89 -45
- package/dist/m365/spo/commands/folder/folder-get.js +1 -1
- package/dist/m365/spo/commands/folder/folder-list.js +2 -2
- package/dist/m365/spo/commands/folder/folder-move.js +89 -47
- package/dist/m365/spo/commands/folder/folder-remove.js +7 -4
- package/dist/m365/spo/commands/folder/folder-rename.js +13 -17
- package/dist/m365/spo/commands/folder/folder-retentionlabel-ensure.js +1 -1
- package/dist/m365/spo/commands/folder/folder-retentionlabel-remove.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleassignment-add.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleinheritance-break.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +1 -1
- package/dist/m365/spo/commands/group/group-list.js +0 -1
- package/dist/m365/spo/commands/group/group-member-add.js +24 -24
- package/dist/m365/spo/commands/hubsite/hubsite-connect.js +7 -4
- package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +4 -1
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +3 -1
- package/dist/m365/spo/commands/list/list-add.js +4 -4
- package/dist/m365/spo/commands/list/list-retentionlabel-ensure.js +2 -24
- package/dist/m365/spo/commands/list/list-set.js +4 -4
- package/dist/m365/spo/commands/listitem/listitem-add.js +1 -0
- package/dist/m365/spo/commands/listitem/listitem-attachment-add.js +127 -0
- package/dist/m365/spo/commands/listitem/listitem-attachment-get.js +97 -0
- package/dist/m365/spo/commands/listitem/listitem-attachment-remove.js +121 -0
- package/dist/m365/spo/commands/listitem/listitem-attachment-set.js +115 -0
- package/dist/m365/spo/commands/listitem/listitem-set.js +3 -2
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +2 -2
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +34 -5
- package/dist/m365/spo/commands/page/clientsidepages.js +19 -81
- package/dist/m365/spo/commands/page/page-get.js +1 -0
- package/dist/m365/spo/commands/page/page-list.js +4 -3
- package/dist/m365/spo/commands/page/page-section-add.js +56 -21
- package/dist/m365/spo/commands/page/page-set.js +13 -2
- package/dist/m365/spo/commands/propertybag/propertybag-base.js +63 -59
- package/dist/m365/spo/commands/propertybag/propertybag-remove.js +28 -31
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +30 -32
- package/dist/m365/spo/commands/site/FlowsPolicy.js +7 -0
- package/dist/m365/spo/commands/site/site-add.js +114 -161
- package/dist/m365/spo/commands/site/site-apppermission-add.js +15 -18
- package/dist/m365/spo/commands/site/site-apppermission-remove.js +34 -38
- package/dist/m365/spo/commands/site/site-apppermission-set.js +11 -14
- package/dist/m365/spo/commands/site/site-commsite-enable.js +34 -5
- package/dist/m365/spo/commands/site/site-ensure.js +14 -67
- package/dist/m365/spo/commands/site/site-hubsite-disconnect.js +22 -22
- package/dist/m365/spo/commands/site/site-list.js +25 -43
- package/dist/m365/spo/commands/site/site-recyclebinitem-list.js +6 -6
- package/dist/m365/spo/commands/site/site-remove.js +166 -210
- package/dist/m365/spo/commands/site/site-set.js +178 -199
- package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +1 -1
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +12 -7
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-list.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-remove.js +2 -1
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-set.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-commandset-add.js +8 -8
- package/dist/m365/spo/commands/tenant/tenant-commandset-get.js +8 -3
- package/dist/m365/spo/commands/tenant/tenant-commandset-list.js +3 -2
- package/dist/m365/spo/commands/tenant/tenant-commandset-remove.js +3 -1
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +8 -8
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +4 -4
- package/dist/m365/spo/commands/term/term-get.js +6 -6
- package/dist/m365/spo/commands/theme/theme-list.js +1 -9
- package/dist/m365/spo/commands/theme/theme-remove.js +24 -24
- package/dist/m365/spo/commands/theme/theme-set.js +0 -1
- package/dist/m365/spo/commands/user/user-get.js +10 -10
- package/dist/m365/spo/commands/user/user-remove.js +27 -27
- package/dist/m365/spo/commands/web/web-reindex.js +35 -42
- package/dist/m365/spo/commands/web/web-remove.js +21 -21
- package/dist/m365/spo/commands/web/web-roleassignment-add.js +16 -31
- package/dist/m365/spo/commands/web/web-roleassignment-remove.js +33 -44
- package/dist/m365/spo/commands/web/web-roleinheritance-break.js +18 -18
- package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +19 -19
- package/dist/m365/spo/commands/web/web-set.js +5 -5
- package/dist/m365/spo/commands.js +4 -0
- package/dist/m365/teams/commands/app/app-list.js +5 -5
- package/dist/m365/teams/commands/app/app-remove.js +49 -15
- package/dist/m365/teams/commands/channel/channel-add.js +5 -1
- package/dist/m365/teams/commands/channel/channel-member-add.js +12 -10
- package/dist/m365/teams/commands/channel/channel-member-remove.js +3 -1
- package/dist/m365/teams/commands/channel/channel-member-set.js +4 -1
- package/dist/m365/teams/commands/chat/chat-get.js +7 -10
- package/dist/m365/teams/commands/chat/chat-member-add.js +5 -5
- package/dist/m365/teams/commands/chat/chat-message-send.js +8 -10
- package/dist/m365/teams/commands/funsettings/funsettings-set.js +4 -4
- package/dist/m365/teams/commands/guestsettings/guestsettings-set.js +4 -4
- package/dist/m365/teams/commands/meeting/meeting-list.js +101 -51
- package/dist/m365/teams/commands/membersettings/membersettings-set.js +4 -4
- package/dist/m365/teams/commands/messagingsettings/messagingsettings-set.js +5 -5
- package/dist/m365/teams/commands/team/team-clone.js +5 -10
- package/dist/m365/teams/commands/team/team-list.js +94 -30
- package/dist/m365/teams/commands/team/team-set.js +3 -3
- package/dist/m365/tenant/commands/info/info-get.js +83 -0
- package/dist/m365/tenant/commands.js +1 -0
- package/dist/m365/todo/commands/task/task-add.js +6 -6
- package/dist/m365/yammer/commands/message/message-like-set.js +27 -28
- package/dist/m365/yammer/commands/message/message-list.js +67 -86
- package/dist/m365/yammer/commands/message/message-remove.js +18 -18
- package/dist/m365/yammer/commands/yammer-search.js +58 -74
- package/dist/utils/aadGroup.js +39 -3
- package/dist/utils/formatting.js +7 -0
- package/dist/utils/fsUtil.js +5 -0
- package/dist/utils/planner.js +4 -3
- package/dist/utils/powerPlatform.js +1 -1
- package/dist/utils/spo.js +595 -54
- package/dist/utils/validation.js +0 -3
- package/docs/docs/_clisettings.mdx +2 -2
- package/docs/docs/cmd/_global.mdx +1 -1
- package/docs/docs/cmd/aad/app/app-set.mdx +15 -15
- package/docs/docs/cmd/aad/approleassignment/approleassignment-add.mdx +9 -9
- package/docs/docs/cmd/aad/approleassignment/approleassignment-remove.mdx +10 -10
- package/docs/docs/cmd/aad/group/group-get.mdx +5 -5
- package/docs/docs/cmd/aad/group/group-list.mdx +0 -11
- package/docs/docs/cmd/aad/group/group-remove.mdx +44 -0
- package/docs/docs/cmd/aad/{o365group/o365group-add.mdx → m365group/m365group-add.mdx} +25 -15
- package/docs/docs/cmd/aad/{o365group/o365group-conversation-list.mdx → m365group/m365group-conversation-list.mdx} +4 -4
- package/docs/docs/cmd/aad/{o365group/o365group-conversation-post-list.mdx → m365group/m365group-conversation-post-list.mdx} +8 -8
- package/docs/docs/cmd/aad/{o365group/o365group-get.mdx → m365group/m365group-get.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-list.mdx → m365group/m365group-list.mdx} +12 -29
- package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-clear.mdx → m365group/m365group-recyclebinitem-clear.mdx} +5 -5
- package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-list.mdx → m365group/m365group-recyclebinitem-list.mdx} +8 -8
- package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-remove.mdx → m365group/m365group-recyclebinitem-remove.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-recyclebinitem-restore.mdx → m365group/m365group-recyclebinitem-restore.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-remove.mdx → m365group/m365group-remove.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-renew.mdx → m365group/m365group-renew.mdx} +4 -4
- package/docs/docs/cmd/aad/{o365group/o365group-report-activitycounts.mdx → m365group/m365group-report-activitycounts.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-report-activitydetail.mdx → m365group/m365group-report-activitydetail.mdx} +7 -7
- package/docs/docs/cmd/aad/{o365group/o365group-report-activityfilecounts.mdx → m365group/m365group-report-activityfilecounts.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-report-activitygroupcounts.mdx → m365group/m365group-report-activitygroupcounts.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-report-activitystorage.mdx → m365group/m365group-report-activitystorage.mdx} +6 -6
- package/docs/docs/cmd/aad/{o365group/o365group-set.mdx → m365group/m365group-set.mdx} +8 -8
- package/docs/docs/cmd/aad/{o365group/o365group-teamify.mdx → m365group/m365group-teamify.mdx} +5 -5
- package/docs/docs/cmd/aad/{o365group/o365group-user-add.mdx → m365group/m365group-user-add.mdx} +5 -5
- package/docs/docs/cmd/aad/{o365group/o365group-user-list.mdx → m365group/m365group-user-list.mdx} +7 -7
- package/docs/docs/cmd/aad/{o365group/o365group-user-remove.mdx → m365group/m365group-user-remove.mdx} +5 -5
- package/docs/docs/cmd/aad/{o365group/o365group-user-set.mdx → m365group/m365group-user-set.mdx} +5 -5
- package/docs/docs/cmd/aad/policy/policy-list.mdx +5 -5
- package/docs/docs/cmd/aad/user/user-set.mdx +1 -1
- package/docs/docs/cmd/cli/config/config-list.mdx +78 -0
- package/docs/docs/cmd/flow/flow-enable.mdx +2 -2
- package/docs/docs/cmd/flow/flow-export.mdx +11 -11
- package/docs/docs/cmd/graph/subscription/subscription-add.mdx +10 -10
- package/docs/docs/cmd/login.mdx +6 -0
- package/docs/docs/cmd/pa/app/app-export.mdx +5 -5
- package/docs/docs/cmd/pa/app/app-permission-ensure.mdx +85 -0
- package/docs/docs/cmd/pa/app/app-permission-remove.mdx +74 -0
- package/docs/docs/cmd/pa/connector/connector-export.mdx +3 -3
- package/docs/docs/cmd/planner/plan/plan-add.mdx +1 -1
- package/docs/docs/cmd/planner/task/task-add.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-get.mdx +13 -4
- package/docs/docs/cmd/planner/task/task-list.mdx +22 -7
- package/docs/docs/cmd/planner/task/task-remove.mdx +25 -8
- package/docs/docs/cmd/planner/task/task-set.mdx +22 -7
- package/docs/docs/cmd/pp/chatbot/chatbot-list.mdx +4 -4
- package/docs/docs/cmd/pp/dataverse/dataverse-table-get.mdx +2 -2
- package/docs/docs/cmd/pp/dataverse/dataverse-table-list.mdx +2 -2
- package/docs/docs/cmd/pp/dataverse/dataverse-table-remove.mdx +3 -3
- package/docs/docs/cmd/pp/solution/solution-publisher-get.mdx +2 -2
- package/docs/docs/cmd/pp/solution/solution-publisher-remove.mdx +2 -2
- package/docs/docs/cmd/spfx/project/project-github-workflow-add.mdx +94 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-checkin.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +1 -9
- package/docs/docs/cmd/spo/file/file-checkout.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-copy.mdx +20 -16
- package/docs/docs/cmd/spo/file/file-get.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-list.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-move.mdx +36 -18
- package/docs/docs/cmd/spo/file/file-remove.mdx +10 -10
- package/docs/docs/cmd/spo/file/file-rename.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +2 -2
- package/docs/docs/cmd/spo/file/file-retentionlabel-remove.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-roleassignment-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-break.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-roleinheritance-reset.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinginfo-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-add.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-clear.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-get.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-list.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-remove.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-sharinglink-set.mdx +1 -1
- package/docs/docs/cmd/spo/file/file-version-clear.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-version-get.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-version-list.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-version-remove.mdx +3 -3
- package/docs/docs/cmd/spo/file/file-version-restore.mdx +3 -3
- package/docs/docs/cmd/spo/folder/folder-add.mdx +76 -1
- package/docs/docs/cmd/spo/folder/folder-copy.mdx +39 -12
- package/docs/docs/cmd/spo/folder/folder-get.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-list.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-move.mdx +40 -13
- package/docs/docs/cmd/spo/folder/folder-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-rename.mdx +5 -1
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-roleassignment-add.mdx +2 -2
- package/docs/docs/cmd/spo/folder/folder-roleassignment-remove.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-break.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.mdx +1 -1
- package/docs/docs/cmd/spo/group/group-member-add.mdx +27 -27
- package/docs/docs/cmd/spo/list/list-contenttype-remove.mdx +1 -1
- package/docs/docs/cmd/spo/list/list-retentionlabel-ensure.mdx +2 -11
- package/docs/docs/cmd/spo/listitem/listitem-add.mdx +2 -5
- package/docs/docs/cmd/spo/listitem/listitem-attachment-add.mdx +110 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-get.mdx +104 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-list.mdx +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-attachment-remove.mdx +58 -0
- package/docs/docs/cmd/spo/listitem/listitem-attachment-set.mdx +58 -0
- package/docs/docs/cmd/spo/listitem/listitem-set.mdx +2 -5
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.mdx +14 -1
- package/docs/docs/cmd/spo/page/page-get.mdx +0 -1
- package/docs/docs/cmd/spo/page/page-list.mdx +0 -1
- package/docs/docs/cmd/spo/page/page-section-add.mdx +25 -1
- package/docs/docs/cmd/spo/page/page-set.mdx +23 -0
- package/docs/docs/cmd/spo/site/site-add.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-commsite-enable.mdx +11 -2
- package/docs/docs/cmd/spo/site/site-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/site/site-list.mdx +3 -78
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-get.mdx +2 -2
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-list.mdx +3 -5
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-remove.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-commandset-add.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-commandset-list.mdx +2 -4
- package/docs/docs/cmd/spo/tenant/tenant-commandset-remove.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-commandset-set.mdx +1 -1
- package/docs/docs/cmd/spo/user/user-get.mdx +8 -8
- package/docs/docs/cmd/teams/app/app-remove.mdx +9 -6
- package/docs/docs/cmd/teams/channel/channel-member-add.mdx +4 -4
- package/docs/docs/cmd/teams/meeting/meeting-list.mdx +135 -92
- package/docs/docs/cmd/teams/team/team-add.mdx +1 -1
- package/docs/docs/cmd/teams/team/team-clone.mdx +3 -3
- package/docs/docs/cmd/teams/team/team-list.mdx +47 -22
- package/docs/docs/cmd/tenant/info/info-get.mdx +101 -0
- package/docs/docs/cmd/yammer/network/network-list.mdx +1 -1
- package/npm-shrinkwrap.json +310 -1433
- package/package.json +23 -28
- package/dist/m365/pa/cds-project-mutator.js +0 -91
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/generated/ManifestTypes.d.ts +0 -11
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/template_ControlManifest.Input.xml +0 -31
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/dataset-template/template_index.ts +0 -51
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/generated/ManifestTypes.d.ts +0 -12
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/template_ControlManifest.Input.xml +0 -37
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/field-template/template_index.ts +0 -48
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/index.ts +0 -0
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-dataset-template/template_ControlManifest.Input.xml +0 -31
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-dataset-template/template_index.tsx +0 -58
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-field-template/template_ControlManifest.Input.xml +0 -37
- package/dist/m365/pa/commands/pcf/pcf-init/assets/control/virtual-field-template/template_index.tsx +0 -55
- package/dist/m365/pa/commands/pcf/pcf-init/assets/package.json +0 -19
- package/dist/m365/pa/commands/pcf/pcf-init/assets/pcfconfig.json +0 -3
- package/dist/m365/pa/commands/pcf/pcf-init/assets/template_.gitignore +0 -14
- package/dist/m365/pa/commands/pcf/pcf-init/assets/template_pcfprojecttype.pcfproj +0 -45
- package/dist/m365/pa/commands/pcf/pcf-init/pcf-init-variables.js +0 -2
- package/dist/m365/pa/commands/pcf/pcf-init.js +0 -120
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/Customizations.xml +0 -18
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/Relationships.xml +0 -2
- package/dist/m365/pa/commands/solution/solution-init/assets/Other/template_Solution.xml +0 -94
- package/dist/m365/pa/commands/solution/solution-init/assets/template_.gitignore +0 -2
- package/dist/m365/pa/commands/solution/solution-init/assets/template_solutionprojecttype.cdsproj +0 -44
- package/dist/m365/pa/commands/solution/solution-init/solution-init-variables.js +0 -2
- package/dist/m365/pa/commands/solution/solution-init.js +0 -126
- package/dist/m365/pa/commands/solution/solution-reference-add.js +0 -88
- package/dist/m365/pa/template-instantiator.js +0 -57
- package/docs/docs/cmd/pa/pcf/pcf-init.mdx +0 -56
- package/docs/docs/cmd/pa/solution/solution-init.mdx +0 -46
- package/docs/docs/cmd/pa/solution/solution-reference-add.mdx +0 -42
- /package/dist/m365/aad/commands/{o365group → m365group}/GroupExtended.js +0 -0
|
@@ -3,11 +3,13 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _TeamsTeamListCommand_instances, _TeamsTeamListCommand_initTelemetry, _TeamsTeamListCommand_initOptions;
|
|
6
|
+
var _TeamsTeamListCommand_instances, _TeamsTeamListCommand_initTelemetry, _TeamsTeamListCommand_initOptions, _TeamsTeamListCommand_initValidators, _TeamsTeamListCommand_initOptionSets, _TeamsTeamListCommand_initTypes;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { odata } from '../../../../utils/odata.js';
|
|
9
9
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
10
10
|
import commands from '../../commands.js';
|
|
11
|
+
import { validation } from '../../../../utils/validation.js';
|
|
12
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
11
13
|
class TeamsTeamListCommand extends GraphCommand {
|
|
12
14
|
get name() {
|
|
13
15
|
return commands.TEAM_LIST;
|
|
@@ -23,64 +25,126 @@ class TeamsTeamListCommand extends GraphCommand {
|
|
|
23
25
|
_TeamsTeamListCommand_instances.add(this);
|
|
24
26
|
__classPrivateFieldGet(this, _TeamsTeamListCommand_instances, "m", _TeamsTeamListCommand_initTelemetry).call(this);
|
|
25
27
|
__classPrivateFieldGet(this, _TeamsTeamListCommand_instances, "m", _TeamsTeamListCommand_initOptions).call(this);
|
|
28
|
+
__classPrivateFieldGet(this, _TeamsTeamListCommand_instances, "m", _TeamsTeamListCommand_initValidators).call(this);
|
|
29
|
+
__classPrivateFieldGet(this, _TeamsTeamListCommand_instances, "m", _TeamsTeamListCommand_initOptionSets).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _TeamsTeamListCommand_instances, "m", _TeamsTeamListCommand_initTypes).call(this);
|
|
26
31
|
}
|
|
27
32
|
async commandAction(logger, args) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
33
|
+
if (this.verbose) {
|
|
34
|
+
if (!args.options.joined && !args.options.associated) {
|
|
35
|
+
await logger.logToStderr(`Retrieving Microsoft Teams in the tenant...`);
|
|
36
|
+
}
|
|
37
|
+
else {
|
|
38
|
+
const user = args.options.userId || args.options.userName || 'me';
|
|
39
|
+
await logger.logToStderr(`Retrieving Microsoft Teams ${args.options.joined ? 'joined by' : 'associated with'} ${user}...`);
|
|
40
|
+
}
|
|
31
41
|
}
|
|
32
42
|
try {
|
|
33
|
-
|
|
34
|
-
if (args.options.joined) {
|
|
35
|
-
|
|
43
|
+
let endpoint = `${this.resource}/v1.0`;
|
|
44
|
+
if (args.options.joined || args.options.associated) {
|
|
45
|
+
endpoint += args.options.userId || args.options.userName ? `/users/${args.options.userId || formatting.encodeQueryParameter(args.options.userName)}` : '/me';
|
|
46
|
+
endpoint += args.options.joined ? '/joinedTeams' : '/teamwork/associatedTeams';
|
|
47
|
+
endpoint += '?$select=id';
|
|
36
48
|
}
|
|
37
49
|
else {
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
}).map(g => this.getTeamFromGroup(g)));
|
|
41
|
-
await logger.log(teamItems);
|
|
50
|
+
// Get all team groups within the tenant
|
|
51
|
+
endpoint += `/groups?$select=id&$filter=resourceProvisioningOptions/Any(x:x eq 'Team')`;
|
|
42
52
|
}
|
|
53
|
+
const groupResponse = await odata.getAllItems(endpoint);
|
|
54
|
+
const groupIds = groupResponse.map(g => g.id);
|
|
55
|
+
if (this.verbose) {
|
|
56
|
+
await logger.logToStderr(`Retrieved ${groupIds.length} Microsoft Teams, getting additional information...`);
|
|
57
|
+
}
|
|
58
|
+
let teams = await this.getAllTeams(groupIds);
|
|
59
|
+
// Sort teams by display name
|
|
60
|
+
teams = teams.sort((x, y) => x.displayName.localeCompare(y.displayName));
|
|
61
|
+
await logger.log(teams);
|
|
43
62
|
}
|
|
44
63
|
catch (err) {
|
|
45
64
|
this.handleRejectedODataJsonPromise(err);
|
|
46
65
|
}
|
|
47
66
|
}
|
|
48
|
-
async
|
|
67
|
+
async getAllTeams(groupIds) {
|
|
68
|
+
const groupBatches = [];
|
|
69
|
+
for (let i = 0; groupIds.length > i; i += 20) {
|
|
70
|
+
groupBatches.push(groupIds.slice(i, i + 20));
|
|
71
|
+
}
|
|
72
|
+
const promises = groupBatches.map(g => this.getTeamsBatch(g));
|
|
73
|
+
const teams = await Promise.all(promises);
|
|
74
|
+
const result = teams.reduce((prev, val) => prev.concat(val), []);
|
|
75
|
+
return result;
|
|
76
|
+
}
|
|
77
|
+
async getTeamsBatch(groupIds) {
|
|
49
78
|
const requestOptions = {
|
|
50
|
-
url: `${this.resource}/v1.0
|
|
79
|
+
url: `${this.resource}/v1.0/$batch`,
|
|
51
80
|
headers: {
|
|
52
|
-
accept: 'application/json;odata.metadata=none'
|
|
81
|
+
accept: 'application/json;odata.metadata=none',
|
|
82
|
+
'content-type': 'application/json'
|
|
53
83
|
},
|
|
54
|
-
responseType: 'json'
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
description: group.description,
|
|
65
|
-
isArchived: undefined
|
|
66
|
-
};
|
|
84
|
+
responseType: 'json',
|
|
85
|
+
data: {
|
|
86
|
+
requests: groupIds.map((id, index) => ({
|
|
87
|
+
id: index.toString(),
|
|
88
|
+
method: 'GET',
|
|
89
|
+
headers: {
|
|
90
|
+
accept: 'application/json;odata.metadata=none'
|
|
91
|
+
},
|
|
92
|
+
url: `/teams/${id}`
|
|
93
|
+
}))
|
|
67
94
|
}
|
|
68
|
-
|
|
69
|
-
|
|
95
|
+
};
|
|
96
|
+
const response = await request.post(requestOptions);
|
|
97
|
+
// Throw error if any of the requests failed
|
|
98
|
+
for (const item of response.responses) {
|
|
99
|
+
if (item.status !== 200) {
|
|
100
|
+
throw item.body;
|
|
70
101
|
}
|
|
71
102
|
}
|
|
103
|
+
return response.responses.map(r => r.body);
|
|
72
104
|
}
|
|
73
105
|
}
|
|
74
106
|
_TeamsTeamListCommand_instances = new WeakSet(), _TeamsTeamListCommand_initTelemetry = function _TeamsTeamListCommand_initTelemetry() {
|
|
75
107
|
this.telemetry.push((args) => {
|
|
76
108
|
Object.assign(this.telemetryProperties, {
|
|
77
|
-
joined: args.options.joined
|
|
109
|
+
joined: !!args.options.joined,
|
|
110
|
+
associated: !!args.options.associated,
|
|
111
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
112
|
+
userName: typeof args.options.userName !== 'undefined'
|
|
78
113
|
});
|
|
79
114
|
});
|
|
80
115
|
}, _TeamsTeamListCommand_initOptions = function _TeamsTeamListCommand_initOptions() {
|
|
81
116
|
this.options.unshift({
|
|
82
117
|
option: '-j, --joined'
|
|
118
|
+
}, {
|
|
119
|
+
option: '-a, --associated'
|
|
120
|
+
}, {
|
|
121
|
+
option: '--userId [userId]'
|
|
122
|
+
}, {
|
|
123
|
+
option: '--userName [userName]'
|
|
124
|
+
});
|
|
125
|
+
}, _TeamsTeamListCommand_initValidators = function _TeamsTeamListCommand_initValidators() {
|
|
126
|
+
this.validators.push(async (args) => {
|
|
127
|
+
if (args.options.userId && !validation.isValidGuid(args.options.userId)) {
|
|
128
|
+
return `${args.options.userId} is not a valid GUID for userId.`;
|
|
129
|
+
}
|
|
130
|
+
if (args.options.userName && !validation.isValidUserPrincipalName(args.options.userName)) {
|
|
131
|
+
return `${args.options.userId} is not a valid UPN for userName.`;
|
|
132
|
+
}
|
|
133
|
+
if ((args.options.userId || args.options.userName) && !args.options.joined && !args.options.associated) {
|
|
134
|
+
return 'You must specify either joined or associated when specifying userId or userName.';
|
|
135
|
+
}
|
|
136
|
+
return true;
|
|
137
|
+
});
|
|
138
|
+
}, _TeamsTeamListCommand_initOptionSets = function _TeamsTeamListCommand_initOptionSets() {
|
|
139
|
+
this.optionSets.push({
|
|
140
|
+
options: ['joined', 'associated'],
|
|
141
|
+
runsWhen: (args) => !!args.options.joined || !!args.options.associated
|
|
142
|
+
}, {
|
|
143
|
+
options: ['userId', 'userName'],
|
|
144
|
+
runsWhen: (args) => typeof args.options.userId !== 'undefined' || typeof args.options.userName !== 'undefined'
|
|
83
145
|
});
|
|
146
|
+
}, _TeamsTeamListCommand_initTypes = function _TeamsTeamListCommand_initTypes() {
|
|
147
|
+
this.types.string.push('userId', 'userName');
|
|
84
148
|
};
|
|
85
149
|
export default new TeamsTeamListCommand();
|
|
86
150
|
//# sourceMappingURL=team-list.js.map
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _TeamsTeamSetCommand_instances, _TeamsTeamSetCommand_initTelemetry, _TeamsTeamSetCommand_initOptions, _TeamsTeamSetCommand_initValidators;
|
|
6
|
+
var _TeamsTeamSetCommand_instances, _a, _TeamsTeamSetCommand_initTelemetry, _TeamsTeamSetCommand_initOptions, _TeamsTeamSetCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { formatting } from '../../../../utils/formatting.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -60,9 +60,9 @@ class TeamsTeamSetCommand extends GraphCommand {
|
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
62
|
}
|
|
63
|
-
_TeamsTeamSetCommand_instances = new WeakSet(), _TeamsTeamSetCommand_initTelemetry = function _TeamsTeamSetCommand_initTelemetry() {
|
|
63
|
+
_a = TeamsTeamSetCommand, _TeamsTeamSetCommand_instances = new WeakSet(), _TeamsTeamSetCommand_initTelemetry = function _TeamsTeamSetCommand_initTelemetry() {
|
|
64
64
|
this.telemetry.push((args) => {
|
|
65
|
-
|
|
65
|
+
_a.props.forEach((p) => {
|
|
66
66
|
this.telemetryProperties[p] = typeof args.options[p] !== 'undefined';
|
|
67
67
|
});
|
|
68
68
|
});
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
2
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
3
|
+
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
|
+
};
|
|
6
|
+
var _TenantInfoGetCommand_instances, _TenantInfoGetCommand_initTelemetry, _TenantInfoGetCommand_initOptions, _TenantInfoGetCommand_initValidators;
|
|
7
|
+
import auth from '../../../../Auth.js';
|
|
8
|
+
import GraphCommand from '../../../base/GraphCommand.js';
|
|
9
|
+
import request from '../../../../request.js';
|
|
10
|
+
import { accessToken } from '../../../../utils/accessToken.js';
|
|
11
|
+
import { formatting } from '../../../../utils/formatting.js';
|
|
12
|
+
import { validation } from '../../../../utils/validation.js';
|
|
13
|
+
import commands from '../../commands.js';
|
|
14
|
+
class TenantInfoGetCommand extends GraphCommand {
|
|
15
|
+
get name() {
|
|
16
|
+
return commands.INFO_GET;
|
|
17
|
+
}
|
|
18
|
+
get description() {
|
|
19
|
+
return 'Gets information about any tenant';
|
|
20
|
+
}
|
|
21
|
+
constructor() {
|
|
22
|
+
super();
|
|
23
|
+
_TenantInfoGetCommand_instances.add(this);
|
|
24
|
+
__classPrivateFieldGet(this, _TenantInfoGetCommand_instances, "m", _TenantInfoGetCommand_initTelemetry).call(this);
|
|
25
|
+
__classPrivateFieldGet(this, _TenantInfoGetCommand_instances, "m", _TenantInfoGetCommand_initOptions).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _TenantInfoGetCommand_instances, "m", _TenantInfoGetCommand_initValidators).call(this);
|
|
27
|
+
}
|
|
28
|
+
async commandAction(logger, args) {
|
|
29
|
+
let domainName = args.options.domainName;
|
|
30
|
+
const tenantId = args.options.tenantId;
|
|
31
|
+
if (!domainName && !tenantId) {
|
|
32
|
+
const userName = accessToken.getUserNameFromAccessToken(auth.service.accessTokens[auth.defaultResource].accessToken);
|
|
33
|
+
domainName = userName.split('@')[1];
|
|
34
|
+
}
|
|
35
|
+
let requestUrl = `${this.resource}/v1.0/tenantRelationships/`;
|
|
36
|
+
if (tenantId) {
|
|
37
|
+
requestUrl += `findTenantInformationByTenantId(tenantId='${formatting.encodeQueryParameter(tenantId)}')`;
|
|
38
|
+
}
|
|
39
|
+
else {
|
|
40
|
+
requestUrl += `findTenantInformationByDomainName(domainName='${formatting.encodeQueryParameter(domainName)}')`;
|
|
41
|
+
}
|
|
42
|
+
const requestOptions = {
|
|
43
|
+
url: requestUrl,
|
|
44
|
+
headers: {
|
|
45
|
+
accept: 'application/json;odata.metadata=none'
|
|
46
|
+
},
|
|
47
|
+
responseType: 'json'
|
|
48
|
+
};
|
|
49
|
+
try {
|
|
50
|
+
const res = await request.get(requestOptions);
|
|
51
|
+
await logger.log(res);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
this.handleRejectedODataJsonPromise(err);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
_TenantInfoGetCommand_instances = new WeakSet(), _TenantInfoGetCommand_initTelemetry = function _TenantInfoGetCommand_initTelemetry() {
|
|
59
|
+
this.telemetry.push((args) => {
|
|
60
|
+
Object.assign(this.telemetryProperties, {
|
|
61
|
+
domainName: typeof args.options.domainName !== 'undefined',
|
|
62
|
+
tenantId: typeof args.options.tenantId !== 'undefined'
|
|
63
|
+
});
|
|
64
|
+
});
|
|
65
|
+
}, _TenantInfoGetCommand_initOptions = function _TenantInfoGetCommand_initOptions() {
|
|
66
|
+
this.options.unshift({
|
|
67
|
+
option: '-d, --domainName [domainName]'
|
|
68
|
+
}, {
|
|
69
|
+
option: '-i, --tenantId [tenantId]'
|
|
70
|
+
});
|
|
71
|
+
}, _TenantInfoGetCommand_initValidators = function _TenantInfoGetCommand_initValidators() {
|
|
72
|
+
this.validators.push(async (args) => {
|
|
73
|
+
if (args.options.tenantId && !validation.isValidGuid(args.options.tenantId)) {
|
|
74
|
+
return `${args.options.tenantId} is not a valid GUID`;
|
|
75
|
+
}
|
|
76
|
+
if (args.options.tenantId && args.options.domainName) {
|
|
77
|
+
return `Specify either domainName or tenantId but not both`;
|
|
78
|
+
}
|
|
79
|
+
return true;
|
|
80
|
+
});
|
|
81
|
+
};
|
|
82
|
+
export default new TenantInfoGetCommand();
|
|
83
|
+
//# sourceMappingURL=info-get.js.map
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
const prefix = 'tenant';
|
|
2
2
|
export default {
|
|
3
3
|
ID_GET: `${prefix} id get`,
|
|
4
|
+
INFO_GET: `${prefix} info get`,
|
|
4
5
|
REPORT_ACTIVEUSERCOUNTS: `${prefix} report activeusercounts`,
|
|
5
6
|
REPORT_ACTIVEUSERDETAIL: `${prefix} report activeuserdetail`,
|
|
6
7
|
REPORT_OFFICE365ACTIVATIONCOUNTS: `${prefix} report office365activationcounts`,
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _TodoTaskAddCommand_instances, _TodoTaskAddCommand_initTelemetry, _TodoTaskAddCommand_initOptions, _TodoTaskAddCommand_initValidators, _TodoTaskAddCommand_initOptionSets;
|
|
6
|
+
var _TodoTaskAddCommand_instances, _a, _TodoTaskAddCommand_initTelemetry, _TodoTaskAddCommand_initOptions, _TodoTaskAddCommand_initValidators, _TodoTaskAddCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { validation } from '../../../../utils/validation.js';
|
|
9
9
|
import GraphCommand from '../../../base/GraphCommand.js';
|
|
@@ -27,7 +27,7 @@ class TodoTaskAddCommand extends GraphCommand {
|
|
|
27
27
|
const endpoint = `${this.resource}/v1.0`;
|
|
28
28
|
try {
|
|
29
29
|
const listId = await this.getTodoListId(args);
|
|
30
|
-
const status = args.options.status &&
|
|
30
|
+
const status = args.options.status && _a.allowedStatuses.filter(x => x.toLowerCase() === args.options.status.toLowerCase())[0];
|
|
31
31
|
const requestOptions = {
|
|
32
32
|
url: `${endpoint}/me/todo/lists/${listId}/tasks`,
|
|
33
33
|
headers: {
|
|
@@ -85,7 +85,7 @@ class TodoTaskAddCommand extends GraphCommand {
|
|
|
85
85
|
return taskList.id;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
88
|
-
_TodoTaskAddCommand_instances = new WeakSet(), _TodoTaskAddCommand_initTelemetry = function _TodoTaskAddCommand_initTelemetry() {
|
|
88
|
+
_a = TodoTaskAddCommand, _TodoTaskAddCommand_instances = new WeakSet(), _TodoTaskAddCommand_initTelemetry = function _TodoTaskAddCommand_initTelemetry() {
|
|
89
89
|
this.telemetry.push((args) => {
|
|
90
90
|
Object.assign(this.telemetryProperties, {
|
|
91
91
|
listId: typeof args.options.listId !== 'undefined',
|
|
@@ -128,7 +128,7 @@ _TodoTaskAddCommand_instances = new WeakSet(), _TodoTaskAddCommand_initTelemetry
|
|
|
128
128
|
option: '--startDateTime [startDateTime]'
|
|
129
129
|
}, {
|
|
130
130
|
option: '--status [status]',
|
|
131
|
-
autocomplete:
|
|
131
|
+
autocomplete: _a.allowedStatuses
|
|
132
132
|
});
|
|
133
133
|
}, _TodoTaskAddCommand_initValidators = function _TodoTaskAddCommand_initValidators() {
|
|
134
134
|
this.validators.push(async (args) => {
|
|
@@ -150,8 +150,8 @@ _TodoTaskAddCommand_instances = new WeakSet(), _TodoTaskAddCommand_initTelemetry
|
|
|
150
150
|
if (args.options.startDateTime && !validation.isValidISODateTime(args.options.startDateTime)) {
|
|
151
151
|
return `'${args.options.startDateTime}' is not a valid datetime.`;
|
|
152
152
|
}
|
|
153
|
-
if (args.options.status &&
|
|
154
|
-
return `${args.options.status} is not a valid value for status. Valid values are ${
|
|
153
|
+
if (args.options.status && _a.allowedStatuses.map(x => x.toLowerCase()).indexOf(args.options.status.toLowerCase()) === -1) {
|
|
154
|
+
return `${args.options.status} is not a valid value for status. Valid values are ${_a.allowedStatuses.join(', ')}`;
|
|
155
155
|
}
|
|
156
156
|
if (args.options.completedDateTime && args.options.status?.toLowerCase() !== 'completed') {
|
|
157
157
|
return `The completedDateTime option can only be used when the status option is set to completed`;
|
|
@@ -24,34 +24,9 @@ class YammerMessageLikeSetCommand extends YammerCommand {
|
|
|
24
24
|
__classPrivateFieldGet(this, _YammerMessageLikeSetCommand_instances, "m", _YammerMessageLikeSetCommand_initValidators).call(this);
|
|
25
25
|
}
|
|
26
26
|
async commandAction(logger, args) {
|
|
27
|
-
const executeLikeAction = async () => {
|
|
28
|
-
const endpoint = `${this.resource}/v1/messages/liked_by/current.json`;
|
|
29
|
-
const requestOptions = {
|
|
30
|
-
url: endpoint,
|
|
31
|
-
headers: {
|
|
32
|
-
accept: 'application/json;odata.metadata=none',
|
|
33
|
-
'content-type': 'application/json;odata=nometadata'
|
|
34
|
-
},
|
|
35
|
-
responseType: 'json',
|
|
36
|
-
data: {
|
|
37
|
-
message_id: args.options.messageId
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
try {
|
|
41
|
-
if (args.options.enable !== false) {
|
|
42
|
-
await request.post(requestOptions);
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
await request.delete(requestOptions);
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
catch (err) {
|
|
49
|
-
this.handleRejectedODataJsonPromise(err);
|
|
50
|
-
}
|
|
51
|
-
};
|
|
52
27
|
if (args.options.enable === false) {
|
|
53
28
|
if (args.options.force) {
|
|
54
|
-
await executeLikeAction();
|
|
29
|
+
await this.executeLikeAction(args.options);
|
|
55
30
|
}
|
|
56
31
|
else {
|
|
57
32
|
const messagePrompt = `Are you sure you want to unlike message ${args.options.messageId}?`;
|
|
@@ -62,12 +37,36 @@ class YammerMessageLikeSetCommand extends YammerCommand {
|
|
|
62
37
|
message: messagePrompt
|
|
63
38
|
});
|
|
64
39
|
if (result.continue) {
|
|
65
|
-
await executeLikeAction();
|
|
40
|
+
await this.executeLikeAction(args.options);
|
|
66
41
|
}
|
|
67
42
|
}
|
|
68
43
|
}
|
|
69
44
|
else {
|
|
70
|
-
await executeLikeAction();
|
|
45
|
+
await this.executeLikeAction(args.options);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
async executeLikeAction(options) {
|
|
49
|
+
const requestOptions = {
|
|
50
|
+
url: `${this.resource}/v1/messages/liked_by/current.json`,
|
|
51
|
+
headers: {
|
|
52
|
+
accept: 'application/json;odata.metadata=none',
|
|
53
|
+
'content-type': 'application/json;odata=nometadata'
|
|
54
|
+
},
|
|
55
|
+
responseType: 'json',
|
|
56
|
+
data: {
|
|
57
|
+
message_id: options.messageId
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
try {
|
|
61
|
+
if (options.enable !== false) {
|
|
62
|
+
await request.post(requestOptions);
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
await request.delete(requestOptions);
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
this.handleRejectedODataJsonPromise(err);
|
|
71
70
|
}
|
|
72
71
|
}
|
|
73
72
|
}
|
|
@@ -3,7 +3,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
3
3
|
if (typeof state === "function" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
4
4
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
5
5
|
};
|
|
6
|
-
var _YammerMessageListCommand_instances, _YammerMessageListCommand_initTelemetry, _YammerMessageListCommand_initOptions, _YammerMessageListCommand_initValidators;
|
|
6
|
+
var _YammerMessageListCommand_instances, _a, _YammerMessageListCommand_initTelemetry, _YammerMessageListCommand_initOptions, _YammerMessageListCommand_initValidators;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import YammerCommand from '../../../base/YammerCommand.js';
|
|
9
9
|
import commands from '../../commands.js';
|
|
@@ -25,91 +25,72 @@ class YammerMessageListCommand extends YammerCommand {
|
|
|
25
25
|
__classPrivateFieldGet(this, _YammerMessageListCommand_instances, "m", _YammerMessageListCommand_initOptions).call(this);
|
|
26
26
|
__classPrivateFieldGet(this, _YammerMessageListCommand_instances, "m", _YammerMessageListCommand_initValidators).call(this);
|
|
27
27
|
}
|
|
28
|
-
getAllItems(logger, args, messageId) {
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
args.options.feedType = "All";
|
|
40
|
-
}
|
|
41
|
-
switch (args.options.feedType) {
|
|
42
|
-
case 'Top':
|
|
43
|
-
endpoint += `/messages/algo.json`;
|
|
44
|
-
break;
|
|
45
|
-
case 'My':
|
|
46
|
-
endpoint += `/messages/my_feed.json`;
|
|
47
|
-
break;
|
|
48
|
-
case 'Following':
|
|
49
|
-
endpoint += `/messages/following.json`;
|
|
50
|
-
break;
|
|
51
|
-
case 'Sent':
|
|
52
|
-
endpoint += `/messages/sent.json`;
|
|
53
|
-
break;
|
|
54
|
-
case 'Private':
|
|
55
|
-
endpoint += `/messages/private.json`;
|
|
56
|
-
break;
|
|
57
|
-
case 'Received':
|
|
58
|
-
endpoint += `/messages/received.json`;
|
|
59
|
-
break;
|
|
60
|
-
default:
|
|
61
|
-
endpoint += `/messages.json`;
|
|
62
|
-
}
|
|
28
|
+
async getAllItems(logger, args, messageId) {
|
|
29
|
+
let endpoint = `${this.resource}/v1`;
|
|
30
|
+
if (args.options.threadId) {
|
|
31
|
+
endpoint += `/messages/in_thread/${args.options.threadId}.json`;
|
|
32
|
+
}
|
|
33
|
+
else if (args.options.groupId) {
|
|
34
|
+
endpoint += `/messages/in_group/${args.options.groupId}.json`;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
if (!args.options.feedType) {
|
|
38
|
+
args.options.feedType = "All";
|
|
63
39
|
}
|
|
64
|
-
|
|
65
|
-
|
|
40
|
+
switch (args.options.feedType) {
|
|
41
|
+
case 'Top':
|
|
42
|
+
endpoint += `/messages/algo.json`;
|
|
43
|
+
break;
|
|
44
|
+
case 'My':
|
|
45
|
+
endpoint += `/messages/my_feed.json`;
|
|
46
|
+
break;
|
|
47
|
+
case 'Following':
|
|
48
|
+
endpoint += `/messages/following.json`;
|
|
49
|
+
break;
|
|
50
|
+
case 'Sent':
|
|
51
|
+
endpoint += `/messages/sent.json`;
|
|
52
|
+
break;
|
|
53
|
+
case 'Private':
|
|
54
|
+
endpoint += `/messages/private.json`;
|
|
55
|
+
break;
|
|
56
|
+
case 'Received':
|
|
57
|
+
endpoint += `/messages/received.json`;
|
|
58
|
+
break;
|
|
59
|
+
default:
|
|
60
|
+
endpoint += `/messages.json`;
|
|
66
61
|
}
|
|
67
|
-
|
|
68
|
-
|
|
62
|
+
}
|
|
63
|
+
if (messageId !== -1) {
|
|
64
|
+
endpoint += `?older_than=${messageId}`;
|
|
65
|
+
}
|
|
66
|
+
else if (args.options.olderThanId) {
|
|
67
|
+
endpoint += `?older_than=${args.options.olderThanId}`;
|
|
68
|
+
}
|
|
69
|
+
if (args.options.threaded) {
|
|
70
|
+
if (endpoint.indexOf("?") > -1) {
|
|
71
|
+
endpoint += "&";
|
|
69
72
|
}
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
endpoint += "&";
|
|
73
|
-
}
|
|
74
|
-
else {
|
|
75
|
-
endpoint += "?";
|
|
76
|
-
}
|
|
77
|
-
endpoint += `threaded=true`;
|
|
73
|
+
else {
|
|
74
|
+
endpoint += "?";
|
|
78
75
|
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
}
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
this
|
|
98
|
-
.getAllItems(logger, args, this.items[this.items.length - 1].id)
|
|
99
|
-
.then(() => {
|
|
100
|
-
resolve();
|
|
101
|
-
}, (err) => {
|
|
102
|
-
reject(err);
|
|
103
|
-
});
|
|
104
|
-
}
|
|
105
|
-
else {
|
|
106
|
-
resolve();
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
}, (err) => {
|
|
110
|
-
reject(err);
|
|
111
|
-
});
|
|
112
|
-
});
|
|
76
|
+
endpoint += `threaded=true`;
|
|
77
|
+
}
|
|
78
|
+
const requestOptions = {
|
|
79
|
+
url: endpoint,
|
|
80
|
+
headers: {
|
|
81
|
+
accept: 'application/json;odata.metadata=none',
|
|
82
|
+
'content-type': 'application/json;odata=nometadata'
|
|
83
|
+
},
|
|
84
|
+
responseType: 'json'
|
|
85
|
+
};
|
|
86
|
+
const res = await request.get(requestOptions);
|
|
87
|
+
this.items = this.items.concat(res.messages);
|
|
88
|
+
if (args.options.limit && this.items.length > args.options.limit) {
|
|
89
|
+
this.items = this.items.slice(0, args.options.limit);
|
|
90
|
+
}
|
|
91
|
+
else if ((res.meta.older_available === true)) {
|
|
92
|
+
await this.getAllItems(logger, args, this.items[this.items.length - 1].id);
|
|
93
|
+
}
|
|
113
94
|
}
|
|
114
95
|
async commandAction(logger, args) {
|
|
115
96
|
this.items = []; // this will reset the items array in interactive mode
|
|
@@ -136,7 +117,7 @@ class YammerMessageListCommand extends YammerCommand {
|
|
|
136
117
|
}
|
|
137
118
|
}
|
|
138
119
|
}
|
|
139
|
-
_YammerMessageListCommand_instances = new WeakSet(), _YammerMessageListCommand_initTelemetry = function _YammerMessageListCommand_initTelemetry() {
|
|
120
|
+
_a = YammerMessageListCommand, _YammerMessageListCommand_instances = new WeakSet(), _YammerMessageListCommand_initTelemetry = function _YammerMessageListCommand_initTelemetry() {
|
|
140
121
|
this.telemetry.push((args) => {
|
|
141
122
|
Object.assign(this.telemetryProperties, {
|
|
142
123
|
olderThanId: args.options.olderThanId !== undefined,
|
|
@@ -152,7 +133,7 @@ _YammerMessageListCommand_instances = new WeakSet(), _YammerMessageListCommand_i
|
|
|
152
133
|
option: '--olderThanId [olderThanId]'
|
|
153
134
|
}, {
|
|
154
135
|
option: '--feedType [feedType]',
|
|
155
|
-
autocomplete:
|
|
136
|
+
autocomplete: _a.feedTypes
|
|
156
137
|
}, {
|
|
157
138
|
option: '--groupId [groupId]'
|
|
158
139
|
}, {
|
|
@@ -170,8 +151,8 @@ _YammerMessageListCommand_instances = new WeakSet(), _YammerMessageListCommand_i
|
|
|
170
151
|
if (args.options.feedType && (args.options.groupId || args.options.threadId)) {
|
|
171
152
|
return `You cannot specify the feedType with groupId or threadId at the same time`;
|
|
172
153
|
}
|
|
173
|
-
if (args.options.feedType &&
|
|
174
|
-
return `${args.options.feedType} is not a valid value for the feedType option. Allowed values are ${
|
|
154
|
+
if (args.options.feedType && _a.feedTypes.indexOf(args.options.feedType) < 0) {
|
|
155
|
+
return `${args.options.feedType} is not a valid value for the feedType option. Allowed values are ${_a.feedTypes.join('|')}`;
|
|
175
156
|
}
|
|
176
157
|
if (args.options.olderThanId && typeof args.options.olderThanId !== 'number') {
|
|
177
158
|
return `${args.options.olderThanId} is not a number`;
|
|
@@ -23,24 +23,8 @@ class YammerMessageRemoveCommand extends YammerCommand {
|
|
|
23
23
|
__classPrivateFieldGet(this, _YammerMessageRemoveCommand_instances, "m", _YammerMessageRemoveCommand_initValidators).call(this);
|
|
24
24
|
}
|
|
25
25
|
async commandAction(logger, args) {
|
|
26
|
-
const removeMessage = async () => {
|
|
27
|
-
try {
|
|
28
|
-
const requestOptions = {
|
|
29
|
-
url: `${this.resource}/v1/messages/${args.options.id}.json`,
|
|
30
|
-
headers: {
|
|
31
|
-
accept: 'application/json;odata.metadata=none',
|
|
32
|
-
'content-type': 'application/json;odata=nometadata'
|
|
33
|
-
},
|
|
34
|
-
responseType: 'json'
|
|
35
|
-
};
|
|
36
|
-
await request.delete(requestOptions);
|
|
37
|
-
}
|
|
38
|
-
catch (err) {
|
|
39
|
-
this.handleRejectedODataJsonPromise(err);
|
|
40
|
-
}
|
|
41
|
-
};
|
|
42
26
|
if (args.options.force) {
|
|
43
|
-
await removeMessage();
|
|
27
|
+
await this.removeMessage(args.options);
|
|
44
28
|
}
|
|
45
29
|
else {
|
|
46
30
|
const result = await Cli.prompt({
|
|
@@ -50,10 +34,26 @@ class YammerMessageRemoveCommand extends YammerCommand {
|
|
|
50
34
|
message: `Are you sure you want to remove the Yammer message ${args.options.id}?`
|
|
51
35
|
});
|
|
52
36
|
if (result.continue) {
|
|
53
|
-
await removeMessage();
|
|
37
|
+
await this.removeMessage(args.options);
|
|
54
38
|
}
|
|
55
39
|
}
|
|
56
40
|
}
|
|
41
|
+
async removeMessage(options) {
|
|
42
|
+
try {
|
|
43
|
+
const requestOptions = {
|
|
44
|
+
url: `${this.resource}/v1/messages/${options.id}.json`,
|
|
45
|
+
headers: {
|
|
46
|
+
accept: 'application/json;odata.metadata=none',
|
|
47
|
+
'content-type': 'application/json;odata=nometadata'
|
|
48
|
+
},
|
|
49
|
+
responseType: 'json'
|
|
50
|
+
};
|
|
51
|
+
await request.delete(requestOptions);
|
|
52
|
+
}
|
|
53
|
+
catch (err) {
|
|
54
|
+
this.handleRejectedODataJsonPromise(err);
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
57
|
}
|
|
58
58
|
_YammerMessageRemoveCommand_instances = new WeakSet(), _YammerMessageRemoveCommand_initTelemetry = function _YammerMessageRemoveCommand_initTelemetry() {
|
|
59
59
|
this.telemetry.push((args) => {
|