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

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.4.0-rc.2',
4470
+ 'x-sdk-version': '18.4.1',
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;
@@ -6796,27 +6819,19 @@
6796
6819
  else {
6797
6820
  params = {
6798
6821
  passkeyId: paramsOrFirst,
6799
- challengeId: rest[0],
6800
- credential: rest[1],
6822
+ credential: rest[0],
6801
6823
  };
6802
6824
  }
6803
6825
  const passkeyId = params.passkeyId;
6804
- const challengeId = params.challengeId;
6805
6826
  const credential = params.credential;
6806
6827
  if (typeof passkeyId === 'undefined' || passkeyId === '') {
6807
6828
  throw new AppwriteException('Missing required parameter: "passkeyId"');
6808
6829
  }
6809
- if (typeof challengeId === 'undefined') {
6810
- throw new AppwriteException('Missing required parameter: "challengeId"');
6811
- }
6812
6830
  if (typeof credential === 'undefined') {
6813
6831
  throw new AppwriteException('Missing required parameter: "credential"');
6814
6832
  }
6815
6833
  const apiPath = '/account/passkeys/{passkeyId}/verification'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
6816
6834
  const apiPayload = {};
6817
- if (typeof challengeId !== 'undefined') {
6818
- apiPayload['challengeId'] = challengeId;
6819
- }
6820
6835
  if (typeof credential !== 'undefined') {
6821
6836
  apiPayload['credential'] = credential;
6822
6837
  }
@@ -7571,7 +7586,7 @@
7571
7586
  }
7572
7587
  const uri = new URL(this.client.config.endpoint + apiPath);
7573
7588
  apiPayload['project'] = this.client.config.project;
7574
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
7589
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
7575
7590
  uri.searchParams.append(key, value);
7576
7591
  }
7577
7592
  if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {
@@ -7980,7 +7995,7 @@
7980
7995
  }
7981
7996
  const uri = new URL(this.client.config.endpoint + apiPath);
7982
7997
  apiPayload['project'] = this.client.config.project;
7983
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
7998
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
7984
7999
  uri.searchParams.append(key, value);
7985
8000
  }
7986
8001
  if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {
@@ -8391,135 +8406,6 @@
8391
8406
  }
8392
8407
  }
8393
8408
 
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
8409
  class Affiliates {
8524
8410
  constructor(client) {
8525
8411
  this.client = client;
@@ -8731,369 +8617,6 @@
8731
8617
  }
8732
8618
  }
8733
8619
 
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
8620
  class Apps {
9098
8621
  constructor(client) {
9099
8622
  this.client = client;
@@ -9986,7 +9509,7 @@
9986
9509
  const uri = new URL(this.client.config.endpoint + apiPath);
9987
9510
  apiPayload['project'] = this.client.config.project;
9988
9511
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
9989
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9512
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
9990
9513
  uri.searchParams.append(key, value);
9991
9514
  }
9992
9515
  return uri.toString();
@@ -10031,7 +9554,7 @@
10031
9554
  const uri = new URL(this.client.config.endpoint + apiPath);
10032
9555
  apiPayload['project'] = this.client.config.project;
10033
9556
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10034
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9557
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10035
9558
  uri.searchParams.append(key, value);
10036
9559
  }
10037
9560
  return uri.toString();
@@ -10060,7 +9583,7 @@
10060
9583
  const uri = new URL(this.client.config.endpoint + apiPath);
10061
9584
  apiPayload['project'] = this.client.config.project;
10062
9585
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10063
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9586
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10064
9587
  uri.searchParams.append(key, value);
10065
9588
  }
10066
9589
  return uri.toString();
@@ -10105,7 +9628,7 @@
10105
9628
  const uri = new URL(this.client.config.endpoint + apiPath);
10106
9629
  apiPayload['project'] = this.client.config.project;
10107
9630
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10108
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9631
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10109
9632
  uri.searchParams.append(key, value);
10110
9633
  }
10111
9634
  return uri.toString();
@@ -10144,7 +9667,7 @@
10144
9667
  const uri = new URL(this.client.config.endpoint + apiPath);
10145
9668
  apiPayload['project'] = this.client.config.project;
10146
9669
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10147
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9670
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10148
9671
  uri.searchParams.append(key, value);
10149
9672
  }
10150
9673
  return uri.toString();
@@ -10186,7 +9709,7 @@
10186
9709
  const uri = new URL(this.client.config.endpoint + apiPath);
10187
9710
  apiPayload['project'] = this.client.config.project;
10188
9711
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10189
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9712
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10190
9713
  uri.searchParams.append(key, value);
10191
9714
  }
10192
9715
  return uri.toString();
@@ -10248,7 +9771,7 @@
10248
9771
  const uri = new URL(this.client.config.endpoint + apiPath);
10249
9772
  apiPayload['project'] = this.client.config.project;
10250
9773
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10251
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9774
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10252
9775
  uri.searchParams.append(key, value);
10253
9776
  }
10254
9777
  return uri.toString();
@@ -10342,7 +9865,7 @@
10342
9865
  const uri = new URL(this.client.config.endpoint + apiPath);
10343
9866
  apiPayload['project'] = this.client.config.project;
10344
9867
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10345
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9868
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10346
9869
  uri.searchParams.append(key, value);
10347
9870
  }
10348
9871
  return uri.toString();
@@ -10466,7 +9989,7 @@
10466
9989
  const uri = new URL(this.client.config.endpoint + apiPath);
10467
9990
  apiPayload['project'] = this.client.config.project;
10468
9991
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
10469
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
9992
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
10470
9993
  uri.searchParams.append(key, value);
10471
9994
  }
10472
9995
  return uri.toString();
@@ -20052,7 +19575,7 @@
20052
19575
  const uri = new URL(this.client.config.endpoint + apiPath);
20053
19576
  apiPayload['project'] = this.client.config.project;
20054
19577
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
20055
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
19578
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
20056
19579
  uri.searchParams.append(key, value);
20057
19580
  }
20058
19581
  return uri.toString();
@@ -30691,7 +30214,7 @@
30691
30214
  const uri = new URL(this.client.config.endpoint + apiPath);
30692
30215
  apiPayload['project'] = this.client.config.project;
30693
30216
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
30694
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
30217
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
30695
30218
  uri.searchParams.append(key, value);
30696
30219
  }
30697
30220
  return uri.toString();
@@ -30798,7 +30321,7 @@
30798
30321
  const uri = new URL(this.client.config.endpoint + apiPath);
30799
30322
  apiPayload['project'] = this.client.config.project;
30800
30323
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
30801
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
30324
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
30802
30325
  uri.searchParams.append(key, value);
30803
30326
  }
30804
30327
  return uri.toString();
@@ -35579,13 +35102,11 @@
35579
35102
  platformId: paramsOrFirst,
35580
35103
  name: rest[0],
35581
35104
  applicationId: rest[1],
35582
- fingerprints: rest[2],
35583
35105
  };
35584
35106
  }
35585
35107
  const platformId = params.platformId;
35586
35108
  const name = params.name;
35587
35109
  const applicationId = params.applicationId;
35588
- const fingerprints = params.fingerprints;
35589
35110
  if (typeof platformId === 'undefined') {
35590
35111
  throw new AppwriteException('Missing required parameter: "platformId"');
35591
35112
  }
@@ -35606,9 +35127,6 @@
35606
35127
  if (typeof applicationId !== 'undefined') {
35607
35128
  apiPayload['applicationId'] = applicationId;
35608
35129
  }
35609
- if (typeof fingerprints !== 'undefined') {
35610
- apiPayload['fingerprints'] = fingerprints;
35611
- }
35612
35130
  const uri = new URL(this.client.config.endpoint + apiPath);
35613
35131
  const apiHeaders = {
35614
35132
  'X-Appwrite-Project': this.client.config.project,
@@ -35629,13 +35147,11 @@
35629
35147
  platformId: paramsOrFirst,
35630
35148
  name: rest[0],
35631
35149
  applicationId: rest[1],
35632
- fingerprints: rest[2],
35633
35150
  };
35634
35151
  }
35635
35152
  const platformId = params.platformId;
35636
35153
  const name = params.name;
35637
35154
  const applicationId = params.applicationId;
35638
- const fingerprints = params.fingerprints;
35639
35155
  if (typeof platformId === 'undefined' || platformId === '') {
35640
35156
  throw new AppwriteException('Missing required parameter: "platformId"');
35641
35157
  }
@@ -35653,9 +35169,6 @@
35653
35169
  if (typeof applicationId !== 'undefined') {
35654
35170
  apiPayload['applicationId'] = applicationId;
35655
35171
  }
35656
- if (typeof fingerprints !== 'undefined') {
35657
- apiPayload['fingerprints'] = fingerprints;
35658
- }
35659
35172
  const uri = new URL(this.client.config.endpoint + apiPath);
35660
35173
  const apiHeaders = {
35661
35174
  'X-Appwrite-Project': this.client.config.project,
@@ -36304,30 +35817,27 @@
36304
35817
  };
36305
35818
  return this.client.call('patch', uri, apiHeaders, apiPayload);
36306
35819
  }
36307
- updatePasskeyPolicy(paramsOrFirst, ...rest) {
35820
+ updatePasskeyPolicy(paramsOrFirst) {
36308
35821
  let params;
36309
- if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
36310
- (paramsOrFirst &&
36311
- typeof paramsOrFirst === 'object' &&
36312
- !Array.isArray(paramsOrFirst))) {
35822
+ if (paramsOrFirst &&
35823
+ typeof paramsOrFirst === 'object' &&
35824
+ !Array.isArray(paramsOrFirst)) {
36313
35825
  params = (paramsOrFirst || {});
36314
35826
  }
36315
35827
  else {
36316
35828
  params = {
36317
35829
  rpId: paramsOrFirst,
36318
- origins: rest[0],
36319
35830
  };
36320
35831
  }
36321
35832
  const rpId = params.rpId;
36322
- const origins = params.origins;
35833
+ if (typeof rpId === 'undefined') {
35834
+ throw new AppwriteException('Missing required parameter: "rpId"');
35835
+ }
36323
35836
  const apiPath = '/project/policies/passkey';
36324
35837
  const apiPayload = {};
36325
35838
  if (typeof rpId !== 'undefined') {
36326
35839
  apiPayload['rpId'] = rpId;
36327
35840
  }
36328
- if (typeof origins !== 'undefined') {
36329
- apiPayload['origins'] = origins;
36330
- }
36331
35841
  const uri = new URL(this.client.config.endpoint + apiPath);
36332
35842
  const apiHeaders = {
36333
35843
  'X-Appwrite-Project': this.client.config.project,
@@ -39026,7 +38536,7 @@
39026
38536
  const uri = new URL(this.client.config.endpoint + apiPath);
39027
38537
  apiPayload['project'] = this.client.config.project;
39028
38538
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
39029
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
38539
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
39030
38540
  uri.searchParams.append(key, value);
39031
38541
  }
39032
38542
  return uri.toString();
@@ -39857,7 +39367,7 @@
39857
39367
  const uri = new URL(this.client.config.endpoint + apiPath);
39858
39368
  apiPayload['project'] = this.client.config.project;
39859
39369
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
39860
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
39370
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
39861
39371
  uri.searchParams.append(key, value);
39862
39372
  }
39863
39373
  return uri.toString();
@@ -39950,7 +39460,7 @@
39950
39460
  const uri = new URL(this.client.config.endpoint + apiPath);
39951
39461
  apiPayload['project'] = this.client.config.project;
39952
39462
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
39953
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
39463
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
39954
39464
  uri.searchParams.append(key, value);
39955
39465
  }
39956
39466
  return uri.toString();
@@ -39988,7 +39498,7 @@
39988
39498
  const uri = new URL(this.client.config.endpoint + apiPath);
39989
39499
  apiPayload['project'] = this.client.config.project;
39990
39500
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
39991
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
39501
+ for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
39992
39502
  uri.searchParams.append(key, value);
39993
39503
  }
39994
39504
  return uri.toString();
@@ -44459,17 +43969,15 @@
44459
43969
  params = {
44460
43970
  teamId: paramsOrFirst,
44461
43971
  roles: rest[0],
44462
- membershipId: rest[1],
44463
- email: rest[2],
44464
- userId: rest[3],
44465
- phone: rest[4],
44466
- url: rest[5],
44467
- name: rest[6],
43972
+ email: rest[1],
43973
+ userId: rest[2],
43974
+ phone: rest[3],
43975
+ url: rest[4],
43976
+ name: rest[5],
44468
43977
  };
44469
43978
  }
44470
43979
  const teamId = params.teamId;
44471
43980
  const roles = params.roles;
44472
- const membershipId = params.membershipId;
44473
43981
  const email = params.email;
44474
43982
  const userId = params.userId;
44475
43983
  const phone = params.phone;
@@ -44483,9 +43991,6 @@
44483
43991
  }
44484
43992
  const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', encodeURIComponent(String(teamId)));
44485
43993
  const apiPayload = {};
44486
- if (typeof membershipId !== 'undefined') {
44487
- apiPayload['membershipId'] = membershipId;
44488
- }
44489
43994
  if (typeof email !== 'undefined') {
44490
43995
  apiPayload['email'] = email;
44491
43996
  }
@@ -46371,6 +45876,47 @@
46371
45876
  };
46372
45877
  return this.client.call('get', uri, apiHeaders, apiPayload);
46373
45878
  }
45879
+ updatePasskey(paramsOrFirst, ...rest) {
45880
+ let params;
45881
+ if (paramsOrFirst &&
45882
+ typeof paramsOrFirst === 'object' &&
45883
+ !Array.isArray(paramsOrFirst)) {
45884
+ params = (paramsOrFirst || {});
45885
+ }
45886
+ else {
45887
+ params = {
45888
+ userId: paramsOrFirst,
45889
+ passkeyId: rest[0],
45890
+ name: rest[1],
45891
+ };
45892
+ }
45893
+ const userId = params.userId;
45894
+ const passkeyId = params.passkeyId;
45895
+ const name = params.name;
45896
+ if (typeof userId === 'undefined' || userId === '') {
45897
+ throw new AppwriteException('Missing required parameter: "userId"');
45898
+ }
45899
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
45900
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
45901
+ }
45902
+ if (typeof name === 'undefined') {
45903
+ throw new AppwriteException('Missing required parameter: "name"');
45904
+ }
45905
+ const apiPath = '/users/{userId}/passkeys/{passkeyId}'
45906
+ .replace('{userId}', encodeURIComponent(String(userId)))
45907
+ .replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
45908
+ const apiPayload = {};
45909
+ if (typeof name !== 'undefined') {
45910
+ apiPayload['name'] = name;
45911
+ }
45912
+ const uri = new URL(this.client.config.endpoint + apiPath);
45913
+ const apiHeaders = {
45914
+ 'X-Appwrite-Project': this.client.config.project,
45915
+ 'content-type': 'application/json',
45916
+ accept: 'application/json',
45917
+ };
45918
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
45919
+ }
46374
45920
  deletePasskey(paramsOrFirst, ...rest) {
46375
45921
  let params;
46376
45922
  if (paramsOrFirst &&
@@ -48910,11 +48456,11 @@
48910
48456
  }
48911
48457
  }
48912
48458
 
48913
- class Videos {
48459
+ class Waf {
48914
48460
  constructor(client) {
48915
48461
  this.client = client;
48916
48462
  }
48917
- list(paramsOrFirst, ...rest) {
48463
+ listRules(paramsOrFirst, ...rest) {
48918
48464
  let params;
48919
48465
  if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
48920
48466
  (paramsOrFirst &&
@@ -48932,7 +48478,7 @@
48932
48478
  const queries = params.queries;
48933
48479
  const search = params.search;
48934
48480
  const total = params.total;
48935
- const apiPath = '/videos';
48481
+ const apiPath = '/waf/rules';
48936
48482
  const apiPayload = {};
48937
48483
  if (typeof queries !== 'undefined') {
48938
48484
  apiPayload['queries'] = queries;
@@ -48950,7 +48496,7 @@
48950
48496
  };
48951
48497
  return this.client.call('get', uri, apiHeaders, apiPayload);
48952
48498
  }
48953
- create(paramsOrFirst, ...rest) {
48499
+ createBypassRule(paramsOrFirst, ...rest) {
48954
48500
  let params;
48955
48501
  if (paramsOrFirst &&
48956
48502
  typeof paramsOrFirst === 'object' &&
@@ -48959,31 +48505,59 @@
48959
48505
  }
48960
48506
  else {
48961
48507
  params = {
48962
- bucketId: paramsOrFirst,
48963
- fileId: rest[0],
48508
+ ruleId: paramsOrFirst,
48509
+ resourceType: rest[0],
48964
48510
  name: rest[1],
48511
+ resourceId: rest[2],
48512
+ description: rest[3],
48513
+ priority: rest[4],
48514
+ enabled: rest[5],
48515
+ conditions: rest[6],
48965
48516
  };
48966
48517
  }
48967
- const bucketId = params.bucketId;
48968
- const fileId = params.fileId;
48518
+ const ruleId = params.ruleId;
48519
+ const resourceType = params.resourceType;
48969
48520
  const name = params.name;
48970
- if (typeof bucketId === 'undefined') {
48971
- throw new AppwriteException('Missing required parameter: "bucketId"');
48521
+ const resourceId = params.resourceId;
48522
+ const description = params.description;
48523
+ const priority = params.priority;
48524
+ const enabled = params.enabled;
48525
+ const conditions = params.conditions;
48526
+ if (typeof ruleId === 'undefined') {
48527
+ throw new AppwriteException('Missing required parameter: "ruleId"');
48972
48528
  }
48973
- if (typeof fileId === 'undefined') {
48974
- throw new AppwriteException('Missing required parameter: "fileId"');
48529
+ if (typeof resourceType === 'undefined') {
48530
+ throw new AppwriteException('Missing required parameter: "resourceType"');
48531
+ }
48532
+ if (typeof name === 'undefined') {
48533
+ throw new AppwriteException('Missing required parameter: "name"');
48975
48534
  }
48976
- const apiPath = '/videos';
48535
+ const apiPath = '/waf/rules/bypass';
48977
48536
  const apiPayload = {};
48978
- if (typeof bucketId !== 'undefined') {
48979
- apiPayload['bucketId'] = bucketId;
48537
+ if (typeof ruleId !== 'undefined') {
48538
+ apiPayload['ruleId'] = ruleId;
48980
48539
  }
48981
- if (typeof fileId !== 'undefined') {
48982
- apiPayload['fileId'] = fileId;
48540
+ if (typeof resourceType !== 'undefined') {
48541
+ apiPayload['resourceType'] = resourceType;
48542
+ }
48543
+ if (typeof resourceId !== 'undefined') {
48544
+ apiPayload['resourceId'] = resourceId;
48983
48545
  }
48984
48546
  if (typeof name !== 'undefined') {
48985
48547
  apiPayload['name'] = name;
48986
48548
  }
48549
+ if (typeof description !== 'undefined') {
48550
+ apiPayload['description'] = description;
48551
+ }
48552
+ if (typeof priority !== 'undefined') {
48553
+ apiPayload['priority'] = priority;
48554
+ }
48555
+ if (typeof enabled !== 'undefined') {
48556
+ apiPayload['enabled'] = enabled;
48557
+ }
48558
+ if (typeof conditions !== 'undefined') {
48559
+ apiPayload['conditions'] = conditions;
48560
+ }
48987
48561
  const uri = new URL(this.client.config.endpoint + apiPath);
48988
48562
  const apiHeaders = {
48989
48563
  'X-Appwrite-Project': this.client.config.project,
@@ -48992,33 +48566,68 @@
48992
48566
  };
48993
48567
  return this.client.call('post', uri, apiHeaders, apiPayload);
48994
48568
  }
48995
- listProfiles(paramsOrFirst) {
48569
+ updateBypassRule(paramsOrFirst, ...rest) {
48996
48570
  let params;
48997
- if (typeof paramsOrFirst === 'undefined' ||
48998
- (paramsOrFirst &&
48999
- typeof paramsOrFirst === 'object' &&
49000
- !Array.isArray(paramsOrFirst))) {
48571
+ if (paramsOrFirst &&
48572
+ typeof paramsOrFirst === 'object' &&
48573
+ !Array.isArray(paramsOrFirst)) {
49001
48574
  params = (paramsOrFirst || {});
49002
48575
  }
49003
48576
  else {
49004
48577
  params = {
49005
- search: paramsOrFirst,
48578
+ ruleId: paramsOrFirst,
48579
+ resourceType: rest[0],
48580
+ resourceId: rest[1],
48581
+ name: rest[2],
48582
+ description: rest[3],
48583
+ priority: rest[4],
48584
+ enabled: rest[5],
48585
+ conditions: rest[6],
49006
48586
  };
49007
48587
  }
49008
- const search = params.search;
49009
- const apiPath = '/videos/profiles';
48588
+ const ruleId = params.ruleId;
48589
+ const resourceType = params.resourceType;
48590
+ const resourceId = params.resourceId;
48591
+ const name = params.name;
48592
+ const description = params.description;
48593
+ const priority = params.priority;
48594
+ const enabled = params.enabled;
48595
+ const conditions = params.conditions;
48596
+ if (typeof ruleId === 'undefined' || ruleId === '') {
48597
+ throw new AppwriteException('Missing required parameter: "ruleId"');
48598
+ }
48599
+ const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
49010
48600
  const apiPayload = {};
49011
- if (typeof search !== 'undefined') {
49012
- apiPayload['search'] = search;
48601
+ if (typeof resourceType !== 'undefined') {
48602
+ apiPayload['resourceType'] = resourceType;
48603
+ }
48604
+ if (typeof resourceId !== 'undefined') {
48605
+ apiPayload['resourceId'] = resourceId;
48606
+ }
48607
+ if (typeof name !== 'undefined') {
48608
+ apiPayload['name'] = name;
48609
+ }
48610
+ if (typeof description !== 'undefined') {
48611
+ apiPayload['description'] = description;
48612
+ }
48613
+ if (typeof priority !== 'undefined') {
48614
+ apiPayload['priority'] = priority;
48615
+ }
48616
+ if (typeof enabled !== 'undefined') {
48617
+ apiPayload['enabled'] = enabled;
48618
+ }
48619
+ if (typeof conditions !== 'undefined') {
48620
+ apiPayload['conditions'] = conditions;
49013
48621
  }
49014
48622
  const uri = new URL(this.client.config.endpoint + apiPath);
49015
48623
  const apiHeaders = {
49016
48624
  'X-Appwrite-Project': this.client.config.project,
48625
+ 'content-type': 'application/json',
49017
48626
  accept: 'application/json',
49018
48627
  };
49019
- return this.client.call('get', uri, apiHeaders, apiPayload);
48628
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
49020
48629
  }
49021
- createProfile(paramsOrFirst, ...rest) {
48630
+ createChallengeRule(paramsOrFirst, ...rest) {
49022
48631
  let params;
49023
48632
  if (paramsOrFirst &&
49024
48633
  typeof paramsOrFirst === 'object' &&
@@ -49027,49 +48636,73 @@
49027
48636
  }
49028
48637
  else {
49029
48638
  params = {
49030
- name: paramsOrFirst,
49031
- videoBitRate: rest[0],
49032
- audioBitRate: rest[1],
49033
- width: rest[2],
49034
- height: rest[3],
48639
+ ruleId: paramsOrFirst,
48640
+ resourceType: rest[0],
48641
+ name: rest[1],
48642
+ resourceId: rest[2],
48643
+ description: rest[3],
48644
+ challengeType: rest[4],
48645
+ priority: rest[5],
48646
+ enabled: rest[6],
48647
+ conditions: rest[7],
48648
+ difficulty: rest[8],
48649
+ ttl: rest[9],
49035
48650
  };
49036
48651
  }
48652
+ const ruleId = params.ruleId;
48653
+ const resourceType = params.resourceType;
49037
48654
  const name = params.name;
49038
- const videoBitRate = params.videoBitRate;
49039
- const audioBitRate = params.audioBitRate;
49040
- const width = params.width;
49041
- const height = params.height;
48655
+ const resourceId = params.resourceId;
48656
+ const description = params.description;
48657
+ const challengeType = params.challengeType;
48658
+ const priority = params.priority;
48659
+ const enabled = params.enabled;
48660
+ const conditions = params.conditions;
48661
+ const difficulty = params.difficulty;
48662
+ const ttl = params.ttl;
48663
+ if (typeof ruleId === 'undefined') {
48664
+ throw new AppwriteException('Missing required parameter: "ruleId"');
48665
+ }
48666
+ if (typeof resourceType === 'undefined') {
48667
+ throw new AppwriteException('Missing required parameter: "resourceType"');
48668
+ }
49042
48669
  if (typeof name === 'undefined') {
49043
48670
  throw new AppwriteException('Missing required parameter: "name"');
49044
48671
  }
49045
- if (typeof videoBitRate === 'undefined') {
49046
- throw new AppwriteException('Missing required parameter: "videoBitRate"');
49047
- }
49048
- if (typeof audioBitRate === 'undefined') {
49049
- throw new AppwriteException('Missing required parameter: "audioBitRate"');
48672
+ const apiPath = '/waf/rules/challenge';
48673
+ const apiPayload = {};
48674
+ if (typeof ruleId !== 'undefined') {
48675
+ apiPayload['ruleId'] = ruleId;
49050
48676
  }
49051
- if (typeof width === 'undefined') {
49052
- throw new AppwriteException('Missing required parameter: "width"');
48677
+ if (typeof resourceType !== 'undefined') {
48678
+ apiPayload['resourceType'] = resourceType;
49053
48679
  }
49054
- if (typeof height === 'undefined') {
49055
- throw new AppwriteException('Missing required parameter: "height"');
48680
+ if (typeof resourceId !== 'undefined') {
48681
+ apiPayload['resourceId'] = resourceId;
49056
48682
  }
49057
- const apiPath = '/videos/profiles';
49058
- const apiPayload = {};
49059
48683
  if (typeof name !== 'undefined') {
49060
48684
  apiPayload['name'] = name;
49061
48685
  }
49062
- if (typeof videoBitRate !== 'undefined') {
49063
- apiPayload['videoBitRate'] = videoBitRate;
48686
+ if (typeof description !== 'undefined') {
48687
+ apiPayload['description'] = description;
49064
48688
  }
49065
- if (typeof audioBitRate !== 'undefined') {
49066
- apiPayload['audioBitRate'] = audioBitRate;
48689
+ if (typeof challengeType !== 'undefined') {
48690
+ apiPayload['challengeType'] = challengeType;
49067
48691
  }
49068
- if (typeof width !== 'undefined') {
49069
- apiPayload['width'] = width;
48692
+ if (typeof priority !== 'undefined') {
48693
+ apiPayload['priority'] = priority;
49070
48694
  }
49071
- if (typeof height !== 'undefined') {
49072
- apiPayload['height'] = height;
48695
+ if (typeof enabled !== 'undefined') {
48696
+ apiPayload['enabled'] = enabled;
48697
+ }
48698
+ if (typeof conditions !== 'undefined') {
48699
+ apiPayload['conditions'] = conditions;
48700
+ }
48701
+ if (typeof difficulty !== 'undefined') {
48702
+ apiPayload['difficulty'] = difficulty;
48703
+ }
48704
+ if (typeof ttl !== 'undefined') {
48705
+ apiPayload['ttl'] = ttl;
49073
48706
  }
49074
48707
  const uri = new URL(this.client.config.endpoint + apiPath);
49075
48708
  const apiHeaders = {
@@ -49079,7 +48712,7 @@
49079
48712
  };
49080
48713
  return this.client.call('post', uri, apiHeaders, apiPayload);
49081
48714
  }
49082
- getProfile(paramsOrFirst) {
48715
+ updateChallengeRule(paramsOrFirst, ...rest) {
49083
48716
  let params;
49084
48717
  if (paramsOrFirst &&
49085
48718
  typeof paramsOrFirst === 'object' &&
@@ -49088,23 +48721,74 @@
49088
48721
  }
49089
48722
  else {
49090
48723
  params = {
49091
- profileId: paramsOrFirst,
48724
+ ruleId: paramsOrFirst,
48725
+ resourceType: rest[0],
48726
+ resourceId: rest[1],
48727
+ name: rest[2],
48728
+ description: rest[3],
48729
+ challengeType: rest[4],
48730
+ priority: rest[5],
48731
+ enabled: rest[6],
48732
+ conditions: rest[7],
48733
+ difficulty: rest[8],
48734
+ ttl: rest[9],
49092
48735
  };
49093
48736
  }
49094
- const profileId = params.profileId;
49095
- if (typeof profileId === 'undefined' || profileId === '') {
49096
- throw new AppwriteException('Missing required parameter: "profileId"');
48737
+ const ruleId = params.ruleId;
48738
+ const resourceType = params.resourceType;
48739
+ const resourceId = params.resourceId;
48740
+ const name = params.name;
48741
+ const description = params.description;
48742
+ const challengeType = params.challengeType;
48743
+ const priority = params.priority;
48744
+ const enabled = params.enabled;
48745
+ const conditions = params.conditions;
48746
+ const difficulty = params.difficulty;
48747
+ const ttl = params.ttl;
48748
+ if (typeof ruleId === 'undefined' || ruleId === '') {
48749
+ throw new AppwriteException('Missing required parameter: "ruleId"');
49097
48750
  }
49098
- const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
48751
+ const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
49099
48752
  const apiPayload = {};
48753
+ if (typeof resourceType !== 'undefined') {
48754
+ apiPayload['resourceType'] = resourceType;
48755
+ }
48756
+ if (typeof resourceId !== 'undefined') {
48757
+ apiPayload['resourceId'] = resourceId;
48758
+ }
48759
+ if (typeof name !== 'undefined') {
48760
+ apiPayload['name'] = name;
48761
+ }
48762
+ if (typeof description !== 'undefined') {
48763
+ apiPayload['description'] = description;
48764
+ }
48765
+ if (typeof challengeType !== 'undefined') {
48766
+ apiPayload['challengeType'] = challengeType;
48767
+ }
48768
+ if (typeof priority !== 'undefined') {
48769
+ apiPayload['priority'] = priority;
48770
+ }
48771
+ if (typeof enabled !== 'undefined') {
48772
+ apiPayload['enabled'] = enabled;
48773
+ }
48774
+ if (typeof conditions !== 'undefined') {
48775
+ apiPayload['conditions'] = conditions;
48776
+ }
48777
+ if (typeof difficulty !== 'undefined') {
48778
+ apiPayload['difficulty'] = difficulty;
48779
+ }
48780
+ if (typeof ttl !== 'undefined') {
48781
+ apiPayload['ttl'] = ttl;
48782
+ }
49100
48783
  const uri = new URL(this.client.config.endpoint + apiPath);
49101
48784
  const apiHeaders = {
49102
48785
  'X-Appwrite-Project': this.client.config.project,
48786
+ 'content-type': 'application/json',
49103
48787
  accept: 'application/json',
49104
48788
  };
49105
- return this.client.call('get', uri, apiHeaders, apiPayload);
48789
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
49106
48790
  }
49107
- updateProfile(paramsOrFirst, ...rest) {
48791
+ createDenyRule(paramsOrFirst, ...rest) {
49108
48792
  let params;
49109
48793
  if (paramsOrFirst &&
49110
48794
  typeof paramsOrFirst === 'object' &&
@@ -49113,54 +48797,58 @@
49113
48797
  }
49114
48798
  else {
49115
48799
  params = {
49116
- profileId: paramsOrFirst,
49117
- name: rest[0],
49118
- videoBitRate: rest[1],
49119
- audioBitRate: rest[2],
49120
- width: rest[3],
49121
- height: rest[4],
48800
+ ruleId: paramsOrFirst,
48801
+ resourceType: rest[0],
48802
+ name: rest[1],
48803
+ resourceId: rest[2],
48804
+ description: rest[3],
48805
+ priority: rest[4],
48806
+ enabled: rest[5],
48807
+ conditions: rest[6],
49122
48808
  };
49123
48809
  }
49124
- const profileId = params.profileId;
48810
+ const ruleId = params.ruleId;
48811
+ const resourceType = params.resourceType;
49125
48812
  const name = params.name;
49126
- const videoBitRate = params.videoBitRate;
49127
- const audioBitRate = params.audioBitRate;
49128
- const width = params.width;
49129
- const height = params.height;
49130
- if (typeof profileId === 'undefined' || profileId === '') {
49131
- throw new AppwriteException('Missing required parameter: "profileId"');
48813
+ const resourceId = params.resourceId;
48814
+ const description = params.description;
48815
+ const priority = params.priority;
48816
+ const enabled = params.enabled;
48817
+ const conditions = params.conditions;
48818
+ if (typeof ruleId === 'undefined') {
48819
+ throw new AppwriteException('Missing required parameter: "ruleId"');
48820
+ }
48821
+ if (typeof resourceType === 'undefined') {
48822
+ throw new AppwriteException('Missing required parameter: "resourceType"');
49132
48823
  }
49133
48824
  if (typeof name === 'undefined') {
49134
48825
  throw new AppwriteException('Missing required parameter: "name"');
49135
48826
  }
49136
- if (typeof videoBitRate === 'undefined') {
49137
- throw new AppwriteException('Missing required parameter: "videoBitRate"');
49138
- }
49139
- if (typeof audioBitRate === 'undefined') {
49140
- throw new AppwriteException('Missing required parameter: "audioBitRate"');
48827
+ const apiPath = '/waf/rules/deny';
48828
+ const apiPayload = {};
48829
+ if (typeof ruleId !== 'undefined') {
48830
+ apiPayload['ruleId'] = ruleId;
49141
48831
  }
49142
- if (typeof width === 'undefined') {
49143
- throw new AppwriteException('Missing required parameter: "width"');
48832
+ if (typeof resourceType !== 'undefined') {
48833
+ apiPayload['resourceType'] = resourceType;
49144
48834
  }
49145
- if (typeof height === 'undefined') {
49146
- throw new AppwriteException('Missing required parameter: "height"');
48835
+ if (typeof resourceId !== 'undefined') {
48836
+ apiPayload['resourceId'] = resourceId;
49147
48837
  }
49148
- const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
49149
- const apiPayload = {};
49150
48838
  if (typeof name !== 'undefined') {
49151
48839
  apiPayload['name'] = name;
49152
48840
  }
49153
- if (typeof videoBitRate !== 'undefined') {
49154
- apiPayload['videoBitRate'] = videoBitRate;
48841
+ if (typeof description !== 'undefined') {
48842
+ apiPayload['description'] = description;
49155
48843
  }
49156
- if (typeof audioBitRate !== 'undefined') {
49157
- apiPayload['audioBitRate'] = audioBitRate;
48844
+ if (typeof priority !== 'undefined') {
48845
+ apiPayload['priority'] = priority;
49158
48846
  }
49159
- if (typeof width !== 'undefined') {
49160
- apiPayload['width'] = width;
48847
+ if (typeof enabled !== 'undefined') {
48848
+ apiPayload['enabled'] = enabled;
49161
48849
  }
49162
- if (typeof height !== 'undefined') {
49163
- apiPayload['height'] = height;
48850
+ if (typeof conditions !== 'undefined') {
48851
+ apiPayload['conditions'] = conditions;
49164
48852
  }
49165
48853
  const uri = new URL(this.client.config.endpoint + apiPath);
49166
48854
  const apiHeaders = {
@@ -49168,9 +48856,9 @@
49168
48856
  'content-type': 'application/json',
49169
48857
  accept: 'application/json',
49170
48858
  };
49171
- return this.client.call('patch', uri, apiHeaders, apiPayload);
48859
+ return this.client.call('post', uri, apiHeaders, apiPayload);
49172
48860
  }
49173
- deleteProfile(paramsOrFirst) {
48861
+ updateDenyRule(paramsOrFirst, ...rest) {
49174
48862
  let params;
49175
48863
  if (paramsOrFirst &&
49176
48864
  typeof paramsOrFirst === 'object' &&
@@ -49179,49 +48867,59 @@
49179
48867
  }
49180
48868
  else {
49181
48869
  params = {
49182
- profileId: paramsOrFirst,
48870
+ ruleId: paramsOrFirst,
48871
+ resourceType: rest[0],
48872
+ resourceId: rest[1],
48873
+ name: rest[2],
48874
+ description: rest[3],
48875
+ priority: rest[4],
48876
+ enabled: rest[5],
48877
+ conditions: rest[6],
49183
48878
  };
49184
48879
  }
49185
- const profileId = params.profileId;
49186
- if (typeof profileId === 'undefined' || profileId === '') {
49187
- throw new AppwriteException('Missing required parameter: "profileId"');
48880
+ const ruleId = params.ruleId;
48881
+ const resourceType = params.resourceType;
48882
+ const resourceId = params.resourceId;
48883
+ const name = params.name;
48884
+ const description = params.description;
48885
+ const priority = params.priority;
48886
+ const enabled = params.enabled;
48887
+ const conditions = params.conditions;
48888
+ if (typeof ruleId === 'undefined' || ruleId === '') {
48889
+ throw new AppwriteException('Missing required parameter: "ruleId"');
49188
48890
  }
49189
- const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
48891
+ const apiPath = '/waf/rules/deny/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
49190
48892
  const apiPayload = {};
49191
- const uri = new URL(this.client.config.endpoint + apiPath);
49192
- const apiHeaders = {
49193
- 'X-Appwrite-Project': this.client.config.project,
49194
- 'content-type': 'application/json',
49195
- accept: 'application/json',
49196
- };
49197
- return this.client.call('delete', uri, apiHeaders, apiPayload);
49198
- }
49199
- get(paramsOrFirst) {
49200
- let params;
49201
- if (paramsOrFirst &&
49202
- typeof paramsOrFirst === 'object' &&
49203
- !Array.isArray(paramsOrFirst)) {
49204
- params = (paramsOrFirst || {});
48893
+ if (typeof resourceType !== 'undefined') {
48894
+ apiPayload['resourceType'] = resourceType;
49205
48895
  }
49206
- else {
49207
- params = {
49208
- videoId: paramsOrFirst,
49209
- };
48896
+ if (typeof resourceId !== 'undefined') {
48897
+ apiPayload['resourceId'] = resourceId;
49210
48898
  }
49211
- const videoId = params.videoId;
49212
- if (typeof videoId === 'undefined' || videoId === '') {
49213
- throw new AppwriteException('Missing required parameter: "videoId"');
48899
+ if (typeof name !== 'undefined') {
48900
+ apiPayload['name'] = name;
48901
+ }
48902
+ if (typeof description !== 'undefined') {
48903
+ apiPayload['description'] = description;
48904
+ }
48905
+ if (typeof priority !== 'undefined') {
48906
+ apiPayload['priority'] = priority;
48907
+ }
48908
+ if (typeof enabled !== 'undefined') {
48909
+ apiPayload['enabled'] = enabled;
48910
+ }
48911
+ if (typeof conditions !== 'undefined') {
48912
+ apiPayload['conditions'] = conditions;
49214
48913
  }
49215
- const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
49216
- const apiPayload = {};
49217
48914
  const uri = new URL(this.client.config.endpoint + apiPath);
49218
48915
  const apiHeaders = {
49219
48916
  'X-Appwrite-Project': this.client.config.project,
48917
+ 'content-type': 'application/json',
49220
48918
  accept: 'application/json',
49221
48919
  };
49222
- return this.client.call('get', uri, apiHeaders, apiPayload);
48920
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
49223
48921
  }
49224
- update(paramsOrFirst, ...rest) {
48922
+ createRateLimitRule(paramsOrFirst, ...rest) {
49225
48923
  let params;
49226
48924
  if (paramsOrFirst &&
49227
48925
  typeof paramsOrFirst === 'object' &&
@@ -49230,58 +48928,99 @@
49230
48928
  }
49231
48929
  else {
49232
48930
  params = {
49233
- videoId: paramsOrFirst,
49234
- name: rest[0],
48931
+ ruleId: paramsOrFirst,
48932
+ resourceType: rest[0],
48933
+ name: rest[1],
48934
+ limit: rest[2],
48935
+ interval: rest[3],
48936
+ resourceId: rest[4],
48937
+ description: rest[5],
48938
+ key: rest[6],
48939
+ strategy: rest[7],
48940
+ maxBucketSize: rest[8],
48941
+ priority: rest[9],
48942
+ enabled: rest[10],
48943
+ conditions: rest[11],
49235
48944
  };
49236
48945
  }
49237
- const videoId = params.videoId;
48946
+ const ruleId = params.ruleId;
48947
+ const resourceType = params.resourceType;
49238
48948
  const name = params.name;
49239
- if (typeof videoId === 'undefined' || videoId === '') {
49240
- throw new AppwriteException('Missing required parameter: "videoId"');
48949
+ const limit = params.limit;
48950
+ const interval = params.interval;
48951
+ const resourceId = params.resourceId;
48952
+ const description = params.description;
48953
+ const key = params.key;
48954
+ const strategy = params.strategy;
48955
+ const maxBucketSize = params.maxBucketSize;
48956
+ const priority = params.priority;
48957
+ const enabled = params.enabled;
48958
+ const conditions = params.conditions;
48959
+ if (typeof ruleId === 'undefined') {
48960
+ throw new AppwriteException('Missing required parameter: "ruleId"');
48961
+ }
48962
+ if (typeof resourceType === 'undefined') {
48963
+ throw new AppwriteException('Missing required parameter: "resourceType"');
49241
48964
  }
49242
48965
  if (typeof name === 'undefined') {
49243
48966
  throw new AppwriteException('Missing required parameter: "name"');
49244
48967
  }
49245
- const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
48968
+ if (typeof limit === 'undefined') {
48969
+ throw new AppwriteException('Missing required parameter: "limit"');
48970
+ }
48971
+ if (typeof interval === 'undefined') {
48972
+ throw new AppwriteException('Missing required parameter: "interval"');
48973
+ }
48974
+ const apiPath = '/waf/rules/rate-limit';
49246
48975
  const apiPayload = {};
48976
+ if (typeof ruleId !== 'undefined') {
48977
+ apiPayload['ruleId'] = ruleId;
48978
+ }
48979
+ if (typeof resourceType !== 'undefined') {
48980
+ apiPayload['resourceType'] = resourceType;
48981
+ }
48982
+ if (typeof resourceId !== 'undefined') {
48983
+ apiPayload['resourceId'] = resourceId;
48984
+ }
49247
48985
  if (typeof name !== 'undefined') {
49248
48986
  apiPayload['name'] = name;
49249
48987
  }
49250
- const uri = new URL(this.client.config.endpoint + apiPath);
49251
- const apiHeaders = {
49252
- 'X-Appwrite-Project': this.client.config.project,
49253
- 'content-type': 'application/json',
49254
- accept: 'application/json',
49255
- };
49256
- return this.client.call('put', uri, apiHeaders, apiPayload);
49257
- }
49258
- delete(paramsOrFirst) {
49259
- let params;
49260
- if (paramsOrFirst &&
49261
- typeof paramsOrFirst === 'object' &&
49262
- !Array.isArray(paramsOrFirst)) {
49263
- params = (paramsOrFirst || {});
48988
+ if (typeof description !== 'undefined') {
48989
+ apiPayload['description'] = description;
49264
48990
  }
49265
- else {
49266
- params = {
49267
- videoId: paramsOrFirst,
49268
- };
48991
+ if (typeof limit !== 'undefined') {
48992
+ apiPayload['limit'] = limit;
49269
48993
  }
49270
- const videoId = params.videoId;
49271
- if (typeof videoId === 'undefined' || videoId === '') {
49272
- throw new AppwriteException('Missing required parameter: "videoId"');
48994
+ if (typeof interval !== 'undefined') {
48995
+ apiPayload['interval'] = interval;
48996
+ }
48997
+ if (typeof key !== 'undefined') {
48998
+ apiPayload['key'] = key;
48999
+ }
49000
+ if (typeof strategy !== 'undefined') {
49001
+ apiPayload['strategy'] = strategy;
49002
+ }
49003
+ if (typeof maxBucketSize !== 'undefined') {
49004
+ apiPayload['maxBucketSize'] = maxBucketSize;
49005
+ }
49006
+ if (typeof priority !== 'undefined') {
49007
+ apiPayload['priority'] = priority;
49008
+ }
49009
+ if (typeof enabled !== 'undefined') {
49010
+ apiPayload['enabled'] = enabled;
49011
+ }
49012
+ if (typeof conditions !== 'undefined') {
49013
+ apiPayload['conditions'] = conditions;
49273
49014
  }
49274
- const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
49275
- const apiPayload = {};
49276
49015
  const uri = new URL(this.client.config.endpoint + apiPath);
49277
49016
  const apiHeaders = {
49278
49017
  'X-Appwrite-Project': this.client.config.project,
49279
49018
  'content-type': 'application/json',
49280
49019
  accept: 'application/json',
49281
49020
  };
49282
- return this.client.call('delete', uri, apiHeaders, apiPayload);
49021
+ return this.client.call('post', uri, apiHeaders, apiPayload);
49283
49022
  }
49284
- getCmafHlsManifest(paramsOrFirst) {
49023
+ updateRateLimitRule(paramsOrFirst, ...rest) {
49285
49024
  let params;
49286
49025
  if (paramsOrFirst &&
49287
49026
  typeof paramsOrFirst === 'object' &&
@@ -49290,1341 +49029,18 @@
49290
49029
  }
49291
49030
  else {
49292
49031
  params = {
49293
- videoId: paramsOrFirst,
49294
- };
49295
- }
49296
- const videoId = params.videoId;
49297
- if (typeof videoId === 'undefined' || videoId === '') {
49298
- throw new AppwriteException('Missing required parameter: "videoId"');
49299
- }
49300
- const apiPath = '/videos/{videoId}/outputs/cmaf/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
49301
- const apiPayload = {};
49302
- const uri = new URL(this.client.config.endpoint + apiPath);
49303
- apiPayload['project'] = this.client.config.project;
49304
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49305
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49306
- uri.searchParams.append(key, value);
49307
- }
49308
- return uri.toString();
49309
- }
49310
- getCmafDashManifest(paramsOrFirst) {
49311
- let params;
49312
- if (paramsOrFirst &&
49313
- typeof paramsOrFirst === 'object' &&
49314
- !Array.isArray(paramsOrFirst)) {
49315
- params = (paramsOrFirst || {});
49316
- }
49317
- else {
49318
- params = {
49319
- videoId: paramsOrFirst,
49320
- };
49321
- }
49322
- const videoId = params.videoId;
49323
- if (typeof videoId === 'undefined' || videoId === '') {
49324
- throw new AppwriteException('Missing required parameter: "videoId"');
49325
- }
49326
- const apiPath = '/videos/{videoId}/outputs/cmaf/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
49327
- const apiPayload = {};
49328
- const uri = new URL(this.client.config.endpoint + apiPath);
49329
- apiPayload['project'] = this.client.config.project;
49330
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49331
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49332
- uri.searchParams.append(key, value);
49333
- }
49334
- return uri.toString();
49335
- }
49336
- getCmafStreamManifest(paramsOrFirst, ...rest) {
49337
- let params;
49338
- if (paramsOrFirst &&
49339
- typeof paramsOrFirst === 'object' &&
49340
- !Array.isArray(paramsOrFirst)) {
49341
- params = (paramsOrFirst || {});
49342
- }
49343
- else {
49344
- params = {
49345
- videoId: paramsOrFirst,
49346
- renditionId: rest[0],
49347
- streamId: rest[1],
49348
- };
49349
- }
49350
- const videoId = params.videoId;
49351
- const renditionId = params.renditionId;
49352
- const streamId = params.streamId;
49353
- if (typeof videoId === 'undefined' || videoId === '') {
49354
- throw new AppwriteException('Missing required parameter: "videoId"');
49355
- }
49356
- if (typeof renditionId === 'undefined' || renditionId === '') {
49357
- throw new AppwriteException('Missing required parameter: "renditionId"');
49358
- }
49359
- if (typeof streamId === 'undefined') {
49360
- throw new AppwriteException('Missing required parameter: "streamId"');
49361
- }
49362
- const apiPath = '/videos/{videoId}/outputs/cmaf/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
49363
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49364
- .replace('{renditionId}', encodeURIComponent(String(renditionId)))
49365
- .replace('{streamId}', encodeURIComponent(String(streamId)));
49366
- const apiPayload = {};
49367
- const uri = new URL(this.client.config.endpoint + apiPath);
49368
- apiPayload['project'] = this.client.config.project;
49369
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49370
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49371
- uri.searchParams.append(key, value);
49372
- }
49373
- return uri.toString();
49374
- }
49375
- getDashManifest(paramsOrFirst) {
49376
- let params;
49377
- if (paramsOrFirst &&
49378
- typeof paramsOrFirst === 'object' &&
49379
- !Array.isArray(paramsOrFirst)) {
49380
- params = (paramsOrFirst || {});
49381
- }
49382
- else {
49383
- params = {
49384
- videoId: paramsOrFirst,
49385
- };
49386
- }
49387
- const videoId = params.videoId;
49388
- if (typeof videoId === 'undefined' || videoId === '') {
49389
- throw new AppwriteException('Missing required parameter: "videoId"');
49390
- }
49391
- const apiPath = '/videos/{videoId}/outputs/dash/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
49392
- const apiPayload = {};
49393
- const uri = new URL(this.client.config.endpoint + apiPath);
49394
- apiPayload['project'] = this.client.config.project;
49395
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49396
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49397
- uri.searchParams.append(key, value);
49398
- }
49399
- return uri.toString();
49400
- }
49401
- getHlsManifest(paramsOrFirst) {
49402
- let params;
49403
- if (paramsOrFirst &&
49404
- typeof paramsOrFirst === 'object' &&
49405
- !Array.isArray(paramsOrFirst)) {
49406
- params = (paramsOrFirst || {});
49407
- }
49408
- else {
49409
- params = {
49410
- videoId: paramsOrFirst,
49411
- };
49412
- }
49413
- const videoId = params.videoId;
49414
- if (typeof videoId === 'undefined' || videoId === '') {
49415
- throw new AppwriteException('Missing required parameter: "videoId"');
49416
- }
49417
- const apiPath = '/videos/{videoId}/outputs/hls/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
49418
- const apiPayload = {};
49419
- const uri = new URL(this.client.config.endpoint + apiPath);
49420
- apiPayload['project'] = this.client.config.project;
49421
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49422
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49423
- uri.searchParams.append(key, value);
49424
- }
49425
- return uri.toString();
49426
- }
49427
- getStreamManifest(paramsOrFirst, ...rest) {
49428
- let params;
49429
- if (paramsOrFirst &&
49430
- typeof paramsOrFirst === 'object' &&
49431
- !Array.isArray(paramsOrFirst)) {
49432
- params = (paramsOrFirst || {});
49433
- }
49434
- else {
49435
- params = {
49436
- videoId: paramsOrFirst,
49437
- renditionId: rest[0],
49438
- streamId: rest[1],
49439
- };
49440
- }
49441
- const videoId = params.videoId;
49442
- const renditionId = params.renditionId;
49443
- const streamId = params.streamId;
49444
- if (typeof videoId === 'undefined' || videoId === '') {
49445
- throw new AppwriteException('Missing required parameter: "videoId"');
49446
- }
49447
- if (typeof renditionId === 'undefined' || renditionId === '') {
49448
- throw new AppwriteException('Missing required parameter: "renditionId"');
49449
- }
49450
- if (typeof streamId === 'undefined') {
49451
- throw new AppwriteException('Missing required parameter: "streamId"');
49452
- }
49453
- const apiPath = '/videos/{videoId}/outputs/hls/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
49454
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49455
- .replace('{renditionId}', encodeURIComponent(String(renditionId)))
49456
- .replace('{streamId}', encodeURIComponent(String(streamId)));
49457
- const apiPayload = {};
49458
- const uri = new URL(this.client.config.endpoint + apiPath);
49459
- apiPayload['project'] = this.client.config.project;
49460
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49461
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49462
- uri.searchParams.append(key, value);
49463
- }
49464
- return uri.toString();
49465
- }
49466
- getSegment(paramsOrFirst, ...rest) {
49467
- let params;
49468
- if (paramsOrFirst &&
49469
- typeof paramsOrFirst === 'object' &&
49470
- !Array.isArray(paramsOrFirst)) {
49471
- params = (paramsOrFirst || {});
49472
- }
49473
- else {
49474
- params = {
49475
- videoId: paramsOrFirst,
49476
- output: rest[0],
49477
- renditionId: rest[1],
49478
- segmentId: rest[2],
49479
- };
49480
- }
49481
- const videoId = params.videoId;
49482
- const output = params.output;
49483
- const renditionId = params.renditionId;
49484
- const segmentId = params.segmentId;
49485
- if (typeof videoId === 'undefined' || videoId === '') {
49486
- throw new AppwriteException('Missing required parameter: "videoId"');
49487
- }
49488
- if (typeof output === 'undefined') {
49489
- throw new AppwriteException('Missing required parameter: "output"');
49490
- }
49491
- if (typeof renditionId === 'undefined' || renditionId === '') {
49492
- throw new AppwriteException('Missing required parameter: "renditionId"');
49493
- }
49494
- if (typeof segmentId === 'undefined' || segmentId === '') {
49495
- throw new AppwriteException('Missing required parameter: "segmentId"');
49496
- }
49497
- const apiPath = '/videos/{videoId}/outputs/{output}/renditions/{renditionId}/segments/{segmentId}'
49498
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49499
- .replace('{output}', encodeURIComponent(String(output)))
49500
- .replace('{renditionId}', encodeURIComponent(String(renditionId)))
49501
- .replace('{segmentId}', encodeURIComponent(String(segmentId)));
49502
- const apiPayload = {};
49503
- const uri = new URL(this.client.config.endpoint + apiPath);
49504
- apiPayload['project'] = this.client.config.project;
49505
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49506
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49507
- uri.searchParams.append(key, value);
49508
- }
49509
- return uri.toString();
49510
- }
49511
- getSubtitleManifest(paramsOrFirst, ...rest) {
49512
- let params;
49513
- if (paramsOrFirst &&
49514
- typeof paramsOrFirst === 'object' &&
49515
- !Array.isArray(paramsOrFirst)) {
49516
- params = (paramsOrFirst || {});
49517
- }
49518
- else {
49519
- params = {
49520
- videoId: paramsOrFirst,
49521
- output: rest[0],
49522
- subtitleId: rest[1],
49523
- };
49524
- }
49525
- const videoId = params.videoId;
49526
- const output = params.output;
49527
- const subtitleId = params.subtitleId;
49528
- if (typeof videoId === 'undefined' || videoId === '') {
49529
- throw new AppwriteException('Missing required parameter: "videoId"');
49530
- }
49531
- if (typeof output === 'undefined') {
49532
- throw new AppwriteException('Missing required parameter: "output"');
49533
- }
49534
- if (typeof subtitleId === 'undefined' || subtitleId === '') {
49535
- throw new AppwriteException('Missing required parameter: "subtitleId"');
49536
- }
49537
- const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/manifest'
49538
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49539
- .replace('{output}', encodeURIComponent(String(output)))
49540
- .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
49541
- const apiPayload = {};
49542
- const uri = new URL(this.client.config.endpoint + apiPath);
49543
- apiPayload['project'] = this.client.config.project;
49544
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49545
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49546
- uri.searchParams.append(key, value);
49547
- }
49548
- return uri.toString();
49549
- }
49550
- getSubtitleSegment(paramsOrFirst, ...rest) {
49551
- let params;
49552
- if (paramsOrFirst &&
49553
- typeof paramsOrFirst === 'object' &&
49554
- !Array.isArray(paramsOrFirst)) {
49555
- params = (paramsOrFirst || {});
49556
- }
49557
- else {
49558
- params = {
49559
- videoId: paramsOrFirst,
49560
- output: rest[0],
49561
- subtitleId: rest[1],
49562
- segmentId: rest[2],
49563
- };
49564
- }
49565
- const videoId = params.videoId;
49566
- const output = params.output;
49567
- const subtitleId = params.subtitleId;
49568
- const segmentId = params.segmentId;
49569
- if (typeof videoId === 'undefined' || videoId === '') {
49570
- throw new AppwriteException('Missing required parameter: "videoId"');
49571
- }
49572
- if (typeof output === 'undefined') {
49573
- throw new AppwriteException('Missing required parameter: "output"');
49574
- }
49575
- if (typeof subtitleId === 'undefined' || subtitleId === '') {
49576
- throw new AppwriteException('Missing required parameter: "subtitleId"');
49577
- }
49578
- if (typeof segmentId === 'undefined' || segmentId === '') {
49579
- throw new AppwriteException('Missing required parameter: "segmentId"');
49580
- }
49581
- const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/segments/{segmentId}'
49582
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49583
- .replace('{output}', encodeURIComponent(String(output)))
49584
- .replace('{subtitleId}', encodeURIComponent(String(subtitleId)))
49585
- .replace('{segmentId}', encodeURIComponent(String(segmentId)));
49586
- const apiPayload = {};
49587
- const uri = new URL(this.client.config.endpoint + apiPath);
49588
- apiPayload['project'] = this.client.config.project;
49589
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49590
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49591
- uri.searchParams.append(key, value);
49592
- }
49593
- return uri.toString();
49594
- }
49595
- getPreview(paramsOrFirst, ...rest) {
49596
- let params;
49597
- if (paramsOrFirst &&
49598
- typeof paramsOrFirst === 'object' &&
49599
- !Array.isArray(paramsOrFirst)) {
49600
- params = (paramsOrFirst || {});
49601
- }
49602
- else {
49603
- params = {
49604
- videoId: paramsOrFirst,
49605
- previewId: rest[0],
49606
- width: rest[1],
49607
- height: rest[2],
49608
- output: rest[3],
49609
- };
49610
- }
49611
- const videoId = params.videoId;
49612
- const previewId = params.previewId;
49613
- const width = params.width;
49614
- const height = params.height;
49615
- const output = params.output;
49616
- if (typeof videoId === 'undefined' || videoId === '') {
49617
- throw new AppwriteException('Missing required parameter: "videoId"');
49618
- }
49619
- if (typeof previewId === 'undefined' || previewId === '') {
49620
- throw new AppwriteException('Missing required parameter: "previewId"');
49621
- }
49622
- const apiPath = '/videos/{videoId}/previews/{previewId}'
49623
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49624
- .replace('{previewId}', encodeURIComponent(String(previewId)));
49625
- const apiPayload = {};
49626
- if (typeof width !== 'undefined') {
49627
- apiPayload['width'] = width;
49628
- }
49629
- if (typeof height !== 'undefined') {
49630
- apiPayload['height'] = height;
49631
- }
49632
- if (typeof output !== 'undefined') {
49633
- apiPayload['output'] = output;
49634
- }
49635
- const uri = new URL(this.client.config.endpoint + apiPath);
49636
- apiPayload['project'] = this.client.config.project;
49637
- apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
49638
- for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
49639
- uri.searchParams.append(key, value);
49640
- }
49641
- return uri.toString();
49642
- }
49643
- listRenditions(paramsOrFirst, ...rest) {
49644
- let params;
49645
- if (paramsOrFirst &&
49646
- typeof paramsOrFirst === 'object' &&
49647
- !Array.isArray(paramsOrFirst)) {
49648
- params = (paramsOrFirst || {});
49649
- }
49650
- else {
49651
- params = {
49652
- videoId: paramsOrFirst,
49653
- output: rest[0],
49654
- status: rest[1],
49655
- };
49656
- }
49657
- const videoId = params.videoId;
49658
- const output = params.output;
49659
- const status = params.status;
49660
- if (typeof videoId === 'undefined' || videoId === '') {
49661
- throw new AppwriteException('Missing required parameter: "videoId"');
49662
- }
49663
- const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
49664
- const apiPayload = {};
49665
- if (typeof output !== 'undefined') {
49666
- apiPayload['output'] = output;
49667
- }
49668
- if (typeof status !== 'undefined') {
49669
- apiPayload['status'] = status;
49670
- }
49671
- const uri = new URL(this.client.config.endpoint + apiPath);
49672
- const apiHeaders = {
49673
- 'X-Appwrite-Project': this.client.config.project,
49674
- accept: 'application/json',
49675
- };
49676
- return this.client.call('get', uri, apiHeaders, apiPayload);
49677
- }
49678
- createRendition(paramsOrFirst, ...rest) {
49679
- let params;
49680
- if (paramsOrFirst &&
49681
- typeof paramsOrFirst === 'object' &&
49682
- !Array.isArray(paramsOrFirst)) {
49683
- params = (paramsOrFirst || {});
49684
- }
49685
- else {
49686
- params = {
49687
- videoId: paramsOrFirst,
49688
- profileId: rest[0],
49689
- output: rest[1],
49690
- };
49691
- }
49692
- const videoId = params.videoId;
49693
- const profileId = params.profileId;
49694
- const output = params.output;
49695
- if (typeof videoId === 'undefined' || videoId === '') {
49696
- throw new AppwriteException('Missing required parameter: "videoId"');
49697
- }
49698
- if (typeof profileId === 'undefined') {
49699
- throw new AppwriteException('Missing required parameter: "profileId"');
49700
- }
49701
- if (typeof output === 'undefined') {
49702
- throw new AppwriteException('Missing required parameter: "output"');
49703
- }
49704
- const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
49705
- const apiPayload = {};
49706
- if (typeof profileId !== 'undefined') {
49707
- apiPayload['profileId'] = profileId;
49708
- }
49709
- if (typeof output !== 'undefined') {
49710
- apiPayload['output'] = output;
49711
- }
49712
- const uri = new URL(this.client.config.endpoint + apiPath);
49713
- const apiHeaders = {
49714
- 'X-Appwrite-Project': this.client.config.project,
49715
- 'content-type': 'application/json',
49716
- accept: 'application/json',
49717
- };
49718
- return this.client.call('post', uri, apiHeaders, apiPayload);
49719
- }
49720
- getRendition(paramsOrFirst, ...rest) {
49721
- let params;
49722
- if (paramsOrFirst &&
49723
- typeof paramsOrFirst === 'object' &&
49724
- !Array.isArray(paramsOrFirst)) {
49725
- params = (paramsOrFirst || {});
49726
- }
49727
- else {
49728
- params = {
49729
- videoId: paramsOrFirst,
49730
- renditionId: rest[0],
49731
- };
49732
- }
49733
- const videoId = params.videoId;
49734
- const renditionId = params.renditionId;
49735
- if (typeof videoId === 'undefined' || videoId === '') {
49736
- throw new AppwriteException('Missing required parameter: "videoId"');
49737
- }
49738
- if (typeof renditionId === 'undefined' || renditionId === '') {
49739
- throw new AppwriteException('Missing required parameter: "renditionId"');
49740
- }
49741
- const apiPath = '/videos/{videoId}/renditions/{renditionId}'
49742
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49743
- .replace('{renditionId}', encodeURIComponent(String(renditionId)));
49744
- const apiPayload = {};
49745
- const uri = new URL(this.client.config.endpoint + apiPath);
49746
- const apiHeaders = {
49747
- 'X-Appwrite-Project': this.client.config.project,
49748
- accept: 'application/json',
49749
- };
49750
- return this.client.call('get', uri, apiHeaders, apiPayload);
49751
- }
49752
- deleteRendition(paramsOrFirst, ...rest) {
49753
- let params;
49754
- if (paramsOrFirst &&
49755
- typeof paramsOrFirst === 'object' &&
49756
- !Array.isArray(paramsOrFirst)) {
49757
- params = (paramsOrFirst || {});
49758
- }
49759
- else {
49760
- params = {
49761
- videoId: paramsOrFirst,
49762
- renditionId: rest[0],
49763
- };
49764
- }
49765
- const videoId = params.videoId;
49766
- const renditionId = params.renditionId;
49767
- if (typeof videoId === 'undefined' || videoId === '') {
49768
- throw new AppwriteException('Missing required parameter: "videoId"');
49769
- }
49770
- if (typeof renditionId === 'undefined' || renditionId === '') {
49771
- throw new AppwriteException('Missing required parameter: "renditionId"');
49772
- }
49773
- const apiPath = '/videos/{videoId}/renditions/{renditionId}'
49774
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49775
- .replace('{renditionId}', encodeURIComponent(String(renditionId)));
49776
- const apiPayload = {};
49777
- const uri = new URL(this.client.config.endpoint + apiPath);
49778
- const apiHeaders = {
49779
- 'X-Appwrite-Project': this.client.config.project,
49780
- 'content-type': 'application/json',
49781
- accept: 'application/json',
49782
- };
49783
- return this.client.call('delete', uri, apiHeaders, apiPayload);
49784
- }
49785
- createSource(paramsOrFirst) {
49786
- let params;
49787
- if (paramsOrFirst &&
49788
- typeof paramsOrFirst === 'object' &&
49789
- !Array.isArray(paramsOrFirst)) {
49790
- params = (paramsOrFirst || {});
49791
- }
49792
- else {
49793
- params = {
49794
- videoId: paramsOrFirst,
49795
- };
49796
- }
49797
- const videoId = params.videoId;
49798
- if (typeof videoId === 'undefined' || videoId === '') {
49799
- throw new AppwriteException('Missing required parameter: "videoId"');
49800
- }
49801
- const apiPath = '/videos/{videoId}/source'.replace('{videoId}', encodeURIComponent(String(videoId)));
49802
- const apiPayload = {};
49803
- const uri = new URL(this.client.config.endpoint + apiPath);
49804
- const apiHeaders = {
49805
- 'X-Appwrite-Project': this.client.config.project,
49806
- 'content-type': 'application/json',
49807
- accept: 'application/json',
49808
- };
49809
- return this.client.call('post', uri, apiHeaders, apiPayload);
49810
- }
49811
- listSubtitles(paramsOrFirst) {
49812
- let params;
49813
- if (paramsOrFirst &&
49814
- typeof paramsOrFirst === 'object' &&
49815
- !Array.isArray(paramsOrFirst)) {
49816
- params = (paramsOrFirst || {});
49817
- }
49818
- else {
49819
- params = {
49820
- videoId: paramsOrFirst,
49821
- };
49822
- }
49823
- const videoId = params.videoId;
49824
- if (typeof videoId === 'undefined' || videoId === '') {
49825
- throw new AppwriteException('Missing required parameter: "videoId"');
49826
- }
49827
- const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
49828
- const apiPayload = {};
49829
- const uri = new URL(this.client.config.endpoint + apiPath);
49830
- const apiHeaders = {
49831
- 'X-Appwrite-Project': this.client.config.project,
49832
- accept: 'application/json',
49833
- };
49834
- return this.client.call('get', uri, apiHeaders, apiPayload);
49835
- }
49836
- createSubtitle(paramsOrFirst, ...rest) {
49837
- let params;
49838
- if (paramsOrFirst &&
49839
- typeof paramsOrFirst === 'object' &&
49840
- !Array.isArray(paramsOrFirst)) {
49841
- params = (paramsOrFirst || {});
49842
- }
49843
- else {
49844
- params = {
49845
- videoId: paramsOrFirst,
49846
- bucketId: rest[0],
49847
- fileId: rest[1],
49848
- name: rest[2],
49849
- code: rest[3],
49850
- xdefault: rest[4],
49851
- };
49852
- }
49853
- const videoId = params.videoId;
49854
- const bucketId = params.bucketId;
49855
- const fileId = params.fileId;
49856
- const name = params.name;
49857
- const code = params.code;
49858
- const xdefault = params.xdefault;
49859
- if (typeof videoId === 'undefined' || videoId === '') {
49860
- throw new AppwriteException('Missing required parameter: "videoId"');
49861
- }
49862
- if (typeof bucketId === 'undefined') {
49863
- throw new AppwriteException('Missing required parameter: "bucketId"');
49864
- }
49865
- if (typeof fileId === 'undefined') {
49866
- throw new AppwriteException('Missing required parameter: "fileId"');
49867
- }
49868
- if (typeof name === 'undefined') {
49869
- throw new AppwriteException('Missing required parameter: "name"');
49870
- }
49871
- if (typeof code === 'undefined') {
49872
- throw new AppwriteException('Missing required parameter: "code"');
49873
- }
49874
- const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
49875
- const apiPayload = {};
49876
- if (typeof bucketId !== 'undefined') {
49877
- apiPayload['bucketId'] = bucketId;
49878
- }
49879
- if (typeof fileId !== 'undefined') {
49880
- apiPayload['fileId'] = fileId;
49881
- }
49882
- if (typeof name !== 'undefined') {
49883
- apiPayload['name'] = name;
49884
- }
49885
- if (typeof code !== 'undefined') {
49886
- apiPayload['code'] = code;
49887
- }
49888
- if (typeof xdefault !== 'undefined') {
49889
- apiPayload['default'] = xdefault;
49890
- }
49891
- const uri = new URL(this.client.config.endpoint + apiPath);
49892
- const apiHeaders = {
49893
- 'X-Appwrite-Project': this.client.config.project,
49894
- 'content-type': 'application/json',
49895
- accept: 'application/json',
49896
- };
49897
- return this.client.call('post', uri, apiHeaders, apiPayload);
49898
- }
49899
- updateSubtitle(paramsOrFirst, ...rest) {
49900
- let params;
49901
- if (paramsOrFirst &&
49902
- typeof paramsOrFirst === 'object' &&
49903
- !Array.isArray(paramsOrFirst)) {
49904
- params = (paramsOrFirst || {});
49905
- }
49906
- else {
49907
- params = {
49908
- videoId: paramsOrFirst,
49909
- subtitleId: rest[0],
49910
- bucketId: rest[1],
49911
- fileId: rest[2],
49912
- name: rest[3],
49913
- code: rest[4],
49914
- xdefault: rest[5],
49915
- };
49916
- }
49917
- const videoId = params.videoId;
49918
- const subtitleId = params.subtitleId;
49919
- const bucketId = params.bucketId;
49920
- const fileId = params.fileId;
49921
- const name = params.name;
49922
- const code = params.code;
49923
- const xdefault = params.xdefault;
49924
- if (typeof videoId === 'undefined' || videoId === '') {
49925
- throw new AppwriteException('Missing required parameter: "videoId"');
49926
- }
49927
- if (typeof subtitleId === 'undefined' || subtitleId === '') {
49928
- throw new AppwriteException('Missing required parameter: "subtitleId"');
49929
- }
49930
- const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
49931
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49932
- .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
49933
- const apiPayload = {};
49934
- if (typeof bucketId !== 'undefined') {
49935
- apiPayload['bucketId'] = bucketId;
49936
- }
49937
- if (typeof fileId !== 'undefined') {
49938
- apiPayload['fileId'] = fileId;
49939
- }
49940
- if (typeof name !== 'undefined') {
49941
- apiPayload['name'] = name;
49942
- }
49943
- if (typeof code !== 'undefined') {
49944
- apiPayload['code'] = code;
49945
- }
49946
- if (typeof xdefault !== 'undefined') {
49947
- apiPayload['default'] = xdefault;
49948
- }
49949
- const uri = new URL(this.client.config.endpoint + apiPath);
49950
- const apiHeaders = {
49951
- 'X-Appwrite-Project': this.client.config.project,
49952
- 'content-type': 'application/json',
49953
- accept: 'application/json',
49954
- };
49955
- return this.client.call('patch', uri, apiHeaders, apiPayload);
49956
- }
49957
- deleteSubtitle(paramsOrFirst, ...rest) {
49958
- let params;
49959
- if (paramsOrFirst &&
49960
- typeof paramsOrFirst === 'object' &&
49961
- !Array.isArray(paramsOrFirst)) {
49962
- params = (paramsOrFirst || {});
49963
- }
49964
- else {
49965
- params = {
49966
- videoId: paramsOrFirst,
49967
- subtitleId: rest[0],
49968
- };
49969
- }
49970
- const videoId = params.videoId;
49971
- const subtitleId = params.subtitleId;
49972
- if (typeof videoId === 'undefined' || videoId === '') {
49973
- throw new AppwriteException('Missing required parameter: "videoId"');
49974
- }
49975
- if (typeof subtitleId === 'undefined' || subtitleId === '') {
49976
- throw new AppwriteException('Missing required parameter: "subtitleId"');
49977
- }
49978
- const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
49979
- .replace('{videoId}', encodeURIComponent(String(videoId)))
49980
- .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
49981
- const apiPayload = {};
49982
- const uri = new URL(this.client.config.endpoint + apiPath);
49983
- const apiHeaders = {
49984
- 'X-Appwrite-Project': this.client.config.project,
49985
- 'content-type': 'application/json',
49986
- accept: 'application/json',
49987
- };
49988
- return this.client.call('delete', uri, apiHeaders, apiPayload);
49989
- }
49990
- getTimeline(paramsOrFirst) {
49991
- let params;
49992
- if (paramsOrFirst &&
49993
- typeof paramsOrFirst === 'object' &&
49994
- !Array.isArray(paramsOrFirst)) {
49995
- params = (paramsOrFirst || {});
49996
- }
49997
- else {
49998
- params = {
49999
- videoId: paramsOrFirst,
50000
- };
50001
- }
50002
- const videoId = params.videoId;
50003
- if (typeof videoId === 'undefined' || videoId === '') {
50004
- throw new AppwriteException('Missing required parameter: "videoId"');
50005
- }
50006
- const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
50007
- const apiPayload = {};
50008
- const uri = new URL(this.client.config.endpoint + apiPath);
50009
- const apiHeaders = {
50010
- 'X-Appwrite-Project': this.client.config.project,
50011
- accept: 'text/plain',
50012
- };
50013
- return this.client.call('get', uri, apiHeaders, apiPayload, 'text');
50014
- }
50015
- createTimeline(paramsOrFirst) {
50016
- let params;
50017
- if (paramsOrFirst &&
50018
- typeof paramsOrFirst === 'object' &&
50019
- !Array.isArray(paramsOrFirst)) {
50020
- params = (paramsOrFirst || {});
50021
- }
50022
- else {
50023
- params = {
50024
- videoId: paramsOrFirst,
50025
- };
50026
- }
50027
- const videoId = params.videoId;
50028
- if (typeof videoId === 'undefined' || videoId === '') {
50029
- throw new AppwriteException('Missing required parameter: "videoId"');
50030
- }
50031
- const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
50032
- const apiPayload = {};
50033
- const uri = new URL(this.client.config.endpoint + apiPath);
50034
- const apiHeaders = {
50035
- 'X-Appwrite-Project': this.client.config.project,
50036
- 'content-type': 'application/json',
50037
- accept: 'application/json',
50038
- };
50039
- return this.client.call('post', uri, apiHeaders, apiPayload);
50040
- }
50041
- }
50042
-
50043
- class Waf {
50044
- constructor(client) {
50045
- this.client = client;
50046
- }
50047
- listRules(paramsOrFirst, ...rest) {
50048
- let params;
50049
- if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
50050
- (paramsOrFirst &&
50051
- typeof paramsOrFirst === 'object' &&
50052
- !Array.isArray(paramsOrFirst))) {
50053
- params = (paramsOrFirst || {});
50054
- }
50055
- else {
50056
- params = {
50057
- queries: paramsOrFirst,
50058
- search: rest[0],
50059
- total: rest[1],
50060
- };
50061
- }
50062
- const queries = params.queries;
50063
- const search = params.search;
50064
- const total = params.total;
50065
- const apiPath = '/waf/rules';
50066
- const apiPayload = {};
50067
- if (typeof queries !== 'undefined') {
50068
- apiPayload['queries'] = queries;
50069
- }
50070
- if (typeof search !== 'undefined') {
50071
- apiPayload['search'] = search;
50072
- }
50073
- if (typeof total !== 'undefined') {
50074
- apiPayload['total'] = total;
50075
- }
50076
- const uri = new URL(this.client.config.endpoint + apiPath);
50077
- const apiHeaders = {
50078
- 'X-Appwrite-Project': this.client.config.project,
50079
- accept: 'application/json',
50080
- };
50081
- return this.client.call('get', uri, apiHeaders, apiPayload);
50082
- }
50083
- createBypassRule(paramsOrFirst, ...rest) {
50084
- let params;
50085
- if (paramsOrFirst &&
50086
- typeof paramsOrFirst === 'object' &&
50087
- !Array.isArray(paramsOrFirst)) {
50088
- params = (paramsOrFirst || {});
50089
- }
50090
- else {
50091
- params = {
50092
- ruleId: paramsOrFirst,
50093
- resourceType: rest[0],
50094
- name: rest[1],
50095
- resourceId: rest[2],
50096
- description: rest[3],
50097
- priority: rest[4],
50098
- enabled: rest[5],
50099
- conditions: rest[6],
50100
- };
50101
- }
50102
- const ruleId = params.ruleId;
50103
- const resourceType = params.resourceType;
50104
- const name = params.name;
50105
- const resourceId = params.resourceId;
50106
- const description = params.description;
50107
- const priority = params.priority;
50108
- const enabled = params.enabled;
50109
- const conditions = params.conditions;
50110
- if (typeof ruleId === 'undefined') {
50111
- throw new AppwriteException('Missing required parameter: "ruleId"');
50112
- }
50113
- if (typeof resourceType === 'undefined') {
50114
- throw new AppwriteException('Missing required parameter: "resourceType"');
50115
- }
50116
- if (typeof name === 'undefined') {
50117
- throw new AppwriteException('Missing required parameter: "name"');
50118
- }
50119
- const apiPath = '/waf/rules/bypass';
50120
- const apiPayload = {};
50121
- if (typeof ruleId !== 'undefined') {
50122
- apiPayload['ruleId'] = ruleId;
50123
- }
50124
- if (typeof resourceType !== 'undefined') {
50125
- apiPayload['resourceType'] = resourceType;
50126
- }
50127
- if (typeof resourceId !== 'undefined') {
50128
- apiPayload['resourceId'] = resourceId;
50129
- }
50130
- if (typeof name !== 'undefined') {
50131
- apiPayload['name'] = name;
50132
- }
50133
- if (typeof description !== 'undefined') {
50134
- apiPayload['description'] = description;
50135
- }
50136
- if (typeof priority !== 'undefined') {
50137
- apiPayload['priority'] = priority;
50138
- }
50139
- if (typeof enabled !== 'undefined') {
50140
- apiPayload['enabled'] = enabled;
50141
- }
50142
- if (typeof conditions !== 'undefined') {
50143
- apiPayload['conditions'] = conditions;
50144
- }
50145
- const uri = new URL(this.client.config.endpoint + apiPath);
50146
- const apiHeaders = {
50147
- 'X-Appwrite-Project': this.client.config.project,
50148
- 'content-type': 'application/json',
50149
- accept: 'application/json',
50150
- };
50151
- return this.client.call('post', uri, apiHeaders, apiPayload);
50152
- }
50153
- updateBypassRule(paramsOrFirst, ...rest) {
50154
- let params;
50155
- if (paramsOrFirst &&
50156
- typeof paramsOrFirst === 'object' &&
50157
- !Array.isArray(paramsOrFirst)) {
50158
- params = (paramsOrFirst || {});
50159
- }
50160
- else {
50161
- params = {
50162
- ruleId: paramsOrFirst,
50163
- resourceType: rest[0],
50164
- resourceId: rest[1],
50165
- name: rest[2],
50166
- description: rest[3],
50167
- priority: rest[4],
50168
- enabled: rest[5],
50169
- conditions: rest[6],
50170
- };
50171
- }
50172
- const ruleId = params.ruleId;
50173
- const resourceType = params.resourceType;
50174
- const resourceId = params.resourceId;
50175
- const name = params.name;
50176
- const description = params.description;
50177
- const priority = params.priority;
50178
- const enabled = params.enabled;
50179
- const conditions = params.conditions;
50180
- if (typeof ruleId === 'undefined' || ruleId === '') {
50181
- throw new AppwriteException('Missing required parameter: "ruleId"');
50182
- }
50183
- const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
50184
- const apiPayload = {};
50185
- if (typeof resourceType !== 'undefined') {
50186
- apiPayload['resourceType'] = resourceType;
50187
- }
50188
- if (typeof resourceId !== 'undefined') {
50189
- apiPayload['resourceId'] = resourceId;
50190
- }
50191
- if (typeof name !== 'undefined') {
50192
- apiPayload['name'] = name;
50193
- }
50194
- if (typeof description !== 'undefined') {
50195
- apiPayload['description'] = description;
50196
- }
50197
- if (typeof priority !== 'undefined') {
50198
- apiPayload['priority'] = priority;
50199
- }
50200
- if (typeof enabled !== 'undefined') {
50201
- apiPayload['enabled'] = enabled;
50202
- }
50203
- if (typeof conditions !== 'undefined') {
50204
- apiPayload['conditions'] = conditions;
50205
- }
50206
- const uri = new URL(this.client.config.endpoint + apiPath);
50207
- const apiHeaders = {
50208
- 'X-Appwrite-Project': this.client.config.project,
50209
- 'content-type': 'application/json',
50210
- accept: 'application/json',
50211
- };
50212
- return this.client.call('patch', uri, apiHeaders, apiPayload);
50213
- }
50214
- createChallengeRule(paramsOrFirst, ...rest) {
50215
- let params;
50216
- if (paramsOrFirst &&
50217
- typeof paramsOrFirst === 'object' &&
50218
- !Array.isArray(paramsOrFirst)) {
50219
- params = (paramsOrFirst || {});
50220
- }
50221
- else {
50222
- params = {
50223
- ruleId: paramsOrFirst,
50224
- resourceType: rest[0],
50225
- name: rest[1],
50226
- resourceId: rest[2],
50227
- description: rest[3],
50228
- challengeType: rest[4],
50229
- priority: rest[5],
50230
- enabled: rest[6],
50231
- conditions: rest[7],
50232
- difficulty: rest[8],
50233
- ttl: rest[9],
50234
- };
50235
- }
50236
- const ruleId = params.ruleId;
50237
- const resourceType = params.resourceType;
50238
- const name = params.name;
50239
- const resourceId = params.resourceId;
50240
- const description = params.description;
50241
- const challengeType = params.challengeType;
50242
- const priority = params.priority;
50243
- const enabled = params.enabled;
50244
- const conditions = params.conditions;
50245
- const difficulty = params.difficulty;
50246
- const ttl = params.ttl;
50247
- if (typeof ruleId === 'undefined') {
50248
- throw new AppwriteException('Missing required parameter: "ruleId"');
50249
- }
50250
- if (typeof resourceType === 'undefined') {
50251
- throw new AppwriteException('Missing required parameter: "resourceType"');
50252
- }
50253
- if (typeof name === 'undefined') {
50254
- throw new AppwriteException('Missing required parameter: "name"');
50255
- }
50256
- const apiPath = '/waf/rules/challenge';
50257
- const apiPayload = {};
50258
- if (typeof ruleId !== 'undefined') {
50259
- apiPayload['ruleId'] = ruleId;
50260
- }
50261
- if (typeof resourceType !== 'undefined') {
50262
- apiPayload['resourceType'] = resourceType;
50263
- }
50264
- if (typeof resourceId !== 'undefined') {
50265
- apiPayload['resourceId'] = resourceId;
50266
- }
50267
- if (typeof name !== 'undefined') {
50268
- apiPayload['name'] = name;
50269
- }
50270
- if (typeof description !== 'undefined') {
50271
- apiPayload['description'] = description;
50272
- }
50273
- if (typeof challengeType !== 'undefined') {
50274
- apiPayload['challengeType'] = challengeType;
50275
- }
50276
- if (typeof priority !== 'undefined') {
50277
- apiPayload['priority'] = priority;
50278
- }
50279
- if (typeof enabled !== 'undefined') {
50280
- apiPayload['enabled'] = enabled;
50281
- }
50282
- if (typeof conditions !== 'undefined') {
50283
- apiPayload['conditions'] = conditions;
50284
- }
50285
- if (typeof difficulty !== 'undefined') {
50286
- apiPayload['difficulty'] = difficulty;
50287
- }
50288
- if (typeof ttl !== 'undefined') {
50289
- apiPayload['ttl'] = ttl;
50290
- }
50291
- const uri = new URL(this.client.config.endpoint + apiPath);
50292
- const apiHeaders = {
50293
- 'X-Appwrite-Project': this.client.config.project,
50294
- 'content-type': 'application/json',
50295
- accept: 'application/json',
50296
- };
50297
- return this.client.call('post', uri, apiHeaders, apiPayload);
50298
- }
50299
- updateChallengeRule(paramsOrFirst, ...rest) {
50300
- let params;
50301
- if (paramsOrFirst &&
50302
- typeof paramsOrFirst === 'object' &&
50303
- !Array.isArray(paramsOrFirst)) {
50304
- params = (paramsOrFirst || {});
50305
- }
50306
- else {
50307
- params = {
50308
- ruleId: paramsOrFirst,
50309
- resourceType: rest[0],
50310
- resourceId: rest[1],
50311
- name: rest[2],
50312
- description: rest[3],
50313
- challengeType: rest[4],
50314
- priority: rest[5],
50315
- enabled: rest[6],
50316
- conditions: rest[7],
50317
- difficulty: rest[8],
50318
- ttl: rest[9],
50319
- };
50320
- }
50321
- const ruleId = params.ruleId;
50322
- const resourceType = params.resourceType;
50323
- const resourceId = params.resourceId;
50324
- const name = params.name;
50325
- const description = params.description;
50326
- const challengeType = params.challengeType;
50327
- const priority = params.priority;
50328
- const enabled = params.enabled;
50329
- const conditions = params.conditions;
50330
- const difficulty = params.difficulty;
50331
- const ttl = params.ttl;
50332
- if (typeof ruleId === 'undefined' || ruleId === '') {
50333
- throw new AppwriteException('Missing required parameter: "ruleId"');
50334
- }
50335
- const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
50336
- const apiPayload = {};
50337
- if (typeof resourceType !== 'undefined') {
50338
- apiPayload['resourceType'] = resourceType;
50339
- }
50340
- if (typeof resourceId !== 'undefined') {
50341
- apiPayload['resourceId'] = resourceId;
50342
- }
50343
- if (typeof name !== 'undefined') {
50344
- apiPayload['name'] = name;
50345
- }
50346
- if (typeof description !== 'undefined') {
50347
- apiPayload['description'] = description;
50348
- }
50349
- if (typeof challengeType !== 'undefined') {
50350
- apiPayload['challengeType'] = challengeType;
50351
- }
50352
- if (typeof priority !== 'undefined') {
50353
- apiPayload['priority'] = priority;
50354
- }
50355
- if (typeof enabled !== 'undefined') {
50356
- apiPayload['enabled'] = enabled;
50357
- }
50358
- if (typeof conditions !== 'undefined') {
50359
- apiPayload['conditions'] = conditions;
50360
- }
50361
- if (typeof difficulty !== 'undefined') {
50362
- apiPayload['difficulty'] = difficulty;
50363
- }
50364
- if (typeof ttl !== 'undefined') {
50365
- apiPayload['ttl'] = ttl;
50366
- }
50367
- const uri = new URL(this.client.config.endpoint + apiPath);
50368
- const apiHeaders = {
50369
- 'X-Appwrite-Project': this.client.config.project,
50370
- 'content-type': 'application/json',
50371
- accept: 'application/json',
50372
- };
50373
- return this.client.call('patch', uri, apiHeaders, apiPayload);
50374
- }
50375
- createDenyRule(paramsOrFirst, ...rest) {
50376
- let params;
50377
- if (paramsOrFirst &&
50378
- typeof paramsOrFirst === 'object' &&
50379
- !Array.isArray(paramsOrFirst)) {
50380
- params = (paramsOrFirst || {});
50381
- }
50382
- else {
50383
- params = {
50384
- ruleId: paramsOrFirst,
50385
- resourceType: rest[0],
50386
- name: rest[1],
50387
- resourceId: rest[2],
50388
- description: rest[3],
50389
- priority: rest[4],
50390
- enabled: rest[5],
50391
- conditions: rest[6],
50392
- };
50393
- }
50394
- const ruleId = params.ruleId;
50395
- const resourceType = params.resourceType;
50396
- const name = params.name;
50397
- const resourceId = params.resourceId;
50398
- const description = params.description;
50399
- const priority = params.priority;
50400
- const enabled = params.enabled;
50401
- const conditions = params.conditions;
50402
- if (typeof ruleId === 'undefined') {
50403
- throw new AppwriteException('Missing required parameter: "ruleId"');
50404
- }
50405
- if (typeof resourceType === 'undefined') {
50406
- throw new AppwriteException('Missing required parameter: "resourceType"');
50407
- }
50408
- if (typeof name === 'undefined') {
50409
- throw new AppwriteException('Missing required parameter: "name"');
50410
- }
50411
- const apiPath = '/waf/rules/deny';
50412
- const apiPayload = {};
50413
- if (typeof ruleId !== 'undefined') {
50414
- apiPayload['ruleId'] = ruleId;
50415
- }
50416
- if (typeof resourceType !== 'undefined') {
50417
- apiPayload['resourceType'] = resourceType;
50418
- }
50419
- if (typeof resourceId !== 'undefined') {
50420
- apiPayload['resourceId'] = resourceId;
50421
- }
50422
- if (typeof name !== 'undefined') {
50423
- apiPayload['name'] = name;
50424
- }
50425
- if (typeof description !== 'undefined') {
50426
- apiPayload['description'] = description;
50427
- }
50428
- if (typeof priority !== 'undefined') {
50429
- apiPayload['priority'] = priority;
50430
- }
50431
- if (typeof enabled !== 'undefined') {
50432
- apiPayload['enabled'] = enabled;
50433
- }
50434
- if (typeof conditions !== 'undefined') {
50435
- apiPayload['conditions'] = conditions;
50436
- }
50437
- const uri = new URL(this.client.config.endpoint + apiPath);
50438
- const apiHeaders = {
50439
- 'X-Appwrite-Project': this.client.config.project,
50440
- 'content-type': 'application/json',
50441
- accept: 'application/json',
50442
- };
50443
- return this.client.call('post', uri, apiHeaders, apiPayload);
50444
- }
50445
- updateDenyRule(paramsOrFirst, ...rest) {
50446
- let params;
50447
- if (paramsOrFirst &&
50448
- typeof paramsOrFirst === 'object' &&
50449
- !Array.isArray(paramsOrFirst)) {
50450
- params = (paramsOrFirst || {});
50451
- }
50452
- else {
50453
- params = {
50454
- ruleId: paramsOrFirst,
50455
- resourceType: rest[0],
50456
- resourceId: rest[1],
50457
- name: rest[2],
50458
- description: rest[3],
50459
- priority: rest[4],
50460
- enabled: rest[5],
50461
- conditions: rest[6],
50462
- };
50463
- }
50464
- const ruleId = params.ruleId;
50465
- const resourceType = params.resourceType;
50466
- const resourceId = params.resourceId;
50467
- const name = params.name;
50468
- const description = params.description;
50469
- const priority = params.priority;
50470
- const enabled = params.enabled;
50471
- const conditions = params.conditions;
50472
- if (typeof ruleId === 'undefined' || ruleId === '') {
50473
- throw new AppwriteException('Missing required parameter: "ruleId"');
50474
- }
50475
- const apiPath = '/waf/rules/deny/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
50476
- const apiPayload = {};
50477
- if (typeof resourceType !== 'undefined') {
50478
- apiPayload['resourceType'] = resourceType;
50479
- }
50480
- if (typeof resourceId !== 'undefined') {
50481
- apiPayload['resourceId'] = resourceId;
50482
- }
50483
- if (typeof name !== 'undefined') {
50484
- apiPayload['name'] = name;
50485
- }
50486
- if (typeof description !== 'undefined') {
50487
- apiPayload['description'] = description;
50488
- }
50489
- if (typeof priority !== 'undefined') {
50490
- apiPayload['priority'] = priority;
50491
- }
50492
- if (typeof enabled !== 'undefined') {
50493
- apiPayload['enabled'] = enabled;
50494
- }
50495
- if (typeof conditions !== 'undefined') {
50496
- apiPayload['conditions'] = conditions;
50497
- }
50498
- const uri = new URL(this.client.config.endpoint + apiPath);
50499
- const apiHeaders = {
50500
- 'X-Appwrite-Project': this.client.config.project,
50501
- 'content-type': 'application/json',
50502
- accept: 'application/json',
50503
- };
50504
- return this.client.call('patch', uri, apiHeaders, apiPayload);
50505
- }
50506
- createRateLimitRule(paramsOrFirst, ...rest) {
50507
- let params;
50508
- if (paramsOrFirst &&
50509
- typeof paramsOrFirst === 'object' &&
50510
- !Array.isArray(paramsOrFirst)) {
50511
- params = (paramsOrFirst || {});
50512
- }
50513
- else {
50514
- params = {
50515
- ruleId: paramsOrFirst,
50516
- resourceType: rest[0],
50517
- name: rest[1],
50518
- limit: rest[2],
50519
- interval: rest[3],
50520
- resourceId: rest[4],
50521
- description: rest[5],
50522
- key: rest[6],
50523
- strategy: rest[7],
50524
- maxBucketSize: rest[8],
50525
- priority: rest[9],
50526
- enabled: rest[10],
50527
- conditions: rest[11],
50528
- };
50529
- }
50530
- const ruleId = params.ruleId;
50531
- const resourceType = params.resourceType;
50532
- const name = params.name;
50533
- const limit = params.limit;
50534
- const interval = params.interval;
50535
- const resourceId = params.resourceId;
50536
- const description = params.description;
50537
- const key = params.key;
50538
- const strategy = params.strategy;
50539
- const maxBucketSize = params.maxBucketSize;
50540
- const priority = params.priority;
50541
- const enabled = params.enabled;
50542
- const conditions = params.conditions;
50543
- if (typeof ruleId === 'undefined') {
50544
- throw new AppwriteException('Missing required parameter: "ruleId"');
50545
- }
50546
- if (typeof resourceType === 'undefined') {
50547
- throw new AppwriteException('Missing required parameter: "resourceType"');
50548
- }
50549
- if (typeof name === 'undefined') {
50550
- throw new AppwriteException('Missing required parameter: "name"');
50551
- }
50552
- if (typeof limit === 'undefined') {
50553
- throw new AppwriteException('Missing required parameter: "limit"');
50554
- }
50555
- if (typeof interval === 'undefined') {
50556
- throw new AppwriteException('Missing required parameter: "interval"');
50557
- }
50558
- const apiPath = '/waf/rules/rate-limit';
50559
- const apiPayload = {};
50560
- if (typeof ruleId !== 'undefined') {
50561
- apiPayload['ruleId'] = ruleId;
50562
- }
50563
- if (typeof resourceType !== 'undefined') {
50564
- apiPayload['resourceType'] = resourceType;
50565
- }
50566
- if (typeof resourceId !== 'undefined') {
50567
- apiPayload['resourceId'] = resourceId;
50568
- }
50569
- if (typeof name !== 'undefined') {
50570
- apiPayload['name'] = name;
50571
- }
50572
- if (typeof description !== 'undefined') {
50573
- apiPayload['description'] = description;
50574
- }
50575
- if (typeof limit !== 'undefined') {
50576
- apiPayload['limit'] = limit;
50577
- }
50578
- if (typeof interval !== 'undefined') {
50579
- apiPayload['interval'] = interval;
50580
- }
50581
- if (typeof key !== 'undefined') {
50582
- apiPayload['key'] = key;
50583
- }
50584
- if (typeof strategy !== 'undefined') {
50585
- apiPayload['strategy'] = strategy;
50586
- }
50587
- if (typeof maxBucketSize !== 'undefined') {
50588
- apiPayload['maxBucketSize'] = maxBucketSize;
50589
- }
50590
- if (typeof priority !== 'undefined') {
50591
- apiPayload['priority'] = priority;
50592
- }
50593
- if (typeof enabled !== 'undefined') {
50594
- apiPayload['enabled'] = enabled;
50595
- }
50596
- if (typeof conditions !== 'undefined') {
50597
- apiPayload['conditions'] = conditions;
50598
- }
50599
- const uri = new URL(this.client.config.endpoint + apiPath);
50600
- const apiHeaders = {
50601
- 'X-Appwrite-Project': this.client.config.project,
50602
- 'content-type': 'application/json',
50603
- accept: 'application/json',
50604
- };
50605
- return this.client.call('post', uri, apiHeaders, apiPayload);
50606
- }
50607
- updateRateLimitRule(paramsOrFirst, ...rest) {
50608
- let params;
50609
- if (paramsOrFirst &&
50610
- typeof paramsOrFirst === 'object' &&
50611
- !Array.isArray(paramsOrFirst)) {
50612
- params = (paramsOrFirst || {});
50613
- }
50614
- else {
50615
- params = {
50616
- ruleId: paramsOrFirst,
50617
- resourceType: rest[0],
50618
- resourceId: rest[1],
50619
- name: rest[2],
50620
- description: rest[3],
50621
- limit: rest[4],
50622
- interval: rest[5],
50623
- key: rest[6],
50624
- maxBucketSize: rest[7],
50625
- priority: rest[8],
50626
- enabled: rest[9],
50627
- conditions: rest[10],
49032
+ ruleId: paramsOrFirst,
49033
+ resourceType: rest[0],
49034
+ resourceId: rest[1],
49035
+ name: rest[2],
49036
+ description: rest[3],
49037
+ limit: rest[4],
49038
+ interval: rest[5],
49039
+ key: rest[6],
49040
+ maxBucketSize: rest[7],
49041
+ priority: rest[8],
49042
+ enabled: rest[9],
49043
+ conditions: rest[10],
50628
49044
  };
50629
49045
  }
50630
49046
  const ruleId = params.ruleId;
@@ -51802,8 +50218,9 @@
51802
50218
  * );
51803
50219
  * // sub.update({ background: true }); sub.unsubscribe();
51804
50220
  */
51805
- class Push {
50221
+ class Push extends Service {
51806
50222
  constructor(client) {
50223
+ super(client);
51807
50224
  this.mqtt = null;
51808
50225
  this.connecting = null;
51809
50226
  this.Buffer = null;
@@ -51833,7 +50250,6 @@
51833
50250
  this.connectedKey = '';
51834
50251
  this.connectionEpoch = 0;
51835
50252
  this.subscriptions = new Map();
51836
- this.client = client;
51837
50253
  }
51838
50254
  // The broker subscription for a filter uses the highest QoS any local subscription on
51839
50255
  // it wants, so a QoS-0 subscription never downgrades a QoS-1 one sharing the filter.
@@ -52573,670 +50989,6 @@
52573
50989
  return filterParts.length === topicParts.length;
52574
50990
  }
52575
50991
 
52576
- /**
52577
- * Analytics auto-tracking helpers.
52578
- *
52579
- * These are hand-written companions to the generated `Analytics` service.
52580
- * The generated service exposes `createEvent(params)` for arbitrary events;
52581
- * this module wires up common auto-tracking behaviours (pageviews, outbound
52582
- * links, downloads, scroll depth, active engagement) on top of it.
52583
- *
52584
- * The tracking helpers accept a plain event-emitter function so they do not
52585
- * hard-couple to the generated `Analytics` class. The emitter adapts this
52586
- * module's option shape to `createEvent`: `url` is required there, and `props`
52587
- * is a flat alternating key/value list rather than an object.
52588
- *
52589
- * ```ts
52590
- * const analytics = new Analytics(client);
52591
- * const tracking = new AnalyticsTracking(
52592
- * (name, options) => analytics.createEvent({
52593
- * propertyId: options?.propertyId ?? '<PROPERTY_ID>',
52594
- * name,
52595
- * url: options?.url ?? window.location.href,
52596
- * referrer: options?.referrer,
52597
- * scrollDepth: options?.scrollDepth,
52598
- * engagementTime: options?.engagementTime,
52599
- * props: Object.entries(options?.props ?? {}).flatMap(
52600
- * ([key, value]) => [key, String(value)],
52601
- * ),
52602
- * }),
52603
- * { propertyId: '<PROPERTY_ID>' }
52604
- * );
52605
- * tracking.enableAllAutoTracking();
52606
- * ```
52607
- *
52608
- * `propertyId` is optional: when set it is merged into the options of every
52609
- * emitted event, so an emitter that forwards `options.propertyId` (as above)
52610
- * picks it up instead of every caller hand-rolling it into the closure.
52611
- * Per-event `propertyId` always wins over the configured default.
52612
- *
52613
- * All helpers respect `navigator.doNotTrack === '1'` by default; opt out with
52614
- * `respectDoNotTrack: false` in the constructor options.
52615
- *
52616
- * Engagement time follows Plausible's model: rather than one total at unload,
52617
- * a delta is emitted at every natural checkpoint of the visit (tab hidden, SPA
52618
- * route change, unload). See `enableAutoEngagementTime` for details.
52619
- *
52620
- * Auto-emitted event names follow `snake_case` + lowercase (`pageview`,
52621
- * `outbound_link`, `file_download`, `screen_view`, etc.). Any prop keys use
52622
- * camelCase to match the endpoint's parameter naming. Callers can pass any
52623
- * custom event name; the auto-track methods only own the events they emit
52624
- * themselves.
52625
- */
52626
- const DEFAULT_DOWNLOAD_EXTENSIONS = [
52627
- 'pdf',
52628
- 'zip',
52629
- 'rar',
52630
- '7z',
52631
- 'tar',
52632
- 'gz',
52633
- 'csv',
52634
- 'tsv',
52635
- 'xls',
52636
- 'xlsx',
52637
- 'doc',
52638
- 'docx',
52639
- 'ppt',
52640
- 'pptx',
52641
- 'dmg',
52642
- 'exe',
52643
- 'msi',
52644
- 'pkg',
52645
- 'deb',
52646
- 'rpm',
52647
- 'apk',
52648
- 'mp3',
52649
- 'wav',
52650
- 'flac',
52651
- 'mp4',
52652
- 'mov',
52653
- 'avi',
52654
- 'mkv',
52655
- 'webm',
52656
- ];
52657
- /**
52658
- * Two-part public suffixes common enough to matter for outbound-link detection.
52659
- * See `rootDomain()` for why this is a short list rather than the Public Suffix
52660
- * List.
52661
- */
52662
- const MULTI_PART_SUFFIXES = new Set([
52663
- 'co.uk',
52664
- 'org.uk',
52665
- 'ac.uk',
52666
- 'gov.uk',
52667
- 'me.uk',
52668
- 'net.uk',
52669
- 'sch.uk',
52670
- 'co.jp',
52671
- 'ne.jp',
52672
- 'or.jp',
52673
- 'ac.jp',
52674
- 'go.jp',
52675
- 'com.au',
52676
- 'net.au',
52677
- 'org.au',
52678
- 'edu.au',
52679
- 'gov.au',
52680
- 'com.br',
52681
- 'net.br',
52682
- 'org.br',
52683
- 'com.cn',
52684
- 'net.cn',
52685
- 'org.cn',
52686
- 'gov.cn',
52687
- 'co.in',
52688
- 'net.in',
52689
- 'org.in',
52690
- 'co.nz',
52691
- 'net.nz',
52692
- 'org.nz',
52693
- 'co.za',
52694
- 'org.za',
52695
- 'com.mx',
52696
- 'com.ar',
52697
- 'com.co',
52698
- 'com.pe',
52699
- 'com.tr',
52700
- 'com.tw',
52701
- 'com.sg',
52702
- 'com.hk',
52703
- 'com.my',
52704
- 'com.ph',
52705
- 'com.vn',
52706
- 'co.kr',
52707
- 'co.il',
52708
- 'co.id',
52709
- 'co.th',
52710
- 'com.ua',
52711
- 'com.pl',
52712
- 'com.es',
52713
- ]);
52714
- const SCROLL_DEPTH_THROTTLE_MS = 200;
52715
- class AnalyticsTracking {
52716
- constructor(emit, options = {}) {
52717
- this.pageviewCleanups = [];
52718
- this.scrollCleanups = [];
52719
- this.engagementCleanups = [];
52720
- this.maxScrollDepth = 0;
52721
- this.scrollTicking = false;
52722
- this.lastScrollReport = 0;
52723
- this.engagementStart = 0;
52724
- this.engagementAccumulatedMs = 0;
52725
- this.engagementActive = false;
52726
- this.emit = emit;
52727
- this.respectDoNotTrack = options.respectDoNotTrack !== false;
52728
- this.propertyId = options.propertyId;
52729
- }
52730
- /**
52731
- * Enable the opinionated default auto-tracking set: pageviews, outbound
52732
- * links, scroll depth and active engagement time. Downloads must be opted
52733
- * into separately via `enableAutoDownloadTracking()` because the extension
52734
- * list is application-specific.
52735
- */
52736
- enableAllAutoTracking() {
52737
- this.enableAutoPageviews();
52738
- this.enableAutoOutboundTracking();
52739
- this.enableAutoScrollDepth();
52740
- this.enableAutoEngagementTime();
52741
- }
52742
- /**
52743
- * Track an event manually. Respects the DNT setting and swallows emitter
52744
- * exceptions so tracking failures never surface to the host page.
52745
- */
52746
- track(name, options) {
52747
- if (!this.canTrack()) {
52748
- return;
52749
- }
52750
- try {
52751
- this.emit(name, this.withPropertyId(options));
52752
- }
52753
- catch (error) {
52754
- console.warn('AnalyticsTracking: emitter threw', error);
52755
- }
52756
- }
52757
- /**
52758
- * Convenience wrapper for pageview-shaped events.
52759
- */
52760
- pageview(url, referrer) {
52761
- this.track('pageview', {
52762
- url: url !== null && url !== void 0 ? url : this.currentPageUrl(),
52763
- referrer: referrer !== null && referrer !== void 0 ? referrer : (typeof document !== 'undefined'
52764
- ? document.referrer
52765
- : undefined),
52766
- });
52767
- }
52768
- /**
52769
- * Enable SPA-aware pageview tracking. Fires an initial pageview on
52770
- * enable, then again on every `pushState`, `replaceState`, `popstate`
52771
- * or hashchange. Idempotent — repeat calls no-op.
52772
- */
52773
- enableAutoPageviews() {
52774
- if (this.pageviewCleanups.length > 0) {
52775
- return;
52776
- }
52777
- if (typeof window === 'undefined' || typeof history === 'undefined') {
52778
- return;
52779
- }
52780
- this.currentPath = this.currentPageUrl();
52781
- this.pageview();
52782
- const handleNavigation = () => {
52783
- const nextPath = this.currentPageUrl();
52784
- if (nextPath === this.currentPath) {
52785
- return;
52786
- }
52787
- const previous = this.currentPath;
52788
- this.currentPath = nextPath;
52789
- this.flushScrollDepth(previous);
52790
- this.flushEngagement(previous);
52791
- this.pageview(nextPath);
52792
- // flushEngagement no longer auto-restarts the timer (see its
52793
- // implementation note re: bfcache). SPA navigation stays on the
52794
- // same document, so restart engagement tracking for the new
52795
- // route as long as the tab is visible.
52796
- if (this.engagementCleanups.length > 0 &&
52797
- (typeof document === 'undefined' ||
52798
- document.visibilityState !== 'hidden')) {
52799
- this.startEngagement();
52800
- }
52801
- };
52802
- const originalPushState = history.pushState.bind(history);
52803
- const originalReplaceState = history.replaceState.bind(history);
52804
- // Our wrappers stay reachable after cleanup whenever another library
52805
- // patched on top of ours, so they have to be switchable off rather than
52806
- // merely unreferenced.
52807
- let patchActive = true;
52808
- const patchedPushState = (data, unused, url) => {
52809
- originalPushState(data, unused, url);
52810
- if (patchActive) {
52811
- handleNavigation();
52812
- }
52813
- };
52814
- const patchedReplaceState = (data, unused, url) => {
52815
- originalReplaceState(data, unused, url);
52816
- if (patchActive) {
52817
- handleNavigation();
52818
- }
52819
- };
52820
- history.pushState = patchedPushState;
52821
- history.replaceState = patchedReplaceState;
52822
- const popstateHandler = () => handleNavigation();
52823
- const hashchangeHandler = () => handleNavigation();
52824
- window.addEventListener('popstate', popstateHandler);
52825
- window.addEventListener('hashchange', hashchangeHandler);
52826
- this.pageviewCleanups.push(() => {
52827
- // Only unwind our own patch. A router (Next.js App Router, React
52828
- // Router, …) that patched these after us owns the current value,
52829
- // and assigning our saved reference back would silently throw its
52830
- // wrapper away. In that case ours stays in the chain, which is why
52831
- // `patchActive` exists: the wrapper keeps delegating to the original
52832
- // but stops reporting.
52833
- patchActive = false;
52834
- if (history.pushState === patchedPushState) {
52835
- history.pushState = originalPushState;
52836
- }
52837
- if (history.replaceState === patchedReplaceState) {
52838
- history.replaceState = originalReplaceState;
52839
- }
52840
- window.removeEventListener('popstate', popstateHandler);
52841
- window.removeEventListener('hashchange', hashchangeHandler);
52842
- });
52843
- }
52844
- /**
52845
- * Disable auto-pageview tracking installed by `enableAutoPageviews`.
52846
- * Safe to call when auto-pageviews were never enabled.
52847
- */
52848
- disableAutoPageviews() {
52849
- for (const cleanup of this.pageviewCleanups) {
52850
- cleanup();
52851
- }
52852
- this.pageviewCleanups = [];
52853
- }
52854
- /**
52855
- * Enable click-based outbound link tracking. Detects anchor clicks that
52856
- * navigate to a different origin and fires an `outbound_link` event
52857
- * (with `hostname` and `href` props) before the browser navigates.
52858
- */
52859
- enableAutoOutboundTracking(options = {}) {
52860
- if (this.outboundCleanup) {
52861
- return;
52862
- }
52863
- if (typeof document === 'undefined') {
52864
- return;
52865
- }
52866
- const includeSubdomains = options.includeSubdomains === true;
52867
- const clickHandler = (event) => {
52868
- const anchor = this.findAnchor(event.target);
52869
- if (!anchor || !anchor.href) {
52870
- return;
52871
- }
52872
- const target = this.parseUrl(anchor.href);
52873
- if (!target || !this.isExternal(target, includeSubdomains)) {
52874
- return;
52875
- }
52876
- this.track('outbound_link', {
52877
- url: target.href,
52878
- props: { hostname: target.hostname, href: target.href },
52879
- });
52880
- };
52881
- document.addEventListener('click', clickHandler, { capture: true });
52882
- this.outboundCleanup = () => document.removeEventListener('click', clickHandler, {
52883
- capture: true,
52884
- });
52885
- }
52886
- /**
52887
- * Disable outbound-link tracking installed by `enableAutoOutboundTracking`.
52888
- * Safe to call when auto-outbound was never enabled.
52889
- */
52890
- disableAutoOutboundTracking() {
52891
- if (this.outboundCleanup) {
52892
- this.outboundCleanup();
52893
- this.outboundCleanup = undefined;
52894
- }
52895
- }
52896
- /**
52897
- * Enable click-based download tracking. Detects anchor clicks that point
52898
- * at a file whose extension appears in the configured list and fires a
52899
- * `file_download` event with `filename`, `extension` and `href` props.
52900
- */
52901
- enableAutoDownloadTracking(options = {}) {
52902
- var _a;
52903
- if (this.downloadCleanup) {
52904
- return;
52905
- }
52906
- if (typeof document === 'undefined') {
52907
- return;
52908
- }
52909
- const extensions = ((_a = options.extensions) !== null && _a !== void 0 ? _a : DEFAULT_DOWNLOAD_EXTENSIONS).map((ext) => ext.toLowerCase().replace(/^\./, ''));
52910
- const extensionSet = new Set(extensions);
52911
- const clickHandler = (event) => {
52912
- var _a, _b;
52913
- const anchor = this.findAnchor(event.target);
52914
- if (!anchor || !anchor.href) {
52915
- return;
52916
- }
52917
- const url = this.parseUrl(anchor.href);
52918
- if (!url) {
52919
- return;
52920
- }
52921
- const filename = (_a = url.pathname.split('/').pop()) !== null && _a !== void 0 ? _a : '';
52922
- const extension = filename.includes('.')
52923
- ? (_b = filename.split('.').pop()) === null || _b === void 0 ? void 0 : _b.toLowerCase()
52924
- : undefined;
52925
- if (!extension || !extensionSet.has(extension)) {
52926
- return;
52927
- }
52928
- this.track('file_download', {
52929
- url: url.href,
52930
- props: { filename, extension, href: url.href },
52931
- });
52932
- };
52933
- document.addEventListener('click', clickHandler, { capture: true });
52934
- this.downloadCleanup = () => document.removeEventListener('click', clickHandler, {
52935
- capture: true,
52936
- });
52937
- }
52938
- /**
52939
- * Disable file-download tracking installed by `enableAutoDownloadTracking`.
52940
- * Safe to call when auto-download was never enabled.
52941
- */
52942
- disableAutoDownloadTracking() {
52943
- if (this.downloadCleanup) {
52944
- this.downloadCleanup();
52945
- this.downloadCleanup = undefined;
52946
- }
52947
- }
52948
- /**
52949
- * Enable passive scroll-depth tracking. Records the maximum percent of the
52950
- * document scrolled and reports it on `beforeunload` and on SPA route
52951
- * changes. Uses a throttled passive listener so it is safe on hot paths.
52952
- */
52953
- enableAutoScrollDepth() {
52954
- if (this.scrollCleanups.length > 0) {
52955
- return;
52956
- }
52957
- if (typeof window === 'undefined' || typeof document === 'undefined') {
52958
- return;
52959
- }
52960
- this.maxScrollDepth = 0;
52961
- this.lastScrollReport = 0;
52962
- const scrollHandler = () => {
52963
- if (this.scrollTicking) {
52964
- return;
52965
- }
52966
- this.scrollTicking = true;
52967
- window.requestAnimationFrame(() => {
52968
- const now = Date.now();
52969
- if (now - this.lastScrollReport < SCROLL_DEPTH_THROTTLE_MS) {
52970
- this.scrollTicking = false;
52971
- return;
52972
- }
52973
- this.lastScrollReport = now;
52974
- const depth = this.computeScrollDepth();
52975
- if (depth > this.maxScrollDepth) {
52976
- this.maxScrollDepth = depth;
52977
- }
52978
- this.scrollTicking = false;
52979
- });
52980
- };
52981
- const unloadHandler = () => {
52982
- this.flushScrollDepth(this.currentPageUrl());
52983
- };
52984
- window.addEventListener('scroll', scrollHandler, { passive: true });
52985
- window.addEventListener('beforeunload', unloadHandler);
52986
- window.addEventListener('pagehide', unloadHandler);
52987
- this.scrollCleanups.push(() => {
52988
- window.removeEventListener('scroll', scrollHandler);
52989
- window.removeEventListener('beforeunload', unloadHandler);
52990
- window.removeEventListener('pagehide', unloadHandler);
52991
- });
52992
- }
52993
- /**
52994
- * Disable scroll-depth tracking installed by `enableAutoScrollDepth`. Safe
52995
- * to call when auto-scroll-depth was never enabled. Any accumulated depth
52996
- * for the current page is dropped.
52997
- */
52998
- disableAutoScrollDepth() {
52999
- for (const cleanup of this.scrollCleanups) {
53000
- cleanup();
53001
- }
53002
- this.scrollCleanups = [];
53003
- this.maxScrollDepth = 0;
53004
- this.scrollTicking = false;
53005
- this.lastScrollReport = 0;
53006
- }
53007
- /**
53008
- * Enable active engagement-time tracking. Counts time the tab is visible
53009
- * and uses `visibilitychange` to exclude background time.
53010
- *
53011
- * Delivery follows Plausible's model rather than a single total at the
53012
- * end of the visit: an `engagement_time` event is emitted at every natural
53013
- * checkpoint — the tab going hidden, an SPA route change, and finally
53014
- * `beforeunload`/`pagehide`. Unload is kept only as a best-effort last
53015
- * flush; it is the least reliable moment to send anything (browsers
53016
- * routinely cancel in-flight requests there, and `sendBeacon` cannot set
53017
- * the `X-Appwrite-Project` header the endpoint requires), so it must never
53018
- * be the only delivery.
53019
- *
53020
- * Each event carries a **delta** — the seconds accrued since the previous
53021
- * flush, not a running total — so the values are additive per session and
53022
- * a lost event costs only its own slice.
53023
- *
53024
- * There is deliberately no periodic ping. The cadence is driven by
53025
- * navigation and tab switches, so request volume tracks what the visitor
53026
- * actually does instead of multiplying with time on page.
53027
- */
53028
- enableAutoEngagementTime() {
53029
- if (this.engagementCleanups.length > 0) {
53030
- return;
53031
- }
53032
- if (typeof window === 'undefined' || typeof document === 'undefined') {
53033
- return;
53034
- }
53035
- this.engagementAccumulatedMs = 0;
53036
- // Do not start the clock for a tab that is already hidden (prerender,
53037
- // background tab restore); `visibilitychange` starts it when it is
53038
- // actually looked at.
53039
- if (document.visibilityState !== 'hidden') {
53040
- this.startEngagement();
53041
- }
53042
- const visibilityHandler = () => {
53043
- if (document.visibilityState === 'hidden') {
53044
- // Flush, don't just pause. The page is still fully alive here,
53045
- // which makes this the most reliable delivery point in the
53046
- // whole visit — and it is the same moment Plausible reports on.
53047
- this.flushEngagement(this.currentPageUrl());
53048
- }
53049
- else if (document.visibilityState === 'visible') {
53050
- this.startEngagement();
53051
- }
53052
- };
53053
- const unloadHandler = () => {
53054
- this.flushEngagement(this.currentPageUrl());
53055
- };
53056
- const pageshowHandler = (event) => {
53057
- // When the page is restored from the back-forward cache the
53058
- // engagement timer is in a stopped state (flushEngagement paused
53059
- // it on pagehide and does not auto-restart). Kick off a fresh
53060
- // engagementStart so bfcache dwell time is not billed as
53061
- // engagement.
53062
- if (event.persisted) {
53063
- this.startEngagement();
53064
- }
53065
- };
53066
- document.addEventListener('visibilitychange', visibilityHandler);
53067
- window.addEventListener('beforeunload', unloadHandler);
53068
- window.addEventListener('pagehide', unloadHandler);
53069
- window.addEventListener('pageshow', pageshowHandler);
53070
- this.engagementCleanups.push(() => {
53071
- document.removeEventListener('visibilitychange', visibilityHandler);
53072
- window.removeEventListener('beforeunload', unloadHandler);
53073
- window.removeEventListener('pagehide', unloadHandler);
53074
- window.removeEventListener('pageshow', pageshowHandler);
53075
- });
53076
- }
53077
- /**
53078
- * Disable engagement-time tracking installed by `enableAutoEngagementTime`.
53079
- * Safe to call when auto-engagement was never enabled. Any accumulated
53080
- * engagement time is dropped without being emitted.
53081
- */
53082
- disableAutoEngagementTime() {
53083
- for (const cleanup of this.engagementCleanups) {
53084
- cleanup();
53085
- }
53086
- this.engagementCleanups = [];
53087
- this.engagementActive = false;
53088
- this.engagementAccumulatedMs = 0;
53089
- this.engagementStart = 0;
53090
- }
53091
- /**
53092
- * Merge the configured `propertyId` into an event's options. Returns the
53093
- * caller's object untouched when no default is configured (or the event
53094
- * already carries one), so emitters written against the pre-`propertyId`
53095
- * shape keep receiving exactly what they received before.
53096
- */
53097
- withPropertyId(options) {
53098
- if (this.propertyId === undefined ||
53099
- (options === null || options === void 0 ? void 0 : options.propertyId) !== undefined) {
53100
- return options;
53101
- }
53102
- return Object.assign(Object.assign({}, (options !== null && options !== void 0 ? options : {})), { propertyId: this.propertyId });
53103
- }
53104
- canTrack() {
53105
- if (!this.respectDoNotTrack) {
53106
- return true;
53107
- }
53108
- if (typeof navigator === 'undefined') {
53109
- return true;
53110
- }
53111
- return navigator.doNotTrack !== '1';
53112
- }
53113
- currentPageUrl() {
53114
- if (typeof window === 'undefined' || !window.location) {
53115
- return '';
53116
- }
53117
- return window.location.href;
53118
- }
53119
- findAnchor(target) {
53120
- let node = target;
53121
- while (node) {
53122
- if (node.tagName === 'A') {
53123
- return node;
53124
- }
53125
- node = node.parentNode;
53126
- }
53127
- return null;
53128
- }
53129
- parseUrl(href) {
53130
- try {
53131
- return new URL(href, window.location.href);
53132
- }
53133
- catch (_a) {
53134
- return null;
53135
- }
53136
- }
53137
- isExternal(target, includeSubdomains) {
53138
- if (target.protocol !== 'http:' && target.protocol !== 'https:') {
53139
- return false;
53140
- }
53141
- if (target.hostname === window.location.hostname) {
53142
- return false;
53143
- }
53144
- if (includeSubdomains) {
53145
- return true;
53146
- }
53147
- const root = this.rootDomain(window.location.hostname);
53148
- return this.rootDomain(target.hostname) !== root;
53149
- }
53150
- rootDomain(hostname) {
53151
- const parts = hostname.split('.');
53152
- if (parts.length <= 2) {
53153
- return hostname;
53154
- }
53155
- // Taking the last two labels is wrong wherever the registry sells names
53156
- // one level down: `shop.example.co.uk` and `google.co.uk` both reduce to
53157
- // `co.uk`, so every outbound click between two `.co.uk` sites looks
53158
- // internal and is dropped. Take three labels after a known two-part
53159
- // suffix instead.
53160
- //
53161
- // This is a heuristic, not the Public Suffix List — the full list is
53162
- // orders of magnitude larger than this whole file, and a tracking
53163
- // snippet cannot carry it. Sites on a suffix that is missing here can
53164
- // pass `includeSubdomains: true` to treat every other host as outbound.
53165
- const suffix = parts.slice(-2).join('.');
53166
- if (parts.length > 2 && MULTI_PART_SUFFIXES.has(suffix)) {
53167
- return parts.slice(-3).join('.');
53168
- }
53169
- return suffix;
53170
- }
53171
- computeScrollDepth() {
53172
- const scrollTop = window.scrollY || document.documentElement.scrollTop;
53173
- const viewport = window.innerHeight || document.documentElement.clientHeight;
53174
- const total = document.documentElement.scrollHeight;
53175
- if (total <= viewport) {
53176
- return 100;
53177
- }
53178
- const depth = Math.round(((scrollTop + viewport) / total) * 100);
53179
- return Math.max(0, Math.min(100, depth));
53180
- }
53181
- flushScrollDepth(url) {
53182
- if (this.scrollCleanups.length === 0) {
53183
- return;
53184
- }
53185
- if (this.maxScrollDepth <= 0) {
53186
- return;
53187
- }
53188
- this.track('scroll_depth', {
53189
- url,
53190
- scrollDepth: this.maxScrollDepth,
53191
- });
53192
- this.maxScrollDepth = 0;
53193
- }
53194
- startEngagement() {
53195
- if (this.engagementActive) {
53196
- return;
53197
- }
53198
- this.engagementActive = true;
53199
- this.engagementStart = Date.now();
53200
- }
53201
- pauseEngagement() {
53202
- if (!this.engagementActive) {
53203
- return;
53204
- }
53205
- this.engagementActive = false;
53206
- this.engagementAccumulatedMs += Date.now() - this.engagementStart;
53207
- }
53208
- flushEngagement(url) {
53209
- if (this.engagementCleanups.length === 0) {
53210
- return;
53211
- }
53212
- this.pauseEngagement();
53213
- // Deltas, not a running total: emit only what accrued since the last
53214
- // flush. `floor` plus keeping the sub-second remainder in the
53215
- // accumulator is what makes repeated flushes safe — nothing is emitted
53216
- // twice, and a visit chopped into many short segments does not lose a
53217
- // fraction of a second to rounding on every one of them.
53218
- const seconds = Math.floor(this.engagementAccumulatedMs / 1000);
53219
- if (seconds > 0) {
53220
- // Deduct before emitting so a synchronous emitter that re-enters
53221
- // (or throws) can never bill the same seconds again.
53222
- this.engagementAccumulatedMs -= seconds * 1000;
53223
- this.track('engagement_time', {
53224
- url,
53225
- engagementTime: seconds,
53226
- });
53227
- }
53228
- // NOTE: intentionally do NOT call startEngagement() here. flushEngagement
53229
- // runs on `pagehide`, which is also the last hook before the browser
53230
- // may freeze the page into the back-forward cache. Auto-restarting
53231
- // would snapshot engagementStart just before the freeze; the next
53232
- // pauseEngagement (after bfcache restore) would then bill the entire
53233
- // bfcache dwell as active engagement. Restart is driven by explicit
53234
- // resume signals: `pageshow` (with `persisted === true`),
53235
- // `visibilitychange` back to visible, or the SPA navigation flow in
53236
- // `enableAutoPageviews`.
53237
- }
53238
- }
53239
-
53240
50992
  /**
53241
50993
  * Helper class to generate permission strings for resources.
53242
50994
  */
@@ -53943,68 +51695,6 @@
53943
51695
  OAuthProvider["Zoom"] = "zoom";
53944
51696
  })(exports.OAuthProvider || (exports.OAuthProvider = {}));
53945
51697
 
53946
- exports.PlatformResourceType = void 0;
53947
- (function (PlatformResourceType) {
53948
- PlatformResourceType["Projects"] = "projects";
53949
- PlatformResourceType["Organizations"] = "organizations";
53950
- PlatformResourceType["Users"] = "users";
53951
- PlatformResourceType["Memberships"] = "memberships";
53952
- PlatformResourceType["Rules"] = "rules";
53953
- PlatformResourceType["Keys"] = "keys";
53954
- PlatformResourceType["Platforms"] = "platforms";
53955
- PlatformResourceType["Webhooks"] = "webhooks";
53956
- PlatformResourceType["Certificates"] = "certificates";
53957
- })(exports.PlatformResourceType || (exports.PlatformResourceType = {}));
53958
-
53959
- exports.ProjectResourceType = void 0;
53960
- (function (ProjectResourceType) {
53961
- ProjectResourceType["Users"] = "users";
53962
- ProjectResourceType["Teams"] = "teams";
53963
- ProjectResourceType["Memberships"] = "memberships";
53964
- ProjectResourceType["Databases"] = "databases";
53965
- ProjectResourceType["Buckets"] = "buckets";
53966
- ProjectResourceType["Functions"] = "functions";
53967
- ProjectResourceType["Sites"] = "sites";
53968
- ProjectResourceType["Deployments"] = "deployments";
53969
- ProjectResourceType["Topics"] = "topics";
53970
- ProjectResourceType["Providers"] = "providers";
53971
- ProjectResourceType["Messages"] = "messages";
53972
- })(exports.ProjectResourceType || (exports.ProjectResourceType = {}));
53973
-
53974
- exports.AnalyticsInterval = void 0;
53975
- (function (AnalyticsInterval) {
53976
- AnalyticsInterval["OneHour"] = "1h";
53977
- AnalyticsInterval["OneDay"] = "1d";
53978
- AnalyticsInterval["OneWeek"] = "1w";
53979
- AnalyticsInterval["OneMonth"] = "1m";
53980
- })(exports.AnalyticsInterval || (exports.AnalyticsInterval = {}));
53981
-
53982
- exports.AnalyticsDimension = void 0;
53983
- (function (AnalyticsDimension) {
53984
- AnalyticsDimension["Country"] = "country";
53985
- AnalyticsDimension["Region"] = "region";
53986
- AnalyticsDimension["City"] = "city";
53987
- AnalyticsDimension["Browser"] = "browser";
53988
- AnalyticsDimension["OperatingSystem"] = "operatingSystem";
53989
- AnalyticsDimension["Device"] = "device";
53990
- AnalyticsDimension["ScreenSize"] = "screenSize";
53991
- AnalyticsDimension["ReferrerSource"] = "referrerSource";
53992
- AnalyticsDimension["Channel"] = "channel";
53993
- AnalyticsDimension["UtmSource"] = "utmSource";
53994
- AnalyticsDimension["UtmMedium"] = "utmMedium";
53995
- AnalyticsDimension["UtmCampaign"] = "utmCampaign";
53996
- AnalyticsDimension["UtmContent"] = "utmContent";
53997
- AnalyticsDimension["UtmTerm"] = "utmTerm";
53998
- AnalyticsDimension["Page"] = "page";
53999
- AnalyticsDimension["Hostname"] = "hostname";
54000
- AnalyticsDimension["EntryPage"] = "entryPage";
54001
- AnalyticsDimension["ExitPage"] = "exitPage";
54002
- AnalyticsDimension["TrafficType"] = "trafficType";
54003
- AnalyticsDimension["BotName"] = "botName";
54004
- AnalyticsDimension["BotCategory"] = "botCategory";
54005
- AnalyticsDimension["EventName"] = "eventName";
54006
- })(exports.AnalyticsDimension || (exports.AnalyticsDimension = {}));
54007
-
54008
51698
  exports.Browser = void 0;
54009
51699
  (function (Browser) {
54010
51700
  Browser["AvantBrowser"] = "aa";
@@ -54820,14 +52510,6 @@
54820
52510
  QuerySuggestionResource["ResourceTokens"] = "resourcetokens";
54821
52511
  QuerySuggestionResource["Transactions"] = "transactions";
54822
52512
  QuerySuggestionResource["TransactionLogs"] = "transactionlogs";
54823
- QuerySuggestionResource["Videos"] = "videos";
54824
- QuerySuggestionResource["VideosPreviews"] = "videos_previews";
54825
- QuerySuggestionResource["VideosRenditions"] = "videos_renditions";
54826
- QuerySuggestionResource["VideosRenditionsSegments"] = "videos_renditions_segments";
54827
- QuerySuggestionResource["VideosProfiles"] = "videos_profiles";
54828
- QuerySuggestionResource["VideosSubtitles"] = "videos_subtitles";
54829
- QuerySuggestionResource["VideosSubtitlesSegments"] = "videos_subtitles_segments";
54830
- QuerySuggestionResource["AnalyticsProperties"] = "analyticsproperties";
54831
52513
  QuerySuggestionResource["DedicatedDatabases"] = "dedicateddatabases";
54832
52514
  QuerySuggestionResource["DedicatedDatabaseConfigs"] = "dedicateddatabaseconfigs";
54833
52515
  QuerySuggestionResource["DedicatedDatabaseRuntimes"] = "dedicateddatabaseruntimes";
@@ -55250,8 +52932,6 @@
55250
52932
  ProjectKeyScopes["ReportsWrite"] = "reports.write";
55251
52933
  ProjectKeyScopes["PresencesRead"] = "presences.read";
55252
52934
  ProjectKeyScopes["PresencesWrite"] = "presences.write";
55253
- ProjectKeyScopes["VideosRead"] = "videos.read";
55254
- ProjectKeyScopes["VideosWrite"] = "videos.write";
55255
52935
  ProjectKeyScopes["DedicatedDatabasesExecute"] = "dedicatedDatabases.execute";
55256
52936
  ProjectKeyScopes["BackupsPoliciesRead"] = "backups.policies.read";
55257
52937
  ProjectKeyScopes["BackupsPoliciesWrite"] = "backups.policies.write";
@@ -55270,8 +52950,6 @@
55270
52950
  ProjectKeyScopes["Oauth2Read"] = "oauth2.read";
55271
52951
  ProjectKeyScopes["Oauth2Write"] = "oauth2.write";
55272
52952
  ProjectKeyScopes["Oauth2Introspect"] = "oauth2.introspect";
55273
- ProjectKeyScopes["AnalyticsRead"] = "analytics.read";
55274
- ProjectKeyScopes["AnalyticsWrite"] = "analytics.write";
55275
52953
  })(exports.ProjectKeyScopes || (exports.ProjectKeyScopes = {}));
55276
52954
 
55277
52955
  exports.FunctionTemplateUseCase = void 0;
@@ -55908,9 +53586,6 @@
55908
53586
 
55909
53587
  exports.UsageEventMetric = void 0;
55910
53588
  (function (UsageEventMetric) {
55911
- UsageEventMetric["AnalyticsEvents"] = "analytics.events";
55912
- UsageEventMetric["AnalyticsPageviews"] = "analytics.pageviews";
55913
- UsageEventMetric["AnalyticsBotsEvents"] = "analytics.bots.events";
55914
53589
  UsageEventMetric["NetworkRequests"] = "network.requests";
55915
53590
  UsageEventMetric["NetworkInbound"] = "network.inbound";
55916
53591
  UsageEventMetric["NetworkOutbound"] = "network.outbound";
@@ -56028,7 +53703,6 @@
56028
53703
 
56029
53704
  exports.UsageGaugeMetric = void 0;
56030
53705
  (function (UsageGaugeMetric) {
56031
- UsageGaugeMetric["AnalyticsProperties"] = "analytics.properties";
56032
53706
  UsageGaugeMetric["Teams"] = "teams";
56033
53707
  UsageGaugeMetric["Users"] = "users";
56034
53708
  UsageGaugeMetric["Messages"] = "messages";
@@ -56126,24 +53800,6 @@
56126
53800
  VectorsDBIndexType["Unique"] = "unique";
56127
53801
  })(exports.VectorsDBIndexType || (exports.VectorsDBIndexType = {}));
56128
53802
 
56129
- exports.VideoOutput = void 0;
56130
- (function (VideoOutput) {
56131
- VideoOutput["Hls"] = "hls";
56132
- VideoOutput["Dash"] = "dash";
56133
- VideoOutput["Cmaf"] = "cmaf";
56134
- })(exports.VideoOutput || (exports.VideoOutput = {}));
56135
-
56136
- exports.VideoRenditionStatus = void 0;
56137
- (function (VideoRenditionStatus) {
56138
- VideoRenditionStatus["Pending"] = "pending";
56139
- VideoRenditionStatus["Started"] = "started";
56140
- VideoRenditionStatus["Ended"] = "ended";
56141
- VideoRenditionStatus["Uploading"] = "uploading";
56142
- VideoRenditionStatus["Ready"] = "ready";
56143
- VideoRenditionStatus["Error"] = "error";
56144
- VideoRenditionStatus["Aborted"] = "aborted";
56145
- })(exports.VideoRenditionStatus || (exports.VideoRenditionStatus = {}));
56146
-
56147
53803
  exports.DatabaseType = void 0;
56148
53804
  (function (DatabaseType) {
56149
53805
  DatabaseType["Legacy"] = "legacy";
@@ -56322,7 +53978,6 @@
56322
53978
  (function (ProxyRuleDeploymentResourceType) {
56323
53979
  ProxyRuleDeploymentResourceType["Function"] = "function";
56324
53980
  ProxyRuleDeploymentResourceType["Site"] = "site";
56325
- ProxyRuleDeploymentResourceType["DedicatedDatabase"] = "dedicatedDatabase";
56326
53981
  })(exports.ProxyRuleDeploymentResourceType || (exports.ProxyRuleDeploymentResourceType = {}));
56327
53982
 
56328
53983
  exports.ProxyRuleStatus = void 0;
@@ -58402,11 +56057,8 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
58402
56057
 
58403
56058
  exports.Account = Account;
58404
56059
  exports.Activities = Activities;
58405
- exports.Admin = Admin;
58406
56060
  exports.Advisor = Advisor;
58407
56061
  exports.Affiliates = Affiliates;
58408
- exports.Analytics = Analytics;
58409
- exports.AnalyticsTracking = AnalyticsTracking;
58410
56062
  exports.Apps = Apps;
58411
56063
  exports.AppwriteException = AppwriteException;
58412
56064
  exports.Assistant = Assistant;
@@ -58455,7 +56107,6 @@ In order to be iterable, non-array objects must have a [Symbol.iterator]() metho
58455
56107
  exports.Users = Users;
58456
56108
  exports.Vcs = Vcs;
58457
56109
  exports.VectorsDB = VectorsDB;
58458
- exports.Videos = Videos;
58459
56110
  exports.Waf = Waf;
58460
56111
  exports.Webhooks = Webhooks;
58461
56112