@appwrite.io/console 18.3.0 → 18.4.0-rc.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/iife/sdk.js CHANGED
@@ -4467,7 +4467,7 @@
4467
4467
  'x-sdk-name': 'Console',
4468
4468
  'x-sdk-platform': 'console',
4469
4469
  'x-sdk-language': 'web',
4470
- 'x-sdk-version': '18.3.0',
4470
+ 'x-sdk-version': '18.4.0-rc.2',
4471
4471
  'X-Appwrite-Response-Format': '2.3.0',
4472
4472
  };
4473
4473
  this.realtime = {
@@ -5320,29 +5320,6 @@
5320
5320
  }
5321
5321
  Client.CHUNK_SIZE = 1024 * 1024 * 5;
5322
5322
 
5323
- class Service {
5324
- constructor(client) {
5325
- this.client = client;
5326
- }
5327
- static flatten(data, prefix = '') {
5328
- let output = {};
5329
- for (const [key, value] of Object.entries(data)) {
5330
- const finalKey = prefix ? prefix + '[' + key + ']' : key;
5331
- if (Array.isArray(value)) {
5332
- output = Object.assign(Object.assign({}, output), Service.flatten(value, finalKey));
5333
- }
5334
- else {
5335
- output[finalKey] = value;
5336
- }
5337
- }
5338
- return output;
5339
- }
5340
- }
5341
- /**
5342
- * The size for chunked uploads in bytes.
5343
- */
5344
- Service.CHUNK_SIZE = 5 * 1024 * 1024; // 5MB
5345
-
5346
5323
  class Account {
5347
5324
  constructor(client) {
5348
5325
  this.client = client;
@@ -6661,6 +6638,196 @@
6661
6638
  };
6662
6639
  return this.client.call('patch', uri, apiHeaders, apiPayload);
6663
6640
  }
6641
+ listPasskeys(paramsOrFirst, ...rest) {
6642
+ let params;
6643
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
6644
+ (paramsOrFirst &&
6645
+ typeof paramsOrFirst === 'object' &&
6646
+ !Array.isArray(paramsOrFirst))) {
6647
+ params = (paramsOrFirst || {});
6648
+ }
6649
+ else {
6650
+ params = {
6651
+ queries: paramsOrFirst,
6652
+ total: rest[0],
6653
+ };
6654
+ }
6655
+ const queries = params.queries;
6656
+ const total = params.total;
6657
+ const apiPath = '/account/passkeys';
6658
+ const apiPayload = {};
6659
+ if (typeof queries !== 'undefined') {
6660
+ apiPayload['queries'] = queries;
6661
+ }
6662
+ if (typeof total !== 'undefined') {
6663
+ apiPayload['total'] = total;
6664
+ }
6665
+ const uri = new URL(this.client.config.endpoint + apiPath);
6666
+ const apiHeaders = {
6667
+ 'X-Appwrite-Project': this.client.config.project,
6668
+ accept: 'application/json',
6669
+ };
6670
+ return this.client.call('get', uri, apiHeaders, apiPayload);
6671
+ }
6672
+ createPasskey(paramsOrFirst, ...rest) {
6673
+ let params;
6674
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
6675
+ (paramsOrFirst &&
6676
+ typeof paramsOrFirst === 'object' &&
6677
+ !Array.isArray(paramsOrFirst))) {
6678
+ params = (paramsOrFirst || {});
6679
+ }
6680
+ else {
6681
+ params = {
6682
+ passkeyId: paramsOrFirst,
6683
+ name: rest[0],
6684
+ };
6685
+ }
6686
+ const passkeyId = params.passkeyId;
6687
+ const name = params.name;
6688
+ const apiPath = '/account/passkeys';
6689
+ const apiPayload = {};
6690
+ if (typeof passkeyId !== 'undefined') {
6691
+ apiPayload['passkeyId'] = passkeyId;
6692
+ }
6693
+ if (typeof name !== 'undefined') {
6694
+ apiPayload['name'] = name;
6695
+ }
6696
+ const uri = new URL(this.client.config.endpoint + apiPath);
6697
+ const apiHeaders = {
6698
+ 'X-Appwrite-Project': this.client.config.project,
6699
+ 'content-type': 'application/json',
6700
+ accept: 'application/json',
6701
+ };
6702
+ return this.client.call('post', uri, apiHeaders, apiPayload);
6703
+ }
6704
+ getPasskey(paramsOrFirst) {
6705
+ let params;
6706
+ if (paramsOrFirst &&
6707
+ typeof paramsOrFirst === 'object' &&
6708
+ !Array.isArray(paramsOrFirst)) {
6709
+ params = (paramsOrFirst || {});
6710
+ }
6711
+ else {
6712
+ params = {
6713
+ passkeyId: paramsOrFirst,
6714
+ };
6715
+ }
6716
+ const passkeyId = params.passkeyId;
6717
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
6718
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
6719
+ }
6720
+ const apiPath = '/account/passkeys/{passkeyId}'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
6721
+ const apiPayload = {};
6722
+ const uri = new URL(this.client.config.endpoint + apiPath);
6723
+ const apiHeaders = {
6724
+ 'X-Appwrite-Project': this.client.config.project,
6725
+ accept: 'application/json',
6726
+ };
6727
+ return this.client.call('get', uri, apiHeaders, apiPayload);
6728
+ }
6729
+ updatePasskey(paramsOrFirst, ...rest) {
6730
+ let params;
6731
+ if (paramsOrFirst &&
6732
+ typeof paramsOrFirst === 'object' &&
6733
+ !Array.isArray(paramsOrFirst)) {
6734
+ params = (paramsOrFirst || {});
6735
+ }
6736
+ else {
6737
+ params = {
6738
+ passkeyId: paramsOrFirst,
6739
+ name: rest[0],
6740
+ };
6741
+ }
6742
+ const passkeyId = params.passkeyId;
6743
+ const name = params.name;
6744
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
6745
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
6746
+ }
6747
+ if (typeof name === 'undefined') {
6748
+ throw new AppwriteException('Missing required parameter: "name"');
6749
+ }
6750
+ const apiPath = '/account/passkeys/{passkeyId}'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
6751
+ const apiPayload = {};
6752
+ if (typeof name !== 'undefined') {
6753
+ apiPayload['name'] = name;
6754
+ }
6755
+ const uri = new URL(this.client.config.endpoint + apiPath);
6756
+ const apiHeaders = {
6757
+ 'X-Appwrite-Project': this.client.config.project,
6758
+ 'content-type': 'application/json',
6759
+ accept: 'application/json',
6760
+ };
6761
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
6762
+ }
6763
+ deletePasskey(paramsOrFirst) {
6764
+ let params;
6765
+ if (paramsOrFirst &&
6766
+ typeof paramsOrFirst === 'object' &&
6767
+ !Array.isArray(paramsOrFirst)) {
6768
+ params = (paramsOrFirst || {});
6769
+ }
6770
+ else {
6771
+ params = {
6772
+ passkeyId: paramsOrFirst,
6773
+ };
6774
+ }
6775
+ const passkeyId = params.passkeyId;
6776
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
6777
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
6778
+ }
6779
+ const apiPath = '/account/passkeys/{passkeyId}'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
6780
+ const apiPayload = {};
6781
+ const uri = new URL(this.client.config.endpoint + apiPath);
6782
+ const apiHeaders = {
6783
+ 'X-Appwrite-Project': this.client.config.project,
6784
+ 'content-type': 'application/json',
6785
+ accept: 'application/json',
6786
+ };
6787
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
6788
+ }
6789
+ updatePasskeyVerification(paramsOrFirst, ...rest) {
6790
+ let params;
6791
+ if (paramsOrFirst &&
6792
+ typeof paramsOrFirst === 'object' &&
6793
+ !Array.isArray(paramsOrFirst)) {
6794
+ params = (paramsOrFirst || {});
6795
+ }
6796
+ else {
6797
+ params = {
6798
+ passkeyId: paramsOrFirst,
6799
+ challengeId: rest[0],
6800
+ credential: rest[1],
6801
+ };
6802
+ }
6803
+ const passkeyId = params.passkeyId;
6804
+ const challengeId = params.challengeId;
6805
+ const credential = params.credential;
6806
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
6807
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
6808
+ }
6809
+ if (typeof challengeId === 'undefined') {
6810
+ throw new AppwriteException('Missing required parameter: "challengeId"');
6811
+ }
6812
+ if (typeof credential === 'undefined') {
6813
+ throw new AppwriteException('Missing required parameter: "credential"');
6814
+ }
6815
+ const apiPath = '/account/passkeys/{passkeyId}/verification'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
6816
+ const apiPayload = {};
6817
+ if (typeof challengeId !== 'undefined') {
6818
+ apiPayload['challengeId'] = challengeId;
6819
+ }
6820
+ if (typeof credential !== 'undefined') {
6821
+ apiPayload['credential'] = credential;
6822
+ }
6823
+ const uri = new URL(this.client.config.endpoint + apiPath);
6824
+ const apiHeaders = {
6825
+ 'X-Appwrite-Project': this.client.config.project,
6826
+ 'content-type': 'application/json',
6827
+ accept: 'application/json',
6828
+ };
6829
+ return this.client.call('put', uri, apiHeaders, apiPayload);
6830
+ }
6664
6831
  updatePassword(paramsOrFirst, ...rest) {
6665
6832
  let params;
6666
6833
  if (paramsOrFirst &&
@@ -7404,7 +7571,7 @@
7404
7571
  }
7405
7572
  const uri = new URL(this.client.config.endpoint + apiPath);
7406
7573
  apiPayload['project'] = this.client.config.project;
7407
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
7574
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
7408
7575
  uri.searchParams.append(key, value);
7409
7576
  }
7410
7577
  if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {
@@ -7813,7 +7980,7 @@
7813
7980
  }
7814
7981
  const uri = new URL(this.client.config.endpoint + apiPath);
7815
7982
  apiPayload['project'] = this.client.config.project;
7816
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
7983
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
7817
7984
  uri.searchParams.append(key, value);
7818
7985
  }
7819
7986
  if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {
@@ -7824,6 +7991,60 @@
7824
7991
  return uri.toString();
7825
7992
  }
7826
7993
  }
7994
+ /**
7995
+ * Start signing in with a passkey. No email or user ID is needed: pass the returned `publicKey` options to `navigator.credentials.get()` and the user picks one of their passkeys. Then call [Update passkey token](/docs/references/cloud/client-web/account#updatePasskeyToken) with the credential to receive a token, and exchange it with [Create session](/docs/references/cloud/client-web/account#createSession). The challenge expires after 5 minutes.
7996
+ *
7997
+ * @throws {AppwriteException}
7998
+ * @returns {Promise<Models.PasskeyChallenge>}
7999
+ */
8000
+ createPasskeyToken() {
8001
+ const apiPath = '/account/tokens/passkey';
8002
+ const apiPayload = {};
8003
+ const uri = new URL(this.client.config.endpoint + apiPath);
8004
+ const apiHeaders = {
8005
+ 'X-Appwrite-Project': this.client.config.project,
8006
+ 'content-type': 'application/json',
8007
+ accept: 'application/json',
8008
+ };
8009
+ return this.client.call('post', uri, apiHeaders, apiPayload);
8010
+ }
8011
+ updatePasskeyToken(paramsOrFirst, ...rest) {
8012
+ let params;
8013
+ if (paramsOrFirst &&
8014
+ typeof paramsOrFirst === 'object' &&
8015
+ !Array.isArray(paramsOrFirst)) {
8016
+ params = (paramsOrFirst || {});
8017
+ }
8018
+ else {
8019
+ params = {
8020
+ challengeId: paramsOrFirst,
8021
+ credential: rest[0],
8022
+ };
8023
+ }
8024
+ const challengeId = params.challengeId;
8025
+ const credential = params.credential;
8026
+ if (typeof challengeId === 'undefined') {
8027
+ throw new AppwriteException('Missing required parameter: "challengeId"');
8028
+ }
8029
+ if (typeof credential === 'undefined') {
8030
+ throw new AppwriteException('Missing required parameter: "credential"');
8031
+ }
8032
+ const apiPath = '/account/tokens/passkey';
8033
+ const apiPayload = {};
8034
+ if (typeof challengeId !== 'undefined') {
8035
+ apiPayload['challengeId'] = challengeId;
8036
+ }
8037
+ if (typeof credential !== 'undefined') {
8038
+ apiPayload['credential'] = credential;
8039
+ }
8040
+ const uri = new URL(this.client.config.endpoint + apiPath);
8041
+ const apiHeaders = {
8042
+ 'X-Appwrite-Project': this.client.config.project,
8043
+ 'content-type': 'application/json',
8044
+ accept: 'application/json',
8045
+ };
8046
+ return this.client.call('put', uri, apiHeaders, apiPayload);
8047
+ }
7827
8048
  createPhoneToken(paramsOrFirst, ...rest) {
7828
8049
  let params;
7829
8050
  if (paramsOrFirst &&
@@ -8170,6 +8391,135 @@
8170
8391
  }
8171
8392
  }
8172
8393
 
8394
+ class Admin {
8395
+ constructor(client) {
8396
+ this.client = client;
8397
+ }
8398
+ /**
8399
+ * Delete everything cached from the platform database in the region serving the request.
8400
+ *
8401
+ * @throws {AppwriteException}
8402
+ * @returns {Promise<{}>}
8403
+ */
8404
+ deletePlatformCache() {
8405
+ const apiPath = '/admin/cache/platform';
8406
+ const apiPayload = {};
8407
+ const uri = new URL(this.client.config.endpoint + apiPath);
8408
+ const apiHeaders = {
8409
+ 'X-Appwrite-Project': this.client.config.project,
8410
+ 'content-type': 'application/json',
8411
+ accept: 'application/json',
8412
+ };
8413
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
8414
+ }
8415
+ deletePlatformResourceCache(paramsOrFirst, ...rest) {
8416
+ let params;
8417
+ if (paramsOrFirst &&
8418
+ typeof paramsOrFirst === 'object' &&
8419
+ !Array.isArray(paramsOrFirst) &&
8420
+ ('resourceType' in paramsOrFirst || 'resourceId' in paramsOrFirst)) {
8421
+ params = (paramsOrFirst || {});
8422
+ }
8423
+ else {
8424
+ params = {
8425
+ resourceType: paramsOrFirst,
8426
+ resourceId: rest[0],
8427
+ };
8428
+ }
8429
+ const resourceType = params.resourceType;
8430
+ const resourceId = params.resourceId;
8431
+ if (typeof resourceType === 'undefined') {
8432
+ throw new AppwriteException('Missing required parameter: "resourceType"');
8433
+ }
8434
+ const apiPath = '/admin/cache/platform/resources';
8435
+ const apiPayload = {};
8436
+ if (typeof resourceType !== 'undefined') {
8437
+ apiPayload['resourceType'] = resourceType;
8438
+ }
8439
+ if (typeof resourceId !== 'undefined') {
8440
+ apiPayload['resourceId'] = resourceId;
8441
+ }
8442
+ const uri = new URL(this.client.config.endpoint + apiPath);
8443
+ const apiHeaders = {
8444
+ 'X-Appwrite-Project': this.client.config.project,
8445
+ 'content-type': 'application/json',
8446
+ accept: 'application/json',
8447
+ };
8448
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
8449
+ }
8450
+ deleteProjectCache(paramsOrFirst) {
8451
+ let params;
8452
+ if (paramsOrFirst &&
8453
+ typeof paramsOrFirst === 'object' &&
8454
+ !Array.isArray(paramsOrFirst)) {
8455
+ params = (paramsOrFirst || {});
8456
+ }
8457
+ else {
8458
+ params = {
8459
+ projectId: paramsOrFirst,
8460
+ };
8461
+ }
8462
+ const projectId = params.projectId;
8463
+ if (typeof projectId === 'undefined') {
8464
+ throw new AppwriteException('Missing required parameter: "projectId"');
8465
+ }
8466
+ const apiPath = '/admin/cache/project';
8467
+ const apiPayload = {};
8468
+ if (typeof projectId !== 'undefined') {
8469
+ apiPayload['projectId'] = projectId;
8470
+ }
8471
+ const uri = new URL(this.client.config.endpoint + apiPath);
8472
+ const apiHeaders = {
8473
+ 'X-Appwrite-Project': this.client.config.project,
8474
+ 'content-type': 'application/json',
8475
+ accept: 'application/json',
8476
+ };
8477
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
8478
+ }
8479
+ deleteProjectResourceCache(paramsOrFirst, ...rest) {
8480
+ let params;
8481
+ if (paramsOrFirst &&
8482
+ typeof paramsOrFirst === 'object' &&
8483
+ !Array.isArray(paramsOrFirst)) {
8484
+ params = (paramsOrFirst || {});
8485
+ }
8486
+ else {
8487
+ params = {
8488
+ projectId: paramsOrFirst,
8489
+ resourceType: rest[0],
8490
+ resourceId: rest[1],
8491
+ };
8492
+ }
8493
+ const projectId = params.projectId;
8494
+ const resourceType = params.resourceType;
8495
+ const resourceId = params.resourceId;
8496
+ if (typeof projectId === 'undefined') {
8497
+ throw new AppwriteException('Missing required parameter: "projectId"');
8498
+ }
8499
+ if (typeof resourceType === 'undefined') {
8500
+ throw new AppwriteException('Missing required parameter: "resourceType"');
8501
+ }
8502
+ const apiPath = '/admin/cache/project/resources';
8503
+ const apiPayload = {};
8504
+ if (typeof projectId !== 'undefined') {
8505
+ apiPayload['projectId'] = projectId;
8506
+ }
8507
+ if (typeof resourceType !== 'undefined') {
8508
+ apiPayload['resourceType'] = resourceType;
8509
+ }
8510
+ if (typeof resourceId !== 'undefined') {
8511
+ apiPayload['resourceId'] = resourceId;
8512
+ }
8513
+ const uri = new URL(this.client.config.endpoint + apiPath);
8514
+ const apiHeaders = {
8515
+ 'X-Appwrite-Project': this.client.config.project,
8516
+ 'content-type': 'application/json',
8517
+ accept: 'application/json',
8518
+ };
8519
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
8520
+ }
8521
+ }
8522
+
8173
8523
  class Affiliates {
8174
8524
  constructor(client) {
8175
8525
  this.client = client;
@@ -8381,6 +8731,369 @@
8381
8731
  }
8382
8732
  }
8383
8733
 
8734
+ class Analytics {
8735
+ constructor(client) {
8736
+ this.client = client;
8737
+ }
8738
+ listProperties(paramsOrFirst, ...rest) {
8739
+ let params;
8740
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
8741
+ (paramsOrFirst &&
8742
+ typeof paramsOrFirst === 'object' &&
8743
+ !Array.isArray(paramsOrFirst))) {
8744
+ params = (paramsOrFirst || {});
8745
+ }
8746
+ else {
8747
+ params = {
8748
+ queries: paramsOrFirst,
8749
+ search: rest[0],
8750
+ total: rest[1],
8751
+ };
8752
+ }
8753
+ const queries = params.queries;
8754
+ const search = params.search;
8755
+ const total = params.total;
8756
+ const apiPath = '/analytics/properties';
8757
+ const apiPayload = {};
8758
+ if (typeof queries !== 'undefined') {
8759
+ apiPayload['queries'] = queries;
8760
+ }
8761
+ if (typeof search !== 'undefined') {
8762
+ apiPayload['search'] = search;
8763
+ }
8764
+ if (typeof total !== 'undefined') {
8765
+ apiPayload['total'] = total;
8766
+ }
8767
+ const uri = new URL(this.client.config.endpoint + apiPath);
8768
+ const apiHeaders = {
8769
+ 'X-Appwrite-Project': this.client.config.project,
8770
+ accept: 'application/json',
8771
+ };
8772
+ return this.client.call('get', uri, apiHeaders, apiPayload);
8773
+ }
8774
+ createProperty(paramsOrFirst, ...rest) {
8775
+ let params;
8776
+ if (paramsOrFirst &&
8777
+ typeof paramsOrFirst === 'object' &&
8778
+ !Array.isArray(paramsOrFirst)) {
8779
+ params = (paramsOrFirst || {});
8780
+ }
8781
+ else {
8782
+ params = {
8783
+ propertyId: paramsOrFirst,
8784
+ name: rest[0],
8785
+ domain: rest[1],
8786
+ timezone: rest[2],
8787
+ enabled: rest[3],
8788
+ xpublic: rest[4],
8789
+ allowedOrigins: rest[5],
8790
+ };
8791
+ }
8792
+ const propertyId = params.propertyId;
8793
+ const name = params.name;
8794
+ const domain = params.domain;
8795
+ const timezone = params.timezone;
8796
+ const enabled = params.enabled;
8797
+ const xpublic = params.xpublic;
8798
+ const allowedOrigins = params.allowedOrigins;
8799
+ if (typeof propertyId === 'undefined') {
8800
+ throw new AppwriteException('Missing required parameter: "propertyId"');
8801
+ }
8802
+ if (typeof name === 'undefined') {
8803
+ throw new AppwriteException('Missing required parameter: "name"');
8804
+ }
8805
+ const apiPath = '/analytics/properties';
8806
+ const apiPayload = {};
8807
+ if (typeof propertyId !== 'undefined') {
8808
+ apiPayload['propertyId'] = propertyId;
8809
+ }
8810
+ if (typeof name !== 'undefined') {
8811
+ apiPayload['name'] = name;
8812
+ }
8813
+ if (typeof domain !== 'undefined') {
8814
+ apiPayload['domain'] = domain;
8815
+ }
8816
+ if (typeof timezone !== 'undefined') {
8817
+ apiPayload['timezone'] = timezone;
8818
+ }
8819
+ if (typeof enabled !== 'undefined') {
8820
+ apiPayload['enabled'] = enabled;
8821
+ }
8822
+ if (typeof xpublic !== 'undefined') {
8823
+ apiPayload['public'] = xpublic;
8824
+ }
8825
+ if (typeof allowedOrigins !== 'undefined') {
8826
+ apiPayload['allowedOrigins'] = allowedOrigins;
8827
+ }
8828
+ const uri = new URL(this.client.config.endpoint + apiPath);
8829
+ const apiHeaders = {
8830
+ 'X-Appwrite-Project': this.client.config.project,
8831
+ 'content-type': 'application/json',
8832
+ accept: 'application/json',
8833
+ };
8834
+ return this.client.call('post', uri, apiHeaders, apiPayload);
8835
+ }
8836
+ getProperty(paramsOrFirst) {
8837
+ let params;
8838
+ if (paramsOrFirst &&
8839
+ typeof paramsOrFirst === 'object' &&
8840
+ !Array.isArray(paramsOrFirst)) {
8841
+ params = (paramsOrFirst || {});
8842
+ }
8843
+ else {
8844
+ params = {
8845
+ propertyId: paramsOrFirst,
8846
+ };
8847
+ }
8848
+ const propertyId = params.propertyId;
8849
+ if (typeof propertyId === 'undefined' || propertyId === '') {
8850
+ throw new AppwriteException('Missing required parameter: "propertyId"');
8851
+ }
8852
+ const apiPath = '/analytics/properties/{propertyId}'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
8853
+ const apiPayload = {};
8854
+ const uri = new URL(this.client.config.endpoint + apiPath);
8855
+ const apiHeaders = {
8856
+ 'X-Appwrite-Project': this.client.config.project,
8857
+ accept: 'application/json',
8858
+ };
8859
+ return this.client.call('get', uri, apiHeaders, apiPayload);
8860
+ }
8861
+ updateProperty(paramsOrFirst, ...rest) {
8862
+ let params;
8863
+ if (paramsOrFirst &&
8864
+ typeof paramsOrFirst === 'object' &&
8865
+ !Array.isArray(paramsOrFirst)) {
8866
+ params = (paramsOrFirst || {});
8867
+ }
8868
+ else {
8869
+ params = {
8870
+ propertyId: paramsOrFirst,
8871
+ name: rest[0],
8872
+ domain: rest[1],
8873
+ timezone: rest[2],
8874
+ enabled: rest[3],
8875
+ xpublic: rest[4],
8876
+ allowedOrigins: rest[5],
8877
+ };
8878
+ }
8879
+ const propertyId = params.propertyId;
8880
+ const name = params.name;
8881
+ const domain = params.domain;
8882
+ const timezone = params.timezone;
8883
+ const enabled = params.enabled;
8884
+ const xpublic = params.xpublic;
8885
+ const allowedOrigins = params.allowedOrigins;
8886
+ if (typeof propertyId === 'undefined' || propertyId === '') {
8887
+ throw new AppwriteException('Missing required parameter: "propertyId"');
8888
+ }
8889
+ const apiPath = '/analytics/properties/{propertyId}'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
8890
+ const apiPayload = {};
8891
+ if (typeof name !== 'undefined') {
8892
+ apiPayload['name'] = name;
8893
+ }
8894
+ if (typeof domain !== 'undefined') {
8895
+ apiPayload['domain'] = domain;
8896
+ }
8897
+ if (typeof timezone !== 'undefined') {
8898
+ apiPayload['timezone'] = timezone;
8899
+ }
8900
+ if (typeof enabled !== 'undefined') {
8901
+ apiPayload['enabled'] = enabled;
8902
+ }
8903
+ if (typeof xpublic !== 'undefined') {
8904
+ apiPayload['public'] = xpublic;
8905
+ }
8906
+ if (typeof allowedOrigins !== 'undefined') {
8907
+ apiPayload['allowedOrigins'] = allowedOrigins;
8908
+ }
8909
+ const uri = new URL(this.client.config.endpoint + apiPath);
8910
+ const apiHeaders = {
8911
+ 'X-Appwrite-Project': this.client.config.project,
8912
+ 'content-type': 'application/json',
8913
+ accept: 'application/json',
8914
+ };
8915
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
8916
+ }
8917
+ deleteProperty(paramsOrFirst) {
8918
+ let params;
8919
+ if (paramsOrFirst &&
8920
+ typeof paramsOrFirst === 'object' &&
8921
+ !Array.isArray(paramsOrFirst)) {
8922
+ params = (paramsOrFirst || {});
8923
+ }
8924
+ else {
8925
+ params = {
8926
+ propertyId: paramsOrFirst,
8927
+ };
8928
+ }
8929
+ const propertyId = params.propertyId;
8930
+ if (typeof propertyId === 'undefined' || propertyId === '') {
8931
+ throw new AppwriteException('Missing required parameter: "propertyId"');
8932
+ }
8933
+ const apiPath = '/analytics/properties/{propertyId}'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
8934
+ const apiPayload = {};
8935
+ const uri = new URL(this.client.config.endpoint + apiPath);
8936
+ const apiHeaders = {
8937
+ 'X-Appwrite-Project': this.client.config.project,
8938
+ 'content-type': 'application/json',
8939
+ accept: 'application/json',
8940
+ };
8941
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
8942
+ }
8943
+ createEvent(paramsOrFirst, ...rest) {
8944
+ let params;
8945
+ if (paramsOrFirst &&
8946
+ typeof paramsOrFirst === 'object' &&
8947
+ !Array.isArray(paramsOrFirst)) {
8948
+ params = (paramsOrFirst || {});
8949
+ }
8950
+ else {
8951
+ params = {
8952
+ propertyId: paramsOrFirst,
8953
+ name: rest[0],
8954
+ url: rest[1],
8955
+ domain: rest[2],
8956
+ referrer: rest[3],
8957
+ screenWidth: rest[4],
8958
+ sessionHash: rest[5],
8959
+ scrollDepth: rest[6],
8960
+ engagementTime: rest[7],
8961
+ props: rest[8],
8962
+ userId: rest[9],
8963
+ ip: rest[10],
8964
+ userAgent: rest[11],
8965
+ };
8966
+ }
8967
+ const propertyId = params.propertyId;
8968
+ const name = params.name;
8969
+ const url = params.url;
8970
+ const domain = params.domain;
8971
+ const referrer = params.referrer;
8972
+ const screenWidth = params.screenWidth;
8973
+ const sessionHash = params.sessionHash;
8974
+ const scrollDepth = params.scrollDepth;
8975
+ const engagementTime = params.engagementTime;
8976
+ const props = params.props;
8977
+ const userId = params.userId;
8978
+ const ip = params.ip;
8979
+ const userAgent = params.userAgent;
8980
+ if (typeof propertyId === 'undefined' || propertyId === '') {
8981
+ throw new AppwriteException('Missing required parameter: "propertyId"');
8982
+ }
8983
+ if (typeof name === 'undefined') {
8984
+ throw new AppwriteException('Missing required parameter: "name"');
8985
+ }
8986
+ if (typeof url === 'undefined') {
8987
+ throw new AppwriteException('Missing required parameter: "url"');
8988
+ }
8989
+ const apiPath = '/analytics/properties/{propertyId}/events'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
8990
+ const apiPayload = {};
8991
+ if (typeof name !== 'undefined') {
8992
+ apiPayload['name'] = name;
8993
+ }
8994
+ if (typeof url !== 'undefined') {
8995
+ apiPayload['url'] = url;
8996
+ }
8997
+ if (typeof domain !== 'undefined') {
8998
+ apiPayload['domain'] = domain;
8999
+ }
9000
+ if (typeof referrer !== 'undefined') {
9001
+ apiPayload['referrer'] = referrer;
9002
+ }
9003
+ if (typeof screenWidth !== 'undefined') {
9004
+ apiPayload['screenWidth'] = screenWidth;
9005
+ }
9006
+ if (typeof sessionHash !== 'undefined') {
9007
+ apiPayload['sessionHash'] = sessionHash;
9008
+ }
9009
+ if (typeof scrollDepth !== 'undefined') {
9010
+ apiPayload['scrollDepth'] = scrollDepth;
9011
+ }
9012
+ if (typeof engagementTime !== 'undefined') {
9013
+ apiPayload['engagementTime'] = engagementTime;
9014
+ }
9015
+ if (typeof props !== 'undefined') {
9016
+ apiPayload['props'] = props;
9017
+ }
9018
+ if (typeof userId !== 'undefined') {
9019
+ apiPayload['userId'] = userId;
9020
+ }
9021
+ if (typeof ip !== 'undefined') {
9022
+ apiPayload['ip'] = ip;
9023
+ }
9024
+ if (typeof userAgent !== 'undefined') {
9025
+ apiPayload['userAgent'] = userAgent;
9026
+ }
9027
+ const uri = new URL(this.client.config.endpoint + apiPath);
9028
+ const apiHeaders = {
9029
+ 'X-Appwrite-Project': this.client.config.project,
9030
+ 'content-type': 'application/json',
9031
+ accept: 'application/json',
9032
+ };
9033
+ return this.client.call('post', uri, apiHeaders, apiPayload);
9034
+ }
9035
+ listMetrics(paramsOrFirst, ...rest) {
9036
+ let params;
9037
+ if (paramsOrFirst &&
9038
+ typeof paramsOrFirst === 'object' &&
9039
+ !Array.isArray(paramsOrFirst)) {
9040
+ params = (paramsOrFirst || {});
9041
+ }
9042
+ else {
9043
+ params = {
9044
+ propertyId: paramsOrFirst,
9045
+ queries: rest[0],
9046
+ interval: rest[1],
9047
+ dimensions: rest[2],
9048
+ dateRange: rest[3],
9049
+ startAt: rest[4],
9050
+ endAt: rest[5],
9051
+ limit: rest[6],
9052
+ };
9053
+ }
9054
+ const propertyId = params.propertyId;
9055
+ const queries = params.queries;
9056
+ const interval = params.interval;
9057
+ const dimensions = params.dimensions;
9058
+ const dateRange = params.dateRange;
9059
+ const startAt = params.startAt;
9060
+ const endAt = params.endAt;
9061
+ const limit = params.limit;
9062
+ if (typeof propertyId === 'undefined' || propertyId === '') {
9063
+ throw new AppwriteException('Missing required parameter: "propertyId"');
9064
+ }
9065
+ const apiPath = '/analytics/properties/{propertyId}/metrics'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
9066
+ const apiPayload = {};
9067
+ if (typeof queries !== 'undefined') {
9068
+ apiPayload['queries'] = queries;
9069
+ }
9070
+ if (typeof interval !== 'undefined') {
9071
+ apiPayload['interval'] = interval;
9072
+ }
9073
+ if (typeof dimensions !== 'undefined') {
9074
+ apiPayload['dimensions'] = dimensions;
9075
+ }
9076
+ if (typeof dateRange !== 'undefined') {
9077
+ apiPayload['dateRange'] = dateRange;
9078
+ }
9079
+ if (typeof startAt !== 'undefined') {
9080
+ apiPayload['startAt'] = startAt;
9081
+ }
9082
+ if (typeof endAt !== 'undefined') {
9083
+ apiPayload['endAt'] = endAt;
9084
+ }
9085
+ if (typeof limit !== 'undefined') {
9086
+ apiPayload['limit'] = limit;
9087
+ }
9088
+ const uri = new URL(this.client.config.endpoint + apiPath);
9089
+ const apiHeaders = {
9090
+ 'X-Appwrite-Project': this.client.config.project,
9091
+ accept: 'application/json',
9092
+ };
9093
+ return this.client.call('get', uri, apiHeaders, apiPayload);
9094
+ }
9095
+ }
9096
+
8384
9097
  class Apps {
8385
9098
  constructor(client) {
8386
9099
  this.client = client;
@@ -9273,7 +9986,7 @@
9273
9986
  const uri = new URL(this.client.config.endpoint + apiPath);
9274
9987
  apiPayload['project'] = this.client.config.project;
9275
9988
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
9276
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
9989
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9277
9990
  uri.searchParams.append(key, value);
9278
9991
  }
9279
9992
  return uri.toString();
@@ -9318,7 +10031,7 @@
9318
10031
  const uri = new URL(this.client.config.endpoint + apiPath);
9319
10032
  apiPayload['project'] = this.client.config.project;
9320
10033
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
9321
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10034
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9322
10035
  uri.searchParams.append(key, value);
9323
10036
  }
9324
10037
  return uri.toString();
@@ -9347,7 +10060,7 @@
9347
10060
  const uri = new URL(this.client.config.endpoint + apiPath);
9348
10061
  apiPayload['project'] = this.client.config.project;
9349
10062
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
9350
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10063
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9351
10064
  uri.searchParams.append(key, value);
9352
10065
  }
9353
10066
  return uri.toString();
@@ -9392,7 +10105,7 @@
9392
10105
  const uri = new URL(this.client.config.endpoint + apiPath);
9393
10106
  apiPayload['project'] = this.client.config.project;
9394
10107
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
9395
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10108
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9396
10109
  uri.searchParams.append(key, value);
9397
10110
  }
9398
10111
  return uri.toString();
@@ -9431,7 +10144,7 @@
9431
10144
  const uri = new URL(this.client.config.endpoint + apiPath);
9432
10145
  apiPayload['project'] = this.client.config.project;
9433
10146
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
9434
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10147
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9435
10148
  uri.searchParams.append(key, value);
9436
10149
  }
9437
10150
  return uri.toString();
@@ -9473,7 +10186,7 @@
9473
10186
  const uri = new URL(this.client.config.endpoint + apiPath);
9474
10187
  apiPayload['project'] = this.client.config.project;
9475
10188
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
9476
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10189
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9477
10190
  uri.searchParams.append(key, value);
9478
10191
  }
9479
10192
  return uri.toString();
@@ -9535,7 +10248,7 @@
9535
10248
  const uri = new URL(this.client.config.endpoint + apiPath);
9536
10249
  apiPayload['project'] = this.client.config.project;
9537
10250
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
9538
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10251
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9539
10252
  uri.searchParams.append(key, value);
9540
10253
  }
9541
10254
  return uri.toString();
@@ -9629,7 +10342,7 @@
9629
10342
  const uri = new URL(this.client.config.endpoint + apiPath);
9630
10343
  apiPayload['project'] = this.client.config.project;
9631
10344
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
9632
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10345
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9633
10346
  uri.searchParams.append(key, value);
9634
10347
  }
9635
10348
  return uri.toString();
@@ -9753,7 +10466,7 @@
9753
10466
  const uri = new URL(this.client.config.endpoint + apiPath);
9754
10467
  apiPayload['project'] = this.client.config.project;
9755
10468
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
9756
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10469
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9757
10470
  uri.searchParams.append(key, value);
9758
10471
  }
9759
10472
  return uri.toString();
@@ -19339,7 +20052,7 @@
19339
20052
  const uri = new URL(this.client.config.endpoint + apiPath);
19340
20053
  apiPayload['project'] = this.client.config.project;
19341
20054
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
19342
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
20055
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
19343
20056
  uri.searchParams.append(key, value);
19344
20057
  }
19345
20058
  return uri.toString();
@@ -29978,7 +30691,7 @@
29978
30691
  const uri = new URL(this.client.config.endpoint + apiPath);
29979
30692
  apiPayload['project'] = this.client.config.project;
29980
30693
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
29981
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
30694
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
29982
30695
  uri.searchParams.append(key, value);
29983
30696
  }
29984
30697
  return uri.toString();
@@ -30085,7 +30798,7 @@
30085
30798
  const uri = new URL(this.client.config.endpoint + apiPath);
30086
30799
  apiPayload['project'] = this.client.config.project;
30087
30800
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
30088
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
30801
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
30089
30802
  uri.searchParams.append(key, value);
30090
30803
  }
30091
30804
  return uri.toString();
@@ -34866,11 +35579,13 @@
34866
35579
  platformId: paramsOrFirst,
34867
35580
  name: rest[0],
34868
35581
  applicationId: rest[1],
35582
+ fingerprints: rest[2],
34869
35583
  };
34870
35584
  }
34871
35585
  const platformId = params.platformId;
34872
35586
  const name = params.name;
34873
35587
  const applicationId = params.applicationId;
35588
+ const fingerprints = params.fingerprints;
34874
35589
  if (typeof platformId === 'undefined') {
34875
35590
  throw new AppwriteException('Missing required parameter: "platformId"');
34876
35591
  }
@@ -34891,6 +35606,9 @@
34891
35606
  if (typeof applicationId !== 'undefined') {
34892
35607
  apiPayload['applicationId'] = applicationId;
34893
35608
  }
35609
+ if (typeof fingerprints !== 'undefined') {
35610
+ apiPayload['fingerprints'] = fingerprints;
35611
+ }
34894
35612
  const uri = new URL(this.client.config.endpoint + apiPath);
34895
35613
  const apiHeaders = {
34896
35614
  'X-Appwrite-Project': this.client.config.project,
@@ -34911,11 +35629,13 @@
34911
35629
  platformId: paramsOrFirst,
34912
35630
  name: rest[0],
34913
35631
  applicationId: rest[1],
35632
+ fingerprints: rest[2],
34914
35633
  };
34915
35634
  }
34916
35635
  const platformId = params.platformId;
34917
35636
  const name = params.name;
34918
35637
  const applicationId = params.applicationId;
35638
+ const fingerprints = params.fingerprints;
34919
35639
  if (typeof platformId === 'undefined' || platformId === '') {
34920
35640
  throw new AppwriteException('Missing required parameter: "platformId"');
34921
35641
  }
@@ -34933,6 +35653,9 @@
34933
35653
  if (typeof applicationId !== 'undefined') {
34934
35654
  apiPayload['applicationId'] = applicationId;
34935
35655
  }
35656
+ if (typeof fingerprints !== 'undefined') {
35657
+ apiPayload['fingerprints'] = fingerprints;
35658
+ }
34936
35659
  const uri = new URL(this.client.config.endpoint + apiPath);
34937
35660
  const apiHeaders = {
34938
35661
  'X-Appwrite-Project': this.client.config.project,
@@ -35581,6 +36304,38 @@
35581
36304
  };
35582
36305
  return this.client.call('patch', uri, apiHeaders, apiPayload);
35583
36306
  }
36307
+ updatePasskeyPolicy(paramsOrFirst, ...rest) {
36308
+ let params;
36309
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
36310
+ (paramsOrFirst &&
36311
+ typeof paramsOrFirst === 'object' &&
36312
+ !Array.isArray(paramsOrFirst))) {
36313
+ params = (paramsOrFirst || {});
36314
+ }
36315
+ else {
36316
+ params = {
36317
+ rpId: paramsOrFirst,
36318
+ origins: rest[0],
36319
+ };
36320
+ }
36321
+ const rpId = params.rpId;
36322
+ const origins = params.origins;
36323
+ const apiPath = '/project/policies/passkey';
36324
+ const apiPayload = {};
36325
+ if (typeof rpId !== 'undefined') {
36326
+ apiPayload['rpId'] = rpId;
36327
+ }
36328
+ if (typeof origins !== 'undefined') {
36329
+ apiPayload['origins'] = origins;
36330
+ }
36331
+ const uri = new URL(this.client.config.endpoint + apiPath);
36332
+ const apiHeaders = {
36333
+ 'X-Appwrite-Project': this.client.config.project,
36334
+ 'content-type': 'application/json',
36335
+ accept: 'application/json',
36336
+ };
36337
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
36338
+ }
35584
36339
  updatePasswordDictionaryPolicy(paramsOrFirst) {
35585
36340
  let params;
35586
36341
  if (paramsOrFirst &&
@@ -38271,7 +39026,7 @@
38271
39026
  const uri = new URL(this.client.config.endpoint + apiPath);
38272
39027
  apiPayload['project'] = this.client.config.project;
38273
39028
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
38274
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
39029
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
38275
39030
  uri.searchParams.append(key, value);
38276
39031
  }
38277
39032
  return uri.toString();
@@ -39102,7 +39857,7 @@
39102
39857
  const uri = new URL(this.client.config.endpoint + apiPath);
39103
39858
  apiPayload['project'] = this.client.config.project;
39104
39859
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
39105
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
39860
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
39106
39861
  uri.searchParams.append(key, value);
39107
39862
  }
39108
39863
  return uri.toString();
@@ -39195,7 +39950,7 @@
39195
39950
  const uri = new URL(this.client.config.endpoint + apiPath);
39196
39951
  apiPayload['project'] = this.client.config.project;
39197
39952
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
39198
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
39953
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
39199
39954
  uri.searchParams.append(key, value);
39200
39955
  }
39201
39956
  return uri.toString();
@@ -39233,7 +39988,7 @@
39233
39988
  const uri = new URL(this.client.config.endpoint + apiPath);
39234
39989
  apiPayload['project'] = this.client.config.project;
39235
39990
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
39236
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
39991
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
39237
39992
  uri.searchParams.append(key, value);
39238
39993
  }
39239
39994
  return uri.toString();
@@ -43704,15 +44459,17 @@
43704
44459
  params = {
43705
44460
  teamId: paramsOrFirst,
43706
44461
  roles: rest[0],
43707
- email: rest[1],
43708
- userId: rest[2],
43709
- phone: rest[3],
43710
- url: rest[4],
43711
- name: rest[5],
44462
+ membershipId: rest[1],
44463
+ email: rest[2],
44464
+ userId: rest[3],
44465
+ phone: rest[4],
44466
+ url: rest[5],
44467
+ name: rest[6],
43712
44468
  };
43713
44469
  }
43714
44470
  const teamId = params.teamId;
43715
44471
  const roles = params.roles;
44472
+ const membershipId = params.membershipId;
43716
44473
  const email = params.email;
43717
44474
  const userId = params.userId;
43718
44475
  const phone = params.phone;
@@ -43726,6 +44483,9 @@
43726
44483
  }
43727
44484
  const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', encodeURIComponent(String(teamId)));
43728
44485
  const apiPayload = {};
44486
+ if (typeof membershipId !== 'undefined') {
44487
+ apiPayload['membershipId'] = membershipId;
44488
+ }
43729
44489
  if (typeof email !== 'undefined') {
43730
44490
  apiPayload['email'] = email;
43731
44491
  }
@@ -45544,6 +46304,106 @@
45544
46304
  };
45545
46305
  return this.client.call('patch', uri, apiHeaders, apiPayload);
45546
46306
  }
46307
+ listPasskeys(paramsOrFirst, ...rest) {
46308
+ let params;
46309
+ if (paramsOrFirst &&
46310
+ typeof paramsOrFirst === 'object' &&
46311
+ !Array.isArray(paramsOrFirst)) {
46312
+ params = (paramsOrFirst || {});
46313
+ }
46314
+ else {
46315
+ params = {
46316
+ userId: paramsOrFirst,
46317
+ queries: rest[0],
46318
+ total: rest[1],
46319
+ };
46320
+ }
46321
+ const userId = params.userId;
46322
+ const queries = params.queries;
46323
+ const total = params.total;
46324
+ if (typeof userId === 'undefined' || userId === '') {
46325
+ throw new AppwriteException('Missing required parameter: "userId"');
46326
+ }
46327
+ const apiPath = '/users/{userId}/passkeys'.replace('{userId}', encodeURIComponent(String(userId)));
46328
+ const apiPayload = {};
46329
+ if (typeof queries !== 'undefined') {
46330
+ apiPayload['queries'] = queries;
46331
+ }
46332
+ if (typeof total !== 'undefined') {
46333
+ apiPayload['total'] = total;
46334
+ }
46335
+ const uri = new URL(this.client.config.endpoint + apiPath);
46336
+ const apiHeaders = {
46337
+ 'X-Appwrite-Project': this.client.config.project,
46338
+ accept: 'application/json',
46339
+ };
46340
+ return this.client.call('get', uri, apiHeaders, apiPayload);
46341
+ }
46342
+ getPasskey(paramsOrFirst, ...rest) {
46343
+ let params;
46344
+ if (paramsOrFirst &&
46345
+ typeof paramsOrFirst === 'object' &&
46346
+ !Array.isArray(paramsOrFirst)) {
46347
+ params = (paramsOrFirst || {});
46348
+ }
46349
+ else {
46350
+ params = {
46351
+ userId: paramsOrFirst,
46352
+ passkeyId: rest[0],
46353
+ };
46354
+ }
46355
+ const userId = params.userId;
46356
+ const passkeyId = params.passkeyId;
46357
+ if (typeof userId === 'undefined' || userId === '') {
46358
+ throw new AppwriteException('Missing required parameter: "userId"');
46359
+ }
46360
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
46361
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
46362
+ }
46363
+ const apiPath = '/users/{userId}/passkeys/{passkeyId}'
46364
+ .replace('{userId}', encodeURIComponent(String(userId)))
46365
+ .replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
46366
+ const apiPayload = {};
46367
+ const uri = new URL(this.client.config.endpoint + apiPath);
46368
+ const apiHeaders = {
46369
+ 'X-Appwrite-Project': this.client.config.project,
46370
+ accept: 'application/json',
46371
+ };
46372
+ return this.client.call('get', uri, apiHeaders, apiPayload);
46373
+ }
46374
+ deletePasskey(paramsOrFirst, ...rest) {
46375
+ let params;
46376
+ if (paramsOrFirst &&
46377
+ typeof paramsOrFirst === 'object' &&
46378
+ !Array.isArray(paramsOrFirst)) {
46379
+ params = (paramsOrFirst || {});
46380
+ }
46381
+ else {
46382
+ params = {
46383
+ userId: paramsOrFirst,
46384
+ passkeyId: rest[0],
46385
+ };
46386
+ }
46387
+ const userId = params.userId;
46388
+ const passkeyId = params.passkeyId;
46389
+ if (typeof userId === 'undefined' || userId === '') {
46390
+ throw new AppwriteException('Missing required parameter: "userId"');
46391
+ }
46392
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
46393
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
46394
+ }
46395
+ const apiPath = '/users/{userId}/passkeys/{passkeyId}'
46396
+ .replace('{userId}', encodeURIComponent(String(userId)))
46397
+ .replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
46398
+ const apiPayload = {};
46399
+ const uri = new URL(this.client.config.endpoint + apiPath);
46400
+ const apiHeaders = {
46401
+ 'X-Appwrite-Project': this.client.config.project,
46402
+ 'content-type': 'application/json',
46403
+ accept: 'application/json',
46404
+ };
46405
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
46406
+ }
45547
46407
  updatePassword(paramsOrFirst, ...rest) {
45548
46408
  let params;
45549
46409
  if (paramsOrFirst &&
@@ -48050,11 +48910,11 @@
48050
48910
  }
48051
48911
  }
48052
48912
 
48053
- class Waf {
48913
+ class Videos {
48054
48914
  constructor(client) {
48055
48915
  this.client = client;
48056
48916
  }
48057
- listRules(paramsOrFirst, ...rest) {
48917
+ list(paramsOrFirst, ...rest) {
48058
48918
  let params;
48059
48919
  if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
48060
48920
  (paramsOrFirst &&
@@ -48072,7 +48932,7 @@
48072
48932
  const queries = params.queries;
48073
48933
  const search = params.search;
48074
48934
  const total = params.total;
48075
- const apiPath = '/waf/rules';
48935
+ const apiPath = '/videos';
48076
48936
  const apiPayload = {};
48077
48937
  if (typeof queries !== 'undefined') {
48078
48938
  apiPayload['queries'] = queries;
@@ -48090,7 +48950,7 @@
48090
48950
  };
48091
48951
  return this.client.call('get', uri, apiHeaders, apiPayload);
48092
48952
  }
48093
- createBypassRule(paramsOrFirst, ...rest) {
48953
+ create(paramsOrFirst, ...rest) {
48094
48954
  let params;
48095
48955
  if (paramsOrFirst &&
48096
48956
  typeof paramsOrFirst === 'object' &&
@@ -48099,59 +48959,31 @@
48099
48959
  }
48100
48960
  else {
48101
48961
  params = {
48102
- ruleId: paramsOrFirst,
48103
- resourceType: rest[0],
48962
+ bucketId: paramsOrFirst,
48963
+ fileId: rest[0],
48104
48964
  name: rest[1],
48105
- resourceId: rest[2],
48106
- description: rest[3],
48107
- priority: rest[4],
48108
- enabled: rest[5],
48109
- conditions: rest[6],
48110
48965
  };
48111
48966
  }
48112
- const ruleId = params.ruleId;
48113
- const resourceType = params.resourceType;
48967
+ const bucketId = params.bucketId;
48968
+ const fileId = params.fileId;
48114
48969
  const name = params.name;
48115
- const resourceId = params.resourceId;
48116
- const description = params.description;
48117
- const priority = params.priority;
48118
- const enabled = params.enabled;
48119
- const conditions = params.conditions;
48120
- if (typeof ruleId === 'undefined') {
48121
- throw new AppwriteException('Missing required parameter: "ruleId"');
48122
- }
48123
- if (typeof resourceType === 'undefined') {
48124
- throw new AppwriteException('Missing required parameter: "resourceType"');
48970
+ if (typeof bucketId === 'undefined') {
48971
+ throw new AppwriteException('Missing required parameter: "bucketId"');
48125
48972
  }
48126
- if (typeof name === 'undefined') {
48127
- throw new AppwriteException('Missing required parameter: "name"');
48973
+ if (typeof fileId === 'undefined') {
48974
+ throw new AppwriteException('Missing required parameter: "fileId"');
48128
48975
  }
48129
- const apiPath = '/waf/rules/bypass';
48976
+ const apiPath = '/videos';
48130
48977
  const apiPayload = {};
48131
- if (typeof ruleId !== 'undefined') {
48132
- apiPayload['ruleId'] = ruleId;
48133
- }
48134
- if (typeof resourceType !== 'undefined') {
48135
- apiPayload['resourceType'] = resourceType;
48978
+ if (typeof bucketId !== 'undefined') {
48979
+ apiPayload['bucketId'] = bucketId;
48136
48980
  }
48137
- if (typeof resourceId !== 'undefined') {
48138
- apiPayload['resourceId'] = resourceId;
48981
+ if (typeof fileId !== 'undefined') {
48982
+ apiPayload['fileId'] = fileId;
48139
48983
  }
48140
48984
  if (typeof name !== 'undefined') {
48141
48985
  apiPayload['name'] = name;
48142
48986
  }
48143
- if (typeof description !== 'undefined') {
48144
- apiPayload['description'] = description;
48145
- }
48146
- if (typeof priority !== 'undefined') {
48147
- apiPayload['priority'] = priority;
48148
- }
48149
- if (typeof enabled !== 'undefined') {
48150
- apiPayload['enabled'] = enabled;
48151
- }
48152
- if (typeof conditions !== 'undefined') {
48153
- apiPayload['conditions'] = conditions;
48154
- }
48155
48987
  const uri = new URL(this.client.config.endpoint + apiPath);
48156
48988
  const apiHeaders = {
48157
48989
  'X-Appwrite-Project': this.client.config.project,
@@ -48160,68 +48992,33 @@
48160
48992
  };
48161
48993
  return this.client.call('post', uri, apiHeaders, apiPayload);
48162
48994
  }
48163
- updateBypassRule(paramsOrFirst, ...rest) {
48995
+ listProfiles(paramsOrFirst) {
48164
48996
  let params;
48165
- if (paramsOrFirst &&
48166
- typeof paramsOrFirst === 'object' &&
48167
- !Array.isArray(paramsOrFirst)) {
48997
+ if (typeof paramsOrFirst === 'undefined' ||
48998
+ (paramsOrFirst &&
48999
+ typeof paramsOrFirst === 'object' &&
49000
+ !Array.isArray(paramsOrFirst))) {
48168
49001
  params = (paramsOrFirst || {});
48169
49002
  }
48170
49003
  else {
48171
49004
  params = {
48172
- ruleId: paramsOrFirst,
48173
- resourceType: rest[0],
48174
- resourceId: rest[1],
48175
- name: rest[2],
48176
- description: rest[3],
48177
- priority: rest[4],
48178
- enabled: rest[5],
48179
- conditions: rest[6],
49005
+ search: paramsOrFirst,
48180
49006
  };
48181
49007
  }
48182
- const ruleId = params.ruleId;
48183
- const resourceType = params.resourceType;
48184
- const resourceId = params.resourceId;
48185
- const name = params.name;
48186
- const description = params.description;
48187
- const priority = params.priority;
48188
- const enabled = params.enabled;
48189
- const conditions = params.conditions;
48190
- if (typeof ruleId === 'undefined' || ruleId === '') {
48191
- throw new AppwriteException('Missing required parameter: "ruleId"');
48192
- }
48193
- const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
49008
+ const search = params.search;
49009
+ const apiPath = '/videos/profiles';
48194
49010
  const apiPayload = {};
48195
- if (typeof resourceType !== 'undefined') {
48196
- apiPayload['resourceType'] = resourceType;
48197
- }
48198
- if (typeof resourceId !== 'undefined') {
48199
- apiPayload['resourceId'] = resourceId;
48200
- }
48201
- if (typeof name !== 'undefined') {
48202
- apiPayload['name'] = name;
48203
- }
48204
- if (typeof description !== 'undefined') {
48205
- apiPayload['description'] = description;
48206
- }
48207
- if (typeof priority !== 'undefined') {
48208
- apiPayload['priority'] = priority;
48209
- }
48210
- if (typeof enabled !== 'undefined') {
48211
- apiPayload['enabled'] = enabled;
48212
- }
48213
- if (typeof conditions !== 'undefined') {
48214
- apiPayload['conditions'] = conditions;
49011
+ if (typeof search !== 'undefined') {
49012
+ apiPayload['search'] = search;
48215
49013
  }
48216
49014
  const uri = new URL(this.client.config.endpoint + apiPath);
48217
49015
  const apiHeaders = {
48218
49016
  'X-Appwrite-Project': this.client.config.project,
48219
- 'content-type': 'application/json',
48220
49017
  accept: 'application/json',
48221
49018
  };
48222
- return this.client.call('patch', uri, apiHeaders, apiPayload);
49019
+ return this.client.call('get', uri, apiHeaders, apiPayload);
48223
49020
  }
48224
- createChallengeRule(paramsOrFirst, ...rest) {
49021
+ createProfile(paramsOrFirst, ...rest) {
48225
49022
  let params;
48226
49023
  if (paramsOrFirst &&
48227
49024
  typeof paramsOrFirst === 'object' &&
@@ -48230,73 +49027,49 @@
48230
49027
  }
48231
49028
  else {
48232
49029
  params = {
48233
- ruleId: paramsOrFirst,
48234
- resourceType: rest[0],
48235
- name: rest[1],
48236
- resourceId: rest[2],
48237
- description: rest[3],
48238
- challengeType: rest[4],
48239
- priority: rest[5],
48240
- enabled: rest[6],
48241
- conditions: rest[7],
48242
- difficulty: rest[8],
48243
- ttl: rest[9],
49030
+ name: paramsOrFirst,
49031
+ videoBitRate: rest[0],
49032
+ audioBitRate: rest[1],
49033
+ width: rest[2],
49034
+ height: rest[3],
48244
49035
  };
48245
49036
  }
48246
- const ruleId = params.ruleId;
48247
- const resourceType = params.resourceType;
48248
49037
  const name = params.name;
48249
- const resourceId = params.resourceId;
48250
- const description = params.description;
48251
- const challengeType = params.challengeType;
48252
- const priority = params.priority;
48253
- const enabled = params.enabled;
48254
- const conditions = params.conditions;
48255
- const difficulty = params.difficulty;
48256
- const ttl = params.ttl;
48257
- if (typeof ruleId === 'undefined') {
48258
- throw new AppwriteException('Missing required parameter: "ruleId"');
48259
- }
48260
- if (typeof resourceType === 'undefined') {
48261
- throw new AppwriteException('Missing required parameter: "resourceType"');
48262
- }
49038
+ const videoBitRate = params.videoBitRate;
49039
+ const audioBitRate = params.audioBitRate;
49040
+ const width = params.width;
49041
+ const height = params.height;
48263
49042
  if (typeof name === 'undefined') {
48264
49043
  throw new AppwriteException('Missing required parameter: "name"');
48265
49044
  }
48266
- const apiPath = '/waf/rules/challenge';
48267
- const apiPayload = {};
48268
- if (typeof ruleId !== 'undefined') {
48269
- apiPayload['ruleId'] = ruleId;
49045
+ if (typeof videoBitRate === 'undefined') {
49046
+ throw new AppwriteException('Missing required parameter: "videoBitRate"');
48270
49047
  }
48271
- if (typeof resourceType !== 'undefined') {
48272
- apiPayload['resourceType'] = resourceType;
49048
+ if (typeof audioBitRate === 'undefined') {
49049
+ throw new AppwriteException('Missing required parameter: "audioBitRate"');
48273
49050
  }
48274
- if (typeof resourceId !== 'undefined') {
48275
- apiPayload['resourceId'] = resourceId;
49051
+ if (typeof width === 'undefined') {
49052
+ throw new AppwriteException('Missing required parameter: "width"');
48276
49053
  }
49054
+ if (typeof height === 'undefined') {
49055
+ throw new AppwriteException('Missing required parameter: "height"');
49056
+ }
49057
+ const apiPath = '/videos/profiles';
49058
+ const apiPayload = {};
48277
49059
  if (typeof name !== 'undefined') {
48278
49060
  apiPayload['name'] = name;
48279
49061
  }
48280
- if (typeof description !== 'undefined') {
48281
- apiPayload['description'] = description;
48282
- }
48283
- if (typeof challengeType !== 'undefined') {
48284
- apiPayload['challengeType'] = challengeType;
48285
- }
48286
- if (typeof priority !== 'undefined') {
48287
- apiPayload['priority'] = priority;
48288
- }
48289
- if (typeof enabled !== 'undefined') {
48290
- apiPayload['enabled'] = enabled;
49062
+ if (typeof videoBitRate !== 'undefined') {
49063
+ apiPayload['videoBitRate'] = videoBitRate;
48291
49064
  }
48292
- if (typeof conditions !== 'undefined') {
48293
- apiPayload['conditions'] = conditions;
49065
+ if (typeof audioBitRate !== 'undefined') {
49066
+ apiPayload['audioBitRate'] = audioBitRate;
48294
49067
  }
48295
- if (typeof difficulty !== 'undefined') {
48296
- apiPayload['difficulty'] = difficulty;
49068
+ if (typeof width !== 'undefined') {
49069
+ apiPayload['width'] = width;
48297
49070
  }
48298
- if (typeof ttl !== 'undefined') {
48299
- apiPayload['ttl'] = ttl;
49071
+ if (typeof height !== 'undefined') {
49072
+ apiPayload['height'] = height;
48300
49073
  }
48301
49074
  const uri = new URL(this.client.config.endpoint + apiPath);
48302
49075
  const apiHeaders = {
@@ -48306,7 +49079,7 @@
48306
49079
  };
48307
49080
  return this.client.call('post', uri, apiHeaders, apiPayload);
48308
49081
  }
48309
- updateChallengeRule(paramsOrFirst, ...rest) {
49082
+ getProfile(paramsOrFirst) {
48310
49083
  let params;
48311
49084
  if (paramsOrFirst &&
48312
49085
  typeof paramsOrFirst === 'object' &&
@@ -48315,74 +49088,23 @@
48315
49088
  }
48316
49089
  else {
48317
49090
  params = {
48318
- ruleId: paramsOrFirst,
48319
- resourceType: rest[0],
48320
- resourceId: rest[1],
48321
- name: rest[2],
48322
- description: rest[3],
48323
- challengeType: rest[4],
48324
- priority: rest[5],
48325
- enabled: rest[6],
48326
- conditions: rest[7],
48327
- difficulty: rest[8],
48328
- ttl: rest[9],
49091
+ profileId: paramsOrFirst,
48329
49092
  };
48330
49093
  }
48331
- const ruleId = params.ruleId;
48332
- const resourceType = params.resourceType;
48333
- const resourceId = params.resourceId;
48334
- const name = params.name;
48335
- const description = params.description;
48336
- const challengeType = params.challengeType;
48337
- const priority = params.priority;
48338
- const enabled = params.enabled;
48339
- const conditions = params.conditions;
48340
- const difficulty = params.difficulty;
48341
- const ttl = params.ttl;
48342
- if (typeof ruleId === 'undefined' || ruleId === '') {
48343
- throw new AppwriteException('Missing required parameter: "ruleId"');
49094
+ const profileId = params.profileId;
49095
+ if (typeof profileId === 'undefined' || profileId === '') {
49096
+ throw new AppwriteException('Missing required parameter: "profileId"');
48344
49097
  }
48345
- const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
49098
+ const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
48346
49099
  const apiPayload = {};
48347
- if (typeof resourceType !== 'undefined') {
48348
- apiPayload['resourceType'] = resourceType;
48349
- }
48350
- if (typeof resourceId !== 'undefined') {
48351
- apiPayload['resourceId'] = resourceId;
48352
- }
48353
- if (typeof name !== 'undefined') {
48354
- apiPayload['name'] = name;
48355
- }
48356
- if (typeof description !== 'undefined') {
48357
- apiPayload['description'] = description;
48358
- }
48359
- if (typeof challengeType !== 'undefined') {
48360
- apiPayload['challengeType'] = challengeType;
48361
- }
48362
- if (typeof priority !== 'undefined') {
48363
- apiPayload['priority'] = priority;
48364
- }
48365
- if (typeof enabled !== 'undefined') {
48366
- apiPayload['enabled'] = enabled;
48367
- }
48368
- if (typeof conditions !== 'undefined') {
48369
- apiPayload['conditions'] = conditions;
48370
- }
48371
- if (typeof difficulty !== 'undefined') {
48372
- apiPayload['difficulty'] = difficulty;
48373
- }
48374
- if (typeof ttl !== 'undefined') {
48375
- apiPayload['ttl'] = ttl;
48376
- }
48377
49100
  const uri = new URL(this.client.config.endpoint + apiPath);
48378
49101
  const apiHeaders = {
48379
49102
  'X-Appwrite-Project': this.client.config.project,
48380
- 'content-type': 'application/json',
48381
49103
  accept: 'application/json',
48382
49104
  };
48383
- return this.client.call('patch', uri, apiHeaders, apiPayload);
49105
+ return this.client.call('get', uri, apiHeaders, apiPayload);
48384
49106
  }
48385
- createDenyRule(paramsOrFirst, ...rest) {
49107
+ updateProfile(paramsOrFirst, ...rest) {
48386
49108
  let params;
48387
49109
  if (paramsOrFirst &&
48388
49110
  typeof paramsOrFirst === 'object' &&
@@ -48391,58 +49113,54 @@
48391
49113
  }
48392
49114
  else {
48393
49115
  params = {
48394
- ruleId: paramsOrFirst,
48395
- resourceType: rest[0],
48396
- name: rest[1],
48397
- resourceId: rest[2],
48398
- description: rest[3],
48399
- priority: rest[4],
48400
- enabled: rest[5],
48401
- conditions: rest[6],
49116
+ profileId: paramsOrFirst,
49117
+ name: rest[0],
49118
+ videoBitRate: rest[1],
49119
+ audioBitRate: rest[2],
49120
+ width: rest[3],
49121
+ height: rest[4],
48402
49122
  };
48403
49123
  }
48404
- const ruleId = params.ruleId;
48405
- const resourceType = params.resourceType;
49124
+ const profileId = params.profileId;
48406
49125
  const name = params.name;
48407
- const resourceId = params.resourceId;
48408
- const description = params.description;
48409
- const priority = params.priority;
48410
- const enabled = params.enabled;
48411
- const conditions = params.conditions;
48412
- if (typeof ruleId === 'undefined') {
48413
- throw new AppwriteException('Missing required parameter: "ruleId"');
48414
- }
48415
- if (typeof resourceType === 'undefined') {
48416
- throw new AppwriteException('Missing required parameter: "resourceType"');
49126
+ const videoBitRate = params.videoBitRate;
49127
+ const audioBitRate = params.audioBitRate;
49128
+ const width = params.width;
49129
+ const height = params.height;
49130
+ if (typeof profileId === 'undefined' || profileId === '') {
49131
+ throw new AppwriteException('Missing required parameter: "profileId"');
48417
49132
  }
48418
49133
  if (typeof name === 'undefined') {
48419
49134
  throw new AppwriteException('Missing required parameter: "name"');
48420
49135
  }
48421
- const apiPath = '/waf/rules/deny';
48422
- const apiPayload = {};
48423
- if (typeof ruleId !== 'undefined') {
48424
- apiPayload['ruleId'] = ruleId;
49136
+ if (typeof videoBitRate === 'undefined') {
49137
+ throw new AppwriteException('Missing required parameter: "videoBitRate"');
48425
49138
  }
48426
- if (typeof resourceType !== 'undefined') {
48427
- apiPayload['resourceType'] = resourceType;
49139
+ if (typeof audioBitRate === 'undefined') {
49140
+ throw new AppwriteException('Missing required parameter: "audioBitRate"');
48428
49141
  }
48429
- if (typeof resourceId !== 'undefined') {
48430
- apiPayload['resourceId'] = resourceId;
49142
+ if (typeof width === 'undefined') {
49143
+ throw new AppwriteException('Missing required parameter: "width"');
48431
49144
  }
49145
+ if (typeof height === 'undefined') {
49146
+ throw new AppwriteException('Missing required parameter: "height"');
49147
+ }
49148
+ const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
49149
+ const apiPayload = {};
48432
49150
  if (typeof name !== 'undefined') {
48433
49151
  apiPayload['name'] = name;
48434
49152
  }
48435
- if (typeof description !== 'undefined') {
48436
- apiPayload['description'] = description;
49153
+ if (typeof videoBitRate !== 'undefined') {
49154
+ apiPayload['videoBitRate'] = videoBitRate;
48437
49155
  }
48438
- if (typeof priority !== 'undefined') {
48439
- apiPayload['priority'] = priority;
49156
+ if (typeof audioBitRate !== 'undefined') {
49157
+ apiPayload['audioBitRate'] = audioBitRate;
48440
49158
  }
48441
- if (typeof enabled !== 'undefined') {
48442
- apiPayload['enabled'] = enabled;
49159
+ if (typeof width !== 'undefined') {
49160
+ apiPayload['width'] = width;
48443
49161
  }
48444
- if (typeof conditions !== 'undefined') {
48445
- apiPayload['conditions'] = conditions;
49162
+ if (typeof height !== 'undefined') {
49163
+ apiPayload['height'] = height;
48446
49164
  }
48447
49165
  const uri = new URL(this.client.config.endpoint + apiPath);
48448
49166
  const apiHeaders = {
@@ -48450,9 +49168,9 @@
48450
49168
  'content-type': 'application/json',
48451
49169
  accept: 'application/json',
48452
49170
  };
48453
- return this.client.call('post', uri, apiHeaders, apiPayload);
49171
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
48454
49172
  }
48455
- updateDenyRule(paramsOrFirst, ...rest) {
49173
+ deleteProfile(paramsOrFirst) {
48456
49174
  let params;
48457
49175
  if (paramsOrFirst &&
48458
49176
  typeof paramsOrFirst === 'object' &&
@@ -48461,59 +49179,49 @@
48461
49179
  }
48462
49180
  else {
48463
49181
  params = {
48464
- ruleId: paramsOrFirst,
48465
- resourceType: rest[0],
48466
- resourceId: rest[1],
48467
- name: rest[2],
48468
- description: rest[3],
48469
- priority: rest[4],
48470
- enabled: rest[5],
48471
- conditions: rest[6],
49182
+ profileId: paramsOrFirst,
48472
49183
  };
48473
49184
  }
48474
- const ruleId = params.ruleId;
48475
- const resourceType = params.resourceType;
48476
- const resourceId = params.resourceId;
48477
- const name = params.name;
48478
- const description = params.description;
48479
- const priority = params.priority;
48480
- const enabled = params.enabled;
48481
- const conditions = params.conditions;
48482
- if (typeof ruleId === 'undefined' || ruleId === '') {
48483
- throw new AppwriteException('Missing required parameter: "ruleId"');
49185
+ const profileId = params.profileId;
49186
+ if (typeof profileId === 'undefined' || profileId === '') {
49187
+ throw new AppwriteException('Missing required parameter: "profileId"');
48484
49188
  }
48485
- const apiPath = '/waf/rules/deny/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
49189
+ const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
48486
49190
  const apiPayload = {};
48487
- if (typeof resourceType !== 'undefined') {
48488
- apiPayload['resourceType'] = resourceType;
48489
- }
48490
- if (typeof resourceId !== 'undefined') {
48491
- apiPayload['resourceId'] = resourceId;
48492
- }
48493
- if (typeof name !== 'undefined') {
48494
- apiPayload['name'] = name;
48495
- }
48496
- if (typeof description !== 'undefined') {
48497
- apiPayload['description'] = description;
48498
- }
48499
- if (typeof priority !== 'undefined') {
48500
- apiPayload['priority'] = priority;
49191
+ const uri = new URL(this.client.config.endpoint + apiPath);
49192
+ const apiHeaders = {
49193
+ 'X-Appwrite-Project': this.client.config.project,
49194
+ 'content-type': 'application/json',
49195
+ accept: 'application/json',
49196
+ };
49197
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
49198
+ }
49199
+ get(paramsOrFirst) {
49200
+ let params;
49201
+ if (paramsOrFirst &&
49202
+ typeof paramsOrFirst === 'object' &&
49203
+ !Array.isArray(paramsOrFirst)) {
49204
+ params = (paramsOrFirst || {});
48501
49205
  }
48502
- if (typeof enabled !== 'undefined') {
48503
- apiPayload['enabled'] = enabled;
49206
+ else {
49207
+ params = {
49208
+ videoId: paramsOrFirst,
49209
+ };
48504
49210
  }
48505
- if (typeof conditions !== 'undefined') {
48506
- apiPayload['conditions'] = conditions;
49211
+ const videoId = params.videoId;
49212
+ if (typeof videoId === 'undefined' || videoId === '') {
49213
+ throw new AppwriteException('Missing required parameter: "videoId"');
48507
49214
  }
49215
+ const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
49216
+ const apiPayload = {};
48508
49217
  const uri = new URL(this.client.config.endpoint + apiPath);
48509
49218
  const apiHeaders = {
48510
49219
  'X-Appwrite-Project': this.client.config.project,
48511
- 'content-type': 'application/json',
48512
49220
  accept: 'application/json',
48513
49221
  };
48514
- return this.client.call('patch', uri, apiHeaders, apiPayload);
49222
+ return this.client.call('get', uri, apiHeaders, apiPayload);
48515
49223
  }
48516
- createRateLimitRule(paramsOrFirst, ...rest) {
49224
+ update(paramsOrFirst, ...rest) {
48517
49225
  let params;
48518
49226
  if (paramsOrFirst &&
48519
49227
  typeof paramsOrFirst === 'object' &&
@@ -48522,71 +49230,1353 @@
48522
49230
  }
48523
49231
  else {
48524
49232
  params = {
48525
- ruleId: paramsOrFirst,
48526
- resourceType: rest[0],
48527
- name: rest[1],
48528
- limit: rest[2],
48529
- interval: rest[3],
48530
- resourceId: rest[4],
48531
- description: rest[5],
48532
- key: rest[6],
48533
- strategy: rest[7],
48534
- maxBucketSize: rest[8],
48535
- priority: rest[9],
48536
- enabled: rest[10],
48537
- conditions: rest[11],
49233
+ videoId: paramsOrFirst,
49234
+ name: rest[0],
48538
49235
  };
48539
49236
  }
48540
- const ruleId = params.ruleId;
48541
- const resourceType = params.resourceType;
49237
+ const videoId = params.videoId;
48542
49238
  const name = params.name;
48543
- const limit = params.limit;
48544
- const interval = params.interval;
48545
- const resourceId = params.resourceId;
48546
- const description = params.description;
48547
- const key = params.key;
48548
- const strategy = params.strategy;
48549
- const maxBucketSize = params.maxBucketSize;
48550
- const priority = params.priority;
48551
- const enabled = params.enabled;
48552
- const conditions = params.conditions;
48553
- if (typeof ruleId === 'undefined') {
48554
- throw new AppwriteException('Missing required parameter: "ruleId"');
48555
- }
48556
- if (typeof resourceType === 'undefined') {
48557
- throw new AppwriteException('Missing required parameter: "resourceType"');
49239
+ if (typeof videoId === 'undefined' || videoId === '') {
49240
+ throw new AppwriteException('Missing required parameter: "videoId"');
48558
49241
  }
48559
49242
  if (typeof name === 'undefined') {
48560
49243
  throw new AppwriteException('Missing required parameter: "name"');
48561
49244
  }
48562
- if (typeof limit === 'undefined') {
48563
- throw new AppwriteException('Missing required parameter: "limit"');
48564
- }
48565
- if (typeof interval === 'undefined') {
48566
- throw new AppwriteException('Missing required parameter: "interval"');
48567
- }
48568
- const apiPath = '/waf/rules/rate-limit';
49245
+ const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
48569
49246
  const apiPayload = {};
48570
- if (typeof ruleId !== 'undefined') {
48571
- apiPayload['ruleId'] = ruleId;
48572
- }
48573
- if (typeof resourceType !== 'undefined') {
48574
- apiPayload['resourceType'] = resourceType;
48575
- }
48576
- if (typeof resourceId !== 'undefined') {
48577
- apiPayload['resourceId'] = resourceId;
48578
- }
48579
49247
  if (typeof name !== 'undefined') {
48580
49248
  apiPayload['name'] = name;
48581
49249
  }
48582
- if (typeof description !== 'undefined') {
48583
- apiPayload['description'] = description;
48584
- }
48585
- if (typeof limit !== 'undefined') {
48586
- apiPayload['limit'] = limit;
48587
- }
48588
- if (typeof interval !== 'undefined') {
48589
- apiPayload['interval'] = interval;
49250
+ const uri = new URL(this.client.config.endpoint + apiPath);
49251
+ const apiHeaders = {
49252
+ 'X-Appwrite-Project': this.client.config.project,
49253
+ 'content-type': 'application/json',
49254
+ accept: 'application/json',
49255
+ };
49256
+ return this.client.call('put', uri, apiHeaders, apiPayload);
49257
+ }
49258
+ delete(paramsOrFirst) {
49259
+ let params;
49260
+ if (paramsOrFirst &&
49261
+ typeof paramsOrFirst === 'object' &&
49262
+ !Array.isArray(paramsOrFirst)) {
49263
+ params = (paramsOrFirst || {});
49264
+ }
49265
+ else {
49266
+ params = {
49267
+ videoId: paramsOrFirst,
49268
+ };
49269
+ }
49270
+ const videoId = params.videoId;
49271
+ if (typeof videoId === 'undefined' || videoId === '') {
49272
+ throw new AppwriteException('Missing required parameter: "videoId"');
49273
+ }
49274
+ const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
49275
+ const apiPayload = {};
49276
+ const uri = new URL(this.client.config.endpoint + apiPath);
49277
+ const apiHeaders = {
49278
+ 'X-Appwrite-Project': this.client.config.project,
49279
+ 'content-type': 'application/json',
49280
+ accept: 'application/json',
49281
+ };
49282
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
49283
+ }
49284
+ getCmafHlsManifest(paramsOrFirst) {
49285
+ let params;
49286
+ if (paramsOrFirst &&
49287
+ typeof paramsOrFirst === 'object' &&
49288
+ !Array.isArray(paramsOrFirst)) {
49289
+ params = (paramsOrFirst || {});
49290
+ }
49291
+ else {
49292
+ params = {
49293
+ videoId: paramsOrFirst,
49294
+ };
49295
+ }
49296
+ const videoId = params.videoId;
49297
+ if (typeof videoId === 'undefined' || videoId === '') {
49298
+ throw new AppwriteException('Missing required parameter: "videoId"');
49299
+ }
49300
+ const apiPath = '/videos/{videoId}/outputs/cmaf/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
49301
+ const apiPayload = {};
49302
+ const uri = new URL(this.client.config.endpoint + apiPath);
49303
+ apiPayload['project'] = this.client.config.project;
49304
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49305
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49306
+ uri.searchParams.append(key, value);
49307
+ }
49308
+ return uri.toString();
49309
+ }
49310
+ getCmafDashManifest(paramsOrFirst) {
49311
+ let params;
49312
+ if (paramsOrFirst &&
49313
+ typeof paramsOrFirst === 'object' &&
49314
+ !Array.isArray(paramsOrFirst)) {
49315
+ params = (paramsOrFirst || {});
49316
+ }
49317
+ else {
49318
+ params = {
49319
+ videoId: paramsOrFirst,
49320
+ };
49321
+ }
49322
+ const videoId = params.videoId;
49323
+ if (typeof videoId === 'undefined' || videoId === '') {
49324
+ throw new AppwriteException('Missing required parameter: "videoId"');
49325
+ }
49326
+ const apiPath = '/videos/{videoId}/outputs/cmaf/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
49327
+ const apiPayload = {};
49328
+ const uri = new URL(this.client.config.endpoint + apiPath);
49329
+ apiPayload['project'] = this.client.config.project;
49330
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49331
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49332
+ uri.searchParams.append(key, value);
49333
+ }
49334
+ return uri.toString();
49335
+ }
49336
+ getCmafStreamManifest(paramsOrFirst, ...rest) {
49337
+ let params;
49338
+ if (paramsOrFirst &&
49339
+ typeof paramsOrFirst === 'object' &&
49340
+ !Array.isArray(paramsOrFirst)) {
49341
+ params = (paramsOrFirst || {});
49342
+ }
49343
+ else {
49344
+ params = {
49345
+ videoId: paramsOrFirst,
49346
+ renditionId: rest[0],
49347
+ streamId: rest[1],
49348
+ };
49349
+ }
49350
+ const videoId = params.videoId;
49351
+ const renditionId = params.renditionId;
49352
+ const streamId = params.streamId;
49353
+ if (typeof videoId === 'undefined' || videoId === '') {
49354
+ throw new AppwriteException('Missing required parameter: "videoId"');
49355
+ }
49356
+ if (typeof renditionId === 'undefined' || renditionId === '') {
49357
+ throw new AppwriteException('Missing required parameter: "renditionId"');
49358
+ }
49359
+ if (typeof streamId === 'undefined') {
49360
+ throw new AppwriteException('Missing required parameter: "streamId"');
49361
+ }
49362
+ const apiPath = '/videos/{videoId}/outputs/cmaf/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
49363
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
49364
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)))
49365
+ .replace('{streamId}', encodeURIComponent(String(streamId)));
49366
+ const apiPayload = {};
49367
+ const uri = new URL(this.client.config.endpoint + apiPath);
49368
+ apiPayload['project'] = this.client.config.project;
49369
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49370
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49371
+ uri.searchParams.append(key, value);
49372
+ }
49373
+ return uri.toString();
49374
+ }
49375
+ getDashManifest(paramsOrFirst) {
49376
+ let params;
49377
+ if (paramsOrFirst &&
49378
+ typeof paramsOrFirst === 'object' &&
49379
+ !Array.isArray(paramsOrFirst)) {
49380
+ params = (paramsOrFirst || {});
49381
+ }
49382
+ else {
49383
+ params = {
49384
+ videoId: paramsOrFirst,
49385
+ };
49386
+ }
49387
+ const videoId = params.videoId;
49388
+ if (typeof videoId === 'undefined' || videoId === '') {
49389
+ throw new AppwriteException('Missing required parameter: "videoId"');
49390
+ }
49391
+ const apiPath = '/videos/{videoId}/outputs/dash/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
49392
+ const apiPayload = {};
49393
+ const uri = new URL(this.client.config.endpoint + apiPath);
49394
+ apiPayload['project'] = this.client.config.project;
49395
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49396
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49397
+ uri.searchParams.append(key, value);
49398
+ }
49399
+ return uri.toString();
49400
+ }
49401
+ getHlsManifest(paramsOrFirst) {
49402
+ let params;
49403
+ if (paramsOrFirst &&
49404
+ typeof paramsOrFirst === 'object' &&
49405
+ !Array.isArray(paramsOrFirst)) {
49406
+ params = (paramsOrFirst || {});
49407
+ }
49408
+ else {
49409
+ params = {
49410
+ videoId: paramsOrFirst,
49411
+ };
49412
+ }
49413
+ const videoId = params.videoId;
49414
+ if (typeof videoId === 'undefined' || videoId === '') {
49415
+ throw new AppwriteException('Missing required parameter: "videoId"');
49416
+ }
49417
+ const apiPath = '/videos/{videoId}/outputs/hls/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
49418
+ const apiPayload = {};
49419
+ const uri = new URL(this.client.config.endpoint + apiPath);
49420
+ apiPayload['project'] = this.client.config.project;
49421
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49422
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49423
+ uri.searchParams.append(key, value);
49424
+ }
49425
+ return uri.toString();
49426
+ }
49427
+ getStreamManifest(paramsOrFirst, ...rest) {
49428
+ let params;
49429
+ if (paramsOrFirst &&
49430
+ typeof paramsOrFirst === 'object' &&
49431
+ !Array.isArray(paramsOrFirst)) {
49432
+ params = (paramsOrFirst || {});
49433
+ }
49434
+ else {
49435
+ params = {
49436
+ videoId: paramsOrFirst,
49437
+ renditionId: rest[0],
49438
+ streamId: rest[1],
49439
+ };
49440
+ }
49441
+ const videoId = params.videoId;
49442
+ const renditionId = params.renditionId;
49443
+ const streamId = params.streamId;
49444
+ if (typeof videoId === 'undefined' || videoId === '') {
49445
+ throw new AppwriteException('Missing required parameter: "videoId"');
49446
+ }
49447
+ if (typeof renditionId === 'undefined' || renditionId === '') {
49448
+ throw new AppwriteException('Missing required parameter: "renditionId"');
49449
+ }
49450
+ if (typeof streamId === 'undefined') {
49451
+ throw new AppwriteException('Missing required parameter: "streamId"');
49452
+ }
49453
+ const apiPath = '/videos/{videoId}/outputs/hls/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
49454
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
49455
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)))
49456
+ .replace('{streamId}', encodeURIComponent(String(streamId)));
49457
+ const apiPayload = {};
49458
+ const uri = new URL(this.client.config.endpoint + apiPath);
49459
+ apiPayload['project'] = this.client.config.project;
49460
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49461
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49462
+ uri.searchParams.append(key, value);
49463
+ }
49464
+ return uri.toString();
49465
+ }
49466
+ getSegment(paramsOrFirst, ...rest) {
49467
+ let params;
49468
+ if (paramsOrFirst &&
49469
+ typeof paramsOrFirst === 'object' &&
49470
+ !Array.isArray(paramsOrFirst)) {
49471
+ params = (paramsOrFirst || {});
49472
+ }
49473
+ else {
49474
+ params = {
49475
+ videoId: paramsOrFirst,
49476
+ output: rest[0],
49477
+ renditionId: rest[1],
49478
+ segmentId: rest[2],
49479
+ };
49480
+ }
49481
+ const videoId = params.videoId;
49482
+ const output = params.output;
49483
+ const renditionId = params.renditionId;
49484
+ const segmentId = params.segmentId;
49485
+ if (typeof videoId === 'undefined' || videoId === '') {
49486
+ throw new AppwriteException('Missing required parameter: "videoId"');
49487
+ }
49488
+ if (typeof output === 'undefined') {
49489
+ throw new AppwriteException('Missing required parameter: "output"');
49490
+ }
49491
+ if (typeof renditionId === 'undefined' || renditionId === '') {
49492
+ throw new AppwriteException('Missing required parameter: "renditionId"');
49493
+ }
49494
+ if (typeof segmentId === 'undefined' || segmentId === '') {
49495
+ throw new AppwriteException('Missing required parameter: "segmentId"');
49496
+ }
49497
+ const apiPath = '/videos/{videoId}/outputs/{output}/renditions/{renditionId}/segments/{segmentId}'
49498
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
49499
+ .replace('{output}', encodeURIComponent(String(output)))
49500
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)))
49501
+ .replace('{segmentId}', encodeURIComponent(String(segmentId)));
49502
+ const apiPayload = {};
49503
+ const uri = new URL(this.client.config.endpoint + apiPath);
49504
+ apiPayload['project'] = this.client.config.project;
49505
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49506
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49507
+ uri.searchParams.append(key, value);
49508
+ }
49509
+ return uri.toString();
49510
+ }
49511
+ getSubtitleManifest(paramsOrFirst, ...rest) {
49512
+ let params;
49513
+ if (paramsOrFirst &&
49514
+ typeof paramsOrFirst === 'object' &&
49515
+ !Array.isArray(paramsOrFirst)) {
49516
+ params = (paramsOrFirst || {});
49517
+ }
49518
+ else {
49519
+ params = {
49520
+ videoId: paramsOrFirst,
49521
+ output: rest[0],
49522
+ subtitleId: rest[1],
49523
+ };
49524
+ }
49525
+ const videoId = params.videoId;
49526
+ const output = params.output;
49527
+ const subtitleId = params.subtitleId;
49528
+ if (typeof videoId === 'undefined' || videoId === '') {
49529
+ throw new AppwriteException('Missing required parameter: "videoId"');
49530
+ }
49531
+ if (typeof output === 'undefined') {
49532
+ throw new AppwriteException('Missing required parameter: "output"');
49533
+ }
49534
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
49535
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
49536
+ }
49537
+ const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/manifest'
49538
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
49539
+ .replace('{output}', encodeURIComponent(String(output)))
49540
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
49541
+ const apiPayload = {};
49542
+ const uri = new URL(this.client.config.endpoint + apiPath);
49543
+ apiPayload['project'] = this.client.config.project;
49544
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49545
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49546
+ uri.searchParams.append(key, value);
49547
+ }
49548
+ return uri.toString();
49549
+ }
49550
+ getSubtitleSegment(paramsOrFirst, ...rest) {
49551
+ let params;
49552
+ if (paramsOrFirst &&
49553
+ typeof paramsOrFirst === 'object' &&
49554
+ !Array.isArray(paramsOrFirst)) {
49555
+ params = (paramsOrFirst || {});
49556
+ }
49557
+ else {
49558
+ params = {
49559
+ videoId: paramsOrFirst,
49560
+ output: rest[0],
49561
+ subtitleId: rest[1],
49562
+ segmentId: rest[2],
49563
+ };
49564
+ }
49565
+ const videoId = params.videoId;
49566
+ const output = params.output;
49567
+ const subtitleId = params.subtitleId;
49568
+ const segmentId = params.segmentId;
49569
+ if (typeof videoId === 'undefined' || videoId === '') {
49570
+ throw new AppwriteException('Missing required parameter: "videoId"');
49571
+ }
49572
+ if (typeof output === 'undefined') {
49573
+ throw new AppwriteException('Missing required parameter: "output"');
49574
+ }
49575
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
49576
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
49577
+ }
49578
+ if (typeof segmentId === 'undefined' || segmentId === '') {
49579
+ throw new AppwriteException('Missing required parameter: "segmentId"');
49580
+ }
49581
+ const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/segments/{segmentId}'
49582
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
49583
+ .replace('{output}', encodeURIComponent(String(output)))
49584
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)))
49585
+ .replace('{segmentId}', encodeURIComponent(String(segmentId)));
49586
+ const apiPayload = {};
49587
+ const uri = new URL(this.client.config.endpoint + apiPath);
49588
+ apiPayload['project'] = this.client.config.project;
49589
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49590
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49591
+ uri.searchParams.append(key, value);
49592
+ }
49593
+ return uri.toString();
49594
+ }
49595
+ getPreview(paramsOrFirst, ...rest) {
49596
+ let params;
49597
+ if (paramsOrFirst &&
49598
+ typeof paramsOrFirst === 'object' &&
49599
+ !Array.isArray(paramsOrFirst)) {
49600
+ params = (paramsOrFirst || {});
49601
+ }
49602
+ else {
49603
+ params = {
49604
+ videoId: paramsOrFirst,
49605
+ previewId: rest[0],
49606
+ width: rest[1],
49607
+ height: rest[2],
49608
+ output: rest[3],
49609
+ };
49610
+ }
49611
+ const videoId = params.videoId;
49612
+ const previewId = params.previewId;
49613
+ const width = params.width;
49614
+ const height = params.height;
49615
+ const output = params.output;
49616
+ if (typeof videoId === 'undefined' || videoId === '') {
49617
+ throw new AppwriteException('Missing required parameter: "videoId"');
49618
+ }
49619
+ if (typeof previewId === 'undefined' || previewId === '') {
49620
+ throw new AppwriteException('Missing required parameter: "previewId"');
49621
+ }
49622
+ const apiPath = '/videos/{videoId}/previews/{previewId}'
49623
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
49624
+ .replace('{previewId}', encodeURIComponent(String(previewId)));
49625
+ const apiPayload = {};
49626
+ if (typeof width !== 'undefined') {
49627
+ apiPayload['width'] = width;
49628
+ }
49629
+ if (typeof height !== 'undefined') {
49630
+ apiPayload['height'] = height;
49631
+ }
49632
+ if (typeof output !== 'undefined') {
49633
+ apiPayload['output'] = output;
49634
+ }
49635
+ const uri = new URL(this.client.config.endpoint + apiPath);
49636
+ apiPayload['project'] = this.client.config.project;
49637
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49638
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49639
+ uri.searchParams.append(key, value);
49640
+ }
49641
+ return uri.toString();
49642
+ }
49643
+ listRenditions(paramsOrFirst, ...rest) {
49644
+ let params;
49645
+ if (paramsOrFirst &&
49646
+ typeof paramsOrFirst === 'object' &&
49647
+ !Array.isArray(paramsOrFirst)) {
49648
+ params = (paramsOrFirst || {});
49649
+ }
49650
+ else {
49651
+ params = {
49652
+ videoId: paramsOrFirst,
49653
+ output: rest[0],
49654
+ status: rest[1],
49655
+ };
49656
+ }
49657
+ const videoId = params.videoId;
49658
+ const output = params.output;
49659
+ const status = params.status;
49660
+ if (typeof videoId === 'undefined' || videoId === '') {
49661
+ throw new AppwriteException('Missing required parameter: "videoId"');
49662
+ }
49663
+ const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
49664
+ const apiPayload = {};
49665
+ if (typeof output !== 'undefined') {
49666
+ apiPayload['output'] = output;
49667
+ }
49668
+ if (typeof status !== 'undefined') {
49669
+ apiPayload['status'] = status;
49670
+ }
49671
+ const uri = new URL(this.client.config.endpoint + apiPath);
49672
+ const apiHeaders = {
49673
+ 'X-Appwrite-Project': this.client.config.project,
49674
+ accept: 'application/json',
49675
+ };
49676
+ return this.client.call('get', uri, apiHeaders, apiPayload);
49677
+ }
49678
+ createRendition(paramsOrFirst, ...rest) {
49679
+ let params;
49680
+ if (paramsOrFirst &&
49681
+ typeof paramsOrFirst === 'object' &&
49682
+ !Array.isArray(paramsOrFirst)) {
49683
+ params = (paramsOrFirst || {});
49684
+ }
49685
+ else {
49686
+ params = {
49687
+ videoId: paramsOrFirst,
49688
+ profileId: rest[0],
49689
+ output: rest[1],
49690
+ };
49691
+ }
49692
+ const videoId = params.videoId;
49693
+ const profileId = params.profileId;
49694
+ const output = params.output;
49695
+ if (typeof videoId === 'undefined' || videoId === '') {
49696
+ throw new AppwriteException('Missing required parameter: "videoId"');
49697
+ }
49698
+ if (typeof profileId === 'undefined') {
49699
+ throw new AppwriteException('Missing required parameter: "profileId"');
49700
+ }
49701
+ if (typeof output === 'undefined') {
49702
+ throw new AppwriteException('Missing required parameter: "output"');
49703
+ }
49704
+ const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
49705
+ const apiPayload = {};
49706
+ if (typeof profileId !== 'undefined') {
49707
+ apiPayload['profileId'] = profileId;
49708
+ }
49709
+ if (typeof output !== 'undefined') {
49710
+ apiPayload['output'] = output;
49711
+ }
49712
+ const uri = new URL(this.client.config.endpoint + apiPath);
49713
+ const apiHeaders = {
49714
+ 'X-Appwrite-Project': this.client.config.project,
49715
+ 'content-type': 'application/json',
49716
+ accept: 'application/json',
49717
+ };
49718
+ return this.client.call('post', uri, apiHeaders, apiPayload);
49719
+ }
49720
+ getRendition(paramsOrFirst, ...rest) {
49721
+ let params;
49722
+ if (paramsOrFirst &&
49723
+ typeof paramsOrFirst === 'object' &&
49724
+ !Array.isArray(paramsOrFirst)) {
49725
+ params = (paramsOrFirst || {});
49726
+ }
49727
+ else {
49728
+ params = {
49729
+ videoId: paramsOrFirst,
49730
+ renditionId: rest[0],
49731
+ };
49732
+ }
49733
+ const videoId = params.videoId;
49734
+ const renditionId = params.renditionId;
49735
+ if (typeof videoId === 'undefined' || videoId === '') {
49736
+ throw new AppwriteException('Missing required parameter: "videoId"');
49737
+ }
49738
+ if (typeof renditionId === 'undefined' || renditionId === '') {
49739
+ throw new AppwriteException('Missing required parameter: "renditionId"');
49740
+ }
49741
+ const apiPath = '/videos/{videoId}/renditions/{renditionId}'
49742
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
49743
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)));
49744
+ const apiPayload = {};
49745
+ const uri = new URL(this.client.config.endpoint + apiPath);
49746
+ const apiHeaders = {
49747
+ 'X-Appwrite-Project': this.client.config.project,
49748
+ accept: 'application/json',
49749
+ };
49750
+ return this.client.call('get', uri, apiHeaders, apiPayload);
49751
+ }
49752
+ deleteRendition(paramsOrFirst, ...rest) {
49753
+ let params;
49754
+ if (paramsOrFirst &&
49755
+ typeof paramsOrFirst === 'object' &&
49756
+ !Array.isArray(paramsOrFirst)) {
49757
+ params = (paramsOrFirst || {});
49758
+ }
49759
+ else {
49760
+ params = {
49761
+ videoId: paramsOrFirst,
49762
+ renditionId: rest[0],
49763
+ };
49764
+ }
49765
+ const videoId = params.videoId;
49766
+ const renditionId = params.renditionId;
49767
+ if (typeof videoId === 'undefined' || videoId === '') {
49768
+ throw new AppwriteException('Missing required parameter: "videoId"');
49769
+ }
49770
+ if (typeof renditionId === 'undefined' || renditionId === '') {
49771
+ throw new AppwriteException('Missing required parameter: "renditionId"');
49772
+ }
49773
+ const apiPath = '/videos/{videoId}/renditions/{renditionId}'
49774
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
49775
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)));
49776
+ const apiPayload = {};
49777
+ const uri = new URL(this.client.config.endpoint + apiPath);
49778
+ const apiHeaders = {
49779
+ 'X-Appwrite-Project': this.client.config.project,
49780
+ 'content-type': 'application/json',
49781
+ accept: 'application/json',
49782
+ };
49783
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
49784
+ }
49785
+ createSource(paramsOrFirst) {
49786
+ let params;
49787
+ if (paramsOrFirst &&
49788
+ typeof paramsOrFirst === 'object' &&
49789
+ !Array.isArray(paramsOrFirst)) {
49790
+ params = (paramsOrFirst || {});
49791
+ }
49792
+ else {
49793
+ params = {
49794
+ videoId: paramsOrFirst,
49795
+ };
49796
+ }
49797
+ const videoId = params.videoId;
49798
+ if (typeof videoId === 'undefined' || videoId === '') {
49799
+ throw new AppwriteException('Missing required parameter: "videoId"');
49800
+ }
49801
+ const apiPath = '/videos/{videoId}/source'.replace('{videoId}', encodeURIComponent(String(videoId)));
49802
+ const apiPayload = {};
49803
+ const uri = new URL(this.client.config.endpoint + apiPath);
49804
+ const apiHeaders = {
49805
+ 'X-Appwrite-Project': this.client.config.project,
49806
+ 'content-type': 'application/json',
49807
+ accept: 'application/json',
49808
+ };
49809
+ return this.client.call('post', uri, apiHeaders, apiPayload);
49810
+ }
49811
+ listSubtitles(paramsOrFirst) {
49812
+ let params;
49813
+ if (paramsOrFirst &&
49814
+ typeof paramsOrFirst === 'object' &&
49815
+ !Array.isArray(paramsOrFirst)) {
49816
+ params = (paramsOrFirst || {});
49817
+ }
49818
+ else {
49819
+ params = {
49820
+ videoId: paramsOrFirst,
49821
+ };
49822
+ }
49823
+ const videoId = params.videoId;
49824
+ if (typeof videoId === 'undefined' || videoId === '') {
49825
+ throw new AppwriteException('Missing required parameter: "videoId"');
49826
+ }
49827
+ const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
49828
+ const apiPayload = {};
49829
+ const uri = new URL(this.client.config.endpoint + apiPath);
49830
+ const apiHeaders = {
49831
+ 'X-Appwrite-Project': this.client.config.project,
49832
+ accept: 'application/json',
49833
+ };
49834
+ return this.client.call('get', uri, apiHeaders, apiPayload);
49835
+ }
49836
+ createSubtitle(paramsOrFirst, ...rest) {
49837
+ let params;
49838
+ if (paramsOrFirst &&
49839
+ typeof paramsOrFirst === 'object' &&
49840
+ !Array.isArray(paramsOrFirst)) {
49841
+ params = (paramsOrFirst || {});
49842
+ }
49843
+ else {
49844
+ params = {
49845
+ videoId: paramsOrFirst,
49846
+ bucketId: rest[0],
49847
+ fileId: rest[1],
49848
+ name: rest[2],
49849
+ code: rest[3],
49850
+ xdefault: rest[4],
49851
+ };
49852
+ }
49853
+ const videoId = params.videoId;
49854
+ const bucketId = params.bucketId;
49855
+ const fileId = params.fileId;
49856
+ const name = params.name;
49857
+ const code = params.code;
49858
+ const xdefault = params.xdefault;
49859
+ if (typeof videoId === 'undefined' || videoId === '') {
49860
+ throw new AppwriteException('Missing required parameter: "videoId"');
49861
+ }
49862
+ if (typeof bucketId === 'undefined') {
49863
+ throw new AppwriteException('Missing required parameter: "bucketId"');
49864
+ }
49865
+ if (typeof fileId === 'undefined') {
49866
+ throw new AppwriteException('Missing required parameter: "fileId"');
49867
+ }
49868
+ if (typeof name === 'undefined') {
49869
+ throw new AppwriteException('Missing required parameter: "name"');
49870
+ }
49871
+ if (typeof code === 'undefined') {
49872
+ throw new AppwriteException('Missing required parameter: "code"');
49873
+ }
49874
+ const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
49875
+ const apiPayload = {};
49876
+ if (typeof bucketId !== 'undefined') {
49877
+ apiPayload['bucketId'] = bucketId;
49878
+ }
49879
+ if (typeof fileId !== 'undefined') {
49880
+ apiPayload['fileId'] = fileId;
49881
+ }
49882
+ if (typeof name !== 'undefined') {
49883
+ apiPayload['name'] = name;
49884
+ }
49885
+ if (typeof code !== 'undefined') {
49886
+ apiPayload['code'] = code;
49887
+ }
49888
+ if (typeof xdefault !== 'undefined') {
49889
+ apiPayload['default'] = xdefault;
49890
+ }
49891
+ const uri = new URL(this.client.config.endpoint + apiPath);
49892
+ const apiHeaders = {
49893
+ 'X-Appwrite-Project': this.client.config.project,
49894
+ 'content-type': 'application/json',
49895
+ accept: 'application/json',
49896
+ };
49897
+ return this.client.call('post', uri, apiHeaders, apiPayload);
49898
+ }
49899
+ updateSubtitle(paramsOrFirst, ...rest) {
49900
+ let params;
49901
+ if (paramsOrFirst &&
49902
+ typeof paramsOrFirst === 'object' &&
49903
+ !Array.isArray(paramsOrFirst)) {
49904
+ params = (paramsOrFirst || {});
49905
+ }
49906
+ else {
49907
+ params = {
49908
+ videoId: paramsOrFirst,
49909
+ subtitleId: rest[0],
49910
+ bucketId: rest[1],
49911
+ fileId: rest[2],
49912
+ name: rest[3],
49913
+ code: rest[4],
49914
+ xdefault: rest[5],
49915
+ };
49916
+ }
49917
+ const videoId = params.videoId;
49918
+ const subtitleId = params.subtitleId;
49919
+ const bucketId = params.bucketId;
49920
+ const fileId = params.fileId;
49921
+ const name = params.name;
49922
+ const code = params.code;
49923
+ const xdefault = params.xdefault;
49924
+ if (typeof videoId === 'undefined' || videoId === '') {
49925
+ throw new AppwriteException('Missing required parameter: "videoId"');
49926
+ }
49927
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
49928
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
49929
+ }
49930
+ const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
49931
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
49932
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
49933
+ const apiPayload = {};
49934
+ if (typeof bucketId !== 'undefined') {
49935
+ apiPayload['bucketId'] = bucketId;
49936
+ }
49937
+ if (typeof fileId !== 'undefined') {
49938
+ apiPayload['fileId'] = fileId;
49939
+ }
49940
+ if (typeof name !== 'undefined') {
49941
+ apiPayload['name'] = name;
49942
+ }
49943
+ if (typeof code !== 'undefined') {
49944
+ apiPayload['code'] = code;
49945
+ }
49946
+ if (typeof xdefault !== 'undefined') {
49947
+ apiPayload['default'] = xdefault;
49948
+ }
49949
+ const uri = new URL(this.client.config.endpoint + apiPath);
49950
+ const apiHeaders = {
49951
+ 'X-Appwrite-Project': this.client.config.project,
49952
+ 'content-type': 'application/json',
49953
+ accept: 'application/json',
49954
+ };
49955
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
49956
+ }
49957
+ deleteSubtitle(paramsOrFirst, ...rest) {
49958
+ let params;
49959
+ if (paramsOrFirst &&
49960
+ typeof paramsOrFirst === 'object' &&
49961
+ !Array.isArray(paramsOrFirst)) {
49962
+ params = (paramsOrFirst || {});
49963
+ }
49964
+ else {
49965
+ params = {
49966
+ videoId: paramsOrFirst,
49967
+ subtitleId: rest[0],
49968
+ };
49969
+ }
49970
+ const videoId = params.videoId;
49971
+ const subtitleId = params.subtitleId;
49972
+ if (typeof videoId === 'undefined' || videoId === '') {
49973
+ throw new AppwriteException('Missing required parameter: "videoId"');
49974
+ }
49975
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
49976
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
49977
+ }
49978
+ const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
49979
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
49980
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
49981
+ const apiPayload = {};
49982
+ const uri = new URL(this.client.config.endpoint + apiPath);
49983
+ const apiHeaders = {
49984
+ 'X-Appwrite-Project': this.client.config.project,
49985
+ 'content-type': 'application/json',
49986
+ accept: 'application/json',
49987
+ };
49988
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
49989
+ }
49990
+ getTimeline(paramsOrFirst) {
49991
+ let params;
49992
+ if (paramsOrFirst &&
49993
+ typeof paramsOrFirst === 'object' &&
49994
+ !Array.isArray(paramsOrFirst)) {
49995
+ params = (paramsOrFirst || {});
49996
+ }
49997
+ else {
49998
+ params = {
49999
+ videoId: paramsOrFirst,
50000
+ };
50001
+ }
50002
+ const videoId = params.videoId;
50003
+ if (typeof videoId === 'undefined' || videoId === '') {
50004
+ throw new AppwriteException('Missing required parameter: "videoId"');
50005
+ }
50006
+ const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
50007
+ const apiPayload = {};
50008
+ const uri = new URL(this.client.config.endpoint + apiPath);
50009
+ const apiHeaders = {
50010
+ 'X-Appwrite-Project': this.client.config.project,
50011
+ accept: 'text/plain',
50012
+ };
50013
+ return this.client.call('get', uri, apiHeaders, apiPayload, 'text');
50014
+ }
50015
+ createTimeline(paramsOrFirst) {
50016
+ let params;
50017
+ if (paramsOrFirst &&
50018
+ typeof paramsOrFirst === 'object' &&
50019
+ !Array.isArray(paramsOrFirst)) {
50020
+ params = (paramsOrFirst || {});
50021
+ }
50022
+ else {
50023
+ params = {
50024
+ videoId: paramsOrFirst,
50025
+ };
50026
+ }
50027
+ const videoId = params.videoId;
50028
+ if (typeof videoId === 'undefined' || videoId === '') {
50029
+ throw new AppwriteException('Missing required parameter: "videoId"');
50030
+ }
50031
+ const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
50032
+ const apiPayload = {};
50033
+ const uri = new URL(this.client.config.endpoint + apiPath);
50034
+ const apiHeaders = {
50035
+ 'X-Appwrite-Project': this.client.config.project,
50036
+ 'content-type': 'application/json',
50037
+ accept: 'application/json',
50038
+ };
50039
+ return this.client.call('post', uri, apiHeaders, apiPayload);
50040
+ }
50041
+ }
50042
+
50043
+ class Waf {
50044
+ constructor(client) {
50045
+ this.client = client;
50046
+ }
50047
+ listRules(paramsOrFirst, ...rest) {
50048
+ let params;
50049
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
50050
+ (paramsOrFirst &&
50051
+ typeof paramsOrFirst === 'object' &&
50052
+ !Array.isArray(paramsOrFirst))) {
50053
+ params = (paramsOrFirst || {});
50054
+ }
50055
+ else {
50056
+ params = {
50057
+ queries: paramsOrFirst,
50058
+ search: rest[0],
50059
+ total: rest[1],
50060
+ };
50061
+ }
50062
+ const queries = params.queries;
50063
+ const search = params.search;
50064
+ const total = params.total;
50065
+ const apiPath = '/waf/rules';
50066
+ const apiPayload = {};
50067
+ if (typeof queries !== 'undefined') {
50068
+ apiPayload['queries'] = queries;
50069
+ }
50070
+ if (typeof search !== 'undefined') {
50071
+ apiPayload['search'] = search;
50072
+ }
50073
+ if (typeof total !== 'undefined') {
50074
+ apiPayload['total'] = total;
50075
+ }
50076
+ const uri = new URL(this.client.config.endpoint + apiPath);
50077
+ const apiHeaders = {
50078
+ 'X-Appwrite-Project': this.client.config.project,
50079
+ accept: 'application/json',
50080
+ };
50081
+ return this.client.call('get', uri, apiHeaders, apiPayload);
50082
+ }
50083
+ createBypassRule(paramsOrFirst, ...rest) {
50084
+ let params;
50085
+ if (paramsOrFirst &&
50086
+ typeof paramsOrFirst === 'object' &&
50087
+ !Array.isArray(paramsOrFirst)) {
50088
+ params = (paramsOrFirst || {});
50089
+ }
50090
+ else {
50091
+ params = {
50092
+ ruleId: paramsOrFirst,
50093
+ resourceType: rest[0],
50094
+ name: rest[1],
50095
+ resourceId: rest[2],
50096
+ description: rest[3],
50097
+ priority: rest[4],
50098
+ enabled: rest[5],
50099
+ conditions: rest[6],
50100
+ };
50101
+ }
50102
+ const ruleId = params.ruleId;
50103
+ const resourceType = params.resourceType;
50104
+ const name = params.name;
50105
+ const resourceId = params.resourceId;
50106
+ const description = params.description;
50107
+ const priority = params.priority;
50108
+ const enabled = params.enabled;
50109
+ const conditions = params.conditions;
50110
+ if (typeof ruleId === 'undefined') {
50111
+ throw new AppwriteException('Missing required parameter: "ruleId"');
50112
+ }
50113
+ if (typeof resourceType === 'undefined') {
50114
+ throw new AppwriteException('Missing required parameter: "resourceType"');
50115
+ }
50116
+ if (typeof name === 'undefined') {
50117
+ throw new AppwriteException('Missing required parameter: "name"');
50118
+ }
50119
+ const apiPath = '/waf/rules/bypass';
50120
+ const apiPayload = {};
50121
+ if (typeof ruleId !== 'undefined') {
50122
+ apiPayload['ruleId'] = ruleId;
50123
+ }
50124
+ if (typeof resourceType !== 'undefined') {
50125
+ apiPayload['resourceType'] = resourceType;
50126
+ }
50127
+ if (typeof resourceId !== 'undefined') {
50128
+ apiPayload['resourceId'] = resourceId;
50129
+ }
50130
+ if (typeof name !== 'undefined') {
50131
+ apiPayload['name'] = name;
50132
+ }
50133
+ if (typeof description !== 'undefined') {
50134
+ apiPayload['description'] = description;
50135
+ }
50136
+ if (typeof priority !== 'undefined') {
50137
+ apiPayload['priority'] = priority;
50138
+ }
50139
+ if (typeof enabled !== 'undefined') {
50140
+ apiPayload['enabled'] = enabled;
50141
+ }
50142
+ if (typeof conditions !== 'undefined') {
50143
+ apiPayload['conditions'] = conditions;
50144
+ }
50145
+ const uri = new URL(this.client.config.endpoint + apiPath);
50146
+ const apiHeaders = {
50147
+ 'X-Appwrite-Project': this.client.config.project,
50148
+ 'content-type': 'application/json',
50149
+ accept: 'application/json',
50150
+ };
50151
+ return this.client.call('post', uri, apiHeaders, apiPayload);
50152
+ }
50153
+ updateBypassRule(paramsOrFirst, ...rest) {
50154
+ let params;
50155
+ if (paramsOrFirst &&
50156
+ typeof paramsOrFirst === 'object' &&
50157
+ !Array.isArray(paramsOrFirst)) {
50158
+ params = (paramsOrFirst || {});
50159
+ }
50160
+ else {
50161
+ params = {
50162
+ ruleId: paramsOrFirst,
50163
+ resourceType: rest[0],
50164
+ resourceId: rest[1],
50165
+ name: rest[2],
50166
+ description: rest[3],
50167
+ priority: rest[4],
50168
+ enabled: rest[5],
50169
+ conditions: rest[6],
50170
+ };
50171
+ }
50172
+ const ruleId = params.ruleId;
50173
+ const resourceType = params.resourceType;
50174
+ const resourceId = params.resourceId;
50175
+ const name = params.name;
50176
+ const description = params.description;
50177
+ const priority = params.priority;
50178
+ const enabled = params.enabled;
50179
+ const conditions = params.conditions;
50180
+ if (typeof ruleId === 'undefined' || ruleId === '') {
50181
+ throw new AppwriteException('Missing required parameter: "ruleId"');
50182
+ }
50183
+ const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
50184
+ const apiPayload = {};
50185
+ if (typeof resourceType !== 'undefined') {
50186
+ apiPayload['resourceType'] = resourceType;
50187
+ }
50188
+ if (typeof resourceId !== 'undefined') {
50189
+ apiPayload['resourceId'] = resourceId;
50190
+ }
50191
+ if (typeof name !== 'undefined') {
50192
+ apiPayload['name'] = name;
50193
+ }
50194
+ if (typeof description !== 'undefined') {
50195
+ apiPayload['description'] = description;
50196
+ }
50197
+ if (typeof priority !== 'undefined') {
50198
+ apiPayload['priority'] = priority;
50199
+ }
50200
+ if (typeof enabled !== 'undefined') {
50201
+ apiPayload['enabled'] = enabled;
50202
+ }
50203
+ if (typeof conditions !== 'undefined') {
50204
+ apiPayload['conditions'] = conditions;
50205
+ }
50206
+ const uri = new URL(this.client.config.endpoint + apiPath);
50207
+ const apiHeaders = {
50208
+ 'X-Appwrite-Project': this.client.config.project,
50209
+ 'content-type': 'application/json',
50210
+ accept: 'application/json',
50211
+ };
50212
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
50213
+ }
50214
+ createChallengeRule(paramsOrFirst, ...rest) {
50215
+ let params;
50216
+ if (paramsOrFirst &&
50217
+ typeof paramsOrFirst === 'object' &&
50218
+ !Array.isArray(paramsOrFirst)) {
50219
+ params = (paramsOrFirst || {});
50220
+ }
50221
+ else {
50222
+ params = {
50223
+ ruleId: paramsOrFirst,
50224
+ resourceType: rest[0],
50225
+ name: rest[1],
50226
+ resourceId: rest[2],
50227
+ description: rest[3],
50228
+ challengeType: rest[4],
50229
+ priority: rest[5],
50230
+ enabled: rest[6],
50231
+ conditions: rest[7],
50232
+ difficulty: rest[8],
50233
+ ttl: rest[9],
50234
+ };
50235
+ }
50236
+ const ruleId = params.ruleId;
50237
+ const resourceType = params.resourceType;
50238
+ const name = params.name;
50239
+ const resourceId = params.resourceId;
50240
+ const description = params.description;
50241
+ const challengeType = params.challengeType;
50242
+ const priority = params.priority;
50243
+ const enabled = params.enabled;
50244
+ const conditions = params.conditions;
50245
+ const difficulty = params.difficulty;
50246
+ const ttl = params.ttl;
50247
+ if (typeof ruleId === 'undefined') {
50248
+ throw new AppwriteException('Missing required parameter: "ruleId"');
50249
+ }
50250
+ if (typeof resourceType === 'undefined') {
50251
+ throw new AppwriteException('Missing required parameter: "resourceType"');
50252
+ }
50253
+ if (typeof name === 'undefined') {
50254
+ throw new AppwriteException('Missing required parameter: "name"');
50255
+ }
50256
+ const apiPath = '/waf/rules/challenge';
50257
+ const apiPayload = {};
50258
+ if (typeof ruleId !== 'undefined') {
50259
+ apiPayload['ruleId'] = ruleId;
50260
+ }
50261
+ if (typeof resourceType !== 'undefined') {
50262
+ apiPayload['resourceType'] = resourceType;
50263
+ }
50264
+ if (typeof resourceId !== 'undefined') {
50265
+ apiPayload['resourceId'] = resourceId;
50266
+ }
50267
+ if (typeof name !== 'undefined') {
50268
+ apiPayload['name'] = name;
50269
+ }
50270
+ if (typeof description !== 'undefined') {
50271
+ apiPayload['description'] = description;
50272
+ }
50273
+ if (typeof challengeType !== 'undefined') {
50274
+ apiPayload['challengeType'] = challengeType;
50275
+ }
50276
+ if (typeof priority !== 'undefined') {
50277
+ apiPayload['priority'] = priority;
50278
+ }
50279
+ if (typeof enabled !== 'undefined') {
50280
+ apiPayload['enabled'] = enabled;
50281
+ }
50282
+ if (typeof conditions !== 'undefined') {
50283
+ apiPayload['conditions'] = conditions;
50284
+ }
50285
+ if (typeof difficulty !== 'undefined') {
50286
+ apiPayload['difficulty'] = difficulty;
50287
+ }
50288
+ if (typeof ttl !== 'undefined') {
50289
+ apiPayload['ttl'] = ttl;
50290
+ }
50291
+ const uri = new URL(this.client.config.endpoint + apiPath);
50292
+ const apiHeaders = {
50293
+ 'X-Appwrite-Project': this.client.config.project,
50294
+ 'content-type': 'application/json',
50295
+ accept: 'application/json',
50296
+ };
50297
+ return this.client.call('post', uri, apiHeaders, apiPayload);
50298
+ }
50299
+ updateChallengeRule(paramsOrFirst, ...rest) {
50300
+ let params;
50301
+ if (paramsOrFirst &&
50302
+ typeof paramsOrFirst === 'object' &&
50303
+ !Array.isArray(paramsOrFirst)) {
50304
+ params = (paramsOrFirst || {});
50305
+ }
50306
+ else {
50307
+ params = {
50308
+ ruleId: paramsOrFirst,
50309
+ resourceType: rest[0],
50310
+ resourceId: rest[1],
50311
+ name: rest[2],
50312
+ description: rest[3],
50313
+ challengeType: rest[4],
50314
+ priority: rest[5],
50315
+ enabled: rest[6],
50316
+ conditions: rest[7],
50317
+ difficulty: rest[8],
50318
+ ttl: rest[9],
50319
+ };
50320
+ }
50321
+ const ruleId = params.ruleId;
50322
+ const resourceType = params.resourceType;
50323
+ const resourceId = params.resourceId;
50324
+ const name = params.name;
50325
+ const description = params.description;
50326
+ const challengeType = params.challengeType;
50327
+ const priority = params.priority;
50328
+ const enabled = params.enabled;
50329
+ const conditions = params.conditions;
50330
+ const difficulty = params.difficulty;
50331
+ const ttl = params.ttl;
50332
+ if (typeof ruleId === 'undefined' || ruleId === '') {
50333
+ throw new AppwriteException('Missing required parameter: "ruleId"');
50334
+ }
50335
+ const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
50336
+ const apiPayload = {};
50337
+ if (typeof resourceType !== 'undefined') {
50338
+ apiPayload['resourceType'] = resourceType;
50339
+ }
50340
+ if (typeof resourceId !== 'undefined') {
50341
+ apiPayload['resourceId'] = resourceId;
50342
+ }
50343
+ if (typeof name !== 'undefined') {
50344
+ apiPayload['name'] = name;
50345
+ }
50346
+ if (typeof description !== 'undefined') {
50347
+ apiPayload['description'] = description;
50348
+ }
50349
+ if (typeof challengeType !== 'undefined') {
50350
+ apiPayload['challengeType'] = challengeType;
50351
+ }
50352
+ if (typeof priority !== 'undefined') {
50353
+ apiPayload['priority'] = priority;
50354
+ }
50355
+ if (typeof enabled !== 'undefined') {
50356
+ apiPayload['enabled'] = enabled;
50357
+ }
50358
+ if (typeof conditions !== 'undefined') {
50359
+ apiPayload['conditions'] = conditions;
50360
+ }
50361
+ if (typeof difficulty !== 'undefined') {
50362
+ apiPayload['difficulty'] = difficulty;
50363
+ }
50364
+ if (typeof ttl !== 'undefined') {
50365
+ apiPayload['ttl'] = ttl;
50366
+ }
50367
+ const uri = new URL(this.client.config.endpoint + apiPath);
50368
+ const apiHeaders = {
50369
+ 'X-Appwrite-Project': this.client.config.project,
50370
+ 'content-type': 'application/json',
50371
+ accept: 'application/json',
50372
+ };
50373
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
50374
+ }
50375
+ createDenyRule(paramsOrFirst, ...rest) {
50376
+ let params;
50377
+ if (paramsOrFirst &&
50378
+ typeof paramsOrFirst === 'object' &&
50379
+ !Array.isArray(paramsOrFirst)) {
50380
+ params = (paramsOrFirst || {});
50381
+ }
50382
+ else {
50383
+ params = {
50384
+ ruleId: paramsOrFirst,
50385
+ resourceType: rest[0],
50386
+ name: rest[1],
50387
+ resourceId: rest[2],
50388
+ description: rest[3],
50389
+ priority: rest[4],
50390
+ enabled: rest[5],
50391
+ conditions: rest[6],
50392
+ };
50393
+ }
50394
+ const ruleId = params.ruleId;
50395
+ const resourceType = params.resourceType;
50396
+ const name = params.name;
50397
+ const resourceId = params.resourceId;
50398
+ const description = params.description;
50399
+ const priority = params.priority;
50400
+ const enabled = params.enabled;
50401
+ const conditions = params.conditions;
50402
+ if (typeof ruleId === 'undefined') {
50403
+ throw new AppwriteException('Missing required parameter: "ruleId"');
50404
+ }
50405
+ if (typeof resourceType === 'undefined') {
50406
+ throw new AppwriteException('Missing required parameter: "resourceType"');
50407
+ }
50408
+ if (typeof name === 'undefined') {
50409
+ throw new AppwriteException('Missing required parameter: "name"');
50410
+ }
50411
+ const apiPath = '/waf/rules/deny';
50412
+ const apiPayload = {};
50413
+ if (typeof ruleId !== 'undefined') {
50414
+ apiPayload['ruleId'] = ruleId;
50415
+ }
50416
+ if (typeof resourceType !== 'undefined') {
50417
+ apiPayload['resourceType'] = resourceType;
50418
+ }
50419
+ if (typeof resourceId !== 'undefined') {
50420
+ apiPayload['resourceId'] = resourceId;
50421
+ }
50422
+ if (typeof name !== 'undefined') {
50423
+ apiPayload['name'] = name;
50424
+ }
50425
+ if (typeof description !== 'undefined') {
50426
+ apiPayload['description'] = description;
50427
+ }
50428
+ if (typeof priority !== 'undefined') {
50429
+ apiPayload['priority'] = priority;
50430
+ }
50431
+ if (typeof enabled !== 'undefined') {
50432
+ apiPayload['enabled'] = enabled;
50433
+ }
50434
+ if (typeof conditions !== 'undefined') {
50435
+ apiPayload['conditions'] = conditions;
50436
+ }
50437
+ const uri = new URL(this.client.config.endpoint + apiPath);
50438
+ const apiHeaders = {
50439
+ 'X-Appwrite-Project': this.client.config.project,
50440
+ 'content-type': 'application/json',
50441
+ accept: 'application/json',
50442
+ };
50443
+ return this.client.call('post', uri, apiHeaders, apiPayload);
50444
+ }
50445
+ updateDenyRule(paramsOrFirst, ...rest) {
50446
+ let params;
50447
+ if (paramsOrFirst &&
50448
+ typeof paramsOrFirst === 'object' &&
50449
+ !Array.isArray(paramsOrFirst)) {
50450
+ params = (paramsOrFirst || {});
50451
+ }
50452
+ else {
50453
+ params = {
50454
+ ruleId: paramsOrFirst,
50455
+ resourceType: rest[0],
50456
+ resourceId: rest[1],
50457
+ name: rest[2],
50458
+ description: rest[3],
50459
+ priority: rest[4],
50460
+ enabled: rest[5],
50461
+ conditions: rest[6],
50462
+ };
50463
+ }
50464
+ const ruleId = params.ruleId;
50465
+ const resourceType = params.resourceType;
50466
+ const resourceId = params.resourceId;
50467
+ const name = params.name;
50468
+ const description = params.description;
50469
+ const priority = params.priority;
50470
+ const enabled = params.enabled;
50471
+ const conditions = params.conditions;
50472
+ if (typeof ruleId === 'undefined' || ruleId === '') {
50473
+ throw new AppwriteException('Missing required parameter: "ruleId"');
50474
+ }
50475
+ const apiPath = '/waf/rules/deny/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
50476
+ const apiPayload = {};
50477
+ if (typeof resourceType !== 'undefined') {
50478
+ apiPayload['resourceType'] = resourceType;
50479
+ }
50480
+ if (typeof resourceId !== 'undefined') {
50481
+ apiPayload['resourceId'] = resourceId;
50482
+ }
50483
+ if (typeof name !== 'undefined') {
50484
+ apiPayload['name'] = name;
50485
+ }
50486
+ if (typeof description !== 'undefined') {
50487
+ apiPayload['description'] = description;
50488
+ }
50489
+ if (typeof priority !== 'undefined') {
50490
+ apiPayload['priority'] = priority;
50491
+ }
50492
+ if (typeof enabled !== 'undefined') {
50493
+ apiPayload['enabled'] = enabled;
50494
+ }
50495
+ if (typeof conditions !== 'undefined') {
50496
+ apiPayload['conditions'] = conditions;
50497
+ }
50498
+ const uri = new URL(this.client.config.endpoint + apiPath);
50499
+ const apiHeaders = {
50500
+ 'X-Appwrite-Project': this.client.config.project,
50501
+ 'content-type': 'application/json',
50502
+ accept: 'application/json',
50503
+ };
50504
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
50505
+ }
50506
+ createRateLimitRule(paramsOrFirst, ...rest) {
50507
+ let params;
50508
+ if (paramsOrFirst &&
50509
+ typeof paramsOrFirst === 'object' &&
50510
+ !Array.isArray(paramsOrFirst)) {
50511
+ params = (paramsOrFirst || {});
50512
+ }
50513
+ else {
50514
+ params = {
50515
+ ruleId: paramsOrFirst,
50516
+ resourceType: rest[0],
50517
+ name: rest[1],
50518
+ limit: rest[2],
50519
+ interval: rest[3],
50520
+ resourceId: rest[4],
50521
+ description: rest[5],
50522
+ key: rest[6],
50523
+ strategy: rest[7],
50524
+ maxBucketSize: rest[8],
50525
+ priority: rest[9],
50526
+ enabled: rest[10],
50527
+ conditions: rest[11],
50528
+ };
50529
+ }
50530
+ const ruleId = params.ruleId;
50531
+ const resourceType = params.resourceType;
50532
+ const name = params.name;
50533
+ const limit = params.limit;
50534
+ const interval = params.interval;
50535
+ const resourceId = params.resourceId;
50536
+ const description = params.description;
50537
+ const key = params.key;
50538
+ const strategy = params.strategy;
50539
+ const maxBucketSize = params.maxBucketSize;
50540
+ const priority = params.priority;
50541
+ const enabled = params.enabled;
50542
+ const conditions = params.conditions;
50543
+ if (typeof ruleId === 'undefined') {
50544
+ throw new AppwriteException('Missing required parameter: "ruleId"');
50545
+ }
50546
+ if (typeof resourceType === 'undefined') {
50547
+ throw new AppwriteException('Missing required parameter: "resourceType"');
50548
+ }
50549
+ if (typeof name === 'undefined') {
50550
+ throw new AppwriteException('Missing required parameter: "name"');
50551
+ }
50552
+ if (typeof limit === 'undefined') {
50553
+ throw new AppwriteException('Missing required parameter: "limit"');
50554
+ }
50555
+ if (typeof interval === 'undefined') {
50556
+ throw new AppwriteException('Missing required parameter: "interval"');
50557
+ }
50558
+ const apiPath = '/waf/rules/rate-limit';
50559
+ const apiPayload = {};
50560
+ if (typeof ruleId !== 'undefined') {
50561
+ apiPayload['ruleId'] = ruleId;
50562
+ }
50563
+ if (typeof resourceType !== 'undefined') {
50564
+ apiPayload['resourceType'] = resourceType;
50565
+ }
50566
+ if (typeof resourceId !== 'undefined') {
50567
+ apiPayload['resourceId'] = resourceId;
50568
+ }
50569
+ if (typeof name !== 'undefined') {
50570
+ apiPayload['name'] = name;
50571
+ }
50572
+ if (typeof description !== 'undefined') {
50573
+ apiPayload['description'] = description;
50574
+ }
50575
+ if (typeof limit !== 'undefined') {
50576
+ apiPayload['limit'] = limit;
50577
+ }
50578
+ if (typeof interval !== 'undefined') {
50579
+ apiPayload['interval'] = interval;
48590
50580
  }
48591
50581
  if (typeof key !== 'undefined') {
48592
50582
  apiPayload['key'] = key;
@@ -49812,9 +51802,8 @@
49812
51802
  * );
49813
51803
  * // sub.update({ background: true }); sub.unsubscribe();
49814
51804
  */
49815
- class Push extends Service {
51805
+ class Push {
49816
51806
  constructor(client) {
49817
- super(client);
49818
51807
  this.mqtt = null;
49819
51808
  this.connecting = null;
49820
51809
  this.Buffer = null;
@@ -49844,6 +51833,7 @@
49844
51833
  this.connectedKey = '';
49845
51834
  this.connectionEpoch = 0;
49846
51835
  this.subscriptions = new Map();
51836
+ this.client = client;
49847
51837
  }
49848
51838
  // The broker subscription for a filter uses the highest QoS any local subscription on
49849
51839
  // it wants, so a QoS-0 subscription never downgrades a QoS-1 one sharing the filter.
@@ -50583,6 +52573,670 @@
50583
52573
  return filterParts.length === topicParts.length;
50584
52574
  }
50585
52575
 
52576
+ /**
52577
+ * Analytics auto-tracking helpers.
52578
+ *
52579
+ * These are hand-written companions to the generated `Analytics` service.
52580
+ * The generated service exposes `createEvent(params)` for arbitrary events;
52581
+ * this module wires up common auto-tracking behaviours (pageviews, outbound
52582
+ * links, downloads, scroll depth, active engagement) on top of it.
52583
+ *
52584
+ * The tracking helpers accept a plain event-emitter function so they do not
52585
+ * hard-couple to the generated `Analytics` class. The emitter adapts this
52586
+ * module's option shape to `createEvent`: `url` is required there, and `props`
52587
+ * is a flat alternating key/value list rather than an object.
52588
+ *
52589
+ * ```ts
52590
+ * const analytics = new Analytics(client);
52591
+ * const tracking = new AnalyticsTracking(
52592
+ * (name, options) => analytics.createEvent({
52593
+ * propertyId: options?.propertyId ?? '<PROPERTY_ID>',
52594
+ * name,
52595
+ * url: options?.url ?? window.location.href,
52596
+ * referrer: options?.referrer,
52597
+ * scrollDepth: options?.scrollDepth,
52598
+ * engagementTime: options?.engagementTime,
52599
+ * props: Object.entries(options?.props ?? {}).flatMap(
52600
+ * ([key, value]) => [key, String(value)],
52601
+ * ),
52602
+ * }),
52603
+ * { propertyId: '<PROPERTY_ID>' }
52604
+ * );
52605
+ * tracking.enableAllAutoTracking();
52606
+ * ```
52607
+ *
52608
+ * `propertyId` is optional: when set it is merged into the options of every
52609
+ * emitted event, so an emitter that forwards `options.propertyId` (as above)
52610
+ * picks it up instead of every caller hand-rolling it into the closure.
52611
+ * Per-event `propertyId` always wins over the configured default.
52612
+ *
52613
+ * All helpers respect `navigator.doNotTrack === '1'` by default; opt out with
52614
+ * `respectDoNotTrack: false` in the constructor options.
52615
+ *
52616
+ * Engagement time follows Plausible's model: rather than one total at unload,
52617
+ * a delta is emitted at every natural checkpoint of the visit (tab hidden, SPA
52618
+ * route change, unload). See `enableAutoEngagementTime` for details.
52619
+ *
52620
+ * Auto-emitted event names follow `snake_case` + lowercase (`pageview`,
52621
+ * `outbound_link`, `file_download`, `screen_view`, etc.). Any prop keys use
52622
+ * camelCase to match the endpoint's parameter naming. Callers can pass any
52623
+ * custom event name; the auto-track methods only own the events they emit
52624
+ * themselves.
52625
+ */
52626
+ const DEFAULT_DOWNLOAD_EXTENSIONS = [
52627
+ 'pdf',
52628
+ 'zip',
52629
+ 'rar',
52630
+ '7z',
52631
+ 'tar',
52632
+ 'gz',
52633
+ 'csv',
52634
+ 'tsv',
52635
+ 'xls',
52636
+ 'xlsx',
52637
+ 'doc',
52638
+ 'docx',
52639
+ 'ppt',
52640
+ 'pptx',
52641
+ 'dmg',
52642
+ 'exe',
52643
+ 'msi',
52644
+ 'pkg',
52645
+ 'deb',
52646
+ 'rpm',
52647
+ 'apk',
52648
+ 'mp3',
52649
+ 'wav',
52650
+ 'flac',
52651
+ 'mp4',
52652
+ 'mov',
52653
+ 'avi',
52654
+ 'mkv',
52655
+ 'webm',
52656
+ ];
52657
+ /**
52658
+ * Two-part public suffixes common enough to matter for outbound-link detection.
52659
+ * See `rootDomain()` for why this is a short list rather than the Public Suffix
52660
+ * List.
52661
+ */
52662
+ const MULTI_PART_SUFFIXES = new Set([
52663
+ 'co.uk',
52664
+ 'org.uk',
52665
+ 'ac.uk',
52666
+ 'gov.uk',
52667
+ 'me.uk',
52668
+ 'net.uk',
52669
+ 'sch.uk',
52670
+ 'co.jp',
52671
+ 'ne.jp',
52672
+ 'or.jp',
52673
+ 'ac.jp',
52674
+ 'go.jp',
52675
+ 'com.au',
52676
+ 'net.au',
52677
+ 'org.au',
52678
+ 'edu.au',
52679
+ 'gov.au',
52680
+ 'com.br',
52681
+ 'net.br',
52682
+ 'org.br',
52683
+ 'com.cn',
52684
+ 'net.cn',
52685
+ 'org.cn',
52686
+ 'gov.cn',
52687
+ 'co.in',
52688
+ 'net.in',
52689
+ 'org.in',
52690
+ 'co.nz',
52691
+ 'net.nz',
52692
+ 'org.nz',
52693
+ 'co.za',
52694
+ 'org.za',
52695
+ 'com.mx',
52696
+ 'com.ar',
52697
+ 'com.co',
52698
+ 'com.pe',
52699
+ 'com.tr',
52700
+ 'com.tw',
52701
+ 'com.sg',
52702
+ 'com.hk',
52703
+ 'com.my',
52704
+ 'com.ph',
52705
+ 'com.vn',
52706
+ 'co.kr',
52707
+ 'co.il',
52708
+ 'co.id',
52709
+ 'co.th',
52710
+ 'com.ua',
52711
+ 'com.pl',
52712
+ 'com.es',
52713
+ ]);
52714
+ const SCROLL_DEPTH_THROTTLE_MS = 200;
52715
+ class AnalyticsTracking {
52716
+ constructor(emit, options = {}) {
52717
+ this.pageviewCleanups = [];
52718
+ this.scrollCleanups = [];
52719
+ this.engagementCleanups = [];
52720
+ this.maxScrollDepth = 0;
52721
+ this.scrollTicking = false;
52722
+ this.lastScrollReport = 0;
52723
+ this.engagementStart = 0;
52724
+ this.engagementAccumulatedMs = 0;
52725
+ this.engagementActive = false;
52726
+ this.emit = emit;
52727
+ this.respectDoNotTrack = options.respectDoNotTrack !== false;
52728
+ this.propertyId = options.propertyId;
52729
+ }
52730
+ /**
52731
+ * Enable the opinionated default auto-tracking set: pageviews, outbound
52732
+ * links, scroll depth and active engagement time. Downloads must be opted
52733
+ * into separately via `enableAutoDownloadTracking()` because the extension
52734
+ * list is application-specific.
52735
+ */
52736
+ enableAllAutoTracking() {
52737
+ this.enableAutoPageviews();
52738
+ this.enableAutoOutboundTracking();
52739
+ this.enableAutoScrollDepth();
52740
+ this.enableAutoEngagementTime();
52741
+ }
52742
+ /**
52743
+ * Track an event manually. Respects the DNT setting and swallows emitter
52744
+ * exceptions so tracking failures never surface to the host page.
52745
+ */
52746
+ track(name, options) {
52747
+ if (!this.canTrack()) {
52748
+ return;
52749
+ }
52750
+ try {
52751
+ this.emit(name, this.withPropertyId(options));
52752
+ }
52753
+ catch (error) {
52754
+ console.warn('AnalyticsTracking: emitter threw', error);
52755
+ }
52756
+ }
52757
+ /**
52758
+ * Convenience wrapper for pageview-shaped events.
52759
+ */
52760
+ pageview(url, referrer) {
52761
+ this.track('pageview', {
52762
+ url: url !== null && url !== void 0 ? url : this.currentPageUrl(),
52763
+ referrer: referrer !== null && referrer !== void 0 ? referrer : (typeof document !== 'undefined'
52764
+ ? document.referrer
52765
+ : undefined),
52766
+ });
52767
+ }
52768
+ /**
52769
+ * Enable SPA-aware pageview tracking. Fires an initial pageview on
52770
+ * enable, then again on every `pushState`, `replaceState`, `popstate`
52771
+ * or hashchange. Idempotent — repeat calls no-op.
52772
+ */
52773
+ enableAutoPageviews() {
52774
+ if (this.pageviewCleanups.length > 0) {
52775
+ return;
52776
+ }
52777
+ if (typeof window === 'undefined' || typeof history === 'undefined') {
52778
+ return;
52779
+ }
52780
+ this.currentPath = this.currentPageUrl();
52781
+ this.pageview();
52782
+ const handleNavigation = () => {
52783
+ const nextPath = this.currentPageUrl();
52784
+ if (nextPath === this.currentPath) {
52785
+ return;
52786
+ }
52787
+ const previous = this.currentPath;
52788
+ this.currentPath = nextPath;
52789
+ this.flushScrollDepth(previous);
52790
+ this.flushEngagement(previous);
52791
+ this.pageview(nextPath);
52792
+ // flushEngagement no longer auto-restarts the timer (see its
52793
+ // implementation note re: bfcache). SPA navigation stays on the
52794
+ // same document, so restart engagement tracking for the new
52795
+ // route as long as the tab is visible.
52796
+ if (this.engagementCleanups.length > 0 &&
52797
+ (typeof document === 'undefined' ||
52798
+ document.visibilityState !== 'hidden')) {
52799
+ this.startEngagement();
52800
+ }
52801
+ };
52802
+ const originalPushState = history.pushState.bind(history);
52803
+ const originalReplaceState = history.replaceState.bind(history);
52804
+ // Our wrappers stay reachable after cleanup whenever another library
52805
+ // patched on top of ours, so they have to be switchable off rather than
52806
+ // merely unreferenced.
52807
+ let patchActive = true;
52808
+ const patchedPushState = (data, unused, url) => {
52809
+ originalPushState(data, unused, url);
52810
+ if (patchActive) {
52811
+ handleNavigation();
52812
+ }
52813
+ };
52814
+ const patchedReplaceState = (data, unused, url) => {
52815
+ originalReplaceState(data, unused, url);
52816
+ if (patchActive) {
52817
+ handleNavigation();
52818
+ }
52819
+ };
52820
+ history.pushState = patchedPushState;
52821
+ history.replaceState = patchedReplaceState;
52822
+ const popstateHandler = () => handleNavigation();
52823
+ const hashchangeHandler = () => handleNavigation();
52824
+ window.addEventListener('popstate', popstateHandler);
52825
+ window.addEventListener('hashchange', hashchangeHandler);
52826
+ this.pageviewCleanups.push(() => {
52827
+ // Only unwind our own patch. A router (Next.js App Router, React
52828
+ // Router, …) that patched these after us owns the current value,
52829
+ // and assigning our saved reference back would silently throw its
52830
+ // wrapper away. In that case ours stays in the chain, which is why
52831
+ // `patchActive` exists: the wrapper keeps delegating to the original
52832
+ // but stops reporting.
52833
+ patchActive = false;
52834
+ if (history.pushState === patchedPushState) {
52835
+ history.pushState = originalPushState;
52836
+ }
52837
+ if (history.replaceState === patchedReplaceState) {
52838
+ history.replaceState = originalReplaceState;
52839
+ }
52840
+ window.removeEventListener('popstate', popstateHandler);
52841
+ window.removeEventListener('hashchange', hashchangeHandler);
52842
+ });
52843
+ }
52844
+ /**
52845
+ * Disable auto-pageview tracking installed by `enableAutoPageviews`.
52846
+ * Safe to call when auto-pageviews were never enabled.
52847
+ */
52848
+ disableAutoPageviews() {
52849
+ for (const cleanup of this.pageviewCleanups) {
52850
+ cleanup();
52851
+ }
52852
+ this.pageviewCleanups = [];
52853
+ }
52854
+ /**
52855
+ * Enable click-based outbound link tracking. Detects anchor clicks that
52856
+ * navigate to a different origin and fires an `outbound_link` event
52857
+ * (with `hostname` and `href` props) before the browser navigates.
52858
+ */
52859
+ enableAutoOutboundTracking(options = {}) {
52860
+ if (this.outboundCleanup) {
52861
+ return;
52862
+ }
52863
+ if (typeof document === 'undefined') {
52864
+ return;
52865
+ }
52866
+ const includeSubdomains = options.includeSubdomains === true;
52867
+ const clickHandler = (event) => {
52868
+ const anchor = this.findAnchor(event.target);
52869
+ if (!anchor || !anchor.href) {
52870
+ return;
52871
+ }
52872
+ const target = this.parseUrl(anchor.href);
52873
+ if (!target || !this.isExternal(target, includeSubdomains)) {
52874
+ return;
52875
+ }
52876
+ this.track('outbound_link', {
52877
+ url: target.href,
52878
+ props: { hostname: target.hostname, href: target.href },
52879
+ });
52880
+ };
52881
+ document.addEventListener('click', clickHandler, { capture: true });
52882
+ this.outboundCleanup = () => document.removeEventListener('click', clickHandler, {
52883
+ capture: true,
52884
+ });
52885
+ }
52886
+ /**
52887
+ * Disable outbound-link tracking installed by `enableAutoOutboundTracking`.
52888
+ * Safe to call when auto-outbound was never enabled.
52889
+ */
52890
+ disableAutoOutboundTracking() {
52891
+ if (this.outboundCleanup) {
52892
+ this.outboundCleanup();
52893
+ this.outboundCleanup = undefined;
52894
+ }
52895
+ }
52896
+ /**
52897
+ * Enable click-based download tracking. Detects anchor clicks that point
52898
+ * at a file whose extension appears in the configured list and fires a
52899
+ * `file_download` event with `filename`, `extension` and `href` props.
52900
+ */
52901
+ enableAutoDownloadTracking(options = {}) {
52902
+ var _a;
52903
+ if (this.downloadCleanup) {
52904
+ return;
52905
+ }
52906
+ if (typeof document === 'undefined') {
52907
+ return;
52908
+ }
52909
+ const extensions = ((_a = options.extensions) !== null && _a !== void 0 ? _a : DEFAULT_DOWNLOAD_EXTENSIONS).map((ext) => ext.toLowerCase().replace(/^\./, ''));
52910
+ const extensionSet = new Set(extensions);
52911
+ const clickHandler = (event) => {
52912
+ var _a, _b;
52913
+ const anchor = this.findAnchor(event.target);
52914
+ if (!anchor || !anchor.href) {
52915
+ return;
52916
+ }
52917
+ const url = this.parseUrl(anchor.href);
52918
+ if (!url) {
52919
+ return;
52920
+ }
52921
+ const filename = (_a = url.pathname.split('/').pop()) !== null && _a !== void 0 ? _a : '';
52922
+ const extension = filename.includes('.')
52923
+ ? (_b = filename.split('.').pop()) === null || _b === void 0 ? void 0 : _b.toLowerCase()
52924
+ : undefined;
52925
+ if (!extension || !extensionSet.has(extension)) {
52926
+ return;
52927
+ }
52928
+ this.track('file_download', {
52929
+ url: url.href,
52930
+ props: { filename, extension, href: url.href },
52931
+ });
52932
+ };
52933
+ document.addEventListener('click', clickHandler, { capture: true });
52934
+ this.downloadCleanup = () => document.removeEventListener('click', clickHandler, {
52935
+ capture: true,
52936
+ });
52937
+ }
52938
+ /**
52939
+ * Disable file-download tracking installed by `enableAutoDownloadTracking`.
52940
+ * Safe to call when auto-download was never enabled.
52941
+ */
52942
+ disableAutoDownloadTracking() {
52943
+ if (this.downloadCleanup) {
52944
+ this.downloadCleanup();
52945
+ this.downloadCleanup = undefined;
52946
+ }
52947
+ }
52948
+ /**
52949
+ * Enable passive scroll-depth tracking. Records the maximum percent of the
52950
+ * document scrolled and reports it on `beforeunload` and on SPA route
52951
+ * changes. Uses a throttled passive listener so it is safe on hot paths.
52952
+ */
52953
+ enableAutoScrollDepth() {
52954
+ if (this.scrollCleanups.length > 0) {
52955
+ return;
52956
+ }
52957
+ if (typeof window === 'undefined' || typeof document === 'undefined') {
52958
+ return;
52959
+ }
52960
+ this.maxScrollDepth = 0;
52961
+ this.lastScrollReport = 0;
52962
+ const scrollHandler = () => {
52963
+ if (this.scrollTicking) {
52964
+ return;
52965
+ }
52966
+ this.scrollTicking = true;
52967
+ window.requestAnimationFrame(() => {
52968
+ const now = Date.now();
52969
+ if (now - this.lastScrollReport < SCROLL_DEPTH_THROTTLE_MS) {
52970
+ this.scrollTicking = false;
52971
+ return;
52972
+ }
52973
+ this.lastScrollReport = now;
52974
+ const depth = this.computeScrollDepth();
52975
+ if (depth > this.maxScrollDepth) {
52976
+ this.maxScrollDepth = depth;
52977
+ }
52978
+ this.scrollTicking = false;
52979
+ });
52980
+ };
52981
+ const unloadHandler = () => {
52982
+ this.flushScrollDepth(this.currentPageUrl());
52983
+ };
52984
+ window.addEventListener('scroll', scrollHandler, { passive: true });
52985
+ window.addEventListener('beforeunload', unloadHandler);
52986
+ window.addEventListener('pagehide', unloadHandler);
52987
+ this.scrollCleanups.push(() => {
52988
+ window.removeEventListener('scroll', scrollHandler);
52989
+ window.removeEventListener('beforeunload', unloadHandler);
52990
+ window.removeEventListener('pagehide', unloadHandler);
52991
+ });
52992
+ }
52993
+ /**
52994
+ * Disable scroll-depth tracking installed by `enableAutoScrollDepth`. Safe
52995
+ * to call when auto-scroll-depth was never enabled. Any accumulated depth
52996
+ * for the current page is dropped.
52997
+ */
52998
+ disableAutoScrollDepth() {
52999
+ for (const cleanup of this.scrollCleanups) {
53000
+ cleanup();
53001
+ }
53002
+ this.scrollCleanups = [];
53003
+ this.maxScrollDepth = 0;
53004
+ this.scrollTicking = false;
53005
+ this.lastScrollReport = 0;
53006
+ }
53007
+ /**
53008
+ * Enable active engagement-time tracking. Counts time the tab is visible
53009
+ * and uses `visibilitychange` to exclude background time.
53010
+ *
53011
+ * Delivery follows Plausible's model rather than a single total at the
53012
+ * end of the visit: an `engagement_time` event is emitted at every natural
53013
+ * checkpoint — the tab going hidden, an SPA route change, and finally
53014
+ * `beforeunload`/`pagehide`. Unload is kept only as a best-effort last
53015
+ * flush; it is the least reliable moment to send anything (browsers
53016
+ * routinely cancel in-flight requests there, and `sendBeacon` cannot set
53017
+ * the `X-Appwrite-Project` header the endpoint requires), so it must never
53018
+ * be the only delivery.
53019
+ *
53020
+ * Each event carries a **delta** — the seconds accrued since the previous
53021
+ * flush, not a running total — so the values are additive per session and
53022
+ * a lost event costs only its own slice.
53023
+ *
53024
+ * There is deliberately no periodic ping. The cadence is driven by
53025
+ * navigation and tab switches, so request volume tracks what the visitor
53026
+ * actually does instead of multiplying with time on page.
53027
+ */
53028
+ enableAutoEngagementTime() {
53029
+ if (this.engagementCleanups.length > 0) {
53030
+ return;
53031
+ }
53032
+ if (typeof window === 'undefined' || typeof document === 'undefined') {
53033
+ return;
53034
+ }
53035
+ this.engagementAccumulatedMs = 0;
53036
+ // Do not start the clock for a tab that is already hidden (prerender,
53037
+ // background tab restore); `visibilitychange` starts it when it is
53038
+ // actually looked at.
53039
+ if (document.visibilityState !== 'hidden') {
53040
+ this.startEngagement();
53041
+ }
53042
+ const visibilityHandler = () => {
53043
+ if (document.visibilityState === 'hidden') {
53044
+ // Flush, don't just pause. The page is still fully alive here,
53045
+ // which makes this the most reliable delivery point in the
53046
+ // whole visit — and it is the same moment Plausible reports on.
53047
+ this.flushEngagement(this.currentPageUrl());
53048
+ }
53049
+ else if (document.visibilityState === 'visible') {
53050
+ this.startEngagement();
53051
+ }
53052
+ };
53053
+ const unloadHandler = () => {
53054
+ this.flushEngagement(this.currentPageUrl());
53055
+ };
53056
+ const pageshowHandler = (event) => {
53057
+ // When the page is restored from the back-forward cache the
53058
+ // engagement timer is in a stopped state (flushEngagement paused
53059
+ // it on pagehide and does not auto-restart). Kick off a fresh
53060
+ // engagementStart so bfcache dwell time is not billed as
53061
+ // engagement.
53062
+ if (event.persisted) {
53063
+ this.startEngagement();
53064
+ }
53065
+ };
53066
+ document.addEventListener('visibilitychange', visibilityHandler);
53067
+ window.addEventListener('beforeunload', unloadHandler);
53068
+ window.addEventListener('pagehide', unloadHandler);
53069
+ window.addEventListener('pageshow', pageshowHandler);
53070
+ this.engagementCleanups.push(() => {
53071
+ document.removeEventListener('visibilitychange', visibilityHandler);
53072
+ window.removeEventListener('beforeunload', unloadHandler);
53073
+ window.removeEventListener('pagehide', unloadHandler);
53074
+ window.removeEventListener('pageshow', pageshowHandler);
53075
+ });
53076
+ }
53077
+ /**
53078
+ * Disable engagement-time tracking installed by `enableAutoEngagementTime`.
53079
+ * Safe to call when auto-engagement was never enabled. Any accumulated
53080
+ * engagement time is dropped without being emitted.
53081
+ */
53082
+ disableAutoEngagementTime() {
53083
+ for (const cleanup of this.engagementCleanups) {
53084
+ cleanup();
53085
+ }
53086
+ this.engagementCleanups = [];
53087
+ this.engagementActive = false;
53088
+ this.engagementAccumulatedMs = 0;
53089
+ this.engagementStart = 0;
53090
+ }
53091
+ /**
53092
+ * Merge the configured `propertyId` into an event's options. Returns the
53093
+ * caller's object untouched when no default is configured (or the event
53094
+ * already carries one), so emitters written against the pre-`propertyId`
53095
+ * shape keep receiving exactly what they received before.
53096
+ */
53097
+ withPropertyId(options) {
53098
+ if (this.propertyId === undefined ||
53099
+ (options === null || options === void 0 ? void 0 : options.propertyId) !== undefined) {
53100
+ return options;
53101
+ }
53102
+ return Object.assign(Object.assign({}, (options !== null && options !== void 0 ? options : {})), { propertyId: this.propertyId });
53103
+ }
53104
+ canTrack() {
53105
+ if (!this.respectDoNotTrack) {
53106
+ return true;
53107
+ }
53108
+ if (typeof navigator === 'undefined') {
53109
+ return true;
53110
+ }
53111
+ return navigator.doNotTrack !== '1';
53112
+ }
53113
+ currentPageUrl() {
53114
+ if (typeof window === 'undefined' || !window.location) {
53115
+ return '';
53116
+ }
53117
+ return window.location.href;
53118
+ }
53119
+ findAnchor(target) {
53120
+ let node = target;
53121
+ while (node) {
53122
+ if (node.tagName === 'A') {
53123
+ return node;
53124
+ }
53125
+ node = node.parentNode;
53126
+ }
53127
+ return null;
53128
+ }
53129
+ parseUrl(href) {
53130
+ try {
53131
+ return new URL(href, window.location.href);
53132
+ }
53133
+ catch (_a) {
53134
+ return null;
53135
+ }
53136
+ }
53137
+ isExternal(target, includeSubdomains) {
53138
+ if (target.protocol !== 'http:' && target.protocol !== 'https:') {
53139
+ return false;
53140
+ }
53141
+ if (target.hostname === window.location.hostname) {
53142
+ return false;
53143
+ }
53144
+ if (includeSubdomains) {
53145
+ return true;
53146
+ }
53147
+ const root = this.rootDomain(window.location.hostname);
53148
+ return this.rootDomain(target.hostname) !== root;
53149
+ }
53150
+ rootDomain(hostname) {
53151
+ const parts = hostname.split('.');
53152
+ if (parts.length <= 2) {
53153
+ return hostname;
53154
+ }
53155
+ // Taking the last two labels is wrong wherever the registry sells names
53156
+ // one level down: `shop.example.co.uk` and `google.co.uk` both reduce to
53157
+ // `co.uk`, so every outbound click between two `.co.uk` sites looks
53158
+ // internal and is dropped. Take three labels after a known two-part
53159
+ // suffix instead.
53160
+ //
53161
+ // This is a heuristic, not the Public Suffix List — the full list is
53162
+ // orders of magnitude larger than this whole file, and a tracking
53163
+ // snippet cannot carry it. Sites on a suffix that is missing here can
53164
+ // pass `includeSubdomains: true` to treat every other host as outbound.
53165
+ const suffix = parts.slice(-2).join('.');
53166
+ if (parts.length > 2 && MULTI_PART_SUFFIXES.has(suffix)) {
53167
+ return parts.slice(-3).join('.');
53168
+ }
53169
+ return suffix;
53170
+ }
53171
+ computeScrollDepth() {
53172
+ const scrollTop = window.scrollY || document.documentElement.scrollTop;
53173
+ const viewport = window.innerHeight || document.documentElement.clientHeight;
53174
+ const total = document.documentElement.scrollHeight;
53175
+ if (total <= viewport) {
53176
+ return 100;
53177
+ }
53178
+ const depth = Math.round(((scrollTop + viewport) / total) * 100);
53179
+ return Math.max(0, Math.min(100, depth));
53180
+ }
53181
+ flushScrollDepth(url) {
53182
+ if (this.scrollCleanups.length === 0) {
53183
+ return;
53184
+ }
53185
+ if (this.maxScrollDepth <= 0) {
53186
+ return;
53187
+ }
53188
+ this.track('scroll_depth', {
53189
+ url,
53190
+ scrollDepth: this.maxScrollDepth,
53191
+ });
53192
+ this.maxScrollDepth = 0;
53193
+ }
53194
+ startEngagement() {
53195
+ if (this.engagementActive) {
53196
+ return;
53197
+ }
53198
+ this.engagementActive = true;
53199
+ this.engagementStart = Date.now();
53200
+ }
53201
+ pauseEngagement() {
53202
+ if (!this.engagementActive) {
53203
+ return;
53204
+ }
53205
+ this.engagementActive = false;
53206
+ this.engagementAccumulatedMs += Date.now() - this.engagementStart;
53207
+ }
53208
+ flushEngagement(url) {
53209
+ if (this.engagementCleanups.length === 0) {
53210
+ return;
53211
+ }
53212
+ this.pauseEngagement();
53213
+ // Deltas, not a running total: emit only what accrued since the last
53214
+ // flush. `floor` plus keeping the sub-second remainder in the
53215
+ // accumulator is what makes repeated flushes safe — nothing is emitted
53216
+ // twice, and a visit chopped into many short segments does not lose a
53217
+ // fraction of a second to rounding on every one of them.
53218
+ const seconds = Math.floor(this.engagementAccumulatedMs / 1000);
53219
+ if (seconds > 0) {
53220
+ // Deduct before emitting so a synchronous emitter that re-enters
53221
+ // (or throws) can never bill the same seconds again.
53222
+ this.engagementAccumulatedMs -= seconds * 1000;
53223
+ this.track('engagement_time', {
53224
+ url,
53225
+ engagementTime: seconds,
53226
+ });
53227
+ }
53228
+ // NOTE: intentionally do NOT call startEngagement() here. flushEngagement
53229
+ // runs on `pagehide`, which is also the last hook before the browser
53230
+ // may freeze the page into the back-forward cache. Auto-restarting
53231
+ // would snapshot engagementStart just before the freeze; the next
53232
+ // pauseEngagement (after bfcache restore) would then bill the entire
53233
+ // bfcache dwell as active engagement. Restart is driven by explicit
53234
+ // resume signals: `pageshow` (with `persisted === true`),
53235
+ // `visibilitychange` back to visible, or the SPA navigation flow in
53236
+ // `enableAutoPageviews`.
53237
+ }
53238
+ }
53239
+
50586
53240
  /**
50587
53241
  * Helper class to generate permission strings for resources.
50588
53242
  */
@@ -51289,6 +53943,68 @@
51289
53943
  OAuthProvider["Zoom"] = "zoom";
51290
53944
  })(exports.OAuthProvider || (exports.OAuthProvider = {}));
51291
53945
 
53946
+ exports.PlatformResourceType = void 0;
53947
+ (function (PlatformResourceType) {
53948
+ PlatformResourceType["Projects"] = "projects";
53949
+ PlatformResourceType["Organizations"] = "organizations";
53950
+ PlatformResourceType["Users"] = "users";
53951
+ PlatformResourceType["Memberships"] = "memberships";
53952
+ PlatformResourceType["Rules"] = "rules";
53953
+ PlatformResourceType["Keys"] = "keys";
53954
+ PlatformResourceType["Platforms"] = "platforms";
53955
+ PlatformResourceType["Webhooks"] = "webhooks";
53956
+ PlatformResourceType["Certificates"] = "certificates";
53957
+ })(exports.PlatformResourceType || (exports.PlatformResourceType = {}));
53958
+
53959
+ exports.ProjectResourceType = void 0;
53960
+ (function (ProjectResourceType) {
53961
+ ProjectResourceType["Users"] = "users";
53962
+ ProjectResourceType["Teams"] = "teams";
53963
+ ProjectResourceType["Memberships"] = "memberships";
53964
+ ProjectResourceType["Databases"] = "databases";
53965
+ ProjectResourceType["Buckets"] = "buckets";
53966
+ ProjectResourceType["Functions"] = "functions";
53967
+ ProjectResourceType["Sites"] = "sites";
53968
+ ProjectResourceType["Deployments"] = "deployments";
53969
+ ProjectResourceType["Topics"] = "topics";
53970
+ ProjectResourceType["Providers"] = "providers";
53971
+ ProjectResourceType["Messages"] = "messages";
53972
+ })(exports.ProjectResourceType || (exports.ProjectResourceType = {}));
53973
+
53974
+ exports.AnalyticsInterval = void 0;
53975
+ (function (AnalyticsInterval) {
53976
+ AnalyticsInterval["OneHour"] = "1h";
53977
+ AnalyticsInterval["OneDay"] = "1d";
53978
+ AnalyticsInterval["OneWeek"] = "1w";
53979
+ AnalyticsInterval["OneMonth"] = "1m";
53980
+ })(exports.AnalyticsInterval || (exports.AnalyticsInterval = {}));
53981
+
53982
+ exports.AnalyticsDimension = void 0;
53983
+ (function (AnalyticsDimension) {
53984
+ AnalyticsDimension["Country"] = "country";
53985
+ AnalyticsDimension["Region"] = "region";
53986
+ AnalyticsDimension["City"] = "city";
53987
+ AnalyticsDimension["Browser"] = "browser";
53988
+ AnalyticsDimension["OperatingSystem"] = "operatingSystem";
53989
+ AnalyticsDimension["Device"] = "device";
53990
+ AnalyticsDimension["ScreenSize"] = "screenSize";
53991
+ AnalyticsDimension["ReferrerSource"] = "referrerSource";
53992
+ AnalyticsDimension["Channel"] = "channel";
53993
+ AnalyticsDimension["UtmSource"] = "utmSource";
53994
+ AnalyticsDimension["UtmMedium"] = "utmMedium";
53995
+ AnalyticsDimension["UtmCampaign"] = "utmCampaign";
53996
+ AnalyticsDimension["UtmContent"] = "utmContent";
53997
+ AnalyticsDimension["UtmTerm"] = "utmTerm";
53998
+ AnalyticsDimension["Page"] = "page";
53999
+ AnalyticsDimension["Hostname"] = "hostname";
54000
+ AnalyticsDimension["EntryPage"] = "entryPage";
54001
+ AnalyticsDimension["ExitPage"] = "exitPage";
54002
+ AnalyticsDimension["TrafficType"] = "trafficType";
54003
+ AnalyticsDimension["BotName"] = "botName";
54004
+ AnalyticsDimension["BotCategory"] = "botCategory";
54005
+ AnalyticsDimension["EventName"] = "eventName";
54006
+ })(exports.AnalyticsDimension || (exports.AnalyticsDimension = {}));
54007
+
51292
54008
  exports.Browser = void 0;
51293
54009
  (function (Browser) {
51294
54010
  Browser["AvantBrowser"] = "aa";
@@ -52104,6 +54820,14 @@
52104
54820
  QuerySuggestionResource["ResourceTokens"] = "resourcetokens";
52105
54821
  QuerySuggestionResource["Transactions"] = "transactions";
52106
54822
  QuerySuggestionResource["TransactionLogs"] = "transactionlogs";
54823
+ QuerySuggestionResource["Videos"] = "videos";
54824
+ QuerySuggestionResource["VideosPreviews"] = "videos_previews";
54825
+ QuerySuggestionResource["VideosRenditions"] = "videos_renditions";
54826
+ QuerySuggestionResource["VideosRenditionsSegments"] = "videos_renditions_segments";
54827
+ QuerySuggestionResource["VideosProfiles"] = "videos_profiles";
54828
+ QuerySuggestionResource["VideosSubtitles"] = "videos_subtitles";
54829
+ QuerySuggestionResource["VideosSubtitlesSegments"] = "videos_subtitles_segments";
54830
+ QuerySuggestionResource["AnalyticsProperties"] = "analyticsproperties";
52107
54831
  QuerySuggestionResource["DedicatedDatabases"] = "dedicateddatabases";
52108
54832
  QuerySuggestionResource["DedicatedDatabaseConfigs"] = "dedicateddatabaseconfigs";
52109
54833
  QuerySuggestionResource["DedicatedDatabaseRuntimes"] = "dedicateddatabaseruntimes";
@@ -52526,6 +55250,8 @@
52526
55250
  ProjectKeyScopes["ReportsWrite"] = "reports.write";
52527
55251
  ProjectKeyScopes["PresencesRead"] = "presences.read";
52528
55252
  ProjectKeyScopes["PresencesWrite"] = "presences.write";
55253
+ ProjectKeyScopes["VideosRead"] = "videos.read";
55254
+ ProjectKeyScopes["VideosWrite"] = "videos.write";
52529
55255
  ProjectKeyScopes["DedicatedDatabasesExecute"] = "dedicatedDatabases.execute";
52530
55256
  ProjectKeyScopes["BackupsPoliciesRead"] = "backups.policies.read";
52531
55257
  ProjectKeyScopes["BackupsPoliciesWrite"] = "backups.policies.write";
@@ -52544,6 +55270,8 @@
52544
55270
  ProjectKeyScopes["Oauth2Read"] = "oauth2.read";
52545
55271
  ProjectKeyScopes["Oauth2Write"] = "oauth2.write";
52546
55272
  ProjectKeyScopes["Oauth2Introspect"] = "oauth2.introspect";
55273
+ ProjectKeyScopes["AnalyticsRead"] = "analytics.read";
55274
+ ProjectKeyScopes["AnalyticsWrite"] = "analytics.write";
52547
55275
  })(exports.ProjectKeyScopes || (exports.ProjectKeyScopes = {}));
52548
55276
 
52549
55277
  exports.FunctionTemplateUseCase = void 0;
@@ -52793,6 +55521,7 @@
52793
55521
  ProjectAuthMethodId["Invites"] = "invites";
52794
55522
  ProjectAuthMethodId["Jwt"] = "jwt";
52795
55523
  ProjectAuthMethodId["Phone"] = "phone";
55524
+ ProjectAuthMethodId["Passkey"] = "passkey";
52796
55525
  })(exports.ProjectAuthMethodId || (exports.ProjectAuthMethodId = {}));
52797
55526
 
52798
55527
  exports.ProjectOAuth2Auth0Prompt = void 0;
@@ -52934,6 +55663,7 @@
52934
55663
  ProjectPolicyId["Denydisposableemail"] = "deny-disposable-email";
52935
55664
  ProjectPolicyId["Denyfreeemail"] = "deny-free-email";
52936
55665
  ProjectPolicyId["Denycorporateemail"] = "deny-corporate-email";
55666
+ ProjectPolicyId["Passkey"] = "passkey";
52937
55667
  })(exports.ProjectPolicyId || (exports.ProjectPolicyId = {}));
52938
55668
 
52939
55669
  exports.ProjectProtocolId = void 0;
@@ -53178,6 +55908,9 @@
53178
55908
 
53179
55909
  exports.UsageEventMetric = void 0;
53180
55910
  (function (UsageEventMetric) {
55911
+ UsageEventMetric["AnalyticsEvents"] = "analytics.events";
55912
+ UsageEventMetric["AnalyticsPageviews"] = "analytics.pageviews";
55913
+ UsageEventMetric["AnalyticsBotsEvents"] = "analytics.bots.events";
53181
55914
  UsageEventMetric["NetworkRequests"] = "network.requests";
53182
55915
  UsageEventMetric["NetworkInbound"] = "network.inbound";
53183
55916
  UsageEventMetric["NetworkOutbound"] = "network.outbound";
@@ -53295,6 +56028,7 @@
53295
56028
 
53296
56029
  exports.UsageGaugeMetric = void 0;
53297
56030
  (function (UsageGaugeMetric) {
56031
+ UsageGaugeMetric["AnalyticsProperties"] = "analytics.properties";
53298
56032
  UsageGaugeMetric["Teams"] = "teams";
53299
56033
  UsageGaugeMetric["Users"] = "users";
53300
56034
  UsageGaugeMetric["Messages"] = "messages";
@@ -53392,6 +56126,24 @@
53392
56126
  VectorsDBIndexType["Unique"] = "unique";
53393
56127
  })(exports.VectorsDBIndexType || (exports.VectorsDBIndexType = {}));
53394
56128
 
56129
+ exports.VideoOutput = void 0;
56130
+ (function (VideoOutput) {
56131
+ VideoOutput["Hls"] = "hls";
56132
+ VideoOutput["Dash"] = "dash";
56133
+ VideoOutput["Cmaf"] = "cmaf";
56134
+ })(exports.VideoOutput || (exports.VideoOutput = {}));
56135
+
56136
+ exports.VideoRenditionStatus = void 0;
56137
+ (function (VideoRenditionStatus) {
56138
+ VideoRenditionStatus["Pending"] = "pending";
56139
+ VideoRenditionStatus["Started"] = "started";
56140
+ VideoRenditionStatus["Ended"] = "ended";
56141
+ VideoRenditionStatus["Uploading"] = "uploading";
56142
+ VideoRenditionStatus["Ready"] = "ready";
56143
+ VideoRenditionStatus["Error"] = "error";
56144
+ VideoRenditionStatus["Aborted"] = "aborted";
56145
+ })(exports.VideoRenditionStatus || (exports.VideoRenditionStatus = {}));
56146
+
53395
56147
  exports.DatabaseType = void 0;
53396
56148
  (function (DatabaseType) {
53397
56149
  DatabaseType["Legacy"] = "legacy";
@@ -53570,6 +56322,7 @@
53570
56322
  (function (ProxyRuleDeploymentResourceType) {
53571
56323
  ProxyRuleDeploymentResourceType["Function"] = "function";
53572
56324
  ProxyRuleDeploymentResourceType["Site"] = "site";
56325
+ ProxyRuleDeploymentResourceType["DedicatedDatabase"] = "dedicatedDatabase";
53573
56326
  })(exports.ProxyRuleDeploymentResourceType || (exports.ProxyRuleDeploymentResourceType = {}));
53574
56327
 
53575
56328
  exports.ProxyRuleStatus = void 0;
@@ -55649,8 +58402,11 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
55649
58402
 
55650
58403
  exports.Account = Account;
55651
58404
  exports.Activities = Activities;
58405
+ exports.Admin = Admin;
55652
58406
  exports.Advisor = Advisor;
55653
58407
  exports.Affiliates = Affiliates;
58408
+ exports.Analytics = Analytics;
58409
+ exports.AnalyticsTracking = AnalyticsTracking;
55654
58410
  exports.Apps = Apps;
55655
58411
  exports.AppwriteException = AppwriteException;
55656
58412
  exports.Assistant = Assistant;
@@ -55699,6 +58455,7 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
55699
58455
  exports.Users = Users;
55700
58456
  exports.Vcs = Vcs;
55701
58457
  exports.VectorsDB = VectorsDB;
58458
+ exports.Videos = Videos;
55702
58459
  exports.Waf = Waf;
55703
58460
  exports.Webhooks = Webhooks;
55704
58461