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
@@ -1258,6 +1258,324 @@ var Databases = class {
1258
1258
  payload
1259
1259
  );
1260
1260
  }
1261
+ createLineAttribute(paramsOrFirst, ...rest) {
1262
+ let params;
1263
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1264
+ params = paramsOrFirst || {};
1265
+ } else {
1266
+ params = {
1267
+ databaseId: paramsOrFirst,
1268
+ collectionId: rest[0],
1269
+ key: rest[1],
1270
+ required: rest[2],
1271
+ xdefault: rest[3]
1272
+ };
1273
+ }
1274
+ const databaseId = params.databaseId;
1275
+ const collectionId = params.collectionId;
1276
+ const key = params.key;
1277
+ const required = params.required;
1278
+ const xdefault = params.xdefault;
1279
+ if (typeof databaseId === "undefined") {
1280
+ throw new AppwriteException('Missing required parameter: "databaseId"');
1281
+ }
1282
+ if (typeof collectionId === "undefined") {
1283
+ throw new AppwriteException('Missing required parameter: "collectionId"');
1284
+ }
1285
+ if (typeof key === "undefined") {
1286
+ throw new AppwriteException('Missing required parameter: "key"');
1287
+ }
1288
+ if (typeof required === "undefined") {
1289
+ throw new AppwriteException('Missing required parameter: "required"');
1290
+ }
1291
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/line".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1292
+ const payload = {};
1293
+ if (typeof key !== "undefined") {
1294
+ payload["key"] = key;
1295
+ }
1296
+ if (typeof required !== "undefined") {
1297
+ payload["required"] = required;
1298
+ }
1299
+ if (typeof xdefault !== "undefined") {
1300
+ payload["default"] = xdefault;
1301
+ }
1302
+ const uri = new URL(this.client.config.endpoint + apiPath);
1303
+ const apiHeaders = {
1304
+ "content-type": "application/json"
1305
+ };
1306
+ return this.client.call(
1307
+ "post",
1308
+ uri,
1309
+ apiHeaders,
1310
+ payload
1311
+ );
1312
+ }
1313
+ updateLineAttribute(paramsOrFirst, ...rest) {
1314
+ let params;
1315
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1316
+ params = paramsOrFirst || {};
1317
+ } else {
1318
+ params = {
1319
+ databaseId: paramsOrFirst,
1320
+ collectionId: rest[0],
1321
+ key: rest[1],
1322
+ required: rest[2],
1323
+ xdefault: rest[3],
1324
+ newKey: rest[4]
1325
+ };
1326
+ }
1327
+ const databaseId = params.databaseId;
1328
+ const collectionId = params.collectionId;
1329
+ const key = params.key;
1330
+ const required = params.required;
1331
+ const xdefault = params.xdefault;
1332
+ const newKey = params.newKey;
1333
+ if (typeof databaseId === "undefined") {
1334
+ throw new AppwriteException('Missing required parameter: "databaseId"');
1335
+ }
1336
+ if (typeof collectionId === "undefined") {
1337
+ throw new AppwriteException('Missing required parameter: "collectionId"');
1338
+ }
1339
+ if (typeof key === "undefined") {
1340
+ throw new AppwriteException('Missing required parameter: "key"');
1341
+ }
1342
+ if (typeof required === "undefined") {
1343
+ throw new AppwriteException('Missing required parameter: "required"');
1344
+ }
1345
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/line/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
1346
+ const payload = {};
1347
+ if (typeof required !== "undefined") {
1348
+ payload["required"] = required;
1349
+ }
1350
+ if (typeof xdefault !== "undefined") {
1351
+ payload["default"] = xdefault;
1352
+ }
1353
+ if (typeof newKey !== "undefined") {
1354
+ payload["newKey"] = newKey;
1355
+ }
1356
+ const uri = new URL(this.client.config.endpoint + apiPath);
1357
+ const apiHeaders = {
1358
+ "content-type": "application/json"
1359
+ };
1360
+ return this.client.call(
1361
+ "patch",
1362
+ uri,
1363
+ apiHeaders,
1364
+ payload
1365
+ );
1366
+ }
1367
+ createPointAttribute(paramsOrFirst, ...rest) {
1368
+ let params;
1369
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1370
+ params = paramsOrFirst || {};
1371
+ } else {
1372
+ params = {
1373
+ databaseId: paramsOrFirst,
1374
+ collectionId: rest[0],
1375
+ key: rest[1],
1376
+ required: rest[2],
1377
+ xdefault: rest[3]
1378
+ };
1379
+ }
1380
+ const databaseId = params.databaseId;
1381
+ const collectionId = params.collectionId;
1382
+ const key = params.key;
1383
+ const required = params.required;
1384
+ const xdefault = params.xdefault;
1385
+ if (typeof databaseId === "undefined") {
1386
+ throw new AppwriteException('Missing required parameter: "databaseId"');
1387
+ }
1388
+ if (typeof collectionId === "undefined") {
1389
+ throw new AppwriteException('Missing required parameter: "collectionId"');
1390
+ }
1391
+ if (typeof key === "undefined") {
1392
+ throw new AppwriteException('Missing required parameter: "key"');
1393
+ }
1394
+ if (typeof required === "undefined") {
1395
+ throw new AppwriteException('Missing required parameter: "required"');
1396
+ }
1397
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/point".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1398
+ const payload = {};
1399
+ if (typeof key !== "undefined") {
1400
+ payload["key"] = key;
1401
+ }
1402
+ if (typeof required !== "undefined") {
1403
+ payload["required"] = required;
1404
+ }
1405
+ if (typeof xdefault !== "undefined") {
1406
+ payload["default"] = xdefault;
1407
+ }
1408
+ const uri = new URL(this.client.config.endpoint + apiPath);
1409
+ const apiHeaders = {
1410
+ "content-type": "application/json"
1411
+ };
1412
+ return this.client.call(
1413
+ "post",
1414
+ uri,
1415
+ apiHeaders,
1416
+ payload
1417
+ );
1418
+ }
1419
+ updatePointAttribute(paramsOrFirst, ...rest) {
1420
+ let params;
1421
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1422
+ params = paramsOrFirst || {};
1423
+ } else {
1424
+ params = {
1425
+ databaseId: paramsOrFirst,
1426
+ collectionId: rest[0],
1427
+ key: rest[1],
1428
+ required: rest[2],
1429
+ xdefault: rest[3],
1430
+ newKey: rest[4]
1431
+ };
1432
+ }
1433
+ const databaseId = params.databaseId;
1434
+ const collectionId = params.collectionId;
1435
+ const key = params.key;
1436
+ const required = params.required;
1437
+ const xdefault = params.xdefault;
1438
+ const newKey = params.newKey;
1439
+ if (typeof databaseId === "undefined") {
1440
+ throw new AppwriteException('Missing required parameter: "databaseId"');
1441
+ }
1442
+ if (typeof collectionId === "undefined") {
1443
+ throw new AppwriteException('Missing required parameter: "collectionId"');
1444
+ }
1445
+ if (typeof key === "undefined") {
1446
+ throw new AppwriteException('Missing required parameter: "key"');
1447
+ }
1448
+ if (typeof required === "undefined") {
1449
+ throw new AppwriteException('Missing required parameter: "required"');
1450
+ }
1451
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/point/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
1452
+ const payload = {};
1453
+ if (typeof required !== "undefined") {
1454
+ payload["required"] = required;
1455
+ }
1456
+ if (typeof xdefault !== "undefined") {
1457
+ payload["default"] = xdefault;
1458
+ }
1459
+ if (typeof newKey !== "undefined") {
1460
+ payload["newKey"] = newKey;
1461
+ }
1462
+ const uri = new URL(this.client.config.endpoint + apiPath);
1463
+ const apiHeaders = {
1464
+ "content-type": "application/json"
1465
+ };
1466
+ return this.client.call(
1467
+ "patch",
1468
+ uri,
1469
+ apiHeaders,
1470
+ payload
1471
+ );
1472
+ }
1473
+ createPolygonAttribute(paramsOrFirst, ...rest) {
1474
+ let params;
1475
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1476
+ params = paramsOrFirst || {};
1477
+ } else {
1478
+ params = {
1479
+ databaseId: paramsOrFirst,
1480
+ collectionId: rest[0],
1481
+ key: rest[1],
1482
+ required: rest[2],
1483
+ xdefault: rest[3]
1484
+ };
1485
+ }
1486
+ const databaseId = params.databaseId;
1487
+ const collectionId = params.collectionId;
1488
+ const key = params.key;
1489
+ const required = params.required;
1490
+ const xdefault = params.xdefault;
1491
+ if (typeof databaseId === "undefined") {
1492
+ throw new AppwriteException('Missing required parameter: "databaseId"');
1493
+ }
1494
+ if (typeof collectionId === "undefined") {
1495
+ throw new AppwriteException('Missing required parameter: "collectionId"');
1496
+ }
1497
+ if (typeof key === "undefined") {
1498
+ throw new AppwriteException('Missing required parameter: "key"');
1499
+ }
1500
+ if (typeof required === "undefined") {
1501
+ throw new AppwriteException('Missing required parameter: "required"');
1502
+ }
1503
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/polygon".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1504
+ const payload = {};
1505
+ if (typeof key !== "undefined") {
1506
+ payload["key"] = key;
1507
+ }
1508
+ if (typeof required !== "undefined") {
1509
+ payload["required"] = required;
1510
+ }
1511
+ if (typeof xdefault !== "undefined") {
1512
+ payload["default"] = xdefault;
1513
+ }
1514
+ const uri = new URL(this.client.config.endpoint + apiPath);
1515
+ const apiHeaders = {
1516
+ "content-type": "application/json"
1517
+ };
1518
+ return this.client.call(
1519
+ "post",
1520
+ uri,
1521
+ apiHeaders,
1522
+ payload
1523
+ );
1524
+ }
1525
+ updatePolygonAttribute(paramsOrFirst, ...rest) {
1526
+ let params;
1527
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
1528
+ params = paramsOrFirst || {};
1529
+ } else {
1530
+ params = {
1531
+ databaseId: paramsOrFirst,
1532
+ collectionId: rest[0],
1533
+ key: rest[1],
1534
+ required: rest[2],
1535
+ xdefault: rest[3],
1536
+ newKey: rest[4]
1537
+ };
1538
+ }
1539
+ const databaseId = params.databaseId;
1540
+ const collectionId = params.collectionId;
1541
+ const key = params.key;
1542
+ const required = params.required;
1543
+ const xdefault = params.xdefault;
1544
+ const newKey = params.newKey;
1545
+ if (typeof databaseId === "undefined") {
1546
+ throw new AppwriteException('Missing required parameter: "databaseId"');
1547
+ }
1548
+ if (typeof collectionId === "undefined") {
1549
+ throw new AppwriteException('Missing required parameter: "collectionId"');
1550
+ }
1551
+ if (typeof key === "undefined") {
1552
+ throw new AppwriteException('Missing required parameter: "key"');
1553
+ }
1554
+ if (typeof required === "undefined") {
1555
+ throw new AppwriteException('Missing required parameter: "required"');
1556
+ }
1557
+ const apiPath = "/databases/{databaseId}/collections/{collectionId}/attributes/polygon/{key}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{key}", key);
1558
+ const payload = {};
1559
+ if (typeof required !== "undefined") {
1560
+ payload["required"] = required;
1561
+ }
1562
+ if (typeof xdefault !== "undefined") {
1563
+ payload["default"] = xdefault;
1564
+ }
1565
+ if (typeof newKey !== "undefined") {
1566
+ payload["newKey"] = newKey;
1567
+ }
1568
+ const uri = new URL(this.client.config.endpoint + apiPath);
1569
+ const apiHeaders = {
1570
+ "content-type": "application/json"
1571
+ };
1572
+ return this.client.call(
1573
+ "patch",
1574
+ uri,
1575
+ apiHeaders,
1576
+ payload
1577
+ );
1578
+ }
1261
1579
  createRelationshipAttribute(paramsOrFirst, ...rest) {
1262
1580
  let params;
1263
1581
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -1751,9 +2069,6 @@ var Databases = class {
1751
2069
  if (typeof data === "undefined") {
1752
2070
  throw new AppwriteException('Missing required parameter: "data"');
1753
2071
  }
1754
- data == null ? true : delete data.$sequence;
1755
- data == null ? true : delete data.$collectionId;
1756
- data == null ? true : delete data.$databaseId;
1757
2072
  const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId);
1758
2073
  const payload = {};
1759
2074
  if (typeof documentId !== "undefined") {
@@ -2000,9 +2315,6 @@ var Databases = class {
2000
2315
  if (typeof data === "undefined") {
2001
2316
  throw new AppwriteException('Missing required parameter: "data"');
2002
2317
  }
2003
- data == null ? true : delete data.$sequence;
2004
- data == null ? true : delete data.$collectionId;
2005
- data == null ? true : delete data.$databaseId;
2006
2318
  const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId);
2007
2319
  const payload = {};
2008
2320
  if (typeof data !== "undefined") {
@@ -2049,9 +2361,6 @@ var Databases = class {
2049
2361
  if (typeof documentId === "undefined") {
2050
2362
  throw new AppwriteException('Missing required parameter: "documentId"');
2051
2363
  }
2052
- data == null ? true : delete data.$sequence;
2053
- data == null ? true : delete data.$collectionId;
2054
- data == null ? true : delete data.$databaseId;
2055
2364
  const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}".replace("{databaseId}", databaseId).replace("{collectionId}", collectionId).replace("{documentId}", documentId);
2056
2365
  const payload = {};
2057
2366
  if (typeof data !== "undefined") {