appwrite-cli 18.1.0 → 19.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
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.1.0";
64991
+ var SDK_VERSION = "19.0.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";
@@ -65007,6 +65009,7 @@ var CONFIG_RESOURCE_KEYS = [
65007
65009
  "tablesDB",
65008
65010
  "tables",
65009
65011
  "teams",
65012
+ "webhooks",
65010
65013
  "collections"
65011
65014
  ];
65012
65015
  var TOP_LEVEL_RESOURCE_ARRAY_KEYS = new Set(
@@ -78991,7 +78994,6 @@ var SiteSchema = external_exports.object({
78991
78994
  path: external_exports.string().optional(),
78992
78995
  $id: external_exports.string(),
78993
78996
  name: external_exports.string(),
78994
- enabled: external_exports.boolean().optional(),
78995
78997
  logging: external_exports.boolean().optional(),
78996
78998
  timeout: external_exports.union([external_exports.number(), external_exports.bigint()]).optional(),
78997
78999
  framework: external_exports.string().optional(),
@@ -79265,7 +79267,6 @@ var siteRequiresBuildCommand = (site) => {
79265
79267
  return !(site.framework === "other" && site.adapter === "static");
79266
79268
  };
79267
79269
  var WINDOWS_EXECUTABLE_NAME = `${EXECUTABLE_NAME.toLowerCase()}.exe`;
79268
- var HOMEBREW_FORMULA_NAME = EXECUTABLE_NAME.toLowerCase();
79269
79270
  var isCloudHostname = (hostname3) => hostname3 === "cloud.appwrite.io" || hostname3.endsWith(".cloud.appwrite.io");
79270
79271
  var getConsoleBaseUrl = (endpoint) => {
79271
79272
  try {
@@ -79434,6 +79435,7 @@ function pruneDeprecatedSiteFields(data) {
79434
79435
  sanitized.sites = sanitized.sites.map((site) => {
79435
79436
  if (site && typeof site === "object") {
79436
79437
  const {
79438
+ enabled: _enabled,
79437
79439
  vars: _vars,
79438
79440
  ignore: _ignore,
79439
79441
  ...rest
@@ -79607,13 +79609,16 @@ var Local = class _Local extends Config {
79607
79609
  if (!this.has("sites")) {
79608
79610
  return [];
79609
79611
  }
79610
- 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
+ });
79611
79616
  }
79612
79617
  getSite($id) {
79613
79618
  if (!this.has("sites")) {
79614
79619
  return {};
79615
79620
  }
79616
- const sites = this.get("sites") ?? [];
79621
+ const sites = this.getSites();
79617
79622
  for (let i = 0; i < sites.length; i++) {
79618
79623
  if (sites[i]["$id"] == $id) {
79619
79624
  return sites[i];
@@ -83672,6 +83677,41 @@ function __classPrivateFieldGet(receiver, state, kind, f2) {
83672
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");
83673
83678
  return kind === "m" ? f2 : kind === "a" ? f2.call(receiver) : f2 ? f2.value : state.get(receiver);
83674
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
+ };
83675
83715
  var JSONbig$1 = (0, import_json_bigint2.default)({ useNativeBigInt: true });
83676
83716
  var Query = class {
83677
83717
  /**
@@ -83827,8 +83867,8 @@ var Client = class _Client {
83827
83867
  "x-sdk-name": "Console",
83828
83868
  "x-sdk-platform": "console",
83829
83869
  "x-sdk-language": "web",
83830
- "x-sdk-version": "9.1.0",
83831
- "X-Appwrite-Response-Format": "1.9.1"
83870
+ "x-sdk-version": "11.0.0",
83871
+ "X-Appwrite-Response-Format": "1.9.2"
83832
83872
  };
83833
83873
  this.realtime = {
83834
83874
  socket: void 0,
@@ -83836,11 +83876,8 @@ var Client = class _Client {
83836
83876
  heartbeat: void 0,
83837
83877
  url: "",
83838
83878
  channels: /* @__PURE__ */ new Set(),
83839
- queries: /* @__PURE__ */ new Set(),
83840
83879
  subscriptions: /* @__PURE__ */ new Map(),
83841
- slotToSubscriptionId: /* @__PURE__ */ new Map(),
83842
- subscriptionIdToSlot: /* @__PURE__ */ new Map(),
83843
- subscriptionsCounter: 0,
83880
+ pendingSubscribes: /* @__PURE__ */ new Map(),
83844
83881
  reconnect: true,
83845
83882
  reconnectAttempts: 0,
83846
83883
  lastMessage: void 0,
@@ -83874,26 +83911,14 @@ var Client = class _Client {
83874
83911
  }, 2e4);
83875
83912
  },
83876
83913
  createSocket: () => {
83877
- var _a3, _b, _c, _d;
83914
+ var _a3, _b, _c, _d, _e2;
83878
83915
  if (this.realtime.subscriptions.size < 1) {
83879
83916
  this.realtime.reconnect = false;
83880
83917
  (_a3 = this.realtime.socket) === null || _a3 === void 0 ? void 0 : _a3.close();
83881
83918
  return;
83882
83919
  }
83883
83920
  const encodedProject = encodeURIComponent((_b = this.config.project) !== null && _b !== void 0 ? _b : "");
83884
- let queryParams = "project=" + encodedProject;
83885
- this.realtime.channels.forEach((channel) => {
83886
- queryParams += "&channels[]=" + encodeURIComponent(channel);
83887
- });
83888
- const selectAllQuery = Query.select(["*"]).toString();
83889
- this.realtime.subscriptions.forEach((sub, slot) => {
83890
- const queries = sub.queries.length > 0 ? sub.queries : [selectAllQuery];
83891
- sub.channels.forEach((channel) => {
83892
- queries.forEach((query) => {
83893
- queryParams += "&" + encodeURIComponent(channel) + "[" + slot + "][]=" + encodeURIComponent(query);
83894
- });
83895
- });
83896
- });
83921
+ const queryParams = "project=" + encodedProject;
83897
83922
  const url2 = this.config.endpointRealtime + "/realtime?" + queryParams;
83898
83923
  if (url2 !== this.realtime.url || // Check if URL is present
83899
83924
  !this.realtime.socket || // Check if WebSocket has not been created
@@ -83923,8 +83948,24 @@ var Client = class _Client {
83923
83948
  this.realtime.createSocket();
83924
83949
  }, timeout);
83925
83950
  });
83951
+ } else if (((_e2 = this.realtime.socket) === null || _e2 === void 0 ? void 0 : _e2.readyState) === WebSocket.OPEN) {
83952
+ this.realtime.sendPendingSubscribes();
83926
83953
  }
83927
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
+ },
83928
83969
  onMessage: (event) => {
83929
83970
  var _a3, _b;
83930
83971
  try {
@@ -83933,17 +83974,6 @@ var Client = class _Client {
83933
83974
  switch (message.type) {
83934
83975
  case "connected": {
83935
83976
  const messageData = message.data;
83936
- if (messageData === null || messageData === void 0 ? void 0 : messageData.subscriptions) {
83937
- this.realtime.slotToSubscriptionId.clear();
83938
- this.realtime.subscriptionIdToSlot.clear();
83939
- for (const [slotStr, subscriptionId] of Object.entries(messageData.subscriptions)) {
83940
- const slot = Number(slotStr);
83941
- if (!isNaN(slot) && typeof subscriptionId === "string") {
83942
- this.realtime.slotToSubscriptionId.set(slot, subscriptionId);
83943
- this.realtime.subscriptionIdToSlot.set(subscriptionId, slot);
83944
- }
83945
- }
83946
- }
83947
83977
  let session = this.config.session;
83948
83978
  if (!session) {
83949
83979
  const cookie = JSONbig.parse((_a3 = window.localStorage.getItem("cookieFallback")) !== null && _a3 !== void 0 ? _a3 : "{}");
@@ -83957,8 +83987,19 @@ var Client = class _Client {
83957
83987
  }
83958
83988
  }));
83959
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();
83960
83999
  break;
83961
84000
  }
84001
+ case "response":
84002
+ break;
83962
84003
  case "event": {
83963
84004
  const data = message.data;
83964
84005
  if (!(data === null || data === void 0 ? void 0 : data.channels))
@@ -83966,12 +84007,9 @@ var Client = class _Client {
83966
84007
  const eventSubIds = data.subscriptions;
83967
84008
  if (eventSubIds && eventSubIds.length > 0) {
83968
84009
  for (const subscriptionId of eventSubIds) {
83969
- const slot = this.realtime.subscriptionIdToSlot.get(subscriptionId);
83970
- if (slot !== void 0) {
83971
- const subscription = this.realtime.subscriptions.get(slot);
83972
- if (subscription) {
83973
- setTimeout(() => subscription.callback(data));
83974
- }
84010
+ const subscription = this.realtime.subscriptions.get(subscriptionId);
84011
+ if (subscription) {
84012
+ setTimeout(() => subscription.callback(data));
83975
84013
  }
83976
84014
  }
83977
84015
  } else {
@@ -83997,29 +84035,6 @@ var Client = class _Client {
83997
84035
  } catch (e) {
83998
84036
  console.error(e);
83999
84037
  }
84000
- },
84001
- cleanUp: (channels, queries) => {
84002
- this.realtime.channels.forEach((channel) => {
84003
- if (channels.includes(channel)) {
84004
- let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
84005
- return subscription.channels.includes(channel);
84006
- });
84007
- if (!found) {
84008
- this.realtime.channels.delete(channel);
84009
- }
84010
- }
84011
- });
84012
- this.realtime.queries.forEach((query) => {
84013
- if (queries.includes(query)) {
84014
- let found = Array.from(this.realtime.subscriptions).some(([_key, subscription]) => {
84015
- var _a3;
84016
- return (_a3 = subscription.queries) === null || _a3 === void 0 ? void 0 : _a3.includes(query);
84017
- });
84018
- if (!found) {
84019
- this.realtime.queries.delete(query);
84020
- }
84021
- }
84022
- });
84023
84038
  }
84024
84039
  };
84025
84040
  }
@@ -84266,17 +84281,41 @@ var Client = class _Client {
84266
84281
  });
84267
84282
  channelStrings.forEach((channel) => this.realtime.channels.add(channel));
84268
84283
  const queryStrings = (queries !== null && queries !== void 0 ? queries : []).map((q2) => typeof q2 === "string" ? q2 : q2.toString());
84269
- queryStrings.forEach((query) => this.realtime.queries.add(query));
84270
- const counter = this.realtime.subscriptionsCounter++;
84271
- 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, {
84272
84297
  channels: channelStrings,
84273
84298
  queries: queryStrings,
84274
84299
  callback
84275
84300
  });
84301
+ this.realtime.pendingSubscribes.set(subscriptionId, {
84302
+ subscriptionId,
84303
+ channels: channelStrings,
84304
+ queries: queryStrings
84305
+ });
84276
84306
  this.realtime.connect();
84277
84307
  return () => {
84278
- this.realtime.subscriptions.delete(counter);
84279
- 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
+ });
84280
84319
  this.realtime.connect();
84281
84320
  };
84282
84321
  }
@@ -93940,7 +93979,240 @@ var Project = class {
93940
93979
  };
93941
93980
  return this.client.call("delete", uri, apiHeaders, payload);
93942
93981
  }
93943
- 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) {
93944
94216
  let params;
93945
94217
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("protocolId" in paramsOrFirst || "enabled" in paramsOrFirst)) {
93946
94218
  params = paramsOrFirst || {};
@@ -93958,7 +94230,7 @@ var Project = class {
93958
94230
  if (typeof enabled === "undefined") {
93959
94231
  throw new AppwriteException('Missing required parameter: "enabled"');
93960
94232
  }
93961
- const apiPath = "/project/protocols/{protocolId}/status".replace("{protocolId}", protocolId);
94233
+ const apiPath = "/project/protocols/{protocolId}".replace("{protocolId}", protocolId);
93962
94234
  const payload = {};
93963
94235
  if (typeof enabled !== "undefined") {
93964
94236
  payload["enabled"] = enabled;
@@ -93969,7 +94241,7 @@ var Project = class {
93969
94241
  };
93970
94242
  return this.client.call("patch", uri, apiHeaders, payload);
93971
94243
  }
93972
- updateServiceStatus(paramsOrFirst, ...rest) {
94244
+ updateService(paramsOrFirst, ...rest) {
93973
94245
  let params;
93974
94246
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst) && ("serviceId" in paramsOrFirst || "enabled" in paramsOrFirst)) {
93975
94247
  params = paramsOrFirst || {};
@@ -93987,7 +94259,7 @@ var Project = class {
93987
94259
  if (typeof enabled === "undefined") {
93988
94260
  throw new AppwriteException('Missing required parameter: "enabled"');
93989
94261
  }
93990
- const apiPath = "/project/services/{serviceId}/status".replace("{serviceId}", serviceId);
94262
+ const apiPath = "/project/services/{serviceId}".replace("{serviceId}", serviceId);
93991
94263
  const payload = {};
93992
94264
  if (typeof enabled !== "undefined") {
93993
94265
  payload["enabled"] = enabled;
@@ -93998,6 +94270,179 @@ var Project = class {
93998
94270
  };
93999
94271
  return this.client.call("patch", uri, apiHeaders, payload);
94000
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
+ }
94001
94446
  getUsage(paramsOrFirst, ...rest) {
94002
94447
  let params;
94003
94448
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -94416,138 +94861,6 @@ var Projects = class {
94416
94861
  };
94417
94862
  return this.client.call("delete", uri, apiHeaders, payload);
94418
94863
  }
94419
- updateAuthDuration(paramsOrFirst, ...rest) {
94420
- let params;
94421
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94422
- params = paramsOrFirst || {};
94423
- } else {
94424
- params = {
94425
- projectId: paramsOrFirst,
94426
- duration: rest[0]
94427
- };
94428
- }
94429
- const projectId = params.projectId;
94430
- const duration3 = params.duration;
94431
- if (typeof projectId === "undefined") {
94432
- throw new AppwriteException('Missing required parameter: "projectId"');
94433
- }
94434
- if (typeof duration3 === "undefined") {
94435
- throw new AppwriteException('Missing required parameter: "duration"');
94436
- }
94437
- const apiPath = "/projects/{projectId}/auth/duration".replace("{projectId}", projectId);
94438
- const payload = {};
94439
- if (typeof duration3 !== "undefined") {
94440
- payload["duration"] = duration3;
94441
- }
94442
- const uri = new URL(this.client.config.endpoint + apiPath);
94443
- const apiHeaders = {
94444
- "content-type": "application/json"
94445
- };
94446
- return this.client.call("patch", uri, apiHeaders, payload);
94447
- }
94448
- updateAuthLimit(paramsOrFirst, ...rest) {
94449
- let params;
94450
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94451
- params = paramsOrFirst || {};
94452
- } else {
94453
- params = {
94454
- projectId: paramsOrFirst,
94455
- limit: rest[0]
94456
- };
94457
- }
94458
- const projectId = params.projectId;
94459
- const limit = params.limit;
94460
- if (typeof projectId === "undefined") {
94461
- throw new AppwriteException('Missing required parameter: "projectId"');
94462
- }
94463
- if (typeof limit === "undefined") {
94464
- throw new AppwriteException('Missing required parameter: "limit"');
94465
- }
94466
- const apiPath = "/projects/{projectId}/auth/limit".replace("{projectId}", projectId);
94467
- const payload = {};
94468
- if (typeof limit !== "undefined") {
94469
- payload["limit"] = limit;
94470
- }
94471
- const uri = new URL(this.client.config.endpoint + apiPath);
94472
- const apiHeaders = {
94473
- "content-type": "application/json"
94474
- };
94475
- return this.client.call("patch", uri, apiHeaders, payload);
94476
- }
94477
- updateAuthSessionsLimit(paramsOrFirst, ...rest) {
94478
- let params;
94479
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94480
- params = paramsOrFirst || {};
94481
- } else {
94482
- params = {
94483
- projectId: paramsOrFirst,
94484
- limit: rest[0]
94485
- };
94486
- }
94487
- const projectId = params.projectId;
94488
- const limit = params.limit;
94489
- if (typeof projectId === "undefined") {
94490
- throw new AppwriteException('Missing required parameter: "projectId"');
94491
- }
94492
- if (typeof limit === "undefined") {
94493
- throw new AppwriteException('Missing required parameter: "limit"');
94494
- }
94495
- const apiPath = "/projects/{projectId}/auth/max-sessions".replace("{projectId}", projectId);
94496
- const payload = {};
94497
- if (typeof limit !== "undefined") {
94498
- payload["limit"] = limit;
94499
- }
94500
- const uri = new URL(this.client.config.endpoint + apiPath);
94501
- const apiHeaders = {
94502
- "content-type": "application/json"
94503
- };
94504
- return this.client.call("patch", uri, apiHeaders, payload);
94505
- }
94506
- updateMembershipsPrivacy(paramsOrFirst, ...rest) {
94507
- let params;
94508
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94509
- params = paramsOrFirst || {};
94510
- } else {
94511
- params = {
94512
- projectId: paramsOrFirst,
94513
- userName: rest[0],
94514
- userEmail: rest[1],
94515
- mfa: rest[2]
94516
- };
94517
- }
94518
- const projectId = params.projectId;
94519
- const userName = params.userName;
94520
- const userEmail = params.userEmail;
94521
- const mfa = params.mfa;
94522
- if (typeof projectId === "undefined") {
94523
- throw new AppwriteException('Missing required parameter: "projectId"');
94524
- }
94525
- if (typeof userName === "undefined") {
94526
- throw new AppwriteException('Missing required parameter: "userName"');
94527
- }
94528
- if (typeof userEmail === "undefined") {
94529
- throw new AppwriteException('Missing required parameter: "userEmail"');
94530
- }
94531
- if (typeof mfa === "undefined") {
94532
- throw new AppwriteException('Missing required parameter: "mfa"');
94533
- }
94534
- const apiPath = "/projects/{projectId}/auth/memberships-privacy".replace("{projectId}", projectId);
94535
- const payload = {};
94536
- if (typeof userName !== "undefined") {
94537
- payload["userName"] = userName;
94538
- }
94539
- if (typeof userEmail !== "undefined") {
94540
- payload["userEmail"] = userEmail;
94541
- }
94542
- if (typeof mfa !== "undefined") {
94543
- payload["mfa"] = mfa;
94544
- }
94545
- const uri = new URL(this.client.config.endpoint + apiPath);
94546
- const apiHeaders = {
94547
- "content-type": "application/json"
94548
- };
94549
- return this.client.call("patch", uri, apiHeaders, payload);
94550
- }
94551
94864
  updateMockNumbers(paramsOrFirst, ...rest) {
94552
94865
  let params;
94553
94866
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -94577,151 +94890,6 @@ var Projects = class {
94577
94890
  };
94578
94891
  return this.client.call("patch", uri, apiHeaders, payload);
94579
94892
  }
94580
- updateAuthPasswordDictionary(paramsOrFirst, ...rest) {
94581
- let params;
94582
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94583
- params = paramsOrFirst || {};
94584
- } else {
94585
- params = {
94586
- projectId: paramsOrFirst,
94587
- enabled: rest[0]
94588
- };
94589
- }
94590
- const projectId = params.projectId;
94591
- const enabled = params.enabled;
94592
- if (typeof projectId === "undefined") {
94593
- throw new AppwriteException('Missing required parameter: "projectId"');
94594
- }
94595
- if (typeof enabled === "undefined") {
94596
- throw new AppwriteException('Missing required parameter: "enabled"');
94597
- }
94598
- const apiPath = "/projects/{projectId}/auth/password-dictionary".replace("{projectId}", projectId);
94599
- const payload = {};
94600
- if (typeof enabled !== "undefined") {
94601
- payload["enabled"] = enabled;
94602
- }
94603
- const uri = new URL(this.client.config.endpoint + apiPath);
94604
- const apiHeaders = {
94605
- "content-type": "application/json"
94606
- };
94607
- return this.client.call("patch", uri, apiHeaders, payload);
94608
- }
94609
- updateAuthPasswordHistory(paramsOrFirst, ...rest) {
94610
- let params;
94611
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94612
- params = paramsOrFirst || {};
94613
- } else {
94614
- params = {
94615
- projectId: paramsOrFirst,
94616
- limit: rest[0]
94617
- };
94618
- }
94619
- const projectId = params.projectId;
94620
- const limit = params.limit;
94621
- if (typeof projectId === "undefined") {
94622
- throw new AppwriteException('Missing required parameter: "projectId"');
94623
- }
94624
- if (typeof limit === "undefined") {
94625
- throw new AppwriteException('Missing required parameter: "limit"');
94626
- }
94627
- const apiPath = "/projects/{projectId}/auth/password-history".replace("{projectId}", projectId);
94628
- const payload = {};
94629
- if (typeof limit !== "undefined") {
94630
- payload["limit"] = limit;
94631
- }
94632
- const uri = new URL(this.client.config.endpoint + apiPath);
94633
- const apiHeaders = {
94634
- "content-type": "application/json"
94635
- };
94636
- return this.client.call("patch", uri, apiHeaders, payload);
94637
- }
94638
- updatePersonalDataCheck(paramsOrFirst, ...rest) {
94639
- let params;
94640
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94641
- params = paramsOrFirst || {};
94642
- } else {
94643
- params = {
94644
- projectId: paramsOrFirst,
94645
- enabled: rest[0]
94646
- };
94647
- }
94648
- const projectId = params.projectId;
94649
- const enabled = params.enabled;
94650
- if (typeof projectId === "undefined") {
94651
- throw new AppwriteException('Missing required parameter: "projectId"');
94652
- }
94653
- if (typeof enabled === "undefined") {
94654
- throw new AppwriteException('Missing required parameter: "enabled"');
94655
- }
94656
- const apiPath = "/projects/{projectId}/auth/personal-data".replace("{projectId}", projectId);
94657
- const payload = {};
94658
- if (typeof enabled !== "undefined") {
94659
- payload["enabled"] = enabled;
94660
- }
94661
- const uri = new URL(this.client.config.endpoint + apiPath);
94662
- const apiHeaders = {
94663
- "content-type": "application/json"
94664
- };
94665
- return this.client.call("patch", uri, apiHeaders, payload);
94666
- }
94667
- updateSessionAlerts(paramsOrFirst, ...rest) {
94668
- let params;
94669
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94670
- params = paramsOrFirst || {};
94671
- } else {
94672
- params = {
94673
- projectId: paramsOrFirst,
94674
- alerts: rest[0]
94675
- };
94676
- }
94677
- const projectId = params.projectId;
94678
- const alerts = params.alerts;
94679
- if (typeof projectId === "undefined") {
94680
- throw new AppwriteException('Missing required parameter: "projectId"');
94681
- }
94682
- if (typeof alerts === "undefined") {
94683
- throw new AppwriteException('Missing required parameter: "alerts"');
94684
- }
94685
- const apiPath = "/projects/{projectId}/auth/session-alerts".replace("{projectId}", projectId);
94686
- const payload = {};
94687
- if (typeof alerts !== "undefined") {
94688
- payload["alerts"] = alerts;
94689
- }
94690
- const uri = new URL(this.client.config.endpoint + apiPath);
94691
- const apiHeaders = {
94692
- "content-type": "application/json"
94693
- };
94694
- return this.client.call("patch", uri, apiHeaders, payload);
94695
- }
94696
- updateSessionInvalidation(paramsOrFirst, ...rest) {
94697
- let params;
94698
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
94699
- params = paramsOrFirst || {};
94700
- } else {
94701
- params = {
94702
- projectId: paramsOrFirst,
94703
- enabled: rest[0]
94704
- };
94705
- }
94706
- const projectId = params.projectId;
94707
- const enabled = params.enabled;
94708
- if (typeof projectId === "undefined") {
94709
- throw new AppwriteException('Missing required parameter: "projectId"');
94710
- }
94711
- if (typeof enabled === "undefined") {
94712
- throw new AppwriteException('Missing required parameter: "enabled"');
94713
- }
94714
- const apiPath = "/projects/{projectId}/auth/session-invalidation".replace("{projectId}", projectId);
94715
- const payload = {};
94716
- if (typeof enabled !== "undefined") {
94717
- payload["enabled"] = enabled;
94718
- }
94719
- const uri = new URL(this.client.config.endpoint + apiPath);
94720
- const apiHeaders = {
94721
- "content-type": "application/json"
94722
- };
94723
- return this.client.call("patch", uri, apiHeaders, payload);
94724
- }
94725
94893
  updateAuthStatus(paramsOrFirst, ...rest) {
94726
94894
  let params;
94727
94895
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -95116,300 +95284,6 @@ var Projects = class {
95116
95284
  const apiHeaders = {};
95117
95285
  return this.client.call("get", uri, apiHeaders, payload);
95118
95286
  }
95119
- updateSmtp(paramsOrFirst, ...rest) {
95120
- let params;
95121
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95122
- params = paramsOrFirst || {};
95123
- } else {
95124
- params = {
95125
- projectId: paramsOrFirst,
95126
- enabled: rest[0],
95127
- senderName: rest[1],
95128
- senderEmail: rest[2],
95129
- replyTo: rest[3],
95130
- host: rest[4],
95131
- port: rest[5],
95132
- username: rest[6],
95133
- password: rest[7],
95134
- secure: rest[8]
95135
- };
95136
- }
95137
- const projectId = params.projectId;
95138
- const enabled = params.enabled;
95139
- const senderName = params.senderName;
95140
- const senderEmail = params.senderEmail;
95141
- const replyTo = params.replyTo;
95142
- const host = params.host;
95143
- const port = params.port;
95144
- const username = params.username;
95145
- const password = params.password;
95146
- const secure = params.secure;
95147
- if (typeof projectId === "undefined") {
95148
- throw new AppwriteException('Missing required parameter: "projectId"');
95149
- }
95150
- if (typeof enabled === "undefined") {
95151
- throw new AppwriteException('Missing required parameter: "enabled"');
95152
- }
95153
- const apiPath = "/projects/{projectId}/smtp".replace("{projectId}", projectId);
95154
- const payload = {};
95155
- if (typeof enabled !== "undefined") {
95156
- payload["enabled"] = enabled;
95157
- }
95158
- if (typeof senderName !== "undefined") {
95159
- payload["senderName"] = senderName;
95160
- }
95161
- if (typeof senderEmail !== "undefined") {
95162
- payload["senderEmail"] = senderEmail;
95163
- }
95164
- if (typeof replyTo !== "undefined") {
95165
- payload["replyTo"] = replyTo;
95166
- }
95167
- if (typeof host !== "undefined") {
95168
- payload["host"] = host;
95169
- }
95170
- if (typeof port !== "undefined") {
95171
- payload["port"] = port;
95172
- }
95173
- if (typeof username !== "undefined") {
95174
- payload["username"] = username;
95175
- }
95176
- if (typeof password !== "undefined") {
95177
- payload["password"] = password;
95178
- }
95179
- if (typeof secure !== "undefined") {
95180
- payload["secure"] = secure;
95181
- }
95182
- const uri = new URL(this.client.config.endpoint + apiPath);
95183
- const apiHeaders = {
95184
- "content-type": "application/json"
95185
- };
95186
- return this.client.call("patch", uri, apiHeaders, payload);
95187
- }
95188
- updateSMTP(paramsOrFirst, ...rest) {
95189
- let params;
95190
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95191
- params = paramsOrFirst || {};
95192
- } else {
95193
- params = {
95194
- projectId: paramsOrFirst,
95195
- enabled: rest[0],
95196
- senderName: rest[1],
95197
- senderEmail: rest[2],
95198
- replyTo: rest[3],
95199
- host: rest[4],
95200
- port: rest[5],
95201
- username: rest[6],
95202
- password: rest[7],
95203
- secure: rest[8]
95204
- };
95205
- }
95206
- const projectId = params.projectId;
95207
- const enabled = params.enabled;
95208
- const senderName = params.senderName;
95209
- const senderEmail = params.senderEmail;
95210
- const replyTo = params.replyTo;
95211
- const host = params.host;
95212
- const port = params.port;
95213
- const username = params.username;
95214
- const password = params.password;
95215
- const secure = params.secure;
95216
- if (typeof projectId === "undefined") {
95217
- throw new AppwriteException('Missing required parameter: "projectId"');
95218
- }
95219
- if (typeof enabled === "undefined") {
95220
- throw new AppwriteException('Missing required parameter: "enabled"');
95221
- }
95222
- const apiPath = "/projects/{projectId}/smtp".replace("{projectId}", projectId);
95223
- const payload = {};
95224
- if (typeof enabled !== "undefined") {
95225
- payload["enabled"] = enabled;
95226
- }
95227
- if (typeof senderName !== "undefined") {
95228
- payload["senderName"] = senderName;
95229
- }
95230
- if (typeof senderEmail !== "undefined") {
95231
- payload["senderEmail"] = senderEmail;
95232
- }
95233
- if (typeof replyTo !== "undefined") {
95234
- payload["replyTo"] = replyTo;
95235
- }
95236
- if (typeof host !== "undefined") {
95237
- payload["host"] = host;
95238
- }
95239
- if (typeof port !== "undefined") {
95240
- payload["port"] = port;
95241
- }
95242
- if (typeof username !== "undefined") {
95243
- payload["username"] = username;
95244
- }
95245
- if (typeof password !== "undefined") {
95246
- payload["password"] = password;
95247
- }
95248
- if (typeof secure !== "undefined") {
95249
- payload["secure"] = secure;
95250
- }
95251
- const uri = new URL(this.client.config.endpoint + apiPath);
95252
- const apiHeaders = {
95253
- "content-type": "application/json"
95254
- };
95255
- return this.client.call("patch", uri, apiHeaders, payload);
95256
- }
95257
- createSmtpTest(paramsOrFirst, ...rest) {
95258
- let params;
95259
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95260
- params = paramsOrFirst || {};
95261
- } else {
95262
- params = {
95263
- projectId: paramsOrFirst,
95264
- emails: rest[0],
95265
- senderName: rest[1],
95266
- senderEmail: rest[2],
95267
- host: rest[3],
95268
- replyTo: rest[4],
95269
- port: rest[5],
95270
- username: rest[6],
95271
- password: rest[7],
95272
- secure: rest[8]
95273
- };
95274
- }
95275
- const projectId = params.projectId;
95276
- const emails = params.emails;
95277
- const senderName = params.senderName;
95278
- const senderEmail = params.senderEmail;
95279
- const host = params.host;
95280
- const replyTo = params.replyTo;
95281
- const port = params.port;
95282
- const username = params.username;
95283
- const password = params.password;
95284
- const secure = params.secure;
95285
- if (typeof projectId === "undefined") {
95286
- throw new AppwriteException('Missing required parameter: "projectId"');
95287
- }
95288
- if (typeof emails === "undefined") {
95289
- throw new AppwriteException('Missing required parameter: "emails"');
95290
- }
95291
- if (typeof senderName === "undefined") {
95292
- throw new AppwriteException('Missing required parameter: "senderName"');
95293
- }
95294
- if (typeof senderEmail === "undefined") {
95295
- throw new AppwriteException('Missing required parameter: "senderEmail"');
95296
- }
95297
- if (typeof host === "undefined") {
95298
- throw new AppwriteException('Missing required parameter: "host"');
95299
- }
95300
- const apiPath = "/projects/{projectId}/smtp/tests".replace("{projectId}", projectId);
95301
- const payload = {};
95302
- if (typeof emails !== "undefined") {
95303
- payload["emails"] = emails;
95304
- }
95305
- if (typeof senderName !== "undefined") {
95306
- payload["senderName"] = senderName;
95307
- }
95308
- if (typeof senderEmail !== "undefined") {
95309
- payload["senderEmail"] = senderEmail;
95310
- }
95311
- if (typeof replyTo !== "undefined") {
95312
- payload["replyTo"] = replyTo;
95313
- }
95314
- if (typeof host !== "undefined") {
95315
- payload["host"] = host;
95316
- }
95317
- if (typeof port !== "undefined") {
95318
- payload["port"] = port;
95319
- }
95320
- if (typeof username !== "undefined") {
95321
- payload["username"] = username;
95322
- }
95323
- if (typeof password !== "undefined") {
95324
- payload["password"] = password;
95325
- }
95326
- if (typeof secure !== "undefined") {
95327
- payload["secure"] = secure;
95328
- }
95329
- const uri = new URL(this.client.config.endpoint + apiPath);
95330
- const apiHeaders = {
95331
- "content-type": "application/json"
95332
- };
95333
- return this.client.call("post", uri, apiHeaders, payload);
95334
- }
95335
- createSMTPTest(paramsOrFirst, ...rest) {
95336
- let params;
95337
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95338
- params = paramsOrFirst || {};
95339
- } else {
95340
- params = {
95341
- projectId: paramsOrFirst,
95342
- emails: rest[0],
95343
- senderName: rest[1],
95344
- senderEmail: rest[2],
95345
- host: rest[3],
95346
- replyTo: rest[4],
95347
- port: rest[5],
95348
- username: rest[6],
95349
- password: rest[7],
95350
- secure: rest[8]
95351
- };
95352
- }
95353
- const projectId = params.projectId;
95354
- const emails = params.emails;
95355
- const senderName = params.senderName;
95356
- const senderEmail = params.senderEmail;
95357
- const host = params.host;
95358
- const replyTo = params.replyTo;
95359
- const port = params.port;
95360
- const username = params.username;
95361
- const password = params.password;
95362
- const secure = params.secure;
95363
- if (typeof projectId === "undefined") {
95364
- throw new AppwriteException('Missing required parameter: "projectId"');
95365
- }
95366
- if (typeof emails === "undefined") {
95367
- throw new AppwriteException('Missing required parameter: "emails"');
95368
- }
95369
- if (typeof senderName === "undefined") {
95370
- throw new AppwriteException('Missing required parameter: "senderName"');
95371
- }
95372
- if (typeof senderEmail === "undefined") {
95373
- throw new AppwriteException('Missing required parameter: "senderEmail"');
95374
- }
95375
- if (typeof host === "undefined") {
95376
- throw new AppwriteException('Missing required parameter: "host"');
95377
- }
95378
- const apiPath = "/projects/{projectId}/smtp/tests".replace("{projectId}", projectId);
95379
- const payload = {};
95380
- if (typeof emails !== "undefined") {
95381
- payload["emails"] = emails;
95382
- }
95383
- if (typeof senderName !== "undefined") {
95384
- payload["senderName"] = senderName;
95385
- }
95386
- if (typeof senderEmail !== "undefined") {
95387
- payload["senderEmail"] = senderEmail;
95388
- }
95389
- if (typeof replyTo !== "undefined") {
95390
- payload["replyTo"] = replyTo;
95391
- }
95392
- if (typeof host !== "undefined") {
95393
- payload["host"] = host;
95394
- }
95395
- if (typeof port !== "undefined") {
95396
- payload["port"] = port;
95397
- }
95398
- if (typeof username !== "undefined") {
95399
- payload["username"] = username;
95400
- }
95401
- if (typeof password !== "undefined") {
95402
- payload["password"] = password;
95403
- }
95404
- if (typeof secure !== "undefined") {
95405
- payload["secure"] = secure;
95406
- }
95407
- const uri = new URL(this.client.config.endpoint + apiPath);
95408
- const apiHeaders = {
95409
- "content-type": "application/json"
95410
- };
95411
- return this.client.call("post", uri, apiHeaders, payload);
95412
- }
95413
95287
  updateStatus(paramsOrFirst, ...rest) {
95414
95288
  let params;
95415
95289
  if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
@@ -95468,326 +95342,6 @@ var Projects = class {
95468
95342
  };
95469
95343
  return this.client.call("patch", uri, apiHeaders, payload);
95470
95344
  }
95471
- getEmailTemplate(paramsOrFirst, ...rest) {
95472
- let params;
95473
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95474
- params = paramsOrFirst || {};
95475
- } else {
95476
- params = {
95477
- projectId: paramsOrFirst,
95478
- type: rest[0],
95479
- locale: rest[1]
95480
- };
95481
- }
95482
- const projectId = params.projectId;
95483
- const type = params.type;
95484
- const locale = params.locale;
95485
- if (typeof projectId === "undefined") {
95486
- throw new AppwriteException('Missing required parameter: "projectId"');
95487
- }
95488
- if (typeof type === "undefined") {
95489
- throw new AppwriteException('Missing required parameter: "type"');
95490
- }
95491
- if (typeof locale === "undefined") {
95492
- throw new AppwriteException('Missing required parameter: "locale"');
95493
- }
95494
- const apiPath = "/projects/{projectId}/templates/email/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95495
- const payload = {};
95496
- const uri = new URL(this.client.config.endpoint + apiPath);
95497
- const apiHeaders = {};
95498
- return this.client.call("get", uri, apiHeaders, payload);
95499
- }
95500
- updateEmailTemplate(paramsOrFirst, ...rest) {
95501
- let params;
95502
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95503
- params = paramsOrFirst || {};
95504
- } else {
95505
- params = {
95506
- projectId: paramsOrFirst,
95507
- type: rest[0],
95508
- locale: rest[1],
95509
- subject: rest[2],
95510
- message: rest[3],
95511
- senderName: rest[4],
95512
- senderEmail: rest[5],
95513
- replyTo: rest[6]
95514
- };
95515
- }
95516
- const projectId = params.projectId;
95517
- const type = params.type;
95518
- const locale = params.locale;
95519
- const subject = params.subject;
95520
- const message = params.message;
95521
- const senderName = params.senderName;
95522
- const senderEmail = params.senderEmail;
95523
- const replyTo = params.replyTo;
95524
- if (typeof projectId === "undefined") {
95525
- throw new AppwriteException('Missing required parameter: "projectId"');
95526
- }
95527
- if (typeof type === "undefined") {
95528
- throw new AppwriteException('Missing required parameter: "type"');
95529
- }
95530
- if (typeof locale === "undefined") {
95531
- throw new AppwriteException('Missing required parameter: "locale"');
95532
- }
95533
- if (typeof subject === "undefined") {
95534
- throw new AppwriteException('Missing required parameter: "subject"');
95535
- }
95536
- if (typeof message === "undefined") {
95537
- throw new AppwriteException('Missing required parameter: "message"');
95538
- }
95539
- const apiPath = "/projects/{projectId}/templates/email/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95540
- const payload = {};
95541
- if (typeof subject !== "undefined") {
95542
- payload["subject"] = subject;
95543
- }
95544
- if (typeof message !== "undefined") {
95545
- payload["message"] = message;
95546
- }
95547
- if (typeof senderName !== "undefined") {
95548
- payload["senderName"] = senderName;
95549
- }
95550
- if (typeof senderEmail !== "undefined") {
95551
- payload["senderEmail"] = senderEmail;
95552
- }
95553
- if (typeof replyTo !== "undefined") {
95554
- payload["replyTo"] = replyTo;
95555
- }
95556
- const uri = new URL(this.client.config.endpoint + apiPath);
95557
- const apiHeaders = {
95558
- "content-type": "application/json"
95559
- };
95560
- return this.client.call("patch", uri, apiHeaders, payload);
95561
- }
95562
- deleteEmailTemplate(paramsOrFirst, ...rest) {
95563
- let params;
95564
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95565
- params = paramsOrFirst || {};
95566
- } else {
95567
- params = {
95568
- projectId: paramsOrFirst,
95569
- type: rest[0],
95570
- locale: rest[1]
95571
- };
95572
- }
95573
- const projectId = params.projectId;
95574
- const type = params.type;
95575
- const locale = params.locale;
95576
- if (typeof projectId === "undefined") {
95577
- throw new AppwriteException('Missing required parameter: "projectId"');
95578
- }
95579
- if (typeof type === "undefined") {
95580
- throw new AppwriteException('Missing required parameter: "type"');
95581
- }
95582
- if (typeof locale === "undefined") {
95583
- throw new AppwriteException('Missing required parameter: "locale"');
95584
- }
95585
- const apiPath = "/projects/{projectId}/templates/email/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95586
- const payload = {};
95587
- const uri = new URL(this.client.config.endpoint + apiPath);
95588
- const apiHeaders = {
95589
- "content-type": "application/json"
95590
- };
95591
- return this.client.call("delete", uri, apiHeaders, payload);
95592
- }
95593
- getSmsTemplate(paramsOrFirst, ...rest) {
95594
- let params;
95595
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95596
- params = paramsOrFirst || {};
95597
- } else {
95598
- params = {
95599
- projectId: paramsOrFirst,
95600
- type: rest[0],
95601
- locale: rest[1]
95602
- };
95603
- }
95604
- const projectId = params.projectId;
95605
- const type = params.type;
95606
- const locale = params.locale;
95607
- if (typeof projectId === "undefined") {
95608
- throw new AppwriteException('Missing required parameter: "projectId"');
95609
- }
95610
- if (typeof type === "undefined") {
95611
- throw new AppwriteException('Missing required parameter: "type"');
95612
- }
95613
- if (typeof locale === "undefined") {
95614
- throw new AppwriteException('Missing required parameter: "locale"');
95615
- }
95616
- const apiPath = "/projects/{projectId}/templates/sms/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95617
- const payload = {};
95618
- const uri = new URL(this.client.config.endpoint + apiPath);
95619
- const apiHeaders = {};
95620
- return this.client.call("get", uri, apiHeaders, payload);
95621
- }
95622
- getSMSTemplate(paramsOrFirst, ...rest) {
95623
- let params;
95624
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95625
- params = paramsOrFirst || {};
95626
- } else {
95627
- params = {
95628
- projectId: paramsOrFirst,
95629
- type: rest[0],
95630
- locale: rest[1]
95631
- };
95632
- }
95633
- const projectId = params.projectId;
95634
- const type = params.type;
95635
- const locale = params.locale;
95636
- if (typeof projectId === "undefined") {
95637
- throw new AppwriteException('Missing required parameter: "projectId"');
95638
- }
95639
- if (typeof type === "undefined") {
95640
- throw new AppwriteException('Missing required parameter: "type"');
95641
- }
95642
- if (typeof locale === "undefined") {
95643
- throw new AppwriteException('Missing required parameter: "locale"');
95644
- }
95645
- const apiPath = "/projects/{projectId}/templates/sms/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95646
- const payload = {};
95647
- const uri = new URL(this.client.config.endpoint + apiPath);
95648
- const apiHeaders = {};
95649
- return this.client.call("get", uri, apiHeaders, payload);
95650
- }
95651
- updateSmsTemplate(paramsOrFirst, ...rest) {
95652
- let params;
95653
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95654
- params = paramsOrFirst || {};
95655
- } else {
95656
- params = {
95657
- projectId: paramsOrFirst,
95658
- type: rest[0],
95659
- locale: rest[1],
95660
- message: rest[2]
95661
- };
95662
- }
95663
- const projectId = params.projectId;
95664
- const type = params.type;
95665
- const locale = params.locale;
95666
- const message = params.message;
95667
- if (typeof projectId === "undefined") {
95668
- throw new AppwriteException('Missing required parameter: "projectId"');
95669
- }
95670
- if (typeof type === "undefined") {
95671
- throw new AppwriteException('Missing required parameter: "type"');
95672
- }
95673
- if (typeof locale === "undefined") {
95674
- throw new AppwriteException('Missing required parameter: "locale"');
95675
- }
95676
- if (typeof message === "undefined") {
95677
- throw new AppwriteException('Missing required parameter: "message"');
95678
- }
95679
- const apiPath = "/projects/{projectId}/templates/sms/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95680
- const payload = {};
95681
- if (typeof message !== "undefined") {
95682
- payload["message"] = message;
95683
- }
95684
- const uri = new URL(this.client.config.endpoint + apiPath);
95685
- const apiHeaders = {
95686
- "content-type": "application/json"
95687
- };
95688
- return this.client.call("patch", uri, apiHeaders, payload);
95689
- }
95690
- updateSMSTemplate(paramsOrFirst, ...rest) {
95691
- let params;
95692
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95693
- params = paramsOrFirst || {};
95694
- } else {
95695
- params = {
95696
- projectId: paramsOrFirst,
95697
- type: rest[0],
95698
- locale: rest[1],
95699
- message: rest[2]
95700
- };
95701
- }
95702
- const projectId = params.projectId;
95703
- const type = params.type;
95704
- const locale = params.locale;
95705
- const message = params.message;
95706
- if (typeof projectId === "undefined") {
95707
- throw new AppwriteException('Missing required parameter: "projectId"');
95708
- }
95709
- if (typeof type === "undefined") {
95710
- throw new AppwriteException('Missing required parameter: "type"');
95711
- }
95712
- if (typeof locale === "undefined") {
95713
- throw new AppwriteException('Missing required parameter: "locale"');
95714
- }
95715
- if (typeof message === "undefined") {
95716
- throw new AppwriteException('Missing required parameter: "message"');
95717
- }
95718
- const apiPath = "/projects/{projectId}/templates/sms/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95719
- const payload = {};
95720
- if (typeof message !== "undefined") {
95721
- payload["message"] = message;
95722
- }
95723
- const uri = new URL(this.client.config.endpoint + apiPath);
95724
- const apiHeaders = {
95725
- "content-type": "application/json"
95726
- };
95727
- return this.client.call("patch", uri, apiHeaders, payload);
95728
- }
95729
- deleteSmsTemplate(paramsOrFirst, ...rest) {
95730
- let params;
95731
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95732
- params = paramsOrFirst || {};
95733
- } else {
95734
- params = {
95735
- projectId: paramsOrFirst,
95736
- type: rest[0],
95737
- locale: rest[1]
95738
- };
95739
- }
95740
- const projectId = params.projectId;
95741
- const type = params.type;
95742
- const locale = params.locale;
95743
- if (typeof projectId === "undefined") {
95744
- throw new AppwriteException('Missing required parameter: "projectId"');
95745
- }
95746
- if (typeof type === "undefined") {
95747
- throw new AppwriteException('Missing required parameter: "type"');
95748
- }
95749
- if (typeof locale === "undefined") {
95750
- throw new AppwriteException('Missing required parameter: "locale"');
95751
- }
95752
- const apiPath = "/projects/{projectId}/templates/sms/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95753
- const payload = {};
95754
- const uri = new URL(this.client.config.endpoint + apiPath);
95755
- const apiHeaders = {
95756
- "content-type": "application/json"
95757
- };
95758
- return this.client.call("delete", uri, apiHeaders, payload);
95759
- }
95760
- deleteSMSTemplate(paramsOrFirst, ...rest) {
95761
- let params;
95762
- if (paramsOrFirst && typeof paramsOrFirst === "object" && !Array.isArray(paramsOrFirst)) {
95763
- params = paramsOrFirst || {};
95764
- } else {
95765
- params = {
95766
- projectId: paramsOrFirst,
95767
- type: rest[0],
95768
- locale: rest[1]
95769
- };
95770
- }
95771
- const projectId = params.projectId;
95772
- const type = params.type;
95773
- const locale = params.locale;
95774
- if (typeof projectId === "undefined") {
95775
- throw new AppwriteException('Missing required parameter: "projectId"');
95776
- }
95777
- if (typeof type === "undefined") {
95778
- throw new AppwriteException('Missing required parameter: "type"');
95779
- }
95780
- if (typeof locale === "undefined") {
95781
- throw new AppwriteException('Missing required parameter: "locale"');
95782
- }
95783
- const apiPath = "/projects/{projectId}/templates/sms/{type}/{locale}".replace("{projectId}", projectId).replace("{type}", type).replace("{locale}", locale);
95784
- const payload = {};
95785
- const uri = new URL(this.client.config.endpoint + apiPath);
95786
- const apiHeaders = {
95787
- "content-type": "application/json"
95788
- };
95789
- return this.client.call("delete", uri, apiHeaders, payload);
95790
- }
95791
95345
  };
95792
95346
  var Proxy2 = class {
95793
95347
  constructor(client) {
@@ -101588,41 +101142,6 @@ Permission.update = (role) => {
101588
101142
  Permission.delete = (role) => {
101589
101143
  return `delete("${role}")`;
101590
101144
  };
101591
- var _a2;
101592
- var _ID_hexTimestamp;
101593
- var ID2 = class {
101594
- /**
101595
- * Uses the provided ID as the ID for the resource.
101596
- *
101597
- * @param {string} id
101598
- * @returns {string}
101599
- */
101600
- static custom(id) {
101601
- return id;
101602
- }
101603
- /**
101604
- * Have Appwrite generate a unique ID for you.
101605
- *
101606
- * @param {number} padding. Default is 7.
101607
- * @returns {string}
101608
- */
101609
- static unique(padding = 7) {
101610
- const baseId = __classPrivateFieldGet(_a2, _a2, "m", _ID_hexTimestamp).call(_a2);
101611
- let randomPadding = "";
101612
- for (let i = 0; i < padding; i++) {
101613
- const randomHexDigit = Math.floor(Math.random() * 16).toString(16);
101614
- randomPadding += randomHexDigit;
101615
- }
101616
- return baseId + randomPadding;
101617
- }
101618
- };
101619
- _a2 = ID2, _ID_hexTimestamp = function _ID_hexTimestamp2() {
101620
- const now = /* @__PURE__ */ new Date();
101621
- const sec = Math.floor(now.getTime() / 1e3);
101622
- const msec = now.getMilliseconds();
101623
- const hexTimestamp = sec.toString(16) + msec.toString(16).padStart(5, "0");
101624
- return hexTimestamp;
101625
- };
101626
101145
  var Condition;
101627
101146
  (function(Condition2) {
101628
101147
  Condition2["Equal"] = "equal";
@@ -101827,6 +101346,8 @@ var Scopes;
101827
101346
  Scopes2["PlatformsRead"] = "platforms.read";
101828
101347
  Scopes2["PlatformsWrite"] = "platforms.write";
101829
101348
  Scopes2["PoliciesWrite"] = "policies.write";
101349
+ Scopes2["TemplatesRead"] = "templates.read";
101350
+ Scopes2["TemplatesWrite"] = "templates.write";
101830
101351
  Scopes2["PoliciesRead"] = "policies.read";
101831
101352
  Scopes2["ArchivesRead"] = "archives.read";
101832
101353
  Scopes2["ArchivesWrite"] = "archives.write";
@@ -102638,6 +102159,12 @@ var OrderBy;
102638
102159
  OrderBy2["Asc"] = "asc";
102639
102160
  OrderBy2["Desc"] = "desc";
102640
102161
  })(OrderBy || (OrderBy = {}));
102162
+ var DocumentsDBIndexType;
102163
+ (function(DocumentsDBIndexType2) {
102164
+ DocumentsDBIndexType2["Key"] = "key";
102165
+ DocumentsDBIndexType2["Fulltext"] = "fulltext";
102166
+ DocumentsDBIndexType2["Unique"] = "unique";
102167
+ })(DocumentsDBIndexType || (DocumentsDBIndexType = {}));
102641
102168
  var RegistrationType;
102642
102169
  (function(RegistrationType2) {
102643
102170
  RegistrationType2["New"] = "new";
@@ -103002,46 +102529,11 @@ var ServiceId;
103002
102529
  ServiceId3["Migrations"] = "migrations";
103003
102530
  ServiceId3["Messaging"] = "messaging";
103004
102531
  })(ServiceId || (ServiceId = {}));
103005
- var ProjectUsageRange;
103006
- (function(ProjectUsageRange2) {
103007
- ProjectUsageRange2["OneHour"] = "1h";
103008
- ProjectUsageRange2["OneDay"] = "1d";
103009
- })(ProjectUsageRange || (ProjectUsageRange = {}));
103010
- var Region;
103011
- (function(Region2) {
103012
- Region2["Fra"] = "fra";
103013
- Region2["Nyc"] = "nyc";
103014
- Region2["Syd"] = "syd";
103015
- Region2["Sfo"] = "sfo";
103016
- Region2["Sgp"] = "sgp";
103017
- Region2["Tor"] = "tor";
103018
- })(Region || (Region = {}));
103019
- var AuthMethod;
103020
- (function(AuthMethod3) {
103021
- AuthMethod3["Emailpassword"] = "email-password";
103022
- AuthMethod3["Magicurl"] = "magic-url";
103023
- AuthMethod3["Emailotp"] = "email-otp";
103024
- AuthMethod3["Anonymous"] = "anonymous";
103025
- AuthMethod3["Invites"] = "invites";
103026
- AuthMethod3["Jwt"] = "jwt";
103027
- AuthMethod3["Phone"] = "phone";
103028
- })(AuthMethod || (AuthMethod = {}));
103029
- var ResourceType;
103030
- (function(ResourceType2) {
103031
- ResourceType2["Function"] = "function";
103032
- ResourceType2["Execution"] = "execution";
103033
- ResourceType2["Message"] = "message";
103034
- ResourceType2["Backup"] = "backup";
103035
- })(ResourceType || (ResourceType = {}));
103036
- var SMTPSecure;
103037
- (function(SMTPSecure2) {
103038
- SMTPSecure2["Tls"] = "tls";
103039
- SMTPSecure2["Ssl"] = "ssl";
103040
- })(SMTPSecure || (SMTPSecure = {}));
103041
- var Status;
103042
- (function(Status2) {
103043
- Status2["Active"] = "active";
103044
- })(Status || (Status = {}));
102532
+ var Secure;
102533
+ (function(Secure2) {
102534
+ Secure2["Tls"] = "tls";
102535
+ Secure2["Ssl"] = "ssl";
102536
+ })(Secure || (Secure = {}));
103045
102537
  var EmailTemplateType;
103046
102538
  (function(EmailTemplateType2) {
103047
102539
  EmailTemplateType2["Verification"] = "verification";
@@ -103186,147 +102678,41 @@ var EmailTemplateLocale;
103186
102678
  EmailTemplateLocale2["Zhtw"] = "zh-tw";
103187
102679
  EmailTemplateLocale2["Zu"] = "zu";
103188
102680
  })(EmailTemplateLocale || (EmailTemplateLocale = {}));
103189
- var SmsTemplateType;
103190
- (function(SmsTemplateType2) {
103191
- SmsTemplateType2["Verification"] = "verification";
103192
- SmsTemplateType2["Login"] = "login";
103193
- SmsTemplateType2["Invitation"] = "invitation";
103194
- SmsTemplateType2["MfaChallenge"] = "mfaChallenge";
103195
- })(SmsTemplateType || (SmsTemplateType = {}));
103196
- var SmsTemplateLocale;
103197
- (function(SmsTemplateLocale2) {
103198
- SmsTemplateLocale2["Af"] = "af";
103199
- SmsTemplateLocale2["Arae"] = "ar-ae";
103200
- SmsTemplateLocale2["Arbh"] = "ar-bh";
103201
- SmsTemplateLocale2["Ardz"] = "ar-dz";
103202
- SmsTemplateLocale2["Areg"] = "ar-eg";
103203
- SmsTemplateLocale2["Ariq"] = "ar-iq";
103204
- SmsTemplateLocale2["Arjo"] = "ar-jo";
103205
- SmsTemplateLocale2["Arkw"] = "ar-kw";
103206
- SmsTemplateLocale2["Arlb"] = "ar-lb";
103207
- SmsTemplateLocale2["Arly"] = "ar-ly";
103208
- SmsTemplateLocale2["Arma"] = "ar-ma";
103209
- SmsTemplateLocale2["Arom"] = "ar-om";
103210
- SmsTemplateLocale2["Arqa"] = "ar-qa";
103211
- SmsTemplateLocale2["Arsa"] = "ar-sa";
103212
- SmsTemplateLocale2["Arsy"] = "ar-sy";
103213
- SmsTemplateLocale2["Artn"] = "ar-tn";
103214
- SmsTemplateLocale2["Arye"] = "ar-ye";
103215
- SmsTemplateLocale2["As"] = "as";
103216
- SmsTemplateLocale2["Az"] = "az";
103217
- SmsTemplateLocale2["Be"] = "be";
103218
- SmsTemplateLocale2["Bg"] = "bg";
103219
- SmsTemplateLocale2["Bh"] = "bh";
103220
- SmsTemplateLocale2["Bn"] = "bn";
103221
- SmsTemplateLocale2["Bs"] = "bs";
103222
- SmsTemplateLocale2["Ca"] = "ca";
103223
- SmsTemplateLocale2["Cs"] = "cs";
103224
- SmsTemplateLocale2["Cy"] = "cy";
103225
- SmsTemplateLocale2["Da"] = "da";
103226
- SmsTemplateLocale2["De"] = "de";
103227
- SmsTemplateLocale2["Deat"] = "de-at";
103228
- SmsTemplateLocale2["Dech"] = "de-ch";
103229
- SmsTemplateLocale2["Deli"] = "de-li";
103230
- SmsTemplateLocale2["Delu"] = "de-lu";
103231
- SmsTemplateLocale2["El"] = "el";
103232
- SmsTemplateLocale2["En"] = "en";
103233
- SmsTemplateLocale2["Enau"] = "en-au";
103234
- SmsTemplateLocale2["Enbz"] = "en-bz";
103235
- SmsTemplateLocale2["Enca"] = "en-ca";
103236
- SmsTemplateLocale2["Engb"] = "en-gb";
103237
- SmsTemplateLocale2["Enie"] = "en-ie";
103238
- SmsTemplateLocale2["Enjm"] = "en-jm";
103239
- SmsTemplateLocale2["Ennz"] = "en-nz";
103240
- SmsTemplateLocale2["Entt"] = "en-tt";
103241
- SmsTemplateLocale2["Enus"] = "en-us";
103242
- SmsTemplateLocale2["Enza"] = "en-za";
103243
- SmsTemplateLocale2["Eo"] = "eo";
103244
- SmsTemplateLocale2["Es"] = "es";
103245
- SmsTemplateLocale2["Esar"] = "es-ar";
103246
- SmsTemplateLocale2["Esbo"] = "es-bo";
103247
- SmsTemplateLocale2["Escl"] = "es-cl";
103248
- SmsTemplateLocale2["Esco"] = "es-co";
103249
- SmsTemplateLocale2["Escr"] = "es-cr";
103250
- SmsTemplateLocale2["Esdo"] = "es-do";
103251
- SmsTemplateLocale2["Esec"] = "es-ec";
103252
- SmsTemplateLocale2["Esgt"] = "es-gt";
103253
- SmsTemplateLocale2["Eshn"] = "es-hn";
103254
- SmsTemplateLocale2["Esmx"] = "es-mx";
103255
- SmsTemplateLocale2["Esni"] = "es-ni";
103256
- SmsTemplateLocale2["Espa"] = "es-pa";
103257
- SmsTemplateLocale2["Espe"] = "es-pe";
103258
- SmsTemplateLocale2["Espr"] = "es-pr";
103259
- SmsTemplateLocale2["Espy"] = "es-py";
103260
- SmsTemplateLocale2["Essv"] = "es-sv";
103261
- SmsTemplateLocale2["Esuy"] = "es-uy";
103262
- SmsTemplateLocale2["Esve"] = "es-ve";
103263
- SmsTemplateLocale2["Et"] = "et";
103264
- SmsTemplateLocale2["Eu"] = "eu";
103265
- SmsTemplateLocale2["Fa"] = "fa";
103266
- SmsTemplateLocale2["Fi"] = "fi";
103267
- SmsTemplateLocale2["Fo"] = "fo";
103268
- SmsTemplateLocale2["Fr"] = "fr";
103269
- SmsTemplateLocale2["Frbe"] = "fr-be";
103270
- SmsTemplateLocale2["Frca"] = "fr-ca";
103271
- SmsTemplateLocale2["Frch"] = "fr-ch";
103272
- SmsTemplateLocale2["Frlu"] = "fr-lu";
103273
- SmsTemplateLocale2["Ga"] = "ga";
103274
- SmsTemplateLocale2["Gd"] = "gd";
103275
- SmsTemplateLocale2["He"] = "he";
103276
- SmsTemplateLocale2["Hi"] = "hi";
103277
- SmsTemplateLocale2["Hr"] = "hr";
103278
- SmsTemplateLocale2["Hu"] = "hu";
103279
- SmsTemplateLocale2["Id"] = "id";
103280
- SmsTemplateLocale2["Is"] = "is";
103281
- SmsTemplateLocale2["It"] = "it";
103282
- SmsTemplateLocale2["Itch"] = "it-ch";
103283
- SmsTemplateLocale2["Ja"] = "ja";
103284
- SmsTemplateLocale2["Ji"] = "ji";
103285
- SmsTemplateLocale2["Ko"] = "ko";
103286
- SmsTemplateLocale2["Ku"] = "ku";
103287
- SmsTemplateLocale2["Lt"] = "lt";
103288
- SmsTemplateLocale2["Lv"] = "lv";
103289
- SmsTemplateLocale2["Mk"] = "mk";
103290
- SmsTemplateLocale2["Ml"] = "ml";
103291
- SmsTemplateLocale2["Ms"] = "ms";
103292
- SmsTemplateLocale2["Mt"] = "mt";
103293
- SmsTemplateLocale2["Nb"] = "nb";
103294
- SmsTemplateLocale2["Ne"] = "ne";
103295
- SmsTemplateLocale2["Nl"] = "nl";
103296
- SmsTemplateLocale2["Nlbe"] = "nl-be";
103297
- SmsTemplateLocale2["Nn"] = "nn";
103298
- SmsTemplateLocale2["No"] = "no";
103299
- SmsTemplateLocale2["Pa"] = "pa";
103300
- SmsTemplateLocale2["Pl"] = "pl";
103301
- SmsTemplateLocale2["Pt"] = "pt";
103302
- SmsTemplateLocale2["Ptbr"] = "pt-br";
103303
- SmsTemplateLocale2["Rm"] = "rm";
103304
- SmsTemplateLocale2["Ro"] = "ro";
103305
- SmsTemplateLocale2["Romd"] = "ro-md";
103306
- SmsTemplateLocale2["Ru"] = "ru";
103307
- SmsTemplateLocale2["Rumd"] = "ru-md";
103308
- SmsTemplateLocale2["Sb"] = "sb";
103309
- SmsTemplateLocale2["Sk"] = "sk";
103310
- SmsTemplateLocale2["Sl"] = "sl";
103311
- SmsTemplateLocale2["Sq"] = "sq";
103312
- SmsTemplateLocale2["Sr"] = "sr";
103313
- SmsTemplateLocale2["Sv"] = "sv";
103314
- SmsTemplateLocale2["Svfi"] = "sv-fi";
103315
- SmsTemplateLocale2["Th"] = "th";
103316
- SmsTemplateLocale2["Tn"] = "tn";
103317
- SmsTemplateLocale2["Tr"] = "tr";
103318
- SmsTemplateLocale2["Ts"] = "ts";
103319
- SmsTemplateLocale2["Ua"] = "ua";
103320
- SmsTemplateLocale2["Ur"] = "ur";
103321
- SmsTemplateLocale2["Ve"] = "ve";
103322
- SmsTemplateLocale2["Vi"] = "vi";
103323
- SmsTemplateLocale2["Xh"] = "xh";
103324
- SmsTemplateLocale2["Zhcn"] = "zh-cn";
103325
- SmsTemplateLocale2["Zhhk"] = "zh-hk";
103326
- SmsTemplateLocale2["Zhsg"] = "zh-sg";
103327
- SmsTemplateLocale2["Zhtw"] = "zh-tw";
103328
- SmsTemplateLocale2["Zu"] = "zu";
103329
- })(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 = {}));
103330
102716
  var StatusCode;
103331
102717
  (function(StatusCode2) {
103332
102718
  StatusCode2["MovedPermanently301"] = "301";
@@ -103521,6 +102907,19 @@ var VCSDetectionType;
103521
102907
  VCSDetectionType2["Runtime"] = "runtime";
103522
102908
  VCSDetectionType2["Framework"] = "framework";
103523
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 = {}));
103524
102923
  var DatabaseType;
103525
102924
  (function(DatabaseType2) {
103526
102925
  DatabaseType2["Legacy"] = "legacy";
@@ -103552,6 +102951,14 @@ var IndexStatus;
103552
102951
  IndexStatus2["Stuck"] = "stuck";
103553
102952
  IndexStatus2["Failed"] = "failed";
103554
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 = {}));
103555
102962
  var DeploymentStatus;
103556
102963
  (function(DeploymentStatus2) {
103557
102964
  DeploymentStatus2["Waiting"] = "waiting";
@@ -103649,7 +103056,7 @@ var package_default = {
103649
103056
  type: "module",
103650
103057
  homepage: "https://appwrite.io/support",
103651
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",
103652
- version: "18.1.0",
103059
+ version: "19.0.0",
103653
103060
  license: "BSD-3-Clause",
103654
103061
  main: "dist/index.cjs",
103655
103062
  module: "dist/index.js",
@@ -103697,7 +103104,7 @@ var package_default = {
103697
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"
103698
103105
  },
103699
103106
  dependencies: {
103700
- "@appwrite.io/console": "~9.1.0",
103107
+ "@appwrite.io/console": "11.0.0",
103701
103108
  chalk: "4.1.2",
103702
103109
  chokidar: "^3.6.0",
103703
103110
  "cli-progress": "^3.12.0",
@@ -103718,7 +103125,8 @@ var package_default = {
103718
103125
  zod: "^4.3.5"
103719
103126
  },
103720
103127
  overrides: {
103721
- phin: "3.7.1"
103128
+ phin: "3.7.1",
103129
+ "@xmldom/xmldom": "^0.9.10"
103722
103130
  },
103723
103131
  devDependencies: {
103724
103132
  "@typescript-eslint/eslint-plugin": "^8.0.0",
@@ -103892,6 +103300,19 @@ var InvoiceSummarySchema = createSummarySchema(
103892
103300
  ["plan", "status", "dueAt"],
103893
103301
  "Expected an invoice summary row"
103894
103302
  );
103303
+ var RuntimeSummarySchema = createSummarySchema(
103304
+ {
103305
+ $id: external_exports.string().nullable().optional(),
103306
+ key: external_exports.string().nullable().optional(),
103307
+ name: external_exports.string().nullable().optional(),
103308
+ version: external_exports.union([external_exports.string(), external_exports.number()]).nullable().optional(),
103309
+ base: external_exports.string().nullable().optional(),
103310
+ image: external_exports.string().nullable().optional(),
103311
+ logo: external_exports.string().nullable().optional()
103312
+ },
103313
+ ["$id", "name", "version", "base", "image"],
103314
+ "Expected a runtime summary row"
103315
+ );
103895
103316
  var paymentMethodLabel = (row) => {
103896
103317
  const brand = valueFrom(row, "brand") ?? "";
103897
103318
  const last4 = valueFrom(row, "last4") ?? "";
@@ -103927,7 +103348,35 @@ var paymentMethodStatus = (row) => {
103927
103348
  }
103928
103349
  return "status: pending";
103929
103350
  };
103351
+ var runtimeLabel = (row) => {
103352
+ const name = compactText(valueFrom(row, "name"), "");
103353
+ const key = compactText(valueFrom(row, "key"), "");
103354
+ const version2 = valueFrom(row, "version");
103355
+ const runtimeName = name || (key ? toTitleCase(key) : "Runtime");
103356
+ if (version2 == null || String(version2).trim() === "") {
103357
+ return runtimeName;
103358
+ }
103359
+ return `${runtimeName} ${version2}`;
103360
+ };
103930
103361
  var structuredCollectionRenderers = {
103362
+ runtimes: createColumnRenderer(RuntimeSummarySchema, [
103363
+ {
103364
+ header: "runtime",
103365
+ value: (row, context) => indexedLabel(runtimeLabel(row), context)
103366
+ },
103367
+ {
103368
+ header: "id",
103369
+ value: (row) => compactText(valueFrom(row, "$id"))
103370
+ },
103371
+ {
103372
+ header: "base",
103373
+ value: (row) => compactText(valueFrom(row, "base"))
103374
+ },
103375
+ {
103376
+ header: "image",
103377
+ value: (row) => compactText(valueFrom(row, "image"))
103378
+ }
103379
+ ]),
103931
103380
  identities: createColumnRenderer(IdentitySummarySchema, [
103932
103381
  {
103933
103382
  header: "identity",
@@ -105152,11 +104601,23 @@ var getWebhooksService = async (sdk) => {
105152
104601
 
105153
104602
  // lib/questions.ts
105154
104603
  var whenOverride = (answers) => answers.override === void 0 ? true : answers.override;
104604
+ var buildSelectionLabel = (name, id) => `${name} (${id})`;
104605
+ var extractSelectionId = (value) => {
104606
+ const match = value.match(/\(([^()]+)\)$/);
104607
+ return match ? match[1] : value;
104608
+ };
104609
+ var getInitProjectOverrideMessage = () => {
104610
+ const projectName = localConfig.getProject().projectName;
104611
+ if (projectName) {
104612
+ return `A project is already linked to this directory (${projectName}). Override?`;
104613
+ }
104614
+ return "A project is already linked to this directory. Override?";
104615
+ };
105155
104616
  var questionsInitProject = [
105156
104617
  {
105157
104618
  type: "confirm",
105158
104619
  name: "override",
105159
- message: `An ${SDK_TITLE} project ( ${localConfig.getProject()["projectId"]} ) is already associated with the current directory. Would you like to override it?`,
104620
+ message: getInitProjectOverrideMessage(),
105160
104621
  when() {
105161
104622
  return Object.keys(localConfig.getProject()).length !== 0;
105162
104623
  }
@@ -105165,14 +104626,14 @@ var questionsInitProject = [
105165
104626
  type: "list",
105166
104627
  name: "start",
105167
104628
  when: whenOverride,
105168
- message: "How would you like to start?",
104629
+ message: "Select a setup method:",
105169
104630
  choices: [
105170
104631
  {
105171
- name: "Create new project",
104632
+ name: "Create a new project",
105172
104633
  value: "new"
105173
104634
  },
105174
104635
  {
105175
- name: "Link directory to an existing project",
104636
+ name: "Link this directory to an existing project",
105176
104637
  value: "existing"
105177
104638
  }
105178
104639
  ]
@@ -105180,7 +104641,7 @@ var questionsInitProject = [
105180
104641
  {
105181
104642
  type: "search-list",
105182
104643
  name: "organization",
105183
- message: "Choose your organization",
104644
+ message: "Choose your organization:",
105184
104645
  choices: async () => {
105185
104646
  const client = await sdkForConsole(true);
105186
104647
  const { teams } = isCloud() ? await paginate(
@@ -105199,9 +104660,10 @@ var questionsInitProject = [
105199
104660
  "teams"
105200
104661
  );
105201
104662
  const choices = teams.map((team, _idx) => {
104663
+ const label = buildSelectionLabel(team.name, team["$id"]);
105202
104664
  return {
105203
- name: `${team.name} (${team["$id"]})`,
105204
- value: team["$id"]
104665
+ name: label,
104666
+ value: label
105205
104667
  };
105206
104668
  });
105207
104669
  if (choices.length == 0) {
@@ -105230,13 +104692,13 @@ var questionsInitProject = [
105230
104692
  {
105231
104693
  type: "search-list",
105232
104694
  name: "project",
105233
- message: `Choose your ${SDK_TITLE} project.`,
104695
+ message: "Choose your project:",
105234
104696
  choices: async (answers) => {
105235
104697
  const queries = [
105236
104698
  JSON.stringify({
105237
104699
  method: "equal",
105238
104700
  attribute: "teamId",
105239
- values: [answers.organization]
104701
+ values: [extractSelectionId(answers.organization)]
105240
104702
  }),
105241
104703
  JSON.stringify({ method: "orderDesc", attribute: "$id" })
105242
104704
  ];
@@ -105248,14 +104710,10 @@ var questionsInitProject = [
105248
104710
  queries
105249
104711
  );
105250
104712
  const choices = projects.map((project) => {
105251
- const label = `${project.name} (${project["$id"]})`;
104713
+ const label = buildSelectionLabel(project.name, project["$id"]);
105252
104714
  return {
105253
104715
  name: label,
105254
- short: label,
105255
- value: {
105256
- $id: project["$id"],
105257
- region: project.region || ""
105258
- }
104716
+ value: label
105259
104717
  };
105260
104718
  });
105261
104719
  if (choices.length === 0) {
@@ -106845,6 +106303,37 @@ function getDeploymentProgressText(status, waitingSince) {
106845
106303
  function getDeploymentTimeoutErrorMessage() {
106846
106304
  return `Deployment got stuck for more than ${DEPLOYMENT_TIMEOUT_MINUTES} minutes`;
106847
106305
  }
106306
+ function getDeploymentProgressSignature(deployment) {
106307
+ const status = typeof deployment["status"] === "string" ? deployment["status"] : "";
106308
+ const buildLogs = typeof deployment["buildLogs"] === "string" ? deployment["buildLogs"] : "";
106309
+ const updatedAt = typeof deployment["$updatedAt"] === "string" ? deployment["$updatedAt"] : "";
106310
+ const { screenshotLight, screenshotDark } = getSiteDeploymentScreenshots(deployment);
106311
+ return JSON.stringify({
106312
+ status,
106313
+ updatedAt,
106314
+ buildLogsLength: buildLogs.length,
106315
+ buildLogsTail: buildLogs.slice(-200),
106316
+ screenshotLight: screenshotLight ?? "",
106317
+ screenshotDark: screenshotDark ?? ""
106318
+ });
106319
+ }
106320
+ function createDeploymentTimeoutTracker(deployment) {
106321
+ let lastActivityAt = Date.now();
106322
+ let lastSignature = null;
106323
+ const touch = (nextDeployment) => {
106324
+ const nextSignature = getDeploymentProgressSignature(nextDeployment);
106325
+ if (nextSignature === lastSignature) {
106326
+ return;
106327
+ }
106328
+ lastSignature = nextSignature;
106329
+ lastActivityAt = Date.now();
106330
+ };
106331
+ touch(deployment);
106332
+ return {
106333
+ touch,
106334
+ hasTimedOut: () => Date.now() - lastActivityAt > DEPLOYMENT_TIMEOUT_MS
106335
+ };
106336
+ }
106848
106337
  async function getTerminalImage() {
106849
106338
  terminalImageModulePromise ??= import("terminal-image").then(
106850
106339
  (module) => module.default
@@ -107363,7 +106852,7 @@ var Push = class {
107363
106852
  if (settings.services) {
107364
106853
  this.log("Applying service statuses ...");
107365
106854
  for (const [service, status] of Object.entries(settings.services)) {
107366
- await projectService.updateServiceStatus({
106855
+ await projectService.updateService({
107367
106856
  serviceId: service,
107368
106857
  enabled: status
107369
106858
  });
@@ -107372,7 +106861,7 @@ var Push = class {
107372
106861
  if (settings.protocols) {
107373
106862
  this.log("Applying protocol statuses ...");
107374
106863
  for (const [protocol, status] of Object.entries(settings.protocols)) {
107375
- await projectService.updateProtocolStatus({
106864
+ await projectService.updateProtocol({
107376
106865
  protocolId: protocol,
107377
106866
  enabled: status
107378
106867
  });
@@ -107381,33 +106870,26 @@ var Push = class {
107381
106870
  if (settings.auth) {
107382
106871
  if (settings.auth.security) {
107383
106872
  this.log("Applying auth security settings ...");
107384
- await projectsService.updateAuthDuration({
107385
- projectId,
106873
+ await projectService.updateSessionDurationPolicy({
107386
106874
  duration: Number(settings.auth.security.duration)
107387
106875
  });
107388
- await projectsService.updateAuthLimit({
107389
- projectId,
107390
- limit: Number(settings.auth.security.limit)
106876
+ await projectService.updateUserLimitPolicy({
106877
+ total: Number(settings.auth.security.limit)
107391
106878
  });
107392
- await projectsService.updateAuthSessionsLimit({
107393
- projectId,
107394
- limit: Number(settings.auth.security.sessionsLimit)
106879
+ await projectService.updateSessionLimitPolicy({
106880
+ total: Number(settings.auth.security.sessionsLimit)
107395
106881
  });
107396
- await projectsService.updateAuthPasswordDictionary({
107397
- projectId,
106882
+ await projectService.updatePasswordDictionaryPolicy({
107398
106883
  enabled: settings.auth.security.passwordDictionary
107399
106884
  });
107400
- await projectsService.updateAuthPasswordHistory({
107401
- projectId,
107402
- limit: Number(settings.auth.security.passwordHistory)
106885
+ await projectService.updatePasswordHistoryPolicy({
106886
+ total: Number(settings.auth.security.passwordHistory)
107403
106887
  });
107404
- await projectsService.updatePersonalDataCheck({
107405
- projectId,
106888
+ await projectService.updatePasswordPersonalDataPolicy({
107406
106889
  enabled: settings.auth.security.personalDataCheck
107407
106890
  });
107408
- await projectsService.updateSessionAlerts({
107409
- projectId,
107410
- alerts: settings.auth.security.sessionAlerts
106891
+ await projectService.updateSessionAlertPolicy({
106892
+ enabled: settings.auth.security.sessionAlerts
107411
106893
  });
107412
106894
  await projectsService.updateMockNumbers({
107413
106895
  projectId,
@@ -107860,6 +107342,7 @@ var Push = class {
107860
107342
  deploymentId
107861
107343
  );
107862
107344
  let waitingSince = null;
107345
+ const deploymentTimeoutTracker = createDeploymentTimeoutTracker(response);
107863
107346
  const deploymentLogPrinter = createDeploymentLogPrinter({
107864
107347
  label: `function:${func.name}`,
107865
107348
  showPrefix: functions.length > 1,
@@ -107870,6 +107353,7 @@ var Push = class {
107870
107353
  endpoint: localConfig.getEndpoint() || globalConfig2.getEndpoint(),
107871
107354
  event: `functions.${func["$id"]}.deployments.${deploymentId}.update`,
107872
107355
  onDeploymentUpdate: (deployment) => {
107356
+ deploymentTimeoutTracker.touch(deployment);
107873
107357
  deploymentLogPrinter.ingest(deployment);
107874
107358
  },
107875
107359
  onClose: () => {
@@ -107899,9 +107383,8 @@ var Push = class {
107899
107383
  deploymentLogsController
107900
107384
  )
107901
107385
  });
107902
- let timeoutDeadline = Date.now() + DEPLOYMENT_TIMEOUT_MS;
107903
107386
  while (true) {
107904
- if (Date.now() > timeoutDeadline) {
107387
+ if (deploymentTimeoutTracker.hasTimedOut()) {
107905
107388
  deploymentLogPrinter.complete();
107906
107389
  failedDeployments.push({
107907
107390
  name: func["name"],
@@ -107925,6 +107408,7 @@ var Push = class {
107925
107408
  functionId: func["$id"],
107926
107409
  deploymentId
107927
107410
  });
107411
+ deploymentTimeoutTracker.touch(response);
107928
107412
  deploymentLogPrinter.ingest(response);
107929
107413
  const status = response["status"];
107930
107414
  if (status === "waiting") {
@@ -108094,7 +107578,6 @@ var Push = class {
108094
107578
  siteId: site["$id"],
108095
107579
  name: site.name,
108096
107580
  framework: site.framework,
108097
- enabled: site.enabled,
108098
107581
  logging: site.logging,
108099
107582
  timeout: site.timeout,
108100
107583
  installCommand: site.installCommand,
@@ -108125,7 +107608,6 @@ var Push = class {
108125
107608
  siteId: site.$id,
108126
107609
  name: site.name,
108127
107610
  framework: site.framework,
108128
- enabled: site.enabled,
108129
107611
  logging: site.logging,
108130
107612
  timeout: site.timeout,
108131
107613
  installCommand: site.installCommand,
@@ -108288,6 +107770,7 @@ var Push = class {
108288
107770
  let waitingSince = null;
108289
107771
  let readyWithoutScreenshotsSince = null;
108290
107772
  let activationApplied = false;
107773
+ const deploymentTimeoutTracker = createDeploymentTimeoutTracker(response);
108291
107774
  const deploymentLogPrinter = createDeploymentLogPrinter({
108292
107775
  label: `site:${site.name}`,
108293
107776
  showPrefix: sites.length > 1,
@@ -108298,6 +107781,7 @@ var Push = class {
108298
107781
  endpoint: localConfig.getEndpoint() || globalConfig2.getEndpoint(),
108299
107782
  event: `sites.${site["$id"]}.deployments.${deploymentId}.update`,
108300
107783
  onDeploymentUpdate: (deployment) => {
107784
+ deploymentTimeoutTracker.touch(deployment);
108301
107785
  deploymentLogPrinter.ingest(deployment);
108302
107786
  },
108303
107787
  onClose: () => {
@@ -108327,9 +107811,8 @@ var Push = class {
108327
107811
  deploymentLogsController
108328
107812
  )
108329
107813
  });
108330
- let timeoutDeadline = Date.now() + DEPLOYMENT_TIMEOUT_MS;
108331
107814
  while (true) {
108332
- if (Date.now() > timeoutDeadline) {
107815
+ if (deploymentTimeoutTracker.hasTimedOut()) {
108333
107816
  deploymentLogPrinter.complete();
108334
107817
  failedDeployments.push({
108335
107818
  name: site["name"],
@@ -108353,6 +107836,7 @@ var Push = class {
108353
107836
  siteId: site["$id"],
108354
107837
  deploymentId
108355
107838
  });
107839
+ deploymentTimeoutTracker.touch(response);
108356
107840
  deploymentLogPrinter.ingest(response);
108357
107841
  const status = response["status"];
108358
107842
  if (status === "waiting") {
@@ -108383,10 +107867,6 @@ var Push = class {
108383
107867
  }
108384
107868
  if (!screenshotsReady) {
108385
107869
  readyWithoutScreenshotsSince ??= Date.now();
108386
- timeoutDeadline = Math.max(
108387
- timeoutDeadline,
108388
- readyWithoutScreenshotsSince + SITE_SCREENSHOT_FINALIZATION_TIMEOUT_MS
108389
- );
108390
107870
  if (Date.now() - readyWithoutScreenshotsSince < SITE_SCREENSHOT_FINALIZATION_TIMEOUT_MS) {
108391
107871
  currentDeploymentEnd = "Finalizing deployment preview...";
108392
107872
  updaterRow.update({
@@ -109973,7 +109453,6 @@ var Pull = class {
109973
109453
  name: site.name,
109974
109454
  path: sitePath,
109975
109455
  framework: site.framework,
109976
- enabled: site.enabled,
109977
109456
  logging: site.logging,
109978
109457
  timeout: site.timeout,
109979
109458
  buildRuntime: site.buildRuntime,