Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Move Yammer commands to Viva Engage. Closes #5573 #5580

Closed
wants to merge 5 commits into from
Closed
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .eslintrc.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ module.exports = {
},
{
"files": [
"**/yammer/**"
"**/viva/**"
],
"rules": {
"camelcase": "off"
Expand Down
14 changes: 7 additions & 7 deletions docs/docs/cmd/cli/cli-consent.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ m365 cli consent [options]

```md definition-list
`-s, --service <service>`
: Service for which to consent permissions. Allowed values: `yammer`
: Service for which to consent permissions. Allowed values: `"viva engage"`
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is a breaking change that we can't introduce in a minor version. I suggest that for the time being we allow both values.

```

<Global />
Expand All @@ -31,10 +31,10 @@ To simplify things, rather than wondering which permissions you should grant for

## Examples

Consent permissions to the Yammer API
Consent permissions to the Viva Engage API

```sh
m365 cli consent --service yammer
m365 cli consent --service "viva engage"
```

## Response
Expand All @@ -43,28 +43,28 @@ m365 cli consent --service yammer
<TabItem value="JSON">

```json
"To consent permissions for executing yammer commands, navigate in your web browser to https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=31359c7f-bd7e-475c-86db-fdb8c937548e&response_type=code&scope=https%3A%2F%2Fapi.yammer.com%2Fuser_impersonation"
"To consent permissions for executing viva engage commands, navigate in your web browser to https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=31359c7f-bd7e-475c-86db-fdb8c937548e&response_type=code&scope=https%3A%2F%2Fapi.yammer.com%2Fuser_impersonation"
```

</TabItem>
<TabItem value="Text">

```text
To consent permissions for executing yammer commands, navigate in your web browser to https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=31359c7f-bd7e-475c-86db-fdb8c937548e&response_type=code&scope=https%3A%2F%2Fapi.yammer.com%2Fuser_impersonation
To consent permissions for executing viva engage commands, navigate in your web browser to https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=31359c7f-bd7e-475c-86db-fdb8c937548e&response_type=code&scope=https%3A%2F%2Fapi.yammer.com%2Fuser_impersonation
```

</TabItem>
<TabItem value="CSV">

```csv
To consent permissions for executing yammer commands, navigate in your web browser to https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=31359c7f-bd7e-475c-86db-fdb8c937548e&response_type=code&scope=https%3A%2F%2Fapi.yammer.com%2Fuser_impersonation
To consent permissions for executing viva engage commands, navigate in your web browser to https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=31359c7f-bd7e-475c-86db-fdb8c937548e&response_type=code&scope=https%3A%2F%2Fapi.yammer.com%2Fuser_impersonation
```

</TabItem>
<TabItem value="Markdown">

```md
To consent permissions for executing yammer commands, navigate in your web browser to https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=31359c7f-bd7e-475c-86db-fdb8c937548e&response_type=code&scope=https%3A%2F%2Fapi.yammer.com%2Fuser_impersonation
To consent permissions for executing viva engage commands, navigate in your web browser to https://login.microsoftonline.com/common/oauth2/v2.0/authorize?client_id=31359c7f-bd7e-475c-86db-fdb8c937548e&response_type=code&scope=https%3A%2F%2Fapi.yammer.com%2Fuser_impersonation
```

</TabItem>
Expand Down
180 changes: 180 additions & 0 deletions docs/docs/cmd/viva/engage/group/group-list.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,180 @@
import Global from '/docs/cmd/_global.mdx';
import Tabs from '@theme/Tabs';
import TabItem from '@theme/TabItem';

# viva engage group list

Returns the list of groups in a Viva Engage network or the groups for a specific user

## Usage

```sh
m365 viva engage group list [options]
```

## Alias

```sh
m365 yammer group list [options]
```

## Options

```md definition-list
`--userId [userId]`
: Returns the groups for a specific user

`--limit [limit]`
: Limits the groups returned
```

<Global />

## Remarks

:::caution

In order to use this command, you need to grant the Azure AD application used by the CLI for Microsoft 365 the permission to the Viva Engage API. To do this, execute the `cli consent --service "viva engage"` command.

:::

## Examples

Returns all Viva Engage network groups

```sh
m365 viva engage group list
```

Returns all Viva Engage network groups for the user with the ID `5611239081`

```sh
m365 viva engage group list --userId 5611239081
```

Returns the first 10 Viva Engage network groups

```sh
m365 viva engage group list --limit 10
```

Returns the first 10 Viva Engage network groups for the user with the ID `5611239081`

```sh
m365 viva engage group list --userId 5611239081 --limit 10
```

## Response

<Tabs>
<TabItem value="JSON">

```json
[
{
"type": "group",
"id": 31158067201,
"email": "",
"full_name": "Contoso Hub",
"network_id": 5897756673,
"name": "contosohub",
"description": "",
"privacy": "public",
"url": "https://www.viva engage.com/api/v1/groups/31158067201",
"web_url": "https://www.viva engage.com/contoso.onmicrosoft.com/#/threads/inGroup?type=in_group&feedId=31158067201",
"mugshot_url": "https://mugshot0eu-1.assets-viva engage.com/mugshot/images/group_profile.png?P1=1668205176&P2=104&P3=1&P4=l98Wk4FkhCqVX1J8bQ_8yZDbK4cfU1lQGgkK0Ak1k2g-tfLV9_ecm6k7FyFApCq3Xnzl7NPKpGLWT2IVD-Ft5q3VSCwzv5c0A1l-SFC5MrfN25BIsR9ux8K-LlYbFUF3yeh-vFk_IxwE-AI2xEVCuq0aoINzHiIW4Gi5IxC6mDDni72sE2LuM3X4LooEowEYrzfz5d-m9hMveU1E8KPPEmq3WTejhJ_Bc3zY3XA3n4jEPDnZ09uPUyVCBpa84Ysh-GGSkFWsPBAldAQAbbzcjip_SzrfKz868BolCLlbM3DwRQfyDH9Of9IYEZpu1U85hBuNoolF68rKPVL6-bxl2w&size=48x48",
"mugshot_redirect_url": "https://www.viva engage.com/mugshot/images/redirect/48x48/group_profile.png",
"mugshot_url_template": "https://mugshot0eu-1.assets-viva engage.com/mugshot/images/group_profile.png?P1=1668205176&P2=104&P3=1&P4=l98Wk4FkhCqVX1J8bQ_8yZDbK4cfU1lQGgkK0Ak1k2g-tfLV9_ecm6k7FyFApCq3Xnzl7NPKpGLWT2IVD-Ft5q3VSCwzv5c0A1l-SFC5MrfN25BIsR9ux8K-LlYbFUF3yeh-vFk_IxwE-AI2xEVCuq0aoINzHiIW4Gi5IxC6mDDni72sE2LuM3X4LooEowEYrzfz5d-m9hMveU1E8KPPEmq3WTejhJ_Bc3zY3XA3n4jEPDnZ09uPUyVCBpa84Ysh-GGSkFWsPBAldAQAbbzcjip_SzrfKz868BolCLlbM3DwRQfyDH9Of9IYEZpu1U85hBuNoolF68rKPVL6-bxl2w&size={width}x{height}",
"mugshot_redirect_url_template": "https://www.viva engage.com/mugshot/images/redirect/{width}x{height}/group_profile.png",
"mugshot_id": null,
"show_in_directory": "true",
"created_at": "2022/11/11 20:54:52 +0000",
"aad_guests": 0,
"color": "#2c5b85",
"external": false,
"moderated": false,
"header_image_url": "https://mugshot0eu-1.assets-viva engage.com/mugshot/images/group-header-coffee.png?P1=1668204451&P2=104&P3=1&P4=hPZP6QJbY1Oj4KQZAodyMQyvjUahlwoqSCMqioVYvDoB-9Fx3qEB3ZTM7I_TF-mceKqGVDtasUIH8ZDYEfjTg9zgWWDpmkREJySioTZ0WcPtHIUkh2GUWJOfr-5aX9QhdpE1Fpp94mltGCtBc_nqlEbgIAYCJtBKgLAgUFZ4L2WSkQNn5Y_JLp5cM9Gnf7Z3MmHniN0Na1oemDhZ1vOsGCtaU09WPB5oNoSUMfwqYSKjF5IqXdd55Y3F2NZuuyTHoZS65BFZR9OJaICXJs6Q2dNExLqMvGQ76_aZsgli-BG67MVwfDsmqpxsjZZOBIZGQOEKc4D_bx8iQUHZD7p2xA",
"category": "unclassified",
"default_thread_starter_type": "normal",
"restricted_posting": false,
"company_group": false,
"creator_type": "user",
"creator_id": 36425097217,
"state": "active",
"stats": {
"members": 1,
"aad_guests": 0,
"updates": 0,
"last_message_id": null,
"last_message_at": null
}
}
]
```

</TabItem>
<TabItem value="Text">

```text
email :
external : false
id : 31158067201
moderated: false
name : contosohub
privacy : public
```

</TabItem>
<TabItem value="CSV">

```csv
id,name,email,privacy,external,moderated
31158067201,wombathub,,public,false,false
```

</TabItem>
<TabItem value="Markdown">

```md
# viva engage group list --limit "1"

Date: 2023-05-16

## leadership (123412865024)

Property | Value
---------|-------
type | group
id | 123412865024
email | leadership+contoso.onmicrosoft.com@viva engage.com
full\_name | Leadership
network\_id | 98327945216
name | leadership
description | Share what's on your mind and get important announcements from Patti and the rest of the Leadership Team.
privacy | public
url | https://www.viva engage.com/api/v1/groups/123412865024
web\_url | https://www.viva engage.com/contoso.onmicrosoft.com/#/threads/inGroup?type=in\_group&feedId=123412865024
mugshot\_url | https://mugshot0.assets-viva engage.com/mugshot/images/5jjCjcSTJsdzFn0Ps50Vz0tqNdWdgnWs?P1=1684267104&P2=104&P3=1&P4=igdO9ZCQbSd5YS7tzwuIFj9CmMPsPWWpAjsk0xGDGrciD-3XKKsHbYx-e6H22yZ6OqLc3zt\_5ZOWefd8l537cWNUOPzeDg2lz\_fNxx1bowFMIdz6mRCHcCwygEwtKI0HxX5eHd4cdJBg54c4R6VN1\_Oex7Ug9Are6hVux4DsLg7eoNMMYvvcjXUp2zcT7o6bXYcZM2WBf\_r1IC24Sb-PLaSfAtKJZsswBBTkmz\_B7O5PZFcY4TQJvd5XzwEL17aqWm1hV1MCUSEd3Ms7Clc7KwxA0Hhv1rWYF064siAHEDiVlKZrE1yN7j-gCt0K1\_xUHWc54TrUIjFxnrwMDGZvzw&size=48x48
mugshot\_redirect\_url | https://www.viva engage.com/mugshot/images/redirect/48x48/5jjCjcSTJsdzFn0Ps50Vz0tqNdWdgnWs
mugshot\_url\_template | https://mugshot0.assets-viva engage.com/mugshot/images/5jjCjcSTJsdzFn0Ps50Vz0tqNdWdgnWs?P1=1684267104&P2=104&P3=1&P4=igdO9ZCQbSd5YS7tzwuIFj9CmMPsPWWpAjsk0xGDGrciD-3XKKsHbYx-e6H22yZ6OqLc3zt\_5ZOWefd8l537cWNUOPzeDg2lz\_fNxx1bowFMIdz6mRCHcCwygEwtKI0HxX5eHd4cdJBg54c4R6VN1\_Oex7Ug9Are6hVux4DsLg7eoNMMYvvcjXUp2zcT7o6bXYcZM2WBf\_r1IC24Sb-PLaSfAtKJZsswBBTkmz\_B7O5PZFcY4TQJvd5XzwEL17aqWm1hV1MCUSEd3Ms7Clc7KwxA0Hhv1rWYF064siAHEDiVlKZrE1yN7j-gCt0K1\_xUHWc54TrUIjFxnrwMDGZvzw&size={width}x{height}
mugshot\_redirect\_url\_template | https://www.viva engage.com/mugshot/images/redirect/{width}x{height}/5jjCjcSTJsdzFn0Ps50Vz0tqNdWdgnWs
mugshot\_id | 5jjCjcSTJsdzFn0Ps50Vz0tqNdWdgnWs
show\_in\_directory | true
created\_at | 2022/12/12 12:51:11 +0000
aad\_guests | 0
color | #0e4f7a
external | false
moderated | false
header\_image\_url | https://mugshot0.assets-viva engage.com/mugshot/images/group-header-megaphone.png?P1=1684266783&P2=104&P3=1&P4=FObDxfvTV7O201-7u4v-u4Y25mAZNrpD9QhUqSXbUyC8UaqvGJH7mT5yPtx0Qls\_QUkM3606i0F2GnkQHOwC1tVW8Vse0yNZHWDTyqA\_wSRX\_fn6cP47uoC4wvSsGAmWeb6epr-hJpDW\_qn-1CHQF7cen2Ti9Ap-XncmOiu2Tfd2DTuGyuHKivI6cxGGbIQ5ERU1NgiVEXqKClOMb9qPUBu4dqPc1gfaFDaA1umUslwTG3DRfAIVviECiG1eHI5cjkTX5qifscUXCmEOQU5lLih9J409qVUOPa0vs1clNspm6XtkVaAfC8FB2gaBmEqbVtFBVbAwyoUJhu2KM0Vp7w
category | unclassified
default\_thread\_starter\_type | normal
restricted\_posting | false
company\_group | false
creator\_type | user
creator\_id | 1842176974848
state | active
```

</TabItem>
</Tabs>

Original file line number Diff line number Diff line change
@@ -1,11 +1,17 @@
import Global from '/docs/cmd/_global.mdx';

# yammer group user add
# viva engage group user add

Adds a user to a Yammer Group
Adds a user to a Viva Engage Group

## Usage

```sh
m365 viva engage group user add [options]
```

## Alias

```sh
m365 yammer group user add [options]
```
Expand All @@ -29,7 +35,7 @@ m365 yammer group user add [options]

:::caution

In order to use this command, you need to grant the Azure AD application used by the CLI for Microsoft 365 the permission to the Yammer API. To do this, execute the `cli consent --service yammer` command.
In order to use this command, you need to grant the Azure AD application used by the CLI for Microsoft 365 the permission to the Viva Engage API. To do this, execute the `cli consent --service "viva engage"` command.

:::

Expand All @@ -40,19 +46,19 @@ If the specified user is not a member of the network, the command will return an
Adds the current user to the group with the ID `5611239081`

```sh
m365 yammer group user add --groupId 5611239081
m365 viva engage group user add --groupId 5611239081
```

Adds the user with ID `66622349` to the group with the ID `5611239081`

```sh
m365 yammer group user add --groupId 5611239081 --id 66622349
m365 viva engage group user add --groupId 5611239081 --id 66622349
```

Adds the user with e-mail to the group with ID `5611239081`

```sh
m365 yammer group user add --groupId 5611239081 --email [email protected]
m365 viva engage group user add --groupId 5611239081 --email [email protected]
```

## Response
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import Global from '/docs/cmd/_global.mdx';

# yammer group user remove
# viva engage group user remove

Removes a user from a Yammer group
Removes a user from a Viva Engage group

## Usage

```sh
m365 yammer group user remove [options]
m365 viva engage group user remove [options]
```

## Options

```md definition-list
`--groupId <groupId>`
: The ID of the Yammer group
: The ID of the Viva Engage group

`--id [id]`
: ID of the user to remove from the group. If not specified, removes the current user
Expand All @@ -29,7 +29,7 @@ m365 yammer group user remove [options]

:::caution

In order to use this command, you need to grant the Azure AD application used by the CLI for Microsoft 365 the permission to the Yammer API. To do this, execute the `cli consent --service yammer` command.
In order to use this command, you need to grant the Azure AD application used by the CLI for Microsoft 365 the permission to the Viva Engage API. To do this, execute the `cli consent --service "viva engage"` command.

:::

Expand All @@ -38,19 +38,19 @@ In order to use this command, you need to grant the Azure AD application used by
Remove the current user from the group with the ID `5611239081`

```sh
m365 yammer group user remove --groupId 5611239081
m365 viva engage group user remove --groupId 5611239081
```

Remove the user with the ID `66622349` from the group with the ID `5611239081`

```sh
m365 yammer group user remove --groupId 5611239081 --id 66622349
m365 viva engage group user remove --groupId 5611239081 --id 66622349
```

Remove the user with the ID `66622349` from the group with the ID `5611239081` without asking for confirmation

```sh
m365 yammer group user remove --groupId 5611239081 --id 66622349 --force
m365 viva engage group user remove --groupId 5611239081 --id 66622349 --force
```

## Response
Expand Down
Loading
Loading