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
@@ -1259,6 +1259,324 @@ class TablesDB {
1259
1259
  payload
1260
1260
  );
1261
1261
  }
1262
+ createLineColumn(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
+ tableId: rest[0],
1270
+ key: rest[1],
1271
+ required: rest[2],
1272
+ xdefault: rest[3]
1273
+ };
1274
+ }
1275
+ const databaseId = params.databaseId;
1276
+ const tableId = params.tableId;
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 tableId === "undefined") {
1284
+ throw new client.AppwriteException('Missing required parameter: "tableId"');
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 = "/tablesdb/{databaseId}/tables/{tableId}/columns/line".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
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
+ updateLineColumn(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
+ tableId: 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 tableId = params.tableId;
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 tableId === "undefined") {
1338
+ throw new client.AppwriteException('Missing required parameter: "tableId"');
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 = "/tablesdb/{databaseId}/tables/{tableId}/columns/line/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).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
+ createPointColumn(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
+ tableId: rest[0],
1376
+ key: rest[1],
1377
+ required: rest[2],
1378
+ xdefault: rest[3]
1379
+ };
1380
+ }
1381
+ const databaseId = params.databaseId;
1382
+ const tableId = params.tableId;
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 tableId === "undefined") {
1390
+ throw new client.AppwriteException('Missing required parameter: "tableId"');
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 = "/tablesdb/{databaseId}/tables/{tableId}/columns/point".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
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
+ updatePointColumn(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
+ tableId: 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 tableId = params.tableId;
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 tableId === "undefined") {
1444
+ throw new client.AppwriteException('Missing required parameter: "tableId"');
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 = "/tablesdb/{databaseId}/tables/{tableId}/columns/point/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).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
+ createPolygonColumn(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
+ tableId: rest[0],
1482
+ key: rest[1],
1483
+ required: rest[2],
1484
+ xdefault: rest[3]
1485
+ };
1486
+ }
1487
+ const databaseId = params.databaseId;
1488
+ const tableId = params.tableId;
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 tableId === "undefined") {
1496
+ throw new client.AppwriteException('Missing required parameter: "tableId"');
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 = "/tablesdb/{databaseId}/tables/{tableId}/columns/polygon".replace("{databaseId}", databaseId).replace("{tableId}", tableId);
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
+ updatePolygonColumn(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
+ tableId: 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 tableId = params.tableId;
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 tableId === "undefined") {
1550
+ throw new client.AppwriteException('Missing required parameter: "tableId"');
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 = "/tablesdb/{databaseId}/tables/{tableId}/columns/polygon/{key}".replace("{databaseId}", databaseId).replace("{tableId}", tableId).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
  createRelationshipColumn(paramsOrFirst, ...rest) {
1263
1581
  let params;
1264
1582
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {