@pnp/cli-microsoft365 6.0.0-beta.4e32416 → 6.0.0-beta.55cbe4a
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/dist/Auth.js +3 -3
- package/dist/Command.js +56 -43
- package/dist/api.js +3 -3
- package/dist/appInsights.js +2 -0
- package/dist/cli/Cli.js +36 -28
- package/dist/index.js +2 -2
- package/dist/m365/aad/commands/app/app-add.js +34 -33
- package/dist/m365/aad/commands/app/app-get.js +15 -12
- package/dist/m365/aad/commands/app/app-remove.js +37 -38
- package/dist/m365/aad/commands/app/app-role-add.js +29 -26
- package/dist/m365/aad/commands/app/app-role-list.js +21 -9
- package/dist/m365/aad/commands/app/app-role-remove.js +25 -24
- package/dist/m365/aad/commands/app/app-set.js +12 -7
- package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +92 -96
- package/dist/m365/aad/commands/approleassignment/approleassignment-list.js +41 -41
- package/dist/m365/aad/commands/approleassignment/approleassignment-remove.js +93 -95
- package/dist/m365/aad/commands/group/group-list.js +36 -24
- package/dist/m365/aad/commands/groupsetting/groupsetting-add.js +35 -34
- package/dist/m365/aad/commands/groupsetting/groupsetting-get.js +19 -16
- package/dist/m365/aad/commands/groupsetting/groupsetting-list.js +20 -8
- package/dist/m365/aad/commands/groupsetting/groupsetting-remove.js +33 -32
- package/dist/m365/aad/commands/groupsetting/groupsetting-set.js +35 -32
- package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-get.js +17 -15
- package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-list.js +20 -8
- package/dist/m365/aad/commands/o365group/o365group-add.js +87 -98
- package/dist/m365/aad/commands/o365group/o365group-conversation-list.js +13 -9
- package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +14 -12
- package/dist/m365/aad/commands/o365group/o365group-get.js +22 -27
- package/dist/m365/aad/commands/o365group/o365group-list.js +39 -44
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-clear.js +34 -22
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-list.js +25 -13
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-remove.js +36 -38
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-restore.js +26 -22
- package/dist/m365/aad/commands/o365group/o365group-remove.js +41 -43
- package/dist/m365/aad/commands/o365group/o365group-renew.js +19 -14
- package/dist/m365/aad/commands/o365group/o365group-set.js +98 -116
- package/dist/m365/aad/commands/o365group/o365group-teamify.js +33 -30
- package/dist/m365/aad/commands/o365group/o365group-user-add.js +30 -27
- package/dist/m365/aad/commands/o365group/o365group-user-list.js +20 -21
- package/dist/m365/aad/commands/o365group/o365group-user-remove.js +61 -64
- package/dist/m365/aad/commands/o365group/o365group-user-set.js +65 -65
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-add.js +28 -23
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-list.js +23 -20
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-remove.js +42 -32
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-set.js +30 -16
- package/dist/m365/aad/commands/policy/policy-list.js +22 -23
- package/dist/m365/aad/commands/siteclassification/siteclassification-disable.js +61 -53
- package/dist/m365/aad/commands/siteclassification/siteclassification-enable.js +84 -72
- package/dist/m365/aad/commands/siteclassification/siteclassification-get.js +66 -57
- package/dist/m365/aad/commands/siteclassification/siteclassification-set.js +96 -93
- package/dist/m365/aad/commands/sp/sp-add.js +25 -24
- package/dist/m365/aad/commands/sp/sp-get.js +25 -24
- package/dist/m365/aad/commands/user/user-get.js +39 -39
- package/dist/m365/aad/commands/user/user-hibp.js +23 -24
- package/dist/m365/aad/commands/user/user-list.js +32 -22
- package/dist/m365/aad/commands/user/user-password-validate.js +29 -17
- package/dist/m365/aad/commands/user/user-set.js +20 -15
- package/dist/m365/aad/commands/user/user-signin-list.js +28 -24
- package/dist/m365/adaptivecard/commands/adaptivecard-send.js +39 -37
- package/dist/m365/app/commands/app-get.js +28 -16
- package/dist/m365/app/commands/app-open.js +20 -5
- package/dist/m365/app/commands/permission/permission-list.js +19 -17
- package/dist/m365/base/AnonymousCommand.js +14 -3
- package/dist/m365/base/AppCommand.js +54 -47
- package/dist/m365/base/DateAndPeriodBasedReport.js +7 -5
- package/dist/m365/base/PeriodBasedReport.js +23 -16
- package/dist/m365/base/SpoCommand.js +13 -9
- package/dist/m365/base/YammerCommand.js +4 -4
- package/dist/m365/booking/commands/business/business-get.js +27 -17
- package/dist/m365/booking/commands/business/business-list.js +21 -12
- package/dist/m365/cli/commands/cli-consent.js +15 -12
- package/dist/m365/cli/commands/cli-doctor.js +37 -27
- package/dist/m365/cli/commands/cli-issue.js +15 -15
- package/dist/m365/cli/commands/cli-reconsent.js +31 -19
- package/dist/m365/cli/commands/completion/completion-clink-update.js +13 -3
- package/dist/m365/cli/commands/completion/completion-pwsh-setup.js +47 -38
- package/dist/m365/cli/commands/completion/completion-pwsh-update.js +16 -6
- package/dist/m365/cli/commands/completion/completion-sh-setup.js +21 -11
- package/dist/m365/cli/commands/completion/completion-sh-update.js +16 -6
- package/dist/m365/cli/commands/config/config-get.js +5 -4
- package/dist/m365/cli/commands/config/config-reset.js +10 -9
- package/dist/m365/cli/commands/config/config-set.js +20 -19
- package/dist/m365/commands/login.js +66 -63
- package/dist/m365/commands/logout.js +34 -23
- package/dist/m365/commands/request.js +56 -59
- package/dist/m365/commands/status.js +50 -28
- package/dist/m365/commands/version.js +13 -3
- package/dist/m365/file/commands/convert/convert-pdf.js +58 -53
- package/dist/m365/file/commands/file-add.js +17 -12
- package/dist/m365/file/commands/file-list.js +31 -33
- package/dist/m365/flow/commands/environment/environment-get.js +34 -22
- package/dist/m365/flow/commands/environment/environment-list.js +33 -21
- package/dist/m365/flow/commands/flow-disable.js +28 -14
- package/dist/m365/flow/commands/flow-enable.js +28 -14
- package/dist/m365/flow/commands/flow-export.js +104 -104
- package/dist/m365/flow/commands/flow-get.js +33 -21
- package/dist/m365/flow/commands/flow-list.js +28 -16
- package/dist/m365/flow/commands/flow-remove.js +41 -45
- package/dist/m365/flow/commands/run/run-cancel.js +35 -34
- package/dist/m365/flow/commands/run/run-get.js +33 -21
- package/dist/m365/flow/commands/run/run-list.js +31 -19
- package/dist/m365/flow/commands/run/run-resubmit.js +39 -40
- package/dist/m365/graph/commands/changelog/changelog-list.js +26 -22
- package/dist/m365/graph/commands/schemaextension/schemaextension-add.js +32 -29
- package/dist/m365/graph/commands/schemaextension/schemaextension-get.js +30 -17
- package/dist/m365/graph/commands/schemaextension/schemaextension-list.js +40 -36
- package/dist/m365/graph/commands/schemaextension/schemaextension-remove.js +43 -32
- package/dist/m365/graph/commands/schemaextension/schemaextension-set.js +59 -56
- package/dist/m365/graph/commands/subscription/subscription-add.js +30 -27
- package/dist/m365/onedrive/commands/onedrive-list.js +25 -15
- package/dist/m365/onenote/commands/notebook/notebook-list.js +15 -14
- package/dist/m365/outlook/commands/mail/mail-send.js +73 -31
- package/dist/m365/outlook/commands/message/message-list.js +22 -12
- package/dist/m365/outlook/commands/message/message-move.js +33 -25
- package/dist/m365/outlook/commands/room/room-list.js +24 -12
- package/dist/m365/outlook/commands/roomlist/roomlist-list.js +20 -8
- package/dist/m365/pa/commands/app/app-get.js +45 -46
- package/dist/m365/pa/commands/app/app-list.js +20 -17
- package/dist/m365/pa/commands/app/app-remove.js +41 -41
- package/dist/m365/pa/commands/connector/connector-export.js +102 -104
- package/dist/m365/pa/commands/connector/connector-list.js +29 -17
- package/dist/m365/pa/commands/environment/environment-get.js +34 -22
- package/dist/m365/pa/commands/environment/environment-list.js +33 -21
- package/dist/m365/pa/commands/pcf/pcf-init.js +39 -38
- package/dist/m365/pa/commands/solution/solution-init.js +50 -49
- package/dist/m365/pa/commands/solution/solution-reference-add.js +15 -14
- package/dist/m365/planner/commands/bucket/bucket-add.js +30 -28
- package/dist/m365/planner/commands/bucket/bucket-get.js +18 -14
- package/dist/m365/planner/commands/bucket/bucket-list.js +19 -14
- package/dist/m365/planner/commands/bucket/bucket-remove.js +39 -39
- package/dist/m365/planner/commands/bucket/bucket-set.js +31 -27
- package/dist/m365/planner/commands/plan/plan-add.js +35 -31
- package/dist/m365/planner/commands/plan/plan-get.js +33 -33
- package/dist/m365/planner/commands/plan/plan-list.js +19 -15
- package/dist/m365/planner/commands/plan/plan-remove.js +38 -40
- package/dist/m365/planner/commands/task/task-add.js +47 -50
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +47 -37
- package/dist/m365/planner/commands/task/task-checklistitem-list.js +36 -22
- package/dist/m365/planner/commands/task/task-checklistitem-remove.js +52 -42
- package/dist/m365/planner/commands/task/task-get.js +19 -15
- package/dist/m365/planner/commands/task/task-list.js +48 -56
- package/dist/m365/planner/commands/task/task-reference-add.js +25 -24
- package/dist/m365/planner/commands/task/task-reference-list.js +31 -19
- package/dist/m365/planner/commands/task/task-reference-remove.js +41 -42
- package/dist/m365/planner/commands/task/task-remove.js +38 -37
- package/dist/m365/planner/commands/task/task-set.js +38 -41
- package/dist/m365/planner/commands/tenant/tenant-settings-list.js +26 -14
- package/dist/m365/planner/commands/tenant/tenant-settings-set.js +27 -24
- package/dist/m365/pp/commands/environment/environment-list.js +40 -28
- package/dist/m365/pp/commands/gateway/gateway-list.js +29 -17
- package/dist/m365/pp/commands/managementapp/managementapp-add.js +22 -21
- package/dist/m365/pp/commands/managementapp/managementapp-list.js +21 -9
- package/dist/m365/search/commands/externalconnection/externalconnection-add.js +29 -24
- package/dist/m365/search/commands/externalconnection/externalconnection-get.js +37 -28
- package/dist/m365/search/commands/externalconnection/externalconnection-list.js +20 -8
- package/dist/m365/search/commands/externalconnection/externalconnection-remove.js +40 -33
- package/dist/m365/spfx/commands/package/package-generate.js +105 -98
- package/dist/m365/spfx/commands/project/base-project-command.js +19 -18
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN001008_DEP_react.js +2 -2
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN001009_DEP_react_dom.js +2 -2
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN001022_DEP_office_ui_fabric_react.js +2 -2
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN002015_DEVDEP_types_react.js +2 -2
- package/dist/m365/spfx/commands/project/project-doctor/rules/FN002016_DEVDEP_types_react_dom.js +2 -2
- package/dist/m365/spfx/commands/project/project-doctor.js +102 -105
- package/dist/m365/spfx/commands/project/project-externalize.js +45 -38
- package/dist/m365/spfx/commands/project/project-rename.js +38 -30
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001005_DEP_types_react.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001006_DEP_types_react_dom.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001008_DEP_react.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001009_DEP_react_dom.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001015_DEP_types_react_addons_shallow_compare.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001016_DEP_types_react_addons_update.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001017_DEP_types_react_addons_update.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001019_DEP_knockout.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001020_DEP_types_knockout.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN001022_DEP_office_ui_fabric_react.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002015_DEVDEP_types_react.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002016_DEVDEP_types_react_dom.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002025_DEVDEP_eslint_plugin_react_hooks.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN010008_YORC_nodeVersion.js +1 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN015008_FILE_eslintrc_js.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN020001_RES_types_react.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN022001_SCSS_remove_fabric_react.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN022002_SCSS_add_fabric_react.js +2 -2
- package/dist/m365/spfx/commands/project/project-upgrade.js +185 -190
- package/dist/m365/spfx/commands/spfx-doctor.js +59 -49
- package/dist/m365/spo/commands/app/app-add.js +34 -34
- package/dist/m365/spo/commands/app/app-deploy.js +41 -41
- package/dist/m365/spo/commands/app/app-get.js +43 -43
- package/dist/m365/spo/commands/app/app-install.js +21 -16
- package/dist/m365/spo/commands/app/app-instance-list.js +27 -23
- package/dist/m365/spo/commands/app/app-list.js +32 -34
- package/dist/m365/spo/commands/app/app-remove.js +38 -40
- package/dist/m365/spo/commands/app/app-retract.js +38 -40
- package/dist/m365/spo/commands/app/app-teamspackage-download.js +42 -43
- package/dist/m365/spo/commands/app/app-uninstall.js +35 -34
- package/dist/m365/spo/commands/app/app-upgrade.js +21 -16
- package/dist/m365/spo/commands/apppage/apppage-add.js +39 -40
- package/dist/m365/spo/commands/apppage/apppage-set.js +21 -16
- package/dist/m365/spo/commands/cdn/cdn-get.js +36 -42
- package/dist/m365/spo/commands/cdn/cdn-origin-add.js +31 -38
- package/dist/m365/spo/commands/cdn/cdn-origin-list.js +34 -40
- package/dist/m365/spo/commands/cdn/cdn-origin-remove.js +46 -59
- package/dist/m365/spo/commands/cdn/cdn-policy-list.js +42 -49
- package/dist/m365/spo/commands/cdn/cdn-policy-set.js +38 -46
- package/dist/m365/spo/commands/cdn/cdn-set.js +64 -68
- package/dist/m365/spo/commands/contenttype/contenttype-add.js +54 -57
- package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +100 -116
- package/dist/m365/spo/commands/contenttype/contenttype-field-set.js +127 -151
- package/dist/m365/spo/commands/contenttype/contenttype-get.js +38 -36
- package/dist/m365/spo/commands/contenttype/contenttype-list.js +23 -20
- package/dist/m365/spo/commands/contenttype/contenttype-remove.js +65 -69
- package/dist/m365/spo/commands/contenttype/contenttype-set.js +168 -0
- package/dist/m365/spo/commands/contenttypehub/contenttypehub-get.js +51 -48
- package/dist/m365/spo/commands/customaction/customaction-add.js +46 -43
- package/dist/m365/spo/commands/customaction/customaction-clear.js +30 -28
- package/dist/m365/spo/commands/customaction/customaction-get.js +43 -38
- package/dist/m365/spo/commands/customaction/customaction-list.js +30 -25
- package/dist/m365/spo/commands/customaction/customaction-remove.js +36 -35
- package/dist/m365/spo/commands/customaction/customaction-set.js +25 -20
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +47 -42
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-list.js +39 -35
- package/dist/m365/spo/commands/externaluser/externaluser-list.js +55 -58
- package/dist/m365/spo/commands/feature/feature-disable.js +26 -21
- package/dist/m365/spo/commands/feature/feature-enable.js +28 -23
- package/dist/m365/spo/commands/feature/feature-list.js +25 -22
- package/dist/m365/spo/commands/field/field-add.js +29 -26
- package/dist/m365/spo/commands/field/field-get.js +41 -36
- package/dist/m365/spo/commands/field/field-list.js +33 -28
- package/dist/m365/spo/commands/field/field-remove.js +87 -88
- package/dist/m365/spo/commands/field/field-set.js +70 -81
- package/dist/m365/spo/commands/file/file-add.js +158 -177
- package/dist/m365/spo/commands/file/file-checkin.js +39 -34
- package/dist/m365/spo/commands/file/file-checkout.js +26 -21
- package/dist/m365/spo/commands/file/file-copy.js +67 -67
- package/dist/m365/spo/commands/file/file-get.js +67 -69
- package/dist/m365/spo/commands/file/file-list.js +17 -11
- package/dist/m365/spo/commands/file/file-move.js +66 -66
- package/dist/m365/spo/commands/file/file-remove.js +58 -60
- package/dist/m365/spo/commands/file/file-rename.js +35 -36
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +125 -0
- package/dist/m365/spo/commands/file/file-sharinginfo-get.js +49 -46
- package/dist/m365/spo/commands/folder/folder-add.js +29 -25
- package/dist/m365/spo/commands/folder/folder-copy.js +49 -44
- package/dist/m365/spo/commands/folder/folder-get.js +59 -28
- package/dist/m365/spo/commands/folder/folder-list.js +25 -21
- package/dist/m365/spo/commands/folder/folder-move.js +50 -45
- package/dist/m365/spo/commands/folder/folder-remove.js +44 -42
- package/dist/m365/spo/commands/folder/folder-rename.js +34 -38
- package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +89 -0
- package/dist/m365/spo/commands/group/group-add.js +28 -25
- package/dist/m365/spo/commands/group/group-get.js +42 -39
- package/dist/m365/spo/commands/group/group-list.js +23 -20
- package/dist/m365/spo/commands/group/group-remove.js +49 -52
- package/dist/m365/spo/commands/group/group-set.js +31 -26
- package/dist/m365/spo/commands/group/group-user-add.js +34 -38
- package/dist/m365/spo/commands/group/group-user-list.js +25 -22
- package/dist/m365/spo/commands/group/group-user-remove.js +42 -43
- package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-get.js +30 -20
- package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-set.js +23 -20
- package/dist/m365/spo/commands/homesite/homesite-get.js +29 -19
- package/dist/m365/spo/commands/homesite/homesite-remove.js +50 -49
- package/dist/m365/spo/commands/homesite/homesite-set.js +28 -31
- package/dist/m365/spo/commands/hubsite/hubsite-connect.js +22 -18
- package/dist/m365/spo/commands/hubsite/hubsite-data-get.js +27 -24
- package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +38 -38
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +24 -37
- package/dist/m365/spo/commands/hubsite/hubsite-list.js +65 -63
- package/dist/m365/spo/commands/hubsite/hubsite-register.js +22 -20
- package/dist/m365/spo/commands/hubsite/hubsite-rights-grant.js +33 -36
- package/dist/m365/spo/commands/hubsite/hubsite-rights-revoke.js +48 -55
- package/dist/m365/spo/commands/hubsite/hubsite-set.js +38 -41
- package/dist/m365/spo/commands/hubsite/hubsite-theme-sync.js +21 -16
- package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +35 -35
- package/dist/m365/spo/commands/knowledgehub/knowledgehub-get.js +35 -32
- package/dist/m365/spo/commands/knowledgehub/knowledgehub-remove.js +52 -53
- package/dist/m365/spo/commands/knowledgehub/knowledgehub-set.js +29 -33
- package/dist/m365/spo/commands/list/list-add.js +28 -25
- package/dist/m365/spo/commands/list/list-contenttype-add.js +34 -30
- package/dist/m365/spo/commands/list/list-contenttype-default-set.js +60 -60
- package/dist/m365/spo/commands/list/list-contenttype-list.js +33 -29
- package/dist/m365/spo/commands/list/list-contenttype-remove.js +46 -47
- package/dist/m365/spo/commands/list/list-get.js +37 -33
- package/dist/m365/spo/commands/list/list-label-get.js +51 -51
- package/dist/m365/spo/commands/list/list-label-set.js +51 -47
- package/dist/m365/spo/commands/list/list-list.js +26 -23
- package/dist/m365/spo/commands/list/list-remove.js +46 -47
- package/dist/m365/spo/commands/list/list-roleassignment-add.js +44 -43
- package/dist/m365/spo/commands/list/list-roleassignment-remove.js +58 -58
- package/dist/m365/spo/commands/list/list-roleinheritance-break.js +58 -31
- package/dist/m365/spo/commands/list/list-roleinheritance-reset.js +54 -27
- package/dist/m365/spo/commands/list/list-set.js +31 -28
- package/dist/m365/spo/commands/list/list-sitescript-get.js +54 -55
- package/dist/m365/spo/commands/list/list-view-add.js +37 -32
- package/dist/m365/spo/commands/list/list-view-field-add.js +53 -53
- package/dist/m365/spo/commands/list/list-view-field-remove.js +47 -49
- package/dist/m365/spo/commands/list/list-view-field-set.js +34 -30
- package/dist/m365/spo/commands/list/list-view-get.js +36 -31
- package/dist/m365/spo/commands/list/list-view-list.js +32 -28
- package/dist/m365/spo/commands/list/list-view-remove.js +46 -46
- package/dist/m365/spo/commands/list/list-view-set.js +31 -26
- package/dist/m365/spo/commands/list/list-webhook-add.js +43 -41
- package/dist/m365/spo/commands/list/list-webhook-get.js +34 -32
- package/dist/m365/spo/commands/list/list-webhook-list.js +52 -48
- package/dist/m365/spo/commands/list/list-webhook-remove.js +47 -49
- package/dist/m365/spo/commands/list/list-webhook-set.js +40 -38
- package/dist/m365/spo/commands/listitem/listitem-add.js +106 -112
- package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +32 -28
- package/dist/m365/spo/commands/listitem/listitem-get.js +32 -28
- package/dist/m365/spo/commands/listitem/listitem-isrecord.js +68 -69
- package/dist/m365/spo/commands/listitem/listitem-list.js +63 -68
- package/dist/m365/spo/commands/listitem/listitem-record-declare.js +55 -55
- package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +54 -54
- package/dist/m365/spo/commands/listitem/listitem-remove.js +51 -51
- package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +59 -59
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +58 -31
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +54 -24
- package/dist/m365/spo/commands/listitem/listitem-set.js +146 -163
- package/dist/m365/spo/commands/mail/mail-send.js +50 -45
- package/dist/m365/spo/commands/navigation/navigation-node-add.js +31 -28
- package/dist/m365/spo/commands/navigation/navigation-node-list.js +28 -25
- package/dist/m365/spo/commands/navigation/navigation-node-remove.js +38 -38
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +30 -33
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-list.js +49 -45
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.js +50 -50
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-list.js +35 -31
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-remove.js +41 -50
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-set.js +26 -29
- package/dist/m365/spo/commands/page/Page.js +2 -2
- package/dist/m365/spo/commands/page/page-add.js +197 -218
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +186 -189
- package/dist/m365/spo/commands/page/page-column-get.js +25 -22
- package/dist/m365/spo/commands/page/page-column-list.js +20 -17
- package/dist/m365/spo/commands/page/page-control-get.js +39 -36
- package/dist/m365/spo/commands/page/page-control-list.js +35 -32
- package/dist/m365/spo/commands/page/page-control-set.js +100 -100
- package/dist/m365/spo/commands/page/page-copy.js +53 -53
- package/dist/m365/spo/commands/page/page-get.js +52 -53
- package/dist/m365/spo/commands/page/page-header-set.js +230 -234
- package/dist/m365/spo/commands/page/page-list.js +42 -41
- package/dist/m365/spo/commands/page/page-remove.js +48 -47
- package/dist/m365/spo/commands/page/page-section-add.js +68 -70
- package/dist/m365/spo/commands/page/page-section-get.js +16 -13
- package/dist/m365/spo/commands/page/page-section-list.js +25 -22
- package/dist/m365/spo/commands/page/page-set.js +219 -238
- package/dist/m365/spo/commands/page/page-template-list.js +26 -27
- package/dist/m365/spo/commands/page/page-text-add.js +45 -43
- package/dist/m365/spo/commands/propertybag/propertybag-base.js +4 -3
- package/dist/m365/spo/commands/propertybag/propertybag-get.js +27 -24
- package/dist/m365/spo/commands/propertybag/propertybag-list.js +22 -19
- package/dist/m365/spo/commands/propertybag/propertybag-remove.js +36 -40
- package/dist/m365/spo/commands/propertybag/propertybag-set.js +25 -29
- package/dist/m365/spo/commands/roledefinition/roledefinition-add.js +117 -0
- package/dist/m365/spo/commands/roledefinition/roledefinition-get.js +27 -24
- package/dist/m365/spo/commands/roledefinition/roledefinition-list.js +22 -19
- package/dist/m365/spo/commands/roledefinition/roledefinition-remove.js +38 -37
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-add.js +40 -35
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-list.js +43 -39
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-revoke.js +35 -30
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-approve.js +33 -36
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-deny.js +28 -31
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-list.js +45 -41
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +47 -56
- package/dist/m365/spo/commands/site/site-add.js +189 -199
- package/dist/m365/spo/commands/site/site-appcatalog-add.js +33 -36
- package/dist/m365/spo/commands/site/site-appcatalog-remove.js +33 -36
- package/dist/m365/spo/commands/site/site-apppermission-add.js +69 -37
- package/dist/m365/spo/commands/site/site-apppermission-get.js +21 -18
- package/dist/m365/spo/commands/site/site-apppermission-list.js +17 -19
- package/dist/m365/spo/commands/site/site-apppermission-remove.js +33 -39
- package/dist/m365/spo/commands/site/site-apppermission-set.js +33 -32
- package/dist/m365/spo/commands/site/site-chrome-set.js +52 -47
- package/dist/m365/spo/commands/site/site-commsite-enable.js +30 -33
- package/dist/m365/spo/commands/site/site-ensure.js +46 -36
- package/dist/m365/spo/commands/site/site-get.js +19 -16
- package/dist/m365/spo/commands/site/site-groupify.js +37 -34
- package/dist/m365/spo/commands/site/site-inplacerecordsmanagement-set.js +27 -22
- package/dist/m365/spo/commands/site/site-list.js +20 -20
- package/dist/m365/spo/commands/site/site-recyclebinitem-list.js +29 -26
- package/dist/m365/spo/commands/site/site-recyclebinitem-restore.js +36 -28
- package/dist/m365/spo/commands/site/site-remove.js +66 -73
- package/dist/m365/spo/commands/site/site-rename.js +66 -77
- package/dist/m365/spo/commands/site/site-set.js +47 -50
- package/dist/m365/spo/commands/sitedesign/sitedesign-add.js +40 -42
- package/dist/m365/spo/commands/sitedesign/sitedesign-apply.js +31 -29
- package/dist/m365/spo/commands/sitedesign/sitedesign-get.js +26 -28
- package/dist/m365/spo/commands/sitedesign/sitedesign-list.js +28 -18
- package/dist/m365/spo/commands/sitedesign/sitedesign-remove.js +38 -42
- package/dist/m365/spo/commands/sitedesign/sitedesign-rights-grant.js +29 -29
- package/dist/m365/spo/commands/sitedesign/sitedesign-rights-list.js +28 -30
- package/dist/m365/spo/commands/sitedesign/sitedesign-rights-revoke.js +41 -45
- package/dist/m365/spo/commands/sitedesign/sitedesign-run-list.js +30 -26
- package/dist/m365/spo/commands/sitedesign/sitedesign-run-status-get.js +25 -21
- package/dist/m365/spo/commands/sitedesign/sitedesign-set.js +53 -51
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-get.js +25 -23
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-list.js +19 -15
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-remove.js +37 -37
- package/dist/m365/spo/commands/sitescript/sitescript-add.js +23 -26
- package/dist/m365/spo/commands/sitescript/sitescript-get.js +25 -27
- package/dist/m365/spo/commands/sitescript/sitescript-list.js +31 -25
- package/dist/m365/spo/commands/sitescript/sitescript-remove.js +38 -42
- package/dist/m365/spo/commands/sitescript/sitescript-set.js +38 -40
- package/dist/m365/spo/commands/spo-get.js +16 -6
- package/dist/m365/spo/commands/spo-search.js +23 -23
- package/dist/m365/spo/commands/spo-set.js +11 -9
- package/dist/m365/spo/commands/storageentity/storageentity-get.js +37 -27
- package/dist/m365/spo/commands/storageentity/storageentity-list.js +36 -38
- package/dist/m365/spo/commands/storageentity/storageentity-remove.js +43 -51
- package/dist/m365/spo/commands/storageentity/storageentity-set.js +33 -36
- package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +21 -22
- package/dist/m365/spo/commands/tenant/tenant-appcatalogurl-get.js +32 -22
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-list.js +39 -35
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-remove.js +56 -62
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-restore.js +24 -22
- package/dist/m365/spo/commands/tenant/tenant-settings-list.js +57 -53
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +56 -66
- package/dist/m365/spo/commands/term/term-add.js +98 -103
- package/dist/m365/spo/commands/term/term-get.js +49 -53
- package/dist/m365/spo/commands/term/term-group-add.js +74 -81
- package/dist/m365/spo/commands/term/term-group-get.js +36 -39
- package/dist/m365/spo/commands/term/term-group-list.js +43 -39
- package/dist/m365/spo/commands/term/term-list.js +40 -43
- package/dist/m365/spo/commands/term/term-set-add.js +84 -89
- package/dist/m365/spo/commands/term/term-set-get.js +38 -41
- package/dist/m365/spo/commands/term/term-set-list.js +39 -42
- package/dist/m365/spo/commands/theme/theme-apply.js +56 -60
- package/dist/m365/spo/commands/theme/theme-get.js +39 -34
- package/dist/m365/spo/commands/theme/theme-list.js +36 -26
- package/dist/m365/spo/commands/theme/theme-remove.js +47 -39
- package/dist/m365/spo/commands/theme/theme-set.js +33 -34
- package/dist/m365/spo/commands/user/user-get.js +33 -30
- package/dist/m365/spo/commands/user/user-list.js +25 -22
- package/dist/m365/spo/commands/user/user-remove.js +42 -41
- package/dist/m365/spo/commands/userprofile/userprofile-get.js +25 -24
- package/dist/m365/spo/commands/userprofile/userprofile-set.js +42 -34
- package/dist/m365/spo/commands/web/web-add.js +74 -99
- package/dist/m365/spo/commands/web/web-clientsidewebpart-list.js +31 -28
- package/dist/m365/spo/commands/web/web-get.js +23 -20
- package/dist/m365/spo/commands/web/web-installedlanguage-list.js +22 -19
- package/dist/m365/spo/commands/web/web-list.js +26 -23
- package/dist/m365/spo/commands/web/web-reindex.js +44 -55
- package/dist/m365/spo/commands/web/web-remove.js +36 -35
- package/dist/m365/spo/commands/web/web-roleassignment-add.js +30 -31
- package/dist/m365/spo/commands/web/web-roleassignment-remove.js +44 -46
- package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +51 -20
- package/dist/m365/spo/commands/web/web-set.js +53 -48
- package/dist/m365/spo/commands.js +4 -0
- package/dist/m365/teams/commands/app/app-install.js +33 -30
- package/dist/m365/teams/commands/app/app-list.js +19 -15
- package/dist/m365/teams/commands/app/app-publish.js +23 -20
- package/dist/m365/teams/commands/app/app-remove.js +32 -31
- package/dist/m365/teams/commands/app/app-uninstall.js +31 -30
- package/dist/m365/teams/commands/app/app-update.js +23 -20
- package/dist/m365/teams/commands/cache/cache-remove.js +25 -24
- package/dist/m365/teams/commands/channel/channel-add.js +13 -10
- package/dist/m365/teams/commands/channel/channel-get.js +27 -29
- package/dist/m365/teams/commands/channel/channel-list.js +20 -18
- package/dist/m365/teams/commands/channel/channel-member-add.js +21 -26
- package/dist/m365/teams/commands/channel/channel-member-list.js +24 -25
- package/dist/m365/teams/commands/channel/channel-member-remove.js +31 -30
- package/dist/m365/teams/commands/channel/channel-member-set.js +30 -35
- package/dist/m365/teams/commands/channel/channel-remove.js +58 -61
- package/dist/m365/teams/commands/channel/channel-set.js +29 -26
- package/dist/m365/teams/commands/chat/chat-get.js +11 -8
- package/dist/m365/teams/commands/chat/chat-list.js +13 -10
- package/dist/m365/teams/commands/chat/chat-member-list.js +14 -10
- package/dist/m365/teams/commands/chat/chat-message-list.js +30 -26
- package/dist/m365/teams/commands/chat/chat-message-send.js +15 -11
- package/dist/m365/teams/commands/funsettings/funsettings-list.js +19 -16
- package/dist/m365/teams/commands/funsettings/funsettings-set.js +28 -23
- package/dist/m365/teams/commands/guestsettings/guestsettings-list.js +19 -16
- package/dist/m365/teams/commands/guestsettings/guestsettings-set.js +25 -20
- package/dist/m365/teams/commands/membersettings/membersettings-list.js +19 -16
- package/dist/m365/teams/commands/membersettings/membersettings-set.js +25 -20
- package/dist/m365/teams/commands/message/message-get.js +20 -17
- package/dist/m365/teams/commands/message/message-list.js +22 -18
- package/dist/m365/teams/commands/message/message-reply-list.js +19 -15
- package/dist/m365/teams/commands/messagingsettings/messagingsettings-list.js +19 -16
- package/dist/m365/teams/commands/messagingsettings/messagingsettings-set.js +26 -21
- package/dist/m365/teams/commands/report/report-directroutingcalls.js +21 -18
- package/dist/m365/teams/commands/report/report-pstncalls.js +21 -18
- package/dist/m365/teams/commands/tab/tab-add.js +23 -20
- package/dist/m365/teams/commands/tab/tab-get.js +25 -30
- package/dist/m365/teams/commands/tab/tab-list.js +18 -14
- package/dist/m365/teams/commands/tab/tab-remove.js +34 -31
- package/dist/m365/teams/commands/team/team-add.js +53 -55
- package/dist/m365/teams/commands/team/team-archive.js +24 -21
- package/dist/m365/teams/commands/team/team-clone.js +34 -29
- package/dist/m365/teams/commands/team/team-get.js +20 -19
- package/dist/m365/teams/commands/team/team-list.js +29 -19
- package/dist/m365/teams/commands/team/team-remove.js +33 -34
- package/dist/m365/teams/commands/team/team-set.js +24 -19
- package/dist/m365/teams/commands/team/team-unarchive.js +21 -18
- package/dist/m365/teams/commands/user/user-app-add.js +23 -18
- package/dist/m365/teams/commands/user/user-app-list.js +31 -31
- package/dist/m365/teams/commands/user/user-app-remove.js +33 -32
- package/dist/m365/teams/commands/user/user-list.js +21 -22
- package/dist/m365/tenant/commands/id/id-get.js +37 -26
- package/dist/m365/tenant/commands/report/report-office365activationcounts.js +38 -24
- package/dist/m365/tenant/commands/report/report-office365activationsusercounts.js +38 -24
- package/dist/m365/tenant/commands/report/report-office365activationsuserdetail.js +38 -24
- package/dist/m365/tenant/commands/security/security-alerts-list.js +19 -7
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-get.js +19 -7
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-list.js +19 -7
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-get.js +26 -14
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +24 -12
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-get.js +20 -17
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +24 -12
- package/dist/m365/todo/commands/list/list-add.js +31 -19
- package/dist/m365/todo/commands/list/list-list.js +20 -8
- package/dist/m365/todo/commands/list/list-remove.js +57 -49
- package/dist/m365/todo/commands/list/list-set.js +34 -22
- package/dist/m365/todo/commands/task/task-add.js +32 -22
- package/dist/m365/todo/commands/task/task-list.js +33 -23
- package/dist/m365/todo/commands/task/task-remove.js +57 -49
- package/dist/m365/todo/commands/task/task-set.js +22 -21
- package/dist/m365/util/commands/accesstoken/accesstoken-get.js +26 -14
- package/dist/m365/viva/commands/connections/connections-app-create.js +104 -106
- package/dist/m365/yammer/commands/group/group-list.js +11 -8
- package/dist/m365/yammer/commands/group/group-user-add.js +21 -16
- package/dist/m365/yammer/commands/group/group-user-remove.js +39 -38
- package/dist/m365/yammer/commands/message/message-add.js +27 -24
- package/dist/m365/yammer/commands/message/message-get.js +18 -15
- package/dist/m365/yammer/commands/message/message-like-set.js +45 -46
- package/dist/m365/yammer/commands/message/message-list.js +24 -21
- package/dist/m365/yammer/commands/message/message-remove.js +31 -30
- package/dist/m365/yammer/commands/network/network-list.js +29 -17
- package/dist/m365/yammer/commands/user/user-get.js +25 -22
- package/dist/m365/yammer/commands/user/user-list.js +11 -8
- package/dist/m365/yammer/commands/yammer-search.js +76 -73
- package/dist/request.js +4 -4
- package/dist/utils/cache.js +81 -0
- package/dist/utils/fsUtil.js +2 -4
- package/dist/utils/md.js +1 -1
- package/dist/utils/pid.js +57 -0
- package/dist/utils/spo.js +7 -6
- package/docs/docs/cmd/aad/user/user-signin-list.md +1 -1
- package/docs/docs/cmd/onedrive/report/report-activityusercounts.md +1 -1
- package/docs/docs/cmd/outlook/mail/mail-send.md +68 -10
- package/docs/docs/cmd/planner/task/task-checklistitem-list.md +1 -1
- package/docs/docs/cmd/planner/task/task-reference-add.md +1 -1
- package/docs/docs/cmd/search/externalconnection/externalconnection-remove.md +1 -1
- package/docs/docs/cmd/spo/contenttype/contenttype-set.md +45 -0
- package/docs/docs/cmd/spo/field/field-set.md +0 -3
- package/docs/docs/cmd/spo/file/file-roleinheritance-reset.md +39 -0
- package/docs/docs/cmd/spo/folder/folder-get.md +13 -4
- package/docs/docs/cmd/spo/folder/folder-roleinheritance-reset.md +36 -0
- package/docs/docs/cmd/spo/list/list-roleassignment-add.md +1 -1
- package/docs/docs/cmd/spo/list/list-roleassignment-remove.md +1 -1
- package/docs/docs/cmd/spo/list/list-roleinheritance-break.md +9 -0
- package/docs/docs/cmd/spo/list/list-roleinheritance-reset.md +9 -0
- package/docs/docs/cmd/spo/listitem/listitem-roleassignment-remove.md +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-break.md +9 -0
- package/docs/docs/cmd/spo/listitem/listitem-roleinheritance-reset.md +9 -0
- package/docs/docs/cmd/spo/roledefinition/roledefinition-add.md +43 -0
- package/docs/docs/cmd/spo/site/site-apppermission-add.md +1 -1
- package/docs/docs/cmd/spo/site/site-apppermission-set.md +1 -1
- package/docs/docs/cmd/spo/web/web-roleassignment-add.md +5 -5
- package/docs/docs/cmd/spo/web/web-roleassignment-remove.md +5 -5
- package/docs/docs/cmd/spo/web/web-roleinheritance-reset.md +10 -1
- package/docs/docs/cmd/teams/cache/cache-remove.md +1 -1
- package/docs/docs/cmd/teams/channel/channel-add.md +1 -1
- package/docs/docs/cmd/teams/channel/channel-list.md +1 -1
- package/docs/docs/cmd/teams/channel/channel-member-add.md +5 -5
- package/docs/docs/cmd/teams/channel/channel-member-remove.md +1 -1
- package/docs/docs/cmd/teams/channel/channel-member-set.md +2 -2
- package/docs/docs/cmd/teams/funsettings/funsettings-set.md +6 -6
- package/docs/docs/cmd/tenant/security/security-alerts-list.md +1 -1
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-get.md +1 -1
- package/docs/docs/cmd/tenant/serviceannouncement/serviceannouncement-health-list.md +1 -1
- package/npm-shrinkwrap.json +342 -357
- package/package.json +24 -18
- package/dist/cli/index.js +0 -21
- package/dist/utils/index.js +0 -31
|
@@ -15,7 +15,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _TeamsChannelListCommand_instances, _TeamsChannelListCommand_initTelemetry, _TeamsChannelListCommand_initOptions, _TeamsChannelListCommand_initValidators, _TeamsChannelListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const
|
|
18
|
+
const odata_1 = require("../../../../utils/odata");
|
|
19
|
+
const validation_1 = require("../../../../utils/validation");
|
|
19
20
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
20
21
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
21
22
|
const commands_1 = require("../../commands");
|
|
@@ -50,20 +51,21 @@ class TeamsChannelListCommand extends GraphCommand_1.default {
|
|
|
50
51
|
return group.id;
|
|
51
52
|
});
|
|
52
53
|
}
|
|
53
|
-
commandAction(logger, args
|
|
54
|
-
this
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
54
|
+
commandAction(logger, args) {
|
|
55
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
56
|
+
try {
|
|
57
|
+
const teamId = yield this.getTeamId(args);
|
|
58
|
+
let endpoint = `${this.resource}/v1.0/teams/${teamId}/channels`;
|
|
59
|
+
if (args.options.type) {
|
|
60
|
+
endpoint += `?$filter=membershipType eq '${args.options.type}'`;
|
|
61
|
+
}
|
|
62
|
+
const items = yield odata_1.odata.getAllItems(endpoint);
|
|
63
|
+
logger.log(items);
|
|
60
64
|
}
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
cb();
|
|
66
|
-
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
65
|
+
catch (err) {
|
|
66
|
+
this.handleRejectedODataJsonPromise(err);
|
|
67
|
+
}
|
|
68
|
+
});
|
|
67
69
|
}
|
|
68
70
|
}
|
|
69
71
|
_TeamsChannelListCommand_instances = new WeakSet(), _TeamsChannelListCommand_initTelemetry = function _TeamsChannelListCommand_initTelemetry() {
|
|
@@ -80,15 +82,15 @@ _TeamsChannelListCommand_instances = new WeakSet(), _TeamsChannelListCommand_ini
|
|
|
80
82
|
option: '--teamName [teamName]'
|
|
81
83
|
}, {
|
|
82
84
|
option: '--type [type]',
|
|
83
|
-
autocomplete: ['standard', 'private']
|
|
85
|
+
autocomplete: ['standard', 'private', 'shared']
|
|
84
86
|
});
|
|
85
87
|
}, _TeamsChannelListCommand_initValidators = function _TeamsChannelListCommand_initValidators() {
|
|
86
88
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
87
|
-
if (args.options.teamId && !
|
|
89
|
+
if (args.options.teamId && !validation_1.validation.isValidGuid(args.options.teamId)) {
|
|
88
90
|
return `${args.options.teamId} is not a valid GUID`;
|
|
89
91
|
}
|
|
90
|
-
if (args.options.type && ['standard', 'private'].indexOf(args.options.type.toLowerCase()) === -1) {
|
|
91
|
-
return `${args.options.type} is not a valid type value. Allowed values standard|private`;
|
|
92
|
+
if (args.options.type && ['standard', 'private', 'shared'].indexOf(args.options.type.toLowerCase()) === -1) {
|
|
93
|
+
return `${args.options.type} is not a valid type value. Allowed values standard|private|shared`;
|
|
92
94
|
}
|
|
93
95
|
return true;
|
|
94
96
|
}));
|
|
@@ -17,7 +17,7 @@ var _TeamsChannelMemberAddCommand_instances, _TeamsChannelMemberAddCommand_initT
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const os = require("os");
|
|
19
19
|
const request_1 = require("../../../../request");
|
|
20
|
-
const
|
|
20
|
+
const validation_1 = require("../../../../utils/validation");
|
|
21
21
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
22
22
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
23
23
|
const commands_1 = require("../../commands");
|
|
@@ -34,31 +34,26 @@ class TeamsChannelMemberAddCommand extends GraphCommand_1.default {
|
|
|
34
34
|
return commands_1.default.CHANNEL_MEMBER_ADD;
|
|
35
35
|
}
|
|
36
36
|
get description() {
|
|
37
|
-
return 'Adds a
|
|
37
|
+
return 'Adds a specified member in the specified Microsoft Teams private or shared team channel';
|
|
38
38
|
}
|
|
39
|
-
commandAction(logger, args
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
.then((userIds) => {
|
|
53
|
-
const endpoint = `${this.resource}/v1.0/teams/${encodeURIComponent(teamId)}/channels/${encodeURIComponent(channelId)}/members`;
|
|
54
|
-
const roles = args.options.owner ? ["owner"] : [];
|
|
55
|
-
const tasks = [];
|
|
56
|
-
for (const userId of userIds) {
|
|
57
|
-
tasks.push(this.addUser(userId, endpoint, roles));
|
|
39
|
+
commandAction(logger, args) {
|
|
40
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
try {
|
|
42
|
+
const teamId = yield this.getTeamId(args);
|
|
43
|
+
const channelId = yield this.getChannelId(teamId, args);
|
|
44
|
+
const userIds = yield this.getUserId(args);
|
|
45
|
+
const endpoint = `${this.resource}/v1.0/teams/${encodeURIComponent(teamId)}/channels/${encodeURIComponent(channelId)}/members`;
|
|
46
|
+
const roles = args.options.owner ? ["owner"] : [];
|
|
47
|
+
const tasks = [];
|
|
48
|
+
for (const userId of userIds) {
|
|
49
|
+
tasks.push(this.addUser(userId, endpoint, roles));
|
|
50
|
+
}
|
|
51
|
+
yield Promise.all(tasks);
|
|
58
52
|
}
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
53
|
+
catch (err) {
|
|
54
|
+
this.handleRejectedODataJsonPromise(err);
|
|
55
|
+
}
|
|
56
|
+
});
|
|
62
57
|
}
|
|
63
58
|
addUser(userId, endpoint, roles) {
|
|
64
59
|
const requestOptions = {
|
|
@@ -176,10 +171,10 @@ _TeamsChannelMemberAddCommand_instances = new WeakSet(), _TeamsChannelMemberAddC
|
|
|
176
171
|
});
|
|
177
172
|
}, _TeamsChannelMemberAddCommand_initValidators = function _TeamsChannelMemberAddCommand_initValidators() {
|
|
178
173
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
179
|
-
if (args.options.teamId && !
|
|
174
|
+
if (args.options.teamId && !validation_1.validation.isValidGuid(args.options.teamId)) {
|
|
180
175
|
return `${args.options.teamId} is not a valid GUID`;
|
|
181
176
|
}
|
|
182
|
-
if (args.options.channelId && !
|
|
177
|
+
if (args.options.channelId && !validation_1.validation.isValidTeamsChannelId(args.options.channelId)) {
|
|
183
178
|
return `${args.options.channelId} is not a valid Teams ChannelId`;
|
|
184
179
|
}
|
|
185
180
|
return true;
|
|
@@ -16,7 +16,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _TeamsChannelMemberListCommand_instances, _TeamsChannelMemberListCommand_initTelemetry, _TeamsChannelMemberListCommand_initOptions, _TeamsChannelMemberListCommand_initValidators, _TeamsChannelMemberListCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
|
-
const
|
|
19
|
+
const odata_1 = require("../../../../utils/odata");
|
|
20
|
+
const validation_1 = require("../../../../utils/validation");
|
|
20
21
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
21
22
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
22
23
|
const commands_1 = require("../../commands");
|
|
@@ -39,30 +40,28 @@ class TeamsChannelMemberListCommand extends GraphCommand_1.default {
|
|
|
39
40
|
defaultProperties() {
|
|
40
41
|
return ['id', 'roles', 'displayName', 'userId', 'email'];
|
|
41
42
|
}
|
|
42
|
-
commandAction(logger, args
|
|
43
|
-
this
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
memberships = memberships.filter(i => i.roles.length === 0);
|
|
58
|
-
}
|
|
59
|
-
else {
|
|
60
|
-
memberships = memberships.filter(i => i.roles.indexOf(args.options.role) !== -1);
|
|
43
|
+
commandAction(logger, args) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
try {
|
|
46
|
+
this.teamId = yield this.getTeamId(args);
|
|
47
|
+
const channelId = yield this.getChannelId(args);
|
|
48
|
+
const endpoint = `${this.resource}/v1.0/teams/${this.teamId}/channels/${channelId}/members`;
|
|
49
|
+
let memberships = yield odata_1.odata.getAllItems(endpoint);
|
|
50
|
+
if (args.options.role) {
|
|
51
|
+
if (args.options.role === 'member') {
|
|
52
|
+
// Members have no role value
|
|
53
|
+
memberships = memberships.filter(i => i.roles.length === 0);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
memberships = memberships.filter(i => i.roles.indexOf(args.options.role) !== -1);
|
|
57
|
+
}
|
|
61
58
|
}
|
|
59
|
+
logger.log(memberships);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
this.handleRejectedODataJsonPromise(err);
|
|
62
63
|
}
|
|
63
|
-
|
|
64
|
-
cb();
|
|
65
|
-
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
64
|
+
});
|
|
66
65
|
}
|
|
67
66
|
getTeamId(args) {
|
|
68
67
|
if (args.options.teamId) {
|
|
@@ -124,10 +123,10 @@ _TeamsChannelMemberListCommand_instances = new WeakSet(), _TeamsChannelMemberLis
|
|
|
124
123
|
});
|
|
125
124
|
}, _TeamsChannelMemberListCommand_initValidators = function _TeamsChannelMemberListCommand_initValidators() {
|
|
126
125
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
127
|
-
if (args.options.teamId && !
|
|
126
|
+
if (args.options.teamId && !validation_1.validation.isValidGuid(args.options.teamId)) {
|
|
128
127
|
return `${args.options.teamId} is not a valid GUID`;
|
|
129
128
|
}
|
|
130
|
-
if (args.options.channelId && !
|
|
129
|
+
if (args.options.channelId && !validation_1.validation.isValidTeamsChannelId(args.options.channelId)) {
|
|
131
130
|
return `${args.options.channelId} is not a valid Teams Channel ID`;
|
|
132
131
|
}
|
|
133
132
|
if (args.options.role) {
|
|
@@ -15,9 +15,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _TeamsChannelMemberRemoveCommand_instances, _TeamsChannelMemberRemoveCommand_initTelemetry, _TeamsChannelMemberRemoveCommand_initOptions, _TeamsChannelMemberRemoveCommand_initValidators, _TeamsChannelMemberRemoveCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
19
19
|
const request_1 = require("../../../../request");
|
|
20
|
-
const
|
|
20
|
+
const validation_1 = require("../../../../utils/validation");
|
|
21
21
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
22
22
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
23
23
|
const commands_1 = require("../../commands");
|
|
@@ -36,35 +36,36 @@ class TeamsChannelMemberRemoveCommand extends GraphCommand_1.default {
|
|
|
36
36
|
return commands_1.default.CHANNEL_MEMBER_REMOVE;
|
|
37
37
|
}
|
|
38
38
|
get description() {
|
|
39
|
-
return '
|
|
39
|
+
return 'Remove the specified member from the specified Microsoft Teams private or shared team channel';
|
|
40
40
|
}
|
|
41
|
-
commandAction(logger, args
|
|
42
|
-
|
|
43
|
-
this
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
};
|
|
47
|
-
if (args.options.confirm) {
|
|
48
|
-
removeMember();
|
|
49
|
-
}
|
|
50
|
-
else {
|
|
51
|
-
const userName = args.options.userName || args.options.userId || args.options.id;
|
|
52
|
-
const teamName = args.options.teamName || args.options.teamId;
|
|
53
|
-
const channelName = args.options.channelName || args.options.channelId;
|
|
54
|
-
cli_1.Cli.prompt({
|
|
55
|
-
type: 'confirm',
|
|
56
|
-
name: 'continue',
|
|
57
|
-
default: false,
|
|
58
|
-
message: `Are you sure you want to remove the member ${userName} from the channel ${channelName} in team ${teamName}?`
|
|
59
|
-
}, (result) => {
|
|
60
|
-
if (!result.continue) {
|
|
61
|
-
cb();
|
|
41
|
+
commandAction(logger, args) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
const removeMember = () => __awaiter(this, void 0, void 0, function* () {
|
|
44
|
+
try {
|
|
45
|
+
yield this.removeMemberFromChannel(args);
|
|
62
46
|
}
|
|
63
|
-
|
|
64
|
-
|
|
47
|
+
catch (err) {
|
|
48
|
+
this.handleRejectedODataJsonPromise(err);
|
|
65
49
|
}
|
|
66
50
|
});
|
|
67
|
-
|
|
51
|
+
if (args.options.confirm) {
|
|
52
|
+
yield removeMember();
|
|
53
|
+
}
|
|
54
|
+
else {
|
|
55
|
+
const userName = args.options.userName || args.options.userId || args.options.id;
|
|
56
|
+
const teamName = args.options.teamName || args.options.teamId;
|
|
57
|
+
const channelName = args.options.channelName || args.options.channelId;
|
|
58
|
+
const result = yield Cli_1.Cli.prompt({
|
|
59
|
+
type: 'confirm',
|
|
60
|
+
name: 'continue',
|
|
61
|
+
default: false,
|
|
62
|
+
message: `Are you sure you want to remove the member ${userName} from the channel ${channelName} in team ${teamName}?`
|
|
63
|
+
});
|
|
64
|
+
if (result.continue) {
|
|
65
|
+
yield removeMember();
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
});
|
|
68
69
|
}
|
|
69
70
|
removeMemberFromChannel(args) {
|
|
70
71
|
return this
|
|
@@ -188,13 +189,13 @@ _TeamsChannelMemberRemoveCommand_instances = new WeakSet(), _TeamsChannelMemberR
|
|
|
188
189
|
});
|
|
189
190
|
}, _TeamsChannelMemberRemoveCommand_initValidators = function _TeamsChannelMemberRemoveCommand_initValidators() {
|
|
190
191
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
191
|
-
if (args.options.teamId && !
|
|
192
|
+
if (args.options.teamId && !validation_1.validation.isValidGuid(args.options.teamId)) {
|
|
192
193
|
return `${args.options.teamId} is not a valid GUID`;
|
|
193
194
|
}
|
|
194
|
-
if (args.options.channelId && !
|
|
195
|
+
if (args.options.channelId && !validation_1.validation.isValidTeamsChannelId(args.options.channelId)) {
|
|
195
196
|
return `${args.options.channelId} is not a valid Teams Channel ID`;
|
|
196
197
|
}
|
|
197
|
-
if (args.options.userId && !
|
|
198
|
+
if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
|
|
198
199
|
return `${args.options.userId} is not a valid GUID`;
|
|
199
200
|
}
|
|
200
201
|
return true;
|
|
@@ -16,7 +16,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _TeamsChannelMemberSetCommand_instances, _TeamsChannelMemberSetCommand_initTelemetry, _TeamsChannelMemberSetCommand_initOptions, _TeamsChannelMemberSetCommand_initValidators, _TeamsChannelMemberSetCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
|
-
const
|
|
19
|
+
const validation_1 = require("../../../../utils/validation");
|
|
20
20
|
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
21
21
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
22
22
|
const commands_1 = require("../../commands");
|
|
@@ -35,38 +35,33 @@ class TeamsChannelMemberSetCommand extends GraphCommand_1.default {
|
|
|
35
35
|
return commands_1.default.CHANNEL_MEMBER_SET;
|
|
36
36
|
}
|
|
37
37
|
get description() {
|
|
38
|
-
return 'Updates the role of the specified member in the specified Microsoft Teams private team channel';
|
|
38
|
+
return 'Updates the role of the specified member in the specified Microsoft Teams private or shared team channel';
|
|
39
39
|
}
|
|
40
|
-
commandAction(logger, args
|
|
41
|
-
this
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
}
|
|
64
|
-
|
|
65
|
-
})
|
|
66
|
-
.then((member) => {
|
|
67
|
-
logger.log(member);
|
|
68
|
-
cb();
|
|
69
|
-
}, (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
40
|
+
commandAction(logger, args) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
try {
|
|
43
|
+
this.teamId = yield this.getTeamId(args);
|
|
44
|
+
this.channelId = yield this.getChannelId(args);
|
|
45
|
+
const memberId = yield this.getMemberId(args);
|
|
46
|
+
const requestOptions = {
|
|
47
|
+
url: `${this.resource}/v1.0/teams/${this.teamId}/channels/${this.channelId}/members/${memberId}`,
|
|
48
|
+
headers: {
|
|
49
|
+
'accept': 'application/json;odata.metadata=none',
|
|
50
|
+
'Prefer': 'return=representation'
|
|
51
|
+
},
|
|
52
|
+
responseType: 'json',
|
|
53
|
+
data: {
|
|
54
|
+
'@odata.type': '#microsoft.graph.aadUserConversationMember',
|
|
55
|
+
roles: [args.options.role]
|
|
56
|
+
}
|
|
57
|
+
};
|
|
58
|
+
const member = yield request_1.default.patch(requestOptions);
|
|
59
|
+
logger.log(member);
|
|
60
|
+
}
|
|
61
|
+
catch (err) {
|
|
62
|
+
this.handleRejectedODataJsonPromise(err);
|
|
63
|
+
}
|
|
64
|
+
});
|
|
70
65
|
}
|
|
71
66
|
getTeamId(args) {
|
|
72
67
|
if (args.options.teamId) {
|
|
@@ -168,13 +163,13 @@ _TeamsChannelMemberSetCommand_instances = new WeakSet(), _TeamsChannelMemberSetC
|
|
|
168
163
|
});
|
|
169
164
|
}, _TeamsChannelMemberSetCommand_initValidators = function _TeamsChannelMemberSetCommand_initValidators() {
|
|
170
165
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
171
|
-
if (args.options.teamId && !
|
|
166
|
+
if (args.options.teamId && !validation_1.validation.isValidGuid(args.options.teamId)) {
|
|
172
167
|
return `${args.options.teamId} is not a valid GUID`;
|
|
173
168
|
}
|
|
174
|
-
if (args.options.channelId && !
|
|
169
|
+
if (args.options.channelId && !validation_1.validation.isValidTeamsChannelId(args.options.channelId)) {
|
|
175
170
|
return `${args.options.channelId} is not a valid Teams Channel ID`;
|
|
176
171
|
}
|
|
177
|
-
if (args.options.userId && !
|
|
172
|
+
if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
|
|
178
173
|
return `${args.options.userId} is not a valid GUID`;
|
|
179
174
|
}
|
|
180
175
|
if (['owner', 'member'].indexOf(args.options.role) === -1) {
|
|
@@ -15,9 +15,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _TeamsChannelRemoveCommand_instances, _TeamsChannelRemoveCommand_initTelemetry, _TeamsChannelRemoveCommand_initOptions, _TeamsChannelRemoveCommand_initValidators, _TeamsChannelRemoveCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
-
const
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
19
19
|
const request_1 = require("../../../../request");
|
|
20
|
-
const
|
|
20
|
+
const validation_1 = require("../../../../utils/validation");
|
|
21
21
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
22
22
|
const commands_1 = require("../../commands");
|
|
23
23
|
class TeamsChannelRemoveCommand extends GraphCommand_1.default {
|
|
@@ -35,67 +35,64 @@ class TeamsChannelRemoveCommand extends GraphCommand_1.default {
|
|
|
35
35
|
get description() {
|
|
36
36
|
return 'Removes the specified channel in the Microsoft Teams team';
|
|
37
37
|
}
|
|
38
|
-
commandAction(logger, args
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
38
|
+
commandAction(logger, args) {
|
|
39
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
40
|
+
const removeChannel = () => __awaiter(this, void 0, void 0, function* () {
|
|
41
|
+
try {
|
|
42
|
+
if (args.options.name) {
|
|
43
|
+
const getRequestOptions = {
|
|
44
|
+
url: `${this.resource}/v1.0/teams/${encodeURIComponent(args.options.teamId)}/channels?$filter=displayName eq '${encodeURIComponent(args.options.name)}'`,
|
|
45
|
+
headers: {
|
|
46
|
+
accept: 'application/json;odata.metadata=none'
|
|
47
|
+
},
|
|
48
|
+
responseType: 'json'
|
|
49
|
+
};
|
|
50
|
+
const res = yield request_1.default.get(getRequestOptions);
|
|
51
|
+
const channelItem = res.value[0];
|
|
52
|
+
if (!channelItem) {
|
|
53
|
+
return Promise.reject(`The specified channel does not exist in the Microsoft Teams team`);
|
|
54
|
+
}
|
|
55
|
+
const channelId = res.value[0].id;
|
|
56
|
+
const deleteRequestOptions = {
|
|
57
|
+
url: `${this.resource}/v1.0/teams/${encodeURIComponent(args.options.teamId)}/channels/${encodeURIComponent(channelId)}`,
|
|
58
|
+
headers: {
|
|
59
|
+
accept: 'application/json;odata.metadata=none'
|
|
60
|
+
},
|
|
61
|
+
responseType: 'json'
|
|
62
|
+
};
|
|
63
|
+
yield request_1.default.delete(deleteRequestOptions);
|
|
64
|
+
}
|
|
65
|
+
else {
|
|
66
|
+
const requestOptions = {
|
|
67
|
+
url: `${this.resource}/v1.0/teams/${encodeURIComponent(args.options.teamId)}/channels/${encodeURIComponent(args.options.id)}`,
|
|
68
|
+
headers: {
|
|
69
|
+
accept: 'application/json;odata.metadata=none'
|
|
70
|
+
},
|
|
71
|
+
responseType: 'json'
|
|
72
|
+
};
|
|
73
|
+
yield request_1.default.delete(requestOptions);
|
|
54
74
|
}
|
|
55
|
-
const channelId = res.value[0].id;
|
|
56
|
-
const requestOptions = {
|
|
57
|
-
url: `${this.resource}/v1.0/teams/${encodeURIComponent(args.options.teamId)}/channels/${encodeURIComponent(channelId)}`,
|
|
58
|
-
headers: {
|
|
59
|
-
accept: 'application/json;odata.metadata=none'
|
|
60
|
-
},
|
|
61
|
-
responseType: 'json'
|
|
62
|
-
};
|
|
63
|
-
return request_1.default.delete(requestOptions);
|
|
64
|
-
})
|
|
65
|
-
.then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
66
|
-
}
|
|
67
|
-
if (args.options.id) {
|
|
68
|
-
const requestOptions = {
|
|
69
|
-
url: `${this.resource}/v1.0/teams/${encodeURIComponent(args.options.teamId)}/channels/${encodeURIComponent(args.options.id)}`,
|
|
70
|
-
headers: {
|
|
71
|
-
accept: 'application/json;odata.metadata=none'
|
|
72
|
-
},
|
|
73
|
-
responseType: 'json'
|
|
74
|
-
};
|
|
75
|
-
request_1.default
|
|
76
|
-
.delete(requestOptions)
|
|
77
|
-
.then(_ => cb(), (err) => this.handleRejectedODataJsonPromise(err, logger, cb));
|
|
78
|
-
}
|
|
79
|
-
};
|
|
80
|
-
if (args.options.confirm) {
|
|
81
|
-
removeChannel();
|
|
82
|
-
}
|
|
83
|
-
else {
|
|
84
|
-
const channelName = args.options.name ? args.options.name : args.options.id;
|
|
85
|
-
cli_1.Cli.prompt({
|
|
86
|
-
type: 'confirm',
|
|
87
|
-
name: 'continue',
|
|
88
|
-
default: false,
|
|
89
|
-
message: `Are you sure you want to remove the channel ${channelName} from team ${args.options.teamId}?`
|
|
90
|
-
}, (result) => {
|
|
91
|
-
if (!result.continue) {
|
|
92
|
-
cb();
|
|
93
75
|
}
|
|
94
|
-
|
|
95
|
-
|
|
76
|
+
catch (err) {
|
|
77
|
+
this.handleRejectedODataJsonPromise(err);
|
|
96
78
|
}
|
|
97
79
|
});
|
|
98
|
-
|
|
80
|
+
if (args.options.confirm) {
|
|
81
|
+
yield removeChannel();
|
|
82
|
+
}
|
|
83
|
+
else {
|
|
84
|
+
const channelName = args.options.name ? args.options.name : args.options.id;
|
|
85
|
+
const result = yield Cli_1.Cli.prompt({
|
|
86
|
+
type: 'confirm',
|
|
87
|
+
name: 'continue',
|
|
88
|
+
default: false,
|
|
89
|
+
message: `Are you sure you want to remove the channel ${channelName} from team ${args.options.teamId}?`
|
|
90
|
+
});
|
|
91
|
+
if (result.continue) {
|
|
92
|
+
yield removeChannel();
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
});
|
|
99
96
|
}
|
|
100
97
|
}
|
|
101
98
|
_TeamsChannelRemoveCommand_instances = new WeakSet(), _TeamsChannelRemoveCommand_initTelemetry = function _TeamsChannelRemoveCommand_initTelemetry() {
|
|
@@ -118,10 +115,10 @@ _TeamsChannelRemoveCommand_instances = new WeakSet(), _TeamsChannelRemoveCommand
|
|
|
118
115
|
});
|
|
119
116
|
}, _TeamsChannelRemoveCommand_initValidators = function _TeamsChannelRemoveCommand_initValidators() {
|
|
120
117
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
121
|
-
if (args.options.id && !
|
|
118
|
+
if (args.options.id && !validation_1.validation.isValidTeamsChannelId(args.options.id)) {
|
|
122
119
|
return `${args.options.id} is not a valid Teams channel id`;
|
|
123
120
|
}
|
|
124
|
-
if (args.options.teamId && !
|
|
121
|
+
if (args.options.teamId && !validation_1.validation.isValidGuid(args.options.teamId)) {
|
|
125
122
|
return `${args.options.teamId} is not a valid GUID`;
|
|
126
123
|
}
|
|
127
124
|
return true;
|
|
@@ -16,7 +16,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _TeamsChannelSetCommand_instances, _TeamsChannelSetCommand_initTelemetry, _TeamsChannelSetCommand_initOptions, _TeamsChannelSetCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
|
-
const
|
|
19
|
+
const validation_1 = require("../../../../utils/validation");
|
|
20
20
|
const GraphCommand_1 = require("../../../base/GraphCommand");
|
|
21
21
|
const commands_1 = require("../../commands");
|
|
22
22
|
class TeamsChannelSetCommand extends GraphCommand_1.default {
|
|
@@ -33,34 +33,37 @@ class TeamsChannelSetCommand extends GraphCommand_1.default {
|
|
|
33
33
|
get description() {
|
|
34
34
|
return 'Updates properties of the specified channel in the given Microsoft Teams team';
|
|
35
35
|
}
|
|
36
|
-
commandAction(logger, args
|
|
37
|
-
|
|
38
|
-
url: `${this.resource}/v1.0/teams/${encodeURIComponent(args.options.teamId)}/channels?$filter=displayName eq '${encodeURIComponent(args.options.name)}'`,
|
|
39
|
-
headers: {
|
|
40
|
-
accept: 'application/json;odata.metadata=none'
|
|
41
|
-
},
|
|
42
|
-
responseType: 'json'
|
|
43
|
-
};
|
|
44
|
-
request_1.default
|
|
45
|
-
.get(requestOptions)
|
|
46
|
-
.then((res) => {
|
|
47
|
-
const channelItem = res.value[0];
|
|
48
|
-
if (!channelItem) {
|
|
49
|
-
return Promise.reject(`The specified channel does not exist in the Microsoft Teams team`);
|
|
50
|
-
}
|
|
51
|
-
const channelId = res.value[0].id;
|
|
52
|
-
const data = this.mapRequestBody(args.options);
|
|
36
|
+
commandAction(logger, args) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
53
38
|
const requestOptions = {
|
|
54
|
-
url: `${this.resource}/v1.0/teams/${encodeURIComponent(args.options.teamId)}/channels
|
|
39
|
+
url: `${this.resource}/v1.0/teams/${encodeURIComponent(args.options.teamId)}/channels?$filter=displayName eq '${encodeURIComponent(args.options.name)}'`,
|
|
55
40
|
headers: {
|
|
56
|
-
|
|
41
|
+
accept: 'application/json;odata.metadata=none'
|
|
57
42
|
},
|
|
58
|
-
responseType: 'json'
|
|
59
|
-
data: data
|
|
43
|
+
responseType: 'json'
|
|
60
44
|
};
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
45
|
+
try {
|
|
46
|
+
const res = yield request_1.default.get(requestOptions);
|
|
47
|
+
const channelItem = res.value[0];
|
|
48
|
+
if (!channelItem) {
|
|
49
|
+
throw `The specified channel does not exist in the Microsoft Teams team`;
|
|
50
|
+
}
|
|
51
|
+
const channelId = res.value[0].id;
|
|
52
|
+
const data = this.mapRequestBody(args.options);
|
|
53
|
+
const requestOptionsPatch = {
|
|
54
|
+
url: `${this.resource}/v1.0/teams/${encodeURIComponent(args.options.teamId)}/channels/${channelId}`,
|
|
55
|
+
headers: {
|
|
56
|
+
'accept': 'application/json;odata.metadata=none'
|
|
57
|
+
},
|
|
58
|
+
responseType: 'json',
|
|
59
|
+
data: data
|
|
60
|
+
};
|
|
61
|
+
yield request_1.default.patch(requestOptionsPatch);
|
|
62
|
+
}
|
|
63
|
+
catch (err) {
|
|
64
|
+
this.handleRejectedODataJsonPromise(err);
|
|
65
|
+
}
|
|
66
|
+
});
|
|
64
67
|
}
|
|
65
68
|
mapRequestBody(options) {
|
|
66
69
|
const requestBody = {};
|
|
@@ -92,7 +95,7 @@ _TeamsChannelSetCommand_instances = new WeakSet(), _TeamsChannelSetCommand_initT
|
|
|
92
95
|
});
|
|
93
96
|
}, _TeamsChannelSetCommand_initValidators = function _TeamsChannelSetCommand_initValidators() {
|
|
94
97
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
95
|
-
if (!
|
|
98
|
+
if (!validation_1.validation.isValidGuid(args.options.teamId)) {
|
|
96
99
|
return `${args.options.teamId} is not a valid GUID`;
|
|
97
100
|
}
|
|
98
101
|
if (args.options.name.toLowerCase() === "general") {
|