@pnp/cli-microsoft365 6.9.0-beta.f6054b4 → 6.10.0-beta.81a81c0
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/.devcontainer/Dockerfile +12 -19
- package/.devcontainer/devcontainer.json +24 -17
- package/Dockerfile +3 -1
- package/dist/Auth.js +2 -8
- package/dist/AuthServer.js +2 -4
- package/dist/cli/Cli.js +2 -2
- package/dist/m365/aad/commands/app/app-add.js +258 -249
- package/dist/m365/aad/commands/app/app-get.js +65 -62
- package/dist/m365/aad/commands/app/app-remove.js +22 -23
- package/dist/m365/aad/commands/app/app-role-add.js +35 -34
- package/dist/m365/aad/commands/app/app-role-list.js +22 -23
- package/dist/m365/aad/commands/app/app-role-remove.js +76 -73
- package/dist/m365/aad/commands/app/app-set.js +103 -103
- package/dist/m365/aad/commands/approleassignment/approleassignment-add.js +16 -14
- package/dist/m365/aad/commands/approleassignment/approleassignment-list.js +43 -52
- package/dist/m365/aad/commands/approleassignment/approleassignment-remove.js +20 -16
- package/dist/m365/aad/commands/o365group/o365group-add.js +40 -37
- package/dist/m365/aad/commands/o365group/o365group-conversation-post-list.js +7 -6
- package/dist/m365/aad/commands/o365group/o365group-list.js +6 -11
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-clear.js +7 -8
- package/dist/m365/aad/commands/o365group/o365group-recyclebinitem-restore.js +23 -24
- package/dist/m365/aad/commands/o365group/o365group-set.js +15 -20
- package/dist/m365/aad/commands/o365group/o365group-teamify.js +15 -16
- package/dist/m365/aad/commands/o365group/o365group-user-list.js +17 -10
- package/dist/m365/aad/commands/o365group/o365group-user-set.js +17 -10
- package/dist/m365/aad/commands/policy/policy-list.js +12 -13
- package/dist/m365/aad/commands/siteclassification/siteclassification-enable.js +1 -3
- package/dist/m365/aad/commands/siteclassification/siteclassification-set.js +19 -20
- package/dist/m365/aad/commands/sp/sp-add.js +22 -23
- package/dist/m365/aad/commands/sp/sp-get.js +22 -23
- package/dist/m365/aad/commands/sp/sp-list.js +78 -0
- package/dist/m365/aad/commands.js +1 -0
- package/dist/m365/app/commands/app-open.js +4 -14
- package/dist/m365/base/AzmgmtItemsListCommand.js +31 -33
- package/dist/m365/cli/commands/cli-issue.js +4 -10
- package/dist/m365/cli/commands/cli-reconsent.js +2 -8
- package/dist/m365/cli/commands/config/config-set.js +0 -1
- package/dist/m365/commands/docs.js +2 -8
- package/dist/m365/commands/login.js +20 -0
- package/dist/m365/file/commands/convert/convert-pdf.js +147 -143
- package/dist/m365/file/commands/file-add.js +87 -93
- package/dist/m365/file/commands/file-list.js +49 -55
- package/dist/m365/flow/commands/flow-list.js +30 -12
- package/dist/m365/flow/commands/flow-remove.js +2 -3
- package/dist/m365/flow/commands/run/run-resubmit.js +11 -10
- package/dist/m365/onedrive/commands/onedrive-list.js +21 -32
- package/dist/m365/outlook/commands/message/message-list.js +18 -23
- package/dist/m365/outlook/commands/message/message-move.js +15 -20
- package/dist/m365/pa/commands/app/app-export.js +3 -4
- package/dist/m365/pa/commands/app/app-get.js +11 -9
- package/dist/m365/pa/commands/app/app-remove.js +1 -1
- package/dist/m365/pa/commands/pcf/pcf-init.js +1 -2
- package/dist/m365/pa/commands/solution/solution-init.js +1 -2
- package/dist/m365/pa/commands/solution/solution-reference-add.js +1 -2
- package/dist/m365/planner/commands/bucket/bucket-add.js +15 -13
- package/dist/m365/planner/commands/bucket/bucket-get.js +27 -28
- package/dist/m365/planner/commands/bucket/bucket-list.js +15 -13
- package/dist/m365/planner/commands/bucket/bucket-remove.js +33 -34
- package/dist/m365/planner/commands/bucket/bucket-set.js +33 -34
- package/dist/m365/planner/commands/plan/plan-add.js +49 -52
- package/dist/m365/planner/commands/plan/plan-set.js +19 -20
- package/dist/m365/planner/commands/task/task-add.js +75 -78
- package/dist/m365/planner/commands/task/task-checklistitem-add.js +11 -10
- package/dist/m365/planner/commands/task/task-checklistitem-remove.js +10 -8
- package/dist/m365/planner/commands/task/task-get.js +53 -56
- package/dist/m365/planner/commands/task/task-list.js +23 -24
- package/dist/m365/planner/commands/task/task-reference-add.js +11 -10
- package/dist/m365/planner/commands/task/task-reference-remove.js +13 -14
- package/dist/m365/planner/commands/task/task-remove.js +44 -48
- package/dist/m365/planner/commands/task/task-set.js +83 -87
- package/dist/m365/pp/commands/managementapp/managementapp-add.js +19 -20
- package/dist/m365/purview/commands/retentionevent/retentionevent-add.js +3 -8
- package/dist/m365/purview/commands/retentionevent/retentionevent-get.js +1 -6
- package/dist/m365/purview/commands/retentionevent/retentionevent-list.js +1 -6
- package/dist/m365/purview/commands/retentionevent/retentionevent-remove.js +1 -6
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-add.js +1 -6
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-get.js +1 -6
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-list.js +1 -6
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-remove.js +1 -6
- package/dist/m365/purview/commands/retentioneventtype/retentioneventtype-set.js +1 -6
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +0 -5
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-get.js +0 -5
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-list.js +0 -5
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-remove.js +19 -22
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-set.js +0 -5
- package/dist/m365/spfx/commands/project/JsonRule.js +1 -1
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.17.3.js +25 -0
- package/dist/m365/spfx/commands/project/project-doctor/doctor-1.17.4.js +25 -0
- package/dist/m365/spfx/commands/project/project-doctor.js +3 -1
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN002027_DEVDEP_fluentui_react.js +14 -0
- package/dist/m365/spfx/commands/project/project-upgrade/rules/FN021003_PKG_engines_node.js +1 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.17.3.js +59 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.17.4.js +55 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +3 -1
- package/dist/m365/spfx/commands/spfx-doctor.js +30 -0
- package/dist/m365/spo/commands/app/app-teamspackage-download.js +17 -24
- package/dist/m365/spo/commands/applicationcustomizer/applicationcustomizer-set.js +154 -0
- package/dist/m365/spo/commands/apppage/apppage-set.js +1 -1
- package/dist/m365/spo/commands/commandset/commandset-set.js +11 -2
- package/dist/m365/spo/commands/contenttype/contenttype-field-set.js +65 -94
- package/dist/m365/spo/commands/customaction/customaction-clear.js +4 -12
- package/dist/m365/spo/commands/customaction/customaction-remove.js +12 -23
- package/dist/m365/spo/commands/customaction/customaction-set.js +21 -29
- package/dist/m365/spo/commands/file/file-add.js +133 -133
- package/dist/m365/spo/commands/file/file-checkout-undo.js +119 -0
- package/dist/m365/spo/commands/file/file-rename.js +11 -9
- package/dist/m365/spo/commands/file/file-retentionlabel-ensure.js +2 -2
- package/dist/m365/spo/commands/file/file-roleassignment-add.js +41 -61
- package/dist/m365/spo/commands/file/file-roleassignment-remove.js +3 -0
- package/dist/m365/spo/commands/file/file-roleinheritance-break.js +3 -0
- package/dist/m365/spo/commands/file/file-roleinheritance-reset.js +3 -0
- package/dist/m365/spo/commands/file/file-sharinginfo-get.js +23 -21
- package/dist/m365/spo/commands/file/file-version-clear.js +1 -1
- package/dist/m365/spo/commands/file/file-version-remove.js +1 -1
- package/dist/m365/spo/commands/file/file-version-restore.js +1 -1
- package/dist/m365/spo/commands/folder/folder-roleassignment-add.js +3 -3
- package/dist/m365/spo/commands/folder/folder-roleassignment-remove.js +1 -1
- package/dist/m365/spo/commands/group/group-member-add.js +17 -16
- package/dist/m365/spo/commands/group/group-set.js +20 -20
- package/dist/m365/spo/commands/homesite/homesite-remove.js +1 -1
- package/dist/m365/spo/commands/hubsite/hubsite-get.js +33 -31
- package/dist/m365/spo/commands/hubsite/hubsite-list.js +18 -29
- package/dist/m365/spo/commands/hubsite/hubsite-unregister.js +3 -0
- package/dist/m365/spo/commands/list/list-add.js +1 -1
- package/dist/m365/spo/commands/list/list-contenttype-default-set.js +1 -1
- package/dist/m365/spo/commands/list/list-roleassignment-add.js +45 -52
- package/dist/m365/spo/commands/list/list-roleassignment-remove.js +33 -38
- package/dist/m365/spo/commands/list/list-sensitivitylabel-ensure.js +137 -0
- package/dist/m365/spo/commands/list/list-view-field-add.js +12 -10
- package/dist/m365/spo/commands/list/list-view-field-remove.js +12 -10
- package/dist/m365/spo/commands/list/list-view-field-set.js +12 -10
- package/dist/m365/spo/commands/list/list-view-remove.js +3 -0
- package/dist/m365/spo/commands/listitem/listitem-roleassignment-add.js +41 -61
- package/dist/m365/spo/commands/listitem/listitem-roleassignment-remove.js +71 -74
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-break.js +36 -34
- package/dist/m365/spo/commands/listitem/listitem-roleinheritance-reset.js +32 -30
- package/dist/m365/spo/commands/navigation/navigation-node-remove.js +24 -22
- package/dist/m365/spo/commands/orgassetslibrary/orgassetslibrary-remove.js +29 -27
- package/dist/m365/spo/commands/orgnewssite/orgnewssite-remove.js +26 -24
- package/dist/m365/spo/commands/page/page-clientsidewebpart-add.js +34 -40
- package/dist/m365/spo/commands/sitedesign/sitedesign-task-remove.js +23 -21
- package/dist/m365/spo/commands/sitescript/sitescript-remove.js +24 -22
- package/dist/m365/spo/commands/spo-search.js +7 -15
- package/dist/m365/spo/commands/storageentity/storageentity-remove.js +29 -27
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-set.js +156 -0
- package/dist/m365/spo/commands/tenant/tenant-commandset-list.js +50 -0
- package/dist/m365/spo/commands/tenant/tenant-commandset-set.js +1 -1
- package/dist/m365/spo/commands.js +5 -0
- package/dist/m365/teams/commands/app/app-install.js +23 -21
- package/dist/m365/teams/commands/app/app-remove.js +3 -0
- package/dist/m365/teams/commands/app/app-uninstall.js +3 -0
- package/dist/m365/teams/commands/app/app-update.js +15 -16
- package/dist/m365/teams/commands/channel/channel-add.js +40 -39
- package/dist/m365/teams/commands/channel/channel-get.js +23 -25
- package/dist/m365/teams/commands/channel/channel-list.js +6 -7
- package/dist/m365/teams/commands/channel/channel-member-add.js +61 -60
- package/dist/m365/teams/commands/channel/channel-member-list.js +20 -22
- package/dist/m365/teams/commands/channel/channel-member-remove.js +43 -48
- package/dist/m365/teams/commands/channel/channel-member-set.js +36 -39
- package/dist/m365/teams/commands/channel/channel-remove.js +4 -1
- package/dist/m365/teams/commands/funsettings/funsettings-list.js +3 -0
- package/dist/m365/teams/commands/funsettings/funsettings-set.js +3 -0
- package/dist/m365/teams/commands/tab/tab-get.js +34 -37
- package/dist/m365/teams/commands/team/team-archive.js +6 -7
- package/dist/m365/teams/commands/team/team-get.js +6 -7
- package/dist/m365/teams/commands/team/team-list.js +9 -11
- package/dist/m365/teams/commands/team/team-remove.js +6 -7
- package/dist/m365/teams/commands/team/team-unarchive.js +6 -7
- package/dist/m365/teams/commands/user/user-app-list.js +13 -11
- package/dist/m365/teams/commands/user/user-list.js +7 -4
- package/dist/m365/tenant/commands/security/security-alerts-list.js +25 -26
- package/dist/m365/tenant/commands/serviceannouncement/serviceannouncement-health-list.js +13 -14
- package/dist/m365/todo/commands/list/list-remove.js +39 -36
- package/dist/m365/todo/commands/list/list-set.js +16 -14
- package/dist/m365/todo/commands/task/task-add.js +14 -14
- package/dist/m365/util/commands/accesstoken/accesstoken-get.js +10 -7
- package/dist/settingsNames.js +0 -1
- package/dist/utils/browserUtil.js +23 -0
- package/dist/utils/md.js +1 -3
- package/docs/docs/cmd/aad/app/app-add.mdx +113 -0
- package/docs/docs/cmd/aad/app/app-get.mdx +217 -0
- package/docs/docs/cmd/aad/app/app-list.mdx +21 -0
- package/docs/docs/cmd/aad/app/app-role-add.mdx +4 -0
- package/docs/docs/cmd/aad/app/app-role-list.mdx +63 -0
- package/docs/docs/cmd/aad/app/app-role-remove.mdx +4 -0
- package/docs/docs/cmd/aad/app/app-set.mdx +4 -0
- package/docs/docs/cmd/aad/approleassignment/approleassignment-add.mdx +61 -0
- package/docs/docs/cmd/aad/approleassignment/approleassignment-list.mdx +59 -0
- package/docs/docs/cmd/aad/approleassignment/approleassignment-remove.mdx +4 -0
- package/docs/docs/cmd/aad/group/group-get.mdx +24 -0
- package/docs/docs/cmd/aad/group/group-list.mdx +98 -0
- package/docs/docs/cmd/aad/groupsetting/groupsetting-add.mdx +114 -0
- package/docs/docs/cmd/aad/groupsetting/groupsetting-get.mdx +115 -0
- package/docs/docs/cmd/aad/groupsetting/groupsetting-list.mdx +115 -0
- package/docs/docs/cmd/aad/groupsetting/groupsetting-remove.mdx +4 -0
- package/docs/docs/cmd/aad/groupsetting/groupsetting-set.mdx +4 -0
- package/docs/docs/cmd/aad/groupsettingtemplate/groupsettingtemplate-get.mdx +63 -0
- package/docs/docs/cmd/aad/groupsettingtemplate/groupsettingtemplate-list.mdx +63 -0
- package/docs/docs/cmd/aad/o365group/o365group-add.mdx +122 -0
- package/docs/docs/cmd/aad/o365group/o365group-conversation-list.mdx +68 -0
- package/docs/docs/cmd/aad/o365group/o365group-conversation-post-list.mdx +77 -0
- package/docs/docs/cmd/aad/o365group/o365group-get.mdx +122 -0
- package/docs/docs/cmd/aad/o365group/o365group-list.mdx +99 -0
- package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-clear.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-list.mdx +96 -0
- package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-remove.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-recyclebinitem-restore.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-remove.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-renew.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-report-activitycounts.mdx +48 -0
- package/docs/docs/cmd/aad/o365group/o365group-report-activitydetail.mdx +60 -0
- package/docs/docs/cmd/aad/o365group/o365group-report-activityfilecounts.mdx +46 -0
- package/docs/docs/cmd/aad/o365group/o365group-report-activitygroupcounts.mdx +46 -0
- package/docs/docs/cmd/aad/o365group/o365group-report-activitystorage.mdx +46 -0
- package/docs/docs/cmd/aad/o365group/o365group-set.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-teamify.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-user-add.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-user-list.mdx +56 -0
- package/docs/docs/cmd/aad/o365group/o365group-user-remove.mdx +4 -0
- package/docs/docs/cmd/aad/o365group/o365group-user-set.mdx +8 -4
- package/docs/docs/cmd/aad/oauth2grant/oauth2grant-add.mdx +4 -0
- package/docs/docs/cmd/aad/oauth2grant/oauth2grant-list.mdx +59 -0
- package/docs/docs/cmd/aad/oauth2grant/oauth2grant-remove.mdx +4 -0
- package/docs/docs/cmd/aad/oauth2grant/oauth2grant-set.mdx +4 -0
- package/docs/docs/cmd/aad/policy/policy-list.mdx +77 -0
- package/docs/docs/cmd/aad/siteclassification/siteclassification-disable.mdx +4 -0
- package/docs/docs/cmd/aad/siteclassification/siteclassification-enable.mdx +4 -0
- package/docs/docs/cmd/aad/siteclassification/siteclassification-get.mdx +57 -0
- package/docs/docs/cmd/aad/siteclassification/siteclassification-set.mdx +4 -0
- package/docs/docs/cmd/aad/sp/sp-add.mdx +136 -0
- package/docs/docs/cmd/aad/sp/sp-get.mdx +166 -0
- package/docs/docs/cmd/aad/sp/sp-list.mdx +162 -0
- package/docs/docs/cmd/aad/user/user-get.mdx +75 -0
- package/docs/docs/cmd/aad/user/user-guest-add.mdx +23 -0
- package/docs/docs/cmd/aad/user/user-hibp.mdx +82 -0
- package/docs/docs/cmd/aad/user/user-license-add.mdx +2 -2
- package/docs/docs/cmd/aad/user/user-license-remove.mdx +2 -2
- package/docs/docs/cmd/aad/user/user-list.mdx +52 -0
- package/docs/docs/cmd/aad/user/user-password-validate.mdx +67 -0
- package/docs/docs/cmd/aad/user/user-signin-list.mdx +131 -0
- package/docs/docs/cmd/flow/flow-list.mdx +15 -0
- package/docs/docs/cmd/login.mdx +39 -0
- package/docs/docs/cmd/purview/retentionevent/retentionevent-add.mdx +0 -6
- package/docs/docs/cmd/purview/retentionevent/retentionevent-get.mdx +0 -6
- package/docs/docs/cmd/purview/retentionevent/retentionevent-list.mdx +0 -7
- package/docs/docs/cmd/purview/retentionevent/retentionevent-remove.mdx +0 -6
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.mdx +0 -6
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-get.mdx +0 -6
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-list.mdx +0 -6
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-remove.mdx +0 -6
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-set.mdx +0 -6
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.mdx +0 -6
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-get.mdx +0 -6
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-list.mdx +0 -6
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-remove.mdx +0 -6
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-set.mdx +0 -6
- package/docs/docs/cmd/setup.mdx +2 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.mdx +1 -1
- package/docs/docs/cmd/spo/applicationcustomizer/applicationcustomizer-set.mdx +72 -0
- package/docs/docs/cmd/spo/commandset/commandset-set.mdx +12 -3
- package/docs/docs/cmd/spo/file/file-checkout-undo.mdx +55 -0
- package/docs/docs/cmd/spo/file/file-retentionlabel-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/folder/folder-retentionlabel-ensure.mdx +1 -1
- package/docs/docs/cmd/spo/list/list-sensitivitylabel-ensure.mdx +73 -0
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-set.mdx +81 -0
- package/docs/docs/cmd/spo/tenant/tenant-commandset-add.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-commandset-get.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-commandset-list.mdx +114 -0
- package/docs/docs/cmd/spo/tenant/tenant-commandset-set.mdx +1 -1
- package/docs/docs/cmd/spo/tenant/tenant-settings-set.mdx +6 -0
- package/docs/docs/cmd/status.mdx +6 -3
- package/docs/docs/cmd/util/accesstoken/accesstoken-get.mdx +12 -2
- package/npm-shrinkwrap.json +301 -274
- package/package.json +18 -17
- package/dist/m365/aad/commands/approleassignment/AppRoleAssignment.js +0 -3
- package/dist/m365/aad/commands/approleassignment/ServicePrincipal.js +0 -3
- package/dist/m365/aad/commands/groupsetting/GroupSetting.js +0 -3
- package/dist/m365/aad/commands/groupsettingtemplate/GroupSettingTemplate.js +0 -3
- package/dist/m365/aad/commands/siteclassification/DirectorySetting.js +0 -10
- package/dist/m365/aad/commands/siteclassification/DirectorySettingTemplatesRsp.js +0 -3
- package/dist/m365/aad/commands/siteclassification/DirectorySettingValue.js +0 -3
- package/dist/m365/outlook/Message.js +0 -3
- package/dist/m365/spo/commands/site/SitePermission.js +0 -3
- package/dist/m365/teams/Channel.js +0 -3
- package/dist/m365/teams/ConversationMember.js +0 -3
- package/dist/m365/teams/Message.js +0 -3
- package/dist/m365/teams/Reply.js +0 -3
- package/dist/m365/teams/Tab.js +0 -3
- package/dist/m365/teams/Team.js +0 -3
- package/dist/m365/teams/TeamsApp.js +0 -3
- package/dist/m365/teams/TeamsAppInstallation.js +0 -3
- package/dist/m365/teams/TeamsTabConfiguration.js +0 -3
- package/dist/m365/teams/commands/Meeting.js +0 -3
|
@@ -0,0 +1,154 @@
|
|
|
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 _SpoApplicationCustomizerSetCommand_instances, _SpoApplicationCustomizerSetCommand_initOptions, _SpoApplicationCustomizerSetCommand_initTelemetry, _SpoApplicationCustomizerSetCommand_initValidators, _SpoApplicationCustomizerSetCommand_initOptionSets;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const request_1 = require("../../../../request");
|
|
19
|
+
const validation_1 = require("../../../../utils/validation");
|
|
20
|
+
const SpoCommand_1 = require("../../../base/SpoCommand");
|
|
21
|
+
const commands_1 = require("../../commands");
|
|
22
|
+
const spo_1 = require("../../../../utils/spo");
|
|
23
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
24
|
+
const os = require("os");
|
|
25
|
+
class SpoApplicationCustomizerSetCommand extends SpoCommand_1.default {
|
|
26
|
+
get name() {
|
|
27
|
+
return commands_1.default.APPLICATIONCUSTOMIZER_SET;
|
|
28
|
+
}
|
|
29
|
+
get description() {
|
|
30
|
+
return 'Updates an existing Application Customizer on a site';
|
|
31
|
+
}
|
|
32
|
+
constructor() {
|
|
33
|
+
super();
|
|
34
|
+
_SpoApplicationCustomizerSetCommand_instances.add(this);
|
|
35
|
+
this.allowedScopes = ['Site', 'Web', 'All'];
|
|
36
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerSetCommand_instances, "m", _SpoApplicationCustomizerSetCommand_initTelemetry).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerSetCommand_instances, "m", _SpoApplicationCustomizerSetCommand_initOptions).call(this);
|
|
38
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerSetCommand_instances, "m", _SpoApplicationCustomizerSetCommand_initValidators).call(this);
|
|
39
|
+
__classPrivateFieldGet(this, _SpoApplicationCustomizerSetCommand_instances, "m", _SpoApplicationCustomizerSetCommand_initOptionSets).call(this);
|
|
40
|
+
}
|
|
41
|
+
commandAction(logger, args) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
try {
|
|
44
|
+
const appCustomizer = yield this.getAppCustomizerToUpdate(logger, args.options);
|
|
45
|
+
yield this.updateAppCustomizer(logger, args.options, appCustomizer);
|
|
46
|
+
}
|
|
47
|
+
catch (err) {
|
|
48
|
+
this.handleRejectedODataJsonPromise(err);
|
|
49
|
+
}
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
updateAppCustomizer(logger, options, appCustomizer) {
|
|
53
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
54
|
+
const { clientSideComponentProperties, webUrl, newTitle } = options;
|
|
55
|
+
if (this.verbose) {
|
|
56
|
+
logger.logToStderr(`Updating application customizer with ID '${appCustomizer.Id}' on the site '${webUrl}'...`);
|
|
57
|
+
}
|
|
58
|
+
const requestBody = {};
|
|
59
|
+
if (newTitle) {
|
|
60
|
+
requestBody.Title = newTitle;
|
|
61
|
+
}
|
|
62
|
+
if (clientSideComponentProperties !== undefined) {
|
|
63
|
+
requestBody.ClientSideComponentProperties = clientSideComponentProperties;
|
|
64
|
+
}
|
|
65
|
+
const requestOptions = {
|
|
66
|
+
url: `${webUrl}/_api/${appCustomizer.Scope.toString() === '2' ? 'Site' : 'Web'}/UserCustomActions('${appCustomizer.Id}')`,
|
|
67
|
+
headers: {
|
|
68
|
+
accept: 'application/json;odata=nometadata',
|
|
69
|
+
'X-HTTP-Method': 'MERGE'
|
|
70
|
+
},
|
|
71
|
+
data: requestBody,
|
|
72
|
+
responseType: 'json'
|
|
73
|
+
};
|
|
74
|
+
yield request_1.default.post(requestOptions);
|
|
75
|
+
});
|
|
76
|
+
}
|
|
77
|
+
getAppCustomizerToUpdate(logger, options) {
|
|
78
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
79
|
+
const { id, webUrl, title, clientSideComponentId, scope } = options;
|
|
80
|
+
const resolvedScope = scope || 'All';
|
|
81
|
+
if (this.verbose) {
|
|
82
|
+
logger.logToStderr(`Getting application customizer ${title || clientSideComponentId || id} to update...`);
|
|
83
|
+
}
|
|
84
|
+
let appCustomizers = [];
|
|
85
|
+
if (id) {
|
|
86
|
+
const appCustomizer = yield spo_1.spo.getCustomActionById(webUrl, id, resolvedScope);
|
|
87
|
+
if (appCustomizer && appCustomizer.Location === 'ClientSideExtension.ApplicationCustomizer') {
|
|
88
|
+
appCustomizers.push(appCustomizer);
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
else if (title) {
|
|
92
|
+
appCustomizers = yield spo_1.spo.getCustomActions(webUrl, resolvedScope, `(Title eq '${formatting_1.formatting.encodeQueryParameter(title)}') and (startswith(Location,'ClientSideExtension.ApplicationCustomizer'))`);
|
|
93
|
+
}
|
|
94
|
+
else {
|
|
95
|
+
appCustomizers = yield spo_1.spo.getCustomActions(webUrl, resolvedScope, `(ClientSideComponentId eq guid'${clientSideComponentId}') and (startswith(Location,'ClientSideExtension.ApplicationCustomizer'))`);
|
|
96
|
+
}
|
|
97
|
+
if (appCustomizers.length === 0) {
|
|
98
|
+
throw `No application customizer with ${title && `title '${title}'` || clientSideComponentId && `ClientSideComponentId '${clientSideComponentId}'` || id && `id '${id}'`} found`;
|
|
99
|
+
}
|
|
100
|
+
if (appCustomizers.length > 1) {
|
|
101
|
+
throw `Multiple application customizer with ${title ? `title '${title}'` : `ClientSideComponentId '${clientSideComponentId}'`} found. Please disambiguate using IDs: ${os.EOL}${appCustomizers.map(a => `- ${a.Id}`).join(os.EOL)}`;
|
|
102
|
+
}
|
|
103
|
+
return appCustomizers[0];
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
_SpoApplicationCustomizerSetCommand_instances = new WeakSet(), _SpoApplicationCustomizerSetCommand_initOptions = function _SpoApplicationCustomizerSetCommand_initOptions() {
|
|
108
|
+
this.options.unshift({
|
|
109
|
+
option: '-u, --webUrl <webUrl>'
|
|
110
|
+
}, {
|
|
111
|
+
option: '-t, --title [title]'
|
|
112
|
+
}, {
|
|
113
|
+
option: '-i, --id [id]'
|
|
114
|
+
}, {
|
|
115
|
+
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
116
|
+
}, {
|
|
117
|
+
option: '--newTitle [newTitle]'
|
|
118
|
+
}, {
|
|
119
|
+
option: '-p, --clientSideComponentProperties [clientSideComponentProperties]'
|
|
120
|
+
}, {
|
|
121
|
+
option: '-s, --scope [scope]', autocomplete: this.allowedScopes
|
|
122
|
+
});
|
|
123
|
+
}, _SpoApplicationCustomizerSetCommand_initTelemetry = function _SpoApplicationCustomizerSetCommand_initTelemetry() {
|
|
124
|
+
this.telemetry.push((args) => {
|
|
125
|
+
Object.assign(this.telemetryProperties, {
|
|
126
|
+
title: typeof args.options.title !== 'undefined',
|
|
127
|
+
id: typeof args.options.id !== 'undefined',
|
|
128
|
+
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
129
|
+
newTitle: typeof args.options.newTitle !== 'undefined',
|
|
130
|
+
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
131
|
+
scope: typeof args.options.scope !== 'undefined'
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
}, _SpoApplicationCustomizerSetCommand_initValidators = function _SpoApplicationCustomizerSetCommand_initValidators() {
|
|
135
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
136
|
+
if (args.options.id && !validation_1.validation.isValidGuid(args.options.id)) {
|
|
137
|
+
return `${args.options.id} is not a valid GUID`;
|
|
138
|
+
}
|
|
139
|
+
if (args.options.clientSideComponentId && !validation_1.validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
140
|
+
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
141
|
+
}
|
|
142
|
+
if (args.options.scope && this.allowedScopes.indexOf(args.options.scope) === -1) {
|
|
143
|
+
return `'${args.options.scope}' is not a valid application customizer scope. Allowed values are: ${this.allowedScopes.join(',')}`;
|
|
144
|
+
}
|
|
145
|
+
if (!args.options.newTitle && !args.options.clientSideComponentProperties) {
|
|
146
|
+
return `Please specify an option to be updated`;
|
|
147
|
+
}
|
|
148
|
+
return validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
149
|
+
}));
|
|
150
|
+
}, _SpoApplicationCustomizerSetCommand_initOptionSets = function _SpoApplicationCustomizerSetCommand_initOptionSets() {
|
|
151
|
+
this.optionSets.push({ options: ['id', 'title', 'clientSideComponentId'] });
|
|
152
|
+
};
|
|
153
|
+
module.exports = new SpoApplicationCustomizerSetCommand();
|
|
154
|
+
//# sourceMappingURL=applicationcustomizer-set.js.map
|
|
@@ -42,7 +42,7 @@ class SpoAppPageSetCommand extends SpoCommand_1.default {
|
|
|
42
42
|
},
|
|
43
43
|
responseType: 'json',
|
|
44
44
|
data: {
|
|
45
|
-
serverRelativeUrl: `${urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, '')}
|
|
45
|
+
serverRelativeUrl: `${urlUtil_1.urlUtil.getServerRelativePath(args.options.webUrl, 'SitePages')}/${args.options.name}`,
|
|
46
46
|
webPartDataAsJson: args.options.webPartData
|
|
47
47
|
}
|
|
48
48
|
};
|
|
@@ -39,7 +39,7 @@ class SpoCommandSetSetCommand extends SpoCommand_1.default {
|
|
|
39
39
|
commandAction(logger, args) {
|
|
40
40
|
return __awaiter(this, void 0, void 0, function* () {
|
|
41
41
|
if (this.verbose) {
|
|
42
|
-
logger.logToStderr(`Updating ListView Command Set ${args.options.clientSideComponentId} to site '${args.options.webUrl}'...`);
|
|
42
|
+
logger.logToStderr(`Updating ListView Command Set ${args.options.id || args.options.title || args.options.clientSideComponentId} to site '${args.options.webUrl}'...`);
|
|
43
43
|
}
|
|
44
44
|
if (!args.options.scope) {
|
|
45
45
|
args.options.scope = 'All';
|
|
@@ -59,6 +59,9 @@ class SpoCommandSetSetCommand extends SpoCommand_1.default {
|
|
|
59
59
|
if (args.options.clientSideComponentProperties) {
|
|
60
60
|
requestBody.ClientSideComponentProperties = args.options.clientSideComponentProperties;
|
|
61
61
|
}
|
|
62
|
+
if (args.options.newClientSideComponentId) {
|
|
63
|
+
requestBody.ClientSideComponentId = args.options.newClientSideComponentId;
|
|
64
|
+
}
|
|
62
65
|
const customAction = yield this.getCustomAction(args.options);
|
|
63
66
|
const requestOptions = {
|
|
64
67
|
url: `${args.options.webUrl}/_api/${customAction.Scope === 3 ? "Web" : "Site"}/UserCustomActions('${formatting_1.formatting.encodeQueryParameter(customAction.Id)}')`,
|
|
@@ -127,6 +130,7 @@ _SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_ini
|
|
|
127
130
|
title: typeof args.options.title !== 'undefined',
|
|
128
131
|
id: typeof args.options.id !== 'undefined',
|
|
129
132
|
clientSideComponentId: typeof args.options.clientSideComponentId !== 'undefined',
|
|
133
|
+
newClientSideComponentId: typeof args.options.newClientSideComponentId !== 'undefined',
|
|
130
134
|
listType: typeof args.options.listType !== 'undefined',
|
|
131
135
|
clientSideComponentProperties: typeof args.options.clientSideComponentProperties !== 'undefined',
|
|
132
136
|
scope: typeof args.options.scope !== 'undefined',
|
|
@@ -142,6 +146,8 @@ _SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_ini
|
|
|
142
146
|
option: '-i, --id [id]'
|
|
143
147
|
}, {
|
|
144
148
|
option: '-c, --clientSideComponentId [clientSideComponentId]'
|
|
149
|
+
}, {
|
|
150
|
+
option: '--newClientSideComponentId [newClientSideComponentId]'
|
|
145
151
|
}, {
|
|
146
152
|
option: '--newTitle [newTitle]'
|
|
147
153
|
}, {
|
|
@@ -161,6 +167,9 @@ _SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_ini
|
|
|
161
167
|
if (args.options.clientSideComponentId && !validation_1.validation.isValidGuid(args.options.clientSideComponentId)) {
|
|
162
168
|
return `${args.options.clientSideComponentId} is not a valid GUID`;
|
|
163
169
|
}
|
|
170
|
+
if (args.options.newClientSideComponentId && !validation_1.validation.isValidGuid(args.options.newClientSideComponentId)) {
|
|
171
|
+
return `${args.options.newClientSideComponentId} is not a valid GUID`;
|
|
172
|
+
}
|
|
164
173
|
if (args.options.listType && SpoCommandSetSetCommand.listTypes.indexOf(args.options.listType) < 0) {
|
|
165
174
|
return `${args.options.listType} is not a valid list type. Allowed values are ${SpoCommandSetSetCommand.listTypes.join(', ')}`;
|
|
166
175
|
}
|
|
@@ -170,7 +179,7 @@ _SpoCommandSetSetCommand_instances = new WeakSet(), _SpoCommandSetSetCommand_ini
|
|
|
170
179
|
if (args.options.location && SpoCommandSetSetCommand.locations.indexOf(args.options.location) < 0) {
|
|
171
180
|
return `${args.options.location} is not a valid location. Allowed values are ${SpoCommandSetSetCommand.locations.join(', ')}`;
|
|
172
181
|
}
|
|
173
|
-
if (!args.options.newTitle && !args.options.listType && !args.options.clientSideComponentProperties && !args.options.location) {
|
|
182
|
+
if (!args.options.newTitle && !args.options.listType && !args.options.clientSideComponentProperties && !args.options.location && !args.options.newClientSideComponentId) {
|
|
174
183
|
return `Please specify option to be updated`;
|
|
175
184
|
}
|
|
176
185
|
return validation_1.validation.isValidSharePointUrl(args.options.webUrl);
|
|
@@ -170,7 +170,7 @@ class SpoContentTypeFieldSetCommand extends SpoCommand_1.default {
|
|
|
170
170
|
});
|
|
171
171
|
}
|
|
172
172
|
createFieldLink(logger, args, schemaXmlWithResourceTokens) {
|
|
173
|
-
return
|
|
173
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
174
174
|
let requiresUpdate = false;
|
|
175
175
|
const match = /(<Field[^>]+>)(.*)/.exec(schemaXmlWithResourceTokens);
|
|
176
176
|
let xField = match[1];
|
|
@@ -185,120 +185,91 @@ class SpoContentTypeFieldSetCommand extends SpoCommand_1.default {
|
|
|
185
185
|
xField = xField.replace(allowDeletion[0], 'AllowDeletion="TRUE"') + match[2];
|
|
186
186
|
}
|
|
187
187
|
}
|
|
188
|
-
this
|
|
189
|
-
|
|
190
|
-
.
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
}
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
}
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
})
|
|
231
|
-
.then((res) => {
|
|
232
|
-
const json = JSON.parse(res);
|
|
233
|
-
const response = json[0];
|
|
234
|
-
if (response.ErrorInfo) {
|
|
235
|
-
reject(response.ErrorInfo.ErrorMessage);
|
|
236
|
-
}
|
|
237
|
-
else {
|
|
238
|
-
resolve();
|
|
239
|
-
}
|
|
240
|
-
}, (error) => {
|
|
241
|
-
reject(error);
|
|
242
|
-
});
|
|
188
|
+
yield this.updateField(xField, requiresUpdate, logger, args);
|
|
189
|
+
if (this.verbose) {
|
|
190
|
+
logger.logToStderr(`Retrieving site collection id...`);
|
|
191
|
+
}
|
|
192
|
+
const requestOptionsSiteId = {
|
|
193
|
+
url: `${args.options.webUrl}/_api/site?$select=Id`,
|
|
194
|
+
headers: {
|
|
195
|
+
accept: 'application/json;odata=nometadata'
|
|
196
|
+
},
|
|
197
|
+
responseType: 'json'
|
|
198
|
+
};
|
|
199
|
+
const resSiteId = yield request_1.default.get(requestOptionsSiteId);
|
|
200
|
+
this.siteId = resSiteId.Id;
|
|
201
|
+
if (this.verbose) {
|
|
202
|
+
logger.logToStderr(`Retrieving site id...`);
|
|
203
|
+
}
|
|
204
|
+
const requestOptionsWebId = {
|
|
205
|
+
url: `${args.options.webUrl}/_api/web?$select=Id`,
|
|
206
|
+
headers: {
|
|
207
|
+
accept: 'application/json;odata=nometadata'
|
|
208
|
+
},
|
|
209
|
+
responseType: 'json'
|
|
210
|
+
};
|
|
211
|
+
const resWebId = yield request_1.default.get(requestOptionsWebId);
|
|
212
|
+
this.webId = resWebId.Id;
|
|
213
|
+
yield this.ensureRequestDigest(args.options.webUrl, logger);
|
|
214
|
+
const requestOptions = {
|
|
215
|
+
url: `${args.options.webUrl}/_vti_bin/client.svc/ProcessQuery`,
|
|
216
|
+
headers: {
|
|
217
|
+
'X-RequestDigest': this.requestDigest
|
|
218
|
+
},
|
|
219
|
+
data: `<Request AddExpandoFieldTypeSuffix="true" SchemaVersion="15.0.0.0" LibraryVersion="16.0.0.0" ApplicationName="${config_1.default.applicationName}" xmlns="http://schemas.microsoft.com/sharepoint/clientquery/2009"><Actions><ObjectPath Id="5" ObjectPathId="4" /><ObjectIdentityQuery Id="6" ObjectPathId="4" /><Method Name="Update" Id="7" ObjectPathId="1"><Parameters><Parameter Type="Boolean">true</Parameter></Parameters></Method></Actions><ObjectPaths><Identity Id="2" Name="d6667b9e-50fb-0000-2693-032ae7a0df25|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${this.siteId}:web:${this.webId}:field:${args.options.id}" /><Method Id="4" ParentId="3" Name="Add"><Parameters><Parameter TypeId="{63fb2c92-8f65-4bbb-a658-b6cd294403f4}"><Property Name="Field" ObjectPathId="2" /></Parameter></Parameters></Method><Identity Id="1" Name="d6667b9e-80f4-0000-2693-05528ff416bf|740c6a0b-85e2-48a0-a494-e0f1759d4aa7:site:${this.siteId}:web:${this.webId}:contenttype:${formatting_1.formatting.escapeXml(args.options.contentTypeId)}" /><Property Id="3" ParentId="1" Name="FieldLinks" /></ObjectPaths></Request>`
|
|
220
|
+
};
|
|
221
|
+
const res = yield request_1.default.post(requestOptions);
|
|
222
|
+
const json = JSON.parse(res);
|
|
223
|
+
const response = json[0];
|
|
224
|
+
if (response.ErrorInfo) {
|
|
225
|
+
throw response.ErrorInfo.ErrorMessage;
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
return;
|
|
229
|
+
}
|
|
243
230
|
});
|
|
244
231
|
}
|
|
245
232
|
updateField(schemaXml, requiresUpdate, logger, args) {
|
|
246
|
-
return
|
|
233
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
247
234
|
if (!requiresUpdate) {
|
|
248
235
|
if (this.verbose) {
|
|
249
236
|
logger.logToStderr(`Schema of field ${args.options.id} is already up-to-date`);
|
|
250
237
|
}
|
|
251
|
-
resolve();
|
|
252
238
|
return;
|
|
253
239
|
}
|
|
254
|
-
this
|
|
255
|
-
|
|
256
|
-
.
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
}
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
};
|
|
273
|
-
return request_1.default.post(requestOptions);
|
|
274
|
-
})
|
|
275
|
-
.then(() => {
|
|
276
|
-
resolve();
|
|
277
|
-
}, (error) => {
|
|
278
|
-
reject(error);
|
|
279
|
-
});
|
|
240
|
+
yield this.ensureRequestDigest(args.options.webUrl, logger);
|
|
241
|
+
if (this.verbose) {
|
|
242
|
+
logger.logToStderr(`Updating field schema...`);
|
|
243
|
+
}
|
|
244
|
+
const requestOptions = {
|
|
245
|
+
url: `${args.options.webUrl}/_api/web/fields('${args.options.id}')`,
|
|
246
|
+
headers: {
|
|
247
|
+
accept: 'application/json;odata=nometadata',
|
|
248
|
+
'content-type': 'application/json;odata=nometadata',
|
|
249
|
+
'X-HTTP-Method': 'MERGE',
|
|
250
|
+
'x-requestdigest': this.requestDigest
|
|
251
|
+
},
|
|
252
|
+
data: {
|
|
253
|
+
SchemaXml: schemaXml
|
|
254
|
+
},
|
|
255
|
+
responseType: 'json'
|
|
256
|
+
};
|
|
257
|
+
yield request_1.default.post(requestOptions);
|
|
280
258
|
});
|
|
281
259
|
}
|
|
282
260
|
ensureRequestDigest(siteUrl, logger) {
|
|
283
|
-
return
|
|
261
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
284
262
|
if (this.requestDigest) {
|
|
285
263
|
if (this.debug) {
|
|
286
264
|
logger.logToStderr('Request digest already present');
|
|
287
265
|
}
|
|
288
|
-
resolve();
|
|
289
266
|
return;
|
|
290
267
|
}
|
|
291
268
|
if (this.debug) {
|
|
292
269
|
logger.logToStderr('Retrieving request digest...');
|
|
293
270
|
}
|
|
294
|
-
spo_1.spo
|
|
295
|
-
|
|
296
|
-
.then((res) => {
|
|
297
|
-
this.requestDigest = res.FormDigestValue;
|
|
298
|
-
resolve();
|
|
299
|
-
}, (error) => {
|
|
300
|
-
reject(error);
|
|
301
|
-
});
|
|
271
|
+
const res = yield spo_1.spo.getRequestDigest(siteUrl);
|
|
272
|
+
this.requestDigest = res.FormDigestValue;
|
|
302
273
|
});
|
|
303
274
|
}
|
|
304
275
|
}
|
|
@@ -81,19 +81,11 @@ class SpoCustomActionClearCommand extends SpoCommand_1.default {
|
|
|
81
81
|
* Another clear request is send with `site` scope after.
|
|
82
82
|
*/
|
|
83
83
|
clearAllScopes(options) {
|
|
84
|
-
return
|
|
84
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
85
85
|
options.scope = "Web";
|
|
86
|
-
this
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
options.scope = "Site";
|
|
90
|
-
return this.clearScopedCustomActions(options);
|
|
91
|
-
})
|
|
92
|
-
.then(() => {
|
|
93
|
-
return resolve();
|
|
94
|
-
}, (err) => {
|
|
95
|
-
reject(err);
|
|
96
|
-
});
|
|
86
|
+
yield this.clearScopedCustomActions(options);
|
|
87
|
+
options.scope = "Site";
|
|
88
|
+
yield this.clearScopedCustomActions(options);
|
|
97
89
|
});
|
|
98
90
|
}
|
|
99
91
|
}
|
|
@@ -77,7 +77,7 @@ class SpoCustomActionRemoveCommand extends SpoCommand_1.default {
|
|
|
77
77
|
getCustomActionId(options) {
|
|
78
78
|
return __awaiter(this, void 0, void 0, function* () {
|
|
79
79
|
if (options.id) {
|
|
80
|
-
return
|
|
80
|
+
return options.id;
|
|
81
81
|
}
|
|
82
82
|
const customActions = yield spo_1.spo.getCustomActions(options.webUrl, options.scope, `Title eq '${formatting_1.formatting.encodeQueryParameter(options.title)}'`);
|
|
83
83
|
if (customActions.length === 1) {
|
|
@@ -90,9 +90,8 @@ class SpoCustomActionRemoveCommand extends SpoCommand_1.default {
|
|
|
90
90
|
});
|
|
91
91
|
}
|
|
92
92
|
removeScopedCustomAction(options) {
|
|
93
|
-
return this
|
|
94
|
-
.getCustomActionId(options)
|
|
95
|
-
.then((customActionId) => {
|
|
93
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
94
|
+
const customActionId = yield this.getCustomActionId(options);
|
|
96
95
|
const requestOptions = {
|
|
97
96
|
url: `${options.webUrl}/_api/${options.scope}/UserCustomActions('${formatting_1.formatting.encodeQueryParameter(customActionId)}')')`,
|
|
98
97
|
headers: {
|
|
@@ -101,7 +100,7 @@ class SpoCustomActionRemoveCommand extends SpoCommand_1.default {
|
|
|
101
100
|
},
|
|
102
101
|
responseType: 'json'
|
|
103
102
|
};
|
|
104
|
-
return request_1.default.post(requestOptions);
|
|
103
|
+
return yield request_1.default.post(requestOptions);
|
|
105
104
|
});
|
|
106
105
|
}
|
|
107
106
|
/**
|
|
@@ -110,25 +109,15 @@ class SpoCustomActionRemoveCommand extends SpoCommand_1.default {
|
|
|
110
109
|
* another get request is send with `site` scope.
|
|
111
110
|
*/
|
|
112
111
|
searchAllScopes(options) {
|
|
113
|
-
return
|
|
112
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
114
113
|
options.scope = "Web";
|
|
115
|
-
this
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
this
|
|
123
|
-
.removeScopedCustomAction(options)
|
|
124
|
-
.then((siteResult) => {
|
|
125
|
-
return resolve(siteResult);
|
|
126
|
-
}, (err) => {
|
|
127
|
-
reject(err);
|
|
128
|
-
});
|
|
129
|
-
}, (err) => {
|
|
130
|
-
reject(err);
|
|
131
|
-
});
|
|
114
|
+
const webResult = yield this.removeScopedCustomAction(options);
|
|
115
|
+
if (!webResult) {
|
|
116
|
+
return webResult;
|
|
117
|
+
}
|
|
118
|
+
options.scope = "Site";
|
|
119
|
+
const siteResult = yield this.removeScopedCustomAction(options);
|
|
120
|
+
return siteResult;
|
|
132
121
|
});
|
|
133
122
|
}
|
|
134
123
|
}
|
|
@@ -73,17 +73,19 @@ class SpoCustomActionSetCommand extends SpoCommand_1.default {
|
|
|
73
73
|
});
|
|
74
74
|
}
|
|
75
75
|
updateCustomAction(options) {
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
76
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
77
|
+
const requestBody = this.mapRequestBody(options);
|
|
78
|
+
const requestOptions = {
|
|
79
|
+
url: `${options.webUrl}/_api/${options.scope}/UserCustomActions('${formatting_1.formatting.encodeQueryParameter(options.id)}')`,
|
|
80
|
+
headers: {
|
|
81
|
+
accept: 'application/json;odata=nometadata',
|
|
82
|
+
'X-HTTP-Method': 'MERGE'
|
|
83
|
+
},
|
|
84
|
+
data: requestBody,
|
|
85
|
+
responseType: 'json'
|
|
86
|
+
};
|
|
87
|
+
return yield request_1.default.post(requestOptions);
|
|
88
|
+
});
|
|
87
89
|
}
|
|
88
90
|
/**
|
|
89
91
|
* Merge request with `web` scope is send first.
|
|
@@ -91,25 +93,15 @@ class SpoCustomActionSetCommand extends SpoCommand_1.default {
|
|
|
91
93
|
* another merge request is send with `site` scope.
|
|
92
94
|
*/
|
|
93
95
|
searchAllScopes(options) {
|
|
94
|
-
return
|
|
96
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
95
97
|
options.scope = "Web";
|
|
96
|
-
this
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
this
|
|
104
|
-
.updateCustomAction(options)
|
|
105
|
-
.then((siteResult) => {
|
|
106
|
-
return resolve(siteResult);
|
|
107
|
-
}, (err) => {
|
|
108
|
-
reject(err);
|
|
109
|
-
});
|
|
110
|
-
}, (err) => {
|
|
111
|
-
reject(err);
|
|
112
|
-
});
|
|
98
|
+
const webResult = yield this.updateCustomAction(options);
|
|
99
|
+
if (webResult === undefined || webResult["odata.null"] !== true) {
|
|
100
|
+
return webResult;
|
|
101
|
+
}
|
|
102
|
+
options.scope = "Site";
|
|
103
|
+
const siteResult = yield this.updateCustomAction(options);
|
|
104
|
+
return siteResult;
|
|
113
105
|
});
|
|
114
106
|
}
|
|
115
107
|
mapRequestBody(options) {
|