appwrite-cli 22.4.0 → 22.5.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/dist/index.cjs CHANGED
@@ -65565,7 +65565,7 @@ var id_default = ID;
65565
65565
  // lib/constants.ts
65566
65566
  var SDK_TITLE = "Appwrite";
65567
65567
  var SDK_TITLE_LOWER = "appwrite";
65568
- var SDK_VERSION = "22.4.0";
65568
+ var SDK_VERSION = "22.5.0";
65569
65569
  var SDK_LOGO = "\n _ _ _ ___ __ _____\n /_\\ _ __ _ ____ ___ __(_) |_ ___ / __\\ / / \\_ \\\n //_\\\\| '_ \\| '_ \\ \\ /\\ / / '__| | __/ _ \\ / / / / / /\\/\n / _ \\ |_) | |_) \\ V V /| | | | || __/ / /___/ /___/\\/ /_\n \\_/ \\_/ .__/| .__/ \\_/\\_/ |_| |_|\\__\\___| \\____/\\____/\\____/\n |_| |_|\n\n";
65570
65570
  var EXECUTABLE_NAME = "appwrite";
65571
65571
  var UPDATE_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
@@ -80712,6 +80712,9 @@ Query.distanceEqual = (attribute, values, distance, meters = true) => new Query(
80712
80712
  Query.distanceNotEqual = (attribute, values, distance, meters = true) => new Query("distanceNotEqual", attribute, [[values, distance, meters]]).toString();
80713
80713
  Query.distanceGreaterThan = (attribute, values, distance, meters = true) => new Query("distanceGreaterThan", attribute, [[values, distance, meters]]).toString();
80714
80714
  Query.distanceLessThan = (attribute, values, distance, meters = true) => new Query("distanceLessThan", attribute, [[values, distance, meters]]).toString();
80715
+ Query.vectorDot = (attribute, vector) => new Query("vectorDot", attribute, [vector]).toString();
80716
+ Query.vectorCosine = (attribute, vector) => new Query("vectorCosine", attribute, [vector]).toString();
80717
+ Query.vectorEuclidean = (attribute, vector) => new Query("vectorEuclidean", attribute, [vector]).toString();
80715
80718
  Query.intersects = (attribute, values) => new Query("intersects", attribute, [values]).toString();
80716
80719
  Query.notIntersects = (attribute, values) => new Query("notIntersects", attribute, [values]).toString();
80717
80720
  Query.crosses = (attribute, values) => new Query("crosses", attribute, [values]).toString();
@@ -80776,6 +80779,7 @@ var Client = class _Client {
80776
80779
  project: "",
80777
80780
  key: "",
80778
80781
  jwt: "",
80782
+ bearer: "",
80779
80783
  locale: "",
80780
80784
  mode: "",
80781
80785
  cookie: "",
@@ -80792,7 +80796,7 @@ var Client = class _Client {
80792
80796
  "x-sdk-name": "Console",
80793
80797
  "x-sdk-platform": "console",
80794
80798
  "x-sdk-language": "web",
80795
- "x-sdk-version": "15.1.1",
80799
+ "x-sdk-version": "15.2.0",
80796
80800
  "X-Appwrite-Response-Format": "1.9.5"
80797
80801
  };
80798
80802
  this.realtime = {
@@ -80843,7 +80847,10 @@ var Client = class _Client {
80843
80847
  return;
80844
80848
  }
80845
80849
  const encodedProject = encodeURIComponent((_b = this.config.project) !== null && _b !== void 0 ? _b : "");
80846
- const queryParams = "project=" + encodedProject;
80850
+ let queryParams = "project=" + encodedProject;
80851
+ if (this.config.jwt) {
80852
+ queryParams += "&jwt=" + encodeURIComponent(this.config.jwt);
80853
+ }
80847
80854
  const url2 = this.config.endpointRealtime + "/realtime?" + queryParams;
80848
80855
  if (url2 !== this.realtime.url || // Check if URL is present
80849
80856
  !this.realtime.socket || // Check if WebSocket has not been created
@@ -81099,6 +81106,20 @@ var Client = class _Client {
81099
81106
  this.config.jwt = value;
81100
81107
  return this;
81101
81108
  }
81109
+ /**
81110
+ * Set Bearer
81111
+ *
81112
+ * The OAuth access token to authenticate with
81113
+ *
81114
+ * @param value string
81115
+ *
81116
+ * @return {this}
81117
+ */
81118
+ setBearer(value) {
81119
+ this.headers["Authorization"] = value;
81120
+ this.config.bearer = value;
81121
+ return this;
81122
+ }
81102
81123
  /**
81103
81124
  * Set Locale
81104
81125
  *
@@ -81470,7 +81491,7 @@ var Client = class _Client {
81470
81491
  }
81471
81492
  call(method_1, url_1) {
81472
81493
  return __awaiter(this, arguments, void 0, function* (method, url2, headers = {}, params = {}, responseType = "json") {
81473
- var _a4, _b;
81494
+ var _a4, _b, _c;
81474
81495
  const { uri, options } = this.prepareRequest(method, url2, headers, params);
81475
81496
  let data = null;
81476
81497
  const response = yield fetch(uri, options);
@@ -81497,7 +81518,7 @@ var Client = class _Client {
81497
81518
  } else {
81498
81519
  responseText = data === null || data === void 0 ? void 0 : data.message;
81499
81520
  }
81500
- throw new AppwriteException(data === null || data === void 0 ? void 0 : data.message, response.status, data === null || data === void 0 ? void 0 : data.type, responseText);
81521
+ throw new AppwriteException((_c = data === null || data === void 0 ? void 0 : data.message) !== null && _c !== void 0 ? _c : responseText, response.status, data === null || data === void 0 ? void 0 : data.type, responseText);
81501
81522
  }
81502
81523
  const cookieFallback = response.headers.get("X-Fallback-Cookies");
81503
81524
  if (typeof window !== "undefined" && window.localStorage && cookieFallback && this.shouldUseFallbackCredentials(url2)) {
@@ -81595,6 +81616,38 @@ var Console = class {
81595
81616
  };
81596
81617
  return this.client.call("get", uri, apiHeaders, payload);
81597
81618
  }
81619
+ listDatabases(paramsOrFirst, ...rest) {
81620
+ let params;
81621
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
81622
+ params = paramsOrFirst || {};
81623
+ } else {
81624
+ params = {
81625
+ queries: paramsOrFirst,
81626
+ search: rest[0],
81627
+ total: rest[1]
81628
+ };
81629
+ }
81630
+ const queries = params.queries;
81631
+ const search = params.search;
81632
+ const total = params.total;
81633
+ const apiPath = "/console/databases";
81634
+ const payload = {};
81635
+ if (typeof queries !== "undefined") {
81636
+ payload["queries"] = queries;
81637
+ }
81638
+ if (typeof search !== "undefined") {
81639
+ payload["search"] = search;
81640
+ }
81641
+ if (typeof total !== "undefined") {
81642
+ payload["total"] = total;
81643
+ }
81644
+ const uri = new URL(this.client.config.endpoint + apiPath);
81645
+ const apiHeaders = {
81646
+ "X-Appwrite-Project": this.client.config.project,
81647
+ "accept": "application/json"
81648
+ };
81649
+ return this.client.call("get", uri, apiHeaders, payload);
81650
+ }
81598
81651
  /**
81599
81652
  * List all OAuth2 providers supported by the Appwrite server, along with the parameters required to configure each provider. The response excludes mock providers but includes sandbox providers.
81600
81653
  *
@@ -81655,6 +81708,23 @@ var Console = class {
81655
81708
  };
81656
81709
  return this.client.call("get", uri, apiHeaders, payload);
81657
81710
  }
81711
+ /**
81712
+ * Get the catalog of Postgres extensions that can be installed on a dedicated Postgres database.
81713
+ *
81714
+ *
81715
+ * @throws {AppwriteException}
81716
+ * @returns {Promise<Models.PostgresExtensionList>}
81717
+ */
81718
+ listPostgresExtensions() {
81719
+ const apiPath = "/console/postgres-extensions";
81720
+ const payload = {};
81721
+ const uri = new URL(this.client.config.endpoint + apiPath);
81722
+ const apiHeaders = {
81723
+ "X-Appwrite-Project": this.client.config.project,
81724
+ "accept": "application/json"
81725
+ };
81726
+ return this.client.call("get", uri, apiHeaders, payload);
81727
+ }
81658
81728
  getProgram(paramsOrFirst) {
81659
81729
  let params;
81660
81730
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -85119,43 +85189,6 @@ var Databases = class {
85119
85189
  };
85120
85190
  return this.client.call("delete", uri, apiHeaders, payload);
85121
85191
  }
85122
- listDocumentLogs(paramsOrFirst, ...rest) {
85123
- let params;
85124
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
85125
- params = paramsOrFirst || {};
85126
- } else {
85127
- params = {
85128
- databaseId: paramsOrFirst,
85129
- collectionId: rest[0],
85130
- documentId: rest[1],
85131
- queries: rest[2]
85132
- };
85133
- }
85134
- const databaseId = params.databaseId;
85135
- const collectionId = params.collectionId;
85136
- const documentId = params.documentId;
85137
- const queries = params.queries;
85138
- if (typeof databaseId === "undefined") {
85139
- throw new AppwriteException('Missing required parameter: "databaseId"');
85140
- }
85141
- if (typeof collectionId === "undefined") {
85142
- throw new AppwriteException('Missing required parameter: "collectionId"');
85143
- }
85144
- if (typeof documentId === "undefined") {
85145
- throw new AppwriteException('Missing required parameter: "documentId"');
85146
- }
85147
- const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/logs".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{collectionId}", encodeURIComponent(String(collectionId))).replace("{documentId}", encodeURIComponent(String(documentId)));
85148
- const payload = {};
85149
- if (typeof queries !== "undefined") {
85150
- payload["queries"] = queries;
85151
- }
85152
- const uri = new URL(this.client.config.endpoint + apiPath);
85153
- const apiHeaders = {
85154
- "X-Appwrite-Project": this.client.config.project,
85155
- "accept": "application/json"
85156
- };
85157
- return this.client.call("get", uri, apiHeaders, payload);
85158
- }
85159
85192
  decrementDocumentAttribute(paramsOrFirst, ...rest) {
85160
85193
  let params;
85161
85194
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -85425,38 +85458,6 @@ var Databases = class {
85425
85458
  };
85426
85459
  return this.client.call("delete", uri, apiHeaders, payload);
85427
85460
  }
85428
- listCollectionLogs(paramsOrFirst, ...rest) {
85429
- let params;
85430
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
85431
- params = paramsOrFirst || {};
85432
- } else {
85433
- params = {
85434
- databaseId: paramsOrFirst,
85435
- collectionId: rest[0],
85436
- queries: rest[1]
85437
- };
85438
- }
85439
- const databaseId = params.databaseId;
85440
- const collectionId = params.collectionId;
85441
- const queries = params.queries;
85442
- if (typeof databaseId === "undefined") {
85443
- throw new AppwriteException('Missing required parameter: "databaseId"');
85444
- }
85445
- if (typeof collectionId === "undefined") {
85446
- throw new AppwriteException('Missing required parameter: "collectionId"');
85447
- }
85448
- const apiPath = "/databases/{databaseId}/collections/{collectionId}/logs".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{collectionId}", encodeURIComponent(String(collectionId)));
85449
- const payload = {};
85450
- if (typeof queries !== "undefined") {
85451
- payload["queries"] = queries;
85452
- }
85453
- const uri = new URL(this.client.config.endpoint + apiPath);
85454
- const apiHeaders = {
85455
- "X-Appwrite-Project": this.client.config.project,
85456
- "accept": "application/json"
85457
- };
85458
- return this.client.call("get", uri, apiHeaders, payload);
85459
- }
85460
85461
  getCollectionUsage(paramsOrFirst, ...rest) {
85461
85462
  let params;
85462
85463
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -85489,33 +85490,6 @@ var Databases = class {
85489
85490
  };
85490
85491
  return this.client.call("get", uri, apiHeaders, payload);
85491
85492
  }
85492
- listLogs(paramsOrFirst, ...rest) {
85493
- let params;
85494
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
85495
- params = paramsOrFirst || {};
85496
- } else {
85497
- params = {
85498
- databaseId: paramsOrFirst,
85499
- queries: rest[0]
85500
- };
85501
- }
85502
- const databaseId = params.databaseId;
85503
- const queries = params.queries;
85504
- if (typeof databaseId === "undefined") {
85505
- throw new AppwriteException('Missing required parameter: "databaseId"');
85506
- }
85507
- const apiPath = "/databases/{databaseId}/logs".replace("{databaseId}", encodeURIComponent(String(databaseId)));
85508
- const payload = {};
85509
- if (typeof queries !== "undefined") {
85510
- payload["queries"] = queries;
85511
- }
85512
- const uri = new URL(this.client.config.endpoint + apiPath);
85513
- const apiHeaders = {
85514
- "X-Appwrite-Project": this.client.config.project,
85515
- "accept": "application/json"
85516
- };
85517
- return this.client.call("get", uri, apiHeaders, payload);
85518
- }
85519
85493
  getUsage(paramsOrFirst, ...rest) {
85520
85494
  let params;
85521
85495
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -87448,38 +87422,6 @@ var Messaging = class {
87448
87422
  };
87449
87423
  return this.client.call("delete", uri, apiHeaders, payload);
87450
87424
  }
87451
- listMessageLogs(paramsOrFirst, ...rest) {
87452
- let params;
87453
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
87454
- params = paramsOrFirst || {};
87455
- } else {
87456
- params = {
87457
- messageId: paramsOrFirst,
87458
- queries: rest[0],
87459
- total: rest[1]
87460
- };
87461
- }
87462
- const messageId = params.messageId;
87463
- const queries = params.queries;
87464
- const total = params.total;
87465
- if (typeof messageId === "undefined") {
87466
- throw new AppwriteException('Missing required parameter: "messageId"');
87467
- }
87468
- const apiPath = "/messaging/messages/{messageId}/logs".replace("{messageId}", encodeURIComponent(String(messageId)));
87469
- const payload = {};
87470
- if (typeof queries !== "undefined") {
87471
- payload["queries"] = queries;
87472
- }
87473
- if (typeof total !== "undefined") {
87474
- payload["total"] = total;
87475
- }
87476
- const uri = new URL(this.client.config.endpoint + apiPath);
87477
- const apiHeaders = {
87478
- "X-Appwrite-Project": this.client.config.project,
87479
- "accept": "application/json"
87480
- };
87481
- return this.client.call("get", uri, apiHeaders, payload);
87482
- }
87483
87425
  listTargets(paramsOrFirst, ...rest) {
87484
87426
  let params;
87485
87427
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -89404,70 +89346,6 @@ var Messaging = class {
89404
89346
  };
89405
89347
  return this.client.call("delete", uri, apiHeaders, payload);
89406
89348
  }
89407
- listProviderLogs(paramsOrFirst, ...rest) {
89408
- let params;
89409
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
89410
- params = paramsOrFirst || {};
89411
- } else {
89412
- params = {
89413
- providerId: paramsOrFirst,
89414
- queries: rest[0],
89415
- total: rest[1]
89416
- };
89417
- }
89418
- const providerId = params.providerId;
89419
- const queries = params.queries;
89420
- const total = params.total;
89421
- if (typeof providerId === "undefined") {
89422
- throw new AppwriteException('Missing required parameter: "providerId"');
89423
- }
89424
- const apiPath = "/messaging/providers/{providerId}/logs".replace("{providerId}", encodeURIComponent(String(providerId)));
89425
- const payload = {};
89426
- if (typeof queries !== "undefined") {
89427
- payload["queries"] = queries;
89428
- }
89429
- if (typeof total !== "undefined") {
89430
- payload["total"] = total;
89431
- }
89432
- const uri = new URL(this.client.config.endpoint + apiPath);
89433
- const apiHeaders = {
89434
- "X-Appwrite-Project": this.client.config.project,
89435
- "accept": "application/json"
89436
- };
89437
- return this.client.call("get", uri, apiHeaders, payload);
89438
- }
89439
- listSubscriberLogs(paramsOrFirst, ...rest) {
89440
- let params;
89441
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
89442
- params = paramsOrFirst || {};
89443
- } else {
89444
- params = {
89445
- subscriberId: paramsOrFirst,
89446
- queries: rest[0],
89447
- total: rest[1]
89448
- };
89449
- }
89450
- const subscriberId = params.subscriberId;
89451
- const queries = params.queries;
89452
- const total = params.total;
89453
- if (typeof subscriberId === "undefined") {
89454
- throw new AppwriteException('Missing required parameter: "subscriberId"');
89455
- }
89456
- const apiPath = "/messaging/subscribers/{subscriberId}/logs".replace("{subscriberId}", encodeURIComponent(String(subscriberId)));
89457
- const payload = {};
89458
- if (typeof queries !== "undefined") {
89459
- payload["queries"] = queries;
89460
- }
89461
- if (typeof total !== "undefined") {
89462
- payload["total"] = total;
89463
- }
89464
- const uri = new URL(this.client.config.endpoint + apiPath);
89465
- const apiHeaders = {
89466
- "X-Appwrite-Project": this.client.config.project,
89467
- "accept": "application/json"
89468
- };
89469
- return this.client.call("get", uri, apiHeaders, payload);
89470
- }
89471
89349
  listTopics(paramsOrFirst, ...rest) {
89472
89350
  let params;
89473
89351
  if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -89616,38 +89494,6 @@ var Messaging = class {
89616
89494
  };
89617
89495
  return this.client.call("delete", uri, apiHeaders, payload);
89618
89496
  }
89619
- listTopicLogs(paramsOrFirst, ...rest) {
89620
- let params;
89621
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
89622
- params = paramsOrFirst || {};
89623
- } else {
89624
- params = {
89625
- topicId: paramsOrFirst,
89626
- queries: rest[0],
89627
- total: rest[1]
89628
- };
89629
- }
89630
- const topicId = params.topicId;
89631
- const queries = params.queries;
89632
- const total = params.total;
89633
- if (typeof topicId === "undefined") {
89634
- throw new AppwriteException('Missing required parameter: "topicId"');
89635
- }
89636
- const apiPath = "/messaging/topics/{topicId}/logs".replace("{topicId}", encodeURIComponent(String(topicId)));
89637
- const payload = {};
89638
- if (typeof queries !== "undefined") {
89639
- payload["queries"] = queries;
89640
- }
89641
- if (typeof total !== "undefined") {
89642
- payload["total"] = total;
89643
- }
89644
- const uri = new URL(this.client.config.endpoint + apiPath);
89645
- const apiHeaders = {
89646
- "X-Appwrite-Project": this.client.config.project,
89647
- "accept": "application/json"
89648
- };
89649
- return this.client.call("get", uri, apiHeaders, payload);
89650
- }
89651
89497
  listSubscribers(paramsOrFirst, ...rest) {
89652
89498
  let params;
89653
89499
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -89790,11 +89636,13 @@ var Oauth2 = class {
89790
89636
  } else {
89791
89637
  params = {
89792
89638
  grantId: paramsOrFirst,
89793
- authorizationDetails: rest[0]
89639
+ authorizationDetails: rest[0],
89640
+ scope: rest[1]
89794
89641
  };
89795
89642
  }
89796
89643
  const grantId = params.grantId;
89797
89644
  const authorizationDetails = params.authorizationDetails;
89645
+ const scope = params.scope;
89798
89646
  if (typeof grantId === "undefined") {
89799
89647
  throw new AppwriteException('Missing required parameter: "grantId"');
89800
89648
  }
@@ -89806,6 +89654,9 @@ var Oauth2 = class {
89806
89654
  if (typeof authorizationDetails !== "undefined") {
89807
89655
  payload["authorization_details"] = authorizationDetails;
89808
89656
  }
89657
+ if (typeof scope !== "undefined") {
89658
+ payload["scope"] = scope;
89659
+ }
89809
89660
  const uri = new URL(this.client.config.endpoint + apiPath);
89810
89661
  const apiHeaders = {
89811
89662
  "content-type": "application/json",
@@ -89815,7 +89666,7 @@ var Oauth2 = class {
89815
89666
  }
89816
89667
  authorize(paramsOrFirst, ...rest) {
89817
89668
  let params;
89818
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
89669
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
89819
89670
  params = paramsOrFirst || {};
89820
89671
  } else {
89821
89672
  params = {
@@ -89830,7 +89681,8 @@ var Oauth2 = class {
89830
89681
  prompt: rest[7],
89831
89682
  maxAge: rest[8],
89832
89683
  authorizationDetails: rest[9],
89833
- resource: rest[10]
89684
+ resource: rest[10],
89685
+ requestUri: rest[11]
89834
89686
  };
89835
89687
  }
89836
89688
  const clientId = params.clientId;
@@ -89845,18 +89697,7 @@ var Oauth2 = class {
89845
89697
  const maxAge = params.maxAge;
89846
89698
  const authorizationDetails = params.authorizationDetails;
89847
89699
  const resource = params.resource;
89848
- if (typeof clientId === "undefined") {
89849
- throw new AppwriteException('Missing required parameter: "clientId"');
89850
- }
89851
- if (typeof redirectUri === "undefined") {
89852
- throw new AppwriteException('Missing required parameter: "redirectUri"');
89853
- }
89854
- if (typeof responseType === "undefined") {
89855
- throw new AppwriteException('Missing required parameter: "responseType"');
89856
- }
89857
- if (typeof scope === "undefined") {
89858
- throw new AppwriteException('Missing required parameter: "scope"');
89859
- }
89700
+ const requestUri = params.requestUri;
89860
89701
  const apiPath = "/oauth2/{project_id}/authorize".replace("{project_id}", encodeURIComponent(String(this.client.config.project)));
89861
89702
  const payload = {};
89862
89703
  if (typeof clientId !== "undefined") {
@@ -89895,6 +89736,9 @@ var Oauth2 = class {
89895
89736
  if (typeof resource !== "undefined") {
89896
89737
  payload["resource"] = resource;
89897
89738
  }
89739
+ if (typeof requestUri !== "undefined") {
89740
+ payload["request_uri"] = requestUri;
89741
+ }
89898
89742
  const uri = new URL(this.client.config.endpoint + apiPath);
89899
89743
  const apiHeaders = {
89900
89744
  "accept": "application/json"
@@ -90030,6 +89874,157 @@ var Oauth2 = class {
90030
89874
  };
90031
89875
  return this.client.call("get", uri, apiHeaders, payload);
90032
89876
  }
89877
+ listOrganizations(paramsOrFirst, ...rest) {
89878
+ let params;
89879
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
89880
+ params = paramsOrFirst || {};
89881
+ } else {
89882
+ params = {
89883
+ limit: paramsOrFirst,
89884
+ offset: rest[0],
89885
+ search: rest[1]
89886
+ };
89887
+ }
89888
+ const limit = params.limit;
89889
+ const offset = params.offset;
89890
+ const search = params.search;
89891
+ const apiPath = "/oauth2/{project_id}/organizations".replace("{project_id}", encodeURIComponent(String(this.client.config.project)));
89892
+ const payload = {};
89893
+ if (typeof limit !== "undefined") {
89894
+ payload["limit"] = limit;
89895
+ }
89896
+ if (typeof offset !== "undefined") {
89897
+ payload["offset"] = offset;
89898
+ }
89899
+ if (typeof search !== "undefined") {
89900
+ payload["search"] = search;
89901
+ }
89902
+ const uri = new URL(this.client.config.endpoint + apiPath);
89903
+ const apiHeaders = {
89904
+ "accept": "application/json"
89905
+ };
89906
+ return this.client.call("get", uri, apiHeaders, payload);
89907
+ }
89908
+ createPAR(paramsOrFirst, ...rest) {
89909
+ let params;
89910
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
89911
+ params = paramsOrFirst || {};
89912
+ } else {
89913
+ params = {
89914
+ clientId: paramsOrFirst,
89915
+ redirectUri: rest[0],
89916
+ responseType: rest[1],
89917
+ scope: rest[2],
89918
+ state: rest[3],
89919
+ nonce: rest[4],
89920
+ codeChallenge: rest[5],
89921
+ codeChallengeMethod: rest[6],
89922
+ prompt: rest[7],
89923
+ maxAge: rest[8],
89924
+ authorizationDetails: rest[9],
89925
+ resource: rest[10]
89926
+ };
89927
+ }
89928
+ const clientId = params.clientId;
89929
+ const redirectUri = params.redirectUri;
89930
+ const responseType = params.responseType;
89931
+ const scope = params.scope;
89932
+ const state = params.state;
89933
+ const nonce = params.nonce;
89934
+ const codeChallenge = params.codeChallenge;
89935
+ const codeChallengeMethod = params.codeChallengeMethod;
89936
+ const prompt = params.prompt;
89937
+ const maxAge = params.maxAge;
89938
+ const authorizationDetails = params.authorizationDetails;
89939
+ const resource = params.resource;
89940
+ if (typeof clientId === "undefined") {
89941
+ throw new AppwriteException('Missing required parameter: "clientId"');
89942
+ }
89943
+ if (typeof redirectUri === "undefined") {
89944
+ throw new AppwriteException('Missing required parameter: "redirectUri"');
89945
+ }
89946
+ if (typeof responseType === "undefined") {
89947
+ throw new AppwriteException('Missing required parameter: "responseType"');
89948
+ }
89949
+ if (typeof scope === "undefined") {
89950
+ throw new AppwriteException('Missing required parameter: "scope"');
89951
+ }
89952
+ const apiPath = "/oauth2/{project_id}/par".replace("{project_id}", encodeURIComponent(String(this.client.config.project)));
89953
+ const payload = {};
89954
+ if (typeof clientId !== "undefined") {
89955
+ payload["client_id"] = clientId;
89956
+ }
89957
+ if (typeof redirectUri !== "undefined") {
89958
+ payload["redirect_uri"] = redirectUri;
89959
+ }
89960
+ if (typeof responseType !== "undefined") {
89961
+ payload["response_type"] = responseType;
89962
+ }
89963
+ if (typeof scope !== "undefined") {
89964
+ payload["scope"] = scope;
89965
+ }
89966
+ if (typeof state !== "undefined") {
89967
+ payload["state"] = state;
89968
+ }
89969
+ if (typeof nonce !== "undefined") {
89970
+ payload["nonce"] = nonce;
89971
+ }
89972
+ if (typeof codeChallenge !== "undefined") {
89973
+ payload["code_challenge"] = codeChallenge;
89974
+ }
89975
+ if (typeof codeChallengeMethod !== "undefined") {
89976
+ payload["code_challenge_method"] = codeChallengeMethod;
89977
+ }
89978
+ if (typeof prompt !== "undefined") {
89979
+ payload["prompt"] = prompt;
89980
+ }
89981
+ if (typeof maxAge !== "undefined") {
89982
+ payload["max_age"] = maxAge;
89983
+ }
89984
+ if (typeof authorizationDetails !== "undefined") {
89985
+ payload["authorization_details"] = authorizationDetails;
89986
+ }
89987
+ if (typeof resource !== "undefined") {
89988
+ payload["resource"] = resource;
89989
+ }
89990
+ const uri = new URL(this.client.config.endpoint + apiPath);
89991
+ const apiHeaders = {
89992
+ "content-type": "application/json",
89993
+ "accept": "application/json"
89994
+ };
89995
+ return this.client.call("post", uri, apiHeaders, payload);
89996
+ }
89997
+ listProjects(paramsOrFirst, ...rest) {
89998
+ let params;
89999
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
90000
+ params = paramsOrFirst || {};
90001
+ } else {
90002
+ params = {
90003
+ limit: paramsOrFirst,
90004
+ offset: rest[0],
90005
+ search: rest[1]
90006
+ };
90007
+ }
90008
+ const limit = params.limit;
90009
+ const offset = params.offset;
90010
+ const search = params.search;
90011
+ const apiPath = "/oauth2/{project_id}/projects".replace("{project_id}", encodeURIComponent(String(this.client.config.project)));
90012
+ const payload = {};
90013
+ if (typeof limit !== "undefined") {
90014
+ payload["limit"] = limit;
90015
+ }
90016
+ if (typeof offset !== "undefined") {
90017
+ payload["offset"] = offset;
90018
+ }
90019
+ if (typeof search !== "undefined") {
90020
+ payload["search"] = search;
90021
+ }
90022
+ const uri = new URL(this.client.config.endpoint + apiPath);
90023
+ const apiHeaders = {
90024
+ "accept": "application/json"
90025
+ };
90026
+ return this.client.call("get", uri, apiHeaders, payload);
90027
+ }
90033
90028
  reject(paramsOrFirst) {
90034
90029
  let params;
90035
90030
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -90165,6 +90160,64 @@ var Organization = class {
90165
90160
  constructor(client) {
90166
90161
  this.client = client;
90167
90162
  }
90163
+ /**
90164
+ * Get the current organization.
90165
+ *
90166
+ * @throws {AppwriteException}
90167
+ * @returns {Promise<Models.Organization<Preferences>>}
90168
+ */
90169
+ get() {
90170
+ const apiPath = "/organization";
90171
+ const payload = {};
90172
+ const uri = new URL(this.client.config.endpoint + apiPath);
90173
+ const apiHeaders = {
90174
+ "X-Appwrite-Project": this.client.config.project,
90175
+ "accept": "application/json"
90176
+ };
90177
+ return this.client.call("get", uri, apiHeaders, payload);
90178
+ }
90179
+ update(paramsOrFirst) {
90180
+ let params;
90181
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
90182
+ params = paramsOrFirst || {};
90183
+ } else {
90184
+ params = {
90185
+ name: paramsOrFirst
90186
+ };
90187
+ }
90188
+ const name = params.name;
90189
+ if (typeof name === "undefined") {
90190
+ throw new AppwriteException('Missing required parameter: "name"');
90191
+ }
90192
+ const apiPath = "/organization";
90193
+ const payload = {};
90194
+ if (typeof name !== "undefined") {
90195
+ payload["name"] = name;
90196
+ }
90197
+ const uri = new URL(this.client.config.endpoint + apiPath);
90198
+ const apiHeaders = {
90199
+ "X-Appwrite-Project": this.client.config.project,
90200
+ "content-type": "application/json",
90201
+ "accept": "application/json"
90202
+ };
90203
+ return this.client.call("put", uri, apiHeaders, payload);
90204
+ }
90205
+ /**
90206
+ * Delete the current organization. All projects that belong to the organization are deleted as well.
90207
+ *
90208
+ * @throws {AppwriteException}
90209
+ * @returns {Promise<{}>}
90210
+ */
90211
+ delete() {
90212
+ const apiPath = "/organization";
90213
+ const payload = {};
90214
+ const uri = new URL(this.client.config.endpoint + apiPath);
90215
+ const apiHeaders = {
90216
+ "X-Appwrite-Project": this.client.config.project,
90217
+ "content-type": "application/json"
90218
+ };
90219
+ return this.client.call("delete", uri, apiHeaders, payload);
90220
+ }
90168
90221
  listKeys(paramsOrFirst, ...rest) {
90169
90222
  let params;
90170
90223
  if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -90327,6 +90380,164 @@ var Organization = class {
90327
90380
  };
90328
90381
  return this.client.call("delete", uri, apiHeaders, payload);
90329
90382
  }
90383
+ listMemberships(paramsOrFirst, ...rest) {
90384
+ let params;
90385
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
90386
+ params = paramsOrFirst || {};
90387
+ } else {
90388
+ params = {
90389
+ queries: paramsOrFirst,
90390
+ search: rest[0],
90391
+ total: rest[1]
90392
+ };
90393
+ }
90394
+ const queries = params.queries;
90395
+ const search = params.search;
90396
+ const total = params.total;
90397
+ const apiPath = "/organization/memberships";
90398
+ const payload = {};
90399
+ if (typeof queries !== "undefined") {
90400
+ payload["queries"] = queries;
90401
+ }
90402
+ if (typeof search !== "undefined") {
90403
+ payload["search"] = search;
90404
+ }
90405
+ if (typeof total !== "undefined") {
90406
+ payload["total"] = total;
90407
+ }
90408
+ const uri = new URL(this.client.config.endpoint + apiPath);
90409
+ const apiHeaders = {
90410
+ "X-Appwrite-Project": this.client.config.project,
90411
+ "accept": "application/json"
90412
+ };
90413
+ return this.client.call("get", uri, apiHeaders, payload);
90414
+ }
90415
+ createMembership(paramsOrFirst, ...rest) {
90416
+ let params;
90417
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
90418
+ params = paramsOrFirst || {};
90419
+ } else {
90420
+ params = {
90421
+ roles: paramsOrFirst,
90422
+ email: rest[0],
90423
+ userId: rest[1],
90424
+ phone: rest[2],
90425
+ url: rest[3],
90426
+ name: rest[4]
90427
+ };
90428
+ }
90429
+ const roles = params.roles;
90430
+ const email3 = params.email;
90431
+ const userId = params.userId;
90432
+ const phone = params.phone;
90433
+ const url2 = params.url;
90434
+ const name = params.name;
90435
+ if (typeof roles === "undefined") {
90436
+ throw new AppwriteException('Missing required parameter: "roles"');
90437
+ }
90438
+ const apiPath = "/organization/memberships";
90439
+ const payload = {};
90440
+ if (typeof email3 !== "undefined") {
90441
+ payload["email"] = email3;
90442
+ }
90443
+ if (typeof userId !== "undefined") {
90444
+ payload["userId"] = userId;
90445
+ }
90446
+ if (typeof phone !== "undefined") {
90447
+ payload["phone"] = phone;
90448
+ }
90449
+ if (typeof roles !== "undefined") {
90450
+ payload["roles"] = roles;
90451
+ }
90452
+ if (typeof url2 !== "undefined") {
90453
+ payload["url"] = url2;
90454
+ }
90455
+ if (typeof name !== "undefined") {
90456
+ payload["name"] = name;
90457
+ }
90458
+ const uri = new URL(this.client.config.endpoint + apiPath);
90459
+ const apiHeaders = {
90460
+ "X-Appwrite-Project": this.client.config.project,
90461
+ "content-type": "application/json",
90462
+ "accept": "application/json"
90463
+ };
90464
+ return this.client.call("post", uri, apiHeaders, payload);
90465
+ }
90466
+ getMembership(paramsOrFirst) {
90467
+ let params;
90468
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
90469
+ params = paramsOrFirst || {};
90470
+ } else {
90471
+ params = {
90472
+ membershipId: paramsOrFirst
90473
+ };
90474
+ }
90475
+ const membershipId = params.membershipId;
90476
+ if (typeof membershipId === "undefined") {
90477
+ throw new AppwriteException('Missing required parameter: "membershipId"');
90478
+ }
90479
+ const apiPath = "/organization/memberships/{membershipId}".replace("{membershipId}", encodeURIComponent(String(membershipId)));
90480
+ const payload = {};
90481
+ const uri = new URL(this.client.config.endpoint + apiPath);
90482
+ const apiHeaders = {
90483
+ "X-Appwrite-Project": this.client.config.project,
90484
+ "accept": "application/json"
90485
+ };
90486
+ return this.client.call("get", uri, apiHeaders, payload);
90487
+ }
90488
+ updateMembership(paramsOrFirst, ...rest) {
90489
+ let params;
90490
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
90491
+ params = paramsOrFirst || {};
90492
+ } else {
90493
+ params = {
90494
+ membershipId: paramsOrFirst,
90495
+ roles: rest[0]
90496
+ };
90497
+ }
90498
+ const membershipId = params.membershipId;
90499
+ const roles = params.roles;
90500
+ if (typeof membershipId === "undefined") {
90501
+ throw new AppwriteException('Missing required parameter: "membershipId"');
90502
+ }
90503
+ if (typeof roles === "undefined") {
90504
+ throw new AppwriteException('Missing required parameter: "roles"');
90505
+ }
90506
+ const apiPath = "/organization/memberships/{membershipId}".replace("{membershipId}", encodeURIComponent(String(membershipId)));
90507
+ const payload = {};
90508
+ if (typeof roles !== "undefined") {
90509
+ payload["roles"] = roles;
90510
+ }
90511
+ const uri = new URL(this.client.config.endpoint + apiPath);
90512
+ const apiHeaders = {
90513
+ "X-Appwrite-Project": this.client.config.project,
90514
+ "content-type": "application/json",
90515
+ "accept": "application/json"
90516
+ };
90517
+ return this.client.call("patch", uri, apiHeaders, payload);
90518
+ }
90519
+ deleteMembership(paramsOrFirst) {
90520
+ let params;
90521
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
90522
+ params = paramsOrFirst || {};
90523
+ } else {
90524
+ params = {
90525
+ membershipId: paramsOrFirst
90526
+ };
90527
+ }
90528
+ const membershipId = params.membershipId;
90529
+ if (typeof membershipId === "undefined") {
90530
+ throw new AppwriteException('Missing required parameter: "membershipId"');
90531
+ }
90532
+ const apiPath = "/organization/memberships/{membershipId}".replace("{membershipId}", encodeURIComponent(String(membershipId)));
90533
+ const payload = {};
90534
+ const uri = new URL(this.client.config.endpoint + apiPath);
90535
+ const apiHeaders = {
90536
+ "X-Appwrite-Project": this.client.config.project,
90537
+ "content-type": "application/json"
90538
+ };
90539
+ return this.client.call("delete", uri, apiHeaders, payload);
90540
+ }
90330
90541
  listProjects(paramsOrFirst, ...rest) {
90331
90542
  let params;
90332
90543
  if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -90695,6 +90906,29 @@ var Organizations = class {
90695
90906
  };
90696
90907
  return this.client.call("post", uri, apiHeaders, payload);
90697
90908
  }
90909
+ createPremiumGeoDBAddon(paramsOrFirst) {
90910
+ let params;
90911
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
90912
+ params = paramsOrFirst || {};
90913
+ } else {
90914
+ params = {
90915
+ organizationId: paramsOrFirst
90916
+ };
90917
+ }
90918
+ const organizationId = params.organizationId;
90919
+ if (typeof organizationId === "undefined") {
90920
+ throw new AppwriteException('Missing required parameter: "organizationId"');
90921
+ }
90922
+ const apiPath = "/organizations/{organizationId}/addons/premium-geo-db".replace("{organizationId}", encodeURIComponent(String(organizationId)));
90923
+ const payload = {};
90924
+ const uri = new URL(this.client.config.endpoint + apiPath);
90925
+ const apiHeaders = {
90926
+ "X-Appwrite-Project": this.client.config.project,
90927
+ "content-type": "application/json",
90928
+ "accept": "application/json"
90929
+ };
90930
+ return this.client.call("post", uri, apiHeaders, payload);
90931
+ }
90698
90932
  getAddon(paramsOrFirst, ...rest) {
90699
90933
  let params;
90700
90934
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -93240,7 +93474,9 @@ var Project = class {
93240
93474
  authorizationURL: rest[2],
93241
93475
  tokenURL: rest[3],
93242
93476
  userInfoURL: rest[4],
93243
- enabled: rest[5]
93477
+ prompt: rest[5],
93478
+ maxAge: rest[6],
93479
+ enabled: rest[7]
93244
93480
  };
93245
93481
  }
93246
93482
  const clientId = params.clientId;
@@ -93249,6 +93485,8 @@ var Project = class {
93249
93485
  const authorizationURL = params.authorizationURL;
93250
93486
  const tokenURL = params.tokenURL;
93251
93487
  const userInfoURL = params.userInfoURL;
93488
+ const prompt = params.prompt;
93489
+ const maxAge = params.maxAge;
93252
93490
  const enabled = params.enabled;
93253
93491
  const apiPath = "/project/oauth2/oidc";
93254
93492
  const payload = {};
@@ -93270,6 +93508,12 @@ var Project = class {
93270
93508
  if (typeof userInfoURL !== "undefined") {
93271
93509
  payload["userInfoURL"] = userInfoURL;
93272
93510
  }
93511
+ if (typeof prompt !== "undefined") {
93512
+ payload["prompt"] = prompt;
93513
+ }
93514
+ if (typeof maxAge !== "undefined") {
93515
+ payload["maxAge"] = maxAge;
93516
+ }
93273
93517
  if (typeof enabled !== "undefined") {
93274
93518
  payload["enabled"] = enabled;
93275
93519
  }
@@ -97359,13 +97603,13 @@ var TablesDB = class {
97359
97603
  databaseId: paramsOrFirst,
97360
97604
  name: rest[0],
97361
97605
  enabled: rest[1],
97362
- dedicatedDatabaseId: rest[2]
97606
+ specification: rest[2]
97363
97607
  };
97364
97608
  }
97365
97609
  const databaseId = params.databaseId;
97366
97610
  const name = params.name;
97367
97611
  const enabled = params.enabled;
97368
- const dedicatedDatabaseId = params.dedicatedDatabaseId;
97612
+ const specification = params.specification;
97369
97613
  if (typeof databaseId === "undefined") {
97370
97614
  throw new AppwriteException('Missing required parameter: "databaseId"');
97371
97615
  }
@@ -97383,8 +97627,8 @@ var TablesDB = class {
97383
97627
  if (typeof enabled !== "undefined") {
97384
97628
  payload["enabled"] = enabled;
97385
97629
  }
97386
- if (typeof dedicatedDatabaseId !== "undefined") {
97387
- payload["dedicatedDatabaseId"] = dedicatedDatabaseId;
97630
+ if (typeof specification !== "undefined") {
97631
+ payload["specification"] = specification;
97388
97632
  }
97389
97633
  const uri = new URL(this.client.config.endpoint + apiPath);
97390
97634
  const apiHeaders = {
@@ -97643,6 +97887,114 @@ var TablesDB = class {
97643
97887
  };
97644
97888
  return this.client.call("delete", uri, apiHeaders, payload);
97645
97889
  }
97890
+ listMigrations(paramsOrFirst) {
97891
+ let params;
97892
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
97893
+ params = paramsOrFirst || {};
97894
+ } else {
97895
+ params = {
97896
+ databaseId: paramsOrFirst
97897
+ };
97898
+ }
97899
+ const databaseId = params.databaseId;
97900
+ if (typeof databaseId === "undefined") {
97901
+ throw new AppwriteException('Missing required parameter: "databaseId"');
97902
+ }
97903
+ const apiPath = "/tablesdb/{databaseId}/migrations".replace("{databaseId}", encodeURIComponent(String(databaseId)));
97904
+ const payload = {};
97905
+ const uri = new URL(this.client.config.endpoint + apiPath);
97906
+ const apiHeaders = {
97907
+ "X-Appwrite-Project": this.client.config.project,
97908
+ "accept": "application/json"
97909
+ };
97910
+ return this.client.call("get", uri, apiHeaders, payload);
97911
+ }
97912
+ createMigration(paramsOrFirst, ...rest) {
97913
+ let params;
97914
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
97915
+ params = paramsOrFirst || {};
97916
+ } else {
97917
+ params = {
97918
+ databaseId: paramsOrFirst,
97919
+ specification: rest[0]
97920
+ };
97921
+ }
97922
+ const databaseId = params.databaseId;
97923
+ const specification = params.specification;
97924
+ if (typeof databaseId === "undefined") {
97925
+ throw new AppwriteException('Missing required parameter: "databaseId"');
97926
+ }
97927
+ if (typeof specification === "undefined") {
97928
+ throw new AppwriteException('Missing required parameter: "specification"');
97929
+ }
97930
+ const apiPath = "/tablesdb/{databaseId}/migrations".replace("{databaseId}", encodeURIComponent(String(databaseId)));
97931
+ const payload = {};
97932
+ if (typeof specification !== "undefined") {
97933
+ payload["specification"] = specification;
97934
+ }
97935
+ const uri = new URL(this.client.config.endpoint + apiPath);
97936
+ const apiHeaders = {
97937
+ "X-Appwrite-Project": this.client.config.project,
97938
+ "content-type": "application/json",
97939
+ "accept": "application/json"
97940
+ };
97941
+ return this.client.call("post", uri, apiHeaders, payload);
97942
+ }
97943
+ getMigration(paramsOrFirst, ...rest) {
97944
+ let params;
97945
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
97946
+ params = paramsOrFirst || {};
97947
+ } else {
97948
+ params = {
97949
+ databaseId: paramsOrFirst,
97950
+ migrationId: rest[0]
97951
+ };
97952
+ }
97953
+ const databaseId = params.databaseId;
97954
+ const migrationId = params.migrationId;
97955
+ if (typeof databaseId === "undefined") {
97956
+ throw new AppwriteException('Missing required parameter: "databaseId"');
97957
+ }
97958
+ if (typeof migrationId === "undefined") {
97959
+ throw new AppwriteException('Missing required parameter: "migrationId"');
97960
+ }
97961
+ const apiPath = "/tablesdb/{databaseId}/migrations/{migrationId}".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{migrationId}", encodeURIComponent(String(migrationId)));
97962
+ const payload = {};
97963
+ const uri = new URL(this.client.config.endpoint + apiPath);
97964
+ const apiHeaders = {
97965
+ "X-Appwrite-Project": this.client.config.project,
97966
+ "accept": "application/json"
97967
+ };
97968
+ return this.client.call("get", uri, apiHeaders, payload);
97969
+ }
97970
+ deleteMigration(paramsOrFirst, ...rest) {
97971
+ let params;
97972
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
97973
+ params = paramsOrFirst || {};
97974
+ } else {
97975
+ params = {
97976
+ databaseId: paramsOrFirst,
97977
+ migrationId: rest[0]
97978
+ };
97979
+ }
97980
+ const databaseId = params.databaseId;
97981
+ const migrationId = params.migrationId;
97982
+ if (typeof databaseId === "undefined") {
97983
+ throw new AppwriteException('Missing required parameter: "databaseId"');
97984
+ }
97985
+ if (typeof migrationId === "undefined") {
97986
+ throw new AppwriteException('Missing required parameter: "migrationId"');
97987
+ }
97988
+ const apiPath = "/tablesdb/{databaseId}/migrations/{migrationId}".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{migrationId}", encodeURIComponent(String(migrationId)));
97989
+ const payload = {};
97990
+ const uri = new URL(this.client.config.endpoint + apiPath);
97991
+ const apiHeaders = {
97992
+ "X-Appwrite-Project": this.client.config.project,
97993
+ "content-type": "application/json",
97994
+ "accept": "application/json"
97995
+ };
97996
+ return this.client.call("delete", uri, apiHeaders, payload);
97997
+ }
97646
97998
  listTables(paramsOrFirst, ...rest) {
97647
97999
  let params;
97648
98000
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -100161,38 +100513,6 @@ var TablesDB = class {
100161
100513
  };
100162
100514
  return this.client.call("delete", uri, apiHeaders, payload);
100163
100515
  }
100164
- listTableLogs(paramsOrFirst, ...rest) {
100165
- let params;
100166
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100167
- params = paramsOrFirst || {};
100168
- } else {
100169
- params = {
100170
- databaseId: paramsOrFirst,
100171
- tableId: rest[0],
100172
- queries: rest[1]
100173
- };
100174
- }
100175
- const databaseId = params.databaseId;
100176
- const tableId = params.tableId;
100177
- const queries = params.queries;
100178
- if (typeof databaseId === "undefined") {
100179
- throw new AppwriteException('Missing required parameter: "databaseId"');
100180
- }
100181
- if (typeof tableId === "undefined") {
100182
- throw new AppwriteException('Missing required parameter: "tableId"');
100183
- }
100184
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/logs".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100185
- const payload = {};
100186
- if (typeof queries !== "undefined") {
100187
- payload["queries"] = queries;
100188
- }
100189
- const uri = new URL(this.client.config.endpoint + apiPath);
100190
- const apiHeaders = {
100191
- "X-Appwrite-Project": this.client.config.project,
100192
- "accept": "application/json"
100193
- };
100194
- return this.client.call("get", uri, apiHeaders, payload);
100195
- }
100196
100516
  listRows(paramsOrFirst, ...rest) {
100197
100517
  let params;
100198
100518
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -100269,267 +100589,14 @@ var TablesDB = class {
100269
100589
  if (typeof rowId === "undefined") {
100270
100590
  throw new AppwriteException('Missing required parameter: "rowId"');
100271
100591
  }
100272
- if (typeof data === "undefined") {
100273
- throw new AppwriteException('Missing required parameter: "data"');
100274
- }
100275
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100276
- const payload = {};
100277
- if (typeof rowId !== "undefined") {
100278
- payload["rowId"] = rowId;
100279
- }
100280
- if (typeof data !== "undefined") {
100281
- payload["data"] = data;
100282
- }
100283
- if (typeof permissions !== "undefined") {
100284
- payload["permissions"] = permissions;
100285
- }
100286
- if (typeof transactionId !== "undefined") {
100287
- payload["transactionId"] = transactionId;
100288
- }
100289
- const uri = new URL(this.client.config.endpoint + apiPath);
100290
- const apiHeaders = {
100291
- "X-Appwrite-Project": this.client.config.project,
100292
- "content-type": "application/json",
100293
- "accept": "application/json"
100294
- };
100295
- return this.client.call("post", uri, apiHeaders, payload);
100296
- }
100297
- createRows(paramsOrFirst, ...rest) {
100298
- let params;
100299
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100300
- params = paramsOrFirst || {};
100301
- } else {
100302
- params = {
100303
- databaseId: paramsOrFirst,
100304
- tableId: rest[0],
100305
- rows: rest[1],
100306
- transactionId: rest[2]
100307
- };
100308
- }
100309
- const databaseId = params.databaseId;
100310
- const tableId = params.tableId;
100311
- const rows = params.rows;
100312
- const transactionId = params.transactionId;
100313
- if (typeof databaseId === "undefined") {
100314
- throw new AppwriteException('Missing required parameter: "databaseId"');
100315
- }
100316
- if (typeof tableId === "undefined") {
100317
- throw new AppwriteException('Missing required parameter: "tableId"');
100318
- }
100319
- if (typeof rows === "undefined") {
100320
- throw new AppwriteException('Missing required parameter: "rows"');
100321
- }
100322
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100323
- const payload = {};
100324
- if (typeof rows !== "undefined") {
100325
- payload["rows"] = rows;
100326
- }
100327
- if (typeof transactionId !== "undefined") {
100328
- payload["transactionId"] = transactionId;
100329
- }
100330
- const uri = new URL(this.client.config.endpoint + apiPath);
100331
- const apiHeaders = {
100332
- "X-Appwrite-Project": this.client.config.project,
100333
- "content-type": "application/json",
100334
- "accept": "application/json"
100335
- };
100336
- return this.client.call("post", uri, apiHeaders, payload);
100337
- }
100338
- upsertRows(paramsOrFirst, ...rest) {
100339
- let params;
100340
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100341
- params = paramsOrFirst || {};
100342
- } else {
100343
- params = {
100344
- databaseId: paramsOrFirst,
100345
- tableId: rest[0],
100346
- rows: rest[1],
100347
- transactionId: rest[2]
100348
- };
100349
- }
100350
- const databaseId = params.databaseId;
100351
- const tableId = params.tableId;
100352
- const rows = params.rows;
100353
- const transactionId = params.transactionId;
100354
- if (typeof databaseId === "undefined") {
100355
- throw new AppwriteException('Missing required parameter: "databaseId"');
100356
- }
100357
- if (typeof tableId === "undefined") {
100358
- throw new AppwriteException('Missing required parameter: "tableId"');
100359
- }
100360
- if (typeof rows === "undefined") {
100361
- throw new AppwriteException('Missing required parameter: "rows"');
100362
- }
100363
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100364
- const payload = {};
100365
- if (typeof rows !== "undefined") {
100366
- payload["rows"] = rows;
100367
- }
100368
- if (typeof transactionId !== "undefined") {
100369
- payload["transactionId"] = transactionId;
100370
- }
100371
- const uri = new URL(this.client.config.endpoint + apiPath);
100372
- const apiHeaders = {
100373
- "X-Appwrite-Project": this.client.config.project,
100374
- "content-type": "application/json",
100375
- "accept": "application/json"
100376
- };
100377
- return this.client.call("put", uri, apiHeaders, payload);
100378
- }
100379
- updateRows(paramsOrFirst, ...rest) {
100380
- let params;
100381
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100382
- params = paramsOrFirst || {};
100383
- } else {
100384
- params = {
100385
- databaseId: paramsOrFirst,
100386
- tableId: rest[0],
100387
- data: rest[1],
100388
- queries: rest[2],
100389
- transactionId: rest[3]
100390
- };
100391
- }
100392
- const databaseId = params.databaseId;
100393
- const tableId = params.tableId;
100394
- const data = params.data;
100395
- const queries = params.queries;
100396
- const transactionId = params.transactionId;
100397
- if (typeof databaseId === "undefined") {
100398
- throw new AppwriteException('Missing required parameter: "databaseId"');
100399
- }
100400
- if (typeof tableId === "undefined") {
100401
- throw new AppwriteException('Missing required parameter: "tableId"');
100402
- }
100403
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100404
- const payload = {};
100405
- if (typeof data !== "undefined") {
100406
- payload["data"] = data;
100407
- }
100408
- if (typeof queries !== "undefined") {
100409
- payload["queries"] = queries;
100410
- }
100411
- if (typeof transactionId !== "undefined") {
100412
- payload["transactionId"] = transactionId;
100413
- }
100414
- const uri = new URL(this.client.config.endpoint + apiPath);
100415
- const apiHeaders = {
100416
- "X-Appwrite-Project": this.client.config.project,
100417
- "content-type": "application/json",
100418
- "accept": "application/json"
100419
- };
100420
- return this.client.call("patch", uri, apiHeaders, payload);
100421
- }
100422
- deleteRows(paramsOrFirst, ...rest) {
100423
- let params;
100424
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100425
- params = paramsOrFirst || {};
100426
- } else {
100427
- params = {
100428
- databaseId: paramsOrFirst,
100429
- tableId: rest[0],
100430
- queries: rest[1],
100431
- transactionId: rest[2]
100432
- };
100433
- }
100434
- const databaseId = params.databaseId;
100435
- const tableId = params.tableId;
100436
- const queries = params.queries;
100437
- const transactionId = params.transactionId;
100438
- if (typeof databaseId === "undefined") {
100439
- throw new AppwriteException('Missing required parameter: "databaseId"');
100440
- }
100441
- if (typeof tableId === "undefined") {
100442
- throw new AppwriteException('Missing required parameter: "tableId"');
100443
- }
100444
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100445
- const payload = {};
100446
- if (typeof queries !== "undefined") {
100447
- payload["queries"] = queries;
100448
- }
100449
- if (typeof transactionId !== "undefined") {
100450
- payload["transactionId"] = transactionId;
100451
- }
100452
- const uri = new URL(this.client.config.endpoint + apiPath);
100453
- const apiHeaders = {
100454
- "X-Appwrite-Project": this.client.config.project,
100455
- "content-type": "application/json",
100456
- "accept": "application/json"
100457
- };
100458
- return this.client.call("delete", uri, apiHeaders, payload);
100459
- }
100460
- getRow(paramsOrFirst, ...rest) {
100461
- let params;
100462
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100463
- params = paramsOrFirst || {};
100464
- } else {
100465
- params = {
100466
- databaseId: paramsOrFirst,
100467
- tableId: rest[0],
100468
- rowId: rest[1],
100469
- queries: rest[2],
100470
- transactionId: rest[3]
100471
- };
100472
- }
100473
- const databaseId = params.databaseId;
100474
- const tableId = params.tableId;
100475
- const rowId = params.rowId;
100476
- const queries = params.queries;
100477
- const transactionId = params.transactionId;
100478
- if (typeof databaseId === "undefined") {
100479
- throw new AppwriteException('Missing required parameter: "databaseId"');
100480
- }
100481
- if (typeof tableId === "undefined") {
100482
- throw new AppwriteException('Missing required parameter: "tableId"');
100483
- }
100484
- if (typeof rowId === "undefined") {
100485
- throw new AppwriteException('Missing required parameter: "rowId"');
100486
- }
100487
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId))).replace("{rowId}", encodeURIComponent(String(rowId)));
100488
- const payload = {};
100489
- if (typeof queries !== "undefined") {
100490
- payload["queries"] = queries;
100491
- }
100492
- if (typeof transactionId !== "undefined") {
100493
- payload["transactionId"] = transactionId;
100494
- }
100495
- const uri = new URL(this.client.config.endpoint + apiPath);
100496
- const apiHeaders = {
100497
- "X-Appwrite-Project": this.client.config.project,
100498
- "accept": "application/json"
100499
- };
100500
- return this.client.call("get", uri, apiHeaders, payload);
100501
- }
100502
- upsertRow(paramsOrFirst, ...rest) {
100503
- let params;
100504
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100505
- params = paramsOrFirst || {};
100506
- } else {
100507
- params = {
100508
- databaseId: paramsOrFirst,
100509
- tableId: rest[0],
100510
- rowId: rest[1],
100511
- data: rest[2],
100512
- permissions: rest[3],
100513
- transactionId: rest[4]
100514
- };
100515
- }
100516
- const databaseId = params.databaseId;
100517
- const tableId = params.tableId;
100518
- const rowId = params.rowId;
100519
- const data = params.data;
100520
- const permissions = params.permissions;
100521
- const transactionId = params.transactionId;
100522
- if (typeof databaseId === "undefined") {
100523
- throw new AppwriteException('Missing required parameter: "databaseId"');
100524
- }
100525
- if (typeof tableId === "undefined") {
100526
- throw new AppwriteException('Missing required parameter: "tableId"');
100527
- }
100528
- if (typeof rowId === "undefined") {
100529
- throw new AppwriteException('Missing required parameter: "rowId"');
100530
- }
100531
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId))).replace("{rowId}", encodeURIComponent(String(rowId)));
100592
+ if (typeof data === "undefined") {
100593
+ throw new AppwriteException('Missing required parameter: "data"');
100594
+ }
100595
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100532
100596
  const payload = {};
100597
+ if (typeof rowId !== "undefined") {
100598
+ payload["rowId"] = rowId;
100599
+ }
100533
100600
  if (typeof data !== "undefined") {
100534
100601
  payload["data"] = data;
100535
100602
  }
@@ -100545,9 +100612,214 @@ var TablesDB = class {
100545
100612
  "content-type": "application/json",
100546
100613
  "accept": "application/json"
100547
100614
  };
100615
+ return this.client.call("post", uri, apiHeaders, payload);
100616
+ }
100617
+ createRows(paramsOrFirst, ...rest) {
100618
+ let params;
100619
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100620
+ params = paramsOrFirst || {};
100621
+ } else {
100622
+ params = {
100623
+ databaseId: paramsOrFirst,
100624
+ tableId: rest[0],
100625
+ rows: rest[1],
100626
+ transactionId: rest[2]
100627
+ };
100628
+ }
100629
+ const databaseId = params.databaseId;
100630
+ const tableId = params.tableId;
100631
+ const rows = params.rows;
100632
+ const transactionId = params.transactionId;
100633
+ if (typeof databaseId === "undefined") {
100634
+ throw new AppwriteException('Missing required parameter: "databaseId"');
100635
+ }
100636
+ if (typeof tableId === "undefined") {
100637
+ throw new AppwriteException('Missing required parameter: "tableId"');
100638
+ }
100639
+ if (typeof rows === "undefined") {
100640
+ throw new AppwriteException('Missing required parameter: "rows"');
100641
+ }
100642
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100643
+ const payload = {};
100644
+ if (typeof rows !== "undefined") {
100645
+ payload["rows"] = rows;
100646
+ }
100647
+ if (typeof transactionId !== "undefined") {
100648
+ payload["transactionId"] = transactionId;
100649
+ }
100650
+ const uri = new URL(this.client.config.endpoint + apiPath);
100651
+ const apiHeaders = {
100652
+ "X-Appwrite-Project": this.client.config.project,
100653
+ "content-type": "application/json",
100654
+ "accept": "application/json"
100655
+ };
100656
+ return this.client.call("post", uri, apiHeaders, payload);
100657
+ }
100658
+ upsertRows(paramsOrFirst, ...rest) {
100659
+ let params;
100660
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100661
+ params = paramsOrFirst || {};
100662
+ } else {
100663
+ params = {
100664
+ databaseId: paramsOrFirst,
100665
+ tableId: rest[0],
100666
+ rows: rest[1],
100667
+ transactionId: rest[2]
100668
+ };
100669
+ }
100670
+ const databaseId = params.databaseId;
100671
+ const tableId = params.tableId;
100672
+ const rows = params.rows;
100673
+ const transactionId = params.transactionId;
100674
+ if (typeof databaseId === "undefined") {
100675
+ throw new AppwriteException('Missing required parameter: "databaseId"');
100676
+ }
100677
+ if (typeof tableId === "undefined") {
100678
+ throw new AppwriteException('Missing required parameter: "tableId"');
100679
+ }
100680
+ if (typeof rows === "undefined") {
100681
+ throw new AppwriteException('Missing required parameter: "rows"');
100682
+ }
100683
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100684
+ const payload = {};
100685
+ if (typeof rows !== "undefined") {
100686
+ payload["rows"] = rows;
100687
+ }
100688
+ if (typeof transactionId !== "undefined") {
100689
+ payload["transactionId"] = transactionId;
100690
+ }
100691
+ const uri = new URL(this.client.config.endpoint + apiPath);
100692
+ const apiHeaders = {
100693
+ "X-Appwrite-Project": this.client.config.project,
100694
+ "content-type": "application/json",
100695
+ "accept": "application/json"
100696
+ };
100548
100697
  return this.client.call("put", uri, apiHeaders, payload);
100549
100698
  }
100550
- updateRow(paramsOrFirst, ...rest) {
100699
+ updateRows(paramsOrFirst, ...rest) {
100700
+ let params;
100701
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100702
+ params = paramsOrFirst || {};
100703
+ } else {
100704
+ params = {
100705
+ databaseId: paramsOrFirst,
100706
+ tableId: rest[0],
100707
+ data: rest[1],
100708
+ queries: rest[2],
100709
+ transactionId: rest[3]
100710
+ };
100711
+ }
100712
+ const databaseId = params.databaseId;
100713
+ const tableId = params.tableId;
100714
+ const data = params.data;
100715
+ const queries = params.queries;
100716
+ const transactionId = params.transactionId;
100717
+ if (typeof databaseId === "undefined") {
100718
+ throw new AppwriteException('Missing required parameter: "databaseId"');
100719
+ }
100720
+ if (typeof tableId === "undefined") {
100721
+ throw new AppwriteException('Missing required parameter: "tableId"');
100722
+ }
100723
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100724
+ const payload = {};
100725
+ if (typeof data !== "undefined") {
100726
+ payload["data"] = data;
100727
+ }
100728
+ if (typeof queries !== "undefined") {
100729
+ payload["queries"] = queries;
100730
+ }
100731
+ if (typeof transactionId !== "undefined") {
100732
+ payload["transactionId"] = transactionId;
100733
+ }
100734
+ const uri = new URL(this.client.config.endpoint + apiPath);
100735
+ const apiHeaders = {
100736
+ "X-Appwrite-Project": this.client.config.project,
100737
+ "content-type": "application/json",
100738
+ "accept": "application/json"
100739
+ };
100740
+ return this.client.call("patch", uri, apiHeaders, payload);
100741
+ }
100742
+ deleteRows(paramsOrFirst, ...rest) {
100743
+ let params;
100744
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100745
+ params = paramsOrFirst || {};
100746
+ } else {
100747
+ params = {
100748
+ databaseId: paramsOrFirst,
100749
+ tableId: rest[0],
100750
+ queries: rest[1],
100751
+ transactionId: rest[2]
100752
+ };
100753
+ }
100754
+ const databaseId = params.databaseId;
100755
+ const tableId = params.tableId;
100756
+ const queries = params.queries;
100757
+ const transactionId = params.transactionId;
100758
+ if (typeof databaseId === "undefined") {
100759
+ throw new AppwriteException('Missing required parameter: "databaseId"');
100760
+ }
100761
+ if (typeof tableId === "undefined") {
100762
+ throw new AppwriteException('Missing required parameter: "tableId"');
100763
+ }
100764
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100765
+ const payload = {};
100766
+ if (typeof queries !== "undefined") {
100767
+ payload["queries"] = queries;
100768
+ }
100769
+ if (typeof transactionId !== "undefined") {
100770
+ payload["transactionId"] = transactionId;
100771
+ }
100772
+ const uri = new URL(this.client.config.endpoint + apiPath);
100773
+ const apiHeaders = {
100774
+ "X-Appwrite-Project": this.client.config.project,
100775
+ "content-type": "application/json",
100776
+ "accept": "application/json"
100777
+ };
100778
+ return this.client.call("delete", uri, apiHeaders, payload);
100779
+ }
100780
+ getRow(paramsOrFirst, ...rest) {
100781
+ let params;
100782
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100783
+ params = paramsOrFirst || {};
100784
+ } else {
100785
+ params = {
100786
+ databaseId: paramsOrFirst,
100787
+ tableId: rest[0],
100788
+ rowId: rest[1],
100789
+ queries: rest[2],
100790
+ transactionId: rest[3]
100791
+ };
100792
+ }
100793
+ const databaseId = params.databaseId;
100794
+ const tableId = params.tableId;
100795
+ const rowId = params.rowId;
100796
+ const queries = params.queries;
100797
+ const transactionId = params.transactionId;
100798
+ if (typeof databaseId === "undefined") {
100799
+ throw new AppwriteException('Missing required parameter: "databaseId"');
100800
+ }
100801
+ if (typeof tableId === "undefined") {
100802
+ throw new AppwriteException('Missing required parameter: "tableId"');
100803
+ }
100804
+ if (typeof rowId === "undefined") {
100805
+ throw new AppwriteException('Missing required parameter: "rowId"');
100806
+ }
100807
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId))).replace("{rowId}", encodeURIComponent(String(rowId)));
100808
+ const payload = {};
100809
+ if (typeof queries !== "undefined") {
100810
+ payload["queries"] = queries;
100811
+ }
100812
+ if (typeof transactionId !== "undefined") {
100813
+ payload["transactionId"] = transactionId;
100814
+ }
100815
+ const uri = new URL(this.client.config.endpoint + apiPath);
100816
+ const apiHeaders = {
100817
+ "X-Appwrite-Project": this.client.config.project,
100818
+ "accept": "application/json"
100819
+ };
100820
+ return this.client.call("get", uri, apiHeaders, payload);
100821
+ }
100822
+ upsertRow(paramsOrFirst, ...rest) {
100551
100823
  let params;
100552
100824
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100553
100825
  params = paramsOrFirst || {};
@@ -100593,9 +100865,9 @@ var TablesDB = class {
100593
100865
  "content-type": "application/json",
100594
100866
  "accept": "application/json"
100595
100867
  };
100596
- return this.client.call("patch", uri, apiHeaders, payload);
100868
+ return this.client.call("put", uri, apiHeaders, payload);
100597
100869
  }
100598
- deleteRow(paramsOrFirst, ...rest) {
100870
+ updateRow(paramsOrFirst, ...rest) {
100599
100871
  let params;
100600
100872
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100601
100873
  params = paramsOrFirst || {};
@@ -100604,12 +100876,16 @@ var TablesDB = class {
100604
100876
  databaseId: paramsOrFirst,
100605
100877
  tableId: rest[0],
100606
100878
  rowId: rest[1],
100607
- transactionId: rest[2]
100879
+ data: rest[2],
100880
+ permissions: rest[3],
100881
+ transactionId: rest[4]
100608
100882
  };
100609
100883
  }
100610
100884
  const databaseId = params.databaseId;
100611
100885
  const tableId = params.tableId;
100612
100886
  const rowId = params.rowId;
100887
+ const data = params.data;
100888
+ const permissions = params.permissions;
100613
100889
  const transactionId = params.transactionId;
100614
100890
  if (typeof databaseId === "undefined") {
100615
100891
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -100622,17 +100898,24 @@ var TablesDB = class {
100622
100898
  }
100623
100899
  const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId))).replace("{rowId}", encodeURIComponent(String(rowId)));
100624
100900
  const payload = {};
100901
+ if (typeof data !== "undefined") {
100902
+ payload["data"] = data;
100903
+ }
100904
+ if (typeof permissions !== "undefined") {
100905
+ payload["permissions"] = permissions;
100906
+ }
100625
100907
  if (typeof transactionId !== "undefined") {
100626
100908
  payload["transactionId"] = transactionId;
100627
100909
  }
100628
100910
  const uri = new URL(this.client.config.endpoint + apiPath);
100629
100911
  const apiHeaders = {
100630
100912
  "X-Appwrite-Project": this.client.config.project,
100631
- "content-type": "application/json"
100913
+ "content-type": "application/json",
100914
+ "accept": "application/json"
100632
100915
  };
100633
- return this.client.call("delete", uri, apiHeaders, payload);
100916
+ return this.client.call("patch", uri, apiHeaders, payload);
100634
100917
  }
100635
- listRowLogs(paramsOrFirst, ...rest) {
100918
+ deleteRow(paramsOrFirst, ...rest) {
100636
100919
  let params;
100637
100920
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100638
100921
  params = paramsOrFirst || {};
@@ -100641,13 +100924,13 @@ var TablesDB = class {
100641
100924
  databaseId: paramsOrFirst,
100642
100925
  tableId: rest[0],
100643
100926
  rowId: rest[1],
100644
- queries: rest[2]
100927
+ transactionId: rest[2]
100645
100928
  };
100646
100929
  }
100647
100930
  const databaseId = params.databaseId;
100648
100931
  const tableId = params.tableId;
100649
100932
  const rowId = params.rowId;
100650
- const queries = params.queries;
100933
+ const transactionId = params.transactionId;
100651
100934
  if (typeof databaseId === "undefined") {
100652
100935
  throw new AppwriteException('Missing required parameter: "databaseId"');
100653
100936
  }
@@ -100657,17 +100940,17 @@ var TablesDB = class {
100657
100940
  if (typeof rowId === "undefined") {
100658
100941
  throw new AppwriteException('Missing required parameter: "rowId"');
100659
100942
  }
100660
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/logs".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId))).replace("{rowId}", encodeURIComponent(String(rowId)));
100943
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId))).replace("{rowId}", encodeURIComponent(String(rowId)));
100661
100944
  const payload = {};
100662
- if (typeof queries !== "undefined") {
100663
- payload["queries"] = queries;
100945
+ if (typeof transactionId !== "undefined") {
100946
+ payload["transactionId"] = transactionId;
100664
100947
  }
100665
100948
  const uri = new URL(this.client.config.endpoint + apiPath);
100666
100949
  const apiHeaders = {
100667
100950
  "X-Appwrite-Project": this.client.config.project,
100668
- "accept": "application/json"
100951
+ "content-type": "application/json"
100669
100952
  };
100670
- return this.client.call("get", uri, apiHeaders, payload);
100953
+ return this.client.call("delete", uri, apiHeaders, payload);
100671
100954
  }
100672
100955
  decrementRowColumn(paramsOrFirst, ...rest) {
100673
100956
  let params;
@@ -102502,6 +102785,7 @@ var QuerySuggestionResource;
102502
102785
  QuerySuggestionResource2["Keys"] = "keys";
102503
102786
  QuerySuggestionResource2["DevKeys"] = "devkeys";
102504
102787
  QuerySuggestionResource2["Webhooks"] = "webhooks";
102788
+ QuerySuggestionResource2["Notifications"] = "notifications";
102505
102789
  QuerySuggestionResource2["Certificates"] = "certificates";
102506
102790
  QuerySuggestionResource2["Realtime"] = "realtime";
102507
102791
  QuerySuggestionResource2["Rules"] = "rules";
@@ -102545,6 +102829,8 @@ var QuerySuggestionResource;
102545
102829
  QuerySuggestionResource2["Feedbacks"] = "feedbacks";
102546
102830
  QuerySuggestionResource2["Disputes"] = "disputes";
102547
102831
  QuerySuggestionResource2["ShInstallations"] = "sh_installations";
102832
+ QuerySuggestionResource2["MigrationDatabases"] = "migrationdatabases";
102833
+ QuerySuggestionResource2["MigrationProjects"] = "migrationprojects";
102548
102834
  QuerySuggestionResource2["Apps"] = "apps";
102549
102835
  QuerySuggestionResource2["AppSecrets"] = "appsecrets";
102550
102836
  QuerySuggestionResource2["Oauth2Grants"] = "oauth2grants";
@@ -102868,8 +103154,12 @@ var ProjectKeyScopes;
102868
103154
  ProjectKeyScopes2["PoliciesWrite"] = "policies.write";
102869
103155
  ProjectKeyScopes2["ProjectPoliciesRead"] = "project.policies.read";
102870
103156
  ProjectKeyScopes2["ProjectPoliciesWrite"] = "project.policies.write";
103157
+ ProjectKeyScopes2["ProjectOauth2Read"] = "project.oauth2.read";
103158
+ ProjectKeyScopes2["ProjectOauth2Write"] = "project.oauth2.write";
102871
103159
  ProjectKeyScopes2["TemplatesRead"] = "templates.read";
102872
103160
  ProjectKeyScopes2["TemplatesWrite"] = "templates.write";
103161
+ ProjectKeyScopes2["StagesRead"] = "stages.read";
103162
+ ProjectKeyScopes2["StagesWrite"] = "stages.write";
102873
103163
  ProjectKeyScopes2["Oauth2Read"] = "oauth2.read";
102874
103164
  ProjectKeyScopes2["Oauth2Write"] = "oauth2.write";
102875
103165
  ProjectKeyScopes2["UsersRead"] = "users.read";
@@ -103006,6 +103296,7 @@ var HealthQueueName;
103006
103296
  HealthQueueName2["V1screenshots"] = "v1-screenshots";
103007
103297
  HealthQueueName2["V1messaging"] = "v1-messaging";
103008
103298
  HealthQueueName2["V1migrations"] = "v1-migrations";
103299
+ HealthQueueName2["V1notifications"] = "v1-notifications";
103009
103300
  })(HealthQueueName || (HealthQueueName = {}));
103010
103301
  var BlockResourceType;
103011
103302
  (function(BlockResourceType2) {
@@ -103019,6 +103310,11 @@ var BlockResourceType;
103019
103310
  BlockResourceType2["Subscribers"] = "subscribers";
103020
103311
  BlockResourceType2["Messages"] = "messages";
103021
103312
  })(BlockResourceType || (BlockResourceType = {}));
103313
+ var BlockMode;
103314
+ (function(BlockMode2) {
103315
+ BlockMode2["Full"] = "full";
103316
+ BlockMode2["Readonly"] = "readonly";
103317
+ })(BlockMode || (BlockMode = {}));
103022
103318
  var Region;
103023
103319
  (function(Region2) {
103024
103320
  Region2["Fra"] = "fra";
@@ -103151,6 +103447,10 @@ var OrganizationKeyScopes;
103151
103447
  OrganizationKeyScopes2["DevKeysWrite"] = "devKeys.write";
103152
103448
  OrganizationKeyScopes2["OrganizationKeysRead"] = "organization.keys.read";
103153
103449
  OrganizationKeyScopes2["OrganizationKeysWrite"] = "organization.keys.write";
103450
+ OrganizationKeyScopes2["OrganizationMembershipsRead"] = "organization.memberships.read";
103451
+ OrganizationKeyScopes2["OrganizationMembershipsWrite"] = "organization.memberships.write";
103452
+ OrganizationKeyScopes2["OrganizationRead"] = "organization.read";
103453
+ OrganizationKeyScopes2["OrganizationWrite"] = "organization.write";
103154
103454
  OrganizationKeyScopes2["DomainsRead"] = "domains.read";
103155
103455
  OrganizationKeyScopes2["DomainsWrite"] = "domains.write";
103156
103456
  OrganizationKeyScopes2["KeysRead"] = "keys.read";
@@ -103159,6 +103459,8 @@ var OrganizationKeyScopes;
103159
103459
  var Addon;
103160
103460
  (function(Addon2) {
103161
103461
  Addon2["Baa"] = "baa";
103462
+ Addon2["Premiumgeodb"] = "premiumgeodb";
103463
+ Addon2["Premiumgeodborg"] = "premiumgeodborg";
103162
103464
  Addon2["BackupRecovery"] = "backup_recovery";
103163
103465
  })(Addon || (Addon = {}));
103164
103466
  var ProjectAuthMethodId;
@@ -103177,6 +103479,13 @@ var ProjectOAuth2GooglePrompt;
103177
103479
  ProjectOAuth2GooglePrompt2["Consent"] = "consent";
103178
103480
  ProjectOAuth2GooglePrompt2["SelectAccount"] = "select_account";
103179
103481
  })(ProjectOAuth2GooglePrompt || (ProjectOAuth2GooglePrompt = {}));
103482
+ var ProjectOAuth2OidcPrompt;
103483
+ (function(ProjectOAuth2OidcPrompt2) {
103484
+ ProjectOAuth2OidcPrompt2["None"] = "none";
103485
+ ProjectOAuth2OidcPrompt2["Login"] = "login";
103486
+ ProjectOAuth2OidcPrompt2["Consent"] = "consent";
103487
+ ProjectOAuth2OidcPrompt2["SelectAccount"] = "select_account";
103488
+ })(ProjectOAuth2OidcPrompt || (ProjectOAuth2OidcPrompt = {}));
103180
103489
  var ProjectOAuthProviderId;
103181
103490
  (function(ProjectOAuthProviderId2) {
103182
103491
  ProjectOAuthProviderId2["Amazon"] = "amazon";
@@ -103503,6 +103812,12 @@ var DatabaseType;
103503
103812
  DatabaseType2["Documentsdb"] = "documentsdb";
103504
103813
  DatabaseType2["Vectorsdb"] = "vectorsdb";
103505
103814
  })(DatabaseType || (DatabaseType = {}));
103815
+ var DatabaseStatus;
103816
+ (function(DatabaseStatus2) {
103817
+ DatabaseStatus2["Provisioning"] = "provisioning";
103818
+ DatabaseStatus2["Ready"] = "ready";
103819
+ DatabaseStatus2["Failed"] = "failed";
103820
+ })(DatabaseStatus || (DatabaseStatus = {}));
103506
103821
  var AttributeStatus;
103507
103822
  (function(AttributeStatus2) {
103508
103823
  AttributeStatus2["Available"] = "available";
@@ -103564,6 +103879,13 @@ var OAuth2GooglePrompt;
103564
103879
  OAuth2GooglePrompt2["Consent"] = "consent";
103565
103880
  OAuth2GooglePrompt2["SelectAccount"] = "select_account";
103566
103881
  })(OAuth2GooglePrompt || (OAuth2GooglePrompt = {}));
103882
+ var OAuth2OidcPrompt;
103883
+ (function(OAuth2OidcPrompt2) {
103884
+ OAuth2OidcPrompt2["None"] = "none";
103885
+ OAuth2OidcPrompt2["Login"] = "login";
103886
+ OAuth2OidcPrompt2["Consent"] = "consent";
103887
+ OAuth2OidcPrompt2["SelectAccount"] = "select_account";
103888
+ })(OAuth2OidcPrompt || (OAuth2OidcPrompt = {}));
103567
103889
  var PlatformType;
103568
103890
  (function(PlatformType2) {
103569
103891
  PlatformType2["Windows"] = "windows";
@@ -104959,7 +105281,7 @@ var package_default = {
104959
105281
  type: "module",
104960
105282
  homepage: "https://appwrite.io/support",
104961
105283
  description: "Appwrite is an open-source self-hosted backend server that abstracts and simplifies complex and repetitive development tasks behind a very simple REST API",
104962
- version: "22.4.0",
105284
+ version: "22.5.0",
104963
105285
  license: "BSD-3-Clause",
104964
105286
  main: "dist/index.cjs",
104965
105287
  module: "dist/index.js",
@@ -105007,7 +105329,7 @@ var package_default = {
105007
105329
  "windows-arm64": "bun build cli.ts --compile --minify --target=bun-windows-arm64 --outfile build/appwrite-cli-win-arm64.exe"
105008
105330
  },
105009
105331
  dependencies: {
105010
- "@appwrite.io/console": "^15.1.1",
105332
+ "@appwrite.io/console": "15.3.0-rc.1",
105011
105333
  "@napi-rs/keyring": "^1.3.0",
105012
105334
  chalk: "4.1.2",
105013
105335
  chokidar: "^3.6.0",
@@ -105035,21 +105357,21 @@ var package_default = {
105035
105357
  esbuild: "^0.28.1"
105036
105358
  },
105037
105359
  devDependencies: {
105038
- "@typescript-eslint/eslint-plugin": "^8.0.0",
105039
- "@typescript-eslint/parser": "^8.0.0",
105040
105360
  "@types/bun": "^1.3.5",
105041
- eslint: "^9.0.0",
105042
- "eslint-plugin-unused-imports": "^4.0.0",
105043
- "typescript-eslint": "^8.0.0",
105044
105361
  "@types/cli-progress": "^3.11.5",
105045
105362
  "@types/inquirer": "^8.2.10",
105046
105363
  "@types/json-bigint": "^1.0.4",
105047
105364
  "@types/node": "^18.19.0",
105048
105365
  "@types/tar": "^6.1.13",
105366
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
105367
+ "@typescript-eslint/parser": "^8.0.0",
105049
105368
  esbuild: "^0.28.1",
105369
+ eslint: "^9.0.0",
105370
+ "eslint-plugin-unused-imports": "^4.0.0",
105050
105371
  prettier: "^3.7.4",
105051
105372
  tsx: "^4.21.0",
105052
- typescript: "^5.3.3"
105373
+ typescript: "^5.3.3",
105374
+ "typescript-eslint": "^8.0.0"
105053
105375
  }
105054
105376
  };
105055
105377
 
@@ -106159,7 +106481,9 @@ var configFilters = [
106159
106481
  new URL(
106160
106482
  `${consoleClient.config.endpoint}/projects/${encodeURIComponent(config2.projectId)}`
106161
106483
  ),
106162
- {},
106484
+ {
106485
+ "X-Appwrite-Project": "console"
106486
+ },
106163
106487
  {}
106164
106488
  );
106165
106489
  organizationId = project.teamId;