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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/cjs/sdk.js CHANGED
@@ -669,7 +669,7 @@ class Client {
669
669
  'x-sdk-name': 'Console',
670
670
  'x-sdk-platform': 'console',
671
671
  'x-sdk-language': 'web',
672
- 'x-sdk-version': '18.3.0',
672
+ 'x-sdk-version': '18.4.0-rc.2',
673
673
  'X-Appwrite-Response-Format': '2.3.0',
674
674
  };
675
675
  this.realtime = {
@@ -1522,29 +1522,6 @@ class Client {
1522
1522
  }
1523
1523
  Client.CHUNK_SIZE = 1024 * 1024 * 5;
1524
1524
 
1525
- class Service {
1526
- constructor(client) {
1527
- this.client = client;
1528
- }
1529
- static flatten(data, prefix = '') {
1530
- let output = {};
1531
- for (const [key, value] of Object.entries(data)) {
1532
- const finalKey = prefix ? prefix + '[' + key + ']' : key;
1533
- if (Array.isArray(value)) {
1534
- output = Object.assign(Object.assign({}, output), Service.flatten(value, finalKey));
1535
- }
1536
- else {
1537
- output[finalKey] = value;
1538
- }
1539
- }
1540
- return output;
1541
- }
1542
- }
1543
- /**
1544
- * The size for chunked uploads in bytes.
1545
- */
1546
- Service.CHUNK_SIZE = 5 * 1024 * 1024; // 5MB
1547
-
1548
1525
  class Account {
1549
1526
  constructor(client) {
1550
1527
  this.client = client;
@@ -2863,6 +2840,196 @@ class Account {
2863
2840
  };
2864
2841
  return this.client.call('patch', uri, apiHeaders, apiPayload);
2865
2842
  }
2843
+ listPasskeys(paramsOrFirst, ...rest) {
2844
+ let params;
2845
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
2846
+ (paramsOrFirst &&
2847
+ typeof paramsOrFirst === 'object' &&
2848
+ !Array.isArray(paramsOrFirst))) {
2849
+ params = (paramsOrFirst || {});
2850
+ }
2851
+ else {
2852
+ params = {
2853
+ queries: paramsOrFirst,
2854
+ total: rest[0],
2855
+ };
2856
+ }
2857
+ const queries = params.queries;
2858
+ const total = params.total;
2859
+ const apiPath = '/account/passkeys';
2860
+ const apiPayload = {};
2861
+ if (typeof queries !== 'undefined') {
2862
+ apiPayload['queries'] = queries;
2863
+ }
2864
+ if (typeof total !== 'undefined') {
2865
+ apiPayload['total'] = total;
2866
+ }
2867
+ const uri = new URL(this.client.config.endpoint + apiPath);
2868
+ const apiHeaders = {
2869
+ 'X-Appwrite-Project': this.client.config.project,
2870
+ accept: 'application/json',
2871
+ };
2872
+ return this.client.call('get', uri, apiHeaders, apiPayload);
2873
+ }
2874
+ createPasskey(paramsOrFirst, ...rest) {
2875
+ let params;
2876
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
2877
+ (paramsOrFirst &&
2878
+ typeof paramsOrFirst === 'object' &&
2879
+ !Array.isArray(paramsOrFirst))) {
2880
+ params = (paramsOrFirst || {});
2881
+ }
2882
+ else {
2883
+ params = {
2884
+ passkeyId: paramsOrFirst,
2885
+ name: rest[0],
2886
+ };
2887
+ }
2888
+ const passkeyId = params.passkeyId;
2889
+ const name = params.name;
2890
+ const apiPath = '/account/passkeys';
2891
+ const apiPayload = {};
2892
+ if (typeof passkeyId !== 'undefined') {
2893
+ apiPayload['passkeyId'] = passkeyId;
2894
+ }
2895
+ if (typeof name !== 'undefined') {
2896
+ apiPayload['name'] = name;
2897
+ }
2898
+ const uri = new URL(this.client.config.endpoint + apiPath);
2899
+ const apiHeaders = {
2900
+ 'X-Appwrite-Project': this.client.config.project,
2901
+ 'content-type': 'application/json',
2902
+ accept: 'application/json',
2903
+ };
2904
+ return this.client.call('post', uri, apiHeaders, apiPayload);
2905
+ }
2906
+ getPasskey(paramsOrFirst) {
2907
+ let params;
2908
+ if (paramsOrFirst &&
2909
+ typeof paramsOrFirst === 'object' &&
2910
+ !Array.isArray(paramsOrFirst)) {
2911
+ params = (paramsOrFirst || {});
2912
+ }
2913
+ else {
2914
+ params = {
2915
+ passkeyId: paramsOrFirst,
2916
+ };
2917
+ }
2918
+ const passkeyId = params.passkeyId;
2919
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
2920
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
2921
+ }
2922
+ const apiPath = '/account/passkeys/{passkeyId}'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
2923
+ const apiPayload = {};
2924
+ const uri = new URL(this.client.config.endpoint + apiPath);
2925
+ const apiHeaders = {
2926
+ 'X-Appwrite-Project': this.client.config.project,
2927
+ accept: 'application/json',
2928
+ };
2929
+ return this.client.call('get', uri, apiHeaders, apiPayload);
2930
+ }
2931
+ updatePasskey(paramsOrFirst, ...rest) {
2932
+ let params;
2933
+ if (paramsOrFirst &&
2934
+ typeof paramsOrFirst === 'object' &&
2935
+ !Array.isArray(paramsOrFirst)) {
2936
+ params = (paramsOrFirst || {});
2937
+ }
2938
+ else {
2939
+ params = {
2940
+ passkeyId: paramsOrFirst,
2941
+ name: rest[0],
2942
+ };
2943
+ }
2944
+ const passkeyId = params.passkeyId;
2945
+ const name = params.name;
2946
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
2947
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
2948
+ }
2949
+ if (typeof name === 'undefined') {
2950
+ throw new AppwriteException('Missing required parameter: "name"');
2951
+ }
2952
+ const apiPath = '/account/passkeys/{passkeyId}'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
2953
+ const apiPayload = {};
2954
+ if (typeof name !== 'undefined') {
2955
+ apiPayload['name'] = name;
2956
+ }
2957
+ const uri = new URL(this.client.config.endpoint + apiPath);
2958
+ const apiHeaders = {
2959
+ 'X-Appwrite-Project': this.client.config.project,
2960
+ 'content-type': 'application/json',
2961
+ accept: 'application/json',
2962
+ };
2963
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
2964
+ }
2965
+ deletePasskey(paramsOrFirst) {
2966
+ let params;
2967
+ if (paramsOrFirst &&
2968
+ typeof paramsOrFirst === 'object' &&
2969
+ !Array.isArray(paramsOrFirst)) {
2970
+ params = (paramsOrFirst || {});
2971
+ }
2972
+ else {
2973
+ params = {
2974
+ passkeyId: paramsOrFirst,
2975
+ };
2976
+ }
2977
+ const passkeyId = params.passkeyId;
2978
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
2979
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
2980
+ }
2981
+ const apiPath = '/account/passkeys/{passkeyId}'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
2982
+ const apiPayload = {};
2983
+ const uri = new URL(this.client.config.endpoint + apiPath);
2984
+ const apiHeaders = {
2985
+ 'X-Appwrite-Project': this.client.config.project,
2986
+ 'content-type': 'application/json',
2987
+ accept: 'application/json',
2988
+ };
2989
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
2990
+ }
2991
+ updatePasskeyVerification(paramsOrFirst, ...rest) {
2992
+ let params;
2993
+ if (paramsOrFirst &&
2994
+ typeof paramsOrFirst === 'object' &&
2995
+ !Array.isArray(paramsOrFirst)) {
2996
+ params = (paramsOrFirst || {});
2997
+ }
2998
+ else {
2999
+ params = {
3000
+ passkeyId: paramsOrFirst,
3001
+ challengeId: rest[0],
3002
+ credential: rest[1],
3003
+ };
3004
+ }
3005
+ const passkeyId = params.passkeyId;
3006
+ const challengeId = params.challengeId;
3007
+ const credential = params.credential;
3008
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
3009
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
3010
+ }
3011
+ if (typeof challengeId === 'undefined') {
3012
+ throw new AppwriteException('Missing required parameter: "challengeId"');
3013
+ }
3014
+ if (typeof credential === 'undefined') {
3015
+ throw new AppwriteException('Missing required parameter: "credential"');
3016
+ }
3017
+ const apiPath = '/account/passkeys/{passkeyId}/verification'.replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
3018
+ const apiPayload = {};
3019
+ if (typeof challengeId !== 'undefined') {
3020
+ apiPayload['challengeId'] = challengeId;
3021
+ }
3022
+ if (typeof credential !== 'undefined') {
3023
+ apiPayload['credential'] = credential;
3024
+ }
3025
+ const uri = new URL(this.client.config.endpoint + apiPath);
3026
+ const apiHeaders = {
3027
+ 'X-Appwrite-Project': this.client.config.project,
3028
+ 'content-type': 'application/json',
3029
+ accept: 'application/json',
3030
+ };
3031
+ return this.client.call('put', uri, apiHeaders, apiPayload);
3032
+ }
2866
3033
  updatePassword(paramsOrFirst, ...rest) {
2867
3034
  let params;
2868
3035
  if (paramsOrFirst &&
@@ -3606,7 +3773,7 @@ class Account {
3606
3773
  }
3607
3774
  const uri = new URL(this.client.config.endpoint + apiPath);
3608
3775
  apiPayload['project'] = this.client.config.project;
3609
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
3776
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
3610
3777
  uri.searchParams.append(key, value);
3611
3778
  }
3612
3779
  if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {
@@ -4015,7 +4182,7 @@ class Account {
4015
4182
  }
4016
4183
  const uri = new URL(this.client.config.endpoint + apiPath);
4017
4184
  apiPayload['project'] = this.client.config.project;
4018
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
4185
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
4019
4186
  uri.searchParams.append(key, value);
4020
4187
  }
4021
4188
  if (typeof window !== 'undefined' && (window === null || window === void 0 ? void 0 : window.location)) {
@@ -4026,6 +4193,60 @@ class Account {
4026
4193
  return uri.toString();
4027
4194
  }
4028
4195
  }
4196
+ /**
4197
+ * 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.
4198
+ *
4199
+ * @throws {AppwriteException}
4200
+ * @returns {Promise<Models.PasskeyChallenge>}
4201
+ */
4202
+ createPasskeyToken() {
4203
+ const apiPath = '/account/tokens/passkey';
4204
+ const apiPayload = {};
4205
+ const uri = new URL(this.client.config.endpoint + apiPath);
4206
+ const apiHeaders = {
4207
+ 'X-Appwrite-Project': this.client.config.project,
4208
+ 'content-type': 'application/json',
4209
+ accept: 'application/json',
4210
+ };
4211
+ return this.client.call('post', uri, apiHeaders, apiPayload);
4212
+ }
4213
+ updatePasskeyToken(paramsOrFirst, ...rest) {
4214
+ let params;
4215
+ if (paramsOrFirst &&
4216
+ typeof paramsOrFirst === 'object' &&
4217
+ !Array.isArray(paramsOrFirst)) {
4218
+ params = (paramsOrFirst || {});
4219
+ }
4220
+ else {
4221
+ params = {
4222
+ challengeId: paramsOrFirst,
4223
+ credential: rest[0],
4224
+ };
4225
+ }
4226
+ const challengeId = params.challengeId;
4227
+ const credential = params.credential;
4228
+ if (typeof challengeId === 'undefined') {
4229
+ throw new AppwriteException('Missing required parameter: "challengeId"');
4230
+ }
4231
+ if (typeof credential === 'undefined') {
4232
+ throw new AppwriteException('Missing required parameter: "credential"');
4233
+ }
4234
+ const apiPath = '/account/tokens/passkey';
4235
+ const apiPayload = {};
4236
+ if (typeof challengeId !== 'undefined') {
4237
+ apiPayload['challengeId'] = challengeId;
4238
+ }
4239
+ if (typeof credential !== 'undefined') {
4240
+ apiPayload['credential'] = credential;
4241
+ }
4242
+ const uri = new URL(this.client.config.endpoint + apiPath);
4243
+ const apiHeaders = {
4244
+ 'X-Appwrite-Project': this.client.config.project,
4245
+ 'content-type': 'application/json',
4246
+ accept: 'application/json',
4247
+ };
4248
+ return this.client.call('put', uri, apiHeaders, apiPayload);
4249
+ }
4029
4250
  createPhoneToken(paramsOrFirst, ...rest) {
4030
4251
  let params;
4031
4252
  if (paramsOrFirst &&
@@ -4372,6 +4593,135 @@ class Activities {
4372
4593
  }
4373
4594
  }
4374
4595
 
4596
+ class Admin {
4597
+ constructor(client) {
4598
+ this.client = client;
4599
+ }
4600
+ /**
4601
+ * Delete everything cached from the platform database in the region serving the request.
4602
+ *
4603
+ * @throws {AppwriteException}
4604
+ * @returns {Promise<{}>}
4605
+ */
4606
+ deletePlatformCache() {
4607
+ const apiPath = '/admin/cache/platform';
4608
+ const apiPayload = {};
4609
+ const uri = new URL(this.client.config.endpoint + apiPath);
4610
+ const apiHeaders = {
4611
+ 'X-Appwrite-Project': this.client.config.project,
4612
+ 'content-type': 'application/json',
4613
+ accept: 'application/json',
4614
+ };
4615
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
4616
+ }
4617
+ deletePlatformResourceCache(paramsOrFirst, ...rest) {
4618
+ let params;
4619
+ if (paramsOrFirst &&
4620
+ typeof paramsOrFirst === 'object' &&
4621
+ !Array.isArray(paramsOrFirst) &&
4622
+ ('resourceType' in paramsOrFirst || 'resourceId' in paramsOrFirst)) {
4623
+ params = (paramsOrFirst || {});
4624
+ }
4625
+ else {
4626
+ params = {
4627
+ resourceType: paramsOrFirst,
4628
+ resourceId: rest[0],
4629
+ };
4630
+ }
4631
+ const resourceType = params.resourceType;
4632
+ const resourceId = params.resourceId;
4633
+ if (typeof resourceType === 'undefined') {
4634
+ throw new AppwriteException('Missing required parameter: "resourceType"');
4635
+ }
4636
+ const apiPath = '/admin/cache/platform/resources';
4637
+ const apiPayload = {};
4638
+ if (typeof resourceType !== 'undefined') {
4639
+ apiPayload['resourceType'] = resourceType;
4640
+ }
4641
+ if (typeof resourceId !== 'undefined') {
4642
+ apiPayload['resourceId'] = resourceId;
4643
+ }
4644
+ const uri = new URL(this.client.config.endpoint + apiPath);
4645
+ const apiHeaders = {
4646
+ 'X-Appwrite-Project': this.client.config.project,
4647
+ 'content-type': 'application/json',
4648
+ accept: 'application/json',
4649
+ };
4650
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
4651
+ }
4652
+ deleteProjectCache(paramsOrFirst) {
4653
+ let params;
4654
+ if (paramsOrFirst &&
4655
+ typeof paramsOrFirst === 'object' &&
4656
+ !Array.isArray(paramsOrFirst)) {
4657
+ params = (paramsOrFirst || {});
4658
+ }
4659
+ else {
4660
+ params = {
4661
+ projectId: paramsOrFirst,
4662
+ };
4663
+ }
4664
+ const projectId = params.projectId;
4665
+ if (typeof projectId === 'undefined') {
4666
+ throw new AppwriteException('Missing required parameter: "projectId"');
4667
+ }
4668
+ const apiPath = '/admin/cache/project';
4669
+ const apiPayload = {};
4670
+ if (typeof projectId !== 'undefined') {
4671
+ apiPayload['projectId'] = projectId;
4672
+ }
4673
+ const uri = new URL(this.client.config.endpoint + apiPath);
4674
+ const apiHeaders = {
4675
+ 'X-Appwrite-Project': this.client.config.project,
4676
+ 'content-type': 'application/json',
4677
+ accept: 'application/json',
4678
+ };
4679
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
4680
+ }
4681
+ deleteProjectResourceCache(paramsOrFirst, ...rest) {
4682
+ let params;
4683
+ if (paramsOrFirst &&
4684
+ typeof paramsOrFirst === 'object' &&
4685
+ !Array.isArray(paramsOrFirst)) {
4686
+ params = (paramsOrFirst || {});
4687
+ }
4688
+ else {
4689
+ params = {
4690
+ projectId: paramsOrFirst,
4691
+ resourceType: rest[0],
4692
+ resourceId: rest[1],
4693
+ };
4694
+ }
4695
+ const projectId = params.projectId;
4696
+ const resourceType = params.resourceType;
4697
+ const resourceId = params.resourceId;
4698
+ if (typeof projectId === 'undefined') {
4699
+ throw new AppwriteException('Missing required parameter: "projectId"');
4700
+ }
4701
+ if (typeof resourceType === 'undefined') {
4702
+ throw new AppwriteException('Missing required parameter: "resourceType"');
4703
+ }
4704
+ const apiPath = '/admin/cache/project/resources';
4705
+ const apiPayload = {};
4706
+ if (typeof projectId !== 'undefined') {
4707
+ apiPayload['projectId'] = projectId;
4708
+ }
4709
+ if (typeof resourceType !== 'undefined') {
4710
+ apiPayload['resourceType'] = resourceType;
4711
+ }
4712
+ if (typeof resourceId !== 'undefined') {
4713
+ apiPayload['resourceId'] = resourceId;
4714
+ }
4715
+ const uri = new URL(this.client.config.endpoint + apiPath);
4716
+ const apiHeaders = {
4717
+ 'X-Appwrite-Project': this.client.config.project,
4718
+ 'content-type': 'application/json',
4719
+ accept: 'application/json',
4720
+ };
4721
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
4722
+ }
4723
+ }
4724
+
4375
4725
  class Affiliates {
4376
4726
  constructor(client) {
4377
4727
  this.client = client;
@@ -4583,6 +4933,369 @@ class Affiliates {
4583
4933
  }
4584
4934
  }
4585
4935
 
4936
+ class Analytics {
4937
+ constructor(client) {
4938
+ this.client = client;
4939
+ }
4940
+ listProperties(paramsOrFirst, ...rest) {
4941
+ let params;
4942
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
4943
+ (paramsOrFirst &&
4944
+ typeof paramsOrFirst === 'object' &&
4945
+ !Array.isArray(paramsOrFirst))) {
4946
+ params = (paramsOrFirst || {});
4947
+ }
4948
+ else {
4949
+ params = {
4950
+ queries: paramsOrFirst,
4951
+ search: rest[0],
4952
+ total: rest[1],
4953
+ };
4954
+ }
4955
+ const queries = params.queries;
4956
+ const search = params.search;
4957
+ const total = params.total;
4958
+ const apiPath = '/analytics/properties';
4959
+ const apiPayload = {};
4960
+ if (typeof queries !== 'undefined') {
4961
+ apiPayload['queries'] = queries;
4962
+ }
4963
+ if (typeof search !== 'undefined') {
4964
+ apiPayload['search'] = search;
4965
+ }
4966
+ if (typeof total !== 'undefined') {
4967
+ apiPayload['total'] = total;
4968
+ }
4969
+ const uri = new URL(this.client.config.endpoint + apiPath);
4970
+ const apiHeaders = {
4971
+ 'X-Appwrite-Project': this.client.config.project,
4972
+ accept: 'application/json',
4973
+ };
4974
+ return this.client.call('get', uri, apiHeaders, apiPayload);
4975
+ }
4976
+ createProperty(paramsOrFirst, ...rest) {
4977
+ let params;
4978
+ if (paramsOrFirst &&
4979
+ typeof paramsOrFirst === 'object' &&
4980
+ !Array.isArray(paramsOrFirst)) {
4981
+ params = (paramsOrFirst || {});
4982
+ }
4983
+ else {
4984
+ params = {
4985
+ propertyId: paramsOrFirst,
4986
+ name: rest[0],
4987
+ domain: rest[1],
4988
+ timezone: rest[2],
4989
+ enabled: rest[3],
4990
+ xpublic: rest[4],
4991
+ allowedOrigins: rest[5],
4992
+ };
4993
+ }
4994
+ const propertyId = params.propertyId;
4995
+ const name = params.name;
4996
+ const domain = params.domain;
4997
+ const timezone = params.timezone;
4998
+ const enabled = params.enabled;
4999
+ const xpublic = params.xpublic;
5000
+ const allowedOrigins = params.allowedOrigins;
5001
+ if (typeof propertyId === 'undefined') {
5002
+ throw new AppwriteException('Missing required parameter: "propertyId"');
5003
+ }
5004
+ if (typeof name === 'undefined') {
5005
+ throw new AppwriteException('Missing required parameter: "name"');
5006
+ }
5007
+ const apiPath = '/analytics/properties';
5008
+ const apiPayload = {};
5009
+ if (typeof propertyId !== 'undefined') {
5010
+ apiPayload['propertyId'] = propertyId;
5011
+ }
5012
+ if (typeof name !== 'undefined') {
5013
+ apiPayload['name'] = name;
5014
+ }
5015
+ if (typeof domain !== 'undefined') {
5016
+ apiPayload['domain'] = domain;
5017
+ }
5018
+ if (typeof timezone !== 'undefined') {
5019
+ apiPayload['timezone'] = timezone;
5020
+ }
5021
+ if (typeof enabled !== 'undefined') {
5022
+ apiPayload['enabled'] = enabled;
5023
+ }
5024
+ if (typeof xpublic !== 'undefined') {
5025
+ apiPayload['public'] = xpublic;
5026
+ }
5027
+ if (typeof allowedOrigins !== 'undefined') {
5028
+ apiPayload['allowedOrigins'] = allowedOrigins;
5029
+ }
5030
+ const uri = new URL(this.client.config.endpoint + apiPath);
5031
+ const apiHeaders = {
5032
+ 'X-Appwrite-Project': this.client.config.project,
5033
+ 'content-type': 'application/json',
5034
+ accept: 'application/json',
5035
+ };
5036
+ return this.client.call('post', uri, apiHeaders, apiPayload);
5037
+ }
5038
+ getProperty(paramsOrFirst) {
5039
+ let params;
5040
+ if (paramsOrFirst &&
5041
+ typeof paramsOrFirst === 'object' &&
5042
+ !Array.isArray(paramsOrFirst)) {
5043
+ params = (paramsOrFirst || {});
5044
+ }
5045
+ else {
5046
+ params = {
5047
+ propertyId: paramsOrFirst,
5048
+ };
5049
+ }
5050
+ const propertyId = params.propertyId;
5051
+ if (typeof propertyId === 'undefined' || propertyId === '') {
5052
+ throw new AppwriteException('Missing required parameter: "propertyId"');
5053
+ }
5054
+ const apiPath = '/analytics/properties/{propertyId}'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
5055
+ const apiPayload = {};
5056
+ const uri = new URL(this.client.config.endpoint + apiPath);
5057
+ const apiHeaders = {
5058
+ 'X-Appwrite-Project': this.client.config.project,
5059
+ accept: 'application/json',
5060
+ };
5061
+ return this.client.call('get', uri, apiHeaders, apiPayload);
5062
+ }
5063
+ updateProperty(paramsOrFirst, ...rest) {
5064
+ let params;
5065
+ if (paramsOrFirst &&
5066
+ typeof paramsOrFirst === 'object' &&
5067
+ !Array.isArray(paramsOrFirst)) {
5068
+ params = (paramsOrFirst || {});
5069
+ }
5070
+ else {
5071
+ params = {
5072
+ propertyId: paramsOrFirst,
5073
+ name: rest[0],
5074
+ domain: rest[1],
5075
+ timezone: rest[2],
5076
+ enabled: rest[3],
5077
+ xpublic: rest[4],
5078
+ allowedOrigins: rest[5],
5079
+ };
5080
+ }
5081
+ const propertyId = params.propertyId;
5082
+ const name = params.name;
5083
+ const domain = params.domain;
5084
+ const timezone = params.timezone;
5085
+ const enabled = params.enabled;
5086
+ const xpublic = params.xpublic;
5087
+ const allowedOrigins = params.allowedOrigins;
5088
+ if (typeof propertyId === 'undefined' || propertyId === '') {
5089
+ throw new AppwriteException('Missing required parameter: "propertyId"');
5090
+ }
5091
+ const apiPath = '/analytics/properties/{propertyId}'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
5092
+ const apiPayload = {};
5093
+ if (typeof name !== 'undefined') {
5094
+ apiPayload['name'] = name;
5095
+ }
5096
+ if (typeof domain !== 'undefined') {
5097
+ apiPayload['domain'] = domain;
5098
+ }
5099
+ if (typeof timezone !== 'undefined') {
5100
+ apiPayload['timezone'] = timezone;
5101
+ }
5102
+ if (typeof enabled !== 'undefined') {
5103
+ apiPayload['enabled'] = enabled;
5104
+ }
5105
+ if (typeof xpublic !== 'undefined') {
5106
+ apiPayload['public'] = xpublic;
5107
+ }
5108
+ if (typeof allowedOrigins !== 'undefined') {
5109
+ apiPayload['allowedOrigins'] = allowedOrigins;
5110
+ }
5111
+ const uri = new URL(this.client.config.endpoint + apiPath);
5112
+ const apiHeaders = {
5113
+ 'X-Appwrite-Project': this.client.config.project,
5114
+ 'content-type': 'application/json',
5115
+ accept: 'application/json',
5116
+ };
5117
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
5118
+ }
5119
+ deleteProperty(paramsOrFirst) {
5120
+ let params;
5121
+ if (paramsOrFirst &&
5122
+ typeof paramsOrFirst === 'object' &&
5123
+ !Array.isArray(paramsOrFirst)) {
5124
+ params = (paramsOrFirst || {});
5125
+ }
5126
+ else {
5127
+ params = {
5128
+ propertyId: paramsOrFirst,
5129
+ };
5130
+ }
5131
+ const propertyId = params.propertyId;
5132
+ if (typeof propertyId === 'undefined' || propertyId === '') {
5133
+ throw new AppwriteException('Missing required parameter: "propertyId"');
5134
+ }
5135
+ const apiPath = '/analytics/properties/{propertyId}'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
5136
+ const apiPayload = {};
5137
+ const uri = new URL(this.client.config.endpoint + apiPath);
5138
+ const apiHeaders = {
5139
+ 'X-Appwrite-Project': this.client.config.project,
5140
+ 'content-type': 'application/json',
5141
+ accept: 'application/json',
5142
+ };
5143
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
5144
+ }
5145
+ createEvent(paramsOrFirst, ...rest) {
5146
+ let params;
5147
+ if (paramsOrFirst &&
5148
+ typeof paramsOrFirst === 'object' &&
5149
+ !Array.isArray(paramsOrFirst)) {
5150
+ params = (paramsOrFirst || {});
5151
+ }
5152
+ else {
5153
+ params = {
5154
+ propertyId: paramsOrFirst,
5155
+ name: rest[0],
5156
+ url: rest[1],
5157
+ domain: rest[2],
5158
+ referrer: rest[3],
5159
+ screenWidth: rest[4],
5160
+ sessionHash: rest[5],
5161
+ scrollDepth: rest[6],
5162
+ engagementTime: rest[7],
5163
+ props: rest[8],
5164
+ userId: rest[9],
5165
+ ip: rest[10],
5166
+ userAgent: rest[11],
5167
+ };
5168
+ }
5169
+ const propertyId = params.propertyId;
5170
+ const name = params.name;
5171
+ const url = params.url;
5172
+ const domain = params.domain;
5173
+ const referrer = params.referrer;
5174
+ const screenWidth = params.screenWidth;
5175
+ const sessionHash = params.sessionHash;
5176
+ const scrollDepth = params.scrollDepth;
5177
+ const engagementTime = params.engagementTime;
5178
+ const props = params.props;
5179
+ const userId = params.userId;
5180
+ const ip = params.ip;
5181
+ const userAgent = params.userAgent;
5182
+ if (typeof propertyId === 'undefined' || propertyId === '') {
5183
+ throw new AppwriteException('Missing required parameter: "propertyId"');
5184
+ }
5185
+ if (typeof name === 'undefined') {
5186
+ throw new AppwriteException('Missing required parameter: "name"');
5187
+ }
5188
+ if (typeof url === 'undefined') {
5189
+ throw new AppwriteException('Missing required parameter: "url"');
5190
+ }
5191
+ const apiPath = '/analytics/properties/{propertyId}/events'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
5192
+ const apiPayload = {};
5193
+ if (typeof name !== 'undefined') {
5194
+ apiPayload['name'] = name;
5195
+ }
5196
+ if (typeof url !== 'undefined') {
5197
+ apiPayload['url'] = url;
5198
+ }
5199
+ if (typeof domain !== 'undefined') {
5200
+ apiPayload['domain'] = domain;
5201
+ }
5202
+ if (typeof referrer !== 'undefined') {
5203
+ apiPayload['referrer'] = referrer;
5204
+ }
5205
+ if (typeof screenWidth !== 'undefined') {
5206
+ apiPayload['screenWidth'] = screenWidth;
5207
+ }
5208
+ if (typeof sessionHash !== 'undefined') {
5209
+ apiPayload['sessionHash'] = sessionHash;
5210
+ }
5211
+ if (typeof scrollDepth !== 'undefined') {
5212
+ apiPayload['scrollDepth'] = scrollDepth;
5213
+ }
5214
+ if (typeof engagementTime !== 'undefined') {
5215
+ apiPayload['engagementTime'] = engagementTime;
5216
+ }
5217
+ if (typeof props !== 'undefined') {
5218
+ apiPayload['props'] = props;
5219
+ }
5220
+ if (typeof userId !== 'undefined') {
5221
+ apiPayload['userId'] = userId;
5222
+ }
5223
+ if (typeof ip !== 'undefined') {
5224
+ apiPayload['ip'] = ip;
5225
+ }
5226
+ if (typeof userAgent !== 'undefined') {
5227
+ apiPayload['userAgent'] = userAgent;
5228
+ }
5229
+ const uri = new URL(this.client.config.endpoint + apiPath);
5230
+ const apiHeaders = {
5231
+ 'X-Appwrite-Project': this.client.config.project,
5232
+ 'content-type': 'application/json',
5233
+ accept: 'application/json',
5234
+ };
5235
+ return this.client.call('post', uri, apiHeaders, apiPayload);
5236
+ }
5237
+ listMetrics(paramsOrFirst, ...rest) {
5238
+ let params;
5239
+ if (paramsOrFirst &&
5240
+ typeof paramsOrFirst === 'object' &&
5241
+ !Array.isArray(paramsOrFirst)) {
5242
+ params = (paramsOrFirst || {});
5243
+ }
5244
+ else {
5245
+ params = {
5246
+ propertyId: paramsOrFirst,
5247
+ queries: rest[0],
5248
+ interval: rest[1],
5249
+ dimensions: rest[2],
5250
+ dateRange: rest[3],
5251
+ startAt: rest[4],
5252
+ endAt: rest[5],
5253
+ limit: rest[6],
5254
+ };
5255
+ }
5256
+ const propertyId = params.propertyId;
5257
+ const queries = params.queries;
5258
+ const interval = params.interval;
5259
+ const dimensions = params.dimensions;
5260
+ const dateRange = params.dateRange;
5261
+ const startAt = params.startAt;
5262
+ const endAt = params.endAt;
5263
+ const limit = params.limit;
5264
+ if (typeof propertyId === 'undefined' || propertyId === '') {
5265
+ throw new AppwriteException('Missing required parameter: "propertyId"');
5266
+ }
5267
+ const apiPath = '/analytics/properties/{propertyId}/metrics'.replace('{propertyId}', encodeURIComponent(String(propertyId)));
5268
+ const apiPayload = {};
5269
+ if (typeof queries !== 'undefined') {
5270
+ apiPayload['queries'] = queries;
5271
+ }
5272
+ if (typeof interval !== 'undefined') {
5273
+ apiPayload['interval'] = interval;
5274
+ }
5275
+ if (typeof dimensions !== 'undefined') {
5276
+ apiPayload['dimensions'] = dimensions;
5277
+ }
5278
+ if (typeof dateRange !== 'undefined') {
5279
+ apiPayload['dateRange'] = dateRange;
5280
+ }
5281
+ if (typeof startAt !== 'undefined') {
5282
+ apiPayload['startAt'] = startAt;
5283
+ }
5284
+ if (typeof endAt !== 'undefined') {
5285
+ apiPayload['endAt'] = endAt;
5286
+ }
5287
+ if (typeof limit !== 'undefined') {
5288
+ apiPayload['limit'] = limit;
5289
+ }
5290
+ const uri = new URL(this.client.config.endpoint + apiPath);
5291
+ const apiHeaders = {
5292
+ 'X-Appwrite-Project': this.client.config.project,
5293
+ accept: 'application/json',
5294
+ };
5295
+ return this.client.call('get', uri, apiHeaders, apiPayload);
5296
+ }
5297
+ }
5298
+
4586
5299
  class Apps {
4587
5300
  constructor(client) {
4588
5301
  this.client = client;
@@ -5475,7 +6188,7 @@ class Avatars {
5475
6188
  const uri = new URL(this.client.config.endpoint + apiPath);
5476
6189
  apiPayload['project'] = this.client.config.project;
5477
6190
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5478
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6191
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5479
6192
  uri.searchParams.append(key, value);
5480
6193
  }
5481
6194
  return uri.toString();
@@ -5520,7 +6233,7 @@ class Avatars {
5520
6233
  const uri = new URL(this.client.config.endpoint + apiPath);
5521
6234
  apiPayload['project'] = this.client.config.project;
5522
6235
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5523
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6236
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5524
6237
  uri.searchParams.append(key, value);
5525
6238
  }
5526
6239
  return uri.toString();
@@ -5549,7 +6262,7 @@ class Avatars {
5549
6262
  const uri = new URL(this.client.config.endpoint + apiPath);
5550
6263
  apiPayload['project'] = this.client.config.project;
5551
6264
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5552
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6265
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5553
6266
  uri.searchParams.append(key, value);
5554
6267
  }
5555
6268
  return uri.toString();
@@ -5594,7 +6307,7 @@ class Avatars {
5594
6307
  const uri = new URL(this.client.config.endpoint + apiPath);
5595
6308
  apiPayload['project'] = this.client.config.project;
5596
6309
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5597
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6310
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5598
6311
  uri.searchParams.append(key, value);
5599
6312
  }
5600
6313
  return uri.toString();
@@ -5633,7 +6346,7 @@ class Avatars {
5633
6346
  const uri = new URL(this.client.config.endpoint + apiPath);
5634
6347
  apiPayload['project'] = this.client.config.project;
5635
6348
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5636
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6349
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5637
6350
  uri.searchParams.append(key, value);
5638
6351
  }
5639
6352
  return uri.toString();
@@ -5675,7 +6388,7 @@ class Avatars {
5675
6388
  const uri = new URL(this.client.config.endpoint + apiPath);
5676
6389
  apiPayload['project'] = this.client.config.project;
5677
6390
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5678
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6391
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5679
6392
  uri.searchParams.append(key, value);
5680
6393
  }
5681
6394
  return uri.toString();
@@ -5737,7 +6450,7 @@ class Avatars {
5737
6450
  const uri = new URL(this.client.config.endpoint + apiPath);
5738
6451
  apiPayload['project'] = this.client.config.project;
5739
6452
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5740
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6453
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5741
6454
  uri.searchParams.append(key, value);
5742
6455
  }
5743
6456
  return uri.toString();
@@ -5831,7 +6544,7 @@ class Avatars {
5831
6544
  const uri = new URL(this.client.config.endpoint + apiPath);
5832
6545
  apiPayload['project'] = this.client.config.project;
5833
6546
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5834
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6547
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5835
6548
  uri.searchParams.append(key, value);
5836
6549
  }
5837
6550
  return uri.toString();
@@ -5955,7 +6668,7 @@ class Avatars {
5955
6668
  const uri = new URL(this.client.config.endpoint + apiPath);
5956
6669
  apiPayload['project'] = this.client.config.project;
5957
6670
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
5958
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
6671
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
5959
6672
  uri.searchParams.append(key, value);
5960
6673
  }
5961
6674
  return uri.toString();
@@ -15541,7 +16254,7 @@ class Functions {
15541
16254
  const uri = new URL(this.client.config.endpoint + apiPath);
15542
16255
  apiPayload['project'] = this.client.config.project;
15543
16256
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
15544
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
16257
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
15545
16258
  uri.searchParams.append(key, value);
15546
16259
  }
15547
16260
  return uri.toString();
@@ -26180,7 +26893,7 @@ class Organizations {
26180
26893
  const uri = new URL(this.client.config.endpoint + apiPath);
26181
26894
  apiPayload['project'] = this.client.config.project;
26182
26895
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
26183
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
26896
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
26184
26897
  uri.searchParams.append(key, value);
26185
26898
  }
26186
26899
  return uri.toString();
@@ -26287,7 +27000,7 @@ class Organizations {
26287
27000
  const uri = new URL(this.client.config.endpoint + apiPath);
26288
27001
  apiPayload['project'] = this.client.config.project;
26289
27002
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
26290
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
27003
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
26291
27004
  uri.searchParams.append(key, value);
26292
27005
  }
26293
27006
  return uri.toString();
@@ -31068,11 +31781,13 @@ class Project {
31068
31781
  platformId: paramsOrFirst,
31069
31782
  name: rest[0],
31070
31783
  applicationId: rest[1],
31784
+ fingerprints: rest[2],
31071
31785
  };
31072
31786
  }
31073
31787
  const platformId = params.platformId;
31074
31788
  const name = params.name;
31075
31789
  const applicationId = params.applicationId;
31790
+ const fingerprints = params.fingerprints;
31076
31791
  if (typeof platformId === 'undefined') {
31077
31792
  throw new AppwriteException('Missing required parameter: "platformId"');
31078
31793
  }
@@ -31093,6 +31808,9 @@ class Project {
31093
31808
  if (typeof applicationId !== 'undefined') {
31094
31809
  apiPayload['applicationId'] = applicationId;
31095
31810
  }
31811
+ if (typeof fingerprints !== 'undefined') {
31812
+ apiPayload['fingerprints'] = fingerprints;
31813
+ }
31096
31814
  const uri = new URL(this.client.config.endpoint + apiPath);
31097
31815
  const apiHeaders = {
31098
31816
  'X-Appwrite-Project': this.client.config.project,
@@ -31113,11 +31831,13 @@ class Project {
31113
31831
  platformId: paramsOrFirst,
31114
31832
  name: rest[0],
31115
31833
  applicationId: rest[1],
31834
+ fingerprints: rest[2],
31116
31835
  };
31117
31836
  }
31118
31837
  const platformId = params.platformId;
31119
31838
  const name = params.name;
31120
31839
  const applicationId = params.applicationId;
31840
+ const fingerprints = params.fingerprints;
31121
31841
  if (typeof platformId === 'undefined' || platformId === '') {
31122
31842
  throw new AppwriteException('Missing required parameter: "platformId"');
31123
31843
  }
@@ -31135,6 +31855,9 @@ class Project {
31135
31855
  if (typeof applicationId !== 'undefined') {
31136
31856
  apiPayload['applicationId'] = applicationId;
31137
31857
  }
31858
+ if (typeof fingerprints !== 'undefined') {
31859
+ apiPayload['fingerprints'] = fingerprints;
31860
+ }
31138
31861
  const uri = new URL(this.client.config.endpoint + apiPath);
31139
31862
  const apiHeaders = {
31140
31863
  'X-Appwrite-Project': this.client.config.project,
@@ -31783,6 +32506,38 @@ class Project {
31783
32506
  };
31784
32507
  return this.client.call('patch', uri, apiHeaders, apiPayload);
31785
32508
  }
32509
+ updatePasskeyPolicy(paramsOrFirst, ...rest) {
32510
+ let params;
32511
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
32512
+ (paramsOrFirst &&
32513
+ typeof paramsOrFirst === 'object' &&
32514
+ !Array.isArray(paramsOrFirst))) {
32515
+ params = (paramsOrFirst || {});
32516
+ }
32517
+ else {
32518
+ params = {
32519
+ rpId: paramsOrFirst,
32520
+ origins: rest[0],
32521
+ };
32522
+ }
32523
+ const rpId = params.rpId;
32524
+ const origins = params.origins;
32525
+ const apiPath = '/project/policies/passkey';
32526
+ const apiPayload = {};
32527
+ if (typeof rpId !== 'undefined') {
32528
+ apiPayload['rpId'] = rpId;
32529
+ }
32530
+ if (typeof origins !== 'undefined') {
32531
+ apiPayload['origins'] = origins;
32532
+ }
32533
+ const uri = new URL(this.client.config.endpoint + apiPath);
32534
+ const apiHeaders = {
32535
+ 'X-Appwrite-Project': this.client.config.project,
32536
+ 'content-type': 'application/json',
32537
+ accept: 'application/json',
32538
+ };
32539
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
32540
+ }
31786
32541
  updatePasswordDictionaryPolicy(paramsOrFirst) {
31787
32542
  let params;
31788
32543
  if (paramsOrFirst &&
@@ -34473,7 +35228,7 @@ class Sites {
34473
35228
  const uri = new URL(this.client.config.endpoint + apiPath);
34474
35229
  apiPayload['project'] = this.client.config.project;
34475
35230
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
34476
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
35231
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
34477
35232
  uri.searchParams.append(key, value);
34478
35233
  }
34479
35234
  return uri.toString();
@@ -35304,7 +36059,7 @@ class Storage {
35304
36059
  const uri = new URL(this.client.config.endpoint + apiPath);
35305
36060
  apiPayload['project'] = this.client.config.project;
35306
36061
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
35307
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
36062
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
35308
36063
  uri.searchParams.append(key, value);
35309
36064
  }
35310
36065
  return uri.toString();
@@ -35397,7 +36152,7 @@ class Storage {
35397
36152
  const uri = new URL(this.client.config.endpoint + apiPath);
35398
36153
  apiPayload['project'] = this.client.config.project;
35399
36154
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
35400
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
36155
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
35401
36156
  uri.searchParams.append(key, value);
35402
36157
  }
35403
36158
  return uri.toString();
@@ -35435,7 +36190,7 @@ class Storage {
35435
36190
  const uri = new URL(this.client.config.endpoint + apiPath);
35436
36191
  apiPayload['project'] = this.client.config.project;
35437
36192
  apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
35438
- for (const [key, value] of Object.entries(Service.flatten(apiPayload))) {
36193
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
35439
36194
  uri.searchParams.append(key, value);
35440
36195
  }
35441
36196
  return uri.toString();
@@ -39906,15 +40661,17 @@ class Teams {
39906
40661
  params = {
39907
40662
  teamId: paramsOrFirst,
39908
40663
  roles: rest[0],
39909
- email: rest[1],
39910
- userId: rest[2],
39911
- phone: rest[3],
39912
- url: rest[4],
39913
- name: rest[5],
40664
+ membershipId: rest[1],
40665
+ email: rest[2],
40666
+ userId: rest[3],
40667
+ phone: rest[4],
40668
+ url: rest[5],
40669
+ name: rest[6],
39914
40670
  };
39915
40671
  }
39916
40672
  const teamId = params.teamId;
39917
40673
  const roles = params.roles;
40674
+ const membershipId = params.membershipId;
39918
40675
  const email = params.email;
39919
40676
  const userId = params.userId;
39920
40677
  const phone = params.phone;
@@ -39928,6 +40685,9 @@ class Teams {
39928
40685
  }
39929
40686
  const apiPath = '/teams/{teamId}/memberships'.replace('{teamId}', encodeURIComponent(String(teamId)));
39930
40687
  const apiPayload = {};
40688
+ if (typeof membershipId !== 'undefined') {
40689
+ apiPayload['membershipId'] = membershipId;
40690
+ }
39931
40691
  if (typeof email !== 'undefined') {
39932
40692
  apiPayload['email'] = email;
39933
40693
  }
@@ -41746,6 +42506,106 @@ class Users {
41746
42506
  };
41747
42507
  return this.client.call('patch', uri, apiHeaders, apiPayload);
41748
42508
  }
42509
+ listPasskeys(paramsOrFirst, ...rest) {
42510
+ let params;
42511
+ if (paramsOrFirst &&
42512
+ typeof paramsOrFirst === 'object' &&
42513
+ !Array.isArray(paramsOrFirst)) {
42514
+ params = (paramsOrFirst || {});
42515
+ }
42516
+ else {
42517
+ params = {
42518
+ userId: paramsOrFirst,
42519
+ queries: rest[0],
42520
+ total: rest[1],
42521
+ };
42522
+ }
42523
+ const userId = params.userId;
42524
+ const queries = params.queries;
42525
+ const total = params.total;
42526
+ if (typeof userId === 'undefined' || userId === '') {
42527
+ throw new AppwriteException('Missing required parameter: "userId"');
42528
+ }
42529
+ const apiPath = '/users/{userId}/passkeys'.replace('{userId}', encodeURIComponent(String(userId)));
42530
+ const apiPayload = {};
42531
+ if (typeof queries !== 'undefined') {
42532
+ apiPayload['queries'] = queries;
42533
+ }
42534
+ if (typeof total !== 'undefined') {
42535
+ apiPayload['total'] = total;
42536
+ }
42537
+ const uri = new URL(this.client.config.endpoint + apiPath);
42538
+ const apiHeaders = {
42539
+ 'X-Appwrite-Project': this.client.config.project,
42540
+ accept: 'application/json',
42541
+ };
42542
+ return this.client.call('get', uri, apiHeaders, apiPayload);
42543
+ }
42544
+ getPasskey(paramsOrFirst, ...rest) {
42545
+ let params;
42546
+ if (paramsOrFirst &&
42547
+ typeof paramsOrFirst === 'object' &&
42548
+ !Array.isArray(paramsOrFirst)) {
42549
+ params = (paramsOrFirst || {});
42550
+ }
42551
+ else {
42552
+ params = {
42553
+ userId: paramsOrFirst,
42554
+ passkeyId: rest[0],
42555
+ };
42556
+ }
42557
+ const userId = params.userId;
42558
+ const passkeyId = params.passkeyId;
42559
+ if (typeof userId === 'undefined' || userId === '') {
42560
+ throw new AppwriteException('Missing required parameter: "userId"');
42561
+ }
42562
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
42563
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
42564
+ }
42565
+ const apiPath = '/users/{userId}/passkeys/{passkeyId}'
42566
+ .replace('{userId}', encodeURIComponent(String(userId)))
42567
+ .replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
42568
+ const apiPayload = {};
42569
+ const uri = new URL(this.client.config.endpoint + apiPath);
42570
+ const apiHeaders = {
42571
+ 'X-Appwrite-Project': this.client.config.project,
42572
+ accept: 'application/json',
42573
+ };
42574
+ return this.client.call('get', uri, apiHeaders, apiPayload);
42575
+ }
42576
+ deletePasskey(paramsOrFirst, ...rest) {
42577
+ let params;
42578
+ if (paramsOrFirst &&
42579
+ typeof paramsOrFirst === 'object' &&
42580
+ !Array.isArray(paramsOrFirst)) {
42581
+ params = (paramsOrFirst || {});
42582
+ }
42583
+ else {
42584
+ params = {
42585
+ userId: paramsOrFirst,
42586
+ passkeyId: rest[0],
42587
+ };
42588
+ }
42589
+ const userId = params.userId;
42590
+ const passkeyId = params.passkeyId;
42591
+ if (typeof userId === 'undefined' || userId === '') {
42592
+ throw new AppwriteException('Missing required parameter: "userId"');
42593
+ }
42594
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
42595
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
42596
+ }
42597
+ const apiPath = '/users/{userId}/passkeys/{passkeyId}'
42598
+ .replace('{userId}', encodeURIComponent(String(userId)))
42599
+ .replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
42600
+ const apiPayload = {};
42601
+ const uri = new URL(this.client.config.endpoint + apiPath);
42602
+ const apiHeaders = {
42603
+ 'X-Appwrite-Project': this.client.config.project,
42604
+ 'content-type': 'application/json',
42605
+ accept: 'application/json',
42606
+ };
42607
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
42608
+ }
41749
42609
  updatePassword(paramsOrFirst, ...rest) {
41750
42610
  let params;
41751
42611
  if (paramsOrFirst &&
@@ -44252,11 +45112,11 @@ class VectorsDB {
44252
45112
  }
44253
45113
  }
44254
45114
 
44255
- class Waf {
45115
+ class Videos {
44256
45116
  constructor(client) {
44257
45117
  this.client = client;
44258
45118
  }
44259
- listRules(paramsOrFirst, ...rest) {
45119
+ list(paramsOrFirst, ...rest) {
44260
45120
  let params;
44261
45121
  if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
44262
45122
  (paramsOrFirst &&
@@ -44274,7 +45134,7 @@ class Waf {
44274
45134
  const queries = params.queries;
44275
45135
  const search = params.search;
44276
45136
  const total = params.total;
44277
- const apiPath = '/waf/rules';
45137
+ const apiPath = '/videos';
44278
45138
  const apiPayload = {};
44279
45139
  if (typeof queries !== 'undefined') {
44280
45140
  apiPayload['queries'] = queries;
@@ -44292,7 +45152,7 @@ class Waf {
44292
45152
  };
44293
45153
  return this.client.call('get', uri, apiHeaders, apiPayload);
44294
45154
  }
44295
- createBypassRule(paramsOrFirst, ...rest) {
45155
+ create(paramsOrFirst, ...rest) {
44296
45156
  let params;
44297
45157
  if (paramsOrFirst &&
44298
45158
  typeof paramsOrFirst === 'object' &&
@@ -44301,59 +45161,31 @@ class Waf {
44301
45161
  }
44302
45162
  else {
44303
45163
  params = {
44304
- ruleId: paramsOrFirst,
44305
- resourceType: rest[0],
45164
+ bucketId: paramsOrFirst,
45165
+ fileId: rest[0],
44306
45166
  name: rest[1],
44307
- resourceId: rest[2],
44308
- description: rest[3],
44309
- priority: rest[4],
44310
- enabled: rest[5],
44311
- conditions: rest[6],
44312
45167
  };
44313
45168
  }
44314
- const ruleId = params.ruleId;
44315
- const resourceType = params.resourceType;
45169
+ const bucketId = params.bucketId;
45170
+ const fileId = params.fileId;
44316
45171
  const name = params.name;
44317
- const resourceId = params.resourceId;
44318
- const description = params.description;
44319
- const priority = params.priority;
44320
- const enabled = params.enabled;
44321
- const conditions = params.conditions;
44322
- if (typeof ruleId === 'undefined') {
44323
- throw new AppwriteException('Missing required parameter: "ruleId"');
44324
- }
44325
- if (typeof resourceType === 'undefined') {
44326
- throw new AppwriteException('Missing required parameter: "resourceType"');
45172
+ if (typeof bucketId === 'undefined') {
45173
+ throw new AppwriteException('Missing required parameter: "bucketId"');
44327
45174
  }
44328
- if (typeof name === 'undefined') {
44329
- throw new AppwriteException('Missing required parameter: "name"');
45175
+ if (typeof fileId === 'undefined') {
45176
+ throw new AppwriteException('Missing required parameter: "fileId"');
44330
45177
  }
44331
- const apiPath = '/waf/rules/bypass';
45178
+ const apiPath = '/videos';
44332
45179
  const apiPayload = {};
44333
- if (typeof ruleId !== 'undefined') {
44334
- apiPayload['ruleId'] = ruleId;
44335
- }
44336
- if (typeof resourceType !== 'undefined') {
44337
- apiPayload['resourceType'] = resourceType;
45180
+ if (typeof bucketId !== 'undefined') {
45181
+ apiPayload['bucketId'] = bucketId;
44338
45182
  }
44339
- if (typeof resourceId !== 'undefined') {
44340
- apiPayload['resourceId'] = resourceId;
45183
+ if (typeof fileId !== 'undefined') {
45184
+ apiPayload['fileId'] = fileId;
44341
45185
  }
44342
45186
  if (typeof name !== 'undefined') {
44343
45187
  apiPayload['name'] = name;
44344
45188
  }
44345
- if (typeof description !== 'undefined') {
44346
- apiPayload['description'] = description;
44347
- }
44348
- if (typeof priority !== 'undefined') {
44349
- apiPayload['priority'] = priority;
44350
- }
44351
- if (typeof enabled !== 'undefined') {
44352
- apiPayload['enabled'] = enabled;
44353
- }
44354
- if (typeof conditions !== 'undefined') {
44355
- apiPayload['conditions'] = conditions;
44356
- }
44357
45189
  const uri = new URL(this.client.config.endpoint + apiPath);
44358
45190
  const apiHeaders = {
44359
45191
  'X-Appwrite-Project': this.client.config.project,
@@ -44362,68 +45194,33 @@ class Waf {
44362
45194
  };
44363
45195
  return this.client.call('post', uri, apiHeaders, apiPayload);
44364
45196
  }
44365
- updateBypassRule(paramsOrFirst, ...rest) {
45197
+ listProfiles(paramsOrFirst) {
44366
45198
  let params;
44367
- if (paramsOrFirst &&
44368
- typeof paramsOrFirst === 'object' &&
44369
- !Array.isArray(paramsOrFirst)) {
45199
+ if (typeof paramsOrFirst === 'undefined' ||
45200
+ (paramsOrFirst &&
45201
+ typeof paramsOrFirst === 'object' &&
45202
+ !Array.isArray(paramsOrFirst))) {
44370
45203
  params = (paramsOrFirst || {});
44371
45204
  }
44372
45205
  else {
44373
45206
  params = {
44374
- ruleId: paramsOrFirst,
44375
- resourceType: rest[0],
44376
- resourceId: rest[1],
44377
- name: rest[2],
44378
- description: rest[3],
44379
- priority: rest[4],
44380
- enabled: rest[5],
44381
- conditions: rest[6],
45207
+ search: paramsOrFirst,
44382
45208
  };
44383
45209
  }
44384
- const ruleId = params.ruleId;
44385
- const resourceType = params.resourceType;
44386
- const resourceId = params.resourceId;
44387
- const name = params.name;
44388
- const description = params.description;
44389
- const priority = params.priority;
44390
- const enabled = params.enabled;
44391
- const conditions = params.conditions;
44392
- if (typeof ruleId === 'undefined' || ruleId === '') {
44393
- throw new AppwriteException('Missing required parameter: "ruleId"');
44394
- }
44395
- const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
45210
+ const search = params.search;
45211
+ const apiPath = '/videos/profiles';
44396
45212
  const apiPayload = {};
44397
- if (typeof resourceType !== 'undefined') {
44398
- apiPayload['resourceType'] = resourceType;
44399
- }
44400
- if (typeof resourceId !== 'undefined') {
44401
- apiPayload['resourceId'] = resourceId;
44402
- }
44403
- if (typeof name !== 'undefined') {
44404
- apiPayload['name'] = name;
44405
- }
44406
- if (typeof description !== 'undefined') {
44407
- apiPayload['description'] = description;
44408
- }
44409
- if (typeof priority !== 'undefined') {
44410
- apiPayload['priority'] = priority;
44411
- }
44412
- if (typeof enabled !== 'undefined') {
44413
- apiPayload['enabled'] = enabled;
44414
- }
44415
- if (typeof conditions !== 'undefined') {
44416
- apiPayload['conditions'] = conditions;
45213
+ if (typeof search !== 'undefined') {
45214
+ apiPayload['search'] = search;
44417
45215
  }
44418
45216
  const uri = new URL(this.client.config.endpoint + apiPath);
44419
45217
  const apiHeaders = {
44420
45218
  'X-Appwrite-Project': this.client.config.project,
44421
- 'content-type': 'application/json',
44422
45219
  accept: 'application/json',
44423
45220
  };
44424
- return this.client.call('patch', uri, apiHeaders, apiPayload);
45221
+ return this.client.call('get', uri, apiHeaders, apiPayload);
44425
45222
  }
44426
- createChallengeRule(paramsOrFirst, ...rest) {
45223
+ createProfile(paramsOrFirst, ...rest) {
44427
45224
  let params;
44428
45225
  if (paramsOrFirst &&
44429
45226
  typeof paramsOrFirst === 'object' &&
@@ -44432,73 +45229,49 @@ class Waf {
44432
45229
  }
44433
45230
  else {
44434
45231
  params = {
44435
- ruleId: paramsOrFirst,
44436
- resourceType: rest[0],
44437
- name: rest[1],
44438
- resourceId: rest[2],
44439
- description: rest[3],
44440
- challengeType: rest[4],
44441
- priority: rest[5],
44442
- enabled: rest[6],
44443
- conditions: rest[7],
44444
- difficulty: rest[8],
44445
- ttl: rest[9],
45232
+ name: paramsOrFirst,
45233
+ videoBitRate: rest[0],
45234
+ audioBitRate: rest[1],
45235
+ width: rest[2],
45236
+ height: rest[3],
44446
45237
  };
44447
45238
  }
44448
- const ruleId = params.ruleId;
44449
- const resourceType = params.resourceType;
44450
45239
  const name = params.name;
44451
- const resourceId = params.resourceId;
44452
- const description = params.description;
44453
- const challengeType = params.challengeType;
44454
- const priority = params.priority;
44455
- const enabled = params.enabled;
44456
- const conditions = params.conditions;
44457
- const difficulty = params.difficulty;
44458
- const ttl = params.ttl;
44459
- if (typeof ruleId === 'undefined') {
44460
- throw new AppwriteException('Missing required parameter: "ruleId"');
44461
- }
44462
- if (typeof resourceType === 'undefined') {
44463
- throw new AppwriteException('Missing required parameter: "resourceType"');
44464
- }
45240
+ const videoBitRate = params.videoBitRate;
45241
+ const audioBitRate = params.audioBitRate;
45242
+ const width = params.width;
45243
+ const height = params.height;
44465
45244
  if (typeof name === 'undefined') {
44466
45245
  throw new AppwriteException('Missing required parameter: "name"');
44467
45246
  }
44468
- const apiPath = '/waf/rules/challenge';
44469
- const apiPayload = {};
44470
- if (typeof ruleId !== 'undefined') {
44471
- apiPayload['ruleId'] = ruleId;
45247
+ if (typeof videoBitRate === 'undefined') {
45248
+ throw new AppwriteException('Missing required parameter: "videoBitRate"');
44472
45249
  }
44473
- if (typeof resourceType !== 'undefined') {
44474
- apiPayload['resourceType'] = resourceType;
45250
+ if (typeof audioBitRate === 'undefined') {
45251
+ throw new AppwriteException('Missing required parameter: "audioBitRate"');
44475
45252
  }
44476
- if (typeof resourceId !== 'undefined') {
44477
- apiPayload['resourceId'] = resourceId;
45253
+ if (typeof width === 'undefined') {
45254
+ throw new AppwriteException('Missing required parameter: "width"');
44478
45255
  }
45256
+ if (typeof height === 'undefined') {
45257
+ throw new AppwriteException('Missing required parameter: "height"');
45258
+ }
45259
+ const apiPath = '/videos/profiles';
45260
+ const apiPayload = {};
44479
45261
  if (typeof name !== 'undefined') {
44480
45262
  apiPayload['name'] = name;
44481
45263
  }
44482
- if (typeof description !== 'undefined') {
44483
- apiPayload['description'] = description;
44484
- }
44485
- if (typeof challengeType !== 'undefined') {
44486
- apiPayload['challengeType'] = challengeType;
44487
- }
44488
- if (typeof priority !== 'undefined') {
44489
- apiPayload['priority'] = priority;
44490
- }
44491
- if (typeof enabled !== 'undefined') {
44492
- apiPayload['enabled'] = enabled;
45264
+ if (typeof videoBitRate !== 'undefined') {
45265
+ apiPayload['videoBitRate'] = videoBitRate;
44493
45266
  }
44494
- if (typeof conditions !== 'undefined') {
44495
- apiPayload['conditions'] = conditions;
45267
+ if (typeof audioBitRate !== 'undefined') {
45268
+ apiPayload['audioBitRate'] = audioBitRate;
44496
45269
  }
44497
- if (typeof difficulty !== 'undefined') {
44498
- apiPayload['difficulty'] = difficulty;
45270
+ if (typeof width !== 'undefined') {
45271
+ apiPayload['width'] = width;
44499
45272
  }
44500
- if (typeof ttl !== 'undefined') {
44501
- apiPayload['ttl'] = ttl;
45273
+ if (typeof height !== 'undefined') {
45274
+ apiPayload['height'] = height;
44502
45275
  }
44503
45276
  const uri = new URL(this.client.config.endpoint + apiPath);
44504
45277
  const apiHeaders = {
@@ -44508,7 +45281,7 @@ class Waf {
44508
45281
  };
44509
45282
  return this.client.call('post', uri, apiHeaders, apiPayload);
44510
45283
  }
44511
- updateChallengeRule(paramsOrFirst, ...rest) {
45284
+ getProfile(paramsOrFirst) {
44512
45285
  let params;
44513
45286
  if (paramsOrFirst &&
44514
45287
  typeof paramsOrFirst === 'object' &&
@@ -44517,74 +45290,23 @@ class Waf {
44517
45290
  }
44518
45291
  else {
44519
45292
  params = {
44520
- ruleId: paramsOrFirst,
44521
- resourceType: rest[0],
44522
- resourceId: rest[1],
44523
- name: rest[2],
44524
- description: rest[3],
44525
- challengeType: rest[4],
44526
- priority: rest[5],
44527
- enabled: rest[6],
44528
- conditions: rest[7],
44529
- difficulty: rest[8],
44530
- ttl: rest[9],
45293
+ profileId: paramsOrFirst,
44531
45294
  };
44532
45295
  }
44533
- const ruleId = params.ruleId;
44534
- const resourceType = params.resourceType;
44535
- const resourceId = params.resourceId;
44536
- const name = params.name;
44537
- const description = params.description;
44538
- const challengeType = params.challengeType;
44539
- const priority = params.priority;
44540
- const enabled = params.enabled;
44541
- const conditions = params.conditions;
44542
- const difficulty = params.difficulty;
44543
- const ttl = params.ttl;
44544
- if (typeof ruleId === 'undefined' || ruleId === '') {
44545
- throw new AppwriteException('Missing required parameter: "ruleId"');
45296
+ const profileId = params.profileId;
45297
+ if (typeof profileId === 'undefined' || profileId === '') {
45298
+ throw new AppwriteException('Missing required parameter: "profileId"');
44546
45299
  }
44547
- const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
45300
+ const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
44548
45301
  const apiPayload = {};
44549
- if (typeof resourceType !== 'undefined') {
44550
- apiPayload['resourceType'] = resourceType;
44551
- }
44552
- if (typeof resourceId !== 'undefined') {
44553
- apiPayload['resourceId'] = resourceId;
44554
- }
44555
- if (typeof name !== 'undefined') {
44556
- apiPayload['name'] = name;
44557
- }
44558
- if (typeof description !== 'undefined') {
44559
- apiPayload['description'] = description;
44560
- }
44561
- if (typeof challengeType !== 'undefined') {
44562
- apiPayload['challengeType'] = challengeType;
44563
- }
44564
- if (typeof priority !== 'undefined') {
44565
- apiPayload['priority'] = priority;
44566
- }
44567
- if (typeof enabled !== 'undefined') {
44568
- apiPayload['enabled'] = enabled;
44569
- }
44570
- if (typeof conditions !== 'undefined') {
44571
- apiPayload['conditions'] = conditions;
44572
- }
44573
- if (typeof difficulty !== 'undefined') {
44574
- apiPayload['difficulty'] = difficulty;
44575
- }
44576
- if (typeof ttl !== 'undefined') {
44577
- apiPayload['ttl'] = ttl;
44578
- }
44579
45302
  const uri = new URL(this.client.config.endpoint + apiPath);
44580
45303
  const apiHeaders = {
44581
45304
  'X-Appwrite-Project': this.client.config.project,
44582
- 'content-type': 'application/json',
44583
45305
  accept: 'application/json',
44584
45306
  };
44585
- return this.client.call('patch', uri, apiHeaders, apiPayload);
45307
+ return this.client.call('get', uri, apiHeaders, apiPayload);
44586
45308
  }
44587
- createDenyRule(paramsOrFirst, ...rest) {
45309
+ updateProfile(paramsOrFirst, ...rest) {
44588
45310
  let params;
44589
45311
  if (paramsOrFirst &&
44590
45312
  typeof paramsOrFirst === 'object' &&
@@ -44593,58 +45315,54 @@ class Waf {
44593
45315
  }
44594
45316
  else {
44595
45317
  params = {
44596
- ruleId: paramsOrFirst,
44597
- resourceType: rest[0],
44598
- name: rest[1],
44599
- resourceId: rest[2],
44600
- description: rest[3],
44601
- priority: rest[4],
44602
- enabled: rest[5],
44603
- conditions: rest[6],
45318
+ profileId: paramsOrFirst,
45319
+ name: rest[0],
45320
+ videoBitRate: rest[1],
45321
+ audioBitRate: rest[2],
45322
+ width: rest[3],
45323
+ height: rest[4],
44604
45324
  };
44605
45325
  }
44606
- const ruleId = params.ruleId;
44607
- const resourceType = params.resourceType;
45326
+ const profileId = params.profileId;
44608
45327
  const name = params.name;
44609
- const resourceId = params.resourceId;
44610
- const description = params.description;
44611
- const priority = params.priority;
44612
- const enabled = params.enabled;
44613
- const conditions = params.conditions;
44614
- if (typeof ruleId === 'undefined') {
44615
- throw new AppwriteException('Missing required parameter: "ruleId"');
44616
- }
44617
- if (typeof resourceType === 'undefined') {
44618
- throw new AppwriteException('Missing required parameter: "resourceType"');
45328
+ const videoBitRate = params.videoBitRate;
45329
+ const audioBitRate = params.audioBitRate;
45330
+ const width = params.width;
45331
+ const height = params.height;
45332
+ if (typeof profileId === 'undefined' || profileId === '') {
45333
+ throw new AppwriteException('Missing required parameter: "profileId"');
44619
45334
  }
44620
45335
  if (typeof name === 'undefined') {
44621
45336
  throw new AppwriteException('Missing required parameter: "name"');
44622
45337
  }
44623
- const apiPath = '/waf/rules/deny';
44624
- const apiPayload = {};
44625
- if (typeof ruleId !== 'undefined') {
44626
- apiPayload['ruleId'] = ruleId;
45338
+ if (typeof videoBitRate === 'undefined') {
45339
+ throw new AppwriteException('Missing required parameter: "videoBitRate"');
44627
45340
  }
44628
- if (typeof resourceType !== 'undefined') {
44629
- apiPayload['resourceType'] = resourceType;
45341
+ if (typeof audioBitRate === 'undefined') {
45342
+ throw new AppwriteException('Missing required parameter: "audioBitRate"');
44630
45343
  }
44631
- if (typeof resourceId !== 'undefined') {
44632
- apiPayload['resourceId'] = resourceId;
45344
+ if (typeof width === 'undefined') {
45345
+ throw new AppwriteException('Missing required parameter: "width"');
44633
45346
  }
45347
+ if (typeof height === 'undefined') {
45348
+ throw new AppwriteException('Missing required parameter: "height"');
45349
+ }
45350
+ const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
45351
+ const apiPayload = {};
44634
45352
  if (typeof name !== 'undefined') {
44635
45353
  apiPayload['name'] = name;
44636
45354
  }
44637
- if (typeof description !== 'undefined') {
44638
- apiPayload['description'] = description;
45355
+ if (typeof videoBitRate !== 'undefined') {
45356
+ apiPayload['videoBitRate'] = videoBitRate;
44639
45357
  }
44640
- if (typeof priority !== 'undefined') {
44641
- apiPayload['priority'] = priority;
45358
+ if (typeof audioBitRate !== 'undefined') {
45359
+ apiPayload['audioBitRate'] = audioBitRate;
44642
45360
  }
44643
- if (typeof enabled !== 'undefined') {
44644
- apiPayload['enabled'] = enabled;
45361
+ if (typeof width !== 'undefined') {
45362
+ apiPayload['width'] = width;
44645
45363
  }
44646
- if (typeof conditions !== 'undefined') {
44647
- apiPayload['conditions'] = conditions;
45364
+ if (typeof height !== 'undefined') {
45365
+ apiPayload['height'] = height;
44648
45366
  }
44649
45367
  const uri = new URL(this.client.config.endpoint + apiPath);
44650
45368
  const apiHeaders = {
@@ -44652,9 +45370,9 @@ class Waf {
44652
45370
  'content-type': 'application/json',
44653
45371
  accept: 'application/json',
44654
45372
  };
44655
- return this.client.call('post', uri, apiHeaders, apiPayload);
45373
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
44656
45374
  }
44657
- updateDenyRule(paramsOrFirst, ...rest) {
45375
+ deleteProfile(paramsOrFirst) {
44658
45376
  let params;
44659
45377
  if (paramsOrFirst &&
44660
45378
  typeof paramsOrFirst === 'object' &&
@@ -44663,59 +45381,49 @@ class Waf {
44663
45381
  }
44664
45382
  else {
44665
45383
  params = {
44666
- ruleId: paramsOrFirst,
44667
- resourceType: rest[0],
44668
- resourceId: rest[1],
44669
- name: rest[2],
44670
- description: rest[3],
44671
- priority: rest[4],
44672
- enabled: rest[5],
44673
- conditions: rest[6],
45384
+ profileId: paramsOrFirst,
44674
45385
  };
44675
45386
  }
44676
- const ruleId = params.ruleId;
44677
- const resourceType = params.resourceType;
44678
- const resourceId = params.resourceId;
44679
- const name = params.name;
44680
- const description = params.description;
44681
- const priority = params.priority;
44682
- const enabled = params.enabled;
44683
- const conditions = params.conditions;
44684
- if (typeof ruleId === 'undefined' || ruleId === '') {
44685
- throw new AppwriteException('Missing required parameter: "ruleId"');
45387
+ const profileId = params.profileId;
45388
+ if (typeof profileId === 'undefined' || profileId === '') {
45389
+ throw new AppwriteException('Missing required parameter: "profileId"');
44686
45390
  }
44687
- const apiPath = '/waf/rules/deny/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
45391
+ const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
44688
45392
  const apiPayload = {};
44689
- if (typeof resourceType !== 'undefined') {
44690
- apiPayload['resourceType'] = resourceType;
44691
- }
44692
- if (typeof resourceId !== 'undefined') {
44693
- apiPayload['resourceId'] = resourceId;
44694
- }
44695
- if (typeof name !== 'undefined') {
44696
- apiPayload['name'] = name;
44697
- }
44698
- if (typeof description !== 'undefined') {
44699
- apiPayload['description'] = description;
44700
- }
44701
- if (typeof priority !== 'undefined') {
44702
- apiPayload['priority'] = priority;
45393
+ const uri = new URL(this.client.config.endpoint + apiPath);
45394
+ const apiHeaders = {
45395
+ 'X-Appwrite-Project': this.client.config.project,
45396
+ 'content-type': 'application/json',
45397
+ accept: 'application/json',
45398
+ };
45399
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
45400
+ }
45401
+ get(paramsOrFirst) {
45402
+ let params;
45403
+ if (paramsOrFirst &&
45404
+ typeof paramsOrFirst === 'object' &&
45405
+ !Array.isArray(paramsOrFirst)) {
45406
+ params = (paramsOrFirst || {});
44703
45407
  }
44704
- if (typeof enabled !== 'undefined') {
44705
- apiPayload['enabled'] = enabled;
45408
+ else {
45409
+ params = {
45410
+ videoId: paramsOrFirst,
45411
+ };
44706
45412
  }
44707
- if (typeof conditions !== 'undefined') {
44708
- apiPayload['conditions'] = conditions;
45413
+ const videoId = params.videoId;
45414
+ if (typeof videoId === 'undefined' || videoId === '') {
45415
+ throw new AppwriteException('Missing required parameter: "videoId"');
44709
45416
  }
45417
+ const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
45418
+ const apiPayload = {};
44710
45419
  const uri = new URL(this.client.config.endpoint + apiPath);
44711
45420
  const apiHeaders = {
44712
45421
  'X-Appwrite-Project': this.client.config.project,
44713
- 'content-type': 'application/json',
44714
45422
  accept: 'application/json',
44715
45423
  };
44716
- return this.client.call('patch', uri, apiHeaders, apiPayload);
45424
+ return this.client.call('get', uri, apiHeaders, apiPayload);
44717
45425
  }
44718
- createRateLimitRule(paramsOrFirst, ...rest) {
45426
+ update(paramsOrFirst, ...rest) {
44719
45427
  let params;
44720
45428
  if (paramsOrFirst &&
44721
45429
  typeof paramsOrFirst === 'object' &&
@@ -44724,71 +45432,1353 @@ class Waf {
44724
45432
  }
44725
45433
  else {
44726
45434
  params = {
44727
- ruleId: paramsOrFirst,
44728
- resourceType: rest[0],
44729
- name: rest[1],
44730
- limit: rest[2],
44731
- interval: rest[3],
44732
- resourceId: rest[4],
44733
- description: rest[5],
44734
- key: rest[6],
44735
- strategy: rest[7],
44736
- maxBucketSize: rest[8],
44737
- priority: rest[9],
44738
- enabled: rest[10],
44739
- conditions: rest[11],
45435
+ videoId: paramsOrFirst,
45436
+ name: rest[0],
44740
45437
  };
44741
45438
  }
44742
- const ruleId = params.ruleId;
44743
- const resourceType = params.resourceType;
45439
+ const videoId = params.videoId;
44744
45440
  const name = params.name;
44745
- const limit = params.limit;
44746
- const interval = params.interval;
44747
- const resourceId = params.resourceId;
44748
- const description = params.description;
44749
- const key = params.key;
44750
- const strategy = params.strategy;
44751
- const maxBucketSize = params.maxBucketSize;
44752
- const priority = params.priority;
44753
- const enabled = params.enabled;
44754
- const conditions = params.conditions;
44755
- if (typeof ruleId === 'undefined') {
44756
- throw new AppwriteException('Missing required parameter: "ruleId"');
44757
- }
44758
- if (typeof resourceType === 'undefined') {
44759
- throw new AppwriteException('Missing required parameter: "resourceType"');
45441
+ if (typeof videoId === 'undefined' || videoId === '') {
45442
+ throw new AppwriteException('Missing required parameter: "videoId"');
44760
45443
  }
44761
45444
  if (typeof name === 'undefined') {
44762
45445
  throw new AppwriteException('Missing required parameter: "name"');
44763
45446
  }
44764
- if (typeof limit === 'undefined') {
44765
- throw new AppwriteException('Missing required parameter: "limit"');
44766
- }
44767
- if (typeof interval === 'undefined') {
44768
- throw new AppwriteException('Missing required parameter: "interval"');
44769
- }
44770
- const apiPath = '/waf/rules/rate-limit';
45447
+ const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
44771
45448
  const apiPayload = {};
44772
- if (typeof ruleId !== 'undefined') {
44773
- apiPayload['ruleId'] = ruleId;
44774
- }
44775
- if (typeof resourceType !== 'undefined') {
44776
- apiPayload['resourceType'] = resourceType;
44777
- }
44778
- if (typeof resourceId !== 'undefined') {
44779
- apiPayload['resourceId'] = resourceId;
44780
- }
44781
45449
  if (typeof name !== 'undefined') {
44782
45450
  apiPayload['name'] = name;
44783
45451
  }
44784
- if (typeof description !== 'undefined') {
44785
- apiPayload['description'] = description;
44786
- }
44787
- if (typeof limit !== 'undefined') {
44788
- apiPayload['limit'] = limit;
44789
- }
44790
- if (typeof interval !== 'undefined') {
44791
- apiPayload['interval'] = interval;
45452
+ const uri = new URL(this.client.config.endpoint + apiPath);
45453
+ const apiHeaders = {
45454
+ 'X-Appwrite-Project': this.client.config.project,
45455
+ 'content-type': 'application/json',
45456
+ accept: 'application/json',
45457
+ };
45458
+ return this.client.call('put', uri, apiHeaders, apiPayload);
45459
+ }
45460
+ delete(paramsOrFirst) {
45461
+ let params;
45462
+ if (paramsOrFirst &&
45463
+ typeof paramsOrFirst === 'object' &&
45464
+ !Array.isArray(paramsOrFirst)) {
45465
+ params = (paramsOrFirst || {});
45466
+ }
45467
+ else {
45468
+ params = {
45469
+ videoId: paramsOrFirst,
45470
+ };
45471
+ }
45472
+ const videoId = params.videoId;
45473
+ if (typeof videoId === 'undefined' || videoId === '') {
45474
+ throw new AppwriteException('Missing required parameter: "videoId"');
45475
+ }
45476
+ const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
45477
+ const apiPayload = {};
45478
+ const uri = new URL(this.client.config.endpoint + apiPath);
45479
+ const apiHeaders = {
45480
+ 'X-Appwrite-Project': this.client.config.project,
45481
+ 'content-type': 'application/json',
45482
+ accept: 'application/json',
45483
+ };
45484
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
45485
+ }
45486
+ getCmafHlsManifest(paramsOrFirst) {
45487
+ let params;
45488
+ if (paramsOrFirst &&
45489
+ typeof paramsOrFirst === 'object' &&
45490
+ !Array.isArray(paramsOrFirst)) {
45491
+ params = (paramsOrFirst || {});
45492
+ }
45493
+ else {
45494
+ params = {
45495
+ videoId: paramsOrFirst,
45496
+ };
45497
+ }
45498
+ const videoId = params.videoId;
45499
+ if (typeof videoId === 'undefined' || videoId === '') {
45500
+ throw new AppwriteException('Missing required parameter: "videoId"');
45501
+ }
45502
+ const apiPath = '/videos/{videoId}/outputs/cmaf/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
45503
+ const apiPayload = {};
45504
+ const uri = new URL(this.client.config.endpoint + apiPath);
45505
+ apiPayload['project'] = this.client.config.project;
45506
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45507
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45508
+ uri.searchParams.append(key, value);
45509
+ }
45510
+ return uri.toString();
45511
+ }
45512
+ getCmafDashManifest(paramsOrFirst) {
45513
+ let params;
45514
+ if (paramsOrFirst &&
45515
+ typeof paramsOrFirst === 'object' &&
45516
+ !Array.isArray(paramsOrFirst)) {
45517
+ params = (paramsOrFirst || {});
45518
+ }
45519
+ else {
45520
+ params = {
45521
+ videoId: paramsOrFirst,
45522
+ };
45523
+ }
45524
+ const videoId = params.videoId;
45525
+ if (typeof videoId === 'undefined' || videoId === '') {
45526
+ throw new AppwriteException('Missing required parameter: "videoId"');
45527
+ }
45528
+ const apiPath = '/videos/{videoId}/outputs/cmaf/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
45529
+ const apiPayload = {};
45530
+ const uri = new URL(this.client.config.endpoint + apiPath);
45531
+ apiPayload['project'] = this.client.config.project;
45532
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45533
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45534
+ uri.searchParams.append(key, value);
45535
+ }
45536
+ return uri.toString();
45537
+ }
45538
+ getCmafStreamManifest(paramsOrFirst, ...rest) {
45539
+ let params;
45540
+ if (paramsOrFirst &&
45541
+ typeof paramsOrFirst === 'object' &&
45542
+ !Array.isArray(paramsOrFirst)) {
45543
+ params = (paramsOrFirst || {});
45544
+ }
45545
+ else {
45546
+ params = {
45547
+ videoId: paramsOrFirst,
45548
+ renditionId: rest[0],
45549
+ streamId: rest[1],
45550
+ };
45551
+ }
45552
+ const videoId = params.videoId;
45553
+ const renditionId = params.renditionId;
45554
+ const streamId = params.streamId;
45555
+ if (typeof videoId === 'undefined' || videoId === '') {
45556
+ throw new AppwriteException('Missing required parameter: "videoId"');
45557
+ }
45558
+ if (typeof renditionId === 'undefined' || renditionId === '') {
45559
+ throw new AppwriteException('Missing required parameter: "renditionId"');
45560
+ }
45561
+ if (typeof streamId === 'undefined') {
45562
+ throw new AppwriteException('Missing required parameter: "streamId"');
45563
+ }
45564
+ const apiPath = '/videos/{videoId}/outputs/cmaf/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
45565
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45566
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)))
45567
+ .replace('{streamId}', encodeURIComponent(String(streamId)));
45568
+ const apiPayload = {};
45569
+ const uri = new URL(this.client.config.endpoint + apiPath);
45570
+ apiPayload['project'] = this.client.config.project;
45571
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45572
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45573
+ uri.searchParams.append(key, value);
45574
+ }
45575
+ return uri.toString();
45576
+ }
45577
+ getDashManifest(paramsOrFirst) {
45578
+ let params;
45579
+ if (paramsOrFirst &&
45580
+ typeof paramsOrFirst === 'object' &&
45581
+ !Array.isArray(paramsOrFirst)) {
45582
+ params = (paramsOrFirst || {});
45583
+ }
45584
+ else {
45585
+ params = {
45586
+ videoId: paramsOrFirst,
45587
+ };
45588
+ }
45589
+ const videoId = params.videoId;
45590
+ if (typeof videoId === 'undefined' || videoId === '') {
45591
+ throw new AppwriteException('Missing required parameter: "videoId"');
45592
+ }
45593
+ const apiPath = '/videos/{videoId}/outputs/dash/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
45594
+ const apiPayload = {};
45595
+ const uri = new URL(this.client.config.endpoint + apiPath);
45596
+ apiPayload['project'] = this.client.config.project;
45597
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45598
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45599
+ uri.searchParams.append(key, value);
45600
+ }
45601
+ return uri.toString();
45602
+ }
45603
+ getHlsManifest(paramsOrFirst) {
45604
+ let params;
45605
+ if (paramsOrFirst &&
45606
+ typeof paramsOrFirst === 'object' &&
45607
+ !Array.isArray(paramsOrFirst)) {
45608
+ params = (paramsOrFirst || {});
45609
+ }
45610
+ else {
45611
+ params = {
45612
+ videoId: paramsOrFirst,
45613
+ };
45614
+ }
45615
+ const videoId = params.videoId;
45616
+ if (typeof videoId === 'undefined' || videoId === '') {
45617
+ throw new AppwriteException('Missing required parameter: "videoId"');
45618
+ }
45619
+ const apiPath = '/videos/{videoId}/outputs/hls/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
45620
+ const apiPayload = {};
45621
+ const uri = new URL(this.client.config.endpoint + apiPath);
45622
+ apiPayload['project'] = this.client.config.project;
45623
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45624
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45625
+ uri.searchParams.append(key, value);
45626
+ }
45627
+ return uri.toString();
45628
+ }
45629
+ getStreamManifest(paramsOrFirst, ...rest) {
45630
+ let params;
45631
+ if (paramsOrFirst &&
45632
+ typeof paramsOrFirst === 'object' &&
45633
+ !Array.isArray(paramsOrFirst)) {
45634
+ params = (paramsOrFirst || {});
45635
+ }
45636
+ else {
45637
+ params = {
45638
+ videoId: paramsOrFirst,
45639
+ renditionId: rest[0],
45640
+ streamId: rest[1],
45641
+ };
45642
+ }
45643
+ const videoId = params.videoId;
45644
+ const renditionId = params.renditionId;
45645
+ const streamId = params.streamId;
45646
+ if (typeof videoId === 'undefined' || videoId === '') {
45647
+ throw new AppwriteException('Missing required parameter: "videoId"');
45648
+ }
45649
+ if (typeof renditionId === 'undefined' || renditionId === '') {
45650
+ throw new AppwriteException('Missing required parameter: "renditionId"');
45651
+ }
45652
+ if (typeof streamId === 'undefined') {
45653
+ throw new AppwriteException('Missing required parameter: "streamId"');
45654
+ }
45655
+ const apiPath = '/videos/{videoId}/outputs/hls/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
45656
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45657
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)))
45658
+ .replace('{streamId}', encodeURIComponent(String(streamId)));
45659
+ const apiPayload = {};
45660
+ const uri = new URL(this.client.config.endpoint + apiPath);
45661
+ apiPayload['project'] = this.client.config.project;
45662
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45663
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45664
+ uri.searchParams.append(key, value);
45665
+ }
45666
+ return uri.toString();
45667
+ }
45668
+ getSegment(paramsOrFirst, ...rest) {
45669
+ let params;
45670
+ if (paramsOrFirst &&
45671
+ typeof paramsOrFirst === 'object' &&
45672
+ !Array.isArray(paramsOrFirst)) {
45673
+ params = (paramsOrFirst || {});
45674
+ }
45675
+ else {
45676
+ params = {
45677
+ videoId: paramsOrFirst,
45678
+ output: rest[0],
45679
+ renditionId: rest[1],
45680
+ segmentId: rest[2],
45681
+ };
45682
+ }
45683
+ const videoId = params.videoId;
45684
+ const output = params.output;
45685
+ const renditionId = params.renditionId;
45686
+ const segmentId = params.segmentId;
45687
+ if (typeof videoId === 'undefined' || videoId === '') {
45688
+ throw new AppwriteException('Missing required parameter: "videoId"');
45689
+ }
45690
+ if (typeof output === 'undefined') {
45691
+ throw new AppwriteException('Missing required parameter: "output"');
45692
+ }
45693
+ if (typeof renditionId === 'undefined' || renditionId === '') {
45694
+ throw new AppwriteException('Missing required parameter: "renditionId"');
45695
+ }
45696
+ if (typeof segmentId === 'undefined' || segmentId === '') {
45697
+ throw new AppwriteException('Missing required parameter: "segmentId"');
45698
+ }
45699
+ const apiPath = '/videos/{videoId}/outputs/{output}/renditions/{renditionId}/segments/{segmentId}'
45700
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45701
+ .replace('{output}', encodeURIComponent(String(output)))
45702
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)))
45703
+ .replace('{segmentId}', encodeURIComponent(String(segmentId)));
45704
+ const apiPayload = {};
45705
+ const uri = new URL(this.client.config.endpoint + apiPath);
45706
+ apiPayload['project'] = this.client.config.project;
45707
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45708
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45709
+ uri.searchParams.append(key, value);
45710
+ }
45711
+ return uri.toString();
45712
+ }
45713
+ getSubtitleManifest(paramsOrFirst, ...rest) {
45714
+ let params;
45715
+ if (paramsOrFirst &&
45716
+ typeof paramsOrFirst === 'object' &&
45717
+ !Array.isArray(paramsOrFirst)) {
45718
+ params = (paramsOrFirst || {});
45719
+ }
45720
+ else {
45721
+ params = {
45722
+ videoId: paramsOrFirst,
45723
+ output: rest[0],
45724
+ subtitleId: rest[1],
45725
+ };
45726
+ }
45727
+ const videoId = params.videoId;
45728
+ const output = params.output;
45729
+ const subtitleId = params.subtitleId;
45730
+ if (typeof videoId === 'undefined' || videoId === '') {
45731
+ throw new AppwriteException('Missing required parameter: "videoId"');
45732
+ }
45733
+ if (typeof output === 'undefined') {
45734
+ throw new AppwriteException('Missing required parameter: "output"');
45735
+ }
45736
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
45737
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
45738
+ }
45739
+ const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/manifest'
45740
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45741
+ .replace('{output}', encodeURIComponent(String(output)))
45742
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
45743
+ const apiPayload = {};
45744
+ const uri = new URL(this.client.config.endpoint + apiPath);
45745
+ apiPayload['project'] = this.client.config.project;
45746
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45747
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45748
+ uri.searchParams.append(key, value);
45749
+ }
45750
+ return uri.toString();
45751
+ }
45752
+ getSubtitleSegment(paramsOrFirst, ...rest) {
45753
+ let params;
45754
+ if (paramsOrFirst &&
45755
+ typeof paramsOrFirst === 'object' &&
45756
+ !Array.isArray(paramsOrFirst)) {
45757
+ params = (paramsOrFirst || {});
45758
+ }
45759
+ else {
45760
+ params = {
45761
+ videoId: paramsOrFirst,
45762
+ output: rest[0],
45763
+ subtitleId: rest[1],
45764
+ segmentId: rest[2],
45765
+ };
45766
+ }
45767
+ const videoId = params.videoId;
45768
+ const output = params.output;
45769
+ const subtitleId = params.subtitleId;
45770
+ const segmentId = params.segmentId;
45771
+ if (typeof videoId === 'undefined' || videoId === '') {
45772
+ throw new AppwriteException('Missing required parameter: "videoId"');
45773
+ }
45774
+ if (typeof output === 'undefined') {
45775
+ throw new AppwriteException('Missing required parameter: "output"');
45776
+ }
45777
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
45778
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
45779
+ }
45780
+ if (typeof segmentId === 'undefined' || segmentId === '') {
45781
+ throw new AppwriteException('Missing required parameter: "segmentId"');
45782
+ }
45783
+ const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/segments/{segmentId}'
45784
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45785
+ .replace('{output}', encodeURIComponent(String(output)))
45786
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)))
45787
+ .replace('{segmentId}', encodeURIComponent(String(segmentId)));
45788
+ const apiPayload = {};
45789
+ const uri = new URL(this.client.config.endpoint + apiPath);
45790
+ apiPayload['project'] = this.client.config.project;
45791
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45792
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45793
+ uri.searchParams.append(key, value);
45794
+ }
45795
+ return uri.toString();
45796
+ }
45797
+ getPreview(paramsOrFirst, ...rest) {
45798
+ let params;
45799
+ if (paramsOrFirst &&
45800
+ typeof paramsOrFirst === 'object' &&
45801
+ !Array.isArray(paramsOrFirst)) {
45802
+ params = (paramsOrFirst || {});
45803
+ }
45804
+ else {
45805
+ params = {
45806
+ videoId: paramsOrFirst,
45807
+ previewId: rest[0],
45808
+ width: rest[1],
45809
+ height: rest[2],
45810
+ output: rest[3],
45811
+ };
45812
+ }
45813
+ const videoId = params.videoId;
45814
+ const previewId = params.previewId;
45815
+ const width = params.width;
45816
+ const height = params.height;
45817
+ const output = params.output;
45818
+ if (typeof videoId === 'undefined' || videoId === '') {
45819
+ throw new AppwriteException('Missing required parameter: "videoId"');
45820
+ }
45821
+ if (typeof previewId === 'undefined' || previewId === '') {
45822
+ throw new AppwriteException('Missing required parameter: "previewId"');
45823
+ }
45824
+ const apiPath = '/videos/{videoId}/previews/{previewId}'
45825
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45826
+ .replace('{previewId}', encodeURIComponent(String(previewId)));
45827
+ const apiPayload = {};
45828
+ if (typeof width !== 'undefined') {
45829
+ apiPayload['width'] = width;
45830
+ }
45831
+ if (typeof height !== 'undefined') {
45832
+ apiPayload['height'] = height;
45833
+ }
45834
+ if (typeof output !== 'undefined') {
45835
+ apiPayload['output'] = output;
45836
+ }
45837
+ const uri = new URL(this.client.config.endpoint + apiPath);
45838
+ apiPayload['project'] = this.client.config.project;
45839
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45840
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45841
+ uri.searchParams.append(key, value);
45842
+ }
45843
+ return uri.toString();
45844
+ }
45845
+ listRenditions(paramsOrFirst, ...rest) {
45846
+ let params;
45847
+ if (paramsOrFirst &&
45848
+ typeof paramsOrFirst === 'object' &&
45849
+ !Array.isArray(paramsOrFirst)) {
45850
+ params = (paramsOrFirst || {});
45851
+ }
45852
+ else {
45853
+ params = {
45854
+ videoId: paramsOrFirst,
45855
+ output: rest[0],
45856
+ status: rest[1],
45857
+ };
45858
+ }
45859
+ const videoId = params.videoId;
45860
+ const output = params.output;
45861
+ const status = params.status;
45862
+ if (typeof videoId === 'undefined' || videoId === '') {
45863
+ throw new AppwriteException('Missing required parameter: "videoId"');
45864
+ }
45865
+ const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
45866
+ const apiPayload = {};
45867
+ if (typeof output !== 'undefined') {
45868
+ apiPayload['output'] = output;
45869
+ }
45870
+ if (typeof status !== 'undefined') {
45871
+ apiPayload['status'] = status;
45872
+ }
45873
+ const uri = new URL(this.client.config.endpoint + apiPath);
45874
+ const apiHeaders = {
45875
+ 'X-Appwrite-Project': this.client.config.project,
45876
+ accept: 'application/json',
45877
+ };
45878
+ return this.client.call('get', uri, apiHeaders, apiPayload);
45879
+ }
45880
+ createRendition(paramsOrFirst, ...rest) {
45881
+ let params;
45882
+ if (paramsOrFirst &&
45883
+ typeof paramsOrFirst === 'object' &&
45884
+ !Array.isArray(paramsOrFirst)) {
45885
+ params = (paramsOrFirst || {});
45886
+ }
45887
+ else {
45888
+ params = {
45889
+ videoId: paramsOrFirst,
45890
+ profileId: rest[0],
45891
+ output: rest[1],
45892
+ };
45893
+ }
45894
+ const videoId = params.videoId;
45895
+ const profileId = params.profileId;
45896
+ const output = params.output;
45897
+ if (typeof videoId === 'undefined' || videoId === '') {
45898
+ throw new AppwriteException('Missing required parameter: "videoId"');
45899
+ }
45900
+ if (typeof profileId === 'undefined') {
45901
+ throw new AppwriteException('Missing required parameter: "profileId"');
45902
+ }
45903
+ if (typeof output === 'undefined') {
45904
+ throw new AppwriteException('Missing required parameter: "output"');
45905
+ }
45906
+ const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
45907
+ const apiPayload = {};
45908
+ if (typeof profileId !== 'undefined') {
45909
+ apiPayload['profileId'] = profileId;
45910
+ }
45911
+ if (typeof output !== 'undefined') {
45912
+ apiPayload['output'] = output;
45913
+ }
45914
+ const uri = new URL(this.client.config.endpoint + apiPath);
45915
+ const apiHeaders = {
45916
+ 'X-Appwrite-Project': this.client.config.project,
45917
+ 'content-type': 'application/json',
45918
+ accept: 'application/json',
45919
+ };
45920
+ return this.client.call('post', uri, apiHeaders, apiPayload);
45921
+ }
45922
+ getRendition(paramsOrFirst, ...rest) {
45923
+ let params;
45924
+ if (paramsOrFirst &&
45925
+ typeof paramsOrFirst === 'object' &&
45926
+ !Array.isArray(paramsOrFirst)) {
45927
+ params = (paramsOrFirst || {});
45928
+ }
45929
+ else {
45930
+ params = {
45931
+ videoId: paramsOrFirst,
45932
+ renditionId: rest[0],
45933
+ };
45934
+ }
45935
+ const videoId = params.videoId;
45936
+ const renditionId = params.renditionId;
45937
+ if (typeof videoId === 'undefined' || videoId === '') {
45938
+ throw new AppwriteException('Missing required parameter: "videoId"');
45939
+ }
45940
+ if (typeof renditionId === 'undefined' || renditionId === '') {
45941
+ throw new AppwriteException('Missing required parameter: "renditionId"');
45942
+ }
45943
+ const apiPath = '/videos/{videoId}/renditions/{renditionId}'
45944
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45945
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)));
45946
+ const apiPayload = {};
45947
+ const uri = new URL(this.client.config.endpoint + apiPath);
45948
+ const apiHeaders = {
45949
+ 'X-Appwrite-Project': this.client.config.project,
45950
+ accept: 'application/json',
45951
+ };
45952
+ return this.client.call('get', uri, apiHeaders, apiPayload);
45953
+ }
45954
+ deleteRendition(paramsOrFirst, ...rest) {
45955
+ let params;
45956
+ if (paramsOrFirst &&
45957
+ typeof paramsOrFirst === 'object' &&
45958
+ !Array.isArray(paramsOrFirst)) {
45959
+ params = (paramsOrFirst || {});
45960
+ }
45961
+ else {
45962
+ params = {
45963
+ videoId: paramsOrFirst,
45964
+ renditionId: rest[0],
45965
+ };
45966
+ }
45967
+ const videoId = params.videoId;
45968
+ const renditionId = params.renditionId;
45969
+ if (typeof videoId === 'undefined' || videoId === '') {
45970
+ throw new AppwriteException('Missing required parameter: "videoId"');
45971
+ }
45972
+ if (typeof renditionId === 'undefined' || renditionId === '') {
45973
+ throw new AppwriteException('Missing required parameter: "renditionId"');
45974
+ }
45975
+ const apiPath = '/videos/{videoId}/renditions/{renditionId}'
45976
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45977
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)));
45978
+ const apiPayload = {};
45979
+ const uri = new URL(this.client.config.endpoint + apiPath);
45980
+ const apiHeaders = {
45981
+ 'X-Appwrite-Project': this.client.config.project,
45982
+ 'content-type': 'application/json',
45983
+ accept: 'application/json',
45984
+ };
45985
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
45986
+ }
45987
+ createSource(paramsOrFirst) {
45988
+ let params;
45989
+ if (paramsOrFirst &&
45990
+ typeof paramsOrFirst === 'object' &&
45991
+ !Array.isArray(paramsOrFirst)) {
45992
+ params = (paramsOrFirst || {});
45993
+ }
45994
+ else {
45995
+ params = {
45996
+ videoId: paramsOrFirst,
45997
+ };
45998
+ }
45999
+ const videoId = params.videoId;
46000
+ if (typeof videoId === 'undefined' || videoId === '') {
46001
+ throw new AppwriteException('Missing required parameter: "videoId"');
46002
+ }
46003
+ const apiPath = '/videos/{videoId}/source'.replace('{videoId}', encodeURIComponent(String(videoId)));
46004
+ const apiPayload = {};
46005
+ const uri = new URL(this.client.config.endpoint + apiPath);
46006
+ const apiHeaders = {
46007
+ 'X-Appwrite-Project': this.client.config.project,
46008
+ 'content-type': 'application/json',
46009
+ accept: 'application/json',
46010
+ };
46011
+ return this.client.call('post', uri, apiHeaders, apiPayload);
46012
+ }
46013
+ listSubtitles(paramsOrFirst) {
46014
+ let params;
46015
+ if (paramsOrFirst &&
46016
+ typeof paramsOrFirst === 'object' &&
46017
+ !Array.isArray(paramsOrFirst)) {
46018
+ params = (paramsOrFirst || {});
46019
+ }
46020
+ else {
46021
+ params = {
46022
+ videoId: paramsOrFirst,
46023
+ };
46024
+ }
46025
+ const videoId = params.videoId;
46026
+ if (typeof videoId === 'undefined' || videoId === '') {
46027
+ throw new AppwriteException('Missing required parameter: "videoId"');
46028
+ }
46029
+ const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
46030
+ const apiPayload = {};
46031
+ const uri = new URL(this.client.config.endpoint + apiPath);
46032
+ const apiHeaders = {
46033
+ 'X-Appwrite-Project': this.client.config.project,
46034
+ accept: 'application/json',
46035
+ };
46036
+ return this.client.call('get', uri, apiHeaders, apiPayload);
46037
+ }
46038
+ createSubtitle(paramsOrFirst, ...rest) {
46039
+ let params;
46040
+ if (paramsOrFirst &&
46041
+ typeof paramsOrFirst === 'object' &&
46042
+ !Array.isArray(paramsOrFirst)) {
46043
+ params = (paramsOrFirst || {});
46044
+ }
46045
+ else {
46046
+ params = {
46047
+ videoId: paramsOrFirst,
46048
+ bucketId: rest[0],
46049
+ fileId: rest[1],
46050
+ name: rest[2],
46051
+ code: rest[3],
46052
+ xdefault: rest[4],
46053
+ };
46054
+ }
46055
+ const videoId = params.videoId;
46056
+ const bucketId = params.bucketId;
46057
+ const fileId = params.fileId;
46058
+ const name = params.name;
46059
+ const code = params.code;
46060
+ const xdefault = params.xdefault;
46061
+ if (typeof videoId === 'undefined' || videoId === '') {
46062
+ throw new AppwriteException('Missing required parameter: "videoId"');
46063
+ }
46064
+ if (typeof bucketId === 'undefined') {
46065
+ throw new AppwriteException('Missing required parameter: "bucketId"');
46066
+ }
46067
+ if (typeof fileId === 'undefined') {
46068
+ throw new AppwriteException('Missing required parameter: "fileId"');
46069
+ }
46070
+ if (typeof name === 'undefined') {
46071
+ throw new AppwriteException('Missing required parameter: "name"');
46072
+ }
46073
+ if (typeof code === 'undefined') {
46074
+ throw new AppwriteException('Missing required parameter: "code"');
46075
+ }
46076
+ const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
46077
+ const apiPayload = {};
46078
+ if (typeof bucketId !== 'undefined') {
46079
+ apiPayload['bucketId'] = bucketId;
46080
+ }
46081
+ if (typeof fileId !== 'undefined') {
46082
+ apiPayload['fileId'] = fileId;
46083
+ }
46084
+ if (typeof name !== 'undefined') {
46085
+ apiPayload['name'] = name;
46086
+ }
46087
+ if (typeof code !== 'undefined') {
46088
+ apiPayload['code'] = code;
46089
+ }
46090
+ if (typeof xdefault !== 'undefined') {
46091
+ apiPayload['default'] = xdefault;
46092
+ }
46093
+ const uri = new URL(this.client.config.endpoint + apiPath);
46094
+ const apiHeaders = {
46095
+ 'X-Appwrite-Project': this.client.config.project,
46096
+ 'content-type': 'application/json',
46097
+ accept: 'application/json',
46098
+ };
46099
+ return this.client.call('post', uri, apiHeaders, apiPayload);
46100
+ }
46101
+ updateSubtitle(paramsOrFirst, ...rest) {
46102
+ let params;
46103
+ if (paramsOrFirst &&
46104
+ typeof paramsOrFirst === 'object' &&
46105
+ !Array.isArray(paramsOrFirst)) {
46106
+ params = (paramsOrFirst || {});
46107
+ }
46108
+ else {
46109
+ params = {
46110
+ videoId: paramsOrFirst,
46111
+ subtitleId: rest[0],
46112
+ bucketId: rest[1],
46113
+ fileId: rest[2],
46114
+ name: rest[3],
46115
+ code: rest[4],
46116
+ xdefault: rest[5],
46117
+ };
46118
+ }
46119
+ const videoId = params.videoId;
46120
+ const subtitleId = params.subtitleId;
46121
+ const bucketId = params.bucketId;
46122
+ const fileId = params.fileId;
46123
+ const name = params.name;
46124
+ const code = params.code;
46125
+ const xdefault = params.xdefault;
46126
+ if (typeof videoId === 'undefined' || videoId === '') {
46127
+ throw new AppwriteException('Missing required parameter: "videoId"');
46128
+ }
46129
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
46130
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
46131
+ }
46132
+ const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
46133
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
46134
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
46135
+ const apiPayload = {};
46136
+ if (typeof bucketId !== 'undefined') {
46137
+ apiPayload['bucketId'] = bucketId;
46138
+ }
46139
+ if (typeof fileId !== 'undefined') {
46140
+ apiPayload['fileId'] = fileId;
46141
+ }
46142
+ if (typeof name !== 'undefined') {
46143
+ apiPayload['name'] = name;
46144
+ }
46145
+ if (typeof code !== 'undefined') {
46146
+ apiPayload['code'] = code;
46147
+ }
46148
+ if (typeof xdefault !== 'undefined') {
46149
+ apiPayload['default'] = xdefault;
46150
+ }
46151
+ const uri = new URL(this.client.config.endpoint + apiPath);
46152
+ const apiHeaders = {
46153
+ 'X-Appwrite-Project': this.client.config.project,
46154
+ 'content-type': 'application/json',
46155
+ accept: 'application/json',
46156
+ };
46157
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
46158
+ }
46159
+ deleteSubtitle(paramsOrFirst, ...rest) {
46160
+ let params;
46161
+ if (paramsOrFirst &&
46162
+ typeof paramsOrFirst === 'object' &&
46163
+ !Array.isArray(paramsOrFirst)) {
46164
+ params = (paramsOrFirst || {});
46165
+ }
46166
+ else {
46167
+ params = {
46168
+ videoId: paramsOrFirst,
46169
+ subtitleId: rest[0],
46170
+ };
46171
+ }
46172
+ const videoId = params.videoId;
46173
+ const subtitleId = params.subtitleId;
46174
+ if (typeof videoId === 'undefined' || videoId === '') {
46175
+ throw new AppwriteException('Missing required parameter: "videoId"');
46176
+ }
46177
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
46178
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
46179
+ }
46180
+ const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
46181
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
46182
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
46183
+ const apiPayload = {};
46184
+ const uri = new URL(this.client.config.endpoint + apiPath);
46185
+ const apiHeaders = {
46186
+ 'X-Appwrite-Project': this.client.config.project,
46187
+ 'content-type': 'application/json',
46188
+ accept: 'application/json',
46189
+ };
46190
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
46191
+ }
46192
+ getTimeline(paramsOrFirst) {
46193
+ let params;
46194
+ if (paramsOrFirst &&
46195
+ typeof paramsOrFirst === 'object' &&
46196
+ !Array.isArray(paramsOrFirst)) {
46197
+ params = (paramsOrFirst || {});
46198
+ }
46199
+ else {
46200
+ params = {
46201
+ videoId: paramsOrFirst,
46202
+ };
46203
+ }
46204
+ const videoId = params.videoId;
46205
+ if (typeof videoId === 'undefined' || videoId === '') {
46206
+ throw new AppwriteException('Missing required parameter: "videoId"');
46207
+ }
46208
+ const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
46209
+ const apiPayload = {};
46210
+ const uri = new URL(this.client.config.endpoint + apiPath);
46211
+ const apiHeaders = {
46212
+ 'X-Appwrite-Project': this.client.config.project,
46213
+ accept: 'text/plain',
46214
+ };
46215
+ return this.client.call('get', uri, apiHeaders, apiPayload, 'text');
46216
+ }
46217
+ createTimeline(paramsOrFirst) {
46218
+ let params;
46219
+ if (paramsOrFirst &&
46220
+ typeof paramsOrFirst === 'object' &&
46221
+ !Array.isArray(paramsOrFirst)) {
46222
+ params = (paramsOrFirst || {});
46223
+ }
46224
+ else {
46225
+ params = {
46226
+ videoId: paramsOrFirst,
46227
+ };
46228
+ }
46229
+ const videoId = params.videoId;
46230
+ if (typeof videoId === 'undefined' || videoId === '') {
46231
+ throw new AppwriteException('Missing required parameter: "videoId"');
46232
+ }
46233
+ const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
46234
+ const apiPayload = {};
46235
+ const uri = new URL(this.client.config.endpoint + apiPath);
46236
+ const apiHeaders = {
46237
+ 'X-Appwrite-Project': this.client.config.project,
46238
+ 'content-type': 'application/json',
46239
+ accept: 'application/json',
46240
+ };
46241
+ return this.client.call('post', uri, apiHeaders, apiPayload);
46242
+ }
46243
+ }
46244
+
46245
+ class Waf {
46246
+ constructor(client) {
46247
+ this.client = client;
46248
+ }
46249
+ listRules(paramsOrFirst, ...rest) {
46250
+ let params;
46251
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
46252
+ (paramsOrFirst &&
46253
+ typeof paramsOrFirst === 'object' &&
46254
+ !Array.isArray(paramsOrFirst))) {
46255
+ params = (paramsOrFirst || {});
46256
+ }
46257
+ else {
46258
+ params = {
46259
+ queries: paramsOrFirst,
46260
+ search: rest[0],
46261
+ total: rest[1],
46262
+ };
46263
+ }
46264
+ const queries = params.queries;
46265
+ const search = params.search;
46266
+ const total = params.total;
46267
+ const apiPath = '/waf/rules';
46268
+ const apiPayload = {};
46269
+ if (typeof queries !== 'undefined') {
46270
+ apiPayload['queries'] = queries;
46271
+ }
46272
+ if (typeof search !== 'undefined') {
46273
+ apiPayload['search'] = search;
46274
+ }
46275
+ if (typeof total !== 'undefined') {
46276
+ apiPayload['total'] = total;
46277
+ }
46278
+ const uri = new URL(this.client.config.endpoint + apiPath);
46279
+ const apiHeaders = {
46280
+ 'X-Appwrite-Project': this.client.config.project,
46281
+ accept: 'application/json',
46282
+ };
46283
+ return this.client.call('get', uri, apiHeaders, apiPayload);
46284
+ }
46285
+ createBypassRule(paramsOrFirst, ...rest) {
46286
+ let params;
46287
+ if (paramsOrFirst &&
46288
+ typeof paramsOrFirst === 'object' &&
46289
+ !Array.isArray(paramsOrFirst)) {
46290
+ params = (paramsOrFirst || {});
46291
+ }
46292
+ else {
46293
+ params = {
46294
+ ruleId: paramsOrFirst,
46295
+ resourceType: rest[0],
46296
+ name: rest[1],
46297
+ resourceId: rest[2],
46298
+ description: rest[3],
46299
+ priority: rest[4],
46300
+ enabled: rest[5],
46301
+ conditions: rest[6],
46302
+ };
46303
+ }
46304
+ const ruleId = params.ruleId;
46305
+ const resourceType = params.resourceType;
46306
+ const name = params.name;
46307
+ const resourceId = params.resourceId;
46308
+ const description = params.description;
46309
+ const priority = params.priority;
46310
+ const enabled = params.enabled;
46311
+ const conditions = params.conditions;
46312
+ if (typeof ruleId === 'undefined') {
46313
+ throw new AppwriteException('Missing required parameter: "ruleId"');
46314
+ }
46315
+ if (typeof resourceType === 'undefined') {
46316
+ throw new AppwriteException('Missing required parameter: "resourceType"');
46317
+ }
46318
+ if (typeof name === 'undefined') {
46319
+ throw new AppwriteException('Missing required parameter: "name"');
46320
+ }
46321
+ const apiPath = '/waf/rules/bypass';
46322
+ const apiPayload = {};
46323
+ if (typeof ruleId !== 'undefined') {
46324
+ apiPayload['ruleId'] = ruleId;
46325
+ }
46326
+ if (typeof resourceType !== 'undefined') {
46327
+ apiPayload['resourceType'] = resourceType;
46328
+ }
46329
+ if (typeof resourceId !== 'undefined') {
46330
+ apiPayload['resourceId'] = resourceId;
46331
+ }
46332
+ if (typeof name !== 'undefined') {
46333
+ apiPayload['name'] = name;
46334
+ }
46335
+ if (typeof description !== 'undefined') {
46336
+ apiPayload['description'] = description;
46337
+ }
46338
+ if (typeof priority !== 'undefined') {
46339
+ apiPayload['priority'] = priority;
46340
+ }
46341
+ if (typeof enabled !== 'undefined') {
46342
+ apiPayload['enabled'] = enabled;
46343
+ }
46344
+ if (typeof conditions !== 'undefined') {
46345
+ apiPayload['conditions'] = conditions;
46346
+ }
46347
+ const uri = new URL(this.client.config.endpoint + apiPath);
46348
+ const apiHeaders = {
46349
+ 'X-Appwrite-Project': this.client.config.project,
46350
+ 'content-type': 'application/json',
46351
+ accept: 'application/json',
46352
+ };
46353
+ return this.client.call('post', uri, apiHeaders, apiPayload);
46354
+ }
46355
+ updateBypassRule(paramsOrFirst, ...rest) {
46356
+ let params;
46357
+ if (paramsOrFirst &&
46358
+ typeof paramsOrFirst === 'object' &&
46359
+ !Array.isArray(paramsOrFirst)) {
46360
+ params = (paramsOrFirst || {});
46361
+ }
46362
+ else {
46363
+ params = {
46364
+ ruleId: paramsOrFirst,
46365
+ resourceType: rest[0],
46366
+ resourceId: rest[1],
46367
+ name: rest[2],
46368
+ description: rest[3],
46369
+ priority: rest[4],
46370
+ enabled: rest[5],
46371
+ conditions: rest[6],
46372
+ };
46373
+ }
46374
+ const ruleId = params.ruleId;
46375
+ const resourceType = params.resourceType;
46376
+ const resourceId = params.resourceId;
46377
+ const name = params.name;
46378
+ const description = params.description;
46379
+ const priority = params.priority;
46380
+ const enabled = params.enabled;
46381
+ const conditions = params.conditions;
46382
+ if (typeof ruleId === 'undefined' || ruleId === '') {
46383
+ throw new AppwriteException('Missing required parameter: "ruleId"');
46384
+ }
46385
+ const apiPath = '/waf/rules/bypass/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
46386
+ const apiPayload = {};
46387
+ if (typeof resourceType !== 'undefined') {
46388
+ apiPayload['resourceType'] = resourceType;
46389
+ }
46390
+ if (typeof resourceId !== 'undefined') {
46391
+ apiPayload['resourceId'] = resourceId;
46392
+ }
46393
+ if (typeof name !== 'undefined') {
46394
+ apiPayload['name'] = name;
46395
+ }
46396
+ if (typeof description !== 'undefined') {
46397
+ apiPayload['description'] = description;
46398
+ }
46399
+ if (typeof priority !== 'undefined') {
46400
+ apiPayload['priority'] = priority;
46401
+ }
46402
+ if (typeof enabled !== 'undefined') {
46403
+ apiPayload['enabled'] = enabled;
46404
+ }
46405
+ if (typeof conditions !== 'undefined') {
46406
+ apiPayload['conditions'] = conditions;
46407
+ }
46408
+ const uri = new URL(this.client.config.endpoint + apiPath);
46409
+ const apiHeaders = {
46410
+ 'X-Appwrite-Project': this.client.config.project,
46411
+ 'content-type': 'application/json',
46412
+ accept: 'application/json',
46413
+ };
46414
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
46415
+ }
46416
+ createChallengeRule(paramsOrFirst, ...rest) {
46417
+ let params;
46418
+ if (paramsOrFirst &&
46419
+ typeof paramsOrFirst === 'object' &&
46420
+ !Array.isArray(paramsOrFirst)) {
46421
+ params = (paramsOrFirst || {});
46422
+ }
46423
+ else {
46424
+ params = {
46425
+ ruleId: paramsOrFirst,
46426
+ resourceType: rest[0],
46427
+ name: rest[1],
46428
+ resourceId: rest[2],
46429
+ description: rest[3],
46430
+ challengeType: rest[4],
46431
+ priority: rest[5],
46432
+ enabled: rest[6],
46433
+ conditions: rest[7],
46434
+ difficulty: rest[8],
46435
+ ttl: rest[9],
46436
+ };
46437
+ }
46438
+ const ruleId = params.ruleId;
46439
+ const resourceType = params.resourceType;
46440
+ const name = params.name;
46441
+ const resourceId = params.resourceId;
46442
+ const description = params.description;
46443
+ const challengeType = params.challengeType;
46444
+ const priority = params.priority;
46445
+ const enabled = params.enabled;
46446
+ const conditions = params.conditions;
46447
+ const difficulty = params.difficulty;
46448
+ const ttl = params.ttl;
46449
+ if (typeof ruleId === 'undefined') {
46450
+ throw new AppwriteException('Missing required parameter: "ruleId"');
46451
+ }
46452
+ if (typeof resourceType === 'undefined') {
46453
+ throw new AppwriteException('Missing required parameter: "resourceType"');
46454
+ }
46455
+ if (typeof name === 'undefined') {
46456
+ throw new AppwriteException('Missing required parameter: "name"');
46457
+ }
46458
+ const apiPath = '/waf/rules/challenge';
46459
+ const apiPayload = {};
46460
+ if (typeof ruleId !== 'undefined') {
46461
+ apiPayload['ruleId'] = ruleId;
46462
+ }
46463
+ if (typeof resourceType !== 'undefined') {
46464
+ apiPayload['resourceType'] = resourceType;
46465
+ }
46466
+ if (typeof resourceId !== 'undefined') {
46467
+ apiPayload['resourceId'] = resourceId;
46468
+ }
46469
+ if (typeof name !== 'undefined') {
46470
+ apiPayload['name'] = name;
46471
+ }
46472
+ if (typeof description !== 'undefined') {
46473
+ apiPayload['description'] = description;
46474
+ }
46475
+ if (typeof challengeType !== 'undefined') {
46476
+ apiPayload['challengeType'] = challengeType;
46477
+ }
46478
+ if (typeof priority !== 'undefined') {
46479
+ apiPayload['priority'] = priority;
46480
+ }
46481
+ if (typeof enabled !== 'undefined') {
46482
+ apiPayload['enabled'] = enabled;
46483
+ }
46484
+ if (typeof conditions !== 'undefined') {
46485
+ apiPayload['conditions'] = conditions;
46486
+ }
46487
+ if (typeof difficulty !== 'undefined') {
46488
+ apiPayload['difficulty'] = difficulty;
46489
+ }
46490
+ if (typeof ttl !== 'undefined') {
46491
+ apiPayload['ttl'] = ttl;
46492
+ }
46493
+ const uri = new URL(this.client.config.endpoint + apiPath);
46494
+ const apiHeaders = {
46495
+ 'X-Appwrite-Project': this.client.config.project,
46496
+ 'content-type': 'application/json',
46497
+ accept: 'application/json',
46498
+ };
46499
+ return this.client.call('post', uri, apiHeaders, apiPayload);
46500
+ }
46501
+ updateChallengeRule(paramsOrFirst, ...rest) {
46502
+ let params;
46503
+ if (paramsOrFirst &&
46504
+ typeof paramsOrFirst === 'object' &&
46505
+ !Array.isArray(paramsOrFirst)) {
46506
+ params = (paramsOrFirst || {});
46507
+ }
46508
+ else {
46509
+ params = {
46510
+ ruleId: paramsOrFirst,
46511
+ resourceType: rest[0],
46512
+ resourceId: rest[1],
46513
+ name: rest[2],
46514
+ description: rest[3],
46515
+ challengeType: rest[4],
46516
+ priority: rest[5],
46517
+ enabled: rest[6],
46518
+ conditions: rest[7],
46519
+ difficulty: rest[8],
46520
+ ttl: rest[9],
46521
+ };
46522
+ }
46523
+ const ruleId = params.ruleId;
46524
+ const resourceType = params.resourceType;
46525
+ const resourceId = params.resourceId;
46526
+ const name = params.name;
46527
+ const description = params.description;
46528
+ const challengeType = params.challengeType;
46529
+ const priority = params.priority;
46530
+ const enabled = params.enabled;
46531
+ const conditions = params.conditions;
46532
+ const difficulty = params.difficulty;
46533
+ const ttl = params.ttl;
46534
+ if (typeof ruleId === 'undefined' || ruleId === '') {
46535
+ throw new AppwriteException('Missing required parameter: "ruleId"');
46536
+ }
46537
+ const apiPath = '/waf/rules/challenge/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
46538
+ const apiPayload = {};
46539
+ if (typeof resourceType !== 'undefined') {
46540
+ apiPayload['resourceType'] = resourceType;
46541
+ }
46542
+ if (typeof resourceId !== 'undefined') {
46543
+ apiPayload['resourceId'] = resourceId;
46544
+ }
46545
+ if (typeof name !== 'undefined') {
46546
+ apiPayload['name'] = name;
46547
+ }
46548
+ if (typeof description !== 'undefined') {
46549
+ apiPayload['description'] = description;
46550
+ }
46551
+ if (typeof challengeType !== 'undefined') {
46552
+ apiPayload['challengeType'] = challengeType;
46553
+ }
46554
+ if (typeof priority !== 'undefined') {
46555
+ apiPayload['priority'] = priority;
46556
+ }
46557
+ if (typeof enabled !== 'undefined') {
46558
+ apiPayload['enabled'] = enabled;
46559
+ }
46560
+ if (typeof conditions !== 'undefined') {
46561
+ apiPayload['conditions'] = conditions;
46562
+ }
46563
+ if (typeof difficulty !== 'undefined') {
46564
+ apiPayload['difficulty'] = difficulty;
46565
+ }
46566
+ if (typeof ttl !== 'undefined') {
46567
+ apiPayload['ttl'] = ttl;
46568
+ }
46569
+ const uri = new URL(this.client.config.endpoint + apiPath);
46570
+ const apiHeaders = {
46571
+ 'X-Appwrite-Project': this.client.config.project,
46572
+ 'content-type': 'application/json',
46573
+ accept: 'application/json',
46574
+ };
46575
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
46576
+ }
46577
+ createDenyRule(paramsOrFirst, ...rest) {
46578
+ let params;
46579
+ if (paramsOrFirst &&
46580
+ typeof paramsOrFirst === 'object' &&
46581
+ !Array.isArray(paramsOrFirst)) {
46582
+ params = (paramsOrFirst || {});
46583
+ }
46584
+ else {
46585
+ params = {
46586
+ ruleId: paramsOrFirst,
46587
+ resourceType: rest[0],
46588
+ name: rest[1],
46589
+ resourceId: rest[2],
46590
+ description: rest[3],
46591
+ priority: rest[4],
46592
+ enabled: rest[5],
46593
+ conditions: rest[6],
46594
+ };
46595
+ }
46596
+ const ruleId = params.ruleId;
46597
+ const resourceType = params.resourceType;
46598
+ const name = params.name;
46599
+ const resourceId = params.resourceId;
46600
+ const description = params.description;
46601
+ const priority = params.priority;
46602
+ const enabled = params.enabled;
46603
+ const conditions = params.conditions;
46604
+ if (typeof ruleId === 'undefined') {
46605
+ throw new AppwriteException('Missing required parameter: "ruleId"');
46606
+ }
46607
+ if (typeof resourceType === 'undefined') {
46608
+ throw new AppwriteException('Missing required parameter: "resourceType"');
46609
+ }
46610
+ if (typeof name === 'undefined') {
46611
+ throw new AppwriteException('Missing required parameter: "name"');
46612
+ }
46613
+ const apiPath = '/waf/rules/deny';
46614
+ const apiPayload = {};
46615
+ if (typeof ruleId !== 'undefined') {
46616
+ apiPayload['ruleId'] = ruleId;
46617
+ }
46618
+ if (typeof resourceType !== 'undefined') {
46619
+ apiPayload['resourceType'] = resourceType;
46620
+ }
46621
+ if (typeof resourceId !== 'undefined') {
46622
+ apiPayload['resourceId'] = resourceId;
46623
+ }
46624
+ if (typeof name !== 'undefined') {
46625
+ apiPayload['name'] = name;
46626
+ }
46627
+ if (typeof description !== 'undefined') {
46628
+ apiPayload['description'] = description;
46629
+ }
46630
+ if (typeof priority !== 'undefined') {
46631
+ apiPayload['priority'] = priority;
46632
+ }
46633
+ if (typeof enabled !== 'undefined') {
46634
+ apiPayload['enabled'] = enabled;
46635
+ }
46636
+ if (typeof conditions !== 'undefined') {
46637
+ apiPayload['conditions'] = conditions;
46638
+ }
46639
+ const uri = new URL(this.client.config.endpoint + apiPath);
46640
+ const apiHeaders = {
46641
+ 'X-Appwrite-Project': this.client.config.project,
46642
+ 'content-type': 'application/json',
46643
+ accept: 'application/json',
46644
+ };
46645
+ return this.client.call('post', uri, apiHeaders, apiPayload);
46646
+ }
46647
+ updateDenyRule(paramsOrFirst, ...rest) {
46648
+ let params;
46649
+ if (paramsOrFirst &&
46650
+ typeof paramsOrFirst === 'object' &&
46651
+ !Array.isArray(paramsOrFirst)) {
46652
+ params = (paramsOrFirst || {});
46653
+ }
46654
+ else {
46655
+ params = {
46656
+ ruleId: paramsOrFirst,
46657
+ resourceType: rest[0],
46658
+ resourceId: rest[1],
46659
+ name: rest[2],
46660
+ description: rest[3],
46661
+ priority: rest[4],
46662
+ enabled: rest[5],
46663
+ conditions: rest[6],
46664
+ };
46665
+ }
46666
+ const ruleId = params.ruleId;
46667
+ const resourceType = params.resourceType;
46668
+ const resourceId = params.resourceId;
46669
+ const name = params.name;
46670
+ const description = params.description;
46671
+ const priority = params.priority;
46672
+ const enabled = params.enabled;
46673
+ const conditions = params.conditions;
46674
+ if (typeof ruleId === 'undefined' || ruleId === '') {
46675
+ throw new AppwriteException('Missing required parameter: "ruleId"');
46676
+ }
46677
+ const apiPath = '/waf/rules/deny/{ruleId}'.replace('{ruleId}', encodeURIComponent(String(ruleId)));
46678
+ const apiPayload = {};
46679
+ if (typeof resourceType !== 'undefined') {
46680
+ apiPayload['resourceType'] = resourceType;
46681
+ }
46682
+ if (typeof resourceId !== 'undefined') {
46683
+ apiPayload['resourceId'] = resourceId;
46684
+ }
46685
+ if (typeof name !== 'undefined') {
46686
+ apiPayload['name'] = name;
46687
+ }
46688
+ if (typeof description !== 'undefined') {
46689
+ apiPayload['description'] = description;
46690
+ }
46691
+ if (typeof priority !== 'undefined') {
46692
+ apiPayload['priority'] = priority;
46693
+ }
46694
+ if (typeof enabled !== 'undefined') {
46695
+ apiPayload['enabled'] = enabled;
46696
+ }
46697
+ if (typeof conditions !== 'undefined') {
46698
+ apiPayload['conditions'] = conditions;
46699
+ }
46700
+ const uri = new URL(this.client.config.endpoint + apiPath);
46701
+ const apiHeaders = {
46702
+ 'X-Appwrite-Project': this.client.config.project,
46703
+ 'content-type': 'application/json',
46704
+ accept: 'application/json',
46705
+ };
46706
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
46707
+ }
46708
+ createRateLimitRule(paramsOrFirst, ...rest) {
46709
+ let params;
46710
+ if (paramsOrFirst &&
46711
+ typeof paramsOrFirst === 'object' &&
46712
+ !Array.isArray(paramsOrFirst)) {
46713
+ params = (paramsOrFirst || {});
46714
+ }
46715
+ else {
46716
+ params = {
46717
+ ruleId: paramsOrFirst,
46718
+ resourceType: rest[0],
46719
+ name: rest[1],
46720
+ limit: rest[2],
46721
+ interval: rest[3],
46722
+ resourceId: rest[4],
46723
+ description: rest[5],
46724
+ key: rest[6],
46725
+ strategy: rest[7],
46726
+ maxBucketSize: rest[8],
46727
+ priority: rest[9],
46728
+ enabled: rest[10],
46729
+ conditions: rest[11],
46730
+ };
46731
+ }
46732
+ const ruleId = params.ruleId;
46733
+ const resourceType = params.resourceType;
46734
+ const name = params.name;
46735
+ const limit = params.limit;
46736
+ const interval = params.interval;
46737
+ const resourceId = params.resourceId;
46738
+ const description = params.description;
46739
+ const key = params.key;
46740
+ const strategy = params.strategy;
46741
+ const maxBucketSize = params.maxBucketSize;
46742
+ const priority = params.priority;
46743
+ const enabled = params.enabled;
46744
+ const conditions = params.conditions;
46745
+ if (typeof ruleId === 'undefined') {
46746
+ throw new AppwriteException('Missing required parameter: "ruleId"');
46747
+ }
46748
+ if (typeof resourceType === 'undefined') {
46749
+ throw new AppwriteException('Missing required parameter: "resourceType"');
46750
+ }
46751
+ if (typeof name === 'undefined') {
46752
+ throw new AppwriteException('Missing required parameter: "name"');
46753
+ }
46754
+ if (typeof limit === 'undefined') {
46755
+ throw new AppwriteException('Missing required parameter: "limit"');
46756
+ }
46757
+ if (typeof interval === 'undefined') {
46758
+ throw new AppwriteException('Missing required parameter: "interval"');
46759
+ }
46760
+ const apiPath = '/waf/rules/rate-limit';
46761
+ const apiPayload = {};
46762
+ if (typeof ruleId !== 'undefined') {
46763
+ apiPayload['ruleId'] = ruleId;
46764
+ }
46765
+ if (typeof resourceType !== 'undefined') {
46766
+ apiPayload['resourceType'] = resourceType;
46767
+ }
46768
+ if (typeof resourceId !== 'undefined') {
46769
+ apiPayload['resourceId'] = resourceId;
46770
+ }
46771
+ if (typeof name !== 'undefined') {
46772
+ apiPayload['name'] = name;
46773
+ }
46774
+ if (typeof description !== 'undefined') {
46775
+ apiPayload['description'] = description;
46776
+ }
46777
+ if (typeof limit !== 'undefined') {
46778
+ apiPayload['limit'] = limit;
46779
+ }
46780
+ if (typeof interval !== 'undefined') {
46781
+ apiPayload['interval'] = interval;
44792
46782
  }
44793
46783
  if (typeof key !== 'undefined') {
44794
46784
  apiPayload['key'] = key;
@@ -46014,9 +48004,8 @@ const RECONNECT_PERIOD_MS = 2000;
46014
48004
  * );
46015
48005
  * // sub.update({ background: true }); sub.unsubscribe();
46016
48006
  */
46017
- class Push extends Service {
48007
+ class Push {
46018
48008
  constructor(client) {
46019
- super(client);
46020
48009
  this.mqtt = null;
46021
48010
  this.connecting = null;
46022
48011
  this.Buffer = null;
@@ -46046,6 +48035,7 @@ class Push extends Service {
46046
48035
  this.connectedKey = '';
46047
48036
  this.connectionEpoch = 0;
46048
48037
  this.subscriptions = new Map();
48038
+ this.client = client;
46049
48039
  }
46050
48040
  // The broker subscription for a filter uses the highest QoS any local subscription on
46051
48041
  // it wants, so a QoS-0 subscription never downgrades a QoS-1 one sharing the filter.
@@ -46785,6 +48775,670 @@ function matches(filter, topic) {
46785
48775
  return filterParts.length === topicParts.length;
46786
48776
  }
46787
48777
 
48778
+ /**
48779
+ * Analytics auto-tracking helpers.
48780
+ *
48781
+ * These are hand-written companions to the generated `Analytics` service.
48782
+ * The generated service exposes `createEvent(params)` for arbitrary events;
48783
+ * this module wires up common auto-tracking behaviours (pageviews, outbound
48784
+ * links, downloads, scroll depth, active engagement) on top of it.
48785
+ *
48786
+ * The tracking helpers accept a plain event-emitter function so they do not
48787
+ * hard-couple to the generated `Analytics` class. The emitter adapts this
48788
+ * module's option shape to `createEvent`: `url` is required there, and `props`
48789
+ * is a flat alternating key/value list rather than an object.
48790
+ *
48791
+ * ```ts
48792
+ * const analytics = new Analytics(client);
48793
+ * const tracking = new AnalyticsTracking(
48794
+ * (name, options) => analytics.createEvent({
48795
+ * propertyId: options?.propertyId ?? '<PROPERTY_ID>',
48796
+ * name,
48797
+ * url: options?.url ?? window.location.href,
48798
+ * referrer: options?.referrer,
48799
+ * scrollDepth: options?.scrollDepth,
48800
+ * engagementTime: options?.engagementTime,
48801
+ * props: Object.entries(options?.props ?? {}).flatMap(
48802
+ * ([key, value]) => [key, String(value)],
48803
+ * ),
48804
+ * }),
48805
+ * { propertyId: '<PROPERTY_ID>' }
48806
+ * );
48807
+ * tracking.enableAllAutoTracking();
48808
+ * ```
48809
+ *
48810
+ * `propertyId` is optional: when set it is merged into the options of every
48811
+ * emitted event, so an emitter that forwards `options.propertyId` (as above)
48812
+ * picks it up instead of every caller hand-rolling it into the closure.
48813
+ * Per-event `propertyId` always wins over the configured default.
48814
+ *
48815
+ * All helpers respect `navigator.doNotTrack === '1'` by default; opt out with
48816
+ * `respectDoNotTrack: false` in the constructor options.
48817
+ *
48818
+ * Engagement time follows Plausible's model: rather than one total at unload,
48819
+ * a delta is emitted at every natural checkpoint of the visit (tab hidden, SPA
48820
+ * route change, unload). See `enableAutoEngagementTime` for details.
48821
+ *
48822
+ * Auto-emitted event names follow `snake_case` + lowercase (`pageview`,
48823
+ * `outbound_link`, `file_download`, `screen_view`, etc.). Any prop keys use
48824
+ * camelCase to match the endpoint's parameter naming. Callers can pass any
48825
+ * custom event name; the auto-track methods only own the events they emit
48826
+ * themselves.
48827
+ */
48828
+ const DEFAULT_DOWNLOAD_EXTENSIONS = [
48829
+ 'pdf',
48830
+ 'zip',
48831
+ 'rar',
48832
+ '7z',
48833
+ 'tar',
48834
+ 'gz',
48835
+ 'csv',
48836
+ 'tsv',
48837
+ 'xls',
48838
+ 'xlsx',
48839
+ 'doc',
48840
+ 'docx',
48841
+ 'ppt',
48842
+ 'pptx',
48843
+ 'dmg',
48844
+ 'exe',
48845
+ 'msi',
48846
+ 'pkg',
48847
+ 'deb',
48848
+ 'rpm',
48849
+ 'apk',
48850
+ 'mp3',
48851
+ 'wav',
48852
+ 'flac',
48853
+ 'mp4',
48854
+ 'mov',
48855
+ 'avi',
48856
+ 'mkv',
48857
+ 'webm',
48858
+ ];
48859
+ /**
48860
+ * Two-part public suffixes common enough to matter for outbound-link detection.
48861
+ * See `rootDomain()` for why this is a short list rather than the Public Suffix
48862
+ * List.
48863
+ */
48864
+ const MULTI_PART_SUFFIXES = new Set([
48865
+ 'co.uk',
48866
+ 'org.uk',
48867
+ 'ac.uk',
48868
+ 'gov.uk',
48869
+ 'me.uk',
48870
+ 'net.uk',
48871
+ 'sch.uk',
48872
+ 'co.jp',
48873
+ 'ne.jp',
48874
+ 'or.jp',
48875
+ 'ac.jp',
48876
+ 'go.jp',
48877
+ 'com.au',
48878
+ 'net.au',
48879
+ 'org.au',
48880
+ 'edu.au',
48881
+ 'gov.au',
48882
+ 'com.br',
48883
+ 'net.br',
48884
+ 'org.br',
48885
+ 'com.cn',
48886
+ 'net.cn',
48887
+ 'org.cn',
48888
+ 'gov.cn',
48889
+ 'co.in',
48890
+ 'net.in',
48891
+ 'org.in',
48892
+ 'co.nz',
48893
+ 'net.nz',
48894
+ 'org.nz',
48895
+ 'co.za',
48896
+ 'org.za',
48897
+ 'com.mx',
48898
+ 'com.ar',
48899
+ 'com.co',
48900
+ 'com.pe',
48901
+ 'com.tr',
48902
+ 'com.tw',
48903
+ 'com.sg',
48904
+ 'com.hk',
48905
+ 'com.my',
48906
+ 'com.ph',
48907
+ 'com.vn',
48908
+ 'co.kr',
48909
+ 'co.il',
48910
+ 'co.id',
48911
+ 'co.th',
48912
+ 'com.ua',
48913
+ 'com.pl',
48914
+ 'com.es',
48915
+ ]);
48916
+ const SCROLL_DEPTH_THROTTLE_MS = 200;
48917
+ class AnalyticsTracking {
48918
+ constructor(emit, options = {}) {
48919
+ this.pageviewCleanups = [];
48920
+ this.scrollCleanups = [];
48921
+ this.engagementCleanups = [];
48922
+ this.maxScrollDepth = 0;
48923
+ this.scrollTicking = false;
48924
+ this.lastScrollReport = 0;
48925
+ this.engagementStart = 0;
48926
+ this.engagementAccumulatedMs = 0;
48927
+ this.engagementActive = false;
48928
+ this.emit = emit;
48929
+ this.respectDoNotTrack = options.respectDoNotTrack !== false;
48930
+ this.propertyId = options.propertyId;
48931
+ }
48932
+ /**
48933
+ * Enable the opinionated default auto-tracking set: pageviews, outbound
48934
+ * links, scroll depth and active engagement time. Downloads must be opted
48935
+ * into separately via `enableAutoDownloadTracking()` because the extension
48936
+ * list is application-specific.
48937
+ */
48938
+ enableAllAutoTracking() {
48939
+ this.enableAutoPageviews();
48940
+ this.enableAutoOutboundTracking();
48941
+ this.enableAutoScrollDepth();
48942
+ this.enableAutoEngagementTime();
48943
+ }
48944
+ /**
48945
+ * Track an event manually. Respects the DNT setting and swallows emitter
48946
+ * exceptions so tracking failures never surface to the host page.
48947
+ */
48948
+ track(name, options) {
48949
+ if (!this.canTrack()) {
48950
+ return;
48951
+ }
48952
+ try {
48953
+ this.emit(name, this.withPropertyId(options));
48954
+ }
48955
+ catch (error) {
48956
+ console.warn('AnalyticsTracking: emitter threw', error);
48957
+ }
48958
+ }
48959
+ /**
48960
+ * Convenience wrapper for pageview-shaped events.
48961
+ */
48962
+ pageview(url, referrer) {
48963
+ this.track('pageview', {
48964
+ url: url !== null && url !== void 0 ? url : this.currentPageUrl(),
48965
+ referrer: referrer !== null && referrer !== void 0 ? referrer : (typeof document !== 'undefined'
48966
+ ? document.referrer
48967
+ : undefined),
48968
+ });
48969
+ }
48970
+ /**
48971
+ * Enable SPA-aware pageview tracking. Fires an initial pageview on
48972
+ * enable, then again on every `pushState`, `replaceState`, `popstate`
48973
+ * or hashchange. Idempotent — repeat calls no-op.
48974
+ */
48975
+ enableAutoPageviews() {
48976
+ if (this.pageviewCleanups.length > 0) {
48977
+ return;
48978
+ }
48979
+ if (typeof window === 'undefined' || typeof history === 'undefined') {
48980
+ return;
48981
+ }
48982
+ this.currentPath = this.currentPageUrl();
48983
+ this.pageview();
48984
+ const handleNavigation = () => {
48985
+ const nextPath = this.currentPageUrl();
48986
+ if (nextPath === this.currentPath) {
48987
+ return;
48988
+ }
48989
+ const previous = this.currentPath;
48990
+ this.currentPath = nextPath;
48991
+ this.flushScrollDepth(previous);
48992
+ this.flushEngagement(previous);
48993
+ this.pageview(nextPath);
48994
+ // flushEngagement no longer auto-restarts the timer (see its
48995
+ // implementation note re: bfcache). SPA navigation stays on the
48996
+ // same document, so restart engagement tracking for the new
48997
+ // route as long as the tab is visible.
48998
+ if (this.engagementCleanups.length > 0 &&
48999
+ (typeof document === 'undefined' ||
49000
+ document.visibilityState !== 'hidden')) {
49001
+ this.startEngagement();
49002
+ }
49003
+ };
49004
+ const originalPushState = history.pushState.bind(history);
49005
+ const originalReplaceState = history.replaceState.bind(history);
49006
+ // Our wrappers stay reachable after cleanup whenever another library
49007
+ // patched on top of ours, so they have to be switchable off rather than
49008
+ // merely unreferenced.
49009
+ let patchActive = true;
49010
+ const patchedPushState = (data, unused, url) => {
49011
+ originalPushState(data, unused, url);
49012
+ if (patchActive) {
49013
+ handleNavigation();
49014
+ }
49015
+ };
49016
+ const patchedReplaceState = (data, unused, url) => {
49017
+ originalReplaceState(data, unused, url);
49018
+ if (patchActive) {
49019
+ handleNavigation();
49020
+ }
49021
+ };
49022
+ history.pushState = patchedPushState;
49023
+ history.replaceState = patchedReplaceState;
49024
+ const popstateHandler = () => handleNavigation();
49025
+ const hashchangeHandler = () => handleNavigation();
49026
+ window.addEventListener('popstate', popstateHandler);
49027
+ window.addEventListener('hashchange', hashchangeHandler);
49028
+ this.pageviewCleanups.push(() => {
49029
+ // Only unwind our own patch. A router (Next.js App Router, React
49030
+ // Router, …) that patched these after us owns the current value,
49031
+ // and assigning our saved reference back would silently throw its
49032
+ // wrapper away. In that case ours stays in the chain, which is why
49033
+ // `patchActive` exists: the wrapper keeps delegating to the original
49034
+ // but stops reporting.
49035
+ patchActive = false;
49036
+ if (history.pushState === patchedPushState) {
49037
+ history.pushState = originalPushState;
49038
+ }
49039
+ if (history.replaceState === patchedReplaceState) {
49040
+ history.replaceState = originalReplaceState;
49041
+ }
49042
+ window.removeEventListener('popstate', popstateHandler);
49043
+ window.removeEventListener('hashchange', hashchangeHandler);
49044
+ });
49045
+ }
49046
+ /**
49047
+ * Disable auto-pageview tracking installed by `enableAutoPageviews`.
49048
+ * Safe to call when auto-pageviews were never enabled.
49049
+ */
49050
+ disableAutoPageviews() {
49051
+ for (const cleanup of this.pageviewCleanups) {
49052
+ cleanup();
49053
+ }
49054
+ this.pageviewCleanups = [];
49055
+ }
49056
+ /**
49057
+ * Enable click-based outbound link tracking. Detects anchor clicks that
49058
+ * navigate to a different origin and fires an `outbound_link` event
49059
+ * (with `hostname` and `href` props) before the browser navigates.
49060
+ */
49061
+ enableAutoOutboundTracking(options = {}) {
49062
+ if (this.outboundCleanup) {
49063
+ return;
49064
+ }
49065
+ if (typeof document === 'undefined') {
49066
+ return;
49067
+ }
49068
+ const includeSubdomains = options.includeSubdomains === true;
49069
+ const clickHandler = (event) => {
49070
+ const anchor = this.findAnchor(event.target);
49071
+ if (!anchor || !anchor.href) {
49072
+ return;
49073
+ }
49074
+ const target = this.parseUrl(anchor.href);
49075
+ if (!target || !this.isExternal(target, includeSubdomains)) {
49076
+ return;
49077
+ }
49078
+ this.track('outbound_link', {
49079
+ url: target.href,
49080
+ props: { hostname: target.hostname, href: target.href },
49081
+ });
49082
+ };
49083
+ document.addEventListener('click', clickHandler, { capture: true });
49084
+ this.outboundCleanup = () => document.removeEventListener('click', clickHandler, {
49085
+ capture: true,
49086
+ });
49087
+ }
49088
+ /**
49089
+ * Disable outbound-link tracking installed by `enableAutoOutboundTracking`.
49090
+ * Safe to call when auto-outbound was never enabled.
49091
+ */
49092
+ disableAutoOutboundTracking() {
49093
+ if (this.outboundCleanup) {
49094
+ this.outboundCleanup();
49095
+ this.outboundCleanup = undefined;
49096
+ }
49097
+ }
49098
+ /**
49099
+ * Enable click-based download tracking. Detects anchor clicks that point
49100
+ * at a file whose extension appears in the configured list and fires a
49101
+ * `file_download` event with `filename`, `extension` and `href` props.
49102
+ */
49103
+ enableAutoDownloadTracking(options = {}) {
49104
+ var _a;
49105
+ if (this.downloadCleanup) {
49106
+ return;
49107
+ }
49108
+ if (typeof document === 'undefined') {
49109
+ return;
49110
+ }
49111
+ const extensions = ((_a = options.extensions) !== null && _a !== void 0 ? _a : DEFAULT_DOWNLOAD_EXTENSIONS).map((ext) => ext.toLowerCase().replace(/^\./, ''));
49112
+ const extensionSet = new Set(extensions);
49113
+ const clickHandler = (event) => {
49114
+ var _a, _b;
49115
+ const anchor = this.findAnchor(event.target);
49116
+ if (!anchor || !anchor.href) {
49117
+ return;
49118
+ }
49119
+ const url = this.parseUrl(anchor.href);
49120
+ if (!url) {
49121
+ return;
49122
+ }
49123
+ const filename = (_a = url.pathname.split('/').pop()) !== null && _a !== void 0 ? _a : '';
49124
+ const extension = filename.includes('.')
49125
+ ? (_b = filename.split('.').pop()) === null || _b === void 0 ? void 0 : _b.toLowerCase()
49126
+ : undefined;
49127
+ if (!extension || !extensionSet.has(extension)) {
49128
+ return;
49129
+ }
49130
+ this.track('file_download', {
49131
+ url: url.href,
49132
+ props: { filename, extension, href: url.href },
49133
+ });
49134
+ };
49135
+ document.addEventListener('click', clickHandler, { capture: true });
49136
+ this.downloadCleanup = () => document.removeEventListener('click', clickHandler, {
49137
+ capture: true,
49138
+ });
49139
+ }
49140
+ /**
49141
+ * Disable file-download tracking installed by `enableAutoDownloadTracking`.
49142
+ * Safe to call when auto-download was never enabled.
49143
+ */
49144
+ disableAutoDownloadTracking() {
49145
+ if (this.downloadCleanup) {
49146
+ this.downloadCleanup();
49147
+ this.downloadCleanup = undefined;
49148
+ }
49149
+ }
49150
+ /**
49151
+ * Enable passive scroll-depth tracking. Records the maximum percent of the
49152
+ * document scrolled and reports it on `beforeunload` and on SPA route
49153
+ * changes. Uses a throttled passive listener so it is safe on hot paths.
49154
+ */
49155
+ enableAutoScrollDepth() {
49156
+ if (this.scrollCleanups.length > 0) {
49157
+ return;
49158
+ }
49159
+ if (typeof window === 'undefined' || typeof document === 'undefined') {
49160
+ return;
49161
+ }
49162
+ this.maxScrollDepth = 0;
49163
+ this.lastScrollReport = 0;
49164
+ const scrollHandler = () => {
49165
+ if (this.scrollTicking) {
49166
+ return;
49167
+ }
49168
+ this.scrollTicking = true;
49169
+ window.requestAnimationFrame(() => {
49170
+ const now = Date.now();
49171
+ if (now - this.lastScrollReport < SCROLL_DEPTH_THROTTLE_MS) {
49172
+ this.scrollTicking = false;
49173
+ return;
49174
+ }
49175
+ this.lastScrollReport = now;
49176
+ const depth = this.computeScrollDepth();
49177
+ if (depth > this.maxScrollDepth) {
49178
+ this.maxScrollDepth = depth;
49179
+ }
49180
+ this.scrollTicking = false;
49181
+ });
49182
+ };
49183
+ const unloadHandler = () => {
49184
+ this.flushScrollDepth(this.currentPageUrl());
49185
+ };
49186
+ window.addEventListener('scroll', scrollHandler, { passive: true });
49187
+ window.addEventListener('beforeunload', unloadHandler);
49188
+ window.addEventListener('pagehide', unloadHandler);
49189
+ this.scrollCleanups.push(() => {
49190
+ window.removeEventListener('scroll', scrollHandler);
49191
+ window.removeEventListener('beforeunload', unloadHandler);
49192
+ window.removeEventListener('pagehide', unloadHandler);
49193
+ });
49194
+ }
49195
+ /**
49196
+ * Disable scroll-depth tracking installed by `enableAutoScrollDepth`. Safe
49197
+ * to call when auto-scroll-depth was never enabled. Any accumulated depth
49198
+ * for the current page is dropped.
49199
+ */
49200
+ disableAutoScrollDepth() {
49201
+ for (const cleanup of this.scrollCleanups) {
49202
+ cleanup();
49203
+ }
49204
+ this.scrollCleanups = [];
49205
+ this.maxScrollDepth = 0;
49206
+ this.scrollTicking = false;
49207
+ this.lastScrollReport = 0;
49208
+ }
49209
+ /**
49210
+ * Enable active engagement-time tracking. Counts time the tab is visible
49211
+ * and uses `visibilitychange` to exclude background time.
49212
+ *
49213
+ * Delivery follows Plausible's model rather than a single total at the
49214
+ * end of the visit: an `engagement_time` event is emitted at every natural
49215
+ * checkpoint — the tab going hidden, an SPA route change, and finally
49216
+ * `beforeunload`/`pagehide`. Unload is kept only as a best-effort last
49217
+ * flush; it is the least reliable moment to send anything (browsers
49218
+ * routinely cancel in-flight requests there, and `sendBeacon` cannot set
49219
+ * the `X-Appwrite-Project` header the endpoint requires), so it must never
49220
+ * be the only delivery.
49221
+ *
49222
+ * Each event carries a **delta** — the seconds accrued since the previous
49223
+ * flush, not a running total — so the values are additive per session and
49224
+ * a lost event costs only its own slice.
49225
+ *
49226
+ * There is deliberately no periodic ping. The cadence is driven by
49227
+ * navigation and tab switches, so request volume tracks what the visitor
49228
+ * actually does instead of multiplying with time on page.
49229
+ */
49230
+ enableAutoEngagementTime() {
49231
+ if (this.engagementCleanups.length > 0) {
49232
+ return;
49233
+ }
49234
+ if (typeof window === 'undefined' || typeof document === 'undefined') {
49235
+ return;
49236
+ }
49237
+ this.engagementAccumulatedMs = 0;
49238
+ // Do not start the clock for a tab that is already hidden (prerender,
49239
+ // background tab restore); `visibilitychange` starts it when it is
49240
+ // actually looked at.
49241
+ if (document.visibilityState !== 'hidden') {
49242
+ this.startEngagement();
49243
+ }
49244
+ const visibilityHandler = () => {
49245
+ if (document.visibilityState === 'hidden') {
49246
+ // Flush, don't just pause. The page is still fully alive here,
49247
+ // which makes this the most reliable delivery point in the
49248
+ // whole visit — and it is the same moment Plausible reports on.
49249
+ this.flushEngagement(this.currentPageUrl());
49250
+ }
49251
+ else if (document.visibilityState === 'visible') {
49252
+ this.startEngagement();
49253
+ }
49254
+ };
49255
+ const unloadHandler = () => {
49256
+ this.flushEngagement(this.currentPageUrl());
49257
+ };
49258
+ const pageshowHandler = (event) => {
49259
+ // When the page is restored from the back-forward cache the
49260
+ // engagement timer is in a stopped state (flushEngagement paused
49261
+ // it on pagehide and does not auto-restart). Kick off a fresh
49262
+ // engagementStart so bfcache dwell time is not billed as
49263
+ // engagement.
49264
+ if (event.persisted) {
49265
+ this.startEngagement();
49266
+ }
49267
+ };
49268
+ document.addEventListener('visibilitychange', visibilityHandler);
49269
+ window.addEventListener('beforeunload', unloadHandler);
49270
+ window.addEventListener('pagehide', unloadHandler);
49271
+ window.addEventListener('pageshow', pageshowHandler);
49272
+ this.engagementCleanups.push(() => {
49273
+ document.removeEventListener('visibilitychange', visibilityHandler);
49274
+ window.removeEventListener('beforeunload', unloadHandler);
49275
+ window.removeEventListener('pagehide', unloadHandler);
49276
+ window.removeEventListener('pageshow', pageshowHandler);
49277
+ });
49278
+ }
49279
+ /**
49280
+ * Disable engagement-time tracking installed by `enableAutoEngagementTime`.
49281
+ * Safe to call when auto-engagement was never enabled. Any accumulated
49282
+ * engagement time is dropped without being emitted.
49283
+ */
49284
+ disableAutoEngagementTime() {
49285
+ for (const cleanup of this.engagementCleanups) {
49286
+ cleanup();
49287
+ }
49288
+ this.engagementCleanups = [];
49289
+ this.engagementActive = false;
49290
+ this.engagementAccumulatedMs = 0;
49291
+ this.engagementStart = 0;
49292
+ }
49293
+ /**
49294
+ * Merge the configured `propertyId` into an event's options. Returns the
49295
+ * caller's object untouched when no default is configured (or the event
49296
+ * already carries one), so emitters written against the pre-`propertyId`
49297
+ * shape keep receiving exactly what they received before.
49298
+ */
49299
+ withPropertyId(options) {
49300
+ if (this.propertyId === undefined ||
49301
+ (options === null || options === void 0 ? void 0 : options.propertyId) !== undefined) {
49302
+ return options;
49303
+ }
49304
+ return Object.assign(Object.assign({}, (options !== null && options !== void 0 ? options : {})), { propertyId: this.propertyId });
49305
+ }
49306
+ canTrack() {
49307
+ if (!this.respectDoNotTrack) {
49308
+ return true;
49309
+ }
49310
+ if (typeof navigator === 'undefined') {
49311
+ return true;
49312
+ }
49313
+ return navigator.doNotTrack !== '1';
49314
+ }
49315
+ currentPageUrl() {
49316
+ if (typeof window === 'undefined' || !window.location) {
49317
+ return '';
49318
+ }
49319
+ return window.location.href;
49320
+ }
49321
+ findAnchor(target) {
49322
+ let node = target;
49323
+ while (node) {
49324
+ if (node.tagName === 'A') {
49325
+ return node;
49326
+ }
49327
+ node = node.parentNode;
49328
+ }
49329
+ return null;
49330
+ }
49331
+ parseUrl(href) {
49332
+ try {
49333
+ return new URL(href, window.location.href);
49334
+ }
49335
+ catch (_a) {
49336
+ return null;
49337
+ }
49338
+ }
49339
+ isExternal(target, includeSubdomains) {
49340
+ if (target.protocol !== 'http:' && target.protocol !== 'https:') {
49341
+ return false;
49342
+ }
49343
+ if (target.hostname === window.location.hostname) {
49344
+ return false;
49345
+ }
49346
+ if (includeSubdomains) {
49347
+ return true;
49348
+ }
49349
+ const root = this.rootDomain(window.location.hostname);
49350
+ return this.rootDomain(target.hostname) !== root;
49351
+ }
49352
+ rootDomain(hostname) {
49353
+ const parts = hostname.split('.');
49354
+ if (parts.length <= 2) {
49355
+ return hostname;
49356
+ }
49357
+ // Taking the last two labels is wrong wherever the registry sells names
49358
+ // one level down: `shop.example.co.uk` and `google.co.uk` both reduce to
49359
+ // `co.uk`, so every outbound click between two `.co.uk` sites looks
49360
+ // internal and is dropped. Take three labels after a known two-part
49361
+ // suffix instead.
49362
+ //
49363
+ // This is a heuristic, not the Public Suffix List — the full list is
49364
+ // orders of magnitude larger than this whole file, and a tracking
49365
+ // snippet cannot carry it. Sites on a suffix that is missing here can
49366
+ // pass `includeSubdomains: true` to treat every other host as outbound.
49367
+ const suffix = parts.slice(-2).join('.');
49368
+ if (parts.length > 2 && MULTI_PART_SUFFIXES.has(suffix)) {
49369
+ return parts.slice(-3).join('.');
49370
+ }
49371
+ return suffix;
49372
+ }
49373
+ computeScrollDepth() {
49374
+ const scrollTop = window.scrollY || document.documentElement.scrollTop;
49375
+ const viewport = window.innerHeight || document.documentElement.clientHeight;
49376
+ const total = document.documentElement.scrollHeight;
49377
+ if (total <= viewport) {
49378
+ return 100;
49379
+ }
49380
+ const depth = Math.round(((scrollTop + viewport) / total) * 100);
49381
+ return Math.max(0, Math.min(100, depth));
49382
+ }
49383
+ flushScrollDepth(url) {
49384
+ if (this.scrollCleanups.length === 0) {
49385
+ return;
49386
+ }
49387
+ if (this.maxScrollDepth <= 0) {
49388
+ return;
49389
+ }
49390
+ this.track('scroll_depth', {
49391
+ url,
49392
+ scrollDepth: this.maxScrollDepth,
49393
+ });
49394
+ this.maxScrollDepth = 0;
49395
+ }
49396
+ startEngagement() {
49397
+ if (this.engagementActive) {
49398
+ return;
49399
+ }
49400
+ this.engagementActive = true;
49401
+ this.engagementStart = Date.now();
49402
+ }
49403
+ pauseEngagement() {
49404
+ if (!this.engagementActive) {
49405
+ return;
49406
+ }
49407
+ this.engagementActive = false;
49408
+ this.engagementAccumulatedMs += Date.now() - this.engagementStart;
49409
+ }
49410
+ flushEngagement(url) {
49411
+ if (this.engagementCleanups.length === 0) {
49412
+ return;
49413
+ }
49414
+ this.pauseEngagement();
49415
+ // Deltas, not a running total: emit only what accrued since the last
49416
+ // flush. `floor` plus keeping the sub-second remainder in the
49417
+ // accumulator is what makes repeated flushes safe — nothing is emitted
49418
+ // twice, and a visit chopped into many short segments does not lose a
49419
+ // fraction of a second to rounding on every one of them.
49420
+ const seconds = Math.floor(this.engagementAccumulatedMs / 1000);
49421
+ if (seconds > 0) {
49422
+ // Deduct before emitting so a synchronous emitter that re-enters
49423
+ // (or throws) can never bill the same seconds again.
49424
+ this.engagementAccumulatedMs -= seconds * 1000;
49425
+ this.track('engagement_time', {
49426
+ url,
49427
+ engagementTime: seconds,
49428
+ });
49429
+ }
49430
+ // NOTE: intentionally do NOT call startEngagement() here. flushEngagement
49431
+ // runs on `pagehide`, which is also the last hook before the browser
49432
+ // may freeze the page into the back-forward cache. Auto-restarting
49433
+ // would snapshot engagementStart just before the freeze; the next
49434
+ // pauseEngagement (after bfcache restore) would then bill the entire
49435
+ // bfcache dwell as active engagement. Restart is driven by explicit
49436
+ // resume signals: `pageshow` (with `persisted === true`),
49437
+ // `visibilitychange` back to visible, or the SPA navigation flow in
49438
+ // `enableAutoPageviews`.
49439
+ }
49440
+ }
49441
+
46788
49442
  /**
46789
49443
  * Helper class to generate permission strings for resources.
46790
49444
  */
@@ -47491,6 +50145,68 @@ exports.OAuthProvider = void 0;
47491
50145
  OAuthProvider["Zoom"] = "zoom";
47492
50146
  })(exports.OAuthProvider || (exports.OAuthProvider = {}));
47493
50147
 
50148
+ exports.PlatformResourceType = void 0;
50149
+ (function (PlatformResourceType) {
50150
+ PlatformResourceType["Projects"] = "projects";
50151
+ PlatformResourceType["Organizations"] = "organizations";
50152
+ PlatformResourceType["Users"] = "users";
50153
+ PlatformResourceType["Memberships"] = "memberships";
50154
+ PlatformResourceType["Rules"] = "rules";
50155
+ PlatformResourceType["Keys"] = "keys";
50156
+ PlatformResourceType["Platforms"] = "platforms";
50157
+ PlatformResourceType["Webhooks"] = "webhooks";
50158
+ PlatformResourceType["Certificates"] = "certificates";
50159
+ })(exports.PlatformResourceType || (exports.PlatformResourceType = {}));
50160
+
50161
+ exports.ProjectResourceType = void 0;
50162
+ (function (ProjectResourceType) {
50163
+ ProjectResourceType["Users"] = "users";
50164
+ ProjectResourceType["Teams"] = "teams";
50165
+ ProjectResourceType["Memberships"] = "memberships";
50166
+ ProjectResourceType["Databases"] = "databases";
50167
+ ProjectResourceType["Buckets"] = "buckets";
50168
+ ProjectResourceType["Functions"] = "functions";
50169
+ ProjectResourceType["Sites"] = "sites";
50170
+ ProjectResourceType["Deployments"] = "deployments";
50171
+ ProjectResourceType["Topics"] = "topics";
50172
+ ProjectResourceType["Providers"] = "providers";
50173
+ ProjectResourceType["Messages"] = "messages";
50174
+ })(exports.ProjectResourceType || (exports.ProjectResourceType = {}));
50175
+
50176
+ exports.AnalyticsInterval = void 0;
50177
+ (function (AnalyticsInterval) {
50178
+ AnalyticsInterval["OneHour"] = "1h";
50179
+ AnalyticsInterval["OneDay"] = "1d";
50180
+ AnalyticsInterval["OneWeek"] = "1w";
50181
+ AnalyticsInterval["OneMonth"] = "1m";
50182
+ })(exports.AnalyticsInterval || (exports.AnalyticsInterval = {}));
50183
+
50184
+ exports.AnalyticsDimension = void 0;
50185
+ (function (AnalyticsDimension) {
50186
+ AnalyticsDimension["Country"] = "country";
50187
+ AnalyticsDimension["Region"] = "region";
50188
+ AnalyticsDimension["City"] = "city";
50189
+ AnalyticsDimension["Browser"] = "browser";
50190
+ AnalyticsDimension["OperatingSystem"] = "operatingSystem";
50191
+ AnalyticsDimension["Device"] = "device";
50192
+ AnalyticsDimension["ScreenSize"] = "screenSize";
50193
+ AnalyticsDimension["ReferrerSource"] = "referrerSource";
50194
+ AnalyticsDimension["Channel"] = "channel";
50195
+ AnalyticsDimension["UtmSource"] = "utmSource";
50196
+ AnalyticsDimension["UtmMedium"] = "utmMedium";
50197
+ AnalyticsDimension["UtmCampaign"] = "utmCampaign";
50198
+ AnalyticsDimension["UtmContent"] = "utmContent";
50199
+ AnalyticsDimension["UtmTerm"] = "utmTerm";
50200
+ AnalyticsDimension["Page"] = "page";
50201
+ AnalyticsDimension["Hostname"] = "hostname";
50202
+ AnalyticsDimension["EntryPage"] = "entryPage";
50203
+ AnalyticsDimension["ExitPage"] = "exitPage";
50204
+ AnalyticsDimension["TrafficType"] = "trafficType";
50205
+ AnalyticsDimension["BotName"] = "botName";
50206
+ AnalyticsDimension["BotCategory"] = "botCategory";
50207
+ AnalyticsDimension["EventName"] = "eventName";
50208
+ })(exports.AnalyticsDimension || (exports.AnalyticsDimension = {}));
50209
+
47494
50210
  exports.Browser = void 0;
47495
50211
  (function (Browser) {
47496
50212
  Browser["AvantBrowser"] = "aa";
@@ -48306,6 +51022,14 @@ exports.QuerySuggestionResource = void 0;
48306
51022
  QuerySuggestionResource["ResourceTokens"] = "resourcetokens";
48307
51023
  QuerySuggestionResource["Transactions"] = "transactions";
48308
51024
  QuerySuggestionResource["TransactionLogs"] = "transactionlogs";
51025
+ QuerySuggestionResource["Videos"] = "videos";
51026
+ QuerySuggestionResource["VideosPreviews"] = "videos_previews";
51027
+ QuerySuggestionResource["VideosRenditions"] = "videos_renditions";
51028
+ QuerySuggestionResource["VideosRenditionsSegments"] = "videos_renditions_segments";
51029
+ QuerySuggestionResource["VideosProfiles"] = "videos_profiles";
51030
+ QuerySuggestionResource["VideosSubtitles"] = "videos_subtitles";
51031
+ QuerySuggestionResource["VideosSubtitlesSegments"] = "videos_subtitles_segments";
51032
+ QuerySuggestionResource["AnalyticsProperties"] = "analyticsproperties";
48309
51033
  QuerySuggestionResource["DedicatedDatabases"] = "dedicateddatabases";
48310
51034
  QuerySuggestionResource["DedicatedDatabaseConfigs"] = "dedicateddatabaseconfigs";
48311
51035
  QuerySuggestionResource["DedicatedDatabaseRuntimes"] = "dedicateddatabaseruntimes";
@@ -48728,6 +51452,8 @@ exports.ProjectKeyScopes = void 0;
48728
51452
  ProjectKeyScopes["ReportsWrite"] = "reports.write";
48729
51453
  ProjectKeyScopes["PresencesRead"] = "presences.read";
48730
51454
  ProjectKeyScopes["PresencesWrite"] = "presences.write";
51455
+ ProjectKeyScopes["VideosRead"] = "videos.read";
51456
+ ProjectKeyScopes["VideosWrite"] = "videos.write";
48731
51457
  ProjectKeyScopes["DedicatedDatabasesExecute"] = "dedicatedDatabases.execute";
48732
51458
  ProjectKeyScopes["BackupsPoliciesRead"] = "backups.policies.read";
48733
51459
  ProjectKeyScopes["BackupsPoliciesWrite"] = "backups.policies.write";
@@ -48746,6 +51472,8 @@ exports.ProjectKeyScopes = void 0;
48746
51472
  ProjectKeyScopes["Oauth2Read"] = "oauth2.read";
48747
51473
  ProjectKeyScopes["Oauth2Write"] = "oauth2.write";
48748
51474
  ProjectKeyScopes["Oauth2Introspect"] = "oauth2.introspect";
51475
+ ProjectKeyScopes["AnalyticsRead"] = "analytics.read";
51476
+ ProjectKeyScopes["AnalyticsWrite"] = "analytics.write";
48749
51477
  })(exports.ProjectKeyScopes || (exports.ProjectKeyScopes = {}));
48750
51478
 
48751
51479
  exports.FunctionTemplateUseCase = void 0;
@@ -48995,6 +51723,7 @@ exports.ProjectAuthMethodId = void 0;
48995
51723
  ProjectAuthMethodId["Invites"] = "invites";
48996
51724
  ProjectAuthMethodId["Jwt"] = "jwt";
48997
51725
  ProjectAuthMethodId["Phone"] = "phone";
51726
+ ProjectAuthMethodId["Passkey"] = "passkey";
48998
51727
  })(exports.ProjectAuthMethodId || (exports.ProjectAuthMethodId = {}));
48999
51728
 
49000
51729
  exports.ProjectOAuth2Auth0Prompt = void 0;
@@ -49136,6 +51865,7 @@ exports.ProjectPolicyId = void 0;
49136
51865
  ProjectPolicyId["Denydisposableemail"] = "deny-disposable-email";
49137
51866
  ProjectPolicyId["Denyfreeemail"] = "deny-free-email";
49138
51867
  ProjectPolicyId["Denycorporateemail"] = "deny-corporate-email";
51868
+ ProjectPolicyId["Passkey"] = "passkey";
49139
51869
  })(exports.ProjectPolicyId || (exports.ProjectPolicyId = {}));
49140
51870
 
49141
51871
  exports.ProjectProtocolId = void 0;
@@ -49380,6 +52110,9 @@ exports.TablesDBIndexType = void 0;
49380
52110
 
49381
52111
  exports.UsageEventMetric = void 0;
49382
52112
  (function (UsageEventMetric) {
52113
+ UsageEventMetric["AnalyticsEvents"] = "analytics.events";
52114
+ UsageEventMetric["AnalyticsPageviews"] = "analytics.pageviews";
52115
+ UsageEventMetric["AnalyticsBotsEvents"] = "analytics.bots.events";
49383
52116
  UsageEventMetric["NetworkRequests"] = "network.requests";
49384
52117
  UsageEventMetric["NetworkInbound"] = "network.inbound";
49385
52118
  UsageEventMetric["NetworkOutbound"] = "network.outbound";
@@ -49497,6 +52230,7 @@ exports.UsageOrderDirection = void 0;
49497
52230
 
49498
52231
  exports.UsageGaugeMetric = void 0;
49499
52232
  (function (UsageGaugeMetric) {
52233
+ UsageGaugeMetric["AnalyticsProperties"] = "analytics.properties";
49500
52234
  UsageGaugeMetric["Teams"] = "teams";
49501
52235
  UsageGaugeMetric["Users"] = "users";
49502
52236
  UsageGaugeMetric["Messages"] = "messages";
@@ -49594,6 +52328,24 @@ exports.VectorsDBIndexType = void 0;
49594
52328
  VectorsDBIndexType["Unique"] = "unique";
49595
52329
  })(exports.VectorsDBIndexType || (exports.VectorsDBIndexType = {}));
49596
52330
 
52331
+ exports.VideoOutput = void 0;
52332
+ (function (VideoOutput) {
52333
+ VideoOutput["Hls"] = "hls";
52334
+ VideoOutput["Dash"] = "dash";
52335
+ VideoOutput["Cmaf"] = "cmaf";
52336
+ })(exports.VideoOutput || (exports.VideoOutput = {}));
52337
+
52338
+ exports.VideoRenditionStatus = void 0;
52339
+ (function (VideoRenditionStatus) {
52340
+ VideoRenditionStatus["Pending"] = "pending";
52341
+ VideoRenditionStatus["Started"] = "started";
52342
+ VideoRenditionStatus["Ended"] = "ended";
52343
+ VideoRenditionStatus["Uploading"] = "uploading";
52344
+ VideoRenditionStatus["Ready"] = "ready";
52345
+ VideoRenditionStatus["Error"] = "error";
52346
+ VideoRenditionStatus["Aborted"] = "aborted";
52347
+ })(exports.VideoRenditionStatus || (exports.VideoRenditionStatus = {}));
52348
+
49597
52349
  exports.DatabaseType = void 0;
49598
52350
  (function (DatabaseType) {
49599
52351
  DatabaseType["Legacy"] = "legacy";
@@ -49772,6 +52524,7 @@ exports.ProxyRuleDeploymentResourceType = void 0;
49772
52524
  (function (ProxyRuleDeploymentResourceType) {
49773
52525
  ProxyRuleDeploymentResourceType["Function"] = "function";
49774
52526
  ProxyRuleDeploymentResourceType["Site"] = "site";
52527
+ ProxyRuleDeploymentResourceType["DedicatedDatabase"] = "dedicatedDatabase";
49775
52528
  })(exports.ProxyRuleDeploymentResourceType || (exports.ProxyRuleDeploymentResourceType = {}));
49776
52529
 
49777
52530
  exports.ProxyRuleStatus = void 0;
@@ -49829,8 +52582,11 @@ exports.WafRuleAction = void 0;
49829
52582
 
49830
52583
  exports.Account = Account;
49831
52584
  exports.Activities = Activities;
52585
+ exports.Admin = Admin;
49832
52586
  exports.Advisor = Advisor;
49833
52587
  exports.Affiliates = Affiliates;
52588
+ exports.Analytics = Analytics;
52589
+ exports.AnalyticsTracking = AnalyticsTracking;
49834
52590
  exports.Apps = Apps;
49835
52591
  exports.AppwriteException = AppwriteException;
49836
52592
  exports.Assistant = Assistant;
@@ -49879,6 +52635,7 @@ exports.Usage = Usage;
49879
52635
  exports.Users = Users;
49880
52636
  exports.Vcs = Vcs;
49881
52637
  exports.VectorsDB = VectorsDB;
52638
+ exports.Videos = Videos;
49882
52639
  exports.Waf = Waf;
49883
52640
  exports.Webhooks = Webhooks;
49884
52641
  //# sourceMappingURL=sdk.js.map