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