Updated SDKs
This commit is contained in:
parent
d52bd92d75
commit
45ee43064a
|
@ -138,12 +138,12 @@ func (srv *Account) UpdatePrefs(Prefs string) (map[string]interface{}, error) {
|
|||
return srv.client.Call("PATCH", path, nil, params)
|
||||
}
|
||||
|
||||
// CreateAccountRecovery sends the user an email with a temporary secret token
|
||||
// CreateAccountRecovery sends the user an email with a temporary secret key
|
||||
// for password reset. When the user clicks the confirmation link he is
|
||||
// redirected back to your app password reset redirect URL with a secret token
|
||||
// and email address values attached to the URL query string. Use the query
|
||||
// string params to submit a request to the /auth/password/reset endpoint to
|
||||
// complete the process.
|
||||
// redirected back to your app password reset URL with the secret key and
|
||||
// email address values attached to the URL query string. Use the query string
|
||||
// params to submit a request to the /auth/password/reset endpoint to complete
|
||||
// the process.
|
||||
func (srv *Account) CreateAccountRecovery(Email string, Url string) (map[string]interface{}, error) {
|
||||
path := "/account/recovery"
|
||||
|
||||
|
@ -156,7 +156,7 @@ func (srv *Account) CreateAccountRecovery(Email string, Url string) (map[string]
|
|||
}
|
||||
|
||||
// UpdateAccountRecovery use this endpoint to complete the user account
|
||||
// password reset. Both the **userId** and **token** arguments will be passed
|
||||
// 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 /auth/recovery endpoint.
|
||||
//
|
||||
|
@ -269,11 +269,11 @@ func (srv *Account) DeleteAccountSession(Id string) (map[string]interface{}, err
|
|||
|
||||
// CreateAccountVerification use this endpoint to send a verification message
|
||||
// to your user email address to confirm they are the valid owners of that
|
||||
// address. Both the **userId** and **token** arguments will be passed as
|
||||
// address. Both the **userId** and **secret** arguments will be passed as
|
||||
// query parameters to the URL you have provider to be attached to the
|
||||
// verification email. The provided URL should redirect the user back for your
|
||||
// app and allow you to complete the verification process by verifying both
|
||||
// the **userId** and **token** parameters. Learn more about how to [complete
|
||||
// the **userId** and **secret** parameters. Learn more about how to [complete
|
||||
// the verification process](/docs/account#updateAccountVerification).
|
||||
//
|
||||
// Please note that in order to avoid a [Redirect
|
||||
|
@ -291,8 +291,8 @@ func (srv *Account) CreateAccountVerification(Url string) (map[string]interface{
|
|||
}
|
||||
|
||||
// UpdateAccountVerification use this endpoint to complete the user email
|
||||
// verification process. Use both the **userId** and **token** parameters that
|
||||
// were attached to your app URL to verify the user email ownership. If
|
||||
// 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.
|
||||
func (srv *Account) UpdateAccountVerification(UserId string, Secret string, PasswordB string) (map[string]interface{}, error) {
|
||||
path := "/account/verification"
|
||||
|
|
|
@ -145,7 +145,7 @@ func (srv *Teams) DeleteTeamMembership(TeamId string, InviteId string) (map[stri
|
|||
// result with a 200 status code on success and with 401 status error on
|
||||
// failure. This behavior was applied to help the web clients deal with
|
||||
// browsers who don't allow to set 3rd party HTTP cookies needed for saving
|
||||
// the account session token.
|
||||
// the account session key.
|
||||
func (srv *Teams) UpdateTeamMembershipStatus(TeamId string, InviteId string, UserId string, Secret string) (map[string]interface{}, error) {
|
||||
r := strings.NewReplacer("{teamId}", TeamId, "{inviteId}", InviteId)
|
||||
path := r.Replace("/teams/{teamId}/memberships/{inviteId}/status")
|
||||
|
|
|
@ -579,12 +579,11 @@
|
|||
/**
|
||||
* Password Recovery
|
||||
*
|
||||
* Sends the user an email with a temporary secret token for password reset.
|
||||
* Sends the user an email with a temporary secret key for password reset.
|
||||
* When the user clicks the confirmation link he is redirected back to your
|
||||
* app password reset redirect URL with a secret token and email address
|
||||
* values attached to the URL query string. Use the query string params to
|
||||
* submit a request to the /auth/password/reset endpoint to complete the
|
||||
* process.
|
||||
* app password reset URL with the secret key and email address values
|
||||
* attached to the URL query string. Use the query string params to submit a
|
||||
* request to the /auth/password/reset endpoint to complete the process.
|
||||
*
|
||||
* @param {string} email
|
||||
* @param {string} url
|
||||
|
@ -622,7 +621,7 @@
|
|||
* Password Reset
|
||||
*
|
||||
* Use this endpoint to complete the user account password reset. Both the
|
||||
* **userId** and **token** arguments will be passed as query parameters to
|
||||
* **userId** and **secret** arguments will be passed as query parameters to
|
||||
* the redirect URL you have provided when sending your request to the
|
||||
* /auth/recovery endpoint.
|
||||
*
|
||||
|
@ -868,10 +867,10 @@
|
|||
*
|
||||
* Use this endpoint to send a verification message to your user email address
|
||||
* to confirm they are the valid owners of that address. Both the **userId**
|
||||
* and **token** arguments will be passed as query parameters to the URL you
|
||||
* and **secret** arguments will be passed as query parameters to the URL you
|
||||
* have provider to be attached to the verification email. The provided URL
|
||||
* should redirect the user back for your app and allow you to complete the
|
||||
* verification process by verifying both the **userId** and **token**
|
||||
* verification process by verifying both the **userId** and **secret**
|
||||
* parameters. Learn more about how to [complete the verification
|
||||
* process](/docs/account#updateAccountVerification).
|
||||
*
|
||||
|
@ -907,7 +906,7 @@
|
|||
* Updated Verification
|
||||
*
|
||||
* Use this endpoint to complete the user email verification process. Use both
|
||||
* the **userId** and **token** parameters that were attached to your app URL
|
||||
* 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.
|
||||
*
|
||||
|
@ -3513,7 +3512,7 @@
|
|||
* result with a 200 status code on success and with 401 status error on
|
||||
* failure. This behavior was applied to help the web clients deal with
|
||||
* browsers who don't allow to set 3rd party HTTP cookies needed for saving
|
||||
* the account session token.
|
||||
* the account session key.
|
||||
*
|
||||
* @param {string} teamId
|
||||
* @param {string} inviteId
|
||||
|
|
|
@ -214,12 +214,11 @@ class Account extends Service {
|
|||
/**
|
||||
* Password Recovery
|
||||
*
|
||||
* Sends the user an email with a temporary secret token for password reset.
|
||||
* Sends the user an email with a temporary secret key for password reset.
|
||||
* When the user clicks the confirmation link he is redirected back to your
|
||||
* app password reset redirect URL with a secret token and email address
|
||||
* values attached to the URL query string. Use the query string params to
|
||||
* submit a request to the /auth/password/reset endpoint to complete the
|
||||
* process.
|
||||
* app password reset URL with the secret key and email address values
|
||||
* attached to the URL query string. Use the query string params to submit a
|
||||
* request to the /auth/password/reset endpoint to complete the process.
|
||||
*
|
||||
* @param string email
|
||||
* @param string url
|
||||
|
@ -242,7 +241,7 @@ class Account extends Service {
|
|||
* Password Reset
|
||||
*
|
||||
* Use this endpoint to complete the user account password reset. Both the
|
||||
* **userId** and **token** arguments will be passed as query parameters to
|
||||
* **userId** and **secret** arguments will be passed as query parameters to
|
||||
* the redirect URL you have provided when sending your request to the
|
||||
* /auth/recovery endpoint.
|
||||
*
|
||||
|
@ -417,10 +416,10 @@ class Account extends Service {
|
|||
*
|
||||
* Use this endpoint to send a verification message to your user email address
|
||||
* to confirm they are the valid owners of that address. Both the **userId**
|
||||
* and **token** arguments will be passed as query parameters to the URL you
|
||||
* and **secret** arguments will be passed as query parameters to the URL you
|
||||
* have provider to be attached to the verification email. The provided URL
|
||||
* should redirect the user back for your app and allow you to complete the
|
||||
* verification process by verifying both the **userId** and **token**
|
||||
* verification process by verifying both the **userId** and **secret**
|
||||
* parameters. Learn more about how to [complete the verification
|
||||
* process](/docs/account#updateAccountVerification).
|
||||
*
|
||||
|
@ -448,7 +447,7 @@ class Account extends Service {
|
|||
* Updated Verification
|
||||
*
|
||||
* Use this endpoint to complete the user email verification process. Use both
|
||||
* the **userId** and **token** parameters that were attached to your app URL
|
||||
* 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.
|
||||
*
|
||||
|
|
|
@ -215,7 +215,7 @@ class Teams extends Service {
|
|||
* result with a 200 status code on success and with 401 status error on
|
||||
* failure. This behavior was applied to help the web clients deal with
|
||||
* browsers who don't allow to set 3rd party HTTP cookies needed for saving
|
||||
* the account session token.
|
||||
* the account session key.
|
||||
*
|
||||
* @param string teamId
|
||||
* @param string inviteId
|
||||
|
|
|
@ -118,7 +118,7 @@ PATCH https://appwrite.io/v1/account/prefs
|
|||
POST https://appwrite.io/v1/account/recovery
|
||||
```
|
||||
|
||||
** Sends the user an email with a temporary secret token for password reset. When the user clicks the confirmation link he is redirected back to your app password reset redirect URL with a secret token and email address values attached to the URL query string. Use the query string params to submit a request to the /auth/password/reset endpoint to complete the process. **
|
||||
** Sends the user an email with a temporary secret key for password reset. When the user clicks the confirmation link he is redirected back to your app password reset URL with the secret key and email address values attached to the URL query string. Use the query string params to submit a request to the /auth/password/reset endpoint to complete the process. **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
@ -133,7 +133,7 @@ POST https://appwrite.io/v1/account/recovery
|
|||
PUT https://appwrite.io/v1/account/recovery
|
||||
```
|
||||
|
||||
** Use this endpoint to complete the user account password reset. Both the **userId** and **token** arguments will be passed as query parameters to the redirect URL you have provided when sending your request to the /auth/recovery endpoint.
|
||||
** 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 /auth/recovery 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. **
|
||||
|
||||
|
@ -225,7 +225,7 @@ DELETE https://appwrite.io/v1/account/sessions/{id}
|
|||
POST https://appwrite.io/v1/account/verification
|
||||
```
|
||||
|
||||
** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **token** arguments will be passed as query parameters to the URL you have provider to be attached to the verification email. The provided URL should redirect the user back for your app and allow you to complete the verification process by verifying both the **userId** and **token** parameters. Learn more about how to [complete the verification process](/docs/account#updateAccountVerification).
|
||||
** Use this endpoint to send a verification message to your user email address to confirm they are the valid owners of that address. Both the **userId** and **secret** arguments will be passed as query parameters to the URL you have provider to be attached to the verification email. The provided URL should redirect the user back for your app and allow you to complete the verification process by verifying both the **userId** and **secret** parameters. Learn more about how to [complete the verification process](/docs/account#updateAccountVerification).
|
||||
|
||||
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. **
|
||||
|
||||
|
@ -241,7 +241,7 @@ Please note that in order to avoid a [Redirect Attack](https://github.com/OWASP/
|
|||
PUT https://appwrite.io/v1/account/verification
|
||||
```
|
||||
|
||||
** Use this endpoint to complete the user email verification process. Use both the **userId** and **token** parameters that were attached to your app URL to verify the user email ownership. If confirmed this route will return a 200 status code. **
|
||||
** 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. **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
|
|
@ -136,7 +136,7 @@ PATCH https://appwrite.io/v1/teams/{teamId}/memberships/{inviteId}/status
|
|||
|
||||
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.
|
||||
|
||||
When not using the success or failure redirect arguments this endpoint will result with a 200 status code on success and with 401 status error on failure. This behavior was applied to help the web clients deal with browsers who don't allow to set 3rd party HTTP cookies needed for saving the account session token. **
|
||||
When not using the success or failure redirect arguments this endpoint will result with a 200 status code on success and with 401 status error on failure. This behavior was applied to help the web clients deal with browsers who don't allow to set 3rd party HTTP cookies needed for saving the account session key. **
|
||||
|
||||
### Parameters
|
||||
|
||||
|
|
|
@ -229,12 +229,11 @@ class Account extends Service
|
|||
/**
|
||||
* Password Recovery
|
||||
*
|
||||
* Sends the user an email with a temporary secret token for password reset.
|
||||
* Sends the user an email with a temporary secret key for password reset.
|
||||
* When the user clicks the confirmation link he is redirected back to your
|
||||
* app password reset redirect URL with a secret token and email address
|
||||
* values attached to the URL query string. Use the query string params to
|
||||
* submit a request to the /auth/password/reset endpoint to complete the
|
||||
* process.
|
||||
* app password reset URL with the secret key and email address values
|
||||
* attached to the URL query string. Use the query string params to submit a
|
||||
* request to the /auth/password/reset endpoint to complete the process.
|
||||
*
|
||||
* @param string $email
|
||||
* @param string $url
|
||||
|
@ -258,7 +257,7 @@ class Account extends Service
|
|||
* Password Reset
|
||||
*
|
||||
* Use this endpoint to complete the user account password reset. Both the
|
||||
* **userId** and **token** arguments will be passed as query parameters to
|
||||
* **userId** and **secret** arguments will be passed as query parameters to
|
||||
* the redirect URL you have provided when sending your request to the
|
||||
* /auth/recovery endpoint.
|
||||
*
|
||||
|
@ -440,10 +439,10 @@ class Account extends Service
|
|||
*
|
||||
* Use this endpoint to send a verification message to your user email address
|
||||
* to confirm they are the valid owners of that address. Both the **userId**
|
||||
* and **token** arguments will be passed as query parameters to the URL you
|
||||
* and **secret** arguments will be passed as query parameters to the URL you
|
||||
* have provider to be attached to the verification email. The provided URL
|
||||
* should redirect the user back for your app and allow you to complete the
|
||||
* verification process by verifying both the **userId** and **token**
|
||||
* verification process by verifying both the **userId** and **secret**
|
||||
* parameters. Learn more about how to [complete the verification
|
||||
* process](/docs/account#updateAccountVerification).
|
||||
*
|
||||
|
@ -472,7 +471,7 @@ class Account extends Service
|
|||
* Updated Verification
|
||||
*
|
||||
* Use this endpoint to complete the user email verification process. Use both
|
||||
* the **userId** and **token** parameters that were attached to your app URL
|
||||
* 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.
|
||||
*
|
||||
|
|
|
@ -229,7 +229,7 @@ class Teams extends Service
|
|||
* result with a 200 status code on success and with 401 status error on
|
||||
* failure. This behavior was applied to help the web clients deal with
|
||||
* browsers who don't allow to set 3rd party HTTP cookies needed for saving
|
||||
* the account session token.
|
||||
* the account session key.
|
||||
*
|
||||
* @param string $teamId
|
||||
* @param string $inviteId
|
||||
|
|
|
@ -52,7 +52,7 @@ $cli
|
|||
$spec = getSSLPage('http://localhost/v1/open-api-2.json?extensions=1');
|
||||
|
||||
$result = realpath(__DIR__.'/..').'/sdks/'.$language['key'];
|
||||
$target = realpath(__DIR__.'/..').'/sdks/git/'.$language['key'];
|
||||
$target = realpath(__DIR__.'/..').'/sdks/git/'.$language['key'].'/';
|
||||
$readme = realpath(__DIR__ . '/../../docs/sdks/'.$language['key'].'.md');
|
||||
$readme = ($readme) ? file_get_contents($readme) : '';
|
||||
$warning = ($language['beta']) ? '**This SDK is compatible with Appwrite server version ' . $version . '. For older versions, please check previous releases.**' : '';
|
||||
|
@ -149,85 +149,31 @@ THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
|||
Console::error($exception->getMessage());
|
||||
}
|
||||
|
||||
var_dump('rm -rf '.$target.' && \
|
||||
$gitUrl = $language['gitUrl'];
|
||||
$gitUrl = 'git@github.com:aw-tests/'.$language['gitRepoName'].'.git';
|
||||
|
||||
exec('rm -rf '.$target.' && \
|
||||
mkdir -p '.$target.' && \
|
||||
cd '.$target.' && \
|
||||
git init && \
|
||||
git remote add origin '.$language['gitUrl'].' && \
|
||||
git remote add origin '.$gitUrl.' && \
|
||||
git fetch && \
|
||||
git pull '.$language['gitUrl'].' && \
|
||||
git pull '.$gitUrl.' && \
|
||||
rm -rf '.$target.'/* && \
|
||||
cp -r '.$result.' '.$target.' && \
|
||||
cp -r '.$result.'/ '.$target.'/ && \
|
||||
git add . && \
|
||||
git commit -m "'.$message.'" && \
|
||||
git push -u origin master');
|
||||
|
||||
Console::success("Pushed {$language['name']} SDK to {$language['url']}");
|
||||
Console::success("Pushed {$language['name']} SDK to {$gitUrl}");
|
||||
|
||||
exec('rm -rf '.$target);
|
||||
|
||||
Console::success("Remove temp directory '{$target}' for {$language['name']} SDK");
|
||||
}
|
||||
}
|
||||
|
||||
exit();
|
||||
|
||||
foreach ($clients as $name => $client) {
|
||||
|
||||
|
||||
|
||||
$sdk
|
||||
->setLicense($license)
|
||||
->setLicenseContent($licenseContent)
|
||||
->setVersion($client['version'])
|
||||
->setGitRepo($client['gitRepo'])
|
||||
->setGitURL($client['gitURL'])
|
||||
->setGitRepoName($client['gitRepoName'])
|
||||
->setGitUserName($client['gitUserName'])
|
||||
->setLogo('https://appwrite.io/images/github.png')
|
||||
->setURL('https://appwrite.io')
|
||||
->setShareText('Appwrite is a backend as a service for building web or mobile apps')
|
||||
->setShareURL('http://appwrite.io')
|
||||
->setShareTags('JS,javascript,reactjs,angular,ios,android')
|
||||
->setShareVia('appwrite_io')
|
||||
->setWarning($client['warning'])
|
||||
->setReadme(($client['readme'] && file_exists($client['readme'])) ? file_get_contents($client['readme']) : '');
|
||||
|
||||
try {
|
||||
$sdk->generate($client['result']);
|
||||
} catch (Exception $exception) {
|
||||
Console::error($exception->getMessage());
|
||||
} catch (Throwable $exception) {
|
||||
Console::error($exception->getMessage());
|
||||
}
|
||||
|
||||
var_dump('rm -rf '.$target.' && \
|
||||
mkdir -p '.$target.' && \
|
||||
cd '.$target.' && \
|
||||
git init && \
|
||||
git remote add origin '.$client['gitRepo'].' && \
|
||||
git fetch && \
|
||||
git pull '.$client['gitRepo'].' && \
|
||||
rm -rf '.$target.'/* && \
|
||||
cp -r '.$client['result'].' '.$target.' && \
|
||||
git add . && \
|
||||
git commit -m "Initial commit" && \
|
||||
git push -u origin master');
|
||||
|
||||
exec('rm -rf '.$target.' && \
|
||||
mkdir -p '.$target.' && \
|
||||
cd '.$target.' && \
|
||||
git init && \
|
||||
git remote add origin '.$client['gitRepo'].' && \
|
||||
git fetch && \
|
||||
git pull '.$client['gitRepo'].' && \
|
||||
rm -rf '.$target.'/* && \
|
||||
cp -r '.$client['result'].' '.$target.' && \
|
||||
git add . && \
|
||||
git commit -m "Initial commit" && \
|
||||
git push -u origin master');
|
||||
|
||||
Console::success("Pushing {$name} SDK to {$client['gitRepo']}");
|
||||
|
||||
exec('rm -rf '.$target);
|
||||
|
||||
Console::success("Remove temp directory '{$target}' for {$name} SDK");
|
||||
}
|
||||
});
|
||||
|
||||
$cli->run();
|
||||
|
|
Loading…
Reference in a new issue