Skip to content

Commit 7efd005

Browse files
authored
docs: update docs (#145)
1 parent 4ab96e7 commit 7efd005

15 files changed

+230
-25
lines changed

docs/imports.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,11 @@ list of JSON objects, representing each item to be imported.
3434
"role": "user",
3535
"teams": [
3636
"A-team"
37-
]
37+
],
38+
"push_notifications": {
39+
"disabled": true,
40+
"disabled_reason": "doesn't want to be disturbed"
41+
}
3842
}
3943
},
4044
{
@@ -80,6 +84,15 @@ list of JSON objects, representing each item to be imported.
8084
"user_id": "murdock",
8185
"created_at": "2022-01-01T01:01:01Z"
8286
}
87+
},
88+
{
89+
"type": "device",
90+
"item": {
91+
"id": "deviceID",
92+
"user_id": "hannibal",
93+
"created_at": "2022-01-01T01:01:01Z",
94+
"push_provider_type": "firebase"
95+
}
8396
}
8497
]
8598
```

docs/stream-cli_chat.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ Allows you to interact with your Chat applications
1919

2020
* [stream-cli](stream-cli.md) - Stream CLI
2121
* [stream-cli chat add-members](stream-cli_chat_add-members.md) - Add members to a channel
22+
* [stream-cli chat assign-role](stream-cli_chat_assign-role.md) - Assign a role to a user
2223
* [stream-cli chat ban-user](stream-cli_chat_ban-user.md) - Ban a user
2324
* [stream-cli chat create-channel](stream-cli_chat_create-channel.md) - Create a channel
2425
* [stream-cli chat create-channel-type](stream-cli_chat_create-channel-type.md) - Create channel type
@@ -33,7 +34,7 @@ Allows you to interact with your Chat applications
3334
* [stream-cli chat delete-message](stream-cli_chat_delete-message.md) - Delete a message
3435
* [stream-cli chat delete-pushprovider](stream-cli_chat_delete-pushprovider.md) - Delete a push provider
3536
* [stream-cli chat delete-reaction](stream-cli_chat_delete-reaction.md) - Delete a reaction from a message
36-
* [stream-cli chat delete-user](stream-cli_chat_delete-user.md) - Delete a user
37+
* [stream-cli chat delete-users](stream-cli_chat_delete-users.md) - Delete multiple users
3738
* [stream-cli chat demote-moderators](stream-cli_chat_demote-moderators.md) - Demote users from moderator role
3839
* [stream-cli chat flag-message](stream-cli_chat_flag-message.md) - Flag a message
3940
* [stream-cli chat flag-user](stream-cli_chat_flag-user.md) - Flag a user
@@ -50,6 +51,7 @@ Allows you to interact with your Chat applications
5051
* [stream-cli chat list-devices](stream-cli_chat_list-devices.md) - List devices
5152
* [stream-cli chat list-imports](stream-cli_chat_list-imports.md) - List imports
5253
* [stream-cli chat list-pushproviders](stream-cli_chat_list-pushproviders.md) - List all push providers
54+
* [stream-cli chat listen-events](stream-cli_chat_listen-events.md) - Listen to events
5355
* [stream-cli chat mute-user](stream-cli_chat_mute-user.md) - Mute a user
5456
* [stream-cli chat promote-moderators](stream-cli_chat_promote-moderators.md) - Promote users to channel moderator role
5557
* [stream-cli chat query-users](stream-cli_chat_query-users.md) - Query users
@@ -69,6 +71,7 @@ Allows you to interact with your Chat applications
6971
* [stream-cli chat update-channel-partial](stream-cli_chat_update-channel-partial.md) - Update a channel partially
7072
* [stream-cli chat update-channel-type](stream-cli_chat_update-channel-type.md) - Update channel type
7173
* [stream-cli chat update-message-partial](stream-cli_chat_update-message-partial.md) - Partially update a message
74+
* [stream-cli chat update-user-partial](stream-cli_chat_update-user-partial.md) - Partially update a user
7275
* [stream-cli chat upload-file](stream-cli_chat_upload-file.md) - Upload a file
7376
* [stream-cli chat upload-image](stream-cli_chat_upload-image.md) - Upload an image
7477
* [stream-cli chat upload-import](stream-cli_chat_upload-import.md) - Upload an import

docs/stream-cli_chat_add-members.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@ stream-cli chat add-members --type [channel-type] --id [channel-id] [user-id-1]
1010

1111
```
1212
# Add members joe, jill and jane to 'red-team' channel
13-
$ stream-cli chat add-member --type messaging --id red-team joe jill jane
13+
$ stream-cli chat add-members --type messaging --id red-team joe jill jane
1414
1515
```
1616

Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
## stream-cli chat assign-role
2+
3+
Assign a role to a user
4+
5+
```
6+
stream-cli chat assign-role --type [channel-type] --id [channel-id] --user-id [user-id] --role [channel-role-name] [flags]
7+
```
8+
9+
### Examples
10+
11+
```
12+
# Assign 'channel_moderator' role to user 'joe'
13+
$ stream-cli chat assign-role --type messaging --id red-team --user-id joe --role channel_moderator
14+
15+
```
16+
17+
### Options
18+
19+
```
20+
-h, --help help for assign-role
21+
-i, --id string [required] Channel id
22+
-r, --role string [required] Channel role name to assign
23+
-t, --type string [required] Channel type such as 'messaging' or 'livestream'
24+
-u, --user-id string [required] User id to assign a role to
25+
```
26+
27+
### Options inherited from parent commands
28+
29+
```
30+
--app string [optional] Application name to use as it's defined in the configuration file
31+
--config string [optional] Explicit config file path
32+
```
33+
34+
### SEE ALSO
35+
36+
* [stream-cli chat](stream-cli_chat.md) - Allows you to interact with your Chat applications
37+

docs/stream-cli_chat_create-token.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ $ stream-cli chat create-token --user joe --expiration 1577880000 --issued-at 15
3333
-e, --expiration int [optional] Expiration (exp) of the JWT in epoch timestamp
3434
-h, --help help for create-token
3535
-i, --issued-at int [optional] Issued at (iat) of the JWT in epoch timestamp
36-
-u, --user string [required] Id of the user to create token for
36+
-u, --user string [required] ID of the user to create token for
3737
```
3838

3939
### Options inherited from parent commands

docs/stream-cli_chat_delete-message.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Delete a message
77
You can delete a message by calling DeleteMessage and including a message
88
with an ID. Messages can be soft deleted or hard deleted. Unless specified
99
via the hard parameter, messages are soft deleted. Be aware that deleting
10-
a message doesn't delete its attachments.
10+
a message doesn't delete its attachments.
1111

1212

1313
```
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
## stream-cli chat delete-users
2+
3+
Delete multiple users
4+
5+
### Synopsis
6+
7+
You can delete up to 100 users and optionally all of their channels and
8+
messages using this method. First the users are marked deleted synchronously
9+
so the user will not be directly visible in the API. Then the process deletes
10+
the user and related objects asynchronously by scheduling a task to be handle
11+
by the task worker.
12+
13+
The delete users response contain a task ID which can be polled using the
14+
get task endpoint to check the status of the deletions.
15+
16+
Note: when deleting a user with hard delete, it also required hard deletion
17+
for messages and conversations as well!
18+
19+
20+
```
21+
stream-cli chat delete-users --new-channel-user-id [user-id] --hard-delete-users [true|false] --hard-delete-messages [true|false] --hard-delete-conversations [user-id1] [user-id2] ... [flags]
22+
```
23+
24+
### Examples
25+
26+
```
27+
# Soft delete users with ids 'my-user-1' and 'my-user-2'
28+
$ stream-cli chat delete-users my-user-1 my-user-2
29+
> Successfully initiated user deletion. Task id: bf1c2d1b-04d6-4e67-873c-5b3ade478b0a
30+
# Waiting for it to succeed
31+
$ stream-cli chat watch bf1c2d1b-04d6-4e67-873c-5b3ade478b0a
32+
> Async operation completed successfully.
33+
34+
# Hard delete users with ids 'my-user-3' and 'my-user-4'
35+
$ stream-cli chat delete-users --hard-delete-users --hard-delete-messages --hard-delete-conversations my-user-3 my-user-4
36+
> Successfully initiated user deletion. Task id: 71516d9a-0764-4aa8-b017-8d2a99748e16
37+
38+
# Waiting for it to succeed
39+
$ stream-cli chat watch 71516d9a-0764-4aa8-b017-8d2a99748e16
40+
> Async operation completed successfully.
41+
42+
```
43+
44+
### Options
45+
46+
```
47+
--hard-delete-conversations [optional] Hard delete all conversations related to the users
48+
--hard-delete-messages [optional] Hard delete all messages related to the users
49+
--hard-delete-users [optional] Hard delete everything related to the users
50+
-h, --help help for delete-users
51+
--new-channel-owner-id string [optional] Channels owned by hard-deleted users will be transferred to this userID
52+
```
53+
54+
### Options inherited from parent commands
55+
56+
```
57+
--app string [optional] Application name to use as it's defined in the configuration file
58+
--config string [optional] Explicit config file path
59+
```
60+
61+
### SEE ALSO
62+
63+
* [stream-cli chat](stream-cli_chat.md) - Allows you to interact with your Chat applications
64+

docs/stream-cli_chat_get-import.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
Get import
44

55
```
6-
stream-cli chat get-import [import-id] --output-format [json|tree] [flags]
6+
stream-cli chat get-import [import-id] --output-format [json|tree] --watch [flags]
77
```
88

99
### Examples
@@ -12,8 +12,8 @@ stream-cli chat get-import [import-id] --output-format [json|tree] [flags]
1212
# Returns an import and prints it as JSON
1313
$ stream-cli chat get-import dcb6e366-93ec-4e52-af6f-b0c030ad5272
1414
15-
# Returns an import and prints it as a browsable tree
16-
$ stream-cli chat get-import dcb6e366-93ec-4e52-af6f-b0c030ad5272 --output-format tree
15+
# Returns an import and prints it as JSON, and wait for it to complete
16+
$ stream-cli chat get-import dcb6e366-93ec-4e52-af6f-b0c030ad5272 --watch
1717
1818
```
1919

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
## stream-cli chat listen-events
2+
3+
Listen to events
4+
5+
### Synopsis
6+
7+
The command opens a WebSocket connection to the backend in the name of the user
8+
and prints the received events to the standard output.
9+
Press Ctrl+C to exit.
10+
11+
12+
```
13+
stream-cli chat listen-events --user-id [user-id] --timeout [number] [flags]
14+
```
15+
16+
### Examples
17+
18+
```
19+
# Listen to events for user with id 'my-user-1'
20+
$ stream-cli chat listen-events --user-id my-user-1
21+
22+
# Listen to events for user with id 'my-user-2' and keeping the connection open for 120 seconds
23+
$ stream-cli chat listen-events --user-id my-user-1 --timeout 120
24+
25+
```
26+
27+
### Options
28+
29+
```
30+
-h, --help help for listen-events
31+
-o, --output-format string [optional] Output format. Can be json or tree (default "json")
32+
-t, --timeout int32 [optional] For how many seconds do we keep the connection alive. Default is 60 seconds, max is 300. (default 60)
33+
-u, --user-id string [required] User ID
34+
```
35+
36+
### Options inherited from parent commands
37+
38+
```
39+
--app string [optional] Application name to use as it's defined in the configuration file
40+
--config string [optional] Explicit config file path
41+
```
42+
43+
### SEE ALSO
44+
45+
* [stream-cli chat](stream-cli_chat.md) - Allows you to interact with your Chat applications
46+

docs/stream-cli_chat_revoke-all-tokens.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Revoke all tokens
44

55
### Synopsis
66

7-
This command revokes ALL tokens for all users of an application.
7+
This command revokes ALL tokens for all users of an application.
88
This should be used with caution as it will expire every user’s token,
99
regardless of whether the token has an iat claim.
1010

0 commit comments

Comments
 (0)