Skip to content

Commit 7aee91f

Browse files
implement realtime feature
1 parent f9eb3ae commit 7aee91f

File tree

105 files changed

+380
-108
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

105 files changed

+380
-108
lines changed

README.md

Lines changed: 2 additions & 2 deletions

app/client.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,8 +109,8 @@
109109
$cli
110110
->task('version')
111111
->action(function() {
112-
Console::log('CLI Version : 0.11.0');
113-
Console::log('Server Version : 0.9.0');
112+
Console::log('CLI Version : 0.12.0');
113+
Console::log('Server Version : 0.10.0');
114114
});
115115

116116

app/teams.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@
173173

174174
$cli
175175
->task('createMembership')
176-
->label('description', "Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.
176+
->label('description', "Use this endpoint to invite a new member to join your team. If initiated from Client SDK, an email with a link to join the team will be sent to the new member's email address if the member doesn't exist in the project it will be created automatically. If initiated from server side SDKs, new member will automatically be added to the team.
177177
178-
Use the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
178+
Use the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team. While calling from side SDKs the redirect url can be empty string.
179179
180180
Please note that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.\n\n")
181181
->param('teamId', '' , new Wildcard() , 'Team unique ID.', false)
@@ -290,9 +290,9 @@
290290
"update" => "Update a team by its unique ID. Only team owners have write access for this resource.",
291291
"delete" => "Delete a team by its unique ID. Only team owners have write access for this resource.",
292292
"getMemberships" => "Get a team members by the team unique ID. All team members have read access for this list of resources.",
293-
"createMembership" => "Use this endpoint to invite a new member to join your team. An email with a link to join the team will be sent to the new member email address if the member doesn't exist in the project it will be created automatically.
293+
"createMembership" => "Use this endpoint to invite a new member to join your team. If initiated from Client SDK, an email with a link to join the team will be sent to the new member's email address if the member doesn't exist in the project it will be created automatically. If initiated from server side SDKs, new member will automatically be added to the team.
294294
295-
Use the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
295+
Use the 'URL' parameter to redirect the user from the invitation email back to your app. When the user is redirected, use the [Update Team Membership Status](/docs/client/teams#teamsUpdateMembershipStatus) endpoint to allow the user to accept the invitation to the team. While calling from side SDKs the redirect url can be empty string.
296296
297297
Please note that in order to avoid a [Redirect Attacks](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URL's are the once from domains you have set when added your platforms in the console interface.",
298298
"updateMembershipRoles" => "",

app/users.php

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,26 @@
125125
$parser->parseResponse($response);
126126
});
127127

128+
$cli
129+
->task('updateEmail')
130+
->label('description', "Update the user email by its unique ID.\n\n")
131+
->param('userId', '' , new Wildcard() , 'User unique ID.', false)
132+
->param('email', '' , new Wildcard() , 'User email.', false)
133+
->action(function ( $userId, $email ) use ($parser) {
134+
/** @var string $userId */
135+
/** @var string $email */
136+
137+
$client = new Client();
138+
$path = str_replace(['{userId}'], [$userId], '/users/{userId}/email');
139+
$params = [];
140+
/** Body Params */
141+
$params['email'] = $email;
142+
$response = $client->call(Client::METHOD_PATCH, $path, [
143+
'content-type' => 'application/json',
144+
], $params);
145+
$parser->parseResponse($response);
146+
});
147+
128148
$cli
129149
->task('getLogs')
130150
->label('description', "Get a user activity logs list by its unique ID.\n\n")
@@ -141,6 +161,46 @@
141161
$parser->parseResponse($response);
142162
});
143163

164+
$cli
165+
->task('updateName')
166+
->label('description', "Update the user name by its unique ID.\n\n")
167+
->param('userId', '' , new Wildcard() , 'User unique ID.', false)
168+
->param('name', '' , new Wildcard() , 'User name. Max length: 128 chars.', false)
169+
->action(function ( $userId, $name ) use ($parser) {
170+
/** @var string $userId */
171+
/** @var string $name */
172+
173+
$client = new Client();
174+
$path = str_replace(['{userId}'], [$userId], '/users/{userId}/name');
175+
$params = [];
176+
/** Body Params */
177+
$params['name'] = $name;
178+
$response = $client->call(Client::METHOD_PATCH, $path, [
179+
'content-type' => 'application/json',
180+
], $params);
181+
$parser->parseResponse($response);
182+
});
183+
184+
$cli
185+
->task('updatePassword')
186+
->label('description', "Update the user password by its unique ID.\n\n")
187+
->param('userId', '' , new Wildcard() , 'User unique ID.', false)
188+
->param('password', '' , new Wildcard() , 'New user password. Must be between 6 to 32 chars.', false)
189+
->action(function ( $userId, $password ) use ($parser) {
190+
/** @var string $userId */
191+
/** @var string $password */
192+
193+
$client = new Client();
194+
$path = str_replace(['{userId}'], [$userId], '/users/{userId}/password');
195+
$params = [];
196+
/** Body Params */
197+
$params['password'] = $password;
198+
$response = $client->call(Client::METHOD_PATCH, $path, [
199+
'content-type' => 'application/json',
200+
], $params);
201+
$parser->parseResponse($response);
202+
});
203+
144204
$cli
145205
->task('getPrefs')
146206
->label('description', "Get the user preferences by its unique ID.\n\n")
@@ -286,7 +346,10 @@
286346
"create" => "Create a new user.",
287347
"get" => "Get a user by its unique ID.",
288348
"delete" => "Delete a user by its unique ID.",
349+
"updateEmail" => "Update the user email by its unique ID.",
289350
"getLogs" => "Get a user activity logs list by its unique ID.",
351+
"updateName" => "Update the user name by its unique ID.",
352+
"updatePassword" => "Update the user password by its unique ID.",
290353
"getPrefs" => "Get the user preferences by its unique ID.",
291354
"updatePrefs" => "Update the user preferences by its unique ID. You can pass only the specific settings you wish to update.",
292355
"getSessions" => "Get the user sessions list by its unique ID.",
Lines changed: 3 additions & 1 deletion
Lines changed: 2 additions & 1 deletion
Lines changed: 2 additions & 1 deletion
Lines changed: 1 addition & 1 deletion

docs/examples/account/delete.md

Lines changed: 1 addition & 1 deletion

docs/examples/account/get-logs.md

Lines changed: 1 addition & 1 deletion

0 commit comments

Comments
 (0)