1
0
Fork 0
mirror of synced 2024-05-20 20:52:36 +12:00

Merge branch 'master' of https://github.com/appwrite/appwrite into feat-database-indexing

This commit is contained in:
Torsten Dittmann 2021-12-17 14:59:55 +01:00
commit 5ebea37295
13 changed files with 95 additions and 36 deletions

View file

@ -8,13 +8,13 @@
<br />
</p>
[![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=friendly&color=90a88b&style=flat-square)](https://hacktoberfest.appwrite.io)
<!-- [![Hacktoberfest](https://img.shields.io/static/v1?label=hacktoberfest&message=friendly&color=90a88b&style=flat-square)](https://hacktoberfest.appwrite.io) -->
[![Discord](https://img.shields.io/discord/564160730845151244?label=discord&style=flat-square)](https://appwrite.io/discord?r=Github)
[![Docker Pulls](https://img.shields.io/docker/pulls/appwrite/appwrite?color=f02e65&style=flat-square)](https://hub.docker.com/r/appwrite/appwrite)
[![Build Status](https://img.shields.io/travis/com/appwrite/appwrite?style=flat-square)](https://travis-ci.com/appwrite/appwrite)
[![Twitter Account](https://img.shields.io/twitter/follow/appwrite?color=00acee&label=twitter&style=flat-square)](https://twitter.com/appwrite)
[![Translate](https://img.shields.io/badge/translate-f02e65?style=flat-square)](docs/tutorials/add-translations.md)
<!-- [![Swag Store](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io) -->
[![Swag Store](https://img.shields.io/badge/swag%20store-f02e65?style=flat-square)](https://store.appwrite.io)
[**Appwrite 0.11 has been released! Learn what's new!**](https://dev.to/appwrite/building-apps-just-got-swifter-announcing-appwrite-v011-4g62)

View file

@ -179,7 +179,7 @@ App::put('/v1/teams/:teamId')
->label('sdk.response.type', Response::CONTENT_TYPE_JSON)
->label('sdk.response.model', Response::MODEL_TEAM)
->param('teamId', '', new UID(), 'Team ID.')
->param('name', null, new Text(128), 'Team name. Max length: 128 chars.')
->param('name', null, new Text(128), 'New team name. Max length: 128 chars.')
->inject('response')
->inject('dbForInternal')
->action(function ($teamId, $name, $response, $dbForInternal) {
@ -270,10 +270,10 @@ App::post('/v1/teams/:teamId/memberships')
->label('sdk.response.model', Response::MODEL_MEMBERSHIP)
->label('abuse-limit', 10)
->param('teamId', '', new UID(), 'Team ID.')
->param('email', '', new Email(), 'Team member email.')
->param('email', '', new Email(), 'Email of the new team member.')
->param('roles', [], new ArrayList(new Key()), 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](/docs/permissions). Max length for each role is 32 chars.')
->param('url', '', function ($clients) { return new Host($clients); }, 'URL to redirect the user back to your app from the invitation email. Only URLs from hostnames in your project platform list are allowed. This requirement helps to prevent an [open redirect](https://cheatsheetseries.owasp.org/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.html) attack against your project API.', false, ['clients']) // TODO add our own built-in confirm page
->param('name', '', new Text(128), 'Team member name. Max length: 128 chars.', true)
->param('name', '', new Text(128), 'Name of the new team member. Max length: 128 chars.', true)
->inject('response')
->inject('project')
->inject('user')
@ -515,13 +515,18 @@ App::get('/v1/teams/:teamId/memberships/:membershipId')
$membership = $dbForInternal->getDocument('memberships', $membershipId);
if($membership->isEmpty() || empty($membership->getAttribute('userId', null))) {
if($membership->isEmpty() || empty($membership->getAttribute('userId'))) {
throw new Exception('Membership not found', 404);
}
$temp = $dbForInternal->getDocument('users', $membership->getAttribute('userId', null))->getArrayCopy(['email', 'name']);
$user = $dbForInternal->getDocument('users', $membership->getAttribute('userId'));
$response->dynamic(new Document(\array_merge($temp, $membership->getArrayCopy())), Response::MODEL_MEMBERSHIP );
$membership
->setAttribute('name', $user->getAttribute('name'))
->setAttribute('email', $user->getAttribute('email'))
;
$response->dynamic($membership, Response::MODEL_MEMBERSHIP );
});
App::patch('/v1/teams/:teamId/memberships/:membershipId')
@ -538,7 +543,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId')
->label('sdk.response.model', Response::MODEL_MEMBERSHIP)
->param('teamId', '', new UID(), 'Team ID.')
->param('membershipId', '', new UID(), 'Membership ID.')
->param('roles', [], new ArrayList(new Key()), 'Array of strings. Use this param to set the user roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Max length for each role is 32 chars.')
->param('roles', [], new ArrayList(new Key()), 'An array of strings. Use this param to set the user\'s roles in the team. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Max length for each role is 32 chars.')
->inject('request')
->inject('response')
->inject('user')
@ -569,7 +574,7 @@ App::patch('/v1/teams/:teamId/memberships/:membershipId')
$isPrivilegedUser = Auth::isPrivilegedUser(Authorization::getRoles());
$isAppUser = Auth::isAppUser(Authorization::getRoles());
$isOwner = Authorization::isRole('team:'.$team->getId().'/owner');;
if (!$isOwner && !$isPrivilegedUser && !$isAppUser) { // Not owner, not admin, not app (server)
throw new Exception('User is not allowed to modify roles', 401);
}

View file

@ -1,5 +1,5 @@
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.
Invite a new member to join your team. If initiated from the client SDK, an email with a link to join the team will be sent to the member's email address and an account will be created for them should they not be signed up already. If initiated from server-side SDKs, the new member will automatically be added to the team.
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.
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.
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.
Please note that to avoid a [Redirect Attack](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 adding your platforms in the console interface.

View file

@ -1 +1 @@
Create a new team. The user who creates the team will automatically be assigned as the owner of the team. The team owner can invite new members, who will be able add new owners and update or delete the team from your project.
Create a new team. The user who creates the team will automatically be assigned as the owner of the team. Only the users with the owner role can invite new members, add new owners and delete or update the team.

View file

@ -1 +1 @@
Delete a team by its unique ID. Only team owners have write access for this resource.
Delete a team using its ID. Only team members with the owner role can delete the team.

View file

@ -1 +1 @@
Get a team members by the team unique ID. All team members have read access for this list of resources.
Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint.

View file

@ -1 +1 @@
Get a team by its unique ID. All team members have read access for this resource.
Get a team by its ID. All team members have read access for this resource.

View file

@ -1 +1,3 @@
Get a list of all the current user teams. You can use the query params to filter your results. On admin mode, this endpoint will return a list of all of the project's teams. [Learn more about different API modes](/docs/admin).
Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
In admin mode, this endpoint returns a list of all the teams in the current project. [Learn more about different API modes](/docs/admin).

View file

@ -0,0 +1 @@
Modify the roles of a team member. Only team members with the owner role have access to this endpoint. Learn more about [roles and permissions](/docs/permissions).

View file

@ -1 +1 @@
Update a team by its unique ID. Only team owners have write access for this resource.
Update a team using its ID. Only members with the owner role can update the team.

View file

@ -46,6 +46,23 @@ For **Mac OS** add your app name and Bundle ID, You can find your Bundle Identif
### Web
Appwrite 0.7, and the Appwrite Flutter SDK 0.3.0 have added support for Flutter Web. To build web apps that integrate with Appwrite successfully, all you have to do is add a web platform on your Appwrite project's dashboard and list the domain your website will use to allow communication to the Appwrite API.
For web in order to capture the OAuth2 callback URL and send it to the application using JavaScript `postMessage()`, you need to create an html file inside `./web` folder of your Flutter project. For example `auth.html` with the following content.
```html
<!DOCTYPE html>
<title>Authentication complete</title>
<p>Authentication is complete. If this does not happen automatically, please
close the window.
<script>
window.opener.postMessage({
flutter-web-auth: window.location.href
}, window.location.origin);
window.close();
</script>
```
Redirection URL passed to the authentication service must be the same as the URL on which the application is running (schema, host, port if necessary) and the path must point to created HTML file, /auth.html in this case. The callbackUrlScheme parameter of the authenticate() method does not take into account, so it is possible to use a schema for native platforms in the code.
#### Flutter Web Cross-Domain Communication & Cookies
While running Flutter Web, make sure your Appwrite server and your Flutter client are using the same top-level domain and the same protocol (HTTP or HTTPS) to communicate. When trying to communicate between different domains or protocols, you may receive HTTP status error 401 because some modern browsers block cross-site or insecure cookies for enhanced privacy. In production, Appwrite allows you set multiple [custom-domains](https://appwrite.io/docs/custom-domains) for each project.

View file

@ -612,20 +612,6 @@
"code": 61751,
"src": "fontawesome"
},
{
"uid": "00d86f3e46c3c3d768e7246eb0eadd7f",
"css": "discord",
"code": 59463,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M435 432.9C411.3 432.9 392.5 453.8 392.5 479.2S411.7 525.4 435 525.4C458.8 525.4 477.5 504.6 477.5 479.2 477.9 453.8 458.8 432.9 435 432.9ZM587.1 432.9C563.3 432.9 544.6 453.8 544.6 479.2S563.8 525.4 587.1 525.4C610.8 525.4 629.6 504.6 629.6 479.2S610.8 432.9 587.1 432.9ZM789.6 83.3H231.3C184.2 83.3 145.8 121.7 145.8 169.2V732.5C145.8 780 184.2 818.3 231.3 818.3H703.8L681.7 741.3 735 790.8 785.4 837.5 875 916.7V169.2C875 121.7 836.7 83.3 789.6 83.3ZM628.8 627.5S613.8 609.6 601.3 593.8C655.8 578.3 676.7 544.2 676.7 544.2 659.6 555.4 643.3 563.3 628.8 568.8 607.9 577.5 587.9 583.3 568.3 586.7 528.3 594.2 491.7 592.1 460.4 586.3 436.7 581.7 416.3 575 399.2 568.3 389.6 564.6 379.2 560 368.8 554.2 367.5 553.3 366.3 552.9 365 552.1 364.2 551.7 363.8 551.3 363.3 550.8 355.8 546.7 351.7 543.8 351.7 543.8S371.7 577.1 424.6 592.9C412.1 608.8 396.7 627.5 396.7 627.5 304.6 624.6 269.6 564.2 269.6 564.2 269.6 430 329.6 321.3 329.6 321.3 389.6 276.3 446.7 277.5 446.7 277.5L450.8 282.5C375.8 304.2 341.3 337.1 341.3 337.1S350.4 332.1 365.8 325C410.4 305.4 445.8 300 460.4 298.8 462.9 298.3 465 297.9 467.5 297.9 492.9 294.6 521.7 293.8 551.7 297.1 591.3 301.7 633.8 313.3 677.1 337.1 677.1 337.1 644.2 305.8 573.3 284.2L579.2 277.5S636.3 276.3 696.3 321.3C696.3 321.3 756.3 430 756.3 564.2 756.3 564.2 720.8 624.6 628.8 627.5Z",
"width": 1021
},
"search": [
"discord-logo-black"
]
},
{
"uid": "c2152732d525871cf35345955854f711",
"css": "moon-inv",
@ -789,6 +775,54 @@
"css": "boolean",
"code": 61957,
"src": "fontawesome"
},
{
"uid": "47a1f80457068fbeab69fdb83d7d0817",
"css": "youtube-play",
"code": 61802,
"src": "fontawesome"
},
{
"uid": "b6941a012434c6246e2ad74248b6453e",
"css": "discord",
"code": 59463,
"src": "custom_icons",
"selected": true,
"svg": {
"path": "M1006.7 168.6C940.3 138.1 869 115.6 794.5 102.8 793.2 102.5 791.8 103.2 791.1 104.4 781.9 120.7 771.8 142 764.7 158.7 684.6 146.7 604.9 146.7 526.4 158.7 519.3 141.6 508.7 120.7 499.5 104.4 498.8 103.2 497.5 102.6 496.1 102.8 421.7 115.6 350.4 138.1 284 168.6 283.4 168.8 282.9 169.3 282.6 169.8 147.4 371.7 110.4 568.6 128.6 763.1 128.6 764.1 129.2 765 129.9 765.5 219.1 831 305.4 870.8 390.2 897.1 391.6 897.5 393 897 393.9 895.9 413.9 868.5 431.8 839.7 447.1 809.3 448 807.5 447.2 805.4 445.3 804.7 417 794 390 780.9 364 766 361.9 764.8 361.8 761.8 363.7 760.4 369.1 756.3 374.6 752.1 379.8 747.8 380.8 747 382.1 746.8 383.2 747.3 553.8 825.2 738.5 825.2 907.1 747.3 908.2 746.8 909.5 746.9 910.5 747.7 915.7 752 921.1 756.3 926.7 760.4 928.5 761.8 928.4 764.8 926.4 766 900.4 781.1 873.4 794 845 804.7 843.2 805.4 842.3 807.5 843.2 809.3 858.9 839.6 876.8 868.5 896.5 895.9 897.3 897 898.8 897.5 900.1 897.1 985.3 870.8 1071.7 831 1160.8 765.5 1161.6 765 1162.1 764.1 1162.2 763.2 1183.9 538.3 1125.8 343 1008 169.8 1007.8 169.3 1007.3 168.8 1006.7 168.6ZM472.6 644.7C421.2 644.7 378.9 597.5 378.9 539.6 378.9 481.7 420.4 434.6 472.6 434.6 525.2 434.6 567.1 482.1 566.3 539.6 566.3 597.5 524.8 644.7 472.6 644.7ZM819 644.7C767.6 644.7 725.3 597.5 725.3 539.6 725.3 481.7 766.8 434.6 819 434.6 871.6 434.6 913.5 482.1 912.6 539.6 912.6 597.5 871.6 644.7 819 644.7Z",
"width": 1291
},
"search": [
"discord-logo-color"
]
},
{
"uid": "00d86f3e46c3c3d768e7246eb0eadd7f",
"css": "discord",
"code": 59463,
"src": "custom_icons",
"selected": false,
"svg": {
"path": "M435 432.9C411.3 432.9 392.5 453.8 392.5 479.2S411.7 525.4 435 525.4C458.8 525.4 477.5 504.6 477.5 479.2 477.9 453.8 458.8 432.9 435 432.9ZM587.1 432.9C563.3 432.9 544.6 453.8 544.6 479.2S563.8 525.4 587.1 525.4C610.8 525.4 629.6 504.6 629.6 479.2S610.8 432.9 587.1 432.9ZM789.6 83.3H231.3C184.2 83.3 145.8 121.7 145.8 169.2V732.5C145.8 780 184.2 818.3 231.3 818.3H703.8L681.7 741.3 735 790.8 785.4 837.5 875 916.7V169.2C875 121.7 836.7 83.3 789.6 83.3ZM628.8 627.5S613.8 609.6 601.3 593.8C655.8 578.3 676.7 544.2 676.7 544.2 659.6 555.4 643.3 563.3 628.8 568.8 607.9 577.5 587.9 583.3 568.3 586.7 528.3 594.2 491.7 592.1 460.4 586.3 436.7 581.7 416.3 575 399.2 568.3 389.6 564.6 379.2 560 368.8 554.2 367.5 553.3 366.3 552.9 365 552.1 364.2 551.7 363.8 551.3 363.3 550.8 355.8 546.7 351.7 543.8 351.7 543.8S371.7 577.1 424.6 592.9C412.1 608.8 396.7 627.5 396.7 627.5 304.6 624.6 269.6 564.2 269.6 564.2 269.6 430 329.6 321.3 329.6 321.3 389.6 276.3 446.7 277.5 446.7 277.5L450.8 282.5C375.8 304.2 341.3 337.1 341.3 337.1S350.4 332.1 365.8 325C410.4 305.4 445.8 300 460.4 298.8 462.9 298.3 465 297.9 467.5 297.9 492.9 294.6 521.7 293.8 551.7 297.1 591.3 301.7 633.8 313.3 677.1 337.1 677.1 337.1 644.2 305.8 573.3 284.2L579.2 277.5S636.3 276.3 696.3 321.3C696.3 321.3 756.3 430 756.3 564.2 756.3 564.2 720.8 624.6 628.8 627.5Z",
"width": 1021
},
"search": [
"discord-logo-black"
]
},
{
"uid": "097a1d40f8e785fbd260946461a6ea9c",
"css": "discord",
"code": 59463,
"src": "custom_icons",
"selected": false,
"svg": {
"path": "M1092.8 89.1C1010.5 51.3 922.3 23.5 830 7.6 828.4 7.2 826.7 8 825.8 9.6 814.5 29.7 801.9 56.1 793.1 76.8 693.9 61.9 595.2 61.9 498 76.8 489.2 55.6 476.2 29.7 464.8 9.6 463.9 8.1 462.2 7.3 460.5 7.6 368.3 23.4 280.1 51.2 197.8 89.1 197.1 89.4 196.5 89.9 196 90.5 28.7 340.6-17.2 584.4 5.3 825.3 5.4 826.5 6.1 827.6 7 828.3 117.4 909.4 224.4 958.6 329.4 991.3 331 991.8 332.8 991.2 333.9 989.8 358.7 955.9 380.9 920.1 399.8 882.5 401 880.3 399.9 877.7 397.6 876.8 362.5 863.5 329.1 847.3 296.9 828.8 294.4 827.3 294.1 823.7 296.5 822 303.3 816.9 310 811.6 316.5 806.3 317.7 805.3 319.3 805.1 320.7 805.7 531.9 902.2 760.6 902.2 969.4 805.7 970.8 805.1 972.4 805.3 973.6 806.2 980.1 811.6 986.9 816.9 993.7 822 996 823.7 995.9 827.3 993.3 828.8 961.2 847.6 927.7 863.5 892.6 876.8 890.3 877.6 889.3 880.3 890.4 882.5 909.8 920.1 931.9 955.8 956.3 989.7 957.3 991.2 959.1 991.8 960.8 991.3 1066.3 958.6 1173.3 909.4 1283.7 828.3 1284.6 827.6 1285.2 826.5 1285.4 825.3 1312.3 546.9 1240.3 305 1094.5 90.6 1094.1 89.9 1093.5 89.4 1092.8 89.1ZM431.4 678.6C367.8 678.6 315.4 620.2 315.4 548.5 315.4 476.8 366.8 418.4 431.4 418.4 496.5 418.4 548.4 477.3 547.4 548.5 547.4 620.2 496 678.6 431.4 678.6ZM860.3 678.6C796.7 678.6 744.3 620.2 744.3 548.5 744.3 476.8 795.7 418.4 860.3 418.4 925.5 418.4 977.4 477.3 976.3 548.5 976.3 620.2 925.5 678.6 860.3 678.6Z",
"width": 1291
},
"search": [
"discord-logo-color"
]
}
]
}

File diff suppressed because one or more lines are too long