node-appwrite 17.0.0 → 17.2.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 +1 -1
- package/dist/client.js +6 -5
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +6 -5
- package/dist/client.mjs.map +1 -1
- package/dist/enums/build-runtime.d.mts +3 -1
- package/dist/enums/build-runtime.d.ts +3 -1
- package/dist/enums/build-runtime.js +2 -0
- package/dist/enums/build-runtime.js.map +1 -1
- package/dist/enums/build-runtime.mjs +2 -0
- package/dist/enums/build-runtime.mjs.map +1 -1
- package/dist/enums/image-format.d.mts +2 -1
- package/dist/enums/image-format.d.ts +2 -1
- package/dist/enums/image-format.js +1 -0
- package/dist/enums/image-format.js.map +1 -1
- package/dist/enums/image-format.mjs +1 -0
- package/dist/enums/image-format.mjs.map +1 -1
- package/dist/enums/runtime.d.mts +3 -1
- package/dist/enums/runtime.d.ts +3 -1
- package/dist/enums/runtime.js +2 -0
- package/dist/enums/runtime.js.map +1 -1
- package/dist/enums/runtime.mjs +2 -0
- package/dist/enums/runtime.mjs.map +1 -1
- package/dist/models.d.mts +122 -97
- package/dist/models.d.ts +122 -97
- package/dist/services/account.d.mts +31 -31
- package/dist/services/account.d.ts +31 -31
- package/dist/services/account.js +81 -81
- package/dist/services/account.js.map +1 -1
- package/dist/services/account.mjs +81 -81
- package/dist/services/account.mjs.map +1 -1
- package/dist/services/avatars.d.mts +20 -20
- package/dist/services/avatars.d.ts +20 -20
- package/dist/services/avatars.js +79 -79
- package/dist/services/avatars.js.map +1 -1
- package/dist/services/avatars.mjs +79 -79
- package/dist/services/avatars.mjs.map +1 -1
- package/dist/services/databases.d.mts +78 -30
- package/dist/services/databases.d.ts +78 -30
- package/dist/services/databases.js +395 -251
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +395 -251
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +8 -8
- package/dist/services/functions.d.ts +8 -8
- package/dist/services/functions.js +38 -38
- package/dist/services/functions.js.map +1 -1
- package/dist/services/functions.mjs +38 -38
- package/dist/services/functions.mjs.map +1 -1
- package/dist/services/graphql.js.map +1 -1
- package/dist/services/graphql.mjs.map +1 -1
- package/dist/services/health.d.mts +1 -1
- package/dist/services/health.d.ts +1 -1
- package/dist/services/health.js +8 -8
- package/dist/services/health.js.map +1 -1
- package/dist/services/health.mjs +8 -8
- package/dist/services/health.mjs.map +1 -1
- package/dist/services/locale.d.mts +2 -2
- package/dist/services/locale.d.ts +2 -2
- package/dist/services/locale.js +7 -7
- package/dist/services/locale.js.map +1 -1
- package/dist/services/locale.mjs +7 -7
- package/dist/services/locale.mjs.map +1 -1
- package/dist/services/messaging.d.mts +8 -8
- package/dist/services/messaging.d.ts +8 -8
- package/dist/services/messaging.js +94 -94
- package/dist/services/messaging.js.map +1 -1
- package/dist/services/messaging.mjs +94 -94
- package/dist/services/messaging.mjs.map +1 -1
- package/dist/services/sites.d.mts +4 -4
- package/dist/services/sites.d.ts +4 -4
- package/dist/services/sites.js +24 -24
- package/dist/services/sites.js.map +1 -1
- package/dist/services/sites.mjs +24 -24
- package/dist/services/sites.mjs.map +1 -1
- package/dist/services/storage.d.mts +7 -7
- package/dist/services/storage.d.ts +7 -7
- package/dist/services/storage.js +16 -16
- package/dist/services/storage.js.map +1 -1
- package/dist/services/storage.mjs +16 -16
- package/dist/services/storage.mjs.map +1 -1
- package/dist/services/teams.d.mts +17 -17
- package/dist/services/teams.d.ts +17 -17
- package/dist/services/teams.js +40 -40
- package/dist/services/teams.js.map +1 -1
- package/dist/services/teams.mjs +40 -40
- package/dist/services/teams.mjs.map +1 -1
- package/dist/services/tokens.d.mts +1 -1
- package/dist/services/tokens.d.ts +1 -1
- package/dist/services/tokens.js +1 -1
- package/dist/services/tokens.js.map +1 -1
- package/dist/services/tokens.mjs +1 -1
- package/dist/services/tokens.mjs.map +1 -1
- package/dist/services/users.d.mts +26 -26
- package/dist/services/users.d.ts +26 -26
- package/dist/services/users.js +26 -26
- package/dist/services/users.js.map +1 -1
- package/dist/services/users.mjs +26 -26
- package/dist/services/users.mjs.map +1 -1
- package/package.json +1 -1
|
@@ -33,15 +33,15 @@ class Databases {
|
|
|
33
33
|
);
|
|
34
34
|
}
|
|
35
35
|
/**
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
36
|
+
* Create a new Database.
|
|
37
|
+
*
|
|
38
|
+
*
|
|
39
|
+
* @param {string} databaseId
|
|
40
|
+
* @param {string} name
|
|
41
|
+
* @param {boolean} enabled
|
|
42
|
+
* @throws {AppwriteException}
|
|
43
|
+
* @returns {Promise<Models.Database>}
|
|
44
|
+
*/
|
|
45
45
|
create(databaseId, name, enabled) {
|
|
46
46
|
if (typeof databaseId === "undefined") {
|
|
47
47
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -364,18 +364,18 @@ class Databases {
|
|
|
364
364
|
);
|
|
365
365
|
}
|
|
366
366
|
/**
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
367
|
+
* Create a boolean attribute.
|
|
368
|
+
*
|
|
369
|
+
*
|
|
370
|
+
* @param {string} databaseId
|
|
371
|
+
* @param {string} collectionId
|
|
372
|
+
* @param {string} key
|
|
373
|
+
* @param {boolean} required
|
|
374
|
+
* @param {boolean} xdefault
|
|
375
|
+
* @param {boolean} array
|
|
376
|
+
* @throws {AppwriteException}
|
|
377
|
+
* @returns {Promise<Models.AttributeBoolean>}
|
|
378
|
+
*/
|
|
379
379
|
createBooleanAttribute(databaseId, collectionId, key, required, xdefault, array) {
|
|
380
380
|
if (typeof databaseId === "undefined") {
|
|
381
381
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -565,18 +565,18 @@ class Databases {
|
|
|
565
565
|
);
|
|
566
566
|
}
|
|
567
567
|
/**
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
568
|
+
* Create an email attribute.
|
|
569
|
+
*
|
|
570
|
+
*
|
|
571
|
+
* @param {string} databaseId
|
|
572
|
+
* @param {string} collectionId
|
|
573
|
+
* @param {string} key
|
|
574
|
+
* @param {boolean} required
|
|
575
|
+
* @param {string} xdefault
|
|
576
|
+
* @param {boolean} array
|
|
577
|
+
* @throws {AppwriteException}
|
|
578
|
+
* @returns {Promise<Models.AttributeEmail>}
|
|
579
|
+
*/
|
|
580
580
|
createEmailAttribute(databaseId, collectionId, key, required, xdefault, array) {
|
|
581
581
|
if (typeof databaseId === "undefined") {
|
|
582
582
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -616,18 +616,18 @@ class Databases {
|
|
|
616
616
|
);
|
|
617
617
|
}
|
|
618
618
|
/**
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
619
|
+
* Update an email attribute. Changing the `default` value will not update already existing documents.
|
|
620
|
+
*
|
|
621
|
+
*
|
|
622
|
+
* @param {string} databaseId
|
|
623
|
+
* @param {string} collectionId
|
|
624
|
+
* @param {string} key
|
|
625
|
+
* @param {boolean} required
|
|
626
|
+
* @param {string} xdefault
|
|
627
|
+
* @param {string} newKey
|
|
628
|
+
* @throws {AppwriteException}
|
|
629
|
+
* @returns {Promise<Models.AttributeEmail>}
|
|
630
|
+
*/
|
|
631
631
|
updateEmailAttribute(databaseId, collectionId, key, required, xdefault, newKey) {
|
|
632
632
|
if (typeof databaseId === "undefined") {
|
|
633
633
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -667,19 +667,19 @@ class Databases {
|
|
|
667
667
|
);
|
|
668
668
|
}
|
|
669
669
|
/**
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
|
|
676
|
-
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
|
|
682
|
-
|
|
670
|
+
* Create an enumeration attribute. The `elements` param acts as a white-list of accepted values for this attribute.
|
|
671
|
+
*
|
|
672
|
+
*
|
|
673
|
+
* @param {string} databaseId
|
|
674
|
+
* @param {string} collectionId
|
|
675
|
+
* @param {string} key
|
|
676
|
+
* @param {string[]} elements
|
|
677
|
+
* @param {boolean} required
|
|
678
|
+
* @param {string} xdefault
|
|
679
|
+
* @param {boolean} array
|
|
680
|
+
* @throws {AppwriteException}
|
|
681
|
+
* @returns {Promise<Models.AttributeEnum>}
|
|
682
|
+
*/
|
|
683
683
|
createEnumAttribute(databaseId, collectionId, key, elements, required, xdefault, array) {
|
|
684
684
|
if (typeof databaseId === "undefined") {
|
|
685
685
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -725,19 +725,19 @@ class Databases {
|
|
|
725
725
|
);
|
|
726
726
|
}
|
|
727
727
|
/**
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
728
|
+
* Update an enum attribute. Changing the `default` value will not update already existing documents.
|
|
729
|
+
*
|
|
730
|
+
*
|
|
731
|
+
* @param {string} databaseId
|
|
732
|
+
* @param {string} collectionId
|
|
733
|
+
* @param {string} key
|
|
734
|
+
* @param {string[]} elements
|
|
735
|
+
* @param {boolean} required
|
|
736
|
+
* @param {string} xdefault
|
|
737
|
+
* @param {string} newKey
|
|
738
|
+
* @throws {AppwriteException}
|
|
739
|
+
* @returns {Promise<Models.AttributeEnum>}
|
|
740
|
+
*/
|
|
741
741
|
updateEnumAttribute(databaseId, collectionId, key, elements, required, xdefault, newKey) {
|
|
742
742
|
if (typeof databaseId === "undefined") {
|
|
743
743
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -783,20 +783,20 @@ class Databases {
|
|
|
783
783
|
);
|
|
784
784
|
}
|
|
785
785
|
/**
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
786
|
+
* Create a float attribute. Optionally, minimum and maximum values can be provided.
|
|
787
|
+
*
|
|
788
|
+
*
|
|
789
|
+
* @param {string} databaseId
|
|
790
|
+
* @param {string} collectionId
|
|
791
|
+
* @param {string} key
|
|
792
|
+
* @param {boolean} required
|
|
793
|
+
* @param {number} min
|
|
794
|
+
* @param {number} max
|
|
795
|
+
* @param {number} xdefault
|
|
796
|
+
* @param {boolean} array
|
|
797
|
+
* @throws {AppwriteException}
|
|
798
|
+
* @returns {Promise<Models.AttributeFloat>}
|
|
799
|
+
*/
|
|
800
800
|
createFloatAttribute(databaseId, collectionId, key, required, min, max, xdefault, array) {
|
|
801
801
|
if (typeof databaseId === "undefined") {
|
|
802
802
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -842,20 +842,20 @@ class Databases {
|
|
|
842
842
|
);
|
|
843
843
|
}
|
|
844
844
|
/**
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
845
|
+
* Update a float attribute. Changing the `default` value will not update already existing documents.
|
|
846
|
+
*
|
|
847
|
+
*
|
|
848
|
+
* @param {string} databaseId
|
|
849
|
+
* @param {string} collectionId
|
|
850
|
+
* @param {string} key
|
|
851
|
+
* @param {boolean} required
|
|
852
|
+
* @param {number} xdefault
|
|
853
|
+
* @param {number} min
|
|
854
|
+
* @param {number} max
|
|
855
|
+
* @param {string} newKey
|
|
856
|
+
* @throws {AppwriteException}
|
|
857
|
+
* @returns {Promise<Models.AttributeFloat>}
|
|
858
|
+
*/
|
|
859
859
|
updateFloatAttribute(databaseId, collectionId, key, required, xdefault, min, max, newKey) {
|
|
860
860
|
if (typeof databaseId === "undefined") {
|
|
861
861
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -901,20 +901,20 @@ class Databases {
|
|
|
901
901
|
);
|
|
902
902
|
}
|
|
903
903
|
/**
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
904
|
+
* Create an integer attribute. Optionally, minimum and maximum values can be provided.
|
|
905
|
+
*
|
|
906
|
+
*
|
|
907
|
+
* @param {string} databaseId
|
|
908
|
+
* @param {string} collectionId
|
|
909
|
+
* @param {string} key
|
|
910
|
+
* @param {boolean} required
|
|
911
|
+
* @param {number} min
|
|
912
|
+
* @param {number} max
|
|
913
|
+
* @param {number} xdefault
|
|
914
|
+
* @param {boolean} array
|
|
915
|
+
* @throws {AppwriteException}
|
|
916
|
+
* @returns {Promise<Models.AttributeInteger>}
|
|
917
|
+
*/
|
|
918
918
|
createIntegerAttribute(databaseId, collectionId, key, required, min, max, xdefault, array) {
|
|
919
919
|
if (typeof databaseId === "undefined") {
|
|
920
920
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -960,20 +960,20 @@ class Databases {
|
|
|
960
960
|
);
|
|
961
961
|
}
|
|
962
962
|
/**
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
963
|
+
* Update an integer attribute. Changing the `default` value will not update already existing documents.
|
|
964
|
+
*
|
|
965
|
+
*
|
|
966
|
+
* @param {string} databaseId
|
|
967
|
+
* @param {string} collectionId
|
|
968
|
+
* @param {string} key
|
|
969
|
+
* @param {boolean} required
|
|
970
|
+
* @param {number} xdefault
|
|
971
|
+
* @param {number} min
|
|
972
|
+
* @param {number} max
|
|
973
|
+
* @param {string} newKey
|
|
974
|
+
* @throws {AppwriteException}
|
|
975
|
+
* @returns {Promise<Models.AttributeInteger>}
|
|
976
|
+
*/
|
|
977
977
|
updateIntegerAttribute(databaseId, collectionId, key, required, xdefault, min, max, newKey) {
|
|
978
978
|
if (typeof databaseId === "undefined") {
|
|
979
979
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1019,18 +1019,18 @@ class Databases {
|
|
|
1019
1019
|
);
|
|
1020
1020
|
}
|
|
1021
1021
|
/**
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1022
|
+
* Create IP address attribute.
|
|
1023
|
+
*
|
|
1024
|
+
*
|
|
1025
|
+
* @param {string} databaseId
|
|
1026
|
+
* @param {string} collectionId
|
|
1027
|
+
* @param {string} key
|
|
1028
|
+
* @param {boolean} required
|
|
1029
|
+
* @param {string} xdefault
|
|
1030
|
+
* @param {boolean} array
|
|
1031
|
+
* @throws {AppwriteException}
|
|
1032
|
+
* @returns {Promise<Models.AttributeIp>}
|
|
1033
|
+
*/
|
|
1034
1034
|
createIpAttribute(databaseId, collectionId, key, required, xdefault, array) {
|
|
1035
1035
|
if (typeof databaseId === "undefined") {
|
|
1036
1036
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1070,18 +1070,18 @@ class Databases {
|
|
|
1070
1070
|
);
|
|
1071
1071
|
}
|
|
1072
1072
|
/**
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1073
|
+
* Update an ip attribute. Changing the `default` value will not update already existing documents.
|
|
1074
|
+
*
|
|
1075
|
+
*
|
|
1076
|
+
* @param {string} databaseId
|
|
1077
|
+
* @param {string} collectionId
|
|
1078
|
+
* @param {string} key
|
|
1079
|
+
* @param {boolean} required
|
|
1080
|
+
* @param {string} xdefault
|
|
1081
|
+
* @param {string} newKey
|
|
1082
|
+
* @throws {AppwriteException}
|
|
1083
|
+
* @returns {Promise<Models.AttributeIp>}
|
|
1084
|
+
*/
|
|
1085
1085
|
updateIpAttribute(databaseId, collectionId, key, required, xdefault, newKey) {
|
|
1086
1086
|
if (typeof databaseId === "undefined") {
|
|
1087
1087
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1121,20 +1121,20 @@ class Databases {
|
|
|
1121
1121
|
);
|
|
1122
1122
|
}
|
|
1123
1123
|
/**
|
|
1124
|
-
|
|
1125
|
-
|
|
1126
|
-
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1124
|
+
* Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1125
|
+
*
|
|
1126
|
+
*
|
|
1127
|
+
* @param {string} databaseId
|
|
1128
|
+
* @param {string} collectionId
|
|
1129
|
+
* @param {string} relatedCollectionId
|
|
1130
|
+
* @param {RelationshipType} type
|
|
1131
|
+
* @param {boolean} twoWay
|
|
1132
|
+
* @param {string} key
|
|
1133
|
+
* @param {string} twoWayKey
|
|
1134
|
+
* @param {RelationMutate} onDelete
|
|
1135
|
+
* @throws {AppwriteException}
|
|
1136
|
+
* @returns {Promise<Models.AttributeRelationship>}
|
|
1137
|
+
*/
|
|
1138
1138
|
createRelationshipAttribute(databaseId, collectionId, relatedCollectionId, type, twoWay, key, twoWayKey, onDelete) {
|
|
1139
1139
|
if (typeof databaseId === "undefined") {
|
|
1140
1140
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1180,20 +1180,20 @@ class Databases {
|
|
|
1180
1180
|
);
|
|
1181
1181
|
}
|
|
1182
1182
|
/**
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1183
|
+
* Create a string attribute.
|
|
1184
|
+
*
|
|
1185
|
+
*
|
|
1186
|
+
* @param {string} databaseId
|
|
1187
|
+
* @param {string} collectionId
|
|
1188
|
+
* @param {string} key
|
|
1189
|
+
* @param {number} size
|
|
1190
|
+
* @param {boolean} required
|
|
1191
|
+
* @param {string} xdefault
|
|
1192
|
+
* @param {boolean} array
|
|
1193
|
+
* @param {boolean} encrypt
|
|
1194
|
+
* @throws {AppwriteException}
|
|
1195
|
+
* @returns {Promise<Models.AttributeString>}
|
|
1196
|
+
*/
|
|
1197
1197
|
createStringAttribute(databaseId, collectionId, key, size, required, xdefault, array, encrypt) {
|
|
1198
1198
|
if (typeof databaseId === "undefined") {
|
|
1199
1199
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1242,19 +1242,19 @@ class Databases {
|
|
|
1242
1242
|
);
|
|
1243
1243
|
}
|
|
1244
1244
|
/**
|
|
1245
|
-
|
|
1246
|
-
|
|
1247
|
-
|
|
1248
|
-
|
|
1249
|
-
|
|
1250
|
-
|
|
1251
|
-
|
|
1252
|
-
|
|
1253
|
-
|
|
1254
|
-
|
|
1255
|
-
|
|
1256
|
-
|
|
1257
|
-
|
|
1245
|
+
* Update a string attribute. Changing the `default` value will not update already existing documents.
|
|
1246
|
+
*
|
|
1247
|
+
*
|
|
1248
|
+
* @param {string} databaseId
|
|
1249
|
+
* @param {string} collectionId
|
|
1250
|
+
* @param {string} key
|
|
1251
|
+
* @param {boolean} required
|
|
1252
|
+
* @param {string} xdefault
|
|
1253
|
+
* @param {number} size
|
|
1254
|
+
* @param {string} newKey
|
|
1255
|
+
* @throws {AppwriteException}
|
|
1256
|
+
* @returns {Promise<Models.AttributeString>}
|
|
1257
|
+
*/
|
|
1258
1258
|
updateStringAttribute(databaseId, collectionId, key, required, xdefault, size, newKey) {
|
|
1259
1259
|
if (typeof databaseId === "undefined") {
|
|
1260
1260
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1297,18 +1297,18 @@ class Databases {
|
|
|
1297
1297
|
);
|
|
1298
1298
|
}
|
|
1299
1299
|
/**
|
|
1300
|
-
|
|
1301
|
-
|
|
1302
|
-
|
|
1303
|
-
|
|
1304
|
-
|
|
1305
|
-
|
|
1306
|
-
|
|
1307
|
-
|
|
1308
|
-
|
|
1309
|
-
|
|
1310
|
-
|
|
1311
|
-
|
|
1300
|
+
* Create a URL attribute.
|
|
1301
|
+
*
|
|
1302
|
+
*
|
|
1303
|
+
* @param {string} databaseId
|
|
1304
|
+
* @param {string} collectionId
|
|
1305
|
+
* @param {string} key
|
|
1306
|
+
* @param {boolean} required
|
|
1307
|
+
* @param {string} xdefault
|
|
1308
|
+
* @param {boolean} array
|
|
1309
|
+
* @throws {AppwriteException}
|
|
1310
|
+
* @returns {Promise<Models.AttributeUrl>}
|
|
1311
|
+
*/
|
|
1312
1312
|
createUrlAttribute(databaseId, collectionId, key, required, xdefault, array) {
|
|
1313
1313
|
if (typeof databaseId === "undefined") {
|
|
1314
1314
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1348,18 +1348,18 @@ class Databases {
|
|
|
1348
1348
|
);
|
|
1349
1349
|
}
|
|
1350
1350
|
/**
|
|
1351
|
-
|
|
1352
|
-
|
|
1353
|
-
|
|
1354
|
-
|
|
1355
|
-
|
|
1356
|
-
|
|
1357
|
-
|
|
1358
|
-
|
|
1359
|
-
|
|
1360
|
-
|
|
1361
|
-
|
|
1362
|
-
|
|
1351
|
+
* Update an url attribute. Changing the `default` value will not update already existing documents.
|
|
1352
|
+
*
|
|
1353
|
+
*
|
|
1354
|
+
* @param {string} databaseId
|
|
1355
|
+
* @param {string} collectionId
|
|
1356
|
+
* @param {string} key
|
|
1357
|
+
* @param {boolean} required
|
|
1358
|
+
* @param {string} xdefault
|
|
1359
|
+
* @param {string} newKey
|
|
1360
|
+
* @throws {AppwriteException}
|
|
1361
|
+
* @returns {Promise<Models.AttributeUrl>}
|
|
1362
|
+
*/
|
|
1363
1363
|
updateUrlAttribute(databaseId, collectionId, key, required, xdefault, newKey) {
|
|
1364
1364
|
if (typeof databaseId === "undefined") {
|
|
1365
1365
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1461,17 +1461,17 @@ class Databases {
|
|
|
1461
1461
|
);
|
|
1462
1462
|
}
|
|
1463
1463
|
/**
|
|
1464
|
-
|
|
1465
|
-
|
|
1466
|
-
|
|
1467
|
-
|
|
1468
|
-
|
|
1469
|
-
|
|
1470
|
-
|
|
1471
|
-
|
|
1472
|
-
|
|
1473
|
-
|
|
1474
|
-
|
|
1464
|
+
* Update relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
|
|
1465
|
+
*
|
|
1466
|
+
*
|
|
1467
|
+
* @param {string} databaseId
|
|
1468
|
+
* @param {string} collectionId
|
|
1469
|
+
* @param {string} key
|
|
1470
|
+
* @param {RelationMutate} onDelete
|
|
1471
|
+
* @param {string} newKey
|
|
1472
|
+
* @throws {AppwriteException}
|
|
1473
|
+
* @returns {Promise<Models.AttributeRelationship>}
|
|
1474
|
+
*/
|
|
1475
1475
|
updateRelationshipAttribute(databaseId, collectionId, key, onDelete, newKey) {
|
|
1476
1476
|
if (typeof databaseId === "undefined") {
|
|
1477
1477
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1537,7 +1537,7 @@ class Databases {
|
|
|
1537
1537
|
* @param {string} databaseId
|
|
1538
1538
|
* @param {string} collectionId
|
|
1539
1539
|
* @param {string} documentId
|
|
1540
|
-
* @param {Omit<Document, keyof Models.Document>} data
|
|
1540
|
+
* @param {Document extends Models.DefaultDocument ? Models.DataWithoutDocumentKeys : Omit<Document, keyof Models.Document>} data
|
|
1541
1541
|
* @param {string[]} permissions
|
|
1542
1542
|
* @throws {AppwriteException}
|
|
1543
1543
|
* @returns {Promise<Document>}
|
|
@@ -1578,6 +1578,8 @@ class Databases {
|
|
|
1578
1578
|
);
|
|
1579
1579
|
}
|
|
1580
1580
|
/**
|
|
1581
|
+
* **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
|
|
1582
|
+
*
|
|
1581
1583
|
* Create new Documents. 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.
|
|
1582
1584
|
*
|
|
1583
1585
|
* @param {string} databaseId
|
|
@@ -1613,15 +1615,17 @@ class Databases {
|
|
|
1613
1615
|
);
|
|
1614
1616
|
}
|
|
1615
1617
|
/**
|
|
1616
|
-
|
|
1617
|
-
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1618
|
+
* **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
|
|
1619
|
+
*
|
|
1620
|
+
* Create or update Documents. 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.
|
|
1621
|
+
*
|
|
1622
|
+
*
|
|
1623
|
+
* @param {string} databaseId
|
|
1624
|
+
* @param {string} collectionId
|
|
1625
|
+
* @param {object[]} documents
|
|
1626
|
+
* @throws {AppwriteException}
|
|
1627
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1628
|
+
*/
|
|
1625
1629
|
upsertDocuments(databaseId, collectionId, documents) {
|
|
1626
1630
|
if (typeof databaseId === "undefined") {
|
|
1627
1631
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1629,6 +1633,9 @@ class Databases {
|
|
|
1629
1633
|
if (typeof collectionId === "undefined") {
|
|
1630
1634
|
throw new client.AppwriteException('Missing required parameter: "collectionId"');
|
|
1631
1635
|
}
|
|
1636
|
+
if (typeof documents === "undefined") {
|
|
1637
|
+
throw new client.AppwriteException('Missing required parameter: "documents"');
|
|
1638
|
+
}
|
|
1632
1639
|
const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
|
|
1633
1640
|
const payload = {};
|
|
1634
1641
|
if (typeof documents !== "undefined") {
|
|
@@ -1646,6 +1653,8 @@ class Databases {
|
|
|
1646
1653
|
);
|
|
1647
1654
|
}
|
|
1648
1655
|
/**
|
|
1656
|
+
* **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
|
|
1657
|
+
*
|
|
1649
1658
|
* Update all documents that match your queries, if no queries are submitted then all documents are updated. You can pass only specific fields to be updated.
|
|
1650
1659
|
*
|
|
1651
1660
|
* @param {string} databaseId
|
|
@@ -1682,6 +1691,8 @@ class Databases {
|
|
|
1682
1691
|
);
|
|
1683
1692
|
}
|
|
1684
1693
|
/**
|
|
1694
|
+
* **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
|
|
1695
|
+
*
|
|
1685
1696
|
* Bulk delete documents using queries, if no queries are passed then all documents are deleted.
|
|
1686
1697
|
*
|
|
1687
1698
|
* @param {string} databaseId
|
|
@@ -1747,13 +1758,58 @@ class Databases {
|
|
|
1747
1758
|
payload
|
|
1748
1759
|
);
|
|
1749
1760
|
}
|
|
1761
|
+
/**
|
|
1762
|
+
* **WARNING: Experimental Feature** - This endpoint is experimental and not yet officially supported. It may be subject to breaking changes or removal in future versions.
|
|
1763
|
+
*
|
|
1764
|
+
* 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.
|
|
1765
|
+
*
|
|
1766
|
+
* @param {string} databaseId
|
|
1767
|
+
* @param {string} collectionId
|
|
1768
|
+
* @param {string} documentId
|
|
1769
|
+
* @param {object} data
|
|
1770
|
+
* @param {string[]} permissions
|
|
1771
|
+
* @throws {AppwriteException}
|
|
1772
|
+
* @returns {Promise<Document>}
|
|
1773
|
+
*/
|
|
1774
|
+
upsertDocument(databaseId, collectionId, documentId, data, permissions) {
|
|
1775
|
+
if (typeof databaseId === "undefined") {
|
|
1776
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1777
|
+
}
|
|
1778
|
+
if (typeof collectionId === "undefined") {
|
|
1779
|
+
throw new client.AppwriteException('Missing required parameter: "collectionId"');
|
|
1780
|
+
}
|
|
1781
|
+
if (typeof documentId === "undefined") {
|
|
1782
|
+
throw new client.AppwriteException('Missing required parameter: "documentId"');
|
|
1783
|
+
}
|
|
1784
|
+
if (typeof data === "undefined") {
|
|
1785
|
+
throw new client.AppwriteException('Missing required parameter: "data"');
|
|
1786
|
+
}
|
|
1787
|
+
const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId);
|
|
1788
|
+
const payload = {};
|
|
1789
|
+
if (typeof data !== "undefined") {
|
|
1790
|
+
payload["data"] = data;
|
|
1791
|
+
}
|
|
1792
|
+
if (typeof permissions !== "undefined") {
|
|
1793
|
+
payload["permissions"] = permissions;
|
|
1794
|
+
}
|
|
1795
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1796
|
+
const apiHeaders = {
|
|
1797
|
+
"content-type": "application/json"
|
|
1798
|
+
};
|
|
1799
|
+
return this.client.call(
|
|
1800
|
+
"put",
|
|
1801
|
+
uri,
|
|
1802
|
+
apiHeaders,
|
|
1803
|
+
payload
|
|
1804
|
+
);
|
|
1805
|
+
}
|
|
1750
1806
|
/**
|
|
1751
1807
|
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
1752
1808
|
*
|
|
1753
1809
|
* @param {string} databaseId
|
|
1754
1810
|
* @param {string} collectionId
|
|
1755
1811
|
* @param {string} documentId
|
|
1756
|
-
* @param {Partial<Omit<Document, keyof Models.Document>>} data
|
|
1812
|
+
* @param {Partial<Document extends Models.DefaultDocument ? Models.DataWithoutDocumentKeys : Omit<Document, keyof Models.Document>>} data
|
|
1757
1813
|
* @param {string[]} permissions
|
|
1758
1814
|
* @throws {AppwriteException}
|
|
1759
1815
|
* @returns {Promise<Document>}
|
|
@@ -1819,6 +1875,94 @@ class Databases {
|
|
|
1819
1875
|
payload
|
|
1820
1876
|
);
|
|
1821
1877
|
}
|
|
1878
|
+
/**
|
|
1879
|
+
* Decrement a specific attribute of a document by a given value.
|
|
1880
|
+
*
|
|
1881
|
+
* @param {string} databaseId
|
|
1882
|
+
* @param {string} collectionId
|
|
1883
|
+
* @param {string} documentId
|
|
1884
|
+
* @param {string} attribute
|
|
1885
|
+
* @param {number} value
|
|
1886
|
+
* @param {number} min
|
|
1887
|
+
* @throws {AppwriteException}
|
|
1888
|
+
* @returns {Promise<Document>}
|
|
1889
|
+
*/
|
|
1890
|
+
decrementDocumentAttribute(databaseId, collectionId, documentId, attribute, value, min) {
|
|
1891
|
+
if (typeof databaseId === "undefined") {
|
|
1892
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1893
|
+
}
|
|
1894
|
+
if (typeof collectionId === "undefined") {
|
|
1895
|
+
throw new client.AppwriteException('Missing required parameter: "collectionId"');
|
|
1896
|
+
}
|
|
1897
|
+
if (typeof documentId === "undefined") {
|
|
1898
|
+
throw new client.AppwriteException('Missing required parameter: "documentId"');
|
|
1899
|
+
}
|
|
1900
|
+
if (typeof attribute === "undefined") {
|
|
1901
|
+
throw new client.AppwriteException('Missing required parameter: "attribute"');
|
|
1902
|
+
}
|
|
1903
|
+
const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/decrement".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId).replace("{attribute}", attribute);
|
|
1904
|
+
const payload = {};
|
|
1905
|
+
if (typeof value !== "undefined") {
|
|
1906
|
+
payload["value"] = value;
|
|
1907
|
+
}
|
|
1908
|
+
if (typeof min !== "undefined") {
|
|
1909
|
+
payload["min"] = min;
|
|
1910
|
+
}
|
|
1911
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1912
|
+
const apiHeaders = {
|
|
1913
|
+
"content-type": "application/json"
|
|
1914
|
+
};
|
|
1915
|
+
return this.client.call(
|
|
1916
|
+
"patch",
|
|
1917
|
+
uri,
|
|
1918
|
+
apiHeaders,
|
|
1919
|
+
payload
|
|
1920
|
+
);
|
|
1921
|
+
}
|
|
1922
|
+
/**
|
|
1923
|
+
* Increment a specific attribute of a document by a given value.
|
|
1924
|
+
*
|
|
1925
|
+
* @param {string} databaseId
|
|
1926
|
+
* @param {string} collectionId
|
|
1927
|
+
* @param {string} documentId
|
|
1928
|
+
* @param {string} attribute
|
|
1929
|
+
* @param {number} value
|
|
1930
|
+
* @param {number} max
|
|
1931
|
+
* @throws {AppwriteException}
|
|
1932
|
+
* @returns {Promise<Document>}
|
|
1933
|
+
*/
|
|
1934
|
+
incrementDocumentAttribute(databaseId, collectionId, documentId, attribute, value, max) {
|
|
1935
|
+
if (typeof databaseId === "undefined") {
|
|
1936
|
+
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
1937
|
+
}
|
|
1938
|
+
if (typeof collectionId === "undefined") {
|
|
1939
|
+
throw new client.AppwriteException('Missing required parameter: "collectionId"');
|
|
1940
|
+
}
|
|
1941
|
+
if (typeof documentId === "undefined") {
|
|
1942
|
+
throw new client.AppwriteException('Missing required parameter: "documentId"');
|
|
1943
|
+
}
|
|
1944
|
+
if (typeof attribute === "undefined") {
|
|
1945
|
+
throw new client.AppwriteException('Missing required parameter: "attribute"');
|
|
1946
|
+
}
|
|
1947
|
+
const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/{attribute}/increment".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId).replace("{attribute}", attribute);
|
|
1948
|
+
const payload = {};
|
|
1949
|
+
if (typeof value !== "undefined") {
|
|
1950
|
+
payload["value"] = value;
|
|
1951
|
+
}
|
|
1952
|
+
if (typeof max !== "undefined") {
|
|
1953
|
+
payload["max"] = max;
|
|
1954
|
+
}
|
|
1955
|
+
const uri = new URL(this.client.config.endpoint + apiPath);
|
|
1956
|
+
const apiHeaders = {
|
|
1957
|
+
"content-type": "application/json"
|
|
1958
|
+
};
|
|
1959
|
+
return this.client.call(
|
|
1960
|
+
"patch",
|
|
1961
|
+
uri,
|
|
1962
|
+
apiHeaders,
|
|
1963
|
+
payload
|
|
1964
|
+
);
|
|
1965
|
+
}
|
|
1822
1966
|
/**
|
|
1823
1967
|
* List indexes in the collection.
|
|
1824
1968
|
*
|
|
@@ -1850,19 +1994,19 @@ class Databases {
|
|
|
1850
1994
|
);
|
|
1851
1995
|
}
|
|
1852
1996
|
/**
|
|
1853
|
-
|
|
1854
|
-
|
|
1855
|
-
|
|
1856
|
-
|
|
1857
|
-
|
|
1858
|
-
|
|
1859
|
-
|
|
1860
|
-
|
|
1861
|
-
|
|
1862
|
-
|
|
1863
|
-
|
|
1864
|
-
|
|
1865
|
-
|
|
1997
|
+
* Creates an index on the attributes listed. Your index should include all the attributes you will query in a single request.
|
|
1998
|
+
* Attributes can be `key`, `fulltext`, and `unique`.
|
|
1999
|
+
*
|
|
2000
|
+
* @param {string} databaseId
|
|
2001
|
+
* @param {string} collectionId
|
|
2002
|
+
* @param {string} key
|
|
2003
|
+
* @param {IndexType} type
|
|
2004
|
+
* @param {string[]} attributes
|
|
2005
|
+
* @param {string[]} orders
|
|
2006
|
+
* @param {number[]} lengths
|
|
2007
|
+
* @throws {AppwriteException}
|
|
2008
|
+
* @returns {Promise<Models.Index>}
|
|
2009
|
+
*/
|
|
1866
2010
|
createIndex(databaseId, collectionId, key, type, attributes, orders, lengths) {
|
|
1867
2011
|
if (typeof databaseId === "undefined") {
|
|
1868
2012
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|