react-native-appwrite 0.10.1 → 0.11.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/CHANGELOG.md +7 -1
- package/dist/cjs/sdk.js +173 -97
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +173 -97
- package/dist/esm/sdk.js.map +1 -1
- package/docs/examples/databases/create-document.md +1 -3
- package/docs/examples/databases/decrement-document-attribute.md +18 -0
- package/docs/examples/databases/increment-document-attribute.md +18 -0
- package/package.json +1 -1
- package/src/client.ts +1 -1
- package/src/models.ts +79 -6
- package/src/services/account.ts +58 -58
- package/src/services/avatars.ts +7 -7
- package/src/services/databases.ts +103 -11
- package/src/services/functions.ts +3 -3
- package/src/services/graphql.ts +2 -2
- package/src/services/locale.ts +8 -8
- package/src/services/messaging.ts +2 -2
- package/src/services/storage.ts +8 -8
- package/src/services/teams.ts +19 -19
- package/types/models.d.ts +68 -47
- package/types/services/account.d.ts +58 -58
- package/types/services/avatars.d.ts +7 -7
- package/types/services/databases.d.ts +37 -11
- package/types/services/functions.d.ts +3 -3
- package/types/services/graphql.d.ts +2 -2
- package/types/services/locale.d.ts +8 -8
- package/types/services/messaging.d.ts +2 -2
- package/types/services/storage.d.ts +8 -8
- package/types/services/teams.d.ts +19 -19
|
@@ -22,7 +22,7 @@ export class Functions extends Service {
|
|
|
22
22
|
* @param {string[]} queries
|
|
23
23
|
* @throws {AppwriteException}
|
|
24
24
|
* @returns {Promise}
|
|
25
|
-
|
|
25
|
+
*/
|
|
26
26
|
listExecutions(functionId: string, queries?: string[]): Promise<Models.ExecutionList> {
|
|
27
27
|
if (typeof functionId === 'undefined') {
|
|
28
28
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
@@ -55,7 +55,7 @@ export class Functions extends Service {
|
|
|
55
55
|
* @param {string} scheduledAt
|
|
56
56
|
* @throws {AppwriteException}
|
|
57
57
|
* @returns {Promise}
|
|
58
|
-
|
|
58
|
+
*/
|
|
59
59
|
createExecution(functionId: string, body?: string, async?: boolean, xpath?: string, method?: ExecutionMethod, headers?: object, scheduledAt?: string): Promise<Models.Execution> {
|
|
60
60
|
if (typeof functionId === 'undefined') {
|
|
61
61
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
@@ -101,7 +101,7 @@ export class Functions extends Service {
|
|
|
101
101
|
* @param {string} executionId
|
|
102
102
|
* @throws {AppwriteException}
|
|
103
103
|
* @returns {Promise}
|
|
104
|
-
|
|
104
|
+
*/
|
|
105
105
|
getExecution(functionId: string, executionId: string): Promise<Models.Execution> {
|
|
106
106
|
if (typeof functionId === 'undefined') {
|
|
107
107
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
package/src/services/graphql.ts
CHANGED
|
@@ -19,7 +19,7 @@ export class Graphql extends Service {
|
|
|
19
19
|
* @param {object} query
|
|
20
20
|
* @throws {AppwriteException}
|
|
21
21
|
* @returns {Promise}
|
|
22
|
-
|
|
22
|
+
*/
|
|
23
23
|
query(query: object): Promise<{}> {
|
|
24
24
|
if (typeof query === 'undefined') {
|
|
25
25
|
throw new AppwriteException('Missing required parameter: "query"');
|
|
@@ -45,7 +45,7 @@ export class Graphql extends Service {
|
|
|
45
45
|
* @param {object} query
|
|
46
46
|
* @throws {AppwriteException}
|
|
47
47
|
* @returns {Promise}
|
|
48
|
-
|
|
48
|
+
*/
|
|
49
49
|
mutation(query: object): Promise<{}> {
|
|
50
50
|
if (typeof query === 'undefined') {
|
|
51
51
|
throw new AppwriteException('Missing required parameter: "query"');
|
package/src/services/locale.ts
CHANGED
|
@@ -23,7 +23,7 @@ export class Locale extends Service {
|
|
|
23
23
|
*
|
|
24
24
|
* @throws {AppwriteException}
|
|
25
25
|
* @returns {Promise}
|
|
26
|
-
|
|
26
|
+
*/
|
|
27
27
|
get(): Promise<Models.Locale> {
|
|
28
28
|
const apiPath = '/locale';
|
|
29
29
|
const payload: Payload = {};
|
|
@@ -39,7 +39,7 @@ export class Locale extends Service {
|
|
|
39
39
|
*
|
|
40
40
|
* @throws {AppwriteException}
|
|
41
41
|
* @returns {Promise}
|
|
42
|
-
|
|
42
|
+
*/
|
|
43
43
|
listCodes(): Promise<Models.LocaleCodeList> {
|
|
44
44
|
const apiPath = '/locale/codes';
|
|
45
45
|
const payload: Payload = {};
|
|
@@ -55,7 +55,7 @@ export class Locale extends Service {
|
|
|
55
55
|
*
|
|
56
56
|
* @throws {AppwriteException}
|
|
57
57
|
* @returns {Promise}
|
|
58
|
-
|
|
58
|
+
*/
|
|
59
59
|
listContinents(): Promise<Models.ContinentList> {
|
|
60
60
|
const apiPath = '/locale/continents';
|
|
61
61
|
const payload: Payload = {};
|
|
@@ -71,7 +71,7 @@ export class Locale extends Service {
|
|
|
71
71
|
*
|
|
72
72
|
* @throws {AppwriteException}
|
|
73
73
|
* @returns {Promise}
|
|
74
|
-
|
|
74
|
+
*/
|
|
75
75
|
listCountries(): Promise<Models.CountryList> {
|
|
76
76
|
const apiPath = '/locale/countries';
|
|
77
77
|
const payload: Payload = {};
|
|
@@ -87,7 +87,7 @@ export class Locale extends Service {
|
|
|
87
87
|
*
|
|
88
88
|
* @throws {AppwriteException}
|
|
89
89
|
* @returns {Promise}
|
|
90
|
-
|
|
90
|
+
*/
|
|
91
91
|
listCountriesEU(): Promise<Models.CountryList> {
|
|
92
92
|
const apiPath = '/locale/countries/eu';
|
|
93
93
|
const payload: Payload = {};
|
|
@@ -103,7 +103,7 @@ export class Locale extends Service {
|
|
|
103
103
|
*
|
|
104
104
|
* @throws {AppwriteException}
|
|
105
105
|
* @returns {Promise}
|
|
106
|
-
|
|
106
|
+
*/
|
|
107
107
|
listCountriesPhones(): Promise<Models.PhoneList> {
|
|
108
108
|
const apiPath = '/locale/countries/phones';
|
|
109
109
|
const payload: Payload = {};
|
|
@@ -120,7 +120,7 @@ export class Locale extends Service {
|
|
|
120
120
|
*
|
|
121
121
|
* @throws {AppwriteException}
|
|
122
122
|
* @returns {Promise}
|
|
123
|
-
|
|
123
|
+
*/
|
|
124
124
|
listCurrencies(): Promise<Models.CurrencyList> {
|
|
125
125
|
const apiPath = '/locale/currencies';
|
|
126
126
|
const payload: Payload = {};
|
|
@@ -136,7 +136,7 @@ export class Locale extends Service {
|
|
|
136
136
|
*
|
|
137
137
|
* @throws {AppwriteException}
|
|
138
138
|
* @returns {Promise}
|
|
139
|
-
|
|
139
|
+
*/
|
|
140
140
|
listLanguages(): Promise<Models.LanguageList> {
|
|
141
141
|
const apiPath = '/locale/languages';
|
|
142
142
|
const payload: Payload = {};
|
|
@@ -21,7 +21,7 @@ export class Messaging extends Service {
|
|
|
21
21
|
* @param {string} targetId
|
|
22
22
|
* @throws {AppwriteException}
|
|
23
23
|
* @returns {Promise}
|
|
24
|
-
|
|
24
|
+
*/
|
|
25
25
|
createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise<Models.Subscriber> {
|
|
26
26
|
if (typeof topicId === 'undefined') {
|
|
27
27
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
@@ -59,7 +59,7 @@ export class Messaging extends Service {
|
|
|
59
59
|
* @param {string} subscriberId
|
|
60
60
|
* @throws {AppwriteException}
|
|
61
61
|
* @returns {Promise}
|
|
62
|
-
|
|
62
|
+
*/
|
|
63
63
|
deleteSubscriber(topicId: string, subscriberId: string): Promise<{}> {
|
|
64
64
|
if (typeof topicId === 'undefined') {
|
|
65
65
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
package/src/services/storage.ts
CHANGED
|
@@ -24,7 +24,7 @@ export class Storage extends Service {
|
|
|
24
24
|
* @param {string} search
|
|
25
25
|
* @throws {AppwriteException}
|
|
26
26
|
* @returns {Promise}
|
|
27
|
-
|
|
27
|
+
*/
|
|
28
28
|
listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList> {
|
|
29
29
|
if (typeof bucketId === 'undefined') {
|
|
30
30
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -72,7 +72,7 @@ export class Storage extends Service {
|
|
|
72
72
|
* @param {string[]} permissions
|
|
73
73
|
* @throws {AppwriteException}
|
|
74
74
|
* @returns {Promise}
|
|
75
|
-
|
|
75
|
+
*/
|
|
76
76
|
async createFile(bucketId: string, fileId: string, file: {name: string, type: string, size: number, uri: string}, permissions?: string[], onProgress = (progress: UploadProgress) => {}): Promise<Models.File> {
|
|
77
77
|
if (typeof bucketId === 'undefined') {
|
|
78
78
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -169,7 +169,7 @@ export class Storage extends Service {
|
|
|
169
169
|
* @param {string} fileId
|
|
170
170
|
* @throws {AppwriteException}
|
|
171
171
|
* @returns {Promise}
|
|
172
|
-
|
|
172
|
+
*/
|
|
173
173
|
getFile(bucketId: string, fileId: string): Promise<Models.File> {
|
|
174
174
|
if (typeof bucketId === 'undefined') {
|
|
175
175
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -197,7 +197,7 @@ export class Storage extends Service {
|
|
|
197
197
|
* @param {string[]} permissions
|
|
198
198
|
* @throws {AppwriteException}
|
|
199
199
|
* @returns {Promise}
|
|
200
|
-
|
|
200
|
+
*/
|
|
201
201
|
updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File> {
|
|
202
202
|
if (typeof bucketId === 'undefined') {
|
|
203
203
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -232,7 +232,7 @@ export class Storage extends Service {
|
|
|
232
232
|
* @param {string} fileId
|
|
233
233
|
* @throws {AppwriteException}
|
|
234
234
|
* @returns {Promise}
|
|
235
|
-
|
|
235
|
+
*/
|
|
236
236
|
deleteFile(bucketId: string, fileId: string): Promise<{}> {
|
|
237
237
|
if (typeof bucketId === 'undefined') {
|
|
238
238
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -261,7 +261,7 @@ export class Storage extends Service {
|
|
|
261
261
|
* @param {string} token
|
|
262
262
|
* @throws {AppwriteException}
|
|
263
263
|
* @returns {ArrayBuffer}
|
|
264
|
-
|
|
264
|
+
*/
|
|
265
265
|
getFileDownload(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer> {
|
|
266
266
|
if (typeof bucketId === 'undefined') {
|
|
267
267
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -312,7 +312,7 @@ export class Storage extends Service {
|
|
|
312
312
|
* @param {string} token
|
|
313
313
|
* @throws {AppwriteException}
|
|
314
314
|
* @returns {ArrayBuffer}
|
|
315
|
-
|
|
315
|
+
*/
|
|
316
316
|
getFilePreview(bucketId: string, fileId: string, width?: number, height?: number, gravity?: ImageGravity, quality?: number, borderWidth?: number, borderColor?: string, borderRadius?: number, opacity?: number, rotation?: number, background?: string, output?: ImageFormat, token?: string): Promise<ArrayBuffer> {
|
|
317
317
|
if (typeof bucketId === 'undefined') {
|
|
318
318
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -394,7 +394,7 @@ export class Storage extends Service {
|
|
|
394
394
|
* @param {string} token
|
|
395
395
|
* @throws {AppwriteException}
|
|
396
396
|
* @returns {ArrayBuffer}
|
|
397
|
-
|
|
397
|
+
*/
|
|
398
398
|
getFileView(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer> {
|
|
399
399
|
if (typeof bucketId === 'undefined') {
|
|
400
400
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
package/src/services/teams.ts
CHANGED
|
@@ -21,8 +21,8 @@ export class Teams extends Service {
|
|
|
21
21
|
* @param {string} search
|
|
22
22
|
* @throws {AppwriteException}
|
|
23
23
|
* @returns {Promise}
|
|
24
|
-
|
|
25
|
-
list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>> {
|
|
24
|
+
*/
|
|
25
|
+
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>> {
|
|
26
26
|
const apiPath = '/teams';
|
|
27
27
|
const payload: Payload = {};
|
|
28
28
|
|
|
@@ -49,8 +49,8 @@ export class Teams extends Service {
|
|
|
49
49
|
* @param {string[]} roles
|
|
50
50
|
* @throws {AppwriteException}
|
|
51
51
|
* @returns {Promise}
|
|
52
|
-
|
|
53
|
-
create<Preferences extends Models.Preferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>> {
|
|
52
|
+
*/
|
|
53
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>> {
|
|
54
54
|
if (typeof teamId === 'undefined') {
|
|
55
55
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
56
56
|
}
|
|
@@ -86,8 +86,8 @@ export class Teams extends Service {
|
|
|
86
86
|
* @param {string} teamId
|
|
87
87
|
* @throws {AppwriteException}
|
|
88
88
|
* @returns {Promise}
|
|
89
|
-
|
|
90
|
-
get<Preferences extends Models.Preferences>(teamId: string): Promise<Models.Team<Preferences>> {
|
|
89
|
+
*/
|
|
90
|
+
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Models.Team<Preferences>> {
|
|
91
91
|
if (typeof teamId === 'undefined') {
|
|
92
92
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
93
93
|
}
|
|
@@ -107,8 +107,8 @@ export class Teams extends Service {
|
|
|
107
107
|
* @param {string} name
|
|
108
108
|
* @throws {AppwriteException}
|
|
109
109
|
* @returns {Promise}
|
|
110
|
-
|
|
111
|
-
updateName<Preferences extends Models.Preferences>(teamId: string, name: string): Promise<Models.Team<Preferences>> {
|
|
110
|
+
*/
|
|
111
|
+
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string): Promise<Models.Team<Preferences>> {
|
|
112
112
|
if (typeof teamId === 'undefined') {
|
|
113
113
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
114
114
|
}
|
|
@@ -137,7 +137,7 @@ export class Teams extends Service {
|
|
|
137
137
|
* @param {string} teamId
|
|
138
138
|
* @throws {AppwriteException}
|
|
139
139
|
* @returns {Promise}
|
|
140
|
-
|
|
140
|
+
*/
|
|
141
141
|
delete(teamId: string): Promise<{}> {
|
|
142
142
|
if (typeof teamId === 'undefined') {
|
|
143
143
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -162,7 +162,7 @@ export class Teams extends Service {
|
|
|
162
162
|
* @param {string} search
|
|
163
163
|
* @throws {AppwriteException}
|
|
164
164
|
* @returns {Promise}
|
|
165
|
-
|
|
165
|
+
*/
|
|
166
166
|
listMemberships(teamId: string, queries?: string[], search?: string): Promise<Models.MembershipList> {
|
|
167
167
|
if (typeof teamId === 'undefined') {
|
|
168
168
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -216,7 +216,7 @@ export class Teams extends Service {
|
|
|
216
216
|
* @param {string} name
|
|
217
217
|
* @throws {AppwriteException}
|
|
218
218
|
* @returns {Promise}
|
|
219
|
-
|
|
219
|
+
*/
|
|
220
220
|
createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership> {
|
|
221
221
|
if (typeof teamId === 'undefined') {
|
|
222
222
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -268,7 +268,7 @@ export class Teams extends Service {
|
|
|
268
268
|
* @param {string} membershipId
|
|
269
269
|
* @throws {AppwriteException}
|
|
270
270
|
* @returns {Promise}
|
|
271
|
-
|
|
271
|
+
*/
|
|
272
272
|
getMembership(teamId: string, membershipId: string): Promise<Models.Membership> {
|
|
273
273
|
if (typeof teamId === 'undefined') {
|
|
274
274
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -297,7 +297,7 @@ export class Teams extends Service {
|
|
|
297
297
|
* @param {string[]} roles
|
|
298
298
|
* @throws {AppwriteException}
|
|
299
299
|
* @returns {Promise}
|
|
300
|
-
|
|
300
|
+
*/
|
|
301
301
|
updateMembership(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership> {
|
|
302
302
|
if (typeof teamId === 'undefined') {
|
|
303
303
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -333,7 +333,7 @@ export class Teams extends Service {
|
|
|
333
333
|
* @param {string} membershipId
|
|
334
334
|
* @throws {AppwriteException}
|
|
335
335
|
* @returns {Promise}
|
|
336
|
-
|
|
336
|
+
*/
|
|
337
337
|
deleteMembership(teamId: string, membershipId: string): Promise<{}> {
|
|
338
338
|
if (typeof teamId === 'undefined') {
|
|
339
339
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -367,7 +367,7 @@ export class Teams extends Service {
|
|
|
367
367
|
* @param {string} secret
|
|
368
368
|
* @throws {AppwriteException}
|
|
369
369
|
* @returns {Promise}
|
|
370
|
-
|
|
370
|
+
*/
|
|
371
371
|
updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise<Models.Membership> {
|
|
372
372
|
if (typeof teamId === 'undefined') {
|
|
373
373
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -410,8 +410,8 @@ export class Teams extends Service {
|
|
|
410
410
|
* @param {string} teamId
|
|
411
411
|
* @throws {AppwriteException}
|
|
412
412
|
* @returns {Promise}
|
|
413
|
-
|
|
414
|
-
getPrefs<Preferences extends Models.Preferences>(teamId: string): Promise<Preferences> {
|
|
413
|
+
*/
|
|
414
|
+
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Preferences> {
|
|
415
415
|
if (typeof teamId === 'undefined') {
|
|
416
416
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
417
417
|
}
|
|
@@ -433,8 +433,8 @@ export class Teams extends Service {
|
|
|
433
433
|
* @param {object} prefs
|
|
434
434
|
* @throws {AppwriteException}
|
|
435
435
|
* @returns {Promise}
|
|
436
|
-
|
|
437
|
-
updatePrefs<Preferences extends Models.Preferences>(teamId: string, prefs: object): Promise<Preferences> {
|
|
436
|
+
*/
|
|
437
|
+
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, prefs: object): Promise<Preferences> {
|
|
438
438
|
if (typeof teamId === 'undefined') {
|
|
439
439
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
440
440
|
}
|