node-appwrite 21.1.0 → 22.0.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/LICENSE +1 -1
- package/README.md +2 -2
- package/dist/client.js +37 -5
- package/dist/client.js.map +1 -1
- package/dist/client.mjs +1505 -5
- package/dist/client.mjs.map +1 -1
- package/dist/enums/browser-permission.d.mts +24 -0
- package/dist/enums/browser-permission.d.ts +24 -0
- package/dist/enums/browser-permission.js +29 -0
- package/dist/enums/browser-permission.js.map +1 -0
- package/dist/enums/browser-permission.mjs +28 -0
- package/dist/enums/browser-permission.mjs.map +1 -0
- package/dist/enums/deployment-status.d.mts +1 -0
- package/dist/enums/deployment-status.d.ts +1 -0
- package/dist/enums/deployment-status.js +1 -0
- package/dist/enums/deployment-status.js.map +1 -1
- package/dist/enums/deployment-status.mjs +1 -0
- package/dist/enums/deployment-status.mjs.map +1 -1
- package/dist/enums/name.d.mts +1 -0
- package/dist/enums/name.d.ts +1 -0
- package/dist/enums/name.js +1 -0
- package/dist/enums/name.js.map +1 -1
- package/dist/enums/name.mjs +1 -0
- package/dist/enums/name.mjs.map +1 -1
- package/dist/enums/o-auth-provider.d.mts +1 -2
- package/dist/enums/o-auth-provider.d.ts +1 -2
- package/dist/enums/o-auth-provider.js +0 -1
- package/dist/enums/o-auth-provider.js.map +1 -1
- package/dist/enums/o-auth-provider.mjs +0 -1
- package/dist/enums/o-auth-provider.mjs.map +1 -1
- package/dist/enums/order-by.d.mts +6 -0
- package/dist/enums/order-by.d.ts +6 -0
- package/dist/enums/order-by.js +11 -0
- package/dist/enums/order-by.js.map +1 -0
- package/dist/enums/order-by.mjs +10 -0
- package/dist/enums/order-by.mjs.map +1 -0
- package/dist/enums/roles.d.mts +7 -0
- package/dist/enums/roles.d.ts +7 -0
- package/dist/enums/roles.js +12 -0
- package/dist/enums/roles.js.map +1 -0
- package/dist/enums/roles.mjs +11 -0
- package/dist/enums/roles.mjs.map +1 -0
- package/dist/enums/scopes.d.mts +59 -0
- package/dist/enums/scopes.d.ts +59 -0
- package/dist/enums/scopes.js +64 -0
- package/dist/enums/scopes.js.map +1 -0
- package/dist/enums/scopes.mjs +63 -0
- package/dist/enums/scopes.mjs.map +1 -0
- package/dist/index.d.mts +5 -2
- package/dist/index.d.ts +5 -2
- package/dist/index.js +21 -6
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +5 -2
- package/dist/index.mjs.map +1 -1
- package/dist/models.d.mts +367 -6
- package/dist/models.d.ts +367 -6
- package/dist/query.d.mts +38 -8
- package/dist/query.d.ts +38 -8
- package/dist/query.js +48 -7
- package/dist/query.js.map +1 -1
- package/dist/query.mjs +44 -7
- package/dist/query.mjs.map +1 -1
- package/dist/services/account.d.mts +13 -1
- package/dist/services/account.d.ts +13 -1
- package/dist/services/account.js +13 -7
- package/dist/services/account.js.map +1 -1
- package/dist/services/account.mjs +13 -7
- package/dist/services/account.mjs.map +1 -1
- package/dist/services/avatars.d.mts +9 -8
- package/dist/services/avatars.d.ts +9 -8
- package/dist/services/avatars.js.map +1 -1
- package/dist/services/avatars.mjs.map +1 -1
- package/dist/services/databases.d.mts +329 -34
- package/dist/services/databases.d.ts +329 -34
- package/dist/services/databases.js +469 -9
- package/dist/services/databases.js.map +1 -1
- package/dist/services/databases.mjs +469 -9
- package/dist/services/databases.mjs.map +1 -1
- package/dist/services/functions.d.mts +9 -8
- package/dist/services/functions.d.ts +9 -8
- package/dist/services/functions.js.map +1 -1
- 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 +25 -6
- package/dist/services/health.d.ts +25 -6
- package/dist/services/health.js +27 -3
- package/dist/services/health.js.map +1 -1
- package/dist/services/health.mjs +27 -3
- package/dist/services/health.mjs.map +1 -1
- package/dist/services/messaging.js.map +1 -1
- package/dist/services/messaging.mjs.map +1 -1
- package/dist/services/sites.js.map +1 -1
- package/dist/services/sites.mjs.map +1 -1
- package/dist/services/storage.d.mts +12 -12
- package/dist/services/storage.d.ts +12 -12
- package/dist/services/storage.js.map +1 -1
- package/dist/services/storage.mjs.map +1 -1
- package/dist/services/tables-db.d.mts +329 -32
- package/dist/services/tables-db.d.ts +329 -32
- package/dist/services/tables-db.js +469 -6
- package/dist/services/tables-db.js.map +1 -1
- package/dist/services/tables-db.mjs +469 -6
- package/dist/services/tables-db.mjs.map +1 -1
- package/dist/services/teams.d.mts +9 -8
- package/dist/services/teams.d.ts +9 -8
- package/dist/services/teams.js.map +1 -1
- 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.js.map +1 -1
- package/dist/services/users.mjs.map +1 -1
- package/package.json +4 -2
- package/dist/enums/output.d.mts +0 -11
- package/dist/enums/output.d.ts +0 -11
- package/dist/enums/output.js +0 -16
- package/dist/enums/output.js.map +0 -1
- package/dist/enums/output.mjs +0 -15
- package/dist/enums/output.mjs.map +0 -1
|
@@ -3,6 +3,7 @@ import { Models } from '../models.js';
|
|
|
3
3
|
import { RelationshipType } from '../enums/relationship-type.js';
|
|
4
4
|
import { RelationMutate } from '../enums/relation-mutate.js';
|
|
5
5
|
import { IndexType } from '../enums/index-type.js';
|
|
6
|
+
import { OrderBy } from '../enums/order-by.js';
|
|
6
7
|
import '../query.js';
|
|
7
8
|
import '../enums/database-type.js';
|
|
8
9
|
import '../enums/attribute-status.js';
|
|
@@ -227,7 +228,7 @@ declare class Databases {
|
|
|
227
228
|
*/
|
|
228
229
|
update(params: {
|
|
229
230
|
databaseId: string;
|
|
230
|
-
name
|
|
231
|
+
name?: string;
|
|
231
232
|
enabled?: boolean;
|
|
232
233
|
}): Promise<Models.Database>;
|
|
233
234
|
/**
|
|
@@ -240,7 +241,7 @@ declare class Databases {
|
|
|
240
241
|
* @returns {Promise<Models.Database>}
|
|
241
242
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
242
243
|
*/
|
|
243
|
-
update(databaseId: string, name
|
|
244
|
+
update(databaseId: string, name?: string, enabled?: boolean): Promise<Models.Database>;
|
|
244
245
|
/**
|
|
245
246
|
* Delete a database by its unique ID. Only API keys with with databases.write scope can delete a database.
|
|
246
247
|
*
|
|
@@ -370,7 +371,7 @@ declare class Databases {
|
|
|
370
371
|
updateCollection(params: {
|
|
371
372
|
databaseId: string;
|
|
372
373
|
collectionId: string;
|
|
373
|
-
name
|
|
374
|
+
name?: string;
|
|
374
375
|
permissions?: string[];
|
|
375
376
|
documentSecurity?: boolean;
|
|
376
377
|
enabled?: boolean;
|
|
@@ -388,7 +389,7 @@ declare class Databases {
|
|
|
388
389
|
* @returns {Promise<Models.Collection>}
|
|
389
390
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
390
391
|
*/
|
|
391
|
-
updateCollection(databaseId: string, collectionId: string, name
|
|
392
|
+
updateCollection(databaseId: string, collectionId: string, name?: string, permissions?: string[], documentSecurity?: boolean, enabled?: boolean): Promise<Models.Collection>;
|
|
392
393
|
/**
|
|
393
394
|
* Delete a collection by its unique ID. Only users with write permissions have access to delete this resource.
|
|
394
395
|
*
|
|
@@ -831,9 +832,9 @@ declare class Databases {
|
|
|
831
832
|
* @param {string} params.collectionId - Collection ID.
|
|
832
833
|
* @param {string} params.key - Attribute Key.
|
|
833
834
|
* @param {boolean} params.required - Is attribute required?
|
|
834
|
-
* @param {number} params.min - Minimum value
|
|
835
|
-
* @param {number} params.max - Maximum value
|
|
836
|
-
* @param {number} params.xdefault - Default value. Cannot be set when attribute is required.
|
|
835
|
+
* @param {number | bigint} params.min - Minimum value
|
|
836
|
+
* @param {number | bigint} params.max - Maximum value
|
|
837
|
+
* @param {number | bigint} params.xdefault - Default value. Cannot be set when attribute is required.
|
|
837
838
|
* @param {boolean} params.array - Is attribute an array?
|
|
838
839
|
* @throws {AppwriteException}
|
|
839
840
|
* @returns {Promise<Models.AttributeInteger>}
|
|
@@ -844,9 +845,9 @@ declare class Databases {
|
|
|
844
845
|
collectionId: string;
|
|
845
846
|
key: string;
|
|
846
847
|
required: boolean;
|
|
847
|
-
min?: number;
|
|
848
|
-
max?: number;
|
|
849
|
-
xdefault?: number;
|
|
848
|
+
min?: number | bigint;
|
|
849
|
+
max?: number | bigint;
|
|
850
|
+
xdefault?: number | bigint;
|
|
850
851
|
array?: boolean;
|
|
851
852
|
}): Promise<Models.AttributeInteger>;
|
|
852
853
|
/**
|
|
@@ -857,15 +858,15 @@ declare class Databases {
|
|
|
857
858
|
* @param {string} collectionId - Collection ID.
|
|
858
859
|
* @param {string} key - Attribute Key.
|
|
859
860
|
* @param {boolean} required - Is attribute required?
|
|
860
|
-
* @param {number} min - Minimum value
|
|
861
|
-
* @param {number} max - Maximum value
|
|
862
|
-
* @param {number} xdefault - Default value. Cannot be set when attribute is required.
|
|
861
|
+
* @param {number | bigint} min - Minimum value
|
|
862
|
+
* @param {number | bigint} max - Maximum value
|
|
863
|
+
* @param {number | bigint} xdefault - Default value. Cannot be set when attribute is required.
|
|
863
864
|
* @param {boolean} array - Is attribute an array?
|
|
864
865
|
* @throws {AppwriteException}
|
|
865
866
|
* @returns {Promise<Models.AttributeInteger>}
|
|
866
867
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
867
868
|
*/
|
|
868
|
-
createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number, max?: number, xdefault?: number, array?: boolean): Promise<Models.AttributeInteger>;
|
|
869
|
+
createIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, min?: number | bigint, max?: number | bigint, xdefault?: number | bigint, array?: boolean): Promise<Models.AttributeInteger>;
|
|
869
870
|
/**
|
|
870
871
|
* Update an integer attribute. Changing the `default` value will not update already existing documents.
|
|
871
872
|
*
|
|
@@ -874,9 +875,9 @@ declare class Databases {
|
|
|
874
875
|
* @param {string} params.collectionId - Collection ID.
|
|
875
876
|
* @param {string} params.key - Attribute Key.
|
|
876
877
|
* @param {boolean} params.required - Is attribute required?
|
|
877
|
-
* @param {number} params.xdefault - Default value. Cannot be set when attribute is required.
|
|
878
|
-
* @param {number} params.min - Minimum value
|
|
879
|
-
* @param {number} params.max - Maximum value
|
|
878
|
+
* @param {number | bigint} params.xdefault - Default value. Cannot be set when attribute is required.
|
|
879
|
+
* @param {number | bigint} params.min - Minimum value
|
|
880
|
+
* @param {number | bigint} params.max - Maximum value
|
|
880
881
|
* @param {string} params.newKey - New Attribute Key.
|
|
881
882
|
* @throws {AppwriteException}
|
|
882
883
|
* @returns {Promise<Models.AttributeInteger>}
|
|
@@ -887,9 +888,9 @@ declare class Databases {
|
|
|
887
888
|
collectionId: string;
|
|
888
889
|
key: string;
|
|
889
890
|
required: boolean;
|
|
890
|
-
xdefault?: number;
|
|
891
|
-
min?: number;
|
|
892
|
-
max?: number;
|
|
891
|
+
xdefault?: number | bigint;
|
|
892
|
+
min?: number | bigint;
|
|
893
|
+
max?: number | bigint;
|
|
893
894
|
newKey?: string;
|
|
894
895
|
}): Promise<Models.AttributeInteger>;
|
|
895
896
|
/**
|
|
@@ -900,15 +901,15 @@ declare class Databases {
|
|
|
900
901
|
* @param {string} collectionId - Collection ID.
|
|
901
902
|
* @param {string} key - Attribute Key.
|
|
902
903
|
* @param {boolean} required - Is attribute required?
|
|
903
|
-
* @param {number} xdefault - Default value. Cannot be set when attribute is required.
|
|
904
|
-
* @param {number} min - Minimum value
|
|
905
|
-
* @param {number} max - Maximum value
|
|
904
|
+
* @param {number | bigint} xdefault - Default value. Cannot be set when attribute is required.
|
|
905
|
+
* @param {number | bigint} min - Minimum value
|
|
906
|
+
* @param {number | bigint} max - Maximum value
|
|
906
907
|
* @param {string} newKey - New Attribute Key.
|
|
907
908
|
* @throws {AppwriteException}
|
|
908
909
|
* @returns {Promise<Models.AttributeInteger>}
|
|
909
910
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
910
911
|
*/
|
|
911
|
-
updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number, min?: number, max?: number, newKey?: string): Promise<Models.AttributeInteger>;
|
|
912
|
+
updateIntegerAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: number | bigint, min?: number | bigint, max?: number | bigint, newKey?: string): Promise<Models.AttributeInteger>;
|
|
912
913
|
/**
|
|
913
914
|
* Create IP address attribute.
|
|
914
915
|
*
|
|
@@ -1050,6 +1051,150 @@ declare class Databases {
|
|
|
1050
1051
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1051
1052
|
*/
|
|
1052
1053
|
updateLineAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise<Models.AttributeLine>;
|
|
1054
|
+
/**
|
|
1055
|
+
* Create a longtext attribute.
|
|
1056
|
+
*
|
|
1057
|
+
*
|
|
1058
|
+
* @param {string} params.databaseId - Database ID.
|
|
1059
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1060
|
+
* @param {string} params.key - Attribute Key.
|
|
1061
|
+
* @param {boolean} params.required - Is attribute required?
|
|
1062
|
+
* @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1063
|
+
* @param {boolean} params.array - Is attribute an array?
|
|
1064
|
+
* @throws {AppwriteException}
|
|
1065
|
+
* @returns {Promise<Models.AttributeLongtext>}
|
|
1066
|
+
*/
|
|
1067
|
+
createLongtextAttribute(params: {
|
|
1068
|
+
databaseId: string;
|
|
1069
|
+
collectionId: string;
|
|
1070
|
+
key: string;
|
|
1071
|
+
required: boolean;
|
|
1072
|
+
xdefault?: string;
|
|
1073
|
+
array?: boolean;
|
|
1074
|
+
}): Promise<Models.AttributeLongtext>;
|
|
1075
|
+
/**
|
|
1076
|
+
* Create a longtext attribute.
|
|
1077
|
+
*
|
|
1078
|
+
*
|
|
1079
|
+
* @param {string} databaseId - Database ID.
|
|
1080
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1081
|
+
* @param {string} key - Attribute Key.
|
|
1082
|
+
* @param {boolean} required - Is attribute required?
|
|
1083
|
+
* @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1084
|
+
* @param {boolean} array - Is attribute an array?
|
|
1085
|
+
* @throws {AppwriteException}
|
|
1086
|
+
* @returns {Promise<Models.AttributeLongtext>}
|
|
1087
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1088
|
+
*/
|
|
1089
|
+
createLongtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeLongtext>;
|
|
1090
|
+
/**
|
|
1091
|
+
* Update a longtext attribute. Changing the `default` value will not update already existing documents.
|
|
1092
|
+
*
|
|
1093
|
+
*
|
|
1094
|
+
* @param {string} params.databaseId - Database ID.
|
|
1095
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1096
|
+
* @param {string} params.key - Attribute Key.
|
|
1097
|
+
* @param {boolean} params.required - Is attribute required?
|
|
1098
|
+
* @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1099
|
+
* @param {string} params.newKey - New Attribute Key.
|
|
1100
|
+
* @throws {AppwriteException}
|
|
1101
|
+
* @returns {Promise<Models.AttributeLongtext>}
|
|
1102
|
+
*/
|
|
1103
|
+
updateLongtextAttribute(params: {
|
|
1104
|
+
databaseId: string;
|
|
1105
|
+
collectionId: string;
|
|
1106
|
+
key: string;
|
|
1107
|
+
required: boolean;
|
|
1108
|
+
xdefault?: string;
|
|
1109
|
+
newKey?: string;
|
|
1110
|
+
}): Promise<Models.AttributeLongtext>;
|
|
1111
|
+
/**
|
|
1112
|
+
* Update a longtext attribute. Changing the `default` value will not update already existing documents.
|
|
1113
|
+
*
|
|
1114
|
+
*
|
|
1115
|
+
* @param {string} databaseId - Database ID.
|
|
1116
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1117
|
+
* @param {string} key - Attribute Key.
|
|
1118
|
+
* @param {boolean} required - Is attribute required?
|
|
1119
|
+
* @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1120
|
+
* @param {string} newKey - New Attribute Key.
|
|
1121
|
+
* @throws {AppwriteException}
|
|
1122
|
+
* @returns {Promise<Models.AttributeLongtext>}
|
|
1123
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1124
|
+
*/
|
|
1125
|
+
updateLongtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeLongtext>;
|
|
1126
|
+
/**
|
|
1127
|
+
* Create a mediumtext attribute.
|
|
1128
|
+
*
|
|
1129
|
+
*
|
|
1130
|
+
* @param {string} params.databaseId - Database ID.
|
|
1131
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1132
|
+
* @param {string} params.key - Attribute Key.
|
|
1133
|
+
* @param {boolean} params.required - Is attribute required?
|
|
1134
|
+
* @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1135
|
+
* @param {boolean} params.array - Is attribute an array?
|
|
1136
|
+
* @throws {AppwriteException}
|
|
1137
|
+
* @returns {Promise<Models.AttributeMediumtext>}
|
|
1138
|
+
*/
|
|
1139
|
+
createMediumtextAttribute(params: {
|
|
1140
|
+
databaseId: string;
|
|
1141
|
+
collectionId: string;
|
|
1142
|
+
key: string;
|
|
1143
|
+
required: boolean;
|
|
1144
|
+
xdefault?: string;
|
|
1145
|
+
array?: boolean;
|
|
1146
|
+
}): Promise<Models.AttributeMediumtext>;
|
|
1147
|
+
/**
|
|
1148
|
+
* Create a mediumtext attribute.
|
|
1149
|
+
*
|
|
1150
|
+
*
|
|
1151
|
+
* @param {string} databaseId - Database ID.
|
|
1152
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1153
|
+
* @param {string} key - Attribute Key.
|
|
1154
|
+
* @param {boolean} required - Is attribute required?
|
|
1155
|
+
* @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1156
|
+
* @param {boolean} array - Is attribute an array?
|
|
1157
|
+
* @throws {AppwriteException}
|
|
1158
|
+
* @returns {Promise<Models.AttributeMediumtext>}
|
|
1159
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1160
|
+
*/
|
|
1161
|
+
createMediumtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeMediumtext>;
|
|
1162
|
+
/**
|
|
1163
|
+
* Update a mediumtext attribute. Changing the `default` value will not update already existing documents.
|
|
1164
|
+
*
|
|
1165
|
+
*
|
|
1166
|
+
* @param {string} params.databaseId - Database ID.
|
|
1167
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1168
|
+
* @param {string} params.key - Attribute Key.
|
|
1169
|
+
* @param {boolean} params.required - Is attribute required?
|
|
1170
|
+
* @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1171
|
+
* @param {string} params.newKey - New Attribute Key.
|
|
1172
|
+
* @throws {AppwriteException}
|
|
1173
|
+
* @returns {Promise<Models.AttributeMediumtext>}
|
|
1174
|
+
*/
|
|
1175
|
+
updateMediumtextAttribute(params: {
|
|
1176
|
+
databaseId: string;
|
|
1177
|
+
collectionId: string;
|
|
1178
|
+
key: string;
|
|
1179
|
+
required: boolean;
|
|
1180
|
+
xdefault?: string;
|
|
1181
|
+
newKey?: string;
|
|
1182
|
+
}): Promise<Models.AttributeMediumtext>;
|
|
1183
|
+
/**
|
|
1184
|
+
* Update a mediumtext attribute. Changing the `default` value will not update already existing documents.
|
|
1185
|
+
*
|
|
1186
|
+
*
|
|
1187
|
+
* @param {string} databaseId - Database ID.
|
|
1188
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1189
|
+
* @param {string} key - Attribute Key.
|
|
1190
|
+
* @param {boolean} required - Is attribute required?
|
|
1191
|
+
* @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1192
|
+
* @param {string} newKey - New Attribute Key.
|
|
1193
|
+
* @throws {AppwriteException}
|
|
1194
|
+
* @returns {Promise<Models.AttributeMediumtext>}
|
|
1195
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1196
|
+
*/
|
|
1197
|
+
updateMediumtextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeMediumtext>;
|
|
1053
1198
|
/**
|
|
1054
1199
|
* Create a geometric point attribute.
|
|
1055
1200
|
*
|
|
@@ -1310,6 +1455,78 @@ declare class Databases {
|
|
|
1310
1455
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1311
1456
|
*/
|
|
1312
1457
|
updateStringAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeString>;
|
|
1458
|
+
/**
|
|
1459
|
+
* Create a text attribute.
|
|
1460
|
+
*
|
|
1461
|
+
*
|
|
1462
|
+
* @param {string} params.databaseId - Database ID.
|
|
1463
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1464
|
+
* @param {string} params.key - Attribute Key.
|
|
1465
|
+
* @param {boolean} params.required - Is attribute required?
|
|
1466
|
+
* @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1467
|
+
* @param {boolean} params.array - Is attribute an array?
|
|
1468
|
+
* @throws {AppwriteException}
|
|
1469
|
+
* @returns {Promise<Models.AttributeText>}
|
|
1470
|
+
*/
|
|
1471
|
+
createTextAttribute(params: {
|
|
1472
|
+
databaseId: string;
|
|
1473
|
+
collectionId: string;
|
|
1474
|
+
key: string;
|
|
1475
|
+
required: boolean;
|
|
1476
|
+
xdefault?: string;
|
|
1477
|
+
array?: boolean;
|
|
1478
|
+
}): Promise<Models.AttributeText>;
|
|
1479
|
+
/**
|
|
1480
|
+
* Create a text attribute.
|
|
1481
|
+
*
|
|
1482
|
+
*
|
|
1483
|
+
* @param {string} databaseId - Database ID.
|
|
1484
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1485
|
+
* @param {string} key - Attribute Key.
|
|
1486
|
+
* @param {boolean} required - Is attribute required?
|
|
1487
|
+
* @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1488
|
+
* @param {boolean} array - Is attribute an array?
|
|
1489
|
+
* @throws {AppwriteException}
|
|
1490
|
+
* @returns {Promise<Models.AttributeText>}
|
|
1491
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1492
|
+
*/
|
|
1493
|
+
createTextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeText>;
|
|
1494
|
+
/**
|
|
1495
|
+
* Update a text attribute. Changing the `default` value will not update already existing documents.
|
|
1496
|
+
*
|
|
1497
|
+
*
|
|
1498
|
+
* @param {string} params.databaseId - Database ID.
|
|
1499
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1500
|
+
* @param {string} params.key - Attribute Key.
|
|
1501
|
+
* @param {boolean} params.required - Is attribute required?
|
|
1502
|
+
* @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1503
|
+
* @param {string} params.newKey - New Attribute Key.
|
|
1504
|
+
* @throws {AppwriteException}
|
|
1505
|
+
* @returns {Promise<Models.AttributeText>}
|
|
1506
|
+
*/
|
|
1507
|
+
updateTextAttribute(params: {
|
|
1508
|
+
databaseId: string;
|
|
1509
|
+
collectionId: string;
|
|
1510
|
+
key: string;
|
|
1511
|
+
required: boolean;
|
|
1512
|
+
xdefault?: string;
|
|
1513
|
+
newKey?: string;
|
|
1514
|
+
}): Promise<Models.AttributeText>;
|
|
1515
|
+
/**
|
|
1516
|
+
* Update a text attribute. Changing the `default` value will not update already existing documents.
|
|
1517
|
+
*
|
|
1518
|
+
*
|
|
1519
|
+
* @param {string} databaseId - Database ID.
|
|
1520
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1521
|
+
* @param {string} key - Attribute Key.
|
|
1522
|
+
* @param {boolean} required - Is attribute required?
|
|
1523
|
+
* @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1524
|
+
* @param {string} newKey - New Attribute Key.
|
|
1525
|
+
* @throws {AppwriteException}
|
|
1526
|
+
* @returns {Promise<Models.AttributeText>}
|
|
1527
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1528
|
+
*/
|
|
1529
|
+
updateTextAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeText>;
|
|
1313
1530
|
/**
|
|
1314
1531
|
* Create a URL attribute.
|
|
1315
1532
|
*
|
|
@@ -1384,6 +1601,84 @@ declare class Databases {
|
|
|
1384
1601
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1385
1602
|
*/
|
|
1386
1603
|
updateUrlAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeUrl>;
|
|
1604
|
+
/**
|
|
1605
|
+
* Create a varchar attribute.
|
|
1606
|
+
*
|
|
1607
|
+
*
|
|
1608
|
+
* @param {string} params.databaseId - Database ID.
|
|
1609
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1610
|
+
* @param {string} params.key - Attribute Key.
|
|
1611
|
+
* @param {number} params.size - Attribute size for varchar attributes, in number of characters. Maximum size is 16381.
|
|
1612
|
+
* @param {boolean} params.required - Is attribute required?
|
|
1613
|
+
* @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1614
|
+
* @param {boolean} params.array - Is attribute an array?
|
|
1615
|
+
* @throws {AppwriteException}
|
|
1616
|
+
* @returns {Promise<Models.AttributeVarchar>}
|
|
1617
|
+
*/
|
|
1618
|
+
createVarcharAttribute(params: {
|
|
1619
|
+
databaseId: string;
|
|
1620
|
+
collectionId: string;
|
|
1621
|
+
key: string;
|
|
1622
|
+
size: number;
|
|
1623
|
+
required: boolean;
|
|
1624
|
+
xdefault?: string;
|
|
1625
|
+
array?: boolean;
|
|
1626
|
+
}): Promise<Models.AttributeVarchar>;
|
|
1627
|
+
/**
|
|
1628
|
+
* Create a varchar attribute.
|
|
1629
|
+
*
|
|
1630
|
+
*
|
|
1631
|
+
* @param {string} databaseId - Database ID.
|
|
1632
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1633
|
+
* @param {string} key - Attribute Key.
|
|
1634
|
+
* @param {number} size - Attribute size for varchar attributes, in number of characters. Maximum size is 16381.
|
|
1635
|
+
* @param {boolean} required - Is attribute required?
|
|
1636
|
+
* @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1637
|
+
* @param {boolean} array - Is attribute an array?
|
|
1638
|
+
* @throws {AppwriteException}
|
|
1639
|
+
* @returns {Promise<Models.AttributeVarchar>}
|
|
1640
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1641
|
+
*/
|
|
1642
|
+
createVarcharAttribute(databaseId: string, collectionId: string, key: string, size: number, required: boolean, xdefault?: string, array?: boolean): Promise<Models.AttributeVarchar>;
|
|
1643
|
+
/**
|
|
1644
|
+
* Update a varchar attribute. Changing the `default` value will not update already existing documents.
|
|
1645
|
+
*
|
|
1646
|
+
*
|
|
1647
|
+
* @param {string} params.databaseId - Database ID.
|
|
1648
|
+
* @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1649
|
+
* @param {string} params.key - Attribute Key.
|
|
1650
|
+
* @param {boolean} params.required - Is attribute required?
|
|
1651
|
+
* @param {string} params.xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1652
|
+
* @param {number} params.size - Maximum size of the varchar attribute.
|
|
1653
|
+
* @param {string} params.newKey - New Attribute Key.
|
|
1654
|
+
* @throws {AppwriteException}
|
|
1655
|
+
* @returns {Promise<Models.AttributeVarchar>}
|
|
1656
|
+
*/
|
|
1657
|
+
updateVarcharAttribute(params: {
|
|
1658
|
+
databaseId: string;
|
|
1659
|
+
collectionId: string;
|
|
1660
|
+
key: string;
|
|
1661
|
+
required: boolean;
|
|
1662
|
+
xdefault?: string;
|
|
1663
|
+
size?: number;
|
|
1664
|
+
newKey?: string;
|
|
1665
|
+
}): Promise<Models.AttributeVarchar>;
|
|
1666
|
+
/**
|
|
1667
|
+
* Update a varchar attribute. Changing the `default` value will not update already existing documents.
|
|
1668
|
+
*
|
|
1669
|
+
*
|
|
1670
|
+
* @param {string} databaseId - Database ID.
|
|
1671
|
+
* @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
|
|
1672
|
+
* @param {string} key - Attribute Key.
|
|
1673
|
+
* @param {boolean} required - Is attribute required?
|
|
1674
|
+
* @param {string} xdefault - Default value for attribute when not provided. Cannot be set when attribute is required.
|
|
1675
|
+
* @param {number} size - Maximum size of the varchar attribute.
|
|
1676
|
+
* @param {string} newKey - New Attribute Key.
|
|
1677
|
+
* @throws {AppwriteException}
|
|
1678
|
+
* @returns {Promise<Models.AttributeVarchar>}
|
|
1679
|
+
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1680
|
+
*/
|
|
1681
|
+
updateVarcharAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, size?: number, newKey?: string): Promise<Models.AttributeVarchar>;
|
|
1387
1682
|
/**
|
|
1388
1683
|
* Get attribute by ID.
|
|
1389
1684
|
*
|
|
@@ -1391,14 +1686,14 @@ declare class Databases {
|
|
|
1391
1686
|
* @param {string} params.collectionId - Collection ID.
|
|
1392
1687
|
* @param {string} params.key - Attribute Key.
|
|
1393
1688
|
* @throws {AppwriteException}
|
|
1394
|
-
* @returns {Promise<
|
|
1689
|
+
* @returns {Promise<Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributeString>}
|
|
1395
1690
|
* @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.getColumn` instead.
|
|
1396
1691
|
*/
|
|
1397
1692
|
getAttribute(params: {
|
|
1398
1693
|
databaseId: string;
|
|
1399
1694
|
collectionId: string;
|
|
1400
1695
|
key: string;
|
|
1401
|
-
}): Promise<
|
|
1696
|
+
}): Promise<Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributeString>;
|
|
1402
1697
|
/**
|
|
1403
1698
|
* Get attribute by ID.
|
|
1404
1699
|
*
|
|
@@ -1406,10 +1701,10 @@ declare class Databases {
|
|
|
1406
1701
|
* @param {string} collectionId - Collection ID.
|
|
1407
1702
|
* @param {string} key - Attribute Key.
|
|
1408
1703
|
* @throws {AppwriteException}
|
|
1409
|
-
* @returns {Promise<
|
|
1704
|
+
* @returns {Promise<Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributeString>}
|
|
1410
1705
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1411
1706
|
*/
|
|
1412
|
-
getAttribute(databaseId: string, collectionId: string, key: string): Promise<
|
|
1707
|
+
getAttribute(databaseId: string, collectionId: string, key: string): Promise<Models.AttributeBoolean | Models.AttributeInteger | Models.AttributeFloat | Models.AttributeEmail | Models.AttributeEnum | Models.AttributeUrl | Models.AttributeIp | Models.AttributeDatetime | Models.AttributeRelationship | Models.AttributeString>;
|
|
1413
1708
|
/**
|
|
1414
1709
|
* Deletes an attribute.
|
|
1415
1710
|
*
|
|
@@ -1707,7 +2002,7 @@ declare class Databases {
|
|
|
1707
2002
|
databaseId: string;
|
|
1708
2003
|
collectionId: string;
|
|
1709
2004
|
documentId: string;
|
|
1710
|
-
data
|
|
2005
|
+
data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>;
|
|
1711
2006
|
permissions?: string[];
|
|
1712
2007
|
transactionId?: string;
|
|
1713
2008
|
}): Promise<Document>;
|
|
@@ -1724,7 +2019,7 @@ declare class Databases {
|
|
|
1724
2019
|
* @returns {Promise<Document>}
|
|
1725
2020
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1726
2021
|
*/
|
|
1727
|
-
upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data
|
|
2022
|
+
upsertDocument<Document extends Models.Document = Models.DefaultDocument>(databaseId: string, collectionId: string, documentId: string, data?: Document extends Models.DefaultDocument ? Partial<Models.Document> & Record<string, any> : Partial<Models.Document> & Partial<Omit<Document, keyof Models.Document>>, permissions?: string[], transactionId?: string): Promise<Document>;
|
|
1728
2023
|
/**
|
|
1729
2024
|
* Update a document by its unique ID. Using the patch method you can pass only specific fields that will get updated.
|
|
1730
2025
|
*
|
|
@@ -1903,7 +2198,7 @@ declare class Databases {
|
|
|
1903
2198
|
* @param {string} params.key - Index Key.
|
|
1904
2199
|
* @param {IndexType} params.type - Index type.
|
|
1905
2200
|
* @param {string[]} params.attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
|
|
1906
|
-
* @param {
|
|
2201
|
+
* @param {OrderBy[]} params.orders - Array of index orders. Maximum of 100 orders are allowed.
|
|
1907
2202
|
* @param {number[]} params.lengths - Length of index. Maximum of 100
|
|
1908
2203
|
* @throws {AppwriteException}
|
|
1909
2204
|
* @returns {Promise<Models.Index>}
|
|
@@ -1915,7 +2210,7 @@ declare class Databases {
|
|
|
1915
2210
|
key: string;
|
|
1916
2211
|
type: IndexType;
|
|
1917
2212
|
attributes: string[];
|
|
1918
|
-
orders?:
|
|
2213
|
+
orders?: OrderBy[];
|
|
1919
2214
|
lengths?: number[];
|
|
1920
2215
|
}): Promise<Models.Index>;
|
|
1921
2216
|
/**
|
|
@@ -1927,13 +2222,13 @@ declare class Databases {
|
|
|
1927
2222
|
* @param {string} key - Index Key.
|
|
1928
2223
|
* @param {IndexType} type - Index type.
|
|
1929
2224
|
* @param {string[]} attributes - Array of attributes to index. Maximum of 100 attributes are allowed, each 32 characters long.
|
|
1930
|
-
* @param {
|
|
2225
|
+
* @param {OrderBy[]} orders - Array of index orders. Maximum of 100 orders are allowed.
|
|
1931
2226
|
* @param {number[]} lengths - Length of index. Maximum of 100
|
|
1932
2227
|
* @throws {AppwriteException}
|
|
1933
2228
|
* @returns {Promise<Models.Index>}
|
|
1934
2229
|
* @deprecated Use the object parameter style method for a better developer experience.
|
|
1935
2230
|
*/
|
|
1936
|
-
createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?:
|
|
2231
|
+
createIndex(databaseId: string, collectionId: string, key: string, type: IndexType, attributes: string[], orders?: OrderBy[], lengths?: number[]): Promise<Models.Index>;
|
|
1937
2232
|
/**
|
|
1938
2233
|
* Get an index by its unique ID.
|
|
1939
2234
|
*
|