node-appwrite 17.1.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/dist/client.js +2 -2
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +2 -2
- package/dist/client.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 +67 -40
- package/dist/services/databases.d.ts +67 -40
- package/dist/services/databases.js +384 -295
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +384 -295
- 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.js.map +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,16 +1578,16 @@ class Databases {
|
|
|
1578
1578
|
);
|
|
1579
1579
|
}
|
|
1580
1580
|
/**
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
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
|
+
*
|
|
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.
|
|
1584
|
+
*
|
|
1585
|
+
* @param {string} databaseId
|
|
1586
|
+
* @param {string} collectionId
|
|
1587
|
+
* @param {object[]} documents
|
|
1588
|
+
* @throws {AppwriteException}
|
|
1589
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1590
|
+
*/
|
|
1591
1591
|
createDocuments(databaseId, collectionId, documents) {
|
|
1592
1592
|
if (typeof databaseId === "undefined") {
|
|
1593
1593
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1615,16 +1615,17 @@ class Databases {
|
|
|
1615
1615
|
);
|
|
1616
1616
|
}
|
|
1617
1617
|
/**
|
|
1618
|
-
|
|
1619
|
-
|
|
1620
|
-
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
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
|
+
*/
|
|
1628
1629
|
upsertDocuments(databaseId, collectionId, documents) {
|
|
1629
1630
|
if (typeof databaseId === "undefined") {
|
|
1630
1631
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1652,17 +1653,17 @@ class Databases {
|
|
|
1652
1653
|
);
|
|
1653
1654
|
}
|
|
1654
1655
|
/**
|
|
1655
|
-
|
|
1656
|
-
|
|
1657
|
-
|
|
1658
|
-
|
|
1659
|
-
|
|
1660
|
-
|
|
1661
|
-
|
|
1662
|
-
|
|
1663
|
-
|
|
1664
|
-
|
|
1665
|
-
|
|
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
|
+
*
|
|
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.
|
|
1659
|
+
*
|
|
1660
|
+
* @param {string} databaseId
|
|
1661
|
+
* @param {string} collectionId
|
|
1662
|
+
* @param {object} data
|
|
1663
|
+
* @param {string[]} queries
|
|
1664
|
+
* @throws {AppwriteException}
|
|
1665
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1666
|
+
*/
|
|
1666
1667
|
updateDocuments(databaseId, collectionId, data, queries) {
|
|
1667
1668
|
if (typeof databaseId === "undefined") {
|
|
1668
1669
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1690,16 +1691,16 @@ class Databases {
|
|
|
1690
1691
|
);
|
|
1691
1692
|
}
|
|
1692
1693
|
/**
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
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
|
+
*
|
|
1696
|
+
* Bulk delete documents using queries, if no queries are passed then all documents are deleted.
|
|
1697
|
+
*
|
|
1698
|
+
* @param {string} databaseId
|
|
1699
|
+
* @param {string} collectionId
|
|
1700
|
+
* @param {string[]} queries
|
|
1701
|
+
* @throws {AppwriteException}
|
|
1702
|
+
* @returns {Promise<Models.DocumentList<Document>>}
|
|
1703
|
+
*/
|
|
1703
1704
|
deleteDocuments(databaseId, collectionId, queries) {
|
|
1704
1705
|
if (typeof databaseId === "undefined") {
|
|
1705
1706
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1758,18 +1759,18 @@ class Databases {
|
|
|
1758
1759
|
);
|
|
1759
1760
|
}
|
|
1760
1761
|
/**
|
|
1761
|
-
|
|
1762
|
-
|
|
1763
|
-
|
|
1764
|
-
|
|
1765
|
-
|
|
1766
|
-
|
|
1767
|
-
|
|
1768
|
-
|
|
1769
|
-
|
|
1770
|
-
|
|
1771
|
-
|
|
1772
|
-
|
|
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
|
+
*/
|
|
1773
1774
|
upsertDocument(databaseId, collectionId, documentId, data, permissions) {
|
|
1774
1775
|
if (typeof databaseId === "undefined") {
|
|
1775
1776
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|
|
@@ -1808,7 +1809,7 @@ class Databases {
|
|
|
1808
1809
|
* @param {string} databaseId
|
|
1809
1810
|
* @param {string} collectionId
|
|
1810
1811
|
* @param {string} documentId
|
|
1811
|
-
* @param {Partial<Omit<Document, keyof Models.Document>>} data
|
|
1812
|
+
* @param {Partial<Document extends Models.DefaultDocument ? Models.DataWithoutDocumentKeys : Omit<Document, keyof Models.Document>>} data
|
|
1812
1813
|
* @param {string[]} permissions
|
|
1813
1814
|
* @throws {AppwriteException}
|
|
1814
1815
|
* @returns {Promise<Document>}
|
|
@@ -1874,6 +1875,94 @@ class Databases {
|
|
|
1874
1875
|
payload
|
|
1875
1876
|
);
|
|
1876
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
|
+
}
|
|
1877
1966
|
/**
|
|
1878
1967
|
* List indexes in the collection.
|
|
1879
1968
|
*
|
|
@@ -1905,19 +1994,19 @@ class Databases {
|
|
|
1905
1994
|
);
|
|
1906
1995
|
}
|
|
1907
1996
|
/**
|
|
1908
|
-
|
|
1909
|
-
|
|
1910
|
-
|
|
1911
|
-
|
|
1912
|
-
|
|
1913
|
-
|
|
1914
|
-
|
|
1915
|
-
|
|
1916
|
-
|
|
1917
|
-
|
|
1918
|
-
|
|
1919
|
-
|
|
1920
|
-
|
|
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
|
+
*/
|
|
1921
2010
|
createIndex(databaseId, collectionId, key, type, attributes, orders, lengths) {
|
|
1922
2011
|
if (typeof databaseId === "undefined") {
|
|
1923
2012
|
throw new client.AppwriteException('Missing required parameter: "databaseId"');
|