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
|
@@ -6,133 +6,228 @@ import { Flag } from '../enums/flag';
|
|
|
6
6
|
export declare class Avatars extends Service {
|
|
7
7
|
constructor(client: Client);
|
|
8
8
|
/**
|
|
9
|
-
* You can use this endpoint to show different browser icons to your users.
|
|
10
|
-
* The code argument receives the browser code as it appears in your user [GET
|
|
11
|
-
* /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions)
|
|
12
|
-
* endpoint. Use width, height and quality arguments to change the output
|
|
13
|
-
* settings.
|
|
9
|
+
* You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.
|
|
14
10
|
*
|
|
15
|
-
* When one dimension is specified and the other is 0, the image is scaled
|
|
16
|
-
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
17
|
-
* image at source quality. If dimensions are not specified, the default size
|
|
18
|
-
* of image returned is 100x100px.
|
|
11
|
+
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
|
19
12
|
*
|
|
20
|
-
* @param {Browser} code
|
|
21
|
-
* @param {number} width
|
|
22
|
-
* @param {number} height
|
|
23
|
-
* @param {number} quality
|
|
13
|
+
* @param {Browser} params.code - Browser Code.
|
|
14
|
+
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
15
|
+
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
16
|
+
* @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
24
17
|
* @throws {AppwriteException}
|
|
25
18
|
* @returns {ArrayBuffer}
|
|
26
19
|
*/
|
|
20
|
+
getBrowser(params: {
|
|
21
|
+
code: Browser;
|
|
22
|
+
width?: number;
|
|
23
|
+
height?: number;
|
|
24
|
+
quality?: number;
|
|
25
|
+
}): Promise<ArrayBuffer>;
|
|
26
|
+
/**
|
|
27
|
+
* You can use this endpoint to show different browser icons to your users. The code argument receives the browser code as it appears in your user [GET /account/sessions](https://appwrite.io/docs/references/cloud/client-web/account#getSessions) endpoint. Use width, height and quality arguments to change the output settings.
|
|
28
|
+
*
|
|
29
|
+
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
|
30
|
+
*
|
|
31
|
+
* @param {Browser} code - Browser Code.
|
|
32
|
+
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
33
|
+
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
34
|
+
* @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
35
|
+
* @throws {AppwriteException}
|
|
36
|
+
* @returns {Promise<ArrayBuffer>}
|
|
37
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
38
|
+
*/
|
|
27
39
|
getBrowser(code: Browser, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
|
|
28
40
|
/**
|
|
29
|
-
* The credit card endpoint will return you the icon of the credit card
|
|
30
|
-
* provider you need. Use width, height and quality arguments to change the
|
|
31
|
-
* output settings.
|
|
41
|
+
* The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
|
|
32
42
|
*
|
|
33
|
-
* When one dimension is specified and the other is 0, the image is scaled
|
|
34
|
-
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
35
|
-
* image at source quality. If dimensions are not specified, the default size
|
|
36
|
-
* of image returned is 100x100px.
|
|
43
|
+
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
|
37
44
|
*
|
|
38
45
|
*
|
|
39
|
-
* @param {CreditCard} code
|
|
40
|
-
* @param {number} width
|
|
41
|
-
* @param {number} height
|
|
42
|
-
* @param {number} quality
|
|
46
|
+
* @param {CreditCard} params.code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
|
|
47
|
+
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
48
|
+
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
49
|
+
* @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
43
50
|
* @throws {AppwriteException}
|
|
44
51
|
* @returns {ArrayBuffer}
|
|
45
52
|
*/
|
|
53
|
+
getCreditCard(params: {
|
|
54
|
+
code: CreditCard;
|
|
55
|
+
width?: number;
|
|
56
|
+
height?: number;
|
|
57
|
+
quality?: number;
|
|
58
|
+
}): Promise<ArrayBuffer>;
|
|
59
|
+
/**
|
|
60
|
+
* The credit card endpoint will return you the icon of the credit card provider you need. Use width, height and quality arguments to change the output settings.
|
|
61
|
+
*
|
|
62
|
+
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
|
63
|
+
*
|
|
64
|
+
*
|
|
65
|
+
* @param {CreditCard} code - Credit Card Code. Possible values: amex, argencard, cabal, cencosud, diners, discover, elo, hipercard, jcb, mastercard, naranja, targeta-shopping, unionpay, visa, mir, maestro, rupay.
|
|
66
|
+
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
67
|
+
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
68
|
+
* @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
69
|
+
* @throws {AppwriteException}
|
|
70
|
+
* @returns {Promise<ArrayBuffer>}
|
|
71
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
72
|
+
*/
|
|
46
73
|
getCreditCard(code: CreditCard, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
|
|
47
74
|
/**
|
|
48
|
-
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote
|
|
49
|
-
* website URL.
|
|
75
|
+
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
|
|
50
76
|
*
|
|
51
77
|
* This endpoint does not follow HTTP redirects.
|
|
52
78
|
*
|
|
53
|
-
* @param {string} url
|
|
79
|
+
* @param {string} params.url - Website URL which you want to fetch the favicon from.
|
|
54
80
|
* @throws {AppwriteException}
|
|
55
81
|
* @returns {ArrayBuffer}
|
|
56
82
|
*/
|
|
83
|
+
getFavicon(params: {
|
|
84
|
+
url: string;
|
|
85
|
+
}): Promise<ArrayBuffer>;
|
|
86
|
+
/**
|
|
87
|
+
* Use this endpoint to fetch the favorite icon (AKA favicon) of any remote website URL.
|
|
88
|
+
*
|
|
89
|
+
* This endpoint does not follow HTTP redirects.
|
|
90
|
+
*
|
|
91
|
+
* @param {string} url - Website URL which you want to fetch the favicon from.
|
|
92
|
+
* @throws {AppwriteException}
|
|
93
|
+
* @returns {Promise<ArrayBuffer>}
|
|
94
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
95
|
+
*/
|
|
57
96
|
getFavicon(url: string): Promise<ArrayBuffer>;
|
|
58
97
|
/**
|
|
59
|
-
* You can use this endpoint to show different country flags icons to your
|
|
60
|
-
* users. The code argument receives the 2 letter country code. Use width,
|
|
61
|
-
* height and quality arguments to change the output settings. Country codes
|
|
62
|
-
* follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
|
98
|
+
* You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
|
63
99
|
*
|
|
64
|
-
* When one dimension is specified and the other is 0, the image is scaled
|
|
65
|
-
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
66
|
-
* image at source quality. If dimensions are not specified, the default size
|
|
67
|
-
* of image returned is 100x100px.
|
|
100
|
+
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
|
68
101
|
*
|
|
69
102
|
*
|
|
70
|
-
* @param {Flag} code
|
|
71
|
-
* @param {number} width
|
|
72
|
-
* @param {number} height
|
|
73
|
-
* @param {number} quality
|
|
103
|
+
* @param {Flag} params.code - Country Code. ISO Alpha-2 country code format.
|
|
104
|
+
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
105
|
+
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
106
|
+
* @param {number} params.quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
74
107
|
* @throws {AppwriteException}
|
|
75
108
|
* @returns {ArrayBuffer}
|
|
76
109
|
*/
|
|
110
|
+
getFlag(params: {
|
|
111
|
+
code: Flag;
|
|
112
|
+
width?: number;
|
|
113
|
+
height?: number;
|
|
114
|
+
quality?: number;
|
|
115
|
+
}): Promise<ArrayBuffer>;
|
|
116
|
+
/**
|
|
117
|
+
* You can use this endpoint to show different country flags icons to your users. The code argument receives the 2 letter country code. Use width, height and quality arguments to change the output settings. Country codes follow the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) standard.
|
|
118
|
+
*
|
|
119
|
+
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
|
120
|
+
*
|
|
121
|
+
*
|
|
122
|
+
* @param {Flag} code - Country Code. ISO Alpha-2 country code format.
|
|
123
|
+
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
124
|
+
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
125
|
+
* @param {number} quality - Image quality. Pass an integer between 0 to 100. Defaults to keep existing image quality.
|
|
126
|
+
* @throws {AppwriteException}
|
|
127
|
+
* @returns {Promise<ArrayBuffer>}
|
|
128
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
129
|
+
*/
|
|
77
130
|
getFlag(code: Flag, width?: number, height?: number, quality?: number): Promise<ArrayBuffer>;
|
|
78
131
|
/**
|
|
79
|
-
* Use this endpoint to fetch a remote image URL and crop it to any image size
|
|
80
|
-
* you want. This endpoint is very useful if you need to crop and display
|
|
81
|
-
* remote images in your app or in case you want to make sure a 3rd party
|
|
82
|
-
* image is properly served using a TLS protocol.
|
|
132
|
+
* Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
|
|
83
133
|
*
|
|
84
|
-
* When one dimension is specified and the other is 0, the image is scaled
|
|
85
|
-
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
86
|
-
* image at source quality. If dimensions are not specified, the default size
|
|
87
|
-
* of image returned is 400x400px.
|
|
134
|
+
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.
|
|
88
135
|
*
|
|
89
136
|
* This endpoint does not follow HTTP redirects.
|
|
90
137
|
*
|
|
91
|
-
* @param {string} url
|
|
92
|
-
* @param {number} width
|
|
93
|
-
* @param {number} height
|
|
138
|
+
* @param {string} params.url - Image URL which you want to crop.
|
|
139
|
+
* @param {number} params.width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.
|
|
140
|
+
* @param {number} params.height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.
|
|
94
141
|
* @throws {AppwriteException}
|
|
95
142
|
* @returns {ArrayBuffer}
|
|
96
143
|
*/
|
|
144
|
+
getImage(params: {
|
|
145
|
+
url: string;
|
|
146
|
+
width?: number;
|
|
147
|
+
height?: number;
|
|
148
|
+
}): Promise<ArrayBuffer>;
|
|
149
|
+
/**
|
|
150
|
+
* Use this endpoint to fetch a remote image URL and crop it to any image size you want. This endpoint is very useful if you need to crop and display remote images in your app or in case you want to make sure a 3rd party image is properly served using a TLS protocol.
|
|
151
|
+
*
|
|
152
|
+
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 400x400px.
|
|
153
|
+
*
|
|
154
|
+
* This endpoint does not follow HTTP redirects.
|
|
155
|
+
*
|
|
156
|
+
* @param {string} url - Image URL which you want to crop.
|
|
157
|
+
* @param {number} width - Resize preview image width, Pass an integer between 0 to 2000. Defaults to 400.
|
|
158
|
+
* @param {number} height - Resize preview image height, Pass an integer between 0 to 2000. Defaults to 400.
|
|
159
|
+
* @throws {AppwriteException}
|
|
160
|
+
* @returns {Promise<ArrayBuffer>}
|
|
161
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
162
|
+
*/
|
|
97
163
|
getImage(url: string, width?: number, height?: number): Promise<ArrayBuffer>;
|
|
98
164
|
/**
|
|
99
|
-
* Use this endpoint to show your user initials avatar icon on your website or
|
|
100
|
-
* app. By default, this route will try to print your logged-in user name or
|
|
101
|
-
* email initials. You can also overwrite the user name if you pass the 'name'
|
|
102
|
-
* parameter. If no name is given and no user is logged, an empty avatar will
|
|
103
|
-
* be returned.
|
|
165
|
+
* Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
|
|
104
166
|
*
|
|
105
|
-
* You can use the color and background params to change the avatar colors. By
|
|
106
|
-
* default, a random theme will be selected. The random theme will persist for
|
|
107
|
-
* the user's initials when reloading the same theme will always return for
|
|
108
|
-
* the same initials.
|
|
167
|
+
* You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.
|
|
109
168
|
*
|
|
110
|
-
* When one dimension is specified and the other is 0, the image is scaled
|
|
111
|
-
* with preserved aspect ratio. If both dimensions are 0, the API provides an
|
|
112
|
-
* image at source quality. If dimensions are not specified, the default size
|
|
113
|
-
* of image returned is 100x100px.
|
|
169
|
+
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
|
114
170
|
*
|
|
115
171
|
*
|
|
116
|
-
* @param {string} name
|
|
117
|
-
* @param {number} width
|
|
118
|
-
* @param {number} height
|
|
119
|
-
* @param {string} background
|
|
172
|
+
* @param {string} params.name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.
|
|
173
|
+
* @param {number} params.width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
174
|
+
* @param {number} params.height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
175
|
+
* @param {string} params.background - Changes background color. By default a random color will be picked and stay will persistent to the given name.
|
|
120
176
|
* @throws {AppwriteException}
|
|
121
177
|
* @returns {ArrayBuffer}
|
|
122
178
|
*/
|
|
179
|
+
getInitials(params?: {
|
|
180
|
+
name?: string;
|
|
181
|
+
width?: number;
|
|
182
|
+
height?: number;
|
|
183
|
+
background?: string;
|
|
184
|
+
}): Promise<ArrayBuffer>;
|
|
185
|
+
/**
|
|
186
|
+
* Use this endpoint to show your user initials avatar icon on your website or app. By default, this route will try to print your logged-in user name or email initials. You can also overwrite the user name if you pass the 'name' parameter. If no name is given and no user is logged, an empty avatar will be returned.
|
|
187
|
+
*
|
|
188
|
+
* You can use the color and background params to change the avatar colors. By default, a random theme will be selected. The random theme will persist for the user's initials when reloading the same theme will always return for the same initials.
|
|
189
|
+
*
|
|
190
|
+
* When one dimension is specified and the other is 0, the image is scaled with preserved aspect ratio. If both dimensions are 0, the API provides an image at source quality. If dimensions are not specified, the default size of image returned is 100x100px.
|
|
191
|
+
*
|
|
192
|
+
*
|
|
193
|
+
* @param {string} name - Full Name. When empty, current user name or email will be used. Max length: 128 chars.
|
|
194
|
+
* @param {number} width - Image width. Pass an integer between 0 to 2000. Defaults to 100.
|
|
195
|
+
* @param {number} height - Image height. Pass an integer between 0 to 2000. Defaults to 100.
|
|
196
|
+
* @param {string} background - Changes background color. By default a random color will be picked and stay will persistent to the given name.
|
|
197
|
+
* @throws {AppwriteException}
|
|
198
|
+
* @returns {Promise<ArrayBuffer>}
|
|
199
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
200
|
+
*/
|
|
123
201
|
getInitials(name?: string, width?: number, height?: number, background?: string): Promise<ArrayBuffer>;
|
|
124
202
|
/**
|
|
125
|
-
* Converts a given plain text to a QR code image. You can use the query
|
|
126
|
-
* parameters to change the size and style of the resulting image.
|
|
203
|
+
* Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
|
|
127
204
|
*
|
|
128
205
|
*
|
|
129
|
-
* @param {string} text
|
|
130
|
-
* @param {number} size
|
|
131
|
-
* @param {number} margin
|
|
132
|
-
* @param {boolean} download
|
|
206
|
+
* @param {string} params.text - Plain text to be converted to QR code image.
|
|
207
|
+
* @param {number} params.size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.
|
|
208
|
+
* @param {number} params.margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.
|
|
209
|
+
* @param {boolean} params.download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.
|
|
133
210
|
* @throws {AppwriteException}
|
|
134
211
|
* @returns {ArrayBuffer}
|
|
135
212
|
*/
|
|
213
|
+
getQR(params: {
|
|
214
|
+
text: string;
|
|
215
|
+
size?: number;
|
|
216
|
+
margin?: number;
|
|
217
|
+
download?: boolean;
|
|
218
|
+
}): Promise<ArrayBuffer>;
|
|
219
|
+
/**
|
|
220
|
+
* Converts a given plain text to a QR code image. You can use the query parameters to change the size and style of the resulting image.
|
|
221
|
+
*
|
|
222
|
+
*
|
|
223
|
+
* @param {string} text - Plain text to be converted to QR code image.
|
|
224
|
+
* @param {number} size - QR code size. Pass an integer between 1 to 1000. Defaults to 400.
|
|
225
|
+
* @param {number} margin - Margin from edge. Pass an integer between 0 to 10. Defaults to 1.
|
|
226
|
+
* @param {boolean} download - Return resulting image with 'Content-Disposition: attachment ' headers for the browser to start downloading it. Pass 0 for no header, or 1 for otherwise. Default value is set to 0.
|
|
227
|
+
* @throws {AppwriteException}
|
|
228
|
+
* @returns {Promise<ArrayBuffer>}
|
|
229
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
230
|
+
*/
|
|
136
231
|
getQR(text: string, size?: number, margin?: number, download?: boolean): Promise<ArrayBuffer>;
|
|
137
232
|
/**
|
|
138
233
|
* You can use this endpoint to show different browser icons to your users.
|
|
@@ -4,109 +4,250 @@ import type { Models } from '../models';
|
|
|
4
4
|
export declare class Databases extends Service {
|
|
5
5
|
constructor(client: Client);
|
|
6
6
|
/**
|
|
7
|
-
* Get a list of all the user's documents in a given collection. You can use
|
|
8
|
-
* the query params to filter your results.
|
|
7
|
+
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
9
8
|
*
|
|
10
|
-
* @param {string} databaseId
|
|
11
|
-
* @param {string} collectionId
|
|
12
|
-
* @param {string[]} queries
|
|
9
|
+
* @param {string} params.databaseId - Database ID.
|
|
10
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
11
|
+
* @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.
|
|
13
12
|
* @throws {AppwriteException}
|
|
14
13
|
* @returns {Promise}
|
|
14
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.listRows` instead.
|
|
15
|
+
*/
|
|
16
|
+
listDocuments<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
17
|
+
databaseId: string;
|
|
18
|
+
collectionId: string;
|
|
19
|
+
queries?: string[];
|
|
20
|
+
}): Promise<Models.DocumentList<Document>>;
|
|
21
|
+
/**
|
|
22
|
+
* Get a list of all the user's documents in a given collection. You can use the query params to filter your results.
|
|
23
|
+
*
|
|
24
|
+
* @param {string} databaseId - Database ID.
|
|
25
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
26
|
+
* @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.
|
|
27
|
+
* @throws {AppwriteException}
|
|
28
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
29
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
15
30
|
*/
|
|
16
31
|
listDocuments<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, queries?: string[]): Promise<Models.DocumentList<Document>>;
|
|
17
32
|
/**
|
|
18
|
-
* Create a new Document. Before using this route, you should create a new
|
|
19
|
-
* collection resource using either a [server
|
|
20
|
-
* integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
|
21
|
-
* API or directly from your database console.
|
|
33
|
+
* Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
|
|
22
34
|
*
|
|
23
|
-
* @param {string} databaseId
|
|
24
|
-
* @param {string} collectionId
|
|
25
|
-
* @param {string} documentId
|
|
26
|
-
* @param {
|
|
27
|
-
* @param {string[]} permissions
|
|
35
|
+
* @param {string} params.databaseId - Database ID.
|
|
36
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
|
|
37
|
+
* @param {string} params.documentId - Document 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.
|
|
38
|
+
* @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>} params.data - Document data as JSON object.
|
|
39
|
+
* @param {string[]} params.permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
28
40
|
* @throws {AppwriteException}
|
|
29
41
|
* @returns {Promise}
|
|
42
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createRow` instead.
|
|
30
43
|
*/
|
|
31
|
-
createDocument<Document extends Models.Document = Models.DefaultDocument>(
|
|
44
|
+
createDocument<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
45
|
+
databaseId: string;
|
|
46
|
+
collectionId: string;
|
|
47
|
+
documentId: string;
|
|
48
|
+
data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>;
|
|
49
|
+
permissions?: string[];
|
|
50
|
+
}): Promise<Document>;
|
|
32
51
|
/**
|
|
33
|
-
*
|
|
34
|
-
* object with the document data.
|
|
52
|
+
* Create a new Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
|
|
35
53
|
*
|
|
36
|
-
* @param {string} databaseId
|
|
37
|
-
* @param {string} collectionId
|
|
38
|
-
* @param {string} documentId
|
|
39
|
-
* @param {string
|
|
54
|
+
* @param {string} databaseId - Database ID.
|
|
55
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection). Make sure to define attributes before creating documents.
|
|
56
|
+
* @param {string} documentId - Document 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.
|
|
57
|
+
* @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>} data - Document data as JSON object.
|
|
58
|
+
* @param {string[]} permissions - An array of permissions strings. By default, only the current user is granted all permissions. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
59
|
+
* @throws {AppwriteException}
|
|
60
|
+
* @returns {Promise<Document>}
|
|
61
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
62
|
+
*/
|
|
63
|
+
createDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Omit<Document, keyof Models.Document>, permissions?: string[]): Promise<Document>;
|
|
64
|
+
/**
|
|
65
|
+
* Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
|
|
66
|
+
*
|
|
67
|
+
* @param {string} params.databaseId - Database ID.
|
|
68
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
69
|
+
* @param {string} params.documentId - Document ID.
|
|
70
|
+
* @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.
|
|
40
71
|
* @throws {AppwriteException}
|
|
41
72
|
* @returns {Promise}
|
|
73
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getRow` instead.
|
|
42
74
|
*/
|
|
43
|
-
getDocument<Document extends Models.Document = Models.DefaultDocument>(
|
|
75
|
+
getDocument<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
76
|
+
databaseId: string;
|
|
77
|
+
collectionId: string;
|
|
78
|
+
documentId: string;
|
|
79
|
+
queries?: string[];
|
|
80
|
+
}): Promise<Document>;
|
|
44
81
|
/**
|
|
45
|
-
*
|
|
46
|
-
* yet officially supported. It may be subject to breaking changes or removal
|
|
47
|
-
* in future versions.
|
|
82
|
+
* Get a document by its unique ID. This endpoint response returns a JSON object with the document data.
|
|
48
83
|
*
|
|
49
|
-
*
|
|
50
|
-
* new collection
|
|
51
|
-
*
|
|
52
|
-
*
|
|
84
|
+
* @param {string} databaseId - Database ID.
|
|
85
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
86
|
+
* @param {string} documentId - Document ID.
|
|
87
|
+
* @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.
|
|
88
|
+
* @throws {AppwriteException}
|
|
89
|
+
* @returns {Promise<Document>}
|
|
90
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
91
|
+
*/
|
|
92
|
+
getDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, queries?: string[]): Promise<Document>;
|
|
93
|
+
/**
|
|
94
|
+
* Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
|
|
53
95
|
*
|
|
54
|
-
* @param {string} databaseId
|
|
55
|
-
* @param {string} collectionId
|
|
56
|
-
* @param {string} documentId
|
|
57
|
-
* @param {
|
|
58
|
-
* @param {string[]} permissions
|
|
96
|
+
* @param {string} params.databaseId - Database ID.
|
|
97
|
+
* @param {string} params.collectionId - Collection ID.
|
|
98
|
+
* @param {string} params.documentId - Document ID.
|
|
99
|
+
* @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} params.data - Document data as JSON object. Include all required attributes of the document to be created or updated.
|
|
100
|
+
* @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
59
101
|
* @throws {AppwriteException}
|
|
60
102
|
* @returns {Promise}
|
|
103
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.upsertRow` instead.
|
|
61
104
|
*/
|
|
62
|
-
upsertDocument<Document extends Models.Document = Models.DefaultDocument>(
|
|
105
|
+
upsertDocument<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
106
|
+
databaseId: string;
|
|
107
|
+
collectionId: string;
|
|
108
|
+
documentId: string;
|
|
109
|
+
data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
|
|
110
|
+
permissions?: string[];
|
|
111
|
+
}): Promise<Document>;
|
|
63
112
|
/**
|
|
64
|
-
*
|
|
65
|
-
* only specific fields that will get updated.
|
|
113
|
+
* Create or update a Document. Before using this route, you should create a new collection resource using either a [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection) API or directly from your database console.
|
|
66
114
|
*
|
|
67
|
-
* @param {string} databaseId
|
|
68
|
-
* @param {string} collectionId
|
|
69
|
-
* @param {string} documentId
|
|
70
|
-
* @param {
|
|
71
|
-
* @param {string[]} permissions
|
|
115
|
+
* @param {string} databaseId - Database ID.
|
|
116
|
+
* @param {string} collectionId - Collection ID.
|
|
117
|
+
* @param {string} documentId - Document ID.
|
|
118
|
+
* @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} data - Document data as JSON object. Include all required attributes of the document to be created or updated.
|
|
119
|
+
* @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
120
|
+
* @throws {AppwriteException}
|
|
121
|
+
* @returns {Promise<Document>}
|
|
122
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
123
|
+
*/
|
|
124
|
+
upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document>;
|
|
125
|
+
/**
|
|
126
|
+
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
127
|
+
*
|
|
128
|
+
* @param {string} params.databaseId - Database ID.
|
|
129
|
+
* @param {string} params.collectionId - Collection ID.
|
|
130
|
+
* @param {string} params.documentId - Document ID.
|
|
131
|
+
* @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} params.data - Document data as JSON object. Include only attribute and value pairs to be updated.
|
|
132
|
+
* @param {string[]} params.permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
72
133
|
* @throws {AppwriteException}
|
|
73
134
|
* @returns {Promise}
|
|
135
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateRow` instead.
|
|
136
|
+
*/
|
|
137
|
+
updateDocument<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
138
|
+
databaseId: string;
|
|
139
|
+
collectionId: string;
|
|
140
|
+
documentId: string;
|
|
141
|
+
data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
|
|
142
|
+
permissions?: string[];
|
|
143
|
+
}): Promise<Document>;
|
|
144
|
+
/**
|
|
145
|
+
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
146
|
+
*
|
|
147
|
+
* @param {string} databaseId - Database ID.
|
|
148
|
+
* @param {string} collectionId - Collection ID.
|
|
149
|
+
* @param {string} documentId - Document ID.
|
|
150
|
+
* @param {Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>} data - Document data as JSON object. Include only attribute and value pairs to be updated.
|
|
151
|
+
* @param {string[]} permissions - An array of permissions strings. By default, the current permissions are inherited. [Learn more about permissions](https://appwrite.io/docs/permissions).
|
|
152
|
+
* @throws {AppwriteException}
|
|
153
|
+
* @returns {Promise<Document>}
|
|
154
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
74
155
|
*/
|
|
75
|
-
updateDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?:
|
|
156
|
+
updateDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[]): Promise<Document>;
|
|
76
157
|
/**
|
|
77
158
|
* Delete a document by its unique ID.
|
|
78
159
|
*
|
|
79
|
-
* @param {string} databaseId
|
|
80
|
-
* @param {string} collectionId
|
|
81
|
-
* @param {string} documentId
|
|
160
|
+
* @param {string} params.databaseId - Database ID.
|
|
161
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
162
|
+
* @param {string} params.documentId - Document ID.
|
|
82
163
|
* @throws {AppwriteException}
|
|
83
164
|
* @returns {Promise}
|
|
165
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.deleteRow` instead.
|
|
166
|
+
*/
|
|
167
|
+
deleteDocument(params: {
|
|
168
|
+
databaseId: string;
|
|
169
|
+
collectionId: string;
|
|
170
|
+
documentId: string;
|
|
171
|
+
}): Promise<{}>;
|
|
172
|
+
/**
|
|
173
|
+
* Delete a document by its unique ID.
|
|
174
|
+
*
|
|
175
|
+
* @param {string} databaseId - Database ID.
|
|
176
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
177
|
+
* @param {string} documentId - Document ID.
|
|
178
|
+
* @throws {AppwriteException}
|
|
179
|
+
* @returns {Promise<{}>}
|
|
180
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
84
181
|
*/
|
|
85
182
|
deleteDocument(databaseId: string, collectionId: string, documentId: string): Promise<{}>;
|
|
86
183
|
/**
|
|
87
184
|
* Decrement a specific attribute of a document by a given value.
|
|
88
185
|
*
|
|
89
|
-
* @param {string} databaseId
|
|
90
|
-
* @param {string} collectionId
|
|
91
|
-
* @param {string} documentId
|
|
92
|
-
* @param {string} attribute
|
|
93
|
-
* @param {number} value
|
|
94
|
-
* @param {number} min
|
|
186
|
+
* @param {string} params.databaseId - Database ID.
|
|
187
|
+
* @param {string} params.collectionId - Collection ID.
|
|
188
|
+
* @param {string} params.documentId - Document ID.
|
|
189
|
+
* @param {string} params.attribute - Attribute key.
|
|
190
|
+
* @param {number} params.value - Value to increment the attribute by. The value must be a number.
|
|
191
|
+
* @param {number} params.min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.
|
|
95
192
|
* @throws {AppwriteException}
|
|
96
193
|
* @returns {Promise}
|
|
194
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.decrementRowColumn` instead.
|
|
195
|
+
*/
|
|
196
|
+
decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
197
|
+
databaseId: string;
|
|
198
|
+
collectionId: string;
|
|
199
|
+
documentId: string;
|
|
200
|
+
attribute: string;
|
|
201
|
+
value?: number;
|
|
202
|
+
min?: number;
|
|
203
|
+
}): Promise<Document>;
|
|
204
|
+
/**
|
|
205
|
+
* Decrement a specific attribute of a document by a given value.
|
|
206
|
+
*
|
|
207
|
+
* @param {string} databaseId - Database ID.
|
|
208
|
+
* @param {string} collectionId - Collection ID.
|
|
209
|
+
* @param {string} documentId - Document ID.
|
|
210
|
+
* @param {string} attribute - Attribute key.
|
|
211
|
+
* @param {number} value - Value to increment the attribute by. The value must be a number.
|
|
212
|
+
* @param {number} min - Minimum value for the attribute. If the current value is lesser than this value, an exception will be thrown.
|
|
213
|
+
* @throws {AppwriteException}
|
|
214
|
+
* @returns {Promise<Document>}
|
|
215
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
97
216
|
*/
|
|
98
217
|
decrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, min?: number): Promise<Document>;
|
|
99
218
|
/**
|
|
100
219
|
* Increment a specific attribute of a document by a given value.
|
|
101
220
|
*
|
|
102
|
-
* @param {string} databaseId
|
|
103
|
-
* @param {string} collectionId
|
|
104
|
-
* @param {string} documentId
|
|
105
|
-
* @param {string} attribute
|
|
106
|
-
* @param {number} value
|
|
107
|
-
* @param {number} max
|
|
221
|
+
* @param {string} params.databaseId - Database ID.
|
|
222
|
+
* @param {string} params.collectionId - Collection ID.
|
|
223
|
+
* @param {string} params.documentId - Document ID.
|
|
224
|
+
* @param {string} params.attribute - Attribute key.
|
|
225
|
+
* @param {number} params.value - Value to increment the attribute by. The value must be a number.
|
|
226
|
+
* @param {number} params.max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.
|
|
108
227
|
* @throws {AppwriteException}
|
|
109
228
|
* @returns {Promise}
|
|
229
|
+
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.incrementRowColumn` instead.
|
|
230
|
+
*/
|
|
231
|
+
incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(params: {
|
|
232
|
+
databaseId: string;
|
|
233
|
+
collectionId: string;
|
|
234
|
+
documentId: string;
|
|
235
|
+
attribute: string;
|
|
236
|
+
value?: number;
|
|
237
|
+
max?: number;
|
|
238
|
+
}): Promise<Document>;
|
|
239
|
+
/**
|
|
240
|
+
* Increment a specific attribute of a document by a given value.
|
|
241
|
+
*
|
|
242
|
+
* @param {string} databaseId - Database ID.
|
|
243
|
+
* @param {string} collectionId - Collection ID.
|
|
244
|
+
* @param {string} documentId - Document ID.
|
|
245
|
+
* @param {string} attribute - Attribute key.
|
|
246
|
+
* @param {number} value - Value to increment the attribute by. The value must be a number.
|
|
247
|
+
* @param {number} max - Maximum value for the attribute. If the current value is greater than this value, an error will be thrown.
|
|
248
|
+
* @throws {AppwriteException}
|
|
249
|
+
* @returns {Promise<Document>}
|
|
250
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
110
251
|
*/
|
|
111
252
|
incrementDocumentAttribute<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, attribute: string, value?: number, max?: number): Promise<Document>;
|
|
112
253
|
}
|