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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/esm/sdk.js CHANGED
@@ -667,7 +667,7 @@ class Client {
667
667
  'x-sdk-name': 'Console',
668
668
  'x-sdk-platform': 'console',
669
669
  'x-sdk-language': 'web',
670
- 'x-sdk-version': '18.2.0',
670
+ 'x-sdk-version': '18.3.0-rc.2',
671
671
  'X-Appwrite-Response-Format': '2.3.0',
672
672
  };
673
673
  this.realtime = {
@@ -1520,29 +1520,6 @@ class Client {
1520
1520
  }
1521
1521
  Client.CHUNK_SIZE = 1024 * 1024 * 5;
1522
1522
 
1523
- class Service {
1524
- constructor(client) {
1525
- this.client = client;
1526
- }
1527
- static flatten(data, prefix = '') {
1528
- let output = {};
1529
- for (const [key, value] of Object.entries(data)) {
1530
- const finalKey = prefix ? prefix + '[' + key + ']' : key;
1531
- if (Array.isArray(value)) {
1532
- output = Object.assign(Object.assign({}, output), Service.flatten(value, finalKey));
1533
- }
1534
- else {
1535
- output[finalKey] = value;
1536
- }
1537
- }
1538
- return output;
1539
- }
1540
- }
1541
- /**
1542
- * The size for chunked uploads in bytes.
1543
- */
1544
- Service.CHUNK_SIZE = 5 * 1024 * 1024; // 5MB
1545
-
1546
1523
  class Account {
1547
1524
  constructor(client) {
1548
1525
  this.client = client;
@@ -2861,6 +2838,196 @@ class Account {
2861
2838
  };
2862
2839
  return this.client.call('patch', uri, apiHeaders, apiPayload);
2863
2840
  }
2841
+ listPasskeys(paramsOrFirst, ...rest) {
2842
+ let params;
2843
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
2844
+ (paramsOrFirst &&
2845
+ typeof paramsOrFirst === 'object' &&
2846
+ !Array.isArray(paramsOrFirst))) {
2847
+ params = (paramsOrFirst || {});
2848
+ }
2849
+ else {
2850
+ params = {
2851
+ queries: paramsOrFirst,
2852
+ total: rest[0],
2853
+ };
2854
+ }
2855
+ const queries = params.queries;
2856
+ const total = params.total;
2857
+ const apiPath = '/account/passkeys';
2858
+ const apiPayload = {};
2859
+ if (typeof queries !== 'undefined') {
2860
+ apiPayload['queries'] = queries;
2861
+ }
2862
+ if (typeof total !== 'undefined') {
2863
+ apiPayload['total'] = total;
2864
+ }
2865
+ const uri = new URL(this.client.config.endpoint + apiPath);
2866
+ const apiHeaders = {
2867
+ 'X-Appwrite-Project': this.client.config.project,
2868
+ accept: 'application/json',
2869
+ };
2870
+ return this.client.call('get', uri, apiHeaders, apiPayload);
2871
+ }
2872
+ createPasskey(paramsOrFirst, ...rest) {
2873
+ let params;
2874
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
2875
+ (paramsOrFirst &&
2876
+ typeof paramsOrFirst === 'object' &&
2877
+ !Array.isArray(paramsOrFirst))) {
2878
+ params = (paramsOrFirst || {});
2879
+ }
2880
+ else {
2881
+ params = {
2882
+ passkeyId: paramsOrFirst,
2883
+ name: rest[0],
2884
+ };
2885
+ }
2886
+ const passkeyId = params.passkeyId;
2887
+ const name = params.name;
2888
+ const apiPath = '/account/passkeys';
2889
+ const apiPayload = {};
2890
+ if (typeof passkeyId !== 'undefined') {
2891
+ apiPayload['passkeyId'] = passkeyId;
2892
+ }
2893
+ if (typeof name !== 'undefined') {
2894
+ apiPayload['name'] = name;
2895
+ }
2896
+ const uri = new URL(this.client.config.endpoint + apiPath);
2897
+ const apiHeaders = {
2898
+ 'X-Appwrite-Project': this.client.config.project,
2899
+ 'content-type': 'application/json',
2900
+ accept: 'application/json',
2901
+ };
2902
+ return this.client.call('post', uri, apiHeaders, apiPayload);
2903
+ }
2904
+ getPasskey(paramsOrFirst) {
2905
+ let params;
2906
+ if (paramsOrFirst &&
2907
+ typeof paramsOrFirst === 'object' &&
2908
+ !Array.isArray(paramsOrFirst)) {
2909
+ params = (paramsOrFirst || {});
2910
+ }
2911
+ else {
2912
+ params = {
2913
+ passkeyId: paramsOrFirst,
2914
+ };
2915
+ }
2916
+ const passkeyId = params.passkeyId;
2917
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
2918
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
2919
+ }
2920
+ const apiPath = '/account/passkeys/{passkeyId}'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
2921
+ const apiPayload = {};
2922
+ const uri = new URL(this.client.config.endpoint + apiPath);
2923
+ const apiHeaders = {
2924
+ 'X-Appwrite-Project': this.client.config.project,
2925
+ accept: 'application/json',
2926
+ };
2927
+ return this.client.call('get', uri, apiHeaders, apiPayload);
2928
+ }
2929
+ updatePasskey(paramsOrFirst, ...rest) {
2930
+ let params;
2931
+ if (paramsOrFirst &&
2932
+ typeof paramsOrFirst === 'object' &&
2933
+ !Array.isArray(paramsOrFirst)) {
2934
+ params = (paramsOrFirst || {});
2935
+ }
2936
+ else {
2937
+ params = {
2938
+ passkeyId: paramsOrFirst,
2939
+ name: rest[0],
2940
+ };
2941
+ }
2942
+ const passkeyId = params.passkeyId;
2943
+ const name = params.name;
2944
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
2945
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
2946
+ }
2947
+ if (typeof name === 'undefined') {
2948
+ throw new AppwriteException('Missing required parameter: "name"');
2949
+ }
2950
+ const apiPath = '/account/passkeys/{passkeyId}'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
2951
+ const apiPayload = {};
2952
+ if (typeof name !== 'undefined') {
2953
+ apiPayload['name'] = name;
2954
+ }
2955
+ const uri = new URL(this.client.config.endpoint + apiPath);
2956
+ const apiHeaders = {
2957
+ 'X-Appwrite-Project': this.client.config.project,
2958
+ 'content-type': 'application/json',
2959
+ accept: 'application/json',
2960
+ };
2961
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
2962
+ }
2963
+ deletePasskey(paramsOrFirst) {
2964
+ let params;
2965
+ if (paramsOrFirst &&
2966
+ typeof paramsOrFirst === 'object' &&
2967
+ !Array.isArray(paramsOrFirst)) {
2968
+ params = (paramsOrFirst || {});
2969
+ }
2970
+ else {
2971
+ params = {
2972
+ passkeyId: paramsOrFirst,
2973
+ };
2974
+ }
2975
+ const passkeyId = params.passkeyId;
2976
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
2977
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
2978
+ }
2979
+ const apiPath = '/account/passkeys/{passkeyId}'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
2980
+ const apiPayload = {};
2981
+ const uri = new URL(this.client.config.endpoint + apiPath);
2982
+ const apiHeaders = {
2983
+ 'X-Appwrite-Project': this.client.config.project,
2984
+ 'content-type': 'application/json',
2985
+ accept: 'application/json',
2986
+ };
2987
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
2988
+ }
2989
+ updatePasskeyVerification(paramsOrFirst, ...rest) {
2990
+ let params;
2991
+ if (paramsOrFirst &&
2992
+ typeof paramsOrFirst === 'object' &&
2993
+ !Array.isArray(paramsOrFirst)) {
2994
+ params = (paramsOrFirst || {});
2995
+ }
2996
+ else {
2997
+ params = {
2998
+ passkeyId: paramsOrFirst,
2999
+ challengeId: rest[0],
3000
+ credential: rest[1],
3001
+ };
3002
+ }
3003
+ const passkeyId = params.passkeyId;
3004
+ const challengeId = params.challengeId;
3005
+ const credential = params.credential;
3006
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
3007
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
3008
+ }
3009
+ if (typeof challengeId === 'undefined') {
3010
+ throw new AppwriteException('Missing required parameter: "challengeId"');
3011
+ }
3012
+ if (typeof credential === 'undefined') {
3013
+ throw new AppwriteException('Missing required parameter: "credential"');
3014
+ }
3015
+ const apiPath = '/account/passkeys/{passkeyId}/verification'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
3016
+ const apiPayload = {};
3017
+ if (typeof challengeId !== 'undefined') {
3018
+ apiPayload['challengeId'] = challengeId;
3019
+ }
3020
+ if (typeof credential !== 'undefined') {
3021
+ apiPayload['credential'] = credential;
3022
+ }
3023
+ const uri = new URL(this.client.config.endpoint + apiPath);
3024
+ const apiHeaders = {
3025
+ 'X-Appwrite-Project': this.client.config.project,
3026
+ 'content-type': 'application/json',
3027
+ accept: 'application/json',
3028
+ };
3029
+ return this.client.call('put', uri, apiHeaders, apiPayload);
3030
+ }
2864
3031
  updatePassword(paramsOrFirst, ...rest) {
2865
3032
  let params;
2866
3033
  if (paramsOrFirst &&
@@ -3604,7 +3771,7 @@ class Account {
3604
3771
  }
3605
3772
  const uri = new URL(this.client.config.endpoint + apiPath);
3606
3773
  apiPayload['project'] = this.client.config.project;
3607
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
3774
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
3608
3775
  uri.searchParams.append(key, value);
3609
3776
  }
3610
3777
  if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {
@@ -4013,7 +4180,7 @@ class Account {
4013
4180
  }
4014
4181
  const uri = new URL(this.client.config.endpoint + apiPath);
4015
4182
  apiPayload['project'] = this.client.config.project;
4016
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
4183
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
4017
4184
  uri.searchParams.append(key, value);
4018
4185
  }
4019
4186
  if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {
@@ -4024,6 +4191,60 @@ class Account {
4024
4191
  return uri.toString();
4025
4192
  }
4026
4193
  }
4194
+ /**
4195
+ * Start signing in with a passkey. No email or user ID is needed: pass the returned `publicKey` options to `navigator.credentials.get()` and the user picks one of their passkeys. Then call [Update passkey token](/docs/references/cloud/client-web/account#updatePasskeyToken) with the credential to receive a token, and exchange it with [Create session](/docs/references/cloud/client-web/account#createSession). The challenge expires after 5 minutes.
4196
+ *
4197
+ * @throws {AppwriteException}
4198
+ * @returns {Promise<Models.PasskeyChallenge>}
4199
+ */
4200
+ createPasskeyToken() {
4201
+ const apiPath = '/account/tokens/passkey';
4202
+ const apiPayload = {};
4203
+ const uri = new URL(this.client.config.endpoint + apiPath);
4204
+ const apiHeaders = {
4205
+ 'X-Appwrite-Project': this.client.config.project,
4206
+ 'content-type': 'application/json',
4207
+ accept: 'application/json',
4208
+ };
4209
+ return this.client.call('post', uri, apiHeaders, apiPayload);
4210
+ }
4211
+ updatePasskeyToken(paramsOrFirst, ...rest) {
4212
+ let params;
4213
+ if (paramsOrFirst &&
4214
+ typeof paramsOrFirst === 'object' &&
4215
+ !Array.isArray(paramsOrFirst)) {
4216
+ params = (paramsOrFirst || {});
4217
+ }
4218
+ else {
4219
+ params = {
4220
+ challengeId: paramsOrFirst,
4221
+ credential: rest[0],
4222
+ };
4223
+ }
4224
+ const challengeId = params.challengeId;
4225
+ const credential = params.credential;
4226
+ if (typeof challengeId === 'undefined') {
4227
+ throw new AppwriteException('Missing required parameter: "challengeId"');
4228
+ }
4229
+ if (typeof credential === 'undefined') {
4230
+ throw new AppwriteException('Missing required parameter: "credential"');
4231
+ }
4232
+ const apiPath = '/account/tokens/passkey';
4233
+ const apiPayload = {};
4234
+ if (typeof challengeId !== 'undefined') {
4235
+ apiPayload['challengeId'] = challengeId;
4236
+ }
4237
+ if (typeof credential !== 'undefined') {
4238
+ apiPayload['credential'] = credential;
4239
+ }
4240
+ const uri = new URL(this.client.config.endpoint + apiPath);
4241
+ const apiHeaders = {
4242
+ 'X-Appwrite-Project': this.client.config.project,
4243
+ 'content-type': 'application/json',
4244
+ accept: 'application/json',
4245
+ };
4246
+ return this.client.call('put', uri, apiHeaders, apiPayload);
4247
+ }
4027
4248
  createPhoneToken(paramsOrFirst, ...rest) {
4028
4249
  let params;
4029
4250
  if (paramsOrFirst &&
@@ -4370,6 +4591,135 @@ class Activities {
4370
4591
  }
4371
4592
  }
4372
4593
 
4594
+ class Admin {
4595
+ constructor(client) {
4596
+ this.client = client;
4597
+ }
4598
+ /**
4599
+ * Delete everything cached from the platform database in the region serving the request.
4600
+ *
4601
+ * @throws {AppwriteException}
4602
+ * @returns {Promise<{}>}
4603
+ */
4604
+ deletePlatformCache() {
4605
+ const apiPath = '/admin/cache/platform';
4606
+ const apiPayload = {};
4607
+ const uri = new URL(this.client.config.endpoint + apiPath);
4608
+ const apiHeaders = {
4609
+ 'X-Appwrite-Project': this.client.config.project,
4610
+ 'content-type': 'application/json',
4611
+ accept: 'application/json',
4612
+ };
4613
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
4614
+ }
4615
+ deletePlatformResourceCache(paramsOrFirst, ...rest) {
4616
+ let params;
4617
+ if (paramsOrFirst &&
4618
+ typeof paramsOrFirst === 'object' &&
4619
+ !Array.isArray(paramsOrFirst) &&
4620
+ ('resourceType' in paramsOrFirst || 'resourceId' in paramsOrFirst)) {
4621
+ params = (paramsOrFirst || {});
4622
+ }
4623
+ else {
4624
+ params = {
4625
+ resourceType: paramsOrFirst,
4626
+ resourceId: rest[0],
4627
+ };
4628
+ }
4629
+ const resourceType = params.resourceType;
4630
+ const resourceId = params.resourceId;
4631
+ if (typeof resourceType === 'undefined') {
4632
+ throw new AppwriteException('Missing required parameter: "resourceType"');
4633
+ }
4634
+ const apiPath = '/admin/cache/platform/resources';
4635
+ const apiPayload = {};
4636
+ if (typeof resourceType !== 'undefined') {
4637
+ apiPayload['resourceType'] = resourceType;
4638
+ }
4639
+ if (typeof resourceId !== 'undefined') {
4640
+ apiPayload['resourceId'] = resourceId;
4641
+ }
4642
+ const uri = new URL(this.client.config.endpoint + apiPath);
4643
+ const apiHeaders = {
4644
+ 'X-Appwrite-Project': this.client.config.project,
4645
+ 'content-type': 'application/json',
4646
+ accept: 'application/json',
4647
+ };
4648
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
4649
+ }
4650
+ deleteProjectCache(paramsOrFirst) {
4651
+ let params;
4652
+ if (paramsOrFirst &&
4653
+ typeof paramsOrFirst === 'object' &&
4654
+ !Array.isArray(paramsOrFirst)) {
4655
+ params = (paramsOrFirst || {});
4656
+ }
4657
+ else {
4658
+ params = {
4659
+ projectId: paramsOrFirst,
4660
+ };
4661
+ }
4662
+ const projectId = params.projectId;
4663
+ if (typeof projectId === 'undefined') {
4664
+ throw new AppwriteException('Missing required parameter: "projectId"');
4665
+ }
4666
+ const apiPath = '/admin/cache/project';
4667
+ const apiPayload = {};
4668
+ if (typeof projectId !== 'undefined') {
4669
+ apiPayload['projectId'] = projectId;
4670
+ }
4671
+ const uri = new URL(this.client.config.endpoint + apiPath);
4672
+ const apiHeaders = {
4673
+ 'X-Appwrite-Project': this.client.config.project,
4674
+ 'content-type': 'application/json',
4675
+ accept: 'application/json',
4676
+ };
4677
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
4678
+ }
4679
+ deleteProjectResourceCache(paramsOrFirst, ...rest) {
4680
+ let params;
4681
+ if (paramsOrFirst &&
4682
+ typeof paramsOrFirst === 'object' &&
4683
+ !Array.isArray(paramsOrFirst)) {
4684
+ params = (paramsOrFirst || {});
4685
+ }
4686
+ else {
4687
+ params = {
4688
+ projectId: paramsOrFirst,
4689
+ resourceType: rest[0],
4690
+ resourceId: rest[1],
4691
+ };
4692
+ }
4693
+ const projectId = params.projectId;
4694
+ const resourceType = params.resourceType;
4695
+ const resourceId = params.resourceId;
4696
+ if (typeof projectId === 'undefined') {
4697
+ throw new AppwriteException('Missing required parameter: "projectId"');
4698
+ }
4699
+ if (typeof resourceType === 'undefined') {
4700
+ throw new AppwriteException('Missing required parameter: "resourceType"');
4701
+ }
4702
+ const apiPath = '/admin/cache/project/resources';
4703
+ const apiPayload = {};
4704
+ if (typeof projectId !== 'undefined') {
4705
+ apiPayload['projectId'] = projectId;
4706
+ }
4707
+ if (typeof resourceType !== 'undefined') {
4708
+ apiPayload['resourceType'] = resourceType;
4709
+ }
4710
+ if (typeof resourceId !== 'undefined') {
4711
+ apiPayload['resourceId'] = resourceId;
4712
+ }
4713
+ const uri = new URL(this.client.config.endpoint + apiPath);
4714
+ const apiHeaders = {
4715
+ 'X-Appwrite-Project': this.client.config.project,
4716
+ 'content-type': 'application/json',
4717
+ accept: 'application/json',
4718
+ };
4719
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
4720
+ }
4721
+ }
4722
+
4373
4723
  class Affiliates {
4374
4724
  constructor(client) {
4375
4725
  this.client = client;
@@ -4581,6 +4931,369 @@ class Affiliates {
4581
4931
  }
4582
4932
  }
4583
4933
 
4934
+ class Analytics {
4935
+ constructor(client) {
4936
+ this.client = client;
4937
+ }
4938
+ listProperties(paramsOrFirst, ...rest) {
4939
+ let params;
4940
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
4941
+ (paramsOrFirst &&
4942
+ typeof paramsOrFirst === 'object' &&
4943
+ !Array.isArray(paramsOrFirst))) {
4944
+ params = (paramsOrFirst || {});
4945
+ }
4946
+ else {
4947
+ params = {
4948
+ queries: paramsOrFirst,
4949
+ search: rest[0],
4950
+ total: rest[1],
4951
+ };
4952
+ }
4953
+ const queries = params.queries;
4954
+ const search = params.search;
4955
+ const total = params.total;
4956
+ const apiPath = '/analytics/properties';
4957
+ const apiPayload = {};
4958
+ if (typeof queries !== 'undefined') {
4959
+ apiPayload['queries'] = queries;
4960
+ }
4961
+ if (typeof search !== 'undefined') {
4962
+ apiPayload['search'] = search;
4963
+ }
4964
+ if (typeof total !== 'undefined') {
4965
+ apiPayload['total'] = total;
4966
+ }
4967
+ const uri = new URL(this.client.config.endpoint + apiPath);
4968
+ const apiHeaders = {
4969
+ 'X-Appwrite-Project': this.client.config.project,
4970
+ accept: 'application/json',
4971
+ };
4972
+ return this.client.call('get', uri, apiHeaders, apiPayload);
4973
+ }
4974
+ createProperty(paramsOrFirst, ...rest) {
4975
+ let params;
4976
+ if (paramsOrFirst &&
4977
+ typeof paramsOrFirst === 'object' &&
4978
+ !Array.isArray(paramsOrFirst)) {
4979
+ params = (paramsOrFirst || {});
4980
+ }
4981
+ else {
4982
+ params = {
4983
+ propertyId: paramsOrFirst,
4984
+ name: rest[0],
4985
+ domain: rest[1],
4986
+ timezone: rest[2],
4987
+ enabled: rest[3],
4988
+ xpublic: rest[4],
4989
+ allowedOrigins: rest[5],
4990
+ };
4991
+ }
4992
+ const propertyId = params.propertyId;
4993
+ const name = params.name;
4994
+ const domain = params.domain;
4995
+ const timezone = params.timezone;
4996
+ const enabled = params.enabled;
4997
+ const xpublic = params.xpublic;
4998
+ const allowedOrigins = params.allowedOrigins;
4999
+ if (typeof propertyId === 'undefined') {
5000
+ throw new AppwriteException('Missing required parameter: "propertyId"');
5001
+ }
5002
+ if (typeof name === 'undefined') {
5003
+ throw new AppwriteException('Missing required parameter: "name"');
5004
+ }
5005
+ const apiPath = '/analytics/properties';
5006
+ const apiPayload = {};
5007
+ if (typeof propertyId !== 'undefined') {
5008
+ apiPayload['propertyId'] = propertyId;
5009
+ }
5010
+ if (typeof name !== 'undefined') {
5011
+ apiPayload['name'] = name;
5012
+ }
5013
+ if (typeof domain !== 'undefined') {
5014
+ apiPayload['domain'] = domain;
5015
+ }
5016
+ if (typeof timezone !== 'undefined') {
5017
+ apiPayload['timezone'] = timezone;
5018
+ }
5019
+ if (typeof enabled !== 'undefined') {
5020
+ apiPayload['enabled'] = enabled;
5021
+ }
5022
+ if (typeof xpublic !== 'undefined') {
5023
+ apiPayload['public'] = xpublic;
5024
+ }
5025
+ if (typeof allowedOrigins !== 'undefined') {
5026
+ apiPayload['allowedOrigins'] = allowedOrigins;
5027
+ }
5028
+ const uri = new URL(this.client.config.endpoint + apiPath);
5029
+ const apiHeaders = {
5030
+ 'X-Appwrite-Project': this.client.config.project,
5031
+ 'content-type': 'application/json',
5032
+ accept: 'application/json',
5033
+ };
5034
+ return this.client.call('post', uri, apiHeaders, apiPayload);
5035
+ }
5036
+ getProperty(paramsOrFirst) {
5037
+ let params;
5038
+ if (paramsOrFirst &&
5039
+ typeof paramsOrFirst === 'object' &&
5040
+ !Array.isArray(paramsOrFirst)) {
5041
+ params = (paramsOrFirst || {});
5042
+ }
5043
+ else {
5044
+ params = {
5045
+ propertyId: paramsOrFirst,
5046
+ };
5047
+ }
5048
+ const propertyId = params.propertyId;
5049
+ if (typeof propertyId === 'undefined' || propertyId === '') {
5050
+ throw new AppwriteException('Missing required parameter: "propertyId"');
5051
+ }
5052
+ const apiPath = '/analytics/properties/{propertyId}'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
5053
+ const apiPayload = {};
5054
+ const uri = new URL(this.client.config.endpoint + apiPath);
5055
+ const apiHeaders = {
5056
+ 'X-Appwrite-Project': this.client.config.project,
5057
+ accept: 'application/json',
5058
+ };
5059
+ return this.client.call('get', uri, apiHeaders, apiPayload);
5060
+ }
5061
+ updateProperty(paramsOrFirst, ...rest) {
5062
+ let params;
5063
+ if (paramsOrFirst &&
5064
+ typeof paramsOrFirst === 'object' &&
5065
+ !Array.isArray(paramsOrFirst)) {
5066
+ params = (paramsOrFirst || {});
5067
+ }
5068
+ else {
5069
+ params = {
5070
+ propertyId: paramsOrFirst,
5071
+ name: rest[0],
5072
+ domain: rest[1],
5073
+ timezone: rest[2],
5074
+ enabled: rest[3],
5075
+ xpublic: rest[4],
5076
+ allowedOrigins: rest[5],
5077
+ };
5078
+ }
5079
+ const propertyId = params.propertyId;
5080
+ const name = params.name;
5081
+ const domain = params.domain;
5082
+ const timezone = params.timezone;
5083
+ const enabled = params.enabled;
5084
+ const xpublic = params.xpublic;
5085
+ const allowedOrigins = params.allowedOrigins;
5086
+ if (typeof propertyId === 'undefined' || propertyId === '') {
5087
+ throw new AppwriteException('Missing required parameter: "propertyId"');
5088
+ }
5089
+ const apiPath = '/analytics/properties/{propertyId}'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
5090
+ const apiPayload = {};
5091
+ if (typeof name !== 'undefined') {
5092
+ apiPayload['name'] = name;
5093
+ }
5094
+ if (typeof domain !== 'undefined') {
5095
+ apiPayload['domain'] = domain;
5096
+ }
5097
+ if (typeof timezone !== 'undefined') {
5098
+ apiPayload['timezone'] = timezone;
5099
+ }
5100
+ if (typeof enabled !== 'undefined') {
5101
+ apiPayload['enabled'] = enabled;
5102
+ }
5103
+ if (typeof xpublic !== 'undefined') {
5104
+ apiPayload['public'] = xpublic;
5105
+ }
5106
+ if (typeof allowedOrigins !== 'undefined') {
5107
+ apiPayload['allowedOrigins'] = allowedOrigins;
5108
+ }
5109
+ const uri = new URL(this.client.config.endpoint + apiPath);
5110
+ const apiHeaders = {
5111
+ 'X-Appwrite-Project': this.client.config.project,
5112
+ 'content-type': 'application/json',
5113
+ accept: 'application/json',
5114
+ };
5115
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
5116
+ }
5117
+ deleteProperty(paramsOrFirst) {
5118
+ let params;
5119
+ if (paramsOrFirst &&
5120
+ typeof paramsOrFirst === 'object' &&
5121
+ !Array.isArray(paramsOrFirst)) {
5122
+ params = (paramsOrFirst || {});
5123
+ }
5124
+ else {
5125
+ params = {
5126
+ propertyId: paramsOrFirst,
5127
+ };
5128
+ }
5129
+ const propertyId = params.propertyId;
5130
+ if (typeof propertyId === 'undefined' || propertyId === '') {
5131
+ throw new AppwriteException('Missing required parameter: "propertyId"');
5132
+ }
5133
+ const apiPath = '/analytics/properties/{propertyId}'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
5134
+ const apiPayload = {};
5135
+ const uri = new URL(this.client.config.endpoint + apiPath);
5136
+ const apiHeaders = {
5137
+ 'X-Appwrite-Project': this.client.config.project,
5138
+ 'content-type': 'application/json',
5139
+ accept: 'application/json',
5140
+ };
5141
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
5142
+ }
5143
+ createEvent(paramsOrFirst, ...rest) {
5144
+ let params;
5145
+ if (paramsOrFirst &&
5146
+ typeof paramsOrFirst === 'object' &&
5147
+ !Array.isArray(paramsOrFirst)) {
5148
+ params = (paramsOrFirst || {});
5149
+ }
5150
+ else {
5151
+ params = {
5152
+ propertyId: paramsOrFirst,
5153
+ name: rest[0],
5154
+ url: rest[1],
5155
+ domain: rest[2],
5156
+ referrer: rest[3],
5157
+ screenWidth: rest[4],
5158
+ sessionHash: rest[5],
5159
+ scrollDepth: rest[6],
5160
+ engagementTime: rest[7],
5161
+ props: rest[8],
5162
+ userId: rest[9],
5163
+ ip: rest[10],
5164
+ userAgent: rest[11],
5165
+ };
5166
+ }
5167
+ const propertyId = params.propertyId;
5168
+ const name = params.name;
5169
+ const url = params.url;
5170
+ const domain = params.domain;
5171
+ const referrer = params.referrer;
5172
+ const screenWidth = params.screenWidth;
5173
+ const sessionHash = params.sessionHash;
5174
+ const scrollDepth = params.scrollDepth;
5175
+ const engagementTime = params.engagementTime;
5176
+ const props = params.props;
5177
+ const userId = params.userId;
5178
+ const ip = params.ip;
5179
+ const userAgent = params.userAgent;
5180
+ if (typeof propertyId === 'undefined' || propertyId === '') {
5181
+ throw new AppwriteException('Missing required parameter: "propertyId"');
5182
+ }
5183
+ if (typeof name === 'undefined') {
5184
+ throw new AppwriteException('Missing required parameter: "name"');
5185
+ }
5186
+ if (typeof url === 'undefined') {
5187
+ throw new AppwriteException('Missing required parameter: "url"');
5188
+ }
5189
+ const apiPath = '/analytics/properties/{propertyId}/events'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
5190
+ const apiPayload = {};
5191
+ if (typeof name !== 'undefined') {
5192
+ apiPayload['name'] = name;
5193
+ }
5194
+ if (typeof url !== 'undefined') {
5195
+ apiPayload['url'] = url;
5196
+ }
5197
+ if (typeof domain !== 'undefined') {
5198
+ apiPayload['domain'] = domain;
5199
+ }
5200
+ if (typeof referrer !== 'undefined') {
5201
+ apiPayload['referrer'] = referrer;
5202
+ }
5203
+ if (typeof screenWidth !== 'undefined') {
5204
+ apiPayload['screenWidth'] = screenWidth;
5205
+ }
5206
+ if (typeof sessionHash !== 'undefined') {
5207
+ apiPayload['sessionHash'] = sessionHash;
5208
+ }
5209
+ if (typeof scrollDepth !== 'undefined') {
5210
+ apiPayload['scrollDepth'] = scrollDepth;
5211
+ }
5212
+ if (typeof engagementTime !== 'undefined') {
5213
+ apiPayload['engagementTime'] = engagementTime;
5214
+ }
5215
+ if (typeof props !== 'undefined') {
5216
+ apiPayload['props'] = props;
5217
+ }
5218
+ if (typeof userId !== 'undefined') {
5219
+ apiPayload['userId'] = userId;
5220
+ }
5221
+ if (typeof ip !== 'undefined') {
5222
+ apiPayload['ip'] = ip;
5223
+ }
5224
+ if (typeof userAgent !== 'undefined') {
5225
+ apiPayload['userAgent'] = userAgent;
5226
+ }
5227
+ const uri = new URL(this.client.config.endpoint + apiPath);
5228
+ const apiHeaders = {
5229
+ 'X-Appwrite-Project': this.client.config.project,
5230
+ 'content-type': 'application/json',
5231
+ accept: 'application/json',
5232
+ };
5233
+ return this.client.call('post', uri, apiHeaders, apiPayload);
5234
+ }
5235
+ listMetrics(paramsOrFirst, ...rest) {
5236
+ let params;
5237
+ if (paramsOrFirst &&
5238
+ typeof paramsOrFirst === 'object' &&
5239
+ !Array.isArray(paramsOrFirst)) {
5240
+ params = (paramsOrFirst || {});
5241
+ }
5242
+ else {
5243
+ params = {
5244
+ propertyId: paramsOrFirst,
5245
+ queries: rest[0],
5246
+ interval: rest[1],
5247
+ dimensions: rest[2],
5248
+ dateRange: rest[3],
5249
+ startAt: rest[4],
5250
+ endAt: rest[5],
5251
+ limit: rest[6],
5252
+ };
5253
+ }
5254
+ const propertyId = params.propertyId;
5255
+ const queries = params.queries;
5256
+ const interval = params.interval;
5257
+ const dimensions = params.dimensions;
5258
+ const dateRange = params.dateRange;
5259
+ const startAt = params.startAt;
5260
+ const endAt = params.endAt;
5261
+ const limit = params.limit;
5262
+ if (typeof propertyId === 'undefined' || propertyId === '') {
5263
+ throw new AppwriteException('Missing required parameter: "propertyId"');
5264
+ }
5265
+ const apiPath = '/analytics/properties/{propertyId}/metrics'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
5266
+ const apiPayload = {};
5267
+ if (typeof queries !== 'undefined') {
5268
+ apiPayload['queries'] = queries;
5269
+ }
5270
+ if (typeof interval !== 'undefined') {
5271
+ apiPayload['interval'] = interval;
5272
+ }
5273
+ if (typeof dimensions !== 'undefined') {
5274
+ apiPayload['dimensions'] = dimensions;
5275
+ }
5276
+ if (typeof dateRange !== 'undefined') {
5277
+ apiPayload['dateRange'] = dateRange;
5278
+ }
5279
+ if (typeof startAt !== 'undefined') {
5280
+ apiPayload['startAt'] = startAt;
5281
+ }
5282
+ if (typeof endAt !== 'undefined') {
5283
+ apiPayload['endAt'] = endAt;
5284
+ }
5285
+ if (typeof limit !== 'undefined') {
5286
+ apiPayload['limit'] = limit;
5287
+ }
5288
+ const uri = new URL(this.client.config.endpoint + apiPath);
5289
+ const apiHeaders = {
5290
+ 'X-Appwrite-Project': this.client.config.project,
5291
+ accept: 'application/json',
5292
+ };
5293
+ return this.client.call('get', uri, apiHeaders, apiPayload);
5294
+ }
5295
+ }
5296
+
4584
5297
  class Apps {
4585
5298
  constructor(client) {
4586
5299
  this.client = client;
@@ -5473,7 +6186,7 @@ class Avatars {
5473
6186
  const uri = new URL(this.client.config.endpoint + apiPath);
5474
6187
  apiPayload['project'] = this.client.config.project;
5475
6188
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5476
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6189
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5477
6190
  uri.searchParams.append(key, value);
5478
6191
  }
5479
6192
  return uri.toString();
@@ -5518,7 +6231,7 @@ class Avatars {
5518
6231
  const uri = new URL(this.client.config.endpoint + apiPath);
5519
6232
  apiPayload['project'] = this.client.config.project;
5520
6233
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5521
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6234
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5522
6235
  uri.searchParams.append(key, value);
5523
6236
  }
5524
6237
  return uri.toString();
@@ -5547,7 +6260,7 @@ class Avatars {
5547
6260
  const uri = new URL(this.client.config.endpoint + apiPath);
5548
6261
  apiPayload['project'] = this.client.config.project;
5549
6262
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5550
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6263
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5551
6264
  uri.searchParams.append(key, value);
5552
6265
  }
5553
6266
  return uri.toString();
@@ -5592,7 +6305,7 @@ class Avatars {
5592
6305
  const uri = new URL(this.client.config.endpoint + apiPath);
5593
6306
  apiPayload['project'] = this.client.config.project;
5594
6307
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5595
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6308
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5596
6309
  uri.searchParams.append(key, value);
5597
6310
  }
5598
6311
  return uri.toString();
@@ -5631,7 +6344,7 @@ class Avatars {
5631
6344
  const uri = new URL(this.client.config.endpoint + apiPath);
5632
6345
  apiPayload['project'] = this.client.config.project;
5633
6346
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5634
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6347
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5635
6348
  uri.searchParams.append(key, value);
5636
6349
  }
5637
6350
  return uri.toString();
@@ -5673,7 +6386,7 @@ class Avatars {
5673
6386
  const uri = new URL(this.client.config.endpoint + apiPath);
5674
6387
  apiPayload['project'] = this.client.config.project;
5675
6388
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5676
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6389
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5677
6390
  uri.searchParams.append(key, value);
5678
6391
  }
5679
6392
  return uri.toString();
@@ -5735,7 +6448,7 @@ class Avatars {
5735
6448
  const uri = new URL(this.client.config.endpoint + apiPath);
5736
6449
  apiPayload['project'] = this.client.config.project;
5737
6450
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5738
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6451
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5739
6452
  uri.searchParams.append(key, value);
5740
6453
  }
5741
6454
  return uri.toString();
@@ -5829,7 +6542,7 @@ class Avatars {
5829
6542
  const uri = new URL(this.client.config.endpoint + apiPath);
5830
6543
  apiPayload['project'] = this.client.config.project;
5831
6544
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5832
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6545
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5833
6546
  uri.searchParams.append(key, value);
5834
6547
  }
5835
6548
  return uri.toString();
@@ -5953,7 +6666,7 @@ class Avatars {
5953
6666
  const uri = new URL(this.client.config.endpoint + apiPath);
5954
6667
  apiPayload['project'] = this.client.config.project;
5955
6668
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5956
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6669
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5957
6670
  uri.searchParams.append(key, value);
5958
6671
  }
5959
6672
  return uri.toString();
@@ -15529,7 +16242,7 @@ class Functions {
15529
16242
  const uri = new URL(this.client.config.endpoint + apiPath);
15530
16243
  apiPayload['project'] = this.client.config.project;
15531
16244
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
15532
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
16245
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
15533
16246
  uri.searchParams.append(key, value);
15534
16247
  }
15535
16248
  return uri.toString();
@@ -26168,7 +26881,7 @@ class Organizations {
26168
26881
  const uri = new URL(this.client.config.endpoint + apiPath);
26169
26882
  apiPayload['project'] = this.client.config.project;
26170
26883
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
26171
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
26884
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
26172
26885
  uri.searchParams.append(key, value);
26173
26886
  }
26174
26887
  return uri.toString();
@@ -26275,7 +26988,7 @@ class Organizations {
26275
26988
  const uri = new URL(this.client.config.endpoint + apiPath);
26276
26989
  apiPayload['project'] = this.client.config.project;
26277
26990
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
26278
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
26991
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
26279
26992
  uri.searchParams.append(key, value);
26280
26993
  }
26281
26994
  return uri.toString();
@@ -31771,6 +32484,38 @@ class Project {
31771
32484
  };
31772
32485
  return this.client.call('patch', uri, apiHeaders, apiPayload);
31773
32486
  }
32487
+ updatePasskeyPolicy(paramsOrFirst, ...rest) {
32488
+ let params;
32489
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
32490
+ (paramsOrFirst &&
32491
+ typeof paramsOrFirst === 'object' &&
32492
+ !Array.isArray(paramsOrFirst))) {
32493
+ params = (paramsOrFirst || {});
32494
+ }
32495
+ else {
32496
+ params = {
32497
+ rpId: paramsOrFirst,
32498
+ origins: rest[0],
32499
+ };
32500
+ }
32501
+ const rpId = params.rpId;
32502
+ const origins = params.origins;
32503
+ const apiPath = '/project/policies/passkey';
32504
+ const apiPayload = {};
32505
+ if (typeof rpId !== 'undefined') {
32506
+ apiPayload['rpId'] = rpId;
32507
+ }
32508
+ if (typeof origins !== 'undefined') {
32509
+ apiPayload['origins'] = origins;
32510
+ }
32511
+ const uri = new URL(this.client.config.endpoint + apiPath);
32512
+ const apiHeaders = {
32513
+ 'X-Appwrite-Project': this.client.config.project,
32514
+ 'content-type': 'application/json',
32515
+ accept: 'application/json',
32516
+ };
32517
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
32518
+ }
31774
32519
  updatePasswordDictionaryPolicy(paramsOrFirst) {
31775
32520
  let params;
31776
32521
  if (paramsOrFirst &&
@@ -34459,7 +35204,7 @@ class Sites {
34459
35204
  const uri = new URL(this.client.config.endpoint + apiPath);
34460
35205
  apiPayload['project'] = this.client.config.project;
34461
35206
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
34462
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
35207
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
34463
35208
  uri.searchParams.append(key, value);
34464
35209
  }
34465
35210
  return uri.toString();
@@ -35290,7 +36035,7 @@ class Storage {
35290
36035
  const uri = new URL(this.client.config.endpoint + apiPath);
35291
36036
  apiPayload['project'] = this.client.config.project;
35292
36037
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
35293
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
36038
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
35294
36039
  uri.searchParams.append(key, value);
35295
36040
  }
35296
36041
  return uri.toString();
@@ -35383,7 +36128,7 @@ class Storage {
35383
36128
  const uri = new URL(this.client.config.endpoint + apiPath);
35384
36129
  apiPayload['project'] = this.client.config.project;
35385
36130
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
35386
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
36131
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
35387
36132
  uri.searchParams.append(key, value);
35388
36133
  }
35389
36134
  return uri.toString();
@@ -35421,7 +36166,7 @@ class Storage {
35421
36166
  const uri = new URL(this.client.config.endpoint + apiPath);
35422
36167
  apiPayload['project'] = this.client.config.project;
35423
36168
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
35424
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
36169
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
35425
36170
  uri.searchParams.append(key, value);
35426
36171
  }
35427
36172
  return uri.toString();
@@ -41732,6 +42477,106 @@ class Users {
41732
42477
  };
41733
42478
  return this.client.call('patch', uri, apiHeaders, apiPayload);
41734
42479
  }
42480
+ listPasskeys(paramsOrFirst, ...rest) {
42481
+ let params;
42482
+ if (paramsOrFirst &&
42483
+ typeof paramsOrFirst === 'object' &&
42484
+ !Array.isArray(paramsOrFirst)) {
42485
+ params = (paramsOrFirst || {});
42486
+ }
42487
+ else {
42488
+ params = {
42489
+ userId: paramsOrFirst,
42490
+ queries: rest[0],
42491
+ total: rest[1],
42492
+ };
42493
+ }
42494
+ const userId = params.userId;
42495
+ const queries = params.queries;
42496
+ const total = params.total;
42497
+ if (typeof userId === 'undefined' || userId === '') {
42498
+ throw new AppwriteException('Missing required parameter: "userId"');
42499
+ }
42500
+ const apiPath = '/users/{userId}/passkeys'.replace('{userId}', encodeURIComponent(String(userId)));
42501
+ const apiPayload = {};
42502
+ if (typeof queries !== 'undefined') {
42503
+ apiPayload['queries'] = queries;
42504
+ }
42505
+ if (typeof total !== 'undefined') {
42506
+ apiPayload['total'] = total;
42507
+ }
42508
+ const uri = new URL(this.client.config.endpoint + apiPath);
42509
+ const apiHeaders = {
42510
+ 'X-Appwrite-Project': this.client.config.project,
42511
+ accept: 'application/json',
42512
+ };
42513
+ return this.client.call('get', uri, apiHeaders, apiPayload);
42514
+ }
42515
+ getPasskey(paramsOrFirst, ...rest) {
42516
+ let params;
42517
+ if (paramsOrFirst &&
42518
+ typeof paramsOrFirst === 'object' &&
42519
+ !Array.isArray(paramsOrFirst)) {
42520
+ params = (paramsOrFirst || {});
42521
+ }
42522
+ else {
42523
+ params = {
42524
+ userId: paramsOrFirst,
42525
+ passkeyId: rest[0],
42526
+ };
42527
+ }
42528
+ const userId = params.userId;
42529
+ const passkeyId = params.passkeyId;
42530
+ if (typeof userId === 'undefined' || userId === '') {
42531
+ throw new AppwriteException('Missing required parameter: "userId"');
42532
+ }
42533
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
42534
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
42535
+ }
42536
+ const apiPath = '/users/{userId}/passkeys/{passkeyId}'
42537
+ .replace('{userId}', encodeURIComponent(String(userId)))
42538
+ .replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
42539
+ const apiPayload = {};
42540
+ const uri = new URL(this.client.config.endpoint + apiPath);
42541
+ const apiHeaders = {
42542
+ 'X-Appwrite-Project': this.client.config.project,
42543
+ accept: 'application/json',
42544
+ };
42545
+ return this.client.call('get', uri, apiHeaders, apiPayload);
42546
+ }
42547
+ deletePasskey(paramsOrFirst, ...rest) {
42548
+ let params;
42549
+ if (paramsOrFirst &&
42550
+ typeof paramsOrFirst === 'object' &&
42551
+ !Array.isArray(paramsOrFirst)) {
42552
+ params = (paramsOrFirst || {});
42553
+ }
42554
+ else {
42555
+ params = {
42556
+ userId: paramsOrFirst,
42557
+ passkeyId: rest[0],
42558
+ };
42559
+ }
42560
+ const userId = params.userId;
42561
+ const passkeyId = params.passkeyId;
42562
+ if (typeof userId === 'undefined' || userId === '') {
42563
+ throw new AppwriteException('Missing required parameter: "userId"');
42564
+ }
42565
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
42566
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
42567
+ }
42568
+ const apiPath = '/users/{userId}/passkeys/{passkeyId}'
42569
+ .replace('{userId}', encodeURIComponent(String(userId)))
42570
+ .replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
42571
+ const apiPayload = {};
42572
+ const uri = new URL(this.client.config.endpoint + apiPath);
42573
+ const apiHeaders = {
42574
+ 'X-Appwrite-Project': this.client.config.project,
42575
+ 'content-type': 'application/json',
42576
+ accept: 'application/json',
42577
+ };
42578
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
42579
+ }
41735
42580
  updatePassword(paramsOrFirst, ...rest) {
41736
42581
  let params;
41737
42582
  if (paramsOrFirst &&
@@ -44238,11 +45083,11 @@ class VectorsDB {
44238
45083
  }
44239
45084
  }
44240
45085
 
44241
- class Waf {
45086
+ class Videos {
44242
45087
  constructor(client) {
44243
45088
  this.client = client;
44244
45089
  }
44245
- listRules(paramsOrFirst, ...rest) {
45090
+ list(paramsOrFirst, ...rest) {
44246
45091
  let params;
44247
45092
  if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
44248
45093
  (paramsOrFirst &&
@@ -44260,7 +45105,7 @@ class Waf {
44260
45105
  const queries = params.queries;
44261
45106
  const search = params.search;
44262
45107
  const total = params.total;
44263
- const apiPath = '/waf/rules';
45108
+ const apiPath = '/videos';
44264
45109
  const apiPayload = {};
44265
45110
  if (typeof queries !== 'undefined') {
44266
45111
  apiPayload['queries'] = queries;
@@ -44278,7 +45123,7 @@ class Waf {
44278
45123
  };
44279
45124
  return this.client.call('get', uri, apiHeaders, apiPayload);
44280
45125
  }
44281
- createBypassRule(paramsOrFirst, ...rest) {
45126
+ create(paramsOrFirst, ...rest) {
44282
45127
  let params;
44283
45128
  if (paramsOrFirst &&
44284
45129
  typeof paramsOrFirst === 'object' &&
@@ -44287,59 +45132,31 @@ class Waf {
44287
45132
  }
44288
45133
  else {
44289
45134
  params = {
44290
- ruleId: paramsOrFirst,
44291
- resourceType: rest[0],
45135
+ bucketId: paramsOrFirst,
45136
+ fileId: rest[0],
44292
45137
  name: rest[1],
44293
- resourceId: rest[2],
44294
- description: rest[3],
44295
- priority: rest[4],
44296
- enabled: rest[5],
44297
- conditions: rest[6],
44298
45138
  };
44299
45139
  }
44300
- const ruleId = params.ruleId;
44301
- const resourceType = params.resourceType;
45140
+ const bucketId = params.bucketId;
45141
+ const fileId = params.fileId;
44302
45142
  const name = params.name;
44303
- const resourceId = params.resourceId;
44304
- const description = params.description;
44305
- const priority = params.priority;
44306
- const enabled = params.enabled;
44307
- const conditions = params.conditions;
44308
- if (typeof ruleId === 'undefined') {
44309
- throw new AppwriteException('Missing required parameter: "ruleId"');
44310
- }
44311
- if (typeof resourceType === 'undefined') {
44312
- throw new AppwriteException('Missing required parameter: "resourceType"');
45143
+ if (typeof bucketId === 'undefined') {
45144
+ throw new AppwriteException('Missing required parameter: "bucketId"');
44313
45145
  }
44314
- if (typeof name === 'undefined') {
44315
- throw new AppwriteException('Missing required parameter: "name"');
45146
+ if (typeof fileId === 'undefined') {
45147
+ throw new AppwriteException('Missing required parameter: "fileId"');
44316
45148
  }
44317
- const apiPath = '/waf/rules/bypass';
45149
+ const apiPath = '/videos';
44318
45150
  const apiPayload = {};
44319
- if (typeof ruleId !== 'undefined') {
44320
- apiPayload['ruleId'] = ruleId;
44321
- }
44322
- if (typeof resourceType !== 'undefined') {
44323
- apiPayload['resourceType'] = resourceType;
45151
+ if (typeof bucketId !== 'undefined') {
45152
+ apiPayload['bucketId'] = bucketId;
44324
45153
  }
44325
- if (typeof resourceId !== 'undefined') {
44326
- apiPayload['resourceId'] = resourceId;
45154
+ if (typeof fileId !== 'undefined') {
45155
+ apiPayload['fileId'] = fileId;
44327
45156
  }
44328
45157
  if (typeof name !== 'undefined') {
44329
45158
  apiPayload['name'] = name;
44330
45159
  }
44331
- if (typeof description !== 'undefined') {
44332
- apiPayload['description'] = description;
44333
- }
44334
- if (typeof priority !== 'undefined') {
44335
- apiPayload['priority'] = priority;
44336
- }
44337
- if (typeof enabled !== 'undefined') {
44338
- apiPayload['enabled'] = enabled;
44339
- }
44340
- if (typeof conditions !== 'undefined') {
44341
- apiPayload['conditions'] = conditions;
44342
- }
44343
45160
  const uri = new URL(this.client.config.endpoint + apiPath);
44344
45161
  const apiHeaders = {
44345
45162
  'X-Appwrite-Project': this.client.config.project,
@@ -44348,68 +45165,33 @@ class Waf {
44348
45165
  };
44349
45166
  return this.client.call('post', uri, apiHeaders, apiPayload);
44350
45167
  }
44351
- updateBypassRule(paramsOrFirst, ...rest) {
45168
+ listProfiles(paramsOrFirst) {
44352
45169
  let params;
44353
- if (paramsOrFirst &&
44354
- typeof paramsOrFirst === 'object' &&
44355
- !Array.isArray(paramsOrFirst)) {
45170
+ if (typeof paramsOrFirst === 'undefined' ||
45171
+ (paramsOrFirst &&
45172
+ typeof paramsOrFirst === 'object' &&
45173
+ !Array.isArray(paramsOrFirst))) {
44356
45174
  params = (paramsOrFirst || {});
44357
45175
  }
44358
45176
  else {
44359
45177
  params = {
44360
- ruleId: paramsOrFirst,
44361
- resourceType: rest[0],
44362
- resourceId: rest[1],
44363
- name: rest[2],
44364
- description: rest[3],
44365
- priority: rest[4],
44366
- enabled: rest[5],
44367
- conditions: rest[6],
45178
+ search: paramsOrFirst,
44368
45179
  };
44369
45180
  }
44370
- const ruleId = params.ruleId;
44371
- const resourceType = params.resourceType;
44372
- const resourceId = params.resourceId;
44373
- const name = params.name;
44374
- const description = params.description;
44375
- const priority = params.priority;
44376
- const enabled = params.enabled;
44377
- const conditions = params.conditions;
44378
- if (typeof ruleId === 'undefined' || ruleId === '') {
44379
- throw new AppwriteException('Missing required parameter: "ruleId"');
44380
- }
44381
- const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
45181
+ const search = params.search;
45182
+ const apiPath = '/videos/profiles';
44382
45183
  const apiPayload = {};
44383
- if (typeof resourceType !== 'undefined') {
44384
- apiPayload['resourceType'] = resourceType;
44385
- }
44386
- if (typeof resourceId !== 'undefined') {
44387
- apiPayload['resourceId'] = resourceId;
44388
- }
44389
- if (typeof name !== 'undefined') {
44390
- apiPayload['name'] = name;
44391
- }
44392
- if (typeof description !== 'undefined') {
44393
- apiPayload['description'] = description;
44394
- }
44395
- if (typeof priority !== 'undefined') {
44396
- apiPayload['priority'] = priority;
44397
- }
44398
- if (typeof enabled !== 'undefined') {
44399
- apiPayload['enabled'] = enabled;
44400
- }
44401
- if (typeof conditions !== 'undefined') {
44402
- apiPayload['conditions'] = conditions;
45184
+ if (typeof search !== 'undefined') {
45185
+ apiPayload['search'] = search;
44403
45186
  }
44404
45187
  const uri = new URL(this.client.config.endpoint + apiPath);
44405
45188
  const apiHeaders = {
44406
45189
  'X-Appwrite-Project': this.client.config.project,
44407
- 'content-type': 'application/json',
44408
45190
  accept: 'application/json',
44409
45191
  };
44410
- return this.client.call('patch', uri, apiHeaders, apiPayload);
45192
+ return this.client.call('get', uri, apiHeaders, apiPayload);
44411
45193
  }
44412
- createChallengeRule(paramsOrFirst, ...rest) {
45194
+ createProfile(paramsOrFirst, ...rest) {
44413
45195
  let params;
44414
45196
  if (paramsOrFirst &&
44415
45197
  typeof paramsOrFirst === 'object' &&
@@ -44418,73 +45200,49 @@ class Waf {
44418
45200
  }
44419
45201
  else {
44420
45202
  params = {
44421
- ruleId: paramsOrFirst,
44422
- resourceType: rest[0],
44423
- name: rest[1],
44424
- resourceId: rest[2],
44425
- description: rest[3],
44426
- challengeType: rest[4],
44427
- priority: rest[5],
44428
- enabled: rest[6],
44429
- conditions: rest[7],
44430
- difficulty: rest[8],
44431
- ttl: rest[9],
45203
+ name: paramsOrFirst,
45204
+ videoBitRate: rest[0],
45205
+ audioBitRate: rest[1],
45206
+ width: rest[2],
45207
+ height: rest[3],
44432
45208
  };
44433
45209
  }
44434
- const ruleId = params.ruleId;
44435
- const resourceType = params.resourceType;
44436
45210
  const name = params.name;
44437
- const resourceId = params.resourceId;
44438
- const description = params.description;
44439
- const challengeType = params.challengeType;
44440
- const priority = params.priority;
44441
- const enabled = params.enabled;
44442
- const conditions = params.conditions;
44443
- const difficulty = params.difficulty;
44444
- const ttl = params.ttl;
44445
- if (typeof ruleId === 'undefined') {
44446
- throw new AppwriteException('Missing required parameter: "ruleId"');
44447
- }
44448
- if (typeof resourceType === 'undefined') {
44449
- throw new AppwriteException('Missing required parameter: "resourceType"');
44450
- }
45211
+ const videoBitRate = params.videoBitRate;
45212
+ const audioBitRate = params.audioBitRate;
45213
+ const width = params.width;
45214
+ const height = params.height;
44451
45215
  if (typeof name === 'undefined') {
44452
45216
  throw new AppwriteException('Missing required parameter: "name"');
44453
45217
  }
44454
- const apiPath = '/waf/rules/challenge';
44455
- const apiPayload = {};
44456
- if (typeof ruleId !== 'undefined') {
44457
- apiPayload['ruleId'] = ruleId;
45218
+ if (typeof videoBitRate === 'undefined') {
45219
+ throw new AppwriteException('Missing required parameter: "videoBitRate"');
44458
45220
  }
44459
- if (typeof resourceType !== 'undefined') {
44460
- apiPayload['resourceType'] = resourceType;
45221
+ if (typeof audioBitRate === 'undefined') {
45222
+ throw new AppwriteException('Missing required parameter: "audioBitRate"');
44461
45223
  }
44462
- if (typeof resourceId !== 'undefined') {
44463
- apiPayload['resourceId'] = resourceId;
45224
+ if (typeof width === 'undefined') {
45225
+ throw new AppwriteException('Missing required parameter: "width"');
44464
45226
  }
45227
+ if (typeof height === 'undefined') {
45228
+ throw new AppwriteException('Missing required parameter: "height"');
45229
+ }
45230
+ const apiPath = '/videos/profiles';
45231
+ const apiPayload = {};
44465
45232
  if (typeof name !== 'undefined') {
44466
45233
  apiPayload['name'] = name;
44467
45234
  }
44468
- if (typeof description !== 'undefined') {
44469
- apiPayload['description'] = description;
44470
- }
44471
- if (typeof challengeType !== 'undefined') {
44472
- apiPayload['challengeType'] = challengeType;
44473
- }
44474
- if (typeof priority !== 'undefined') {
44475
- apiPayload['priority'] = priority;
44476
- }
44477
- if (typeof enabled !== 'undefined') {
44478
- apiPayload['enabled'] = enabled;
45235
+ if (typeof videoBitRate !== 'undefined') {
45236
+ apiPayload['videoBitRate'] = videoBitRate;
44479
45237
  }
44480
- if (typeof conditions !== 'undefined') {
44481
- apiPayload['conditions'] = conditions;
45238
+ if (typeof audioBitRate !== 'undefined') {
45239
+ apiPayload['audioBitRate'] = audioBitRate;
44482
45240
  }
44483
- if (typeof difficulty !== 'undefined') {
44484
- apiPayload['difficulty'] = difficulty;
45241
+ if (typeof width !== 'undefined') {
45242
+ apiPayload['width'] = width;
44485
45243
  }
44486
- if (typeof ttl !== 'undefined') {
44487
- apiPayload['ttl'] = ttl;
45244
+ if (typeof height !== 'undefined') {
45245
+ apiPayload['height'] = height;
44488
45246
  }
44489
45247
  const uri = new URL(this.client.config.endpoint + apiPath);
44490
45248
  const apiHeaders = {
@@ -44494,7 +45252,7 @@ class Waf {
44494
45252
  };
44495
45253
  return this.client.call('post', uri, apiHeaders, apiPayload);
44496
45254
  }
44497
- updateChallengeRule(paramsOrFirst, ...rest) {
45255
+ getProfile(paramsOrFirst) {
44498
45256
  let params;
44499
45257
  if (paramsOrFirst &&
44500
45258
  typeof paramsOrFirst === 'object' &&
@@ -44503,74 +45261,23 @@ class Waf {
44503
45261
  }
44504
45262
  else {
44505
45263
  params = {
44506
- ruleId: paramsOrFirst,
44507
- resourceType: rest[0],
44508
- resourceId: rest[1],
44509
- name: rest[2],
44510
- description: rest[3],
44511
- challengeType: rest[4],
44512
- priority: rest[5],
44513
- enabled: rest[6],
44514
- conditions: rest[7],
44515
- difficulty: rest[8],
44516
- ttl: rest[9],
45264
+ profileId: paramsOrFirst,
44517
45265
  };
44518
45266
  }
44519
- const ruleId = params.ruleId;
44520
- const resourceType = params.resourceType;
44521
- const resourceId = params.resourceId;
44522
- const name = params.name;
44523
- const description = params.description;
44524
- const challengeType = params.challengeType;
44525
- const priority = params.priority;
44526
- const enabled = params.enabled;
44527
- const conditions = params.conditions;
44528
- const difficulty = params.difficulty;
44529
- const ttl = params.ttl;
44530
- if (typeof ruleId === 'undefined' || ruleId === '') {
44531
- throw new AppwriteException('Missing required parameter: "ruleId"');
45267
+ const profileId = params.profileId;
45268
+ if (typeof profileId === 'undefined' || profileId === '') {
45269
+ throw new AppwriteException('Missing required parameter: "profileId"');
44532
45270
  }
44533
- const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
45271
+ const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
44534
45272
  const apiPayload = {};
44535
- if (typeof resourceType !== 'undefined') {
44536
- apiPayload['resourceType'] = resourceType;
44537
- }
44538
- if (typeof resourceId !== 'undefined') {
44539
- apiPayload['resourceId'] = resourceId;
44540
- }
44541
- if (typeof name !== 'undefined') {
44542
- apiPayload['name'] = name;
44543
- }
44544
- if (typeof description !== 'undefined') {
44545
- apiPayload['description'] = description;
44546
- }
44547
- if (typeof challengeType !== 'undefined') {
44548
- apiPayload['challengeType'] = challengeType;
44549
- }
44550
- if (typeof priority !== 'undefined') {
44551
- apiPayload['priority'] = priority;
44552
- }
44553
- if (typeof enabled !== 'undefined') {
44554
- apiPayload['enabled'] = enabled;
44555
- }
44556
- if (typeof conditions !== 'undefined') {
44557
- apiPayload['conditions'] = conditions;
44558
- }
44559
- if (typeof difficulty !== 'undefined') {
44560
- apiPayload['difficulty'] = difficulty;
44561
- }
44562
- if (typeof ttl !== 'undefined') {
44563
- apiPayload['ttl'] = ttl;
44564
- }
44565
45273
  const uri = new URL(this.client.config.endpoint + apiPath);
44566
45274
  const apiHeaders = {
44567
45275
  'X-Appwrite-Project': this.client.config.project,
44568
- 'content-type': 'application/json',
44569
45276
  accept: 'application/json',
44570
45277
  };
44571
- return this.client.call('patch', uri, apiHeaders, apiPayload);
45278
+ return this.client.call('get', uri, apiHeaders, apiPayload);
44572
45279
  }
44573
- createDenyRule(paramsOrFirst, ...rest) {
45280
+ updateProfile(paramsOrFirst, ...rest) {
44574
45281
  let params;
44575
45282
  if (paramsOrFirst &&
44576
45283
  typeof paramsOrFirst === 'object' &&
@@ -44579,58 +45286,54 @@ class Waf {
44579
45286
  }
44580
45287
  else {
44581
45288
  params = {
44582
- ruleId: paramsOrFirst,
44583
- resourceType: rest[0],
44584
- name: rest[1],
44585
- resourceId: rest[2],
44586
- description: rest[3],
44587
- priority: rest[4],
44588
- enabled: rest[5],
44589
- conditions: rest[6],
45289
+ profileId: paramsOrFirst,
45290
+ name: rest[0],
45291
+ videoBitRate: rest[1],
45292
+ audioBitRate: rest[2],
45293
+ width: rest[3],
45294
+ height: rest[4],
44590
45295
  };
44591
45296
  }
44592
- const ruleId = params.ruleId;
44593
- const resourceType = params.resourceType;
45297
+ const profileId = params.profileId;
44594
45298
  const name = params.name;
44595
- const resourceId = params.resourceId;
44596
- const description = params.description;
44597
- const priority = params.priority;
44598
- const enabled = params.enabled;
44599
- const conditions = params.conditions;
44600
- if (typeof ruleId === 'undefined') {
44601
- throw new AppwriteException('Missing required parameter: "ruleId"');
44602
- }
44603
- if (typeof resourceType === 'undefined') {
44604
- throw new AppwriteException('Missing required parameter: "resourceType"');
45299
+ const videoBitRate = params.videoBitRate;
45300
+ const audioBitRate = params.audioBitRate;
45301
+ const width = params.width;
45302
+ const height = params.height;
45303
+ if (typeof profileId === 'undefined' || profileId === '') {
45304
+ throw new AppwriteException('Missing required parameter: "profileId"');
44605
45305
  }
44606
45306
  if (typeof name === 'undefined') {
44607
45307
  throw new AppwriteException('Missing required parameter: "name"');
44608
45308
  }
44609
- const apiPath = '/waf/rules/deny';
44610
- const apiPayload = {};
44611
- if (typeof ruleId !== 'undefined') {
44612
- apiPayload['ruleId'] = ruleId;
45309
+ if (typeof videoBitRate === 'undefined') {
45310
+ throw new AppwriteException('Missing required parameter: "videoBitRate"');
44613
45311
  }
44614
- if (typeof resourceType !== 'undefined') {
44615
- apiPayload['resourceType'] = resourceType;
45312
+ if (typeof audioBitRate === 'undefined') {
45313
+ throw new AppwriteException('Missing required parameter: "audioBitRate"');
44616
45314
  }
44617
- if (typeof resourceId !== 'undefined') {
44618
- apiPayload['resourceId'] = resourceId;
45315
+ if (typeof width === 'undefined') {
45316
+ throw new AppwriteException('Missing required parameter: "width"');
44619
45317
  }
45318
+ if (typeof height === 'undefined') {
45319
+ throw new AppwriteException('Missing required parameter: "height"');
45320
+ }
45321
+ const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
45322
+ const apiPayload = {};
44620
45323
  if (typeof name !== 'undefined') {
44621
45324
  apiPayload['name'] = name;
44622
45325
  }
44623
- if (typeof description !== 'undefined') {
44624
- apiPayload['description'] = description;
45326
+ if (typeof videoBitRate !== 'undefined') {
45327
+ apiPayload['videoBitRate'] = videoBitRate;
44625
45328
  }
44626
- if (typeof priority !== 'undefined') {
44627
- apiPayload['priority'] = priority;
45329
+ if (typeof audioBitRate !== 'undefined') {
45330
+ apiPayload['audioBitRate'] = audioBitRate;
44628
45331
  }
44629
- if (typeof enabled !== 'undefined') {
44630
- apiPayload['enabled'] = enabled;
45332
+ if (typeof width !== 'undefined') {
45333
+ apiPayload['width'] = width;
44631
45334
  }
44632
- if (typeof conditions !== 'undefined') {
44633
- apiPayload['conditions'] = conditions;
45335
+ if (typeof height !== 'undefined') {
45336
+ apiPayload['height'] = height;
44634
45337
  }
44635
45338
  const uri = new URL(this.client.config.endpoint + apiPath);
44636
45339
  const apiHeaders = {
@@ -44638,9 +45341,9 @@ class Waf {
44638
45341
  'content-type': 'application/json',
44639
45342
  accept: 'application/json',
44640
45343
  };
44641
- return this.client.call('post', uri, apiHeaders, apiPayload);
45344
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
44642
45345
  }
44643
- updateDenyRule(paramsOrFirst, ...rest) {
45346
+ deleteProfile(paramsOrFirst) {
44644
45347
  let params;
44645
45348
  if (paramsOrFirst &&
44646
45349
  typeof paramsOrFirst === 'object' &&
@@ -44649,59 +45352,49 @@ class Waf {
44649
45352
  }
44650
45353
  else {
44651
45354
  params = {
44652
- ruleId: paramsOrFirst,
44653
- resourceType: rest[0],
44654
- resourceId: rest[1],
44655
- name: rest[2],
44656
- description: rest[3],
44657
- priority: rest[4],
44658
- enabled: rest[5],
44659
- conditions: rest[6],
45355
+ profileId: paramsOrFirst,
44660
45356
  };
44661
45357
  }
44662
- const ruleId = params.ruleId;
44663
- const resourceType = params.resourceType;
44664
- const resourceId = params.resourceId;
44665
- const name = params.name;
44666
- const description = params.description;
44667
- const priority = params.priority;
44668
- const enabled = params.enabled;
44669
- const conditions = params.conditions;
44670
- if (typeof ruleId === 'undefined' || ruleId === '') {
44671
- throw new AppwriteException('Missing required parameter: "ruleId"');
45358
+ const profileId = params.profileId;
45359
+ if (typeof profileId === 'undefined' || profileId === '') {
45360
+ throw new AppwriteException('Missing required parameter: "profileId"');
44672
45361
  }
44673
- const apiPath = '/waf/rules/deny/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
45362
+ const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
44674
45363
  const apiPayload = {};
44675
- if (typeof resourceType !== 'undefined') {
44676
- apiPayload['resourceType'] = resourceType;
44677
- }
44678
- if (typeof resourceId !== 'undefined') {
44679
- apiPayload['resourceId'] = resourceId;
44680
- }
44681
- if (typeof name !== 'undefined') {
44682
- apiPayload['name'] = name;
44683
- }
44684
- if (typeof description !== 'undefined') {
44685
- apiPayload['description'] = description;
44686
- }
44687
- if (typeof priority !== 'undefined') {
44688
- apiPayload['priority'] = priority;
45364
+ const uri = new URL(this.client.config.endpoint + apiPath);
45365
+ const apiHeaders = {
45366
+ 'X-Appwrite-Project': this.client.config.project,
45367
+ 'content-type': 'application/json',
45368
+ accept: 'application/json',
45369
+ };
45370
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
45371
+ }
45372
+ get(paramsOrFirst) {
45373
+ let params;
45374
+ if (paramsOrFirst &&
45375
+ typeof paramsOrFirst === 'object' &&
45376
+ !Array.isArray(paramsOrFirst)) {
45377
+ params = (paramsOrFirst || {});
44689
45378
  }
44690
- if (typeof enabled !== 'undefined') {
44691
- apiPayload['enabled'] = enabled;
45379
+ else {
45380
+ params = {
45381
+ videoId: paramsOrFirst,
45382
+ };
44692
45383
  }
44693
- if (typeof conditions !== 'undefined') {
44694
- apiPayload['conditions'] = conditions;
45384
+ const videoId = params.videoId;
45385
+ if (typeof videoId === 'undefined' || videoId === '') {
45386
+ throw new AppwriteException('Missing required parameter: "videoId"');
44695
45387
  }
45388
+ const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
45389
+ const apiPayload = {};
44696
45390
  const uri = new URL(this.client.config.endpoint + apiPath);
44697
45391
  const apiHeaders = {
44698
45392
  'X-Appwrite-Project': this.client.config.project,
44699
- 'content-type': 'application/json',
44700
45393
  accept: 'application/json',
44701
45394
  };
44702
- return this.client.call('patch', uri, apiHeaders, apiPayload);
45395
+ return this.client.call('get', uri, apiHeaders, apiPayload);
44703
45396
  }
44704
- createRateLimitRule(paramsOrFirst, ...rest) {
45397
+ update(paramsOrFirst, ...rest) {
44705
45398
  let params;
44706
45399
  if (paramsOrFirst &&
44707
45400
  typeof paramsOrFirst === 'object' &&
@@ -44710,65 +45403,1347 @@ class Waf {
44710
45403
  }
44711
45404
  else {
44712
45405
  params = {
44713
- ruleId: paramsOrFirst,
44714
- resourceType: rest[0],
44715
- name: rest[1],
44716
- limit: rest[2],
44717
- interval: rest[3],
44718
- resourceId: rest[4],
44719
- description: rest[5],
44720
- key: rest[6],
44721
- strategy: rest[7],
44722
- maxBucketSize: rest[8],
44723
- priority: rest[9],
44724
- enabled: rest[10],
44725
- conditions: rest[11],
45406
+ videoId: paramsOrFirst,
45407
+ name: rest[0],
44726
45408
  };
44727
45409
  }
44728
- const ruleId = params.ruleId;
44729
- const resourceType = params.resourceType;
45410
+ const videoId = params.videoId;
44730
45411
  const name = params.name;
44731
- const limit = params.limit;
44732
- const interval = params.interval;
44733
- const resourceId = params.resourceId;
44734
- const description = params.description;
44735
- const key = params.key;
44736
- const strategy = params.strategy;
44737
- const maxBucketSize = params.maxBucketSize;
44738
- const priority = params.priority;
44739
- const enabled = params.enabled;
44740
- const conditions = params.conditions;
44741
- if (typeof ruleId === 'undefined') {
44742
- throw new AppwriteException('Missing required parameter: "ruleId"');
44743
- }
44744
- if (typeof resourceType === 'undefined') {
44745
- throw new AppwriteException('Missing required parameter: "resourceType"');
45412
+ if (typeof videoId === 'undefined' || videoId === '') {
45413
+ throw new AppwriteException('Missing required parameter: "videoId"');
44746
45414
  }
44747
45415
  if (typeof name === 'undefined') {
44748
45416
  throw new AppwriteException('Missing required parameter: "name"');
44749
45417
  }
44750
- if (typeof limit === 'undefined') {
44751
- throw new AppwriteException('Missing required parameter: "limit"');
44752
- }
44753
- if (typeof interval === 'undefined') {
44754
- throw new AppwriteException('Missing required parameter: "interval"');
44755
- }
44756
- const apiPath = '/waf/rules/rate-limit';
45418
+ const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
44757
45419
  const apiPayload = {};
44758
- if (typeof ruleId !== 'undefined') {
44759
- apiPayload['ruleId'] = ruleId;
44760
- }
44761
- if (typeof resourceType !== 'undefined') {
44762
- apiPayload['resourceType'] = resourceType;
44763
- }
44764
- if (typeof resourceId !== 'undefined') {
44765
- apiPayload['resourceId'] = resourceId;
44766
- }
44767
45420
  if (typeof name !== 'undefined') {
44768
45421
  apiPayload['name'] = name;
44769
45422
  }
44770
- if (typeof description !== 'undefined') {
44771
- apiPayload['description'] = description;
45423
+ const uri = new URL(this.client.config.endpoint + apiPath);
45424
+ const apiHeaders = {
45425
+ 'X-Appwrite-Project': this.client.config.project,
45426
+ 'content-type': 'application/json',
45427
+ accept: 'application/json',
45428
+ };
45429
+ return this.client.call('put', uri, apiHeaders, apiPayload);
45430
+ }
45431
+ delete(paramsOrFirst) {
45432
+ let params;
45433
+ if (paramsOrFirst &&
45434
+ typeof paramsOrFirst === 'object' &&
45435
+ !Array.isArray(paramsOrFirst)) {
45436
+ params = (paramsOrFirst || {});
45437
+ }
45438
+ else {
45439
+ params = {
45440
+ videoId: paramsOrFirst,
45441
+ };
45442
+ }
45443
+ const videoId = params.videoId;
45444
+ if (typeof videoId === 'undefined' || videoId === '') {
45445
+ throw new AppwriteException('Missing required parameter: "videoId"');
45446
+ }
45447
+ const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
45448
+ const apiPayload = {};
45449
+ const uri = new URL(this.client.config.endpoint + apiPath);
45450
+ const apiHeaders = {
45451
+ 'X-Appwrite-Project': this.client.config.project,
45452
+ 'content-type': 'application/json',
45453
+ accept: 'application/json',
45454
+ };
45455
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
45456
+ }
45457
+ getCmafHlsManifest(paramsOrFirst) {
45458
+ let params;
45459
+ if (paramsOrFirst &&
45460
+ typeof paramsOrFirst === 'object' &&
45461
+ !Array.isArray(paramsOrFirst)) {
45462
+ params = (paramsOrFirst || {});
45463
+ }
45464
+ else {
45465
+ params = {
45466
+ videoId: paramsOrFirst,
45467
+ };
45468
+ }
45469
+ const videoId = params.videoId;
45470
+ if (typeof videoId === 'undefined' || videoId === '') {
45471
+ throw new AppwriteException('Missing required parameter: "videoId"');
45472
+ }
45473
+ const apiPath = '/videos/{videoId}/outputs/cmaf/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
45474
+ const apiPayload = {};
45475
+ const uri = new URL(this.client.config.endpoint + apiPath);
45476
+ apiPayload['project'] = this.client.config.project;
45477
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45478
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45479
+ uri.searchParams.append(key, value);
45480
+ }
45481
+ return uri.toString();
45482
+ }
45483
+ getCmafDashManifest(paramsOrFirst) {
45484
+ let params;
45485
+ if (paramsOrFirst &&
45486
+ typeof paramsOrFirst === 'object' &&
45487
+ !Array.isArray(paramsOrFirst)) {
45488
+ params = (paramsOrFirst || {});
45489
+ }
45490
+ else {
45491
+ params = {
45492
+ videoId: paramsOrFirst,
45493
+ };
45494
+ }
45495
+ const videoId = params.videoId;
45496
+ if (typeof videoId === 'undefined' || videoId === '') {
45497
+ throw new AppwriteException('Missing required parameter: "videoId"');
45498
+ }
45499
+ const apiPath = '/videos/{videoId}/outputs/cmaf/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
45500
+ const apiPayload = {};
45501
+ const uri = new URL(this.client.config.endpoint + apiPath);
45502
+ apiPayload['project'] = this.client.config.project;
45503
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45504
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45505
+ uri.searchParams.append(key, value);
45506
+ }
45507
+ return uri.toString();
45508
+ }
45509
+ getCmafStreamManifest(paramsOrFirst, ...rest) {
45510
+ let params;
45511
+ if (paramsOrFirst &&
45512
+ typeof paramsOrFirst === 'object' &&
45513
+ !Array.isArray(paramsOrFirst)) {
45514
+ params = (paramsOrFirst || {});
45515
+ }
45516
+ else {
45517
+ params = {
45518
+ videoId: paramsOrFirst,
45519
+ renditionId: rest[0],
45520
+ streamId: rest[1],
45521
+ };
45522
+ }
45523
+ const videoId = params.videoId;
45524
+ const renditionId = params.renditionId;
45525
+ const streamId = params.streamId;
45526
+ if (typeof videoId === 'undefined' || videoId === '') {
45527
+ throw new AppwriteException('Missing required parameter: "videoId"');
45528
+ }
45529
+ if (typeof renditionId === 'undefined' || renditionId === '') {
45530
+ throw new AppwriteException('Missing required parameter: "renditionId"');
45531
+ }
45532
+ if (typeof streamId === 'undefined') {
45533
+ throw new AppwriteException('Missing required parameter: "streamId"');
45534
+ }
45535
+ const apiPath = '/videos/{videoId}/outputs/cmaf/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
45536
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45537
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)))
45538
+ .replace('{streamId}', encodeURIComponent(String(streamId)));
45539
+ const apiPayload = {};
45540
+ const uri = new URL(this.client.config.endpoint + apiPath);
45541
+ apiPayload['project'] = this.client.config.project;
45542
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45543
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45544
+ uri.searchParams.append(key, value);
45545
+ }
45546
+ return uri.toString();
45547
+ }
45548
+ getDashManifest(paramsOrFirst) {
45549
+ let params;
45550
+ if (paramsOrFirst &&
45551
+ typeof paramsOrFirst === 'object' &&
45552
+ !Array.isArray(paramsOrFirst)) {
45553
+ params = (paramsOrFirst || {});
45554
+ }
45555
+ else {
45556
+ params = {
45557
+ videoId: paramsOrFirst,
45558
+ };
45559
+ }
45560
+ const videoId = params.videoId;
45561
+ if (typeof videoId === 'undefined' || videoId === '') {
45562
+ throw new AppwriteException('Missing required parameter: "videoId"');
45563
+ }
45564
+ const apiPath = '/videos/{videoId}/outputs/dash/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
45565
+ const apiPayload = {};
45566
+ const uri = new URL(this.client.config.endpoint + apiPath);
45567
+ apiPayload['project'] = this.client.config.project;
45568
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45569
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45570
+ uri.searchParams.append(key, value);
45571
+ }
45572
+ return uri.toString();
45573
+ }
45574
+ getHlsManifest(paramsOrFirst) {
45575
+ let params;
45576
+ if (paramsOrFirst &&
45577
+ typeof paramsOrFirst === 'object' &&
45578
+ !Array.isArray(paramsOrFirst)) {
45579
+ params = (paramsOrFirst || {});
45580
+ }
45581
+ else {
45582
+ params = {
45583
+ videoId: paramsOrFirst,
45584
+ };
45585
+ }
45586
+ const videoId = params.videoId;
45587
+ if (typeof videoId === 'undefined' || videoId === '') {
45588
+ throw new AppwriteException('Missing required parameter: "videoId"');
45589
+ }
45590
+ const apiPath = '/videos/{videoId}/outputs/hls/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
45591
+ const apiPayload = {};
45592
+ const uri = new URL(this.client.config.endpoint + apiPath);
45593
+ apiPayload['project'] = this.client.config.project;
45594
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45595
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45596
+ uri.searchParams.append(key, value);
45597
+ }
45598
+ return uri.toString();
45599
+ }
45600
+ getStreamManifest(paramsOrFirst, ...rest) {
45601
+ let params;
45602
+ if (paramsOrFirst &&
45603
+ typeof paramsOrFirst === 'object' &&
45604
+ !Array.isArray(paramsOrFirst)) {
45605
+ params = (paramsOrFirst || {});
45606
+ }
45607
+ else {
45608
+ params = {
45609
+ videoId: paramsOrFirst,
45610
+ renditionId: rest[0],
45611
+ streamId: rest[1],
45612
+ };
45613
+ }
45614
+ const videoId = params.videoId;
45615
+ const renditionId = params.renditionId;
45616
+ const streamId = params.streamId;
45617
+ if (typeof videoId === 'undefined' || videoId === '') {
45618
+ throw new AppwriteException('Missing required parameter: "videoId"');
45619
+ }
45620
+ if (typeof renditionId === 'undefined' || renditionId === '') {
45621
+ throw new AppwriteException('Missing required parameter: "renditionId"');
45622
+ }
45623
+ if (typeof streamId === 'undefined') {
45624
+ throw new AppwriteException('Missing required parameter: "streamId"');
45625
+ }
45626
+ const apiPath = '/videos/{videoId}/outputs/hls/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
45627
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45628
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)))
45629
+ .replace('{streamId}', encodeURIComponent(String(streamId)));
45630
+ const apiPayload = {};
45631
+ const uri = new URL(this.client.config.endpoint + apiPath);
45632
+ apiPayload['project'] = this.client.config.project;
45633
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45634
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45635
+ uri.searchParams.append(key, value);
45636
+ }
45637
+ return uri.toString();
45638
+ }
45639
+ getSegment(paramsOrFirst, ...rest) {
45640
+ let params;
45641
+ if (paramsOrFirst &&
45642
+ typeof paramsOrFirst === 'object' &&
45643
+ !Array.isArray(paramsOrFirst)) {
45644
+ params = (paramsOrFirst || {});
45645
+ }
45646
+ else {
45647
+ params = {
45648
+ videoId: paramsOrFirst,
45649
+ output: rest[0],
45650
+ renditionId: rest[1],
45651
+ segmentId: rest[2],
45652
+ };
45653
+ }
45654
+ const videoId = params.videoId;
45655
+ const output = params.output;
45656
+ const renditionId = params.renditionId;
45657
+ const segmentId = params.segmentId;
45658
+ if (typeof videoId === 'undefined' || videoId === '') {
45659
+ throw new AppwriteException('Missing required parameter: "videoId"');
45660
+ }
45661
+ if (typeof output === 'undefined') {
45662
+ throw new AppwriteException('Missing required parameter: "output"');
45663
+ }
45664
+ if (typeof renditionId === 'undefined' || renditionId === '') {
45665
+ throw new AppwriteException('Missing required parameter: "renditionId"');
45666
+ }
45667
+ if (typeof segmentId === 'undefined' || segmentId === '') {
45668
+ throw new AppwriteException('Missing required parameter: "segmentId"');
45669
+ }
45670
+ const apiPath = '/videos/{videoId}/outputs/{output}/renditions/{renditionId}/segments/{segmentId}'
45671
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45672
+ .replace('{output}', encodeURIComponent(String(output)))
45673
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)))
45674
+ .replace('{segmentId}', encodeURIComponent(String(segmentId)));
45675
+ const apiPayload = {};
45676
+ const uri = new URL(this.client.config.endpoint + apiPath);
45677
+ apiPayload['project'] = this.client.config.project;
45678
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45679
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45680
+ uri.searchParams.append(key, value);
45681
+ }
45682
+ return uri.toString();
45683
+ }
45684
+ getSubtitleManifest(paramsOrFirst, ...rest) {
45685
+ let params;
45686
+ if (paramsOrFirst &&
45687
+ typeof paramsOrFirst === 'object' &&
45688
+ !Array.isArray(paramsOrFirst)) {
45689
+ params = (paramsOrFirst || {});
45690
+ }
45691
+ else {
45692
+ params = {
45693
+ videoId: paramsOrFirst,
45694
+ output: rest[0],
45695
+ subtitleId: rest[1],
45696
+ };
45697
+ }
45698
+ const videoId = params.videoId;
45699
+ const output = params.output;
45700
+ const subtitleId = params.subtitleId;
45701
+ if (typeof videoId === 'undefined' || videoId === '') {
45702
+ throw new AppwriteException('Missing required parameter: "videoId"');
45703
+ }
45704
+ if (typeof output === 'undefined') {
45705
+ throw new AppwriteException('Missing required parameter: "output"');
45706
+ }
45707
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
45708
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
45709
+ }
45710
+ const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/manifest'
45711
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45712
+ .replace('{output}', encodeURIComponent(String(output)))
45713
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
45714
+ const apiPayload = {};
45715
+ const uri = new URL(this.client.config.endpoint + apiPath);
45716
+ apiPayload['project'] = this.client.config.project;
45717
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45718
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45719
+ uri.searchParams.append(key, value);
45720
+ }
45721
+ return uri.toString();
45722
+ }
45723
+ getSubtitleSegment(paramsOrFirst, ...rest) {
45724
+ let params;
45725
+ if (paramsOrFirst &&
45726
+ typeof paramsOrFirst === 'object' &&
45727
+ !Array.isArray(paramsOrFirst)) {
45728
+ params = (paramsOrFirst || {});
45729
+ }
45730
+ else {
45731
+ params = {
45732
+ videoId: paramsOrFirst,
45733
+ output: rest[0],
45734
+ subtitleId: rest[1],
45735
+ segmentId: rest[2],
45736
+ };
45737
+ }
45738
+ const videoId = params.videoId;
45739
+ const output = params.output;
45740
+ const subtitleId = params.subtitleId;
45741
+ const segmentId = params.segmentId;
45742
+ if (typeof videoId === 'undefined' || videoId === '') {
45743
+ throw new AppwriteException('Missing required parameter: "videoId"');
45744
+ }
45745
+ if (typeof output === 'undefined') {
45746
+ throw new AppwriteException('Missing required parameter: "output"');
45747
+ }
45748
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
45749
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
45750
+ }
45751
+ if (typeof segmentId === 'undefined' || segmentId === '') {
45752
+ throw new AppwriteException('Missing required parameter: "segmentId"');
45753
+ }
45754
+ const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/segments/{segmentId}'
45755
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45756
+ .replace('{output}', encodeURIComponent(String(output)))
45757
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)))
45758
+ .replace('{segmentId}', encodeURIComponent(String(segmentId)));
45759
+ const apiPayload = {};
45760
+ const uri = new URL(this.client.config.endpoint + apiPath);
45761
+ apiPayload['project'] = this.client.config.project;
45762
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45763
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45764
+ uri.searchParams.append(key, value);
45765
+ }
45766
+ return uri.toString();
45767
+ }
45768
+ getPreview(paramsOrFirst, ...rest) {
45769
+ let params;
45770
+ if (paramsOrFirst &&
45771
+ typeof paramsOrFirst === 'object' &&
45772
+ !Array.isArray(paramsOrFirst)) {
45773
+ params = (paramsOrFirst || {});
45774
+ }
45775
+ else {
45776
+ params = {
45777
+ videoId: paramsOrFirst,
45778
+ previewId: rest[0],
45779
+ width: rest[1],
45780
+ height: rest[2],
45781
+ output: rest[3],
45782
+ };
45783
+ }
45784
+ const videoId = params.videoId;
45785
+ const previewId = params.previewId;
45786
+ const width = params.width;
45787
+ const height = params.height;
45788
+ const output = params.output;
45789
+ if (typeof videoId === 'undefined' || videoId === '') {
45790
+ throw new AppwriteException('Missing required parameter: "videoId"');
45791
+ }
45792
+ if (typeof previewId === 'undefined' || previewId === '') {
45793
+ throw new AppwriteException('Missing required parameter: "previewId"');
45794
+ }
45795
+ const apiPath = '/videos/{videoId}/previews/{previewId}'
45796
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45797
+ .replace('{previewId}', encodeURIComponent(String(previewId)));
45798
+ const apiPayload = {};
45799
+ if (typeof width !== 'undefined') {
45800
+ apiPayload['width'] = width;
45801
+ }
45802
+ if (typeof height !== 'undefined') {
45803
+ apiPayload['height'] = height;
45804
+ }
45805
+ if (typeof output !== 'undefined') {
45806
+ apiPayload['output'] = output;
45807
+ }
45808
+ const uri = new URL(this.client.config.endpoint + apiPath);
45809
+ apiPayload['project'] = this.client.config.project;
45810
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45811
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45812
+ uri.searchParams.append(key, value);
45813
+ }
45814
+ return uri.toString();
45815
+ }
45816
+ listRenditions(paramsOrFirst, ...rest) {
45817
+ let params;
45818
+ if (paramsOrFirst &&
45819
+ typeof paramsOrFirst === 'object' &&
45820
+ !Array.isArray(paramsOrFirst)) {
45821
+ params = (paramsOrFirst || {});
45822
+ }
45823
+ else {
45824
+ params = {
45825
+ videoId: paramsOrFirst,
45826
+ output: rest[0],
45827
+ status: rest[1],
45828
+ };
45829
+ }
45830
+ const videoId = params.videoId;
45831
+ const output = params.output;
45832
+ const status = params.status;
45833
+ if (typeof videoId === 'undefined' || videoId === '') {
45834
+ throw new AppwriteException('Missing required parameter: "videoId"');
45835
+ }
45836
+ const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
45837
+ const apiPayload = {};
45838
+ if (typeof output !== 'undefined') {
45839
+ apiPayload['output'] = output;
45840
+ }
45841
+ if (typeof status !== 'undefined') {
45842
+ apiPayload['status'] = status;
45843
+ }
45844
+ const uri = new URL(this.client.config.endpoint + apiPath);
45845
+ const apiHeaders = {
45846
+ 'X-Appwrite-Project': this.client.config.project,
45847
+ accept: 'application/json',
45848
+ };
45849
+ return this.client.call('get', uri, apiHeaders, apiPayload);
45850
+ }
45851
+ createRendition(paramsOrFirst, ...rest) {
45852
+ let params;
45853
+ if (paramsOrFirst &&
45854
+ typeof paramsOrFirst === 'object' &&
45855
+ !Array.isArray(paramsOrFirst)) {
45856
+ params = (paramsOrFirst || {});
45857
+ }
45858
+ else {
45859
+ params = {
45860
+ videoId: paramsOrFirst,
45861
+ profileId: rest[0],
45862
+ output: rest[1],
45863
+ };
45864
+ }
45865
+ const videoId = params.videoId;
45866
+ const profileId = params.profileId;
45867
+ const output = params.output;
45868
+ if (typeof videoId === 'undefined' || videoId === '') {
45869
+ throw new AppwriteException('Missing required parameter: "videoId"');
45870
+ }
45871
+ if (typeof profileId === 'undefined') {
45872
+ throw new AppwriteException('Missing required parameter: "profileId"');
45873
+ }
45874
+ if (typeof output === 'undefined') {
45875
+ throw new AppwriteException('Missing required parameter: "output"');
45876
+ }
45877
+ const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
45878
+ const apiPayload = {};
45879
+ if (typeof profileId !== 'undefined') {
45880
+ apiPayload['profileId'] = profileId;
45881
+ }
45882
+ if (typeof output !== 'undefined') {
45883
+ apiPayload['output'] = output;
45884
+ }
45885
+ const uri = new URL(this.client.config.endpoint + apiPath);
45886
+ const apiHeaders = {
45887
+ 'X-Appwrite-Project': this.client.config.project,
45888
+ 'content-type': 'application/json',
45889
+ accept: 'application/json',
45890
+ };
45891
+ return this.client.call('post', uri, apiHeaders, apiPayload);
45892
+ }
45893
+ getRendition(paramsOrFirst, ...rest) {
45894
+ let params;
45895
+ if (paramsOrFirst &&
45896
+ typeof paramsOrFirst === 'object' &&
45897
+ !Array.isArray(paramsOrFirst)) {
45898
+ params = (paramsOrFirst || {});
45899
+ }
45900
+ else {
45901
+ params = {
45902
+ videoId: paramsOrFirst,
45903
+ renditionId: rest[0],
45904
+ };
45905
+ }
45906
+ const videoId = params.videoId;
45907
+ const renditionId = params.renditionId;
45908
+ if (typeof videoId === 'undefined' || videoId === '') {
45909
+ throw new AppwriteException('Missing required parameter: "videoId"');
45910
+ }
45911
+ if (typeof renditionId === 'undefined' || renditionId === '') {
45912
+ throw new AppwriteException('Missing required parameter: "renditionId"');
45913
+ }
45914
+ const apiPath = '/videos/{videoId}/renditions/{renditionId}'
45915
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45916
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)));
45917
+ const apiPayload = {};
45918
+ const uri = new URL(this.client.config.endpoint + apiPath);
45919
+ const apiHeaders = {
45920
+ 'X-Appwrite-Project': this.client.config.project,
45921
+ accept: 'application/json',
45922
+ };
45923
+ return this.client.call('get', uri, apiHeaders, apiPayload);
45924
+ }
45925
+ deleteRendition(paramsOrFirst, ...rest) {
45926
+ let params;
45927
+ if (paramsOrFirst &&
45928
+ typeof paramsOrFirst === 'object' &&
45929
+ !Array.isArray(paramsOrFirst)) {
45930
+ params = (paramsOrFirst || {});
45931
+ }
45932
+ else {
45933
+ params = {
45934
+ videoId: paramsOrFirst,
45935
+ renditionId: rest[0],
45936
+ };
45937
+ }
45938
+ const videoId = params.videoId;
45939
+ const renditionId = params.renditionId;
45940
+ if (typeof videoId === 'undefined' || videoId === '') {
45941
+ throw new AppwriteException('Missing required parameter: "videoId"');
45942
+ }
45943
+ if (typeof renditionId === 'undefined' || renditionId === '') {
45944
+ throw new AppwriteException('Missing required parameter: "renditionId"');
45945
+ }
45946
+ const apiPath = '/videos/{videoId}/renditions/{renditionId}'
45947
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45948
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)));
45949
+ const apiPayload = {};
45950
+ const uri = new URL(this.client.config.endpoint + apiPath);
45951
+ const apiHeaders = {
45952
+ 'X-Appwrite-Project': this.client.config.project,
45953
+ 'content-type': 'application/json',
45954
+ accept: 'application/json',
45955
+ };
45956
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
45957
+ }
45958
+ createSource(paramsOrFirst) {
45959
+ let params;
45960
+ if (paramsOrFirst &&
45961
+ typeof paramsOrFirst === 'object' &&
45962
+ !Array.isArray(paramsOrFirst)) {
45963
+ params = (paramsOrFirst || {});
45964
+ }
45965
+ else {
45966
+ params = {
45967
+ videoId: paramsOrFirst,
45968
+ };
45969
+ }
45970
+ const videoId = params.videoId;
45971
+ if (typeof videoId === 'undefined' || videoId === '') {
45972
+ throw new AppwriteException('Missing required parameter: "videoId"');
45973
+ }
45974
+ const apiPath = '/videos/{videoId}/source'.replace('{videoId}', encodeURIComponent(String(videoId)));
45975
+ const apiPayload = {};
45976
+ const uri = new URL(this.client.config.endpoint + apiPath);
45977
+ const apiHeaders = {
45978
+ 'X-Appwrite-Project': this.client.config.project,
45979
+ 'content-type': 'application/json',
45980
+ accept: 'application/json',
45981
+ };
45982
+ return this.client.call('post', uri, apiHeaders, apiPayload);
45983
+ }
45984
+ listSubtitles(paramsOrFirst) {
45985
+ let params;
45986
+ if (paramsOrFirst &&
45987
+ typeof paramsOrFirst === 'object' &&
45988
+ !Array.isArray(paramsOrFirst)) {
45989
+ params = (paramsOrFirst || {});
45990
+ }
45991
+ else {
45992
+ params = {
45993
+ videoId: paramsOrFirst,
45994
+ };
45995
+ }
45996
+ const videoId = params.videoId;
45997
+ if (typeof videoId === 'undefined' || videoId === '') {
45998
+ throw new AppwriteException('Missing required parameter: "videoId"');
45999
+ }
46000
+ const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
46001
+ const apiPayload = {};
46002
+ const uri = new URL(this.client.config.endpoint + apiPath);
46003
+ const apiHeaders = {
46004
+ 'X-Appwrite-Project': this.client.config.project,
46005
+ accept: 'application/json',
46006
+ };
46007
+ return this.client.call('get', uri, apiHeaders, apiPayload);
46008
+ }
46009
+ createSubtitle(paramsOrFirst, ...rest) {
46010
+ let params;
46011
+ if (paramsOrFirst &&
46012
+ typeof paramsOrFirst === 'object' &&
46013
+ !Array.isArray(paramsOrFirst)) {
46014
+ params = (paramsOrFirst || {});
46015
+ }
46016
+ else {
46017
+ params = {
46018
+ videoId: paramsOrFirst,
46019
+ bucketId: rest[0],
46020
+ fileId: rest[1],
46021
+ name: rest[2],
46022
+ code: rest[3],
46023
+ xdefault: rest[4],
46024
+ };
46025
+ }
46026
+ const videoId = params.videoId;
46027
+ const bucketId = params.bucketId;
46028
+ const fileId = params.fileId;
46029
+ const name = params.name;
46030
+ const code = params.code;
46031
+ const xdefault = params.xdefault;
46032
+ if (typeof videoId === 'undefined' || videoId === '') {
46033
+ throw new AppwriteException('Missing required parameter: "videoId"');
46034
+ }
46035
+ if (typeof bucketId === 'undefined') {
46036
+ throw new AppwriteException('Missing required parameter: "bucketId"');
46037
+ }
46038
+ if (typeof fileId === 'undefined') {
46039
+ throw new AppwriteException('Missing required parameter: "fileId"');
46040
+ }
46041
+ if (typeof name === 'undefined') {
46042
+ throw new AppwriteException('Missing required parameter: "name"');
46043
+ }
46044
+ if (typeof code === 'undefined') {
46045
+ throw new AppwriteException('Missing required parameter: "code"');
46046
+ }
46047
+ const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
46048
+ const apiPayload = {};
46049
+ if (typeof bucketId !== 'undefined') {
46050
+ apiPayload['bucketId'] = bucketId;
46051
+ }
46052
+ if (typeof fileId !== 'undefined') {
46053
+ apiPayload['fileId'] = fileId;
46054
+ }
46055
+ if (typeof name !== 'undefined') {
46056
+ apiPayload['name'] = name;
46057
+ }
46058
+ if (typeof code !== 'undefined') {
46059
+ apiPayload['code'] = code;
46060
+ }
46061
+ if (typeof xdefault !== 'undefined') {
46062
+ apiPayload['default'] = xdefault;
46063
+ }
46064
+ const uri = new URL(this.client.config.endpoint + apiPath);
46065
+ const apiHeaders = {
46066
+ 'X-Appwrite-Project': this.client.config.project,
46067
+ 'content-type': 'application/json',
46068
+ accept: 'application/json',
46069
+ };
46070
+ return this.client.call('post', uri, apiHeaders, apiPayload);
46071
+ }
46072
+ updateSubtitle(paramsOrFirst, ...rest) {
46073
+ let params;
46074
+ if (paramsOrFirst &&
46075
+ typeof paramsOrFirst === 'object' &&
46076
+ !Array.isArray(paramsOrFirst)) {
46077
+ params = (paramsOrFirst || {});
46078
+ }
46079
+ else {
46080
+ params = {
46081
+ videoId: paramsOrFirst,
46082
+ subtitleId: rest[0],
46083
+ bucketId: rest[1],
46084
+ fileId: rest[2],
46085
+ name: rest[3],
46086
+ code: rest[4],
46087
+ xdefault: rest[5],
46088
+ };
46089
+ }
46090
+ const videoId = params.videoId;
46091
+ const subtitleId = params.subtitleId;
46092
+ const bucketId = params.bucketId;
46093
+ const fileId = params.fileId;
46094
+ const name = params.name;
46095
+ const code = params.code;
46096
+ const xdefault = params.xdefault;
46097
+ if (typeof videoId === 'undefined' || videoId === '') {
46098
+ throw new AppwriteException('Missing required parameter: "videoId"');
46099
+ }
46100
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
46101
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
46102
+ }
46103
+ const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
46104
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
46105
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
46106
+ const apiPayload = {};
46107
+ if (typeof bucketId !== 'undefined') {
46108
+ apiPayload['bucketId'] = bucketId;
46109
+ }
46110
+ if (typeof fileId !== 'undefined') {
46111
+ apiPayload['fileId'] = fileId;
46112
+ }
46113
+ if (typeof name !== 'undefined') {
46114
+ apiPayload['name'] = name;
46115
+ }
46116
+ if (typeof code !== 'undefined') {
46117
+ apiPayload['code'] = code;
46118
+ }
46119
+ if (typeof xdefault !== 'undefined') {
46120
+ apiPayload['default'] = xdefault;
46121
+ }
46122
+ const uri = new URL(this.client.config.endpoint + apiPath);
46123
+ const apiHeaders = {
46124
+ 'X-Appwrite-Project': this.client.config.project,
46125
+ 'content-type': 'application/json',
46126
+ accept: 'application/json',
46127
+ };
46128
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
46129
+ }
46130
+ deleteSubtitle(paramsOrFirst, ...rest) {
46131
+ let params;
46132
+ if (paramsOrFirst &&
46133
+ typeof paramsOrFirst === 'object' &&
46134
+ !Array.isArray(paramsOrFirst)) {
46135
+ params = (paramsOrFirst || {});
46136
+ }
46137
+ else {
46138
+ params = {
46139
+ videoId: paramsOrFirst,
46140
+ subtitleId: rest[0],
46141
+ };
46142
+ }
46143
+ const videoId = params.videoId;
46144
+ const subtitleId = params.subtitleId;
46145
+ if (typeof videoId === 'undefined' || videoId === '') {
46146
+ throw new AppwriteException('Missing required parameter: "videoId"');
46147
+ }
46148
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
46149
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
46150
+ }
46151
+ const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
46152
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
46153
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
46154
+ const apiPayload = {};
46155
+ const uri = new URL(this.client.config.endpoint + apiPath);
46156
+ const apiHeaders = {
46157
+ 'X-Appwrite-Project': this.client.config.project,
46158
+ 'content-type': 'application/json',
46159
+ accept: 'application/json',
46160
+ };
46161
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
46162
+ }
46163
+ getTimeline(paramsOrFirst) {
46164
+ let params;
46165
+ if (paramsOrFirst &&
46166
+ typeof paramsOrFirst === 'object' &&
46167
+ !Array.isArray(paramsOrFirst)) {
46168
+ params = (paramsOrFirst || {});
46169
+ }
46170
+ else {
46171
+ params = {
46172
+ videoId: paramsOrFirst,
46173
+ };
46174
+ }
46175
+ const videoId = params.videoId;
46176
+ if (typeof videoId === 'undefined' || videoId === '') {
46177
+ throw new AppwriteException('Missing required parameter: "videoId"');
46178
+ }
46179
+ const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
46180
+ const apiPayload = {};
46181
+ const uri = new URL(this.client.config.endpoint + apiPath);
46182
+ const apiHeaders = {
46183
+ 'X-Appwrite-Project': this.client.config.project,
46184
+ accept: 'text/plain',
46185
+ };
46186
+ return this.client.call('get', uri, apiHeaders, apiPayload, 'text');
46187
+ }
46188
+ createTimeline(paramsOrFirst) {
46189
+ let params;
46190
+ if (paramsOrFirst &&
46191
+ typeof paramsOrFirst === 'object' &&
46192
+ !Array.isArray(paramsOrFirst)) {
46193
+ params = (paramsOrFirst || {});
46194
+ }
46195
+ else {
46196
+ params = {
46197
+ videoId: paramsOrFirst,
46198
+ };
46199
+ }
46200
+ const videoId = params.videoId;
46201
+ if (typeof videoId === 'undefined' || videoId === '') {
46202
+ throw new AppwriteException('Missing required parameter: "videoId"');
46203
+ }
46204
+ const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
46205
+ const apiPayload = {};
46206
+ const uri = new URL(this.client.config.endpoint + apiPath);
46207
+ const apiHeaders = {
46208
+ 'X-Appwrite-Project': this.client.config.project,
46209
+ 'content-type': 'application/json',
46210
+ accept: 'application/json',
46211
+ };
46212
+ return this.client.call('post', uri, apiHeaders, apiPayload);
46213
+ }
46214
+ }
46215
+
46216
+ class Waf {
46217
+ constructor(client) {
46218
+ this.client = client;
46219
+ }
46220
+ listRules(paramsOrFirst, ...rest) {
46221
+ let params;
46222
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
46223
+ (paramsOrFirst &&
46224
+ typeof paramsOrFirst === 'object' &&
46225
+ !Array.isArray(paramsOrFirst))) {
46226
+ params = (paramsOrFirst || {});
46227
+ }
46228
+ else {
46229
+ params = {
46230
+ queries: paramsOrFirst,
46231
+ search: rest[0],
46232
+ total: rest[1],
46233
+ };
46234
+ }
46235
+ const queries = params.queries;
46236
+ const search = params.search;
46237
+ const total = params.total;
46238
+ const apiPath = '/waf/rules';
46239
+ const apiPayload = {};
46240
+ if (typeof queries !== 'undefined') {
46241
+ apiPayload['queries'] = queries;
46242
+ }
46243
+ if (typeof search !== 'undefined') {
46244
+ apiPayload['search'] = search;
46245
+ }
46246
+ if (typeof total !== 'undefined') {
46247
+ apiPayload['total'] = total;
46248
+ }
46249
+ const uri = new URL(this.client.config.endpoint + apiPath);
46250
+ const apiHeaders = {
46251
+ 'X-Appwrite-Project': this.client.config.project,
46252
+ accept: 'application/json',
46253
+ };
46254
+ return this.client.call('get', uri, apiHeaders, apiPayload);
46255
+ }
46256
+ createBypassRule(paramsOrFirst, ...rest) {
46257
+ let params;
46258
+ if (paramsOrFirst &&
46259
+ typeof paramsOrFirst === 'object' &&
46260
+ !Array.isArray(paramsOrFirst)) {
46261
+ params = (paramsOrFirst || {});
46262
+ }
46263
+ else {
46264
+ params = {
46265
+ ruleId: paramsOrFirst,
46266
+ resourceType: rest[0],
46267
+ name: rest[1],
46268
+ resourceId: rest[2],
46269
+ description: rest[3],
46270
+ priority: rest[4],
46271
+ enabled: rest[5],
46272
+ conditions: rest[6],
46273
+ };
46274
+ }
46275
+ const ruleId = params.ruleId;
46276
+ const resourceType = params.resourceType;
46277
+ const name = params.name;
46278
+ const resourceId = params.resourceId;
46279
+ const description = params.description;
46280
+ const priority = params.priority;
46281
+ const enabled = params.enabled;
46282
+ const conditions = params.conditions;
46283
+ if (typeof ruleId === 'undefined') {
46284
+ throw new AppwriteException('Missing required parameter: "ruleId"');
46285
+ }
46286
+ if (typeof resourceType === 'undefined') {
46287
+ throw new AppwriteException('Missing required parameter: "resourceType"');
46288
+ }
46289
+ if (typeof name === 'undefined') {
46290
+ throw new AppwriteException('Missing required parameter: "name"');
46291
+ }
46292
+ const apiPath = '/waf/rules/bypass';
46293
+ const apiPayload = {};
46294
+ if (typeof ruleId !== 'undefined') {
46295
+ apiPayload['ruleId'] = ruleId;
46296
+ }
46297
+ if (typeof resourceType !== 'undefined') {
46298
+ apiPayload['resourceType'] = resourceType;
46299
+ }
46300
+ if (typeof resourceId !== 'undefined') {
46301
+ apiPayload['resourceId'] = resourceId;
46302
+ }
46303
+ if (typeof name !== 'undefined') {
46304
+ apiPayload['name'] = name;
46305
+ }
46306
+ if (typeof description !== 'undefined') {
46307
+ apiPayload['description'] = description;
46308
+ }
46309
+ if (typeof priority !== 'undefined') {
46310
+ apiPayload['priority'] = priority;
46311
+ }
46312
+ if (typeof enabled !== 'undefined') {
46313
+ apiPayload['enabled'] = enabled;
46314
+ }
46315
+ if (typeof conditions !== 'undefined') {
46316
+ apiPayload['conditions'] = conditions;
46317
+ }
46318
+ const uri = new URL(this.client.config.endpoint + apiPath);
46319
+ const apiHeaders = {
46320
+ 'X-Appwrite-Project': this.client.config.project,
46321
+ 'content-type': 'application/json',
46322
+ accept: 'application/json',
46323
+ };
46324
+ return this.client.call('post', uri, apiHeaders, apiPayload);
46325
+ }
46326
+ updateBypassRule(paramsOrFirst, ...rest) {
46327
+ let params;
46328
+ if (paramsOrFirst &&
46329
+ typeof paramsOrFirst === 'object' &&
46330
+ !Array.isArray(paramsOrFirst)) {
46331
+ params = (paramsOrFirst || {});
46332
+ }
46333
+ else {
46334
+ params = {
46335
+ ruleId: paramsOrFirst,
46336
+ resourceType: rest[0],
46337
+ resourceId: rest[1],
46338
+ name: rest[2],
46339
+ description: rest[3],
46340
+ priority: rest[4],
46341
+ enabled: rest[5],
46342
+ conditions: rest[6],
46343
+ };
46344
+ }
46345
+ const ruleId = params.ruleId;
46346
+ const resourceType = params.resourceType;
46347
+ const resourceId = params.resourceId;
46348
+ const name = params.name;
46349
+ const description = params.description;
46350
+ const priority = params.priority;
46351
+ const enabled = params.enabled;
46352
+ const conditions = params.conditions;
46353
+ if (typeof ruleId === 'undefined' || ruleId === '') {
46354
+ throw new AppwriteException('Missing required parameter: "ruleId"');
46355
+ }
46356
+ const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
46357
+ const apiPayload = {};
46358
+ if (typeof resourceType !== 'undefined') {
46359
+ apiPayload['resourceType'] = resourceType;
46360
+ }
46361
+ if (typeof resourceId !== 'undefined') {
46362
+ apiPayload['resourceId'] = resourceId;
46363
+ }
46364
+ if (typeof name !== 'undefined') {
46365
+ apiPayload['name'] = name;
46366
+ }
46367
+ if (typeof description !== 'undefined') {
46368
+ apiPayload['description'] = description;
46369
+ }
46370
+ if (typeof priority !== 'undefined') {
46371
+ apiPayload['priority'] = priority;
46372
+ }
46373
+ if (typeof enabled !== 'undefined') {
46374
+ apiPayload['enabled'] = enabled;
46375
+ }
46376
+ if (typeof conditions !== 'undefined') {
46377
+ apiPayload['conditions'] = conditions;
46378
+ }
46379
+ const uri = new URL(this.client.config.endpoint + apiPath);
46380
+ const apiHeaders = {
46381
+ 'X-Appwrite-Project': this.client.config.project,
46382
+ 'content-type': 'application/json',
46383
+ accept: 'application/json',
46384
+ };
46385
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
46386
+ }
46387
+ createChallengeRule(paramsOrFirst, ...rest) {
46388
+ let params;
46389
+ if (paramsOrFirst &&
46390
+ typeof paramsOrFirst === 'object' &&
46391
+ !Array.isArray(paramsOrFirst)) {
46392
+ params = (paramsOrFirst || {});
46393
+ }
46394
+ else {
46395
+ params = {
46396
+ ruleId: paramsOrFirst,
46397
+ resourceType: rest[0],
46398
+ name: rest[1],
46399
+ resourceId: rest[2],
46400
+ description: rest[3],
46401
+ challengeType: rest[4],
46402
+ priority: rest[5],
46403
+ enabled: rest[6],
46404
+ conditions: rest[7],
46405
+ difficulty: rest[8],
46406
+ ttl: rest[9],
46407
+ };
46408
+ }
46409
+ const ruleId = params.ruleId;
46410
+ const resourceType = params.resourceType;
46411
+ const name = params.name;
46412
+ const resourceId = params.resourceId;
46413
+ const description = params.description;
46414
+ const challengeType = params.challengeType;
46415
+ const priority = params.priority;
46416
+ const enabled = params.enabled;
46417
+ const conditions = params.conditions;
46418
+ const difficulty = params.difficulty;
46419
+ const ttl = params.ttl;
46420
+ if (typeof ruleId === 'undefined') {
46421
+ throw new AppwriteException('Missing required parameter: "ruleId"');
46422
+ }
46423
+ if (typeof resourceType === 'undefined') {
46424
+ throw new AppwriteException('Missing required parameter: "resourceType"');
46425
+ }
46426
+ if (typeof name === 'undefined') {
46427
+ throw new AppwriteException('Missing required parameter: "name"');
46428
+ }
46429
+ const apiPath = '/waf/rules/challenge';
46430
+ const apiPayload = {};
46431
+ if (typeof ruleId !== 'undefined') {
46432
+ apiPayload['ruleId'] = ruleId;
46433
+ }
46434
+ if (typeof resourceType !== 'undefined') {
46435
+ apiPayload['resourceType'] = resourceType;
46436
+ }
46437
+ if (typeof resourceId !== 'undefined') {
46438
+ apiPayload['resourceId'] = resourceId;
46439
+ }
46440
+ if (typeof name !== 'undefined') {
46441
+ apiPayload['name'] = name;
46442
+ }
46443
+ if (typeof description !== 'undefined') {
46444
+ apiPayload['description'] = description;
46445
+ }
46446
+ if (typeof challengeType !== 'undefined') {
46447
+ apiPayload['challengeType'] = challengeType;
46448
+ }
46449
+ if (typeof priority !== 'undefined') {
46450
+ apiPayload['priority'] = priority;
46451
+ }
46452
+ if (typeof enabled !== 'undefined') {
46453
+ apiPayload['enabled'] = enabled;
46454
+ }
46455
+ if (typeof conditions !== 'undefined') {
46456
+ apiPayload['conditions'] = conditions;
46457
+ }
46458
+ if (typeof difficulty !== 'undefined') {
46459
+ apiPayload['difficulty'] = difficulty;
46460
+ }
46461
+ if (typeof ttl !== 'undefined') {
46462
+ apiPayload['ttl'] = ttl;
46463
+ }
46464
+ const uri = new URL(this.client.config.endpoint + apiPath);
46465
+ const apiHeaders = {
46466
+ 'X-Appwrite-Project': this.client.config.project,
46467
+ 'content-type': 'application/json',
46468
+ accept: 'application/json',
46469
+ };
46470
+ return this.client.call('post', uri, apiHeaders, apiPayload);
46471
+ }
46472
+ updateChallengeRule(paramsOrFirst, ...rest) {
46473
+ let params;
46474
+ if (paramsOrFirst &&
46475
+ typeof paramsOrFirst === 'object' &&
46476
+ !Array.isArray(paramsOrFirst)) {
46477
+ params = (paramsOrFirst || {});
46478
+ }
46479
+ else {
46480
+ params = {
46481
+ ruleId: paramsOrFirst,
46482
+ resourceType: rest[0],
46483
+ resourceId: rest[1],
46484
+ name: rest[2],
46485
+ description: rest[3],
46486
+ challengeType: rest[4],
46487
+ priority: rest[5],
46488
+ enabled: rest[6],
46489
+ conditions: rest[7],
46490
+ difficulty: rest[8],
46491
+ ttl: rest[9],
46492
+ };
46493
+ }
46494
+ const ruleId = params.ruleId;
46495
+ const resourceType = params.resourceType;
46496
+ const resourceId = params.resourceId;
46497
+ const name = params.name;
46498
+ const description = params.description;
46499
+ const challengeType = params.challengeType;
46500
+ const priority = params.priority;
46501
+ const enabled = params.enabled;
46502
+ const conditions = params.conditions;
46503
+ const difficulty = params.difficulty;
46504
+ const ttl = params.ttl;
46505
+ if (typeof ruleId === 'undefined' || ruleId === '') {
46506
+ throw new AppwriteException('Missing required parameter: "ruleId"');
46507
+ }
46508
+ const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
46509
+ const apiPayload = {};
46510
+ if (typeof resourceType !== 'undefined') {
46511
+ apiPayload['resourceType'] = resourceType;
46512
+ }
46513
+ if (typeof resourceId !== 'undefined') {
46514
+ apiPayload['resourceId'] = resourceId;
46515
+ }
46516
+ if (typeof name !== 'undefined') {
46517
+ apiPayload['name'] = name;
46518
+ }
46519
+ if (typeof description !== 'undefined') {
46520
+ apiPayload['description'] = description;
46521
+ }
46522
+ if (typeof challengeType !== 'undefined') {
46523
+ apiPayload['challengeType'] = challengeType;
46524
+ }
46525
+ if (typeof priority !== 'undefined') {
46526
+ apiPayload['priority'] = priority;
46527
+ }
46528
+ if (typeof enabled !== 'undefined') {
46529
+ apiPayload['enabled'] = enabled;
46530
+ }
46531
+ if (typeof conditions !== 'undefined') {
46532
+ apiPayload['conditions'] = conditions;
46533
+ }
46534
+ if (typeof difficulty !== 'undefined') {
46535
+ apiPayload['difficulty'] = difficulty;
46536
+ }
46537
+ if (typeof ttl !== 'undefined') {
46538
+ apiPayload['ttl'] = ttl;
46539
+ }
46540
+ const uri = new URL(this.client.config.endpoint + apiPath);
46541
+ const apiHeaders = {
46542
+ 'X-Appwrite-Project': this.client.config.project,
46543
+ 'content-type': 'application/json',
46544
+ accept: 'application/json',
46545
+ };
46546
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
46547
+ }
46548
+ createDenyRule(paramsOrFirst, ...rest) {
46549
+ let params;
46550
+ if (paramsOrFirst &&
46551
+ typeof paramsOrFirst === 'object' &&
46552
+ !Array.isArray(paramsOrFirst)) {
46553
+ params = (paramsOrFirst || {});
46554
+ }
46555
+ else {
46556
+ params = {
46557
+ ruleId: paramsOrFirst,
46558
+ resourceType: rest[0],
46559
+ name: rest[1],
46560
+ resourceId: rest[2],
46561
+ description: rest[3],
46562
+ priority: rest[4],
46563
+ enabled: rest[5],
46564
+ conditions: rest[6],
46565
+ };
46566
+ }
46567
+ const ruleId = params.ruleId;
46568
+ const resourceType = params.resourceType;
46569
+ const name = params.name;
46570
+ const resourceId = params.resourceId;
46571
+ const description = params.description;
46572
+ const priority = params.priority;
46573
+ const enabled = params.enabled;
46574
+ const conditions = params.conditions;
46575
+ if (typeof ruleId === 'undefined') {
46576
+ throw new AppwriteException('Missing required parameter: "ruleId"');
46577
+ }
46578
+ if (typeof resourceType === 'undefined') {
46579
+ throw new AppwriteException('Missing required parameter: "resourceType"');
46580
+ }
46581
+ if (typeof name === 'undefined') {
46582
+ throw new AppwriteException('Missing required parameter: "name"');
46583
+ }
46584
+ const apiPath = '/waf/rules/deny';
46585
+ const apiPayload = {};
46586
+ if (typeof ruleId !== 'undefined') {
46587
+ apiPayload['ruleId'] = ruleId;
46588
+ }
46589
+ if (typeof resourceType !== 'undefined') {
46590
+ apiPayload['resourceType'] = resourceType;
46591
+ }
46592
+ if (typeof resourceId !== 'undefined') {
46593
+ apiPayload['resourceId'] = resourceId;
46594
+ }
46595
+ if (typeof name !== 'undefined') {
46596
+ apiPayload['name'] = name;
46597
+ }
46598
+ if (typeof description !== 'undefined') {
46599
+ apiPayload['description'] = description;
46600
+ }
46601
+ if (typeof priority !== 'undefined') {
46602
+ apiPayload['priority'] = priority;
46603
+ }
46604
+ if (typeof enabled !== 'undefined') {
46605
+ apiPayload['enabled'] = enabled;
46606
+ }
46607
+ if (typeof conditions !== 'undefined') {
46608
+ apiPayload['conditions'] = conditions;
46609
+ }
46610
+ const uri = new URL(this.client.config.endpoint + apiPath);
46611
+ const apiHeaders = {
46612
+ 'X-Appwrite-Project': this.client.config.project,
46613
+ 'content-type': 'application/json',
46614
+ accept: 'application/json',
46615
+ };
46616
+ return this.client.call('post', uri, apiHeaders, apiPayload);
46617
+ }
46618
+ updateDenyRule(paramsOrFirst, ...rest) {
46619
+ let params;
46620
+ if (paramsOrFirst &&
46621
+ typeof paramsOrFirst === 'object' &&
46622
+ !Array.isArray(paramsOrFirst)) {
46623
+ params = (paramsOrFirst || {});
46624
+ }
46625
+ else {
46626
+ params = {
46627
+ ruleId: paramsOrFirst,
46628
+ resourceType: rest[0],
46629
+ resourceId: rest[1],
46630
+ name: rest[2],
46631
+ description: rest[3],
46632
+ priority: rest[4],
46633
+ enabled: rest[5],
46634
+ conditions: rest[6],
46635
+ };
46636
+ }
46637
+ const ruleId = params.ruleId;
46638
+ const resourceType = params.resourceType;
46639
+ const resourceId = params.resourceId;
46640
+ const name = params.name;
46641
+ const description = params.description;
46642
+ const priority = params.priority;
46643
+ const enabled = params.enabled;
46644
+ const conditions = params.conditions;
46645
+ if (typeof ruleId === 'undefined' || ruleId === '') {
46646
+ throw new AppwriteException('Missing required parameter: "ruleId"');
46647
+ }
46648
+ const apiPath = '/waf/rules/deny/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
46649
+ const apiPayload = {};
46650
+ if (typeof resourceType !== 'undefined') {
46651
+ apiPayload['resourceType'] = resourceType;
46652
+ }
46653
+ if (typeof resourceId !== 'undefined') {
46654
+ apiPayload['resourceId'] = resourceId;
46655
+ }
46656
+ if (typeof name !== 'undefined') {
46657
+ apiPayload['name'] = name;
46658
+ }
46659
+ if (typeof description !== 'undefined') {
46660
+ apiPayload['description'] = description;
46661
+ }
46662
+ if (typeof priority !== 'undefined') {
46663
+ apiPayload['priority'] = priority;
46664
+ }
46665
+ if (typeof enabled !== 'undefined') {
46666
+ apiPayload['enabled'] = enabled;
46667
+ }
46668
+ if (typeof conditions !== 'undefined') {
46669
+ apiPayload['conditions'] = conditions;
46670
+ }
46671
+ const uri = new URL(this.client.config.endpoint + apiPath);
46672
+ const apiHeaders = {
46673
+ 'X-Appwrite-Project': this.client.config.project,
46674
+ 'content-type': 'application/json',
46675
+ accept: 'application/json',
46676
+ };
46677
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
46678
+ }
46679
+ createRateLimitRule(paramsOrFirst, ...rest) {
46680
+ let params;
46681
+ if (paramsOrFirst &&
46682
+ typeof paramsOrFirst === 'object' &&
46683
+ !Array.isArray(paramsOrFirst)) {
46684
+ params = (paramsOrFirst || {});
46685
+ }
46686
+ else {
46687
+ params = {
46688
+ ruleId: paramsOrFirst,
46689
+ resourceType: rest[0],
46690
+ name: rest[1],
46691
+ limit: rest[2],
46692
+ interval: rest[3],
46693
+ resourceId: rest[4],
46694
+ description: rest[5],
46695
+ key: rest[6],
46696
+ strategy: rest[7],
46697
+ maxBucketSize: rest[8],
46698
+ priority: rest[9],
46699
+ enabled: rest[10],
46700
+ conditions: rest[11],
46701
+ };
46702
+ }
46703
+ const ruleId = params.ruleId;
46704
+ const resourceType = params.resourceType;
46705
+ const name = params.name;
46706
+ const limit = params.limit;
46707
+ const interval = params.interval;
46708
+ const resourceId = params.resourceId;
46709
+ const description = params.description;
46710
+ const key = params.key;
46711
+ const strategy = params.strategy;
46712
+ const maxBucketSize = params.maxBucketSize;
46713
+ const priority = params.priority;
46714
+ const enabled = params.enabled;
46715
+ const conditions = params.conditions;
46716
+ if (typeof ruleId === 'undefined') {
46717
+ throw new AppwriteException('Missing required parameter: "ruleId"');
46718
+ }
46719
+ if (typeof resourceType === 'undefined') {
46720
+ throw new AppwriteException('Missing required parameter: "resourceType"');
46721
+ }
46722
+ if (typeof name === 'undefined') {
46723
+ throw new AppwriteException('Missing required parameter: "name"');
46724
+ }
46725
+ if (typeof limit === 'undefined') {
46726
+ throw new AppwriteException('Missing required parameter: "limit"');
46727
+ }
46728
+ if (typeof interval === 'undefined') {
46729
+ throw new AppwriteException('Missing required parameter: "interval"');
46730
+ }
46731
+ const apiPath = '/waf/rules/rate-limit';
46732
+ const apiPayload = {};
46733
+ if (typeof ruleId !== 'undefined') {
46734
+ apiPayload['ruleId'] = ruleId;
46735
+ }
46736
+ if (typeof resourceType !== 'undefined') {
46737
+ apiPayload['resourceType'] = resourceType;
46738
+ }
46739
+ if (typeof resourceId !== 'undefined') {
46740
+ apiPayload['resourceId'] = resourceId;
46741
+ }
46742
+ if (typeof name !== 'undefined') {
46743
+ apiPayload['name'] = name;
46744
+ }
46745
+ if (typeof description !== 'undefined') {
46746
+ apiPayload['description'] = description;
44772
46747
  }
44773
46748
  if (typeof limit !== 'undefined') {
44774
46749
  apiPayload['limit'] = limit;
@@ -46000,9 +47975,8 @@ const RECONNECT_PERIOD_MS = 2000;
46000
47975
  * );
46001
47976
  * // sub.update({ background: true }); sub.unsubscribe();
46002
47977
  */
46003
- class Push extends Service {
47978
+ class Push {
46004
47979
  constructor(client) {
46005
- super(client);
46006
47980
  this.mqtt = null;
46007
47981
  this.connecting = null;
46008
47982
  this.Buffer = null;
@@ -46032,6 +48006,7 @@ class Push extends Service {
46032
48006
  this.connectedKey = '';
46033
48007
  this.connectionEpoch = 0;
46034
48008
  this.subscriptions = new Map();
48009
+ this.client = client;
46035
48010
  }
46036
48011
  // The broker subscription for a filter uses the highest QoS any local subscription on
46037
48012
  // it wants, so a QoS-0 subscription never downgrades a QoS-1 one sharing the filter.
@@ -46771,6 +48746,670 @@ function matches(filter, topic) {
46771
48746
  return filterParts.length === topicParts.length;
46772
48747
  }
46773
48748
 
48749
+ /**
48750
+ * Analytics auto-tracking helpers.
48751
+ *
48752
+ * These are hand-written companions to the generated `Analytics` service.
48753
+ * The generated service exposes `createEvent(params)` for arbitrary events;
48754
+ * this module wires up common auto-tracking behaviours (pageviews, outbound
48755
+ * links, downloads, scroll depth, active engagement) on top of it.
48756
+ *
48757
+ * The tracking helpers accept a plain event-emitter function so they do not
48758
+ * hard-couple to the generated `Analytics` class. The emitter adapts this
48759
+ * module's option shape to `createEvent`: `url` is required there, and `props`
48760
+ * is a flat alternating key/value list rather than an object.
48761
+ *
48762
+ * ```ts
48763
+ * const analytics = new Analytics(client);
48764
+ * const tracking = new AnalyticsTracking(
48765
+ * (name, options) => analytics.createEvent({
48766
+ * propertyId: options?.propertyId ?? '<PROPERTY_ID>',
48767
+ * name,
48768
+ * url: options?.url ?? window.location.href,
48769
+ * referrer: options?.referrer,
48770
+ * scrollDepth: options?.scrollDepth,
48771
+ * engagementTime: options?.engagementTime,
48772
+ * props: Object.entries(options?.props ?? {}).flatMap(
48773
+ * ([key, value]) => [key, String(value)],
48774
+ * ),
48775
+ * }),
48776
+ * { propertyId: '<PROPERTY_ID>' }
48777
+ * );
48778
+ * tracking.enableAllAutoTracking();
48779
+ * ```
48780
+ *
48781
+ * `propertyId` is optional: when set it is merged into the options of every
48782
+ * emitted event, so an emitter that forwards `options.propertyId` (as above)
48783
+ * picks it up instead of every caller hand-rolling it into the closure.
48784
+ * Per-event `propertyId` always wins over the configured default.
48785
+ *
48786
+ * All helpers respect `navigator.doNotTrack === '1'` by default; opt out with
48787
+ * `respectDoNotTrack: false` in the constructor options.
48788
+ *
48789
+ * Engagement time follows Plausible's model: rather than one total at unload,
48790
+ * a delta is emitted at every natural checkpoint of the visit (tab hidden, SPA
48791
+ * route change, unload). See `enableAutoEngagementTime` for details.
48792
+ *
48793
+ * Auto-emitted event names follow `snake_case` + lowercase (`pageview`,
48794
+ * `outbound_link`, `file_download`, `screen_view`, etc.). Any prop keys use
48795
+ * camelCase to match the endpoint's parameter naming. Callers can pass any
48796
+ * custom event name; the auto-track methods only own the events they emit
48797
+ * themselves.
48798
+ */
48799
+ const DEFAULT_DOWNLOAD_EXTENSIONS = [
48800
+ 'pdf',
48801
+ 'zip',
48802
+ 'rar',
48803
+ '7z',
48804
+ 'tar',
48805
+ 'gz',
48806
+ 'csv',
48807
+ 'tsv',
48808
+ 'xls',
48809
+ 'xlsx',
48810
+ 'doc',
48811
+ 'docx',
48812
+ 'ppt',
48813
+ 'pptx',
48814
+ 'dmg',
48815
+ 'exe',
48816
+ 'msi',
48817
+ 'pkg',
48818
+ 'deb',
48819
+ 'rpm',
48820
+ 'apk',
48821
+ 'mp3',
48822
+ 'wav',
48823
+ 'flac',
48824
+ 'mp4',
48825
+ 'mov',
48826
+ 'avi',
48827
+ 'mkv',
48828
+ 'webm',
48829
+ ];
48830
+ /**
48831
+ * Two-part public suffixes common enough to matter for outbound-link detection.
48832
+ * See `rootDomain()` for why this is a short list rather than the Public Suffix
48833
+ * List.
48834
+ */
48835
+ const MULTI_PART_SUFFIXES = new Set([
48836
+ 'co.uk',
48837
+ 'org.uk',
48838
+ 'ac.uk',
48839
+ 'gov.uk',
48840
+ 'me.uk',
48841
+ 'net.uk',
48842
+ 'sch.uk',
48843
+ 'co.jp',
48844
+ 'ne.jp',
48845
+ 'or.jp',
48846
+ 'ac.jp',
48847
+ 'go.jp',
48848
+ 'com.au',
48849
+ 'net.au',
48850
+ 'org.au',
48851
+ 'edu.au',
48852
+ 'gov.au',
48853
+ 'com.br',
48854
+ 'net.br',
48855
+ 'org.br',
48856
+ 'com.cn',
48857
+ 'net.cn',
48858
+ 'org.cn',
48859
+ 'gov.cn',
48860
+ 'co.in',
48861
+ 'net.in',
48862
+ 'org.in',
48863
+ 'co.nz',
48864
+ 'net.nz',
48865
+ 'org.nz',
48866
+ 'co.za',
48867
+ 'org.za',
48868
+ 'com.mx',
48869
+ 'com.ar',
48870
+ 'com.co',
48871
+ 'com.pe',
48872
+ 'com.tr',
48873
+ 'com.tw',
48874
+ 'com.sg',
48875
+ 'com.hk',
48876
+ 'com.my',
48877
+ 'com.ph',
48878
+ 'com.vn',
48879
+ 'co.kr',
48880
+ 'co.il',
48881
+ 'co.id',
48882
+ 'co.th',
48883
+ 'com.ua',
48884
+ 'com.pl',
48885
+ 'com.es',
48886
+ ]);
48887
+ const SCROLL_DEPTH_THROTTLE_MS = 200;
48888
+ class AnalyticsTracking {
48889
+ constructor(emit, options = {}) {
48890
+ this.pageviewCleanups = [];
48891
+ this.scrollCleanups = [];
48892
+ this.engagementCleanups = [];
48893
+ this.maxScrollDepth = 0;
48894
+ this.scrollTicking = false;
48895
+ this.lastScrollReport = 0;
48896
+ this.engagementStart = 0;
48897
+ this.engagementAccumulatedMs = 0;
48898
+ this.engagementActive = false;
48899
+ this.emit = emit;
48900
+ this.respectDoNotTrack = options.respectDoNotTrack !== false;
48901
+ this.propertyId = options.propertyId;
48902
+ }
48903
+ /**
48904
+ * Enable the opinionated default auto-tracking set: pageviews, outbound
48905
+ * links, scroll depth and active engagement time. Downloads must be opted
48906
+ * into separately via `enableAutoDownloadTracking()` because the extension
48907
+ * list is application-specific.
48908
+ */
48909
+ enableAllAutoTracking() {
48910
+ this.enableAutoPageviews();
48911
+ this.enableAutoOutboundTracking();
48912
+ this.enableAutoScrollDepth();
48913
+ this.enableAutoEngagementTime();
48914
+ }
48915
+ /**
48916
+ * Track an event manually. Respects the DNT setting and swallows emitter
48917
+ * exceptions so tracking failures never surface to the host page.
48918
+ */
48919
+ track(name, options) {
48920
+ if (!this.canTrack()) {
48921
+ return;
48922
+ }
48923
+ try {
48924
+ this.emit(name, this.withPropertyId(options));
48925
+ }
48926
+ catch (error) {
48927
+ console.warn('AnalyticsTracking: emitter threw', error);
48928
+ }
48929
+ }
48930
+ /**
48931
+ * Convenience wrapper for pageview-shaped events.
48932
+ */
48933
+ pageview(url, referrer) {
48934
+ this.track('pageview', {
48935
+ url: url !== null && url !== void 0 ? url : this.currentPageUrl(),
48936
+ referrer: referrer !== null && referrer !== void 0 ? referrer : (typeof document !== 'undefined'
48937
+ ? document.referrer
48938
+ : undefined),
48939
+ });
48940
+ }
48941
+ /**
48942
+ * Enable SPA-aware pageview tracking. Fires an initial pageview on
48943
+ * enable, then again on every `pushState`, `replaceState`, `popstate`
48944
+ * or hashchange. Idempotent — repeat calls no-op.
48945
+ */
48946
+ enableAutoPageviews() {
48947
+ if (this.pageviewCleanups.length > 0) {
48948
+ return;
48949
+ }
48950
+ if (typeof window === 'undefined' || typeof history === 'undefined') {
48951
+ return;
48952
+ }
48953
+ this.currentPath = this.currentPageUrl();
48954
+ this.pageview();
48955
+ const handleNavigation = () => {
48956
+ const nextPath = this.currentPageUrl();
48957
+ if (nextPath === this.currentPath) {
48958
+ return;
48959
+ }
48960
+ const previous = this.currentPath;
48961
+ this.currentPath = nextPath;
48962
+ this.flushScrollDepth(previous);
48963
+ this.flushEngagement(previous);
48964
+ this.pageview(nextPath);
48965
+ // flushEngagement no longer auto-restarts the timer (see its
48966
+ // implementation note re: bfcache). SPA navigation stays on the
48967
+ // same document, so restart engagement tracking for the new
48968
+ // route as long as the tab is visible.
48969
+ if (this.engagementCleanups.length > 0 &&
48970
+ (typeof document === 'undefined' ||
48971
+ document.visibilityState !== 'hidden')) {
48972
+ this.startEngagement();
48973
+ }
48974
+ };
48975
+ const originalPushState = history.pushState.bind(history);
48976
+ const originalReplaceState = history.replaceState.bind(history);
48977
+ // Our wrappers stay reachable after cleanup whenever another library
48978
+ // patched on top of ours, so they have to be switchable off rather than
48979
+ // merely unreferenced.
48980
+ let patchActive = true;
48981
+ const patchedPushState = (data, unused, url) => {
48982
+ originalPushState(data, unused, url);
48983
+ if (patchActive) {
48984
+ handleNavigation();
48985
+ }
48986
+ };
48987
+ const patchedReplaceState = (data, unused, url) => {
48988
+ originalReplaceState(data, unused, url);
48989
+ if (patchActive) {
48990
+ handleNavigation();
48991
+ }
48992
+ };
48993
+ history.pushState = patchedPushState;
48994
+ history.replaceState = patchedReplaceState;
48995
+ const popstateHandler = () => handleNavigation();
48996
+ const hashchangeHandler = () => handleNavigation();
48997
+ window.addEventListener('popstate', popstateHandler);
48998
+ window.addEventListener('hashchange', hashchangeHandler);
48999
+ this.pageviewCleanups.push(() => {
49000
+ // Only unwind our own patch. A router (Next.js App Router, React
49001
+ // Router, …) that patched these after us owns the current value,
49002
+ // and assigning our saved reference back would silently throw its
49003
+ // wrapper away. In that case ours stays in the chain, which is why
49004
+ // `patchActive` exists: the wrapper keeps delegating to the original
49005
+ // but stops reporting.
49006
+ patchActive = false;
49007
+ if (history.pushState === patchedPushState) {
49008
+ history.pushState = originalPushState;
49009
+ }
49010
+ if (history.replaceState === patchedReplaceState) {
49011
+ history.replaceState = originalReplaceState;
49012
+ }
49013
+ window.removeEventListener('popstate', popstateHandler);
49014
+ window.removeEventListener('hashchange', hashchangeHandler);
49015
+ });
49016
+ }
49017
+ /**
49018
+ * Disable auto-pageview tracking installed by `enableAutoPageviews`.
49019
+ * Safe to call when auto-pageviews were never enabled.
49020
+ */
49021
+ disableAutoPageviews() {
49022
+ for (const cleanup of this.pageviewCleanups) {
49023
+ cleanup();
49024
+ }
49025
+ this.pageviewCleanups = [];
49026
+ }
49027
+ /**
49028
+ * Enable click-based outbound link tracking. Detects anchor clicks that
49029
+ * navigate to a different origin and fires an `outbound_link` event
49030
+ * (with `hostname` and `href` props) before the browser navigates.
49031
+ */
49032
+ enableAutoOutboundTracking(options = {}) {
49033
+ if (this.outboundCleanup) {
49034
+ return;
49035
+ }
49036
+ if (typeof document === 'undefined') {
49037
+ return;
49038
+ }
49039
+ const includeSubdomains = options.includeSubdomains === true;
49040
+ const clickHandler = (event) => {
49041
+ const anchor = this.findAnchor(event.target);
49042
+ if (!anchor || !anchor.href) {
49043
+ return;
49044
+ }
49045
+ const target = this.parseUrl(anchor.href);
49046
+ if (!target || !this.isExternal(target, includeSubdomains)) {
49047
+ return;
49048
+ }
49049
+ this.track('outbound_link', {
49050
+ url: target.href,
49051
+ props: { hostname: target.hostname, href: target.href },
49052
+ });
49053
+ };
49054
+ document.addEventListener('click', clickHandler, { capture: true });
49055
+ this.outboundCleanup = () => document.removeEventListener('click', clickHandler, {
49056
+ capture: true,
49057
+ });
49058
+ }
49059
+ /**
49060
+ * Disable outbound-link tracking installed by `enableAutoOutboundTracking`.
49061
+ * Safe to call when auto-outbound was never enabled.
49062
+ */
49063
+ disableAutoOutboundTracking() {
49064
+ if (this.outboundCleanup) {
49065
+ this.outboundCleanup();
49066
+ this.outboundCleanup = undefined;
49067
+ }
49068
+ }
49069
+ /**
49070
+ * Enable click-based download tracking. Detects anchor clicks that point
49071
+ * at a file whose extension appears in the configured list and fires a
49072
+ * `file_download` event with `filename`, `extension` and `href` props.
49073
+ */
49074
+ enableAutoDownloadTracking(options = {}) {
49075
+ var _a;
49076
+ if (this.downloadCleanup) {
49077
+ return;
49078
+ }
49079
+ if (typeof document === 'undefined') {
49080
+ return;
49081
+ }
49082
+ const extensions = ((_a = options.extensions) !== null && _a !== void 0 ? _a : DEFAULT_DOWNLOAD_EXTENSIONS).map((ext) => ext.toLowerCase().replace(/^\./, ''));
49083
+ const extensionSet = new Set(extensions);
49084
+ const clickHandler = (event) => {
49085
+ var _a, _b;
49086
+ const anchor = this.findAnchor(event.target);
49087
+ if (!anchor || !anchor.href) {
49088
+ return;
49089
+ }
49090
+ const url = this.parseUrl(anchor.href);
49091
+ if (!url) {
49092
+ return;
49093
+ }
49094
+ const filename = (_a = url.pathname.split('/').pop()) !== null && _a !== void 0 ? _a : '';
49095
+ const extension = filename.includes('.')
49096
+ ? (_b = filename.split('.').pop()) === null || _b === void 0 ? void 0 : _b.toLowerCase()
49097
+ : undefined;
49098
+ if (!extension || !extensionSet.has(extension)) {
49099
+ return;
49100
+ }
49101
+ this.track('file_download', {
49102
+ url: url.href,
49103
+ props: { filename, extension, href: url.href },
49104
+ });
49105
+ };
49106
+ document.addEventListener('click', clickHandler, { capture: true });
49107
+ this.downloadCleanup = () => document.removeEventListener('click', clickHandler, {
49108
+ capture: true,
49109
+ });
49110
+ }
49111
+ /**
49112
+ * Disable file-download tracking installed by `enableAutoDownloadTracking`.
49113
+ * Safe to call when auto-download was never enabled.
49114
+ */
49115
+ disableAutoDownloadTracking() {
49116
+ if (this.downloadCleanup) {
49117
+ this.downloadCleanup();
49118
+ this.downloadCleanup = undefined;
49119
+ }
49120
+ }
49121
+ /**
49122
+ * Enable passive scroll-depth tracking. Records the maximum percent of the
49123
+ * document scrolled and reports it on `beforeunload` and on SPA route
49124
+ * changes. Uses a throttled passive listener so it is safe on hot paths.
49125
+ */
49126
+ enableAutoScrollDepth() {
49127
+ if (this.scrollCleanups.length > 0) {
49128
+ return;
49129
+ }
49130
+ if (typeof window === 'undefined' || typeof document === 'undefined') {
49131
+ return;
49132
+ }
49133
+ this.maxScrollDepth = 0;
49134
+ this.lastScrollReport = 0;
49135
+ const scrollHandler = () => {
49136
+ if (this.scrollTicking) {
49137
+ return;
49138
+ }
49139
+ this.scrollTicking = true;
49140
+ window.requestAnimationFrame(() => {
49141
+ const now = Date.now();
49142
+ if (now - this.lastScrollReport < SCROLL_DEPTH_THROTTLE_MS) {
49143
+ this.scrollTicking = false;
49144
+ return;
49145
+ }
49146
+ this.lastScrollReport = now;
49147
+ const depth = this.computeScrollDepth();
49148
+ if (depth > this.maxScrollDepth) {
49149
+ this.maxScrollDepth = depth;
49150
+ }
49151
+ this.scrollTicking = false;
49152
+ });
49153
+ };
49154
+ const unloadHandler = () => {
49155
+ this.flushScrollDepth(this.currentPageUrl());
49156
+ };
49157
+ window.addEventListener('scroll', scrollHandler, { passive: true });
49158
+ window.addEventListener('beforeunload', unloadHandler);
49159
+ window.addEventListener('pagehide', unloadHandler);
49160
+ this.scrollCleanups.push(() => {
49161
+ window.removeEventListener('scroll', scrollHandler);
49162
+ window.removeEventListener('beforeunload', unloadHandler);
49163
+ window.removeEventListener('pagehide', unloadHandler);
49164
+ });
49165
+ }
49166
+ /**
49167
+ * Disable scroll-depth tracking installed by `enableAutoScrollDepth`. Safe
49168
+ * to call when auto-scroll-depth was never enabled. Any accumulated depth
49169
+ * for the current page is dropped.
49170
+ */
49171
+ disableAutoScrollDepth() {
49172
+ for (const cleanup of this.scrollCleanups) {
49173
+ cleanup();
49174
+ }
49175
+ this.scrollCleanups = [];
49176
+ this.maxScrollDepth = 0;
49177
+ this.scrollTicking = false;
49178
+ this.lastScrollReport = 0;
49179
+ }
49180
+ /**
49181
+ * Enable active engagement-time tracking. Counts time the tab is visible
49182
+ * and uses `visibilitychange` to exclude background time.
49183
+ *
49184
+ * Delivery follows Plausible's model rather than a single total at the
49185
+ * end of the visit: an `engagement_time` event is emitted at every natural
49186
+ * checkpoint — the tab going hidden, an SPA route change, and finally
49187
+ * `beforeunload`/`pagehide`. Unload is kept only as a best-effort last
49188
+ * flush; it is the least reliable moment to send anything (browsers
49189
+ * routinely cancel in-flight requests there, and `sendBeacon` cannot set
49190
+ * the `X-Appwrite-Project` header the endpoint requires), so it must never
49191
+ * be the only delivery.
49192
+ *
49193
+ * Each event carries a **delta** — the seconds accrued since the previous
49194
+ * flush, not a running total — so the values are additive per session and
49195
+ * a lost event costs only its own slice.
49196
+ *
49197
+ * There is deliberately no periodic ping. The cadence is driven by
49198
+ * navigation and tab switches, so request volume tracks what the visitor
49199
+ * actually does instead of multiplying with time on page.
49200
+ */
49201
+ enableAutoEngagementTime() {
49202
+ if (this.engagementCleanups.length > 0) {
49203
+ return;
49204
+ }
49205
+ if (typeof window === 'undefined' || typeof document === 'undefined') {
49206
+ return;
49207
+ }
49208
+ this.engagementAccumulatedMs = 0;
49209
+ // Do not start the clock for a tab that is already hidden (prerender,
49210
+ // background tab restore); `visibilitychange` starts it when it is
49211
+ // actually looked at.
49212
+ if (document.visibilityState !== 'hidden') {
49213
+ this.startEngagement();
49214
+ }
49215
+ const visibilityHandler = () => {
49216
+ if (document.visibilityState === 'hidden') {
49217
+ // Flush, don't just pause. The page is still fully alive here,
49218
+ // which makes this the most reliable delivery point in the
49219
+ // whole visit — and it is the same moment Plausible reports on.
49220
+ this.flushEngagement(this.currentPageUrl());
49221
+ }
49222
+ else if (document.visibilityState === 'visible') {
49223
+ this.startEngagement();
49224
+ }
49225
+ };
49226
+ const unloadHandler = () => {
49227
+ this.flushEngagement(this.currentPageUrl());
49228
+ };
49229
+ const pageshowHandler = (event) => {
49230
+ // When the page is restored from the back-forward cache the
49231
+ // engagement timer is in a stopped state (flushEngagement paused
49232
+ // it on pagehide and does not auto-restart). Kick off a fresh
49233
+ // engagementStart so bfcache dwell time is not billed as
49234
+ // engagement.
49235
+ if (event.persisted) {
49236
+ this.startEngagement();
49237
+ }
49238
+ };
49239
+ document.addEventListener('visibilitychange', visibilityHandler);
49240
+ window.addEventListener('beforeunload', unloadHandler);
49241
+ window.addEventListener('pagehide', unloadHandler);
49242
+ window.addEventListener('pageshow', pageshowHandler);
49243
+ this.engagementCleanups.push(() => {
49244
+ document.removeEventListener('visibilitychange', visibilityHandler);
49245
+ window.removeEventListener('beforeunload', unloadHandler);
49246
+ window.removeEventListener('pagehide', unloadHandler);
49247
+ window.removeEventListener('pageshow', pageshowHandler);
49248
+ });
49249
+ }
49250
+ /**
49251
+ * Disable engagement-time tracking installed by `enableAutoEngagementTime`.
49252
+ * Safe to call when auto-engagement was never enabled. Any accumulated
49253
+ * engagement time is dropped without being emitted.
49254
+ */
49255
+ disableAutoEngagementTime() {
49256
+ for (const cleanup of this.engagementCleanups) {
49257
+ cleanup();
49258
+ }
49259
+ this.engagementCleanups = [];
49260
+ this.engagementActive = false;
49261
+ this.engagementAccumulatedMs = 0;
49262
+ this.engagementStart = 0;
49263
+ }
49264
+ /**
49265
+ * Merge the configured `propertyId` into an event's options. Returns the
49266
+ * caller's object untouched when no default is configured (or the event
49267
+ * already carries one), so emitters written against the pre-`propertyId`
49268
+ * shape keep receiving exactly what they received before.
49269
+ */
49270
+ withPropertyId(options) {
49271
+ if (this.propertyId === undefined ||
49272
+ (options === null || options === void 0 ? void 0 : options.propertyId) !== undefined) {
49273
+ return options;
49274
+ }
49275
+ return Object.assign(Object.assign({}, (options !== null && options !== void 0 ? options : {})), { propertyId: this.propertyId });
49276
+ }
49277
+ canTrack() {
49278
+ if (!this.respectDoNotTrack) {
49279
+ return true;
49280
+ }
49281
+ if (typeof navigator === 'undefined') {
49282
+ return true;
49283
+ }
49284
+ return navigator.doNotTrack !== '1';
49285
+ }
49286
+ currentPageUrl() {
49287
+ if (typeof window === 'undefined' || !window.location) {
49288
+ return '';
49289
+ }
49290
+ return window.location.href;
49291
+ }
49292
+ findAnchor(target) {
49293
+ let node = target;
49294
+ while (node) {
49295
+ if (node.tagName === 'A') {
49296
+ return node;
49297
+ }
49298
+ node = node.parentNode;
49299
+ }
49300
+ return null;
49301
+ }
49302
+ parseUrl(href) {
49303
+ try {
49304
+ return new URL(href, window.location.href);
49305
+ }
49306
+ catch (_a) {
49307
+ return null;
49308
+ }
49309
+ }
49310
+ isExternal(target, includeSubdomains) {
49311
+ if (target.protocol !== 'http:' && target.protocol !== 'https:') {
49312
+ return false;
49313
+ }
49314
+ if (target.hostname === window.location.hostname) {
49315
+ return false;
49316
+ }
49317
+ if (includeSubdomains) {
49318
+ return true;
49319
+ }
49320
+ const root = this.rootDomain(window.location.hostname);
49321
+ return this.rootDomain(target.hostname) !== root;
49322
+ }
49323
+ rootDomain(hostname) {
49324
+ const parts = hostname.split('.');
49325
+ if (parts.length <= 2) {
49326
+ return hostname;
49327
+ }
49328
+ // Taking the last two labels is wrong wherever the registry sells names
49329
+ // one level down: `shop.example.co.uk` and `google.co.uk` both reduce to
49330
+ // `co.uk`, so every outbound click between two `.co.uk` sites looks
49331
+ // internal and is dropped. Take three labels after a known two-part
49332
+ // suffix instead.
49333
+ //
49334
+ // This is a heuristic, not the Public Suffix List — the full list is
49335
+ // orders of magnitude larger than this whole file, and a tracking
49336
+ // snippet cannot carry it. Sites on a suffix that is missing here can
49337
+ // pass `includeSubdomains: true` to treat every other host as outbound.
49338
+ const suffix = parts.slice(-2).join('.');
49339
+ if (parts.length > 2 && MULTI_PART_SUFFIXES.has(suffix)) {
49340
+ return parts.slice(-3).join('.');
49341
+ }
49342
+ return suffix;
49343
+ }
49344
+ computeScrollDepth() {
49345
+ const scrollTop = window.scrollY || document.documentElement.scrollTop;
49346
+ const viewport = window.innerHeight || document.documentElement.clientHeight;
49347
+ const total = document.documentElement.scrollHeight;
49348
+ if (total <= viewport) {
49349
+ return 100;
49350
+ }
49351
+ const depth = Math.round(((scrollTop + viewport) / total) * 100);
49352
+ return Math.max(0, Math.min(100, depth));
49353
+ }
49354
+ flushScrollDepth(url) {
49355
+ if (this.scrollCleanups.length === 0) {
49356
+ return;
49357
+ }
49358
+ if (this.maxScrollDepth <= 0) {
49359
+ return;
49360
+ }
49361
+ this.track('scroll_depth', {
49362
+ url,
49363
+ scrollDepth: this.maxScrollDepth,
49364
+ });
49365
+ this.maxScrollDepth = 0;
49366
+ }
49367
+ startEngagement() {
49368
+ if (this.engagementActive) {
49369
+ return;
49370
+ }
49371
+ this.engagementActive = true;
49372
+ this.engagementStart = Date.now();
49373
+ }
49374
+ pauseEngagement() {
49375
+ if (!this.engagementActive) {
49376
+ return;
49377
+ }
49378
+ this.engagementActive = false;
49379
+ this.engagementAccumulatedMs += Date.now() - this.engagementStart;
49380
+ }
49381
+ flushEngagement(url) {
49382
+ if (this.engagementCleanups.length === 0) {
49383
+ return;
49384
+ }
49385
+ this.pauseEngagement();
49386
+ // Deltas, not a running total: emit only what accrued since the last
49387
+ // flush. `floor` plus keeping the sub-second remainder in the
49388
+ // accumulator is what makes repeated flushes safe — nothing is emitted
49389
+ // twice, and a visit chopped into many short segments does not lose a
49390
+ // fraction of a second to rounding on every one of them.
49391
+ const seconds = Math.floor(this.engagementAccumulatedMs / 1000);
49392
+ if (seconds > 0) {
49393
+ // Deduct before emitting so a synchronous emitter that re-enters
49394
+ // (or throws) can never bill the same seconds again.
49395
+ this.engagementAccumulatedMs -= seconds * 1000;
49396
+ this.track('engagement_time', {
49397
+ url,
49398
+ engagementTime: seconds,
49399
+ });
49400
+ }
49401
+ // NOTE: intentionally do NOT call startEngagement() here. flushEngagement
49402
+ // runs on `pagehide`, which is also the last hook before the browser
49403
+ // may freeze the page into the back-forward cache. Auto-restarting
49404
+ // would snapshot engagementStart just before the freeze; the next
49405
+ // pauseEngagement (after bfcache restore) would then bill the entire
49406
+ // bfcache dwell as active engagement. Restart is driven by explicit
49407
+ // resume signals: `pageshow` (with `persisted === true`),
49408
+ // `visibilitychange` back to visible, or the SPA navigation flow in
49409
+ // `enableAutoPageviews`.
49410
+ }
49411
+ }
49412
+
46774
49413
  /**
46775
49414
  * Helper class to generate permission strings for resources.
46776
49415
  */
@@ -47477,6 +50116,68 @@ var OAuthProvider;
47477
50116
  OAuthProvider["Zoom"] = "zoom";
47478
50117
  })(OAuthProvider || (OAuthProvider = {}));
47479
50118
 
50119
+ var PlatformResourceType;
50120
+ (function (PlatformResourceType) {
50121
+ PlatformResourceType["Projects"] = "projects";
50122
+ PlatformResourceType["Organizations"] = "organizations";
50123
+ PlatformResourceType["Users"] = "users";
50124
+ PlatformResourceType["Memberships"] = "memberships";
50125
+ PlatformResourceType["Rules"] = "rules";
50126
+ PlatformResourceType["Keys"] = "keys";
50127
+ PlatformResourceType["Platforms"] = "platforms";
50128
+ PlatformResourceType["Webhooks"] = "webhooks";
50129
+ PlatformResourceType["Certificates"] = "certificates";
50130
+ })(PlatformResourceType || (PlatformResourceType = {}));
50131
+
50132
+ var ProjectResourceType;
50133
+ (function (ProjectResourceType) {
50134
+ ProjectResourceType["Users"] = "users";
50135
+ ProjectResourceType["Teams"] = "teams";
50136
+ ProjectResourceType["Memberships"] = "memberships";
50137
+ ProjectResourceType["Databases"] = "databases";
50138
+ ProjectResourceType["Buckets"] = "buckets";
50139
+ ProjectResourceType["Functions"] = "functions";
50140
+ ProjectResourceType["Sites"] = "sites";
50141
+ ProjectResourceType["Deployments"] = "deployments";
50142
+ ProjectResourceType["Topics"] = "topics";
50143
+ ProjectResourceType["Providers"] = "providers";
50144
+ ProjectResourceType["Messages"] = "messages";
50145
+ })(ProjectResourceType || (ProjectResourceType = {}));
50146
+
50147
+ var AnalyticsInterval;
50148
+ (function (AnalyticsInterval) {
50149
+ AnalyticsInterval["OneHour"] = "1h";
50150
+ AnalyticsInterval["OneDay"] = "1d";
50151
+ AnalyticsInterval["OneWeek"] = "1w";
50152
+ AnalyticsInterval["OneMonth"] = "1m";
50153
+ })(AnalyticsInterval || (AnalyticsInterval = {}));
50154
+
50155
+ var AnalyticsDimension;
50156
+ (function (AnalyticsDimension) {
50157
+ AnalyticsDimension["Country"] = "country";
50158
+ AnalyticsDimension["Region"] = "region";
50159
+ AnalyticsDimension["City"] = "city";
50160
+ AnalyticsDimension["Browser"] = "browser";
50161
+ AnalyticsDimension["OperatingSystem"] = "operatingSystem";
50162
+ AnalyticsDimension["Device"] = "device";
50163
+ AnalyticsDimension["ScreenSize"] = "screenSize";
50164
+ AnalyticsDimension["ReferrerSource"] = "referrerSource";
50165
+ AnalyticsDimension["Channel"] = "channel";
50166
+ AnalyticsDimension["UtmSource"] = "utmSource";
50167
+ AnalyticsDimension["UtmMedium"] = "utmMedium";
50168
+ AnalyticsDimension["UtmCampaign"] = "utmCampaign";
50169
+ AnalyticsDimension["UtmContent"] = "utmContent";
50170
+ AnalyticsDimension["UtmTerm"] = "utmTerm";
50171
+ AnalyticsDimension["Page"] = "page";
50172
+ AnalyticsDimension["Hostname"] = "hostname";
50173
+ AnalyticsDimension["EntryPage"] = "entryPage";
50174
+ AnalyticsDimension["ExitPage"] = "exitPage";
50175
+ AnalyticsDimension["TrafficType"] = "trafficType";
50176
+ AnalyticsDimension["BotName"] = "botName";
50177
+ AnalyticsDimension["BotCategory"] = "botCategory";
50178
+ AnalyticsDimension["EventName"] = "eventName";
50179
+ })(AnalyticsDimension || (AnalyticsDimension = {}));
50180
+
47480
50181
  var Browser;
47481
50182
  (function (Browser) {
47482
50183
  Browser["AvantBrowser"] = "aa";
@@ -48292,6 +50993,14 @@ var QuerySuggestionResource;
48292
50993
  QuerySuggestionResource["ResourceTokens"] = "resourcetokens";
48293
50994
  QuerySuggestionResource["Transactions"] = "transactions";
48294
50995
  QuerySuggestionResource["TransactionLogs"] = "transactionlogs";
50996
+ QuerySuggestionResource["Videos"] = "videos";
50997
+ QuerySuggestionResource["VideosPreviews"] = "videos_previews";
50998
+ QuerySuggestionResource["VideosRenditions"] = "videos_renditions";
50999
+ QuerySuggestionResource["VideosRenditionsSegments"] = "videos_renditions_segments";
51000
+ QuerySuggestionResource["VideosProfiles"] = "videos_profiles";
51001
+ QuerySuggestionResource["VideosSubtitles"] = "videos_subtitles";
51002
+ QuerySuggestionResource["VideosSubtitlesSegments"] = "videos_subtitles_segments";
51003
+ QuerySuggestionResource["AnalyticsProperties"] = "analyticsproperties";
48295
51004
  QuerySuggestionResource["DedicatedDatabases"] = "dedicateddatabases";
48296
51005
  QuerySuggestionResource["DedicatedDatabaseConfigs"] = "dedicateddatabaseconfigs";
48297
51006
  QuerySuggestionResource["DedicatedDatabaseRuntimes"] = "dedicateddatabaseruntimes";
@@ -48714,6 +51423,8 @@ var ProjectKeyScopes;
48714
51423
  ProjectKeyScopes["ReportsWrite"] = "reports.write";
48715
51424
  ProjectKeyScopes["PresencesRead"] = "presences.read";
48716
51425
  ProjectKeyScopes["PresencesWrite"] = "presences.write";
51426
+ ProjectKeyScopes["VideosRead"] = "videos.read";
51427
+ ProjectKeyScopes["VideosWrite"] = "videos.write";
48717
51428
  ProjectKeyScopes["DedicatedDatabasesExecute"] = "dedicatedDatabases.execute";
48718
51429
  ProjectKeyScopes["BackupsPoliciesRead"] = "backups.policies.read";
48719
51430
  ProjectKeyScopes["BackupsPoliciesWrite"] = "backups.policies.write";
@@ -48732,6 +51443,8 @@ var ProjectKeyScopes;
48732
51443
  ProjectKeyScopes["Oauth2Read"] = "oauth2.read";
48733
51444
  ProjectKeyScopes["Oauth2Write"] = "oauth2.write";
48734
51445
  ProjectKeyScopes["Oauth2Introspect"] = "oauth2.introspect";
51446
+ ProjectKeyScopes["AnalyticsRead"] = "analytics.read";
51447
+ ProjectKeyScopes["AnalyticsWrite"] = "analytics.write";
48735
51448
  })(ProjectKeyScopes || (ProjectKeyScopes = {}));
48736
51449
 
48737
51450
  var FunctionTemplateUseCase;
@@ -48981,6 +51694,7 @@ var ProjectAuthMethodId;
48981
51694
  ProjectAuthMethodId["Invites"] = "invites";
48982
51695
  ProjectAuthMethodId["Jwt"] = "jwt";
48983
51696
  ProjectAuthMethodId["Phone"] = "phone";
51697
+ ProjectAuthMethodId["Passkey"] = "passkey";
48984
51698
  })(ProjectAuthMethodId || (ProjectAuthMethodId = {}));
48985
51699
 
48986
51700
  var ProjectOAuth2Auth0Prompt;
@@ -49122,6 +51836,7 @@ var ProjectPolicyId;
49122
51836
  ProjectPolicyId["Denydisposableemail"] = "deny-disposable-email";
49123
51837
  ProjectPolicyId["Denyfreeemail"] = "deny-free-email";
49124
51838
  ProjectPolicyId["Denycorporateemail"] = "deny-corporate-email";
51839
+ ProjectPolicyId["Passkey"] = "passkey";
49125
51840
  })(ProjectPolicyId || (ProjectPolicyId = {}));
49126
51841
 
49127
51842
  var ProjectProtocolId;
@@ -49366,6 +52081,9 @@ var TablesDBIndexType;
49366
52081
 
49367
52082
  var UsageEventMetric;
49368
52083
  (function (UsageEventMetric) {
52084
+ UsageEventMetric["AnalyticsEvents"] = "analytics.events";
52085
+ UsageEventMetric["AnalyticsPageviews"] = "analytics.pageviews";
52086
+ UsageEventMetric["AnalyticsBotsEvents"] = "analytics.bots.events";
49369
52087
  UsageEventMetric["NetworkRequests"] = "network.requests";
49370
52088
  UsageEventMetric["NetworkInbound"] = "network.inbound";
49371
52089
  UsageEventMetric["NetworkOutbound"] = "network.outbound";
@@ -49483,6 +52201,7 @@ var UsageOrderDirection;
49483
52201
 
49484
52202
  var UsageGaugeMetric;
49485
52203
  (function (UsageGaugeMetric) {
52204
+ UsageGaugeMetric["AnalyticsProperties"] = "analytics.properties";
49486
52205
  UsageGaugeMetric["Teams"] = "teams";
49487
52206
  UsageGaugeMetric["Users"] = "users";
49488
52207
  UsageGaugeMetric["Messages"] = "messages";
@@ -49580,6 +52299,24 @@ var VectorsDBIndexType;
49580
52299
  VectorsDBIndexType["Unique"] = "unique";
49581
52300
  })(VectorsDBIndexType || (VectorsDBIndexType = {}));
49582
52301
 
52302
+ var VideoOutput;
52303
+ (function (VideoOutput) {
52304
+ VideoOutput["Hls"] = "hls";
52305
+ VideoOutput["Dash"] = "dash";
52306
+ VideoOutput["Cmaf"] = "cmaf";
52307
+ })(VideoOutput || (VideoOutput = {}));
52308
+
52309
+ var VideoRenditionStatus;
52310
+ (function (VideoRenditionStatus) {
52311
+ VideoRenditionStatus["Pending"] = "pending";
52312
+ VideoRenditionStatus["Started"] = "started";
52313
+ VideoRenditionStatus["Ended"] = "ended";
52314
+ VideoRenditionStatus["Uploading"] = "uploading";
52315
+ VideoRenditionStatus["Ready"] = "ready";
52316
+ VideoRenditionStatus["Error"] = "error";
52317
+ VideoRenditionStatus["Aborted"] = "aborted";
52318
+ })(VideoRenditionStatus || (VideoRenditionStatus = {}));
52319
+
49583
52320
  var DatabaseType;
49584
52321
  (function (DatabaseType) {
49585
52322
  DatabaseType["Legacy"] = "legacy";
@@ -49758,6 +52495,7 @@ var ProxyRuleDeploymentResourceType;
49758
52495
  (function (ProxyRuleDeploymentResourceType) {
49759
52496
  ProxyRuleDeploymentResourceType["Function"] = "function";
49760
52497
  ProxyRuleDeploymentResourceType["Site"] = "site";
52498
+ ProxyRuleDeploymentResourceType["DedicatedDatabase"] = "dedicatedDatabase";
49761
52499
  })(ProxyRuleDeploymentResourceType || (ProxyRuleDeploymentResourceType = {}));
49762
52500
 
49763
52501
  var ProxyRuleStatus;
@@ -49813,5 +52551,5 @@ var WafRuleAction;
49813
52551
  WafRuleAction["Redirect"] = "redirect";
49814
52552
  })(WafRuleAction || (WafRuleAction = {}));
49815
52553
 
49816
- export { Account, AccountKeyScopes, Activities, Adapter, AddonKey, Advisor, Affiliates, Apps, AppwriteException, AppwriteMigrationResource, Assistant, AttributeStatus, AuthenticationFactor, AuthenticatorType, Avatars, BackupServices, Backups, BillingPlanGroup, BlockMode, BlockResourceType, Browser, BrowserPermission, BrowserTheme, BuildRuntime, CacheDatabase, CacheTarget, Channel, Client, ColumnStatus, Compression, Condition, Console, ConsoleResourceType, ConversationType, CreditCard, DatabaseStatus, DatabaseType, Databases, DatabasesIndexType, DeploymentDownloadType, DeploymentStatus, DetectionFrameworkType, DetectionRuntimeType, DocumentsDB, DocumentsDBIndexType, DomainPurchaseStatus, DomainRegistrationType, DomainSuggestionType, DomainTransferStatusEnum, Domains, EmbeddingModel, Embeddings, ExecutionMethod, ExecutionResourceType, ExecutionStatus, ExecutionTrigger, FirebaseMigrationResource, Flag, Framework, FunctionTemplateUseCase, Functions, Graphql, Growth, ID, IdTokenProvider, ImageFormat, ImageGravity, IndexStatus, InvalidationType, Locale, Manager, MessagePriority, MessageStatus, Messaging, MessagingProviderType, Migrations, Mongo, Mysql, NHostMigrationResource, Notifications, OAuth2Auth0Prompt, OAuth2DiscordPrompt, OAuth2GithubPrompt, OAuth2GooglePrompt, OAuth2KakaoPrompt, OAuth2MicrosoftPrompt, OAuth2OidcPrompt, OAuth2OktaPrompt, OAuth2SalesforcePrompt, OAuth2ZohoPrompt, OAuthProvider, Oauth2, OnDuplicate, Operator, OrderBy, Organization, OrganizationKeyScopes, Organizations, PasswordHash, Permission, Platform, PlatformType, Postgresql, Presences, Project, ProjectAuthMethodId, ProjectEmailTemplateId, ProjectEmailTemplateLocale, ProjectKeyScopes, ProjectOAuth2Auth0Prompt, ProjectOAuth2DiscordPrompt, ProjectOAuth2GitHubPrompt, ProjectOAuth2GooglePrompt, ProjectOAuth2KakaoPrompt, ProjectOAuth2MicrosoftPrompt, ProjectOAuth2OidcPrompt, ProjectOAuth2OktaPrompt, ProjectOAuth2SalesforcePrompt, ProjectOAuth2ZohoPrompt, ProjectOAuthProviderId, ProjectPolicyId, ProjectProtocolId, ProjectSMTPSecure, ProjectServiceId, Projects, Proxy, ProxyResourceType, ProxyRuleDeploymentResourceType, ProxyRuleStatus, Push, Query, QuerySuggestionResource, Realtime, Region, RelationMutate, RelationshipType, ResolvedTopic, Role, Runtime, ScheduleResourceType, SiteTemplateUseCase, Sites, SmtpEncryption, Status, StatusCode, Storage, SupabaseMigrationResource, TablesDB, TablesDBIndexType, Teams, TemplateReferenceType, Timezone, Tokens, Topic, Usage, UsageEventDimension, UsageEventMetric, UsageGaugeDimension, UsageGaugeMetric, UsageInterval, UsageOrderBy, UsageOrderDirection, UsageRange, Users, VCSDetectionType, VCSReferenceType, Vcs, VectorsDB, VectorsDBIndexType, Waf, WafRuleAction, Webhooks };
52554
+ export { Account, AccountKeyScopes, Activities, Adapter, AddonKey, Admin, Advisor, Affiliates, Analytics, AnalyticsDimension, AnalyticsInterval, AnalyticsTracking, Apps, AppwriteException, AppwriteMigrationResource, Assistant, AttributeStatus, AuthenticationFactor, AuthenticatorType, Avatars, BackupServices, Backups, BillingPlanGroup, BlockMode, BlockResourceType, Browser, BrowserPermission, BrowserTheme, BuildRuntime, CacheDatabase, CacheTarget, Channel, Client, ColumnStatus, Compression, Condition, Console, ConsoleResourceType, ConversationType, CreditCard, DatabaseStatus, DatabaseType, Databases, DatabasesIndexType, DeploymentDownloadType, DeploymentStatus, DetectionFrameworkType, DetectionRuntimeType, DocumentsDB, DocumentsDBIndexType, DomainPurchaseStatus, DomainRegistrationType, DomainSuggestionType, DomainTransferStatusEnum, Domains, EmbeddingModel, Embeddings, ExecutionMethod, ExecutionResourceType, ExecutionStatus, ExecutionTrigger, FirebaseMigrationResource, Flag, Framework, FunctionTemplateUseCase, Functions, Graphql, Growth, ID, IdTokenProvider, ImageFormat, ImageGravity, IndexStatus, InvalidationType, Locale, Manager, MessagePriority, MessageStatus, Messaging, MessagingProviderType, Migrations, Mongo, Mysql, NHostMigrationResource, Notifications, OAuth2Auth0Prompt, OAuth2DiscordPrompt, OAuth2GithubPrompt, OAuth2GooglePrompt, OAuth2KakaoPrompt, OAuth2MicrosoftPrompt, OAuth2OidcPrompt, OAuth2OktaPrompt, OAuth2SalesforcePrompt, OAuth2ZohoPrompt, OAuthProvider, Oauth2, OnDuplicate, Operator, OrderBy, Organization, OrganizationKeyScopes, Organizations, PasswordHash, Permission, Platform, PlatformResourceType, PlatformType, Postgresql, Presences, Project, ProjectAuthMethodId, ProjectEmailTemplateId, ProjectEmailTemplateLocale, ProjectKeyScopes, ProjectOAuth2Auth0Prompt, ProjectOAuth2DiscordPrompt, ProjectOAuth2GitHubPrompt, ProjectOAuth2GooglePrompt, ProjectOAuth2KakaoPrompt, ProjectOAuth2MicrosoftPrompt, ProjectOAuth2OidcPrompt, ProjectOAuth2OktaPrompt, ProjectOAuth2SalesforcePrompt, ProjectOAuth2ZohoPrompt, ProjectOAuthProviderId, ProjectPolicyId, ProjectProtocolId, ProjectResourceType, ProjectSMTPSecure, ProjectServiceId, Projects, Proxy, ProxyResourceType, ProxyRuleDeploymentResourceType, ProxyRuleStatus, Push, Query, QuerySuggestionResource, Realtime, Region, RelationMutate, RelationshipType, ResolvedTopic, Role, Runtime, ScheduleResourceType, SiteTemplateUseCase, Sites, SmtpEncryption, Status, StatusCode, Storage, SupabaseMigrationResource, TablesDB, TablesDBIndexType, Teams, TemplateReferenceType, Timezone, Tokens, Topic, Usage, UsageEventDimension, UsageEventMetric, UsageGaugeDimension, UsageGaugeMetric, UsageInterval, UsageOrderBy, UsageOrderDirection, UsageRange, Users, VCSDetectionType, VCSReferenceType, Vcs, VectorsDB, VectorsDBIndexType, VideoOutput, VideoRenditionStatus, Videos, Waf, WafRuleAction, Webhooks };
49817
52555
  //# sourceMappingURL=sdk.js.map