Skip to content

Commit

Permalink
feat(version): support 0.12.0
Browse files Browse the repository at this point in the history
  • Loading branch information
lohanidamodar committed Jan 4, 2022
1 parent 40c51ee commit e13e859
Show file tree
Hide file tree
Showing 52 changed files with 853 additions and 243 deletions.
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Copyright (c) 2021 Appwrite (https://appwrite.io) and individual contributors.
Copyright (c) 2022 Appwrite (https://appwrite.io) and individual contributors.
All rights reserved.

Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
# Appwrite Command Line SDK

![License](https://img.shields.io/github/license/appwrite/sdk-for-cli.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-0.11.0-blue.svg?style=flat-square)
![Version](https://img.shields.io/badge/api%20version-0.12.0-blue.svg?style=flat-square)
[![Build Status](https://img.shields.io/travis/com/appwrite/sdk-generator?style=flat-square)](https://travis-ci.com/appwrite/sdk-generator)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord)

**This SDK is compatible with Appwrite server version 0.11.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).**
**This SDK is compatible with Appwrite server version 0.12.x. For older versions, please check [previous releases](https://github.com/appwrite/sdk-for-cli/releases).**

Appwrite is an open-source backend as a service server that abstract and simplify complex and repetitive development tasks behind a very simple to use REST API. Appwrite aims to help you develop your apps faster and in a more secure way. Use the Command Line SDK to integrate your app with the Appwrite server to easily start interacting with all of Appwrite backend APIs and tools. For full API documentation and tutorials go to [https://appwrite.io/docs](https://appwrite.io/docs)

Expand Down
37 changes: 23 additions & 14 deletions app/account.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,10 +72,11 @@

$cli
->task('updateEmail')
->label('description', "Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.\n\n")
->label('description', "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
\n\n")
->param('email', '' , new Wildcard() , 'User email.', false)
->param('password', '' , new Wildcard() , 'User password. Must be between 6 to 32 chars.', false)
->param('password', '' , new Wildcard() , 'User password. Must be at least 8 chars.', false)
->action(function ( $email, $password ) use ($parser) {
/** @var string $email */
/** @var string $password */
Expand All @@ -95,11 +96,18 @@
$cli
->task('getLogs')
->label('description', "Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.\n\n")
->action(function ( ) use ($parser) {
->param('limit', 25 , new Wildcard() , 'Maximum number of logs to return in response. By default will return maximum 25 results. Maximum of 100 results allowed per request.', true)
->param('offset', 0 , new Wildcard() , 'Offset value. The default value is 0. Use this value to manage pagination. [learn more about pagination](https://appwrite.io/docs/pagination)', true)
->action(function ( $limit, $offset ) use ($parser) {
/** @var integer $limit */
/** @var integer $offset */

$client = new Client();
$path = str_replace([], [], '/account/logs');
$params = [];
/** Query Params */
$params['limit'] = $limit;
$params['offset'] = $offset;
$response = $client->call(Client::METHOD_GET, $path, [
'content-type' => 'application/json',
], $params);
Expand Down Expand Up @@ -127,8 +135,8 @@
$cli
->task('updatePassword')
->label('description', "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth and Team Invites, oldPassword is optional.\n\n")
->param('password', '' , new Wildcard() , 'New user password. Must be between 6 to 32 chars.', false)
->param('oldPassword', '' , new Wildcard() , 'Old user password. Must be between 6 to 32 chars.', true)
->param('password', '' , new Wildcard() , 'New user password. Must be at least 8 chars.', false)
->param('oldPassword', '' , new Wildcard() , 'Current user password. Must be at least 8 chars.', true)
->action(function ( $password, $oldPassword ) use ($parser) {
/** @var string $password */
/** @var string $oldPassword */
Expand Down Expand Up @@ -203,10 +211,10 @@
->label('description', "Use this endpoint to complete the user account password reset. Both the **userId** and **secret** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the [POST /account/recovery](/docs/client/account#accountCreateRecovery) endpoint.
Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) the only valid redirect URLs are the ones from domains you have set when adding your platforms in the console interface.\n\n")
->param('userId', '' , new Wildcard() , 'User account UID address.', false)
->param('userId', '' , new Wildcard() , 'User ID.', false)
->param('secret', '' , new Wildcard() , 'Valid reset token.', false)
->param('password', '' , new Wildcard() , 'New password. Must be between 6 to 32 chars.', false)
->param('passwordAgain', '' , new Wildcard() , 'New password again. Must be between 6 to 32 chars.', false)
->param('password', '' , new Wildcard() , 'New user password. Must be at least 8 chars.', false)
->param('passwordAgain', '' , new Wildcard() , 'Repeat new user password. Must be at least 8 chars.', false)
->action(function ( $userId, $secret, $password, $passwordAgain ) use ($parser) {
/** @var string $userId */
/** @var string $secret */
Expand Down Expand Up @@ -258,7 +266,7 @@
$cli
->task('getSession')
->label('description', "Use this endpoint to get a logged in user's session using a Session ID. Inputting 'current' will return the current session being used.\n\n")
->param('sessionId', '' , new Wildcard() , 'Session unique ID. Use the string 'current' to get the current device session.', false)
->param('sessionId', '' , new Wildcard() , 'Session ID. Use the string 'current' to get the current device session.', false)
->action(function ( $sessionId ) use ($parser) {
/** @var string $sessionId */

Expand All @@ -274,7 +282,7 @@
$cli
->task('deleteSession')
->label('description', "Use this endpoint to log out the currently logged in user from all their account sessions across all of their different devices. When using the option id argument, only the session unique ID provider will be deleted.\n\n")
->param('sessionId', '' , new Wildcard() , 'Session unique ID. Use the string 'current' to delete the current device session.', false)
->param('sessionId', '' , new Wildcard() , 'Session ID. Use the string 'current' to delete the current device session.', false)
->action(function ( $sessionId ) use ($parser) {
/** @var string $sessionId */

Expand Down Expand Up @@ -311,7 +319,7 @@
$cli
->task('updateVerification')
->label('description', "Use this endpoint to complete the user email verification process. Use both the **userId** and **secret** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code.\n\n")
->param('userId', '' , new Wildcard() , 'User unique ID.', false)
->param('userId', '' , new Wildcard() , 'User ID.', false)
->param('secret', '' , new Wildcard() , 'Valid verification token.', false)
->action(function ( $userId, $secret ) use ($parser) {
/** @var string $userId */
Expand Down Expand Up @@ -346,8 +354,9 @@
$commands = [
"get" => "Get currently logged in user data as JSON object.",
"delete" => "Delete a currently logged in user account. Behind the scene, the user record is not deleted but permanently blocked from any access. This is done to avoid deleted accounts being overtaken by new users with the same email address. Any user-related resources like documents or storage files should be deleted separately.",
"updateEmail" => "Update currently logged in user account email address. After changing user address, user confirmation status is being reset and a new confirmation mail is sent. For security measures, user password is required to complete this request.
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.",
"updateEmail" => "Update currently logged in user account email address. After changing user address, the user confirmation status will get reset. A new confirmation email is not sent automatically however you can use the send confirmation email endpoint again to send the confirmation email. For security measures, user password is required to complete this request.
This endpoint can also be used to convert an anonymous account to a normal one, by passing an email address and a new password.
",
"getLogs" => "Get currently logged in user list of latest security activity logs. Each log returns user IP address, location and date and time of log.",
"updateName" => "Update currently logged in user account name.",
"updatePassword" => "Update currently logged in user password. For validation, user is required to pass in the new password, and the old password. For users created with OAuth and Team Invites, oldPassword is optional.",
Expand Down
2 changes: 1 addition & 1 deletion app/client.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@
->task('version')
->action(function() {
Console::log('CLI Version : 0.12.1');
Console::log('Server Version : 0.11.0');
Console::log('Server Version : 0.12.0');
});


Expand Down
Loading

0 comments on commit e13e859

Please sign in to comment.