@pnp/cli-microsoft365 6.3.0 → 6.4.0-beta.006c079
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 +5 -2
- package/.eslintrc.js +4 -0
- package/Dockerfile +6 -3
- package/README.md +12 -1
- package/dist/Command.js +1 -0
- package/dist/m365/aad/commands/user/user-get.js +3 -0
- package/dist/m365/aad/commands/user/user-license-remove.js +2 -1
- package/dist/m365/aad/commands/user/user-recyclebinitem-restore.js +2 -9
- package/dist/m365/aad/commands/user/user-set.js +3 -0
- package/dist/m365/aad/commands/user/user-signin-list.js +3 -0
- package/dist/m365/file/commands/file-list.js +5 -1
- package/dist/m365/flow/commands/flow-disable.js +9 -2
- package/dist/m365/flow/commands/flow-enable.js +9 -2
- package/dist/m365/flow/commands/flow-get.js +9 -2
- package/dist/m365/flow/commands/flow-list.js +1 -1
- package/dist/m365/flow/commands/flow-remove.js +2 -2
- package/dist/m365/flow/commands/owner/owner-ensure.js +147 -0
- package/dist/m365/flow/commands/owner/owner-list.js +89 -0
- package/dist/m365/flow/commands/owner/owner-remove.js +147 -0
- package/dist/m365/flow/commands/run/run-cancel.js +9 -2
- package/dist/m365/flow/commands/run/run-list.js +5 -2
- package/dist/m365/flow/commands.js +3 -0
- package/dist/m365/planner/commands/roster/roster-member-add.js +3 -0
- package/dist/m365/planner/commands/roster/roster-member-get.js +98 -0
- package/dist/m365/planner/commands.js +1 -0
- package/dist/m365/purview/commands/retentionevent/retentionevent-add.js +138 -0
- package/dist/m365/purview/commands/retentionlabel/retentionlabel-add.js +48 -14
- package/dist/m365/purview/commands.js +1 -0
- package/dist/m365/spfx/commands/project/project-upgrade/upgrade-1.17.0-beta.1.js +59 -0
- package/dist/m365/spfx/commands/project/project-upgrade.js +16 -13
- package/dist/m365/spfx/commands/spfx-doctor.js +43 -29
- package/dist/m365/spo/commands/commandset/commandset-add.js +138 -0
- package/dist/m365/spo/commands/commandset/commandset-get.js +128 -0
- package/dist/m365/spo/commands/commandset/commandset-list.js +77 -0
- package/dist/m365/spo/commands/commandset/commandset-remove.js +146 -0
- package/dist/m365/spo/commands/commandset/commandset-set.js +182 -0
- package/dist/m365/spo/commands/customaction/customaction-get.js +27 -7
- package/dist/m365/spo/commands/file/file-move.js +1 -1
- package/dist/m365/spo/commands/group/group-member-add.js +54 -95
- package/dist/m365/spo/commands/list/list-add.js +11 -8
- package/dist/m365/spo/commands/list/list-set.js +3 -3
- package/dist/m365/spo/commands/navigation/navigation-node-add.js +5 -4
- package/dist/m365/spo/commands/navigation/navigation-node-set.js +5 -1
- package/dist/m365/spo/commands/tenant/tenant-applicationcustomizer-get.js +118 -0
- package/dist/m365/spo/commands/term/term-get.js +68 -48
- package/dist/m365/spo/commands/user/user-ensure.js +105 -0
- package/dist/m365/spo/commands.js +7 -0
- package/dist/m365/todo/commands/task/task-add.js +35 -3
- package/dist/utils/aadGroup.js +18 -0
- package/dist/utils/aadUser.js +37 -0
- package/dist/utils/md.js +7 -0
- package/dist/utils/spo.js +32 -0
- package/docs/docs/cmd/aad/app/app-add.md +3 -3
- package/docs/docs/cmd/aad/approleassignment/approleassignment-add.md +5 -5
- package/docs/docs/cmd/aad/approleassignment/approleassignment-remove.md +3 -3
- package/docs/docs/cmd/aad/user/user-remove.md +1 -1
- package/docs/docs/cmd/cli/completion/completion-clink-update.md +4 -4
- package/docs/docs/cmd/flow/owner/owner-ensure.md +61 -0
- package/docs/docs/cmd/flow/owner/owner-list.md +90 -0
- package/docs/docs/cmd/flow/owner/owner-remove.md +67 -0
- package/docs/docs/cmd/flow/run/run-list.md +28 -0
- package/docs/docs/cmd/onenote/page/page-list.md +1 -1
- package/docs/docs/cmd/outlook/mail/mail-send.md +7 -3
- package/docs/docs/cmd/outlook/message/message-get.md +143 -0
- package/docs/docs/cmd/outlook/message/message-list.md +119 -0
- package/docs/docs/cmd/outlook/message/message-move.md +4 -0
- package/docs/docs/cmd/outlook/report/report-mailactivitycounts.md +40 -0
- package/docs/docs/cmd/outlook/report/report-mailactivityusercounts.md +40 -0
- package/docs/docs/cmd/outlook/report/report-mailactivityuserdetail.md +45 -0
- package/docs/docs/cmd/outlook/report/report-mailappusageappsusercounts.md +43 -0
- package/docs/docs/cmd/outlook/report/report-mailappusageusercounts.md +44 -0
- package/docs/docs/cmd/outlook/report/report-mailappusageuserdetail.md +48 -0
- package/docs/docs/cmd/outlook/report/report-mailappusageversionsusercounts.md +41 -0
- package/docs/docs/cmd/outlook/report/report-mailboxusagedetail.md +49 -0
- package/docs/docs/cmd/outlook/report/report-mailboxusagemailboxcount.md +37 -0
- package/docs/docs/cmd/outlook/report/report-mailboxusagequotastatusmailboxcounts.md +40 -0
- package/docs/docs/cmd/outlook/report/report-mailboxusagestorage.md +36 -0
- package/docs/docs/cmd/outlook/room/room-list.md +81 -0
- package/docs/docs/cmd/outlook/roomlist/roomlist-list.md +58 -0
- package/docs/docs/cmd/planner/plan/plan-add.md +3 -3
- package/docs/docs/cmd/planner/plan/plan-set.md +73 -7
- package/docs/docs/cmd/planner/roster/roster-add.md +16 -1
- package/docs/docs/cmd/planner/roster/roster-member-get.md +87 -0
- package/docs/docs/cmd/planner/task/task-add.md +230 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-add.md +55 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-list.md +55 -0
- package/docs/docs/cmd/planner/task/task-checklistitem-remove.md +4 -0
- package/docs/docs/cmd/planner/task/task-get.md +131 -0
- package/docs/docs/cmd/planner/task/task-list.md +92 -0
- package/docs/docs/cmd/planner/task/task-reference-add.md +46 -0
- package/docs/docs/cmd/planner/task/task-reference-list.md +46 -0
- package/docs/docs/cmd/planner/task/task-reference-remove.md +4 -0
- package/docs/docs/cmd/planner/task/task-remove.md +4 -0
- package/docs/docs/cmd/planner/task/task-set.md +230 -0
- package/docs/docs/cmd/planner/tenant/tenant-settings-list.md +55 -0
- package/docs/docs/cmd/planner/tenant/tenant-settings-set.md +55 -0
- package/docs/docs/cmd/pp/card/card-get.md +2 -2
- package/docs/docs/cmd/pp/card/card-list.md +2 -2
- package/docs/docs/cmd/purview/retentionevent/retentionevent-add.md +149 -0
- package/docs/docs/cmd/purview/retentioneventtype/retentioneventtype-add.md +7 -7
- package/docs/docs/cmd/purview/retentionlabel/retentionlabel-add.md +12 -0
- package/docs/docs/cmd/skype/report/report-activitycounts.md +38 -0
- package/docs/docs/cmd/skype/report/report-activityusercounts.md +38 -0
- package/docs/docs/cmd/skype/report/report-activityuserdetail.md +67 -0
- package/docs/docs/cmd/spfx/project/project-doctor.md +3 -3
- package/docs/docs/cmd/spfx/project/project-externalize.md +3 -3
- package/docs/docs/cmd/spfx/project/project-permissions-grant.md +21 -0
- package/docs/docs/cmd/spfx/project/project-upgrade.md +3 -3
- package/docs/docs/cmd/spfx/spfx-doctor.md +3 -3
- package/docs/docs/cmd/spo/cdn/cdn-get.md +6 -6
- package/docs/docs/cmd/spo/cdn/cdn-origin-add.md +3 -3
- package/docs/docs/cmd/spo/cdn/cdn-origin-list.md +3 -3
- package/docs/docs/cmd/spo/cdn/cdn-origin-remove.md +3 -3
- package/docs/docs/cmd/spo/cdn/cdn-policy-list.md +3 -3
- package/docs/docs/cmd/spo/cdn/cdn-policy-set.md +3 -3
- package/docs/docs/cmd/spo/cdn/cdn-set.md +3 -3
- package/docs/docs/cmd/spo/commandset/commandset-add.md +159 -0
- package/docs/docs/cmd/spo/commandset/commandset-get.md +149 -0
- package/docs/docs/cmd/spo/commandset/commandset-list.md +109 -0
- package/docs/docs/cmd/spo/commandset/commandset-remove.md +55 -0
- package/docs/docs/cmd/spo/commandset/commandset-set.md +71 -0
- package/docs/docs/cmd/spo/customaction/customaction-get.md +113 -11
- package/docs/docs/cmd/spo/externaluser/externaluser-list.md +2 -0
- package/docs/docs/cmd/spo/group/group-member-add.md +26 -4
- package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-get.md +2 -0
- package/docs/docs/cmd/spo/hidedefaultthemes/hidedefaultthemes-set.md +2 -0
- package/docs/docs/cmd/spo/homesite/homesite-remove.md +2 -0
- package/docs/docs/cmd/spo/homesite/homesite-set.md +2 -0
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-get.md +2 -0
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-remove.md +2 -0
- package/docs/docs/cmd/spo/knowledgehub/knowledgehub-set.md +3 -3
- package/docs/docs/cmd/spo/list/list-add.md +2 -2
- package/docs/docs/cmd/spo/list/list-set.md +2 -2
- package/docs/docs/cmd/spo/listitem/listitem-add.md +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-batch-add.md +1 -1
- package/docs/docs/cmd/spo/listitem/listitem-set.md +1 -1
- package/docs/docs/cmd/spo/navigation/navigation-node-add.md +3 -3
- package/docs/docs/cmd/spo/navigation/navigation-node-set.md +2 -2
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-add.md +2 -0
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-list.md +2 -0
- package/docs/docs/cmd/spo/orgassetslibrary/orgassetslibrary-remove.md +2 -0
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-list.md +2 -0
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-remove.md +2 -0
- package/docs/docs/cmd/spo/orgnewssite/orgnewssite-set.md +3 -3
- package/docs/docs/cmd/spo/site/site-appcatalog-add.md +2 -0
- package/docs/docs/cmd/spo/site/site-appcatalog-remove.md +3 -3
- package/docs/docs/cmd/spo/site/site-commsite-enable.md +2 -0
- package/docs/docs/cmd/spo/site/site-list.md +3 -3
- package/docs/docs/cmd/spo/site/site-remove.md +3 -3
- package/docs/docs/cmd/spo/site/site-rename.md +3 -3
- package/docs/docs/cmd/spo/site/site-set.md +5 -5
- package/docs/docs/cmd/spo/storageentity/storageentity-remove.md +3 -3
- package/docs/docs/cmd/spo/storageentity/storageentity-set.md +3 -3
- package/docs/docs/cmd/spo/tenant/tenant-appcatalog-add.md +3 -3
- package/docs/docs/cmd/spo/tenant/tenant-appcatalogurl-get.md +2 -0
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-add.md +3 -3
- package/docs/docs/cmd/spo/tenant/tenant-applicationcustomizer-get.md +142 -0
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-list.md +2 -0
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-remove.md +3 -3
- package/docs/docs/cmd/spo/tenant/tenant-recyclebinitem-restore.md +3 -3
- package/docs/docs/cmd/spo/tenant/tenant-settings-list.md +2 -0
- package/docs/docs/cmd/spo/tenant/tenant-settings-set.md +28 -26
- package/docs/docs/cmd/spo/term/term-add.md +3 -3
- package/docs/docs/cmd/spo/term/term-get.md +3 -3
- package/docs/docs/cmd/spo/term/term-group-add.md +2 -0
- package/docs/docs/cmd/spo/term/term-group-get.md +2 -0
- package/docs/docs/cmd/spo/term/term-group-list.md +2 -0
- package/docs/docs/cmd/spo/term/term-list.md +3 -1
- package/docs/docs/cmd/spo/term/term-set-add.md +3 -3
- package/docs/docs/cmd/spo/term/term-set-get.md +2 -0
- package/docs/docs/cmd/spo/term/term-set-list.md +2 -0
- package/docs/docs/cmd/spo/theme/theme-apply.md +3 -3
- package/docs/docs/cmd/spo/theme/theme-get.md +2 -0
- package/docs/docs/cmd/spo/theme/theme-list.md +2 -0
- package/docs/docs/cmd/spo/theme/theme-remove.md +2 -0
- package/docs/docs/cmd/spo/theme/theme-set.md +3 -3
- package/docs/docs/cmd/spo/user/user-ensure.md +109 -0
- package/docs/docs/cmd/teams/channel/channel-get.md +1 -1
- package/docs/docs/cmd/teams/channel/channel-member-add.md +2 -2
- package/docs/docs/cmd/teams/message/message-get.md +39 -4
- package/docs/docs/cmd/teams/message/message-list.md +41 -6
- package/docs/docs/cmd/teams/message/message-reply-list.md +39 -4
- package/docs/docs/cmd/teams/messagingsettings/messagingsettings-list.md +20 -2
- package/docs/docs/cmd/teams/messagingsettings/messagingsettings-set.md +8 -8
- package/docs/docs/cmd/teams/report/report-deviceusagedistributionusercounts.md +12 -5
- package/docs/docs/cmd/teams/report/report-deviceusageusercounts.md +13 -6
- package/docs/docs/cmd/teams/report/report-deviceusageuserdetail.md +14 -7
- package/docs/docs/cmd/teams/report/report-directroutingcalls.md +13 -6
- package/docs/docs/cmd/teams/report/report-pstncalls.md +13 -6
- package/docs/docs/cmd/teams/report/report-useractivitycounts.md +13 -6
- package/docs/docs/cmd/teams/report/report-useractivityusercounts.md +13 -6
- package/docs/docs/cmd/teams/report/report-useractivityuserdetail.md +13 -6
- package/docs/docs/cmd/teams/tab/tab-add.md +16 -0
- package/docs/docs/cmd/teams/tab/tab-get.md +17 -0
- package/docs/docs/cmd/teams/tab/tab-list.md +19 -0
- package/docs/docs/cmd/teams/team/team-add.md +77 -8
- package/docs/docs/cmd/teams/team/team-app-list.md +18 -2
- package/docs/docs/cmd/teams/team/team-archive.md +2 -2
- package/docs/docs/cmd/teams/team/team-clone.md +8 -8
- package/docs/docs/cmd/teams/team/team-get.md +34 -4
- package/docs/docs/cmd/teams/team/team-list.md +34 -3
- package/docs/docs/cmd/teams/team/team-remove.md +3 -3
- package/docs/docs/cmd/teams/team/team-set.md +8 -8
- package/docs/docs/cmd/teams/team/team-unarchive.md +3 -2
- package/docs/docs/cmd/teams/user/user-app-add.md +3 -3
- package/docs/docs/cmd/teams/user/user-app-list.md +18 -2
- package/docs/docs/cmd/teams/user/user-app-remove.md +4 -4
- package/docs/docs/cmd/teams/user/user-list.md +21 -4
- package/docs/docs/cmd/todo/task/task-add.md +47 -2
- package/npm-shrinkwrap.json +279 -194
- package/package.json +15 -14
package/.devcontainer/Dockerfile
CHANGED
|
@@ -4,12 +4,15 @@ LABEL name="CLI for Microsoft 365 Development" \
|
|
|
4
4
|
description="Development container for contributing to CLI for Microsoft 365" \
|
|
5
5
|
homepage="https://pnp.github.io/cli-microsoft365" \
|
|
6
6
|
maintainers="Waldek Mastykarz <waldek@mastykarz.nl>, \
|
|
7
|
-
Velin Georgiev <velin.georgiev@gmail.com>, \
|
|
8
7
|
Garry Trinder <garry.trinder@live.com>, \
|
|
9
8
|
Albert-Jan Schot <appie@digiwijs.nl>, \
|
|
10
9
|
Rabia Williams <rabiawilliams@gmail.com>, \
|
|
11
10
|
Patrick Lamber <patrick@nubo.eu>, \
|
|
12
|
-
Arjun Menon <arjun.umenon@gmail.com
|
|
11
|
+
Arjun Menon <arjun.umenon@gmail.com>, \
|
|
12
|
+
Adam Wojcik <adam.wojcik.it@gmail.com>, \
|
|
13
|
+
Martin Lingstuyl <mlingstuyl@live.com>, \
|
|
14
|
+
Jasey Waegebaert <jaseyw@gmigroup.be>, \
|
|
15
|
+
Milan Holemans <Milan.Holemans@vanroey.be>"
|
|
13
16
|
|
|
14
17
|
ENV NPM_CONFIG_PREFIX=/home/cli-microsoft365-dev/.npm-global \
|
|
15
18
|
PATH=$PATH:/home/cli-microsoft365-dev/.npm-global/bin
|
package/.eslintrc.js
CHANGED
|
@@ -18,6 +18,7 @@ const dictionary = [
|
|
|
18
18
|
'checklist',
|
|
19
19
|
'client',
|
|
20
20
|
'comm',
|
|
21
|
+
'command',
|
|
21
22
|
'content',
|
|
22
23
|
'conversation',
|
|
23
24
|
'custom',
|
|
@@ -60,6 +61,7 @@ const dictionary = [
|
|
|
60
61
|
'office365',
|
|
61
62
|
'one',
|
|
62
63
|
'org',
|
|
64
|
+
'owner',
|
|
63
65
|
'o365',
|
|
64
66
|
'permission',
|
|
65
67
|
'place',
|
|
@@ -71,8 +73,10 @@ const dictionary = [
|
|
|
71
73
|
'room',
|
|
72
74
|
'schema',
|
|
73
75
|
'service',
|
|
76
|
+
'set',
|
|
74
77
|
'setting',
|
|
75
78
|
'settings',
|
|
79
|
+
'setup',
|
|
76
80
|
'sharing',
|
|
77
81
|
'side',
|
|
78
82
|
'site',
|
package/Dockerfile
CHANGED
|
@@ -6,12 +6,15 @@ LABEL name="m365pnp/cli-microsoft365:${CLI_VERSION}" \
|
|
|
6
6
|
description="Manage Microsoft 365 and SharePoint Framework projects on any platform" \
|
|
7
7
|
homepage="https://pnp.github.io/cli-microsoft365" \
|
|
8
8
|
maintainers="Waldek Mastykarz <waldek@mastykarz.nl>, \
|
|
9
|
-
Velin Georgiev <velin.georgiev@gmail.com>, \
|
|
10
9
|
Garry Trinder <garry.trinder@live.com>, \
|
|
11
10
|
Albert-Jan Schot <appie@digiwijs.nl>, \
|
|
12
11
|
Rabia Williams <rabiawilliams@gmail.com>, \
|
|
13
|
-
Patrick Lamber <patrick@nubo.eu
|
|
14
|
-
Arjun Menon <arjun.umenon@gmail.com
|
|
12
|
+
Patrick Lamber <patrick@nubo.eu>, \
|
|
13
|
+
Arjun Menon <arjun.umenon@gmail.com>, \
|
|
14
|
+
Adam Wojcik <adam.wojcik.it@gmail.com>, \
|
|
15
|
+
Martin Lingstuyl <mlingstuyl@live.com>, \
|
|
16
|
+
Jasey Waegebaert <jaseyw@gmigroup.be>, \
|
|
17
|
+
Milan Holemans <Milan.Holemans@vanroey.be>" \
|
|
15
18
|
com.azure.dev.pipelines.agent.handler.node.path="/usr/bin/node"
|
|
16
19
|
|
|
17
20
|
RUN apk add --no-cache \
|
package/README.md
CHANGED
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
alt="GitHub" />
|
|
16
16
|
</a>
|
|
17
17
|
|
|
18
|
-
<a href="https://discord.
|
|
18
|
+
<a href="https://discord.gg/35HTFJ544b">
|
|
19
19
|
<img src="https://img.shields.io/badge/Discord-Join-7289da?style=flat-square"
|
|
20
20
|
alt="Discord" />
|
|
21
21
|
</a>
|
|
@@ -213,6 +213,17 @@ If you want to get involved with helping us grow the CLI, whether that is sugges
|
|
|
213
213
|
|
|
214
214
|
Checkout our [Wiki](https://github.com/pnp/cli-microsoft365/wiki) for guides on how to contribute to this project.
|
|
215
215
|
|
|
216
|
+
## Need Help?
|
|
217
|
+
|
|
218
|
+
<h4 align="center">
|
|
219
|
+
Join our community
|
|
220
|
+
</h4>
|
|
221
|
+
<p align="center">
|
|
222
|
+
<a href="https://discord.gg/35HTFJ544b">
|
|
223
|
+
<img alt="Discord" src="./docs/docs/images/discord-logo.png" width="100"/>
|
|
224
|
+
</a>
|
|
225
|
+
</p>
|
|
226
|
+
|
|
216
227
|
## Microsoft 365 Platform Community
|
|
217
228
|
|
|
218
229
|
CLI for Microsoft 365 is a [Microsoft 365 Platform Community](https://pnp.github.io) (PnP) project. Microsoft 365 Platform Community is a virtual team consisting of Microsoft employees and community members focused on helping the community make the best use of Microsoft products. CLI for Microsoft 365 is an open-source project not affiliated with Microsoft and not covered by Microsoft support. If you experience any issues using the CLI, please submit an issue in the [issues list](https://github.com/pnp/cli-microsoft365/issues).
|
package/dist/Command.js
CHANGED
|
@@ -101,6 +101,9 @@ _AadUserGetCommand_instances = new WeakSet(), _AadUserGetCommand_initTelemetry =
|
|
|
101
101
|
!validation_1.validation.isValidGuid(args.options.id)) {
|
|
102
102
|
return `${args.options.id} is not a valid GUID`;
|
|
103
103
|
}
|
|
104
|
+
if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
|
|
105
|
+
return `${args.options.userName} is not a valid userName`;
|
|
106
|
+
}
|
|
104
107
|
return true;
|
|
105
108
|
}));
|
|
106
109
|
}, _AadUserGetCommand_initOptionSets = function _AadUserGetCommand_initOptionSets() {
|
|
@@ -81,7 +81,8 @@ _AadUserLicenseRemoveCommand_instances = new WeakSet(), _AadUserLicenseRemoveCom
|
|
|
81
81
|
this.telemetry.push((args) => {
|
|
82
82
|
Object.assign(this.telemetryProperties, {
|
|
83
83
|
userId: typeof args.options.userId !== 'undefined',
|
|
84
|
-
userName: typeof args.options.userName !== 'undefined'
|
|
84
|
+
userName: typeof args.options.userName !== 'undefined',
|
|
85
|
+
confirm: !!args.options.confirm
|
|
85
86
|
});
|
|
86
87
|
});
|
|
87
88
|
}, _AadUserLicenseRemoveCommand_initOptions = function _AadUserLicenseRemoveCommand_initOptions() {
|
|
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
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
14
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
15
|
};
|
|
16
|
-
var _AadUserRecycleBinItemRestoreCommand_instances,
|
|
16
|
+
var _AadUserRecycleBinItemRestoreCommand_instances, _AadUserRecycleBinItemRestoreCommand_initOptions, _AadUserRecycleBinItemRestoreCommand_initValidators;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../../request");
|
|
19
19
|
const validation_1 = require("../../../../utils/validation");
|
|
@@ -29,7 +29,6 @@ class AadUserRecycleBinItemRestoreCommand extends GraphCommand_1.default {
|
|
|
29
29
|
constructor() {
|
|
30
30
|
super();
|
|
31
31
|
_AadUserRecycleBinItemRestoreCommand_instances.add(this);
|
|
32
|
-
__classPrivateFieldGet(this, _AadUserRecycleBinItemRestoreCommand_instances, "m", _AadUserRecycleBinItemRestoreCommand_initTelemetry).call(this);
|
|
33
32
|
__classPrivateFieldGet(this, _AadUserRecycleBinItemRestoreCommand_instances, "m", _AadUserRecycleBinItemRestoreCommand_initOptions).call(this);
|
|
34
33
|
__classPrivateFieldGet(this, _AadUserRecycleBinItemRestoreCommand_instances, "m", _AadUserRecycleBinItemRestoreCommand_initValidators).call(this);
|
|
35
34
|
}
|
|
@@ -55,13 +54,7 @@ class AadUserRecycleBinItemRestoreCommand extends GraphCommand_1.default {
|
|
|
55
54
|
});
|
|
56
55
|
}
|
|
57
56
|
}
|
|
58
|
-
_AadUserRecycleBinItemRestoreCommand_instances = new WeakSet(),
|
|
59
|
-
this.telemetry.push((args) => {
|
|
60
|
-
Object.assign(this.telemetryProperties, {
|
|
61
|
-
confirm: !!args.options.confirm
|
|
62
|
-
});
|
|
63
|
-
});
|
|
64
|
-
}, _AadUserRecycleBinItemRestoreCommand_initOptions = function _AadUserRecycleBinItemRestoreCommand_initOptions() {
|
|
57
|
+
_AadUserRecycleBinItemRestoreCommand_instances = new WeakSet(), _AadUserRecycleBinItemRestoreCommand_initOptions = function _AadUserRecycleBinItemRestoreCommand_initOptions() {
|
|
65
58
|
this.options.unshift({
|
|
66
59
|
option: '--id <id>'
|
|
67
60
|
});
|
|
@@ -170,6 +170,9 @@ _AadUserSetCommand_instances = new WeakSet(), _AadUserSetCommand_initTelemetry =
|
|
|
170
170
|
!validation_1.validation.isValidGuid(args.options.objectId)) {
|
|
171
171
|
return `${args.options.objectId} is not a valid GUID`;
|
|
172
172
|
}
|
|
173
|
+
if (args.options.userPrincipalName && !validation_1.validation.isValidUserPrincipalName(args.options.userPrincipalName)) {
|
|
174
|
+
return `${args.options.userPrincipalName} is not a valid userPrincipalName`;
|
|
175
|
+
}
|
|
173
176
|
if (!args.options.resetPassword && ((args.options.currentPassword && !args.options.newPassword) || (args.options.newPassword && !args.options.currentPassword))) {
|
|
174
177
|
return `Specify both currentPassword and newPassword when you want to change your password`;
|
|
175
178
|
}
|
|
@@ -90,6 +90,9 @@ _AadUserSigninListCommand_instances = new WeakSet(), _AadUserSigninListCommand_i
|
|
|
90
90
|
if (args.options.appId && args.options.appDisplayName) {
|
|
91
91
|
return 'Specify either appId or appDisplayName, but not both';
|
|
92
92
|
}
|
|
93
|
+
if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
|
|
94
|
+
return `${args.options.userName} is not a valid userName`;
|
|
95
|
+
}
|
|
93
96
|
if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
|
|
94
97
|
return `${args.options.userId} is not a valid GUID`;
|
|
95
98
|
}
|
|
@@ -45,7 +45,11 @@ class FileListCommand extends GraphCommand_1.default {
|
|
|
45
45
|
if (!webUrl.endsWith('/')) {
|
|
46
46
|
webUrl += '/';
|
|
47
47
|
}
|
|
48
|
-
|
|
48
|
+
let folderUrlValue = args.options.folderUrl;
|
|
49
|
+
if (folderUrlValue.endsWith('/')) {
|
|
50
|
+
folderUrlValue = folderUrlValue.slice(0, -1);
|
|
51
|
+
}
|
|
52
|
+
const folderUrl = new URL(folderUrlValue, webUrl);
|
|
49
53
|
let driveId = '';
|
|
50
54
|
try {
|
|
51
55
|
const siteId = yield this.getSiteId(args.options.webUrl, logger);
|
|
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
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
14
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
15
|
};
|
|
16
|
-
var _FlowDisableCommand_instances, _FlowDisableCommand_initOptions;
|
|
16
|
+
var _FlowDisableCommand_instances, _FlowDisableCommand_initTelemetry, _FlowDisableCommand_initOptions;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../request");
|
|
19
19
|
const formatting_1 = require("../../../utils/formatting");
|
|
@@ -29,6 +29,7 @@ class FlowDisableCommand extends AzmgmtCommand_1.default {
|
|
|
29
29
|
constructor() {
|
|
30
30
|
super();
|
|
31
31
|
_FlowDisableCommand_instances.add(this);
|
|
32
|
+
__classPrivateFieldGet(this, _FlowDisableCommand_instances, "m", _FlowDisableCommand_initTelemetry).call(this);
|
|
32
33
|
__classPrivateFieldGet(this, _FlowDisableCommand_instances, "m", _FlowDisableCommand_initOptions).call(this);
|
|
33
34
|
}
|
|
34
35
|
commandAction(logger, args) {
|
|
@@ -52,7 +53,13 @@ class FlowDisableCommand extends AzmgmtCommand_1.default {
|
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
_FlowDisableCommand_instances = new WeakSet(),
|
|
56
|
+
_FlowDisableCommand_instances = new WeakSet(), _FlowDisableCommand_initTelemetry = function _FlowDisableCommand_initTelemetry() {
|
|
57
|
+
this.telemetry.push((args) => {
|
|
58
|
+
Object.assign(this.telemetryProperties, {
|
|
59
|
+
asAdmin: !!args.options.asAdmin
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}, _FlowDisableCommand_initOptions = function _FlowDisableCommand_initOptions() {
|
|
56
63
|
this.options.unshift({
|
|
57
64
|
option: '-n, --name <name>'
|
|
58
65
|
}, {
|
|
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
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
14
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
15
|
};
|
|
16
|
-
var _FlowEnableCommand_instances, _FlowEnableCommand_initOptions;
|
|
16
|
+
var _FlowEnableCommand_instances, _FlowEnableCommand_initTelemetry, _FlowEnableCommand_initOptions;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../request");
|
|
19
19
|
const formatting_1 = require("../../../utils/formatting");
|
|
@@ -29,6 +29,7 @@ class FlowEnableCommand extends AzmgmtCommand_1.default {
|
|
|
29
29
|
constructor() {
|
|
30
30
|
super();
|
|
31
31
|
_FlowEnableCommand_instances.add(this);
|
|
32
|
+
__classPrivateFieldGet(this, _FlowEnableCommand_instances, "m", _FlowEnableCommand_initTelemetry).call(this);
|
|
32
33
|
__classPrivateFieldGet(this, _FlowEnableCommand_instances, "m", _FlowEnableCommand_initOptions).call(this);
|
|
33
34
|
}
|
|
34
35
|
commandAction(logger, args) {
|
|
@@ -52,7 +53,13 @@ class FlowEnableCommand extends AzmgmtCommand_1.default {
|
|
|
52
53
|
});
|
|
53
54
|
}
|
|
54
55
|
}
|
|
55
|
-
_FlowEnableCommand_instances = new WeakSet(),
|
|
56
|
+
_FlowEnableCommand_instances = new WeakSet(), _FlowEnableCommand_initTelemetry = function _FlowEnableCommand_initTelemetry() {
|
|
57
|
+
this.telemetry.push((args) => {
|
|
58
|
+
Object.assign(this.telemetryProperties, {
|
|
59
|
+
asAdmin: !!args.options.asAdmin
|
|
60
|
+
});
|
|
61
|
+
});
|
|
62
|
+
}, _FlowEnableCommand_initOptions = function _FlowEnableCommand_initOptions() {
|
|
56
63
|
this.options.unshift({
|
|
57
64
|
option: '-n, --name <name>'
|
|
58
65
|
}, {
|
|
@@ -13,7 +13,7 @@ var __classPrivateFieldGet = (this && this.__classPrivateFieldGet) || function (
|
|
|
13
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
14
|
return kind === "m" ? f : kind === "a" ? f.call(receiver) : f ? f.value : state.get(receiver);
|
|
15
15
|
};
|
|
16
|
-
var _FlowGetCommand_instances, _FlowGetCommand_initOptions;
|
|
16
|
+
var _FlowGetCommand_instances, _FlowGetCommand_initTelemetry, _FlowGetCommand_initOptions;
|
|
17
17
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
18
|
const request_1 = require("../../../request");
|
|
19
19
|
const formatting_1 = require("../../../utils/formatting");
|
|
@@ -32,6 +32,7 @@ class FlowGetCommand extends AzmgmtCommand_1.default {
|
|
|
32
32
|
constructor() {
|
|
33
33
|
super();
|
|
34
34
|
_FlowGetCommand_instances.add(this);
|
|
35
|
+
__classPrivateFieldGet(this, _FlowGetCommand_instances, "m", _FlowGetCommand_initTelemetry).call(this);
|
|
35
36
|
__classPrivateFieldGet(this, _FlowGetCommand_instances, "m", _FlowGetCommand_initOptions).call(this);
|
|
36
37
|
}
|
|
37
38
|
commandAction(logger, args) {
|
|
@@ -60,7 +61,13 @@ class FlowGetCommand extends AzmgmtCommand_1.default {
|
|
|
60
61
|
});
|
|
61
62
|
}
|
|
62
63
|
}
|
|
63
|
-
_FlowGetCommand_instances = new WeakSet(),
|
|
64
|
+
_FlowGetCommand_instances = new WeakSet(), _FlowGetCommand_initTelemetry = function _FlowGetCommand_initTelemetry() {
|
|
65
|
+
this.telemetry.push((args) => {
|
|
66
|
+
Object.assign(this.telemetryProperties, {
|
|
67
|
+
asAdmin: !!args.options.asAdmin
|
|
68
|
+
});
|
|
69
|
+
});
|
|
70
|
+
}, _FlowGetCommand_initOptions = function _FlowGetCommand_initOptions() {
|
|
64
71
|
this.options.unshift({
|
|
65
72
|
option: '-n, --name <name>'
|
|
66
73
|
}, {
|
|
@@ -60,7 +60,7 @@ class FlowListCommand extends AzmgmtItemsListCommand_1.AzmgmtItemsListCommand {
|
|
|
60
60
|
_FlowListCommand_instances = new WeakSet(), _FlowListCommand_initTelemetry = function _FlowListCommand_initTelemetry() {
|
|
61
61
|
this.telemetry.push((args) => {
|
|
62
62
|
Object.assign(this.telemetryProperties, {
|
|
63
|
-
asAdmin: args.options.asAdmin
|
|
63
|
+
asAdmin: !!args.options.asAdmin
|
|
64
64
|
});
|
|
65
65
|
});
|
|
66
66
|
}, _FlowListCommand_initOptions = function _FlowListCommand_initOptions() {
|
|
@@ -82,8 +82,8 @@ class FlowRemoveCommand extends AzmgmtCommand_1.default {
|
|
|
82
82
|
_FlowRemoveCommand_instances = new WeakSet(), _FlowRemoveCommand_initTelemetry = function _FlowRemoveCommand_initTelemetry() {
|
|
83
83
|
this.telemetry.push((args) => {
|
|
84
84
|
Object.assign(this.telemetryProperties, {
|
|
85
|
-
asAdmin:
|
|
86
|
-
confirm:
|
|
85
|
+
asAdmin: !!args.options.asAdmin,
|
|
86
|
+
confirm: !!args.options.confirm
|
|
87
87
|
});
|
|
88
88
|
});
|
|
89
89
|
}, _FlowRemoveCommand_initOptions = function _FlowRemoveCommand_initOptions() {
|
|
@@ -0,0 +1,147 @@
|
|
|
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 _FlowOwnerEnsureCommand_instances, _FlowOwnerEnsureCommand_initTelemetry, _FlowOwnerEnsureCommand_initOptions, _FlowOwnerEnsureCommand_initOptionSets, _FlowOwnerEnsureCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const request_1 = require("../../../../request");
|
|
19
|
+
const aadGroup_1 = require("../../../../utils/aadGroup");
|
|
20
|
+
const aadUser_1 = require("../../../../utils/aadUser");
|
|
21
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
22
|
+
const validation_1 = require("../../../../utils/validation");
|
|
23
|
+
const AzmgmtCommand_1 = require("../../../base/AzmgmtCommand");
|
|
24
|
+
const commands_1 = require("../../commands");
|
|
25
|
+
class FlowOwnerEnsureCommand extends AzmgmtCommand_1.default {
|
|
26
|
+
get name() {
|
|
27
|
+
return commands_1.default.OWNER_ENSURE;
|
|
28
|
+
}
|
|
29
|
+
get description() {
|
|
30
|
+
return 'Assigns/updates permissions to a Power Automate flow';
|
|
31
|
+
}
|
|
32
|
+
constructor() {
|
|
33
|
+
super();
|
|
34
|
+
_FlowOwnerEnsureCommand_instances.add(this);
|
|
35
|
+
__classPrivateFieldGet(this, _FlowOwnerEnsureCommand_instances, "m", _FlowOwnerEnsureCommand_initTelemetry).call(this);
|
|
36
|
+
__classPrivateFieldGet(this, _FlowOwnerEnsureCommand_instances, "m", _FlowOwnerEnsureCommand_initOptions).call(this);
|
|
37
|
+
__classPrivateFieldGet(this, _FlowOwnerEnsureCommand_instances, "m", _FlowOwnerEnsureCommand_initValidators).call(this);
|
|
38
|
+
__classPrivateFieldGet(this, _FlowOwnerEnsureCommand_instances, "m", _FlowOwnerEnsureCommand_initOptionSets).call(this);
|
|
39
|
+
}
|
|
40
|
+
commandAction(logger, args) {
|
|
41
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
42
|
+
try {
|
|
43
|
+
if (this.verbose) {
|
|
44
|
+
logger.logToStderr(`Assigning permissions for ${args.options.userId || args.options.userName || args.options.groupId || args.options.groupName} with permissions ${args.options.roleName} to Power Automate flow ${args.options.flowName}`);
|
|
45
|
+
}
|
|
46
|
+
let id = '';
|
|
47
|
+
if (args.options.userId) {
|
|
48
|
+
id = args.options.userId;
|
|
49
|
+
}
|
|
50
|
+
else if (args.options.userName) {
|
|
51
|
+
id = yield aadUser_1.aadUser.getUserIdByUpn(args.options.userName);
|
|
52
|
+
}
|
|
53
|
+
else if (args.options.groupId) {
|
|
54
|
+
id = args.options.groupId;
|
|
55
|
+
}
|
|
56
|
+
else {
|
|
57
|
+
id = yield aadGroup_1.aadGroup.getGroupIdByDisplayName(args.options.groupName);
|
|
58
|
+
}
|
|
59
|
+
let type;
|
|
60
|
+
if (args.options.userId || args.options.userName) {
|
|
61
|
+
type = 'User';
|
|
62
|
+
}
|
|
63
|
+
else {
|
|
64
|
+
type = 'Group';
|
|
65
|
+
}
|
|
66
|
+
const requestOptions = {
|
|
67
|
+
url: `${this.resource}providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting_1.formatting.encodeQueryParameter(args.options.flowName)}/modifyPermissions?api-version=2016-11-01`,
|
|
68
|
+
headers: {
|
|
69
|
+
accept: 'application/json'
|
|
70
|
+
},
|
|
71
|
+
data: {
|
|
72
|
+
put: [
|
|
73
|
+
{
|
|
74
|
+
properties: {
|
|
75
|
+
principal: {
|
|
76
|
+
id: id,
|
|
77
|
+
type: type
|
|
78
|
+
},
|
|
79
|
+
roleName: args.options.roleName
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
]
|
|
83
|
+
},
|
|
84
|
+
responseType: 'json'
|
|
85
|
+
};
|
|
86
|
+
yield request_1.default.post(requestOptions);
|
|
87
|
+
}
|
|
88
|
+
catch (err) {
|
|
89
|
+
this.handleRejectedODataJsonPromise(err);
|
|
90
|
+
}
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
_FlowOwnerEnsureCommand_instances = new WeakSet(), _FlowOwnerEnsureCommand_initTelemetry = function _FlowOwnerEnsureCommand_initTelemetry() {
|
|
95
|
+
this.telemetry.push((args) => {
|
|
96
|
+
Object.assign(this.telemetryProperties, {
|
|
97
|
+
asAdmin: !!args.options.asAdmin,
|
|
98
|
+
userId: typeof args.options.userId !== 'undefined',
|
|
99
|
+
userName: typeof args.options.userName !== 'undefined',
|
|
100
|
+
groupId: typeof args.options.groupId !== 'undefined',
|
|
101
|
+
groupName: typeof args.options.groupName !== 'undefined'
|
|
102
|
+
});
|
|
103
|
+
});
|
|
104
|
+
}, _FlowOwnerEnsureCommand_initOptions = function _FlowOwnerEnsureCommand_initOptions() {
|
|
105
|
+
this.options.unshift({
|
|
106
|
+
option: '-e, --environmentName <environmentName>'
|
|
107
|
+
}, {
|
|
108
|
+
option: '-f, --flowName <flowName>'
|
|
109
|
+
}, {
|
|
110
|
+
option: '--userId [userId]'
|
|
111
|
+
}, {
|
|
112
|
+
option: '--userName [userName]'
|
|
113
|
+
}, {
|
|
114
|
+
option: '--groupId [groupId]'
|
|
115
|
+
}, {
|
|
116
|
+
option: '--groupName [groupName]'
|
|
117
|
+
}, {
|
|
118
|
+
option: '--roleName <roleName>',
|
|
119
|
+
autocomplete: FlowOwnerEnsureCommand.allowedRoleNames
|
|
120
|
+
}, {
|
|
121
|
+
option: '--asAdmin'
|
|
122
|
+
});
|
|
123
|
+
}, _FlowOwnerEnsureCommand_initOptionSets = function _FlowOwnerEnsureCommand_initOptionSets() {
|
|
124
|
+
this.optionSets.push({ options: ['userId', 'userName', 'groupId', 'groupName'] });
|
|
125
|
+
}, _FlowOwnerEnsureCommand_initValidators = function _FlowOwnerEnsureCommand_initValidators() {
|
|
126
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
127
|
+
if (!validation_1.validation.isValidGuid(args.options.flowName)) {
|
|
128
|
+
return `${args.options.flowName} is not a valid GUID.`;
|
|
129
|
+
}
|
|
130
|
+
if (args.options.userId && !validation_1.validation.isValidGuid(args.options.userId)) {
|
|
131
|
+
return `${args.options.userId} is not a valid GUID.`;
|
|
132
|
+
}
|
|
133
|
+
if (args.options.userName && !validation_1.validation.isValidUserPrincipalName(args.options.userName)) {
|
|
134
|
+
return `${args.options.userName} is not a valid userName.`;
|
|
135
|
+
}
|
|
136
|
+
if (args.options.groupId && !validation_1.validation.isValidGuid(args.options.groupId)) {
|
|
137
|
+
return `${args.options.groupId} is not a valid GUID.`;
|
|
138
|
+
}
|
|
139
|
+
if (FlowOwnerEnsureCommand.allowedRoleNames.indexOf(args.options.roleName) === -1) {
|
|
140
|
+
return `${args.options.roleName} is not a valid roleName. Valid values are: ${FlowOwnerEnsureCommand.allowedRoleNames.join(', ')}`;
|
|
141
|
+
}
|
|
142
|
+
return true;
|
|
143
|
+
}));
|
|
144
|
+
};
|
|
145
|
+
FlowOwnerEnsureCommand.allowedRoleNames = ['CanView', 'CanEdit'];
|
|
146
|
+
module.exports = new FlowOwnerEnsureCommand();
|
|
147
|
+
//# sourceMappingURL=owner-ensure.js.map
|
|
@@ -0,0 +1,89 @@
|
|
|
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 _FlowOwnerListCommand_instances, _FlowOwnerListCommand_initTelemetry, _FlowOwnerListCommand_initOptions, _FlowOwnerListCommand_initValidators;
|
|
17
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
|
+
const Cli_1 = require("../../../../cli/Cli");
|
|
19
|
+
const formatting_1 = require("../../../../utils/formatting");
|
|
20
|
+
const odata_1 = require("../../../../utils/odata");
|
|
21
|
+
const validation_1 = require("../../../../utils/validation");
|
|
22
|
+
const AzmgmtCommand_1 = require("../../../base/AzmgmtCommand");
|
|
23
|
+
const commands_1 = require("../../commands");
|
|
24
|
+
class FlowOwnerListCommand extends AzmgmtCommand_1.default {
|
|
25
|
+
get name() {
|
|
26
|
+
return commands_1.default.OWNER_LIST;
|
|
27
|
+
}
|
|
28
|
+
get description() {
|
|
29
|
+
return 'Lists all owners of a Power Automate flow';
|
|
30
|
+
}
|
|
31
|
+
defaultProperties() {
|
|
32
|
+
return ['roleName', 'id', 'type'];
|
|
33
|
+
}
|
|
34
|
+
constructor() {
|
|
35
|
+
super();
|
|
36
|
+
_FlowOwnerListCommand_instances.add(this);
|
|
37
|
+
__classPrivateFieldGet(this, _FlowOwnerListCommand_instances, "m", _FlowOwnerListCommand_initTelemetry).call(this);
|
|
38
|
+
__classPrivateFieldGet(this, _FlowOwnerListCommand_instances, "m", _FlowOwnerListCommand_initOptions).call(this);
|
|
39
|
+
__classPrivateFieldGet(this, _FlowOwnerListCommand_instances, "m", _FlowOwnerListCommand_initValidators).call(this);
|
|
40
|
+
}
|
|
41
|
+
commandAction(logger, args) {
|
|
42
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
43
|
+
try {
|
|
44
|
+
if (this.verbose) {
|
|
45
|
+
logger.logToStderr(`Listing owners for flow ${args.options.flowName} in environment ${args.options.environmentName}`);
|
|
46
|
+
}
|
|
47
|
+
const response = yield odata_1.odata.getAllItems(`${this.resource}providers/Microsoft.ProcessSimple/${args.options.asAdmin ? 'scopes/admin/' : ''}environments/${formatting_1.formatting.encodeQueryParameter(args.options.environmentName)}/flows/${formatting_1.formatting.encodeQueryParameter(args.options.flowName)}/permissions?api-version=2016-11-01`);
|
|
48
|
+
if (!Cli_1.Cli.shouldTrimOutput(args.options.output)) {
|
|
49
|
+
logger.log(response);
|
|
50
|
+
}
|
|
51
|
+
else {
|
|
52
|
+
//converted to text friendly output
|
|
53
|
+
logger.log(response.map(res => ({
|
|
54
|
+
roleName: res.properties.roleName,
|
|
55
|
+
id: res.properties.principal.id,
|
|
56
|
+
type: res.properties.principal.type
|
|
57
|
+
})));
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
catch (err) {
|
|
61
|
+
this.handleRejectedODataJsonPromise(err);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
_FlowOwnerListCommand_instances = new WeakSet(), _FlowOwnerListCommand_initTelemetry = function _FlowOwnerListCommand_initTelemetry() {
|
|
67
|
+
this.telemetry.push((args) => {
|
|
68
|
+
Object.assign(this.telemetryProperties, {
|
|
69
|
+
asAdmin: !!args.options.asAdmin
|
|
70
|
+
});
|
|
71
|
+
});
|
|
72
|
+
}, _FlowOwnerListCommand_initOptions = function _FlowOwnerListCommand_initOptions() {
|
|
73
|
+
this.options.unshift({
|
|
74
|
+
option: '-e, --environmentName <environmentName>'
|
|
75
|
+
}, {
|
|
76
|
+
option: '-f, --flowName <flowName>'
|
|
77
|
+
}, {
|
|
78
|
+
option: '--asAdmin'
|
|
79
|
+
});
|
|
80
|
+
}, _FlowOwnerListCommand_initValidators = function _FlowOwnerListCommand_initValidators() {
|
|
81
|
+
this.validators.push((args) => __awaiter(this, void 0, void 0, function* () {
|
|
82
|
+
if (!validation_1.validation.isValidGuid(args.options.flowName)) {
|
|
83
|
+
return `${args.options.flowName} is not a valid GUID.`;
|
|
84
|
+
}
|
|
85
|
+
return true;
|
|
86
|
+
}));
|
|
87
|
+
};
|
|
88
|
+
module.exports = new FlowOwnerListCommand();
|
|
89
|
+
//# sourceMappingURL=owner-list.js.map
|