appwrite-cli 18.2.0 → 19.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (39) hide show
  1. package/README.md +6 -6
  2. package/dist/bundle-win-arm64.mjs +2308 -2610
  3. package/dist/cli.cjs +2459 -2761
  4. package/dist/index.cjs +697 -1215
  5. package/dist/index.js +697 -1215
  6. package/dist/lib/commands/config.d.ts +0 -2
  7. package/dist/lib/commands/config.d.ts.map +1 -1
  8. package/dist/lib/commands/init.d.ts.map +1 -1
  9. package/dist/lib/commands/pull.d.ts.map +1 -1
  10. package/dist/lib/commands/push.d.ts.map +1 -1
  11. package/dist/lib/commands/services/account.d.ts.map +1 -1
  12. package/dist/lib/commands/services/backups.d.ts.map +1 -1
  13. package/dist/lib/commands/services/databases.d.ts.map +1 -1
  14. package/dist/lib/commands/services/functions.d.ts.map +1 -1
  15. package/dist/lib/commands/services/messaging.d.ts.map +1 -1
  16. package/dist/lib/commands/services/migrations.d.ts.map +1 -1
  17. package/dist/lib/commands/services/organizations.d.ts.map +1 -1
  18. package/dist/lib/commands/services/project.d.ts.map +1 -1
  19. package/dist/lib/commands/services/projects.d.ts.map +1 -1
  20. package/dist/lib/commands/services/proxy.d.ts.map +1 -1
  21. package/dist/lib/commands/services/sites.d.ts.map +1 -1
  22. package/dist/lib/commands/services/storage.d.ts.map +1 -1
  23. package/dist/lib/commands/services/tables-db.d.ts.map +1 -1
  24. package/dist/lib/commands/services/teams.d.ts.map +1 -1
  25. package/dist/lib/commands/services/tokens.d.ts.map +1 -1
  26. package/dist/lib/commands/services/users.d.ts.map +1 -1
  27. package/dist/lib/commands/services/vcs.d.ts.map +1 -1
  28. package/dist/lib/commands/services/webhooks.d.ts.map +1 -1
  29. package/dist/lib/commands/update.d.ts.map +1 -1
  30. package/dist/lib/commands/utils/query.d.ts +15 -0
  31. package/dist/lib/commands/utils/query.d.ts.map +1 -0
  32. package/dist/lib/config.d.ts.map +1 -1
  33. package/dist/lib/constants.d.ts +3 -1
  34. package/dist/lib/constants.d.ts.map +1 -1
  35. package/dist/lib/parser.d.ts.map +1 -1
  36. package/dist/lib/questions.d.ts.map +1 -1
  37. package/dist/lib/response-config.d.ts.map +1 -1
  38. package/dist/lib/utils.d.ts.map +1 -1
  39. package/package.json +5 -3
package/dist/index.js CHANGED
@@ -64988,10 +64988,12 @@ var id_default = ID;
64988
64988
  // lib/constants.ts
64989
64989
  var SDK_TITLE = "Appwrite";
64990
64990
  var SDK_TITLE_LOWER = "appwrite";
64991
- var SDK_VERSION = "18.2.0";
64991
+ var SDK_VERSION = "19.1.0";
64992
64992
  var SDK_LOGO = "\n _ _ _ ___ __ _____\n /_\\ _ __ _ ____ ___ __(_) |_ ___ / __\\ / / \\_ \\\n //_\\\\| '_ \\| '_ \\ \\ /\\ / / '__| | __/ _ \\ / / / / / /\\/\n / _ \\ |_) | |_) \\ V V /| | | | || __/ / /___/ /___/\\/ /_\n \\_/ \\_/ .__/| .__/ \\_/\\_/ |_| |_|\\__\\___| \\____/\\____/\\____/\n |_| |_|\n\n";
64993
64993
  var EXECUTABLE_NAME = "appwrite";
64994
64994
  var UPDATE_CHECK_INTERVAL_MS = 24 * 60 * 60 * 1e3;
64995
+ var HOMEBREW_TAP = "appwrite/appwrite";
64996
+ var HOMEBREW_FORMULA = `${HOMEBREW_TAP}/appwrite`;
64995
64997
  var NPM_PACKAGE_NAME = "appwrite-cli";
64996
64998
  var NPM_REGISTRY_URL = `https://registry.npmjs.org/${NPM_PACKAGE_NAME}/latest`;
64997
64999
  var GITHUB_REPO = "appwrite/appwrite-cli";
@@ -78992,7 +78994,6 @@ var SiteSchema = external_exports.object({
78992
78994
  path: external_exports.string().optional(),
78993
78995
  $id: external_exports.string(),
78994
78996
  name: external_exports.string(),
78995
- enabled: external_exports.boolean().optional(),
78996
78997
  logging: external_exports.boolean().optional(),
78997
78998
  timeout: external_exports.union([external_exports.number(), external_exports.bigint()]).optional(),
78998
78999
  framework: external_exports.string().optional(),
@@ -79266,7 +79267,6 @@ var siteRequiresBuildCommand = (site) => {
79266
79267
  return !(site.framework === "other" && site.adapter === "static");
79267
79268
  };
79268
79269
  var WINDOWS_EXECUTABLE_NAME = `${EXECUTABLE_NAME.toLowerCase()}.exe`;
79269
- var HOMEBREW_FORMULA_NAME = EXECUTABLE_NAME.toLowerCase();
79270
79270
  var isCloudHostname = (hostname3) => hostname3 === "cloud.appwrite.io" || hostname3.endsWith(".cloud.appwrite.io");
79271
79271
  var getConsoleBaseUrl = (endpoint) => {
79272
79272
  try {
@@ -79435,6 +79435,7 @@ function pruneDeprecatedSiteFields(data) {
79435
79435
  sanitized.sites = sanitized.sites.map((site) => {
79436
79436
  if (site && typeof site === "object") {
79437
79437
  const {
79438
+ enabled: _enabled,
79438
79439
  vars: _vars,
79439
79440
  ignore: _ignore,
79440
79441
  ...rest
@@ -79608,13 +79609,16 @@ var Local = class _Local extends Config {
79608
79609
  if (!this.has("sites")) {
79609
79610
  return [];
79610
79611
  }
79611
- return this.get("sites") ?? [];
79612
+ return (this.get("sites") ?? []).map((site) => {
79613
+ const { enabled: _enabled, vars: _vars, ignore: _ignore, ...rest } = site;
79614
+ return rest;
79615
+ });
79612
79616
  }
79613
79617
  getSite($id) {
79614
79618
  if (!this.has("sites")) {
79615
79619
  return {};
79616
79620
  }
79617
- const sites = this.get("sites") ?? [];
79621
+ const sites = this.getSites();
79618
79622
  for (let i = 0; i < sites.length; i++) {
79619
79623
  if (sites[i]["$id"] == $id) {
79620
79624
  return sites[i];
@@ -83673,6 +83677,41 @@ function __classPrivateFieldGet(receiver, state, kind, f2) {
83673
83677
  if (typeof state === "function" ? receiver !== state || !f2 : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
83674
83678
  return kind === "m" ? f2 : kind === "a" ? f2.call(receiver) : f2 ? f2.value : state.get(receiver);
83675
83679
  }
83680
+ var _a2;
83681
+ var _ID_hexTimestamp;
83682
+ var ID2 = class {
83683
+ /**
83684
+ * Uses the provided ID as the ID for the resource.
83685
+ *
83686
+ * @param {string} id
83687
+ * @returns {string}
83688
+ */
83689
+ static custom(id) {
83690
+ return id;
83691
+ }
83692
+ /**
83693
+ * Have Appwrite generate a unique ID for you.
83694
+ *
83695
+ * @param {number} padding. Default is 7.
83696
+ * @returns {string}
83697
+ */
83698
+ static unique(padding = 7) {
83699
+ const baseId = __classPrivateFieldGet(_a2, _a2, "m", _ID_hexTimestamp).call(_a2);
83700
+ let randomPadding = "";
83701
+ for (let i = 0; i < padding; i++) {
83702
+ const randomHexDigit = Math.floor(Math.random() * 16).toString(16);
83703
+ randomPadding += randomHexDigit;
83704
+ }
83705
+ return baseId + randomPadding;
83706
+ }
83707
+ };
83708
+ _a2 = ID2, _ID_hexTimestamp = function _ID_hexTimestamp2() {
83709
+ const now = /* @__PURE__ */ new Date();
83710
+ const sec = Math.floor(now.getTime() / 1e3);
83711
+ const msec = now.getMilliseconds();
83712
+ const hexTimestamp = sec.toString(16) + msec.toString(16).padStart(5, "0");
83713
+ return hexTimestamp;
83714
+ };
83676
83715
  var JSONbig$1 = (0, import_json_bigint2.default)({ useNativeBigInt: true });
83677
83716
  var Query = class {
83678
83717
  /**
@@ -83828,8 +83867,8 @@ var Client = class _Client {
83828
83867
  "x-sdk-name": "Console",
83829
83868
  "x-sdk-platform": "console",
83830
83869
  "x-sdk-language": "web",
83831
- "x-sdk-version": "9.1.0",
83832
- "X-Appwrite-Response-Format": "1.9.1"
83870
+ "x-sdk-version": "11.0.0",
83871
+ "X-Appwrite-Response-Format": "1.9.2"
83833
83872
  };
83834
83873
  this.realtime = {
83835
83874
  socket: void 0,
@@ -83837,11 +83876,8 @@ var Client = class _Client {
83837
83876
  heartbeat: void 0,
83838
83877
  url: "",
83839
83878
  channels: /* @__PURE__ */ new Set(),
83840
- queries: /* @__PURE__ */ new Set(),
83841
83879
  subscriptions: /* @__PURE__ */ new Map(),
83842
- slotToSubscriptionId: /* @__PURE__ */ new Map(),
83843
- subscriptionIdToSlot: /* @__PURE__ */ new Map(),
83844
- subscriptionsCounter: 0,
83880
+ pendingSubscribes: /* @__PURE__ */ new Map(),
83845
83881
  reconnect: true,
83846
83882
  reconnectAttempts: 0,
83847
83883
  lastMessage: void 0,
@@ -83875,26 +83911,14 @@ var Client = class _Client {
83875
83911
  }, 2e4);
83876
83912
  },
83877
83913
  createSocket: () => {
83878
- var _a3, _b, _c, _d;
83914
+ var _a3, _b, _c, _d, _e2;
83879
83915
  if (this.realtime.subscriptions.size < 1) {
83880
83916
  this.realtime.reconnect = false;
83881
83917
  (_a3 = this.realtime.socket) === null || _a3 === void 0 ? void 0 : _a3.close();
83882
83918
  return;
83883
83919
  }
83884
83920
  const encodedProject = encodeURIComponent((_b = this.config.project) !== null && _b !== void 0 ? _b : "");
83885
- let queryParams = "project=" + encodedProject;
83886
- this.realtime.channels.forEach((channel) => {
83887
- queryParams += "&channels[]=" + encodeURIComponent(channel);
83888
- });
83889
- const selectAllQuery = Query.select(["*"]).toString();
83890
- this.realtime.subscriptions.forEach((sub, slot) => {
83891
- const queries = sub.queries.length > 0 ? sub.queries : [selectAllQuery];
83892
- sub.channels.forEach((channel) => {
83893
- queries.forEach((query) => {
83894
- queryParams += "&" + encodeURIComponent(channel) + "[" + slot + "][]=" + encodeURIComponent(query);
83895
- });
83896
- });
83897
- });
83921
+ const queryParams = "project=" + encodedProject;
83898
83922
  const url2 = this.config.endpointRealtime + "/realtime?" + queryParams;
83899
83923
  if (url2 !== this.realtime.url || // Check if URL is present
83900
83924
  !this.realtime.socket || // Check if WebSocket has not been created
@@ -83924,8 +83948,24 @@ var Client = class _Client {
83924
83948
  this.realtime.createSocket();
83925
83949
  }, timeout);
83926
83950
  });
83951
+ } else if (((_e2 = this.realtime.socket) === null || _e2 === void 0 ? void 0 : _e2.readyState) === WebSocket.OPEN) {
83952
+ this.realtime.sendPendingSubscribes();
83927
83953
  }
83928
83954
  },
83955
+ sendPendingSubscribes: () => {
83956
+ if (!this.realtime.socket || this.realtime.socket.readyState !== WebSocket.OPEN) {
83957
+ return;
83958
+ }
83959
+ if (this.realtime.pendingSubscribes.size < 1) {
83960
+ return;
83961
+ }
83962
+ const rows = Array.from(this.realtime.pendingSubscribes.values());
83963
+ this.realtime.pendingSubscribes.clear();
83964
+ this.realtime.socket.send(JSONbig.stringify({
83965
+ type: "subscribe",
83966
+ data: rows
83967
+ }));
83968
+ },
83929
83969
  onMessage: (event) => {
83930
83970
  var _a3, _b;
83931
83971
  try {
@@ -83934,17 +83974,6 @@ var Client = class _Client {
83934
83974
  switch (message.type) {
83935
83975
  case "connected": {
83936
83976
  const messageData = message.data;
83937
- if (messageData === null || messageData === void 0 ? void 0 : messageData.subscriptions) {
83938
- this.realtime.slotToSubscriptionId.clear();
83939
- this.realtime.subscriptionIdToSlot.clear();
83940
- for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
83941
- const slot = Number(slotStr);
83942
- if (!isNaN(slot) && typeof subscriptionId === "string") {
83943
- this.realtime.slotToSubscriptionId.set(slot, subscriptionId);
83944
- this.realtime.subscriptionIdToSlot.set(subscriptionId, slot);
83945
- }
83946
- }
83947
- }
83948
83977
  let session = this.config.session;
83949
83978
  if (!session) {
83950
83979
  const cookie = JSONbig.parse((_a3 = window.localStorage.getItem("cookieFallback")) !== null && _a3 !== void 0 ? _a3 : "{}");
@@ -83958,8 +83987,19 @@ var Client = class _Client {
83958
83987
  }
83959
83988
  }));
83960
83989
  }
83990
+ this.realtime.subscriptions.forEach((sub, subscriptionId) => {
83991
+ var _a4;
83992
+ this.realtime.pendingSubscribes.set(subscriptionId, {
83993
+ subscriptionId,
83994
+ channels: sub.channels,
83995
+ queries: (_a4 = sub.queries) !== null && _a4 !== void 0 ? _a4 : []
83996
+ });
83997
+ });
83998
+ this.realtime.sendPendingSubscribes();
83961
83999
  break;
83962
84000
  }
84001
+ case "response":
84002
+ break;
83963
84003
  case "event": {
83964
84004
  const data = message.data;
83965
84005
  if (!(data === null || data === void 0 ? void 0 : data.channels))
@@ -83967,12 +84007,9 @@ var Client = class _Client {
83967
84007
  const eventSubIds = data.subscriptions;
83968
84008
  if (eventSubIds && eventSubIds.length > 0) {
83969
84009
  for (const subscriptionId of eventSubIds) {
83970
- const slot = this.realtime.subscriptionIdToSlot.get(subscriptionId);
83971
- if (slot !== void 0) {
83972
- const subscription = this.realtime.subscriptions.get(slot);
83973
- if (subscription) {
83974
- setTimeout(() => subscription.callback(data));
83975
- }
84010
+ const subscription = this.realtime.subscriptions.get(subscriptionId);
84011
+ if (subscription) {
84012
+ setTimeout(() => subscription.callback(data));
83976
84013
  }
83977
84014
  }
83978
84015
  } else {
@@ -83998,29 +84035,6 @@ var Client = class _Client {
83998
84035
  } catch (e) {
83999
84036
  console.error(e);
84000
84037
  }
84001
- },
84002
- cleanUp: (channels, queries) => {
84003
- this.realtime.channels.forEach((channel) => {
84004
- if (channels.includes(channel)) {
84005
- let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
84006
- return subscription.channels.includes(channel);
84007
- });
84008
- if (!found) {
84009
- this.realtime.channels.delete(channel);
84010
- }
84011
- }
84012
- });
84013
- this.realtime.queries.forEach((query) => {
84014
- if (queries.includes(query)) {
84015
- let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
84016
- var _a3;
84017
- return (_a3 = subscription.queries) === null || _a3 === void 0 ? void 0 : _a3.includes(query);
84018
- });
84019
- if (!found) {
84020
- this.realtime.queries.delete(query);
84021
- }
84022
- }
84023
- });
84024
84038
  }
84025
84039
  };
84026
84040
  }
@@ -84267,17 +84281,41 @@ var Client = class _Client {
84267
84281
  });
84268
84282
  channelStrings.forEach((channel) => this.realtime.channels.add(channel));
84269
84283
  const queryStrings = (queries !== null && queries !== void 0 ? queries : []).map((q2) => typeof q2 === "string" ? q2 : q2.toString());
84270
- queryStrings.forEach((query) => this.realtime.queries.add(query));
84271
- const counter = this.realtime.subscriptionsCounter++;
84272
- this.realtime.subscriptions.set(counter, {
84284
+ let subscriptionId = "";
84285
+ const attempts = this.realtime.subscriptions.size + 1;
84286
+ for (let i = 0; i < attempts; i++) {
84287
+ const candidate = ID2.unique();
84288
+ if (!this.realtime.subscriptions.has(candidate)) {
84289
+ subscriptionId = candidate;
84290
+ break;
84291
+ }
84292
+ }
84293
+ if (subscriptionId === "") {
84294
+ throw new AppwriteException("Failed to generate unique subscription id");
84295
+ }
84296
+ this.realtime.subscriptions.set(subscriptionId, {
84273
84297
  channels: channelStrings,
84274
84298
  queries: queryStrings,
84275
84299
  callback
84276
84300
  });
84301
+ this.realtime.pendingSubscribes.set(subscriptionId, {
84302
+ subscriptionId,
84303
+ channels: channelStrings,
84304
+ queries: queryStrings
84305
+ });
84277
84306
  this.realtime.connect();
84278
84307
  return () => {
84279
- this.realtime.subscriptions.delete(counter);
84280
- this.realtime.cleanUp(channelStrings, queryStrings);
84308
+ this.realtime.subscriptions.delete(subscriptionId);
84309
+ this.realtime.pendingSubscribes.delete(subscriptionId);
84310
+ const stillUsed = /* @__PURE__ */ new Set();
84311
+ this.realtime.subscriptions.forEach((sub) => {
84312
+ sub.channels.forEach((channel) => stillUsed.add(channel));
84313
+ });
84314
+ this.realtime.channels.forEach((channel) => {
84315
+ if (!stillUsed.has(channel)) {
84316
+ this.realtime.channels.delete(channel);
84317
+ }
84318
+ });
84281
84319
  this.realtime.connect();
84282
84320
  };
84283
84321
  }
@@ -93941,7 +93979,240 @@ var Project = class {
93941
93979
  };
93942
93980
  return this.client.call("delete", uri, apiHeaders, payload);
93943
93981
  }
93944
- updateProtocolStatus(paramsOrFirst, ...rest) {
93982
+ updateMembershipPrivacyPolicy(paramsOrFirst, ...rest) {
93983
+ let params;
93984
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
93985
+ params = paramsOrFirst || {};
93986
+ } else {
93987
+ params = {
93988
+ userId: paramsOrFirst,
93989
+ userEmail: rest[0],
93990
+ userPhone: rest[1],
93991
+ userName: rest[2],
93992
+ userMFA: rest[3]
93993
+ };
93994
+ }
93995
+ const userId = params.userId;
93996
+ const userEmail = params.userEmail;
93997
+ const userPhone = params.userPhone;
93998
+ const userName = params.userName;
93999
+ const userMFA = params.userMFA;
94000
+ const apiPath = "/project/policies/membership-privacy";
94001
+ const payload = {};
94002
+ if (typeof userId !== "undefined") {
94003
+ payload["userId"] = userId;
94004
+ }
94005
+ if (typeof userEmail !== "undefined") {
94006
+ payload["userEmail"] = userEmail;
94007
+ }
94008
+ if (typeof userPhone !== "undefined") {
94009
+ payload["userPhone"] = userPhone;
94010
+ }
94011
+ if (typeof userName !== "undefined") {
94012
+ payload["userName"] = userName;
94013
+ }
94014
+ if (typeof userMFA !== "undefined") {
94015
+ payload["userMFA"] = userMFA;
94016
+ }
94017
+ const uri = new URL(this.client.config.endpoint + apiPath);
94018
+ const apiHeaders = {
94019
+ "content-type": "application/json"
94020
+ };
94021
+ return this.client.call("patch", uri, apiHeaders, payload);
94022
+ }
94023
+ updatePasswordDictionaryPolicy(paramsOrFirst) {
94024
+ let params;
94025
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94026
+ params = paramsOrFirst || {};
94027
+ } else {
94028
+ params = {
94029
+ enabled: paramsOrFirst
94030
+ };
94031
+ }
94032
+ const enabled = params.enabled;
94033
+ if (typeof enabled === "undefined") {
94034
+ throw new AppwriteException('Missing required parameter: "enabled"');
94035
+ }
94036
+ const apiPath = "/project/policies/password-dictionary";
94037
+ const payload = {};
94038
+ if (typeof enabled !== "undefined") {
94039
+ payload["enabled"] = enabled;
94040
+ }
94041
+ const uri = new URL(this.client.config.endpoint + apiPath);
94042
+ const apiHeaders = {
94043
+ "content-type": "application/json"
94044
+ };
94045
+ return this.client.call("patch", uri, apiHeaders, payload);
94046
+ }
94047
+ updatePasswordHistoryPolicy(paramsOrFirst) {
94048
+ let params;
94049
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94050
+ params = paramsOrFirst || {};
94051
+ } else {
94052
+ params = {
94053
+ total: paramsOrFirst
94054
+ };
94055
+ }
94056
+ const total = params.total;
94057
+ if (typeof total === "undefined") {
94058
+ throw new AppwriteException('Missing required parameter: "total"');
94059
+ }
94060
+ const apiPath = "/project/policies/password-history";
94061
+ const payload = {};
94062
+ if (typeof total !== "undefined") {
94063
+ payload["total"] = total;
94064
+ }
94065
+ const uri = new URL(this.client.config.endpoint + apiPath);
94066
+ const apiHeaders = {
94067
+ "content-type": "application/json"
94068
+ };
94069
+ return this.client.call("patch", uri, apiHeaders, payload);
94070
+ }
94071
+ updatePasswordPersonalDataPolicy(paramsOrFirst) {
94072
+ let params;
94073
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94074
+ params = paramsOrFirst || {};
94075
+ } else {
94076
+ params = {
94077
+ enabled: paramsOrFirst
94078
+ };
94079
+ }
94080
+ const enabled = params.enabled;
94081
+ if (typeof enabled === "undefined") {
94082
+ throw new AppwriteException('Missing required parameter: "enabled"');
94083
+ }
94084
+ const apiPath = "/project/policies/password-personal-data";
94085
+ const payload = {};
94086
+ if (typeof enabled !== "undefined") {
94087
+ payload["enabled"] = enabled;
94088
+ }
94089
+ const uri = new URL(this.client.config.endpoint + apiPath);
94090
+ const apiHeaders = {
94091
+ "content-type": "application/json"
94092
+ };
94093
+ return this.client.call("patch", uri, apiHeaders, payload);
94094
+ }
94095
+ updateSessionAlertPolicy(paramsOrFirst) {
94096
+ let params;
94097
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94098
+ params = paramsOrFirst || {};
94099
+ } else {
94100
+ params = {
94101
+ enabled: paramsOrFirst
94102
+ };
94103
+ }
94104
+ const enabled = params.enabled;
94105
+ if (typeof enabled === "undefined") {
94106
+ throw new AppwriteException('Missing required parameter: "enabled"');
94107
+ }
94108
+ const apiPath = "/project/policies/session-alert";
94109
+ const payload = {};
94110
+ if (typeof enabled !== "undefined") {
94111
+ payload["enabled"] = enabled;
94112
+ }
94113
+ const uri = new URL(this.client.config.endpoint + apiPath);
94114
+ const apiHeaders = {
94115
+ "content-type": "application/json"
94116
+ };
94117
+ return this.client.call("patch", uri, apiHeaders, payload);
94118
+ }
94119
+ updateSessionDurationPolicy(paramsOrFirst) {
94120
+ let params;
94121
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94122
+ params = paramsOrFirst || {};
94123
+ } else {
94124
+ params = {
94125
+ duration: paramsOrFirst
94126
+ };
94127
+ }
94128
+ const duration3 = params.duration;
94129
+ if (typeof duration3 === "undefined") {
94130
+ throw new AppwriteException('Missing required parameter: "duration"');
94131
+ }
94132
+ const apiPath = "/project/policies/session-duration";
94133
+ const payload = {};
94134
+ if (typeof duration3 !== "undefined") {
94135
+ payload["duration"] = duration3;
94136
+ }
94137
+ const uri = new URL(this.client.config.endpoint + apiPath);
94138
+ const apiHeaders = {
94139
+ "content-type": "application/json"
94140
+ };
94141
+ return this.client.call("patch", uri, apiHeaders, payload);
94142
+ }
94143
+ updateSessionInvalidationPolicy(paramsOrFirst) {
94144
+ let params;
94145
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94146
+ params = paramsOrFirst || {};
94147
+ } else {
94148
+ params = {
94149
+ enabled: paramsOrFirst
94150
+ };
94151
+ }
94152
+ const enabled = params.enabled;
94153
+ if (typeof enabled === "undefined") {
94154
+ throw new AppwriteException('Missing required parameter: "enabled"');
94155
+ }
94156
+ const apiPath = "/project/policies/session-invalidation";
94157
+ const payload = {};
94158
+ if (typeof enabled !== "undefined") {
94159
+ payload["enabled"] = enabled;
94160
+ }
94161
+ const uri = new URL(this.client.config.endpoint + apiPath);
94162
+ const apiHeaders = {
94163
+ "content-type": "application/json"
94164
+ };
94165
+ return this.client.call("patch", uri, apiHeaders, payload);
94166
+ }
94167
+ updateSessionLimitPolicy(paramsOrFirst) {
94168
+ let params;
94169
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94170
+ params = paramsOrFirst || {};
94171
+ } else {
94172
+ params = {
94173
+ total: paramsOrFirst
94174
+ };
94175
+ }
94176
+ const total = params.total;
94177
+ if (typeof total === "undefined") {
94178
+ throw new AppwriteException('Missing required parameter: "total"');
94179
+ }
94180
+ const apiPath = "/project/policies/session-limit";
94181
+ const payload = {};
94182
+ if (typeof total !== "undefined") {
94183
+ payload["total"] = total;
94184
+ }
94185
+ const uri = new URL(this.client.config.endpoint + apiPath);
94186
+ const apiHeaders = {
94187
+ "content-type": "application/json"
94188
+ };
94189
+ return this.client.call("patch", uri, apiHeaders, payload);
94190
+ }
94191
+ updateUserLimitPolicy(paramsOrFirst) {
94192
+ let params;
94193
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94194
+ params = paramsOrFirst || {};
94195
+ } else {
94196
+ params = {
94197
+ total: paramsOrFirst
94198
+ };
94199
+ }
94200
+ const total = params.total;
94201
+ if (typeof total === "undefined") {
94202
+ throw new AppwriteException('Missing required parameter: "total"');
94203
+ }
94204
+ const apiPath = "/project/policies/user-limit";
94205
+ const payload = {};
94206
+ if (typeof total !== "undefined") {
94207
+ payload["total"] = total;
94208
+ }
94209
+ const uri = new URL(this.client.config.endpoint + apiPath);
94210
+ const apiHeaders = {
94211
+ "content-type": "application/json"
94212
+ };
94213
+ return this.client.call("patch", uri, apiHeaders, payload);
94214
+ }
94215
+ updateProtocol(paramsOrFirst, ...rest) {
93945
94216
  let params;
93946
94217
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("protocolId" in paramsOrFirst || "enabled" in paramsOrFirst)) {
93947
94218
  params = paramsOrFirst || {};
@@ -93959,7 +94230,7 @@ var Project = class {
93959
94230
  if (typeof enabled === "undefined") {
93960
94231
  throw new AppwriteException('Missing required parameter: "enabled"');
93961
94232
  }
93962
- const apiPath = "/project/protocols/{protocolId}/status".replace("{protocolId}", protocolId);
94233
+ const apiPath = "/project/protocols/{protocolId}".replace("{protocolId}", protocolId);
93963
94234
  const payload = {};
93964
94235
  if (typeof enabled !== "undefined") {
93965
94236
  payload["enabled"] = enabled;
@@ -93970,7 +94241,7 @@ var Project = class {
93970
94241
  };
93971
94242
  return this.client.call("patch", uri, apiHeaders, payload);
93972
94243
  }
93973
- updateServiceStatus(paramsOrFirst, ...rest) {
94244
+ updateService(paramsOrFirst, ...rest) {
93974
94245
  let params;
93975
94246
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("serviceId" in paramsOrFirst || "enabled" in paramsOrFirst)) {
93976
94247
  params = paramsOrFirst || {};
@@ -93988,7 +94259,7 @@ var Project = class {
93988
94259
  if (typeof enabled === "undefined") {
93989
94260
  throw new AppwriteException('Missing required parameter: "enabled"');
93990
94261
  }
93991
- const apiPath = "/project/services/{serviceId}/status".replace("{serviceId}", serviceId);
94262
+ const apiPath = "/project/services/{serviceId}".replace("{serviceId}", serviceId);
93992
94263
  const payload = {};
93993
94264
  if (typeof enabled !== "undefined") {
93994
94265
  payload["enabled"] = enabled;
@@ -93999,6 +94270,179 @@ var Project = class {
93999
94270
  };
94000
94271
  return this.client.call("patch", uri, apiHeaders, payload);
94001
94272
  }
94273
+ updateSMTP(paramsOrFirst, ...rest) {
94274
+ let params;
94275
+ if (!paramsOrFirst || paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94276
+ params = paramsOrFirst || {};
94277
+ } else {
94278
+ params = {
94279
+ host: paramsOrFirst,
94280
+ port: rest[0],
94281
+ username: rest[1],
94282
+ password: rest[2],
94283
+ senderEmail: rest[3],
94284
+ senderName: rest[4],
94285
+ replyToEmail: rest[5],
94286
+ replyToName: rest[6],
94287
+ secure: rest[7],
94288
+ enabled: rest[8]
94289
+ };
94290
+ }
94291
+ const host = params.host;
94292
+ const port = params.port;
94293
+ const username = params.username;
94294
+ const password = params.password;
94295
+ const senderEmail = params.senderEmail;
94296
+ const senderName = params.senderName;
94297
+ const replyToEmail = params.replyToEmail;
94298
+ const replyToName = params.replyToName;
94299
+ const secure = params.secure;
94300
+ const enabled = params.enabled;
94301
+ const apiPath = "/project/smtp";
94302
+ const payload = {};
94303
+ if (typeof host !== "undefined") {
94304
+ payload["host"] = host;
94305
+ }
94306
+ if (typeof port !== "undefined") {
94307
+ payload["port"] = port;
94308
+ }
94309
+ if (typeof username !== "undefined") {
94310
+ payload["username"] = username;
94311
+ }
94312
+ if (typeof password !== "undefined") {
94313
+ payload["password"] = password;
94314
+ }
94315
+ if (typeof senderEmail !== "undefined") {
94316
+ payload["senderEmail"] = senderEmail;
94317
+ }
94318
+ if (typeof senderName !== "undefined") {
94319
+ payload["senderName"] = senderName;
94320
+ }
94321
+ if (typeof replyToEmail !== "undefined") {
94322
+ payload["replyToEmail"] = replyToEmail;
94323
+ }
94324
+ if (typeof replyToName !== "undefined") {
94325
+ payload["replyToName"] = replyToName;
94326
+ }
94327
+ if (typeof secure !== "undefined") {
94328
+ payload["secure"] = secure;
94329
+ }
94330
+ if (typeof enabled !== "undefined") {
94331
+ payload["enabled"] = enabled;
94332
+ }
94333
+ const uri = new URL(this.client.config.endpoint + apiPath);
94334
+ const apiHeaders = {
94335
+ "content-type": "application/json"
94336
+ };
94337
+ return this.client.call("patch", uri, apiHeaders, payload);
94338
+ }
94339
+ createSMTPTest(paramsOrFirst) {
94340
+ let params;
94341
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94342
+ params = paramsOrFirst || {};
94343
+ } else {
94344
+ params = {
94345
+ emails: paramsOrFirst
94346
+ };
94347
+ }
94348
+ const emails = params.emails;
94349
+ if (typeof emails === "undefined") {
94350
+ throw new AppwriteException('Missing required parameter: "emails"');
94351
+ }
94352
+ const apiPath = "/project/smtp/tests";
94353
+ const payload = {};
94354
+ if (typeof emails !== "undefined") {
94355
+ payload["emails"] = emails;
94356
+ }
94357
+ const uri = new URL(this.client.config.endpoint + apiPath);
94358
+ const apiHeaders = {
94359
+ "content-type": "application/json"
94360
+ };
94361
+ return this.client.call("post", uri, apiHeaders, payload);
94362
+ }
94363
+ updateEmailTemplate(paramsOrFirst, ...rest) {
94364
+ let params;
94365
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("templateId" in paramsOrFirst || "locale" in paramsOrFirst || "subject" in paramsOrFirst || "message" in paramsOrFirst || "senderName" in paramsOrFirst || "senderEmail" in paramsOrFirst || "replyToEmail" in paramsOrFirst || "replyToName" in paramsOrFirst)) {
94366
+ params = paramsOrFirst || {};
94367
+ } else {
94368
+ params = {
94369
+ templateId: paramsOrFirst,
94370
+ locale: rest[0],
94371
+ subject: rest[1],
94372
+ message: rest[2],
94373
+ senderName: rest[3],
94374
+ senderEmail: rest[4],
94375
+ replyToEmail: rest[5],
94376
+ replyToName: rest[6]
94377
+ };
94378
+ }
94379
+ const templateId = params.templateId;
94380
+ const locale = params.locale;
94381
+ const subject = params.subject;
94382
+ const message = params.message;
94383
+ const senderName = params.senderName;
94384
+ const senderEmail = params.senderEmail;
94385
+ const replyToEmail = params.replyToEmail;
94386
+ const replyToName = params.replyToName;
94387
+ if (typeof templateId === "undefined") {
94388
+ throw new AppwriteException('Missing required parameter: "templateId"');
94389
+ }
94390
+ const apiPath = "/project/templates/email";
94391
+ const payload = {};
94392
+ if (typeof templateId !== "undefined") {
94393
+ payload["templateId"] = templateId;
94394
+ }
94395
+ if (typeof locale !== "undefined") {
94396
+ payload["locale"] = locale;
94397
+ }
94398
+ if (typeof subject !== "undefined") {
94399
+ payload["subject"] = subject;
94400
+ }
94401
+ if (typeof message !== "undefined") {
94402
+ payload["message"] = message;
94403
+ }
94404
+ if (typeof senderName !== "undefined") {
94405
+ payload["senderName"] = senderName;
94406
+ }
94407
+ if (typeof senderEmail !== "undefined") {
94408
+ payload["senderEmail"] = senderEmail;
94409
+ }
94410
+ if (typeof replyToEmail !== "undefined") {
94411
+ payload["replyToEmail"] = replyToEmail;
94412
+ }
94413
+ if (typeof replyToName !== "undefined") {
94414
+ payload["replyToName"] = replyToName;
94415
+ }
94416
+ const uri = new URL(this.client.config.endpoint + apiPath);
94417
+ const apiHeaders = {
94418
+ "content-type": "application/json"
94419
+ };
94420
+ return this.client.call("patch", uri, apiHeaders, payload);
94421
+ }
94422
+ getEmailTemplate(paramsOrFirst, ...rest) {
94423
+ let params;
94424
+ if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("templateId" in paramsOrFirst || "locale" in paramsOrFirst)) {
94425
+ params = paramsOrFirst || {};
94426
+ } else {
94427
+ params = {
94428
+ templateId: paramsOrFirst,
94429
+ locale: rest[0]
94430
+ };
94431
+ }
94432
+ const templateId = params.templateId;
94433
+ const locale = params.locale;
94434
+ if (typeof templateId === "undefined") {
94435
+ throw new AppwriteException('Missing required parameter: "templateId"');
94436
+ }
94437
+ const apiPath = "/project/templates/email/{templateId}".replace("{templateId}", templateId);
94438
+ const payload = {};
94439
+ if (typeof locale !== "undefined") {
94440
+ payload["locale"] = locale;
94441
+ }
94442
+ const uri = new URL(this.client.config.endpoint + apiPath);
94443
+ const apiHeaders = {};
94444
+ return this.client.call("get", uri, apiHeaders, payload);
94445
+ }
94002
94446
  getUsage(paramsOrFirst, ...rest) {
94003
94447
  let params;
94004
94448
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -94417,138 +94861,6 @@ var Projects = class {
94417
94861
  };
94418
94862
  return this.client.call("delete", uri, apiHeaders, payload);
94419
94863
  }
94420
- updateAuthDuration(paramsOrFirst, ...rest) {
94421
- let params;
94422
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94423
- params = paramsOrFirst || {};
94424
- } else {
94425
- params = {
94426
- projectId: paramsOrFirst,
94427
- duration: rest[0]
94428
- };
94429
- }
94430
- const projectId = params.projectId;
94431
- const duration3 = params.duration;
94432
- if (typeof projectId === "undefined") {
94433
- throw new AppwriteException('Missing required parameter: "projectId"');
94434
- }
94435
- if (typeof duration3 === "undefined") {
94436
- throw new AppwriteException('Missing required parameter: "duration"');
94437
- }
94438
- const apiPath = "/projects/{projectId}/auth/duration".replace("{projectId}", projectId);
94439
- const payload = {};
94440
- if (typeof duration3 !== "undefined") {
94441
- payload["duration"] = duration3;
94442
- }
94443
- const uri = new URL(this.client.config.endpoint + apiPath);
94444
- const apiHeaders = {
94445
- "content-type": "application/json"
94446
- };
94447
- return this.client.call("patch", uri, apiHeaders, payload);
94448
- }
94449
- updateAuthLimit(paramsOrFirst, ...rest) {
94450
- let params;
94451
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94452
- params = paramsOrFirst || {};
94453
- } else {
94454
- params = {
94455
- projectId: paramsOrFirst,
94456
- limit: rest[0]
94457
- };
94458
- }
94459
- const projectId = params.projectId;
94460
- const limit = params.limit;
94461
- if (typeof projectId === "undefined") {
94462
- throw new AppwriteException('Missing required parameter: "projectId"');
94463
- }
94464
- if (typeof limit === "undefined") {
94465
- throw new AppwriteException('Missing required parameter: "limit"');
94466
- }
94467
- const apiPath = "/projects/{projectId}/auth/limit".replace("{projectId}", projectId);
94468
- const payload = {};
94469
- if (typeof limit !== "undefined") {
94470
- payload["limit"] = limit;
94471
- }
94472
- const uri = new URL(this.client.config.endpoint + apiPath);
94473
- const apiHeaders = {
94474
- "content-type": "application/json"
94475
- };
94476
- return this.client.call("patch", uri, apiHeaders, payload);
94477
- }
94478
- updateAuthSessionsLimit(paramsOrFirst, ...rest) {
94479
- let params;
94480
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94481
- params = paramsOrFirst || {};
94482
- } else {
94483
- params = {
94484
- projectId: paramsOrFirst,
94485
- limit: rest[0]
94486
- };
94487
- }
94488
- const projectId = params.projectId;
94489
- const limit = params.limit;
94490
- if (typeof projectId === "undefined") {
94491
- throw new AppwriteException('Missing required parameter: "projectId"');
94492
- }
94493
- if (typeof limit === "undefined") {
94494
- throw new AppwriteException('Missing required parameter: "limit"');
94495
- }
94496
- const apiPath = "/projects/{projectId}/auth/max-sessions".replace("{projectId}", projectId);
94497
- const payload = {};
94498
- if (typeof limit !== "undefined") {
94499
- payload["limit"] = limit;
94500
- }
94501
- const uri = new URL(this.client.config.endpoint + apiPath);
94502
- const apiHeaders = {
94503
- "content-type": "application/json"
94504
- };
94505
- return this.client.call("patch", uri, apiHeaders, payload);
94506
- }
94507
- updateMembershipsPrivacy(paramsOrFirst, ...rest) {
94508
- let params;
94509
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94510
- params = paramsOrFirst || {};
94511
- } else {
94512
- params = {
94513
- projectId: paramsOrFirst,
94514
- userName: rest[0],
94515
- userEmail: rest[1],
94516
- mfa: rest[2]
94517
- };
94518
- }
94519
- const projectId = params.projectId;
94520
- const userName = params.userName;
94521
- const userEmail = params.userEmail;
94522
- const mfa = params.mfa;
94523
- if (typeof projectId === "undefined") {
94524
- throw new AppwriteException('Missing required parameter: "projectId"');
94525
- }
94526
- if (typeof userName === "undefined") {
94527
- throw new AppwriteException('Missing required parameter: "userName"');
94528
- }
94529
- if (typeof userEmail === "undefined") {
94530
- throw new AppwriteException('Missing required parameter: "userEmail"');
94531
- }
94532
- if (typeof mfa === "undefined") {
94533
- throw new AppwriteException('Missing required parameter: "mfa"');
94534
- }
94535
- const apiPath = "/projects/{projectId}/auth/memberships-privacy".replace("{projectId}", projectId);
94536
- const payload = {};
94537
- if (typeof userName !== "undefined") {
94538
- payload["userName"] = userName;
94539
- }
94540
- if (typeof userEmail !== "undefined") {
94541
- payload["userEmail"] = userEmail;
94542
- }
94543
- if (typeof mfa !== "undefined") {
94544
- payload["mfa"] = mfa;
94545
- }
94546
- const uri = new URL(this.client.config.endpoint + apiPath);
94547
- const apiHeaders = {
94548
- "content-type": "application/json"
94549
- };
94550
- return this.client.call("patch", uri, apiHeaders, payload);
94551
- }
94552
94864
  updateMockNumbers(paramsOrFirst, ...rest) {
94553
94865
  let params;
94554
94866
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -94578,151 +94890,6 @@ var Projects = class {
94578
94890
  };
94579
94891
  return this.client.call("patch", uri, apiHeaders, payload);
94580
94892
  }
94581
- updateAuthPasswordDictionary(paramsOrFirst, ...rest) {
94582
- let params;
94583
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94584
- params = paramsOrFirst || {};
94585
- } else {
94586
- params = {
94587
- projectId: paramsOrFirst,
94588
- enabled: rest[0]
94589
- };
94590
- }
94591
- const projectId = params.projectId;
94592
- const enabled = params.enabled;
94593
- if (typeof projectId === "undefined") {
94594
- throw new AppwriteException('Missing required parameter: "projectId"');
94595
- }
94596
- if (typeof enabled === "undefined") {
94597
- throw new AppwriteException('Missing required parameter: "enabled"');
94598
- }
94599
- const apiPath = "/projects/{projectId}/auth/password-dictionary".replace("{projectId}", projectId);
94600
- const payload = {};
94601
- if (typeof enabled !== "undefined") {
94602
- payload["enabled"] = enabled;
94603
- }
94604
- const uri = new URL(this.client.config.endpoint + apiPath);
94605
- const apiHeaders = {
94606
- "content-type": "application/json"
94607
- };
94608
- return this.client.call("patch", uri, apiHeaders, payload);
94609
- }
94610
- updateAuthPasswordHistory(paramsOrFirst, ...rest) {
94611
- let params;
94612
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94613
- params = paramsOrFirst || {};
94614
- } else {
94615
- params = {
94616
- projectId: paramsOrFirst,
94617
- limit: rest[0]
94618
- };
94619
- }
94620
- const projectId = params.projectId;
94621
- const limit = params.limit;
94622
- if (typeof projectId === "undefined") {
94623
- throw new AppwriteException('Missing required parameter: "projectId"');
94624
- }
94625
- if (typeof limit === "undefined") {
94626
- throw new AppwriteException('Missing required parameter: "limit"');
94627
- }
94628
- const apiPath = "/projects/{projectId}/auth/password-history".replace("{projectId}", projectId);
94629
- const payload = {};
94630
- if (typeof limit !== "undefined") {
94631
- payload["limit"] = limit;
94632
- }
94633
- const uri = new URL(this.client.config.endpoint + apiPath);
94634
- const apiHeaders = {
94635
- "content-type": "application/json"
94636
- };
94637
- return this.client.call("patch", uri, apiHeaders, payload);
94638
- }
94639
- updatePersonalDataCheck(paramsOrFirst, ...rest) {
94640
- let params;
94641
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94642
- params = paramsOrFirst || {};
94643
- } else {
94644
- params = {
94645
- projectId: paramsOrFirst,
94646
- enabled: rest[0]
94647
- };
94648
- }
94649
- const projectId = params.projectId;
94650
- const enabled = params.enabled;
94651
- if (typeof projectId === "undefined") {
94652
- throw new AppwriteException('Missing required parameter: "projectId"');
94653
- }
94654
- if (typeof enabled === "undefined") {
94655
- throw new AppwriteException('Missing required parameter: "enabled"');
94656
- }
94657
- const apiPath = "/projects/{projectId}/auth/personal-data".replace("{projectId}", projectId);
94658
- const payload = {};
94659
- if (typeof enabled !== "undefined") {
94660
- payload["enabled"] = enabled;
94661
- }
94662
- const uri = new URL(this.client.config.endpoint + apiPath);
94663
- const apiHeaders = {
94664
- "content-type": "application/json"
94665
- };
94666
- return this.client.call("patch", uri, apiHeaders, payload);
94667
- }
94668
- updateSessionAlerts(paramsOrFirst, ...rest) {
94669
- let params;
94670
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94671
- params = paramsOrFirst || {};
94672
- } else {
94673
- params = {
94674
- projectId: paramsOrFirst,
94675
- alerts: rest[0]
94676
- };
94677
- }
94678
- const projectId = params.projectId;
94679
- const alerts = params.alerts;
94680
- if (typeof projectId === "undefined") {
94681
- throw new AppwriteException('Missing required parameter: "projectId"');
94682
- }
94683
- if (typeof alerts === "undefined") {
94684
- throw new AppwriteException('Missing required parameter: "alerts"');
94685
- }
94686
- const apiPath = "/projects/{projectId}/auth/session-alerts".replace("{projectId}", projectId);
94687
- const payload = {};
94688
- if (typeof alerts !== "undefined") {
94689
- payload["alerts"] = alerts;
94690
- }
94691
- const uri = new URL(this.client.config.endpoint + apiPath);
94692
- const apiHeaders = {
94693
- "content-type": "application/json"
94694
- };
94695
- return this.client.call("patch", uri, apiHeaders, payload);
94696
- }
94697
- updateSessionInvalidation(paramsOrFirst, ...rest) {
94698
- let params;
94699
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94700
- params = paramsOrFirst || {};
94701
- } else {
94702
- params = {
94703
- projectId: paramsOrFirst,
94704
- enabled: rest[0]
94705
- };
94706
- }
94707
- const projectId = params.projectId;
94708
- const enabled = params.enabled;
94709
- if (typeof projectId === "undefined") {
94710
- throw new AppwriteException('Missing required parameter: "projectId"');
94711
- }
94712
- if (typeof enabled === "undefined") {
94713
- throw new AppwriteException('Missing required parameter: "enabled"');
94714
- }
94715
- const apiPath = "/projects/{projectId}/auth/session-invalidation".replace("{projectId}", projectId);
94716
- const payload = {};
94717
- if (typeof enabled !== "undefined") {
94718
- payload["enabled"] = enabled;
94719
- }
94720
- const uri = new URL(this.client.config.endpoint + apiPath);
94721
- const apiHeaders = {
94722
- "content-type": "application/json"
94723
- };
94724
- return this.client.call("patch", uri, apiHeaders, payload);
94725
- }
94726
94893
  updateAuthStatus(paramsOrFirst, ...rest) {
94727
94894
  let params;
94728
94895
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -95117,300 +95284,6 @@ var Projects = class {
95117
95284
  const apiHeaders = {};
95118
95285
  return this.client.call("get", uri, apiHeaders, payload);
95119
95286
  }
95120
- updateSmtp(paramsOrFirst, ...rest) {
95121
- let params;
95122
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95123
- params = paramsOrFirst || {};
95124
- } else {
95125
- params = {
95126
- projectId: paramsOrFirst,
95127
- enabled: rest[0],
95128
- senderName: rest[1],
95129
- senderEmail: rest[2],
95130
- replyTo: rest[3],
95131
- host: rest[4],
95132
- port: rest[5],
95133
- username: rest[6],
95134
- password: rest[7],
95135
- secure: rest[8]
95136
- };
95137
- }
95138
- const projectId = params.projectId;
95139
- const enabled = params.enabled;
95140
- const senderName = params.senderName;
95141
- const senderEmail = params.senderEmail;
95142
- const replyTo = params.replyTo;
95143
- const host = params.host;
95144
- const port = params.port;
95145
- const username = params.username;
95146
- const password = params.password;
95147
- const secure = params.secure;
95148
- if (typeof projectId === "undefined") {
95149
- throw new AppwriteException('Missing required parameter: "projectId"');
95150
- }
95151
- if (typeof enabled === "undefined") {
95152
- throw new AppwriteException('Missing required parameter: "enabled"');
95153
- }
95154
- const apiPath = "/projects/{projectId}/smtp".replace("{projectId}", projectId);
95155
- const payload = {};
95156
- if (typeof enabled !== "undefined") {
95157
- payload["enabled"] = enabled;
95158
- }
95159
- if (typeof senderName !== "undefined") {
95160
- payload["senderName"] = senderName;
95161
- }
95162
- if (typeof senderEmail !== "undefined") {
95163
- payload["senderEmail"] = senderEmail;
95164
- }
95165
- if (typeof replyTo !== "undefined") {
95166
- payload["replyTo"] = replyTo;
95167
- }
95168
- if (typeof host !== "undefined") {
95169
- payload["host"] = host;
95170
- }
95171
- if (typeof port !== "undefined") {
95172
- payload["port"] = port;
95173
- }
95174
- if (typeof username !== "undefined") {
95175
- payload["username"] = username;
95176
- }
95177
- if (typeof password !== "undefined") {
95178
- payload["password"] = password;
95179
- }
95180
- if (typeof secure !== "undefined") {
95181
- payload["secure"] = secure;
95182
- }
95183
- const uri = new URL(this.client.config.endpoint + apiPath);
95184
- const apiHeaders = {
95185
- "content-type": "application/json"
95186
- };
95187
- return this.client.call("patch", uri, apiHeaders, payload);
95188
- }
95189
- updateSMTP(paramsOrFirst, ...rest) {
95190
- let params;
95191
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95192
- params = paramsOrFirst || {};
95193
- } else {
95194
- params = {
95195
- projectId: paramsOrFirst,
95196
- enabled: rest[0],
95197
- senderName: rest[1],
95198
- senderEmail: rest[2],
95199
- replyTo: rest[3],
95200
- host: rest[4],
95201
- port: rest[5],
95202
- username: rest[6],
95203
- password: rest[7],
95204
- secure: rest[8]
95205
- };
95206
- }
95207
- const projectId = params.projectId;
95208
- const enabled = params.enabled;
95209
- const senderName = params.senderName;
95210
- const senderEmail = params.senderEmail;
95211
- const replyTo = params.replyTo;
95212
- const host = params.host;
95213
- const port = params.port;
95214
- const username = params.username;
95215
- const password = params.password;
95216
- const secure = params.secure;
95217
- if (typeof projectId === "undefined") {
95218
- throw new AppwriteException('Missing required parameter: "projectId"');
95219
- }
95220
- if (typeof enabled === "undefined") {
95221
- throw new AppwriteException('Missing required parameter: "enabled"');
95222
- }
95223
- const apiPath = "/projects/{projectId}/smtp".replace("{projectId}", projectId);
95224
- const payload = {};
95225
- if (typeof enabled !== "undefined") {
95226
- payload["enabled"] = enabled;
95227
- }
95228
- if (typeof senderName !== "undefined") {
95229
- payload["senderName"] = senderName;
95230
- }
95231
- if (typeof senderEmail !== "undefined") {
95232
- payload["senderEmail"] = senderEmail;
95233
- }
95234
- if (typeof replyTo !== "undefined") {
95235
- payload["replyTo"] = replyTo;
95236
- }
95237
- if (typeof host !== "undefined") {
95238
- payload["host"] = host;
95239
- }
95240
- if (typeof port !== "undefined") {
95241
- payload["port"] = port;
95242
- }
95243
- if (typeof username !== "undefined") {
95244
- payload["username"] = username;
95245
- }
95246
- if (typeof password !== "undefined") {
95247
- payload["password"] = password;
95248
- }
95249
- if (typeof secure !== "undefined") {
95250
- payload["secure"] = secure;
95251
- }
95252
- const uri = new URL(this.client.config.endpoint + apiPath);
95253
- const apiHeaders = {
95254
- "content-type": "application/json"
95255
- };
95256
- return this.client.call("patch", uri, apiHeaders, payload);
95257
- }
95258
- createSmtpTest(paramsOrFirst, ...rest) {
95259
- let params;
95260
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95261
- params = paramsOrFirst || {};
95262
- } else {
95263
- params = {
95264
- projectId: paramsOrFirst,
95265
- emails: rest[0],
95266
- senderName: rest[1],
95267
- senderEmail: rest[2],
95268
- host: rest[3],
95269
- replyTo: rest[4],
95270
- port: rest[5],
95271
- username: rest[6],
95272
- password: rest[7],
95273
- secure: rest[8]
95274
- };
95275
- }
95276
- const projectId = params.projectId;
95277
- const emails = params.emails;
95278
- const senderName = params.senderName;
95279
- const senderEmail = params.senderEmail;
95280
- const host = params.host;
95281
- const replyTo = params.replyTo;
95282
- const port = params.port;
95283
- const username = params.username;
95284
- const password = params.password;
95285
- const secure = params.secure;
95286
- if (typeof projectId === "undefined") {
95287
- throw new AppwriteException('Missing required parameter: "projectId"');
95288
- }
95289
- if (typeof emails === "undefined") {
95290
- throw new AppwriteException('Missing required parameter: "emails"');
95291
- }
95292
- if (typeof senderName === "undefined") {
95293
- throw new AppwriteException('Missing required parameter: "senderName"');
95294
- }
95295
- if (typeof senderEmail === "undefined") {
95296
- throw new AppwriteException('Missing required parameter: "senderEmail"');
95297
- }
95298
- if (typeof host === "undefined") {
95299
- throw new AppwriteException('Missing required parameter: "host"');
95300
- }
95301
- const apiPath = "/projects/{projectId}/smtp/tests".replace("{projectId}", projectId);
95302
- const payload = {};
95303
- if (typeof emails !== "undefined") {
95304
- payload["emails"] = emails;
95305
- }
95306
- if (typeof senderName !== "undefined") {
95307
- payload["senderName"] = senderName;
95308
- }
95309
- if (typeof senderEmail !== "undefined") {
95310
- payload["senderEmail"] = senderEmail;
95311
- }
95312
- if (typeof replyTo !== "undefined") {
95313
- payload["replyTo"] = replyTo;
95314
- }
95315
- if (typeof host !== "undefined") {
95316
- payload["host"] = host;
95317
- }
95318
- if (typeof port !== "undefined") {
95319
- payload["port"] = port;
95320
- }
95321
- if (typeof username !== "undefined") {
95322
- payload["username"] = username;
95323
- }
95324
- if (typeof password !== "undefined") {
95325
- payload["password"] = password;
95326
- }
95327
- if (typeof secure !== "undefined") {
95328
- payload["secure"] = secure;
95329
- }
95330
- const uri = new URL(this.client.config.endpoint + apiPath);
95331
- const apiHeaders = {
95332
- "content-type": "application/json"
95333
- };
95334
- return this.client.call("post", uri, apiHeaders, payload);
95335
- }
95336
- createSMTPTest(paramsOrFirst, ...rest) {
95337
- let params;
95338
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95339
- params = paramsOrFirst || {};
95340
- } else {
95341
- params = {
95342
- projectId: paramsOrFirst,
95343
- emails: rest[0],
95344
- senderName: rest[1],
95345
- senderEmail: rest[2],
95346
- host: rest[3],
95347
- replyTo: rest[4],
95348
- port: rest[5],
95349
- username: rest[6],
95350
- password: rest[7],
95351
- secure: rest[8]
95352
- };
95353
- }
95354
- const projectId = params.projectId;
95355
- const emails = params.emails;
95356
- const senderName = params.senderName;
95357
- const senderEmail = params.senderEmail;
95358
- const host = params.host;
95359
- const replyTo = params.replyTo;
95360
- const port = params.port;
95361
- const username = params.username;
95362
- const password = params.password;
95363
- const secure = params.secure;
95364
- if (typeof projectId === "undefined") {
95365
- throw new AppwriteException('Missing required parameter: "projectId"');
95366
- }
95367
- if (typeof emails === "undefined") {
95368
- throw new AppwriteException('Missing required parameter: "emails"');
95369
- }
95370
- if (typeof senderName === "undefined") {
95371
- throw new AppwriteException('Missing required parameter: "senderName"');
95372
- }
95373
- if (typeof senderEmail === "undefined") {
95374
- throw new AppwriteException('Missing required parameter: "senderEmail"');
95375
- }
95376
- if (typeof host === "undefined") {
95377
- throw new AppwriteException('Missing required parameter: "host"');
95378
- }
95379
- const apiPath = "/projects/{projectId}/smtp/tests".replace("{projectId}", projectId);
95380
- const payload = {};
95381
- if (typeof emails !== "undefined") {
95382
- payload["emails"] = emails;
95383
- }
95384
- if (typeof senderName !== "undefined") {
95385
- payload["senderName"] = senderName;
95386
- }
95387
- if (typeof senderEmail !== "undefined") {
95388
- payload["senderEmail"] = senderEmail;
95389
- }
95390
- if (typeof replyTo !== "undefined") {
95391
- payload["replyTo"] = replyTo;
95392
- }
95393
- if (typeof host !== "undefined") {
95394
- payload["host"] = host;
95395
- }
95396
- if (typeof port !== "undefined") {
95397
- payload["port"] = port;
95398
- }
95399
- if (typeof username !== "undefined") {
95400
- payload["username"] = username;
95401
- }
95402
- if (typeof password !== "undefined") {
95403
- payload["password"] = password;
95404
- }
95405
- if (typeof secure !== "undefined") {
95406
- payload["secure"] = secure;
95407
- }
95408
- const uri = new URL(this.client.config.endpoint + apiPath);
95409
- const apiHeaders = {
95410
- "content-type": "application/json"
95411
- };
95412
- return this.client.call("post", uri, apiHeaders, payload);
95413
- }
95414
95287
  updateStatus(paramsOrFirst, ...rest) {
95415
95288
  let params;
95416
95289
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -95469,326 +95342,6 @@ var Projects = class {
95469
95342
  };
95470
95343
  return this.client.call("patch", uri, apiHeaders, payload);
95471
95344
  }
95472
- getEmailTemplate(paramsOrFirst, ...rest) {
95473
- let params;
95474
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95475
- params = paramsOrFirst || {};
95476
- } else {
95477
- params = {
95478
- projectId: paramsOrFirst,
95479
- type: rest[0],
95480
- locale: rest[1]
95481
- };
95482
- }
95483
- const projectId = params.projectId;
95484
- const type = params.type;
95485
- const locale = params.locale;
95486
- if (typeof projectId === "undefined") {
95487
- throw new AppwriteException('Missing required parameter: "projectId"');
95488
- }
95489
- if (typeof type === "undefined") {
95490
- throw new AppwriteException('Missing required parameter: "type"');
95491
- }
95492
- if (typeof locale === "undefined") {
95493
- throw new AppwriteException('Missing required parameter: "locale"');
95494
- }
95495
- const apiPath = "/projects/{projectId}/templates/email/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95496
- const payload = {};
95497
- const uri = new URL(this.client.config.endpoint + apiPath);
95498
- const apiHeaders = {};
95499
- return this.client.call("get", uri, apiHeaders, payload);
95500
- }
95501
- updateEmailTemplate(paramsOrFirst, ...rest) {
95502
- let params;
95503
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95504
- params = paramsOrFirst || {};
95505
- } else {
95506
- params = {
95507
- projectId: paramsOrFirst,
95508
- type: rest[0],
95509
- locale: rest[1],
95510
- subject: rest[2],
95511
- message: rest[3],
95512
- senderName: rest[4],
95513
- senderEmail: rest[5],
95514
- replyTo: rest[6]
95515
- };
95516
- }
95517
- const projectId = params.projectId;
95518
- const type = params.type;
95519
- const locale = params.locale;
95520
- const subject = params.subject;
95521
- const message = params.message;
95522
- const senderName = params.senderName;
95523
- const senderEmail = params.senderEmail;
95524
- const replyTo = params.replyTo;
95525
- if (typeof projectId === "undefined") {
95526
- throw new AppwriteException('Missing required parameter: "projectId"');
95527
- }
95528
- if (typeof type === "undefined") {
95529
- throw new AppwriteException('Missing required parameter: "type"');
95530
- }
95531
- if (typeof locale === "undefined") {
95532
- throw new AppwriteException('Missing required parameter: "locale"');
95533
- }
95534
- if (typeof subject === "undefined") {
95535
- throw new AppwriteException('Missing required parameter: "subject"');
95536
- }
95537
- if (typeof message === "undefined") {
95538
- throw new AppwriteException('Missing required parameter: "message"');
95539
- }
95540
- const apiPath = "/projects/{projectId}/templates/email/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95541
- const payload = {};
95542
- if (typeof subject !== "undefined") {
95543
- payload["subject"] = subject;
95544
- }
95545
- if (typeof message !== "undefined") {
95546
- payload["message"] = message;
95547
- }
95548
- if (typeof senderName !== "undefined") {
95549
- payload["senderName"] = senderName;
95550
- }
95551
- if (typeof senderEmail !== "undefined") {
95552
- payload["senderEmail"] = senderEmail;
95553
- }
95554
- if (typeof replyTo !== "undefined") {
95555
- payload["replyTo"] = replyTo;
95556
- }
95557
- const uri = new URL(this.client.config.endpoint + apiPath);
95558
- const apiHeaders = {
95559
- "content-type": "application/json"
95560
- };
95561
- return this.client.call("patch", uri, apiHeaders, payload);
95562
- }
95563
- deleteEmailTemplate(paramsOrFirst, ...rest) {
95564
- let params;
95565
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95566
- params = paramsOrFirst || {};
95567
- } else {
95568
- params = {
95569
- projectId: paramsOrFirst,
95570
- type: rest[0],
95571
- locale: rest[1]
95572
- };
95573
- }
95574
- const projectId = params.projectId;
95575
- const type = params.type;
95576
- const locale = params.locale;
95577
- if (typeof projectId === "undefined") {
95578
- throw new AppwriteException('Missing required parameter: "projectId"');
95579
- }
95580
- if (typeof type === "undefined") {
95581
- throw new AppwriteException('Missing required parameter: "type"');
95582
- }
95583
- if (typeof locale === "undefined") {
95584
- throw new AppwriteException('Missing required parameter: "locale"');
95585
- }
95586
- const apiPath = "/projects/{projectId}/templates/email/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95587
- const payload = {};
95588
- const uri = new URL(this.client.config.endpoint + apiPath);
95589
- const apiHeaders = {
95590
- "content-type": "application/json"
95591
- };
95592
- return this.client.call("delete", uri, apiHeaders, payload);
95593
- }
95594
- getSmsTemplate(paramsOrFirst, ...rest) {
95595
- let params;
95596
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95597
- params = paramsOrFirst || {};
95598
- } else {
95599
- params = {
95600
- projectId: paramsOrFirst,
95601
- type: rest[0],
95602
- locale: rest[1]
95603
- };
95604
- }
95605
- const projectId = params.projectId;
95606
- const type = params.type;
95607
- const locale = params.locale;
95608
- if (typeof projectId === "undefined") {
95609
- throw new AppwriteException('Missing required parameter: "projectId"');
95610
- }
95611
- if (typeof type === "undefined") {
95612
- throw new AppwriteException('Missing required parameter: "type"');
95613
- }
95614
- if (typeof locale === "undefined") {
95615
- throw new AppwriteException('Missing required parameter: "locale"');
95616
- }
95617
- const apiPath = "/projects/{projectId}/templates/sms/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95618
- const payload = {};
95619
- const uri = new URL(this.client.config.endpoint + apiPath);
95620
- const apiHeaders = {};
95621
- return this.client.call("get", uri, apiHeaders, payload);
95622
- }
95623
- getSMSTemplate(paramsOrFirst, ...rest) {
95624
- let params;
95625
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95626
- params = paramsOrFirst || {};
95627
- } else {
95628
- params = {
95629
- projectId: paramsOrFirst,
95630
- type: rest[0],
95631
- locale: rest[1]
95632
- };
95633
- }
95634
- const projectId = params.projectId;
95635
- const type = params.type;
95636
- const locale = params.locale;
95637
- if (typeof projectId === "undefined") {
95638
- throw new AppwriteException('Missing required parameter: "projectId"');
95639
- }
95640
- if (typeof type === "undefined") {
95641
- throw new AppwriteException('Missing required parameter: "type"');
95642
- }
95643
- if (typeof locale === "undefined") {
95644
- throw new AppwriteException('Missing required parameter: "locale"');
95645
- }
95646
- const apiPath = "/projects/{projectId}/templates/sms/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95647
- const payload = {};
95648
- const uri = new URL(this.client.config.endpoint + apiPath);
95649
- const apiHeaders = {};
95650
- return this.client.call("get", uri, apiHeaders, payload);
95651
- }
95652
- updateSmsTemplate(paramsOrFirst, ...rest) {
95653
- let params;
95654
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95655
- params = paramsOrFirst || {};
95656
- } else {
95657
- params = {
95658
- projectId: paramsOrFirst,
95659
- type: rest[0],
95660
- locale: rest[1],
95661
- message: rest[2]
95662
- };
95663
- }
95664
- const projectId = params.projectId;
95665
- const type = params.type;
95666
- const locale = params.locale;
95667
- const message = params.message;
95668
- if (typeof projectId === "undefined") {
95669
- throw new AppwriteException('Missing required parameter: "projectId"');
95670
- }
95671
- if (typeof type === "undefined") {
95672
- throw new AppwriteException('Missing required parameter: "type"');
95673
- }
95674
- if (typeof locale === "undefined") {
95675
- throw new AppwriteException('Missing required parameter: "locale"');
95676
- }
95677
- if (typeof message === "undefined") {
95678
- throw new AppwriteException('Missing required parameter: "message"');
95679
- }
95680
- const apiPath = "/projects/{projectId}/templates/sms/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95681
- const payload = {};
95682
- if (typeof message !== "undefined") {
95683
- payload["message"] = message;
95684
- }
95685
- const uri = new URL(this.client.config.endpoint + apiPath);
95686
- const apiHeaders = {
95687
- "content-type": "application/json"
95688
- };
95689
- return this.client.call("patch", uri, apiHeaders, payload);
95690
- }
95691
- updateSMSTemplate(paramsOrFirst, ...rest) {
95692
- let params;
95693
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95694
- params = paramsOrFirst || {};
95695
- } else {
95696
- params = {
95697
- projectId: paramsOrFirst,
95698
- type: rest[0],
95699
- locale: rest[1],
95700
- message: rest[2]
95701
- };
95702
- }
95703
- const projectId = params.projectId;
95704
- const type = params.type;
95705
- const locale = params.locale;
95706
- const message = params.message;
95707
- if (typeof projectId === "undefined") {
95708
- throw new AppwriteException('Missing required parameter: "projectId"');
95709
- }
95710
- if (typeof type === "undefined") {
95711
- throw new AppwriteException('Missing required parameter: "type"');
95712
- }
95713
- if (typeof locale === "undefined") {
95714
- throw new AppwriteException('Missing required parameter: "locale"');
95715
- }
95716
- if (typeof message === "undefined") {
95717
- throw new AppwriteException('Missing required parameter: "message"');
95718
- }
95719
- const apiPath = "/projects/{projectId}/templates/sms/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95720
- const payload = {};
95721
- if (typeof message !== "undefined") {
95722
- payload["message"] = message;
95723
- }
95724
- const uri = new URL(this.client.config.endpoint + apiPath);
95725
- const apiHeaders = {
95726
- "content-type": "application/json"
95727
- };
95728
- return this.client.call("patch", uri, apiHeaders, payload);
95729
- }
95730
- deleteSmsTemplate(paramsOrFirst, ...rest) {
95731
- let params;
95732
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95733
- params = paramsOrFirst || {};
95734
- } else {
95735
- params = {
95736
- projectId: paramsOrFirst,
95737
- type: rest[0],
95738
- locale: rest[1]
95739
- };
95740
- }
95741
- const projectId = params.projectId;
95742
- const type = params.type;
95743
- const locale = params.locale;
95744
- if (typeof projectId === "undefined") {
95745
- throw new AppwriteException('Missing required parameter: "projectId"');
95746
- }
95747
- if (typeof type === "undefined") {
95748
- throw new AppwriteException('Missing required parameter: "type"');
95749
- }
95750
- if (typeof locale === "undefined") {
95751
- throw new AppwriteException('Missing required parameter: "locale"');
95752
- }
95753
- const apiPath = "/projects/{projectId}/templates/sms/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95754
- const payload = {};
95755
- const uri = new URL(this.client.config.endpoint + apiPath);
95756
- const apiHeaders = {
95757
- "content-type": "application/json"
95758
- };
95759
- return this.client.call("delete", uri, apiHeaders, payload);
95760
- }
95761
- deleteSMSTemplate(paramsOrFirst, ...rest) {
95762
- let params;
95763
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95764
- params = paramsOrFirst || {};
95765
- } else {
95766
- params = {
95767
- projectId: paramsOrFirst,
95768
- type: rest[0],
95769
- locale: rest[1]
95770
- };
95771
- }
95772
- const projectId = params.projectId;
95773
- const type = params.type;
95774
- const locale = params.locale;
95775
- if (typeof projectId === "undefined") {
95776
- throw new AppwriteException('Missing required parameter: "projectId"');
95777
- }
95778
- if (typeof type === "undefined") {
95779
- throw new AppwriteException('Missing required parameter: "type"');
95780
- }
95781
- if (typeof locale === "undefined") {
95782
- throw new AppwriteException('Missing required parameter: "locale"');
95783
- }
95784
- const apiPath = "/projects/{projectId}/templates/sms/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95785
- const payload = {};
95786
- const uri = new URL(this.client.config.endpoint + apiPath);
95787
- const apiHeaders = {
95788
- "content-type": "application/json"
95789
- };
95790
- return this.client.call("delete", uri, apiHeaders, payload);
95791
- }
95792
95345
  };
95793
95346
  var Proxy2 = class {
95794
95347
  constructor(client) {
@@ -101589,41 +101142,6 @@ Permission.update = (role) => {
101589
101142
  Permission.delete = (role) => {
101590
101143
  return `delete("${role}")`;
101591
101144
  };
101592
- var _a2;
101593
- var _ID_hexTimestamp;
101594
- var ID2 = class {
101595
- /**
101596
- * Uses the provided ID as the ID for the resource.
101597
- *
101598
- * @param {string} id
101599
- * @returns {string}
101600
- */
101601
- static custom(id) {
101602
- return id;
101603
- }
101604
- /**
101605
- * Have Appwrite generate a unique ID for you.
101606
- *
101607
- * @param {number} padding. Default is 7.
101608
- * @returns {string}
101609
- */
101610
- static unique(padding = 7) {
101611
- const baseId = __classPrivateFieldGet(_a2, _a2, "m", _ID_hexTimestamp).call(_a2);
101612
- let randomPadding = "";
101613
- for (let i = 0; i < padding; i++) {
101614
- const randomHexDigit = Math.floor(Math.random() * 16).toString(16);
101615
- randomPadding += randomHexDigit;
101616
- }
101617
- return baseId + randomPadding;
101618
- }
101619
- };
101620
- _a2 = ID2, _ID_hexTimestamp = function _ID_hexTimestamp2() {
101621
- const now = /* @__PURE__ */ new Date();
101622
- const sec = Math.floor(now.getTime() / 1e3);
101623
- const msec = now.getMilliseconds();
101624
- const hexTimestamp = sec.toString(16) + msec.toString(16).padStart(5, "0");
101625
- return hexTimestamp;
101626
- };
101627
101145
  var Condition;
101628
101146
  (function(Condition2) {
101629
101147
  Condition2["Equal"] = "equal";
@@ -101828,6 +101346,8 @@ var Scopes;
101828
101346
  Scopes2["PlatformsRead"] = "platforms.read";
101829
101347
  Scopes2["PlatformsWrite"] = "platforms.write";
101830
101348
  Scopes2["PoliciesWrite"] = "policies.write";
101349
+ Scopes2["TemplatesRead"] = "templates.read";
101350
+ Scopes2["TemplatesWrite"] = "templates.write";
101831
101351
  Scopes2["PoliciesRead"] = "policies.read";
101832
101352
  Scopes2["ArchivesRead"] = "archives.read";
101833
101353
  Scopes2["ArchivesWrite"] = "archives.write";
@@ -102639,6 +102159,12 @@ var OrderBy;
102639
102159
  OrderBy2["Asc"] = "asc";
102640
102160
  OrderBy2["Desc"] = "desc";
102641
102161
  })(OrderBy || (OrderBy = {}));
102162
+ var DocumentsDBIndexType;
102163
+ (function(DocumentsDBIndexType2) {
102164
+ DocumentsDBIndexType2["Key"] = "key";
102165
+ DocumentsDBIndexType2["Fulltext"] = "fulltext";
102166
+ DocumentsDBIndexType2["Unique"] = "unique";
102167
+ })(DocumentsDBIndexType || (DocumentsDBIndexType = {}));
102642
102168
  var RegistrationType;
102643
102169
  (function(RegistrationType2) {
102644
102170
  RegistrationType2["New"] = "new";
@@ -103003,46 +102529,11 @@ var ServiceId;
103003
102529
  ServiceId3["Migrations"] = "migrations";
103004
102530
  ServiceId3["Messaging"] = "messaging";
103005
102531
  })(ServiceId || (ServiceId = {}));
103006
- var ProjectUsageRange;
103007
- (function(ProjectUsageRange2) {
103008
- ProjectUsageRange2["OneHour"] = "1h";
103009
- ProjectUsageRange2["OneDay"] = "1d";
103010
- })(ProjectUsageRange || (ProjectUsageRange = {}));
103011
- var Region;
103012
- (function(Region2) {
103013
- Region2["Fra"] = "fra";
103014
- Region2["Nyc"] = "nyc";
103015
- Region2["Syd"] = "syd";
103016
- Region2["Sfo"] = "sfo";
103017
- Region2["Sgp"] = "sgp";
103018
- Region2["Tor"] = "tor";
103019
- })(Region || (Region = {}));
103020
- var AuthMethod;
103021
- (function(AuthMethod3) {
103022
- AuthMethod3["Emailpassword"] = "email-password";
103023
- AuthMethod3["Magicurl"] = "magic-url";
103024
- AuthMethod3["Emailotp"] = "email-otp";
103025
- AuthMethod3["Anonymous"] = "anonymous";
103026
- AuthMethod3["Invites"] = "invites";
103027
- AuthMethod3["Jwt"] = "jwt";
103028
- AuthMethod3["Phone"] = "phone";
103029
- })(AuthMethod || (AuthMethod = {}));
103030
- var ResourceType;
103031
- (function(ResourceType2) {
103032
- ResourceType2["Function"] = "function";
103033
- ResourceType2["Execution"] = "execution";
103034
- ResourceType2["Message"] = "message";
103035
- ResourceType2["Backup"] = "backup";
103036
- })(ResourceType || (ResourceType = {}));
103037
- var SMTPSecure;
103038
- (function(SMTPSecure2) {
103039
- SMTPSecure2["Tls"] = "tls";
103040
- SMTPSecure2["Ssl"] = "ssl";
103041
- })(SMTPSecure || (SMTPSecure = {}));
103042
- var Status;
103043
- (function(Status2) {
103044
- Status2["Active"] = "active";
103045
- })(Status || (Status = {}));
102532
+ var Secure;
102533
+ (function(Secure2) {
102534
+ Secure2["Tls"] = "tls";
102535
+ Secure2["Ssl"] = "ssl";
102536
+ })(Secure || (Secure = {}));
103046
102537
  var EmailTemplateType;
103047
102538
  (function(EmailTemplateType2) {
103048
102539
  EmailTemplateType2["Verification"] = "verification";
@@ -103187,147 +102678,41 @@ var EmailTemplateLocale;
103187
102678
  EmailTemplateLocale2["Zhtw"] = "zh-tw";
103188
102679
  EmailTemplateLocale2["Zu"] = "zu";
103189
102680
  })(EmailTemplateLocale || (EmailTemplateLocale = {}));
103190
- var SmsTemplateType;
103191
- (function(SmsTemplateType2) {
103192
- SmsTemplateType2["Verification"] = "verification";
103193
- SmsTemplateType2["Login"] = "login";
103194
- SmsTemplateType2["Invitation"] = "invitation";
103195
- SmsTemplateType2["MfaChallenge"] = "mfaChallenge";
103196
- })(SmsTemplateType || (SmsTemplateType = {}));
103197
- var SmsTemplateLocale;
103198
- (function(SmsTemplateLocale2) {
103199
- SmsTemplateLocale2["Af"] = "af";
103200
- SmsTemplateLocale2["Arae"] = "ar-ae";
103201
- SmsTemplateLocale2["Arbh"] = "ar-bh";
103202
- SmsTemplateLocale2["Ardz"] = "ar-dz";
103203
- SmsTemplateLocale2["Areg"] = "ar-eg";
103204
- SmsTemplateLocale2["Ariq"] = "ar-iq";
103205
- SmsTemplateLocale2["Arjo"] = "ar-jo";
103206
- SmsTemplateLocale2["Arkw"] = "ar-kw";
103207
- SmsTemplateLocale2["Arlb"] = "ar-lb";
103208
- SmsTemplateLocale2["Arly"] = "ar-ly";
103209
- SmsTemplateLocale2["Arma"] = "ar-ma";
103210
- SmsTemplateLocale2["Arom"] = "ar-om";
103211
- SmsTemplateLocale2["Arqa"] = "ar-qa";
103212
- SmsTemplateLocale2["Arsa"] = "ar-sa";
103213
- SmsTemplateLocale2["Arsy"] = "ar-sy";
103214
- SmsTemplateLocale2["Artn"] = "ar-tn";
103215
- SmsTemplateLocale2["Arye"] = "ar-ye";
103216
- SmsTemplateLocale2["As"] = "as";
103217
- SmsTemplateLocale2["Az"] = "az";
103218
- SmsTemplateLocale2["Be"] = "be";
103219
- SmsTemplateLocale2["Bg"] = "bg";
103220
- SmsTemplateLocale2["Bh"] = "bh";
103221
- SmsTemplateLocale2["Bn"] = "bn";
103222
- SmsTemplateLocale2["Bs"] = "bs";
103223
- SmsTemplateLocale2["Ca"] = "ca";
103224
- SmsTemplateLocale2["Cs"] = "cs";
103225
- SmsTemplateLocale2["Cy"] = "cy";
103226
- SmsTemplateLocale2["Da"] = "da";
103227
- SmsTemplateLocale2["De"] = "de";
103228
- SmsTemplateLocale2["Deat"] = "de-at";
103229
- SmsTemplateLocale2["Dech"] = "de-ch";
103230
- SmsTemplateLocale2["Deli"] = "de-li";
103231
- SmsTemplateLocale2["Delu"] = "de-lu";
103232
- SmsTemplateLocale2["El"] = "el";
103233
- SmsTemplateLocale2["En"] = "en";
103234
- SmsTemplateLocale2["Enau"] = "en-au";
103235
- SmsTemplateLocale2["Enbz"] = "en-bz";
103236
- SmsTemplateLocale2["Enca"] = "en-ca";
103237
- SmsTemplateLocale2["Engb"] = "en-gb";
103238
- SmsTemplateLocale2["Enie"] = "en-ie";
103239
- SmsTemplateLocale2["Enjm"] = "en-jm";
103240
- SmsTemplateLocale2["Ennz"] = "en-nz";
103241
- SmsTemplateLocale2["Entt"] = "en-tt";
103242
- SmsTemplateLocale2["Enus"] = "en-us";
103243
- SmsTemplateLocale2["Enza"] = "en-za";
103244
- SmsTemplateLocale2["Eo"] = "eo";
103245
- SmsTemplateLocale2["Es"] = "es";
103246
- SmsTemplateLocale2["Esar"] = "es-ar";
103247
- SmsTemplateLocale2["Esbo"] = "es-bo";
103248
- SmsTemplateLocale2["Escl"] = "es-cl";
103249
- SmsTemplateLocale2["Esco"] = "es-co";
103250
- SmsTemplateLocale2["Escr"] = "es-cr";
103251
- SmsTemplateLocale2["Esdo"] = "es-do";
103252
- SmsTemplateLocale2["Esec"] = "es-ec";
103253
- SmsTemplateLocale2["Esgt"] = "es-gt";
103254
- SmsTemplateLocale2["Eshn"] = "es-hn";
103255
- SmsTemplateLocale2["Esmx"] = "es-mx";
103256
- SmsTemplateLocale2["Esni"] = "es-ni";
103257
- SmsTemplateLocale2["Espa"] = "es-pa";
103258
- SmsTemplateLocale2["Espe"] = "es-pe";
103259
- SmsTemplateLocale2["Espr"] = "es-pr";
103260
- SmsTemplateLocale2["Espy"] = "es-py";
103261
- SmsTemplateLocale2["Essv"] = "es-sv";
103262
- SmsTemplateLocale2["Esuy"] = "es-uy";
103263
- SmsTemplateLocale2["Esve"] = "es-ve";
103264
- SmsTemplateLocale2["Et"] = "et";
103265
- SmsTemplateLocale2["Eu"] = "eu";
103266
- SmsTemplateLocale2["Fa"] = "fa";
103267
- SmsTemplateLocale2["Fi"] = "fi";
103268
- SmsTemplateLocale2["Fo"] = "fo";
103269
- SmsTemplateLocale2["Fr"] = "fr";
103270
- SmsTemplateLocale2["Frbe"] = "fr-be";
103271
- SmsTemplateLocale2["Frca"] = "fr-ca";
103272
- SmsTemplateLocale2["Frch"] = "fr-ch";
103273
- SmsTemplateLocale2["Frlu"] = "fr-lu";
103274
- SmsTemplateLocale2["Ga"] = "ga";
103275
- SmsTemplateLocale2["Gd"] = "gd";
103276
- SmsTemplateLocale2["He"] = "he";
103277
- SmsTemplateLocale2["Hi"] = "hi";
103278
- SmsTemplateLocale2["Hr"] = "hr";
103279
- SmsTemplateLocale2["Hu"] = "hu";
103280
- SmsTemplateLocale2["Id"] = "id";
103281
- SmsTemplateLocale2["Is"] = "is";
103282
- SmsTemplateLocale2["It"] = "it";
103283
- SmsTemplateLocale2["Itch"] = "it-ch";
103284
- SmsTemplateLocale2["Ja"] = "ja";
103285
- SmsTemplateLocale2["Ji"] = "ji";
103286
- SmsTemplateLocale2["Ko"] = "ko";
103287
- SmsTemplateLocale2["Ku"] = "ku";
103288
- SmsTemplateLocale2["Lt"] = "lt";
103289
- SmsTemplateLocale2["Lv"] = "lv";
103290
- SmsTemplateLocale2["Mk"] = "mk";
103291
- SmsTemplateLocale2["Ml"] = "ml";
103292
- SmsTemplateLocale2["Ms"] = "ms";
103293
- SmsTemplateLocale2["Mt"] = "mt";
103294
- SmsTemplateLocale2["Nb"] = "nb";
103295
- SmsTemplateLocale2["Ne"] = "ne";
103296
- SmsTemplateLocale2["Nl"] = "nl";
103297
- SmsTemplateLocale2["Nlbe"] = "nl-be";
103298
- SmsTemplateLocale2["Nn"] = "nn";
103299
- SmsTemplateLocale2["No"] = "no";
103300
- SmsTemplateLocale2["Pa"] = "pa";
103301
- SmsTemplateLocale2["Pl"] = "pl";
103302
- SmsTemplateLocale2["Pt"] = "pt";
103303
- SmsTemplateLocale2["Ptbr"] = "pt-br";
103304
- SmsTemplateLocale2["Rm"] = "rm";
103305
- SmsTemplateLocale2["Ro"] = "ro";
103306
- SmsTemplateLocale2["Romd"] = "ro-md";
103307
- SmsTemplateLocale2["Ru"] = "ru";
103308
- SmsTemplateLocale2["Rumd"] = "ru-md";
103309
- SmsTemplateLocale2["Sb"] = "sb";
103310
- SmsTemplateLocale2["Sk"] = "sk";
103311
- SmsTemplateLocale2["Sl"] = "sl";
103312
- SmsTemplateLocale2["Sq"] = "sq";
103313
- SmsTemplateLocale2["Sr"] = "sr";
103314
- SmsTemplateLocale2["Sv"] = "sv";
103315
- SmsTemplateLocale2["Svfi"] = "sv-fi";
103316
- SmsTemplateLocale2["Th"] = "th";
103317
- SmsTemplateLocale2["Tn"] = "tn";
103318
- SmsTemplateLocale2["Tr"] = "tr";
103319
- SmsTemplateLocale2["Ts"] = "ts";
103320
- SmsTemplateLocale2["Ua"] = "ua";
103321
- SmsTemplateLocale2["Ur"] = "ur";
103322
- SmsTemplateLocale2["Ve"] = "ve";
103323
- SmsTemplateLocale2["Vi"] = "vi";
103324
- SmsTemplateLocale2["Xh"] = "xh";
103325
- SmsTemplateLocale2["Zhcn"] = "zh-cn";
103326
- SmsTemplateLocale2["Zhhk"] = "zh-hk";
103327
- SmsTemplateLocale2["Zhsg"] = "zh-sg";
103328
- SmsTemplateLocale2["Zhtw"] = "zh-tw";
103329
- SmsTemplateLocale2["Zu"] = "zu";
103330
- })(SmsTemplateLocale || (SmsTemplateLocale = {}));
102681
+ var ProjectUsageRange;
102682
+ (function(ProjectUsageRange2) {
102683
+ ProjectUsageRange2["OneHour"] = "1h";
102684
+ ProjectUsageRange2["OneDay"] = "1d";
102685
+ })(ProjectUsageRange || (ProjectUsageRange = {}));
102686
+ var Region;
102687
+ (function(Region2) {
102688
+ Region2["Fra"] = "fra";
102689
+ Region2["Nyc"] = "nyc";
102690
+ Region2["Syd"] = "syd";
102691
+ Region2["Sfo"] = "sfo";
102692
+ Region2["Sgp"] = "sgp";
102693
+ Region2["Tor"] = "tor";
102694
+ })(Region || (Region = {}));
102695
+ var AuthMethod;
102696
+ (function(AuthMethod3) {
102697
+ AuthMethod3["Emailpassword"] = "email-password";
102698
+ AuthMethod3["Magicurl"] = "magic-url";
102699
+ AuthMethod3["Emailotp"] = "email-otp";
102700
+ AuthMethod3["Anonymous"] = "anonymous";
102701
+ AuthMethod3["Invites"] = "invites";
102702
+ AuthMethod3["Jwt"] = "jwt";
102703
+ AuthMethod3["Phone"] = "phone";
102704
+ })(AuthMethod || (AuthMethod = {}));
102705
+ var ResourceType;
102706
+ (function(ResourceType2) {
102707
+ ResourceType2["Function"] = "function";
102708
+ ResourceType2["Execution"] = "execution";
102709
+ ResourceType2["Message"] = "message";
102710
+ ResourceType2["Backup"] = "backup";
102711
+ })(ResourceType || (ResourceType = {}));
102712
+ var Status;
102713
+ (function(Status2) {
102714
+ Status2["Active"] = "active";
102715
+ })(Status || (Status = {}));
103331
102716
  var StatusCode;
103332
102717
  (function(StatusCode2) {
103333
102718
  StatusCode2["MovedPermanently301"] = "301";
@@ -103522,6 +102907,19 @@ var VCSDetectionType;
103522
102907
  VCSDetectionType2["Runtime"] = "runtime";
103523
102908
  VCSDetectionType2["Framework"] = "framework";
103524
102909
  })(VCSDetectionType || (VCSDetectionType = {}));
102910
+ var Model;
102911
+ (function(Model2) {
102912
+ Model2["Embeddinggemma"] = "embeddinggemma";
102913
+ })(Model || (Model = {}));
102914
+ var VectorsDBIndexType;
102915
+ (function(VectorsDBIndexType2) {
102916
+ VectorsDBIndexType2["HnswEuclidean"] = "hnsw_euclidean";
102917
+ VectorsDBIndexType2["HnswDot"] = "hnsw_dot";
102918
+ VectorsDBIndexType2["HnswCosine"] = "hnsw_cosine";
102919
+ VectorsDBIndexType2["Object"] = "object";
102920
+ VectorsDBIndexType2["Key"] = "key";
102921
+ VectorsDBIndexType2["Unique"] = "unique";
102922
+ })(VectorsDBIndexType || (VectorsDBIndexType = {}));
103525
102923
  var DatabaseType;
103526
102924
  (function(DatabaseType2) {
103527
102925
  DatabaseType2["Legacy"] = "legacy";
@@ -103553,6 +102951,14 @@ var IndexStatus;
103553
102951
  IndexStatus2["Stuck"] = "stuck";
103554
102952
  IndexStatus2["Failed"] = "failed";
103555
102953
  })(IndexStatus || (IndexStatus = {}));
102954
+ var DetectionFrameworkType;
102955
+ (function(DetectionFrameworkType2) {
102956
+ DetectionFrameworkType2["Framework"] = "framework";
102957
+ })(DetectionFrameworkType || (DetectionFrameworkType = {}));
102958
+ var DetectionRuntimeType;
102959
+ (function(DetectionRuntimeType2) {
102960
+ DetectionRuntimeType2["Runtime"] = "runtime";
102961
+ })(DetectionRuntimeType || (DetectionRuntimeType = {}));
103556
102962
  var DeploymentStatus;
103557
102963
  (function(DeploymentStatus2) {
103558
102964
  DeploymentStatus2["Waiting"] = "waiting";
@@ -103650,7 +103056,7 @@ var package_default = {
103650
103056
  type: "module",
103651
103057
  homepage: "https://appwrite.io/support",
103652
103058
  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",
103653
- version: "18.2.0",
103059
+ version: "19.1.0",
103654
103060
  license: "BSD-3-Clause",
103655
103061
  main: "dist/index.cjs",
103656
103062
  module: "dist/index.js",
@@ -103698,7 +103104,7 @@ var package_default = {
103698
103104
  "windows-arm64": "esbuild cli.ts --bundle --loader:.hbs=text --platform=node --target=node18 --format=esm --external:fsevents --external:terminal-image --outfile=dist/bundle-win-arm64.mjs && pkg dist/bundle-win-arm64.mjs -t node18-win-arm64 -o build/appwrite-cli-win-arm64.exe"
103699
103105
  },
103700
103106
  dependencies: {
103701
- "@appwrite.io/console": "~9.1.0",
103107
+ "@appwrite.io/console": "11.0.0",
103702
103108
  chalk: "4.1.2",
103703
103109
  chokidar: "^3.6.0",
103704
103110
  "cli-progress": "^3.12.0",
@@ -103719,7 +103125,9 @@ var package_default = {
103719
103125
  zod: "^4.3.5"
103720
103126
  },
103721
103127
  overrides: {
103722
- phin: "3.7.1"
103128
+ phin: "3.7.1",
103129
+ "@xmldom/xmldom": "^0.9.10",
103130
+ tmp: "0.2.5"
103723
103131
  },
103724
103132
  devDependencies: {
103725
103133
  "@typescript-eslint/eslint-plugin": "^8.0.0",
@@ -103893,6 +103301,19 @@ var InvoiceSummarySchema = createSummarySchema(
103893
103301
  ["plan", "status", "dueAt"],
103894
103302
  "Expected an invoice summary row"
103895
103303
  );
103304
+ var RuntimeSummarySchema = createSummarySchema(
103305
+ {
103306
+ $id: external_exports.string().nullable().optional(),
103307
+ key: external_exports.string().nullable().optional(),
103308
+ name: external_exports.string().nullable().optional(),
103309
+ version: external_exports.union([external_exports.string(), external_exports.number()]).nullable().optional(),
103310
+ base: external_exports.string().nullable().optional(),
103311
+ image: external_exports.string().nullable().optional(),
103312
+ logo: external_exports.string().nullable().optional()
103313
+ },
103314
+ ["$id", "name", "version", "base", "image"],
103315
+ "Expected a runtime summary row"
103316
+ );
103896
103317
  var paymentMethodLabel = (row) => {
103897
103318
  const brand = valueFrom(row, "brand") ?? "";
103898
103319
  const last4 = valueFrom(row, "last4") ?? "";
@@ -103928,7 +103349,35 @@ var paymentMethodStatus = (row) => {
103928
103349
  }
103929
103350
  return "status: pending";
103930
103351
  };
103352
+ var runtimeLabel = (row) => {
103353
+ const name = compactText(valueFrom(row, "name"), "");
103354
+ const key = compactText(valueFrom(row, "key"), "");
103355
+ const version2 = valueFrom(row, "version");
103356
+ const runtimeName = name || (key ? toTitleCase(key) : "Runtime");
103357
+ if (version2 == null || String(version2).trim() === "") {
103358
+ return runtimeName;
103359
+ }
103360
+ return `${runtimeName} ${version2}`;
103361
+ };
103931
103362
  var structuredCollectionRenderers = {
103363
+ runtimes: createColumnRenderer(RuntimeSummarySchema, [
103364
+ {
103365
+ header: "runtime",
103366
+ value: (row, context) => indexedLabel(runtimeLabel(row), context)
103367
+ },
103368
+ {
103369
+ header: "id",
103370
+ value: (row) => compactText(valueFrom(row, "$id"))
103371
+ },
103372
+ {
103373
+ header: "base",
103374
+ value: (row) => compactText(valueFrom(row, "base"))
103375
+ },
103376
+ {
103377
+ header: "image",
103378
+ value: (row) => compactText(valueFrom(row, "image"))
103379
+ }
103380
+ ]),
103932
103381
  identities: createColumnRenderer(IdentitySummarySchema, [
103933
103382
  {
103934
103383
  header: "identity",
@@ -104446,6 +103895,15 @@ var drawTable = (data, options = {}) => {
104446
103895
  var drawJSON = (data) => {
104447
103896
  console.log(JSON.stringify(data, null, 2));
104448
103897
  };
103898
+ var isQueryError = (message) => /Invalid query(?: method)?/i.test(message) || /query[^.:\n]*syntax error|syntax error[^.:\n]*query/i.test(message);
103899
+ var printQueryErrorHint = (err) => {
103900
+ if (!isQueryError(err.message)) {
103901
+ return;
103902
+ }
103903
+ hint(
103904
+ `For common list filters, use flags like --limit 25, --sort-desc '$createdAt', or --where 'status=active'. Raw --queries values must be Appwrite JSON query strings, for example: ${EXECUTABLE_NAME} tables-db list-rows --queries '{"method":"limit","values":[25]}'`
103905
+ );
103906
+ };
104449
103907
  var parseError = (err) => {
104450
103908
  if (cliConfig.report) {
104451
103909
  void (async () => {
@@ -104494,6 +103952,7 @@ ${stack}`
104494
103952
  ${githubIssueUrl.href}
104495
103953
  `
104496
103954
  );
103955
+ printQueryErrorHint(err);
104497
103956
  error48("\n Stack Trace: \n");
104498
103957
  console.error(err);
104499
103958
  process.exit(1);
@@ -104501,9 +103960,11 @@ ${stack}`
104501
103960
  } else {
104502
103961
  if (cliConfig.verbose) {
104503
103962
  console.error(err);
103963
+ printQueryErrorHint(err);
104504
103964
  } else {
104505
103965
  log("For detailed error pass the --verbose or --report flag");
104506
103966
  error48(err.message);
103967
+ printQueryErrorHint(err);
104507
103968
  }
104508
103969
  process.exit(1);
104509
103970
  }
@@ -106855,6 +106316,37 @@ function getDeploymentProgressText(status, waitingSince) {
106855
106316
  function getDeploymentTimeoutErrorMessage() {
106856
106317
  return `Deployment got stuck for more than ${DEPLOYMENT_TIMEOUT_MINUTES} minutes`;
106857
106318
  }
106319
+ function getDeploymentProgressSignature(deployment) {
106320
+ const status = typeof deployment["status"] === "string" ? deployment["status"] : "";
106321
+ const buildLogs = typeof deployment["buildLogs"] === "string" ? deployment["buildLogs"] : "";
106322
+ const updatedAt = typeof deployment["$updatedAt"] === "string" ? deployment["$updatedAt"] : "";
106323
+ const { screenshotLight, screenshotDark } = getSiteDeploymentScreenshots(deployment);
106324
+ return JSON.stringify({
106325
+ status,
106326
+ updatedAt,
106327
+ buildLogsLength: buildLogs.length,
106328
+ buildLogsTail: buildLogs.slice(-200),
106329
+ screenshotLight: screenshotLight ?? "",
106330
+ screenshotDark: screenshotDark ?? ""
106331
+ });
106332
+ }
106333
+ function createDeploymentTimeoutTracker(deployment) {
106334
+ let lastActivityAt = Date.now();
106335
+ let lastSignature = null;
106336
+ const touch = (nextDeployment) => {
106337
+ const nextSignature = getDeploymentProgressSignature(nextDeployment);
106338
+ if (nextSignature === lastSignature) {
106339
+ return;
106340
+ }
106341
+ lastSignature = nextSignature;
106342
+ lastActivityAt = Date.now();
106343
+ };
106344
+ touch(deployment);
106345
+ return {
106346
+ touch,
106347
+ hasTimedOut: () => Date.now() - lastActivityAt > DEPLOYMENT_TIMEOUT_MS
106348
+ };
106349
+ }
106858
106350
  async function getTerminalImage() {
106859
106351
  terminalImageModulePromise ??= import("terminal-image").then(
106860
106352
  (module) => module.default
@@ -107373,7 +106865,7 @@ var Push = class {
107373
106865
  if (settings.services) {
107374
106866
  this.log("Applying service statuses ...");
107375
106867
  for (const [service, status] of Object.entries(settings.services)) {
107376
- await projectService.updateServiceStatus({
106868
+ await projectService.updateService({
107377
106869
  serviceId: service,
107378
106870
  enabled: status
107379
106871
  });
@@ -107382,7 +106874,7 @@ var Push = class {
107382
106874
  if (settings.protocols) {
107383
106875
  this.log("Applying protocol statuses ...");
107384
106876
  for (const [protocol, status] of Object.entries(settings.protocols)) {
107385
- await projectService.updateProtocolStatus({
106877
+ await projectService.updateProtocol({
107386
106878
  protocolId: protocol,
107387
106879
  enabled: status
107388
106880
  });
@@ -107391,33 +106883,26 @@ var Push = class {
107391
106883
  if (settings.auth) {
107392
106884
  if (settings.auth.security) {
107393
106885
  this.log("Applying auth security settings ...");
107394
- await projectsService.updateAuthDuration({
107395
- projectId,
106886
+ await projectService.updateSessionDurationPolicy({
107396
106887
  duration: Number(settings.auth.security.duration)
107397
106888
  });
107398
- await projectsService.updateAuthLimit({
107399
- projectId,
107400
- limit: Number(settings.auth.security.limit)
106889
+ await projectService.updateUserLimitPolicy({
106890
+ total: Number(settings.auth.security.limit)
107401
106891
  });
107402
- await projectsService.updateAuthSessionsLimit({
107403
- projectId,
107404
- limit: Number(settings.auth.security.sessionsLimit)
106892
+ await projectService.updateSessionLimitPolicy({
106893
+ total: Number(settings.auth.security.sessionsLimit)
107405
106894
  });
107406
- await projectsService.updateAuthPasswordDictionary({
107407
- projectId,
106895
+ await projectService.updatePasswordDictionaryPolicy({
107408
106896
  enabled: settings.auth.security.passwordDictionary
107409
106897
  });
107410
- await projectsService.updateAuthPasswordHistory({
107411
- projectId,
107412
- limit: Number(settings.auth.security.passwordHistory)
106898
+ await projectService.updatePasswordHistoryPolicy({
106899
+ total: Number(settings.auth.security.passwordHistory)
107413
106900
  });
107414
- await projectsService.updatePersonalDataCheck({
107415
- projectId,
106901
+ await projectService.updatePasswordPersonalDataPolicy({
107416
106902
  enabled: settings.auth.security.personalDataCheck
107417
106903
  });
107418
- await projectsService.updateSessionAlerts({
107419
- projectId,
107420
- alerts: settings.auth.security.sessionAlerts
106904
+ await projectService.updateSessionAlertPolicy({
106905
+ enabled: settings.auth.security.sessionAlerts
107421
106906
  });
107422
106907
  await projectsService.updateMockNumbers({
107423
106908
  projectId,
@@ -107870,6 +107355,7 @@ var Push = class {
107870
107355
  deploymentId
107871
107356
  );
107872
107357
  let waitingSince = null;
107358
+ const deploymentTimeoutTracker = createDeploymentTimeoutTracker(response);
107873
107359
  const deploymentLogPrinter = createDeploymentLogPrinter({
107874
107360
  label: `function:${func.name}`,
107875
107361
  showPrefix: functions.length > 1,
@@ -107880,6 +107366,7 @@ var Push = class {
107880
107366
  endpoint: localConfig.getEndpoint() || globalConfig2.getEndpoint(),
107881
107367
  event: `functions.${func["$id"]}.deployments.${deploymentId}.update`,
107882
107368
  onDeploymentUpdate: (deployment) => {
107369
+ deploymentTimeoutTracker.touch(deployment);
107883
107370
  deploymentLogPrinter.ingest(deployment);
107884
107371
  },
107885
107372
  onClose: () => {
@@ -107909,9 +107396,8 @@ var Push = class {
107909
107396
  deploymentLogsController
107910
107397
  )
107911
107398
  });
107912
- let timeoutDeadline = Date.now() + DEPLOYMENT_TIMEOUT_MS;
107913
107399
  while (true) {
107914
- if (Date.now() > timeoutDeadline) {
107400
+ if (deploymentTimeoutTracker.hasTimedOut()) {
107915
107401
  deploymentLogPrinter.complete();
107916
107402
  failedDeployments.push({
107917
107403
  name: func["name"],
@@ -107935,6 +107421,7 @@ var Push = class {
107935
107421
  functionId: func["$id"],
107936
107422
  deploymentId
107937
107423
  });
107424
+ deploymentTimeoutTracker.touch(response);
107938
107425
  deploymentLogPrinter.ingest(response);
107939
107426
  const status = response["status"];
107940
107427
  if (status === "waiting") {
@@ -108104,7 +107591,6 @@ var Push = class {
108104
107591
  siteId: site["$id"],
108105
107592
  name: site.name,
108106
107593
  framework: site.framework,
108107
- enabled: site.enabled,
108108
107594
  logging: site.logging,
108109
107595
  timeout: site.timeout,
108110
107596
  installCommand: site.installCommand,
@@ -108135,7 +107621,6 @@ var Push = class {
108135
107621
  siteId: site.$id,
108136
107622
  name: site.name,
108137
107623
  framework: site.framework,
108138
- enabled: site.enabled,
108139
107624
  logging: site.logging,
108140
107625
  timeout: site.timeout,
108141
107626
  installCommand: site.installCommand,
@@ -108298,6 +107783,7 @@ var Push = class {
108298
107783
  let waitingSince = null;
108299
107784
  let readyWithoutScreenshotsSince = null;
108300
107785
  let activationApplied = false;
107786
+ const deploymentTimeoutTracker = createDeploymentTimeoutTracker(response);
108301
107787
  const deploymentLogPrinter = createDeploymentLogPrinter({
108302
107788
  label: `site:${site.name}`,
108303
107789
  showPrefix: sites.length > 1,
@@ -108308,6 +107794,7 @@ var Push = class {
108308
107794
  endpoint: localConfig.getEndpoint() || globalConfig2.getEndpoint(),
108309
107795
  event: `sites.${site["$id"]}.deployments.${deploymentId}.update`,
108310
107796
  onDeploymentUpdate: (deployment) => {
107797
+ deploymentTimeoutTracker.touch(deployment);
108311
107798
  deploymentLogPrinter.ingest(deployment);
108312
107799
  },
108313
107800
  onClose: () => {
@@ -108337,9 +107824,8 @@ var Push = class {
108337
107824
  deploymentLogsController
108338
107825
  )
108339
107826
  });
108340
- let timeoutDeadline = Date.now() + DEPLOYMENT_TIMEOUT_MS;
108341
107827
  while (true) {
108342
- if (Date.now() > timeoutDeadline) {
107828
+ if (deploymentTimeoutTracker.hasTimedOut()) {
108343
107829
  deploymentLogPrinter.complete();
108344
107830
  failedDeployments.push({
108345
107831
  name: site["name"],
@@ -108363,6 +107849,7 @@ var Push = class {
108363
107849
  siteId: site["$id"],
108364
107850
  deploymentId
108365
107851
  });
107852
+ deploymentTimeoutTracker.touch(response);
108366
107853
  deploymentLogPrinter.ingest(response);
108367
107854
  const status = response["status"];
108368
107855
  if (status === "waiting") {
@@ -108393,10 +107880,6 @@ var Push = class {
108393
107880
  }
108394
107881
  if (!screenshotsReady) {
108395
107882
  readyWithoutScreenshotsSince ??= Date.now();
108396
- timeoutDeadline = Math.max(
108397
- timeoutDeadline,
108398
- readyWithoutScreenshotsSince + SITE_SCREENSHOT_FINALIZATION_TIMEOUT_MS
108399
- );
108400
107883
  if (Date.now() - readyWithoutScreenshotsSince < SITE_SCREENSHOT_FINALIZATION_TIMEOUT_MS) {
108401
107884
  currentDeploymentEnd = "Finalizing deployment preview...";
108402
107885
  updaterRow.update({
@@ -109983,7 +109466,6 @@ var Pull = class {
109983
109466
  name: site.name,
109984
109467
  path: sitePath,
109985
109468
  framework: site.framework,
109986
- enabled: site.enabled,
109987
109469
  logging: site.logging,
109988
109470
  timeout: site.timeout,
109989
109471
  buildRuntime: site.buildRuntime,