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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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-rc.2',
4470
+ 'x-sdk-version': '18.3.0',
4471
4471
  'X-Appwrite-Response-Format': '2.3.0',
4472
4472
  };
4473
4473
  this.realtime = {
@@ -5320,6 +5320,29 @@
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
+
5323
5346
  class Account {
5324
5347
  constructor(client) {
5325
5348
  this.client = client;
@@ -6638,196 +6661,6 @@
6638
6661
  };
6639
6662
  return this.client.call('patch', uri, apiHeaders, apiPayload);
6640
6663
  }
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
- }
6831
6664
  updatePassword(paramsOrFirst, ...rest) {
6832
6665
  let params;
6833
6666
  if (paramsOrFirst &&
@@ -7571,7 +7404,7 @@
7571
7404
  }
7572
7405
  const uri = new URL(this.client.config.endpoint + apiPath);
7573
7406
  apiPayload['project'] = this.client.config.project;
7574
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
7407
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
7575
7408
  uri.searchParams.append(key, value);
7576
7409
  }
7577
7410
  if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {
@@ -7980,7 +7813,7 @@
7980
7813
  }
7981
7814
  const uri = new URL(this.client.config.endpoint + apiPath);
7982
7815
  apiPayload['project'] = this.client.config.project;
7983
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
7816
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
7984
7817
  uri.searchParams.append(key, value);
7985
7818
  }
7986
7819
  if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {
@@ -7991,60 +7824,6 @@
7991
7824
  return uri.toString();
7992
7825
  }
7993
7826
  }
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
- }
8048
7827
  createPhoneToken(paramsOrFirst, ...rest) {
8049
7828
  let params;
8050
7829
  if (paramsOrFirst &&
@@ -8391,135 +8170,6 @@
8391
8170
  }
8392
8171
  }
8393
8172
 
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
-
8523
8173
  class Affiliates {
8524
8174
  constructor(client) {
8525
8175
  this.client = client;
@@ -8731,369 +8381,6 @@
8731
8381
  }
8732
8382
  }
8733
8383
 
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
-
9097
8384
  class Apps {
9098
8385
  constructor(client) {
9099
8386
  this.client = client;
@@ -9986,7 +9273,7 @@
9986
9273
  const uri = new URL(this.client.config.endpoint + apiPath);
9987
9274
  apiPayload['project'] = this.client.config.project;
9988
9275
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
9989
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9276
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
9990
9277
  uri.searchParams.append(key, value);
9991
9278
  }
9992
9279
  return uri.toString();
@@ -10031,7 +9318,7 @@
10031
9318
  const uri = new URL(this.client.config.endpoint + apiPath);
10032
9319
  apiPayload['project'] = this.client.config.project;
10033
9320
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10034
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9321
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10035
9322
  uri.searchParams.append(key, value);
10036
9323
  }
10037
9324
  return uri.toString();
@@ -10060,7 +9347,7 @@
10060
9347
  const uri = new URL(this.client.config.endpoint + apiPath);
10061
9348
  apiPayload['project'] = this.client.config.project;
10062
9349
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10063
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9350
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10064
9351
  uri.searchParams.append(key, value);
10065
9352
  }
10066
9353
  return uri.toString();
@@ -10105,7 +9392,7 @@
10105
9392
  const uri = new URL(this.client.config.endpoint + apiPath);
10106
9393
  apiPayload['project'] = this.client.config.project;
10107
9394
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10108
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9395
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10109
9396
  uri.searchParams.append(key, value);
10110
9397
  }
10111
9398
  return uri.toString();
@@ -10144,7 +9431,7 @@
10144
9431
  const uri = new URL(this.client.config.endpoint + apiPath);
10145
9432
  apiPayload['project'] = this.client.config.project;
10146
9433
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10147
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9434
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10148
9435
  uri.searchParams.append(key, value);
10149
9436
  }
10150
9437
  return uri.toString();
@@ -10186,7 +9473,7 @@
10186
9473
  const uri = new URL(this.client.config.endpoint + apiPath);
10187
9474
  apiPayload['project'] = this.client.config.project;
10188
9475
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10189
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9476
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10190
9477
  uri.searchParams.append(key, value);
10191
9478
  }
10192
9479
  return uri.toString();
@@ -10248,7 +9535,7 @@
10248
9535
  const uri = new URL(this.client.config.endpoint + apiPath);
10249
9536
  apiPayload['project'] = this.client.config.project;
10250
9537
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10251
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9538
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10252
9539
  uri.searchParams.append(key, value);
10253
9540
  }
10254
9541
  return uri.toString();
@@ -10342,7 +9629,7 @@
10342
9629
  const uri = new URL(this.client.config.endpoint + apiPath);
10343
9630
  apiPayload['project'] = this.client.config.project;
10344
9631
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10345
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9632
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10346
9633
  uri.searchParams.append(key, value);
10347
9634
  }
10348
9635
  return uri.toString();
@@ -10466,7 +9753,7 @@
10466
9753
  const uri = new URL(this.client.config.endpoint + apiPath);
10467
9754
  apiPayload['project'] = this.client.config.project;
10468
9755
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10469
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9756
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10470
9757
  uri.searchParams.append(key, value);
10471
9758
  }
10472
9759
  return uri.toString();
@@ -19226,6 +18513,7 @@
19226
18513
  buildSpecification: rest[18],
19227
18514
  runtimeSpecification: rest[19],
19228
18515
  deploymentRetention: rest[20],
18516
+ interval: rest[21],
19229
18517
  };
19230
18518
  }
19231
18519
  const functionId = params.functionId;
@@ -19250,6 +18538,7 @@
19250
18538
  const buildSpecification = params.buildSpecification;
19251
18539
  const runtimeSpecification = params.runtimeSpecification;
19252
18540
  const deploymentRetention = params.deploymentRetention;
18541
+ const interval = params.interval;
19253
18542
  if (typeof functionId === 'undefined') {
19254
18543
  throw new AppwriteException('Missing required parameter: "functionId"');
19255
18544
  }
@@ -19327,6 +18616,9 @@
19327
18616
  if (typeof deploymentRetention !== 'undefined') {
19328
18617
  apiPayload['deploymentRetention'] = deploymentRetention;
19329
18618
  }
18619
+ if (typeof interval !== 'undefined') {
18620
+ apiPayload['interval'] = interval;
18621
+ }
19330
18622
  const uri = new URL(this.client.config.endpoint + apiPath);
19331
18623
  const apiHeaders = {
19332
18624
  'X-Appwrite-Project': this.client.config.project,
@@ -19524,6 +18816,7 @@
19524
18816
  buildSpecification: rest[18],
19525
18817
  runtimeSpecification: rest[19],
19526
18818
  deploymentRetention: rest[20],
18819
+ interval: rest[21],
19527
18820
  };
19528
18821
  }
19529
18822
  const functionId = params.functionId;
@@ -19548,6 +18841,7 @@
19548
18841
  const buildSpecification = params.buildSpecification;
19549
18842
  const runtimeSpecification = params.runtimeSpecification;
19550
18843
  const deploymentRetention = params.deploymentRetention;
18844
+ const interval = params.interval;
19551
18845
  if (typeof functionId === 'undefined' || functionId === '') {
19552
18846
  throw new AppwriteException('Missing required parameter: "functionId"');
19553
18847
  }
@@ -19619,6 +18913,9 @@
19619
18913
  if (typeof deploymentRetention !== 'undefined') {
19620
18914
  apiPayload['deploymentRetention'] = deploymentRetention;
19621
18915
  }
18916
+ if (typeof interval !== 'undefined') {
18917
+ apiPayload['interval'] = interval;
18918
+ }
19622
18919
  const uri = new URL(this.client.config.endpoint + apiPath);
19623
18920
  const apiHeaders = {
19624
18921
  'X-Appwrite-Project': this.client.config.project,
@@ -20042,7 +19339,7 @@
20042
19339
  const uri = new URL(this.client.config.endpoint + apiPath);
20043
19340
  apiPayload['project'] = this.client.config.project;
20044
19341
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
20045
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
19342
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
20046
19343
  uri.searchParams.append(key, value);
20047
19344
  }
20048
19345
  return uri.toString();
@@ -30681,7 +29978,7 @@
30681
29978
  const uri = new URL(this.client.config.endpoint + apiPath);
30682
29979
  apiPayload['project'] = this.client.config.project;
30683
29980
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
30684
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
29981
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
30685
29982
  uri.searchParams.append(key, value);
30686
29983
  }
30687
29984
  return uri.toString();
@@ -30788,7 +30085,7 @@
30788
30085
  const uri = new URL(this.client.config.endpoint + apiPath);
30789
30086
  apiPayload['project'] = this.client.config.project;
30790
30087
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
30791
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
30088
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
30792
30089
  uri.searchParams.append(key, value);
30793
30090
  }
30794
30091
  return uri.toString();
@@ -36284,38 +35581,6 @@
36284
35581
  };
36285
35582
  return this.client.call('patch', uri, apiHeaders, apiPayload);
36286
35583
  }
36287
- updatePasskeyPolicy(paramsOrFirst, ...rest) {
36288
- let params;
36289
- if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
36290
- (paramsOrFirst &&
36291
- typeof paramsOrFirst === 'object' &&
36292
- !Array.isArray(paramsOrFirst))) {
36293
- params = (paramsOrFirst || {});
36294
- }
36295
- else {
36296
- params = {
36297
- rpId: paramsOrFirst,
36298
- origins: rest[0],
36299
- };
36300
- }
36301
- const rpId = params.rpId;
36302
- const origins = params.origins;
36303
- const apiPath = '/project/policies/passkey';
36304
- const apiPayload = {};
36305
- if (typeof rpId !== 'undefined') {
36306
- apiPayload['rpId'] = rpId;
36307
- }
36308
- if (typeof origins !== 'undefined') {
36309
- apiPayload['origins'] = origins;
36310
- }
36311
- const uri = new URL(this.client.config.endpoint + apiPath);
36312
- const apiHeaders = {
36313
- 'X-Appwrite-Project': this.client.config.project,
36314
- 'content-type': 'application/json',
36315
- accept: 'application/json',
36316
- };
36317
- return this.client.call('patch', uri, apiHeaders, apiPayload);
36318
- }
36319
35584
  updatePasswordDictionaryPolicy(paramsOrFirst) {
36320
35585
  let params;
36321
35586
  if (paramsOrFirst &&
@@ -37399,6 +36664,7 @@
37399
36664
  schedule: rest[2],
37400
36665
  active: rest[3],
37401
36666
  data: rest[4],
36667
+ interval: rest[5],
37402
36668
  };
37403
36669
  }
37404
36670
  const projectId = params.projectId;
@@ -37407,6 +36673,7 @@
37407
36673
  const schedule = params.schedule;
37408
36674
  const active = params.active;
37409
36675
  const data = params.data;
36676
+ const interval = params.interval;
37410
36677
  if (typeof projectId === 'undefined' || projectId === '') {
37411
36678
  throw new AppwriteException('Missing required parameter: "projectId"');
37412
36679
  }
@@ -37416,9 +36683,6 @@
37416
36683
  if (typeof resourceId === 'undefined') {
37417
36684
  throw new AppwriteException('Missing required parameter: "resourceId"');
37418
36685
  }
37419
- if (typeof schedule === 'undefined') {
37420
- throw new AppwriteException('Missing required parameter: "schedule"');
37421
- }
37422
36686
  const apiPath = '/projects/{projectId}/schedules'.replace('{projectId}', encodeURIComponent(String(projectId)));
37423
36687
  const apiPayload = {};
37424
36688
  if (typeof resourceType !== 'undefined') {
@@ -37436,6 +36700,9 @@
37436
36700
  if (typeof data !== 'undefined') {
37437
36701
  apiPayload['data'] = data;
37438
36702
  }
36703
+ if (typeof interval !== 'undefined') {
36704
+ apiPayload['interval'] = interval;
36705
+ }
37439
36706
  const uri = new URL(this.client.config.endpoint + apiPath);
37440
36707
  const apiHeaders = {
37441
36708
  'X-Appwrite-Project': this.client.config.project,
@@ -39004,7 +38271,7 @@
39004
38271
  const uri = new URL(this.client.config.endpoint + apiPath);
39005
38272
  apiPayload['project'] = this.client.config.project;
39006
38273
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
39007
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
38274
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
39008
38275
  uri.searchParams.append(key, value);
39009
38276
  }
39010
38277
  return uri.toString();
@@ -39835,7 +39102,7 @@
39835
39102
  const uri = new URL(this.client.config.endpoint + apiPath);
39836
39103
  apiPayload['project'] = this.client.config.project;
39837
39104
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
39838
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
39105
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
39839
39106
  uri.searchParams.append(key, value);
39840
39107
  }
39841
39108
  return uri.toString();
@@ -39928,7 +39195,7 @@
39928
39195
  const uri = new URL(this.client.config.endpoint + apiPath);
39929
39196
  apiPayload['project'] = this.client.config.project;
39930
39197
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
39931
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
39198
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
39932
39199
  uri.searchParams.append(key, value);
39933
39200
  }
39934
39201
  return uri.toString();
@@ -39966,7 +39233,7 @@
39966
39233
  const uri = new URL(this.client.config.endpoint + apiPath);
39967
39234
  apiPayload['project'] = this.client.config.project;
39968
39235
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
39969
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
39236
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
39970
39237
  uri.searchParams.append(key, value);
39971
39238
  }
39972
39239
  return uri.toString();
@@ -46277,106 +45544,6 @@
46277
45544
  };
46278
45545
  return this.client.call('patch', uri, apiHeaders, apiPayload);
46279
45546
  }
46280
- listPasskeys(paramsOrFirst, ...rest) {
46281
- let params;
46282
- if (paramsOrFirst &&
46283
- typeof paramsOrFirst === 'object' &&
46284
- !Array.isArray(paramsOrFirst)) {
46285
- params = (paramsOrFirst || {});
46286
- }
46287
- else {
46288
- params = {
46289
- userId: paramsOrFirst,
46290
- queries: rest[0],
46291
- total: rest[1],
46292
- };
46293
- }
46294
- const userId = params.userId;
46295
- const queries = params.queries;
46296
- const total = params.total;
46297
- if (typeof userId === 'undefined' || userId === '') {
46298
- throw new AppwriteException('Missing required parameter: "userId"');
46299
- }
46300
- const apiPath = '/users/{userId}/passkeys'.replace('{userId}', encodeURIComponent(String(userId)));
46301
- const apiPayload = {};
46302
- if (typeof queries !== 'undefined') {
46303
- apiPayload['queries'] = queries;
46304
- }
46305
- if (typeof total !== 'undefined') {
46306
- apiPayload['total'] = total;
46307
- }
46308
- const uri = new URL(this.client.config.endpoint + apiPath);
46309
- const apiHeaders = {
46310
- 'X-Appwrite-Project': this.client.config.project,
46311
- accept: 'application/json',
46312
- };
46313
- return this.client.call('get', uri, apiHeaders, apiPayload);
46314
- }
46315
- getPasskey(paramsOrFirst, ...rest) {
46316
- let params;
46317
- if (paramsOrFirst &&
46318
- typeof paramsOrFirst === 'object' &&
46319
- !Array.isArray(paramsOrFirst)) {
46320
- params = (paramsOrFirst || {});
46321
- }
46322
- else {
46323
- params = {
46324
- userId: paramsOrFirst,
46325
- passkeyId: rest[0],
46326
- };
46327
- }
46328
- const userId = params.userId;
46329
- const passkeyId = params.passkeyId;
46330
- if (typeof userId === 'undefined' || userId === '') {
46331
- throw new AppwriteException('Missing required parameter: "userId"');
46332
- }
46333
- if (typeof passkeyId === 'undefined' || passkeyId === '') {
46334
- throw new AppwriteException('Missing required parameter: "passkeyId"');
46335
- }
46336
- const apiPath = '/users/{userId}/passkeys/{passkeyId}'
46337
- .replace('{userId}', encodeURIComponent(String(userId)))
46338
- .replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
46339
- const apiPayload = {};
46340
- const uri = new URL(this.client.config.endpoint + apiPath);
46341
- const apiHeaders = {
46342
- 'X-Appwrite-Project': this.client.config.project,
46343
- accept: 'application/json',
46344
- };
46345
- return this.client.call('get', uri, apiHeaders, apiPayload);
46346
- }
46347
- deletePasskey(paramsOrFirst, ...rest) {
46348
- let params;
46349
- if (paramsOrFirst &&
46350
- typeof paramsOrFirst === 'object' &&
46351
- !Array.isArray(paramsOrFirst)) {
46352
- params = (paramsOrFirst || {});
46353
- }
46354
- else {
46355
- params = {
46356
- userId: paramsOrFirst,
46357
- passkeyId: rest[0],
46358
- };
46359
- }
46360
- const userId = params.userId;
46361
- const passkeyId = params.passkeyId;
46362
- if (typeof userId === 'undefined' || userId === '') {
46363
- throw new AppwriteException('Missing required parameter: "userId"');
46364
- }
46365
- if (typeof passkeyId === 'undefined' || passkeyId === '') {
46366
- throw new AppwriteException('Missing required parameter: "passkeyId"');
46367
- }
46368
- const apiPath = '/users/{userId}/passkeys/{passkeyId}'
46369
- .replace('{userId}', encodeURIComponent(String(userId)))
46370
- .replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
46371
- const apiPayload = {};
46372
- const uri = new URL(this.client.config.endpoint + apiPath);
46373
- const apiHeaders = {
46374
- 'X-Appwrite-Project': this.client.config.project,
46375
- 'content-type': 'application/json',
46376
- accept: 'application/json',
46377
- };
46378
- return this.client.call('delete', uri, apiHeaders, apiPayload);
46379
- }
46380
45547
  updatePassword(paramsOrFirst, ...rest) {
46381
45548
  let params;
46382
45549
  if (paramsOrFirst &&
@@ -48883,11 +48050,11 @@
48883
48050
  }
48884
48051
  }
48885
48052
 
48886
- class Videos {
48053
+ class Waf {
48887
48054
  constructor(client) {
48888
48055
  this.client = client;
48889
48056
  }
48890
- list(paramsOrFirst, ...rest) {
48057
+ listRules(paramsOrFirst, ...rest) {
48891
48058
  let params;
48892
48059
  if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
48893
48060
  (paramsOrFirst &&
@@ -48905,7 +48072,7 @@
48905
48072
  const queries = params.queries;
48906
48073
  const search = params.search;
48907
48074
  const total = params.total;
48908
- const apiPath = '/videos';
48075
+ const apiPath = '/waf/rules';
48909
48076
  const apiPayload = {};
48910
48077
  if (typeof queries !== 'undefined') {
48911
48078
  apiPayload['queries'] = queries;
@@ -48923,7 +48090,7 @@
48923
48090
  };
48924
48091
  return this.client.call('get', uri, apiHeaders, apiPayload);
48925
48092
  }
48926
- create(paramsOrFirst, ...rest) {
48093
+ createBypassRule(paramsOrFirst, ...rest) {
48927
48094
  let params;
48928
48095
  if (paramsOrFirst &&
48929
48096
  typeof paramsOrFirst === 'object' &&
@@ -48932,66 +48099,68 @@
48932
48099
  }
48933
48100
  else {
48934
48101
  params = {
48935
- bucketId: paramsOrFirst,
48936
- fileId: rest[0],
48102
+ ruleId: paramsOrFirst,
48103
+ resourceType: rest[0],
48937
48104
  name: rest[1],
48105
+ resourceId: rest[2],
48106
+ description: rest[3],
48107
+ priority: rest[4],
48108
+ enabled: rest[5],
48109
+ conditions: rest[6],
48938
48110
  };
48939
48111
  }
48940
- const bucketId = params.bucketId;
48941
- const fileId = params.fileId;
48112
+ const ruleId = params.ruleId;
48113
+ const resourceType = params.resourceType;
48942
48114
  const name = params.name;
48943
- if (typeof bucketId === 'undefined') {
48944
- throw new AppwriteException('Missing required parameter: "bucketId"');
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"');
48945
48122
  }
48946
- if (typeof fileId === 'undefined') {
48947
- throw new AppwriteException('Missing required parameter: "fileId"');
48123
+ if (typeof resourceType === 'undefined') {
48124
+ throw new AppwriteException('Missing required parameter: "resourceType"');
48125
+ }
48126
+ if (typeof name === 'undefined') {
48127
+ throw new AppwriteException('Missing required parameter: "name"');
48948
48128
  }
48949
- const apiPath = '/videos';
48129
+ const apiPath = '/waf/rules/bypass';
48950
48130
  const apiPayload = {};
48951
- if (typeof bucketId !== 'undefined') {
48952
- apiPayload['bucketId'] = bucketId;
48131
+ if (typeof ruleId !== 'undefined') {
48132
+ apiPayload['ruleId'] = ruleId;
48953
48133
  }
48954
- if (typeof fileId !== 'undefined') {
48955
- apiPayload['fileId'] = fileId;
48134
+ if (typeof resourceType !== 'undefined') {
48135
+ apiPayload['resourceType'] = resourceType;
48136
+ }
48137
+ if (typeof resourceId !== 'undefined') {
48138
+ apiPayload['resourceId'] = resourceId;
48956
48139
  }
48957
48140
  if (typeof name !== 'undefined') {
48958
48141
  apiPayload['name'] = name;
48959
48142
  }
48960
- const uri = new URL(this.client.config.endpoint + apiPath);
48961
- const apiHeaders = {
48962
- 'X-Appwrite-Project': this.client.config.project,
48963
- 'content-type': 'application/json',
48964
- accept: 'application/json',
48965
- };
48966
- return this.client.call('post', uri, apiHeaders, apiPayload);
48967
- }
48968
- listProfiles(paramsOrFirst) {
48969
- let params;
48970
- if (typeof paramsOrFirst === 'undefined' ||
48971
- (paramsOrFirst &&
48972
- typeof paramsOrFirst === 'object' &&
48973
- !Array.isArray(paramsOrFirst))) {
48974
- params = (paramsOrFirst || {});
48143
+ if (typeof description !== 'undefined') {
48144
+ apiPayload['description'] = description;
48975
48145
  }
48976
- else {
48977
- params = {
48978
- search: paramsOrFirst,
48979
- };
48146
+ if (typeof priority !== 'undefined') {
48147
+ apiPayload['priority'] = priority;
48980
48148
  }
48981
- const search = params.search;
48982
- const apiPath = '/videos/profiles';
48983
- const apiPayload = {};
48984
- if (typeof search !== 'undefined') {
48985
- apiPayload['search'] = search;
48149
+ if (typeof enabled !== 'undefined') {
48150
+ apiPayload['enabled'] = enabled;
48151
+ }
48152
+ if (typeof conditions !== 'undefined') {
48153
+ apiPayload['conditions'] = conditions;
48986
48154
  }
48987
48155
  const uri = new URL(this.client.config.endpoint + apiPath);
48988
48156
  const apiHeaders = {
48989
48157
  'X-Appwrite-Project': this.client.config.project,
48158
+ 'content-type': 'application/json',
48990
48159
  accept: 'application/json',
48991
48160
  };
48992
- return this.client.call('get', uri, apiHeaders, apiPayload);
48161
+ return this.client.call('post', uri, apiHeaders, apiPayload);
48993
48162
  }
48994
- createProfile(paramsOrFirst, ...rest) {
48163
+ updateBypassRule(paramsOrFirst, ...rest) {
48995
48164
  let params;
48996
48165
  if (paramsOrFirst &&
48997
48166
  typeof paramsOrFirst === 'object' &&
@@ -49000,49 +48169,49 @@
49000
48169
  }
49001
48170
  else {
49002
48171
  params = {
49003
- name: paramsOrFirst,
49004
- videoBitRate: rest[0],
49005
- audioBitRate: rest[1],
49006
- width: rest[2],
49007
- height: rest[3],
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],
49008
48180
  };
49009
48181
  }
48182
+ const ruleId = params.ruleId;
48183
+ const resourceType = params.resourceType;
48184
+ const resourceId = params.resourceId;
49010
48185
  const name = params.name;
49011
- const videoBitRate = params.videoBitRate;
49012
- const audioBitRate = params.audioBitRate;
49013
- const width = params.width;
49014
- const height = params.height;
49015
- if (typeof name === 'undefined') {
49016
- throw new AppwriteException('Missing required parameter: "name"');
49017
- }
49018
- if (typeof videoBitRate === 'undefined') {
49019
- throw new AppwriteException('Missing required parameter: "videoBitRate"');
49020
- }
49021
- if (typeof audioBitRate === 'undefined') {
49022
- throw new AppwriteException('Missing required parameter: "audioBitRate"');
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"');
49023
48192
  }
49024
- if (typeof width === 'undefined') {
49025
- throw new AppwriteException('Missing required parameter: "width"');
48193
+ const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
48194
+ const apiPayload = {};
48195
+ if (typeof resourceType !== 'undefined') {
48196
+ apiPayload['resourceType'] = resourceType;
49026
48197
  }
49027
- if (typeof height === 'undefined') {
49028
- throw new AppwriteException('Missing required parameter: "height"');
48198
+ if (typeof resourceId !== 'undefined') {
48199
+ apiPayload['resourceId'] = resourceId;
49029
48200
  }
49030
- const apiPath = '/videos/profiles';
49031
- const apiPayload = {};
49032
48201
  if (typeof name !== 'undefined') {
49033
48202
  apiPayload['name'] = name;
49034
48203
  }
49035
- if (typeof videoBitRate !== 'undefined') {
49036
- apiPayload['videoBitRate'] = videoBitRate;
48204
+ if (typeof description !== 'undefined') {
48205
+ apiPayload['description'] = description;
49037
48206
  }
49038
- if (typeof audioBitRate !== 'undefined') {
49039
- apiPayload['audioBitRate'] = audioBitRate;
48207
+ if (typeof priority !== 'undefined') {
48208
+ apiPayload['priority'] = priority;
49040
48209
  }
49041
- if (typeof width !== 'undefined') {
49042
- apiPayload['width'] = width;
48210
+ if (typeof enabled !== 'undefined') {
48211
+ apiPayload['enabled'] = enabled;
49043
48212
  }
49044
- if (typeof height !== 'undefined') {
49045
- apiPayload['height'] = height;
48213
+ if (typeof conditions !== 'undefined') {
48214
+ apiPayload['conditions'] = conditions;
49046
48215
  }
49047
48216
  const uri = new URL(this.client.config.endpoint + apiPath);
49048
48217
  const apiHeaders = {
@@ -49050,34 +48219,9 @@
49050
48219
  'content-type': 'application/json',
49051
48220
  accept: 'application/json',
49052
48221
  };
49053
- return this.client.call('post', uri, apiHeaders, apiPayload);
49054
- }
49055
- getProfile(paramsOrFirst) {
49056
- let params;
49057
- if (paramsOrFirst &&
49058
- typeof paramsOrFirst === 'object' &&
49059
- !Array.isArray(paramsOrFirst)) {
49060
- params = (paramsOrFirst || {});
49061
- }
49062
- else {
49063
- params = {
49064
- profileId: paramsOrFirst,
49065
- };
49066
- }
49067
- const profileId = params.profileId;
49068
- if (typeof profileId === 'undefined' || profileId === '') {
49069
- throw new AppwriteException('Missing required parameter: "profileId"');
49070
- }
49071
- const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
49072
- const apiPayload = {};
49073
- const uri = new URL(this.client.config.endpoint + apiPath);
49074
- const apiHeaders = {
49075
- 'X-Appwrite-Project': this.client.config.project,
49076
- accept: 'application/json',
49077
- };
49078
- return this.client.call('get', uri, apiHeaders, apiPayload);
48222
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
49079
48223
  }
49080
- updateProfile(paramsOrFirst, ...rest) {
48224
+ createChallengeRule(paramsOrFirst, ...rest) {
49081
48225
  let params;
49082
48226
  if (paramsOrFirst &&
49083
48227
  typeof paramsOrFirst === 'object' &&
@@ -49086,90 +48230,83 @@
49086
48230
  }
49087
48231
  else {
49088
48232
  params = {
49089
- profileId: paramsOrFirst,
49090
- name: rest[0],
49091
- videoBitRate: rest[1],
49092
- audioBitRate: rest[2],
49093
- width: rest[3],
49094
- height: rest[4],
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],
49095
48244
  };
49096
48245
  }
49097
- const profileId = params.profileId;
48246
+ const ruleId = params.ruleId;
48247
+ const resourceType = params.resourceType;
49098
48248
  const name = params.name;
49099
- const videoBitRate = params.videoBitRate;
49100
- const audioBitRate = params.audioBitRate;
49101
- const width = params.width;
49102
- const height = params.height;
49103
- if (typeof profileId === 'undefined' || profileId === '') {
49104
- throw new AppwriteException('Missing required parameter: "profileId"');
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"');
49105
48262
  }
49106
48263
  if (typeof name === 'undefined') {
49107
48264
  throw new AppwriteException('Missing required parameter: "name"');
49108
48265
  }
49109
- if (typeof videoBitRate === 'undefined') {
49110
- throw new AppwriteException('Missing required parameter: "videoBitRate"');
49111
- }
49112
- if (typeof audioBitRate === 'undefined') {
49113
- throw new AppwriteException('Missing required parameter: "audioBitRate"');
48266
+ const apiPath = '/waf/rules/challenge';
48267
+ const apiPayload = {};
48268
+ if (typeof ruleId !== 'undefined') {
48269
+ apiPayload['ruleId'] = ruleId;
49114
48270
  }
49115
- if (typeof width === 'undefined') {
49116
- throw new AppwriteException('Missing required parameter: "width"');
48271
+ if (typeof resourceType !== 'undefined') {
48272
+ apiPayload['resourceType'] = resourceType;
49117
48273
  }
49118
- if (typeof height === 'undefined') {
49119
- throw new AppwriteException('Missing required parameter: "height"');
48274
+ if (typeof resourceId !== 'undefined') {
48275
+ apiPayload['resourceId'] = resourceId;
49120
48276
  }
49121
- const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
49122
- const apiPayload = {};
49123
48277
  if (typeof name !== 'undefined') {
49124
48278
  apiPayload['name'] = name;
49125
48279
  }
49126
- if (typeof videoBitRate !== 'undefined') {
49127
- apiPayload['videoBitRate'] = videoBitRate;
48280
+ if (typeof description !== 'undefined') {
48281
+ apiPayload['description'] = description;
49128
48282
  }
49129
- if (typeof audioBitRate !== 'undefined') {
49130
- apiPayload['audioBitRate'] = audioBitRate;
48283
+ if (typeof challengeType !== 'undefined') {
48284
+ apiPayload['challengeType'] = challengeType;
49131
48285
  }
49132
- if (typeof width !== 'undefined') {
49133
- apiPayload['width'] = width;
48286
+ if (typeof priority !== 'undefined') {
48287
+ apiPayload['priority'] = priority;
49134
48288
  }
49135
- if (typeof height !== 'undefined') {
49136
- apiPayload['height'] = height;
48289
+ if (typeof enabled !== 'undefined') {
48290
+ apiPayload['enabled'] = enabled;
49137
48291
  }
49138
- const uri = new URL(this.client.config.endpoint + apiPath);
49139
- const apiHeaders = {
49140
- 'X-Appwrite-Project': this.client.config.project,
49141
- 'content-type': 'application/json',
49142
- accept: 'application/json',
49143
- };
49144
- return this.client.call('patch', uri, apiHeaders, apiPayload);
49145
- }
49146
- deleteProfile(paramsOrFirst) {
49147
- let params;
49148
- if (paramsOrFirst &&
49149
- typeof paramsOrFirst === 'object' &&
49150
- !Array.isArray(paramsOrFirst)) {
49151
- params = (paramsOrFirst || {});
48292
+ if (typeof conditions !== 'undefined') {
48293
+ apiPayload['conditions'] = conditions;
49152
48294
  }
49153
- else {
49154
- params = {
49155
- profileId: paramsOrFirst,
49156
- };
48295
+ if (typeof difficulty !== 'undefined') {
48296
+ apiPayload['difficulty'] = difficulty;
49157
48297
  }
49158
- const profileId = params.profileId;
49159
- if (typeof profileId === 'undefined' || profileId === '') {
49160
- throw new AppwriteException('Missing required parameter: "profileId"');
48298
+ if (typeof ttl !== 'undefined') {
48299
+ apiPayload['ttl'] = ttl;
49161
48300
  }
49162
- const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
49163
- const apiPayload = {};
49164
48301
  const uri = new URL(this.client.config.endpoint + apiPath);
49165
48302
  const apiHeaders = {
49166
48303
  'X-Appwrite-Project': this.client.config.project,
49167
48304
  'content-type': 'application/json',
49168
48305
  accept: 'application/json',
49169
48306
  };
49170
- return this.client.call('delete', uri, apiHeaders, apiPayload);
48307
+ return this.client.call('post', uri, apiHeaders, apiPayload);
49171
48308
  }
49172
- get(paramsOrFirst) {
48309
+ updateChallengeRule(paramsOrFirst, ...rest) {
49173
48310
  let params;
49174
48311
  if (paramsOrFirst &&
49175
48312
  typeof paramsOrFirst === 'object' &&
@@ -49178,23 +48315,74 @@
49178
48315
  }
49179
48316
  else {
49180
48317
  params = {
49181
- videoId: paramsOrFirst,
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],
49182
48329
  };
49183
48330
  }
49184
- const videoId = params.videoId;
49185
- if (typeof videoId === 'undefined' || videoId === '') {
49186
- throw new AppwriteException('Missing required parameter: "videoId"');
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"');
49187
48344
  }
49188
- const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
48345
+ const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
49189
48346
  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
+ }
49190
48377
  const uri = new URL(this.client.config.endpoint + apiPath);
49191
48378
  const apiHeaders = {
49192
48379
  'X-Appwrite-Project': this.client.config.project,
48380
+ 'content-type': 'application/json',
49193
48381
  accept: 'application/json',
49194
48382
  };
49195
- return this.client.call('get', uri, apiHeaders, apiPayload);
48383
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
49196
48384
  }
49197
- update(paramsOrFirst, ...rest) {
48385
+ createDenyRule(paramsOrFirst, ...rest) {
49198
48386
  let params;
49199
48387
  if (paramsOrFirst &&
49200
48388
  typeof paramsOrFirst === 'object' &&
@@ -49203,32 +48391,68 @@
49203
48391
  }
49204
48392
  else {
49205
48393
  params = {
49206
- videoId: paramsOrFirst,
49207
- name: rest[0],
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],
49208
48402
  };
49209
48403
  }
49210
- const videoId = params.videoId;
48404
+ const ruleId = params.ruleId;
48405
+ const resourceType = params.resourceType;
49211
48406
  const name = params.name;
49212
- if (typeof videoId === 'undefined' || videoId === '') {
49213
- throw new AppwriteException('Missing required parameter: "videoId"');
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"');
49214
48417
  }
49215
48418
  if (typeof name === 'undefined') {
49216
48419
  throw new AppwriteException('Missing required parameter: "name"');
49217
48420
  }
49218
- const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
48421
+ const apiPath = '/waf/rules/deny';
49219
48422
  const apiPayload = {};
48423
+ if (typeof ruleId !== 'undefined') {
48424
+ apiPayload['ruleId'] = ruleId;
48425
+ }
48426
+ if (typeof resourceType !== 'undefined') {
48427
+ apiPayload['resourceType'] = resourceType;
48428
+ }
48429
+ if (typeof resourceId !== 'undefined') {
48430
+ apiPayload['resourceId'] = resourceId;
48431
+ }
49220
48432
  if (typeof name !== 'undefined') {
49221
48433
  apiPayload['name'] = name;
49222
48434
  }
48435
+ if (typeof description !== 'undefined') {
48436
+ apiPayload['description'] = description;
48437
+ }
48438
+ if (typeof priority !== 'undefined') {
48439
+ apiPayload['priority'] = priority;
48440
+ }
48441
+ if (typeof enabled !== 'undefined') {
48442
+ apiPayload['enabled'] = enabled;
48443
+ }
48444
+ if (typeof conditions !== 'undefined') {
48445
+ apiPayload['conditions'] = conditions;
48446
+ }
49223
48447
  const uri = new URL(this.client.config.endpoint + apiPath);
49224
48448
  const apiHeaders = {
49225
48449
  'X-Appwrite-Project': this.client.config.project,
49226
48450
  'content-type': 'application/json',
49227
48451
  accept: 'application/json',
49228
48452
  };
49229
- return this.client.call('put', uri, apiHeaders, apiPayload);
48453
+ return this.client.call('post', uri, apiHeaders, apiPayload);
49230
48454
  }
49231
- delete(paramsOrFirst) {
48455
+ updateDenyRule(paramsOrFirst, ...rest) {
49232
48456
  let params;
49233
48457
  if (paramsOrFirst &&
49234
48458
  typeof paramsOrFirst === 'object' &&
@@ -49237,24 +48461,59 @@
49237
48461
  }
49238
48462
  else {
49239
48463
  params = {
49240
- videoId: paramsOrFirst,
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],
49241
48472
  };
49242
48473
  }
49243
- const videoId = params.videoId;
49244
- if (typeof videoId === 'undefined' || videoId === '') {
49245
- throw new AppwriteException('Missing required parameter: "videoId"');
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"');
49246
48484
  }
49247
- const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
48485
+ const apiPath = '/waf/rules/deny/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
49248
48486
  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;
48501
+ }
48502
+ if (typeof enabled !== 'undefined') {
48503
+ apiPayload['enabled'] = enabled;
48504
+ }
48505
+ if (typeof conditions !== 'undefined') {
48506
+ apiPayload['conditions'] = conditions;
48507
+ }
49249
48508
  const uri = new URL(this.client.config.endpoint + apiPath);
49250
48509
  const apiHeaders = {
49251
48510
  'X-Appwrite-Project': this.client.config.project,
49252
48511
  'content-type': 'application/json',
49253
48512
  accept: 'application/json',
49254
48513
  };
49255
- return this.client.call('delete', uri, apiHeaders, apiPayload);
48514
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
49256
48515
  }
49257
- getCmafHlsManifest(paramsOrFirst) {
48516
+ createRateLimitRule(paramsOrFirst, ...rest) {
49258
48517
  let params;
49259
48518
  if (paramsOrFirst &&
49260
48519
  typeof paramsOrFirst === 'object' &&
@@ -49263,1241 +48522,19 @@
49263
48522
  }
49264
48523
  else {
49265
48524
  params = {
49266
- videoId: paramsOrFirst,
49267
- };
49268
- }
49269
- const videoId = params.videoId;
49270
- if (typeof videoId === 'undefined' || videoId === '') {
49271
- throw new AppwriteException('Missing required parameter: "videoId"');
49272
- }
49273
- const apiPath = '/videos/{videoId}/outputs/cmaf/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
49274
- const apiPayload = {};
49275
- const uri = new URL(this.client.config.endpoint + apiPath);
49276
- apiPayload['project'] = this.client.config.project;
49277
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49278
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49279
- uri.searchParams.append(key, value);
49280
- }
49281
- return uri.toString();
49282
- }
49283
- getCmafDashManifest(paramsOrFirst) {
49284
- let params;
49285
- if (paramsOrFirst &&
49286
- typeof paramsOrFirst === 'object' &&
49287
- !Array.isArray(paramsOrFirst)) {
49288
- params = (paramsOrFirst || {});
49289
- }
49290
- else {
49291
- params = {
49292
- videoId: paramsOrFirst,
49293
- };
49294
- }
49295
- const videoId = params.videoId;
49296
- if (typeof videoId === 'undefined' || videoId === '') {
49297
- throw new AppwriteException('Missing required parameter: "videoId"');
49298
- }
49299
- const apiPath = '/videos/{videoId}/outputs/cmaf/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
49300
- const apiPayload = {};
49301
- const uri = new URL(this.client.config.endpoint + apiPath);
49302
- apiPayload['project'] = this.client.config.project;
49303
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49304
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49305
- uri.searchParams.append(key, value);
49306
- }
49307
- return uri.toString();
49308
- }
49309
- getCmafStreamManifest(paramsOrFirst, ...rest) {
49310
- let params;
49311
- if (paramsOrFirst &&
49312
- typeof paramsOrFirst === 'object' &&
49313
- !Array.isArray(paramsOrFirst)) {
49314
- params = (paramsOrFirst || {});
49315
- }
49316
- else {
49317
- params = {
49318
- videoId: paramsOrFirst,
49319
- renditionId: rest[0],
49320
- streamId: rest[1],
49321
- };
49322
- }
49323
- const videoId = params.videoId;
49324
- const renditionId = params.renditionId;
49325
- const streamId = params.streamId;
49326
- if (typeof videoId === 'undefined' || videoId === '') {
49327
- throw new AppwriteException('Missing required parameter: "videoId"');
49328
- }
49329
- if (typeof renditionId === 'undefined' || renditionId === '') {
49330
- throw new AppwriteException('Missing required parameter: "renditionId"');
49331
- }
49332
- if (typeof streamId === 'undefined') {
49333
- throw new AppwriteException('Missing required parameter: "streamId"');
49334
- }
49335
- const apiPath = '/videos/{videoId}/outputs/cmaf/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
49336
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49337
- .replace('{renditionId}', encodeURIComponent(String(renditionId)))
49338
- .replace('{streamId}', encodeURIComponent(String(streamId)));
49339
- const apiPayload = {};
49340
- const uri = new URL(this.client.config.endpoint + apiPath);
49341
- apiPayload['project'] = this.client.config.project;
49342
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49343
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49344
- uri.searchParams.append(key, value);
49345
- }
49346
- return uri.toString();
49347
- }
49348
- getDashManifest(paramsOrFirst) {
49349
- let params;
49350
- if (paramsOrFirst &&
49351
- typeof paramsOrFirst === 'object' &&
49352
- !Array.isArray(paramsOrFirst)) {
49353
- params = (paramsOrFirst || {});
49354
- }
49355
- else {
49356
- params = {
49357
- videoId: paramsOrFirst,
49358
- };
49359
- }
49360
- const videoId = params.videoId;
49361
- if (typeof videoId === 'undefined' || videoId === '') {
49362
- throw new AppwriteException('Missing required parameter: "videoId"');
49363
- }
49364
- const apiPath = '/videos/{videoId}/outputs/dash/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
49365
- const apiPayload = {};
49366
- const uri = new URL(this.client.config.endpoint + apiPath);
49367
- apiPayload['project'] = this.client.config.project;
49368
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49369
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49370
- uri.searchParams.append(key, value);
49371
- }
49372
- return uri.toString();
49373
- }
49374
- getHlsManifest(paramsOrFirst) {
49375
- let params;
49376
- if (paramsOrFirst &&
49377
- typeof paramsOrFirst === 'object' &&
49378
- !Array.isArray(paramsOrFirst)) {
49379
- params = (paramsOrFirst || {});
49380
- }
49381
- else {
49382
- params = {
49383
- videoId: paramsOrFirst,
49384
- };
49385
- }
49386
- const videoId = params.videoId;
49387
- if (typeof videoId === 'undefined' || videoId === '') {
49388
- throw new AppwriteException('Missing required parameter: "videoId"');
49389
- }
49390
- const apiPath = '/videos/{videoId}/outputs/hls/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
49391
- const apiPayload = {};
49392
- const uri = new URL(this.client.config.endpoint + apiPath);
49393
- apiPayload['project'] = this.client.config.project;
49394
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49395
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49396
- uri.searchParams.append(key, value);
49397
- }
49398
- return uri.toString();
49399
- }
49400
- getStreamManifest(paramsOrFirst, ...rest) {
49401
- let params;
49402
- if (paramsOrFirst &&
49403
- typeof paramsOrFirst === 'object' &&
49404
- !Array.isArray(paramsOrFirst)) {
49405
- params = (paramsOrFirst || {});
49406
- }
49407
- else {
49408
- params = {
49409
- videoId: paramsOrFirst,
49410
- renditionId: rest[0],
49411
- streamId: rest[1],
49412
- };
49413
- }
49414
- const videoId = params.videoId;
49415
- const renditionId = params.renditionId;
49416
- const streamId = params.streamId;
49417
- if (typeof videoId === 'undefined' || videoId === '') {
49418
- throw new AppwriteException('Missing required parameter: "videoId"');
49419
- }
49420
- if (typeof renditionId === 'undefined' || renditionId === '') {
49421
- throw new AppwriteException('Missing required parameter: "renditionId"');
49422
- }
49423
- if (typeof streamId === 'undefined') {
49424
- throw new AppwriteException('Missing required parameter: "streamId"');
49425
- }
49426
- const apiPath = '/videos/{videoId}/outputs/hls/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
49427
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49428
- .replace('{renditionId}', encodeURIComponent(String(renditionId)))
49429
- .replace('{streamId}', encodeURIComponent(String(streamId)));
49430
- const apiPayload = {};
49431
- const uri = new URL(this.client.config.endpoint + apiPath);
49432
- apiPayload['project'] = this.client.config.project;
49433
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49434
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49435
- uri.searchParams.append(key, value);
49436
- }
49437
- return uri.toString();
49438
- }
49439
- getSegment(paramsOrFirst, ...rest) {
49440
- let params;
49441
- if (paramsOrFirst &&
49442
- typeof paramsOrFirst === 'object' &&
49443
- !Array.isArray(paramsOrFirst)) {
49444
- params = (paramsOrFirst || {});
49445
- }
49446
- else {
49447
- params = {
49448
- videoId: paramsOrFirst,
49449
- output: rest[0],
49450
- renditionId: rest[1],
49451
- segmentId: rest[2],
49452
- };
49453
- }
49454
- const videoId = params.videoId;
49455
- const output = params.output;
49456
- const renditionId = params.renditionId;
49457
- const segmentId = params.segmentId;
49458
- if (typeof videoId === 'undefined' || videoId === '') {
49459
- throw new AppwriteException('Missing required parameter: "videoId"');
49460
- }
49461
- if (typeof output === 'undefined') {
49462
- throw new AppwriteException('Missing required parameter: "output"');
49463
- }
49464
- if (typeof renditionId === 'undefined' || renditionId === '') {
49465
- throw new AppwriteException('Missing required parameter: "renditionId"');
49466
- }
49467
- if (typeof segmentId === 'undefined' || segmentId === '') {
49468
- throw new AppwriteException('Missing required parameter: "segmentId"');
49469
- }
49470
- const apiPath = '/videos/{videoId}/outputs/{output}/renditions/{renditionId}/segments/{segmentId}'
49471
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49472
- .replace('{output}', encodeURIComponent(String(output)))
49473
- .replace('{renditionId}', encodeURIComponent(String(renditionId)))
49474
- .replace('{segmentId}', encodeURIComponent(String(segmentId)));
49475
- const apiPayload = {};
49476
- const uri = new URL(this.client.config.endpoint + apiPath);
49477
- apiPayload['project'] = this.client.config.project;
49478
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49479
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49480
- uri.searchParams.append(key, value);
49481
- }
49482
- return uri.toString();
49483
- }
49484
- getSubtitleManifest(paramsOrFirst, ...rest) {
49485
- let params;
49486
- if (paramsOrFirst &&
49487
- typeof paramsOrFirst === 'object' &&
49488
- !Array.isArray(paramsOrFirst)) {
49489
- params = (paramsOrFirst || {});
49490
- }
49491
- else {
49492
- params = {
49493
- videoId: paramsOrFirst,
49494
- output: rest[0],
49495
- subtitleId: rest[1],
49496
- };
49497
- }
49498
- const videoId = params.videoId;
49499
- const output = params.output;
49500
- const subtitleId = params.subtitleId;
49501
- if (typeof videoId === 'undefined' || videoId === '') {
49502
- throw new AppwriteException('Missing required parameter: "videoId"');
49503
- }
49504
- if (typeof output === 'undefined') {
49505
- throw new AppwriteException('Missing required parameter: "output"');
49506
- }
49507
- if (typeof subtitleId === 'undefined' || subtitleId === '') {
49508
- throw new AppwriteException('Missing required parameter: "subtitleId"');
49509
- }
49510
- const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/manifest'
49511
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49512
- .replace('{output}', encodeURIComponent(String(output)))
49513
- .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
49514
- const apiPayload = {};
49515
- const uri = new URL(this.client.config.endpoint + apiPath);
49516
- apiPayload['project'] = this.client.config.project;
49517
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49518
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49519
- uri.searchParams.append(key, value);
49520
- }
49521
- return uri.toString();
49522
- }
49523
- getSubtitleSegment(paramsOrFirst, ...rest) {
49524
- let params;
49525
- if (paramsOrFirst &&
49526
- typeof paramsOrFirst === 'object' &&
49527
- !Array.isArray(paramsOrFirst)) {
49528
- params = (paramsOrFirst || {});
49529
- }
49530
- else {
49531
- params = {
49532
- videoId: paramsOrFirst,
49533
- output: rest[0],
49534
- subtitleId: rest[1],
49535
- segmentId: rest[2],
49536
- };
49537
- }
49538
- const videoId = params.videoId;
49539
- const output = params.output;
49540
- const subtitleId = params.subtitleId;
49541
- const segmentId = params.segmentId;
49542
- if (typeof videoId === 'undefined' || videoId === '') {
49543
- throw new AppwriteException('Missing required parameter: "videoId"');
49544
- }
49545
- if (typeof output === 'undefined') {
49546
- throw new AppwriteException('Missing required parameter: "output"');
49547
- }
49548
- if (typeof subtitleId === 'undefined' || subtitleId === '') {
49549
- throw new AppwriteException('Missing required parameter: "subtitleId"');
49550
- }
49551
- if (typeof segmentId === 'undefined' || segmentId === '') {
49552
- throw new AppwriteException('Missing required parameter: "segmentId"');
49553
- }
49554
- const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/segments/{segmentId}'
49555
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49556
- .replace('{output}', encodeURIComponent(String(output)))
49557
- .replace('{subtitleId}', encodeURIComponent(String(subtitleId)))
49558
- .replace('{segmentId}', encodeURIComponent(String(segmentId)));
49559
- const apiPayload = {};
49560
- const uri = new URL(this.client.config.endpoint + apiPath);
49561
- apiPayload['project'] = this.client.config.project;
49562
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49563
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49564
- uri.searchParams.append(key, value);
49565
- }
49566
- return uri.toString();
49567
- }
49568
- getPreview(paramsOrFirst, ...rest) {
49569
- let params;
49570
- if (paramsOrFirst &&
49571
- typeof paramsOrFirst === 'object' &&
49572
- !Array.isArray(paramsOrFirst)) {
49573
- params = (paramsOrFirst || {});
49574
- }
49575
- else {
49576
- params = {
49577
- videoId: paramsOrFirst,
49578
- previewId: rest[0],
49579
- width: rest[1],
49580
- height: rest[2],
49581
- output: rest[3],
49582
- };
49583
- }
49584
- const videoId = params.videoId;
49585
- const previewId = params.previewId;
49586
- const width = params.width;
49587
- const height = params.height;
49588
- const output = params.output;
49589
- if (typeof videoId === 'undefined' || videoId === '') {
49590
- throw new AppwriteException('Missing required parameter: "videoId"');
49591
- }
49592
- if (typeof previewId === 'undefined' || previewId === '') {
49593
- throw new AppwriteException('Missing required parameter: "previewId"');
49594
- }
49595
- const apiPath = '/videos/{videoId}/previews/{previewId}'
49596
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49597
- .replace('{previewId}', encodeURIComponent(String(previewId)));
49598
- const apiPayload = {};
49599
- if (typeof width !== 'undefined') {
49600
- apiPayload['width'] = width;
49601
- }
49602
- if (typeof height !== 'undefined') {
49603
- apiPayload['height'] = height;
49604
- }
49605
- if (typeof output !== 'undefined') {
49606
- apiPayload['output'] = output;
49607
- }
49608
- const uri = new URL(this.client.config.endpoint + apiPath);
49609
- apiPayload['project'] = this.client.config.project;
49610
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49611
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49612
- uri.searchParams.append(key, value);
49613
- }
49614
- return uri.toString();
49615
- }
49616
- listRenditions(paramsOrFirst, ...rest) {
49617
- let params;
49618
- if (paramsOrFirst &&
49619
- typeof paramsOrFirst === 'object' &&
49620
- !Array.isArray(paramsOrFirst)) {
49621
- params = (paramsOrFirst || {});
49622
- }
49623
- else {
49624
- params = {
49625
- videoId: paramsOrFirst,
49626
- output: rest[0],
49627
- status: rest[1],
49628
- };
49629
- }
49630
- const videoId = params.videoId;
49631
- const output = params.output;
49632
- const status = params.status;
49633
- if (typeof videoId === 'undefined' || videoId === '') {
49634
- throw new AppwriteException('Missing required parameter: "videoId"');
49635
- }
49636
- const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
49637
- const apiPayload = {};
49638
- if (typeof output !== 'undefined') {
49639
- apiPayload['output'] = output;
49640
- }
49641
- if (typeof status !== 'undefined') {
49642
- apiPayload['status'] = status;
49643
- }
49644
- const uri = new URL(this.client.config.endpoint + apiPath);
49645
- const apiHeaders = {
49646
- 'X-Appwrite-Project': this.client.config.project,
49647
- accept: 'application/json',
49648
- };
49649
- return this.client.call('get', uri, apiHeaders, apiPayload);
49650
- }
49651
- createRendition(paramsOrFirst, ...rest) {
49652
- let params;
49653
- if (paramsOrFirst &&
49654
- typeof paramsOrFirst === 'object' &&
49655
- !Array.isArray(paramsOrFirst)) {
49656
- params = (paramsOrFirst || {});
49657
- }
49658
- else {
49659
- params = {
49660
- videoId: paramsOrFirst,
49661
- profileId: rest[0],
49662
- output: rest[1],
49663
- };
49664
- }
49665
- const videoId = params.videoId;
49666
- const profileId = params.profileId;
49667
- const output = params.output;
49668
- if (typeof videoId === 'undefined' || videoId === '') {
49669
- throw new AppwriteException('Missing required parameter: "videoId"');
49670
- }
49671
- if (typeof profileId === 'undefined') {
49672
- throw new AppwriteException('Missing required parameter: "profileId"');
49673
- }
49674
- if (typeof output === 'undefined') {
49675
- throw new AppwriteException('Missing required parameter: "output"');
49676
- }
49677
- const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
49678
- const apiPayload = {};
49679
- if (typeof profileId !== 'undefined') {
49680
- apiPayload['profileId'] = profileId;
49681
- }
49682
- if (typeof output !== 'undefined') {
49683
- apiPayload['output'] = output;
49684
- }
49685
- const uri = new URL(this.client.config.endpoint + apiPath);
49686
- const apiHeaders = {
49687
- 'X-Appwrite-Project': this.client.config.project,
49688
- 'content-type': 'application/json',
49689
- accept: 'application/json',
49690
- };
49691
- return this.client.call('post', uri, apiHeaders, apiPayload);
49692
- }
49693
- getRendition(paramsOrFirst, ...rest) {
49694
- let params;
49695
- if (paramsOrFirst &&
49696
- typeof paramsOrFirst === 'object' &&
49697
- !Array.isArray(paramsOrFirst)) {
49698
- params = (paramsOrFirst || {});
49699
- }
49700
- else {
49701
- params = {
49702
- videoId: paramsOrFirst,
49703
- renditionId: rest[0],
49704
- };
49705
- }
49706
- const videoId = params.videoId;
49707
- const renditionId = params.renditionId;
49708
- if (typeof videoId === 'undefined' || videoId === '') {
49709
- throw new AppwriteException('Missing required parameter: "videoId"');
49710
- }
49711
- if (typeof renditionId === 'undefined' || renditionId === '') {
49712
- throw new AppwriteException('Missing required parameter: "renditionId"');
49713
- }
49714
- const apiPath = '/videos/{videoId}/renditions/{renditionId}'
49715
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49716
- .replace('{renditionId}', encodeURIComponent(String(renditionId)));
49717
- const apiPayload = {};
49718
- const uri = new URL(this.client.config.endpoint + apiPath);
49719
- const apiHeaders = {
49720
- 'X-Appwrite-Project': this.client.config.project,
49721
- accept: 'application/json',
49722
- };
49723
- return this.client.call('get', uri, apiHeaders, apiPayload);
49724
- }
49725
- deleteRendition(paramsOrFirst, ...rest) {
49726
- let params;
49727
- if (paramsOrFirst &&
49728
- typeof paramsOrFirst === 'object' &&
49729
- !Array.isArray(paramsOrFirst)) {
49730
- params = (paramsOrFirst || {});
49731
- }
49732
- else {
49733
- params = {
49734
- videoId: paramsOrFirst,
49735
- renditionId: rest[0],
49736
- };
49737
- }
49738
- const videoId = params.videoId;
49739
- const renditionId = params.renditionId;
49740
- if (typeof videoId === 'undefined' || videoId === '') {
49741
- throw new AppwriteException('Missing required parameter: "videoId"');
49742
- }
49743
- if (typeof renditionId === 'undefined' || renditionId === '') {
49744
- throw new AppwriteException('Missing required parameter: "renditionId"');
49745
- }
49746
- const apiPath = '/videos/{videoId}/renditions/{renditionId}'
49747
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49748
- .replace('{renditionId}', encodeURIComponent(String(renditionId)));
49749
- const apiPayload = {};
49750
- const uri = new URL(this.client.config.endpoint + apiPath);
49751
- const apiHeaders = {
49752
- 'X-Appwrite-Project': this.client.config.project,
49753
- 'content-type': 'application/json',
49754
- accept: 'application/json',
49755
- };
49756
- return this.client.call('delete', uri, apiHeaders, apiPayload);
49757
- }
49758
- createSource(paramsOrFirst) {
49759
- let params;
49760
- if (paramsOrFirst &&
49761
- typeof paramsOrFirst === 'object' &&
49762
- !Array.isArray(paramsOrFirst)) {
49763
- params = (paramsOrFirst || {});
49764
- }
49765
- else {
49766
- params = {
49767
- videoId: paramsOrFirst,
49768
- };
49769
- }
49770
- const videoId = params.videoId;
49771
- if (typeof videoId === 'undefined' || videoId === '') {
49772
- throw new AppwriteException('Missing required parameter: "videoId"');
49773
- }
49774
- const apiPath = '/videos/{videoId}/source'.replace('{videoId}', encodeURIComponent(String(videoId)));
49775
- const apiPayload = {};
49776
- const uri = new URL(this.client.config.endpoint + apiPath);
49777
- const apiHeaders = {
49778
- 'X-Appwrite-Project': this.client.config.project,
49779
- 'content-type': 'application/json',
49780
- accept: 'application/json',
49781
- };
49782
- return this.client.call('post', uri, apiHeaders, apiPayload);
49783
- }
49784
- listSubtitles(paramsOrFirst) {
49785
- let params;
49786
- if (paramsOrFirst &&
49787
- typeof paramsOrFirst === 'object' &&
49788
- !Array.isArray(paramsOrFirst)) {
49789
- params = (paramsOrFirst || {});
49790
- }
49791
- else {
49792
- params = {
49793
- videoId: paramsOrFirst,
49794
- };
49795
- }
49796
- const videoId = params.videoId;
49797
- if (typeof videoId === 'undefined' || videoId === '') {
49798
- throw new AppwriteException('Missing required parameter: "videoId"');
49799
- }
49800
- const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
49801
- const apiPayload = {};
49802
- const uri = new URL(this.client.config.endpoint + apiPath);
49803
- const apiHeaders = {
49804
- 'X-Appwrite-Project': this.client.config.project,
49805
- accept: 'application/json',
49806
- };
49807
- return this.client.call('get', uri, apiHeaders, apiPayload);
49808
- }
49809
- createSubtitle(paramsOrFirst, ...rest) {
49810
- let params;
49811
- if (paramsOrFirst &&
49812
- typeof paramsOrFirst === 'object' &&
49813
- !Array.isArray(paramsOrFirst)) {
49814
- params = (paramsOrFirst || {});
49815
- }
49816
- else {
49817
- params = {
49818
- videoId: paramsOrFirst,
49819
- bucketId: rest[0],
49820
- fileId: rest[1],
49821
- name: rest[2],
49822
- code: rest[3],
49823
- xdefault: rest[4],
49824
- };
49825
- }
49826
- const videoId = params.videoId;
49827
- const bucketId = params.bucketId;
49828
- const fileId = params.fileId;
49829
- const name = params.name;
49830
- const code = params.code;
49831
- const xdefault = params.xdefault;
49832
- if (typeof videoId === 'undefined' || videoId === '') {
49833
- throw new AppwriteException('Missing required parameter: "videoId"');
49834
- }
49835
- if (typeof bucketId === 'undefined') {
49836
- throw new AppwriteException('Missing required parameter: "bucketId"');
49837
- }
49838
- if (typeof fileId === 'undefined') {
49839
- throw new AppwriteException('Missing required parameter: "fileId"');
49840
- }
49841
- if (typeof name === 'undefined') {
49842
- throw new AppwriteException('Missing required parameter: "name"');
49843
- }
49844
- if (typeof code === 'undefined') {
49845
- throw new AppwriteException('Missing required parameter: "code"');
49846
- }
49847
- const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
49848
- const apiPayload = {};
49849
- if (typeof bucketId !== 'undefined') {
49850
- apiPayload['bucketId'] = bucketId;
49851
- }
49852
- if (typeof fileId !== 'undefined') {
49853
- apiPayload['fileId'] = fileId;
49854
- }
49855
- if (typeof name !== 'undefined') {
49856
- apiPayload['name'] = name;
49857
- }
49858
- if (typeof code !== 'undefined') {
49859
- apiPayload['code'] = code;
49860
- }
49861
- if (typeof xdefault !== 'undefined') {
49862
- apiPayload['default'] = xdefault;
49863
- }
49864
- const uri = new URL(this.client.config.endpoint + apiPath);
49865
- const apiHeaders = {
49866
- 'X-Appwrite-Project': this.client.config.project,
49867
- 'content-type': 'application/json',
49868
- accept: 'application/json',
49869
- };
49870
- return this.client.call('post', uri, apiHeaders, apiPayload);
49871
- }
49872
- updateSubtitle(paramsOrFirst, ...rest) {
49873
- let params;
49874
- if (paramsOrFirst &&
49875
- typeof paramsOrFirst === 'object' &&
49876
- !Array.isArray(paramsOrFirst)) {
49877
- params = (paramsOrFirst || {});
49878
- }
49879
- else {
49880
- params = {
49881
- videoId: paramsOrFirst,
49882
- subtitleId: rest[0],
49883
- bucketId: rest[1],
49884
- fileId: rest[2],
49885
- name: rest[3],
49886
- code: rest[4],
49887
- xdefault: rest[5],
49888
- };
49889
- }
49890
- const videoId = params.videoId;
49891
- const subtitleId = params.subtitleId;
49892
- const bucketId = params.bucketId;
49893
- const fileId = params.fileId;
49894
- const name = params.name;
49895
- const code = params.code;
49896
- const xdefault = params.xdefault;
49897
- if (typeof videoId === 'undefined' || videoId === '') {
49898
- throw new AppwriteException('Missing required parameter: "videoId"');
49899
- }
49900
- if (typeof subtitleId === 'undefined' || subtitleId === '') {
49901
- throw new AppwriteException('Missing required parameter: "subtitleId"');
49902
- }
49903
- const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
49904
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49905
- .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
49906
- const apiPayload = {};
49907
- if (typeof bucketId !== 'undefined') {
49908
- apiPayload['bucketId'] = bucketId;
49909
- }
49910
- if (typeof fileId !== 'undefined') {
49911
- apiPayload['fileId'] = fileId;
49912
- }
49913
- if (typeof name !== 'undefined') {
49914
- apiPayload['name'] = name;
49915
- }
49916
- if (typeof code !== 'undefined') {
49917
- apiPayload['code'] = code;
49918
- }
49919
- if (typeof xdefault !== 'undefined') {
49920
- apiPayload['default'] = xdefault;
49921
- }
49922
- const uri = new URL(this.client.config.endpoint + apiPath);
49923
- const apiHeaders = {
49924
- 'X-Appwrite-Project': this.client.config.project,
49925
- 'content-type': 'application/json',
49926
- accept: 'application/json',
49927
- };
49928
- return this.client.call('patch', uri, apiHeaders, apiPayload);
49929
- }
49930
- deleteSubtitle(paramsOrFirst, ...rest) {
49931
- let params;
49932
- if (paramsOrFirst &&
49933
- typeof paramsOrFirst === 'object' &&
49934
- !Array.isArray(paramsOrFirst)) {
49935
- params = (paramsOrFirst || {});
49936
- }
49937
- else {
49938
- params = {
49939
- videoId: paramsOrFirst,
49940
- subtitleId: rest[0],
49941
- };
49942
- }
49943
- const videoId = params.videoId;
49944
- const subtitleId = params.subtitleId;
49945
- if (typeof videoId === 'undefined' || videoId === '') {
49946
- throw new AppwriteException('Missing required parameter: "videoId"');
49947
- }
49948
- if (typeof subtitleId === 'undefined' || subtitleId === '') {
49949
- throw new AppwriteException('Missing required parameter: "subtitleId"');
49950
- }
49951
- const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
49952
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49953
- .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
49954
- const apiPayload = {};
49955
- const uri = new URL(this.client.config.endpoint + apiPath);
49956
- const apiHeaders = {
49957
- 'X-Appwrite-Project': this.client.config.project,
49958
- 'content-type': 'application/json',
49959
- accept: 'application/json',
49960
- };
49961
- return this.client.call('delete', uri, apiHeaders, apiPayload);
49962
- }
49963
- getTimeline(paramsOrFirst) {
49964
- let params;
49965
- if (paramsOrFirst &&
49966
- typeof paramsOrFirst === 'object' &&
49967
- !Array.isArray(paramsOrFirst)) {
49968
- params = (paramsOrFirst || {});
49969
- }
49970
- else {
49971
- params = {
49972
- videoId: paramsOrFirst,
49973
- };
49974
- }
49975
- const videoId = params.videoId;
49976
- if (typeof videoId === 'undefined' || videoId === '') {
49977
- throw new AppwriteException('Missing required parameter: "videoId"');
49978
- }
49979
- const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
49980
- const apiPayload = {};
49981
- const uri = new URL(this.client.config.endpoint + apiPath);
49982
- const apiHeaders = {
49983
- 'X-Appwrite-Project': this.client.config.project,
49984
- accept: 'text/plain',
49985
- };
49986
- return this.client.call('get', uri, apiHeaders, apiPayload, 'text');
49987
- }
49988
- createTimeline(paramsOrFirst) {
49989
- let params;
49990
- if (paramsOrFirst &&
49991
- typeof paramsOrFirst === 'object' &&
49992
- !Array.isArray(paramsOrFirst)) {
49993
- params = (paramsOrFirst || {});
49994
- }
49995
- else {
49996
- params = {
49997
- videoId: paramsOrFirst,
49998
- };
49999
- }
50000
- const videoId = params.videoId;
50001
- if (typeof videoId === 'undefined' || videoId === '') {
50002
- throw new AppwriteException('Missing required parameter: "videoId"');
50003
- }
50004
- const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
50005
- const apiPayload = {};
50006
- const uri = new URL(this.client.config.endpoint + apiPath);
50007
- const apiHeaders = {
50008
- 'X-Appwrite-Project': this.client.config.project,
50009
- 'content-type': 'application/json',
50010
- accept: 'application/json',
50011
- };
50012
- return this.client.call('post', uri, apiHeaders, apiPayload);
50013
- }
50014
- }
50015
-
50016
- class Waf {
50017
- constructor(client) {
50018
- this.client = client;
50019
- }
50020
- listRules(paramsOrFirst, ...rest) {
50021
- let params;
50022
- if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
50023
- (paramsOrFirst &&
50024
- typeof paramsOrFirst === 'object' &&
50025
- !Array.isArray(paramsOrFirst))) {
50026
- params = (paramsOrFirst || {});
50027
- }
50028
- else {
50029
- params = {
50030
- queries: paramsOrFirst,
50031
- search: rest[0],
50032
- total: rest[1],
50033
- };
50034
- }
50035
- const queries = params.queries;
50036
- const search = params.search;
50037
- const total = params.total;
50038
- const apiPath = '/waf/rules';
50039
- const apiPayload = {};
50040
- if (typeof queries !== 'undefined') {
50041
- apiPayload['queries'] = queries;
50042
- }
50043
- if (typeof search !== 'undefined') {
50044
- apiPayload['search'] = search;
50045
- }
50046
- if (typeof total !== 'undefined') {
50047
- apiPayload['total'] = total;
50048
- }
50049
- const uri = new URL(this.client.config.endpoint + apiPath);
50050
- const apiHeaders = {
50051
- 'X-Appwrite-Project': this.client.config.project,
50052
- accept: 'application/json',
50053
- };
50054
- return this.client.call('get', uri, apiHeaders, apiPayload);
50055
- }
50056
- createBypassRule(paramsOrFirst, ...rest) {
50057
- let params;
50058
- if (paramsOrFirst &&
50059
- typeof paramsOrFirst === 'object' &&
50060
- !Array.isArray(paramsOrFirst)) {
50061
- params = (paramsOrFirst || {});
50062
- }
50063
- else {
50064
- params = {
50065
- ruleId: paramsOrFirst,
50066
- resourceType: rest[0],
50067
- name: rest[1],
50068
- resourceId: rest[2],
50069
- description: rest[3],
50070
- priority: rest[4],
50071
- enabled: rest[5],
50072
- conditions: rest[6],
50073
- };
50074
- }
50075
- const ruleId = params.ruleId;
50076
- const resourceType = params.resourceType;
50077
- const name = params.name;
50078
- const resourceId = params.resourceId;
50079
- const description = params.description;
50080
- const priority = params.priority;
50081
- const enabled = params.enabled;
50082
- const conditions = params.conditions;
50083
- if (typeof ruleId === 'undefined') {
50084
- throw new AppwriteException('Missing required parameter: "ruleId"');
50085
- }
50086
- if (typeof resourceType === 'undefined') {
50087
- throw new AppwriteException('Missing required parameter: "resourceType"');
50088
- }
50089
- if (typeof name === 'undefined') {
50090
- throw new AppwriteException('Missing required parameter: "name"');
50091
- }
50092
- const apiPath = '/waf/rules/bypass';
50093
- const apiPayload = {};
50094
- if (typeof ruleId !== 'undefined') {
50095
- apiPayload['ruleId'] = ruleId;
50096
- }
50097
- if (typeof resourceType !== 'undefined') {
50098
- apiPayload['resourceType'] = resourceType;
50099
- }
50100
- if (typeof resourceId !== 'undefined') {
50101
- apiPayload['resourceId'] = resourceId;
50102
- }
50103
- if (typeof name !== 'undefined') {
50104
- apiPayload['name'] = name;
50105
- }
50106
- if (typeof description !== 'undefined') {
50107
- apiPayload['description'] = description;
50108
- }
50109
- if (typeof priority !== 'undefined') {
50110
- apiPayload['priority'] = priority;
50111
- }
50112
- if (typeof enabled !== 'undefined') {
50113
- apiPayload['enabled'] = enabled;
50114
- }
50115
- if (typeof conditions !== 'undefined') {
50116
- apiPayload['conditions'] = conditions;
50117
- }
50118
- const uri = new URL(this.client.config.endpoint + apiPath);
50119
- const apiHeaders = {
50120
- 'X-Appwrite-Project': this.client.config.project,
50121
- 'content-type': 'application/json',
50122
- accept: 'application/json',
50123
- };
50124
- return this.client.call('post', uri, apiHeaders, apiPayload);
50125
- }
50126
- updateBypassRule(paramsOrFirst, ...rest) {
50127
- let params;
50128
- if (paramsOrFirst &&
50129
- typeof paramsOrFirst === 'object' &&
50130
- !Array.isArray(paramsOrFirst)) {
50131
- params = (paramsOrFirst || {});
50132
- }
50133
- else {
50134
- params = {
50135
- ruleId: paramsOrFirst,
50136
- resourceType: rest[0],
50137
- resourceId: rest[1],
50138
- name: rest[2],
50139
- description: rest[3],
50140
- priority: rest[4],
50141
- enabled: rest[5],
50142
- conditions: rest[6],
50143
- };
50144
- }
50145
- const ruleId = params.ruleId;
50146
- const resourceType = params.resourceType;
50147
- const resourceId = params.resourceId;
50148
- const name = params.name;
50149
- const description = params.description;
50150
- const priority = params.priority;
50151
- const enabled = params.enabled;
50152
- const conditions = params.conditions;
50153
- if (typeof ruleId === 'undefined' || ruleId === '') {
50154
- throw new AppwriteException('Missing required parameter: "ruleId"');
50155
- }
50156
- const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
50157
- const apiPayload = {};
50158
- if (typeof resourceType !== 'undefined') {
50159
- apiPayload['resourceType'] = resourceType;
50160
- }
50161
- if (typeof resourceId !== 'undefined') {
50162
- apiPayload['resourceId'] = resourceId;
50163
- }
50164
- if (typeof name !== 'undefined') {
50165
- apiPayload['name'] = name;
50166
- }
50167
- if (typeof description !== 'undefined') {
50168
- apiPayload['description'] = description;
50169
- }
50170
- if (typeof priority !== 'undefined') {
50171
- apiPayload['priority'] = priority;
50172
- }
50173
- if (typeof enabled !== 'undefined') {
50174
- apiPayload['enabled'] = enabled;
50175
- }
50176
- if (typeof conditions !== 'undefined') {
50177
- apiPayload['conditions'] = conditions;
50178
- }
50179
- const uri = new URL(this.client.config.endpoint + apiPath);
50180
- const apiHeaders = {
50181
- 'X-Appwrite-Project': this.client.config.project,
50182
- 'content-type': 'application/json',
50183
- accept: 'application/json',
50184
- };
50185
- return this.client.call('patch', uri, apiHeaders, apiPayload);
50186
- }
50187
- createChallengeRule(paramsOrFirst, ...rest) {
50188
- let params;
50189
- if (paramsOrFirst &&
50190
- typeof paramsOrFirst === 'object' &&
50191
- !Array.isArray(paramsOrFirst)) {
50192
- params = (paramsOrFirst || {});
50193
- }
50194
- else {
50195
- params = {
50196
- ruleId: paramsOrFirst,
50197
- resourceType: rest[0],
50198
- name: rest[1],
50199
- resourceId: rest[2],
50200
- description: rest[3],
50201
- challengeType: rest[4],
50202
- priority: rest[5],
50203
- enabled: rest[6],
50204
- conditions: rest[7],
50205
- difficulty: rest[8],
50206
- ttl: rest[9],
50207
- };
50208
- }
50209
- const ruleId = params.ruleId;
50210
- const resourceType = params.resourceType;
50211
- const name = params.name;
50212
- const resourceId = params.resourceId;
50213
- const description = params.description;
50214
- const challengeType = params.challengeType;
50215
- const priority = params.priority;
50216
- const enabled = params.enabled;
50217
- const conditions = params.conditions;
50218
- const difficulty = params.difficulty;
50219
- const ttl = params.ttl;
50220
- if (typeof ruleId === 'undefined') {
50221
- throw new AppwriteException('Missing required parameter: "ruleId"');
50222
- }
50223
- if (typeof resourceType === 'undefined') {
50224
- throw new AppwriteException('Missing required parameter: "resourceType"');
50225
- }
50226
- if (typeof name === 'undefined') {
50227
- throw new AppwriteException('Missing required parameter: "name"');
50228
- }
50229
- const apiPath = '/waf/rules/challenge';
50230
- const apiPayload = {};
50231
- if (typeof ruleId !== 'undefined') {
50232
- apiPayload['ruleId'] = ruleId;
50233
- }
50234
- if (typeof resourceType !== 'undefined') {
50235
- apiPayload['resourceType'] = resourceType;
50236
- }
50237
- if (typeof resourceId !== 'undefined') {
50238
- apiPayload['resourceId'] = resourceId;
50239
- }
50240
- if (typeof name !== 'undefined') {
50241
- apiPayload['name'] = name;
50242
- }
50243
- if (typeof description !== 'undefined') {
50244
- apiPayload['description'] = description;
50245
- }
50246
- if (typeof challengeType !== 'undefined') {
50247
- apiPayload['challengeType'] = challengeType;
50248
- }
50249
- if (typeof priority !== 'undefined') {
50250
- apiPayload['priority'] = priority;
50251
- }
50252
- if (typeof enabled !== 'undefined') {
50253
- apiPayload['enabled'] = enabled;
50254
- }
50255
- if (typeof conditions !== 'undefined') {
50256
- apiPayload['conditions'] = conditions;
50257
- }
50258
- if (typeof difficulty !== 'undefined') {
50259
- apiPayload['difficulty'] = difficulty;
50260
- }
50261
- if (typeof ttl !== 'undefined') {
50262
- apiPayload['ttl'] = ttl;
50263
- }
50264
- const uri = new URL(this.client.config.endpoint + apiPath);
50265
- const apiHeaders = {
50266
- 'X-Appwrite-Project': this.client.config.project,
50267
- 'content-type': 'application/json',
50268
- accept: 'application/json',
50269
- };
50270
- return this.client.call('post', uri, apiHeaders, apiPayload);
50271
- }
50272
- updateChallengeRule(paramsOrFirst, ...rest) {
50273
- let params;
50274
- if (paramsOrFirst &&
50275
- typeof paramsOrFirst === 'object' &&
50276
- !Array.isArray(paramsOrFirst)) {
50277
- params = (paramsOrFirst || {});
50278
- }
50279
- else {
50280
- params = {
50281
- ruleId: paramsOrFirst,
50282
- resourceType: rest[0],
50283
- resourceId: rest[1],
50284
- name: rest[2],
50285
- description: rest[3],
50286
- challengeType: rest[4],
50287
- priority: rest[5],
50288
- enabled: rest[6],
50289
- conditions: rest[7],
50290
- difficulty: rest[8],
50291
- ttl: rest[9],
50292
- };
50293
- }
50294
- const ruleId = params.ruleId;
50295
- const resourceType = params.resourceType;
50296
- const resourceId = params.resourceId;
50297
- const name = params.name;
50298
- const description = params.description;
50299
- const challengeType = params.challengeType;
50300
- const priority = params.priority;
50301
- const enabled = params.enabled;
50302
- const conditions = params.conditions;
50303
- const difficulty = params.difficulty;
50304
- const ttl = params.ttl;
50305
- if (typeof ruleId === 'undefined' || ruleId === '') {
50306
- throw new AppwriteException('Missing required parameter: "ruleId"');
50307
- }
50308
- const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
50309
- const apiPayload = {};
50310
- if (typeof resourceType !== 'undefined') {
50311
- apiPayload['resourceType'] = resourceType;
50312
- }
50313
- if (typeof resourceId !== 'undefined') {
50314
- apiPayload['resourceId'] = resourceId;
50315
- }
50316
- if (typeof name !== 'undefined') {
50317
- apiPayload['name'] = name;
50318
- }
50319
- if (typeof description !== 'undefined') {
50320
- apiPayload['description'] = description;
50321
- }
50322
- if (typeof challengeType !== 'undefined') {
50323
- apiPayload['challengeType'] = challengeType;
50324
- }
50325
- if (typeof priority !== 'undefined') {
50326
- apiPayload['priority'] = priority;
50327
- }
50328
- if (typeof enabled !== 'undefined') {
50329
- apiPayload['enabled'] = enabled;
50330
- }
50331
- if (typeof conditions !== 'undefined') {
50332
- apiPayload['conditions'] = conditions;
50333
- }
50334
- if (typeof difficulty !== 'undefined') {
50335
- apiPayload['difficulty'] = difficulty;
50336
- }
50337
- if (typeof ttl !== 'undefined') {
50338
- apiPayload['ttl'] = ttl;
50339
- }
50340
- const uri = new URL(this.client.config.endpoint + apiPath);
50341
- const apiHeaders = {
50342
- 'X-Appwrite-Project': this.client.config.project,
50343
- 'content-type': 'application/json',
50344
- accept: 'application/json',
50345
- };
50346
- return this.client.call('patch', uri, apiHeaders, apiPayload);
50347
- }
50348
- createDenyRule(paramsOrFirst, ...rest) {
50349
- let params;
50350
- if (paramsOrFirst &&
50351
- typeof paramsOrFirst === 'object' &&
50352
- !Array.isArray(paramsOrFirst)) {
50353
- params = (paramsOrFirst || {});
50354
- }
50355
- else {
50356
- params = {
50357
- ruleId: paramsOrFirst,
50358
- resourceType: rest[0],
50359
- name: rest[1],
50360
- resourceId: rest[2],
50361
- description: rest[3],
50362
- priority: rest[4],
50363
- enabled: rest[5],
50364
- conditions: rest[6],
50365
- };
50366
- }
50367
- const ruleId = params.ruleId;
50368
- const resourceType = params.resourceType;
50369
- const name = params.name;
50370
- const resourceId = params.resourceId;
50371
- const description = params.description;
50372
- const priority = params.priority;
50373
- const enabled = params.enabled;
50374
- const conditions = params.conditions;
50375
- if (typeof ruleId === 'undefined') {
50376
- throw new AppwriteException('Missing required parameter: "ruleId"');
50377
- }
50378
- if (typeof resourceType === 'undefined') {
50379
- throw new AppwriteException('Missing required parameter: "resourceType"');
50380
- }
50381
- if (typeof name === 'undefined') {
50382
- throw new AppwriteException('Missing required parameter: "name"');
50383
- }
50384
- const apiPath = '/waf/rules/deny';
50385
- const apiPayload = {};
50386
- if (typeof ruleId !== 'undefined') {
50387
- apiPayload['ruleId'] = ruleId;
50388
- }
50389
- if (typeof resourceType !== 'undefined') {
50390
- apiPayload['resourceType'] = resourceType;
50391
- }
50392
- if (typeof resourceId !== 'undefined') {
50393
- apiPayload['resourceId'] = resourceId;
50394
- }
50395
- if (typeof name !== 'undefined') {
50396
- apiPayload['name'] = name;
50397
- }
50398
- if (typeof description !== 'undefined') {
50399
- apiPayload['description'] = description;
50400
- }
50401
- if (typeof priority !== 'undefined') {
50402
- apiPayload['priority'] = priority;
50403
- }
50404
- if (typeof enabled !== 'undefined') {
50405
- apiPayload['enabled'] = enabled;
50406
- }
50407
- if (typeof conditions !== 'undefined') {
50408
- apiPayload['conditions'] = conditions;
50409
- }
50410
- const uri = new URL(this.client.config.endpoint + apiPath);
50411
- const apiHeaders = {
50412
- 'X-Appwrite-Project': this.client.config.project,
50413
- 'content-type': 'application/json',
50414
- accept: 'application/json',
50415
- };
50416
- return this.client.call('post', uri, apiHeaders, apiPayload);
50417
- }
50418
- updateDenyRule(paramsOrFirst, ...rest) {
50419
- let params;
50420
- if (paramsOrFirst &&
50421
- typeof paramsOrFirst === 'object' &&
50422
- !Array.isArray(paramsOrFirst)) {
50423
- params = (paramsOrFirst || {});
50424
- }
50425
- else {
50426
- params = {
50427
- ruleId: paramsOrFirst,
50428
- resourceType: rest[0],
50429
- resourceId: rest[1],
50430
- name: rest[2],
50431
- description: rest[3],
50432
- priority: rest[4],
50433
- enabled: rest[5],
50434
- conditions: rest[6],
50435
- };
50436
- }
50437
- const ruleId = params.ruleId;
50438
- const resourceType = params.resourceType;
50439
- const resourceId = params.resourceId;
50440
- const name = params.name;
50441
- const description = params.description;
50442
- const priority = params.priority;
50443
- const enabled = params.enabled;
50444
- const conditions = params.conditions;
50445
- if (typeof ruleId === 'undefined' || ruleId === '') {
50446
- throw new AppwriteException('Missing required parameter: "ruleId"');
50447
- }
50448
- const apiPath = '/waf/rules/deny/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
50449
- const apiPayload = {};
50450
- if (typeof resourceType !== 'undefined') {
50451
- apiPayload['resourceType'] = resourceType;
50452
- }
50453
- if (typeof resourceId !== 'undefined') {
50454
- apiPayload['resourceId'] = resourceId;
50455
- }
50456
- if (typeof name !== 'undefined') {
50457
- apiPayload['name'] = name;
50458
- }
50459
- if (typeof description !== 'undefined') {
50460
- apiPayload['description'] = description;
50461
- }
50462
- if (typeof priority !== 'undefined') {
50463
- apiPayload['priority'] = priority;
50464
- }
50465
- if (typeof enabled !== 'undefined') {
50466
- apiPayload['enabled'] = enabled;
50467
- }
50468
- if (typeof conditions !== 'undefined') {
50469
- apiPayload['conditions'] = conditions;
50470
- }
50471
- const uri = new URL(this.client.config.endpoint + apiPath);
50472
- const apiHeaders = {
50473
- 'X-Appwrite-Project': this.client.config.project,
50474
- 'content-type': 'application/json',
50475
- accept: 'application/json',
50476
- };
50477
- return this.client.call('patch', uri, apiHeaders, apiPayload);
50478
- }
50479
- createRateLimitRule(paramsOrFirst, ...rest) {
50480
- let params;
50481
- if (paramsOrFirst &&
50482
- typeof paramsOrFirst === 'object' &&
50483
- !Array.isArray(paramsOrFirst)) {
50484
- params = (paramsOrFirst || {});
50485
- }
50486
- else {
50487
- params = {
50488
- ruleId: paramsOrFirst,
50489
- resourceType: rest[0],
50490
- name: rest[1],
50491
- limit: rest[2],
50492
- interval: rest[3],
50493
- resourceId: rest[4],
50494
- description: rest[5],
50495
- key: rest[6],
50496
- strategy: rest[7],
50497
- maxBucketSize: rest[8],
50498
- priority: rest[9],
50499
- enabled: rest[10],
50500
- conditions: rest[11],
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],
50501
48538
  };
50502
48539
  }
50503
48540
  const ruleId = params.ruleId;
@@ -51775,8 +49812,9 @@
51775
49812
  * );
51776
49813
  * // sub.update({ background: true }); sub.unsubscribe();
51777
49814
  */
51778
- class Push {
49815
+ class Push extends Service {
51779
49816
  constructor(client) {
49817
+ super(client);
51780
49818
  this.mqtt = null;
51781
49819
  this.connecting = null;
51782
49820
  this.Buffer = null;
@@ -51806,7 +49844,6 @@
51806
49844
  this.connectedKey = '';
51807
49845
  this.connectionEpoch = 0;
51808
49846
  this.subscriptions = new Map();
51809
- this.client = client;
51810
49847
  }
51811
49848
  // The broker subscription for a filter uses the highest QoS any local subscription on
51812
49849
  // it wants, so a QoS-0 subscription never downgrades a QoS-1 one sharing the filter.
@@ -52546,670 +50583,6 @@
52546
50583
  return filterParts.length === topicParts.length;
52547
50584
  }
52548
50585
 
52549
- /**
52550
- * Analytics auto-tracking helpers.
52551
- *
52552
- * These are hand-written companions to the generated `Analytics` service.
52553
- * The generated service exposes `createEvent(params)` for arbitrary events;
52554
- * this module wires up common auto-tracking behaviours (pageviews, outbound
52555
- * links, downloads, scroll depth, active engagement) on top of it.
52556
- *
52557
- * The tracking helpers accept a plain event-emitter function so they do not
52558
- * hard-couple to the generated `Analytics` class. The emitter adapts this
52559
- * module's option shape to `createEvent`: `url` is required there, and `props`
52560
- * is a flat alternating key/value list rather than an object.
52561
- *
52562
- * ```ts
52563
- * const analytics = new Analytics(client);
52564
- * const tracking = new AnalyticsTracking(
52565
- * (name, options) => analytics.createEvent({
52566
- * propertyId: options?.propertyId ?? '<PROPERTY_ID>',
52567
- * name,
52568
- * url: options?.url ?? window.location.href,
52569
- * referrer: options?.referrer,
52570
- * scrollDepth: options?.scrollDepth,
52571
- * engagementTime: options?.engagementTime,
52572
- * props: Object.entries(options?.props ?? {}).flatMap(
52573
- * ([key, value]) => [key, String(value)],
52574
- * ),
52575
- * }),
52576
- * { propertyId: '<PROPERTY_ID>' }
52577
- * );
52578
- * tracking.enableAllAutoTracking();
52579
- * ```
52580
- *
52581
- * `propertyId` is optional: when set it is merged into the options of every
52582
- * emitted event, so an emitter that forwards `options.propertyId` (as above)
52583
- * picks it up instead of every caller hand-rolling it into the closure.
52584
- * Per-event `propertyId` always wins over the configured default.
52585
- *
52586
- * All helpers respect `navigator.doNotTrack === '1'` by default; opt out with
52587
- * `respectDoNotTrack: false` in the constructor options.
52588
- *
52589
- * Engagement time follows Plausible's model: rather than one total at unload,
52590
- * a delta is emitted at every natural checkpoint of the visit (tab hidden, SPA
52591
- * route change, unload). See `enableAutoEngagementTime` for details.
52592
- *
52593
- * Auto-emitted event names follow `snake_case` + lowercase (`pageview`,
52594
- * `outbound_link`, `file_download`, `screen_view`, etc.). Any prop keys use
52595
- * camelCase to match the endpoint's parameter naming. Callers can pass any
52596
- * custom event name; the auto-track methods only own the events they emit
52597
- * themselves.
52598
- */
52599
- const DEFAULT_DOWNLOAD_EXTENSIONS = [
52600
- 'pdf',
52601
- 'zip',
52602
- 'rar',
52603
- '7z',
52604
- 'tar',
52605
- 'gz',
52606
- 'csv',
52607
- 'tsv',
52608
- 'xls',
52609
- 'xlsx',
52610
- 'doc',
52611
- 'docx',
52612
- 'ppt',
52613
- 'pptx',
52614
- 'dmg',
52615
- 'exe',
52616
- 'msi',
52617
- 'pkg',
52618
- 'deb',
52619
- 'rpm',
52620
- 'apk',
52621
- 'mp3',
52622
- 'wav',
52623
- 'flac',
52624
- 'mp4',
52625
- 'mov',
52626
- 'avi',
52627
- 'mkv',
52628
- 'webm',
52629
- ];
52630
- /**
52631
- * Two-part public suffixes common enough to matter for outbound-link detection.
52632
- * See `rootDomain()` for why this is a short list rather than the Public Suffix
52633
- * List.
52634
- */
52635
- const MULTI_PART_SUFFIXES = new Set([
52636
- 'co.uk',
52637
- 'org.uk',
52638
- 'ac.uk',
52639
- 'gov.uk',
52640
- 'me.uk',
52641
- 'net.uk',
52642
- 'sch.uk',
52643
- 'co.jp',
52644
- 'ne.jp',
52645
- 'or.jp',
52646
- 'ac.jp',
52647
- 'go.jp',
52648
- 'com.au',
52649
- 'net.au',
52650
- 'org.au',
52651
- 'edu.au',
52652
- 'gov.au',
52653
- 'com.br',
52654
- 'net.br',
52655
- 'org.br',
52656
- 'com.cn',
52657
- 'net.cn',
52658
- 'org.cn',
52659
- 'gov.cn',
52660
- 'co.in',
52661
- 'net.in',
52662
- 'org.in',
52663
- 'co.nz',
52664
- 'net.nz',
52665
- 'org.nz',
52666
- 'co.za',
52667
- 'org.za',
52668
- 'com.mx',
52669
- 'com.ar',
52670
- 'com.co',
52671
- 'com.pe',
52672
- 'com.tr',
52673
- 'com.tw',
52674
- 'com.sg',
52675
- 'com.hk',
52676
- 'com.my',
52677
- 'com.ph',
52678
- 'com.vn',
52679
- 'co.kr',
52680
- 'co.il',
52681
- 'co.id',
52682
- 'co.th',
52683
- 'com.ua',
52684
- 'com.pl',
52685
- 'com.es',
52686
- ]);
52687
- const SCROLL_DEPTH_THROTTLE_MS = 200;
52688
- class AnalyticsTracking {
52689
- constructor(emit, options = {}) {
52690
- this.pageviewCleanups = [];
52691
- this.scrollCleanups = [];
52692
- this.engagementCleanups = [];
52693
- this.maxScrollDepth = 0;
52694
- this.scrollTicking = false;
52695
- this.lastScrollReport = 0;
52696
- this.engagementStart = 0;
52697
- this.engagementAccumulatedMs = 0;
52698
- this.engagementActive = false;
52699
- this.emit = emit;
52700
- this.respectDoNotTrack = options.respectDoNotTrack !== false;
52701
- this.propertyId = options.propertyId;
52702
- }
52703
- /**
52704
- * Enable the opinionated default auto-tracking set: pageviews, outbound
52705
- * links, scroll depth and active engagement time. Downloads must be opted
52706
- * into separately via `enableAutoDownloadTracking()` because the extension
52707
- * list is application-specific.
52708
- */
52709
- enableAllAutoTracking() {
52710
- this.enableAutoPageviews();
52711
- this.enableAutoOutboundTracking();
52712
- this.enableAutoScrollDepth();
52713
- this.enableAutoEngagementTime();
52714
- }
52715
- /**
52716
- * Track an event manually. Respects the DNT setting and swallows emitter
52717
- * exceptions so tracking failures never surface to the host page.
52718
- */
52719
- track(name, options) {
52720
- if (!this.canTrack()) {
52721
- return;
52722
- }
52723
- try {
52724
- this.emit(name, this.withPropertyId(options));
52725
- }
52726
- catch (error) {
52727
- console.warn('AnalyticsTracking: emitter threw', error);
52728
- }
52729
- }
52730
- /**
52731
- * Convenience wrapper for pageview-shaped events.
52732
- */
52733
- pageview(url, referrer) {
52734
- this.track('pageview', {
52735
- url: url !== null && url !== void 0 ? url : this.currentPageUrl(),
52736
- referrer: referrer !== null && referrer !== void 0 ? referrer : (typeof document !== 'undefined'
52737
- ? document.referrer
52738
- : undefined),
52739
- });
52740
- }
52741
- /**
52742
- * Enable SPA-aware pageview tracking. Fires an initial pageview on
52743
- * enable, then again on every `pushState`, `replaceState`, `popstate`
52744
- * or hashchange. Idempotent — repeat calls no-op.
52745
- */
52746
- enableAutoPageviews() {
52747
- if (this.pageviewCleanups.length > 0) {
52748
- return;
52749
- }
52750
- if (typeof window === 'undefined' || typeof history === 'undefined') {
52751
- return;
52752
- }
52753
- this.currentPath = this.currentPageUrl();
52754
- this.pageview();
52755
- const handleNavigation = () => {
52756
- const nextPath = this.currentPageUrl();
52757
- if (nextPath === this.currentPath) {
52758
- return;
52759
- }
52760
- const previous = this.currentPath;
52761
- this.currentPath = nextPath;
52762
- this.flushScrollDepth(previous);
52763
- this.flushEngagement(previous);
52764
- this.pageview(nextPath);
52765
- // flushEngagement no longer auto-restarts the timer (see its
52766
- // implementation note re: bfcache). SPA navigation stays on the
52767
- // same document, so restart engagement tracking for the new
52768
- // route as long as the tab is visible.
52769
- if (this.engagementCleanups.length > 0 &&
52770
- (typeof document === 'undefined' ||
52771
- document.visibilityState !== 'hidden')) {
52772
- this.startEngagement();
52773
- }
52774
- };
52775
- const originalPushState = history.pushState.bind(history);
52776
- const originalReplaceState = history.replaceState.bind(history);
52777
- // Our wrappers stay reachable after cleanup whenever another library
52778
- // patched on top of ours, so they have to be switchable off rather than
52779
- // merely unreferenced.
52780
- let patchActive = true;
52781
- const patchedPushState = (data, unused, url) => {
52782
- originalPushState(data, unused, url);
52783
- if (patchActive) {
52784
- handleNavigation();
52785
- }
52786
- };
52787
- const patchedReplaceState = (data, unused, url) => {
52788
- originalReplaceState(data, unused, url);
52789
- if (patchActive) {
52790
- handleNavigation();
52791
- }
52792
- };
52793
- history.pushState = patchedPushState;
52794
- history.replaceState = patchedReplaceState;
52795
- const popstateHandler = () => handleNavigation();
52796
- const hashchangeHandler = () => handleNavigation();
52797
- window.addEventListener('popstate', popstateHandler);
52798
- window.addEventListener('hashchange', hashchangeHandler);
52799
- this.pageviewCleanups.push(() => {
52800
- // Only unwind our own patch. A router (Next.js App Router, React
52801
- // Router, …) that patched these after us owns the current value,
52802
- // and assigning our saved reference back would silently throw its
52803
- // wrapper away. In that case ours stays in the chain, which is why
52804
- // `patchActive` exists: the wrapper keeps delegating to the original
52805
- // but stops reporting.
52806
- patchActive = false;
52807
- if (history.pushState === patchedPushState) {
52808
- history.pushState = originalPushState;
52809
- }
52810
- if (history.replaceState === patchedReplaceState) {
52811
- history.replaceState = originalReplaceState;
52812
- }
52813
- window.removeEventListener('popstate', popstateHandler);
52814
- window.removeEventListener('hashchange', hashchangeHandler);
52815
- });
52816
- }
52817
- /**
52818
- * Disable auto-pageview tracking installed by `enableAutoPageviews`.
52819
- * Safe to call when auto-pageviews were never enabled.
52820
- */
52821
- disableAutoPageviews() {
52822
- for (const cleanup of this.pageviewCleanups) {
52823
- cleanup();
52824
- }
52825
- this.pageviewCleanups = [];
52826
- }
52827
- /**
52828
- * Enable click-based outbound link tracking. Detects anchor clicks that
52829
- * navigate to a different origin and fires an `outbound_link` event
52830
- * (with `hostname` and `href` props) before the browser navigates.
52831
- */
52832
- enableAutoOutboundTracking(options = {}) {
52833
- if (this.outboundCleanup) {
52834
- return;
52835
- }
52836
- if (typeof document === 'undefined') {
52837
- return;
52838
- }
52839
- const includeSubdomains = options.includeSubdomains === true;
52840
- const clickHandler = (event) => {
52841
- const anchor = this.findAnchor(event.target);
52842
- if (!anchor || !anchor.href) {
52843
- return;
52844
- }
52845
- const target = this.parseUrl(anchor.href);
52846
- if (!target || !this.isExternal(target, includeSubdomains)) {
52847
- return;
52848
- }
52849
- this.track('outbound_link', {
52850
- url: target.href,
52851
- props: { hostname: target.hostname, href: target.href },
52852
- });
52853
- };
52854
- document.addEventListener('click', clickHandler, { capture: true });
52855
- this.outboundCleanup = () => document.removeEventListener('click', clickHandler, {
52856
- capture: true,
52857
- });
52858
- }
52859
- /**
52860
- * Disable outbound-link tracking installed by `enableAutoOutboundTracking`.
52861
- * Safe to call when auto-outbound was never enabled.
52862
- */
52863
- disableAutoOutboundTracking() {
52864
- if (this.outboundCleanup) {
52865
- this.outboundCleanup();
52866
- this.outboundCleanup = undefined;
52867
- }
52868
- }
52869
- /**
52870
- * Enable click-based download tracking. Detects anchor clicks that point
52871
- * at a file whose extension appears in the configured list and fires a
52872
- * `file_download` event with `filename`, `extension` and `href` props.
52873
- */
52874
- enableAutoDownloadTracking(options = {}) {
52875
- var _a;
52876
- if (this.downloadCleanup) {
52877
- return;
52878
- }
52879
- if (typeof document === 'undefined') {
52880
- return;
52881
- }
52882
- const extensions = ((_a = options.extensions) !== null && _a !== void 0 ? _a : DEFAULT_DOWNLOAD_EXTENSIONS).map((ext) => ext.toLowerCase().replace(/^\./, ''));
52883
- const extensionSet = new Set(extensions);
52884
- const clickHandler = (event) => {
52885
- var _a, _b;
52886
- const anchor = this.findAnchor(event.target);
52887
- if (!anchor || !anchor.href) {
52888
- return;
52889
- }
52890
- const url = this.parseUrl(anchor.href);
52891
- if (!url) {
52892
- return;
52893
- }
52894
- const filename = (_a = url.pathname.split('/').pop()) !== null && _a !== void 0 ? _a : '';
52895
- const extension = filename.includes('.')
52896
- ? (_b = filename.split('.').pop()) === null || _b === void 0 ? void 0 : _b.toLowerCase()
52897
- : undefined;
52898
- if (!extension || !extensionSet.has(extension)) {
52899
- return;
52900
- }
52901
- this.track('file_download', {
52902
- url: url.href,
52903
- props: { filename, extension, href: url.href },
52904
- });
52905
- };
52906
- document.addEventListener('click', clickHandler, { capture: true });
52907
- this.downloadCleanup = () => document.removeEventListener('click', clickHandler, {
52908
- capture: true,
52909
- });
52910
- }
52911
- /**
52912
- * Disable file-download tracking installed by `enableAutoDownloadTracking`.
52913
- * Safe to call when auto-download was never enabled.
52914
- */
52915
- disableAutoDownloadTracking() {
52916
- if (this.downloadCleanup) {
52917
- this.downloadCleanup();
52918
- this.downloadCleanup = undefined;
52919
- }
52920
- }
52921
- /**
52922
- * Enable passive scroll-depth tracking. Records the maximum percent of the
52923
- * document scrolled and reports it on `beforeunload` and on SPA route
52924
- * changes. Uses a throttled passive listener so it is safe on hot paths.
52925
- */
52926
- enableAutoScrollDepth() {
52927
- if (this.scrollCleanups.length > 0) {
52928
- return;
52929
- }
52930
- if (typeof window === 'undefined' || typeof document === 'undefined') {
52931
- return;
52932
- }
52933
- this.maxScrollDepth = 0;
52934
- this.lastScrollReport = 0;
52935
- const scrollHandler = () => {
52936
- if (this.scrollTicking) {
52937
- return;
52938
- }
52939
- this.scrollTicking = true;
52940
- window.requestAnimationFrame(() => {
52941
- const now = Date.now();
52942
- if (now - this.lastScrollReport < SCROLL_DEPTH_THROTTLE_MS) {
52943
- this.scrollTicking = false;
52944
- return;
52945
- }
52946
- this.lastScrollReport = now;
52947
- const depth = this.computeScrollDepth();
52948
- if (depth > this.maxScrollDepth) {
52949
- this.maxScrollDepth = depth;
52950
- }
52951
- this.scrollTicking = false;
52952
- });
52953
- };
52954
- const unloadHandler = () => {
52955
- this.flushScrollDepth(this.currentPageUrl());
52956
- };
52957
- window.addEventListener('scroll', scrollHandler, { passive: true });
52958
- window.addEventListener('beforeunload', unloadHandler);
52959
- window.addEventListener('pagehide', unloadHandler);
52960
- this.scrollCleanups.push(() => {
52961
- window.removeEventListener('scroll', scrollHandler);
52962
- window.removeEventListener('beforeunload', unloadHandler);
52963
- window.removeEventListener('pagehide', unloadHandler);
52964
- });
52965
- }
52966
- /**
52967
- * Disable scroll-depth tracking installed by `enableAutoScrollDepth`. Safe
52968
- * to call when auto-scroll-depth was never enabled. Any accumulated depth
52969
- * for the current page is dropped.
52970
- */
52971
- disableAutoScrollDepth() {
52972
- for (const cleanup of this.scrollCleanups) {
52973
- cleanup();
52974
- }
52975
- this.scrollCleanups = [];
52976
- this.maxScrollDepth = 0;
52977
- this.scrollTicking = false;
52978
- this.lastScrollReport = 0;
52979
- }
52980
- /**
52981
- * Enable active engagement-time tracking. Counts time the tab is visible
52982
- * and uses `visibilitychange` to exclude background time.
52983
- *
52984
- * Delivery follows Plausible's model rather than a single total at the
52985
- * end of the visit: an `engagement_time` event is emitted at every natural
52986
- * checkpoint — the tab going hidden, an SPA route change, and finally
52987
- * `beforeunload`/`pagehide`. Unload is kept only as a best-effort last
52988
- * flush; it is the least reliable moment to send anything (browsers
52989
- * routinely cancel in-flight requests there, and `sendBeacon` cannot set
52990
- * the `X-Appwrite-Project` header the endpoint requires), so it must never
52991
- * be the only delivery.
52992
- *
52993
- * Each event carries a **delta** — the seconds accrued since the previous
52994
- * flush, not a running total — so the values are additive per session and
52995
- * a lost event costs only its own slice.
52996
- *
52997
- * There is deliberately no periodic ping. The cadence is driven by
52998
- * navigation and tab switches, so request volume tracks what the visitor
52999
- * actually does instead of multiplying with time on page.
53000
- */
53001
- enableAutoEngagementTime() {
53002
- if (this.engagementCleanups.length > 0) {
53003
- return;
53004
- }
53005
- if (typeof window === 'undefined' || typeof document === 'undefined') {
53006
- return;
53007
- }
53008
- this.engagementAccumulatedMs = 0;
53009
- // Do not start the clock for a tab that is already hidden (prerender,
53010
- // background tab restore); `visibilitychange` starts it when it is
53011
- // actually looked at.
53012
- if (document.visibilityState !== 'hidden') {
53013
- this.startEngagement();
53014
- }
53015
- const visibilityHandler = () => {
53016
- if (document.visibilityState === 'hidden') {
53017
- // Flush, don't just pause. The page is still fully alive here,
53018
- // which makes this the most reliable delivery point in the
53019
- // whole visit — and it is the same moment Plausible reports on.
53020
- this.flushEngagement(this.currentPageUrl());
53021
- }
53022
- else if (document.visibilityState === 'visible') {
53023
- this.startEngagement();
53024
- }
53025
- };
53026
- const unloadHandler = () => {
53027
- this.flushEngagement(this.currentPageUrl());
53028
- };
53029
- const pageshowHandler = (event) => {
53030
- // When the page is restored from the back-forward cache the
53031
- // engagement timer is in a stopped state (flushEngagement paused
53032
- // it on pagehide and does not auto-restart). Kick off a fresh
53033
- // engagementStart so bfcache dwell time is not billed as
53034
- // engagement.
53035
- if (event.persisted) {
53036
- this.startEngagement();
53037
- }
53038
- };
53039
- document.addEventListener('visibilitychange', visibilityHandler);
53040
- window.addEventListener('beforeunload', unloadHandler);
53041
- window.addEventListener('pagehide', unloadHandler);
53042
- window.addEventListener('pageshow', pageshowHandler);
53043
- this.engagementCleanups.push(() => {
53044
- document.removeEventListener('visibilitychange', visibilityHandler);
53045
- window.removeEventListener('beforeunload', unloadHandler);
53046
- window.removeEventListener('pagehide', unloadHandler);
53047
- window.removeEventListener('pageshow', pageshowHandler);
53048
- });
53049
- }
53050
- /**
53051
- * Disable engagement-time tracking installed by `enableAutoEngagementTime`.
53052
- * Safe to call when auto-engagement was never enabled. Any accumulated
53053
- * engagement time is dropped without being emitted.
53054
- */
53055
- disableAutoEngagementTime() {
53056
- for (const cleanup of this.engagementCleanups) {
53057
- cleanup();
53058
- }
53059
- this.engagementCleanups = [];
53060
- this.engagementActive = false;
53061
- this.engagementAccumulatedMs = 0;
53062
- this.engagementStart = 0;
53063
- }
53064
- /**
53065
- * Merge the configured `propertyId` into an event's options. Returns the
53066
- * caller's object untouched when no default is configured (or the event
53067
- * already carries one), so emitters written against the pre-`propertyId`
53068
- * shape keep receiving exactly what they received before.
53069
- */
53070
- withPropertyId(options) {
53071
- if (this.propertyId === undefined ||
53072
- (options === null || options === void 0 ? void 0 : options.propertyId) !== undefined) {
53073
- return options;
53074
- }
53075
- return Object.assign(Object.assign({}, (options !== null && options !== void 0 ? options : {})), { propertyId: this.propertyId });
53076
- }
53077
- canTrack() {
53078
- if (!this.respectDoNotTrack) {
53079
- return true;
53080
- }
53081
- if (typeof navigator === 'undefined') {
53082
- return true;
53083
- }
53084
- return navigator.doNotTrack !== '1';
53085
- }
53086
- currentPageUrl() {
53087
- if (typeof window === 'undefined' || !window.location) {
53088
- return '';
53089
- }
53090
- return window.location.href;
53091
- }
53092
- findAnchor(target) {
53093
- let node = target;
53094
- while (node) {
53095
- if (node.tagName === 'A') {
53096
- return node;
53097
- }
53098
- node = node.parentNode;
53099
- }
53100
- return null;
53101
- }
53102
- parseUrl(href) {
53103
- try {
53104
- return new URL(href, window.location.href);
53105
- }
53106
- catch (_a) {
53107
- return null;
53108
- }
53109
- }
53110
- isExternal(target, includeSubdomains) {
53111
- if (target.protocol !== 'http:' && target.protocol !== 'https:') {
53112
- return false;
53113
- }
53114
- if (target.hostname === window.location.hostname) {
53115
- return false;
53116
- }
53117
- if (includeSubdomains) {
53118
- return true;
53119
- }
53120
- const root = this.rootDomain(window.location.hostname);
53121
- return this.rootDomain(target.hostname) !== root;
53122
- }
53123
- rootDomain(hostname) {
53124
- const parts = hostname.split('.');
53125
- if (parts.length <= 2) {
53126
- return hostname;
53127
- }
53128
- // Taking the last two labels is wrong wherever the registry sells names
53129
- // one level down: `shop.example.co.uk` and `google.co.uk` both reduce to
53130
- // `co.uk`, so every outbound click between two `.co.uk` sites looks
53131
- // internal and is dropped. Take three labels after a known two-part
53132
- // suffix instead.
53133
- //
53134
- // This is a heuristic, not the Public Suffix List — the full list is
53135
- // orders of magnitude larger than this whole file, and a tracking
53136
- // snippet cannot carry it. Sites on a suffix that is missing here can
53137
- // pass `includeSubdomains: true` to treat every other host as outbound.
53138
- const suffix = parts.slice(-2).join('.');
53139
- if (parts.length > 2 && MULTI_PART_SUFFIXES.has(suffix)) {
53140
- return parts.slice(-3).join('.');
53141
- }
53142
- return suffix;
53143
- }
53144
- computeScrollDepth() {
53145
- const scrollTop = window.scrollY || document.documentElement.scrollTop;
53146
- const viewport = window.innerHeight || document.documentElement.clientHeight;
53147
- const total = document.documentElement.scrollHeight;
53148
- if (total <= viewport) {
53149
- return 100;
53150
- }
53151
- const depth = Math.round(((scrollTop + viewport) / total) * 100);
53152
- return Math.max(0, Math.min(100, depth));
53153
- }
53154
- flushScrollDepth(url) {
53155
- if (this.scrollCleanups.length === 0) {
53156
- return;
53157
- }
53158
- if (this.maxScrollDepth <= 0) {
53159
- return;
53160
- }
53161
- this.track('scroll_depth', {
53162
- url,
53163
- scrollDepth: this.maxScrollDepth,
53164
- });
53165
- this.maxScrollDepth = 0;
53166
- }
53167
- startEngagement() {
53168
- if (this.engagementActive) {
53169
- return;
53170
- }
53171
- this.engagementActive = true;
53172
- this.engagementStart = Date.now();
53173
- }
53174
- pauseEngagement() {
53175
- if (!this.engagementActive) {
53176
- return;
53177
- }
53178
- this.engagementActive = false;
53179
- this.engagementAccumulatedMs += Date.now() - this.engagementStart;
53180
- }
53181
- flushEngagement(url) {
53182
- if (this.engagementCleanups.length === 0) {
53183
- return;
53184
- }
53185
- this.pauseEngagement();
53186
- // Deltas, not a running total: emit only what accrued since the last
53187
- // flush. `floor` plus keeping the sub-second remainder in the
53188
- // accumulator is what makes repeated flushes safe — nothing is emitted
53189
- // twice, and a visit chopped into many short segments does not lose a
53190
- // fraction of a second to rounding on every one of them.
53191
- const seconds = Math.floor(this.engagementAccumulatedMs / 1000);
53192
- if (seconds > 0) {
53193
- // Deduct before emitting so a synchronous emitter that re-enters
53194
- // (or throws) can never bill the same seconds again.
53195
- this.engagementAccumulatedMs -= seconds * 1000;
53196
- this.track('engagement_time', {
53197
- url,
53198
- engagementTime: seconds,
53199
- });
53200
- }
53201
- // NOTE: intentionally do NOT call startEngagement() here. flushEngagement
53202
- // runs on `pagehide`, which is also the last hook before the browser
53203
- // may freeze the page into the back-forward cache. Auto-restarting
53204
- // would snapshot engagementStart just before the freeze; the next
53205
- // pauseEngagement (after bfcache restore) would then bill the entire
53206
- // bfcache dwell as active engagement. Restart is driven by explicit
53207
- // resume signals: `pageshow` (with `persisted === true`),
53208
- // `visibilitychange` back to visible, or the SPA navigation flow in
53209
- // `enableAutoPageviews`.
53210
- }
53211
- }
53212
-
53213
50586
  /**
53214
50587
  * Helper class to generate permission strings for resources.
53215
50588
  */
@@ -53916,68 +51289,6 @@
53916
51289
  OAuthProvider["Zoom"] = "zoom";
53917
51290
  })(exports.OAuthProvider || (exports.OAuthProvider = {}));
53918
51291
 
53919
- exports.PlatformResourceType = void 0;
53920
- (function (PlatformResourceType) {
53921
- PlatformResourceType["Projects"] = "projects";
53922
- PlatformResourceType["Organizations"] = "organizations";
53923
- PlatformResourceType["Users"] = "users";
53924
- PlatformResourceType["Memberships"] = "memberships";
53925
- PlatformResourceType["Rules"] = "rules";
53926
- PlatformResourceType["Keys"] = "keys";
53927
- PlatformResourceType["Platforms"] = "platforms";
53928
- PlatformResourceType["Webhooks"] = "webhooks";
53929
- PlatformResourceType["Certificates"] = "certificates";
53930
- })(exports.PlatformResourceType || (exports.PlatformResourceType = {}));
53931
-
53932
- exports.ProjectResourceType = void 0;
53933
- (function (ProjectResourceType) {
53934
- ProjectResourceType["Users"] = "users";
53935
- ProjectResourceType["Teams"] = "teams";
53936
- ProjectResourceType["Memberships"] = "memberships";
53937
- ProjectResourceType["Databases"] = "databases";
53938
- ProjectResourceType["Buckets"] = "buckets";
53939
- ProjectResourceType["Functions"] = "functions";
53940
- ProjectResourceType["Sites"] = "sites";
53941
- ProjectResourceType["Deployments"] = "deployments";
53942
- ProjectResourceType["Topics"] = "topics";
53943
- ProjectResourceType["Providers"] = "providers";
53944
- ProjectResourceType["Messages"] = "messages";
53945
- })(exports.ProjectResourceType || (exports.ProjectResourceType = {}));
53946
-
53947
- exports.AnalyticsInterval = void 0;
53948
- (function (AnalyticsInterval) {
53949
- AnalyticsInterval["OneHour"] = "1h";
53950
- AnalyticsInterval["OneDay"] = "1d";
53951
- AnalyticsInterval["OneWeek"] = "1w";
53952
- AnalyticsInterval["OneMonth"] = "1m";
53953
- })(exports.AnalyticsInterval || (exports.AnalyticsInterval = {}));
53954
-
53955
- exports.AnalyticsDimension = void 0;
53956
- (function (AnalyticsDimension) {
53957
- AnalyticsDimension["Country"] = "country";
53958
- AnalyticsDimension["Region"] = "region";
53959
- AnalyticsDimension["City"] = "city";
53960
- AnalyticsDimension["Browser"] = "browser";
53961
- AnalyticsDimension["OperatingSystem"] = "operatingSystem";
53962
- AnalyticsDimension["Device"] = "device";
53963
- AnalyticsDimension["ScreenSize"] = "screenSize";
53964
- AnalyticsDimension["ReferrerSource"] = "referrerSource";
53965
- AnalyticsDimension["Channel"] = "channel";
53966
- AnalyticsDimension["UtmSource"] = "utmSource";
53967
- AnalyticsDimension["UtmMedium"] = "utmMedium";
53968
- AnalyticsDimension["UtmCampaign"] = "utmCampaign";
53969
- AnalyticsDimension["UtmContent"] = "utmContent";
53970
- AnalyticsDimension["UtmTerm"] = "utmTerm";
53971
- AnalyticsDimension["Page"] = "page";
53972
- AnalyticsDimension["Hostname"] = "hostname";
53973
- AnalyticsDimension["EntryPage"] = "entryPage";
53974
- AnalyticsDimension["ExitPage"] = "exitPage";
53975
- AnalyticsDimension["TrafficType"] = "trafficType";
53976
- AnalyticsDimension["BotName"] = "botName";
53977
- AnalyticsDimension["BotCategory"] = "botCategory";
53978
- AnalyticsDimension["EventName"] = "eventName";
53979
- })(exports.AnalyticsDimension || (exports.AnalyticsDimension = {}));
53980
-
53981
51292
  exports.Browser = void 0;
53982
51293
  (function (Browser) {
53983
51294
  Browser["AvantBrowser"] = "aa";
@@ -54793,14 +52104,6 @@
54793
52104
  QuerySuggestionResource["ResourceTokens"] = "resourcetokens";
54794
52105
  QuerySuggestionResource["Transactions"] = "transactions";
54795
52106
  QuerySuggestionResource["TransactionLogs"] = "transactionlogs";
54796
- QuerySuggestionResource["Videos"] = "videos";
54797
- QuerySuggestionResource["VideosPreviews"] = "videos_previews";
54798
- QuerySuggestionResource["VideosRenditions"] = "videos_renditions";
54799
- QuerySuggestionResource["VideosRenditionsSegments"] = "videos_renditions_segments";
54800
- QuerySuggestionResource["VideosProfiles"] = "videos_profiles";
54801
- QuerySuggestionResource["VideosSubtitles"] = "videos_subtitles";
54802
- QuerySuggestionResource["VideosSubtitlesSegments"] = "videos_subtitles_segments";
54803
- QuerySuggestionResource["AnalyticsProperties"] = "analyticsproperties";
54804
52107
  QuerySuggestionResource["DedicatedDatabases"] = "dedicateddatabases";
54805
52108
  QuerySuggestionResource["DedicatedDatabaseConfigs"] = "dedicateddatabaseconfigs";
54806
52109
  QuerySuggestionResource["DedicatedDatabaseRuntimes"] = "dedicateddatabaseruntimes";
@@ -55223,8 +52526,6 @@
55223
52526
  ProjectKeyScopes["ReportsWrite"] = "reports.write";
55224
52527
  ProjectKeyScopes["PresencesRead"] = "presences.read";
55225
52528
  ProjectKeyScopes["PresencesWrite"] = "presences.write";
55226
- ProjectKeyScopes["VideosRead"] = "videos.read";
55227
- ProjectKeyScopes["VideosWrite"] = "videos.write";
55228
52529
  ProjectKeyScopes["DedicatedDatabasesExecute"] = "dedicatedDatabases.execute";
55229
52530
  ProjectKeyScopes["BackupsPoliciesRead"] = "backups.policies.read";
55230
52531
  ProjectKeyScopes["BackupsPoliciesWrite"] = "backups.policies.write";
@@ -55243,8 +52544,6 @@
55243
52544
  ProjectKeyScopes["Oauth2Read"] = "oauth2.read";
55244
52545
  ProjectKeyScopes["Oauth2Write"] = "oauth2.write";
55245
52546
  ProjectKeyScopes["Oauth2Introspect"] = "oauth2.introspect";
55246
- ProjectKeyScopes["AnalyticsRead"] = "analytics.read";
55247
- ProjectKeyScopes["AnalyticsWrite"] = "analytics.write";
55248
52547
  })(exports.ProjectKeyScopes || (exports.ProjectKeyScopes = {}));
55249
52548
 
55250
52549
  exports.FunctionTemplateUseCase = void 0;
@@ -55494,7 +52793,6 @@
55494
52793
  ProjectAuthMethodId["Invites"] = "invites";
55495
52794
  ProjectAuthMethodId["Jwt"] = "jwt";
55496
52795
  ProjectAuthMethodId["Phone"] = "phone";
55497
- ProjectAuthMethodId["Passkey"] = "passkey";
55498
52796
  })(exports.ProjectAuthMethodId || (exports.ProjectAuthMethodId = {}));
55499
52797
 
55500
52798
  exports.ProjectOAuth2Auth0Prompt = void 0;
@@ -55636,7 +52934,6 @@
55636
52934
  ProjectPolicyId["Denydisposableemail"] = "deny-disposable-email";
55637
52935
  ProjectPolicyId["Denyfreeemail"] = "deny-free-email";
55638
52936
  ProjectPolicyId["Denycorporateemail"] = "deny-corporate-email";
55639
- ProjectPolicyId["Passkey"] = "passkey";
55640
52937
  })(exports.ProjectPolicyId || (exports.ProjectPolicyId = {}));
55641
52938
 
55642
52939
  exports.ProjectProtocolId = void 0;
@@ -55881,9 +53178,6 @@
55881
53178
 
55882
53179
  exports.UsageEventMetric = void 0;
55883
53180
  (function (UsageEventMetric) {
55884
- UsageEventMetric["AnalyticsEvents"] = "analytics.events";
55885
- UsageEventMetric["AnalyticsPageviews"] = "analytics.pageviews";
55886
- UsageEventMetric["AnalyticsBotsEvents"] = "analytics.bots.events";
55887
53181
  UsageEventMetric["NetworkRequests"] = "network.requests";
55888
53182
  UsageEventMetric["NetworkInbound"] = "network.inbound";
55889
53183
  UsageEventMetric["NetworkOutbound"] = "network.outbound";
@@ -56001,7 +53295,6 @@
56001
53295
 
56002
53296
  exports.UsageGaugeMetric = void 0;
56003
53297
  (function (UsageGaugeMetric) {
56004
- UsageGaugeMetric["AnalyticsProperties"] = "analytics.properties";
56005
53298
  UsageGaugeMetric["Teams"] = "teams";
56006
53299
  UsageGaugeMetric["Users"] = "users";
56007
53300
  UsageGaugeMetric["Messages"] = "messages";
@@ -56099,24 +53392,6 @@
56099
53392
  VectorsDBIndexType["Unique"] = "unique";
56100
53393
  })(exports.VectorsDBIndexType || (exports.VectorsDBIndexType = {}));
56101
53394
 
56102
- exports.VideoOutput = void 0;
56103
- (function (VideoOutput) {
56104
- VideoOutput["Hls"] = "hls";
56105
- VideoOutput["Dash"] = "dash";
56106
- VideoOutput["Cmaf"] = "cmaf";
56107
- })(exports.VideoOutput || (exports.VideoOutput = {}));
56108
-
56109
- exports.VideoRenditionStatus = void 0;
56110
- (function (VideoRenditionStatus) {
56111
- VideoRenditionStatus["Pending"] = "pending";
56112
- VideoRenditionStatus["Started"] = "started";
56113
- VideoRenditionStatus["Ended"] = "ended";
56114
- VideoRenditionStatus["Uploading"] = "uploading";
56115
- VideoRenditionStatus["Ready"] = "ready";
56116
- VideoRenditionStatus["Error"] = "error";
56117
- VideoRenditionStatus["Aborted"] = "aborted";
56118
- })(exports.VideoRenditionStatus || (exports.VideoRenditionStatus = {}));
56119
-
56120
53395
  exports.DatabaseType = void 0;
56121
53396
  (function (DatabaseType) {
56122
53397
  DatabaseType["Legacy"] = "legacy";
@@ -56295,7 +53570,6 @@
56295
53570
  (function (ProxyRuleDeploymentResourceType) {
56296
53571
  ProxyRuleDeploymentResourceType["Function"] = "function";
56297
53572
  ProxyRuleDeploymentResourceType["Site"] = "site";
56298
- ProxyRuleDeploymentResourceType["DedicatedDatabase"] = "dedicatedDatabase";
56299
53573
  })(exports.ProxyRuleDeploymentResourceType || (exports.ProxyRuleDeploymentResourceType = {}));
56300
53574
 
56301
53575
  exports.ProxyRuleStatus = void 0;
@@ -58375,11 +55649,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
58375
55649
 
58376
55650
  exports.Account = Account;
58377
55651
  exports.Activities = Activities;
58378
- exports.Admin = Admin;
58379
55652
  exports.Advisor = Advisor;
58380
55653
  exports.Affiliates = Affiliates;
58381
- exports.Analytics = Analytics;
58382
- exports.AnalyticsTracking = AnalyticsTracking;
58383
55654
  exports.Apps = Apps;
58384
55655
  exports.AppwriteException = AppwriteException;
58385
55656
  exports.Assistant = Assistant;
@@ -58428,7 +55699,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
58428
55699
  exports.Users = Users;
58429
55700
  exports.Vcs = Vcs;
58430
55701
  exports.VectorsDB = VectorsDB;
58431
- exports.Videos = Videos;
58432
55702
  exports.Waf = Waf;
58433
55703
  exports.Webhooks = Webhooks;
58434
55704