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.js CHANGED
@@ -65545,7 +65545,7 @@ var id_default = ID;
65545
65545
  // lib/constants.ts
65546
65546
  var SDK_TITLE = "Appwrite";
65547
65547
  var SDK_TITLE_LOWER = "appwrite";
65548
- var SDK_VERSION = "22.4.0";
65548
+ var SDK_VERSION = "22.5.0";
65549
65549
  var SDK_LOGO = "\n _ _ _ ___ __ _____\n /_\\ _ __ _ ____ ___ __(_) |_ ___ / __\\ / / \\_ \\\n //_\\\\| '_ \\| '_ \\ \\ /\\ / / '__| | __/ _ \\ / / / / / /\\/\n / _ \\ |_) | |_) \\ V V /| | | | || __/ / /___/ /___/\\/ /_\n \\_/ \\_/ .__/| .__/ \\_/\\_/ |_| |_|\\__\\___| \\____/\\____/\\____/\n |_| |_|\n\n";
65550
65550
  var EXECUTABLE_NAME = "appwrite";
65551
65551
  var UPDATE_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
@@ -80692,6 +80692,9 @@ Query.distanceEqual = (attribute, values, distance, meters = true) => new Query(
80692
80692
  Query.distanceNotEqual = (attribute, values, distance, meters = true) => new Query("distanceNotEqual", attribute, [[values, distance, meters]]).toString();
80693
80693
  Query.distanceGreaterThan = (attribute, values, distance, meters = true) => new Query("distanceGreaterThan", attribute, [[values, distance, meters]]).toString();
80694
80694
  Query.distanceLessThan = (attribute, values, distance, meters = true) => new Query("distanceLessThan", attribute, [[values, distance, meters]]).toString();
80695
+ Query.vectorDot = (attribute, vector) => new Query("vectorDot", attribute, [vector]).toString();
80696
+ Query.vectorCosine = (attribute, vector) => new Query("vectorCosine", attribute, [vector]).toString();
80697
+ Query.vectorEuclidean = (attribute, vector) => new Query("vectorEuclidean", attribute, [vector]).toString();
80695
80698
  Query.intersects = (attribute, values) => new Query("intersects", attribute, [values]).toString();
80696
80699
  Query.notIntersects = (attribute, values) => new Query("notIntersects", attribute, [values]).toString();
80697
80700
  Query.crosses = (attribute, values) => new Query("crosses", attribute, [values]).toString();
@@ -80756,6 +80759,7 @@ var Client = class _Client {
80756
80759
  project: "",
80757
80760
  key: "",
80758
80761
  jwt: "",
80762
+ bearer: "",
80759
80763
  locale: "",
80760
80764
  mode: "",
80761
80765
  cookie: "",
@@ -80772,7 +80776,7 @@ var Client = class _Client {
80772
80776
  "x-sdk-name": "Console",
80773
80777
  "x-sdk-platform": "console",
80774
80778
  "x-sdk-language": "web",
80775
- "x-sdk-version": "15.1.1",
80779
+ "x-sdk-version": "15.2.0",
80776
80780
  "X-Appwrite-Response-Format": "1.9.5"
80777
80781
  };
80778
80782
  this.realtime = {
@@ -80823,7 +80827,10 @@ var Client = class _Client {
80823
80827
  return;
80824
80828
  }
80825
80829
  const encodedProject = encodeURIComponent((_b = this.config.project) !== null && _b !== void 0 ? _b : "");
80826
- const queryParams = "project=" + encodedProject;
80830
+ let queryParams = "project=" + encodedProject;
80831
+ if (this.config.jwt) {
80832
+ queryParams += "&jwt=" + encodeURIComponent(this.config.jwt);
80833
+ }
80827
80834
  const url2 = this.config.endpointRealtime + "/realtime?" + queryParams;
80828
80835
  if (url2 !== this.realtime.url || // Check if URL is present
80829
80836
  !this.realtime.socket || // Check if WebSocket has not been created
@@ -81079,6 +81086,20 @@ var Client = class _Client {
81079
81086
  this.config.jwt = value;
81080
81087
  return this;
81081
81088
  }
81089
+ /**
81090
+ * Set Bearer
81091
+ *
81092
+ * The OAuth access token to authenticate with
81093
+ *
81094
+ * @param value string
81095
+ *
81096
+ * @return {this}
81097
+ */
81098
+ setBearer(value) {
81099
+ this.headers["Authorization"] = value;
81100
+ this.config.bearer = value;
81101
+ return this;
81102
+ }
81082
81103
  /**
81083
81104
  * Set Locale
81084
81105
  *
@@ -81450,7 +81471,7 @@ var Client = class _Client {
81450
81471
  }
81451
81472
  call(method_1, url_1) {
81452
81473
  return __awaiter(this, arguments, void 0, function* (method, url2, headers = {}, params = {}, responseType = "json") {
81453
- var _a4, _b;
81474
+ var _a4, _b, _c;
81454
81475
  const { uri, options } = this.prepareRequest(method, url2, headers, params);
81455
81476
  let data = null;
81456
81477
  const response = yield fetch(uri, options);
@@ -81477,7 +81498,7 @@ var Client = class _Client {
81477
81498
  } else {
81478
81499
  responseText = data === null || data === void 0 ? void 0 : data.message;
81479
81500
  }
81480
- throw new AppwriteException(data === null || data === void 0 ? void 0 : data.message, response.status, data === null || data === void 0 ? void 0 : data.type, responseText);
81501
+ 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);
81481
81502
  }
81482
81503
  const cookieFallback = response.headers.get("X-Fallback-Cookies");
81483
81504
  if (typeof window !== "undefined" && window.localStorage && cookieFallback && this.shouldUseFallbackCredentials(url2)) {
@@ -81575,6 +81596,38 @@ var Console = class {
81575
81596
  };
81576
81597
  return this.client.call("get", uri, apiHeaders, payload);
81577
81598
  }
81599
+ listDatabases(paramsOrFirst, ...rest) {
81600
+ let params;
81601
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
81602
+ params = paramsOrFirst || {};
81603
+ } else {
81604
+ params = {
81605
+ queries: paramsOrFirst,
81606
+ search: rest[0],
81607
+ total: rest[1]
81608
+ };
81609
+ }
81610
+ const queries = params.queries;
81611
+ const search = params.search;
81612
+ const total = params.total;
81613
+ const apiPath = "/console/databases";
81614
+ const payload = {};
81615
+ if (typeof queries !== "undefined") {
81616
+ payload["queries"] = queries;
81617
+ }
81618
+ if (typeof search !== "undefined") {
81619
+ payload["search"] = search;
81620
+ }
81621
+ if (typeof total !== "undefined") {
81622
+ payload["total"] = total;
81623
+ }
81624
+ const uri = new URL(this.client.config.endpoint + apiPath);
81625
+ const apiHeaders = {
81626
+ "X-Appwrite-Project": this.client.config.project,
81627
+ "accept": "application/json"
81628
+ };
81629
+ return this.client.call("get", uri, apiHeaders, payload);
81630
+ }
81578
81631
  /**
81579
81632
  * 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.
81580
81633
  *
@@ -81635,6 +81688,23 @@ var Console = class {
81635
81688
  };
81636
81689
  return this.client.call("get", uri, apiHeaders, payload);
81637
81690
  }
81691
+ /**
81692
+ * Get the catalog of Postgres extensions that can be installed on a dedicated Postgres database.
81693
+ *
81694
+ *
81695
+ * @throws {AppwriteException}
81696
+ * @returns {Promise<Models.PostgresExtensionList>}
81697
+ */
81698
+ listPostgresExtensions() {
81699
+ const apiPath = "/console/postgres-extensions";
81700
+ const payload = {};
81701
+ const uri = new URL(this.client.config.endpoint + apiPath);
81702
+ const apiHeaders = {
81703
+ "X-Appwrite-Project": this.client.config.project,
81704
+ "accept": "application/json"
81705
+ };
81706
+ return this.client.call("get", uri, apiHeaders, payload);
81707
+ }
81638
81708
  getProgram(paramsOrFirst) {
81639
81709
  let params;
81640
81710
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -85099,43 +85169,6 @@ var Databases = class {
85099
85169
  };
85100
85170
  return this.client.call("delete", uri, apiHeaders, payload);
85101
85171
  }
85102
- listDocumentLogs(paramsOrFirst, ...rest) {
85103
- let params;
85104
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
85105
- params = paramsOrFirst || {};
85106
- } else {
85107
- params = {
85108
- databaseId: paramsOrFirst,
85109
- collectionId: rest[0],
85110
- documentId: rest[1],
85111
- queries: rest[2]
85112
- };
85113
- }
85114
- const databaseId = params.databaseId;
85115
- const collectionId = params.collectionId;
85116
- const documentId = params.documentId;
85117
- const queries = params.queries;
85118
- if (typeof databaseId === "undefined") {
85119
- throw new AppwriteException('Missing required parameter: "databaseId"');
85120
- }
85121
- if (typeof collectionId === "undefined") {
85122
- throw new AppwriteException('Missing required parameter: "collectionId"');
85123
- }
85124
- if (typeof documentId === "undefined") {
85125
- throw new AppwriteException('Missing required parameter: "documentId"');
85126
- }
85127
- const apiPath = "/databases/{databaseId}/collections/{collectionId}/documents/{documentId}/logs".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{collectionId}", encodeURIComponent(String(collectionId))).replace("{documentId}", encodeURIComponent(String(documentId)));
85128
- const payload = {};
85129
- if (typeof queries !== "undefined") {
85130
- payload["queries"] = queries;
85131
- }
85132
- const uri = new URL(this.client.config.endpoint + apiPath);
85133
- const apiHeaders = {
85134
- "X-Appwrite-Project": this.client.config.project,
85135
- "accept": "application/json"
85136
- };
85137
- return this.client.call("get", uri, apiHeaders, payload);
85138
- }
85139
85172
  decrementDocumentAttribute(paramsOrFirst, ...rest) {
85140
85173
  let params;
85141
85174
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -85405,38 +85438,6 @@ var Databases = class {
85405
85438
  };
85406
85439
  return this.client.call("delete", uri, apiHeaders, payload);
85407
85440
  }
85408
- listCollectionLogs(paramsOrFirst, ...rest) {
85409
- let params;
85410
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
85411
- params = paramsOrFirst || {};
85412
- } else {
85413
- params = {
85414
- databaseId: paramsOrFirst,
85415
- collectionId: rest[0],
85416
- queries: rest[1]
85417
- };
85418
- }
85419
- const databaseId = params.databaseId;
85420
- const collectionId = params.collectionId;
85421
- const queries = params.queries;
85422
- if (typeof databaseId === "undefined") {
85423
- throw new AppwriteException('Missing required parameter: "databaseId"');
85424
- }
85425
- if (typeof collectionId === "undefined") {
85426
- throw new AppwriteException('Missing required parameter: "collectionId"');
85427
- }
85428
- const apiPath = "/databases/{databaseId}/collections/{collectionId}/logs".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{collectionId}", encodeURIComponent(String(collectionId)));
85429
- const payload = {};
85430
- if (typeof queries !== "undefined") {
85431
- payload["queries"] = queries;
85432
- }
85433
- const uri = new URL(this.client.config.endpoint + apiPath);
85434
- const apiHeaders = {
85435
- "X-Appwrite-Project": this.client.config.project,
85436
- "accept": "application/json"
85437
- };
85438
- return this.client.call("get", uri, apiHeaders, payload);
85439
- }
85440
85441
  getCollectionUsage(paramsOrFirst, ...rest) {
85441
85442
  let params;
85442
85443
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -85469,33 +85470,6 @@ var Databases = class {
85469
85470
  };
85470
85471
  return this.client.call("get", uri, apiHeaders, payload);
85471
85472
  }
85472
- listLogs(paramsOrFirst, ...rest) {
85473
- let params;
85474
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
85475
- params = paramsOrFirst || {};
85476
- } else {
85477
- params = {
85478
- databaseId: paramsOrFirst,
85479
- queries: rest[0]
85480
- };
85481
- }
85482
- const databaseId = params.databaseId;
85483
- const queries = params.queries;
85484
- if (typeof databaseId === "undefined") {
85485
- throw new AppwriteException('Missing required parameter: "databaseId"');
85486
- }
85487
- const apiPath = "/databases/{databaseId}/logs".replace("{databaseId}", encodeURIComponent(String(databaseId)));
85488
- const payload = {};
85489
- if (typeof queries !== "undefined") {
85490
- payload["queries"] = queries;
85491
- }
85492
- const uri = new URL(this.client.config.endpoint + apiPath);
85493
- const apiHeaders = {
85494
- "X-Appwrite-Project": this.client.config.project,
85495
- "accept": "application/json"
85496
- };
85497
- return this.client.call("get", uri, apiHeaders, payload);
85498
- }
85499
85473
  getUsage(paramsOrFirst, ...rest) {
85500
85474
  let params;
85501
85475
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -87428,38 +87402,6 @@ var Messaging = class {
87428
87402
  };
87429
87403
  return this.client.call("delete", uri, apiHeaders, payload);
87430
87404
  }
87431
- listMessageLogs(paramsOrFirst, ...rest) {
87432
- let params;
87433
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
87434
- params = paramsOrFirst || {};
87435
- } else {
87436
- params = {
87437
- messageId: paramsOrFirst,
87438
- queries: rest[0],
87439
- total: rest[1]
87440
- };
87441
- }
87442
- const messageId = params.messageId;
87443
- const queries = params.queries;
87444
- const total = params.total;
87445
- if (typeof messageId === "undefined") {
87446
- throw new AppwriteException('Missing required parameter: "messageId"');
87447
- }
87448
- const apiPath = "/messaging/messages/{messageId}/logs".replace("{messageId}", encodeURIComponent(String(messageId)));
87449
- const payload = {};
87450
- if (typeof queries !== "undefined") {
87451
- payload["queries"] = queries;
87452
- }
87453
- if (typeof total !== "undefined") {
87454
- payload["total"] = total;
87455
- }
87456
- const uri = new URL(this.client.config.endpoint + apiPath);
87457
- const apiHeaders = {
87458
- "X-Appwrite-Project": this.client.config.project,
87459
- "accept": "application/json"
87460
- };
87461
- return this.client.call("get", uri, apiHeaders, payload);
87462
- }
87463
87405
  listTargets(paramsOrFirst, ...rest) {
87464
87406
  let params;
87465
87407
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -89384,70 +89326,6 @@ var Messaging = class {
89384
89326
  };
89385
89327
  return this.client.call("delete", uri, apiHeaders, payload);
89386
89328
  }
89387
- listProviderLogs(paramsOrFirst, ...rest) {
89388
- let params;
89389
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
89390
- params = paramsOrFirst || {};
89391
- } else {
89392
- params = {
89393
- providerId: paramsOrFirst,
89394
- queries: rest[0],
89395
- total: rest[1]
89396
- };
89397
- }
89398
- const providerId = params.providerId;
89399
- const queries = params.queries;
89400
- const total = params.total;
89401
- if (typeof providerId === "undefined") {
89402
- throw new AppwriteException('Missing required parameter: "providerId"');
89403
- }
89404
- const apiPath = "/messaging/providers/{providerId}/logs".replace("{providerId}", encodeURIComponent(String(providerId)));
89405
- const payload = {};
89406
- if (typeof queries !== "undefined") {
89407
- payload["queries"] = queries;
89408
- }
89409
- if (typeof total !== "undefined") {
89410
- payload["total"] = total;
89411
- }
89412
- const uri = new URL(this.client.config.endpoint + apiPath);
89413
- const apiHeaders = {
89414
- "X-Appwrite-Project": this.client.config.project,
89415
- "accept": "application/json"
89416
- };
89417
- return this.client.call("get", uri, apiHeaders, payload);
89418
- }
89419
- listSubscriberLogs(paramsOrFirst, ...rest) {
89420
- let params;
89421
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
89422
- params = paramsOrFirst || {};
89423
- } else {
89424
- params = {
89425
- subscriberId: paramsOrFirst,
89426
- queries: rest[0],
89427
- total: rest[1]
89428
- };
89429
- }
89430
- const subscriberId = params.subscriberId;
89431
- const queries = params.queries;
89432
- const total = params.total;
89433
- if (typeof subscriberId === "undefined") {
89434
- throw new AppwriteException('Missing required parameter: "subscriberId"');
89435
- }
89436
- const apiPath = "/messaging/subscribers/{subscriberId}/logs".replace("{subscriberId}", encodeURIComponent(String(subscriberId)));
89437
- const payload = {};
89438
- if (typeof queries !== "undefined") {
89439
- payload["queries"] = queries;
89440
- }
89441
- if (typeof total !== "undefined") {
89442
- payload["total"] = total;
89443
- }
89444
- const uri = new URL(this.client.config.endpoint + apiPath);
89445
- const apiHeaders = {
89446
- "X-Appwrite-Project": this.client.config.project,
89447
- "accept": "application/json"
89448
- };
89449
- return this.client.call("get", uri, apiHeaders, payload);
89450
- }
89451
89329
  listTopics(paramsOrFirst, ...rest) {
89452
89330
  let params;
89453
89331
  if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -89596,38 +89474,6 @@ var Messaging = class {
89596
89474
  };
89597
89475
  return this.client.call("delete", uri, apiHeaders, payload);
89598
89476
  }
89599
- listTopicLogs(paramsOrFirst, ...rest) {
89600
- let params;
89601
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
89602
- params = paramsOrFirst || {};
89603
- } else {
89604
- params = {
89605
- topicId: paramsOrFirst,
89606
- queries: rest[0],
89607
- total: rest[1]
89608
- };
89609
- }
89610
- const topicId = params.topicId;
89611
- const queries = params.queries;
89612
- const total = params.total;
89613
- if (typeof topicId === "undefined") {
89614
- throw new AppwriteException('Missing required parameter: "topicId"');
89615
- }
89616
- const apiPath = "/messaging/topics/{topicId}/logs".replace("{topicId}", encodeURIComponent(String(topicId)));
89617
- const payload = {};
89618
- if (typeof queries !== "undefined") {
89619
- payload["queries"] = queries;
89620
- }
89621
- if (typeof total !== "undefined") {
89622
- payload["total"] = total;
89623
- }
89624
- const uri = new URL(this.client.config.endpoint + apiPath);
89625
- const apiHeaders = {
89626
- "X-Appwrite-Project": this.client.config.project,
89627
- "accept": "application/json"
89628
- };
89629
- return this.client.call("get", uri, apiHeaders, payload);
89630
- }
89631
89477
  listSubscribers(paramsOrFirst, ...rest) {
89632
89478
  let params;
89633
89479
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -89770,11 +89616,13 @@ var Oauth2 = class {
89770
89616
  } else {
89771
89617
  params = {
89772
89618
  grantId: paramsOrFirst,
89773
- authorizationDetails: rest[0]
89619
+ authorizationDetails: rest[0],
89620
+ scope: rest[1]
89774
89621
  };
89775
89622
  }
89776
89623
  const grantId = params.grantId;
89777
89624
  const authorizationDetails = params.authorizationDetails;
89625
+ const scope = params.scope;
89778
89626
  if (typeof grantId === "undefined") {
89779
89627
  throw new AppwriteException('Missing required parameter: "grantId"');
89780
89628
  }
@@ -89786,6 +89634,9 @@ var Oauth2 = class {
89786
89634
  if (typeof authorizationDetails !== "undefined") {
89787
89635
  payload["authorization_details"] = authorizationDetails;
89788
89636
  }
89637
+ if (typeof scope !== "undefined") {
89638
+ payload["scope"] = scope;
89639
+ }
89789
89640
  const uri = new URL(this.client.config.endpoint + apiPath);
89790
89641
  const apiHeaders = {
89791
89642
  "content-type": "application/json",
@@ -89795,7 +89646,7 @@ var Oauth2 = class {
89795
89646
  }
89796
89647
  authorize(paramsOrFirst, ...rest) {
89797
89648
  let params;
89798
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
89649
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
89799
89650
  params = paramsOrFirst || {};
89800
89651
  } else {
89801
89652
  params = {
@@ -89810,7 +89661,8 @@ var Oauth2 = class {
89810
89661
  prompt: rest[7],
89811
89662
  maxAge: rest[8],
89812
89663
  authorizationDetails: rest[9],
89813
- resource: rest[10]
89664
+ resource: rest[10],
89665
+ requestUri: rest[11]
89814
89666
  };
89815
89667
  }
89816
89668
  const clientId = params.clientId;
@@ -89825,18 +89677,7 @@ var Oauth2 = class {
89825
89677
  const maxAge = params.maxAge;
89826
89678
  const authorizationDetails = params.authorizationDetails;
89827
89679
  const resource = params.resource;
89828
- if (typeof clientId === "undefined") {
89829
- throw new AppwriteException('Missing required parameter: "clientId"');
89830
- }
89831
- if (typeof redirectUri === "undefined") {
89832
- throw new AppwriteException('Missing required parameter: "redirectUri"');
89833
- }
89834
- if (typeof responseType === "undefined") {
89835
- throw new AppwriteException('Missing required parameter: "responseType"');
89836
- }
89837
- if (typeof scope === "undefined") {
89838
- throw new AppwriteException('Missing required parameter: "scope"');
89839
- }
89680
+ const requestUri = params.requestUri;
89840
89681
  const apiPath = "/oauth2/{project_id}/authorize".replace("{project_id}", encodeURIComponent(String(this.client.config.project)));
89841
89682
  const payload = {};
89842
89683
  if (typeof clientId !== "undefined") {
@@ -89875,6 +89716,9 @@ var Oauth2 = class {
89875
89716
  if (typeof resource !== "undefined") {
89876
89717
  payload["resource"] = resource;
89877
89718
  }
89719
+ if (typeof requestUri !== "undefined") {
89720
+ payload["request_uri"] = requestUri;
89721
+ }
89878
89722
  const uri = new URL(this.client.config.endpoint + apiPath);
89879
89723
  const apiHeaders = {
89880
89724
  "accept": "application/json"
@@ -90010,6 +89854,157 @@ var Oauth2 = class {
90010
89854
  };
90011
89855
  return this.client.call("get", uri, apiHeaders, payload);
90012
89856
  }
89857
+ listOrganizations(paramsOrFirst, ...rest) {
89858
+ let params;
89859
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
89860
+ params = paramsOrFirst || {};
89861
+ } else {
89862
+ params = {
89863
+ limit: paramsOrFirst,
89864
+ offset: rest[0],
89865
+ search: rest[1]
89866
+ };
89867
+ }
89868
+ const limit = params.limit;
89869
+ const offset = params.offset;
89870
+ const search = params.search;
89871
+ const apiPath = "/oauth2/{project_id}/organizations".replace("{project_id}", encodeURIComponent(String(this.client.config.project)));
89872
+ const payload = {};
89873
+ if (typeof limit !== "undefined") {
89874
+ payload["limit"] = limit;
89875
+ }
89876
+ if (typeof offset !== "undefined") {
89877
+ payload["offset"] = offset;
89878
+ }
89879
+ if (typeof search !== "undefined") {
89880
+ payload["search"] = search;
89881
+ }
89882
+ const uri = new URL(this.client.config.endpoint + apiPath);
89883
+ const apiHeaders = {
89884
+ "accept": "application/json"
89885
+ };
89886
+ return this.client.call("get", uri, apiHeaders, payload);
89887
+ }
89888
+ createPAR(paramsOrFirst, ...rest) {
89889
+ let params;
89890
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
89891
+ params = paramsOrFirst || {};
89892
+ } else {
89893
+ params = {
89894
+ clientId: paramsOrFirst,
89895
+ redirectUri: rest[0],
89896
+ responseType: rest[1],
89897
+ scope: rest[2],
89898
+ state: rest[3],
89899
+ nonce: rest[4],
89900
+ codeChallenge: rest[5],
89901
+ codeChallengeMethod: rest[6],
89902
+ prompt: rest[7],
89903
+ maxAge: rest[8],
89904
+ authorizationDetails: rest[9],
89905
+ resource: rest[10]
89906
+ };
89907
+ }
89908
+ const clientId = params.clientId;
89909
+ const redirectUri = params.redirectUri;
89910
+ const responseType = params.responseType;
89911
+ const scope = params.scope;
89912
+ const state = params.state;
89913
+ const nonce = params.nonce;
89914
+ const codeChallenge = params.codeChallenge;
89915
+ const codeChallengeMethod = params.codeChallengeMethod;
89916
+ const prompt = params.prompt;
89917
+ const maxAge = params.maxAge;
89918
+ const authorizationDetails = params.authorizationDetails;
89919
+ const resource = params.resource;
89920
+ if (typeof clientId === "undefined") {
89921
+ throw new AppwriteException('Missing required parameter: "clientId"');
89922
+ }
89923
+ if (typeof redirectUri === "undefined") {
89924
+ throw new AppwriteException('Missing required parameter: "redirectUri"');
89925
+ }
89926
+ if (typeof responseType === "undefined") {
89927
+ throw new AppwriteException('Missing required parameter: "responseType"');
89928
+ }
89929
+ if (typeof scope === "undefined") {
89930
+ throw new AppwriteException('Missing required parameter: "scope"');
89931
+ }
89932
+ const apiPath = "/oauth2/{project_id}/par".replace("{project_id}", encodeURIComponent(String(this.client.config.project)));
89933
+ const payload = {};
89934
+ if (typeof clientId !== "undefined") {
89935
+ payload["client_id"] = clientId;
89936
+ }
89937
+ if (typeof redirectUri !== "undefined") {
89938
+ payload["redirect_uri"] = redirectUri;
89939
+ }
89940
+ if (typeof responseType !== "undefined") {
89941
+ payload["response_type"] = responseType;
89942
+ }
89943
+ if (typeof scope !== "undefined") {
89944
+ payload["scope"] = scope;
89945
+ }
89946
+ if (typeof state !== "undefined") {
89947
+ payload["state"] = state;
89948
+ }
89949
+ if (typeof nonce !== "undefined") {
89950
+ payload["nonce"] = nonce;
89951
+ }
89952
+ if (typeof codeChallenge !== "undefined") {
89953
+ payload["code_challenge"] = codeChallenge;
89954
+ }
89955
+ if (typeof codeChallengeMethod !== "undefined") {
89956
+ payload["code_challenge_method"] = codeChallengeMethod;
89957
+ }
89958
+ if (typeof prompt !== "undefined") {
89959
+ payload["prompt"] = prompt;
89960
+ }
89961
+ if (typeof maxAge !== "undefined") {
89962
+ payload["max_age"] = maxAge;
89963
+ }
89964
+ if (typeof authorizationDetails !== "undefined") {
89965
+ payload["authorization_details"] = authorizationDetails;
89966
+ }
89967
+ if (typeof resource !== "undefined") {
89968
+ payload["resource"] = resource;
89969
+ }
89970
+ const uri = new URL(this.client.config.endpoint + apiPath);
89971
+ const apiHeaders = {
89972
+ "content-type": "application/json",
89973
+ "accept": "application/json"
89974
+ };
89975
+ return this.client.call("post", uri, apiHeaders, payload);
89976
+ }
89977
+ listProjects(paramsOrFirst, ...rest) {
89978
+ let params;
89979
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
89980
+ params = paramsOrFirst || {};
89981
+ } else {
89982
+ params = {
89983
+ limit: paramsOrFirst,
89984
+ offset: rest[0],
89985
+ search: rest[1]
89986
+ };
89987
+ }
89988
+ const limit = params.limit;
89989
+ const offset = params.offset;
89990
+ const search = params.search;
89991
+ const apiPath = "/oauth2/{project_id}/projects".replace("{project_id}", encodeURIComponent(String(this.client.config.project)));
89992
+ const payload = {};
89993
+ if (typeof limit !== "undefined") {
89994
+ payload["limit"] = limit;
89995
+ }
89996
+ if (typeof offset !== "undefined") {
89997
+ payload["offset"] = offset;
89998
+ }
89999
+ if (typeof search !== "undefined") {
90000
+ payload["search"] = search;
90001
+ }
90002
+ const uri = new URL(this.client.config.endpoint + apiPath);
90003
+ const apiHeaders = {
90004
+ "accept": "application/json"
90005
+ };
90006
+ return this.client.call("get", uri, apiHeaders, payload);
90007
+ }
90013
90008
  reject(paramsOrFirst) {
90014
90009
  let params;
90015
90010
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -90145,6 +90140,64 @@ var Organization = class {
90145
90140
  constructor(client) {
90146
90141
  this.client = client;
90147
90142
  }
90143
+ /**
90144
+ * Get the current organization.
90145
+ *
90146
+ * @throws {AppwriteException}
90147
+ * @returns {Promise<Models.Organization<Preferences>>}
90148
+ */
90149
+ get() {
90150
+ const apiPath = "/organization";
90151
+ const payload = {};
90152
+ const uri = new URL(this.client.config.endpoint + apiPath);
90153
+ const apiHeaders = {
90154
+ "X-Appwrite-Project": this.client.config.project,
90155
+ "accept": "application/json"
90156
+ };
90157
+ return this.client.call("get", uri, apiHeaders, payload);
90158
+ }
90159
+ update(paramsOrFirst) {
90160
+ let params;
90161
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
90162
+ params = paramsOrFirst || {};
90163
+ } else {
90164
+ params = {
90165
+ name: paramsOrFirst
90166
+ };
90167
+ }
90168
+ const name = params.name;
90169
+ if (typeof name === "undefined") {
90170
+ throw new AppwriteException('Missing required parameter: "name"');
90171
+ }
90172
+ const apiPath = "/organization";
90173
+ const payload = {};
90174
+ if (typeof name !== "undefined") {
90175
+ payload["name"] = name;
90176
+ }
90177
+ const uri = new URL(this.client.config.endpoint + apiPath);
90178
+ const apiHeaders = {
90179
+ "X-Appwrite-Project": this.client.config.project,
90180
+ "content-type": "application/json",
90181
+ "accept": "application/json"
90182
+ };
90183
+ return this.client.call("put", uri, apiHeaders, payload);
90184
+ }
90185
+ /**
90186
+ * Delete the current organization. All projects that belong to the organization are deleted as well.
90187
+ *
90188
+ * @throws {AppwriteException}
90189
+ * @returns {Promise<{}>}
90190
+ */
90191
+ delete() {
90192
+ const apiPath = "/organization";
90193
+ const payload = {};
90194
+ const uri = new URL(this.client.config.endpoint + apiPath);
90195
+ const apiHeaders = {
90196
+ "X-Appwrite-Project": this.client.config.project,
90197
+ "content-type": "application/json"
90198
+ };
90199
+ return this.client.call("delete", uri, apiHeaders, payload);
90200
+ }
90148
90201
  listKeys(paramsOrFirst, ...rest) {
90149
90202
  let params;
90150
90203
  if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -90307,6 +90360,164 @@ var Organization = class {
90307
90360
  };
90308
90361
  return this.client.call("delete", uri, apiHeaders, payload);
90309
90362
  }
90363
+ listMemberships(paramsOrFirst, ...rest) {
90364
+ let params;
90365
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
90366
+ params = paramsOrFirst || {};
90367
+ } else {
90368
+ params = {
90369
+ queries: paramsOrFirst,
90370
+ search: rest[0],
90371
+ total: rest[1]
90372
+ };
90373
+ }
90374
+ const queries = params.queries;
90375
+ const search = params.search;
90376
+ const total = params.total;
90377
+ const apiPath = "/organization/memberships";
90378
+ const payload = {};
90379
+ if (typeof queries !== "undefined") {
90380
+ payload["queries"] = queries;
90381
+ }
90382
+ if (typeof search !== "undefined") {
90383
+ payload["search"] = search;
90384
+ }
90385
+ if (typeof total !== "undefined") {
90386
+ payload["total"] = total;
90387
+ }
90388
+ const uri = new URL(this.client.config.endpoint + apiPath);
90389
+ const apiHeaders = {
90390
+ "X-Appwrite-Project": this.client.config.project,
90391
+ "accept": "application/json"
90392
+ };
90393
+ return this.client.call("get", uri, apiHeaders, payload);
90394
+ }
90395
+ createMembership(paramsOrFirst, ...rest) {
90396
+ let params;
90397
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
90398
+ params = paramsOrFirst || {};
90399
+ } else {
90400
+ params = {
90401
+ roles: paramsOrFirst,
90402
+ email: rest[0],
90403
+ userId: rest[1],
90404
+ phone: rest[2],
90405
+ url: rest[3],
90406
+ name: rest[4]
90407
+ };
90408
+ }
90409
+ const roles = params.roles;
90410
+ const email3 = params.email;
90411
+ const userId = params.userId;
90412
+ const phone = params.phone;
90413
+ const url2 = params.url;
90414
+ const name = params.name;
90415
+ if (typeof roles === "undefined") {
90416
+ throw new AppwriteException('Missing required parameter: "roles"');
90417
+ }
90418
+ const apiPath = "/organization/memberships";
90419
+ const payload = {};
90420
+ if (typeof email3 !== "undefined") {
90421
+ payload["email"] = email3;
90422
+ }
90423
+ if (typeof userId !== "undefined") {
90424
+ payload["userId"] = userId;
90425
+ }
90426
+ if (typeof phone !== "undefined") {
90427
+ payload["phone"] = phone;
90428
+ }
90429
+ if (typeof roles !== "undefined") {
90430
+ payload["roles"] = roles;
90431
+ }
90432
+ if (typeof url2 !== "undefined") {
90433
+ payload["url"] = url2;
90434
+ }
90435
+ if (typeof name !== "undefined") {
90436
+ payload["name"] = name;
90437
+ }
90438
+ const uri = new URL(this.client.config.endpoint + apiPath);
90439
+ const apiHeaders = {
90440
+ "X-Appwrite-Project": this.client.config.project,
90441
+ "content-type": "application/json",
90442
+ "accept": "application/json"
90443
+ };
90444
+ return this.client.call("post", uri, apiHeaders, payload);
90445
+ }
90446
+ getMembership(paramsOrFirst) {
90447
+ let params;
90448
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
90449
+ params = paramsOrFirst || {};
90450
+ } else {
90451
+ params = {
90452
+ membershipId: paramsOrFirst
90453
+ };
90454
+ }
90455
+ const membershipId = params.membershipId;
90456
+ if (typeof membershipId === "undefined") {
90457
+ throw new AppwriteException('Missing required parameter: "membershipId"');
90458
+ }
90459
+ const apiPath = "/organization/memberships/{membershipId}".replace("{membershipId}", encodeURIComponent(String(membershipId)));
90460
+ const payload = {};
90461
+ const uri = new URL(this.client.config.endpoint + apiPath);
90462
+ const apiHeaders = {
90463
+ "X-Appwrite-Project": this.client.config.project,
90464
+ "accept": "application/json"
90465
+ };
90466
+ return this.client.call("get", uri, apiHeaders, payload);
90467
+ }
90468
+ updateMembership(paramsOrFirst, ...rest) {
90469
+ let params;
90470
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
90471
+ params = paramsOrFirst || {};
90472
+ } else {
90473
+ params = {
90474
+ membershipId: paramsOrFirst,
90475
+ roles: rest[0]
90476
+ };
90477
+ }
90478
+ const membershipId = params.membershipId;
90479
+ const roles = params.roles;
90480
+ if (typeof membershipId === "undefined") {
90481
+ throw new AppwriteException('Missing required parameter: "membershipId"');
90482
+ }
90483
+ if (typeof roles === "undefined") {
90484
+ throw new AppwriteException('Missing required parameter: "roles"');
90485
+ }
90486
+ const apiPath = "/organization/memberships/{membershipId}".replace("{membershipId}", encodeURIComponent(String(membershipId)));
90487
+ const payload = {};
90488
+ if (typeof roles !== "undefined") {
90489
+ payload["roles"] = roles;
90490
+ }
90491
+ const uri = new URL(this.client.config.endpoint + apiPath);
90492
+ const apiHeaders = {
90493
+ "X-Appwrite-Project": this.client.config.project,
90494
+ "content-type": "application/json",
90495
+ "accept": "application/json"
90496
+ };
90497
+ return this.client.call("patch", uri, apiHeaders, payload);
90498
+ }
90499
+ deleteMembership(paramsOrFirst) {
90500
+ let params;
90501
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
90502
+ params = paramsOrFirst || {};
90503
+ } else {
90504
+ params = {
90505
+ membershipId: paramsOrFirst
90506
+ };
90507
+ }
90508
+ const membershipId = params.membershipId;
90509
+ if (typeof membershipId === "undefined") {
90510
+ throw new AppwriteException('Missing required parameter: "membershipId"');
90511
+ }
90512
+ const apiPath = "/organization/memberships/{membershipId}".replace("{membershipId}", encodeURIComponent(String(membershipId)));
90513
+ const payload = {};
90514
+ const uri = new URL(this.client.config.endpoint + apiPath);
90515
+ const apiHeaders = {
90516
+ "X-Appwrite-Project": this.client.config.project,
90517
+ "content-type": "application/json"
90518
+ };
90519
+ return this.client.call("delete", uri, apiHeaders, payload);
90520
+ }
90310
90521
  listProjects(paramsOrFirst, ...rest) {
90311
90522
  let params;
90312
90523
  if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -90675,6 +90886,29 @@ var Organizations = class {
90675
90886
  };
90676
90887
  return this.client.call("post", uri, apiHeaders, payload);
90677
90888
  }
90889
+ createPremiumGeoDBAddon(paramsOrFirst) {
90890
+ let params;
90891
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
90892
+ params = paramsOrFirst || {};
90893
+ } else {
90894
+ params = {
90895
+ organizationId: paramsOrFirst
90896
+ };
90897
+ }
90898
+ const organizationId = params.organizationId;
90899
+ if (typeof organizationId === "undefined") {
90900
+ throw new AppwriteException('Missing required parameter: "organizationId"');
90901
+ }
90902
+ const apiPath = "/organizations/{organizationId}/addons/premium-geo-db".replace("{organizationId}", encodeURIComponent(String(organizationId)));
90903
+ const payload = {};
90904
+ const uri = new URL(this.client.config.endpoint + apiPath);
90905
+ const apiHeaders = {
90906
+ "X-Appwrite-Project": this.client.config.project,
90907
+ "content-type": "application/json",
90908
+ "accept": "application/json"
90909
+ };
90910
+ return this.client.call("post", uri, apiHeaders, payload);
90911
+ }
90678
90912
  getAddon(paramsOrFirst, ...rest) {
90679
90913
  let params;
90680
90914
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -93220,7 +93454,9 @@ var Project = class {
93220
93454
  authorizationURL: rest[2],
93221
93455
  tokenURL: rest[3],
93222
93456
  userInfoURL: rest[4],
93223
- enabled: rest[5]
93457
+ prompt: rest[5],
93458
+ maxAge: rest[6],
93459
+ enabled: rest[7]
93224
93460
  };
93225
93461
  }
93226
93462
  const clientId = params.clientId;
@@ -93229,6 +93465,8 @@ var Project = class {
93229
93465
  const authorizationURL = params.authorizationURL;
93230
93466
  const tokenURL = params.tokenURL;
93231
93467
  const userInfoURL = params.userInfoURL;
93468
+ const prompt = params.prompt;
93469
+ const maxAge = params.maxAge;
93232
93470
  const enabled = params.enabled;
93233
93471
  const apiPath = "/project/oauth2/oidc";
93234
93472
  const payload = {};
@@ -93250,6 +93488,12 @@ var Project = class {
93250
93488
  if (typeof userInfoURL !== "undefined") {
93251
93489
  payload["userInfoURL"] = userInfoURL;
93252
93490
  }
93491
+ if (typeof prompt !== "undefined") {
93492
+ payload["prompt"] = prompt;
93493
+ }
93494
+ if (typeof maxAge !== "undefined") {
93495
+ payload["maxAge"] = maxAge;
93496
+ }
93253
93497
  if (typeof enabled !== "undefined") {
93254
93498
  payload["enabled"] = enabled;
93255
93499
  }
@@ -97339,13 +97583,13 @@ var TablesDB = class {
97339
97583
  databaseId: paramsOrFirst,
97340
97584
  name: rest[0],
97341
97585
  enabled: rest[1],
97342
- dedicatedDatabaseId: rest[2]
97586
+ specification: rest[2]
97343
97587
  };
97344
97588
  }
97345
97589
  const databaseId = params.databaseId;
97346
97590
  const name = params.name;
97347
97591
  const enabled = params.enabled;
97348
- const dedicatedDatabaseId = params.dedicatedDatabaseId;
97592
+ const specification = params.specification;
97349
97593
  if (typeof databaseId === "undefined") {
97350
97594
  throw new AppwriteException('Missing required parameter: "databaseId"');
97351
97595
  }
@@ -97363,8 +97607,8 @@ var TablesDB = class {
97363
97607
  if (typeof enabled !== "undefined") {
97364
97608
  payload["enabled"] = enabled;
97365
97609
  }
97366
- if (typeof dedicatedDatabaseId !== "undefined") {
97367
- payload["dedicatedDatabaseId"] = dedicatedDatabaseId;
97610
+ if (typeof specification !== "undefined") {
97611
+ payload["specification"] = specification;
97368
97612
  }
97369
97613
  const uri = new URL(this.client.config.endpoint + apiPath);
97370
97614
  const apiHeaders = {
@@ -97623,6 +97867,114 @@ var TablesDB = class {
97623
97867
  };
97624
97868
  return this.client.call("delete", uri, apiHeaders, payload);
97625
97869
  }
97870
+ listMigrations(paramsOrFirst) {
97871
+ let params;
97872
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
97873
+ params = paramsOrFirst || {};
97874
+ } else {
97875
+ params = {
97876
+ databaseId: paramsOrFirst
97877
+ };
97878
+ }
97879
+ const databaseId = params.databaseId;
97880
+ if (typeof databaseId === "undefined") {
97881
+ throw new AppwriteException('Missing required parameter: "databaseId"');
97882
+ }
97883
+ const apiPath = "/tablesdb/{databaseId}/migrations".replace("{databaseId}", encodeURIComponent(String(databaseId)));
97884
+ const payload = {};
97885
+ const uri = new URL(this.client.config.endpoint + apiPath);
97886
+ const apiHeaders = {
97887
+ "X-Appwrite-Project": this.client.config.project,
97888
+ "accept": "application/json"
97889
+ };
97890
+ return this.client.call("get", uri, apiHeaders, payload);
97891
+ }
97892
+ createMigration(paramsOrFirst, ...rest) {
97893
+ let params;
97894
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
97895
+ params = paramsOrFirst || {};
97896
+ } else {
97897
+ params = {
97898
+ databaseId: paramsOrFirst,
97899
+ specification: rest[0]
97900
+ };
97901
+ }
97902
+ const databaseId = params.databaseId;
97903
+ const specification = params.specification;
97904
+ if (typeof databaseId === "undefined") {
97905
+ throw new AppwriteException('Missing required parameter: "databaseId"');
97906
+ }
97907
+ if (typeof specification === "undefined") {
97908
+ throw new AppwriteException('Missing required parameter: "specification"');
97909
+ }
97910
+ const apiPath = "/tablesdb/{databaseId}/migrations".replace("{databaseId}", encodeURIComponent(String(databaseId)));
97911
+ const payload = {};
97912
+ if (typeof specification !== "undefined") {
97913
+ payload["specification"] = specification;
97914
+ }
97915
+ const uri = new URL(this.client.config.endpoint + apiPath);
97916
+ const apiHeaders = {
97917
+ "X-Appwrite-Project": this.client.config.project,
97918
+ "content-type": "application/json",
97919
+ "accept": "application/json"
97920
+ };
97921
+ return this.client.call("post", uri, apiHeaders, payload);
97922
+ }
97923
+ getMigration(paramsOrFirst, ...rest) {
97924
+ let params;
97925
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
97926
+ params = paramsOrFirst || {};
97927
+ } else {
97928
+ params = {
97929
+ databaseId: paramsOrFirst,
97930
+ migrationId: rest[0]
97931
+ };
97932
+ }
97933
+ const databaseId = params.databaseId;
97934
+ const migrationId = params.migrationId;
97935
+ if (typeof databaseId === "undefined") {
97936
+ throw new AppwriteException('Missing required parameter: "databaseId"');
97937
+ }
97938
+ if (typeof migrationId === "undefined") {
97939
+ throw new AppwriteException('Missing required parameter: "migrationId"');
97940
+ }
97941
+ const apiPath = "/tablesdb/{databaseId}/migrations/{migrationId}".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{migrationId}", encodeURIComponent(String(migrationId)));
97942
+ const payload = {};
97943
+ const uri = new URL(this.client.config.endpoint + apiPath);
97944
+ const apiHeaders = {
97945
+ "X-Appwrite-Project": this.client.config.project,
97946
+ "accept": "application/json"
97947
+ };
97948
+ return this.client.call("get", uri, apiHeaders, payload);
97949
+ }
97950
+ deleteMigration(paramsOrFirst, ...rest) {
97951
+ let params;
97952
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
97953
+ params = paramsOrFirst || {};
97954
+ } else {
97955
+ params = {
97956
+ databaseId: paramsOrFirst,
97957
+ migrationId: rest[0]
97958
+ };
97959
+ }
97960
+ const databaseId = params.databaseId;
97961
+ const migrationId = params.migrationId;
97962
+ if (typeof databaseId === "undefined") {
97963
+ throw new AppwriteException('Missing required parameter: "databaseId"');
97964
+ }
97965
+ if (typeof migrationId === "undefined") {
97966
+ throw new AppwriteException('Missing required parameter: "migrationId"');
97967
+ }
97968
+ const apiPath = "/tablesdb/{databaseId}/migrations/{migrationId}".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{migrationId}", encodeURIComponent(String(migrationId)));
97969
+ const payload = {};
97970
+ const uri = new URL(this.client.config.endpoint + apiPath);
97971
+ const apiHeaders = {
97972
+ "X-Appwrite-Project": this.client.config.project,
97973
+ "content-type": "application/json",
97974
+ "accept": "application/json"
97975
+ };
97976
+ return this.client.call("delete", uri, apiHeaders, payload);
97977
+ }
97626
97978
  listTables(paramsOrFirst, ...rest) {
97627
97979
  let params;
97628
97980
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -100141,38 +100493,6 @@ var TablesDB = class {
100141
100493
  };
100142
100494
  return this.client.call("delete", uri, apiHeaders, payload);
100143
100495
  }
100144
- listTableLogs(paramsOrFirst, ...rest) {
100145
- let params;
100146
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100147
- params = paramsOrFirst || {};
100148
- } else {
100149
- params = {
100150
- databaseId: paramsOrFirst,
100151
- tableId: rest[0],
100152
- queries: rest[1]
100153
- };
100154
- }
100155
- const databaseId = params.databaseId;
100156
- const tableId = params.tableId;
100157
- const queries = params.queries;
100158
- if (typeof databaseId === "undefined") {
100159
- throw new AppwriteException('Missing required parameter: "databaseId"');
100160
- }
100161
- if (typeof tableId === "undefined") {
100162
- throw new AppwriteException('Missing required parameter: "tableId"');
100163
- }
100164
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/logs".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100165
- const payload = {};
100166
- if (typeof queries !== "undefined") {
100167
- payload["queries"] = queries;
100168
- }
100169
- const uri = new URL(this.client.config.endpoint + apiPath);
100170
- const apiHeaders = {
100171
- "X-Appwrite-Project": this.client.config.project,
100172
- "accept": "application/json"
100173
- };
100174
- return this.client.call("get", uri, apiHeaders, payload);
100175
- }
100176
100496
  listRows(paramsOrFirst, ...rest) {
100177
100497
  let params;
100178
100498
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -100249,267 +100569,14 @@ var TablesDB = class {
100249
100569
  if (typeof rowId === "undefined") {
100250
100570
  throw new AppwriteException('Missing required parameter: "rowId"');
100251
100571
  }
100252
- if (typeof data === "undefined") {
100253
- throw new AppwriteException('Missing required parameter: "data"');
100254
- }
100255
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100256
- const payload = {};
100257
- if (typeof rowId !== "undefined") {
100258
- payload["rowId"] = rowId;
100259
- }
100260
- if (typeof data !== "undefined") {
100261
- payload["data"] = data;
100262
- }
100263
- if (typeof permissions !== "undefined") {
100264
- payload["permissions"] = permissions;
100265
- }
100266
- if (typeof transactionId !== "undefined") {
100267
- payload["transactionId"] = transactionId;
100268
- }
100269
- const uri = new URL(this.client.config.endpoint + apiPath);
100270
- const apiHeaders = {
100271
- "X-Appwrite-Project": this.client.config.project,
100272
- "content-type": "application/json",
100273
- "accept": "application/json"
100274
- };
100275
- return this.client.call("post", uri, apiHeaders, payload);
100276
- }
100277
- createRows(paramsOrFirst, ...rest) {
100278
- let params;
100279
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100280
- params = paramsOrFirst || {};
100281
- } else {
100282
- params = {
100283
- databaseId: paramsOrFirst,
100284
- tableId: rest[0],
100285
- rows: rest[1],
100286
- transactionId: rest[2]
100287
- };
100288
- }
100289
- const databaseId = params.databaseId;
100290
- const tableId = params.tableId;
100291
- const rows = params.rows;
100292
- const transactionId = params.transactionId;
100293
- if (typeof databaseId === "undefined") {
100294
- throw new AppwriteException('Missing required parameter: "databaseId"');
100295
- }
100296
- if (typeof tableId === "undefined") {
100297
- throw new AppwriteException('Missing required parameter: "tableId"');
100298
- }
100299
- if (typeof rows === "undefined") {
100300
- throw new AppwriteException('Missing required parameter: "rows"');
100301
- }
100302
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100303
- const payload = {};
100304
- if (typeof rows !== "undefined") {
100305
- payload["rows"] = rows;
100306
- }
100307
- if (typeof transactionId !== "undefined") {
100308
- payload["transactionId"] = transactionId;
100309
- }
100310
- const uri = new URL(this.client.config.endpoint + apiPath);
100311
- const apiHeaders = {
100312
- "X-Appwrite-Project": this.client.config.project,
100313
- "content-type": "application/json",
100314
- "accept": "application/json"
100315
- };
100316
- return this.client.call("post", uri, apiHeaders, payload);
100317
- }
100318
- upsertRows(paramsOrFirst, ...rest) {
100319
- let params;
100320
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100321
- params = paramsOrFirst || {};
100322
- } else {
100323
- params = {
100324
- databaseId: paramsOrFirst,
100325
- tableId: rest[0],
100326
- rows: rest[1],
100327
- transactionId: rest[2]
100328
- };
100329
- }
100330
- const databaseId = params.databaseId;
100331
- const tableId = params.tableId;
100332
- const rows = params.rows;
100333
- const transactionId = params.transactionId;
100334
- if (typeof databaseId === "undefined") {
100335
- throw new AppwriteException('Missing required parameter: "databaseId"');
100336
- }
100337
- if (typeof tableId === "undefined") {
100338
- throw new AppwriteException('Missing required parameter: "tableId"');
100339
- }
100340
- if (typeof rows === "undefined") {
100341
- throw new AppwriteException('Missing required parameter: "rows"');
100342
- }
100343
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100344
- const payload = {};
100345
- if (typeof rows !== "undefined") {
100346
- payload["rows"] = rows;
100347
- }
100348
- if (typeof transactionId !== "undefined") {
100349
- payload["transactionId"] = transactionId;
100350
- }
100351
- const uri = new URL(this.client.config.endpoint + apiPath);
100352
- const apiHeaders = {
100353
- "X-Appwrite-Project": this.client.config.project,
100354
- "content-type": "application/json",
100355
- "accept": "application/json"
100356
- };
100357
- return this.client.call("put", uri, apiHeaders, payload);
100358
- }
100359
- updateRows(paramsOrFirst, ...rest) {
100360
- let params;
100361
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100362
- params = paramsOrFirst || {};
100363
- } else {
100364
- params = {
100365
- databaseId: paramsOrFirst,
100366
- tableId: rest[0],
100367
- data: rest[1],
100368
- queries: rest[2],
100369
- transactionId: rest[3]
100370
- };
100371
- }
100372
- const databaseId = params.databaseId;
100373
- const tableId = params.tableId;
100374
- const data = params.data;
100375
- const queries = params.queries;
100376
- const transactionId = params.transactionId;
100377
- if (typeof databaseId === "undefined") {
100378
- throw new AppwriteException('Missing required parameter: "databaseId"');
100379
- }
100380
- if (typeof tableId === "undefined") {
100381
- throw new AppwriteException('Missing required parameter: "tableId"');
100382
- }
100383
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100384
- const payload = {};
100385
- if (typeof data !== "undefined") {
100386
- payload["data"] = data;
100387
- }
100388
- if (typeof queries !== "undefined") {
100389
- payload["queries"] = queries;
100390
- }
100391
- if (typeof transactionId !== "undefined") {
100392
- payload["transactionId"] = transactionId;
100393
- }
100394
- const uri = new URL(this.client.config.endpoint + apiPath);
100395
- const apiHeaders = {
100396
- "X-Appwrite-Project": this.client.config.project,
100397
- "content-type": "application/json",
100398
- "accept": "application/json"
100399
- };
100400
- return this.client.call("patch", uri, apiHeaders, payload);
100401
- }
100402
- deleteRows(paramsOrFirst, ...rest) {
100403
- let params;
100404
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100405
- params = paramsOrFirst || {};
100406
- } else {
100407
- params = {
100408
- databaseId: paramsOrFirst,
100409
- tableId: rest[0],
100410
- queries: rest[1],
100411
- transactionId: rest[2]
100412
- };
100413
- }
100414
- const databaseId = params.databaseId;
100415
- const tableId = params.tableId;
100416
- const queries = params.queries;
100417
- const transactionId = params.transactionId;
100418
- if (typeof databaseId === "undefined") {
100419
- throw new AppwriteException('Missing required parameter: "databaseId"');
100420
- }
100421
- if (typeof tableId === "undefined") {
100422
- throw new AppwriteException('Missing required parameter: "tableId"');
100423
- }
100424
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100425
- const payload = {};
100426
- if (typeof queries !== "undefined") {
100427
- payload["queries"] = queries;
100428
- }
100429
- if (typeof transactionId !== "undefined") {
100430
- payload["transactionId"] = transactionId;
100431
- }
100432
- const uri = new URL(this.client.config.endpoint + apiPath);
100433
- const apiHeaders = {
100434
- "X-Appwrite-Project": this.client.config.project,
100435
- "content-type": "application/json",
100436
- "accept": "application/json"
100437
- };
100438
- return this.client.call("delete", uri, apiHeaders, payload);
100439
- }
100440
- getRow(paramsOrFirst, ...rest) {
100441
- let params;
100442
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100443
- params = paramsOrFirst || {};
100444
- } else {
100445
- params = {
100446
- databaseId: paramsOrFirst,
100447
- tableId: rest[0],
100448
- rowId: rest[1],
100449
- queries: rest[2],
100450
- transactionId: rest[3]
100451
- };
100452
- }
100453
- const databaseId = params.databaseId;
100454
- const tableId = params.tableId;
100455
- const rowId = params.rowId;
100456
- const queries = params.queries;
100457
- const transactionId = params.transactionId;
100458
- if (typeof databaseId === "undefined") {
100459
- throw new AppwriteException('Missing required parameter: "databaseId"');
100460
- }
100461
- if (typeof tableId === "undefined") {
100462
- throw new AppwriteException('Missing required parameter: "tableId"');
100463
- }
100464
- if (typeof rowId === "undefined") {
100465
- throw new AppwriteException('Missing required parameter: "rowId"');
100466
- }
100467
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId))).replace("{rowId}", encodeURIComponent(String(rowId)));
100468
- const payload = {};
100469
- if (typeof queries !== "undefined") {
100470
- payload["queries"] = queries;
100471
- }
100472
- if (typeof transactionId !== "undefined") {
100473
- payload["transactionId"] = transactionId;
100474
- }
100475
- const uri = new URL(this.client.config.endpoint + apiPath);
100476
- const apiHeaders = {
100477
- "X-Appwrite-Project": this.client.config.project,
100478
- "accept": "application/json"
100479
- };
100480
- return this.client.call("get", uri, apiHeaders, payload);
100481
- }
100482
- upsertRow(paramsOrFirst, ...rest) {
100483
- let params;
100484
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100485
- params = paramsOrFirst || {};
100486
- } else {
100487
- params = {
100488
- databaseId: paramsOrFirst,
100489
- tableId: rest[0],
100490
- rowId: rest[1],
100491
- data: rest[2],
100492
- permissions: rest[3],
100493
- transactionId: rest[4]
100494
- };
100495
- }
100496
- const databaseId = params.databaseId;
100497
- const tableId = params.tableId;
100498
- const rowId = params.rowId;
100499
- const data = params.data;
100500
- const permissions = params.permissions;
100501
- const transactionId = params.transactionId;
100502
- if (typeof databaseId === "undefined") {
100503
- throw new AppwriteException('Missing required parameter: "databaseId"');
100504
- }
100505
- if (typeof tableId === "undefined") {
100506
- throw new AppwriteException('Missing required parameter: "tableId"');
100507
- }
100508
- if (typeof rowId === "undefined") {
100509
- throw new AppwriteException('Missing required parameter: "rowId"');
100510
- }
100511
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId))).replace("{rowId}", encodeURIComponent(String(rowId)));
100572
+ if (typeof data === "undefined") {
100573
+ throw new AppwriteException('Missing required parameter: "data"');
100574
+ }
100575
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100512
100576
  const payload = {};
100577
+ if (typeof rowId !== "undefined") {
100578
+ payload["rowId"] = rowId;
100579
+ }
100513
100580
  if (typeof data !== "undefined") {
100514
100581
  payload["data"] = data;
100515
100582
  }
@@ -100525,9 +100592,214 @@ var TablesDB = class {
100525
100592
  "content-type": "application/json",
100526
100593
  "accept": "application/json"
100527
100594
  };
100595
+ return this.client.call("post", uri, apiHeaders, payload);
100596
+ }
100597
+ createRows(paramsOrFirst, ...rest) {
100598
+ let params;
100599
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100600
+ params = paramsOrFirst || {};
100601
+ } else {
100602
+ params = {
100603
+ databaseId: paramsOrFirst,
100604
+ tableId: rest[0],
100605
+ rows: rest[1],
100606
+ transactionId: rest[2]
100607
+ };
100608
+ }
100609
+ const databaseId = params.databaseId;
100610
+ const tableId = params.tableId;
100611
+ const rows = params.rows;
100612
+ const transactionId = params.transactionId;
100613
+ if (typeof databaseId === "undefined") {
100614
+ throw new AppwriteException('Missing required parameter: "databaseId"');
100615
+ }
100616
+ if (typeof tableId === "undefined") {
100617
+ throw new AppwriteException('Missing required parameter: "tableId"');
100618
+ }
100619
+ if (typeof rows === "undefined") {
100620
+ throw new AppwriteException('Missing required parameter: "rows"');
100621
+ }
100622
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100623
+ const payload = {};
100624
+ if (typeof rows !== "undefined") {
100625
+ payload["rows"] = rows;
100626
+ }
100627
+ if (typeof transactionId !== "undefined") {
100628
+ payload["transactionId"] = transactionId;
100629
+ }
100630
+ const uri = new URL(this.client.config.endpoint + apiPath);
100631
+ const apiHeaders = {
100632
+ "X-Appwrite-Project": this.client.config.project,
100633
+ "content-type": "application/json",
100634
+ "accept": "application/json"
100635
+ };
100636
+ return this.client.call("post", uri, apiHeaders, payload);
100637
+ }
100638
+ upsertRows(paramsOrFirst, ...rest) {
100639
+ let params;
100640
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100641
+ params = paramsOrFirst || {};
100642
+ } else {
100643
+ params = {
100644
+ databaseId: paramsOrFirst,
100645
+ tableId: rest[0],
100646
+ rows: rest[1],
100647
+ transactionId: rest[2]
100648
+ };
100649
+ }
100650
+ const databaseId = params.databaseId;
100651
+ const tableId = params.tableId;
100652
+ const rows = params.rows;
100653
+ const transactionId = params.transactionId;
100654
+ if (typeof databaseId === "undefined") {
100655
+ throw new AppwriteException('Missing required parameter: "databaseId"');
100656
+ }
100657
+ if (typeof tableId === "undefined") {
100658
+ throw new AppwriteException('Missing required parameter: "tableId"');
100659
+ }
100660
+ if (typeof rows === "undefined") {
100661
+ throw new AppwriteException('Missing required parameter: "rows"');
100662
+ }
100663
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100664
+ const payload = {};
100665
+ if (typeof rows !== "undefined") {
100666
+ payload["rows"] = rows;
100667
+ }
100668
+ if (typeof transactionId !== "undefined") {
100669
+ payload["transactionId"] = transactionId;
100670
+ }
100671
+ const uri = new URL(this.client.config.endpoint + apiPath);
100672
+ const apiHeaders = {
100673
+ "X-Appwrite-Project": this.client.config.project,
100674
+ "content-type": "application/json",
100675
+ "accept": "application/json"
100676
+ };
100528
100677
  return this.client.call("put", uri, apiHeaders, payload);
100529
100678
  }
100530
- updateRow(paramsOrFirst, ...rest) {
100679
+ updateRows(paramsOrFirst, ...rest) {
100680
+ let params;
100681
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100682
+ params = paramsOrFirst || {};
100683
+ } else {
100684
+ params = {
100685
+ databaseId: paramsOrFirst,
100686
+ tableId: rest[0],
100687
+ data: rest[1],
100688
+ queries: rest[2],
100689
+ transactionId: rest[3]
100690
+ };
100691
+ }
100692
+ const databaseId = params.databaseId;
100693
+ const tableId = params.tableId;
100694
+ const data = params.data;
100695
+ const queries = params.queries;
100696
+ const transactionId = params.transactionId;
100697
+ if (typeof databaseId === "undefined") {
100698
+ throw new AppwriteException('Missing required parameter: "databaseId"');
100699
+ }
100700
+ if (typeof tableId === "undefined") {
100701
+ throw new AppwriteException('Missing required parameter: "tableId"');
100702
+ }
100703
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100704
+ const payload = {};
100705
+ if (typeof data !== "undefined") {
100706
+ payload["data"] = data;
100707
+ }
100708
+ if (typeof queries !== "undefined") {
100709
+ payload["queries"] = queries;
100710
+ }
100711
+ if (typeof transactionId !== "undefined") {
100712
+ payload["transactionId"] = transactionId;
100713
+ }
100714
+ const uri = new URL(this.client.config.endpoint + apiPath);
100715
+ const apiHeaders = {
100716
+ "X-Appwrite-Project": this.client.config.project,
100717
+ "content-type": "application/json",
100718
+ "accept": "application/json"
100719
+ };
100720
+ return this.client.call("patch", uri, apiHeaders, payload);
100721
+ }
100722
+ deleteRows(paramsOrFirst, ...rest) {
100723
+ let params;
100724
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100725
+ params = paramsOrFirst || {};
100726
+ } else {
100727
+ params = {
100728
+ databaseId: paramsOrFirst,
100729
+ tableId: rest[0],
100730
+ queries: rest[1],
100731
+ transactionId: rest[2]
100732
+ };
100733
+ }
100734
+ const databaseId = params.databaseId;
100735
+ const tableId = params.tableId;
100736
+ const queries = params.queries;
100737
+ const transactionId = params.transactionId;
100738
+ if (typeof databaseId === "undefined") {
100739
+ throw new AppwriteException('Missing required parameter: "databaseId"');
100740
+ }
100741
+ if (typeof tableId === "undefined") {
100742
+ throw new AppwriteException('Missing required parameter: "tableId"');
100743
+ }
100744
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId)));
100745
+ const payload = {};
100746
+ if (typeof queries !== "undefined") {
100747
+ payload["queries"] = queries;
100748
+ }
100749
+ if (typeof transactionId !== "undefined") {
100750
+ payload["transactionId"] = transactionId;
100751
+ }
100752
+ const uri = new URL(this.client.config.endpoint + apiPath);
100753
+ const apiHeaders = {
100754
+ "X-Appwrite-Project": this.client.config.project,
100755
+ "content-type": "application/json",
100756
+ "accept": "application/json"
100757
+ };
100758
+ return this.client.call("delete", uri, apiHeaders, payload);
100759
+ }
100760
+ getRow(paramsOrFirst, ...rest) {
100761
+ let params;
100762
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100763
+ params = paramsOrFirst || {};
100764
+ } else {
100765
+ params = {
100766
+ databaseId: paramsOrFirst,
100767
+ tableId: rest[0],
100768
+ rowId: rest[1],
100769
+ queries: rest[2],
100770
+ transactionId: rest[3]
100771
+ };
100772
+ }
100773
+ const databaseId = params.databaseId;
100774
+ const tableId = params.tableId;
100775
+ const rowId = params.rowId;
100776
+ const queries = params.queries;
100777
+ const transactionId = params.transactionId;
100778
+ if (typeof databaseId === "undefined") {
100779
+ throw new AppwriteException('Missing required parameter: "databaseId"');
100780
+ }
100781
+ if (typeof tableId === "undefined") {
100782
+ throw new AppwriteException('Missing required parameter: "tableId"');
100783
+ }
100784
+ if (typeof rowId === "undefined") {
100785
+ throw new AppwriteException('Missing required parameter: "rowId"');
100786
+ }
100787
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId))).replace("{rowId}", encodeURIComponent(String(rowId)));
100788
+ const payload = {};
100789
+ if (typeof queries !== "undefined") {
100790
+ payload["queries"] = queries;
100791
+ }
100792
+ if (typeof transactionId !== "undefined") {
100793
+ payload["transactionId"] = transactionId;
100794
+ }
100795
+ const uri = new URL(this.client.config.endpoint + apiPath);
100796
+ const apiHeaders = {
100797
+ "X-Appwrite-Project": this.client.config.project,
100798
+ "accept": "application/json"
100799
+ };
100800
+ return this.client.call("get", uri, apiHeaders, payload);
100801
+ }
100802
+ upsertRow(paramsOrFirst, ...rest) {
100531
100803
  let params;
100532
100804
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100533
100805
  params = paramsOrFirst || {};
@@ -100573,9 +100845,9 @@ var TablesDB = class {
100573
100845
  "content-type": "application/json",
100574
100846
  "accept": "application/json"
100575
100847
  };
100576
- return this.client.call("patch", uri, apiHeaders, payload);
100848
+ return this.client.call("put", uri, apiHeaders, payload);
100577
100849
  }
100578
- deleteRow(paramsOrFirst, ...rest) {
100850
+ updateRow(paramsOrFirst, ...rest) {
100579
100851
  let params;
100580
100852
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100581
100853
  params = paramsOrFirst || {};
@@ -100584,12 +100856,16 @@ var TablesDB = class {
100584
100856
  databaseId: paramsOrFirst,
100585
100857
  tableId: rest[0],
100586
100858
  rowId: rest[1],
100587
- transactionId: rest[2]
100859
+ data: rest[2],
100860
+ permissions: rest[3],
100861
+ transactionId: rest[4]
100588
100862
  };
100589
100863
  }
100590
100864
  const databaseId = params.databaseId;
100591
100865
  const tableId = params.tableId;
100592
100866
  const rowId = params.rowId;
100867
+ const data = params.data;
100868
+ const permissions = params.permissions;
100593
100869
  const transactionId = params.transactionId;
100594
100870
  if (typeof databaseId === "undefined") {
100595
100871
  throw new AppwriteException('Missing required parameter: "databaseId"');
@@ -100602,17 +100878,24 @@ var TablesDB = class {
100602
100878
  }
100603
100879
  const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId))).replace("{rowId}", encodeURIComponent(String(rowId)));
100604
100880
  const payload = {};
100881
+ if (typeof data !== "undefined") {
100882
+ payload["data"] = data;
100883
+ }
100884
+ if (typeof permissions !== "undefined") {
100885
+ payload["permissions"] = permissions;
100886
+ }
100605
100887
  if (typeof transactionId !== "undefined") {
100606
100888
  payload["transactionId"] = transactionId;
100607
100889
  }
100608
100890
  const uri = new URL(this.client.config.endpoint + apiPath);
100609
100891
  const apiHeaders = {
100610
100892
  "X-Appwrite-Project": this.client.config.project,
100611
- "content-type": "application/json"
100893
+ "content-type": "application/json",
100894
+ "accept": "application/json"
100612
100895
  };
100613
- return this.client.call("delete", uri, apiHeaders, payload);
100896
+ return this.client.call("patch", uri, apiHeaders, payload);
100614
100897
  }
100615
- listRowLogs(paramsOrFirst, ...rest) {
100898
+ deleteRow(paramsOrFirst, ...rest) {
100616
100899
  let params;
100617
100900
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
100618
100901
  params = paramsOrFirst || {};
@@ -100621,13 +100904,13 @@ var TablesDB = class {
100621
100904
  databaseId: paramsOrFirst,
100622
100905
  tableId: rest[0],
100623
100906
  rowId: rest[1],
100624
- queries: rest[2]
100907
+ transactionId: rest[2]
100625
100908
  };
100626
100909
  }
100627
100910
  const databaseId = params.databaseId;
100628
100911
  const tableId = params.tableId;
100629
100912
  const rowId = params.rowId;
100630
- const queries = params.queries;
100913
+ const transactionId = params.transactionId;
100631
100914
  if (typeof databaseId === "undefined") {
100632
100915
  throw new AppwriteException('Missing required parameter: "databaseId"');
100633
100916
  }
@@ -100637,17 +100920,17 @@ var TablesDB = class {
100637
100920
  if (typeof rowId === "undefined") {
100638
100921
  throw new AppwriteException('Missing required parameter: "rowId"');
100639
100922
  }
100640
- const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}/logs".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId))).replace("{rowId}", encodeURIComponent(String(rowId)));
100923
+ const apiPath = "/tablesdb/{databaseId}/tables/{tableId}/rows/{rowId}".replace("{databaseId}", encodeURIComponent(String(databaseId))).replace("{tableId}", encodeURIComponent(String(tableId))).replace("{rowId}", encodeURIComponent(String(rowId)));
100641
100924
  const payload = {};
100642
- if (typeof queries !== "undefined") {
100643
- payload["queries"] = queries;
100925
+ if (typeof transactionId !== "undefined") {
100926
+ payload["transactionId"] = transactionId;
100644
100927
  }
100645
100928
  const uri = new URL(this.client.config.endpoint + apiPath);
100646
100929
  const apiHeaders = {
100647
100930
  "X-Appwrite-Project": this.client.config.project,
100648
- "accept": "application/json"
100931
+ "content-type": "application/json"
100649
100932
  };
100650
- return this.client.call("get", uri, apiHeaders, payload);
100933
+ return this.client.call("delete", uri, apiHeaders, payload);
100651
100934
  }
100652
100935
  decrementRowColumn(paramsOrFirst, ...rest) {
100653
100936
  let params;
@@ -102482,6 +102765,7 @@ var QuerySuggestionResource;
102482
102765
  QuerySuggestionResource2["Keys"] = "keys";
102483
102766
  QuerySuggestionResource2["DevKeys"] = "devkeys";
102484
102767
  QuerySuggestionResource2["Webhooks"] = "webhooks";
102768
+ QuerySuggestionResource2["Notifications"] = "notifications";
102485
102769
  QuerySuggestionResource2["Certificates"] = "certificates";
102486
102770
  QuerySuggestionResource2["Realtime"] = "realtime";
102487
102771
  QuerySuggestionResource2["Rules"] = "rules";
@@ -102525,6 +102809,8 @@ var QuerySuggestionResource;
102525
102809
  QuerySuggestionResource2["Feedbacks"] = "feedbacks";
102526
102810
  QuerySuggestionResource2["Disputes"] = "disputes";
102527
102811
  QuerySuggestionResource2["ShInstallations"] = "sh_installations";
102812
+ QuerySuggestionResource2["MigrationDatabases"] = "migrationdatabases";
102813
+ QuerySuggestionResource2["MigrationProjects"] = "migrationprojects";
102528
102814
  QuerySuggestionResource2["Apps"] = "apps";
102529
102815
  QuerySuggestionResource2["AppSecrets"] = "appsecrets";
102530
102816
  QuerySuggestionResource2["Oauth2Grants"] = "oauth2grants";
@@ -102848,8 +103134,12 @@ var ProjectKeyScopes;
102848
103134
  ProjectKeyScopes2["PoliciesWrite"] = "policies.write";
102849
103135
  ProjectKeyScopes2["ProjectPoliciesRead"] = "project.policies.read";
102850
103136
  ProjectKeyScopes2["ProjectPoliciesWrite"] = "project.policies.write";
103137
+ ProjectKeyScopes2["ProjectOauth2Read"] = "project.oauth2.read";
103138
+ ProjectKeyScopes2["ProjectOauth2Write"] = "project.oauth2.write";
102851
103139
  ProjectKeyScopes2["TemplatesRead"] = "templates.read";
102852
103140
  ProjectKeyScopes2["TemplatesWrite"] = "templates.write";
103141
+ ProjectKeyScopes2["StagesRead"] = "stages.read";
103142
+ ProjectKeyScopes2["StagesWrite"] = "stages.write";
102853
103143
  ProjectKeyScopes2["Oauth2Read"] = "oauth2.read";
102854
103144
  ProjectKeyScopes2["Oauth2Write"] = "oauth2.write";
102855
103145
  ProjectKeyScopes2["UsersRead"] = "users.read";
@@ -102986,6 +103276,7 @@ var HealthQueueName;
102986
103276
  HealthQueueName2["V1screenshots"] = "v1-screenshots";
102987
103277
  HealthQueueName2["V1messaging"] = "v1-messaging";
102988
103278
  HealthQueueName2["V1migrations"] = "v1-migrations";
103279
+ HealthQueueName2["V1notifications"] = "v1-notifications";
102989
103280
  })(HealthQueueName || (HealthQueueName = {}));
102990
103281
  var BlockResourceType;
102991
103282
  (function(BlockResourceType2) {
@@ -102999,6 +103290,11 @@ var BlockResourceType;
102999
103290
  BlockResourceType2["Subscribers"] = "subscribers";
103000
103291
  BlockResourceType2["Messages"] = "messages";
103001
103292
  })(BlockResourceType || (BlockResourceType = {}));
103293
+ var BlockMode;
103294
+ (function(BlockMode2) {
103295
+ BlockMode2["Full"] = "full";
103296
+ BlockMode2["Readonly"] = "readonly";
103297
+ })(BlockMode || (BlockMode = {}));
103002
103298
  var Region;
103003
103299
  (function(Region2) {
103004
103300
  Region2["Fra"] = "fra";
@@ -103131,6 +103427,10 @@ var OrganizationKeyScopes;
103131
103427
  OrganizationKeyScopes2["DevKeysWrite"] = "devKeys.write";
103132
103428
  OrganizationKeyScopes2["OrganizationKeysRead"] = "organization.keys.read";
103133
103429
  OrganizationKeyScopes2["OrganizationKeysWrite"] = "organization.keys.write";
103430
+ OrganizationKeyScopes2["OrganizationMembershipsRead"] = "organization.memberships.read";
103431
+ OrganizationKeyScopes2["OrganizationMembershipsWrite"] = "organization.memberships.write";
103432
+ OrganizationKeyScopes2["OrganizationRead"] = "organization.read";
103433
+ OrganizationKeyScopes2["OrganizationWrite"] = "organization.write";
103134
103434
  OrganizationKeyScopes2["DomainsRead"] = "domains.read";
103135
103435
  OrganizationKeyScopes2["DomainsWrite"] = "domains.write";
103136
103436
  OrganizationKeyScopes2["KeysRead"] = "keys.read";
@@ -103139,6 +103439,8 @@ var OrganizationKeyScopes;
103139
103439
  var Addon;
103140
103440
  (function(Addon2) {
103141
103441
  Addon2["Baa"] = "baa";
103442
+ Addon2["Premiumgeodb"] = "premiumgeodb";
103443
+ Addon2["Premiumgeodborg"] = "premiumgeodborg";
103142
103444
  Addon2["BackupRecovery"] = "backup_recovery";
103143
103445
  })(Addon || (Addon = {}));
103144
103446
  var ProjectAuthMethodId;
@@ -103157,6 +103459,13 @@ var ProjectOAuth2GooglePrompt;
103157
103459
  ProjectOAuth2GooglePrompt2["Consent"] = "consent";
103158
103460
  ProjectOAuth2GooglePrompt2["SelectAccount"] = "select_account";
103159
103461
  })(ProjectOAuth2GooglePrompt || (ProjectOAuth2GooglePrompt = {}));
103462
+ var ProjectOAuth2OidcPrompt;
103463
+ (function(ProjectOAuth2OidcPrompt2) {
103464
+ ProjectOAuth2OidcPrompt2["None"] = "none";
103465
+ ProjectOAuth2OidcPrompt2["Login"] = "login";
103466
+ ProjectOAuth2OidcPrompt2["Consent"] = "consent";
103467
+ ProjectOAuth2OidcPrompt2["SelectAccount"] = "select_account";
103468
+ })(ProjectOAuth2OidcPrompt || (ProjectOAuth2OidcPrompt = {}));
103160
103469
  var ProjectOAuthProviderId;
103161
103470
  (function(ProjectOAuthProviderId2) {
103162
103471
  ProjectOAuthProviderId2["Amazon"] = "amazon";
@@ -103483,6 +103792,12 @@ var DatabaseType;
103483
103792
  DatabaseType2["Documentsdb"] = "documentsdb";
103484
103793
  DatabaseType2["Vectorsdb"] = "vectorsdb";
103485
103794
  })(DatabaseType || (DatabaseType = {}));
103795
+ var DatabaseStatus;
103796
+ (function(DatabaseStatus2) {
103797
+ DatabaseStatus2["Provisioning"] = "provisioning";
103798
+ DatabaseStatus2["Ready"] = "ready";
103799
+ DatabaseStatus2["Failed"] = "failed";
103800
+ })(DatabaseStatus || (DatabaseStatus = {}));
103486
103801
  var AttributeStatus;
103487
103802
  (function(AttributeStatus2) {
103488
103803
  AttributeStatus2["Available"] = "available";
@@ -103544,6 +103859,13 @@ var OAuth2GooglePrompt;
103544
103859
  OAuth2GooglePrompt2["Consent"] = "consent";
103545
103860
  OAuth2GooglePrompt2["SelectAccount"] = "select_account";
103546
103861
  })(OAuth2GooglePrompt || (OAuth2GooglePrompt = {}));
103862
+ var OAuth2OidcPrompt;
103863
+ (function(OAuth2OidcPrompt2) {
103864
+ OAuth2OidcPrompt2["None"] = "none";
103865
+ OAuth2OidcPrompt2["Login"] = "login";
103866
+ OAuth2OidcPrompt2["Consent"] = "consent";
103867
+ OAuth2OidcPrompt2["SelectAccount"] = "select_account";
103868
+ })(OAuth2OidcPrompt || (OAuth2OidcPrompt = {}));
103547
103869
  var PlatformType;
103548
103870
  (function(PlatformType2) {
103549
103871
  PlatformType2["Windows"] = "windows";
@@ -104939,7 +105261,7 @@ var package_default = {
104939
105261
  type: "module",
104940
105262
  homepage: "https://appwrite.io/support",
104941
105263
  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",
104942
- version: "22.4.0",
105264
+ version: "22.5.0",
104943
105265
  license: "BSD-3-Clause",
104944
105266
  main: "dist/index.cjs",
104945
105267
  module: "dist/index.js",
@@ -104987,7 +105309,7 @@ var package_default = {
104987
105309
  "windows-arm64": "bun build cli.ts --compile --minify --target=bun-windows-arm64 --outfile build/appwrite-cli-win-arm64.exe"
104988
105310
  },
104989
105311
  dependencies: {
104990
- "@appwrite.io/console": "^15.1.1",
105312
+ "@appwrite.io/console": "15.3.0-rc.1",
104991
105313
  "@napi-rs/keyring": "^1.3.0",
104992
105314
  chalk: "4.1.2",
104993
105315
  chokidar: "^3.6.0",
@@ -105015,21 +105337,21 @@ var package_default = {
105015
105337
  esbuild: "^0.28.1"
105016
105338
  },
105017
105339
  devDependencies: {
105018
- "@typescript-eslint/eslint-plugin": "^8.0.0",
105019
- "@typescript-eslint/parser": "^8.0.0",
105020
105340
  "@types/bun": "^1.3.5",
105021
- eslint: "^9.0.0",
105022
- "eslint-plugin-unused-imports": "^4.0.0",
105023
- "typescript-eslint": "^8.0.0",
105024
105341
  "@types/cli-progress": "^3.11.5",
105025
105342
  "@types/inquirer": "^8.2.10",
105026
105343
  "@types/json-bigint": "^1.0.4",
105027
105344
  "@types/node": "^18.19.0",
105028
105345
  "@types/tar": "^6.1.13",
105346
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
105347
+ "@typescript-eslint/parser": "^8.0.0",
105029
105348
  esbuild: "^0.28.1",
105349
+ eslint: "^9.0.0",
105350
+ "eslint-plugin-unused-imports": "^4.0.0",
105030
105351
  prettier: "^3.7.4",
105031
105352
  tsx: "^4.21.0",
105032
- typescript: "^5.3.3"
105353
+ typescript: "^5.3.3",
105354
+ "typescript-eslint": "^8.0.0"
105033
105355
  }
105034
105356
  };
105035
105357
 
@@ -106139,7 +106461,9 @@ var configFilters = [
106139
106461
  new URL(
106140
106462
  `${consoleClient.config.endpoint}/projects/${encodeURIComponent(config2.projectId)}`
106141
106463
  ),
106142
- {},
106464
+ {
106465
+ "X-Appwrite-Project": "console"
106466
+ },
106143
106467
  {}
106144
106468
  );
106145
106469
  organizationId = project.teamId;