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
package/dist/cjs/sdk.js
CHANGED
|
@@ -100,7 +100,7 @@ class Client {
|
|
|
100
100
|
'x-sdk-name': 'React Native',
|
|
101
101
|
'x-sdk-platform': 'client',
|
|
102
102
|
'x-sdk-language': 'reactnative',
|
|
103
|
-
'x-sdk-version': '0.
|
|
103
|
+
'x-sdk-version': '0.11.0',
|
|
104
104
|
'X-Appwrite-Response-Format': '1.7.0',
|
|
105
105
|
};
|
|
106
106
|
this.realtime = {
|
|
@@ -485,7 +485,7 @@ class Account extends Service {
|
|
|
485
485
|
*
|
|
486
486
|
* @throws {AppwriteException}
|
|
487
487
|
* @returns {Promise}
|
|
488
|
-
|
|
488
|
+
*/
|
|
489
489
|
get() {
|
|
490
490
|
const apiPath = '/account';
|
|
491
491
|
const payload = {};
|
|
@@ -507,7 +507,7 @@ class Account extends Service {
|
|
|
507
507
|
* @param {string} name
|
|
508
508
|
* @throws {AppwriteException}
|
|
509
509
|
* @returns {Promise}
|
|
510
|
-
|
|
510
|
+
*/
|
|
511
511
|
create(userId, email, password, name) {
|
|
512
512
|
if (typeof userId === 'undefined') {
|
|
513
513
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -551,7 +551,7 @@ class Account extends Service {
|
|
|
551
551
|
* @param {string} password
|
|
552
552
|
* @throws {AppwriteException}
|
|
553
553
|
* @returns {Promise}
|
|
554
|
-
|
|
554
|
+
*/
|
|
555
555
|
updateEmail(email, password) {
|
|
556
556
|
if (typeof email === 'undefined') {
|
|
557
557
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
@@ -578,7 +578,7 @@ class Account extends Service {
|
|
|
578
578
|
* @param {string[]} queries
|
|
579
579
|
* @throws {AppwriteException}
|
|
580
580
|
* @returns {Promise}
|
|
581
|
-
|
|
581
|
+
*/
|
|
582
582
|
listIdentities(queries) {
|
|
583
583
|
const apiPath = '/account/identities';
|
|
584
584
|
const payload = {};
|
|
@@ -594,7 +594,7 @@ class Account extends Service {
|
|
|
594
594
|
* @param {string} identityId
|
|
595
595
|
* @throws {AppwriteException}
|
|
596
596
|
* @returns {Promise}
|
|
597
|
-
|
|
597
|
+
*/
|
|
598
598
|
deleteIdentity(identityId) {
|
|
599
599
|
if (typeof identityId === 'undefined') {
|
|
600
600
|
throw new AppwriteException('Missing required parameter: "identityId"');
|
|
@@ -615,7 +615,7 @@ class Account extends Service {
|
|
|
615
615
|
*
|
|
616
616
|
* @throws {AppwriteException}
|
|
617
617
|
* @returns {Promise}
|
|
618
|
-
|
|
618
|
+
*/
|
|
619
619
|
createJWT() {
|
|
620
620
|
const apiPath = '/account/jwts';
|
|
621
621
|
const payload = {};
|
|
@@ -631,7 +631,7 @@ class Account extends Service {
|
|
|
631
631
|
* @param {string[]} queries
|
|
632
632
|
* @throws {AppwriteException}
|
|
633
633
|
* @returns {Promise}
|
|
634
|
-
|
|
634
|
+
*/
|
|
635
635
|
listLogs(queries) {
|
|
636
636
|
const apiPath = '/account/logs';
|
|
637
637
|
const payload = {};
|
|
@@ -647,7 +647,7 @@ class Account extends Service {
|
|
|
647
647
|
* @param {boolean} mfa
|
|
648
648
|
* @throws {AppwriteException}
|
|
649
649
|
* @returns {Promise}
|
|
650
|
-
|
|
650
|
+
*/
|
|
651
651
|
updateMFA(mfa) {
|
|
652
652
|
if (typeof mfa === 'undefined') {
|
|
653
653
|
throw new AppwriteException('Missing required parameter: "mfa"');
|
|
@@ -671,7 +671,7 @@ class Account extends Service {
|
|
|
671
671
|
* @param {AuthenticatorType} type
|
|
672
672
|
* @throws {AppwriteException}
|
|
673
673
|
* @returns {Promise}
|
|
674
|
-
|
|
674
|
+
*/
|
|
675
675
|
createMfaAuthenticator(type) {
|
|
676
676
|
if (typeof type === 'undefined') {
|
|
677
677
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
@@ -692,7 +692,7 @@ class Account extends Service {
|
|
|
692
692
|
* @param {string} otp
|
|
693
693
|
* @throws {AppwriteException}
|
|
694
694
|
* @returns {Promise}
|
|
695
|
-
|
|
695
|
+
*/
|
|
696
696
|
updateMfaAuthenticator(type, otp) {
|
|
697
697
|
if (typeof type === 'undefined') {
|
|
698
698
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
@@ -716,7 +716,7 @@ class Account extends Service {
|
|
|
716
716
|
* @param {AuthenticatorType} type
|
|
717
717
|
* @throws {AppwriteException}
|
|
718
718
|
* @returns {Promise}
|
|
719
|
-
|
|
719
|
+
*/
|
|
720
720
|
deleteMfaAuthenticator(type) {
|
|
721
721
|
if (typeof type === 'undefined') {
|
|
722
722
|
throw new AppwriteException('Missing required parameter: "type"');
|
|
@@ -736,7 +736,7 @@ class Account extends Service {
|
|
|
736
736
|
* @param {AuthenticationFactor} factor
|
|
737
737
|
* @throws {AppwriteException}
|
|
738
738
|
* @returns {Promise}
|
|
739
|
-
|
|
739
|
+
*/
|
|
740
740
|
createMfaChallenge(factor) {
|
|
741
741
|
if (typeof factor === 'undefined') {
|
|
742
742
|
throw new AppwriteException('Missing required parameter: "factor"');
|
|
@@ -762,7 +762,7 @@ class Account extends Service {
|
|
|
762
762
|
* @param {string} otp
|
|
763
763
|
* @throws {AppwriteException}
|
|
764
764
|
* @returns {Promise}
|
|
765
|
-
|
|
765
|
+
*/
|
|
766
766
|
updateMfaChallenge(challengeId, otp) {
|
|
767
767
|
if (typeof challengeId === 'undefined') {
|
|
768
768
|
throw new AppwriteException('Missing required parameter: "challengeId"');
|
|
@@ -788,7 +788,7 @@ class Account extends Service {
|
|
|
788
788
|
*
|
|
789
789
|
* @throws {AppwriteException}
|
|
790
790
|
* @returns {Promise}
|
|
791
|
-
|
|
791
|
+
*/
|
|
792
792
|
listMfaFactors() {
|
|
793
793
|
const apiPath = '/account/mfa/factors';
|
|
794
794
|
const payload = {};
|
|
@@ -803,7 +803,7 @@ class Account extends Service {
|
|
|
803
803
|
*
|
|
804
804
|
* @throws {AppwriteException}
|
|
805
805
|
* @returns {Promise}
|
|
806
|
-
|
|
806
|
+
*/
|
|
807
807
|
getMfaRecoveryCodes() {
|
|
808
808
|
const apiPath = '/account/mfa/recovery-codes';
|
|
809
809
|
const payload = {};
|
|
@@ -819,7 +819,7 @@ class Account extends Service {
|
|
|
819
819
|
*
|
|
820
820
|
* @throws {AppwriteException}
|
|
821
821
|
* @returns {Promise}
|
|
822
|
-
|
|
822
|
+
*/
|
|
823
823
|
createMfaRecoveryCodes() {
|
|
824
824
|
const apiPath = '/account/mfa/recovery-codes';
|
|
825
825
|
const payload = {};
|
|
@@ -836,7 +836,7 @@ class Account extends Service {
|
|
|
836
836
|
*
|
|
837
837
|
* @throws {AppwriteException}
|
|
838
838
|
* @returns {Promise}
|
|
839
|
-
|
|
839
|
+
*/
|
|
840
840
|
updateMfaRecoveryCodes() {
|
|
841
841
|
const apiPath = '/account/mfa/recovery-codes';
|
|
842
842
|
const payload = {};
|
|
@@ -851,7 +851,7 @@ class Account extends Service {
|
|
|
851
851
|
* @param {string} name
|
|
852
852
|
* @throws {AppwriteException}
|
|
853
853
|
* @returns {Promise}
|
|
854
|
-
|
|
854
|
+
*/
|
|
855
855
|
updateName(name) {
|
|
856
856
|
if (typeof name === 'undefined') {
|
|
857
857
|
throw new AppwriteException('Missing required parameter: "name"');
|
|
@@ -875,7 +875,7 @@ class Account extends Service {
|
|
|
875
875
|
* @param {string} oldPassword
|
|
876
876
|
* @throws {AppwriteException}
|
|
877
877
|
* @returns {Promise}
|
|
878
|
-
|
|
878
|
+
*/
|
|
879
879
|
updatePassword(password, oldPassword) {
|
|
880
880
|
if (typeof password === 'undefined') {
|
|
881
881
|
throw new AppwriteException('Missing required parameter: "password"');
|
|
@@ -904,7 +904,7 @@ class Account extends Service {
|
|
|
904
904
|
* @param {string} password
|
|
905
905
|
* @throws {AppwriteException}
|
|
906
906
|
* @returns {Promise}
|
|
907
|
-
|
|
907
|
+
*/
|
|
908
908
|
updatePhone(phone, password) {
|
|
909
909
|
if (typeof phone === 'undefined') {
|
|
910
910
|
throw new AppwriteException('Missing required parameter: "phone"');
|
|
@@ -930,7 +930,7 @@ class Account extends Service {
|
|
|
930
930
|
*
|
|
931
931
|
* @throws {AppwriteException}
|
|
932
932
|
* @returns {Promise}
|
|
933
|
-
|
|
933
|
+
*/
|
|
934
934
|
getPrefs() {
|
|
935
935
|
const apiPath = '/account/prefs';
|
|
936
936
|
const payload = {};
|
|
@@ -945,7 +945,7 @@ class Account extends Service {
|
|
|
945
945
|
* @param {object} prefs
|
|
946
946
|
* @throws {AppwriteException}
|
|
947
947
|
* @returns {Promise}
|
|
948
|
-
|
|
948
|
+
*/
|
|
949
949
|
updatePrefs(prefs) {
|
|
950
950
|
if (typeof prefs === 'undefined') {
|
|
951
951
|
throw new AppwriteException('Missing required parameter: "prefs"');
|
|
@@ -974,7 +974,7 @@ class Account extends Service {
|
|
|
974
974
|
* @param {string} url
|
|
975
975
|
* @throws {AppwriteException}
|
|
976
976
|
* @returns {Promise}
|
|
977
|
-
|
|
977
|
+
*/
|
|
978
978
|
createRecovery(email, url) {
|
|
979
979
|
if (typeof email === 'undefined') {
|
|
980
980
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
@@ -1012,7 +1012,7 @@ class Account extends Service {
|
|
|
1012
1012
|
* @param {string} password
|
|
1013
1013
|
* @throws {AppwriteException}
|
|
1014
1014
|
* @returns {Promise}
|
|
1015
|
-
|
|
1015
|
+
*/
|
|
1016
1016
|
updateRecovery(userId, secret, password) {
|
|
1017
1017
|
if (typeof userId === 'undefined') {
|
|
1018
1018
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -1045,7 +1045,7 @@ class Account extends Service {
|
|
|
1045
1045
|
*
|
|
1046
1046
|
* @throws {AppwriteException}
|
|
1047
1047
|
* @returns {Promise}
|
|
1048
|
-
|
|
1048
|
+
*/
|
|
1049
1049
|
listSessions() {
|
|
1050
1050
|
const apiPath = '/account/sessions';
|
|
1051
1051
|
const payload = {};
|
|
@@ -1058,7 +1058,7 @@ class Account extends Service {
|
|
|
1058
1058
|
*
|
|
1059
1059
|
* @throws {AppwriteException}
|
|
1060
1060
|
* @returns {Promise}
|
|
1061
|
-
|
|
1061
|
+
*/
|
|
1062
1062
|
deleteSessions() {
|
|
1063
1063
|
const apiPath = '/account/sessions';
|
|
1064
1064
|
const payload = {};
|
|
@@ -1078,7 +1078,7 @@ class Account extends Service {
|
|
|
1078
1078
|
*
|
|
1079
1079
|
* @throws {AppwriteException}
|
|
1080
1080
|
* @returns {Promise}
|
|
1081
|
-
|
|
1081
|
+
*/
|
|
1082
1082
|
createAnonymousSession() {
|
|
1083
1083
|
const apiPath = '/account/sessions/anonymous';
|
|
1084
1084
|
const payload = {};
|
|
@@ -1099,7 +1099,7 @@ class Account extends Service {
|
|
|
1099
1099
|
* @param {string} password
|
|
1100
1100
|
* @throws {AppwriteException}
|
|
1101
1101
|
* @returns {Promise}
|
|
1102
|
-
|
|
1102
|
+
*/
|
|
1103
1103
|
createEmailPasswordSession(email, password) {
|
|
1104
1104
|
if (typeof email === 'undefined') {
|
|
1105
1105
|
throw new AppwriteException('Missing required parameter: "email"');
|
|
@@ -1129,7 +1129,7 @@ class Account extends Service {
|
|
|
1129
1129
|
* @param {string} secret
|
|
1130
1130
|
* @throws {AppwriteException}
|
|
1131
1131
|
* @returns {Promise}
|
|
1132
|
-
|
|
1132
|
+
*/
|
|
1133
1133
|
updateMagicURLSession(userId, secret) {
|
|
1134
1134
|
if (typeof userId === 'undefined') {
|
|
1135
1135
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -1174,7 +1174,7 @@ class Account extends Service {
|
|
|
1174
1174
|
* @param {string[]} scopes
|
|
1175
1175
|
* @throws {AppwriteException}
|
|
1176
1176
|
* @returns {void|string}
|
|
1177
|
-
|
|
1177
|
+
*/
|
|
1178
1178
|
createOAuth2Session(provider, success, failure, scopes) {
|
|
1179
1179
|
if (typeof provider === 'undefined') {
|
|
1180
1180
|
throw new AppwriteException('Missing required parameter: "provider"');
|
|
@@ -1206,7 +1206,7 @@ class Account extends Service {
|
|
|
1206
1206
|
* @param {string} secret
|
|
1207
1207
|
* @throws {AppwriteException}
|
|
1208
1208
|
* @returns {Promise}
|
|
1209
|
-
|
|
1209
|
+
*/
|
|
1210
1210
|
updatePhoneSession(userId, secret) {
|
|
1211
1211
|
if (typeof userId === 'undefined') {
|
|
1212
1212
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -1236,7 +1236,7 @@ class Account extends Service {
|
|
|
1236
1236
|
* @param {string} secret
|
|
1237
1237
|
* @throws {AppwriteException}
|
|
1238
1238
|
* @returns {Promise}
|
|
1239
|
-
|
|
1239
|
+
*/
|
|
1240
1240
|
createSession(userId, secret) {
|
|
1241
1241
|
if (typeof userId === 'undefined') {
|
|
1242
1242
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -1264,7 +1264,7 @@ class Account extends Service {
|
|
|
1264
1264
|
* @param {string} sessionId
|
|
1265
1265
|
* @throws {AppwriteException}
|
|
1266
1266
|
* @returns {Promise}
|
|
1267
|
-
|
|
1267
|
+
*/
|
|
1268
1268
|
getSession(sessionId) {
|
|
1269
1269
|
if (typeof sessionId === 'undefined') {
|
|
1270
1270
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
@@ -1282,7 +1282,7 @@ class Account extends Service {
|
|
|
1282
1282
|
* @param {string} sessionId
|
|
1283
1283
|
* @throws {AppwriteException}
|
|
1284
1284
|
* @returns {Promise}
|
|
1285
|
-
|
|
1285
|
+
*/
|
|
1286
1286
|
updateSession(sessionId) {
|
|
1287
1287
|
if (typeof sessionId === 'undefined') {
|
|
1288
1288
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
@@ -1304,7 +1304,7 @@ class Account extends Service {
|
|
|
1304
1304
|
* @param {string} sessionId
|
|
1305
1305
|
* @throws {AppwriteException}
|
|
1306
1306
|
* @returns {Promise}
|
|
1307
|
-
|
|
1307
|
+
*/
|
|
1308
1308
|
deleteSession(sessionId) {
|
|
1309
1309
|
if (typeof sessionId === 'undefined') {
|
|
1310
1310
|
throw new AppwriteException('Missing required parameter: "sessionId"');
|
|
@@ -1323,7 +1323,7 @@ class Account extends Service {
|
|
|
1323
1323
|
*
|
|
1324
1324
|
* @throws {AppwriteException}
|
|
1325
1325
|
* @returns {Promise}
|
|
1326
|
-
|
|
1326
|
+
*/
|
|
1327
1327
|
updateStatus() {
|
|
1328
1328
|
const apiPath = '/account/status';
|
|
1329
1329
|
const payload = {};
|
|
@@ -1344,7 +1344,7 @@ class Account extends Service {
|
|
|
1344
1344
|
* @param {string} providerId
|
|
1345
1345
|
* @throws {AppwriteException}
|
|
1346
1346
|
* @returns {Promise}
|
|
1347
|
-
|
|
1347
|
+
*/
|
|
1348
1348
|
createPushTarget(targetId, identifier, providerId) {
|
|
1349
1349
|
if (typeof targetId === 'undefined') {
|
|
1350
1350
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
@@ -1379,7 +1379,7 @@ class Account extends Service {
|
|
|
1379
1379
|
* @param {string} identifier
|
|
1380
1380
|
* @throws {AppwriteException}
|
|
1381
1381
|
* @returns {Promise}
|
|
1382
|
-
|
|
1382
|
+
*/
|
|
1383
1383
|
updatePushTarget(targetId, identifier) {
|
|
1384
1384
|
if (typeof targetId === 'undefined') {
|
|
1385
1385
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
@@ -1405,7 +1405,7 @@ class Account extends Service {
|
|
|
1405
1405
|
* @param {string} targetId
|
|
1406
1406
|
* @throws {AppwriteException}
|
|
1407
1407
|
* @returns {Promise}
|
|
1408
|
-
|
|
1408
|
+
*/
|
|
1409
1409
|
deletePushTarget(targetId) {
|
|
1410
1410
|
if (typeof targetId === 'undefined') {
|
|
1411
1411
|
throw new AppwriteException('Missing required parameter: "targetId"');
|
|
@@ -1434,7 +1434,7 @@ class Account extends Service {
|
|
|
1434
1434
|
* @param {boolean} phrase
|
|
1435
1435
|
* @throws {AppwriteException}
|
|
1436
1436
|
* @returns {Promise}
|
|
1437
|
-
|
|
1437
|
+
*/
|
|
1438
1438
|
createEmailToken(userId, email, phrase) {
|
|
1439
1439
|
if (typeof userId === 'undefined') {
|
|
1440
1440
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -1480,7 +1480,7 @@ class Account extends Service {
|
|
|
1480
1480
|
* @param {boolean} phrase
|
|
1481
1481
|
* @throws {AppwriteException}
|
|
1482
1482
|
* @returns {Promise}
|
|
1483
|
-
|
|
1483
|
+
*/
|
|
1484
1484
|
createMagicURLToken(userId, email, url, phrase) {
|
|
1485
1485
|
if (typeof userId === 'undefined') {
|
|
1486
1486
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -1529,7 +1529,7 @@ class Account extends Service {
|
|
|
1529
1529
|
* @param {string[]} scopes
|
|
1530
1530
|
* @throws {AppwriteException}
|
|
1531
1531
|
* @returns {void|string}
|
|
1532
|
-
|
|
1532
|
+
*/
|
|
1533
1533
|
createOAuth2Token(provider, success, failure, scopes) {
|
|
1534
1534
|
if (typeof provider === 'undefined') {
|
|
1535
1535
|
throw new AppwriteException('Missing required parameter: "provider"');
|
|
@@ -1568,7 +1568,7 @@ class Account extends Service {
|
|
|
1568
1568
|
* @param {string} phone
|
|
1569
1569
|
* @throws {AppwriteException}
|
|
1570
1570
|
* @returns {Promise}
|
|
1571
|
-
|
|
1571
|
+
*/
|
|
1572
1572
|
createPhoneToken(userId, phone) {
|
|
1573
1573
|
if (typeof userId === 'undefined') {
|
|
1574
1574
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -1609,7 +1609,7 @@ class Account extends Service {
|
|
|
1609
1609
|
* @param {string} url
|
|
1610
1610
|
* @throws {AppwriteException}
|
|
1611
1611
|
* @returns {Promise}
|
|
1612
|
-
|
|
1612
|
+
*/
|
|
1613
1613
|
createVerification(url) {
|
|
1614
1614
|
if (typeof url === 'undefined') {
|
|
1615
1615
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
@@ -1634,7 +1634,7 @@ class Account extends Service {
|
|
|
1634
1634
|
* @param {string} secret
|
|
1635
1635
|
* @throws {AppwriteException}
|
|
1636
1636
|
* @returns {Promise}
|
|
1637
|
-
|
|
1637
|
+
*/
|
|
1638
1638
|
updateVerification(userId, secret) {
|
|
1639
1639
|
if (typeof userId === 'undefined') {
|
|
1640
1640
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -1667,7 +1667,7 @@ class Account extends Service {
|
|
|
1667
1667
|
*
|
|
1668
1668
|
* @throws {AppwriteException}
|
|
1669
1669
|
* @returns {Promise}
|
|
1670
|
-
|
|
1670
|
+
*/
|
|
1671
1671
|
createPhoneVerification() {
|
|
1672
1672
|
const apiPath = '/account/verification/phone';
|
|
1673
1673
|
const payload = {};
|
|
@@ -1686,7 +1686,7 @@ class Account extends Service {
|
|
|
1686
1686
|
* @param {string} secret
|
|
1687
1687
|
* @throws {AppwriteException}
|
|
1688
1688
|
* @returns {Promise}
|
|
1689
|
-
|
|
1689
|
+
*/
|
|
1690
1690
|
updatePhoneVerification(userId, secret) {
|
|
1691
1691
|
if (typeof userId === 'undefined') {
|
|
1692
1692
|
throw new AppwriteException('Missing required parameter: "userId"');
|
|
@@ -1731,7 +1731,7 @@ class Avatars extends Service {
|
|
|
1731
1731
|
* @param {number} quality
|
|
1732
1732
|
* @throws {AppwriteException}
|
|
1733
1733
|
* @returns {ArrayBuffer}
|
|
1734
|
-
|
|
1734
|
+
*/
|
|
1735
1735
|
getBrowser(code, width, height, quality) {
|
|
1736
1736
|
if (typeof code === 'undefined') {
|
|
1737
1737
|
throw new AppwriteException('Missing required parameter: "code"');
|
|
@@ -1771,7 +1771,7 @@ class Avatars extends Service {
|
|
|
1771
1771
|
* @param {number} quality
|
|
1772
1772
|
* @throws {AppwriteException}
|
|
1773
1773
|
* @returns {ArrayBuffer}
|
|
1774
|
-
|
|
1774
|
+
*/
|
|
1775
1775
|
getCreditCard(code, width, height, quality) {
|
|
1776
1776
|
if (typeof code === 'undefined') {
|
|
1777
1777
|
throw new AppwriteException('Missing required parameter: "code"');
|
|
@@ -1803,7 +1803,7 @@ class Avatars extends Service {
|
|
|
1803
1803
|
* @param {string} url
|
|
1804
1804
|
* @throws {AppwriteException}
|
|
1805
1805
|
* @returns {ArrayBuffer}
|
|
1806
|
-
|
|
1806
|
+
*/
|
|
1807
1807
|
getFavicon(url) {
|
|
1808
1808
|
if (typeof url === 'undefined') {
|
|
1809
1809
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
@@ -1838,7 +1838,7 @@ class Avatars extends Service {
|
|
|
1838
1838
|
* @param {number} quality
|
|
1839
1839
|
* @throws {AppwriteException}
|
|
1840
1840
|
* @returns {ArrayBuffer}
|
|
1841
|
-
|
|
1841
|
+
*/
|
|
1842
1842
|
getFlag(code, width, height, quality) {
|
|
1843
1843
|
if (typeof code === 'undefined') {
|
|
1844
1844
|
throw new AppwriteException('Missing required parameter: "code"');
|
|
@@ -1879,7 +1879,7 @@ class Avatars extends Service {
|
|
|
1879
1879
|
* @param {number} height
|
|
1880
1880
|
* @throws {AppwriteException}
|
|
1881
1881
|
* @returns {ArrayBuffer}
|
|
1882
|
-
|
|
1882
|
+
*/
|
|
1883
1883
|
getImage(url, width, height) {
|
|
1884
1884
|
if (typeof url === 'undefined') {
|
|
1885
1885
|
throw new AppwriteException('Missing required parameter: "url"');
|
|
@@ -1926,7 +1926,7 @@ class Avatars extends Service {
|
|
|
1926
1926
|
* @param {string} background
|
|
1927
1927
|
* @throws {AppwriteException}
|
|
1928
1928
|
* @returns {ArrayBuffer}
|
|
1929
|
-
|
|
1929
|
+
*/
|
|
1930
1930
|
getInitials(name, width, height, background) {
|
|
1931
1931
|
const apiPath = '/avatars/initials';
|
|
1932
1932
|
const payload = {};
|
|
@@ -1960,7 +1960,7 @@ class Avatars extends Service {
|
|
|
1960
1960
|
* @param {boolean} download
|
|
1961
1961
|
* @throws {AppwriteException}
|
|
1962
1962
|
* @returns {ArrayBuffer}
|
|
1963
|
-
|
|
1963
|
+
*/
|
|
1964
1964
|
getQR(text, size, margin, download) {
|
|
1965
1965
|
if (typeof text === 'undefined') {
|
|
1966
1966
|
throw new AppwriteException('Missing required parameter: "text"');
|
|
@@ -2007,7 +2007,21 @@ class Avatars extends Service {
|
|
|
2007
2007
|
*/
|
|
2008
2008
|
getBrowserURL(code, width, height, quality) {
|
|
2009
2009
|
const apiPath = '/avatars/browsers/{code}'.replace('{code}', code);
|
|
2010
|
+
const payload = {};
|
|
2011
|
+
if (typeof width !== 'undefined') {
|
|
2012
|
+
payload['width'] = width;
|
|
2013
|
+
}
|
|
2014
|
+
if (typeof height !== 'undefined') {
|
|
2015
|
+
payload['height'] = height;
|
|
2016
|
+
}
|
|
2017
|
+
if (typeof quality !== 'undefined') {
|
|
2018
|
+
payload['quality'] = quality;
|
|
2019
|
+
}
|
|
2010
2020
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2021
|
+
payload['project'] = this.client.config.project;
|
|
2022
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2023
|
+
uri.searchParams.append(key, value);
|
|
2024
|
+
}
|
|
2011
2025
|
return uri;
|
|
2012
2026
|
}
|
|
2013
2027
|
/**
|
|
@@ -2030,7 +2044,21 @@ class Avatars extends Service {
|
|
|
2030
2044
|
*/
|
|
2031
2045
|
getCreditCardURL(code, width, height, quality) {
|
|
2032
2046
|
const apiPath = '/avatars/credit-cards/{code}'.replace('{code}', code);
|
|
2047
|
+
const payload = {};
|
|
2048
|
+
if (typeof width !== 'undefined') {
|
|
2049
|
+
payload['width'] = width;
|
|
2050
|
+
}
|
|
2051
|
+
if (typeof height !== 'undefined') {
|
|
2052
|
+
payload['height'] = height;
|
|
2053
|
+
}
|
|
2054
|
+
if (typeof quality !== 'undefined') {
|
|
2055
|
+
payload['quality'] = quality;
|
|
2056
|
+
}
|
|
2033
2057
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2058
|
+
payload['project'] = this.client.config.project;
|
|
2059
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2060
|
+
uri.searchParams.append(key, value);
|
|
2061
|
+
}
|
|
2034
2062
|
return uri;
|
|
2035
2063
|
}
|
|
2036
2064
|
/**
|
|
@@ -2045,7 +2073,15 @@ class Avatars extends Service {
|
|
|
2045
2073
|
*/
|
|
2046
2074
|
getFaviconURL(url) {
|
|
2047
2075
|
const apiPath = '/avatars/favicon';
|
|
2076
|
+
const payload = {};
|
|
2077
|
+
if (typeof url !== 'undefined') {
|
|
2078
|
+
payload['url'] = url;
|
|
2079
|
+
}
|
|
2048
2080
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2081
|
+
payload['project'] = this.client.config.project;
|
|
2082
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2083
|
+
uri.searchParams.append(key, value);
|
|
2084
|
+
}
|
|
2049
2085
|
return uri;
|
|
2050
2086
|
}
|
|
2051
2087
|
/**
|
|
@@ -2069,7 +2105,21 @@ class Avatars extends Service {
|
|
|
2069
2105
|
*/
|
|
2070
2106
|
getFlagURL(code, width, height, quality) {
|
|
2071
2107
|
const apiPath = '/avatars/flags/{code}'.replace('{code}', code);
|
|
2108
|
+
const payload = {};
|
|
2109
|
+
if (typeof width !== 'undefined') {
|
|
2110
|
+
payload['width'] = width;
|
|
2111
|
+
}
|
|
2112
|
+
if (typeof height !== 'undefined') {
|
|
2113
|
+
payload['height'] = height;
|
|
2114
|
+
}
|
|
2115
|
+
if (typeof quality !== 'undefined') {
|
|
2116
|
+
payload['quality'] = quality;
|
|
2117
|
+
}
|
|
2072
2118
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2119
|
+
payload['project'] = this.client.config.project;
|
|
2120
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2121
|
+
uri.searchParams.append(key, value);
|
|
2122
|
+
}
|
|
2073
2123
|
return uri;
|
|
2074
2124
|
}
|
|
2075
2125
|
/**
|
|
@@ -2093,7 +2143,21 @@ class Avatars extends Service {
|
|
|
2093
2143
|
*/
|
|
2094
2144
|
getImageURL(url, width, height) {
|
|
2095
2145
|
const apiPath = '/avatars/image';
|
|
2146
|
+
const payload = {};
|
|
2147
|
+
if (typeof url !== 'undefined') {
|
|
2148
|
+
payload['url'] = url;
|
|
2149
|
+
}
|
|
2150
|
+
if (typeof width !== 'undefined') {
|
|
2151
|
+
payload['width'] = width;
|
|
2152
|
+
}
|
|
2153
|
+
if (typeof height !== 'undefined') {
|
|
2154
|
+
payload['height'] = height;
|
|
2155
|
+
}
|
|
2096
2156
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2157
|
+
payload['project'] = this.client.config.project;
|
|
2158
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2159
|
+
uri.searchParams.append(key, value);
|
|
2160
|
+
}
|
|
2097
2161
|
return uri;
|
|
2098
2162
|
}
|
|
2099
2163
|
/**
|
|
@@ -2123,7 +2187,24 @@ class Avatars extends Service {
|
|
|
2123
2187
|
*/
|
|
2124
2188
|
getInitialsURL(name, width, height, background) {
|
|
2125
2189
|
const apiPath = '/avatars/initials';
|
|
2190
|
+
const payload = {};
|
|
2191
|
+
if (typeof name !== 'undefined') {
|
|
2192
|
+
payload['name'] = name;
|
|
2193
|
+
}
|
|
2194
|
+
if (typeof width !== 'undefined') {
|
|
2195
|
+
payload['width'] = width;
|
|
2196
|
+
}
|
|
2197
|
+
if (typeof height !== 'undefined') {
|
|
2198
|
+
payload['height'] = height;
|
|
2199
|
+
}
|
|
2200
|
+
if (typeof background !== 'undefined') {
|
|
2201
|
+
payload['background'] = background;
|
|
2202
|
+
}
|
|
2126
2203
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2204
|
+
payload['project'] = this.client.config.project;
|
|
2205
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2206
|
+
uri.searchParams.append(key, value);
|
|
2207
|
+
}
|
|
2127
2208
|
return uri;
|
|
2128
2209
|
}
|
|
2129
2210
|
/**
|
|
@@ -2140,7 +2221,24 @@ class Avatars extends Service {
|
|
|
2140
2221
|
*/
|
|
2141
2222
|
getQRURL(text, size, margin, download) {
|
|
2142
2223
|
const apiPath = '/avatars/qr';
|
|
2224
|
+
const payload = {};
|
|
2225
|
+
if (typeof text !== 'undefined') {
|
|
2226
|
+
payload['text'] = text;
|
|
2227
|
+
}
|
|
2228
|
+
if (typeof size !== 'undefined') {
|
|
2229
|
+
payload['size'] = size;
|
|
2230
|
+
}
|
|
2231
|
+
if (typeof margin !== 'undefined') {
|
|
2232
|
+
payload['margin'] = margin;
|
|
2233
|
+
}
|
|
2234
|
+
if (typeof download !== 'undefined') {
|
|
2235
|
+
payload['download'] = download;
|
|
2236
|
+
}
|
|
2143
2237
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2238
|
+
payload['project'] = this.client.config.project;
|
|
2239
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
2240
|
+
uri.searchParams.append(key, value);
|
|
2241
|
+
}
|
|
2144
2242
|
return uri;
|
|
2145
2243
|
}
|
|
2146
2244
|
}
|
|
@@ -2158,7 +2256,7 @@ class Databases extends Service {
|
|
|
2158
2256
|
* @param {string[]} queries
|
|
2159
2257
|
* @throws {AppwriteException}
|
|
2160
2258
|
* @returns {Promise}
|
|
2161
|
-
|
|
2259
|
+
*/
|
|
2162
2260
|
listDocuments(databaseId, collectionId, queries) {
|
|
2163
2261
|
if (typeof databaseId === 'undefined') {
|
|
2164
2262
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -2187,7 +2285,7 @@ class Databases extends Service {
|
|
|
2187
2285
|
* @param {string[]} permissions
|
|
2188
2286
|
* @throws {AppwriteException}
|
|
2189
2287
|
* @returns {Promise}
|
|
2190
|
-
|
|
2288
|
+
*/
|
|
2191
2289
|
createDocument(databaseId, collectionId, documentId, data, permissions) {
|
|
2192
2290
|
if (typeof databaseId === 'undefined') {
|
|
2193
2291
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -2227,7 +2325,7 @@ class Databases extends Service {
|
|
|
2227
2325
|
* @param {string[]} queries
|
|
2228
2326
|
* @throws {AppwriteException}
|
|
2229
2327
|
* @returns {Promise}
|
|
2230
|
-
|
|
2328
|
+
*/
|
|
2231
2329
|
getDocument(databaseId, collectionId, documentId, queries) {
|
|
2232
2330
|
if (typeof databaseId === 'undefined') {
|
|
2233
2331
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -2247,6 +2345,10 @@ class Databases extends Service {
|
|
|
2247
2345
|
return this.client.call('get', uri, {}, payload);
|
|
2248
2346
|
}
|
|
2249
2347
|
/**
|
|
2348
|
+
* **WARNING: Experimental Feature** - This endpoint is experimental and not
|
|
2349
|
+
* yet officially supported. It may be subject to breaking changes or removal
|
|
2350
|
+
* in future versions.
|
|
2351
|
+
*
|
|
2250
2352
|
* Create or update a Document. Before using this route, you should create a
|
|
2251
2353
|
* new collection resource using either a [server
|
|
2252
2354
|
* integration](https://appwrite.io/docs/server/databases#databasesCreateCollection)
|
|
@@ -2259,7 +2361,7 @@ class Databases extends Service {
|
|
|
2259
2361
|
* @param {string[]} permissions
|
|
2260
2362
|
* @throws {AppwriteException}
|
|
2261
2363
|
* @returns {Promise}
|
|
2262
|
-
|
|
2364
|
+
*/
|
|
2263
2365
|
upsertDocument(databaseId, collectionId, documentId, data, permissions) {
|
|
2264
2366
|
if (typeof databaseId === 'undefined') {
|
|
2265
2367
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -2297,7 +2399,7 @@ class Databases extends Service {
|
|
|
2297
2399
|
* @param {string[]} permissions
|
|
2298
2400
|
* @throws {AppwriteException}
|
|
2299
2401
|
* @returns {Promise}
|
|
2300
|
-
|
|
2402
|
+
*/
|
|
2301
2403
|
updateDocument(databaseId, collectionId, documentId, data, permissions) {
|
|
2302
2404
|
if (typeof databaseId === 'undefined') {
|
|
2303
2405
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -2329,7 +2431,7 @@ class Databases extends Service {
|
|
|
2329
2431
|
* @param {string} documentId
|
|
2330
2432
|
* @throws {AppwriteException}
|
|
2331
2433
|
* @returns {Promise}
|
|
2332
|
-
|
|
2434
|
+
*/
|
|
2333
2435
|
deleteDocument(databaseId, collectionId, documentId) {
|
|
2334
2436
|
if (typeof databaseId === 'undefined') {
|
|
2335
2437
|
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -2347,6 +2449,82 @@ class Databases extends Service {
|
|
|
2347
2449
|
'content-type': 'application/json',
|
|
2348
2450
|
}, payload);
|
|
2349
2451
|
}
|
|
2452
|
+
/**
|
|
2453
|
+
* Decrement a specific attribute of a document by a given value.
|
|
2454
|
+
*
|
|
2455
|
+
* @param {string} databaseId
|
|
2456
|
+
* @param {string} collectionId
|
|
2457
|
+
* @param {string} documentId
|
|
2458
|
+
* @param {string} attribute
|
|
2459
|
+
* @param {number} value
|
|
2460
|
+
* @param {number} min
|
|
2461
|
+
* @throws {AppwriteException}
|
|
2462
|
+
* @returns {Promise}
|
|
2463
|
+
*/
|
|
2464
|
+
decrementDocumentAttribute(databaseId, collectionId, documentId, attribute, value, min) {
|
|
2465
|
+
if (typeof databaseId === 'undefined') {
|
|
2466
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2467
|
+
}
|
|
2468
|
+
if (typeof collectionId === 'undefined') {
|
|
2469
|
+
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
2470
|
+
}
|
|
2471
|
+
if (typeof documentId === 'undefined') {
|
|
2472
|
+
throw new AppwriteException('Missing required parameter: "documentId"');
|
|
2473
|
+
}
|
|
2474
|
+
if (typeof attribute === 'undefined') {
|
|
2475
|
+
throw new AppwriteException('Missing required parameter: "attribute"');
|
|
2476
|
+
}
|
|
2477
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
|
|
2478
|
+
const payload = {};
|
|
2479
|
+
if (typeof value !== 'undefined') {
|
|
2480
|
+
payload['value'] = value;
|
|
2481
|
+
}
|
|
2482
|
+
if (typeof min !== 'undefined') {
|
|
2483
|
+
payload['min'] = min;
|
|
2484
|
+
}
|
|
2485
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2486
|
+
return this.client.call('patch', uri, {
|
|
2487
|
+
'content-type': 'application/json',
|
|
2488
|
+
}, payload);
|
|
2489
|
+
}
|
|
2490
|
+
/**
|
|
2491
|
+
* Increment a specific attribute of a document by a given value.
|
|
2492
|
+
*
|
|
2493
|
+
* @param {string} databaseId
|
|
2494
|
+
* @param {string} collectionId
|
|
2495
|
+
* @param {string} documentId
|
|
2496
|
+
* @param {string} attribute
|
|
2497
|
+
* @param {number} value
|
|
2498
|
+
* @param {number} max
|
|
2499
|
+
* @throws {AppwriteException}
|
|
2500
|
+
* @returns {Promise}
|
|
2501
|
+
*/
|
|
2502
|
+
incrementDocumentAttribute(databaseId, collectionId, documentId, attribute, value, max) {
|
|
2503
|
+
if (typeof databaseId === 'undefined') {
|
|
2504
|
+
throw new AppwriteException('Missing required parameter: "databaseId"');
|
|
2505
|
+
}
|
|
2506
|
+
if (typeof collectionId === 'undefined') {
|
|
2507
|
+
throw new AppwriteException('Missing required parameter: "collectionId"');
|
|
2508
|
+
}
|
|
2509
|
+
if (typeof documentId === 'undefined') {
|
|
2510
|
+
throw new AppwriteException('Missing required parameter: "documentId"');
|
|
2511
|
+
}
|
|
2512
|
+
if (typeof attribute === 'undefined') {
|
|
2513
|
+
throw new AppwriteException('Missing required parameter: "attribute"');
|
|
2514
|
+
}
|
|
2515
|
+
const apiPath = '/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment'.replace('{databaseId}', databaseId).replace('{collectionId}', collectionId).replace('{documentId}', documentId).replace('{attribute}', attribute);
|
|
2516
|
+
const payload = {};
|
|
2517
|
+
if (typeof value !== 'undefined') {
|
|
2518
|
+
payload['value'] = value;
|
|
2519
|
+
}
|
|
2520
|
+
if (typeof max !== 'undefined') {
|
|
2521
|
+
payload['max'] = max;
|
|
2522
|
+
}
|
|
2523
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
2524
|
+
return this.client.call('patch', uri, {
|
|
2525
|
+
'content-type': 'application/json',
|
|
2526
|
+
}, payload);
|
|
2527
|
+
}
|
|
2350
2528
|
}
|
|
2351
2529
|
|
|
2352
2530
|
class Functions extends Service {
|
|
@@ -2361,7 +2539,7 @@ class Functions extends Service {
|
|
|
2361
2539
|
* @param {string[]} queries
|
|
2362
2540
|
* @throws {AppwriteException}
|
|
2363
2541
|
* @returns {Promise}
|
|
2364
|
-
|
|
2542
|
+
*/
|
|
2365
2543
|
listExecutions(functionId, queries) {
|
|
2366
2544
|
if (typeof functionId === 'undefined') {
|
|
2367
2545
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
@@ -2389,7 +2567,7 @@ class Functions extends Service {
|
|
|
2389
2567
|
* @param {string} scheduledAt
|
|
2390
2568
|
* @throws {AppwriteException}
|
|
2391
2569
|
* @returns {Promise}
|
|
2392
|
-
|
|
2570
|
+
*/
|
|
2393
2571
|
createExecution(functionId, body, async, xpath, method, headers, scheduledAt) {
|
|
2394
2572
|
if (typeof functionId === 'undefined') {
|
|
2395
2573
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
@@ -2426,7 +2604,7 @@ class Functions extends Service {
|
|
|
2426
2604
|
* @param {string} executionId
|
|
2427
2605
|
* @throws {AppwriteException}
|
|
2428
2606
|
* @returns {Promise}
|
|
2429
|
-
|
|
2607
|
+
*/
|
|
2430
2608
|
getExecution(functionId, executionId) {
|
|
2431
2609
|
if (typeof functionId === 'undefined') {
|
|
2432
2610
|
throw new AppwriteException('Missing required parameter: "functionId"');
|
|
@@ -2451,7 +2629,7 @@ class Graphql extends Service {
|
|
|
2451
2629
|
* @param {object} query
|
|
2452
2630
|
* @throws {AppwriteException}
|
|
2453
2631
|
* @returns {Promise}
|
|
2454
|
-
|
|
2632
|
+
*/
|
|
2455
2633
|
query(query) {
|
|
2456
2634
|
if (typeof query === 'undefined') {
|
|
2457
2635
|
throw new AppwriteException('Missing required parameter: "query"');
|
|
@@ -2473,7 +2651,7 @@ class Graphql extends Service {
|
|
|
2473
2651
|
* @param {object} query
|
|
2474
2652
|
* @throws {AppwriteException}
|
|
2475
2653
|
* @returns {Promise}
|
|
2476
|
-
|
|
2654
|
+
*/
|
|
2477
2655
|
mutation(query) {
|
|
2478
2656
|
if (typeof query === 'undefined') {
|
|
2479
2657
|
throw new AppwriteException('Missing required parameter: "query"');
|
|
@@ -2505,7 +2683,7 @@ class Locale extends Service {
|
|
|
2505
2683
|
*
|
|
2506
2684
|
* @throws {AppwriteException}
|
|
2507
2685
|
* @returns {Promise}
|
|
2508
|
-
|
|
2686
|
+
*/
|
|
2509
2687
|
get() {
|
|
2510
2688
|
const apiPath = '/locale';
|
|
2511
2689
|
const payload = {};
|
|
@@ -2518,7 +2696,7 @@ class Locale extends Service {
|
|
|
2518
2696
|
*
|
|
2519
2697
|
* @throws {AppwriteException}
|
|
2520
2698
|
* @returns {Promise}
|
|
2521
|
-
|
|
2699
|
+
*/
|
|
2522
2700
|
listCodes() {
|
|
2523
2701
|
const apiPath = '/locale/codes';
|
|
2524
2702
|
const payload = {};
|
|
@@ -2531,7 +2709,7 @@ class Locale extends Service {
|
|
|
2531
2709
|
*
|
|
2532
2710
|
* @throws {AppwriteException}
|
|
2533
2711
|
* @returns {Promise}
|
|
2534
|
-
|
|
2712
|
+
*/
|
|
2535
2713
|
listContinents() {
|
|
2536
2714
|
const apiPath = '/locale/continents';
|
|
2537
2715
|
const payload = {};
|
|
@@ -2544,7 +2722,7 @@ class Locale extends Service {
|
|
|
2544
2722
|
*
|
|
2545
2723
|
* @throws {AppwriteException}
|
|
2546
2724
|
* @returns {Promise}
|
|
2547
|
-
|
|
2725
|
+
*/
|
|
2548
2726
|
listCountries() {
|
|
2549
2727
|
const apiPath = '/locale/countries';
|
|
2550
2728
|
const payload = {};
|
|
@@ -2557,7 +2735,7 @@ class Locale extends Service {
|
|
|
2557
2735
|
*
|
|
2558
2736
|
* @throws {AppwriteException}
|
|
2559
2737
|
* @returns {Promise}
|
|
2560
|
-
|
|
2738
|
+
*/
|
|
2561
2739
|
listCountriesEU() {
|
|
2562
2740
|
const apiPath = '/locale/countries/eu';
|
|
2563
2741
|
const payload = {};
|
|
@@ -2570,7 +2748,7 @@ class Locale extends Service {
|
|
|
2570
2748
|
*
|
|
2571
2749
|
* @throws {AppwriteException}
|
|
2572
2750
|
* @returns {Promise}
|
|
2573
|
-
|
|
2751
|
+
*/
|
|
2574
2752
|
listCountriesPhones() {
|
|
2575
2753
|
const apiPath = '/locale/countries/phones';
|
|
2576
2754
|
const payload = {};
|
|
@@ -2584,7 +2762,7 @@ class Locale extends Service {
|
|
|
2584
2762
|
*
|
|
2585
2763
|
* @throws {AppwriteException}
|
|
2586
2764
|
* @returns {Promise}
|
|
2587
|
-
|
|
2765
|
+
*/
|
|
2588
2766
|
listCurrencies() {
|
|
2589
2767
|
const apiPath = '/locale/currencies';
|
|
2590
2768
|
const payload = {};
|
|
@@ -2597,7 +2775,7 @@ class Locale extends Service {
|
|
|
2597
2775
|
*
|
|
2598
2776
|
* @throws {AppwriteException}
|
|
2599
2777
|
* @returns {Promise}
|
|
2600
|
-
|
|
2778
|
+
*/
|
|
2601
2779
|
listLanguages() {
|
|
2602
2780
|
const apiPath = '/locale/languages';
|
|
2603
2781
|
const payload = {};
|
|
@@ -2618,7 +2796,7 @@ class Messaging extends Service {
|
|
|
2618
2796
|
* @param {string} targetId
|
|
2619
2797
|
* @throws {AppwriteException}
|
|
2620
2798
|
* @returns {Promise}
|
|
2621
|
-
|
|
2799
|
+
*/
|
|
2622
2800
|
createSubscriber(topicId, subscriberId, targetId) {
|
|
2623
2801
|
if (typeof topicId === 'undefined') {
|
|
2624
2802
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
@@ -2649,7 +2827,7 @@ class Messaging extends Service {
|
|
|
2649
2827
|
* @param {string} subscriberId
|
|
2650
2828
|
* @throws {AppwriteException}
|
|
2651
2829
|
* @returns {Promise}
|
|
2652
|
-
|
|
2830
|
+
*/
|
|
2653
2831
|
deleteSubscriber(topicId, subscriberId) {
|
|
2654
2832
|
if (typeof topicId === 'undefined') {
|
|
2655
2833
|
throw new AppwriteException('Missing required parameter: "topicId"');
|
|
@@ -2679,7 +2857,7 @@ class Storage extends Service {
|
|
|
2679
2857
|
* @param {string} search
|
|
2680
2858
|
* @throws {AppwriteException}
|
|
2681
2859
|
* @returns {Promise}
|
|
2682
|
-
|
|
2860
|
+
*/
|
|
2683
2861
|
listFiles(bucketId, queries, search) {
|
|
2684
2862
|
if (typeof bucketId === 'undefined') {
|
|
2685
2863
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -2721,7 +2899,7 @@ class Storage extends Service {
|
|
|
2721
2899
|
* @param {string[]} permissions
|
|
2722
2900
|
* @throws {AppwriteException}
|
|
2723
2901
|
* @returns {Promise}
|
|
2724
|
-
|
|
2902
|
+
*/
|
|
2725
2903
|
createFile(bucketId_1, fileId_1, file_1, permissions_1) {
|
|
2726
2904
|
return __awaiter(this, arguments, void 0, function* (bucketId, fileId, file, permissions, onProgress = (progress) => { }) {
|
|
2727
2905
|
if (typeof bucketId === 'undefined') {
|
|
@@ -2803,7 +2981,7 @@ class Storage extends Service {
|
|
|
2803
2981
|
* @param {string} fileId
|
|
2804
2982
|
* @throws {AppwriteException}
|
|
2805
2983
|
* @returns {Promise}
|
|
2806
|
-
|
|
2984
|
+
*/
|
|
2807
2985
|
getFile(bucketId, fileId) {
|
|
2808
2986
|
if (typeof bucketId === 'undefined') {
|
|
2809
2987
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -2826,7 +3004,7 @@ class Storage extends Service {
|
|
|
2826
3004
|
* @param {string[]} permissions
|
|
2827
3005
|
* @throws {AppwriteException}
|
|
2828
3006
|
* @returns {Promise}
|
|
2829
|
-
|
|
3007
|
+
*/
|
|
2830
3008
|
updateFile(bucketId, fileId, name, permissions) {
|
|
2831
3009
|
if (typeof bucketId === 'undefined') {
|
|
2832
3010
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -2855,7 +3033,7 @@ class Storage extends Service {
|
|
|
2855
3033
|
* @param {string} fileId
|
|
2856
3034
|
* @throws {AppwriteException}
|
|
2857
3035
|
* @returns {Promise}
|
|
2858
|
-
|
|
3036
|
+
*/
|
|
2859
3037
|
deleteFile(bucketId, fileId) {
|
|
2860
3038
|
if (typeof bucketId === 'undefined') {
|
|
2861
3039
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -2880,7 +3058,7 @@ class Storage extends Service {
|
|
|
2880
3058
|
* @param {string} token
|
|
2881
3059
|
* @throws {AppwriteException}
|
|
2882
3060
|
* @returns {ArrayBuffer}
|
|
2883
|
-
|
|
3061
|
+
*/
|
|
2884
3062
|
getFileDownload(bucketId, fileId, token) {
|
|
2885
3063
|
if (typeof bucketId === 'undefined') {
|
|
2886
3064
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -2923,7 +3101,7 @@ class Storage extends Service {
|
|
|
2923
3101
|
* @param {string} token
|
|
2924
3102
|
* @throws {AppwriteException}
|
|
2925
3103
|
* @returns {ArrayBuffer}
|
|
2926
|
-
|
|
3104
|
+
*/
|
|
2927
3105
|
getFilePreview(bucketId, fileId, width, height, gravity, quality, borderWidth, borderColor, borderRadius, opacity, rotation, background, output, token) {
|
|
2928
3106
|
if (typeof bucketId === 'undefined') {
|
|
2929
3107
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -2986,7 +3164,7 @@ class Storage extends Service {
|
|
|
2986
3164
|
* @param {string} token
|
|
2987
3165
|
* @throws {AppwriteException}
|
|
2988
3166
|
* @returns {ArrayBuffer}
|
|
2989
|
-
|
|
3167
|
+
*/
|
|
2990
3168
|
getFileView(bucketId, fileId, token) {
|
|
2991
3169
|
if (typeof bucketId === 'undefined') {
|
|
2992
3170
|
throw new AppwriteException('Missing required parameter: "bucketId"');
|
|
@@ -3019,7 +3197,15 @@ class Storage extends Service {
|
|
|
3019
3197
|
*/
|
|
3020
3198
|
getFileDownloadURL(bucketId, fileId, token) {
|
|
3021
3199
|
const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/download'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
|
|
3200
|
+
const payload = {};
|
|
3201
|
+
if (typeof token !== 'undefined') {
|
|
3202
|
+
payload['token'] = token;
|
|
3203
|
+
}
|
|
3022
3204
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3205
|
+
payload['project'] = this.client.config.project;
|
|
3206
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
3207
|
+
uri.searchParams.append(key, value);
|
|
3208
|
+
}
|
|
3023
3209
|
return uri;
|
|
3024
3210
|
}
|
|
3025
3211
|
/**
|
|
@@ -3048,7 +3234,48 @@ class Storage extends Service {
|
|
|
3048
3234
|
*/
|
|
3049
3235
|
getFilePreviewURL(bucketId, fileId, width, height, gravity, quality, borderWidth, borderColor, borderRadius, opacity, rotation, background, output, token) {
|
|
3050
3236
|
const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/preview'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
|
|
3237
|
+
const payload = {};
|
|
3238
|
+
if (typeof width !== 'undefined') {
|
|
3239
|
+
payload['width'] = width;
|
|
3240
|
+
}
|
|
3241
|
+
if (typeof height !== 'undefined') {
|
|
3242
|
+
payload['height'] = height;
|
|
3243
|
+
}
|
|
3244
|
+
if (typeof gravity !== 'undefined') {
|
|
3245
|
+
payload['gravity'] = gravity;
|
|
3246
|
+
}
|
|
3247
|
+
if (typeof quality !== 'undefined') {
|
|
3248
|
+
payload['quality'] = quality;
|
|
3249
|
+
}
|
|
3250
|
+
if (typeof borderWidth !== 'undefined') {
|
|
3251
|
+
payload['borderWidth'] = borderWidth;
|
|
3252
|
+
}
|
|
3253
|
+
if (typeof borderColor !== 'undefined') {
|
|
3254
|
+
payload['borderColor'] = borderColor;
|
|
3255
|
+
}
|
|
3256
|
+
if (typeof borderRadius !== 'undefined') {
|
|
3257
|
+
payload['borderRadius'] = borderRadius;
|
|
3258
|
+
}
|
|
3259
|
+
if (typeof opacity !== 'undefined') {
|
|
3260
|
+
payload['opacity'] = opacity;
|
|
3261
|
+
}
|
|
3262
|
+
if (typeof rotation !== 'undefined') {
|
|
3263
|
+
payload['rotation'] = rotation;
|
|
3264
|
+
}
|
|
3265
|
+
if (typeof background !== 'undefined') {
|
|
3266
|
+
payload['background'] = background;
|
|
3267
|
+
}
|
|
3268
|
+
if (typeof output !== 'undefined') {
|
|
3269
|
+
payload['output'] = output;
|
|
3270
|
+
}
|
|
3271
|
+
if (typeof token !== 'undefined') {
|
|
3272
|
+
payload['token'] = token;
|
|
3273
|
+
}
|
|
3051
3274
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3275
|
+
payload['project'] = this.client.config.project;
|
|
3276
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
3277
|
+
uri.searchParams.append(key, value);
|
|
3278
|
+
}
|
|
3052
3279
|
return uri;
|
|
3053
3280
|
}
|
|
3054
3281
|
/**
|
|
@@ -3064,7 +3291,15 @@ class Storage extends Service {
|
|
|
3064
3291
|
*/
|
|
3065
3292
|
getFileViewURL(bucketId, fileId, token) {
|
|
3066
3293
|
const apiPath = '/storage/buckets/{bucketId}/files/{fileId}/view'.replace('{bucketId}', bucketId).replace('{fileId}', fileId);
|
|
3294
|
+
const payload = {};
|
|
3295
|
+
if (typeof token !== 'undefined') {
|
|
3296
|
+
payload['token'] = token;
|
|
3297
|
+
}
|
|
3067
3298
|
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
3299
|
+
payload['project'] = this.client.config.project;
|
|
3300
|
+
for (const [key, value] of Object.entries(Service.flatten(payload))) {
|
|
3301
|
+
uri.searchParams.append(key, value);
|
|
3302
|
+
}
|
|
3068
3303
|
return uri;
|
|
3069
3304
|
}
|
|
3070
3305
|
}
|
|
@@ -3081,7 +3316,7 @@ class Teams extends Service {
|
|
|
3081
3316
|
* @param {string} search
|
|
3082
3317
|
* @throws {AppwriteException}
|
|
3083
3318
|
* @returns {Promise}
|
|
3084
|
-
|
|
3319
|
+
*/
|
|
3085
3320
|
list(queries, search) {
|
|
3086
3321
|
const apiPath = '/teams';
|
|
3087
3322
|
const payload = {};
|
|
@@ -3104,7 +3339,7 @@ class Teams extends Service {
|
|
|
3104
3339
|
* @param {string[]} roles
|
|
3105
3340
|
* @throws {AppwriteException}
|
|
3106
3341
|
* @returns {Promise}
|
|
3107
|
-
|
|
3342
|
+
*/
|
|
3108
3343
|
create(teamId, name, roles) {
|
|
3109
3344
|
if (typeof teamId === 'undefined') {
|
|
3110
3345
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -3134,7 +3369,7 @@ class Teams extends Service {
|
|
|
3134
3369
|
* @param {string} teamId
|
|
3135
3370
|
* @throws {AppwriteException}
|
|
3136
3371
|
* @returns {Promise}
|
|
3137
|
-
|
|
3372
|
+
*/
|
|
3138
3373
|
get(teamId) {
|
|
3139
3374
|
if (typeof teamId === 'undefined') {
|
|
3140
3375
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -3151,7 +3386,7 @@ class Teams extends Service {
|
|
|
3151
3386
|
* @param {string} name
|
|
3152
3387
|
* @throws {AppwriteException}
|
|
3153
3388
|
* @returns {Promise}
|
|
3154
|
-
|
|
3389
|
+
*/
|
|
3155
3390
|
updateName(teamId, name) {
|
|
3156
3391
|
if (typeof teamId === 'undefined') {
|
|
3157
3392
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -3176,7 +3411,7 @@ class Teams extends Service {
|
|
|
3176
3411
|
* @param {string} teamId
|
|
3177
3412
|
* @throws {AppwriteException}
|
|
3178
3413
|
* @returns {Promise}
|
|
3179
|
-
|
|
3414
|
+
*/
|
|
3180
3415
|
delete(teamId) {
|
|
3181
3416
|
if (typeof teamId === 'undefined') {
|
|
3182
3417
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -3198,7 +3433,7 @@ class Teams extends Service {
|
|
|
3198
3433
|
* @param {string} search
|
|
3199
3434
|
* @throws {AppwriteException}
|
|
3200
3435
|
* @returns {Promise}
|
|
3201
|
-
|
|
3436
|
+
*/
|
|
3202
3437
|
listMemberships(teamId, queries, search) {
|
|
3203
3438
|
if (typeof teamId === 'undefined') {
|
|
3204
3439
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -3246,7 +3481,7 @@ class Teams extends Service {
|
|
|
3246
3481
|
* @param {string} name
|
|
3247
3482
|
* @throws {AppwriteException}
|
|
3248
3483
|
* @returns {Promise}
|
|
3249
|
-
|
|
3484
|
+
*/
|
|
3250
3485
|
createMembership(teamId, roles, email, userId, phone, url, name) {
|
|
3251
3486
|
if (typeof teamId === 'undefined') {
|
|
3252
3487
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -3288,7 +3523,7 @@ class Teams extends Service {
|
|
|
3288
3523
|
* @param {string} membershipId
|
|
3289
3524
|
* @throws {AppwriteException}
|
|
3290
3525
|
* @returns {Promise}
|
|
3291
|
-
|
|
3526
|
+
*/
|
|
3292
3527
|
getMembership(teamId, membershipId) {
|
|
3293
3528
|
if (typeof teamId === 'undefined') {
|
|
3294
3529
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -3312,7 +3547,7 @@ class Teams extends Service {
|
|
|
3312
3547
|
* @param {string[]} roles
|
|
3313
3548
|
* @throws {AppwriteException}
|
|
3314
3549
|
* @returns {Promise}
|
|
3315
|
-
|
|
3550
|
+
*/
|
|
3316
3551
|
updateMembership(teamId, membershipId, roles) {
|
|
3317
3552
|
if (typeof teamId === 'undefined') {
|
|
3318
3553
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -3342,7 +3577,7 @@ class Teams extends Service {
|
|
|
3342
3577
|
* @param {string} membershipId
|
|
3343
3578
|
* @throws {AppwriteException}
|
|
3344
3579
|
* @returns {Promise}
|
|
3345
|
-
|
|
3580
|
+
*/
|
|
3346
3581
|
deleteMembership(teamId, membershipId) {
|
|
3347
3582
|
if (typeof teamId === 'undefined') {
|
|
3348
3583
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -3372,7 +3607,7 @@ class Teams extends Service {
|
|
|
3372
3607
|
* @param {string} secret
|
|
3373
3608
|
* @throws {AppwriteException}
|
|
3374
3609
|
* @returns {Promise}
|
|
3375
|
-
|
|
3610
|
+
*/
|
|
3376
3611
|
updateMembershipStatus(teamId, membershipId, userId, secret) {
|
|
3377
3612
|
if (typeof teamId === 'undefined') {
|
|
3378
3613
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -3407,7 +3642,7 @@ class Teams extends Service {
|
|
|
3407
3642
|
* @param {string} teamId
|
|
3408
3643
|
* @throws {AppwriteException}
|
|
3409
3644
|
* @returns {Promise}
|
|
3410
|
-
|
|
3645
|
+
*/
|
|
3411
3646
|
getPrefs(teamId) {
|
|
3412
3647
|
if (typeof teamId === 'undefined') {
|
|
3413
3648
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -3426,7 +3661,7 @@ class Teams extends Service {
|
|
|
3426
3661
|
* @param {object} prefs
|
|
3427
3662
|
* @throws {AppwriteException}
|
|
3428
3663
|
* @returns {Promise}
|
|
3429
|
-
|
|
3664
|
+
*/
|
|
3430
3665
|
updatePrefs(teamId, prefs) {
|
|
3431
3666
|
if (typeof teamId === 'undefined') {
|
|
3432
3667
|
throw new AppwriteException('Missing required parameter: "teamId"');
|
|
@@ -3953,6 +4188,7 @@ exports.ImageFormat = void 0;
|
|
|
3953
4188
|
ImageFormat["Webp"] = "webp";
|
|
3954
4189
|
ImageFormat["Heic"] = "heic";
|
|
3955
4190
|
ImageFormat["Avif"] = "avif";
|
|
4191
|
+
ImageFormat["Gif"] = "gif";
|
|
3956
4192
|
})(exports.ImageFormat || (exports.ImageFormat = {}));
|
|
3957
4193
|
|
|
3958
4194
|
exports.Account = Account;
|