@appwrite.io/console 16.1.0 → 18.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (55) hide show
  1. package/README.md +3 -3
  2. package/dist/cjs/sdk.js +1808 -412
  3. package/dist/cjs/sdk.js.map +1 -1
  4. package/dist/esm/sdk.js +1805 -413
  5. package/dist/esm/sdk.js.map +1 -1
  6. package/dist/iife/sdk.js +4339 -944
  7. package/package.json +5 -2
  8. package/types/client.d.ts +24 -11
  9. package/types/enums/billing-plan-group.d.ts +2 -1
  10. package/types/enums/build-runtime.d.ts +3 -0
  11. package/types/enums/cache-database.d.ts +1 -2
  12. package/types/enums/conversation-type.d.ts +9 -0
  13. package/types/enums/framework.d.ts +1 -0
  14. package/types/enums/id-token-provider.d.ts +4 -0
  15. package/types/enums/o-auth-2-auth-0-prompt.d.ts +5 -0
  16. package/types/enums/o-auth-2-discord-prompt.d.ts +4 -0
  17. package/types/enums/o-auth-2-github-prompt.d.ts +3 -0
  18. package/types/enums/o-auth-2-kakao-prompt.d.ts +6 -0
  19. package/types/enums/o-auth-2-microsoft-prompt.d.ts +6 -0
  20. package/types/enums/o-auth-2-okta-prompt.d.ts +5 -0
  21. package/types/enums/o-auth-2-salesforce-prompt.d.ts +4 -0
  22. package/types/enums/o-auth-2-zoho-prompt.d.ts +3 -0
  23. package/types/enums/organization-key-scopes.d.ts +2 -4
  24. package/types/enums/project-email-template-id.d.ts +3 -1
  25. package/types/enums/project-key-scopes.d.ts +1 -0
  26. package/types/enums/project-o-auth-2-auth-0-prompt.d.ts +5 -0
  27. package/types/enums/project-o-auth-2-discord-prompt.d.ts +4 -0
  28. package/types/enums/project-o-auth-2-git-hub-prompt.d.ts +3 -0
  29. package/types/enums/project-o-auth-2-kakao-prompt.d.ts +6 -0
  30. package/types/enums/project-o-auth-2-microsoft-prompt.d.ts +6 -0
  31. package/types/enums/project-o-auth-2-okta-prompt.d.ts +5 -0
  32. package/types/enums/project-o-auth-2-salesforce-prompt.d.ts +4 -0
  33. package/types/enums/project-o-auth-2-zoho-prompt.d.ts +3 -0
  34. package/types/enums/project-policy-id.d.ts +1 -0
  35. package/types/enums/query-suggestion-resource.d.ts +1 -3
  36. package/types/enums/runtime.d.ts +3 -0
  37. package/types/index.d.ts +23 -2
  38. package/types/models.d.ts +271 -562
  39. package/types/services/account.d.ts +167 -24
  40. package/types/services/console.d.ts +2 -2
  41. package/types/services/databases.d.ts +4 -4
  42. package/types/services/growth.d.ts +100 -0
  43. package/types/services/manager.d.ts +39 -14
  44. package/types/services/messaging.d.ts +94 -8
  45. package/types/services/organization.d.ts +165 -0
  46. package/types/services/organizations.d.ts +0 -19
  47. package/types/services/project.d.ts +93 -50
  48. package/types/services/projects.d.ts +0 -94
  49. package/types/services/push.d.ts +153 -0
  50. package/types/services/storage.d.ts +4 -4
  51. package/types/services/tables-db.d.ts +37 -37
  52. package/types/services/teams.d.ts +0 -25
  53. package/types/services/users.d.ts +4 -29
  54. package/types/topic.d.ts +34 -0
  55. package/types/enums/project-usage-range.d.ts +0 -4
package/dist/esm/sdk.js CHANGED
@@ -1,4 +1,6 @@
1
1
  import JSONbigModule from 'json-bigint';
2
+ import { Buffer } from 'buffer';
3
+ import mqtt from 'mqtt';
2
4
 
3
5
  /******************************************************************************
4
6
  Copyright (c) Microsoft Corporation.
@@ -642,6 +644,8 @@ class Client {
642
644
  this.config = {
643
645
  endpoint: 'https://cloud.appwrite.io/v1',
644
646
  endpointRealtime: '',
647
+ endpointPush: '',
648
+ pushClientId: '',
645
649
  project: '',
646
650
  key: '',
647
651
  organization: '',
@@ -651,7 +655,6 @@ class Client {
651
655
  mode: '',
652
656
  cookie: '',
653
657
  session: '',
654
- devkey: '',
655
658
  impersonateuserid: '',
656
659
  impersonateuseremail: '',
657
660
  impersonateuserphone: '',
@@ -666,8 +669,8 @@ class Client {
666
669
  'x-sdk-name': 'Console',
667
670
  'x-sdk-platform': 'console',
668
671
  'x-sdk-language': 'web',
669
- 'x-sdk-version': '16.1.0',
670
- 'X-Appwrite-Response-Format': '2.0.0',
672
+ 'x-sdk-version': '18.0.0',
673
+ 'X-Appwrite-Response-Format': '2.3.0',
671
674
  };
672
675
  this.realtime = {
673
676
  socket: undefined,
@@ -908,6 +911,44 @@ class Client {
908
911
  this.config.endpointRealtime = endpointRealtime;
909
912
  return this;
910
913
  }
914
+ /**
915
+ * Set Push Endpoint
916
+ *
917
+ * The MQTT-over-WebSocket URL the AppwritePush service connects to.
918
+ *
919
+ * @param {string} endpointPush
920
+ *
921
+ * @returns {this}
922
+ */
923
+ setPushEndpoint(endpointPush) {
924
+ if (!endpointPush || typeof endpointPush !== 'string') {
925
+ throw new AppwriteException('Endpoint must be a valid string');
926
+ }
927
+ if (!endpointPush.startsWith('ws://') &&
928
+ !endpointPush.startsWith('wss://')) {
929
+ throw new AppwriteException('Invalid push endpoint URL: ' + endpointPush);
930
+ }
931
+ this.config.endpointPush = endpointPush;
932
+ return this;
933
+ }
934
+ /**
935
+ * Set Push Client Id
936
+ *
937
+ * A stable client id for the AppwritePush service. The broker keys its
938
+ * offline-replay cursor on this id, so pass a stable value to resume replay across
939
+ * reloads/restarts. Defaults to a per-connection id when unset.
940
+ *
941
+ * @param {string} pushClientId
942
+ *
943
+ * @returns {this}
944
+ */
945
+ setPushClientId(pushClientId) {
946
+ if (!pushClientId || typeof pushClientId !== 'string') {
947
+ throw new AppwriteException('Client id must be a valid string');
948
+ }
949
+ this.config.pushClientId = pushClientId;
950
+ return this;
951
+ }
911
952
  /**
912
953
  * Set self-signed
913
954
  *
@@ -1079,20 +1120,6 @@ class Client {
1079
1120
  this.config.session = value;
1080
1121
  return this;
1081
1122
  }
1082
- /**
1083
- * Set DevKey
1084
- *
1085
- * Your secret dev API key
1086
- *
1087
- * @param value string
1088
- *
1089
- * @return {this}
1090
- */
1091
- setDevKey(value) {
1092
- this.headers['X-Appwrite-Dev-Key'] = value;
1093
- this.config.devkey = value;
1094
- return this;
1095
- }
1096
1123
  /**
1097
1124
  * Set ImpersonateUserId
1098
1125
  *
@@ -1252,10 +1279,8 @@ class Client {
1252
1279
  const options = {
1253
1280
  method,
1254
1281
  headers,
1282
+ credentials: this.config.credentials,
1255
1283
  };
1256
- if (headers['X-Appwrite-Dev-Key'] === undefined) {
1257
- options.credentials = this.config.credentials;
1258
- }
1259
1284
  if (method === 'GET') {
1260
1285
  for (const [key, value] of Object.entries(Client.flatten(params))) {
1261
1286
  url.searchParams.append(key, value);
@@ -1294,7 +1319,7 @@ class Client {
1294
1319
  var _a;
1295
1320
  const [fileParam, file] = (_a = Object.entries(originalPayload).find(([_, value]) => value instanceof File)) !== null && _a !== void 0 ? _a : [];
1296
1321
  if (!file || !fileParam) {
1297
- throw new Error('File not found in payload');
1322
+ return yield this.call(method, url, headers, originalPayload);
1298
1323
  }
1299
1324
  if (file.size <= Client.CHUNK_SIZE) {
1300
1325
  return yield this.call(method, url, headers, originalPayload);
@@ -2322,37 +2347,6 @@ class Account {
2322
2347
  };
2323
2348
  return this.client.call('delete', uri, apiHeaders, payload);
2324
2349
  }
2325
- listLogs(paramsOrFirst, ...rest) {
2326
- let params;
2327
- if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
2328
- (paramsOrFirst &&
2329
- typeof paramsOrFirst === 'object' &&
2330
- !Array.isArray(paramsOrFirst))) {
2331
- params = (paramsOrFirst || {});
2332
- }
2333
- else {
2334
- params = {
2335
- queries: paramsOrFirst,
2336
- total: rest[0],
2337
- };
2338
- }
2339
- const queries = params.queries;
2340
- const total = params.total;
2341
- const apiPath = '/account/logs';
2342
- const payload = {};
2343
- if (typeof queries !== 'undefined') {
2344
- payload['queries'] = queries;
2345
- }
2346
- if (typeof total !== 'undefined') {
2347
- payload['total'] = total;
2348
- }
2349
- const uri = new URL(this.client.config.endpoint + apiPath);
2350
- const apiHeaders = {
2351
- 'X-Appwrite-Project': this.client.config.project,
2352
- accept: 'application/json',
2353
- };
2354
- return this.client.call('get', uri, apiHeaders, payload);
2355
- }
2356
2350
  updateMFA(paramsOrFirst) {
2357
2351
  let params;
2358
2352
  if (paramsOrFirst &&
@@ -3272,6 +3266,85 @@ class Account {
3272
3266
  };
3273
3267
  return this.client.call('put', uri, apiHeaders, payload);
3274
3268
  }
3269
+ createRecoveryOTP(paramsOrFirst, ...rest) {
3270
+ let params;
3271
+ if (paramsOrFirst &&
3272
+ typeof paramsOrFirst === 'object' &&
3273
+ !Array.isArray(paramsOrFirst)) {
3274
+ params = (paramsOrFirst || {});
3275
+ }
3276
+ else {
3277
+ params = {
3278
+ email: paramsOrFirst,
3279
+ phrase: rest[0],
3280
+ };
3281
+ }
3282
+ const email = params.email;
3283
+ const phrase = params.phrase;
3284
+ if (typeof email === 'undefined') {
3285
+ throw new AppwriteException('Missing required parameter: "email"');
3286
+ }
3287
+ const apiPath = '/account/recovery/otp';
3288
+ const payload = {};
3289
+ if (typeof email !== 'undefined') {
3290
+ payload['email'] = email;
3291
+ }
3292
+ if (typeof phrase !== 'undefined') {
3293
+ payload['phrase'] = phrase;
3294
+ }
3295
+ const uri = new URL(this.client.config.endpoint + apiPath);
3296
+ const apiHeaders = {
3297
+ 'X-Appwrite-Project': this.client.config.project,
3298
+ 'content-type': 'application/json',
3299
+ accept: 'application/json',
3300
+ };
3301
+ return this.client.call('post', uri, apiHeaders, payload);
3302
+ }
3303
+ updateRecoveryOTP(paramsOrFirst, ...rest) {
3304
+ let params;
3305
+ if (paramsOrFirst &&
3306
+ typeof paramsOrFirst === 'object' &&
3307
+ !Array.isArray(paramsOrFirst)) {
3308
+ params = (paramsOrFirst || {});
3309
+ }
3310
+ else {
3311
+ params = {
3312
+ userId: paramsOrFirst,
3313
+ secret: rest[0],
3314
+ password: rest[1],
3315
+ };
3316
+ }
3317
+ const userId = params.userId;
3318
+ const secret = params.secret;
3319
+ const password = params.password;
3320
+ if (typeof userId === 'undefined') {
3321
+ throw new AppwriteException('Missing required parameter: "userId"');
3322
+ }
3323
+ if (typeof secret === 'undefined') {
3324
+ throw new AppwriteException('Missing required parameter: "secret"');
3325
+ }
3326
+ if (typeof password === 'undefined') {
3327
+ throw new AppwriteException('Missing required parameter: "password"');
3328
+ }
3329
+ const apiPath = '/account/recovery/otp';
3330
+ const payload = {};
3331
+ if (typeof userId !== 'undefined') {
3332
+ payload['userId'] = userId;
3333
+ }
3334
+ if (typeof secret !== 'undefined') {
3335
+ payload['secret'] = secret;
3336
+ }
3337
+ if (typeof password !== 'undefined') {
3338
+ payload['password'] = password;
3339
+ }
3340
+ const uri = new URL(this.client.config.endpoint + apiPath);
3341
+ const apiHeaders = {
3342
+ 'X-Appwrite-Project': this.client.config.project,
3343
+ 'content-type': 'application/json',
3344
+ accept: 'application/json',
3345
+ };
3346
+ return this.client.call('put', uri, apiHeaders, payload);
3347
+ }
3275
3348
  /**
3276
3349
  * Get the list of active sessions across different devices for the currently logged in user.
3277
3350
  *
@@ -3359,6 +3432,69 @@ class Account {
3359
3432
  };
3360
3433
  return this.client.call('post', uri, apiHeaders, payload);
3361
3434
  }
3435
+ createIdTokenSession(paramsOrFirst, ...rest) {
3436
+ let params;
3437
+ if (paramsOrFirst &&
3438
+ typeof paramsOrFirst === 'object' &&
3439
+ !Array.isArray(paramsOrFirst) &&
3440
+ ('provider' in paramsOrFirst ||
3441
+ 'idToken' in paramsOrFirst ||
3442
+ 'nonce' in paramsOrFirst ||
3443
+ 'accessToken' in paramsOrFirst ||
3444
+ 'accessTokenExpiry' in paramsOrFirst ||
3445
+ 'name' in paramsOrFirst)) {
3446
+ params = (paramsOrFirst || {});
3447
+ }
3448
+ else {
3449
+ params = {
3450
+ provider: paramsOrFirst,
3451
+ idToken: rest[0],
3452
+ nonce: rest[1],
3453
+ accessToken: rest[2],
3454
+ accessTokenExpiry: rest[3],
3455
+ name: rest[4],
3456
+ };
3457
+ }
3458
+ const provider = params.provider;
3459
+ const idToken = params.idToken;
3460
+ const nonce = params.nonce;
3461
+ const accessToken = params.accessToken;
3462
+ const accessTokenExpiry = params.accessTokenExpiry;
3463
+ const name = params.name;
3464
+ if (typeof provider === 'undefined') {
3465
+ throw new AppwriteException('Missing required parameter: "provider"');
3466
+ }
3467
+ if (typeof idToken === 'undefined') {
3468
+ throw new AppwriteException('Missing required parameter: "idToken"');
3469
+ }
3470
+ const apiPath = '/account/sessions/id-token';
3471
+ const payload = {};
3472
+ if (typeof provider !== 'undefined') {
3473
+ payload['provider'] = provider;
3474
+ }
3475
+ if (typeof idToken !== 'undefined') {
3476
+ payload['idToken'] = idToken;
3477
+ }
3478
+ if (typeof nonce !== 'undefined') {
3479
+ payload['nonce'] = nonce;
3480
+ }
3481
+ if (typeof accessToken !== 'undefined') {
3482
+ payload['accessToken'] = accessToken;
3483
+ }
3484
+ if (typeof accessTokenExpiry !== 'undefined') {
3485
+ payload['accessTokenExpiry'] = accessTokenExpiry;
3486
+ }
3487
+ if (typeof name !== 'undefined') {
3488
+ payload['name'] = name;
3489
+ }
3490
+ const uri = new URL(this.client.config.endpoint + apiPath);
3491
+ const apiHeaders = {
3492
+ 'X-Appwrite-Project': this.client.config.project,
3493
+ 'content-type': 'application/json',
3494
+ accept: 'application/json',
3495
+ };
3496
+ return this.client.call('post', uri, apiHeaders, payload);
3497
+ }
3362
3498
  updateMagicURLSession(paramsOrFirst, ...rest) {
3363
3499
  let params;
3364
3500
  if (paramsOrFirst &&
@@ -4024,6 +4160,70 @@ class Account {
4024
4160
  };
4025
4161
  return this.client.call('put', uri, apiHeaders, payload);
4026
4162
  }
4163
+ createEmailVerificationOTP(paramsOrFirst) {
4164
+ let params;
4165
+ if (typeof paramsOrFirst === 'undefined' ||
4166
+ (paramsOrFirst &&
4167
+ typeof paramsOrFirst === 'object' &&
4168
+ !Array.isArray(paramsOrFirst))) {
4169
+ params = (paramsOrFirst || {});
4170
+ }
4171
+ else {
4172
+ params = {
4173
+ phrase: paramsOrFirst,
4174
+ };
4175
+ }
4176
+ const phrase = params.phrase;
4177
+ const apiPath = '/account/verifications/email/otp';
4178
+ const payload = {};
4179
+ if (typeof phrase !== 'undefined') {
4180
+ payload['phrase'] = phrase;
4181
+ }
4182
+ const uri = new URL(this.client.config.endpoint + apiPath);
4183
+ const apiHeaders = {
4184
+ 'X-Appwrite-Project': this.client.config.project,
4185
+ 'content-type': 'application/json',
4186
+ accept: 'application/json',
4187
+ };
4188
+ return this.client.call('post', uri, apiHeaders, payload);
4189
+ }
4190
+ updateEmailVerificationOTP(paramsOrFirst, ...rest) {
4191
+ let params;
4192
+ if (paramsOrFirst &&
4193
+ typeof paramsOrFirst === 'object' &&
4194
+ !Array.isArray(paramsOrFirst)) {
4195
+ params = (paramsOrFirst || {});
4196
+ }
4197
+ else {
4198
+ params = {
4199
+ userId: paramsOrFirst,
4200
+ secret: rest[0],
4201
+ };
4202
+ }
4203
+ const userId = params.userId;
4204
+ const secret = params.secret;
4205
+ if (typeof userId === 'undefined') {
4206
+ throw new AppwriteException('Missing required parameter: "userId"');
4207
+ }
4208
+ if (typeof secret === 'undefined') {
4209
+ throw new AppwriteException('Missing required parameter: "secret"');
4210
+ }
4211
+ const apiPath = '/account/verifications/email/otp';
4212
+ const payload = {};
4213
+ if (typeof userId !== 'undefined') {
4214
+ payload['userId'] = userId;
4215
+ }
4216
+ if (typeof secret !== 'undefined') {
4217
+ payload['secret'] = secret;
4218
+ }
4219
+ const uri = new URL(this.client.config.endpoint + apiPath);
4220
+ const apiHeaders = {
4221
+ 'X-Appwrite-Project': this.client.config.project,
4222
+ 'content-type': 'application/json',
4223
+ accept: 'application/json',
4224
+ };
4225
+ return this.client.call('put', uri, apiHeaders, payload);
4226
+ }
4027
4227
  /**
4028
4228
  * Use this endpoint to send a verification SMS to the currently logged in user. This endpoint is meant for use after updating a user's phone number using the [accountUpdatePhone](https://appwrite.io/docs/references/cloud/client-web/account#updatePhone) endpoint. Learn more about how to [complete the verification process](https://appwrite.io/docs/references/cloud/client-web/account#updatePhoneVerification). The verification code sent to the user's phone number is valid for 15 minutes.
4029
4229
  *
@@ -15658,6 +15858,171 @@ class Graphql {
15658
15858
  }
15659
15859
  }
15660
15860
 
15861
+ class Growth {
15862
+ constructor(client) {
15863
+ this.client = client;
15864
+ }
15865
+ createConversation(paramsOrFirst, ...rest) {
15866
+ let params;
15867
+ let onProgress;
15868
+ if (paramsOrFirst &&
15869
+ typeof paramsOrFirst === 'object' &&
15870
+ !Array.isArray(paramsOrFirst) &&
15871
+ ('type' in paramsOrFirst ||
15872
+ 'email' in paramsOrFirst ||
15873
+ 'name' in paramsOrFirst ||
15874
+ 'subject' in paramsOrFirst ||
15875
+ 'message' in paramsOrFirst ||
15876
+ 'organizationId' in paramsOrFirst ||
15877
+ 'projectId' in paramsOrFirst ||
15878
+ 'attributes' in paramsOrFirst ||
15879
+ 'attachment' in paramsOrFirst ||
15880
+ 'onProgress' in paramsOrFirst)) {
15881
+ params = (paramsOrFirst || {});
15882
+ onProgress = paramsOrFirst === null || paramsOrFirst === void 0 ? void 0 : paramsOrFirst.onProgress;
15883
+ }
15884
+ else {
15885
+ params = {
15886
+ type: paramsOrFirst,
15887
+ email: rest[0],
15888
+ name: rest[1],
15889
+ subject: rest[2],
15890
+ message: rest[3],
15891
+ organizationId: rest[4],
15892
+ projectId: rest[5],
15893
+ attributes: rest[6],
15894
+ attachment: rest[7],
15895
+ };
15896
+ onProgress = rest[8];
15897
+ }
15898
+ const type = params.type;
15899
+ const email = params.email;
15900
+ const name = params.name;
15901
+ const subject = params.subject;
15902
+ const message = params.message;
15903
+ const organizationId = params.organizationId;
15904
+ const projectId = params.projectId;
15905
+ const attributes = params.attributes;
15906
+ const attachment = params.attachment;
15907
+ if (typeof type === 'undefined') {
15908
+ throw new AppwriteException('Missing required parameter: "type"');
15909
+ }
15910
+ const apiPath = '/growth/conversations';
15911
+ const payload = {};
15912
+ if (typeof type !== 'undefined') {
15913
+ payload['type'] = type;
15914
+ }
15915
+ if (typeof email !== 'undefined') {
15916
+ payload['email'] = email;
15917
+ }
15918
+ if (typeof name !== 'undefined') {
15919
+ payload['name'] = name;
15920
+ }
15921
+ if (typeof subject !== 'undefined') {
15922
+ payload['subject'] = subject;
15923
+ }
15924
+ if (typeof message !== 'undefined') {
15925
+ payload['message'] = message;
15926
+ }
15927
+ if (typeof organizationId !== 'undefined') {
15928
+ payload['organizationId'] = organizationId;
15929
+ }
15930
+ if (typeof projectId !== 'undefined') {
15931
+ payload['projectId'] = projectId;
15932
+ }
15933
+ if (typeof attributes !== 'undefined') {
15934
+ payload['attributes'] = attributes;
15935
+ }
15936
+ if (typeof attachment !== 'undefined') {
15937
+ payload['attachment'] = attachment;
15938
+ }
15939
+ const uri = new URL(this.client.config.endpoint + apiPath);
15940
+ const apiHeaders = {
15941
+ 'X-Appwrite-Project': this.client.config.project,
15942
+ 'content-type': 'multipart/form-data',
15943
+ accept: 'application/json',
15944
+ };
15945
+ return this.client.chunkedUpload('post', uri, apiHeaders, payload, onProgress);
15946
+ }
15947
+ createInstallation(paramsOrFirst, ...rest) {
15948
+ let params;
15949
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
15950
+ (paramsOrFirst &&
15951
+ typeof paramsOrFirst === 'object' &&
15952
+ !Array.isArray(paramsOrFirst))) {
15953
+ params = (paramsOrFirst || {});
15954
+ }
15955
+ else {
15956
+ params = {
15957
+ email: paramsOrFirst,
15958
+ name: rest[0],
15959
+ version: rest[1],
15960
+ domain: rest[2],
15961
+ database: rest[3],
15962
+ hostIp: rest[4],
15963
+ userAgent: rest[5],
15964
+ os: rest[6],
15965
+ arch: rest[7],
15966
+ cpus: rest[8],
15967
+ ram: rest[9],
15968
+ };
15969
+ }
15970
+ const email = params.email;
15971
+ const name = params.name;
15972
+ const version = params.version;
15973
+ const domain = params.domain;
15974
+ const database = params.database;
15975
+ const hostIp = params.hostIp;
15976
+ const userAgent = params.userAgent;
15977
+ const os = params.os;
15978
+ const arch = params.arch;
15979
+ const cpus = params.cpus;
15980
+ const ram = params.ram;
15981
+ const apiPath = '/growth/installations';
15982
+ const payload = {};
15983
+ if (typeof email !== 'undefined') {
15984
+ payload['email'] = email;
15985
+ }
15986
+ if (typeof name !== 'undefined') {
15987
+ payload['name'] = name;
15988
+ }
15989
+ if (typeof version !== 'undefined') {
15990
+ payload['version'] = version;
15991
+ }
15992
+ if (typeof domain !== 'undefined') {
15993
+ payload['domain'] = domain;
15994
+ }
15995
+ if (typeof database !== 'undefined') {
15996
+ payload['database'] = database;
15997
+ }
15998
+ if (typeof hostIp !== 'undefined') {
15999
+ payload['hostIp'] = hostIp;
16000
+ }
16001
+ if (typeof userAgent !== 'undefined') {
16002
+ payload['userAgent'] = userAgent;
16003
+ }
16004
+ if (typeof os !== 'undefined') {
16005
+ payload['os'] = os;
16006
+ }
16007
+ if (typeof arch !== 'undefined') {
16008
+ payload['arch'] = arch;
16009
+ }
16010
+ if (typeof cpus !== 'undefined') {
16011
+ payload['cpus'] = cpus;
16012
+ }
16013
+ if (typeof ram !== 'undefined') {
16014
+ payload['ram'] = ram;
16015
+ }
16016
+ const uri = new URL(this.client.config.endpoint + apiPath);
16017
+ const apiHeaders = {
16018
+ 'X-Appwrite-Project': this.client.config.project,
16019
+ 'content-type': 'application/json',
16020
+ accept: 'application/json',
16021
+ };
16022
+ return this.client.call('post', uri, apiHeaders, payload);
16023
+ }
16024
+ }
16025
+
15661
16026
  class Locale {
15662
16027
  constructor(client) {
15663
16028
  this.client = client;
@@ -15982,6 +16347,47 @@ class Manager {
15982
16347
  };
15983
16348
  return this.client.call('delete', uri, apiHeaders, payload);
15984
16349
  }
16350
+ updateOrganizationStatus(paramsOrFirst, ...rest) {
16351
+ let params;
16352
+ if (paramsOrFirst &&
16353
+ typeof paramsOrFirst === 'object' &&
16354
+ !Array.isArray(paramsOrFirst)) {
16355
+ params = (paramsOrFirst || {});
16356
+ }
16357
+ else {
16358
+ params = {
16359
+ teamId: paramsOrFirst,
16360
+ status: rest[0],
16361
+ reason: rest[1],
16362
+ };
16363
+ }
16364
+ const teamId = params.teamId;
16365
+ const status = params.status;
16366
+ const reason = params.reason;
16367
+ if (typeof teamId === 'undefined') {
16368
+ throw new AppwriteException('Missing required parameter: "teamId"');
16369
+ }
16370
+ if (typeof status === 'undefined') {
16371
+ throw new AppwriteException('Missing required parameter: "status"');
16372
+ }
16373
+ const apiPath = '/manager/organizations/status';
16374
+ const payload = {};
16375
+ if (typeof teamId !== 'undefined') {
16376
+ payload['teamId'] = teamId;
16377
+ }
16378
+ if (typeof status !== 'undefined') {
16379
+ payload['status'] = status;
16380
+ }
16381
+ if (typeof reason !== 'undefined') {
16382
+ payload['reason'] = reason;
16383
+ }
16384
+ const uri = new URL(this.client.config.endpoint + apiPath);
16385
+ const apiHeaders = {
16386
+ 'content-type': 'application/json',
16387
+ accept: 'application/json',
16388
+ };
16389
+ return this.client.call('patch', uri, apiHeaders, payload);
16390
+ }
15985
16391
  updateUserStatus(paramsOrFirst, ...rest) {
15986
16392
  let params;
15987
16393
  if (paramsOrFirst &&
@@ -16085,9 +16491,11 @@ class Messaging {
16085
16491
  cc: rest[5],
16086
16492
  bcc: rest[6],
16087
16493
  attachments: rest[7],
16088
- draft: rest[8],
16089
- html: rest[9],
16090
- scheduledAt: rest[10],
16494
+ replyToEmail: rest[8],
16495
+ replyToName: rest[9],
16496
+ draft: rest[10],
16497
+ html: rest[11],
16498
+ scheduledAt: rest[12],
16091
16499
  };
16092
16500
  }
16093
16501
  const messageId = params.messageId;
@@ -16099,6 +16507,8 @@ class Messaging {
16099
16507
  const cc = params.cc;
16100
16508
  const bcc = params.bcc;
16101
16509
  const attachments = params.attachments;
16510
+ const replyToEmail = params.replyToEmail;
16511
+ const replyToName = params.replyToName;
16102
16512
  const draft = params.draft;
16103
16513
  const html = params.html;
16104
16514
  const scheduledAt = params.scheduledAt;
@@ -16140,6 +16550,12 @@ class Messaging {
16140
16550
  if (typeof attachments !== 'undefined') {
16141
16551
  payload['attachments'] = attachments;
16142
16552
  }
16553
+ if (typeof replyToEmail !== 'undefined') {
16554
+ payload['replyToEmail'] = replyToEmail;
16555
+ }
16556
+ if (typeof replyToName !== 'undefined') {
16557
+ payload['replyToName'] = replyToName;
16558
+ }
16143
16559
  if (typeof draft !== 'undefined') {
16144
16560
  payload['draft'] = draft;
16145
16561
  }
@@ -16176,8 +16592,10 @@ class Messaging {
16176
16592
  html: rest[6],
16177
16593
  cc: rest[7],
16178
16594
  bcc: rest[8],
16179
- scheduledAt: rest[9],
16180
- attachments: rest[10],
16595
+ replyToEmail: rest[9],
16596
+ replyToName: rest[10],
16597
+ scheduledAt: rest[11],
16598
+ attachments: rest[12],
16181
16599
  };
16182
16600
  }
16183
16601
  const messageId = params.messageId;
@@ -16190,6 +16608,8 @@ class Messaging {
16190
16608
  const html = params.html;
16191
16609
  const cc = params.cc;
16192
16610
  const bcc = params.bcc;
16611
+ const replyToEmail = params.replyToEmail;
16612
+ const replyToName = params.replyToName;
16193
16613
  const scheduledAt = params.scheduledAt;
16194
16614
  const attachments = params.attachments;
16195
16615
  if (typeof messageId === 'undefined' || messageId === '') {
@@ -16224,6 +16644,12 @@ class Messaging {
16224
16644
  if (typeof bcc !== 'undefined') {
16225
16645
  payload['bcc'] = bcc;
16226
16646
  }
16647
+ if (typeof replyToEmail !== 'undefined') {
16648
+ payload['replyToEmail'] = replyToEmail;
16649
+ }
16650
+ if (typeof replyToName !== 'undefined') {
16651
+ payload['replyToName'] = replyToName;
16652
+ }
16227
16653
  if (typeof scheduledAt !== 'undefined') {
16228
16654
  payload['scheduledAt'] = scheduledAt;
16229
16655
  }
@@ -17087,6 +17513,104 @@ class Messaging {
17087
17513
  };
17088
17514
  return this.client.call('patch', uri, apiHeaders, payload);
17089
17515
  }
17516
+ createAppwriteProvider(paramsOrFirst, ...rest) {
17517
+ let params;
17518
+ if (paramsOrFirst &&
17519
+ typeof paramsOrFirst === 'object' &&
17520
+ !Array.isArray(paramsOrFirst)) {
17521
+ params = (paramsOrFirst || {});
17522
+ }
17523
+ else {
17524
+ params = {
17525
+ providerId: paramsOrFirst,
17526
+ name: rest[0],
17527
+ enabled: rest[1],
17528
+ qos: rest[2],
17529
+ expiry: rest[3],
17530
+ };
17531
+ }
17532
+ const providerId = params.providerId;
17533
+ const name = params.name;
17534
+ const enabled = params.enabled;
17535
+ const qos = params.qos;
17536
+ const expiry = params.expiry;
17537
+ if (typeof providerId === 'undefined') {
17538
+ throw new AppwriteException('Missing required parameter: "providerId"');
17539
+ }
17540
+ if (typeof name === 'undefined') {
17541
+ throw new AppwriteException('Missing required parameter: "name"');
17542
+ }
17543
+ const apiPath = '/messaging/providers/appwrite';
17544
+ const payload = {};
17545
+ if (typeof providerId !== 'undefined') {
17546
+ payload['providerId'] = providerId;
17547
+ }
17548
+ if (typeof name !== 'undefined') {
17549
+ payload['name'] = name;
17550
+ }
17551
+ if (typeof enabled !== 'undefined') {
17552
+ payload['enabled'] = enabled;
17553
+ }
17554
+ if (typeof qos !== 'undefined') {
17555
+ payload['qos'] = qos;
17556
+ }
17557
+ if (typeof expiry !== 'undefined') {
17558
+ payload['expiry'] = expiry;
17559
+ }
17560
+ const uri = new URL(this.client.config.endpoint + apiPath);
17561
+ const apiHeaders = {
17562
+ 'X-Appwrite-Project': this.client.config.project,
17563
+ 'content-type': 'application/json',
17564
+ accept: 'application/json',
17565
+ };
17566
+ return this.client.call('post', uri, apiHeaders, payload);
17567
+ }
17568
+ updateAppwriteProvider(paramsOrFirst, ...rest) {
17569
+ let params;
17570
+ if (paramsOrFirst &&
17571
+ typeof paramsOrFirst === 'object' &&
17572
+ !Array.isArray(paramsOrFirst)) {
17573
+ params = (paramsOrFirst || {});
17574
+ }
17575
+ else {
17576
+ params = {
17577
+ providerId: paramsOrFirst,
17578
+ name: rest[0],
17579
+ enabled: rest[1],
17580
+ qos: rest[2],
17581
+ expiry: rest[3],
17582
+ };
17583
+ }
17584
+ const providerId = params.providerId;
17585
+ const name = params.name;
17586
+ const enabled = params.enabled;
17587
+ const qos = params.qos;
17588
+ const expiry = params.expiry;
17589
+ if (typeof providerId === 'undefined' || providerId === '') {
17590
+ throw new AppwriteException('Missing required parameter: "providerId"');
17591
+ }
17592
+ const apiPath = '/messaging/providers/appwrite/{providerId}'.replace('{providerId}', encodeURIComponent(String(providerId)));
17593
+ const payload = {};
17594
+ if (typeof name !== 'undefined') {
17595
+ payload['name'] = name;
17596
+ }
17597
+ if (typeof enabled !== 'undefined') {
17598
+ payload['enabled'] = enabled;
17599
+ }
17600
+ if (typeof qos !== 'undefined') {
17601
+ payload['qos'] = qos;
17602
+ }
17603
+ if (typeof expiry !== 'undefined') {
17604
+ payload['expiry'] = expiry;
17605
+ }
17606
+ const uri = new URL(this.client.config.endpoint + apiPath);
17607
+ const apiHeaders = {
17608
+ 'X-Appwrite-Project': this.client.config.project,
17609
+ 'content-type': 'application/json',
17610
+ accept: 'application/json',
17611
+ };
17612
+ return this.client.call('patch', uri, apiHeaders, payload);
17613
+ }
17090
17614
  createFcmProvider(paramsOrFirst, ...rest) {
17091
17615
  let params;
17092
17616
  if (paramsOrFirst &&
@@ -18836,11 +19360,15 @@ class Messaging {
18836
19360
  topicId: paramsOrFirst,
18837
19361
  name: rest[0],
18838
19362
  subscribe: rest[1],
19363
+ qos: rest[2],
19364
+ expiry: rest[3],
18839
19365
  };
18840
19366
  }
18841
19367
  const topicId = params.topicId;
18842
19368
  const name = params.name;
18843
19369
  const subscribe = params.subscribe;
19370
+ const qos = params.qos;
19371
+ const expiry = params.expiry;
18844
19372
  if (typeof topicId === 'undefined') {
18845
19373
  throw new AppwriteException('Missing required parameter: "topicId"');
18846
19374
  }
@@ -18858,6 +19386,12 @@ class Messaging {
18858
19386
  if (typeof subscribe !== 'undefined') {
18859
19387
  payload['subscribe'] = subscribe;
18860
19388
  }
19389
+ if (typeof qos !== 'undefined') {
19390
+ payload['qos'] = qos;
19391
+ }
19392
+ if (typeof expiry !== 'undefined') {
19393
+ payload['expiry'] = expiry;
19394
+ }
18861
19395
  const uri = new URL(this.client.config.endpoint + apiPath);
18862
19396
  const apiHeaders = {
18863
19397
  'X-Appwrite-Project': this.client.config.project,
@@ -18903,11 +19437,15 @@ class Messaging {
18903
19437
  topicId: paramsOrFirst,
18904
19438
  name: rest[0],
18905
19439
  subscribe: rest[1],
19440
+ qos: rest[2],
19441
+ expiry: rest[3],
18906
19442
  };
18907
19443
  }
18908
19444
  const topicId = params.topicId;
18909
19445
  const name = params.name;
18910
19446
  const subscribe = params.subscribe;
19447
+ const qos = params.qos;
19448
+ const expiry = params.expiry;
18911
19449
  if (typeof topicId === 'undefined' || topicId === '') {
18912
19450
  throw new AppwriteException('Missing required parameter: "topicId"');
18913
19451
  }
@@ -18919,6 +19457,12 @@ class Messaging {
18919
19457
  if (typeof subscribe !== 'undefined') {
18920
19458
  payload['subscribe'] = subscribe;
18921
19459
  }
19460
+ if (typeof qos !== 'undefined') {
19461
+ payload['qos'] = qos;
19462
+ }
19463
+ if (typeof expiry !== 'undefined') {
19464
+ payload['expiry'] = expiry;
19465
+ }
18922
19466
  const uri = new URL(this.client.config.endpoint + apiPath);
18923
19467
  const apiHeaders = {
18924
19468
  'X-Appwrite-Project': this.client.config.project,
@@ -24174,6 +24718,257 @@ class Organization {
24174
24718
  };
24175
24719
  return this.client.call('delete', uri, apiHeaders, payload);
24176
24720
  }
24721
+ listProjectKeys(paramsOrFirst, ...rest) {
24722
+ let params;
24723
+ if (paramsOrFirst &&
24724
+ typeof paramsOrFirst === 'object' &&
24725
+ !Array.isArray(paramsOrFirst)) {
24726
+ params = (paramsOrFirst || {});
24727
+ }
24728
+ else {
24729
+ params = {
24730
+ projectId: paramsOrFirst,
24731
+ queries: rest[0],
24732
+ total: rest[1],
24733
+ };
24734
+ }
24735
+ const projectId = params.projectId;
24736
+ const queries = params.queries;
24737
+ const total = params.total;
24738
+ if (typeof projectId === 'undefined' || projectId === '') {
24739
+ throw new AppwriteException('Missing required parameter: "projectId"');
24740
+ }
24741
+ const apiPath = '/organization/projects/{projectId}/keys'.replace('{projectId}', encodeURIComponent(String(projectId)));
24742
+ const payload = {};
24743
+ if (typeof queries !== 'undefined') {
24744
+ payload['queries'] = queries;
24745
+ }
24746
+ if (typeof total !== 'undefined') {
24747
+ payload['total'] = total;
24748
+ }
24749
+ const uri = new URL(this.client.config.endpoint + apiPath);
24750
+ const apiHeaders = {
24751
+ 'X-Appwrite-Project': this.client.config.project,
24752
+ accept: 'application/json',
24753
+ };
24754
+ return this.client.call('get', uri, apiHeaders, payload);
24755
+ }
24756
+ createProjectKey(paramsOrFirst, ...rest) {
24757
+ let params;
24758
+ if (paramsOrFirst &&
24759
+ typeof paramsOrFirst === 'object' &&
24760
+ !Array.isArray(paramsOrFirst)) {
24761
+ params = (paramsOrFirst || {});
24762
+ }
24763
+ else {
24764
+ params = {
24765
+ projectId: paramsOrFirst,
24766
+ keyId: rest[0],
24767
+ name: rest[1],
24768
+ scopes: rest[2],
24769
+ expire: rest[3],
24770
+ };
24771
+ }
24772
+ const projectId = params.projectId;
24773
+ const keyId = params.keyId;
24774
+ const name = params.name;
24775
+ const scopes = params.scopes;
24776
+ const expire = params.expire;
24777
+ if (typeof projectId === 'undefined' || projectId === '') {
24778
+ throw new AppwriteException('Missing required parameter: "projectId"');
24779
+ }
24780
+ if (typeof keyId === 'undefined') {
24781
+ throw new AppwriteException('Missing required parameter: "keyId"');
24782
+ }
24783
+ if (typeof name === 'undefined') {
24784
+ throw new AppwriteException('Missing required parameter: "name"');
24785
+ }
24786
+ if (typeof scopes === 'undefined') {
24787
+ throw new AppwriteException('Missing required parameter: "scopes"');
24788
+ }
24789
+ const apiPath = '/organization/projects/{projectId}/keys'.replace('{projectId}', encodeURIComponent(String(projectId)));
24790
+ const payload = {};
24791
+ if (typeof keyId !== 'undefined') {
24792
+ payload['keyId'] = keyId;
24793
+ }
24794
+ if (typeof name !== 'undefined') {
24795
+ payload['name'] = name;
24796
+ }
24797
+ if (typeof scopes !== 'undefined') {
24798
+ payload['scopes'] = scopes;
24799
+ }
24800
+ if (typeof expire !== 'undefined') {
24801
+ payload['expire'] = expire;
24802
+ }
24803
+ const uri = new URL(this.client.config.endpoint + apiPath);
24804
+ const apiHeaders = {
24805
+ 'X-Appwrite-Project': this.client.config.project,
24806
+ 'content-type': 'application/json',
24807
+ accept: 'application/json',
24808
+ };
24809
+ return this.client.call('post', uri, apiHeaders, payload);
24810
+ }
24811
+ createEphemeralProjectKey(paramsOrFirst, ...rest) {
24812
+ let params;
24813
+ if (paramsOrFirst &&
24814
+ typeof paramsOrFirst === 'object' &&
24815
+ !Array.isArray(paramsOrFirst)) {
24816
+ params = (paramsOrFirst || {});
24817
+ }
24818
+ else {
24819
+ params = {
24820
+ projectId: paramsOrFirst,
24821
+ scopes: rest[0],
24822
+ duration: rest[1],
24823
+ };
24824
+ }
24825
+ const projectId = params.projectId;
24826
+ const scopes = params.scopes;
24827
+ const duration = params.duration;
24828
+ if (typeof projectId === 'undefined' || projectId === '') {
24829
+ throw new AppwriteException('Missing required parameter: "projectId"');
24830
+ }
24831
+ if (typeof scopes === 'undefined') {
24832
+ throw new AppwriteException('Missing required parameter: "scopes"');
24833
+ }
24834
+ if (typeof duration === 'undefined') {
24835
+ throw new AppwriteException('Missing required parameter: "duration"');
24836
+ }
24837
+ const apiPath = '/organization/projects/{projectId}/keys/ephemeral'.replace('{projectId}', encodeURIComponent(String(projectId)));
24838
+ const payload = {};
24839
+ if (typeof scopes !== 'undefined') {
24840
+ payload['scopes'] = scopes;
24841
+ }
24842
+ if (typeof duration !== 'undefined') {
24843
+ payload['duration'] = duration;
24844
+ }
24845
+ const uri = new URL(this.client.config.endpoint + apiPath);
24846
+ const apiHeaders = {
24847
+ 'X-Appwrite-Project': this.client.config.project,
24848
+ 'content-type': 'application/json',
24849
+ accept: 'application/json',
24850
+ };
24851
+ return this.client.call('post', uri, apiHeaders, payload);
24852
+ }
24853
+ getProjectKey(paramsOrFirst, ...rest) {
24854
+ let params;
24855
+ if (paramsOrFirst &&
24856
+ typeof paramsOrFirst === 'object' &&
24857
+ !Array.isArray(paramsOrFirst)) {
24858
+ params = (paramsOrFirst || {});
24859
+ }
24860
+ else {
24861
+ params = {
24862
+ projectId: paramsOrFirst,
24863
+ keyId: rest[0],
24864
+ };
24865
+ }
24866
+ const projectId = params.projectId;
24867
+ const keyId = params.keyId;
24868
+ if (typeof projectId === 'undefined' || projectId === '') {
24869
+ throw new AppwriteException('Missing required parameter: "projectId"');
24870
+ }
24871
+ if (typeof keyId === 'undefined' || keyId === '') {
24872
+ throw new AppwriteException('Missing required parameter: "keyId"');
24873
+ }
24874
+ const apiPath = '/organization/projects/{projectId}/keys/{keyId}'
24875
+ .replace('{projectId}', encodeURIComponent(String(projectId)))
24876
+ .replace('{keyId}', encodeURIComponent(String(keyId)));
24877
+ const payload = {};
24878
+ const uri = new URL(this.client.config.endpoint + apiPath);
24879
+ const apiHeaders = {
24880
+ 'X-Appwrite-Project': this.client.config.project,
24881
+ accept: 'application/json',
24882
+ };
24883
+ return this.client.call('get', uri, apiHeaders, payload);
24884
+ }
24885
+ updateProjectKey(paramsOrFirst, ...rest) {
24886
+ let params;
24887
+ if (paramsOrFirst &&
24888
+ typeof paramsOrFirst === 'object' &&
24889
+ !Array.isArray(paramsOrFirst)) {
24890
+ params = (paramsOrFirst || {});
24891
+ }
24892
+ else {
24893
+ params = {
24894
+ projectId: paramsOrFirst,
24895
+ keyId: rest[0],
24896
+ name: rest[1],
24897
+ scopes: rest[2],
24898
+ expire: rest[3],
24899
+ };
24900
+ }
24901
+ const projectId = params.projectId;
24902
+ const keyId = params.keyId;
24903
+ const name = params.name;
24904
+ const scopes = params.scopes;
24905
+ const expire = params.expire;
24906
+ if (typeof projectId === 'undefined' || projectId === '') {
24907
+ throw new AppwriteException('Missing required parameter: "projectId"');
24908
+ }
24909
+ if (typeof keyId === 'undefined' || keyId === '') {
24910
+ throw new AppwriteException('Missing required parameter: "keyId"');
24911
+ }
24912
+ if (typeof name === 'undefined') {
24913
+ throw new AppwriteException('Missing required parameter: "name"');
24914
+ }
24915
+ if (typeof scopes === 'undefined') {
24916
+ throw new AppwriteException('Missing required parameter: "scopes"');
24917
+ }
24918
+ const apiPath = '/organization/projects/{projectId}/keys/{keyId}'
24919
+ .replace('{projectId}', encodeURIComponent(String(projectId)))
24920
+ .replace('{keyId}', encodeURIComponent(String(keyId)));
24921
+ const payload = {};
24922
+ if (typeof name !== 'undefined') {
24923
+ payload['name'] = name;
24924
+ }
24925
+ if (typeof scopes !== 'undefined') {
24926
+ payload['scopes'] = scopes;
24927
+ }
24928
+ if (typeof expire !== 'undefined') {
24929
+ payload['expire'] = expire;
24930
+ }
24931
+ const uri = new URL(this.client.config.endpoint + apiPath);
24932
+ const apiHeaders = {
24933
+ 'X-Appwrite-Project': this.client.config.project,
24934
+ 'content-type': 'application/json',
24935
+ accept: 'application/json',
24936
+ };
24937
+ return this.client.call('put', uri, apiHeaders, payload);
24938
+ }
24939
+ deleteProjectKey(paramsOrFirst, ...rest) {
24940
+ let params;
24941
+ if (paramsOrFirst &&
24942
+ typeof paramsOrFirst === 'object' &&
24943
+ !Array.isArray(paramsOrFirst)) {
24944
+ params = (paramsOrFirst || {});
24945
+ }
24946
+ else {
24947
+ params = {
24948
+ projectId: paramsOrFirst,
24949
+ keyId: rest[0],
24950
+ };
24951
+ }
24952
+ const projectId = params.projectId;
24953
+ const keyId = params.keyId;
24954
+ if (typeof projectId === 'undefined' || projectId === '') {
24955
+ throw new AppwriteException('Missing required parameter: "projectId"');
24956
+ }
24957
+ if (typeof keyId === 'undefined' || keyId === '') {
24958
+ throw new AppwriteException('Missing required parameter: "keyId"');
24959
+ }
24960
+ const apiPath = '/organization/projects/{projectId}/keys/{keyId}'
24961
+ .replace('{projectId}', encodeURIComponent(String(projectId)))
24962
+ .replace('{keyId}', encodeURIComponent(String(keyId)));
24963
+ const payload = {};
24964
+ const uri = new URL(this.client.config.endpoint + apiPath);
24965
+ const apiHeaders = {
24966
+ 'X-Appwrite-Project': this.client.config.project,
24967
+ 'content-type': 'application/json',
24968
+ accept: 'application/json',
24969
+ };
24970
+ return this.client.call('delete', uri, apiHeaders, payload);
24971
+ }
24177
24972
  }
24178
24973
 
24179
24974
  class Organizations {
@@ -25503,32 +26298,6 @@ class Organizations {
25503
26298
  };
25504
26299
  return this.client.call('patch', uri, apiHeaders, payload);
25505
26300
  }
25506
- cancelDowngrade(paramsOrFirst) {
25507
- let params;
25508
- if (paramsOrFirst &&
25509
- typeof paramsOrFirst === 'object' &&
25510
- !Array.isArray(paramsOrFirst)) {
25511
- params = (paramsOrFirst || {});
25512
- }
25513
- else {
25514
- params = {
25515
- organizationId: paramsOrFirst,
25516
- };
25517
- }
25518
- const organizationId = params.organizationId;
25519
- if (typeof organizationId === 'undefined' || organizationId === '') {
25520
- throw new AppwriteException('Missing required parameter: "organizationId"');
25521
- }
25522
- const apiPath = '/organizations/{organizationId}/plan/cancel'.replace('{organizationId}', encodeURIComponent(String(organizationId)));
25523
- const payload = {};
25524
- const uri = new URL(this.client.config.endpoint + apiPath);
25525
- const apiHeaders = {
25526
- 'X-Appwrite-Project': this.client.config.project,
25527
- 'content-type': 'application/json',
25528
- accept: 'application/json',
25529
- };
25530
- return this.client.call('patch', uri, apiHeaders, payload);
25531
- }
25532
26301
  createPlanEstimation(paramsOrFirst, ...rest) {
25533
26302
  let params;
25534
26303
  if (paramsOrFirst &&
@@ -28082,14 +28851,18 @@ class Project {
28082
28851
  keyId: rest[0],
28083
28852
  teamId: rest[1],
28084
28853
  p8File: rest[2],
28085
- enabled: rest[3],
28854
+ nativeClientIds: rest[3],
28855
+ enabled: rest[4],
28856
+ nativeEnabled: rest[5],
28086
28857
  };
28087
28858
  }
28088
28859
  const serviceId = params.serviceId;
28089
28860
  const keyId = params.keyId;
28090
28861
  const teamId = params.teamId;
28091
28862
  const p8File = params.p8File;
28863
+ const nativeClientIds = params.nativeClientIds;
28092
28864
  const enabled = params.enabled;
28865
+ const nativeEnabled = params.nativeEnabled;
28093
28866
  const apiPath = '/project/oauth2/apple';
28094
28867
  const payload = {};
28095
28868
  if (typeof serviceId !== 'undefined') {
@@ -28104,9 +28877,15 @@ class Project {
28104
28877
  if (typeof p8File !== 'undefined') {
28105
28878
  payload['p8File'] = p8File;
28106
28879
  }
28880
+ if (typeof nativeClientIds !== 'undefined') {
28881
+ payload['nativeClientIds'] = nativeClientIds;
28882
+ }
28107
28883
  if (typeof enabled !== 'undefined') {
28108
28884
  payload['enabled'] = enabled;
28109
28885
  }
28886
+ if (typeof nativeEnabled !== 'undefined') {
28887
+ payload['nativeEnabled'] = nativeEnabled;
28888
+ }
28110
28889
  const uri = new URL(this.client.config.endpoint + apiPath);
28111
28890
  const apiHeaders = {
28112
28891
  'X-Appwrite-Project': this.client.config.project,
@@ -28165,12 +28944,14 @@ class Project {
28165
28944
  clientId: paramsOrFirst,
28166
28945
  clientSecret: rest[0],
28167
28946
  endpoint: rest[1],
28168
- enabled: rest[2],
28947
+ prompt: rest[2],
28948
+ enabled: rest[3],
28169
28949
  };
28170
28950
  }
28171
28951
  const clientId = params.clientId;
28172
28952
  const clientSecret = params.clientSecret;
28173
28953
  const endpoint = params.endpoint;
28954
+ const prompt = params.prompt;
28174
28955
  const enabled = params.enabled;
28175
28956
  const apiPath = '/project/oauth2/auth0';
28176
28957
  const payload = {};
@@ -28183,6 +28964,9 @@ class Project {
28183
28964
  if (typeof endpoint !== 'undefined') {
28184
28965
  payload['endpoint'] = endpoint;
28185
28966
  }
28967
+ if (typeof prompt !== 'undefined') {
28968
+ payload['prompt'] = prompt;
28969
+ }
28186
28970
  if (typeof enabled !== 'undefined') {
28187
28971
  payload['enabled'] = enabled;
28188
28972
  }
@@ -28470,11 +29254,13 @@ class Project {
28470
29254
  params = {
28471
29255
  clientId: paramsOrFirst,
28472
29256
  clientSecret: rest[0],
28473
- enabled: rest[1],
29257
+ prompt: rest[1],
29258
+ enabled: rest[2],
28474
29259
  };
28475
29260
  }
28476
29261
  const clientId = params.clientId;
28477
29262
  const clientSecret = params.clientSecret;
29263
+ const prompt = params.prompt;
28478
29264
  const enabled = params.enabled;
28479
29265
  const apiPath = '/project/oauth2/discord';
28480
29266
  const payload = {};
@@ -28484,6 +29270,9 @@ class Project {
28484
29270
  if (typeof clientSecret !== 'undefined') {
28485
29271
  payload['clientSecret'] = clientSecret;
28486
29272
  }
29273
+ if (typeof prompt !== 'undefined') {
29274
+ payload['prompt'] = prompt;
29275
+ }
28487
29276
  if (typeof enabled !== 'undefined') {
28488
29277
  payload['enabled'] = enabled;
28489
29278
  }
@@ -28734,11 +29523,13 @@ class Project {
28734
29523
  params = {
28735
29524
  clientId: paramsOrFirst,
28736
29525
  clientSecret: rest[0],
28737
- enabled: rest[1],
29526
+ prompt: rest[1],
29527
+ enabled: rest[2],
28738
29528
  };
28739
29529
  }
28740
29530
  const clientId = params.clientId;
28741
29531
  const clientSecret = params.clientSecret;
29532
+ const prompt = params.prompt;
28742
29533
  const enabled = params.enabled;
28743
29534
  const apiPath = '/project/oauth2/github';
28744
29535
  const payload = {};
@@ -28748,6 +29539,9 @@ class Project {
28748
29539
  if (typeof clientSecret !== 'undefined') {
28749
29540
  payload['clientSecret'] = clientSecret;
28750
29541
  }
29542
+ if (typeof prompt !== 'undefined') {
29543
+ payload['prompt'] = prompt;
29544
+ }
28751
29545
  if (typeof enabled !== 'undefined') {
28752
29546
  payload['enabled'] = enabled;
28753
29547
  }
@@ -28814,13 +29608,17 @@ class Project {
28814
29608
  clientId: paramsOrFirst,
28815
29609
  clientSecret: rest[0],
28816
29610
  prompt: rest[1],
28817
- enabled: rest[2],
29611
+ nativeClientIds: rest[2],
29612
+ enabled: rest[3],
29613
+ nativeEnabled: rest[4],
28818
29614
  };
28819
29615
  }
28820
29616
  const clientId = params.clientId;
28821
29617
  const clientSecret = params.clientSecret;
28822
29618
  const prompt = params.prompt;
29619
+ const nativeClientIds = params.nativeClientIds;
28823
29620
  const enabled = params.enabled;
29621
+ const nativeEnabled = params.nativeEnabled;
28824
29622
  const apiPath = '/project/oauth2/google';
28825
29623
  const payload = {};
28826
29624
  if (typeof clientId !== 'undefined') {
@@ -28832,9 +29630,15 @@ class Project {
28832
29630
  if (typeof prompt !== 'undefined') {
28833
29631
  payload['prompt'] = prompt;
28834
29632
  }
29633
+ if (typeof nativeClientIds !== 'undefined') {
29634
+ payload['nativeClientIds'] = nativeClientIds;
29635
+ }
28835
29636
  if (typeof enabled !== 'undefined') {
28836
29637
  payload['enabled'] = enabled;
28837
29638
  }
29639
+ if (typeof nativeEnabled !== 'undefined') {
29640
+ payload['nativeEnabled'] = nativeEnabled;
29641
+ }
28838
29642
  const uri = new URL(this.client.config.endpoint + apiPath);
28839
29643
  const apiHeaders = {
28840
29644
  'X-Appwrite-Project': this.client.config.project,
@@ -28892,11 +29696,13 @@ class Project {
28892
29696
  params = {
28893
29697
  clientId: paramsOrFirst,
28894
29698
  clientSecret: rest[0],
28895
- enabled: rest[1],
29699
+ prompt: rest[1],
29700
+ enabled: rest[2],
28896
29701
  };
28897
29702
  }
28898
29703
  const clientId = params.clientId;
28899
29704
  const clientSecret = params.clientSecret;
29705
+ const prompt = params.prompt;
28900
29706
  const enabled = params.enabled;
28901
29707
  const apiPath = '/project/oauth2/kakao';
28902
29708
  const payload = {};
@@ -28906,6 +29712,9 @@ class Project {
28906
29712
  if (typeof clientSecret !== 'undefined') {
28907
29713
  payload['clientSecret'] = clientSecret;
28908
29714
  }
29715
+ if (typeof prompt !== 'undefined') {
29716
+ payload['prompt'] = prompt;
29717
+ }
28909
29718
  if (typeof enabled !== 'undefined') {
28910
29719
  payload['enabled'] = enabled;
28911
29720
  }
@@ -29051,12 +29860,14 @@ class Project {
29051
29860
  applicationId: paramsOrFirst,
29052
29861
  applicationSecret: rest[0],
29053
29862
  tenant: rest[1],
29054
- enabled: rest[2],
29863
+ prompt: rest[2],
29864
+ enabled: rest[3],
29055
29865
  };
29056
29866
  }
29057
29867
  const applicationId = params.applicationId;
29058
29868
  const applicationSecret = params.applicationSecret;
29059
29869
  const tenant = params.tenant;
29870
+ const prompt = params.prompt;
29060
29871
  const enabled = params.enabled;
29061
29872
  const apiPath = '/project/oauth2/microsoft';
29062
29873
  const payload = {};
@@ -29069,6 +29880,9 @@ class Project {
29069
29880
  if (typeof tenant !== 'undefined') {
29070
29881
  payload['tenant'] = tenant;
29071
29882
  }
29883
+ if (typeof prompt !== 'undefined') {
29884
+ payload['prompt'] = prompt;
29885
+ }
29072
29886
  if (typeof enabled !== 'undefined') {
29073
29887
  payload['enabled'] = enabled;
29074
29888
  }
@@ -29198,13 +30012,15 @@ class Project {
29198
30012
  clientSecret: rest[0],
29199
30013
  domain: rest[1],
29200
30014
  authorizationServerId: rest[2],
29201
- enabled: rest[3],
30015
+ prompt: rest[3],
30016
+ enabled: rest[4],
29202
30017
  };
29203
30018
  }
29204
30019
  const clientId = params.clientId;
29205
30020
  const clientSecret = params.clientSecret;
29206
30021
  const domain = params.domain;
29207
30022
  const authorizationServerId = params.authorizationServerId;
30023
+ const prompt = params.prompt;
29208
30024
  const enabled = params.enabled;
29209
30025
  const apiPath = '/project/oauth2/okta';
29210
30026
  const payload = {};
@@ -29220,6 +30036,9 @@ class Project {
29220
30036
  if (typeof authorizationServerId !== 'undefined') {
29221
30037
  payload['authorizationServerId'] = authorizationServerId;
29222
30038
  }
30039
+ if (typeof prompt !== 'undefined') {
30040
+ payload['prompt'] = prompt;
30041
+ }
29223
30042
  if (typeof enabled !== 'undefined') {
29224
30043
  payload['enabled'] = enabled;
29225
30044
  }
@@ -29391,11 +30210,13 @@ class Project {
29391
30210
  params = {
29392
30211
  customerKey: paramsOrFirst,
29393
30212
  customerSecret: rest[0],
29394
- enabled: rest[1],
30213
+ prompt: rest[1],
30214
+ enabled: rest[2],
29395
30215
  };
29396
30216
  }
29397
30217
  const customerKey = params.customerKey;
29398
30218
  const customerSecret = params.customerSecret;
30219
+ const prompt = params.prompt;
29399
30220
  const enabled = params.enabled;
29400
30221
  const apiPath = '/project/oauth2/salesforce';
29401
30222
  const payload = {};
@@ -29405,6 +30226,9 @@ class Project {
29405
30226
  if (typeof customerSecret !== 'undefined') {
29406
30227
  payload['customerSecret'] = customerSecret;
29407
30228
  }
30229
+ if (typeof prompt !== 'undefined') {
30230
+ payload['prompt'] = prompt;
30231
+ }
29408
30232
  if (typeof enabled !== 'undefined') {
29409
30233
  payload['enabled'] = enabled;
29410
30234
  }
@@ -29835,11 +30659,13 @@ class Project {
29835
30659
  params = {
29836
30660
  clientId: paramsOrFirst,
29837
30661
  clientSecret: rest[0],
29838
- enabled: rest[1],
30662
+ prompt: rest[1],
30663
+ enabled: rest[2],
29839
30664
  };
29840
30665
  }
29841
30666
  const clientId = params.clientId;
29842
30667
  const clientSecret = params.clientSecret;
30668
+ const prompt = params.prompt;
29843
30669
  const enabled = params.enabled;
29844
30670
  const apiPath = '/project/oauth2/zoho';
29845
30671
  const payload = {};
@@ -29849,6 +30675,9 @@ class Project {
29849
30675
  if (typeof clientSecret !== 'undefined') {
29850
30676
  payload['clientSecret'] = clientSecret;
29851
30677
  }
30678
+ if (typeof prompt !== 'undefined') {
30679
+ payload['prompt'] = prompt;
30680
+ }
29852
30681
  if (typeof enabled !== 'undefined') {
29853
30682
  payload['enabled'] = enabled;
29854
30683
  }
@@ -30768,6 +31597,43 @@ class Project {
30768
31597
  };
30769
31598
  return this.client.call('patch', uri, apiHeaders, payload);
30770
31599
  }
31600
+ updatePasswordPwnedPolicy(paramsOrFirst, ...rest) {
31601
+ let params;
31602
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
31603
+ (paramsOrFirst &&
31604
+ typeof paramsOrFirst === 'object' &&
31605
+ !Array.isArray(paramsOrFirst))) {
31606
+ params = (paramsOrFirst || {});
31607
+ }
31608
+ else {
31609
+ params = {
31610
+ enabled: paramsOrFirst,
31611
+ sessions: rest[0],
31612
+ users: rest[1],
31613
+ };
31614
+ }
31615
+ const enabled = params.enabled;
31616
+ const sessions = params.sessions;
31617
+ const users = params.users;
31618
+ const apiPath = '/project/policies/password-pwned';
31619
+ const payload = {};
31620
+ if (typeof enabled !== 'undefined') {
31621
+ payload['enabled'] = enabled;
31622
+ }
31623
+ if (typeof sessions !== 'undefined') {
31624
+ payload['sessions'] = sessions;
31625
+ }
31626
+ if (typeof users !== 'undefined') {
31627
+ payload['users'] = users;
31628
+ }
31629
+ const uri = new URL(this.client.config.endpoint + apiPath);
31630
+ const apiHeaders = {
31631
+ 'X-Appwrite-Project': this.client.config.project,
31632
+ 'content-type': 'application/json',
31633
+ accept: 'application/json',
31634
+ };
31635
+ return this.client.call('patch', uri, apiHeaders, payload);
31636
+ }
30771
31637
  updatePasswordStrengthPolicy(paramsOrFirst, ...rest) {
30772
31638
  let params;
30773
31639
  if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
@@ -31291,47 +32157,6 @@ class Project {
31291
32157
  };
31292
32158
  return this.client.call('get', uri, apiHeaders, payload);
31293
32159
  }
31294
- getUsage(paramsOrFirst, ...rest) {
31295
- let params;
31296
- if (paramsOrFirst &&
31297
- typeof paramsOrFirst === 'object' &&
31298
- !Array.isArray(paramsOrFirst)) {
31299
- params = (paramsOrFirst || {});
31300
- }
31301
- else {
31302
- params = {
31303
- startDate: paramsOrFirst,
31304
- endDate: rest[0],
31305
- period: rest[1],
31306
- };
31307
- }
31308
- const startDate = params.startDate;
31309
- const endDate = params.endDate;
31310
- const period = params.period;
31311
- if (typeof startDate === 'undefined') {
31312
- throw new AppwriteException('Missing required parameter: "startDate"');
31313
- }
31314
- if (typeof endDate === 'undefined') {
31315
- throw new AppwriteException('Missing required parameter: "endDate"');
31316
- }
31317
- const apiPath = '/project/usage';
31318
- const payload = {};
31319
- if (typeof startDate !== 'undefined') {
31320
- payload['startDate'] = startDate;
31321
- }
31322
- if (typeof endDate !== 'undefined') {
31323
- payload['endDate'] = endDate;
31324
- }
31325
- if (typeof period !== 'undefined') {
31326
- payload['period'] = period;
31327
- }
31328
- const uri = new URL(this.client.config.endpoint + apiPath);
31329
- const apiHeaders = {
31330
- 'X-Appwrite-Project': this.client.config.project,
31331
- accept: 'application/json',
31332
- };
31333
- return this.client.call('get', uri, apiHeaders, payload);
31334
- }
31335
32160
  listVariables(paramsOrFirst, ...rest) {
31336
32161
  let params;
31337
32162
  if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
@@ -31718,150 +32543,6 @@ class Projects {
31718
32543
  };
31719
32544
  return this.client.call('patch', uri, apiHeaders, payload);
31720
32545
  }
31721
- listDevKeys(paramsOrFirst, ...rest) {
31722
- let params;
31723
- if (paramsOrFirst &&
31724
- typeof paramsOrFirst === 'object' &&
31725
- !Array.isArray(paramsOrFirst)) {
31726
- params = (paramsOrFirst || {});
31727
- }
31728
- else {
31729
- params = {
31730
- projectId: paramsOrFirst,
31731
- queries: rest[0],
31732
- };
31733
- }
31734
- const projectId = params.projectId;
31735
- const queries = params.queries;
31736
- if (typeof projectId === 'undefined' || projectId === '') {
31737
- throw new AppwriteException('Missing required parameter: "projectId"');
31738
- }
31739
- const apiPath = '/projects/{projectId}/dev-keys'.replace('{projectId}', encodeURIComponent(String(projectId)));
31740
- const payload = {};
31741
- if (typeof queries !== 'undefined') {
31742
- payload['queries'] = queries;
31743
- }
31744
- const uri = new URL(this.client.config.endpoint + apiPath);
31745
- const apiHeaders = {
31746
- 'X-Appwrite-Project': this.client.config.project,
31747
- accept: 'application/json',
31748
- };
31749
- return this.client.call('get', uri, apiHeaders, payload);
31750
- }
31751
- getDevKey(paramsOrFirst, ...rest) {
31752
- let params;
31753
- if (paramsOrFirst &&
31754
- typeof paramsOrFirst === 'object' &&
31755
- !Array.isArray(paramsOrFirst)) {
31756
- params = (paramsOrFirst || {});
31757
- }
31758
- else {
31759
- params = {
31760
- projectId: paramsOrFirst,
31761
- keyId: rest[0],
31762
- };
31763
- }
31764
- const projectId = params.projectId;
31765
- const keyId = params.keyId;
31766
- if (typeof projectId === 'undefined' || projectId === '') {
31767
- throw new AppwriteException('Missing required parameter: "projectId"');
31768
- }
31769
- if (typeof keyId === 'undefined' || keyId === '') {
31770
- throw new AppwriteException('Missing required parameter: "keyId"');
31771
- }
31772
- const apiPath = '/projects/{projectId}/dev-keys/{keyId}'
31773
- .replace('{projectId}', encodeURIComponent(String(projectId)))
31774
- .replace('{keyId}', encodeURIComponent(String(keyId)));
31775
- const payload = {};
31776
- const uri = new URL(this.client.config.endpoint + apiPath);
31777
- const apiHeaders = {
31778
- 'X-Appwrite-Project': this.client.config.project,
31779
- accept: 'application/json',
31780
- };
31781
- return this.client.call('get', uri, apiHeaders, payload);
31782
- }
31783
- updateDevKey(paramsOrFirst, ...rest) {
31784
- let params;
31785
- if (paramsOrFirst &&
31786
- typeof paramsOrFirst === 'object' &&
31787
- !Array.isArray(paramsOrFirst)) {
31788
- params = (paramsOrFirst || {});
31789
- }
31790
- else {
31791
- params = {
31792
- projectId: paramsOrFirst,
31793
- keyId: rest[0],
31794
- name: rest[1],
31795
- expire: rest[2],
31796
- };
31797
- }
31798
- const projectId = params.projectId;
31799
- const keyId = params.keyId;
31800
- const name = params.name;
31801
- const expire = params.expire;
31802
- if (typeof projectId === 'undefined' || projectId === '') {
31803
- throw new AppwriteException('Missing required parameter: "projectId"');
31804
- }
31805
- if (typeof keyId === 'undefined' || keyId === '') {
31806
- throw new AppwriteException('Missing required parameter: "keyId"');
31807
- }
31808
- if (typeof name === 'undefined') {
31809
- throw new AppwriteException('Missing required parameter: "name"');
31810
- }
31811
- if (typeof expire === 'undefined') {
31812
- throw new AppwriteException('Missing required parameter: "expire"');
31813
- }
31814
- const apiPath = '/projects/{projectId}/dev-keys/{keyId}'
31815
- .replace('{projectId}', encodeURIComponent(String(projectId)))
31816
- .replace('{keyId}', encodeURIComponent(String(keyId)));
31817
- const payload = {};
31818
- if (typeof name !== 'undefined') {
31819
- payload['name'] = name;
31820
- }
31821
- if (typeof expire !== 'undefined') {
31822
- payload['expire'] = expire;
31823
- }
31824
- const uri = new URL(this.client.config.endpoint + apiPath);
31825
- const apiHeaders = {
31826
- 'X-Appwrite-Project': this.client.config.project,
31827
- 'content-type': 'application/json',
31828
- accept: 'application/json',
31829
- };
31830
- return this.client.call('put', uri, apiHeaders, payload);
31831
- }
31832
- deleteDevKey(paramsOrFirst, ...rest) {
31833
- let params;
31834
- if (paramsOrFirst &&
31835
- typeof paramsOrFirst === 'object' &&
31836
- !Array.isArray(paramsOrFirst)) {
31837
- params = (paramsOrFirst || {});
31838
- }
31839
- else {
31840
- params = {
31841
- projectId: paramsOrFirst,
31842
- keyId: rest[0],
31843
- };
31844
- }
31845
- const projectId = params.projectId;
31846
- const keyId = params.keyId;
31847
- if (typeof projectId === 'undefined' || projectId === '') {
31848
- throw new AppwriteException('Missing required parameter: "projectId"');
31849
- }
31850
- if (typeof keyId === 'undefined' || keyId === '') {
31851
- throw new AppwriteException('Missing required parameter: "keyId"');
31852
- }
31853
- const apiPath = '/projects/{projectId}/dev-keys/{keyId}'
31854
- .replace('{projectId}', encodeURIComponent(String(projectId)))
31855
- .replace('{keyId}', encodeURIComponent(String(keyId)));
31856
- const payload = {};
31857
- const uri = new URL(this.client.config.endpoint + apiPath);
31858
- const apiHeaders = {
31859
- 'X-Appwrite-Project': this.client.config.project,
31860
- 'content-type': 'application/json',
31861
- accept: 'application/json',
31862
- };
31863
- return this.client.call('delete', uri, apiHeaders, payload);
31864
- }
31865
32546
  listSchedules(paramsOrFirst, ...rest) {
31866
32547
  let params;
31867
32548
  if (paramsOrFirst &&
@@ -37084,6 +37765,55 @@ class TablesDB {
37084
37765
  };
37085
37766
  return this.client.call('post', uri, apiHeaders, payload);
37086
37767
  }
37768
+ updateRelationshipColumn(paramsOrFirst, ...rest) {
37769
+ let params;
37770
+ if (paramsOrFirst &&
37771
+ typeof paramsOrFirst === 'object' &&
37772
+ !Array.isArray(paramsOrFirst)) {
37773
+ params = (paramsOrFirst || {});
37774
+ }
37775
+ else {
37776
+ params = {
37777
+ databaseId: paramsOrFirst,
37778
+ tableId: rest[0],
37779
+ key: rest[1],
37780
+ onDelete: rest[2],
37781
+ newKey: rest[3],
37782
+ };
37783
+ }
37784
+ const databaseId = params.databaseId;
37785
+ const tableId = params.tableId;
37786
+ const key = params.key;
37787
+ const onDelete = params.onDelete;
37788
+ const newKey = params.newKey;
37789
+ if (typeof databaseId === 'undefined' || databaseId === '') {
37790
+ throw new AppwriteException('Missing required parameter: "databaseId"');
37791
+ }
37792
+ if (typeof tableId === 'undefined' || tableId === '') {
37793
+ throw new AppwriteException('Missing required parameter: "tableId"');
37794
+ }
37795
+ if (typeof key === 'undefined' || key === '') {
37796
+ throw new AppwriteException('Missing required parameter: "key"');
37797
+ }
37798
+ const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/relationship/{key}'
37799
+ .replace('{databaseId}', encodeURIComponent(String(databaseId)))
37800
+ .replace('{tableId}', encodeURIComponent(String(tableId)))
37801
+ .replace('{key}', encodeURIComponent(String(key)));
37802
+ const payload = {};
37803
+ if (typeof onDelete !== 'undefined') {
37804
+ payload['onDelete'] = onDelete;
37805
+ }
37806
+ if (typeof newKey !== 'undefined') {
37807
+ payload['newKey'] = newKey;
37808
+ }
37809
+ const uri = new URL(this.client.config.endpoint + apiPath);
37810
+ const apiHeaders = {
37811
+ 'X-Appwrite-Project': this.client.config.project,
37812
+ 'content-type': 'application/json',
37813
+ accept: 'application/json',
37814
+ };
37815
+ return this.client.call('patch', uri, apiHeaders, payload);
37816
+ }
37087
37817
  createStringColumn(paramsOrFirst, ...rest) {
37088
37818
  let params;
37089
37819
  if (paramsOrFirst &&
@@ -37678,55 +38408,6 @@ class TablesDB {
37678
38408
  };
37679
38409
  return this.client.call('delete', uri, apiHeaders, payload);
37680
38410
  }
37681
- updateRelationshipColumn(paramsOrFirst, ...rest) {
37682
- let params;
37683
- if (paramsOrFirst &&
37684
- typeof paramsOrFirst === 'object' &&
37685
- !Array.isArray(paramsOrFirst)) {
37686
- params = (paramsOrFirst || {});
37687
- }
37688
- else {
37689
- params = {
37690
- databaseId: paramsOrFirst,
37691
- tableId: rest[0],
37692
- key: rest[1],
37693
- onDelete: rest[2],
37694
- newKey: rest[3],
37695
- };
37696
- }
37697
- const databaseId = params.databaseId;
37698
- const tableId = params.tableId;
37699
- const key = params.key;
37700
- const onDelete = params.onDelete;
37701
- const newKey = params.newKey;
37702
- if (typeof databaseId === 'undefined' || databaseId === '') {
37703
- throw new AppwriteException('Missing required parameter: "databaseId"');
37704
- }
37705
- if (typeof tableId === 'undefined' || tableId === '') {
37706
- throw new AppwriteException('Missing required parameter: "tableId"');
37707
- }
37708
- if (typeof key === 'undefined' || key === '') {
37709
- throw new AppwriteException('Missing required parameter: "key"');
37710
- }
37711
- const apiPath = '/tablesdb/{databaseId}/tables/{tableId}/columns/{key}/relationship'
37712
- .replace('{databaseId}', encodeURIComponent(String(databaseId)))
37713
- .replace('{tableId}', encodeURIComponent(String(tableId)))
37714
- .replace('{key}', encodeURIComponent(String(key)));
37715
- const payload = {};
37716
- if (typeof onDelete !== 'undefined') {
37717
- payload['onDelete'] = onDelete;
37718
- }
37719
- if (typeof newKey !== 'undefined') {
37720
- payload['newKey'] = newKey;
37721
- }
37722
- const uri = new URL(this.client.config.endpoint + apiPath);
37723
- const apiHeaders = {
37724
- 'X-Appwrite-Project': this.client.config.project,
37725
- 'content-type': 'application/json',
37726
- accept: 'application/json',
37727
- };
37728
- return this.client.call('patch', uri, apiHeaders, payload);
37729
- }
37730
38411
  listIndexes(paramsOrFirst, ...rest) {
37731
38412
  let params;
37732
38413
  if (paramsOrFirst &&
@@ -38873,41 +39554,6 @@ class Teams {
38873
39554
  };
38874
39555
  return this.client.call('delete', uri, apiHeaders, payload);
38875
39556
  }
38876
- listLogs(paramsOrFirst, ...rest) {
38877
- let params;
38878
- if (paramsOrFirst &&
38879
- typeof paramsOrFirst === 'object' &&
38880
- !Array.isArray(paramsOrFirst)) {
38881
- params = (paramsOrFirst || {});
38882
- }
38883
- else {
38884
- params = {
38885
- teamId: paramsOrFirst,
38886
- queries: rest[0],
38887
- total: rest[1],
38888
- };
38889
- }
38890
- const teamId = params.teamId;
38891
- const queries = params.queries;
38892
- const total = params.total;
38893
- if (typeof teamId === 'undefined' || teamId === '') {
38894
- throw new AppwriteException('Missing required parameter: "teamId"');
38895
- }
38896
- const apiPath = '/teams/{teamId}/logs'.replace('{teamId}', encodeURIComponent(String(teamId)));
38897
- const payload = {};
38898
- if (typeof queries !== 'undefined') {
38899
- payload['queries'] = queries;
38900
- }
38901
- if (typeof total !== 'undefined') {
38902
- payload['total'] = total;
38903
- }
38904
- const uri = new URL(this.client.config.endpoint + apiPath);
38905
- const apiHeaders = {
38906
- 'X-Appwrite-Project': this.client.config.project,
38907
- accept: 'application/json',
38908
- };
38909
- return this.client.call('get', uri, apiHeaders, payload);
38910
- }
38911
39557
  listMemberships(paramsOrFirst, ...rest) {
38912
39558
  let params;
38913
39559
  if (paramsOrFirst &&
@@ -40355,41 +41001,6 @@ class Users {
40355
41001
  };
40356
41002
  return this.client.call('put', uri, apiHeaders, payload);
40357
41003
  }
40358
- listLogs(paramsOrFirst, ...rest) {
40359
- let params;
40360
- if (paramsOrFirst &&
40361
- typeof paramsOrFirst === 'object' &&
40362
- !Array.isArray(paramsOrFirst)) {
40363
- params = (paramsOrFirst || {});
40364
- }
40365
- else {
40366
- params = {
40367
- userId: paramsOrFirst,
40368
- queries: rest[0],
40369
- total: rest[1],
40370
- };
40371
- }
40372
- const userId = params.userId;
40373
- const queries = params.queries;
40374
- const total = params.total;
40375
- if (typeof userId === 'undefined' || userId === '') {
40376
- throw new AppwriteException('Missing required parameter: "userId"');
40377
- }
40378
- const apiPath = '/users/{userId}/logs'.replace('{userId}', encodeURIComponent(String(userId)));
40379
- const payload = {};
40380
- if (typeof queries !== 'undefined') {
40381
- payload['queries'] = queries;
40382
- }
40383
- if (typeof total !== 'undefined') {
40384
- payload['total'] = total;
40385
- }
40386
- const uri = new URL(this.client.config.endpoint + apiPath);
40387
- const apiHeaders = {
40388
- 'X-Appwrite-Project': this.client.config.project,
40389
- accept: 'application/json',
40390
- };
40391
- return this.client.call('get', uri, apiHeaders, payload);
40392
- }
40393
41004
  listMemberships(paramsOrFirst, ...rest) {
40394
41005
  let params;
40395
41006
  if (paramsOrFirst &&
@@ -45037,6 +45648,571 @@ class Realtime {
45037
45648
  }
45038
45649
  }
45039
45650
 
45651
+ // Fixed connection tuning — not exposed as options.
45652
+ const KEEP_ALIVE_SECONDS = 60;
45653
+ const RECONNECT_PERIOD_MS = 2000;
45654
+ /**
45655
+ * Appwrite native push service — the Realtime analog over an MQTT broker, without
45656
+ * FCM or APNS. In the browser the transport is MQTT 5 over WebSocket: while the page is
45657
+ * open the connection stays up and each message is handed to your callback, and a
45658
+ * subscription may also opt into a browser notification per message.
45659
+ *
45660
+ * The connection has no tunables — it always keeps its session (clean start off) so the
45661
+ * broker can redeliver missed messages, and reliability is chosen per subscription via
45662
+ * `retry`. `subscribe` opens the connection lazily and returns a
45663
+ * {@link PushSubscription} handle (unlike Realtime's bare unsubscribe callable — Push
45664
+ * carries per-subscription state). The credential is read off the client — set a JWT or
45665
+ * session on it (`Client.setJWT` / `Client.setSession`), the same way every other service
45666
+ * reads auth.
45667
+ *
45668
+ * const client = new Client().setEndpoint(...).setProject(...).setJWT(jwt);
45669
+ * const push = new Push(client);
45670
+ * const sub = await push.subscribe('user/123/#', (m) =>
45671
+ * console.log(m.topic, m.data),
45672
+ * );
45673
+ * // sub.update({ background: true }); sub.unsubscribe();
45674
+ */
45675
+ class Push extends Service {
45676
+ constructor(client) {
45677
+ super(client);
45678
+ this.mqtt = null;
45679
+ this.connecting = null;
45680
+ /** Set once the first CONNACK lands, so 'connect' events after are reconnects. */
45681
+ this.everConnected = false;
45682
+ /** Errors already handed to onError, so one failure is reported once. */
45683
+ this.reported = new WeakSet();
45684
+ /** mqtt.js connect errors mapped to the error handed out for them (see connectError). */
45685
+ this.connectErrors = new WeakMap();
45686
+ /** True while the first connect is in flight: its errors go to the waiting caller. */
45687
+ this.opening = false;
45688
+ // Local id -> subscription state. The id is never sent to the broker; it only lets
45689
+ // the same topic carry more than one callback (each with its own options).
45690
+ /**
45691
+ * The client id when the credential names no user (and none was set): random, but kept for
45692
+ * this instance so reconnects resume the same broker session.
45693
+ */
45694
+ this.fallbackClientId = randomId();
45695
+ this.subscriptions = new Map();
45696
+ }
45697
+ // The broker subscription for a filter uses the highest QoS any local subscription on
45698
+ // it wants, so a QoS-0 subscription never downgrades a QoS-1 one sharing the filter.
45699
+ effectiveQos(filter) {
45700
+ for (const sub of this.subscriptions.values()) {
45701
+ if (sub.topic === filter && sub.qos === 1) {
45702
+ return 1;
45703
+ }
45704
+ }
45705
+ return 0;
45706
+ }
45707
+ /** Register a callback invoked when the connection opens (CONNACK success). */
45708
+ onOpen(callback) {
45709
+ this.onOpenCb = callback;
45710
+ return this;
45711
+ }
45712
+ /** Register a callback invoked when the connection closes. */
45713
+ onClose(callback) {
45714
+ this.onCloseCb = callback;
45715
+ return this;
45716
+ }
45717
+ /** Register a callback invoked on a connection error. */
45718
+ onError(callback) {
45719
+ this.onErrorCb = callback;
45720
+ return this;
45721
+ }
45722
+ /**
45723
+ * The signed-in user's own topic, `users/<userId>`, for a topic-less subscribe. The id comes
45724
+ * from the credential the connection authenticates with: the JWT when one is set (never
45725
+ * the session, which could belong to a different user), else the session.
45726
+ */
45727
+ userTopic() {
45728
+ const { jwt, session } = this.client.config;
45729
+ const userId = jwt ? userIdFromJwt(jwt) : userIdFromSession(session);
45730
+ if (!userId) {
45731
+ throw new Error('subscribe() without a topic needs a signed-in user: set a JWT or session on the client');
45732
+ }
45733
+ return `users/${userId}`;
45734
+ }
45735
+ /**
45736
+ * Hand an error to the onError callback, once per error. These errors happen outside any
45737
+ * call (reconnects, broker DISCONNECTs, background re-subscribes), so they are never
45738
+ * thrown, which would crash the app from inside mqtt.js: with no callback registered
45739
+ * they are logged, like Realtime does.
45740
+ */
45741
+ report(error) {
45742
+ const err = toError(error);
45743
+ if (this.reported.has(err)) {
45744
+ return;
45745
+ }
45746
+ this.reported.add(err);
45747
+ if (!this.onErrorCb) {
45748
+ console.error('Appwrite Push error:', err);
45749
+ return;
45750
+ }
45751
+ try {
45752
+ this.onErrorCb(err);
45753
+ }
45754
+ catch (callbackError) {
45755
+ console.error('Appwrite Push onError threw:', callbackError);
45756
+ }
45757
+ }
45758
+ /**
45759
+ * For a call that fails to its caller: report the error to onError when a callback is
45760
+ * registered, then throw it to the caller, who can catch it.
45761
+ */
45762
+ fail(error) {
45763
+ const err = toError(error);
45764
+ if (this.onErrorCb) {
45765
+ this.report(err);
45766
+ }
45767
+ throw err;
45768
+ }
45769
+ subscribe(topicsOrCallback_1, callbackOrOptions_1) {
45770
+ return __awaiter(this, arguments, void 0, function* (topicsOrCallback, callbackOrOptions, topicOptions = {}) {
45771
+ // Every failure reaches onError (when registered) and is thrown to the caller.
45772
+ try {
45773
+ return yield this.subscribeWith(topicsOrCallback, callbackOrOptions, topicOptions);
45774
+ }
45775
+ catch (err) {
45776
+ this.fail(err);
45777
+ }
45778
+ });
45779
+ }
45780
+ subscribeWith(topicsOrCallback, callbackOrOptions, topicOptions) {
45781
+ return __awaiter(this, void 0, void 0, function* () {
45782
+ var _a, _b;
45783
+ // Topic-less form: subscribe(callback, options) targets the signed-in user's topic.
45784
+ const userForm = typeof topicsOrCallback === 'function';
45785
+ const topics = userForm ? this.userTopic() : topicsOrCallback;
45786
+ const callback = (userForm ? topicsOrCallback : callbackOrOptions);
45787
+ const options = (userForm ? (callbackOrOptions !== null && callbackOrOptions !== void 0 ? callbackOrOptions : {}) : topicOptions);
45788
+ const topicList = (Array.isArray(topics) ? topics : [topics]).map((topic) => topic.toString());
45789
+ // The user topic defaults to background delivery, like FCM/APNs; topics default off.
45790
+ const background = (_a = options.background) !== null && _a !== void 0 ? _a : userForm;
45791
+ const qos = ((_b = options.retry) !== null && _b !== void 0 ? _b : true) ? 1 : 0;
45792
+ if (background) {
45793
+ this.requestNotificationPermission();
45794
+ }
45795
+ const client = yield this.connect();
45796
+ const ids = [];
45797
+ const acks = [];
45798
+ for (const topic of topicList) {
45799
+ const id = randomId();
45800
+ ids.push(id);
45801
+ this.subscriptions.set(id, {
45802
+ topic,
45803
+ callback,
45804
+ background,
45805
+ title: options.title,
45806
+ qos,
45807
+ });
45808
+ acks.push(new Promise((resolve, reject) => {
45809
+ client.subscribe(topic, { qos: this.effectiveQos(topic) }, (err) => (err ? reject(err) : resolve()));
45810
+ }));
45811
+ }
45812
+ const unsubscribe = () => {
45813
+ var _a;
45814
+ // Filters whose removed sub was QoS 1: their effective QoS may now drop.
45815
+ const maybeDowngrade = new Set();
45816
+ for (const id of ids) {
45817
+ const entry = this.subscriptions.get(id);
45818
+ this.subscriptions.delete(id);
45819
+ if ((entry === null || entry === void 0 ? void 0 : entry.qos) === 1) {
45820
+ maybeDowngrade.add(entry.topic);
45821
+ }
45822
+ // Only unsubscribe the broker filter once its last local callback is gone.
45823
+ const stillUsed = [...this.subscriptions.values()].some((s) => s.topic === (entry === null || entry === void 0 ? void 0 : entry.topic));
45824
+ if (entry && this.mqtt && !stillUsed) {
45825
+ this.mqtt.unsubscribe(entry.topic, (err) => {
45826
+ if (err) {
45827
+ this.report(err);
45828
+ }
45829
+ });
45830
+ }
45831
+ }
45832
+ // A filter that lost its last QoS-1 sub but still has QoS-0 subs must be
45833
+ // re-SUBSCRIBEd at the lower QoS, or the broker keeps replaying to at-most-once subs.
45834
+ for (const filter of maybeDowngrade) {
45835
+ const stillUsed = [...this.subscriptions.values()].some((s) => s.topic === filter);
45836
+ if (stillUsed && this.effectiveQos(filter) === 0) {
45837
+ (_a = this.mqtt) === null || _a === void 0 ? void 0 : _a.subscribe(filter, { qos: 0 }, (err) => {
45838
+ if (err) {
45839
+ this.report(err);
45840
+ }
45841
+ });
45842
+ }
45843
+ }
45844
+ if (this.subscriptions.size === 0) {
45845
+ this.close();
45846
+ }
45847
+ };
45848
+ // If any topic's subscribe fails, roll this call's registrations back (and drop
45849
+ // any now-unused broker filter) so a failed subscribe leaks no callback, then rethrow.
45850
+ try {
45851
+ yield Promise.all(acks);
45852
+ }
45853
+ catch (err) {
45854
+ unsubscribe();
45855
+ throw err;
45856
+ }
45857
+ const update = (next) => {
45858
+ var _a;
45859
+ const enabling = next.background === true;
45860
+ const changedFilters = new Set();
45861
+ // Remember the pre-update QoS per id so a rejected re-SUBSCRIBE can be rolled back.
45862
+ const previous = new Map();
45863
+ for (const id of ids) {
45864
+ const entry = this.subscriptions.get(id);
45865
+ if (!entry) {
45866
+ continue;
45867
+ }
45868
+ if (next.background !== undefined) {
45869
+ entry.background = next.background;
45870
+ }
45871
+ if (next.title !== undefined) {
45872
+ entry.title = next.title;
45873
+ }
45874
+ if (next.retry !== undefined) {
45875
+ const q = next.retry ? 1 : 0;
45876
+ if (q !== entry.qos) {
45877
+ previous.set(id, entry.qos);
45878
+ entry.qos = q;
45879
+ changedFilters.add(entry.topic);
45880
+ }
45881
+ }
45882
+ }
45883
+ if (enabling) {
45884
+ this.requestNotificationPermission();
45885
+ }
45886
+ // Re-SUBSCRIBE the affected filters at their new effective QoS (a SUBSCRIBE to an
45887
+ // existing filter just updates its QoS — no unsubscribe gap). If the broker rejects
45888
+ // it, the old subscription still stands, so restore the local QoS to match and
45889
+ // surface the error rather than silently assuming the change took effect.
45890
+ for (const filter of changedFilters) {
45891
+ (_a = this.mqtt) === null || _a === void 0 ? void 0 : _a.subscribe(filter, { qos: this.effectiveQos(filter) }, (err) => {
45892
+ if (!err) {
45893
+ return;
45894
+ }
45895
+ for (const [id, q] of previous) {
45896
+ const entry = this.subscriptions.get(id);
45897
+ if (entry && entry.topic === filter) {
45898
+ entry.qos = q;
45899
+ }
45900
+ }
45901
+ this.report(err);
45902
+ });
45903
+ }
45904
+ };
45905
+ return { unsubscribe, update };
45906
+ });
45907
+ }
45908
+ /** Tear down the connection and drop all active subscriptions. */
45909
+ close() {
45910
+ if (this.mqtt) {
45911
+ this.mqtt.end(true);
45912
+ this.mqtt = null;
45913
+ }
45914
+ this.connecting = null;
45915
+ this.everConnected = false;
45916
+ this.subscriptions.clear();
45917
+ }
45918
+ /**
45919
+ * Re-register every active subscription. Called on each reconnect so a client that
45920
+ * reconnects with a fresh (or cleared) session does not silently stop receiving;
45921
+ * re-subscribing an existing filter is idempotent.
45922
+ */
45923
+ resubscribeAll() {
45924
+ const client = this.mqtt;
45925
+ if (!client) {
45926
+ return;
45927
+ }
45928
+ const filters = new Set([...this.subscriptions.values()].map((s) => s.topic));
45929
+ for (const filter of filters) {
45930
+ client.subscribe(filter, { qos: this.effectiveQos(filter) }, (err) => {
45931
+ if (err) {
45932
+ this.report(err);
45933
+ }
45934
+ });
45935
+ }
45936
+ }
45937
+ // --- internals ---
45938
+ connect() {
45939
+ if (this.mqtt) {
45940
+ return Promise.resolve(this.mqtt);
45941
+ }
45942
+ if (!this.connecting) {
45943
+ this.connecting = this.open();
45944
+ // A failed open must not poison future attempts — clear the cached
45945
+ // in-flight promise so a later subscribe/publish can retry.
45946
+ this.connecting.catch(() => {
45947
+ this.connecting = null;
45948
+ });
45949
+ }
45950
+ return this.connecting.then(() => this.mqtt);
45951
+ }
45952
+ endpointUrl() {
45953
+ // The push endpoint set on the client (Client.setPushEndpoint) wins.
45954
+ if (this.client.config.endpointPush !== '') {
45955
+ return this.client.config.endpointPush;
45956
+ }
45957
+ // Otherwise default to a `push.` host on the regular API endpoint (not the
45958
+ // independently-configurable realtime endpoint), scheme switched to ws/wss.
45959
+ const wsEndpoint = this.client.config.endpoint
45960
+ .replace('https://', 'wss://')
45961
+ .replace('http://', 'ws://');
45962
+ // Prefix the host with `push.` (scheme://host/path -> scheme://push.host/path).
45963
+ const separator = '://';
45964
+ const at = wsEndpoint.indexOf(separator);
45965
+ return at === -1
45966
+ ? wsEndpoint
45967
+ : `${wsEndpoint.slice(0, at + separator.length)}push.${wsEndpoint.slice(at + separator.length)}`;
45968
+ }
45969
+ open() {
45970
+ return __awaiter(this, void 0, void 0, function* () {
45971
+ var _a;
45972
+ // Read the credential set on the client (via Client.setJWT / setSession).
45973
+ let authMethod;
45974
+ let credential;
45975
+ if (this.client.config.jwt) {
45976
+ authMethod = 'appwrite-jwt';
45977
+ credential = this.client.config.jwt;
45978
+ }
45979
+ else if (this.client.config.session) {
45980
+ authMethod = 'appwrite-session';
45981
+ credential = this.client.config.session;
45982
+ }
45983
+ else {
45984
+ throw new Error('No credential set on the client; call Client.setJWT() or Client.setSession() first.');
45985
+ }
45986
+ const project = (_a = this.client.config.project) !== null && _a !== void 0 ? _a : '';
45987
+ // Client id, when the app did not set one with Client.setPushClientId(). Unlike the
45988
+ // native SDKs (which send an empty id and let the broker derive a stable one), mqtt.js
45989
+ // rejects an empty id with clean start off, so derive a stable per-user id here from the
45990
+ // credential this connection authenticates with: the JWT's userId, or the session's user
45991
+ // id. A stable id keeps the broker's replay cursor resuming across reloads. The
45992
+ // credential itself is never used as the id.
45993
+ const clientId = this.client.config.pushClientId ||
45994
+ (authMethod === 'appwrite-jwt'
45995
+ ? userIdFromJwt(credential)
45996
+ : userIdFromSession(credential)) ||
45997
+ this.fallbackClientId;
45998
+ const options = {
45999
+ clientId,
46000
+ protocolVersion: 5,
46001
+ clean: false, // always keep the session so the broker can replay QoS-1 topics
46002
+ keepalive: KEEP_ALIVE_SECONDS,
46003
+ reconnectPeriod: RECONNECT_PERIOD_MS,
46004
+ manualConnect: true,
46005
+ // Enhanced auth carried in CONNECT properties.
46006
+ properties: {
46007
+ authenticationMethod: authMethod,
46008
+ authenticationData: Buffer.from(credential),
46009
+ userProperties: { projectId: project },
46010
+ },
46011
+ };
46012
+ const client = mqtt.connect(this.endpointUrl(), options);
46013
+ this.mqtt = client;
46014
+ client.on('message', (_topic, _payload, packet) => {
46015
+ this.dispatch(packet).catch((err) => this.report(err));
46016
+ });
46017
+ // Persistent lifecycle listeners. Re-register every subscription on reconnect
46018
+ // (harmless if the broker resumed our session), and surface the lifecycle to the
46019
+ // caller's onOpen/onClose/onError hooks.
46020
+ client.on('connect', () => {
46021
+ var _a;
46022
+ if (this.everConnected) {
46023
+ this.resubscribeAll();
46024
+ }
46025
+ this.everConnected = true;
46026
+ (_a = this.onOpenCb) === null || _a === void 0 ? void 0 : _a.call(this);
46027
+ });
46028
+ client.on('close', () => { var _a; return (_a = this.onCloseCb) === null || _a === void 0 ? void 0 : _a.call(this); });
46029
+ // The broker explains a refused CONNECT (CONNACK) or a server-initiated DISCONNECT
46030
+ // with an MQTT 5 Reason String. mqtt.js reports only the reason code, so capture the
46031
+ // string off the packet (packetreceive fires before mqtt.js handles it) and hand it
46032
+ // to onError as the error message.
46033
+ let refusedReason;
46034
+ client.on('packetreceive', (packet) => {
46035
+ var _a, _b;
46036
+ if (packet.cmd === 'connack') {
46037
+ refusedReason =
46038
+ ((_a = packet.reasonCode) !== null && _a !== void 0 ? _a : 0) !== 0
46039
+ ? (_b = packet.properties) === null || _b === void 0 ? void 0 : _b.reasonString
46040
+ : undefined;
46041
+ }
46042
+ });
46043
+ client.on('error', (err) => {
46044
+ const error = this.connectError(err, refusedReason);
46045
+ // While the first connect is pending its caller receives the error (and reports it
46046
+ // through fail()); afterwards, e.g. on reconnect, report it here.
46047
+ if (!this.opening) {
46048
+ this.report(error);
46049
+ }
46050
+ });
46051
+ client.on('disconnect', (packet) => {
46052
+ var _a, _b, _c;
46053
+ if (((_a = packet.reasonCode) !== null && _a !== void 0 ? _a : 0) !== 0) {
46054
+ this.report(new Error((_c = (_b = packet.properties) === null || _b === void 0 ? void 0 : _b.reasonString) !== null && _c !== void 0 ? _c : `Disconnected by the broker (reason ${packet.reasonCode})`));
46055
+ }
46056
+ });
46057
+ this.opening = true;
46058
+ yield new Promise((resolve, reject) => {
46059
+ const onConnect = (packet) => {
46060
+ var _a, _b;
46061
+ cleanup();
46062
+ const rc = (_b = (_a = packet.reasonCode) !== null && _a !== void 0 ? _a : packet.returnCode) !== null && _b !== void 0 ? _b : 0;
46063
+ if (rc !== 0) {
46064
+ this.close();
46065
+ reject(new Error(refusedReason !== null && refusedReason !== void 0 ? refusedReason : `MQTT authentication failed (CONNACK reason ${rc})`));
46066
+ }
46067
+ else {
46068
+ resolve();
46069
+ }
46070
+ };
46071
+ const onError = (err) => {
46072
+ cleanup();
46073
+ this.close();
46074
+ reject(this.connectError(err, refusedReason));
46075
+ };
46076
+ const cleanup = () => {
46077
+ this.opening = false;
46078
+ client.removeListener('connect', onConnect);
46079
+ client.removeListener('error', onError);
46080
+ };
46081
+ client.on('connect', onConnect);
46082
+ client.on('error', onError);
46083
+ client.connect();
46084
+ });
46085
+ });
46086
+ }
46087
+ /**
46088
+ * The error for a failed connect: the broker's Reason String when it sent one (a refused
46089
+ * CONNACK), else mqtt.js's error. Memoized so both error listeners hand out the same
46090
+ * object and it is reported once.
46091
+ */
46092
+ connectError(err, reason) {
46093
+ const source = toError(err);
46094
+ let error = this.connectErrors.get(source);
46095
+ if (!error) {
46096
+ error = reason ? new Error(reason) : source;
46097
+ this.connectErrors.set(source, error);
46098
+ }
46099
+ return error;
46100
+ }
46101
+ /** Fan a delivered packet out to every subscription whose filter matches. */
46102
+ dispatch(packet) {
46103
+ return __awaiter(this, void 0, void 0, function* () {
46104
+ const payload = Buffer.isBuffer(packet.payload)
46105
+ ? packet.payload
46106
+ : Buffer.from(packet.payload);
46107
+ const message = {
46108
+ topic: packet.topic.toString(),
46109
+ data: new TextDecoder().decode(payload),
46110
+ payload,
46111
+ qos: packet.qos,
46112
+ };
46113
+ for (const sub of this.subscriptions.values()) {
46114
+ if (matches(sub.topic, message.topic)) {
46115
+ yield sub.callback(message);
46116
+ // Notification is per-subscription: only subs that opted in post one,
46117
+ // each with its own title.
46118
+ if (sub.background) {
46119
+ this.notify(message, sub.title);
46120
+ }
46121
+ }
46122
+ }
46123
+ });
46124
+ }
46125
+ requestNotificationPermission() {
46126
+ if (typeof Notification !== 'undefined' &&
46127
+ Notification.permission === 'default') {
46128
+ Promise.resolve(Notification.requestPermission()).catch((err) => this.report(err));
46129
+ }
46130
+ }
46131
+ /** Post a browser notification for a message a background subscription matched. */
46132
+ notify(message, title) {
46133
+ if (typeof Notification === 'undefined' ||
46134
+ Notification.permission !== 'granted') {
46135
+ return;
46136
+ }
46137
+ try {
46138
+ new Notification(title !== null && title !== void 0 ? title : message.topic, {
46139
+ body: message.data,
46140
+ });
46141
+ }
46142
+ catch (_a) {
46143
+ // Some browsers only allow notifications from a service worker; ignore.
46144
+ }
46145
+ }
46146
+ }
46147
+ /** Normalize anything thrown or passed to an error handler into an `Error`. */
46148
+ function toError(error) {
46149
+ return error instanceof Error ? error : new Error(String(error));
46150
+ }
46151
+ /**
46152
+ * The userId claim from an Appwrite JWT, used as the default MQTT client id so the
46153
+ * broker's replay cursor is stable per user. Returns '' when the token is not a decodable JWT
46154
+ * (e.g. a plain string), so the caller can fall back to the session or raw credential.
46155
+ */
46156
+ function userIdFromJwt(jwt) {
46157
+ if (!jwt) {
46158
+ return '';
46159
+ }
46160
+ const parts = jwt.split('.');
46161
+ if (parts.length < 2) {
46162
+ return '';
46163
+ }
46164
+ try {
46165
+ const json = Buffer.from(parts[1].replace(/-/g, '+').replace(/_/g, '/'), 'base64').toString('utf-8');
46166
+ const payload = JSON.parse(json);
46167
+ return typeof payload.userId === 'string' ? payload.userId : '';
46168
+ }
46169
+ catch (_a) {
46170
+ return '';
46171
+ }
46172
+ }
46173
+ /**
46174
+ * The user id inside a session secret, which is base64 of JSON `{"id": <userId>, "secret": ...}`.
46175
+ * Returns '' when the value is not such a secret.
46176
+ */
46177
+ function userIdFromSession(session) {
46178
+ if (!session) {
46179
+ return '';
46180
+ }
46181
+ try {
46182
+ const payload = JSON.parse(Buffer.from(session, 'base64').toString('utf-8'));
46183
+ return typeof payload.id === 'string' ? payload.id : '';
46184
+ }
46185
+ catch (_a) {
46186
+ return '';
46187
+ }
46188
+ }
46189
+ /** A hex id, uuid4-like enough for a client-generated client id suffix. */
46190
+ function randomId() {
46191
+ let out = '';
46192
+ for (let i = 0; i < 32; i++) {
46193
+ out += Math.floor(Math.random() * 16).toString(16);
46194
+ }
46195
+ return out;
46196
+ }
46197
+ /** MQTT topic-filter match with '+' (single level) and '#' (multi level). */
46198
+ function matches(filter, topic) {
46199
+ const filterParts = filter.split('/');
46200
+ const topicParts = topic.split('/');
46201
+ for (let i = 0; i < filterParts.length; i++) {
46202
+ const part = filterParts[i];
46203
+ if (part === '#') {
46204
+ return true;
46205
+ }
46206
+ if (i >= topicParts.length) {
46207
+ return false;
46208
+ }
46209
+ if (part !== '+' && part !== topicParts[i]) {
46210
+ return false;
46211
+ }
46212
+ }
46213
+ return filterParts.length === topicParts.length;
46214
+ }
46215
+
45040
46216
  /**
45041
46217
  * Helper class to generate permission strings for resources.
45042
46218
  */
@@ -45185,6 +46361,100 @@ class Role {
45185
46361
  }
45186
46362
  }
45187
46363
 
46364
+ /**
46365
+ * Validate the levels passed to `path()`: a non-empty array of non-empty strings, none holding
46366
+ * the level separator `/` or the wildcards `+` and `#` (use `any()` and `all()` for those).
46367
+ */
46368
+ function levelsOf(levels) {
46369
+ if (!Array.isArray(levels)) {
46370
+ throw new Error("path() expects an array, e.g. path(['user'])");
46371
+ }
46372
+ if (levels.length === 0) {
46373
+ throw new Error('path() needs at least one level');
46374
+ }
46375
+ return levels.map((level, index) => {
46376
+ if (typeof level !== 'string') {
46377
+ const type = level === null ? 'null' : typeof level;
46378
+ throw new Error(`level at index ${index} must be a string, got ${type}`);
46379
+ }
46380
+ if (level === '') {
46381
+ throw new Error(`empty level at index ${index}`);
46382
+ }
46383
+ if (level.includes('/')) {
46384
+ const parts = level
46385
+ .split('/')
46386
+ .map((part) => `'${part}'`)
46387
+ .join(', ');
46388
+ throw new Error(`"${level}" contains "/", split it: path([${parts}])`);
46389
+ }
46390
+ if (level === '+') {
46391
+ throw new Error('"+" is reserved, use any()');
46392
+ }
46393
+ if (level.includes('+')) {
46394
+ throw new Error(`"${level}" contains "+", use any() for wildcards`);
46395
+ }
46396
+ if (level === '#') {
46397
+ throw new Error('"#" is reserved, use all()');
46398
+ }
46399
+ if (level.includes('#')) {
46400
+ throw new Error(`"${level}" contains "#", use all() for wildcards`);
46401
+ }
46402
+ return level;
46403
+ });
46404
+ }
46405
+ /**
46406
+ * Helper to build MQTT topics for `Push`, level by level.
46407
+ *
46408
+ * Topic.path(['user', userId, 'notification']); // "user/123/notification"
46409
+ * Topic.path(['user']).any().path(['notification']); // "user/+/notification"
46410
+ * Topic.path(['org']).any().path(['logs']).all(); // "org/+/logs/#"
46411
+ *
46412
+ * `any()` matches exactly one level and `all()` everything below, at any depth (including the
46413
+ * parent itself). `all()` ends the topic, so it returns a {@link ResolvedTopic}.
46414
+ */
46415
+ class Topic {
46416
+ constructor(levels) {
46417
+ this.levels = levels;
46418
+ }
46419
+ /** Start a topic with the given levels, e.g. `Topic.path(['user', userId])`. */
46420
+ static path(levels) {
46421
+ return new Topic(levelsOf(levels));
46422
+ }
46423
+ /** Start a topic with a single-level wildcard (`+`). */
46424
+ static any() {
46425
+ return new Topic(['+']);
46426
+ }
46427
+ /** The multi-level wildcard alone (`#`): matches every topic. */
46428
+ static all() {
46429
+ return new ResolvedTopic(['#']);
46430
+ }
46431
+ /** Append the given levels. */
46432
+ path(levels) {
46433
+ return new Topic([...this.levels, ...levelsOf(levels)]);
46434
+ }
46435
+ /** Append a single-level wildcard (`+`): matches exactly one level. */
46436
+ any() {
46437
+ return new Topic([...this.levels, '+']);
46438
+ }
46439
+ /** Append the multi-level wildcard (`#`) and end the topic. */
46440
+ all() {
46441
+ return new ResolvedTopic([...this.levels, '#']);
46442
+ }
46443
+ toString() {
46444
+ return this.levels.join('/');
46445
+ }
46446
+ }
46447
+ /** A topic ended by `all()`: nothing can be appended after the `#` wildcard. */
46448
+ class ResolvedTopic {
46449
+ /** @internal Created by {@link Topic.all}. */
46450
+ constructor(levels) {
46451
+ this.levels = levels;
46452
+ }
46453
+ toString() {
46454
+ return this.levels.join('/');
46455
+ }
46456
+ }
46457
+
45188
46458
  function normalize(id) {
45189
46459
  if (id === undefined || id === null) {
45190
46460
  throw new Error('Channel ID is required');
@@ -45589,6 +46859,12 @@ var AuthenticationFactor;
45589
46859
  AuthenticationFactor["Custom"] = "custom";
45590
46860
  })(AuthenticationFactor || (AuthenticationFactor = {}));
45591
46861
 
46862
+ var IdTokenProvider;
46863
+ (function (IdTokenProvider) {
46864
+ IdTokenProvider["Apple"] = "apple";
46865
+ IdTokenProvider["Google"] = "google";
46866
+ })(IdTokenProvider || (IdTokenProvider = {}));
46867
+
45592
46868
  var OAuthProvider;
45593
46869
  (function (OAuthProvider) {
45594
46870
  OAuthProvider["Amazon"] = "amazon";
@@ -46387,7 +47663,6 @@ var QuerySuggestionResource;
46387
47663
  QuerySuggestionResource["Schedules"] = "schedules";
46388
47664
  QuerySuggestionResource["Platforms"] = "platforms";
46389
47665
  QuerySuggestionResource["Keys"] = "keys";
46390
- QuerySuggestionResource["DevKeys"] = "devkeys";
46391
47666
  QuerySuggestionResource["Webhooks"] = "webhooks";
46392
47667
  QuerySuggestionResource["Notifications"] = "notifications";
46393
47668
  QuerySuggestionResource["Certificates"] = "certificates";
@@ -46410,6 +47685,7 @@ var QuerySuggestionResource;
46410
47685
  QuerySuggestionResource["Buckets"] = "buckets";
46411
47686
  QuerySuggestionResource["Providers"] = "providers";
46412
47687
  QuerySuggestionResource["Messages"] = "messages";
47688
+ QuerySuggestionResource["PushLedger"] = "pushledger";
46413
47689
  QuerySuggestionResource["Topics"] = "topics";
46414
47690
  QuerySuggestionResource["Subscribers"] = "subscribers";
46415
47691
  QuerySuggestionResource["Targets"] = "targets";
@@ -46452,13 +47728,11 @@ var QuerySuggestionResource;
46452
47728
  QuerySuggestionResource["Functions"] = "functions";
46453
47729
  QuerySuggestionResource["Sites"] = "sites";
46454
47730
  QuerySuggestionResource["Deployments"] = "deployments";
46455
- QuerySuggestionResource["Executions"] = "executions";
46456
47731
  QuerySuggestionResource["Variables"] = "variables";
46457
47732
  QuerySuggestionResource["Migrations"] = "migrations";
46458
47733
  QuerySuggestionResource["ResourceTokens"] = "resourcetokens";
46459
47734
  QuerySuggestionResource["Transactions"] = "transactions";
46460
47735
  QuerySuggestionResource["TransactionLogs"] = "transactionlogs";
46461
- QuerySuggestionResource["Stats"] = "stats";
46462
47736
  QuerySuggestionResource["DedicatedDatabases"] = "dedicateddatabases";
46463
47737
  QuerySuggestionResource["DedicatedDatabaseConfigs"] = "dedicateddatabaseconfigs";
46464
47738
  QuerySuggestionResource["DedicatedDatabaseRuntimes"] = "dedicateddatabaseruntimes";
@@ -46477,6 +47751,8 @@ var ProjectEmailTemplateId;
46477
47751
  ProjectEmailTemplateId["MfaChallenge"] = "mfaChallenge";
46478
47752
  ProjectEmailTemplateId["SessionAlert"] = "sessionAlert";
46479
47753
  ProjectEmailTemplateId["OtpSession"] = "otpSession";
47754
+ ProjectEmailTemplateId["OtpVerification"] = "otpVerification";
47755
+ ProjectEmailTemplateId["OtpRecovery"] = "otpRecovery";
46480
47756
  })(ProjectEmailTemplateId || (ProjectEmailTemplateId = {}));
46481
47757
 
46482
47758
  var ProjectEmailTemplateLocale;
@@ -46704,6 +47980,9 @@ var Runtime;
46704
47980
  Runtime["Pythonml311"] = "python-ml-3.11";
46705
47981
  Runtime["Pythonml312"] = "python-ml-3.12";
46706
47982
  Runtime["Pythonml313"] = "python-ml-3.13";
47983
+ Runtime["Deno121"] = "deno-1.21";
47984
+ Runtime["Deno124"] = "deno-1.24";
47985
+ Runtime["Deno135"] = "deno-1.35";
46707
47986
  Runtime["Deno140"] = "deno-1.40";
46708
47987
  Runtime["Deno146"] = "deno-1.46";
46709
47988
  Runtime["Deno20"] = "deno-2.0";
@@ -46875,6 +48154,7 @@ var ProjectKeyScopes;
46875
48154
  ProjectKeyScopes["ReportsWrite"] = "reports.write";
46876
48155
  ProjectKeyScopes["PresencesRead"] = "presences.read";
46877
48156
  ProjectKeyScopes["PresencesWrite"] = "presences.write";
48157
+ ProjectKeyScopes["DedicatedDatabasesExecute"] = "dedicatedDatabases.execute";
46878
48158
  ProjectKeyScopes["BackupsPoliciesRead"] = "backups.policies.read";
46879
48159
  ProjectKeyScopes["BackupsPoliciesWrite"] = "backups.policies.write";
46880
48160
  ProjectKeyScopes["ArchivesRead"] = "archives.read";
@@ -46936,6 +48216,17 @@ var ExecutionMethod;
46936
48216
  ExecutionMethod["HEAD"] = "HEAD";
46937
48217
  })(ExecutionMethod || (ExecutionMethod = {}));
46938
48218
 
48219
+ var ConversationType;
48220
+ (function (ConversationType) {
48221
+ ConversationType["Support"] = "support";
48222
+ ConversationType["Feedback"] = "feedback";
48223
+ ConversationType["Docs"] = "docs";
48224
+ ConversationType["Enterprise"] = "enterprise";
48225
+ ConversationType["Startup"] = "startup";
48226
+ ConversationType["Partner"] = "partner";
48227
+ ConversationType["Sponsorship"] = "sponsorship";
48228
+ })(ConversationType || (ConversationType = {}));
48229
+
46939
48230
  var BlockResourceType;
46940
48231
  (function (BlockResourceType) {
46941
48232
  BlockResourceType["Projects"] = "projects";
@@ -46979,7 +48270,6 @@ var CacheDatabase;
46979
48270
  (function (CacheDatabase) {
46980
48271
  CacheDatabase["Console"] = "console";
46981
48272
  CacheDatabase["Project"] = "project";
46982
- CacheDatabase["Logs"] = "logs";
46983
48273
  })(CacheDatabase || (CacheDatabase = {}));
46984
48274
 
46985
48275
  var MessagePriority;
@@ -47093,10 +48383,8 @@ var OrganizationKeyScopes;
47093
48383
  (function (OrganizationKeyScopes) {
47094
48384
  OrganizationKeyScopes["ProjectsRead"] = "projects.read";
47095
48385
  OrganizationKeyScopes["ProjectsWrite"] = "projects.write";
47096
- OrganizationKeyScopes["DevKeysRead"] = "devKeys.read";
47097
- OrganizationKeyScopes["DevKeysWrite"] = "devKeys.write";
47098
- OrganizationKeyScopes["OrganizationKeysRead"] = "organization.keys.read";
47099
- OrganizationKeyScopes["OrganizationKeysWrite"] = "organization.keys.write";
48386
+ OrganizationKeyScopes["OrganizationProjectsKeysRead"] = "organization.projects.keys.read";
48387
+ OrganizationKeyScopes["OrganizationProjectsKeysWrite"] = "organization.projects.keys.write";
47100
48388
  OrganizationKeyScopes["OrganizationInstallationsRead"] = "organization.installations.read";
47101
48389
  OrganizationKeyScopes["OrganizationInstallationsWrite"] = "organization.installations.write";
47102
48390
  OrganizationKeyScopes["OrganizationMembershipsRead"] = "organization.memberships.read";
@@ -47135,6 +48423,24 @@ var ProjectAuthMethodId;
47135
48423
  ProjectAuthMethodId["Phone"] = "phone";
47136
48424
  })(ProjectAuthMethodId || (ProjectAuthMethodId = {}));
47137
48425
 
48426
+ var ProjectOAuth2Auth0Prompt;
48427
+ (function (ProjectOAuth2Auth0Prompt) {
48428
+ ProjectOAuth2Auth0Prompt["None"] = "none";
48429
+ ProjectOAuth2Auth0Prompt["Login"] = "login";
48430
+ ProjectOAuth2Auth0Prompt["Consent"] = "consent";
48431
+ })(ProjectOAuth2Auth0Prompt || (ProjectOAuth2Auth0Prompt = {}));
48432
+
48433
+ var ProjectOAuth2DiscordPrompt;
48434
+ (function (ProjectOAuth2DiscordPrompt) {
48435
+ ProjectOAuth2DiscordPrompt["None"] = "none";
48436
+ ProjectOAuth2DiscordPrompt["Consent"] = "consent";
48437
+ })(ProjectOAuth2DiscordPrompt || (ProjectOAuth2DiscordPrompt = {}));
48438
+
48439
+ var ProjectOAuth2GitHubPrompt;
48440
+ (function (ProjectOAuth2GitHubPrompt) {
48441
+ ProjectOAuth2GitHubPrompt["SelectAccount"] = "select_account";
48442
+ })(ProjectOAuth2GitHubPrompt || (ProjectOAuth2GitHubPrompt = {}));
48443
+
47138
48444
  var ProjectOAuth2GooglePrompt;
47139
48445
  (function (ProjectOAuth2GooglePrompt) {
47140
48446
  ProjectOAuth2GooglePrompt["None"] = "none";
@@ -47142,6 +48448,22 @@ var ProjectOAuth2GooglePrompt;
47142
48448
  ProjectOAuth2GooglePrompt["SelectAccount"] = "select_account";
47143
48449
  })(ProjectOAuth2GooglePrompt || (ProjectOAuth2GooglePrompt = {}));
47144
48450
 
48451
+ var ProjectOAuth2KakaoPrompt;
48452
+ (function (ProjectOAuth2KakaoPrompt) {
48453
+ ProjectOAuth2KakaoPrompt["None"] = "none";
48454
+ ProjectOAuth2KakaoPrompt["Login"] = "login";
48455
+ ProjectOAuth2KakaoPrompt["Create"] = "create";
48456
+ ProjectOAuth2KakaoPrompt["SelectAccount"] = "select_account";
48457
+ })(ProjectOAuth2KakaoPrompt || (ProjectOAuth2KakaoPrompt = {}));
48458
+
48459
+ var ProjectOAuth2MicrosoftPrompt;
48460
+ (function (ProjectOAuth2MicrosoftPrompt) {
48461
+ ProjectOAuth2MicrosoftPrompt["None"] = "none";
48462
+ ProjectOAuth2MicrosoftPrompt["Login"] = "login";
48463
+ ProjectOAuth2MicrosoftPrompt["Consent"] = "consent";
48464
+ ProjectOAuth2MicrosoftPrompt["SelectAccount"] = "select_account";
48465
+ })(ProjectOAuth2MicrosoftPrompt || (ProjectOAuth2MicrosoftPrompt = {}));
48466
+
47145
48467
  var ProjectOAuth2OidcPrompt;
47146
48468
  (function (ProjectOAuth2OidcPrompt) {
47147
48469
  ProjectOAuth2OidcPrompt["None"] = "none";
@@ -47150,6 +48472,24 @@ var ProjectOAuth2OidcPrompt;
47150
48472
  ProjectOAuth2OidcPrompt["SelectAccount"] = "select_account";
47151
48473
  })(ProjectOAuth2OidcPrompt || (ProjectOAuth2OidcPrompt = {}));
47152
48474
 
48475
+ var ProjectOAuth2OktaPrompt;
48476
+ (function (ProjectOAuth2OktaPrompt) {
48477
+ ProjectOAuth2OktaPrompt["None"] = "none";
48478
+ ProjectOAuth2OktaPrompt["Login"] = "login";
48479
+ ProjectOAuth2OktaPrompt["Consent"] = "consent";
48480
+ })(ProjectOAuth2OktaPrompt || (ProjectOAuth2OktaPrompt = {}));
48481
+
48482
+ var ProjectOAuth2SalesforcePrompt;
48483
+ (function (ProjectOAuth2SalesforcePrompt) {
48484
+ ProjectOAuth2SalesforcePrompt["Login"] = "login";
48485
+ ProjectOAuth2SalesforcePrompt["Consent"] = "consent";
48486
+ })(ProjectOAuth2SalesforcePrompt || (ProjectOAuth2SalesforcePrompt = {}));
48487
+
48488
+ var ProjectOAuth2ZohoPrompt;
48489
+ (function (ProjectOAuth2ZohoPrompt) {
48490
+ ProjectOAuth2ZohoPrompt["Consent"] = "consent";
48491
+ })(ProjectOAuth2ZohoPrompt || (ProjectOAuth2ZohoPrompt = {}));
48492
+
47153
48493
  var ProjectOAuthProviderId;
47154
48494
  (function (ProjectOAuthProviderId) {
47155
48495
  ProjectOAuthProviderId["Amazon"] = "amazon";
@@ -47209,6 +48549,7 @@ var ProjectPolicyId;
47209
48549
  ProjectPolicyId["Passwordhistory"] = "password-history";
47210
48550
  ProjectPolicyId["Passwordstrength"] = "password-strength";
47211
48551
  ProjectPolicyId["Passwordpersonaldata"] = "password-personal-data";
48552
+ ProjectPolicyId["Passwordpwned"] = "password-pwned";
47212
48553
  ProjectPolicyId["Sessionalert"] = "session-alert";
47213
48554
  ProjectPolicyId["Sessionduration"] = "session-duration";
47214
48555
  ProjectPolicyId["Sessioninvalidation"] = "session-invalidation";
@@ -47258,12 +48599,6 @@ var ProjectSMTPSecure;
47258
48599
  ProjectSMTPSecure["Ssl"] = "ssl";
47259
48600
  })(ProjectSMTPSecure || (ProjectSMTPSecure = {}));
47260
48601
 
47261
- var ProjectUsageRange;
47262
- (function (ProjectUsageRange) {
47263
- ProjectUsageRange["OneHour"] = "1h";
47264
- ProjectUsageRange["OneDay"] = "1d";
47265
- })(ProjectUsageRange || (ProjectUsageRange = {}));
47266
-
47267
48602
  var ScheduleResourceType;
47268
48603
  (function (ScheduleResourceType) {
47269
48604
  ScheduleResourceType["Function"] = "function";
@@ -47312,6 +48647,7 @@ var Framework;
47312
48647
  Framework["Remix"] = "remix";
47313
48648
  Framework["Lynx"] = "lynx";
47314
48649
  Framework["Flutter"] = "flutter";
48650
+ Framework["Jaspr"] = "jaspr";
47315
48651
  Framework["Reactnative"] = "react-native";
47316
48652
  Framework["Vite"] = "vite";
47317
48653
  Framework["Other"] = "other";
@@ -47351,6 +48687,9 @@ var BuildRuntime;
47351
48687
  BuildRuntime["Pythonml311"] = "python-ml-3.11";
47352
48688
  BuildRuntime["Pythonml312"] = "python-ml-3.12";
47353
48689
  BuildRuntime["Pythonml313"] = "python-ml-3.13";
48690
+ BuildRuntime["Deno121"] = "deno-1.21";
48691
+ BuildRuntime["Deno124"] = "deno-1.24";
48692
+ BuildRuntime["Deno135"] = "deno-1.35";
47354
48693
  BuildRuntime["Deno140"] = "deno-1.40";
47355
48694
  BuildRuntime["Deno146"] = "deno-1.46";
47356
48695
  BuildRuntime["Deno20"] = "deno-2.0";
@@ -47768,6 +49107,17 @@ var ExecutionStatus;
47768
49107
  ExecutionStatus["Scheduled"] = "scheduled";
47769
49108
  })(ExecutionStatus || (ExecutionStatus = {}));
47770
49109
 
49110
+ var OAuth2GithubPrompt;
49111
+ (function (OAuth2GithubPrompt) {
49112
+ OAuth2GithubPrompt["SelectAccount"] = "select_account";
49113
+ })(OAuth2GithubPrompt || (OAuth2GithubPrompt = {}));
49114
+
49115
+ var OAuth2DiscordPrompt;
49116
+ (function (OAuth2DiscordPrompt) {
49117
+ OAuth2DiscordPrompt["None"] = "none";
49118
+ OAuth2DiscordPrompt["Consent"] = "consent";
49119
+ })(OAuth2DiscordPrompt || (OAuth2DiscordPrompt = {}));
49120
+
47771
49121
  var OAuth2GooglePrompt;
47772
49122
  (function (OAuth2GooglePrompt) {
47773
49123
  OAuth2GooglePrompt["None"] = "none";
@@ -47775,6 +49125,24 @@ var OAuth2GooglePrompt;
47775
49125
  OAuth2GooglePrompt["SelectAccount"] = "select_account";
47776
49126
  })(OAuth2GooglePrompt || (OAuth2GooglePrompt = {}));
47777
49127
 
49128
+ var OAuth2ZohoPrompt;
49129
+ (function (OAuth2ZohoPrompt) {
49130
+ OAuth2ZohoPrompt["Consent"] = "consent";
49131
+ })(OAuth2ZohoPrompt || (OAuth2ZohoPrompt = {}));
49132
+
49133
+ var OAuth2SalesforcePrompt;
49134
+ (function (OAuth2SalesforcePrompt) {
49135
+ OAuth2SalesforcePrompt["Login"] = "login";
49136
+ OAuth2SalesforcePrompt["Consent"] = "consent";
49137
+ })(OAuth2SalesforcePrompt || (OAuth2SalesforcePrompt = {}));
49138
+
49139
+ var OAuth2Auth0Prompt;
49140
+ (function (OAuth2Auth0Prompt) {
49141
+ OAuth2Auth0Prompt["None"] = "none";
49142
+ OAuth2Auth0Prompt["Login"] = "login";
49143
+ OAuth2Auth0Prompt["Consent"] = "consent";
49144
+ })(OAuth2Auth0Prompt || (OAuth2Auth0Prompt = {}));
49145
+
47778
49146
  var OAuth2OidcPrompt;
47779
49147
  (function (OAuth2OidcPrompt) {
47780
49148
  OAuth2OidcPrompt["None"] = "none";
@@ -47783,6 +49151,29 @@ var OAuth2OidcPrompt;
47783
49151
  OAuth2OidcPrompt["SelectAccount"] = "select_account";
47784
49152
  })(OAuth2OidcPrompt || (OAuth2OidcPrompt = {}));
47785
49153
 
49154
+ var OAuth2OktaPrompt;
49155
+ (function (OAuth2OktaPrompt) {
49156
+ OAuth2OktaPrompt["None"] = "none";
49157
+ OAuth2OktaPrompt["Login"] = "login";
49158
+ OAuth2OktaPrompt["Consent"] = "consent";
49159
+ })(OAuth2OktaPrompt || (OAuth2OktaPrompt = {}));
49160
+
49161
+ var OAuth2MicrosoftPrompt;
49162
+ (function (OAuth2MicrosoftPrompt) {
49163
+ OAuth2MicrosoftPrompt["None"] = "none";
49164
+ OAuth2MicrosoftPrompt["Login"] = "login";
49165
+ OAuth2MicrosoftPrompt["Consent"] = "consent";
49166
+ OAuth2MicrosoftPrompt["SelectAccount"] = "select_account";
49167
+ })(OAuth2MicrosoftPrompt || (OAuth2MicrosoftPrompt = {}));
49168
+
49169
+ var OAuth2KakaoPrompt;
49170
+ (function (OAuth2KakaoPrompt) {
49171
+ OAuth2KakaoPrompt["None"] = "none";
49172
+ OAuth2KakaoPrompt["Login"] = "login";
49173
+ OAuth2KakaoPrompt["Create"] = "create";
49174
+ OAuth2KakaoPrompt["SelectAccount"] = "select_account";
49175
+ })(OAuth2KakaoPrompt || (OAuth2KakaoPrompt = {}));
49176
+
47786
49177
  var PlatformType;
47787
49178
  (function (PlatformType) {
47788
49179
  PlatformType["Windows"] = "windows";
@@ -47816,7 +49207,8 @@ var MessageStatus;
47816
49207
 
47817
49208
  var BillingPlanGroup;
47818
49209
  (function (BillingPlanGroup) {
47819
- BillingPlanGroup["Starter"] = "starter";
49210
+ BillingPlanGroup["Free"] = "free";
49211
+ BillingPlanGroup["Start"] = "start";
47820
49212
  BillingPlanGroup["Pro"] = "pro";
47821
49213
  BillingPlanGroup["Scale"] = "scale";
47822
49214
  })(BillingPlanGroup || (BillingPlanGroup = {}));
@@ -47850,5 +49242,5 @@ var WafRuleAction;
47850
49242
  WafRuleAction["Redirect"] = "redirect";
47851
49243
  })(WafRuleAction || (WafRuleAction = {}));
47852
49244
 
47853
- export { Account, AccountKeyScopes, Activities, Adapter, AddonKey, Advisor, Affiliates, Apps, AppwriteException, AppwriteMigrationResource, Assistant, AttributeStatus, AuthenticationFactor, AuthenticatorType, Avatars, BackupServices, Backups, BillingPlanGroup, BlockMode, BlockResourceType, Browser, BrowserPermission, BrowserTheme, BuildRuntime, CacheDatabase, CacheTarget, Channel, Client, ColumnStatus, Compression, Condition, Console, ConsoleResourceType, CreditCard, DatabaseStatus, DatabaseType, Databases, DatabasesIndexType, DeploymentDownloadType, DeploymentStatus, DetectionFrameworkType, DetectionRuntimeType, DocumentsDB, DocumentsDBIndexType, DomainPurchaseStatus, DomainRegistrationType, DomainSuggestionType, DomainTransferStatusEnum, Domains, EmbeddingModel, Embeddings, ExecutionMethod, ExecutionResourceType, ExecutionStatus, ExecutionTrigger, FirebaseMigrationResource, Flag, Framework, FunctionTemplateUseCase, Functions, Graphql, ID, ImageFormat, ImageGravity, IndexStatus, InvalidationType, Locale, Manager, MessagePriority, MessageStatus, Messaging, MessagingProviderType, Migrations, Mongo, Mysql, NHostMigrationResource, Notifications, OAuth2GooglePrompt, OAuth2OidcPrompt, OAuthProvider, Oauth2, OnDuplicate, Operator, OrderBy, Organization, OrganizationKeyScopes, Organizations, PasswordHash, Permission, Platform, PlatformType, Postgresql, Presences, Project, ProjectAuthMethodId, ProjectEmailTemplateId, ProjectEmailTemplateLocale, ProjectKeyScopes, ProjectOAuth2GooglePrompt, ProjectOAuth2OidcPrompt, ProjectOAuthProviderId, ProjectPolicyId, ProjectProtocolId, ProjectSMTPSecure, ProjectServiceId, ProjectUsageRange, Projects, Proxy, ProxyResourceType, ProxyRuleDeploymentResourceType, ProxyRuleStatus, Query, QuerySuggestionResource, Realtime, Region, RelationMutate, RelationshipType, Role, Runtime, ScheduleResourceType, SiteTemplateUseCase, Sites, SmtpEncryption, Status, StatusCode, Storage, SupabaseMigrationResource, TablesDB, TablesDBIndexType, Teams, TemplateReferenceType, Timezone, Tokens, Usage, UsageEventDimension, UsageEventMetric, UsageGaugeDimension, UsageGaugeMetric, UsageInterval, UsageOrderBy, UsageOrderDirection, UsageRange, Users, VCSDetectionType, VCSReferenceType, Vcs, VectorsDB, VectorsDBIndexType, Waf, WafRuleAction, Webhooks };
49245
+ export { Account, AccountKeyScopes, Activities, Adapter, AddonKey, Advisor, Affiliates, Apps, AppwriteException, AppwriteMigrationResource, Assistant, AttributeStatus, AuthenticationFactor, AuthenticatorType, Avatars, BackupServices, Backups, BillingPlanGroup, BlockMode, BlockResourceType, Browser, BrowserPermission, BrowserTheme, BuildRuntime, CacheDatabase, CacheTarget, Channel, Client, ColumnStatus, Compression, Condition, Console, ConsoleResourceType, ConversationType, CreditCard, DatabaseStatus, DatabaseType, Databases, DatabasesIndexType, DeploymentDownloadType, DeploymentStatus, DetectionFrameworkType, DetectionRuntimeType, DocumentsDB, DocumentsDBIndexType, DomainPurchaseStatus, DomainRegistrationType, DomainSuggestionType, DomainTransferStatusEnum, Domains, EmbeddingModel, Embeddings, ExecutionMethod, ExecutionResourceType, ExecutionStatus, ExecutionTrigger, FirebaseMigrationResource, Flag, Framework, FunctionTemplateUseCase, Functions, Graphql, Growth, ID, IdTokenProvider, ImageFormat, ImageGravity, IndexStatus, InvalidationType, Locale, Manager, MessagePriority, MessageStatus, Messaging, MessagingProviderType, Migrations, Mongo, Mysql, NHostMigrationResource, Notifications, OAuth2Auth0Prompt, OAuth2DiscordPrompt, OAuth2GithubPrompt, OAuth2GooglePrompt, OAuth2KakaoPrompt, OAuth2MicrosoftPrompt, OAuth2OidcPrompt, OAuth2OktaPrompt, OAuth2SalesforcePrompt, OAuth2ZohoPrompt, OAuthProvider, Oauth2, OnDuplicate, Operator, OrderBy, Organization, OrganizationKeyScopes, Organizations, PasswordHash, Permission, Platform, PlatformType, Postgresql, Presences, Project, ProjectAuthMethodId, ProjectEmailTemplateId, ProjectEmailTemplateLocale, ProjectKeyScopes, ProjectOAuth2Auth0Prompt, ProjectOAuth2DiscordPrompt, ProjectOAuth2GitHubPrompt, ProjectOAuth2GooglePrompt, ProjectOAuth2KakaoPrompt, ProjectOAuth2MicrosoftPrompt, ProjectOAuth2OidcPrompt, ProjectOAuth2OktaPrompt, ProjectOAuth2SalesforcePrompt, ProjectOAuth2ZohoPrompt, ProjectOAuthProviderId, ProjectPolicyId, ProjectProtocolId, ProjectSMTPSecure, ProjectServiceId, Projects, Proxy, ProxyResourceType, ProxyRuleDeploymentResourceType, ProxyRuleStatus, Push, Query, QuerySuggestionResource, Realtime, Region, RelationMutate, RelationshipType, ResolvedTopic, Role, Runtime, ScheduleResourceType, SiteTemplateUseCase, Sites, SmtpEncryption, Status, StatusCode, Storage, SupabaseMigrationResource, TablesDB, TablesDBIndexType, Teams, TemplateReferenceType, Timezone, Tokens, Topic, Usage, UsageEventDimension, UsageEventMetric, UsageGaugeDimension, UsageGaugeMetric, UsageInterval, UsageOrderBy, UsageOrderDirection, UsageRange, Users, VCSDetectionType, VCSReferenceType, Vcs, VectorsDB, VectorsDBIndexType, Waf, WafRuleAction, Webhooks };
47854
49246
  //# sourceMappingURL=sdk.js.map