react-native-appwrite 0.3.0 → 0.3.1

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.
@@ -0,0 +1,197 @@
1
+ import { Service } from '../service';
2
+ import { Client } from '../client';
3
+ import type { Models } from '../models';
4
+ export declare class Teams extends Service {
5
+ constructor(client: Client);
6
+ /**
7
+ * List teams
8
+ *
9
+ * Get a list of all the teams in which the current user is a member. You can
10
+ * use the parameters to filter your results.
11
+ *
12
+ * @param {string[]} queries
13
+ * @param {string} search
14
+ * @throws {AppwriteException}
15
+ * @returns {Promise}
16
+ */
17
+ list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>>;
18
+ /**
19
+ * Create team
20
+ *
21
+ * Create a new team. The user who creates the team will automatically be
22
+ * assigned as the owner of the team. Only the users with the owner role can
23
+ * invite new members, add new owners and delete or update the team.
24
+ *
25
+ * @param {string} teamId
26
+ * @param {string} name
27
+ * @param {string[]} roles
28
+ * @throws {AppwriteException}
29
+ * @returns {Promise}
30
+ */
31
+ create<Preferences extends Models.Preferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>>;
32
+ /**
33
+ * Get team
34
+ *
35
+ * Get a team by its ID. All team members have read access for this resource.
36
+ *
37
+ * @param {string} teamId
38
+ * @throws {AppwriteException}
39
+ * @returns {Promise}
40
+ */
41
+ get<Preferences extends Models.Preferences>(teamId: string): Promise<Models.Team<Preferences>>;
42
+ /**
43
+ * Update name
44
+ *
45
+ * Update the team's name by its unique ID.
46
+ *
47
+ * @param {string} teamId
48
+ * @param {string} name
49
+ * @throws {AppwriteException}
50
+ * @returns {Promise}
51
+ */
52
+ updateName<Preferences extends Models.Preferences>(teamId: string, name: string): Promise<Models.Team<Preferences>>;
53
+ /**
54
+ * Delete team
55
+ *
56
+ * Delete a team using its ID. Only team members with the owner role can
57
+ * delete the team.
58
+ *
59
+ * @param {string} teamId
60
+ * @throws {AppwriteException}
61
+ * @returns {Promise}
62
+ */
63
+ delete(teamId: string): Promise<{}>;
64
+ /**
65
+ * List team memberships
66
+ *
67
+ * Use this endpoint to list a team's members using the team's ID. All team
68
+ * members have read access to this endpoint.
69
+ *
70
+ * @param {string} teamId
71
+ * @param {string[]} queries
72
+ * @param {string} search
73
+ * @throws {AppwriteException}
74
+ * @returns {Promise}
75
+ */
76
+ listMemberships(teamId: string, queries?: string[], search?: string): Promise<Models.MembershipList>;
77
+ /**
78
+ * Create team membership
79
+ *
80
+ * Invite a new member to join your team. Provide an ID for existing users, or
81
+ * invite unregistered users using an email or phone number. If initiated from
82
+ * a Client SDK, Appwrite will send an email or sms with a link to join the
83
+ * team to the invited user, and an account will be created for them if one
84
+ * doesn't exist. If initiated from a Server SDK, the new member will be added
85
+ * automatically to the team.
86
+ *
87
+ * You only need to provide one of a user ID, email, or phone number. Appwrite
88
+ * will prioritize accepting the user ID > email > phone number if you provide
89
+ * more than one of these parameters.
90
+ *
91
+ * Use the `url` parameter to redirect the user from the invitation email to
92
+ * your app. After the user is redirected, use the [Update Team Membership
93
+ * Status](https://appwrite.io/docs/references/cloud/client-web/teams#updateMembershipStatus)
94
+ * endpoint to allow the user to accept the invitation to the team.
95
+ *
96
+ * Please note that to avoid a [Redirect
97
+ * Attack](https://github.com/OWASP/CheatSheetSeries/blob/master/cheatsheets/Unvalidated_Redirects_and_Forwards_Cheat_Sheet.md)
98
+ * Appwrite will accept the only redirect URLs under the domains you have
99
+ * added as a platform on the Appwrite Console.
100
+ *
101
+ *
102
+ * @param {string} teamId
103
+ * @param {string[]} roles
104
+ * @param {string} email
105
+ * @param {string} userId
106
+ * @param {string} phone
107
+ * @param {string} url
108
+ * @param {string} name
109
+ * @throws {AppwriteException}
110
+ * @returns {Promise}
111
+ */
112
+ createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership>;
113
+ /**
114
+ * Get team membership
115
+ *
116
+ * Get a team member by the membership unique id. All team members have read
117
+ * access for this resource.
118
+ *
119
+ * @param {string} teamId
120
+ * @param {string} membershipId
121
+ * @throws {AppwriteException}
122
+ * @returns {Promise}
123
+ */
124
+ getMembership(teamId: string, membershipId: string): Promise<Models.Membership>;
125
+ /**
126
+ * Update membership
127
+ *
128
+ * Modify the roles of a team member. Only team members with the owner role
129
+ * have access to this endpoint. Learn more about [roles and
130
+ * permissions](https://appwrite.io/docs/permissions).
131
+ *
132
+ *
133
+ * @param {string} teamId
134
+ * @param {string} membershipId
135
+ * @param {string[]} roles
136
+ * @throws {AppwriteException}
137
+ * @returns {Promise}
138
+ */
139
+ updateMembership(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership>;
140
+ /**
141
+ * Delete team membership
142
+ *
143
+ * This endpoint allows a user to leave a team or for a team owner to delete
144
+ * the membership of any other team member. You can also use this endpoint to
145
+ * delete a user membership even if it is not accepted.
146
+ *
147
+ * @param {string} teamId
148
+ * @param {string} membershipId
149
+ * @throws {AppwriteException}
150
+ * @returns {Promise}
151
+ */
152
+ deleteMembership(teamId: string, membershipId: string): Promise<{}>;
153
+ /**
154
+ * Update team membership status
155
+ *
156
+ * Use this endpoint to allow a user to accept an invitation to join a team
157
+ * after being redirected back to your app from the invitation email received
158
+ * by the user.
159
+ *
160
+ * If the request is successful, a session for the user is automatically
161
+ * created.
162
+ *
163
+ *
164
+ * @param {string} teamId
165
+ * @param {string} membershipId
166
+ * @param {string} userId
167
+ * @param {string} secret
168
+ * @throws {AppwriteException}
169
+ * @returns {Promise}
170
+ */
171
+ updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise<Models.Membership>;
172
+ /**
173
+ * Get team preferences
174
+ *
175
+ * Get the team's shared preferences by its unique ID. If a preference doesn't
176
+ * need to be shared by all team members, prefer storing them in [user
177
+ * preferences](https://appwrite.io/docs/references/cloud/client-web/account#getPrefs).
178
+ *
179
+ * @param {string} teamId
180
+ * @throws {AppwriteException}
181
+ * @returns {Promise}
182
+ */
183
+ getPrefs<Preferences extends Models.Preferences>(teamId: string): Promise<Preferences>;
184
+ /**
185
+ * Update preferences
186
+ *
187
+ * Update the team's preferences by its unique ID. The object you pass is
188
+ * stored as is and replaces any previous value. The maximum allowed prefs
189
+ * size is 64kB and throws an error if exceeded.
190
+ *
191
+ * @param {string} teamId
192
+ * @param {object} prefs
193
+ * @throws {AppwriteException}
194
+ * @returns {Promise}
195
+ */
196
+ updatePrefs<Preferences extends Models.Preferences>(teamId: string, prefs: object): Promise<Preferences>;
197
+ }