@pnp/cli-microsoft365 5.8.0 → 5.9.0-beta.1672f8f
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.js +2 -0
- package/dist/Auth.js +4 -4
- package/dist/Command.js +8 -8
- package/dist/api.js +3 -3
- package/dist/appInsights.js +2 -0
- package/dist/cli/Cli.js +6 -4
- package/dist/index.js +2 -2
- package/dist/m365/aad/commands/app/app-add.js +4 -3
- package/dist/m365/aad/commands/app/app-get.js +3 -3
- package/dist/m365/aad/commands/app/app-remove.js +5 -5
- package/dist/m365/aad/commands/app/app-role-list.js +2 -2
- package/dist/m365/aad/commands/app/app-role-remove.js +4 -4
- package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +4 -4
- package/dist/m365/aad/commands/approleassignment/approleassignment-list.js +3 -3
- package/dist/m365/aad/commands/approleassignment/approleassignment-remove.js +6 -6
- package/dist/m365/aad/commands/group/group-list.js +2 -2
- package/dist/m365/aad/commands/groupsetting/groupsetting-add.js +2 -2
- package/dist/m365/aad/commands/groupsetting/groupsetting-get.js +2 -2
- package/dist/m365/aad/commands/groupsetting/groupsetting-list.js +2 -2
- package/dist/m365/aad/commands/groupsetting/groupsetting-remove.js +4 -4
- package/dist/m365/aad/commands/groupsetting/groupsetting-set.js +2 -2
- package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-get.js +4 -3
- package/dist/m365/aad/commands/groupsettingtemplate/groupsettingtemplate-list.js +2 -2
- package/dist/m365/aad/commands/o365group/o365group-add.js +2 -2
- package/dist/m365/aad/commands/o365group/o365group-conversation-list.js +4 -3
- package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +4 -3
- package/dist/m365/aad/commands/o365group/o365group-get.js +2 -2
- package/dist/m365/aad/commands/o365group/o365group-list.js +2 -2
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-clear.js +4 -4
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-list.js +2 -2
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-remove.js +7 -6
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-restore.js +5 -4
- package/dist/m365/aad/commands/o365group/o365group-remove.js +4 -4
- package/dist/m365/aad/commands/o365group/o365group-renew.js +2 -2
- package/dist/m365/aad/commands/o365group/o365group-set.js +2 -2
- package/dist/m365/aad/commands/o365group/o365group-teamify.js +2 -2
- package/dist/m365/aad/commands/o365group/o365group-user-add.js +3 -3
- package/dist/m365/aad/commands/o365group/o365group-user-list.js +5 -4
- package/dist/m365/aad/commands/o365group/o365group-user-remove.js +5 -5
- package/dist/m365/aad/commands/o365group/o365group-user-set.js +6 -5
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-add.js +3 -3
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-list.js +2 -2
- package/dist/m365/aad/commands/oauth2grant/oauth2grant-remove.js +2 -2
- package/dist/m365/aad/commands/siteclassification/siteclassification-disable.js +2 -2
- package/dist/m365/aad/commands/sp/sp-add.js +3 -3
- package/dist/m365/aad/commands/sp/sp-get.js +3 -3
- package/dist/m365/aad/commands/user/user-get.js +2 -2
- package/dist/m365/aad/commands/user/user-hibp.js +2 -2
- package/dist/m365/aad/commands/user/user-list.js +2 -2
- package/dist/m365/aad/commands/user/user-set.js +2 -2
- package/dist/m365/aad/commands/user/user-signin-list.js +5 -4
- package/dist/m365/app/commands/app-get.js +2 -2
- package/dist/m365/app/commands/app-open.js +2 -2
- package/dist/m365/app/commands/permission/permission-list.js +2 -2
- package/dist/m365/base/AppCommand.js +4 -4
- package/dist/m365/booking/commands/business/business-list.js +2 -2
- package/dist/m365/cli/commands/cli-doctor.js +4 -4
- package/dist/m365/cli/commands/cli-reconsent.js +2 -2
- package/dist/m365/cli/commands/config/config-get.js +2 -2
- package/dist/m365/cli/commands/config/config-reset.js +3 -3
- package/dist/m365/cli/commands/config/config-set.js +2 -2
- package/dist/m365/commands/status.js +3 -3
- package/dist/m365/file/commands/file-add.js +3 -3
- package/dist/m365/file/commands/file-list.js +4 -3
- package/dist/m365/flow/commands/flow-export.js +2 -2
- package/dist/m365/flow/commands/flow-remove.js +4 -4
- package/dist/m365/flow/commands/run/run-cancel.js +4 -4
- package/dist/m365/flow/commands/run/run-resubmit.js +4 -4
- package/dist/m365/graph/commands/changelog/changelog-list.js +5 -4
- package/dist/m365/graph/commands/schemaextension/schemaextension-add.js +2 -2
- package/dist/m365/graph/commands/schemaextension/schemaextension-list.js +2 -2
- package/dist/m365/graph/commands/schemaextension/schemaextension-remove.js +2 -2
- package/dist/m365/graph/commands/schemaextension/schemaextension-set.js +2 -2
- package/dist/m365/graph/commands/subscription/subscription-add.js +2 -2
- package/dist/m365/onedrive/commands/onedrive-list.js +3 -3
- package/dist/m365/onenote/commands/notebook/notebook-list.js +5 -4
- package/dist/m365/outlook/commands/message/message-list.js +2 -2
- package/dist/m365/outlook/commands/room/room-list.js +2 -2
- package/dist/m365/outlook/commands/roomlist/roomlist-list.js +2 -2
- package/dist/m365/pa/commands/app/app-get.js +4 -4
- package/dist/m365/pa/commands/app/app-list.js +2 -2
- package/dist/m365/pa/commands/app/app-remove.js +4 -4
- package/dist/m365/pa/commands/connector/connector-list.js +2 -2
- package/dist/m365/pa/commands/pcf/pcf-init.js +4 -4
- package/dist/m365/pa/commands/solution/solution-init.js +2 -2
- package/dist/m365/planner/commands/bucket/bucket-add.js +4 -3
- package/dist/m365/planner/commands/bucket/bucket-get.js +4 -3
- package/dist/m365/planner/commands/bucket/bucket-list.js +6 -4
- package/dist/m365/planner/commands/bucket/bucket-remove.js +6 -5
- package/dist/m365/planner/commands/bucket/bucket-set.js +4 -3
- package/dist/m365/planner/commands/plan/plan-add.js +9 -6
- package/dist/m365/planner/commands/plan/plan-get.js +4 -3
- package/dist/m365/planner/commands/plan/plan-list.js +4 -3
- package/dist/m365/planner/commands/plan/plan-remove.js +6 -5
- package/dist/m365/planner/commands/task/task-add.js +9 -7
- package/dist/m365/planner/commands/task/task-checklistitem-list.js +2 -2
- package/dist/m365/planner/commands/task/task-checklistitem-remove.js +2 -2
- package/dist/m365/planner/commands/task/task-get.js +4 -3
- package/dist/m365/planner/commands/task/task-list.js +11 -9
- package/dist/m365/planner/commands/task/task-reference-add.js +2 -2
- package/dist/m365/planner/commands/task/task-reference-list.js +2 -2
- package/dist/m365/planner/commands/task/task-reference-remove.js +4 -4
- package/dist/m365/planner/commands/task/task-remove.js +8 -6
- package/dist/m365/planner/commands/task/task-set.js +9 -7
- package/dist/m365/planner/commands/tenant/tenant-settings-set.js +2 -2
- package/dist/m365/pp/commands/dataverse/dataverse-table-list.js +75 -0
- package/dist/m365/pp/commands/managementapp/managementapp-add.js +3 -3
- package/dist/m365/pp/commands/managementapp/managementapp-list.js +2 -2
- package/dist/m365/pp/commands/tenant/tenant-settings-list.js +45 -0
- package/dist/m365/pp/commands.js +3 -1
- package/dist/m365/search/commands/externalconnection/externalconnection-list.js +2 -2
- package/dist/m365/search/commands/externalconnection/externalconnection-remove.js +2 -2
- package/dist/m365/spfx/commands/package/package-generate.js +4 -4
- 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 +7 -7
- 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/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 +24 -23
- package/dist/m365/spfx/commands/spfx-doctor.js +15 -0
- package/dist/m365/spo/commands/app/app-add.js +4 -3
- package/dist/m365/spo/commands/app/app-deploy.js +5 -4
- package/dist/m365/spo/commands/app/app-get.js +5 -4
- package/dist/m365/spo/commands/app/app-install.js +3 -3
- package/dist/m365/spo/commands/app/app-instance-list.js +2 -2
- package/dist/m365/spo/commands/app/app-list.js +4 -3
- package/dist/m365/spo/commands/app/app-remove.js +7 -6
- package/dist/m365/spo/commands/app/app-retract.js +7 -6
- package/dist/m365/spo/commands/app/app-uninstall.js +5 -5
- package/dist/m365/spo/commands/app/app-upgrade.js +3 -3
- package/dist/m365/spo/commands/apppage/apppage-add.js +2 -2
- package/dist/m365/spo/commands/apppage/apppage-set.js +2 -2
- package/dist/m365/spo/commands/cdn/cdn-get.js +4 -4
- package/dist/m365/spo/commands/cdn/cdn-origin-add.js +6 -5
- package/dist/m365/spo/commands/cdn/cdn-origin-list.js +4 -4
- package/dist/m365/spo/commands/cdn/cdn-origin-remove.js +8 -7
- package/dist/m365/spo/commands/cdn/cdn-policy-list.js +4 -4
- package/dist/m365/spo/commands/cdn/cdn-policy-set.js +6 -5
- package/dist/m365/spo/commands/cdn/cdn-set.js +3 -3
- package/dist/m365/spo/commands/contenttype/contenttype-add.js +11 -9
- package/dist/m365/spo/commands/contenttype/contenttype-field-remove.js +11 -9
- package/dist/m365/spo/commands/contenttype/contenttype-field-set.js +8 -6
- package/dist/m365/spo/commands/contenttype/contenttype-get.js +4 -3
- package/dist/m365/spo/commands/contenttype/contenttype-list.js +2 -2
- package/dist/m365/spo/commands/contenttype/contenttype-remove.js +4 -4
- package/dist/m365/spo/commands/contenttype/contenttype-set.js +13 -11
- package/dist/m365/spo/commands/contenttypehub/contenttypehub-get.js +3 -3
- package/dist/m365/spo/commands/customaction/customaction-add.js +3 -3
- package/dist/m365/spo/commands/customaction/customaction-clear.js +4 -4
- package/dist/m365/spo/commands/customaction/customaction-get.js +3 -3
- package/dist/m365/spo/commands/customaction/customaction-list.js +2 -2
- package/dist/m365/spo/commands/customaction/customaction-remove.js +5 -5
- package/dist/m365/spo/commands/customaction/customaction-set.js +4 -4
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-get.js +9 -7
- package/dist/m365/spo/commands/eventreceiver/eventreceiver-list.js +5 -4
- package/dist/m365/spo/commands/externaluser/externaluser-list.js +8 -6
- package/dist/m365/spo/commands/feature/feature-enable.js +2 -2
- package/dist/m365/spo/commands/feature/feature-list.js +2 -2
- package/dist/m365/spo/commands/field/field-add.js +6 -4
- package/dist/m365/spo/commands/field/field-get.js +12 -10
- package/dist/m365/spo/commands/field/field-list.js +9 -7
- package/dist/m365/spo/commands/field/field-remove.js +14 -12
- package/dist/m365/spo/commands/field/field-set.js +12 -10
- package/dist/m365/spo/commands/file/file-add.js +8 -5
- package/dist/m365/spo/commands/file/file-checkin.js +3 -3
- package/dist/m365/spo/commands/file/file-checkout.js +3 -3
- package/dist/m365/spo/commands/file/file-copy.js +10 -8
- package/dist/m365/spo/commands/file/file-get.js +3 -3
- package/dist/m365/spo/commands/file/file-list.js +4 -3
- package/dist/m365/spo/commands/file/file-move.js +10 -8
- package/dist/m365/spo/commands/file/file-remove.js +5 -5
- package/dist/m365/spo/commands/file/file-rename.js +7 -6
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +180 -0
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +125 -0
- package/dist/m365/spo/commands/file/file-sharinginfo-get.js +5 -4
- package/dist/m365/spo/commands/folder/folder-add.js +4 -3
- package/dist/m365/spo/commands/folder/folder-copy.js +8 -6
- package/dist/m365/spo/commands/folder/folder-get.js +38 -7
- package/dist/m365/spo/commands/folder/folder-list.js +4 -3
- package/dist/m365/spo/commands/folder/folder-move.js +8 -6
- package/dist/m365/spo/commands/folder/folder-remove.js +6 -5
- package/dist/m365/spo/commands/folder/folder-rename.js +8 -6
- package/dist/m365/spo/commands/folder/folder-roleinheritance-reset.js +89 -0
- package/dist/m365/spo/commands/group/group-add.js +3 -3
- package/dist/m365/spo/commands/group/group-get.js +2 -2
- package/dist/m365/spo/commands/group/group-list.js +2 -2
- package/dist/m365/spo/commands/group/group-remove.js +4 -4
- package/dist/m365/spo/commands/group/group-set.js +5 -5
- package/dist/m365/spo/commands/group/group-user-add.js +4 -4
- package/dist/m365/spo/commands/group/group-user-list.js +2 -2
- package/dist/m365/spo/commands/group/group-user-remove.js +4 -4
- package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-get.js +2 -2
- package/dist/m365/spo/commands/hidedefaultthemes/hidedefaultthemes-set.js +2 -2
- package/dist/m365/spo/commands/homesite/homesite-get.js +2 -2
- package/dist/m365/spo/commands/homesite/homesite-remove.js +5 -5
- package/dist/m365/spo/commands/homesite/homesite-set.js +7 -5
- package/dist/m365/spo/commands/hubsite/hubsite-connect.js +5 -4
- package/dist/m365/spo/commands/hubsite/hubsite-data-get.js +2 -2
- package/dist/m365/spo/commands/hubsite/hubsite-disconnect.js +6 -5
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +8 -7
- package/dist/m365/spo/commands/hubsite/hubsite-list.js +2 -2
- package/dist/m365/spo/commands/hubsite/hubsite-register.js +4 -3
- package/dist/m365/spo/commands/hubsite/hubsite-rights-grant.js +8 -6
- package/dist/m365/spo/commands/hubsite/hubsite-rights-revoke.js +10 -8
- package/dist/m365/spo/commands/hubsite/hubsite-set.js +10 -8
- package/dist/m365/spo/commands/hubsite/hubsite-theme-sync.js +2 -2
- package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +6 -5
- package/dist/m365/spo/commands/knowledgehub/knowledgehub-get.js +3 -3
- package/dist/m365/spo/commands/knowledgehub/knowledgehub-remove.js +5 -5
- package/dist/m365/spo/commands/knowledgehub/knowledgehub-set.js +7 -5
- package/dist/m365/spo/commands/list/list-add.js +5 -5
- package/dist/m365/spo/commands/list/list-contenttype-add.js +6 -5
- package/dist/m365/spo/commands/list/list-contenttype-default-set.js +6 -5
- package/dist/m365/spo/commands/list/list-contenttype-list.js +6 -5
- package/dist/m365/spo/commands/list/list-contenttype-remove.js +8 -7
- package/dist/m365/spo/commands/list/list-get.js +6 -5
- package/dist/m365/spo/commands/list/list-label-get.js +8 -6
- package/dist/m365/spo/commands/list/list-label-set.js +9 -7
- package/dist/m365/spo/commands/list/list-list.js +2 -2
- package/dist/m365/spo/commands/list/list-remove.js +8 -7
- package/dist/m365/spo/commands/list/list-roleassignment-add.js +13 -11
- package/dist/m365/spo/commands/list/list-roleassignment-remove.js +13 -11
- package/dist/m365/spo/commands/list/list-roleinheritance-break.js +6 -5
- package/dist/m365/spo/commands/list/list-roleinheritance-reset.js +6 -5
- package/dist/m365/spo/commands/list/list-set.js +6 -6
- package/dist/m365/spo/commands/list/list-sitescript-get.js +8 -6
- package/dist/m365/spo/commands/list/list-view-add.js +8 -6
- package/dist/m365/spo/commands/list/list-view-field-add.js +8 -7
- package/dist/m365/spo/commands/list/list-view-field-remove.js +10 -9
- package/dist/m365/spo/commands/list/list-view-field-set.js +8 -7
- package/dist/m365/spo/commands/list/list-view-get.js +11 -9
- package/dist/m365/spo/commands/list/list-view-list.js +6 -5
- package/dist/m365/spo/commands/list/list-view-remove.js +9 -8
- package/dist/m365/spo/commands/list/list-view-set.js +10 -8
- package/dist/m365/spo/commands/list/list-webhook-add.js +6 -5
- package/dist/m365/spo/commands/list/list-webhook-get.js +7 -6
- package/dist/m365/spo/commands/list/list-webhook-list.js +10 -9
- package/dist/m365/spo/commands/list/list-webhook-remove.js +9 -8
- package/dist/m365/spo/commands/list/list-webhook-set.js +7 -6
- package/dist/m365/spo/commands/listitem/listitem-add.js +10 -7
- package/dist/m365/spo/commands/listitem/listitem-attachment-list.js +6 -5
- package/dist/m365/spo/commands/listitem/listitem-get.js +6 -5
- package/dist/m365/spo/commands/listitem/listitem-isrecord.js +9 -7
- package/dist/m365/spo/commands/listitem/listitem-list.js +9 -7
- package/dist/m365/spo/commands/listitem/listitem-record-declare.js +10 -8
- package/dist/m365/spo/commands/listitem/listitem-record-undeclare.js +9 -7
- package/dist/m365/spo/commands/listitem/listitem-remove.js +8 -7
- package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +13 -11
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +6 -5
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +6 -5
- package/dist/m365/spo/commands/listitem/listitem-set.js +8 -6
- package/dist/m365/spo/commands/mail/mail-send.js +2 -2
- package/dist/m365/spo/commands/navigation/navigation-node-add.js +2 -2
- package/dist/m365/spo/commands/navigation/navigation-node-list.js +2 -2
- package/dist/m365/spo/commands/navigation/navigation-node-remove.js +6 -5
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-add.js +6 -5
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-list.js +3 -3
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.js +5 -5
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-list.js +3 -3
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-remove.js +9 -7
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-set.js +7 -5
- package/dist/m365/spo/commands/page/Page.js +2 -2
- package/dist/m365/spo/commands/page/page-add.js +6 -4
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +3 -3
- package/dist/m365/spo/commands/page/page-column-get.js +2 -2
- package/dist/m365/spo/commands/page/page-column-list.js +2 -2
- package/dist/m365/spo/commands/page/page-control-get.js +3 -3
- package/dist/m365/spo/commands/page/page-control-list.js +2 -2
- package/dist/m365/spo/commands/page/page-control-set.js +3 -3
- package/dist/m365/spo/commands/page/page-copy.js +2 -2
- package/dist/m365/spo/commands/page/page-get.js +4 -3
- package/dist/m365/spo/commands/page/page-header-set.js +2 -2
- package/dist/m365/spo/commands/page/page-list.js +2 -2
- package/dist/m365/spo/commands/page/page-remove.js +8 -6
- package/dist/m365/spo/commands/page/page-section-add.js +2 -2
- package/dist/m365/spo/commands/page/page-section-get.js +2 -2
- package/dist/m365/spo/commands/page/page-section-list.js +2 -2
- package/dist/m365/spo/commands/page/page-set.js +6 -4
- package/dist/m365/spo/commands/page/page-template-list.js +2 -2
- package/dist/m365/spo/commands/page/page-text-add.js +6 -4
- package/dist/m365/spo/commands/propertybag/propertybag-base.js +4 -3
- package/dist/m365/spo/commands/propertybag/propertybag-get.js +5 -4
- package/dist/m365/spo/commands/propertybag/propertybag-list.js +5 -4
- package/dist/m365/spo/commands/propertybag/propertybag-remove.js +10 -8
- package/dist/m365/spo/commands/propertybag/propertybag-set.js +6 -5
- package/dist/m365/spo/commands/roledefinition/roledefinition-add.js +2 -2
- package/dist/m365/spo/commands/roledefinition/roledefinition-get.js +2 -2
- package/dist/m365/spo/commands/roledefinition/roledefinition-list.js +2 -2
- package/dist/m365/spo/commands/roledefinition/roledefinition-remove.js +4 -4
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-add.js +5 -4
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-list.js +3 -3
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-grant-revoke.js +5 -4
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-approve.js +7 -5
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-deny.js +7 -5
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-permissionrequest-list.js +3 -3
- package/dist/m365/spo/commands/serviceprincipal/serviceprincipal-set.js +5 -5
- package/dist/m365/spo/commands/site/site-add.js +18 -16
- package/dist/m365/spo/commands/site/site-appcatalog-add.js +7 -5
- package/dist/m365/spo/commands/site/site-appcatalog-remove.js +7 -5
- package/dist/m365/spo/commands/site/site-apppermission-add.js +3 -3
- package/dist/m365/spo/commands/site/site-apppermission-get.js +2 -2
- package/dist/m365/spo/commands/site/site-apppermission-list.js +2 -2
- package/dist/m365/spo/commands/site/site-apppermission-remove.js +5 -5
- package/dist/m365/spo/commands/site/site-apppermission-set.js +3 -3
- package/dist/m365/spo/commands/site/site-chrome-set.js +2 -2
- package/dist/m365/spo/commands/site/site-classic-add.js +15 -13
- package/dist/m365/spo/commands/site/site-classic-list.js +5 -4
- package/dist/m365/spo/commands/site/site-classic-set.js +14 -12
- package/dist/m365/spo/commands/site/site-commsite-enable.js +8 -6
- package/dist/m365/spo/commands/site/site-ensure.js +8 -8
- package/dist/m365/spo/commands/site/site-get.js +2 -2
- package/dist/m365/spo/commands/site/site-groupify.js +2 -2
- package/dist/m365/spo/commands/site/site-inplacerecordsmanagement-set.js +3 -3
- package/dist/m365/spo/commands/site/site-list.js +5 -4
- package/dist/m365/spo/commands/site/site-recyclebinitem-list.js +2 -2
- package/dist/m365/spo/commands/site/site-recyclebinitem-restore.js +6 -5
- package/dist/m365/spo/commands/site/site-remove.js +18 -16
- package/dist/m365/spo/commands/site/site-rename.js +3 -3
- package/dist/m365/spo/commands/site/site-set.js +24 -21
- package/dist/m365/spo/commands/sitedesign/sitedesign-add.js +5 -4
- package/dist/m365/spo/commands/sitedesign/sitedesign-apply.js +5 -4
- package/dist/m365/spo/commands/sitedesign/sitedesign-get.js +4 -3
- package/dist/m365/spo/commands/sitedesign/sitedesign-list.js +2 -2
- package/dist/m365/spo/commands/sitedesign/sitedesign-remove.js +7 -6
- package/dist/m365/spo/commands/sitedesign/sitedesign-rights-grant.js +5 -4
- package/dist/m365/spo/commands/sitedesign/sitedesign-rights-list.js +5 -4
- package/dist/m365/spo/commands/sitedesign/sitedesign-rights-revoke.js +7 -6
- package/dist/m365/spo/commands/sitedesign/sitedesign-run-list.js +3 -3
- package/dist/m365/spo/commands/sitedesign/sitedesign-run-status-get.js +3 -3
- package/dist/m365/spo/commands/sitedesign/sitedesign-set.js +5 -4
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-get.js +4 -3
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-list.js +2 -2
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-remove.js +6 -5
- package/dist/m365/spo/commands/sitescript/sitescript-add.js +3 -3
- package/dist/m365/spo/commands/sitescript/sitescript-get.js +5 -4
- package/dist/m365/spo/commands/sitescript/sitescript-list.js +3 -3
- package/dist/m365/spo/commands/sitescript/sitescript-remove.js +7 -6
- package/dist/m365/spo/commands/sitescript/sitescript-set.js +5 -4
- package/dist/m365/spo/commands/spo-search.js +5 -4
- package/dist/m365/spo/commands/spo-set.js +2 -2
- package/dist/m365/spo/commands/storageentity/storageentity-get.js +2 -2
- package/dist/m365/spo/commands/storageentity/storageentity-list.js +2 -2
- package/dist/m365/spo/commands/storageentity/storageentity-remove.js +9 -7
- package/dist/m365/spo/commands/storageentity/storageentity-set.js +7 -5
- package/dist/m365/spo/commands/tenant/tenant-appcatalog-add.js +7 -7
- package/dist/m365/spo/commands/tenant/tenant-appcatalogurl-get.js +2 -2
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-list.js +3 -3
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-remove.js +10 -8
- package/dist/m365/spo/commands/tenant/tenant-recyclebinitem-restore.js +4 -3
- package/dist/m365/spo/commands/tenant/tenant-settings-list.js +3 -3
- package/dist/m365/spo/commands/tenant/tenant-settings-set.js +6 -5
- package/dist/m365/spo/commands/term/term-add.js +15 -13
- package/dist/m365/spo/commands/term/term-get.js +11 -9
- package/dist/m365/spo/commands/term/term-group-add.js +8 -6
- package/dist/m365/spo/commands/term/term-group-get.js +7 -5
- package/dist/m365/spo/commands/term/term-group-list.js +3 -3
- package/dist/m365/spo/commands/term/term-list.js +9 -7
- package/dist/m365/spo/commands/term/term-set-add.js +11 -9
- package/dist/m365/spo/commands/term/term-set-get.js +9 -7
- package/dist/m365/spo/commands/term/term-set-list.js +7 -5
- package/dist/m365/spo/commands/theme/theme-apply.js +7 -5
- package/dist/m365/spo/commands/theme/theme-get.js +5 -4
- package/dist/m365/spo/commands/theme/theme-list.js +2 -2
- package/dist/m365/spo/commands/theme/theme-remove.js +4 -4
- package/dist/m365/spo/commands/theme/theme-set.js +7 -5
- package/dist/m365/spo/commands/user/user-get.js +2 -2
- package/dist/m365/spo/commands/user/user-list.js +2 -2
- package/dist/m365/spo/commands/user/user-remove.js +4 -4
- package/dist/m365/spo/commands/userprofile/userprofile-get.js +4 -3
- package/dist/m365/spo/commands/userprofile/userprofile-set.js +3 -3
- package/dist/m365/spo/commands/web/web-add.js +5 -4
- package/dist/m365/spo/commands/web/web-clientsidewebpart-list.js +2 -2
- package/dist/m365/spo/commands/web/web-get.js +2 -2
- package/dist/m365/spo/commands/web/web-installedlanguage-list.js +2 -2
- package/dist/m365/spo/commands/web/web-list.js +2 -2
- package/dist/m365/spo/commands/web/web-reindex.js +6 -5
- package/dist/m365/spo/commands/web/web-remove.js +4 -4
- package/dist/m365/spo/commands/web/web-roleassignment-add.js +6 -6
- package/dist/m365/spo/commands/web/web-roleassignment-remove.js +6 -6
- package/dist/m365/spo/commands/web/web-roleinheritance-reset.js +2 -2
- package/dist/m365/spo/commands/web/web-set.js +2 -2
- package/dist/m365/spo/commands.js +3 -0
- package/dist/m365/teams/commands/app/app-install.js +6 -6
- package/dist/m365/teams/commands/app/app-list.js +4 -3
- package/dist/m365/teams/commands/app/app-remove.js +4 -4
- package/dist/m365/teams/commands/app/app-uninstall.js +4 -4
- package/dist/m365/teams/commands/app/app-update.js +2 -2
- package/dist/m365/teams/commands/cache/cache-remove.js +2 -2
- package/dist/m365/teams/commands/channel/channel-add.js +2 -2
- package/dist/m365/teams/commands/channel/channel-get.js +3 -3
- package/dist/m365/teams/commands/channel/channel-list.js +7 -6
- package/dist/m365/teams/commands/channel/channel-member-add.js +3 -3
- package/dist/m365/teams/commands/channel/channel-member-list.js +5 -4
- package/dist/m365/teams/commands/channel/channel-member-remove.js +6 -6
- package/dist/m365/teams/commands/channel/channel-member-set.js +4 -4
- package/dist/m365/teams/commands/channel/channel-remove.js +5 -5
- package/dist/m365/teams/commands/channel/channel-set.js +2 -2
- package/dist/m365/teams/commands/chat/chat-list.js +2 -2
- package/dist/m365/teams/commands/chat/chat-member-list.js +4 -3
- package/dist/m365/teams/commands/chat/chat-message-list.js +4 -3
- package/dist/m365/teams/commands/chat/chat-message-send.js +5 -4
- package/dist/m365/teams/commands/funsettings/funsettings-list.js +2 -2
- package/dist/m365/teams/commands/funsettings/funsettings-set.js +2 -2
- package/dist/m365/teams/commands/guestsettings/guestsettings-list.js +2 -2
- package/dist/m365/teams/commands/guestsettings/guestsettings-set.js +2 -2
- package/dist/m365/teams/commands/membersettings/membersettings-list.js +2 -2
- package/dist/m365/teams/commands/membersettings/membersettings-set.js +2 -2
- package/dist/m365/teams/commands/message/message-get.js +3 -3
- package/dist/m365/teams/commands/message/message-list.js +7 -6
- package/dist/m365/teams/commands/message/message-reply-list.js +5 -4
- package/dist/m365/teams/commands/messagingsettings/messagingsettings-list.js +2 -2
- package/dist/m365/teams/commands/messagingsettings/messagingsettings-set.js +3 -3
- package/dist/m365/teams/commands/report/report-directroutingcalls.js +3 -3
- package/dist/m365/teams/commands/report/report-pstncalls.js +3 -3
- package/dist/m365/teams/commands/tab/tab-add.js +3 -3
- package/dist/m365/teams/commands/tab/tab-get.js +4 -4
- package/dist/m365/teams/commands/tab/tab-list.js +5 -4
- package/dist/m365/teams/commands/tab/tab-remove.js +6 -6
- package/dist/m365/teams/commands/team/team-archive.js +3 -3
- package/dist/m365/teams/commands/team/team-clone.js +3 -3
- package/dist/m365/teams/commands/team/team-get.js +2 -2
- package/dist/m365/teams/commands/team/team-list.js +2 -2
- package/dist/m365/teams/commands/team/team-remove.js +5 -5
- package/dist/m365/teams/commands/team/team-set.js +3 -3
- package/dist/m365/teams/commands/team/team-unarchive.js +3 -3
- package/dist/m365/teams/commands/user/user-app-add.js +3 -3
- package/dist/m365/teams/commands/user/user-app-list.js +5 -4
- package/dist/m365/teams/commands/user/user-app-remove.js +4 -4
- package/dist/m365/teams/commands/user/user-list.js +5 -4
- package/dist/m365/tenant/commands/id/id-get.js +2 -2
- package/dist/m365/tenant/commands/report/report-office365activationcounts.js +2 -2
- package/dist/m365/tenant/commands/report/report-office365activationsusercounts.js +2 -2
- package/dist/m365/tenant/commands/report/report-office365activationsuserdetail.js +2 -2
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-healthissue-list.js +2 -2
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-message-list.js +2 -2
- package/dist/m365/todo/commands/list/list-list.js +2 -2
- package/dist/m365/todo/commands/list/list-remove.js +2 -2
- package/dist/m365/todo/commands/task/task-list.js +2 -2
- package/dist/m365/todo/commands/task/task-remove.js +2 -2
- package/dist/m365/viva/commands/connections/connections-app-create.js +2 -2
- package/dist/m365/yammer/commands/group/group-user-remove.js +2 -2
- package/dist/m365/yammer/commands/message/message-like-set.js +2 -2
- package/dist/m365/yammer/commands/message/message-remove.js +2 -2
- package/dist/request.js +4 -4
- package/dist/utils/cache.js +81 -0
- package/dist/utils/pid.js +57 -0
- package/dist/utils/powerPlatform.js +42 -0
- package/dist/utils/spo.js +7 -6
- package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-restore.md +1 -1
- 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/planner/task/task-checklistitem-list.md +1 -1
- package/docs/docs/cmd/planner/task/task-reference-add.md +1 -1
- package/docs/docs/cmd/pp/dataverse/dataverse-table-list.md +33 -0
- package/docs/docs/cmd/pp/tenant/tenant-settings-list.md +26 -0
- package/docs/docs/cmd/search/externalconnection/externalconnection-remove.md +1 -1
- package/docs/docs/cmd/spo/file/file-roleassignment-remove.md +54 -0
- 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/hubsite/hubsite-disconnect.md +1 -1
- package/docs/docs/cmd/spo/hubsite/hubsite-get.md +3 -3
- 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/listitem/listitem-roleassignment-remove.md +1 -1
- package/docs/docs/cmd/spo/roledefinition/roledefinition-add.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 +1 -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-set.md +1 -1
- 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 +344 -359
- package/package.json +22 -19
- package/dist/cli/index.js +0 -21
- package/dist/utils/index.js +0 -31
|
@@ -16,7 +16,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _SpoFileCheckoutCommand_instances, _SpoFileCheckoutCommand_initTelemetry, _SpoFileCheckoutCommand_initOptions, _SpoFileCheckoutCommand_initValidators, _SpoFileCheckoutCommand_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 SpoCommand_1 = require("../../../base/SpoCommand");
|
|
21
21
|
const commands_1 = require("../../commands");
|
|
22
22
|
class SpoFileCheckoutCommand extends SpoCommand_1.default {
|
|
@@ -76,12 +76,12 @@ _SpoFileCheckoutCommand_instances = new WeakSet(), _SpoFileCheckoutCommand_initT
|
|
|
76
76
|
});
|
|
77
77
|
}, _SpoFileCheckoutCommand_initValidators = function _SpoFileCheckoutCommand_initValidators() {
|
|
78
78
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
79
|
-
const isValidSharePointUrl =
|
|
79
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
80
80
|
if (isValidSharePointUrl !== true) {
|
|
81
81
|
return isValidSharePointUrl;
|
|
82
82
|
}
|
|
83
83
|
if (args.options.id) {
|
|
84
|
-
if (!
|
|
84
|
+
if (!validation_1.validation.isValidGuid(args.options.id)) {
|
|
85
85
|
return `${args.options.id} is not a valid GUID`;
|
|
86
86
|
}
|
|
87
87
|
}
|
|
@@ -17,7 +17,9 @@ var _SpoFileCopyCommand_instances, _SpoFileCopyCommand_initTelemetry, _SpoFileCo
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const url = require("url");
|
|
19
19
|
const request_1 = require("../../../../request");
|
|
20
|
-
const
|
|
20
|
+
const spo_1 = require("../../../../utils/spo");
|
|
21
|
+
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
22
|
+
const validation_1 = require("../../../../utils/validation");
|
|
21
23
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
22
24
|
const commands_1 = require("../../commands");
|
|
23
25
|
class SpoFileCopyCommand extends SpoCommand_1.default {
|
|
@@ -57,9 +59,9 @@ class SpoFileCopyCommand extends SpoCommand_1.default {
|
|
|
57
59
|
yield this.recycleFile(tenantUrl, args.options.targetUrl, filename, logger);
|
|
58
60
|
}
|
|
59
61
|
// all preconditions met, now create copy job
|
|
60
|
-
const sourceAbsoluteUrl =
|
|
62
|
+
const sourceAbsoluteUrl = urlUtil_1.urlUtil.urlCombine(webUrl, args.options.sourceUrl);
|
|
61
63
|
const allowSchemaMismatch = args.options.allowSchemaMismatch || false;
|
|
62
|
-
const requestUrl =
|
|
64
|
+
const requestUrl = urlUtil_1.urlUtil.urlCombine(webUrl, '/_api/site/CreateCopyJobs');
|
|
63
65
|
const requestOptions = {
|
|
64
66
|
url: requestUrl,
|
|
65
67
|
headers: {
|
|
@@ -67,7 +69,7 @@ class SpoFileCopyCommand extends SpoCommand_1.default {
|
|
|
67
69
|
},
|
|
68
70
|
data: {
|
|
69
71
|
exportObjectUris: [sourceAbsoluteUrl],
|
|
70
|
-
destinationUri:
|
|
72
|
+
destinationUri: urlUtil_1.urlUtil.urlCombine(tenantUrl, args.options.targetUrl),
|
|
71
73
|
options: {
|
|
72
74
|
"AllowSchemaMismatch": allowSchemaMismatch,
|
|
73
75
|
"IgnoreVersionHistory": true
|
|
@@ -81,7 +83,7 @@ class SpoFileCopyCommand extends SpoCommand_1.default {
|
|
|
81
83
|
const copyJobInfo = jobInfo.value[0];
|
|
82
84
|
const progressPollInterval = 30 * 60; //used previously implemented interval. The API does not provide guidance on what value should be used.
|
|
83
85
|
setTimeout(() => {
|
|
84
|
-
|
|
86
|
+
spo_1.spo.waitUntilCopyJobFinished({
|
|
85
87
|
copyJobInfo,
|
|
86
88
|
siteUrl: webUrl,
|
|
87
89
|
pollingInterval: progressPollInterval,
|
|
@@ -122,11 +124,11 @@ class SpoFileCopyCommand extends SpoCommand_1.default {
|
|
|
122
124
|
*/
|
|
123
125
|
recycleFile(tenantUrl, targetUrl, filename, logger) {
|
|
124
126
|
return new Promise((resolve, reject) => {
|
|
125
|
-
const targetFolderAbsoluteUrl =
|
|
127
|
+
const targetFolderAbsoluteUrl = urlUtil_1.urlUtil.urlCombine(tenantUrl, targetUrl);
|
|
126
128
|
// since the target WebFullUrl is unknown we can use getRequestDigestForSite
|
|
127
129
|
// to get it from target folder absolute url.
|
|
128
130
|
// Similar approach used here Microsoft.SharePoint.Client.Web.WebUrlFromFolderUrlDirect
|
|
129
|
-
|
|
131
|
+
spo_1.spo
|
|
130
132
|
.getRequestDigest(targetFolderAbsoluteUrl)
|
|
131
133
|
.then((contextResponse) => {
|
|
132
134
|
if (this.debug) {
|
|
@@ -188,7 +190,7 @@ _SpoFileCopyCommand_instances = new WeakSet(), _SpoFileCopyCommand_initTelemetry
|
|
|
188
190
|
option: '--allowSchemaMismatch'
|
|
189
191
|
});
|
|
190
192
|
}, _SpoFileCopyCommand_initValidators = function _SpoFileCopyCommand_initValidators() {
|
|
191
|
-
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return
|
|
193
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return validation_1.validation.isValidSharePointUrl(args.options.webUrl); }));
|
|
192
194
|
};
|
|
193
195
|
module.exports = new SpoFileCopyCommand();
|
|
194
196
|
//# sourceMappingURL=file-copy.js.map
|
|
@@ -18,7 +18,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
18
18
|
const fs = require("fs");
|
|
19
19
|
const path = require("path");
|
|
20
20
|
const request_1 = require("../../../../request");
|
|
21
|
-
const
|
|
21
|
+
const validation_1 = require("../../../../utils/validation");
|
|
22
22
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
23
23
|
const commands_1 = require("../../commands");
|
|
24
24
|
class SpoFileGetCommand extends SpoCommand_1.default {
|
|
@@ -140,12 +140,12 @@ _SpoFileGetCommand_instances = new WeakSet(), _SpoFileGetCommand_initTelemetry =
|
|
|
140
140
|
});
|
|
141
141
|
}, _SpoFileGetCommand_initValidators = function _SpoFileGetCommand_initValidators() {
|
|
142
142
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
143
|
-
const isValidSharePointUrl =
|
|
143
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
144
144
|
if (isValidSharePointUrl !== true) {
|
|
145
145
|
return isValidSharePointUrl;
|
|
146
146
|
}
|
|
147
147
|
if (args.options.id) {
|
|
148
|
-
if (!
|
|
148
|
+
if (!validation_1.validation.isValidGuid(args.options.id)) {
|
|
149
149
|
return `${args.options.id} is not a valid GUID`;
|
|
150
150
|
}
|
|
151
151
|
}
|
|
@@ -16,7 +16,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _SpoFileListCommand_instances, _SpoFileListCommand_initTelemetry, _SpoFileListCommand_initOptions, _SpoFileListCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
|
-
const
|
|
19
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
20
|
+
const validation_1 = require("../../../../utils/validation");
|
|
20
21
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
21
22
|
const commands_1 = require("../../commands");
|
|
22
23
|
class SpoFileListCommand extends SpoCommand_1.default {
|
|
@@ -51,7 +52,7 @@ class SpoFileListCommand extends SpoCommand_1.default {
|
|
|
51
52
|
getFiles(folderUrl, args, files = { value: [] }) {
|
|
52
53
|
// If --recursive option is specified, retrieve both Files and Folder details, otherwise only Files.
|
|
53
54
|
const expandParameters = args.options.recursive ? 'Files,Folders' : 'Files';
|
|
54
|
-
let requestUrl = `${args.options.webUrl}/_api/web/GetFolderByServerRelativeUrl('${
|
|
55
|
+
let requestUrl = `${args.options.webUrl}/_api/web/GetFolderByServerRelativeUrl('${formatting_1.formatting.encodeQueryParameter(folderUrl)}')?$expand=${expandParameters}`;
|
|
55
56
|
if (args.options.output !== 'json') {
|
|
56
57
|
requestUrl += '&$select=Files/UniqueId,Files/Name,Files/ServerRelativeUrl';
|
|
57
58
|
}
|
|
@@ -94,7 +95,7 @@ _SpoFileListCommand_instances = new WeakSet(), _SpoFileListCommand_initTelemetry
|
|
|
94
95
|
option: '-r, --recursive'
|
|
95
96
|
});
|
|
96
97
|
}, _SpoFileListCommand_initValidators = function _SpoFileListCommand_initValidators() {
|
|
97
|
-
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return
|
|
98
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return validation_1.validation.isValidSharePointUrl(args.options.webUrl); }));
|
|
98
99
|
};
|
|
99
100
|
module.exports = new SpoFileListCommand();
|
|
100
101
|
//# sourceMappingURL=file-list.js.map
|
|
@@ -17,7 +17,9 @@ var _SpoFileMoveCommand_instances, _SpoFileMoveCommand_initTelemetry, _SpoFileMo
|
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const url = require("url");
|
|
19
19
|
const request_1 = require("../../../../request");
|
|
20
|
-
const
|
|
20
|
+
const spo_1 = require("../../../../utils/spo");
|
|
21
|
+
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
22
|
+
const validation_1 = require("../../../../utils/validation");
|
|
21
23
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
22
24
|
const commands_1 = require("../../commands");
|
|
23
25
|
class SpoFileMoveCommand extends SpoCommand_1.default {
|
|
@@ -57,9 +59,9 @@ class SpoFileMoveCommand extends SpoCommand_1.default {
|
|
|
57
59
|
yield this.recycleFile(tenantUrl, args.options.targetUrl, filename, logger);
|
|
58
60
|
}
|
|
59
61
|
// all preconditions met, now create copy job
|
|
60
|
-
const sourceAbsoluteUrl =
|
|
62
|
+
const sourceAbsoluteUrl = urlUtil_1.urlUtil.urlCombine(webUrl, args.options.sourceUrl);
|
|
61
63
|
const allowSchemaMismatch = args.options.allowSchemaMismatch || false;
|
|
62
|
-
const requestUrl =
|
|
64
|
+
const requestUrl = urlUtil_1.urlUtil.urlCombine(webUrl, '/_api/site/CreateCopyJobs');
|
|
63
65
|
const requestOptions = {
|
|
64
66
|
url: requestUrl,
|
|
65
67
|
headers: {
|
|
@@ -67,7 +69,7 @@ class SpoFileMoveCommand extends SpoCommand_1.default {
|
|
|
67
69
|
},
|
|
68
70
|
data: {
|
|
69
71
|
exportObjectUris: [sourceAbsoluteUrl],
|
|
70
|
-
destinationUri:
|
|
72
|
+
destinationUri: urlUtil_1.urlUtil.urlCombine(tenantUrl, args.options.targetUrl),
|
|
71
73
|
options: {
|
|
72
74
|
"AllowSchemaMismatch": allowSchemaMismatch,
|
|
73
75
|
"IgnoreVersionHistory": true,
|
|
@@ -82,7 +84,7 @@ class SpoFileMoveCommand extends SpoCommand_1.default {
|
|
|
82
84
|
const progressPollInterval = 1800; // 30 * 60; //used previously implemented interval. The API does not provide guidance on what value should be used.
|
|
83
85
|
yield new Promise((resolve, reject) => {
|
|
84
86
|
setTimeout(() => {
|
|
85
|
-
|
|
87
|
+
spo_1.spo.waitUntilCopyJobFinished({
|
|
86
88
|
copyJobInfo,
|
|
87
89
|
siteUrl: webUrl,
|
|
88
90
|
pollingInterval: progressPollInterval,
|
|
@@ -123,11 +125,11 @@ class SpoFileMoveCommand extends SpoCommand_1.default {
|
|
|
123
125
|
*/
|
|
124
126
|
recycleFile(tenantUrl, targetUrl, filename, logger) {
|
|
125
127
|
return new Promise((resolve, reject) => {
|
|
126
|
-
const targetFolderAbsoluteUrl =
|
|
128
|
+
const targetFolderAbsoluteUrl = urlUtil_1.urlUtil.urlCombine(tenantUrl, targetUrl);
|
|
127
129
|
// since the target WebFullUrl is unknown we can use getRequestDigest
|
|
128
130
|
// to get it from target folder absolute url.
|
|
129
131
|
// Similar approach used here Microsoft.SharePoint.Client.Web.WebUrlFromFolderUrlDirect
|
|
130
|
-
|
|
132
|
+
spo_1.spo.getRequestDigest(targetFolderAbsoluteUrl)
|
|
131
133
|
.then((contextResponse) => {
|
|
132
134
|
if (this.debug) {
|
|
133
135
|
logger.logToStderr(`contextResponse.WebFullUrl: ${contextResponse.WebFullUrl}`);
|
|
@@ -188,7 +190,7 @@ _SpoFileMoveCommand_instances = new WeakSet(), _SpoFileMoveCommand_initTelemetry
|
|
|
188
190
|
option: '--allowSchemaMismatch'
|
|
189
191
|
});
|
|
190
192
|
}, _SpoFileMoveCommand_initValidators = function _SpoFileMoveCommand_initValidators() {
|
|
191
|
-
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return
|
|
193
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return validation_1.validation.isValidSharePointUrl(args.options.webUrl); }));
|
|
192
194
|
};
|
|
193
195
|
module.exports = new SpoFileMoveCommand();
|
|
194
196
|
//# sourceMappingURL=file-move.js.map
|
|
@@ -15,9 +15,9 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoFileRemoveCommand_instances, _SpoFileRemoveCommand_initTelemetry, _SpoFileRemoveCommand_initOptions, _SpoFileRemoveCommand_initValidators, _SpoFileRemoveCommand_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 SpoCommand_1 = require("../../../base/SpoCommand");
|
|
22
22
|
const commands_1 = require("../../commands");
|
|
23
23
|
class SpoFileRemoveCommand extends SpoCommand_1.default {
|
|
@@ -86,7 +86,7 @@ class SpoFileRemoveCommand extends SpoCommand_1.default {
|
|
|
86
86
|
yield removeFile();
|
|
87
87
|
}
|
|
88
88
|
else {
|
|
89
|
-
const result = yield
|
|
89
|
+
const result = yield Cli_1.Cli.prompt({
|
|
90
90
|
type: 'confirm',
|
|
91
91
|
name: 'continue',
|
|
92
92
|
default: false,
|
|
@@ -122,12 +122,12 @@ _SpoFileRemoveCommand_instances = new WeakSet(), _SpoFileRemoveCommand_initTelem
|
|
|
122
122
|
});
|
|
123
123
|
}, _SpoFileRemoveCommand_initValidators = function _SpoFileRemoveCommand_initValidators() {
|
|
124
124
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
125
|
-
const isValidSharePointUrl =
|
|
125
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
126
126
|
if (isValidSharePointUrl !== true) {
|
|
127
127
|
return isValidSharePointUrl;
|
|
128
128
|
}
|
|
129
129
|
if (args.options.id &&
|
|
130
|
-
!
|
|
130
|
+
!validation_1.validation.isValidGuid(args.options.id)) {
|
|
131
131
|
return `${args.options.id} is not a valid GUID`;
|
|
132
132
|
}
|
|
133
133
|
return true;
|
|
@@ -15,9 +15,10 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
15
15
|
};
|
|
16
16
|
var _SpoFileRenameCommand_instances, _SpoFileRenameCommand_initTelemetry, _SpoFileRenameCommand_initOptions, _SpoFileRenameCommand_initValidators;
|
|
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 urlUtil_1 = require("../../../../utils/urlUtil");
|
|
21
|
+
const validation_1 = require("../../../../utils/validation");
|
|
21
22
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
22
23
|
const commands_1 = require("../../commands");
|
|
23
24
|
const removeCommand = require('./file-remove');
|
|
@@ -38,7 +39,7 @@ class SpoFileRenameCommand extends SpoCommand_1.default {
|
|
|
38
39
|
commandAction(logger, args) {
|
|
39
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
40
41
|
const webUrl = args.options.webUrl;
|
|
41
|
-
const originalFileServerRelativeUrl =
|
|
42
|
+
const originalFileServerRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, args.options.sourceUrl);
|
|
42
43
|
try {
|
|
43
44
|
yield this.getFile(originalFileServerRelativeUrl, webUrl);
|
|
44
45
|
if (args.options.force) {
|
|
@@ -78,7 +79,7 @@ class SpoFileRenameCommand extends SpoCommand_1.default {
|
|
|
78
79
|
return request_1.default.get(requestOptions);
|
|
79
80
|
}
|
|
80
81
|
deleteFile(webUrl, sourceUrl, targetFileName) {
|
|
81
|
-
const targetFileServerRelativeUrl = `${
|
|
82
|
+
const targetFileServerRelativeUrl = `${urlUtil_1.urlUtil.getServerRelativePath(webUrl, sourceUrl.substring(0, sourceUrl.lastIndexOf('/')))}/${targetFileName}`;
|
|
82
83
|
const options = {
|
|
83
84
|
webUrl: webUrl,
|
|
84
85
|
url: targetFileServerRelativeUrl,
|
|
@@ -87,7 +88,7 @@ class SpoFileRenameCommand extends SpoCommand_1.default {
|
|
|
87
88
|
debug: this.debug,
|
|
88
89
|
verbose: this.verbose
|
|
89
90
|
};
|
|
90
|
-
return
|
|
91
|
+
return Cli_1.Cli.executeCommandWithOutput(removeCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) })
|
|
91
92
|
.then(_ => {
|
|
92
93
|
return Promise.resolve();
|
|
93
94
|
}, (err) => {
|
|
@@ -115,7 +116,7 @@ _SpoFileRenameCommand_instances = new WeakSet(), _SpoFileRenameCommand_initTelem
|
|
|
115
116
|
option: '--force'
|
|
116
117
|
});
|
|
117
118
|
}, _SpoFileRenameCommand_initValidators = function _SpoFileRenameCommand_initValidators() {
|
|
118
|
-
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return
|
|
119
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () { return validation_1.validation.isValidSharePointUrl(args.options.webUrl); }));
|
|
119
120
|
};
|
|
120
121
|
module.exports = new SpoFileRenameCommand();
|
|
121
122
|
//# sourceMappingURL=file-rename.js.map
|
|
@@ -0,0 +1,180 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13
|
+
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");
|
|
14
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
|
+
};
|
|
16
|
+
var _SpoFileRoleAssignmentRemoveCommand_instances, _SpoFileRoleAssignmentRemoveCommand_initTelemetry, _SpoFileRoleAssignmentRemoveCommand_initOptions, _SpoFileRoleAssignmentRemoveCommand_initValidators, _SpoFileRoleAssignmentRemoveCommand_initOptionSets;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
19
|
+
const request_1 = require("../../../../request");
|
|
20
|
+
const urlUtil_1 = require("../../../../utils/urlUtil");
|
|
21
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
22
|
+
const validation_1 = require("../../../../utils/validation");
|
|
23
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
24
|
+
const commands_1 = require("../../commands");
|
|
25
|
+
const SpoFileGetCommand = require("./file-get");
|
|
26
|
+
const SpoUserGetCommand = require("../user/user-get");
|
|
27
|
+
const SpoGroupGetCommand = require("../group/group-get");
|
|
28
|
+
class SpoFileRoleAssignmentRemoveCommand extends SpoCommand_1.default {
|
|
29
|
+
constructor() {
|
|
30
|
+
super();
|
|
31
|
+
_SpoFileRoleAssignmentRemoveCommand_instances.add(this);
|
|
32
|
+
__classPrivateFieldGet(this, _SpoFileRoleAssignmentRemoveCommand_instances, "m", _SpoFileRoleAssignmentRemoveCommand_initTelemetry).call(this);
|
|
33
|
+
__classPrivateFieldGet(this, _SpoFileRoleAssignmentRemoveCommand_instances, "m", _SpoFileRoleAssignmentRemoveCommand_initOptions).call(this);
|
|
34
|
+
__classPrivateFieldGet(this, _SpoFileRoleAssignmentRemoveCommand_instances, "m", _SpoFileRoleAssignmentRemoveCommand_initValidators).call(this);
|
|
35
|
+
__classPrivateFieldGet(this, _SpoFileRoleAssignmentRemoveCommand_instances, "m", _SpoFileRoleAssignmentRemoveCommand_initOptionSets).call(this);
|
|
36
|
+
}
|
|
37
|
+
get name() {
|
|
38
|
+
return commands_1.default.FILE_ROLEASSIGNMENT_REMOVE;
|
|
39
|
+
}
|
|
40
|
+
get description() {
|
|
41
|
+
return 'Removes a role assignment from a file.';
|
|
42
|
+
}
|
|
43
|
+
commandAction(logger, args) {
|
|
44
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
45
|
+
const removeRoleAssignment = () => __awaiter(this, void 0, void 0, function* () {
|
|
46
|
+
try {
|
|
47
|
+
const fileURL = yield this.getFileURL(args);
|
|
48
|
+
let principalId;
|
|
49
|
+
if (args.options.groupName) {
|
|
50
|
+
principalId = yield this.getGroupPrincipalId(args.options);
|
|
51
|
+
}
|
|
52
|
+
else if (args.options.upn) {
|
|
53
|
+
principalId = yield this.getUserPrincipalId(args.options);
|
|
54
|
+
}
|
|
55
|
+
else {
|
|
56
|
+
principalId = args.options.principalId;
|
|
57
|
+
}
|
|
58
|
+
const serverRelativeUrl = urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, fileURL);
|
|
59
|
+
const requestOptions = {
|
|
60
|
+
url: `${args.options.webUrl}/_api/web/GetFileByServerRelativeUrl('${formatting_1.formatting.encodeQueryParameter(serverRelativeUrl)}')/ListItemAllFields/roleassignments/removeroleassignment(principalid='${principalId}')`,
|
|
61
|
+
headers: {
|
|
62
|
+
accept: 'application/json;odata=nometadata'
|
|
63
|
+
},
|
|
64
|
+
responseType: 'json'
|
|
65
|
+
};
|
|
66
|
+
yield request_1.default.post(requestOptions);
|
|
67
|
+
}
|
|
68
|
+
catch (err) {
|
|
69
|
+
this.handleRejectedODataJsonPromise(err);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
|
+
if (args.options.confirm) {
|
|
73
|
+
yield removeRoleAssignment();
|
|
74
|
+
}
|
|
75
|
+
else {
|
|
76
|
+
const result = yield Cli_1.Cli.prompt({
|
|
77
|
+
type: 'confirm',
|
|
78
|
+
name: 'continue',
|
|
79
|
+
default: false,
|
|
80
|
+
message: `Are you sure you want to remove role assignment from file ${args.options.fileUrl || args.options.fileId} from site ${args.options.webUrl}?`
|
|
81
|
+
});
|
|
82
|
+
if (result.continue) {
|
|
83
|
+
yield removeRoleAssignment();
|
|
84
|
+
}
|
|
85
|
+
}
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
getFileURL(args) {
|
|
89
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
90
|
+
if (args.options.fileUrl) {
|
|
91
|
+
return args.options.fileUrl;
|
|
92
|
+
}
|
|
93
|
+
const options = {
|
|
94
|
+
webUrl: args.options.webUrl,
|
|
95
|
+
id: args.options.fileId,
|
|
96
|
+
output: 'json',
|
|
97
|
+
debug: this.debug,
|
|
98
|
+
verbose: this.verbose
|
|
99
|
+
};
|
|
100
|
+
const output = yield Cli_1.Cli.executeCommandWithOutput(SpoFileGetCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) });
|
|
101
|
+
const getFileOutput = JSON.parse(output.stdout);
|
|
102
|
+
return getFileOutput.ServerRelativeUrl;
|
|
103
|
+
});
|
|
104
|
+
}
|
|
105
|
+
getUserPrincipalId(options) {
|
|
106
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
107
|
+
const userGetCommandOptions = {
|
|
108
|
+
webUrl: options.webUrl,
|
|
109
|
+
email: options.upn,
|
|
110
|
+
id: undefined,
|
|
111
|
+
output: 'json',
|
|
112
|
+
debug: this.debug,
|
|
113
|
+
verbose: this.verbose
|
|
114
|
+
};
|
|
115
|
+
const output = yield Cli_1.Cli.executeCommandWithOutput(SpoUserGetCommand, { options: Object.assign(Object.assign({}, userGetCommandOptions), { _: [] }) });
|
|
116
|
+
const getUserOutput = JSON.parse(output.stdout);
|
|
117
|
+
return getUserOutput.Id;
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
getGroupPrincipalId(options) {
|
|
121
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
122
|
+
const groupGetCommandOptions = {
|
|
123
|
+
webUrl: options.webUrl,
|
|
124
|
+
name: options.groupName,
|
|
125
|
+
output: 'json',
|
|
126
|
+
debug: this.debug,
|
|
127
|
+
verbose: this.verbose
|
|
128
|
+
};
|
|
129
|
+
const output = yield Cli_1.Cli.executeCommandWithOutput(SpoGroupGetCommand, { options: Object.assign(Object.assign({}, groupGetCommandOptions), { _: [] }) });
|
|
130
|
+
const getGroupOutput = JSON.parse(output.stdout);
|
|
131
|
+
return getGroupOutput.Id;
|
|
132
|
+
});
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
_SpoFileRoleAssignmentRemoveCommand_instances = new WeakSet(), _SpoFileRoleAssignmentRemoveCommand_initTelemetry = function _SpoFileRoleAssignmentRemoveCommand_initTelemetry() {
|
|
136
|
+
this.telemetry.push((args) => {
|
|
137
|
+
Object.assign(this.telemetryProperties, {
|
|
138
|
+
fileUrl: typeof args.options.fileUrl !== 'undefined',
|
|
139
|
+
fileId: typeof args.options.fileId !== 'undefined',
|
|
140
|
+
principalId: typeof args.options.principalId !== 'undefined',
|
|
141
|
+
upn: typeof args.options.upn !== 'undefined',
|
|
142
|
+
groupName: typeof args.options.groupName !== 'undefined',
|
|
143
|
+
confirm: !!args.options.confirm
|
|
144
|
+
});
|
|
145
|
+
});
|
|
146
|
+
}, _SpoFileRoleAssignmentRemoveCommand_initOptions = function _SpoFileRoleAssignmentRemoveCommand_initOptions() {
|
|
147
|
+
this.options.unshift({
|
|
148
|
+
option: '-u, --webUrl <webUrl>'
|
|
149
|
+
}, {
|
|
150
|
+
option: '--fileUrl [fileUrl]'
|
|
151
|
+
}, {
|
|
152
|
+
option: '-i, --fileId [fileId]'
|
|
153
|
+
}, {
|
|
154
|
+
option: '--principalId [principalId]'
|
|
155
|
+
}, {
|
|
156
|
+
option: '--upn [upn]'
|
|
157
|
+
}, {
|
|
158
|
+
option: '--groupName [groupName]'
|
|
159
|
+
}, {
|
|
160
|
+
option: '--confirm'
|
|
161
|
+
});
|
|
162
|
+
}, _SpoFileRoleAssignmentRemoveCommand_initValidators = function _SpoFileRoleAssignmentRemoveCommand_initValidators() {
|
|
163
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
164
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
165
|
+
if (isValidSharePointUrl !== true) {
|
|
166
|
+
return isValidSharePointUrl;
|
|
167
|
+
}
|
|
168
|
+
if (args.options.principalId && isNaN(args.options.principalId)) {
|
|
169
|
+
return `Specified principalId ${args.options.principalId} is not a number`;
|
|
170
|
+
}
|
|
171
|
+
if (args.options.fileId && !validation_1.validation.isValidGuid(args.options.fileId)) {
|
|
172
|
+
return `${args.options.fileId} is not a valid GUID`;
|
|
173
|
+
}
|
|
174
|
+
return true;
|
|
175
|
+
}));
|
|
176
|
+
}, _SpoFileRoleAssignmentRemoveCommand_initOptionSets = function _SpoFileRoleAssignmentRemoveCommand_initOptionSets() {
|
|
177
|
+
this.optionSets.push(['fileUrl', 'fileId'], ['upn', 'groupName', 'principalId']);
|
|
178
|
+
};
|
|
179
|
+
module.exports = new SpoFileRoleAssignmentRemoveCommand();
|
|
180
|
+
//# sourceMappingURL=file-roleassignment-remove.js.map
|
|
@@ -0,0 +1,125 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (receiver, state, kind, f) {
|
|
12
|
+
if (kind === "a" && !f) throw new TypeError("Private accessor was defined without a getter");
|
|
13
|
+
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");
|
|
14
|
+
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
|
+
};
|
|
16
|
+
var _SpoFileRoleInheritanceResetCommand_instances, _SpoFileRoleInheritanceResetCommand_initTelemetry, _SpoFileRoleInheritanceResetCommand_initOptions, _SpoFileRoleInheritanceResetCommand_initValidators, _SpoFileRoleInheritanceResetCommand_initOptionSets;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
19
|
+
const request_1 = require("../../../../request");
|
|
20
|
+
const validation_1 = require("../../../../utils/validation");
|
|
21
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
22
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
23
|
+
const commands_1 = require("../../commands");
|
|
24
|
+
const SpoFileGetCommand = require("./file-get");
|
|
25
|
+
class SpoFileRoleInheritanceResetCommand extends SpoCommand_1.default {
|
|
26
|
+
constructor() {
|
|
27
|
+
super();
|
|
28
|
+
_SpoFileRoleInheritanceResetCommand_instances.add(this);
|
|
29
|
+
__classPrivateFieldGet(this, _SpoFileRoleInheritanceResetCommand_instances, "m", _SpoFileRoleInheritanceResetCommand_initTelemetry).call(this);
|
|
30
|
+
__classPrivateFieldGet(this, _SpoFileRoleInheritanceResetCommand_instances, "m", _SpoFileRoleInheritanceResetCommand_initOptions).call(this);
|
|
31
|
+
__classPrivateFieldGet(this, _SpoFileRoleInheritanceResetCommand_instances, "m", _SpoFileRoleInheritanceResetCommand_initValidators).call(this);
|
|
32
|
+
__classPrivateFieldGet(this, _SpoFileRoleInheritanceResetCommand_instances, "m", _SpoFileRoleInheritanceResetCommand_initOptionSets).call(this);
|
|
33
|
+
}
|
|
34
|
+
get name() {
|
|
35
|
+
return commands_1.default.FILE_ROLEINHERITANCE_RESET;
|
|
36
|
+
}
|
|
37
|
+
get description() {
|
|
38
|
+
return 'Restores the role inheritance of a file';
|
|
39
|
+
}
|
|
40
|
+
commandAction(logger, args) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
const resetFileRoleInheritance = () => __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
try {
|
|
44
|
+
const fileURL = yield this.getFileURL(args);
|
|
45
|
+
const requestOptions = {
|
|
46
|
+
url: `${args.options.webUrl}/_api/web/GetFileByServerRelativeUrl('${formatting_1.formatting.encodeQueryParameter(fileURL)}')/ListItemAllFields/resetroleinheritance`,
|
|
47
|
+
headers: {
|
|
48
|
+
accept: 'application/json;odata.metadata=none'
|
|
49
|
+
},
|
|
50
|
+
responseType: 'json'
|
|
51
|
+
};
|
|
52
|
+
yield request_1.default.post(requestOptions);
|
|
53
|
+
}
|
|
54
|
+
catch (err) {
|
|
55
|
+
this.handleRejectedODataJsonPromise(err);
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
if (args.options.confirm) {
|
|
59
|
+
yield resetFileRoleInheritance();
|
|
60
|
+
}
|
|
61
|
+
else {
|
|
62
|
+
const result = yield Cli_1.Cli.prompt({
|
|
63
|
+
type: 'confirm',
|
|
64
|
+
name: 'continue',
|
|
65
|
+
default: false,
|
|
66
|
+
message: `Are you sure you want to reset the role inheritance of file ${args.options.fileUrl || args.options.fileId} located in site ${args.options.webUrl}?`
|
|
67
|
+
});
|
|
68
|
+
if (result.continue) {
|
|
69
|
+
yield resetFileRoleInheritance();
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
});
|
|
73
|
+
}
|
|
74
|
+
getFileURL(args) {
|
|
75
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
76
|
+
if (args.options.fileUrl) {
|
|
77
|
+
return args.options.fileUrl;
|
|
78
|
+
}
|
|
79
|
+
const options = {
|
|
80
|
+
webUrl: args.options.webUrl,
|
|
81
|
+
id: args.options.fileId,
|
|
82
|
+
output: 'json',
|
|
83
|
+
debug: this.debug,
|
|
84
|
+
verbose: this.verbose
|
|
85
|
+
};
|
|
86
|
+
const output = yield Cli_1.Cli.executeCommandWithOutput(SpoFileGetCommand, { options: Object.assign(Object.assign({}, options), { _: [] }) });
|
|
87
|
+
const getFileOutput = JSON.parse(output.stdout);
|
|
88
|
+
return getFileOutput.ServerRelativeUrl;
|
|
89
|
+
});
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
_SpoFileRoleInheritanceResetCommand_instances = new WeakSet(), _SpoFileRoleInheritanceResetCommand_initTelemetry = function _SpoFileRoleInheritanceResetCommand_initTelemetry() {
|
|
93
|
+
this.telemetry.push((args) => {
|
|
94
|
+
Object.assign(this.telemetryProperties, {
|
|
95
|
+
fileUrl: typeof args.options.fileUrl !== 'undefined',
|
|
96
|
+
fileId: typeof args.options.fileId !== 'undefined',
|
|
97
|
+
confirm: !!args.options.confirm
|
|
98
|
+
});
|
|
99
|
+
});
|
|
100
|
+
}, _SpoFileRoleInheritanceResetCommand_initOptions = function _SpoFileRoleInheritanceResetCommand_initOptions() {
|
|
101
|
+
this.options.unshift({
|
|
102
|
+
option: '-u, --webUrl <webUrl>'
|
|
103
|
+
}, {
|
|
104
|
+
option: '--fileUrl [fileUrl]'
|
|
105
|
+
}, {
|
|
106
|
+
option: 'i, --fileId [fileId]'
|
|
107
|
+
}, {
|
|
108
|
+
option: '--confirm'
|
|
109
|
+
});
|
|
110
|
+
}, _SpoFileRoleInheritanceResetCommand_initValidators = function _SpoFileRoleInheritanceResetCommand_initValidators() {
|
|
111
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
112
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
113
|
+
if (isValidSharePointUrl !== true) {
|
|
114
|
+
return isValidSharePointUrl;
|
|
115
|
+
}
|
|
116
|
+
if (args.options.fileId && !validation_1.validation.isValidGuid(args.options.fileId)) {
|
|
117
|
+
return `${args.options.fileId} is not a valid GUID`;
|
|
118
|
+
}
|
|
119
|
+
return true;
|
|
120
|
+
}));
|
|
121
|
+
}, _SpoFileRoleInheritanceResetCommand_initOptionSets = function _SpoFileRoleInheritanceResetCommand_initOptionSets() {
|
|
122
|
+
this.optionSets.push(['fileId', 'fileUrl']);
|
|
123
|
+
};
|
|
124
|
+
module.exports = new SpoFileRoleInheritanceResetCommand();
|
|
125
|
+
//# sourceMappingURL=file-roleinheritance-reset.js.map
|
|
@@ -16,7 +16,8 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
16
16
|
var _SpoFileSharinginfoGetCommand_instances, _SpoFileSharinginfoGetCommand_initTelemetry, _SpoFileSharinginfoGetCommand_initOptions, _SpoFileSharinginfoGetCommand_initValidators, _SpoFileSharinginfoGetCommand_initOptionSets;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
|
-
const
|
|
19
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
20
|
+
const validation_1 = require("../../../../utils/validation");
|
|
20
21
|
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
21
22
|
const commands_1 = require("../../commands");
|
|
22
23
|
const FileSharingPrincipalType_1 = require("./FileSharingPrincipalType");
|
|
@@ -49,7 +50,7 @@ class SpoFileSharinginfoGetCommand extends SpoCommand_1.default {
|
|
|
49
50
|
logger.logToStderr(`Retrieving sharing information report for the file with item Id ${fileInformation.fileItemId}`);
|
|
50
51
|
}
|
|
51
52
|
const requestOptions = {
|
|
52
|
-
url: `${args.options.webUrl}/_api/web/lists/getbytitle('${
|
|
53
|
+
url: `${args.options.webUrl}/_api/web/lists/getbytitle('${formatting_1.formatting.encodeQueryParameter(fileInformation.libraryName)}')/items(${fileInformation.fileItemId})/GetSharingInformation?$select=permissionsInformation&$Expand=permissionsInformation`,
|
|
53
54
|
headers: {
|
|
54
55
|
'accept': 'application/json;odata=nometadata'
|
|
55
56
|
},
|
|
@@ -129,12 +130,12 @@ _SpoFileSharinginfoGetCommand_instances = new WeakSet(), _SpoFileSharinginfoGetC
|
|
|
129
130
|
});
|
|
130
131
|
}, _SpoFileSharinginfoGetCommand_initValidators = function _SpoFileSharinginfoGetCommand_initValidators() {
|
|
131
132
|
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
132
|
-
const isValidSharePointUrl =
|
|
133
|
+
const isValidSharePointUrl = validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
133
134
|
if (isValidSharePointUrl !== true) {
|
|
134
135
|
return isValidSharePointUrl;
|
|
135
136
|
}
|
|
136
137
|
if (args.options.id) {
|
|
137
|
-
if (!
|
|
138
|
+
if (!validation_1.validation.isValidGuid(args.options.id)) {
|
|
138
139
|
return `${args.options.id} is not a valid GUID`;
|
|
139
140
|
}
|
|
140
141
|
}
|