react-native-appwrite 0.11.0 → 0.13.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +84 -3
- package/dist/cjs/sdk.js +1854 -1121
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +1854 -1122
- package/dist/esm/sdk.js.map +1 -1
- package/docs/examples/account/create-email-password-session.md +4 -4
- package/docs/examples/account/create-email-token.md +5 -5
- package/docs/examples/account/{create-magic-u-r-l-token.md → create-magic-url-token.md} +6 -6
- package/docs/examples/account/create-mfa-authenticator.md +3 -3
- package/docs/examples/account/create-mfa-challenge.md +3 -3
- package/docs/examples/account/create-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/{create-o-auth2token.md → create-o-auth-2-session.md} +6 -6
- package/docs/examples/account/{create-o-auth2session.md → create-o-auth-2-token.md} +6 -6
- package/docs/examples/account/create-phone-token.md +4 -4
- package/docs/examples/account/create-push-target.md +5 -5
- package/docs/examples/account/create-recovery.md +4 -4
- package/docs/examples/account/create-session.md +4 -4
- package/docs/examples/account/create-verification.md +3 -3
- package/docs/examples/account/create.md +6 -6
- package/docs/examples/account/delete-identity.md +3 -3
- package/docs/examples/account/delete-mfa-authenticator.md +3 -3
- package/docs/examples/account/delete-push-target.md +3 -3
- package/docs/examples/account/delete-session.md +3 -3
- package/docs/examples/account/get-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/get-session.md +3 -3
- package/docs/examples/account/list-identities.md +3 -3
- package/docs/examples/account/list-logs.md +3 -3
- package/docs/examples/account/list-mfa-factors.md +1 -1
- package/docs/examples/account/update-email.md +4 -4
- package/docs/examples/account/{update-magic-u-r-l-session.md → update-magic-url-session.md} +4 -4
- package/docs/examples/account/update-mfa-authenticator.md +4 -4
- package/docs/examples/account/update-mfa-challenge.md +4 -4
- package/docs/examples/account/update-mfa-recovery-codes.md +1 -1
- package/docs/examples/account/{update-m-f-a.md → update-mfa.md} +3 -3
- package/docs/examples/account/update-name.md +3 -3
- package/docs/examples/account/update-password.md +4 -4
- package/docs/examples/account/update-phone-session.md +4 -4
- package/docs/examples/account/update-phone-verification.md +4 -4
- package/docs/examples/account/update-phone.md +4 -4
- package/docs/examples/account/update-prefs.md +7 -3
- package/docs/examples/account/update-push-target.md +4 -4
- package/docs/examples/account/update-recovery.md +5 -5
- package/docs/examples/account/update-session.md +3 -3
- package/docs/examples/account/update-verification.md +4 -4
- package/docs/examples/avatars/get-browser.md +6 -6
- package/docs/examples/avatars/get-credit-card.md +6 -6
- package/docs/examples/avatars/get-favicon.md +3 -3
- package/docs/examples/avatars/get-flag.md +6 -6
- package/docs/examples/avatars/get-image.md +5 -5
- package/docs/examples/avatars/get-initials.md +6 -6
- package/docs/examples/avatars/{get-q-r.md → get-qr.md} +6 -6
- package/docs/examples/databases/create-document.md +13 -7
- package/docs/examples/databases/decrement-document-attribute.md +8 -8
- package/docs/examples/databases/delete-document.md +5 -5
- package/docs/examples/databases/get-document.md +6 -6
- package/docs/examples/databases/increment-document-attribute.md +8 -8
- package/docs/examples/databases/list-documents.md +5 -5
- package/docs/examples/databases/update-document.md +7 -7
- package/docs/examples/databases/upsert-document.md +7 -7
- package/docs/examples/functions/create-execution.md +9 -9
- package/docs/examples/functions/get-execution.md +4 -4
- package/docs/examples/functions/list-executions.md +4 -4
- package/docs/examples/graphql/mutation.md +3 -3
- package/docs/examples/graphql/query.md +3 -3
- package/docs/examples/messaging/create-subscriber.md +5 -5
- package/docs/examples/messaging/delete-subscriber.md +4 -4
- package/docs/examples/storage/create-file.md +6 -6
- package/docs/examples/storage/delete-file.md +4 -4
- package/docs/examples/storage/get-file-download.md +5 -5
- package/docs/examples/storage/get-file-preview.md +16 -16
- package/docs/examples/storage/get-file-view.md +5 -5
- package/docs/examples/storage/get-file.md +4 -4
- package/docs/examples/storage/list-files.md +5 -5
- package/docs/examples/storage/update-file.md +6 -6
- package/docs/examples/tablesdb/create-row.md +23 -0
- package/docs/examples/tablesdb/decrement-row-column.md +18 -0
- package/docs/examples/tablesdb/delete-row.md +15 -0
- package/docs/examples/tablesdb/get-row.md +16 -0
- package/docs/examples/tablesdb/increment-row-column.md +18 -0
- package/docs/examples/tablesdb/list-rows.md +15 -0
- package/docs/examples/tablesdb/update-row.md +17 -0
- package/docs/examples/tablesdb/upsert-row.md +17 -0
- package/docs/examples/teams/create-membership.md +9 -9
- package/docs/examples/teams/create.md +5 -5
- package/docs/examples/teams/delete-membership.md +4 -4
- package/docs/examples/teams/delete.md +3 -3
- package/docs/examples/teams/get-membership.md +4 -4
- package/docs/examples/teams/get-prefs.md +3 -3
- package/docs/examples/teams/get.md +3 -3
- package/docs/examples/teams/list-memberships.md +5 -5
- package/docs/examples/teams/list.md +4 -4
- package/docs/examples/teams/update-membership-status.md +6 -6
- package/docs/examples/teams/update-membership.md +5 -5
- package/docs/examples/teams/update-name.md +4 -4
- package/docs/examples/teams/update-prefs.md +4 -4
- package/package.json +1 -1
- package/src/client.ts +2 -2
- package/src/enums/credit-card.ts +1 -1
- package/src/enums/execution-method.ts +1 -0
- package/src/index.ts +1 -0
- package/src/models.ts +72 -27
- package/src/query.ts +247 -4
- package/src/services/account.ts +1469 -315
- package/src/services/avatars.ts +289 -80
- package/src/services/databases.ts +345 -63
- package/src/services/functions.ts +115 -20
- package/src/services/graphql.ts +52 -4
- package/src/services/locale.ts +8 -19
- package/src/services/messaging.ts +66 -7
- package/src/services/storage.ts +345 -76
- package/src/services/tables-db.ts +621 -0
- package/src/services/teams.ts +454 -93
- package/types/enums/credit-card.d.ts +1 -1
- package/types/enums/execution-method.d.ts +2 -1
- package/types/index.d.ts +1 -0
- package/types/models.d.ts +69 -25
- package/types/query.d.ts +201 -4
- package/types/services/account.d.ts +734 -280
- package/types/services/avatars.d.ts +168 -73
- package/types/services/databases.d.ts +199 -58
- package/types/services/functions.d.ts +62 -17
- package/types/services/graphql.d.ts +24 -2
- package/types/services/locale.d.ts +8 -19
- package/types/services/messaging.d.ts +33 -5
- package/types/services/storage.d.ts +201 -68
- package/types/services/tables-db.d.ts +245 -0
- package/types/services/teams.d.ts +242 -80
- /package/docs/examples/account/{create-j-w-t.md → create-jwt.md} +0 -0
- /package/docs/examples/locale/{list-countries-e-u.md → list-countries-eu.md} +0 -0
|
@@ -4,170 +4,332 @@ import type { Models } from '../models';
|
|
|
4
4
|
export declare class Teams extends Service {
|
|
5
5
|
constructor(client: Client);
|
|
6
6
|
/**
|
|
7
|
-
* Get a list of all the teams in which the current user is a member. You can
|
|
8
|
-
* use the parameters to filter your results.
|
|
7
|
+
* Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
|
|
9
8
|
*
|
|
10
|
-
* @param {string[]} queries
|
|
11
|
-
* @param {string} search
|
|
9
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan
|
|
10
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
12
11
|
* @throws {AppwriteException}
|
|
13
12
|
* @returns {Promise}
|
|
14
13
|
*/
|
|
14
|
+
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(params?: {
|
|
15
|
+
queries?: string[];
|
|
16
|
+
search?: string;
|
|
17
|
+
}): Promise<Models.TeamList<Preferences>>;
|
|
18
|
+
/**
|
|
19
|
+
* Get a list of all the teams in which the current user is a member. You can use the parameters to filter your results.
|
|
20
|
+
*
|
|
21
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: name, total, billingPlan
|
|
22
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
23
|
+
* @throws {AppwriteException}
|
|
24
|
+
* @returns {Promise<Models.TeamList<Preferences>>}
|
|
25
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
26
|
+
*/
|
|
15
27
|
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>>;
|
|
16
28
|
/**
|
|
17
|
-
* Create a new team. The user who creates the team will automatically be
|
|
18
|
-
* assigned as the owner of the team. Only the users with the owner role can
|
|
19
|
-
* invite new members, add new owners and delete or update the team.
|
|
29
|
+
* 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.
|
|
20
30
|
*
|
|
21
|
-
* @param {string} teamId
|
|
22
|
-
* @param {string} name
|
|
23
|
-
* @param {string[]} roles
|
|
31
|
+
* @param {string} params.teamId - Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
32
|
+
* @param {string} params.name - Team name. Max length: 128 chars.
|
|
33
|
+
* @param {string[]} params.roles - Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
|
24
34
|
* @throws {AppwriteException}
|
|
25
35
|
* @returns {Promise}
|
|
26
36
|
*/
|
|
37
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
38
|
+
teamId: string;
|
|
39
|
+
name: string;
|
|
40
|
+
roles?: string[];
|
|
41
|
+
}): Promise<Models.Team<Preferences>>;
|
|
42
|
+
/**
|
|
43
|
+
* 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.
|
|
44
|
+
*
|
|
45
|
+
* @param {string} teamId - Team ID. Choose a custom ID or generate a random ID with `ID.unique()`. Valid chars are a-z, A-Z, 0-9, period, hyphen, and underscore. Can't start with a special char. Max length is 36 chars.
|
|
46
|
+
* @param {string} name - Team name. Max length: 128 chars.
|
|
47
|
+
* @param {string[]} roles - Array of strings. Use this param to set the roles in the team for the user who created it. The default role is **owner**. A role can be any string. Learn more about [roles and permissions](https://appwrite.io/docs/permissions). Maximum of 100 roles are allowed, each 32 characters long.
|
|
48
|
+
* @throws {AppwriteException}
|
|
49
|
+
* @returns {Promise<Models.Team<Preferences>>}
|
|
50
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
51
|
+
*/
|
|
27
52
|
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>>;
|
|
28
53
|
/**
|
|
29
54
|
* Get a team by its ID. All team members have read access for this resource.
|
|
30
55
|
*
|
|
31
|
-
* @param {string} teamId
|
|
56
|
+
* @param {string} params.teamId - Team ID.
|
|
32
57
|
* @throws {AppwriteException}
|
|
33
58
|
* @returns {Promise}
|
|
34
59
|
*/
|
|
60
|
+
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
61
|
+
teamId: string;
|
|
62
|
+
}): Promise<Models.Team<Preferences>>;
|
|
63
|
+
/**
|
|
64
|
+
* Get a team by its ID. All team members have read access for this resource.
|
|
65
|
+
*
|
|
66
|
+
* @param {string} teamId - Team ID.
|
|
67
|
+
* @throws {AppwriteException}
|
|
68
|
+
* @returns {Promise<Models.Team<Preferences>>}
|
|
69
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
70
|
+
*/
|
|
35
71
|
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Models.Team<Preferences>>;
|
|
36
72
|
/**
|
|
37
73
|
* Update the team's name by its unique ID.
|
|
38
74
|
*
|
|
39
|
-
* @param {string} teamId
|
|
40
|
-
* @param {string} name
|
|
75
|
+
* @param {string} params.teamId - Team ID.
|
|
76
|
+
* @param {string} params.name - New team name. Max length: 128 chars.
|
|
41
77
|
* @throws {AppwriteException}
|
|
42
78
|
* @returns {Promise}
|
|
43
79
|
*/
|
|
80
|
+
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
81
|
+
teamId: string;
|
|
82
|
+
name: string;
|
|
83
|
+
}): Promise<Models.Team<Preferences>>;
|
|
84
|
+
/**
|
|
85
|
+
* Update the team's name by its unique ID.
|
|
86
|
+
*
|
|
87
|
+
* @param {string} teamId - Team ID.
|
|
88
|
+
* @param {string} name - New team name. Max length: 128 chars.
|
|
89
|
+
* @throws {AppwriteException}
|
|
90
|
+
* @returns {Promise<Models.Team<Preferences>>}
|
|
91
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
92
|
+
*/
|
|
44
93
|
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string): Promise<Models.Team<Preferences>>;
|
|
45
94
|
/**
|
|
46
|
-
* Delete a team using its ID. Only team members with the owner role can
|
|
47
|
-
* delete the team.
|
|
95
|
+
* Delete a team using its ID. Only team members with the owner role can delete the team.
|
|
48
96
|
*
|
|
49
|
-
* @param {string} teamId
|
|
97
|
+
* @param {string} params.teamId - Team ID.
|
|
50
98
|
* @throws {AppwriteException}
|
|
51
99
|
* @returns {Promise}
|
|
52
100
|
*/
|
|
101
|
+
delete(params: {
|
|
102
|
+
teamId: string;
|
|
103
|
+
}): Promise<{}>;
|
|
104
|
+
/**
|
|
105
|
+
* Delete a team using its ID. Only team members with the owner role can delete the team.
|
|
106
|
+
*
|
|
107
|
+
* @param {string} teamId - Team ID.
|
|
108
|
+
* @throws {AppwriteException}
|
|
109
|
+
* @returns {Promise<{}>}
|
|
110
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
111
|
+
*/
|
|
53
112
|
delete(teamId: string): Promise<{}>;
|
|
54
113
|
/**
|
|
55
|
-
* Use this endpoint to list a team's members using the team's ID. All team
|
|
56
|
-
* members have read access to this endpoint. Hide sensitive attributes from
|
|
57
|
-
* the response by toggling membership privacy in the Console.
|
|
114
|
+
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
|
58
115
|
*
|
|
59
|
-
* @param {string} teamId
|
|
60
|
-
* @param {string[]} queries
|
|
61
|
-
* @param {string} search
|
|
116
|
+
* @param {string} params.teamId - Team ID.
|
|
117
|
+
* @param {string[]} params.queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
|
|
118
|
+
* @param {string} params.search - Search term to filter your list results. Max length: 256 chars.
|
|
62
119
|
* @throws {AppwriteException}
|
|
63
120
|
* @returns {Promise}
|
|
64
121
|
*/
|
|
122
|
+
listMemberships(params: {
|
|
123
|
+
teamId: string;
|
|
124
|
+
queries?: string[];
|
|
125
|
+
search?: string;
|
|
126
|
+
}): Promise<Models.MembershipList>;
|
|
127
|
+
/**
|
|
128
|
+
* Use this endpoint to list a team's members using the team's ID. All team members have read access to this endpoint. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
|
129
|
+
*
|
|
130
|
+
* @param {string} teamId - Team ID.
|
|
131
|
+
* @param {string[]} queries - Array of query strings generated using the Query class provided by the SDK. [Learn more about queries](https://appwrite.io/docs/queries). Maximum of 100 queries are allowed, each 4096 characters long. You may filter on the following attributes: userId, teamId, invited, joined, confirm, roles
|
|
132
|
+
* @param {string} search - Search term to filter your list results. Max length: 256 chars.
|
|
133
|
+
* @throws {AppwriteException}
|
|
134
|
+
* @returns {Promise<Models.MembershipList>}
|
|
135
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
136
|
+
*/
|
|
65
137
|
listMemberships(teamId: string, queries?: string[], search?: string): Promise<Models.MembershipList>;
|
|
66
138
|
/**
|
|
67
|
-
* Invite a new member to join your team. Provide an ID for existing users, or
|
|
68
|
-
* invite unregistered users using an email or phone number. If initiated from
|
|
69
|
-
* a Client SDK, Appwrite will send an email or sms with a link to join the
|
|
70
|
-
* team to the invited user, and an account will be created for them if one
|
|
71
|
-
* doesn't exist. If initiated from a Server SDK, the new member will be added
|
|
72
|
-
* automatically to the team.
|
|
139
|
+
* Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.
|
|
73
140
|
*
|
|
74
|
-
* You only need to provide one of a user ID, email, or phone number. Appwrite
|
|
75
|
-
* will prioritize accepting the user ID > email > phone number if you provide
|
|
76
|
-
* more than one of these parameters.
|
|
141
|
+
* You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
|
|
77
142
|
*
|
|
78
|
-
* Use the `url` parameter to redirect the user from the invitation email to
|
|
79
|
-
* your app. After the user is redirected, use the [Update Team Membership
|
|
80
|
-
* Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus)
|
|
81
|
-
* endpoint to allow the user to accept the invitation to the team.
|
|
143
|
+
* Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
|
|
82
144
|
*
|
|
83
|
-
* Please note that to avoid a [Redirect
|
|
84
|
-
* Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
|
|
85
|
-
* Appwrite will accept the only redirect URLs under the domains you have
|
|
86
|
-
* added as a platform on the Appwrite Console.
|
|
145
|
+
* Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.
|
|
87
146
|
*
|
|
88
147
|
*
|
|
89
|
-
* @param {string} teamId
|
|
90
|
-
* @param {string[]} roles
|
|
91
|
-
* @param {string} email
|
|
92
|
-
* @param {string} userId
|
|
93
|
-
* @param {string} phone
|
|
94
|
-
* @param {string} url
|
|
95
|
-
* @param {string} name
|
|
148
|
+
* @param {string} params.teamId - Team ID.
|
|
149
|
+
* @param {string[]} params.roles - 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). Maximum of 100 roles are allowed, each 32 characters long.
|
|
150
|
+
* @param {string} params.email - Email of the new team member.
|
|
151
|
+
* @param {string} params.userId - ID of the user to be added to a team.
|
|
152
|
+
* @param {string} params.phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
153
|
+
* @param {string} params.url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.
|
|
154
|
+
* @param {string} params.name - Name of the new team member. Max length: 128 chars.
|
|
96
155
|
* @throws {AppwriteException}
|
|
97
156
|
* @returns {Promise}
|
|
98
157
|
*/
|
|
158
|
+
createMembership(params: {
|
|
159
|
+
teamId: string;
|
|
160
|
+
roles: string[];
|
|
161
|
+
email?: string;
|
|
162
|
+
userId?: string;
|
|
163
|
+
phone?: string;
|
|
164
|
+
url?: string;
|
|
165
|
+
name?: string;
|
|
166
|
+
}): Promise<Models.Membership>;
|
|
167
|
+
/**
|
|
168
|
+
* Invite a new member to join your team. Provide an ID for existing users, or invite unregistered users using an email or phone number. If initiated from a Client SDK, Appwrite will send an email or sms with a link to join the team to the invited user, and an account will be created for them if one doesn't exist. If initiated from a Server SDK, the new member will be added automatically to the team.
|
|
169
|
+
*
|
|
170
|
+
* You only need to provide one of a user ID, email, or phone number. Appwrite will prioritize accepting the user ID > email > phone number if you provide more than one of these parameters.
|
|
171
|
+
*
|
|
172
|
+
* Use the `url` parameter to redirect the user from the invitation email to your app. After the user is redirected, use the [Update Team Membership Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus) endpoint to allow the user to accept the invitation to the team.
|
|
173
|
+
*
|
|
174
|
+
* Please note that to avoid a [Redirect Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md) Appwrite will accept the only redirect URLs under the domains you have added as a platform on the Appwrite Console.
|
|
175
|
+
*
|
|
176
|
+
*
|
|
177
|
+
* @param {string} teamId - Team ID.
|
|
178
|
+
* @param {string[]} roles - 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). Maximum of 100 roles are allowed, each 32 characters long.
|
|
179
|
+
* @param {string} email - Email of the new team member.
|
|
180
|
+
* @param {string} userId - ID of the user to be added to a team.
|
|
181
|
+
* @param {string} phone - Phone number. Format this number with a leading '+' and a country code, e.g., +16175551212.
|
|
182
|
+
* @param {string} url - URL to redirect the user back to your app from the invitation email. This parameter is not required when an API key is supplied. 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.
|
|
183
|
+
* @param {string} name - Name of the new team member. Max length: 128 chars.
|
|
184
|
+
* @throws {AppwriteException}
|
|
185
|
+
* @returns {Promise<Models.Membership>}
|
|
186
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
187
|
+
*/
|
|
99
188
|
createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership>;
|
|
100
189
|
/**
|
|
101
|
-
* Get a team member by the membership unique id. All team members have read
|
|
102
|
-
* access for this resource. Hide sensitive attributes from the response by
|
|
103
|
-
* toggling membership privacy in the Console.
|
|
190
|
+
* Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
|
104
191
|
*
|
|
105
|
-
* @param {string} teamId
|
|
106
|
-
* @param {string} membershipId
|
|
192
|
+
* @param {string} params.teamId - Team ID.
|
|
193
|
+
* @param {string} params.membershipId - Membership ID.
|
|
107
194
|
* @throws {AppwriteException}
|
|
108
195
|
* @returns {Promise}
|
|
109
196
|
*/
|
|
197
|
+
getMembership(params: {
|
|
198
|
+
teamId: string;
|
|
199
|
+
membershipId: string;
|
|
200
|
+
}): Promise<Models.Membership>;
|
|
201
|
+
/**
|
|
202
|
+
* Get a team member by the membership unique id. All team members have read access for this resource. Hide sensitive attributes from the response by toggling membership privacy in the Console.
|
|
203
|
+
*
|
|
204
|
+
* @param {string} teamId - Team ID.
|
|
205
|
+
* @param {string} membershipId - Membership ID.
|
|
206
|
+
* @throws {AppwriteException}
|
|
207
|
+
* @returns {Promise<Models.Membership>}
|
|
208
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
209
|
+
*/
|
|
110
210
|
getMembership(teamId: string, membershipId: string): Promise<Models.Membership>;
|
|
111
211
|
/**
|
|
112
|
-
* Modify the roles of a team member. Only team members with the owner role
|
|
113
|
-
* have access to this endpoint. Learn more about [roles and
|
|
114
|
-
* permissions](https://appwrite.io/docs/permissions).
|
|
212
|
+
* 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](https://appwrite.io/docs/permissions).
|
|
115
213
|
*
|
|
116
214
|
*
|
|
117
|
-
* @param {string} teamId
|
|
118
|
-
* @param {string} membershipId
|
|
119
|
-
* @param {string[]} roles
|
|
215
|
+
* @param {string} params.teamId - Team ID.
|
|
216
|
+
* @param {string} params.membershipId - Membership ID.
|
|
217
|
+
* @param {string[]} params.roles - 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). Maximum of 100 roles are allowed, each 32 characters long.
|
|
120
218
|
* @throws {AppwriteException}
|
|
121
219
|
* @returns {Promise}
|
|
122
220
|
*/
|
|
221
|
+
updateMembership(params: {
|
|
222
|
+
teamId: string;
|
|
223
|
+
membershipId: string;
|
|
224
|
+
roles: string[];
|
|
225
|
+
}): Promise<Models.Membership>;
|
|
226
|
+
/**
|
|
227
|
+
* 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](https://appwrite.io/docs/permissions).
|
|
228
|
+
*
|
|
229
|
+
*
|
|
230
|
+
* @param {string} teamId - Team ID.
|
|
231
|
+
* @param {string} membershipId - Membership ID.
|
|
232
|
+
* @param {string[]} roles - 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). Maximum of 100 roles are allowed, each 32 characters long.
|
|
233
|
+
* @throws {AppwriteException}
|
|
234
|
+
* @returns {Promise<Models.Membership>}
|
|
235
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
236
|
+
*/
|
|
123
237
|
updateMembership(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership>;
|
|
124
238
|
/**
|
|
125
|
-
* This endpoint allows a user to leave a team or for a team owner to delete
|
|
126
|
-
* the membership of any other team member. You can also use this endpoint to
|
|
127
|
-
* delete a user membership even if it is not accepted.
|
|
239
|
+
* This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.
|
|
128
240
|
*
|
|
129
|
-
* @param {string} teamId
|
|
130
|
-
* @param {string} membershipId
|
|
241
|
+
* @param {string} params.teamId - Team ID.
|
|
242
|
+
* @param {string} params.membershipId - Membership ID.
|
|
131
243
|
* @throws {AppwriteException}
|
|
132
244
|
* @returns {Promise}
|
|
133
245
|
*/
|
|
246
|
+
deleteMembership(params: {
|
|
247
|
+
teamId: string;
|
|
248
|
+
membershipId: string;
|
|
249
|
+
}): Promise<{}>;
|
|
250
|
+
/**
|
|
251
|
+
* This endpoint allows a user to leave a team or for a team owner to delete the membership of any other team member. You can also use this endpoint to delete a user membership even if it is not accepted.
|
|
252
|
+
*
|
|
253
|
+
* @param {string} teamId - Team ID.
|
|
254
|
+
* @param {string} membershipId - Membership ID.
|
|
255
|
+
* @throws {AppwriteException}
|
|
256
|
+
* @returns {Promise<{}>}
|
|
257
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
258
|
+
*/
|
|
134
259
|
deleteMembership(teamId: string, membershipId: string): Promise<{}>;
|
|
135
260
|
/**
|
|
136
|
-
* Use this endpoint to allow a user to accept an invitation to join a team
|
|
137
|
-
* after being redirected back to your app from the invitation email received
|
|
138
|
-
* by the user.
|
|
261
|
+
* Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
|
|
139
262
|
*
|
|
140
|
-
* If the request is successful, a session for the user is automatically
|
|
141
|
-
* created.
|
|
263
|
+
* If the request is successful, a session for the user is automatically created.
|
|
142
264
|
*
|
|
143
265
|
*
|
|
144
|
-
* @param {string} teamId
|
|
145
|
-
* @param {string} membershipId
|
|
146
|
-
* @param {string} userId
|
|
147
|
-
* @param {string} secret
|
|
266
|
+
* @param {string} params.teamId - Team ID.
|
|
267
|
+
* @param {string} params.membershipId - Membership ID.
|
|
268
|
+
* @param {string} params.userId - User ID.
|
|
269
|
+
* @param {string} params.secret - Secret key.
|
|
148
270
|
* @throws {AppwriteException}
|
|
149
271
|
* @returns {Promise}
|
|
150
272
|
*/
|
|
273
|
+
updateMembershipStatus(params: {
|
|
274
|
+
teamId: string;
|
|
275
|
+
membershipId: string;
|
|
276
|
+
userId: string;
|
|
277
|
+
secret: string;
|
|
278
|
+
}): Promise<Models.Membership>;
|
|
279
|
+
/**
|
|
280
|
+
* Use this endpoint to allow a user to accept an invitation to join a team after being redirected back to your app from the invitation email received by the user.
|
|
281
|
+
*
|
|
282
|
+
* If the request is successful, a session for the user is automatically created.
|
|
283
|
+
*
|
|
284
|
+
*
|
|
285
|
+
* @param {string} teamId - Team ID.
|
|
286
|
+
* @param {string} membershipId - Membership ID.
|
|
287
|
+
* @param {string} userId - User ID.
|
|
288
|
+
* @param {string} secret - Secret key.
|
|
289
|
+
* @throws {AppwriteException}
|
|
290
|
+
* @returns {Promise<Models.Membership>}
|
|
291
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
292
|
+
*/
|
|
151
293
|
updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise<Models.Membership>;
|
|
152
294
|
/**
|
|
153
|
-
* Get the team's shared preferences by its unique ID. If a preference doesn't
|
|
154
|
-
* need to be shared by all team members, prefer storing them in [user
|
|
155
|
-
* preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
|
|
295
|
+
* Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
|
|
156
296
|
*
|
|
157
|
-
* @param {string} teamId
|
|
297
|
+
* @param {string} params.teamId - Team ID.
|
|
158
298
|
* @throws {AppwriteException}
|
|
159
299
|
* @returns {Promise}
|
|
160
300
|
*/
|
|
301
|
+
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
302
|
+
teamId: string;
|
|
303
|
+
}): Promise<Preferences>;
|
|
304
|
+
/**
|
|
305
|
+
* Get the team's shared preferences by its unique ID. If a preference doesn't need to be shared by all team members, prefer storing them in [user preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
|
|
306
|
+
*
|
|
307
|
+
* @param {string} teamId - Team ID.
|
|
308
|
+
* @throws {AppwriteException}
|
|
309
|
+
* @returns {Promise<Preferences>}
|
|
310
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
311
|
+
*/
|
|
161
312
|
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Preferences>;
|
|
162
313
|
/**
|
|
163
|
-
* Update the team's preferences by its unique ID. The object you pass is
|
|
164
|
-
* stored as is and replaces any previous value. The maximum allowed prefs
|
|
165
|
-
* size is 64kB and throws an error if exceeded.
|
|
314
|
+
* Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.
|
|
166
315
|
*
|
|
167
|
-
* @param {string} teamId
|
|
168
|
-
* @param {object} prefs
|
|
316
|
+
* @param {string} params.teamId - Team ID.
|
|
317
|
+
* @param {object} params.prefs - Prefs key-value JSON object.
|
|
169
318
|
* @throws {AppwriteException}
|
|
170
319
|
* @returns {Promise}
|
|
171
320
|
*/
|
|
321
|
+
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(params: {
|
|
322
|
+
teamId: string;
|
|
323
|
+
prefs: object;
|
|
324
|
+
}): Promise<Preferences>;
|
|
325
|
+
/**
|
|
326
|
+
* Update the team's preferences by its unique ID. The object you pass is stored as is and replaces any previous value. The maximum allowed prefs size is 64kB and throws an error if exceeded.
|
|
327
|
+
*
|
|
328
|
+
* @param {string} teamId - Team ID.
|
|
329
|
+
* @param {object} prefs - Prefs key-value JSON object.
|
|
330
|
+
* @throws {AppwriteException}
|
|
331
|
+
* @returns {Promise<Preferences>}
|
|
332
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
333
|
+
*/
|
|
172
334
|
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, prefs: object): Promise<Preferences>;
|
|
173
335
|
}
|
|
File without changes
|
|
File without changes
|