node-appwrite 18.0.0 → 19.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.
Files changed (55) hide show
  1. package/dist/client.js +2 -2
  2. package/dist/client.js.map +1 -1
  3. package/dist/client.mjs +2 -2
  4. package/dist/client.mjs.map +1 -1
  5. package/dist/enums/credit-card.d.mts +1 -1
  6. package/dist/enums/credit-card.d.ts +1 -1
  7. package/dist/enums/credit-card.js +1 -1
  8. package/dist/enums/credit-card.js.map +1 -1
  9. package/dist/enums/credit-card.mjs +1 -1
  10. package/dist/enums/credit-card.mjs.map +1 -1
  11. package/dist/enums/execution-method.d.mts +2 -1
  12. package/dist/enums/execution-method.d.ts +2 -1
  13. package/dist/enums/execution-method.js +1 -0
  14. package/dist/enums/execution-method.js.map +1 -1
  15. package/dist/enums/execution-method.mjs +1 -0
  16. package/dist/enums/execution-method.mjs.map +1 -1
  17. package/dist/enums/index-type.d.mts +2 -1
  18. package/dist/enums/index-type.d.ts +2 -1
  19. package/dist/enums/index-type.js +1 -0
  20. package/dist/enums/index-type.js.map +1 -1
  21. package/dist/enums/index-type.mjs +1 -0
  22. package/dist/enums/index-type.mjs.map +1 -1
  23. package/dist/models.d.mts +250 -4
  24. package/dist/models.d.ts +250 -4
  25. package/dist/query.d.mts +128 -8
  26. package/dist/query.d.ts +128 -8
  27. package/dist/query.js +123 -3
  28. package/dist/query.js.map +1 -1
  29. package/dist/query.mjs +123 -3
  30. package/dist/query.mjs.map +1 -1
  31. package/dist/services/account.d.mts +2 -2
  32. package/dist/services/account.d.ts +2 -2
  33. package/dist/services/account.js.map +1 -1
  34. package/dist/services/account.mjs.map +1 -1
  35. package/dist/services/avatars.d.mts +2 -2
  36. package/dist/services/avatars.d.ts +2 -2
  37. package/dist/services/avatars.js.map +1 -1
  38. package/dist/services/avatars.mjs.map +1 -1
  39. package/dist/services/databases.d.mts +202 -1
  40. package/dist/services/databases.d.ts +202 -1
  41. package/dist/services/databases.js +318 -9
  42. package/dist/services/databases.js.map +1 -1
  43. package/dist/services/databases.mjs +318 -9
  44. package/dist/services/databases.mjs.map +1 -1
  45. package/dist/services/functions.d.mts +2 -2
  46. package/dist/services/functions.d.ts +2 -2
  47. package/dist/services/functions.js.map +1 -1
  48. package/dist/services/functions.mjs.map +1 -1
  49. package/dist/services/tables-db.d.mts +195 -0
  50. package/dist/services/tables-db.d.ts +195 -0
  51. package/dist/services/tables-db.js +318 -0
  52. package/dist/services/tables-db.js.map +1 -1
  53. package/dist/services/tables-db.mjs +318 -0
  54. package/dist/services/tables-db.mjs.map +1 -1
  55. package/package.json +1 -1
@@ -40,7 +40,7 @@ declare class Databases {
40
40
  * @param {boolean} params.enabled - Is the database enabled? When set to 'disabled', users cannot access the database but Server SDKs with an API key can still read and write to the database. No data is lost when this is toggled.
41
41
  * @throws {AppwriteException}
42
42
  * @returns {Promise<Models.Database>}
43
- * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createDatabase` instead.
43
+ * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.create` instead.
44
44
  */
45
45
  create(params: {
46
46
  databaseId: string;
@@ -835,6 +835,207 @@ declare class Databases {
835
835
  * @deprecated Use the object parameter style method for a better developer experience.
836
836
  */
837
837
  updateIpAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: string, newKey?: string): Promise<Models.AttributeIp>;
838
+ /**
839
+ * Create a geometric line attribute.
840
+ *
841
+ * @param {string} params.databaseId - Database ID.
842
+ * @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).
843
+ * @param {string} params.key - Attribute Key.
844
+ * @param {boolean} params.required - Is attribute required?
845
+ * @param {any[]} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
846
+ * @throws {AppwriteException}
847
+ * @returns {Promise<Models.AttributeLine>}
848
+ * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createLineColumn` instead.
849
+ */
850
+ createLineAttribute(params: {
851
+ databaseId: string;
852
+ collectionId: string;
853
+ key: string;
854
+ required: boolean;
855
+ xdefault?: any[];
856
+ }): Promise<Models.AttributeLine>;
857
+ /**
858
+ * Create a geometric line attribute.
859
+ *
860
+ * @param {string} databaseId - Database ID.
861
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
862
+ * @param {string} key - Attribute Key.
863
+ * @param {boolean} required - Is attribute required?
864
+ * @param {any[]} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
865
+ * @throws {AppwriteException}
866
+ * @returns {Promise<Models.AttributeLine>}
867
+ * @deprecated Use the object parameter style method for a better developer experience.
868
+ */
869
+ createLineAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise<Models.AttributeLine>;
870
+ /**
871
+ * Update a line attribute. Changing the `default` value will not update already existing documents.
872
+ *
873
+ * @param {string} params.databaseId - Database ID.
874
+ * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
875
+ * @param {string} params.key - Attribute Key.
876
+ * @param {boolean} params.required - Is attribute required?
877
+ * @param {any[]} params.xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
878
+ * @param {string} params.newKey - New attribute key.
879
+ * @throws {AppwriteException}
880
+ * @returns {Promise<Models.AttributeLine>}
881
+ * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updateLineColumn` instead.
882
+ */
883
+ updateLineAttribute(params: {
884
+ databaseId: string;
885
+ collectionId: string;
886
+ key: string;
887
+ required: boolean;
888
+ xdefault?: any[];
889
+ newKey?: string;
890
+ }): Promise<Models.AttributeLine>;
891
+ /**
892
+ * Update a line attribute. Changing the `default` value will not update already existing documents.
893
+ *
894
+ * @param {string} databaseId - Database ID.
895
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
896
+ * @param {string} key - Attribute Key.
897
+ * @param {boolean} required - Is attribute required?
898
+ * @param {any[]} xdefault - Default value for attribute when not provided, two-dimensional array of coordinate pairs, [[longitude, latitude], [longitude, latitude], …], listing the vertices of the line in order. Cannot be set when attribute is required.
899
+ * @param {string} newKey - New attribute key.
900
+ * @throws {AppwriteException}
901
+ * @returns {Promise<Models.AttributeLine>}
902
+ * @deprecated Use the object parameter style method for a better developer experience.
903
+ */
904
+ updateLineAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise<Models.AttributeLine>;
905
+ /**
906
+ * Create a geometric point attribute.
907
+ *
908
+ * @param {string} params.databaseId - Database ID.
909
+ * @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).
910
+ * @param {string} params.key - Attribute Key.
911
+ * @param {boolean} params.required - Is attribute required?
912
+ * @param {any[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
913
+ * @throws {AppwriteException}
914
+ * @returns {Promise<Models.AttributePoint>}
915
+ * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createPointColumn` instead.
916
+ */
917
+ createPointAttribute(params: {
918
+ databaseId: string;
919
+ collectionId: string;
920
+ key: string;
921
+ required: boolean;
922
+ xdefault?: any[];
923
+ }): Promise<Models.AttributePoint>;
924
+ /**
925
+ * Create a geometric point attribute.
926
+ *
927
+ * @param {string} databaseId - Database ID.
928
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
929
+ * @param {string} key - Attribute Key.
930
+ * @param {boolean} required - Is attribute required?
931
+ * @param {any[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
932
+ * @throws {AppwriteException}
933
+ * @returns {Promise<Models.AttributePoint>}
934
+ * @deprecated Use the object parameter style method for a better developer experience.
935
+ */
936
+ createPointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise<Models.AttributePoint>;
937
+ /**
938
+ * Update a point attribute. Changing the `default` value will not update already existing documents.
939
+ *
940
+ * @param {string} params.databaseId - Database ID.
941
+ * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
942
+ * @param {string} params.key - Attribute Key.
943
+ * @param {boolean} params.required - Is attribute required?
944
+ * @param {any[]} params.xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
945
+ * @param {string} params.newKey - New attribute key.
946
+ * @throws {AppwriteException}
947
+ * @returns {Promise<Models.AttributePoint>}
948
+ * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updatePointColumn` instead.
949
+ */
950
+ updatePointAttribute(params: {
951
+ databaseId: string;
952
+ collectionId: string;
953
+ key: string;
954
+ required: boolean;
955
+ xdefault?: any[];
956
+ newKey?: string;
957
+ }): Promise<Models.AttributePoint>;
958
+ /**
959
+ * Update a point attribute. Changing the `default` value will not update already existing documents.
960
+ *
961
+ * @param {string} databaseId - Database ID.
962
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
963
+ * @param {string} key - Attribute Key.
964
+ * @param {boolean} required - Is attribute required?
965
+ * @param {any[]} xdefault - Default value for attribute when not provided, array of two numbers [longitude, latitude], representing a single coordinate. Cannot be set when attribute is required.
966
+ * @param {string} newKey - New attribute key.
967
+ * @throws {AppwriteException}
968
+ * @returns {Promise<Models.AttributePoint>}
969
+ * @deprecated Use the object parameter style method for a better developer experience.
970
+ */
971
+ updatePointAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise<Models.AttributePoint>;
972
+ /**
973
+ * Create a geometric polygon attribute.
974
+ *
975
+ * @param {string} params.databaseId - Database ID.
976
+ * @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).
977
+ * @param {string} params.key - Attribute Key.
978
+ * @param {boolean} params.required - Is attribute required?
979
+ * @param {any[]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
980
+ * @throws {AppwriteException}
981
+ * @returns {Promise<Models.AttributePolygon>}
982
+ * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.createPolygonColumn` instead.
983
+ */
984
+ createPolygonAttribute(params: {
985
+ databaseId: string;
986
+ collectionId: string;
987
+ key: string;
988
+ required: boolean;
989
+ xdefault?: any[];
990
+ }): Promise<Models.AttributePolygon>;
991
+ /**
992
+ * Create a geometric polygon attribute.
993
+ *
994
+ * @param {string} databaseId - Database ID.
995
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#databasesCreateCollection).
996
+ * @param {string} key - Attribute Key.
997
+ * @param {boolean} required - Is attribute required?
998
+ * @param {any[]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
999
+ * @throws {AppwriteException}
1000
+ * @returns {Promise<Models.AttributePolygon>}
1001
+ * @deprecated Use the object parameter style method for a better developer experience.
1002
+ */
1003
+ createPolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[]): Promise<Models.AttributePolygon>;
1004
+ /**
1005
+ * Update a polygon attribute. Changing the `default` value will not update already existing documents.
1006
+ *
1007
+ * @param {string} params.databaseId - Database ID.
1008
+ * @param {string} params.collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
1009
+ * @param {string} params.key - Attribute Key.
1010
+ * @param {boolean} params.required - Is attribute required?
1011
+ * @param {any[]} params.xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
1012
+ * @param {string} params.newKey - New attribute key.
1013
+ * @throws {AppwriteException}
1014
+ * @returns {Promise<Models.AttributePolygon>}
1015
+ * @deprecated This API has been deprecated since 1.8.0. Please use `TablesDB.updatePolygonColumn` instead.
1016
+ */
1017
+ updatePolygonAttribute(params: {
1018
+ databaseId: string;
1019
+ collectionId: string;
1020
+ key: string;
1021
+ required: boolean;
1022
+ xdefault?: any[];
1023
+ newKey?: string;
1024
+ }): Promise<Models.AttributePolygon>;
1025
+ /**
1026
+ * Update a polygon attribute. Changing the `default` value will not update already existing documents.
1027
+ *
1028
+ * @param {string} databaseId - Database ID.
1029
+ * @param {string} collectionId - Collection ID. You can create a new collection using the Database service [server integration](https://appwrite.io/docs/server/databases#createCollection).
1030
+ * @param {string} key - Attribute Key.
1031
+ * @param {boolean} required - Is attribute required?
1032
+ * @param {any[]} xdefault - Default value for attribute when not provided, three-dimensional array where the outer array holds one or more linear rings, [[[longitude, latitude], …], …], the first ring is the exterior boundary, any additional rings are interior holes, and each ring must start and end with the same coordinate pair. Cannot be set when attribute is required.
1033
+ * @param {string} newKey - New attribute key.
1034
+ * @throws {AppwriteException}
1035
+ * @returns {Promise<Models.AttributePolygon>}
1036
+ * @deprecated Use the object parameter style method for a better developer experience.
1037
+ */
1038
+ updatePolygonAttribute(databaseId: string, collectionId: string, key: string, required: boolean, xdefault?: any[], newKey?: string): Promise<Models.AttributePolygon>;
838
1039
  /**
839
1040
  * Create relationship attribute. [Learn more about relationship attributes](https://appwrite.io/docs/databases-relationships#relationship-attributes).
840
1041
  *
@@ -1259,6 +1259,324 @@ class Databases {
1259
1259
  payload
1260
1260
  );
1261
1261
  }
1262
+ createLineAttribute(paramsOrFirst, ...rest) {
1263
+ let params;
1264
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1265
+ params = paramsOrFirst || {};
1266
+ } else {
1267
+ params = {
1268
+ databaseId: paramsOrFirst,
1269
+ collectionId: rest[0],
1270
+ key: rest[1],
1271
+ required: rest[2],
1272
+ xdefault: rest[3]
1273
+ };
1274
+ }
1275
+ const databaseId = params.databaseId;
1276
+ const collectionId = params.collectionId;
1277
+ const key = params.key;
1278
+ const required = params.required;
1279
+ const xdefault = params.xdefault;
1280
+ if (typeof databaseId === "undefined") {
1281
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1282
+ }
1283
+ if (typeof collectionId === "undefined") {
1284
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1285
+ }
1286
+ if (typeof key === "undefined") {
1287
+ throw new client.AppwriteException('Missing required parameter: "key"');
1288
+ }
1289
+ if (typeof required === "undefined") {
1290
+ throw new client.AppwriteException('Missing required parameter: "required"');
1291
+ }
1292
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/line".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1293
+ const payload = {};
1294
+ if (typeof key !== "undefined") {
1295
+ payload["key"] = key;
1296
+ }
1297
+ if (typeof required !== "undefined") {
1298
+ payload["required"] = required;
1299
+ }
1300
+ if (typeof xdefault !== "undefined") {
1301
+ payload["default"] = xdefault;
1302
+ }
1303
+ const uri = new URL(this.client.config.endpoint + apiPath);
1304
+ const apiHeaders = {
1305
+ "content-type": "application/json"
1306
+ };
1307
+ return this.client.call(
1308
+ "post",
1309
+ uri,
1310
+ apiHeaders,
1311
+ payload
1312
+ );
1313
+ }
1314
+ updateLineAttribute(paramsOrFirst, ...rest) {
1315
+ let params;
1316
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1317
+ params = paramsOrFirst || {};
1318
+ } else {
1319
+ params = {
1320
+ databaseId: paramsOrFirst,
1321
+ collectionId: rest[0],
1322
+ key: rest[1],
1323
+ required: rest[2],
1324
+ xdefault: rest[3],
1325
+ newKey: rest[4]
1326
+ };
1327
+ }
1328
+ const databaseId = params.databaseId;
1329
+ const collectionId = params.collectionId;
1330
+ const key = params.key;
1331
+ const required = params.required;
1332
+ const xdefault = params.xdefault;
1333
+ const newKey = params.newKey;
1334
+ if (typeof databaseId === "undefined") {
1335
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1336
+ }
1337
+ if (typeof collectionId === "undefined") {
1338
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1339
+ }
1340
+ if (typeof key === "undefined") {
1341
+ throw new client.AppwriteException('Missing required parameter: "key"');
1342
+ }
1343
+ if (typeof required === "undefined") {
1344
+ throw new client.AppwriteException('Missing required parameter: "required"');
1345
+ }
1346
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/line/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
1347
+ const payload = {};
1348
+ if (typeof required !== "undefined") {
1349
+ payload["required"] = required;
1350
+ }
1351
+ if (typeof xdefault !== "undefined") {
1352
+ payload["default"] = xdefault;
1353
+ }
1354
+ if (typeof newKey !== "undefined") {
1355
+ payload["newKey"] = newKey;
1356
+ }
1357
+ const uri = new URL(this.client.config.endpoint + apiPath);
1358
+ const apiHeaders = {
1359
+ "content-type": "application/json"
1360
+ };
1361
+ return this.client.call(
1362
+ "patch",
1363
+ uri,
1364
+ apiHeaders,
1365
+ payload
1366
+ );
1367
+ }
1368
+ createPointAttribute(paramsOrFirst, ...rest) {
1369
+ let params;
1370
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1371
+ params = paramsOrFirst || {};
1372
+ } else {
1373
+ params = {
1374
+ databaseId: paramsOrFirst,
1375
+ collectionId: rest[0],
1376
+ key: rest[1],
1377
+ required: rest[2],
1378
+ xdefault: rest[3]
1379
+ };
1380
+ }
1381
+ const databaseId = params.databaseId;
1382
+ const collectionId = params.collectionId;
1383
+ const key = params.key;
1384
+ const required = params.required;
1385
+ const xdefault = params.xdefault;
1386
+ if (typeof databaseId === "undefined") {
1387
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1388
+ }
1389
+ if (typeof collectionId === "undefined") {
1390
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1391
+ }
1392
+ if (typeof key === "undefined") {
1393
+ throw new client.AppwriteException('Missing required parameter: "key"');
1394
+ }
1395
+ if (typeof required === "undefined") {
1396
+ throw new client.AppwriteException('Missing required parameter: "required"');
1397
+ }
1398
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/point".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1399
+ const payload = {};
1400
+ if (typeof key !== "undefined") {
1401
+ payload["key"] = key;
1402
+ }
1403
+ if (typeof required !== "undefined") {
1404
+ payload["required"] = required;
1405
+ }
1406
+ if (typeof xdefault !== "undefined") {
1407
+ payload["default"] = xdefault;
1408
+ }
1409
+ const uri = new URL(this.client.config.endpoint + apiPath);
1410
+ const apiHeaders = {
1411
+ "content-type": "application/json"
1412
+ };
1413
+ return this.client.call(
1414
+ "post",
1415
+ uri,
1416
+ apiHeaders,
1417
+ payload
1418
+ );
1419
+ }
1420
+ updatePointAttribute(paramsOrFirst, ...rest) {
1421
+ let params;
1422
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1423
+ params = paramsOrFirst || {};
1424
+ } else {
1425
+ params = {
1426
+ databaseId: paramsOrFirst,
1427
+ collectionId: rest[0],
1428
+ key: rest[1],
1429
+ required: rest[2],
1430
+ xdefault: rest[3],
1431
+ newKey: rest[4]
1432
+ };
1433
+ }
1434
+ const databaseId = params.databaseId;
1435
+ const collectionId = params.collectionId;
1436
+ const key = params.key;
1437
+ const required = params.required;
1438
+ const xdefault = params.xdefault;
1439
+ const newKey = params.newKey;
1440
+ if (typeof databaseId === "undefined") {
1441
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1442
+ }
1443
+ if (typeof collectionId === "undefined") {
1444
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1445
+ }
1446
+ if (typeof key === "undefined") {
1447
+ throw new client.AppwriteException('Missing required parameter: "key"');
1448
+ }
1449
+ if (typeof required === "undefined") {
1450
+ throw new client.AppwriteException('Missing required parameter: "required"');
1451
+ }
1452
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/point/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
1453
+ const payload = {};
1454
+ if (typeof required !== "undefined") {
1455
+ payload["required"] = required;
1456
+ }
1457
+ if (typeof xdefault !== "undefined") {
1458
+ payload["default"] = xdefault;
1459
+ }
1460
+ if (typeof newKey !== "undefined") {
1461
+ payload["newKey"] = newKey;
1462
+ }
1463
+ const uri = new URL(this.client.config.endpoint + apiPath);
1464
+ const apiHeaders = {
1465
+ "content-type": "application/json"
1466
+ };
1467
+ return this.client.call(
1468
+ "patch",
1469
+ uri,
1470
+ apiHeaders,
1471
+ payload
1472
+ );
1473
+ }
1474
+ createPolygonAttribute(paramsOrFirst, ...rest) {
1475
+ let params;
1476
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1477
+ params = paramsOrFirst || {};
1478
+ } else {
1479
+ params = {
1480
+ databaseId: paramsOrFirst,
1481
+ collectionId: rest[0],
1482
+ key: rest[1],
1483
+ required: rest[2],
1484
+ xdefault: rest[3]
1485
+ };
1486
+ }
1487
+ const databaseId = params.databaseId;
1488
+ const collectionId = params.collectionId;
1489
+ const key = params.key;
1490
+ const required = params.required;
1491
+ const xdefault = params.xdefault;
1492
+ if (typeof databaseId === "undefined") {
1493
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1494
+ }
1495
+ if (typeof collectionId === "undefined") {
1496
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1497
+ }
1498
+ if (typeof key === "undefined") {
1499
+ throw new client.AppwriteException('Missing required parameter: "key"');
1500
+ }
1501
+ if (typeof required === "undefined") {
1502
+ throw new client.AppwriteException('Missing required parameter: "required"');
1503
+ }
1504
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/polygon".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1505
+ const payload = {};
1506
+ if (typeof key !== "undefined") {
1507
+ payload["key"] = key;
1508
+ }
1509
+ if (typeof required !== "undefined") {
1510
+ payload["required"] = required;
1511
+ }
1512
+ if (typeof xdefault !== "undefined") {
1513
+ payload["default"] = xdefault;
1514
+ }
1515
+ const uri = new URL(this.client.config.endpoint + apiPath);
1516
+ const apiHeaders = {
1517
+ "content-type": "application/json"
1518
+ };
1519
+ return this.client.call(
1520
+ "post",
1521
+ uri,
1522
+ apiHeaders,
1523
+ payload
1524
+ );
1525
+ }
1526
+ updatePolygonAttribute(paramsOrFirst, ...rest) {
1527
+ let params;
1528
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1529
+ params = paramsOrFirst || {};
1530
+ } else {
1531
+ params = {
1532
+ databaseId: paramsOrFirst,
1533
+ collectionId: rest[0],
1534
+ key: rest[1],
1535
+ required: rest[2],
1536
+ xdefault: rest[3],
1537
+ newKey: rest[4]
1538
+ };
1539
+ }
1540
+ const databaseId = params.databaseId;
1541
+ const collectionId = params.collectionId;
1542
+ const key = params.key;
1543
+ const required = params.required;
1544
+ const xdefault = params.xdefault;
1545
+ const newKey = params.newKey;
1546
+ if (typeof databaseId === "undefined") {
1547
+ throw new client.AppwriteException('Missing required parameter: "databaseId"');
1548
+ }
1549
+ if (typeof collectionId === "undefined") {
1550
+ throw new client.AppwriteException('Missing required parameter: "collectionId"');
1551
+ }
1552
+ if (typeof key === "undefined") {
1553
+ throw new client.AppwriteException('Missing required parameter: "key"');
1554
+ }
1555
+ if (typeof required === "undefined") {
1556
+ throw new client.AppwriteException('Missing required parameter: "required"');
1557
+ }
1558
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
1559
+ const payload = {};
1560
+ if (typeof required !== "undefined") {
1561
+ payload["required"] = required;
1562
+ }
1563
+ if (typeof xdefault !== "undefined") {
1564
+ payload["default"] = xdefault;
1565
+ }
1566
+ if (typeof newKey !== "undefined") {
1567
+ payload["newKey"] = newKey;
1568
+ }
1569
+ const uri = new URL(this.client.config.endpoint + apiPath);
1570
+ const apiHeaders = {
1571
+ "content-type": "application/json"
1572
+ };
1573
+ return this.client.call(
1574
+ "patch",
1575
+ uri,
1576
+ apiHeaders,
1577
+ payload
1578
+ );
1579
+ }
1262
1580
  createRelationshipAttribute(paramsOrFirst, ...rest) {
1263
1581
  let params;
1264
1582
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -1752,9 +2070,6 @@ class Databases {
1752
2070
  if (typeof data === "undefined") {
1753
2071
  throw new client.AppwriteException('Missing required parameter: "data"');
1754
2072
  }
1755
- data == null ? true : delete data.$sequence;
1756
- data == null ? true : delete data.$collectionId;
1757
- data == null ? true : delete data.$databaseId;
1758
2073
  const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1759
2074
  const payload = {};
1760
2075
  if (typeof documentId !== "undefined") {
@@ -2001,9 +2316,6 @@ class Databases {
2001
2316
  if (typeof data === "undefined") {
2002
2317
  throw new client.AppwriteException('Missing required parameter: "data"');
2003
2318
  }
2004
- data == null ? true : delete data.$sequence;
2005
- data == null ? true : delete data.$collectionId;
2006
- data == null ? true : delete data.$databaseId;
2007
2319
  const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId);
2008
2320
  const payload = {};
2009
2321
  if (typeof data !== "undefined") {
@@ -2050,9 +2362,6 @@ class Databases {
2050
2362
  if (typeof documentId === "undefined") {
2051
2363
  throw new client.AppwriteException('Missing required parameter: "documentId"');
2052
2364
  }
2053
- data == null ? true : delete data.$sequence;
2054
- data == null ? true : delete data.$collectionId;
2055
- data == null ? true : delete data.$databaseId;
2056
2365
  const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId);
2057
2366
  const payload = {};
2058
2367
  if (typeof data !== "undefined") {