react-native-appwrite 0.10.0 → 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/.github/workflows/publish.yml +1 -1
- package/CHANGELOG.md +12 -1
- package/dist/cjs/sdk.js +333 -97
- package/dist/cjs/sdk.js.map +1 -1
- package/dist/esm/sdk.js +333 -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/enums/image-format.ts +1 -0
- package/src/models.ts +79 -6
- package/src/services/account.ts +58 -58
- package/src/services/avatars.ts +42 -7
- package/src/services/databases.ts +107 -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 +23 -8
- package/src/services/teams.ts +19 -19
- package/types/enums/image-format.d.ts +2 -1
- 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 +41 -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
|
@@ -13,7 +13,7 @@ export declare class Locale extends Service {
|
|
|
13
13
|
*
|
|
14
14
|
* @throws {AppwriteException}
|
|
15
15
|
* @returns {Promise}
|
|
16
|
-
|
|
16
|
+
*/
|
|
17
17
|
get(): Promise<Models.Locale>;
|
|
18
18
|
/**
|
|
19
19
|
* List of all locale codes in [ISO
|
|
@@ -21,7 +21,7 @@ export declare class Locale extends Service {
|
|
|
21
21
|
*
|
|
22
22
|
* @throws {AppwriteException}
|
|
23
23
|
* @returns {Promise}
|
|
24
|
-
|
|
24
|
+
*/
|
|
25
25
|
listCodes(): Promise<Models.LocaleCodeList>;
|
|
26
26
|
/**
|
|
27
27
|
* List of all continents. You can use the locale header to get the data in a
|
|
@@ -29,7 +29,7 @@ export declare class Locale extends Service {
|
|
|
29
29
|
*
|
|
30
30
|
* @throws {AppwriteException}
|
|
31
31
|
* @returns {Promise}
|
|
32
|
-
|
|
32
|
+
*/
|
|
33
33
|
listContinents(): Promise<Models.ContinentList>;
|
|
34
34
|
/**
|
|
35
35
|
* List of all countries. You can use the locale header to get the data in a
|
|
@@ -37,7 +37,7 @@ export declare class Locale extends Service {
|
|
|
37
37
|
*
|
|
38
38
|
* @throws {AppwriteException}
|
|
39
39
|
* @returns {Promise}
|
|
40
|
-
|
|
40
|
+
*/
|
|
41
41
|
listCountries(): Promise<Models.CountryList>;
|
|
42
42
|
/**
|
|
43
43
|
* List of all countries that are currently members of the EU. You can use the
|
|
@@ -45,7 +45,7 @@ export declare class Locale extends Service {
|
|
|
45
45
|
*
|
|
46
46
|
* @throws {AppwriteException}
|
|
47
47
|
* @returns {Promise}
|
|
48
|
-
|
|
48
|
+
*/
|
|
49
49
|
listCountriesEU(): Promise<Models.CountryList>;
|
|
50
50
|
/**
|
|
51
51
|
* List of all countries phone codes. You can use the locale header to get the
|
|
@@ -53,7 +53,7 @@ export declare class Locale extends Service {
|
|
|
53
53
|
*
|
|
54
54
|
* @throws {AppwriteException}
|
|
55
55
|
* @returns {Promise}
|
|
56
|
-
|
|
56
|
+
*/
|
|
57
57
|
listCountriesPhones(): Promise<Models.PhoneList>;
|
|
58
58
|
/**
|
|
59
59
|
* List of all currencies, including currency symbol, name, plural, and
|
|
@@ -62,7 +62,7 @@ export declare class Locale extends Service {
|
|
|
62
62
|
*
|
|
63
63
|
* @throws {AppwriteException}
|
|
64
64
|
* @returns {Promise}
|
|
65
|
-
|
|
65
|
+
*/
|
|
66
66
|
listCurrencies(): Promise<Models.CurrencyList>;
|
|
67
67
|
/**
|
|
68
68
|
* List of all languages classified by ISO 639-1 including 2-letter code, name
|
|
@@ -70,6 +70,6 @@ export declare class Locale extends Service {
|
|
|
70
70
|
*
|
|
71
71
|
* @throws {AppwriteException}
|
|
72
72
|
* @returns {Promise}
|
|
73
|
-
|
|
73
|
+
*/
|
|
74
74
|
listLanguages(): Promise<Models.LanguageList>;
|
|
75
75
|
}
|
|
@@ -11,7 +11,7 @@ export declare class Messaging extends Service {
|
|
|
11
11
|
* @param {string} targetId
|
|
12
12
|
* @throws {AppwriteException}
|
|
13
13
|
* @returns {Promise}
|
|
14
|
-
|
|
14
|
+
*/
|
|
15
15
|
createSubscriber(topicId: string, subscriberId: string, targetId: string): Promise<Models.Subscriber>;
|
|
16
16
|
/**
|
|
17
17
|
* Delete a subscriber by its unique ID.
|
|
@@ -20,6 +20,6 @@ export declare class Messaging extends Service {
|
|
|
20
20
|
* @param {string} subscriberId
|
|
21
21
|
* @throws {AppwriteException}
|
|
22
22
|
* @returns {Promise}
|
|
23
|
-
|
|
23
|
+
*/
|
|
24
24
|
deleteSubscriber(topicId: string, subscriberId: string): Promise<{}>;
|
|
25
25
|
}
|
|
@@ -15,7 +15,7 @@ export declare class Storage extends Service {
|
|
|
15
15
|
* @param {string} search
|
|
16
16
|
* @throws {AppwriteException}
|
|
17
17
|
* @returns {Promise}
|
|
18
|
-
|
|
18
|
+
*/
|
|
19
19
|
listFiles(bucketId: string, queries?: string[], search?: string): Promise<Models.FileList>;
|
|
20
20
|
/**
|
|
21
21
|
* Create a new file. Before using this route, you should create a new bucket
|
|
@@ -43,7 +43,7 @@ export declare class Storage extends Service {
|
|
|
43
43
|
* @param {string[]} permissions
|
|
44
44
|
* @throws {AppwriteException}
|
|
45
45
|
* @returns {Promise}
|
|
46
|
-
|
|
46
|
+
*/
|
|
47
47
|
createFile(bucketId: string, fileId: string, file: {
|
|
48
48
|
name: string;
|
|
49
49
|
type: string;
|
|
@@ -58,7 +58,7 @@ export declare class Storage extends Service {
|
|
|
58
58
|
* @param {string} fileId
|
|
59
59
|
* @throws {AppwriteException}
|
|
60
60
|
* @returns {Promise}
|
|
61
|
-
|
|
61
|
+
*/
|
|
62
62
|
getFile(bucketId: string, fileId: string): Promise<Models.File>;
|
|
63
63
|
/**
|
|
64
64
|
* Update a file by its unique ID. Only users with write permissions have
|
|
@@ -70,7 +70,7 @@ export declare class Storage extends Service {
|
|
|
70
70
|
* @param {string[]} permissions
|
|
71
71
|
* @throws {AppwriteException}
|
|
72
72
|
* @returns {Promise}
|
|
73
|
-
|
|
73
|
+
*/
|
|
74
74
|
updateFile(bucketId: string, fileId: string, name?: string, permissions?: string[]): Promise<Models.File>;
|
|
75
75
|
/**
|
|
76
76
|
* Delete a file by its unique ID. Only users with write permissions have
|
|
@@ -80,7 +80,7 @@ export declare class Storage extends Service {
|
|
|
80
80
|
* @param {string} fileId
|
|
81
81
|
* @throws {AppwriteException}
|
|
82
82
|
* @returns {Promise}
|
|
83
|
-
|
|
83
|
+
*/
|
|
84
84
|
deleteFile(bucketId: string, fileId: string): Promise<{}>;
|
|
85
85
|
/**
|
|
86
86
|
* Get a file content by its unique ID. The endpoint response return with a
|
|
@@ -92,7 +92,7 @@ export declare class Storage extends Service {
|
|
|
92
92
|
* @param {string} token
|
|
93
93
|
* @throws {AppwriteException}
|
|
94
94
|
* @returns {ArrayBuffer}
|
|
95
|
-
|
|
95
|
+
*/
|
|
96
96
|
getFileDownload(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;
|
|
97
97
|
/**
|
|
98
98
|
* Get a file preview image. Currently, this method supports preview for image
|
|
@@ -117,7 +117,7 @@ export declare class Storage extends Service {
|
|
|
117
117
|
* @param {string} token
|
|
118
118
|
* @throws {AppwriteException}
|
|
119
119
|
* @returns {ArrayBuffer}
|
|
120
|
-
|
|
120
|
+
*/
|
|
121
121
|
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>;
|
|
122
122
|
/**
|
|
123
123
|
* Get a file content by its unique ID. This endpoint is similar to the
|
|
@@ -129,7 +129,7 @@ export declare class Storage extends Service {
|
|
|
129
129
|
* @param {string} token
|
|
130
130
|
* @throws {AppwriteException}
|
|
131
131
|
* @returns {ArrayBuffer}
|
|
132
|
-
|
|
132
|
+
*/
|
|
133
133
|
getFileView(bucketId: string, fileId: string, token?: string): Promise<ArrayBuffer>;
|
|
134
134
|
/**
|
|
135
135
|
* Get a file content by its unique ID. The endpoint response return with a
|
|
@@ -11,8 +11,8 @@ export declare class Teams extends Service {
|
|
|
11
11
|
* @param {string} search
|
|
12
12
|
* @throws {AppwriteException}
|
|
13
13
|
* @returns {Promise}
|
|
14
|
-
|
|
15
|
-
list<Preferences extends Models.Preferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>>;
|
|
14
|
+
*/
|
|
15
|
+
list<Preferences extends Models.Preferences = Models.DefaultPreferences>(queries?: string[], search?: string): Promise<Models.TeamList<Preferences>>;
|
|
16
16
|
/**
|
|
17
17
|
* Create a new team. The user who creates the team will automatically be
|
|
18
18
|
* assigned as the owner of the team. Only the users with the owner role can
|
|
@@ -23,16 +23,16 @@ export declare class Teams extends Service {
|
|
|
23
23
|
* @param {string[]} roles
|
|
24
24
|
* @throws {AppwriteException}
|
|
25
25
|
* @returns {Promise}
|
|
26
|
-
|
|
27
|
-
create<Preferences extends Models.Preferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>>;
|
|
26
|
+
*/
|
|
27
|
+
create<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string, roles?: string[]): Promise<Models.Team<Preferences>>;
|
|
28
28
|
/**
|
|
29
29
|
* Get a team by its ID. All team members have read access for this resource.
|
|
30
30
|
*
|
|
31
31
|
* @param {string} teamId
|
|
32
32
|
* @throws {AppwriteException}
|
|
33
33
|
* @returns {Promise}
|
|
34
|
-
|
|
35
|
-
get<Preferences extends Models.Preferences>(teamId: string): Promise<Models.Team<Preferences>>;
|
|
34
|
+
*/
|
|
35
|
+
get<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Models.Team<Preferences>>;
|
|
36
36
|
/**
|
|
37
37
|
* Update the team's name by its unique ID.
|
|
38
38
|
*
|
|
@@ -40,8 +40,8 @@ export declare class Teams extends Service {
|
|
|
40
40
|
* @param {string} name
|
|
41
41
|
* @throws {AppwriteException}
|
|
42
42
|
* @returns {Promise}
|
|
43
|
-
|
|
44
|
-
updateName<Preferences extends Models.Preferences>(teamId: string, name: string): Promise<Models.Team<Preferences>>;
|
|
43
|
+
*/
|
|
44
|
+
updateName<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, name: string): Promise<Models.Team<Preferences>>;
|
|
45
45
|
/**
|
|
46
46
|
* Delete a team using its ID. Only team members with the owner role can
|
|
47
47
|
* delete the team.
|
|
@@ -49,7 +49,7 @@ export declare class Teams extends Service {
|
|
|
49
49
|
* @param {string} teamId
|
|
50
50
|
* @throws {AppwriteException}
|
|
51
51
|
* @returns {Promise}
|
|
52
|
-
|
|
52
|
+
*/
|
|
53
53
|
delete(teamId: string): Promise<{}>;
|
|
54
54
|
/**
|
|
55
55
|
* Use this endpoint to list a team's members using the team's ID. All team
|
|
@@ -61,7 +61,7 @@ export declare class Teams extends Service {
|
|
|
61
61
|
* @param {string} search
|
|
62
62
|
* @throws {AppwriteException}
|
|
63
63
|
* @returns {Promise}
|
|
64
|
-
|
|
64
|
+
*/
|
|
65
65
|
listMemberships(teamId: string, queries?: string[], search?: string): Promise<Models.MembershipList>;
|
|
66
66
|
/**
|
|
67
67
|
* Invite a new member to join your team. Provide an ID for existing users, or
|
|
@@ -95,7 +95,7 @@ export declare class Teams extends Service {
|
|
|
95
95
|
* @param {string} name
|
|
96
96
|
* @throws {AppwriteException}
|
|
97
97
|
* @returns {Promise}
|
|
98
|
-
|
|
98
|
+
*/
|
|
99
99
|
createMembership(teamId: string, roles: string[], email?: string, userId?: string, phone?: string, url?: string, name?: string): Promise<Models.Membership>;
|
|
100
100
|
/**
|
|
101
101
|
* Get a team member by the membership unique id. All team members have read
|
|
@@ -106,7 +106,7 @@ export declare class Teams extends Service {
|
|
|
106
106
|
* @param {string} membershipId
|
|
107
107
|
* @throws {AppwriteException}
|
|
108
108
|
* @returns {Promise}
|
|
109
|
-
|
|
109
|
+
*/
|
|
110
110
|
getMembership(teamId: string, membershipId: string): Promise<Models.Membership>;
|
|
111
111
|
/**
|
|
112
112
|
* Modify the roles of a team member. Only team members with the owner role
|
|
@@ -119,7 +119,7 @@ export declare class Teams extends Service {
|
|
|
119
119
|
* @param {string[]} roles
|
|
120
120
|
* @throws {AppwriteException}
|
|
121
121
|
* @returns {Promise}
|
|
122
|
-
|
|
122
|
+
*/
|
|
123
123
|
updateMembership(teamId: string, membershipId: string, roles: string[]): Promise<Models.Membership>;
|
|
124
124
|
/**
|
|
125
125
|
* This endpoint allows a user to leave a team or for a team owner to delete
|
|
@@ -130,7 +130,7 @@ export declare class Teams extends Service {
|
|
|
130
130
|
* @param {string} membershipId
|
|
131
131
|
* @throws {AppwriteException}
|
|
132
132
|
* @returns {Promise}
|
|
133
|
-
|
|
133
|
+
*/
|
|
134
134
|
deleteMembership(teamId: string, membershipId: string): Promise<{}>;
|
|
135
135
|
/**
|
|
136
136
|
* Use this endpoint to allow a user to accept an invitation to join a team
|
|
@@ -147,7 +147,7 @@ export declare class Teams extends Service {
|
|
|
147
147
|
* @param {string} secret
|
|
148
148
|
* @throws {AppwriteException}
|
|
149
149
|
* @returns {Promise}
|
|
150
|
-
|
|
150
|
+
*/
|
|
151
151
|
updateMembershipStatus(teamId: string, membershipId: string, userId: string, secret: string): Promise<Models.Membership>;
|
|
152
152
|
/**
|
|
153
153
|
* Get the team's shared preferences by its unique ID. If a preference doesn't
|
|
@@ -157,8 +157,8 @@ export declare class Teams extends Service {
|
|
|
157
157
|
* @param {string} teamId
|
|
158
158
|
* @throws {AppwriteException}
|
|
159
159
|
* @returns {Promise}
|
|
160
|
-
|
|
161
|
-
getPrefs<Preferences extends Models.Preferences>(teamId: string): Promise<Preferences>;
|
|
160
|
+
*/
|
|
161
|
+
getPrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string): Promise<Preferences>;
|
|
162
162
|
/**
|
|
163
163
|
* Update the team's preferences by its unique ID. The object you pass is
|
|
164
164
|
* stored as is and replaces any previous value. The maximum allowed prefs
|
|
@@ -168,6 +168,6 @@ export declare class Teams extends Service {
|
|
|
168
168
|
* @param {object} prefs
|
|
169
169
|
* @throws {AppwriteException}
|
|
170
170
|
* @returns {Promise}
|
|
171
|
-
|
|
172
|
-
updatePrefs<Preferences extends Models.Preferences>(teamId: string, prefs: object): Promise<Preferences>;
|
|
171
|
+
*/
|
|
172
|
+
updatePrefs<Preferences extends Models.Preferences = Models.DefaultPreferences>(teamId: string, prefs: object): Promise<Preferences>;
|
|
173
173
|
}
|