@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,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 _SpoFileCopyCommand_instances, _SpoFileCopyCommand_initTelemetry, _SpoFileCopyCommand_initOptions, _SpoFileCopyCommand_initValidators;
|
|
6
|
+
var _SpoFileCopyCommand_instances, _SpoFileCopyCommand_initTelemetry, _SpoFileCopyCommand_initOptions, _SpoFileCopyCommand_initValidators, _SpoFileCopyCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -23,10 +23,12 @@ class SpoFileCopyCommand extends SpoCommand {
|
|
|
23
23
|
__classPrivateFieldGet(this, _SpoFileCopyCommand_instances, "m", _SpoFileCopyCommand_initTelemetry).call(this);
|
|
24
24
|
__classPrivateFieldGet(this, _SpoFileCopyCommand_instances, "m", _SpoFileCopyCommand_initOptions).call(this);
|
|
25
25
|
__classPrivateFieldGet(this, _SpoFileCopyCommand_instances, "m", _SpoFileCopyCommand_initValidators).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SpoFileCopyCommand_instances, "m", _SpoFileCopyCommand_initOptionSets).call(this);
|
|
26
27
|
}
|
|
27
28
|
async commandAction(logger, args) {
|
|
28
29
|
try {
|
|
29
|
-
const
|
|
30
|
+
const sourceServerRelativePath = await this.getSourcePath(logger, args.options);
|
|
31
|
+
const sourcePath = this.getAbsoluteUrl(args.options.webUrl, sourceServerRelativePath);
|
|
30
32
|
let destinationPath = this.getAbsoluteUrl(args.options.webUrl, args.options.targetUrl) + '/';
|
|
31
33
|
if (args.options.newName) {
|
|
32
34
|
destinationPath += args.options.newName;
|
|
@@ -54,6 +56,7 @@ class SpoFileCopyCommand extends SpoCommand {
|
|
|
54
56
|
overwrite: args.options.nameConflictBehavior === 'replace',
|
|
55
57
|
options: {
|
|
56
58
|
KeepBoth: args.options.nameConflictBehavior === 'rename',
|
|
59
|
+
ResetAuthorAndCreatedOnCopy: !!args.options.resetAuthorAndCreated,
|
|
57
60
|
ShouldBypassSharedLocks: !!args.options.bypassSharedLock
|
|
58
61
|
}
|
|
59
62
|
}
|
|
@@ -64,6 +67,23 @@ class SpoFileCopyCommand extends SpoCommand {
|
|
|
64
67
|
this.handleRejectedODataJsonPromise(err);
|
|
65
68
|
}
|
|
66
69
|
}
|
|
70
|
+
async getSourcePath(logger, options) {
|
|
71
|
+
if (options.sourceUrl) {
|
|
72
|
+
return urlUtil.getServerRelativePath(options.webUrl, options.sourceUrl);
|
|
73
|
+
}
|
|
74
|
+
if (this.verbose) {
|
|
75
|
+
await logger.logToStderr(`Retrieving server-relative path for file with ID '${options.sourceId}'...`);
|
|
76
|
+
}
|
|
77
|
+
const requestOptions = {
|
|
78
|
+
url: `${options.webUrl}/_api/Web/GetFileById('${options.sourceId}')?$select=ServerRelativePath`,
|
|
79
|
+
headers: {
|
|
80
|
+
accept: 'application/json;odata=nometadata'
|
|
81
|
+
},
|
|
82
|
+
responseType: 'json'
|
|
83
|
+
};
|
|
84
|
+
const file = await request.get(requestOptions);
|
|
85
|
+
return file.ServerRelativePath.DecodedUrl;
|
|
86
|
+
}
|
|
67
87
|
getAbsoluteUrl(webUrl, url) {
|
|
68
88
|
return url.startsWith('https://') ? url : urlUtil.getAbsoluteUrl(webUrl, url);
|
|
69
89
|
}
|
|
@@ -71,8 +91,11 @@ class SpoFileCopyCommand extends SpoCommand {
|
|
|
71
91
|
_SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry = function _SpoFileCopyCommand_initTelemetry() {
|
|
72
92
|
this.telemetry.push((args) => {
|
|
73
93
|
Object.assign(this.telemetryProperties, {
|
|
94
|
+
sourceUrl: typeof args.options.sourceUrl !== 'undefined',
|
|
95
|
+
sourceId: typeof args.options.sourceId !== 'undefined',
|
|
74
96
|
newName: typeof args.options.newName !== 'undefined',
|
|
75
97
|
nameConflictBehavior: args.options.nameConflictBehavior || false,
|
|
98
|
+
resetAuthorAndCreated: !!args.options.resetAuthorAndCreated,
|
|
76
99
|
bypassSharedLock: !!args.options.bypassSharedLock
|
|
77
100
|
});
|
|
78
101
|
});
|
|
@@ -80,7 +103,9 @@ _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry
|
|
|
80
103
|
this.options.unshift({
|
|
81
104
|
option: '-u, --webUrl <webUrl>'
|
|
82
105
|
}, {
|
|
83
|
-
option: '-s, --sourceUrl
|
|
106
|
+
option: '-s, --sourceUrl [sourceUrl]'
|
|
107
|
+
}, {
|
|
108
|
+
option: '-i, --sourceId [sourceId]'
|
|
84
109
|
}, {
|
|
85
110
|
option: '-t, --targetUrl <targetUrl>'
|
|
86
111
|
}, {
|
|
@@ -88,6 +113,8 @@ _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry
|
|
|
88
113
|
}, {
|
|
89
114
|
option: '--nameConflictBehavior [nameConflictBehavior]',
|
|
90
115
|
autocomplete: this.nameConflictBehaviorOptions
|
|
116
|
+
}, {
|
|
117
|
+
option: '--resetAuthorAndCreated'
|
|
91
118
|
}, {
|
|
92
119
|
option: '--bypassSharedLock'
|
|
93
120
|
});
|
|
@@ -97,11 +124,16 @@ _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry
|
|
|
97
124
|
if (isValidSharePointUrl !== true) {
|
|
98
125
|
return isValidSharePointUrl;
|
|
99
126
|
}
|
|
127
|
+
if (args.options.sourceId && !validation.isValidGuid(args.options.sourceId)) {
|
|
128
|
+
return `${args.options.sourceId} is not a valid GUID for sourceId.`;
|
|
129
|
+
}
|
|
100
130
|
if (args.options.nameConflictBehavior && this.nameConflictBehaviorOptions.indexOf(args.options.nameConflictBehavior) === -1) {
|
|
101
|
-
return `${args.options.nameConflictBehavior} is not a valid nameConflictBehavior value. Allowed values: ${this.nameConflictBehaviorOptions.join(', ')}
|
|
131
|
+
return `${args.options.nameConflictBehavior} is not a valid nameConflictBehavior value. Allowed values: ${this.nameConflictBehaviorOptions.join(', ')}.`;
|
|
102
132
|
}
|
|
103
133
|
return true;
|
|
104
134
|
});
|
|
135
|
+
}, _SpoFileCopyCommand_initOptionSets = function _SpoFileCopyCommand_initOptionSets() {
|
|
136
|
+
this.optionSets.push({ options: ['sourceUrl', 'sourceId'] });
|
|
105
137
|
};
|
|
106
138
|
export default new SpoFileCopyCommand();
|
|
107
139
|
//# sourceMappingURL=file-copy.js.map
|
|
@@ -103,6 +103,9 @@ class SpoFileGetCommand extends SpoCommand {
|
|
|
103
103
|
fileProperties.ListItemAllFields.RoleAssignments = response.value;
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
|
+
if (args.options.asListItem) {
|
|
107
|
+
delete fileProperties.ListItemAllFields.ID;
|
|
108
|
+
}
|
|
106
109
|
await logger.log(args.options.asListItem ? fileProperties.ListItemAllFields : fileProperties);
|
|
107
110
|
}
|
|
108
111
|
}
|
|
@@ -115,20 +118,20 @@ class SpoFileGetCommand extends SpoCommand {
|
|
|
115
118
|
_SpoFileGetCommand_instances = new WeakSet(), _SpoFileGetCommand_initTelemetry = function _SpoFileGetCommand_initTelemetry() {
|
|
116
119
|
this.telemetry.push((args) => {
|
|
117
120
|
Object.assign(this.telemetryProperties, {
|
|
118
|
-
id:
|
|
119
|
-
url:
|
|
120
|
-
asString: args.options.asString
|
|
121
|
-
asListItem: args.options.asListItem
|
|
122
|
-
asFile: args.options.asFile
|
|
123
|
-
path:
|
|
121
|
+
id: typeof args.options.id !== 'undefined',
|
|
122
|
+
url: typeof args.options.url !== 'undefined',
|
|
123
|
+
asString: !!args.options.asString,
|
|
124
|
+
asListItem: !!args.options.asListItem,
|
|
125
|
+
asFile: !!args.options.asFile,
|
|
126
|
+
path: typeof args.options.path !== 'undefined',
|
|
124
127
|
withPermissions: !!args.options.withPermissions
|
|
125
128
|
});
|
|
126
129
|
});
|
|
127
130
|
}, _SpoFileGetCommand_initOptions = function _SpoFileGetCommand_initOptions() {
|
|
128
131
|
this.options.unshift({
|
|
129
|
-
option: '-
|
|
132
|
+
option: '-u, --webUrl <webUrl>'
|
|
130
133
|
}, {
|
|
131
|
-
option: '
|
|
134
|
+
option: '--url [url]'
|
|
132
135
|
}, {
|
|
133
136
|
option: '-i, --id [id]'
|
|
134
137
|
}, {
|
|
@@ -56,7 +56,7 @@ class SpoFileListCommand extends SpoCommand {
|
|
|
56
56
|
}
|
|
57
57
|
const allFiles = [];
|
|
58
58
|
const serverRelativePath = urlUtil.getServerRelativePath(args.options.webUrl, folderUrl);
|
|
59
|
-
const requestUrl = `${args.options.webUrl}/_api/web/
|
|
59
|
+
const requestUrl = `${args.options.webUrl}/_api/web/GetFolderByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(serverRelativePath)}')/Files`;
|
|
60
60
|
const queryParams = [`$skip=${skip}`, `$top=${SpoFileListCommand.pageSize}`];
|
|
61
61
|
if (fieldProperties.expandProperties.length > 0) {
|
|
62
62
|
queryParams.push(`$expand=${fieldProperties.expandProperties.join(',')}`);
|
|
@@ -68,7 +68,7 @@ class SpoFileListCommand extends SpoCommand {
|
|
|
68
68
|
queryParams.push(`$filter=${args.options.filter}`);
|
|
69
69
|
}
|
|
70
70
|
const requestOptions = {
|
|
71
|
-
url: `${requestUrl}
|
|
71
|
+
url: `${requestUrl}?${queryParams.join('&')}`,
|
|
72
72
|
method: 'GET',
|
|
73
73
|
headers: {
|
|
74
74
|
'accept': 'application/json;odata=nometadata'
|
|
@@ -90,9 +90,9 @@ class SpoFileListCommand extends SpoCommand {
|
|
|
90
90
|
}
|
|
91
91
|
const allFolders = [];
|
|
92
92
|
const serverRelativeUrl = urlUtil.getServerRelativePath(args.options.webUrl, folderUrl);
|
|
93
|
-
const requestUrl = `${args.options.webUrl}/_api/web/
|
|
93
|
+
const requestUrl = `${args.options.webUrl}/_api/web/GetFolderByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(serverRelativeUrl)}')/Folders`;
|
|
94
94
|
const requestOptions = {
|
|
95
|
-
url: `${requestUrl}
|
|
95
|
+
url: `${requestUrl}?$skip=${skip}&$top=${SpoFileListCommand.pageSize}&$select=ServerRelativeUrl`,
|
|
96
96
|
method: 'GET',
|
|
97
97
|
headers: {
|
|
98
98
|
'accept': 'application/json;odata=nometadata'
|
|
@@ -3,17 +3,12 @@ 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 _SpoFileMoveCommand_instances, _SpoFileMoveCommand_initTelemetry, _SpoFileMoveCommand_initOptions, _SpoFileMoveCommand_initValidators;
|
|
7
|
-
import url from 'url';
|
|
8
|
-
import { Cli } from '../../../../cli/Cli.js';
|
|
6
|
+
var _SpoFileMoveCommand_instances, _SpoFileMoveCommand_initTelemetry, _SpoFileMoveCommand_initOptions, _SpoFileMoveCommand_initValidators, _SpoFileMoveCommand_initOptionSets;
|
|
9
7
|
import request from '../../../../request.js';
|
|
10
|
-
import { formatting } from '../../../../utils/formatting.js';
|
|
11
|
-
import { spo } from '../../../../utils/spo.js';
|
|
12
8
|
import { urlUtil } from '../../../../utils/urlUtil.js';
|
|
13
9
|
import { validation } from '../../../../utils/validation.js';
|
|
14
10
|
import SpoCommand from '../../../base/SpoCommand.js';
|
|
15
11
|
import commands from '../../commands.js';
|
|
16
|
-
import removeCommand from './file-remove.js';
|
|
17
12
|
class SpoFileMoveCommand extends SpoCommand {
|
|
18
13
|
get name() {
|
|
19
14
|
return commands.FILE_MOVE;
|
|
@@ -24,143 +19,124 @@ class SpoFileMoveCommand extends SpoCommand {
|
|
|
24
19
|
constructor() {
|
|
25
20
|
super();
|
|
26
21
|
_SpoFileMoveCommand_instances.add(this);
|
|
22
|
+
this.nameConflictBehaviorOptions = ['fail', 'replace', 'rename'];
|
|
27
23
|
__classPrivateFieldGet(this, _SpoFileMoveCommand_instances, "m", _SpoFileMoveCommand_initTelemetry).call(this);
|
|
28
24
|
__classPrivateFieldGet(this, _SpoFileMoveCommand_instances, "m", _SpoFileMoveCommand_initOptions).call(this);
|
|
29
25
|
__classPrivateFieldGet(this, _SpoFileMoveCommand_instances, "m", _SpoFileMoveCommand_initValidators).call(this);
|
|
26
|
+
__classPrivateFieldGet(this, _SpoFileMoveCommand_instances, "m", _SpoFileMoveCommand_initOptionSets).call(this);
|
|
30
27
|
}
|
|
31
28
|
getExcludedOptionsWithUrls() {
|
|
32
29
|
return ['targetUrl', 'sourceUrl'];
|
|
33
30
|
}
|
|
34
31
|
async commandAction(logger, args) {
|
|
35
|
-
const webUrl = args.options.webUrl;
|
|
36
|
-
const parsedUrl = url.parse(webUrl);
|
|
37
|
-
const tenantUrl = `${parsedUrl.protocol}//${parsedUrl.hostname}`;
|
|
38
32
|
try {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
//
|
|
50
|
-
|
|
51
|
-
await this.recycleFile(tenantUrl, args.options.targetUrl, filename, logger);
|
|
33
|
+
const sourcePath = await this.getSourcePath(logger, args.options);
|
|
34
|
+
if (this.verbose) {
|
|
35
|
+
await logger.logToStderr(`Moving file ${sourcePath} to ${args.options.targetUrl}...`);
|
|
36
|
+
}
|
|
37
|
+
const absoluteSourcePath = this.getAbsoluteUrl(args.options.webUrl, sourcePath);
|
|
38
|
+
let absoluteTargetPath = this.getAbsoluteUrl(args.options.webUrl, args.options.targetUrl) + '/';
|
|
39
|
+
if (args.options.newName) {
|
|
40
|
+
absoluteTargetPath += args.options.newName;
|
|
41
|
+
}
|
|
42
|
+
else {
|
|
43
|
+
// Keep the original file name
|
|
44
|
+
absoluteTargetPath += sourcePath.substring(sourcePath.lastIndexOf('/') + 1);
|
|
52
45
|
}
|
|
53
|
-
// all preconditions met, now create copy job
|
|
54
|
-
const sourceAbsoluteUrl = urlUtil.urlCombine(tenantUrl, serverRelativePath);
|
|
55
|
-
const allowSchemaMismatch = args.options.allowSchemaMismatch || false;
|
|
56
|
-
const requestUrl = urlUtil.urlCombine(webUrl, '/_api/site/CreateCopyJobs');
|
|
57
46
|
const requestOptions = {
|
|
58
|
-
url:
|
|
47
|
+
url: `${args.options.webUrl}/_api/SP.MoveCopyUtil.MoveFileByPath`,
|
|
59
48
|
headers: {
|
|
60
|
-
|
|
49
|
+
accept: 'application/json;odata=nometadata'
|
|
61
50
|
},
|
|
51
|
+
responseType: 'json',
|
|
62
52
|
data: {
|
|
63
|
-
|
|
64
|
-
|
|
53
|
+
srcPath: {
|
|
54
|
+
DecodedUrl: absoluteSourcePath
|
|
55
|
+
},
|
|
56
|
+
destPath: {
|
|
57
|
+
DecodedUrl: absoluteTargetPath
|
|
58
|
+
},
|
|
59
|
+
overwrite: args.options.nameConflictBehavior === 'replace',
|
|
65
60
|
options: {
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
61
|
+
KeepBoth: args.options.nameConflictBehavior === 'rename',
|
|
62
|
+
ShouldBypassSharedLocks: !!args.options.bypassSharedLock,
|
|
63
|
+
RetainEditorAndModifiedOnMove: !!args.options.retainEditorAndModified
|
|
69
64
|
}
|
|
70
|
-
}
|
|
71
|
-
responseType: 'json'
|
|
65
|
+
}
|
|
72
66
|
};
|
|
73
|
-
|
|
74
|
-
const copyJobInfo = jobInfo.value[0];
|
|
75
|
-
const progressPollInterval = 1800; // 30 * 60; //used previously implemented interval. The API does not provide guidance on what value should be used.
|
|
76
|
-
await new Promise((resolve, reject) => {
|
|
77
|
-
setTimeout(() => {
|
|
78
|
-
spo.waitUntilCopyJobFinished({
|
|
79
|
-
copyJobInfo,
|
|
80
|
-
siteUrl: webUrl,
|
|
81
|
-
pollingInterval: progressPollInterval,
|
|
82
|
-
resolve,
|
|
83
|
-
reject,
|
|
84
|
-
logger,
|
|
85
|
-
debug: this.debug,
|
|
86
|
-
verbose: this.verbose
|
|
87
|
-
});
|
|
88
|
-
}, progressPollInterval);
|
|
89
|
-
});
|
|
67
|
+
await request.post(requestOptions);
|
|
90
68
|
}
|
|
91
69
|
catch (err) {
|
|
92
70
|
this.handleRejectedODataJsonPromise(err);
|
|
93
71
|
}
|
|
94
72
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
73
|
+
async getSourcePath(logger, options) {
|
|
74
|
+
if (options.sourceUrl) {
|
|
75
|
+
return urlUtil.getServerRelativePath(options.webUrl, options.sourceUrl);
|
|
76
|
+
}
|
|
77
|
+
if (this.verbose) {
|
|
78
|
+
await logger.logToStderr(`Retrieving server-relative path for file with ID '${options.sourceId}'...`);
|
|
79
|
+
}
|
|
100
80
|
const requestOptions = {
|
|
101
|
-
url:
|
|
102
|
-
method: 'GET',
|
|
81
|
+
url: `${options.webUrl}/_api/Web/GetFileById('${options.sourceId}')?$select=ServerRelativePath`,
|
|
103
82
|
headers: {
|
|
104
|
-
|
|
83
|
+
accept: 'application/json;odata=nometadata'
|
|
105
84
|
},
|
|
106
85
|
responseType: 'json'
|
|
107
86
|
};
|
|
108
|
-
|
|
87
|
+
const file = await request.get(requestOptions);
|
|
88
|
+
return file.ServerRelativePath.DecodedUrl;
|
|
109
89
|
}
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
*/
|
|
113
|
-
async recycleFile(tenantUrl, targetUrl, filename, logger) {
|
|
114
|
-
const targetFolderAbsoluteUrl = urlUtil.urlCombine(tenantUrl, targetUrl);
|
|
115
|
-
// since the target WebFullUrl is unknown we can use getRequestDigest
|
|
116
|
-
// to get it from target folder absolute url.
|
|
117
|
-
// Similar approach used here Microsoft.SharePoint.Client.Web.WebUrlFromFolderUrlDirect
|
|
118
|
-
const contextResponse = await spo.getRequestDigest(targetFolderAbsoluteUrl);
|
|
119
|
-
if (this.debug) {
|
|
120
|
-
await logger.logToStderr(`contextResponse.WebFullUrl: ${contextResponse.WebFullUrl}`);
|
|
121
|
-
}
|
|
122
|
-
const targetFileServerRelativeUrl = `${urlUtil.getServerRelativePath(contextResponse.WebFullUrl, targetUrl)}/${filename}`;
|
|
123
|
-
const removeOptions = {
|
|
124
|
-
webUrl: contextResponse.WebFullUrl,
|
|
125
|
-
url: targetFileServerRelativeUrl,
|
|
126
|
-
recycle: true,
|
|
127
|
-
force: true,
|
|
128
|
-
debug: this.debug,
|
|
129
|
-
verbose: this.verbose
|
|
130
|
-
};
|
|
131
|
-
try {
|
|
132
|
-
await Cli.executeCommand(removeCommand, { options: { ...removeOptions, _: [] } });
|
|
133
|
-
}
|
|
134
|
-
catch (err) {
|
|
135
|
-
if (err !== undefined && err.message !== undefined && err.message.includes('does not exist')) {
|
|
136
|
-
}
|
|
137
|
-
else {
|
|
138
|
-
throw err;
|
|
139
|
-
}
|
|
140
|
-
}
|
|
90
|
+
getAbsoluteUrl(webUrl, url) {
|
|
91
|
+
return url.startsWith('https://') ? url : urlUtil.getAbsoluteUrl(webUrl, url);
|
|
141
92
|
}
|
|
142
93
|
}
|
|
143
94
|
_SpoFileMoveCommand_instances = new WeakSet(), _SpoFileMoveCommand_initTelemetry = function _SpoFileMoveCommand_initTelemetry() {
|
|
144
95
|
this.telemetry.push((args) => {
|
|
145
96
|
Object.assign(this.telemetryProperties, {
|
|
146
|
-
|
|
147
|
-
|
|
97
|
+
sourceUrl: typeof args.options.sourceUrl !== 'undefined',
|
|
98
|
+
sourceId: typeof args.options.sourceId !== 'undefined',
|
|
99
|
+
newName: typeof args.options.newName !== 'undefined',
|
|
100
|
+
nameConflictBehavior: typeof args.options.nameConflictBehavior !== 'undefined',
|
|
101
|
+
retainEditorAndModified: !!args.options.retainEditorAndModified,
|
|
102
|
+
bypassSharedLock: !!args.options.bypassSharedLock
|
|
148
103
|
});
|
|
149
104
|
});
|
|
150
105
|
}, _SpoFileMoveCommand_initOptions = function _SpoFileMoveCommand_initOptions() {
|
|
151
106
|
this.options.unshift({
|
|
152
107
|
option: '-u, --webUrl <webUrl>'
|
|
153
108
|
}, {
|
|
154
|
-
option: '-s, --sourceUrl
|
|
109
|
+
option: '-s, --sourceUrl [sourceUrl]'
|
|
110
|
+
}, {
|
|
111
|
+
option: '-i, --sourceId [sourceId]'
|
|
155
112
|
}, {
|
|
156
113
|
option: '-t, --targetUrl <targetUrl>'
|
|
157
114
|
}, {
|
|
158
|
-
option: '--
|
|
115
|
+
option: '--newName [newName]'
|
|
116
|
+
}, {
|
|
117
|
+
option: '--nameConflictBehavior [nameConflictBehavior]',
|
|
118
|
+
autocomplete: this.nameConflictBehaviorOptions
|
|
159
119
|
}, {
|
|
160
|
-
option: '--
|
|
120
|
+
option: '--retainEditorAndModified'
|
|
121
|
+
}, {
|
|
122
|
+
option: '--bypassSharedLock'
|
|
161
123
|
});
|
|
162
124
|
}, _SpoFileMoveCommand_initValidators = function _SpoFileMoveCommand_initValidators() {
|
|
163
|
-
this.validators.push(async (args) =>
|
|
125
|
+
this.validators.push(async (args) => {
|
|
126
|
+
const isValidSharePointUrl = validation.isValidSharePointUrl(args.options.webUrl);
|
|
127
|
+
if (isValidSharePointUrl !== true) {
|
|
128
|
+
return isValidSharePointUrl;
|
|
129
|
+
}
|
|
130
|
+
if (args.options.sourceId && !validation.isValidGuid(args.options.sourceId)) {
|
|
131
|
+
return `'${args.options.sourceId}' is not a valid GUID for sourceId.`;
|
|
132
|
+
}
|
|
133
|
+
if (args.options.nameConflictBehavior && this.nameConflictBehaviorOptions.indexOf(args.options.nameConflictBehavior) === -1) {
|
|
134
|
+
return `'${args.options.nameConflictBehavior}' is not a valid value for nameConflictBehavior. Allowed values are: ${this.nameConflictBehaviorOptions.join(', ')}.`;
|
|
135
|
+
}
|
|
136
|
+
return true;
|
|
137
|
+
});
|
|
138
|
+
}, _SpoFileMoveCommand_initOptionSets = function _SpoFileMoveCommand_initOptionSets() {
|
|
139
|
+
this.optionSets.push({ options: ['sourceUrl', 'sourceId'] });
|
|
164
140
|
};
|
|
165
141
|
export default new SpoFileMoveCommand();
|
|
166
142
|
//# sourceMappingURL=file-move.js.map
|
|
@@ -43,7 +43,7 @@ class SpoFileRemoveCommand extends SpoCommand {
|
|
|
43
43
|
}
|
|
44
44
|
else {
|
|
45
45
|
const serverRelativePath = urlUtil.getServerRelativePath(args.options.webUrl, args.options.url);
|
|
46
|
-
requestUrl = `${args.options.webUrl}/_api/web/
|
|
46
|
+
requestUrl = `${args.options.webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(serverRelativePath)}')`;
|
|
47
47
|
}
|
|
48
48
|
if (args.options.recycle) {
|
|
49
49
|
requestUrl += `/recycle()`;
|
|
@@ -73,7 +73,7 @@ class SpoFileRemoveCommand extends SpoCommand {
|
|
|
73
73
|
type: 'confirm',
|
|
74
74
|
name: 'continue',
|
|
75
75
|
default: false,
|
|
76
|
-
message: `Are you sure you want to ${args.options.recycle ?
|
|
76
|
+
message: `Are you sure you want to ${args.options.recycle ? 'recycle' : 'remove'} the file ${args.options.id || args.options.url} located in site ${args.options.webUrl}?`
|
|
77
77
|
});
|
|
78
78
|
if (result.continue) {
|
|
79
79
|
await removeFile();
|
|
@@ -84,19 +84,19 @@ class SpoFileRemoveCommand extends SpoCommand {
|
|
|
84
84
|
_SpoFileRemoveCommand_instances = new WeakSet(), _SpoFileRemoveCommand_initTelemetry = function _SpoFileRemoveCommand_initTelemetry() {
|
|
85
85
|
this.telemetry.push((args) => {
|
|
86
86
|
Object.assign(this.telemetryProperties, {
|
|
87
|
-
id:
|
|
88
|
-
url:
|
|
89
|
-
recycle:
|
|
90
|
-
force:
|
|
87
|
+
id: typeof args.options.id !== 'undefined',
|
|
88
|
+
url: typeof args.options.url !== 'undefined',
|
|
89
|
+
recycle: !!args.options.recycle,
|
|
90
|
+
force: !!args.options.force
|
|
91
91
|
});
|
|
92
92
|
});
|
|
93
93
|
}, _SpoFileRemoveCommand_initOptions = function _SpoFileRemoveCommand_initOptions() {
|
|
94
94
|
this.options.unshift({
|
|
95
|
-
option: '-
|
|
95
|
+
option: '-u, --webUrl <webUrl>'
|
|
96
96
|
}, {
|
|
97
97
|
option: '-i, --id [id]'
|
|
98
98
|
}, {
|
|
99
|
-
option: '
|
|
99
|
+
option: '--url [url]'
|
|
100
100
|
}, {
|
|
101
101
|
option: '--recycle'
|
|
102
102
|
}, {
|
|
@@ -41,7 +41,7 @@ class SpoFileRenameCommand extends SpoCommand {
|
|
|
41
41
|
}]
|
|
42
42
|
};
|
|
43
43
|
const requestOptions = {
|
|
44
|
-
url: `${webUrl}/_api/web/
|
|
44
|
+
url: `${webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(originalFileServerRelativePath)}')/ListItemAllFields/ValidateUpdateListItem()`,
|
|
45
45
|
headers: {
|
|
46
46
|
'accept': 'application/json;odata=nometadata'
|
|
47
47
|
},
|
|
@@ -56,7 +56,7 @@ class SpoFileRenameCommand extends SpoCommand {
|
|
|
56
56
|
}
|
|
57
57
|
}
|
|
58
58
|
async getFile(originalFileServerRelativeUrl, webUrl) {
|
|
59
|
-
const requestUrl = `${webUrl}/_api/web/
|
|
59
|
+
const requestUrl = `${webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(originalFileServerRelativeUrl)}')?$select=UniqueId`;
|
|
60
60
|
const requestOptions = {
|
|
61
61
|
url: requestUrl,
|
|
62
62
|
headers: {
|
|
@@ -61,7 +61,7 @@ class SpoFileRetentionLabelEnsureCommand extends SpoCommand {
|
|
|
61
61
|
}
|
|
62
62
|
else {
|
|
63
63
|
const serverRelativeUrl = urlUtil.getServerRelativePath(args.options.webUrl, args.options.fileUrl);
|
|
64
|
-
requestUrl += `
|
|
64
|
+
requestUrl += `GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(serverRelativeUrl)}')`;
|
|
65
65
|
}
|
|
66
66
|
const requestOptions = {
|
|
67
67
|
url: `${requestUrl}?$expand=ListItemAllFields,ListItemAllFields/ParentList&$select=ServerRelativeUrl,ListItemAllFields/ParentList/Id,ListItemAllFields/Id`,
|
|
@@ -80,7 +80,7 @@ class SpoFileRetentionLabelRemoveCommand extends SpoCommand {
|
|
|
80
80
|
}
|
|
81
81
|
else {
|
|
82
82
|
const serverRelativeUrl = urlUtil.getServerRelativePath(args.options.webUrl, args.options.fileUrl);
|
|
83
|
-
requestUrl += `
|
|
83
|
+
requestUrl += `GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(serverRelativeUrl)}')`;
|
|
84
84
|
}
|
|
85
85
|
requestOptions.url = `${requestUrl}?$expand=ListItemAllFields,ListItemAllFields/ParentList&$select=ListItemAllFields/ParentList/Id,ListItemAllFields/Id`;
|
|
86
86
|
const response = await request.get(requestOptions);
|
|
@@ -55,7 +55,7 @@ class SpoFileRoleAssignmentAddCommand extends SpoCommand {
|
|
|
55
55
|
}
|
|
56
56
|
async addRoleAssignment(fileUrl, webUrl, principalId, roleDefinitionId) {
|
|
57
57
|
const requestOptions = {
|
|
58
|
-
url: `${webUrl}/_api/web/
|
|
58
|
+
url: `${webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(fileUrl)}')/ListItemAllFields/roleassignments/addroleassignment(principalid='${principalId}',roledefid='${roleDefinitionId}')`,
|
|
59
59
|
method: 'POST',
|
|
60
60
|
headers: {
|
|
61
61
|
'accept': 'application/json;odata=nometadata',
|
|
@@ -48,7 +48,7 @@ class SpoFileRoleAssignmentRemoveCommand extends SpoCommand {
|
|
|
48
48
|
}
|
|
49
49
|
const serverRelativePath = urlUtil.getServerRelativePath(args.options.webUrl, fileURL);
|
|
50
50
|
const requestOptions = {
|
|
51
|
-
url: `${args.options.webUrl}/_api/web/
|
|
51
|
+
url: `${args.options.webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(serverRelativePath)}')/ListItemAllFields/roleassignments/removeroleassignment(principalid='${principalId}')`,
|
|
52
52
|
headers: {
|
|
53
53
|
accept: 'application/json;odata=nometadata'
|
|
54
54
|
},
|
|
@@ -36,7 +36,7 @@ class SpoFileRoleInheritanceBreakCommand extends SpoCommand {
|
|
|
36
36
|
const fileURL = await this.getFileURL(args);
|
|
37
37
|
const keepExistingPermissions = !args.options.clearExistingPermissions;
|
|
38
38
|
const requestOptions = {
|
|
39
|
-
url: `${args.options.webUrl}/_api/web/
|
|
39
|
+
url: `${args.options.webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(fileURL)}')/ListItemAllFields/breakroleinheritance(${keepExistingPermissions})`,
|
|
40
40
|
headers: {
|
|
41
41
|
accept: 'application/json;odata=nometadata'
|
|
42
42
|
},
|
|
@@ -35,7 +35,7 @@ class SpoFileRoleInheritanceResetCommand extends SpoCommand {
|
|
|
35
35
|
try {
|
|
36
36
|
const fileURL = await this.getFileURL(args);
|
|
37
37
|
const requestOptions = {
|
|
38
|
-
url: `${args.options.webUrl}/_api/web/
|
|
38
|
+
url: `${args.options.webUrl}/_api/web/GetFileByServerRelativePath(DecodedUrl='${formatting.encodeQueryParameter(fileURL)}')/ListItemAllFields/resetroleinheritance`,
|
|
39
39
|
headers: {
|
|
40
40
|
accept: 'application/json;odata=nometadata'
|
|
41
41
|
},
|
|
@@ -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 _SpoFileSharingLinkAddCommand_instances, _SpoFileSharingLinkAddCommand_initTelemetry, _SpoFileSharingLinkAddCommand_initOptions, _SpoFileSharingLinkAddCommand_initValidators, _SpoFileSharingLinkAddCommand_initOptionSets;
|
|
6
|
+
var _SpoFileSharingLinkAddCommand_instances, _a, _SpoFileSharingLinkAddCommand_initTelemetry, _SpoFileSharingLinkAddCommand_initOptions, _SpoFileSharingLinkAddCommand_initValidators, _SpoFileSharingLinkAddCommand_initOptionSets;
|
|
7
7
|
import request from '../../../../request.js';
|
|
8
8
|
import { spo } from '../../../../utils/spo.js';
|
|
9
9
|
import { validation } from '../../../../utils/validation.js';
|
|
@@ -50,7 +50,7 @@ class SpoFileSharingLinkAddCommand extends SpoCommand {
|
|
|
50
50
|
}
|
|
51
51
|
}
|
|
52
52
|
}
|
|
53
|
-
_SpoFileSharingLinkAddCommand_instances = new WeakSet(), _SpoFileSharingLinkAddCommand_initTelemetry = function _SpoFileSharingLinkAddCommand_initTelemetry() {
|
|
53
|
+
_a = SpoFileSharingLinkAddCommand, _SpoFileSharingLinkAddCommand_instances = new WeakSet(), _SpoFileSharingLinkAddCommand_initTelemetry = function _SpoFileSharingLinkAddCommand_initTelemetry() {
|
|
54
54
|
this.telemetry.push((args) => {
|
|
55
55
|
Object.assign(this.telemetryProperties, {
|
|
56
56
|
fileId: typeof args.options.fileId !== 'undefined',
|
|
@@ -68,12 +68,12 @@ _SpoFileSharingLinkAddCommand_instances = new WeakSet(), _SpoFileSharingLinkAddC
|
|
|
68
68
|
option: '--fileUrl [fileUrl]'
|
|
69
69
|
}, {
|
|
70
70
|
option: '--type <type>',
|
|
71
|
-
autocomplete:
|
|
71
|
+
autocomplete: _a.types
|
|
72
72
|
}, {
|
|
73
73
|
option: '--expirationDateTime [expirationDateTime]'
|
|
74
74
|
}, {
|
|
75
75
|
option: '--scope [scope]',
|
|
76
|
-
autocomplete:
|
|
76
|
+
autocomplete: _a.scopes
|
|
77
77
|
});
|
|
78
78
|
}, _SpoFileSharingLinkAddCommand_initValidators = function _SpoFileSharingLinkAddCommand_initValidators() {
|
|
79
79
|
this.validators.push(async (args) => {
|
|
@@ -84,12 +84,12 @@ _SpoFileSharingLinkAddCommand_instances = new WeakSet(), _SpoFileSharingLinkAddC
|
|
|
84
84
|
if (args.options.fileId && !validation.isValidGuid(args.options.fileId)) {
|
|
85
85
|
return `${args.options.fileId} is not a valid GUID`;
|
|
86
86
|
}
|
|
87
|
-
if (
|
|
88
|
-
return `'${args.options.type}' is not a valid type. Allowed types are ${
|
|
87
|
+
if (_a.types.indexOf(args.options.type) < 0) {
|
|
88
|
+
return `'${args.options.type}' is not a valid type. Allowed types are ${_a.types.join(', ')}`;
|
|
89
89
|
}
|
|
90
90
|
if (args.options.scope &&
|
|
91
|
-
|
|
92
|
-
return `'${args.options.scope}' is not a valid scope. Allowed scopes are ${
|
|
91
|
+
_a.scopes.indexOf(args.options.scope) < 0) {
|
|
92
|
+
return `'${args.options.scope}' is not a valid scope. Allowed scopes are ${_a.scopes.join(', ')}`;
|
|
93
93
|
}
|
|
94
94
|
if (args.options.scope && args.options.scope !== 'anonymous' && args.options.expirationDateTime) {
|
|
95
95
|
return `Option expirationDateTime can only be used for links with scope 'anonymous'.`;
|
|
@@ -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 _SpoFileSharingLinkListCommand_instances, _SpoFileSharingLinkListCommand_initTelemetry, _SpoFileSharingLinkListCommand_initOptions, _SpoFileSharingLinkListCommand_initValidators, _SpoFileSharingLinkListCommand_initOptionSets;
|
|
6
|
+
var _SpoFileSharingLinkListCommand_instances, _a, _SpoFileSharingLinkListCommand_initTelemetry, _SpoFileSharingLinkListCommand_initOptions, _SpoFileSharingLinkListCommand_initValidators, _SpoFileSharingLinkListCommand_initOptionSets;
|
|
7
7
|
import { Cli } from '../../../../cli/Cli.js';
|
|
8
8
|
import { odata } from '../../../../utils/odata.js';
|
|
9
9
|
import { spo } from '../../../../utils/spo.js';
|
|
@@ -59,7 +59,7 @@ class SpoFileSharingLinkListCommand extends SpoCommand {
|
|
|
59
59
|
}
|
|
60
60
|
}
|
|
61
61
|
}
|
|
62
|
-
_SpoFileSharingLinkListCommand_instances = new WeakSet(), _SpoFileSharingLinkListCommand_initTelemetry = function _SpoFileSharingLinkListCommand_initTelemetry() {
|
|
62
|
+
_a = SpoFileSharingLinkListCommand, _SpoFileSharingLinkListCommand_instances = new WeakSet(), _SpoFileSharingLinkListCommand_initTelemetry = function _SpoFileSharingLinkListCommand_initTelemetry() {
|
|
63
63
|
this.telemetry.push((args) => {
|
|
64
64
|
Object.assign(this.telemetryProperties, {
|
|
65
65
|
fileId: typeof args.options.fileId !== 'undefined',
|
|
@@ -76,7 +76,7 @@ _SpoFileSharingLinkListCommand_instances = new WeakSet(), _SpoFileSharingLinkLis
|
|
|
76
76
|
option: '--fileUrl [fileUrl]'
|
|
77
77
|
}, {
|
|
78
78
|
option: '-s, --scope [scope]',
|
|
79
|
-
autocomplete:
|
|
79
|
+
autocomplete: _a.allowedScopes
|
|
80
80
|
});
|
|
81
81
|
}, _SpoFileSharingLinkListCommand_initValidators = function _SpoFileSharingLinkListCommand_initValidators() {
|
|
82
82
|
this.validators.push(async (args) => {
|
|
@@ -87,8 +87,8 @@ _SpoFileSharingLinkListCommand_instances = new WeakSet(), _SpoFileSharingLinkLis
|
|
|
87
87
|
if (args.options.fileId && !validation.isValidGuid(args.options.fileId)) {
|
|
88
88
|
return `${args.options.fileId} is not a valid GUID`;
|
|
89
89
|
}
|
|
90
|
-
if (args.options.scope &&
|
|
91
|
-
return `'${args.options.scope}' is not a valid scope. Allowed values are: ${
|
|
90
|
+
if (args.options.scope && _a.allowedScopes.indexOf(args.options.scope) === -1) {
|
|
91
|
+
return `'${args.options.scope}' is not a valid scope. Allowed values are: ${_a.allowedScopes.join(',')}`;
|
|
92
92
|
}
|
|
93
93
|
return true;
|
|
94
94
|
});
|