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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/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-rc.1',
672
+ 'x-sdk-version': '18.3.0-rc.2',
673
673
  'X-Appwrite-Response-Format': '2.3.0',
674
674
  };
675
675
  this.realtime = {
@@ -2840,6 +2840,196 @@ class Account {
2840
2840
  };
2841
2841
  return this.client.call('patch', uri, apiHeaders, apiPayload);
2842
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
+ }
2843
3033
  updatePassword(paramsOrFirst, ...rest) {
2844
3034
  let params;
2845
3035
  if (paramsOrFirst &&
@@ -4003,6 +4193,60 @@ class Account {
4003
4193
  return uri.toString();
4004
4194
  }
4005
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
+ }
4006
4250
  createPhoneToken(paramsOrFirst, ...rest) {
4007
4251
  let params;
4008
4252
  if (paramsOrFirst &&
@@ -4349,6 +4593,135 @@ class Activities {
4349
4593
  }
4350
4594
  }
4351
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
+
4352
4725
  class Affiliates {
4353
4726
  constructor(client) {
4354
4727
  this.client = client;
@@ -32113,6 +32486,38 @@ class Project {
32113
32486
  };
32114
32487
  return this.client.call('patch', uri, apiHeaders, apiPayload);
32115
32488
  }
32489
+ updatePasskeyPolicy(paramsOrFirst, ...rest) {
32490
+ let params;
32491
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
32492
+ (paramsOrFirst &&
32493
+ typeof paramsOrFirst === 'object' &&
32494
+ !Array.isArray(paramsOrFirst))) {
32495
+ params = (paramsOrFirst || {});
32496
+ }
32497
+ else {
32498
+ params = {
32499
+ rpId: paramsOrFirst,
32500
+ origins: rest[0],
32501
+ };
32502
+ }
32503
+ const rpId = params.rpId;
32504
+ const origins = params.origins;
32505
+ const apiPath = '/project/policies/passkey';
32506
+ const apiPayload = {};
32507
+ if (typeof rpId !== 'undefined') {
32508
+ apiPayload['rpId'] = rpId;
32509
+ }
32510
+ if (typeof origins !== 'undefined') {
32511
+ apiPayload['origins'] = origins;
32512
+ }
32513
+ const uri = new URL(this.client.config.endpoint + apiPath);
32514
+ const apiHeaders = {
32515
+ 'X-Appwrite-Project': this.client.config.project,
32516
+ 'content-type': 'application/json',
32517
+ accept: 'application/json',
32518
+ };
32519
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
32520
+ }
32116
32521
  updatePasswordDictionaryPolicy(paramsOrFirst) {
32117
32522
  let params;
32118
32523
  if (paramsOrFirst &&
@@ -42074,6 +42479,106 @@ class Users {
42074
42479
  };
42075
42480
  return this.client.call('patch', uri, apiHeaders, apiPayload);
42076
42481
  }
42482
+ listPasskeys(paramsOrFirst, ...rest) {
42483
+ let params;
42484
+ if (paramsOrFirst &&
42485
+ typeof paramsOrFirst === 'object' &&
42486
+ !Array.isArray(paramsOrFirst)) {
42487
+ params = (paramsOrFirst || {});
42488
+ }
42489
+ else {
42490
+ params = {
42491
+ userId: paramsOrFirst,
42492
+ queries: rest[0],
42493
+ total: rest[1],
42494
+ };
42495
+ }
42496
+ const userId = params.userId;
42497
+ const queries = params.queries;
42498
+ const total = params.total;
42499
+ if (typeof userId === 'undefined' || userId === '') {
42500
+ throw new AppwriteException('Missing required parameter: "userId"');
42501
+ }
42502
+ const apiPath = '/users/{userId}/passkeys'.replace('{userId}', encodeURIComponent(String(userId)));
42503
+ const apiPayload = {};
42504
+ if (typeof queries !== 'undefined') {
42505
+ apiPayload['queries'] = queries;
42506
+ }
42507
+ if (typeof total !== 'undefined') {
42508
+ apiPayload['total'] = total;
42509
+ }
42510
+ const uri = new URL(this.client.config.endpoint + apiPath);
42511
+ const apiHeaders = {
42512
+ 'X-Appwrite-Project': this.client.config.project,
42513
+ accept: 'application/json',
42514
+ };
42515
+ return this.client.call('get', uri, apiHeaders, apiPayload);
42516
+ }
42517
+ getPasskey(paramsOrFirst, ...rest) {
42518
+ let params;
42519
+ if (paramsOrFirst &&
42520
+ typeof paramsOrFirst === 'object' &&
42521
+ !Array.isArray(paramsOrFirst)) {
42522
+ params = (paramsOrFirst || {});
42523
+ }
42524
+ else {
42525
+ params = {
42526
+ userId: paramsOrFirst,
42527
+ passkeyId: rest[0],
42528
+ };
42529
+ }
42530
+ const userId = params.userId;
42531
+ const passkeyId = params.passkeyId;
42532
+ if (typeof userId === 'undefined' || userId === '') {
42533
+ throw new AppwriteException('Missing required parameter: "userId"');
42534
+ }
42535
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
42536
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
42537
+ }
42538
+ const apiPath = '/users/{userId}/passkeys/{passkeyId}'
42539
+ .replace('{userId}', encodeURIComponent(String(userId)))
42540
+ .replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
42541
+ const apiPayload = {};
42542
+ const uri = new URL(this.client.config.endpoint + apiPath);
42543
+ const apiHeaders = {
42544
+ 'X-Appwrite-Project': this.client.config.project,
42545
+ accept: 'application/json',
42546
+ };
42547
+ return this.client.call('get', uri, apiHeaders, apiPayload);
42548
+ }
42549
+ deletePasskey(paramsOrFirst, ...rest) {
42550
+ let params;
42551
+ if (paramsOrFirst &&
42552
+ typeof paramsOrFirst === 'object' &&
42553
+ !Array.isArray(paramsOrFirst)) {
42554
+ params = (paramsOrFirst || {});
42555
+ }
42556
+ else {
42557
+ params = {
42558
+ userId: paramsOrFirst,
42559
+ passkeyId: rest[0],
42560
+ };
42561
+ }
42562
+ const userId = params.userId;
42563
+ const passkeyId = params.passkeyId;
42564
+ if (typeof userId === 'undefined' || userId === '') {
42565
+ throw new AppwriteException('Missing required parameter: "userId"');
42566
+ }
42567
+ if (typeof passkeyId === 'undefined' || passkeyId === '') {
42568
+ throw new AppwriteException('Missing required parameter: "passkeyId"');
42569
+ }
42570
+ const apiPath = '/users/{userId}/passkeys/{passkeyId}'
42571
+ .replace('{userId}', encodeURIComponent(String(userId)))
42572
+ .replace('{passkeyId}', encodeURIComponent(String(passkeyId)));
42573
+ const apiPayload = {};
42574
+ const uri = new URL(this.client.config.endpoint + apiPath);
42575
+ const apiHeaders = {
42576
+ 'X-Appwrite-Project': this.client.config.project,
42577
+ 'content-type': 'application/json',
42578
+ accept: 'application/json',
42579
+ };
42580
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
42581
+ }
42077
42582
  updatePassword(paramsOrFirst, ...rest) {
42078
42583
  let params;
42079
42584
  if (paramsOrFirst &&
@@ -44580,6 +45085,1136 @@ class VectorsDB {
44580
45085
  }
44581
45086
  }
44582
45087
 
45088
+ class Videos {
45089
+ constructor(client) {
45090
+ this.client = client;
45091
+ }
45092
+ list(paramsOrFirst, ...rest) {
45093
+ let params;
45094
+ if ((typeof paramsOrFirst === 'undefined' && rest.length === 0) ||
45095
+ (paramsOrFirst &&
45096
+ typeof paramsOrFirst === 'object' &&
45097
+ !Array.isArray(paramsOrFirst))) {
45098
+ params = (paramsOrFirst || {});
45099
+ }
45100
+ else {
45101
+ params = {
45102
+ queries: paramsOrFirst,
45103
+ search: rest[0],
45104
+ total: rest[1],
45105
+ };
45106
+ }
45107
+ const queries = params.queries;
45108
+ const search = params.search;
45109
+ const total = params.total;
45110
+ const apiPath = '/videos';
45111
+ const apiPayload = {};
45112
+ if (typeof queries !== 'undefined') {
45113
+ apiPayload['queries'] = queries;
45114
+ }
45115
+ if (typeof search !== 'undefined') {
45116
+ apiPayload['search'] = search;
45117
+ }
45118
+ if (typeof total !== 'undefined') {
45119
+ apiPayload['total'] = total;
45120
+ }
45121
+ const uri = new URL(this.client.config.endpoint + apiPath);
45122
+ const apiHeaders = {
45123
+ 'X-Appwrite-Project': this.client.config.project,
45124
+ accept: 'application/json',
45125
+ };
45126
+ return this.client.call('get', uri, apiHeaders, apiPayload);
45127
+ }
45128
+ create(paramsOrFirst, ...rest) {
45129
+ let params;
45130
+ if (paramsOrFirst &&
45131
+ typeof paramsOrFirst === 'object' &&
45132
+ !Array.isArray(paramsOrFirst)) {
45133
+ params = (paramsOrFirst || {});
45134
+ }
45135
+ else {
45136
+ params = {
45137
+ bucketId: paramsOrFirst,
45138
+ fileId: rest[0],
45139
+ name: rest[1],
45140
+ };
45141
+ }
45142
+ const bucketId = params.bucketId;
45143
+ const fileId = params.fileId;
45144
+ const name = params.name;
45145
+ if (typeof bucketId === 'undefined') {
45146
+ throw new AppwriteException('Missing required parameter: "bucketId"');
45147
+ }
45148
+ if (typeof fileId === 'undefined') {
45149
+ throw new AppwriteException('Missing required parameter: "fileId"');
45150
+ }
45151
+ const apiPath = '/videos';
45152
+ const apiPayload = {};
45153
+ if (typeof bucketId !== 'undefined') {
45154
+ apiPayload['bucketId'] = bucketId;
45155
+ }
45156
+ if (typeof fileId !== 'undefined') {
45157
+ apiPayload['fileId'] = fileId;
45158
+ }
45159
+ if (typeof name !== 'undefined') {
45160
+ apiPayload['name'] = name;
45161
+ }
45162
+ const uri = new URL(this.client.config.endpoint + apiPath);
45163
+ const apiHeaders = {
45164
+ 'X-Appwrite-Project': this.client.config.project,
45165
+ 'content-type': 'application/json',
45166
+ accept: 'application/json',
45167
+ };
45168
+ return this.client.call('post', uri, apiHeaders, apiPayload);
45169
+ }
45170
+ listProfiles(paramsOrFirst) {
45171
+ let params;
45172
+ if (typeof paramsOrFirst === 'undefined' ||
45173
+ (paramsOrFirst &&
45174
+ typeof paramsOrFirst === 'object' &&
45175
+ !Array.isArray(paramsOrFirst))) {
45176
+ params = (paramsOrFirst || {});
45177
+ }
45178
+ else {
45179
+ params = {
45180
+ search: paramsOrFirst,
45181
+ };
45182
+ }
45183
+ const search = params.search;
45184
+ const apiPath = '/videos/profiles';
45185
+ const apiPayload = {};
45186
+ if (typeof search !== 'undefined') {
45187
+ apiPayload['search'] = search;
45188
+ }
45189
+ const uri = new URL(this.client.config.endpoint + apiPath);
45190
+ const apiHeaders = {
45191
+ 'X-Appwrite-Project': this.client.config.project,
45192
+ accept: 'application/json',
45193
+ };
45194
+ return this.client.call('get', uri, apiHeaders, apiPayload);
45195
+ }
45196
+ createProfile(paramsOrFirst, ...rest) {
45197
+ let params;
45198
+ if (paramsOrFirst &&
45199
+ typeof paramsOrFirst === 'object' &&
45200
+ !Array.isArray(paramsOrFirst)) {
45201
+ params = (paramsOrFirst || {});
45202
+ }
45203
+ else {
45204
+ params = {
45205
+ name: paramsOrFirst,
45206
+ videoBitRate: rest[0],
45207
+ audioBitRate: rest[1],
45208
+ width: rest[2],
45209
+ height: rest[3],
45210
+ };
45211
+ }
45212
+ const name = params.name;
45213
+ const videoBitRate = params.videoBitRate;
45214
+ const audioBitRate = params.audioBitRate;
45215
+ const width = params.width;
45216
+ const height = params.height;
45217
+ if (typeof name === 'undefined') {
45218
+ throw new AppwriteException('Missing required parameter: "name"');
45219
+ }
45220
+ if (typeof videoBitRate === 'undefined') {
45221
+ throw new AppwriteException('Missing required parameter: "videoBitRate"');
45222
+ }
45223
+ if (typeof audioBitRate === 'undefined') {
45224
+ throw new AppwriteException('Missing required parameter: "audioBitRate"');
45225
+ }
45226
+ if (typeof width === 'undefined') {
45227
+ throw new AppwriteException('Missing required parameter: "width"');
45228
+ }
45229
+ if (typeof height === 'undefined') {
45230
+ throw new AppwriteException('Missing required parameter: "height"');
45231
+ }
45232
+ const apiPath = '/videos/profiles';
45233
+ const apiPayload = {};
45234
+ if (typeof name !== 'undefined') {
45235
+ apiPayload['name'] = name;
45236
+ }
45237
+ if (typeof videoBitRate !== 'undefined') {
45238
+ apiPayload['videoBitRate'] = videoBitRate;
45239
+ }
45240
+ if (typeof audioBitRate !== 'undefined') {
45241
+ apiPayload['audioBitRate'] = audioBitRate;
45242
+ }
45243
+ if (typeof width !== 'undefined') {
45244
+ apiPayload['width'] = width;
45245
+ }
45246
+ if (typeof height !== 'undefined') {
45247
+ apiPayload['height'] = height;
45248
+ }
45249
+ const uri = new URL(this.client.config.endpoint + apiPath);
45250
+ const apiHeaders = {
45251
+ 'X-Appwrite-Project': this.client.config.project,
45252
+ 'content-type': 'application/json',
45253
+ accept: 'application/json',
45254
+ };
45255
+ return this.client.call('post', uri, apiHeaders, apiPayload);
45256
+ }
45257
+ getProfile(paramsOrFirst) {
45258
+ let params;
45259
+ if (paramsOrFirst &&
45260
+ typeof paramsOrFirst === 'object' &&
45261
+ !Array.isArray(paramsOrFirst)) {
45262
+ params = (paramsOrFirst || {});
45263
+ }
45264
+ else {
45265
+ params = {
45266
+ profileId: paramsOrFirst,
45267
+ };
45268
+ }
45269
+ const profileId = params.profileId;
45270
+ if (typeof profileId === 'undefined' || profileId === '') {
45271
+ throw new AppwriteException('Missing required parameter: "profileId"');
45272
+ }
45273
+ const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
45274
+ const apiPayload = {};
45275
+ const uri = new URL(this.client.config.endpoint + apiPath);
45276
+ const apiHeaders = {
45277
+ 'X-Appwrite-Project': this.client.config.project,
45278
+ accept: 'application/json',
45279
+ };
45280
+ return this.client.call('get', uri, apiHeaders, apiPayload);
45281
+ }
45282
+ updateProfile(paramsOrFirst, ...rest) {
45283
+ let params;
45284
+ if (paramsOrFirst &&
45285
+ typeof paramsOrFirst === 'object' &&
45286
+ !Array.isArray(paramsOrFirst)) {
45287
+ params = (paramsOrFirst || {});
45288
+ }
45289
+ else {
45290
+ params = {
45291
+ profileId: paramsOrFirst,
45292
+ name: rest[0],
45293
+ videoBitRate: rest[1],
45294
+ audioBitRate: rest[2],
45295
+ width: rest[3],
45296
+ height: rest[4],
45297
+ };
45298
+ }
45299
+ const profileId = params.profileId;
45300
+ const name = params.name;
45301
+ const videoBitRate = params.videoBitRate;
45302
+ const audioBitRate = params.audioBitRate;
45303
+ const width = params.width;
45304
+ const height = params.height;
45305
+ if (typeof profileId === 'undefined' || profileId === '') {
45306
+ throw new AppwriteException('Missing required parameter: "profileId"');
45307
+ }
45308
+ if (typeof name === 'undefined') {
45309
+ throw new AppwriteException('Missing required parameter: "name"');
45310
+ }
45311
+ if (typeof videoBitRate === 'undefined') {
45312
+ throw new AppwriteException('Missing required parameter: "videoBitRate"');
45313
+ }
45314
+ if (typeof audioBitRate === 'undefined') {
45315
+ throw new AppwriteException('Missing required parameter: "audioBitRate"');
45316
+ }
45317
+ if (typeof width === 'undefined') {
45318
+ throw new AppwriteException('Missing required parameter: "width"');
45319
+ }
45320
+ if (typeof height === 'undefined') {
45321
+ throw new AppwriteException('Missing required parameter: "height"');
45322
+ }
45323
+ const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
45324
+ const apiPayload = {};
45325
+ if (typeof name !== 'undefined') {
45326
+ apiPayload['name'] = name;
45327
+ }
45328
+ if (typeof videoBitRate !== 'undefined') {
45329
+ apiPayload['videoBitRate'] = videoBitRate;
45330
+ }
45331
+ if (typeof audioBitRate !== 'undefined') {
45332
+ apiPayload['audioBitRate'] = audioBitRate;
45333
+ }
45334
+ if (typeof width !== 'undefined') {
45335
+ apiPayload['width'] = width;
45336
+ }
45337
+ if (typeof height !== 'undefined') {
45338
+ apiPayload['height'] = height;
45339
+ }
45340
+ const uri = new URL(this.client.config.endpoint + apiPath);
45341
+ const apiHeaders = {
45342
+ 'X-Appwrite-Project': this.client.config.project,
45343
+ 'content-type': 'application/json',
45344
+ accept: 'application/json',
45345
+ };
45346
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
45347
+ }
45348
+ deleteProfile(paramsOrFirst) {
45349
+ let params;
45350
+ if (paramsOrFirst &&
45351
+ typeof paramsOrFirst === 'object' &&
45352
+ !Array.isArray(paramsOrFirst)) {
45353
+ params = (paramsOrFirst || {});
45354
+ }
45355
+ else {
45356
+ params = {
45357
+ profileId: paramsOrFirst,
45358
+ };
45359
+ }
45360
+ const profileId = params.profileId;
45361
+ if (typeof profileId === 'undefined' || profileId === '') {
45362
+ throw new AppwriteException('Missing required parameter: "profileId"');
45363
+ }
45364
+ const apiPath = '/videos/profiles/{profileId}'.replace('{profileId}', encodeURIComponent(String(profileId)));
45365
+ const apiPayload = {};
45366
+ const uri = new URL(this.client.config.endpoint + apiPath);
45367
+ const apiHeaders = {
45368
+ 'X-Appwrite-Project': this.client.config.project,
45369
+ 'content-type': 'application/json',
45370
+ accept: 'application/json',
45371
+ };
45372
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
45373
+ }
45374
+ get(paramsOrFirst) {
45375
+ let params;
45376
+ if (paramsOrFirst &&
45377
+ typeof paramsOrFirst === 'object' &&
45378
+ !Array.isArray(paramsOrFirst)) {
45379
+ params = (paramsOrFirst || {});
45380
+ }
45381
+ else {
45382
+ params = {
45383
+ videoId: paramsOrFirst,
45384
+ };
45385
+ }
45386
+ const videoId = params.videoId;
45387
+ if (typeof videoId === 'undefined' || videoId === '') {
45388
+ throw new AppwriteException('Missing required parameter: "videoId"');
45389
+ }
45390
+ const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
45391
+ const apiPayload = {};
45392
+ const uri = new URL(this.client.config.endpoint + apiPath);
45393
+ const apiHeaders = {
45394
+ 'X-Appwrite-Project': this.client.config.project,
45395
+ accept: 'application/json',
45396
+ };
45397
+ return this.client.call('get', uri, apiHeaders, apiPayload);
45398
+ }
45399
+ update(paramsOrFirst, ...rest) {
45400
+ let params;
45401
+ if (paramsOrFirst &&
45402
+ typeof paramsOrFirst === 'object' &&
45403
+ !Array.isArray(paramsOrFirst)) {
45404
+ params = (paramsOrFirst || {});
45405
+ }
45406
+ else {
45407
+ params = {
45408
+ videoId: paramsOrFirst,
45409
+ name: rest[0],
45410
+ };
45411
+ }
45412
+ const videoId = params.videoId;
45413
+ const name = params.name;
45414
+ if (typeof videoId === 'undefined' || videoId === '') {
45415
+ throw new AppwriteException('Missing required parameter: "videoId"');
45416
+ }
45417
+ if (typeof name === 'undefined') {
45418
+ throw new AppwriteException('Missing required parameter: "name"');
45419
+ }
45420
+ const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
45421
+ const apiPayload = {};
45422
+ if (typeof name !== 'undefined') {
45423
+ apiPayload['name'] = name;
45424
+ }
45425
+ const uri = new URL(this.client.config.endpoint + apiPath);
45426
+ const apiHeaders = {
45427
+ 'X-Appwrite-Project': this.client.config.project,
45428
+ 'content-type': 'application/json',
45429
+ accept: 'application/json',
45430
+ };
45431
+ return this.client.call('put', uri, apiHeaders, apiPayload);
45432
+ }
45433
+ delete(paramsOrFirst) {
45434
+ let params;
45435
+ if (paramsOrFirst &&
45436
+ typeof paramsOrFirst === 'object' &&
45437
+ !Array.isArray(paramsOrFirst)) {
45438
+ params = (paramsOrFirst || {});
45439
+ }
45440
+ else {
45441
+ params = {
45442
+ videoId: paramsOrFirst,
45443
+ };
45444
+ }
45445
+ const videoId = params.videoId;
45446
+ if (typeof videoId === 'undefined' || videoId === '') {
45447
+ throw new AppwriteException('Missing required parameter: "videoId"');
45448
+ }
45449
+ const apiPath = '/videos/{videoId}'.replace('{videoId}', encodeURIComponent(String(videoId)));
45450
+ const apiPayload = {};
45451
+ const uri = new URL(this.client.config.endpoint + apiPath);
45452
+ const apiHeaders = {
45453
+ 'X-Appwrite-Project': this.client.config.project,
45454
+ 'content-type': 'application/json',
45455
+ accept: 'application/json',
45456
+ };
45457
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
45458
+ }
45459
+ getCmafHlsManifest(paramsOrFirst) {
45460
+ let params;
45461
+ if (paramsOrFirst &&
45462
+ typeof paramsOrFirst === 'object' &&
45463
+ !Array.isArray(paramsOrFirst)) {
45464
+ params = (paramsOrFirst || {});
45465
+ }
45466
+ else {
45467
+ params = {
45468
+ videoId: paramsOrFirst,
45469
+ };
45470
+ }
45471
+ const videoId = params.videoId;
45472
+ if (typeof videoId === 'undefined' || videoId === '') {
45473
+ throw new AppwriteException('Missing required parameter: "videoId"');
45474
+ }
45475
+ const apiPath = '/videos/{videoId}/outputs/cmaf/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
45476
+ const apiPayload = {};
45477
+ const uri = new URL(this.client.config.endpoint + apiPath);
45478
+ apiPayload['project'] = this.client.config.project;
45479
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45480
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45481
+ uri.searchParams.append(key, value);
45482
+ }
45483
+ return uri.toString();
45484
+ }
45485
+ getCmafDashManifest(paramsOrFirst) {
45486
+ let params;
45487
+ if (paramsOrFirst &&
45488
+ typeof paramsOrFirst === 'object' &&
45489
+ !Array.isArray(paramsOrFirst)) {
45490
+ params = (paramsOrFirst || {});
45491
+ }
45492
+ else {
45493
+ params = {
45494
+ videoId: paramsOrFirst,
45495
+ };
45496
+ }
45497
+ const videoId = params.videoId;
45498
+ if (typeof videoId === 'undefined' || videoId === '') {
45499
+ throw new AppwriteException('Missing required parameter: "videoId"');
45500
+ }
45501
+ const apiPath = '/videos/{videoId}/outputs/cmaf/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
45502
+ const apiPayload = {};
45503
+ const uri = new URL(this.client.config.endpoint + apiPath);
45504
+ apiPayload['project'] = this.client.config.project;
45505
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45506
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45507
+ uri.searchParams.append(key, value);
45508
+ }
45509
+ return uri.toString();
45510
+ }
45511
+ getCmafStreamManifest(paramsOrFirst, ...rest) {
45512
+ let params;
45513
+ if (paramsOrFirst &&
45514
+ typeof paramsOrFirst === 'object' &&
45515
+ !Array.isArray(paramsOrFirst)) {
45516
+ params = (paramsOrFirst || {});
45517
+ }
45518
+ else {
45519
+ params = {
45520
+ videoId: paramsOrFirst,
45521
+ renditionId: rest[0],
45522
+ streamId: rest[1],
45523
+ };
45524
+ }
45525
+ const videoId = params.videoId;
45526
+ const renditionId = params.renditionId;
45527
+ const streamId = params.streamId;
45528
+ if (typeof videoId === 'undefined' || videoId === '') {
45529
+ throw new AppwriteException('Missing required parameter: "videoId"');
45530
+ }
45531
+ if (typeof renditionId === 'undefined' || renditionId === '') {
45532
+ throw new AppwriteException('Missing required parameter: "renditionId"');
45533
+ }
45534
+ if (typeof streamId === 'undefined') {
45535
+ throw new AppwriteException('Missing required parameter: "streamId"');
45536
+ }
45537
+ const apiPath = '/videos/{videoId}/outputs/cmaf/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
45538
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45539
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)))
45540
+ .replace('{streamId}', encodeURIComponent(String(streamId)));
45541
+ const apiPayload = {};
45542
+ const uri = new URL(this.client.config.endpoint + apiPath);
45543
+ apiPayload['project'] = this.client.config.project;
45544
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45545
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45546
+ uri.searchParams.append(key, value);
45547
+ }
45548
+ return uri.toString();
45549
+ }
45550
+ getDashManifest(paramsOrFirst) {
45551
+ let params;
45552
+ if (paramsOrFirst &&
45553
+ typeof paramsOrFirst === 'object' &&
45554
+ !Array.isArray(paramsOrFirst)) {
45555
+ params = (paramsOrFirst || {});
45556
+ }
45557
+ else {
45558
+ params = {
45559
+ videoId: paramsOrFirst,
45560
+ };
45561
+ }
45562
+ const videoId = params.videoId;
45563
+ if (typeof videoId === 'undefined' || videoId === '') {
45564
+ throw new AppwriteException('Missing required parameter: "videoId"');
45565
+ }
45566
+ const apiPath = '/videos/{videoId}/outputs/dash/master.mpd'.replace('{videoId}', encodeURIComponent(String(videoId)));
45567
+ const apiPayload = {};
45568
+ const uri = new URL(this.client.config.endpoint + apiPath);
45569
+ apiPayload['project'] = this.client.config.project;
45570
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45571
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45572
+ uri.searchParams.append(key, value);
45573
+ }
45574
+ return uri.toString();
45575
+ }
45576
+ getHlsManifest(paramsOrFirst) {
45577
+ let params;
45578
+ if (paramsOrFirst &&
45579
+ typeof paramsOrFirst === 'object' &&
45580
+ !Array.isArray(paramsOrFirst)) {
45581
+ params = (paramsOrFirst || {});
45582
+ }
45583
+ else {
45584
+ params = {
45585
+ videoId: paramsOrFirst,
45586
+ };
45587
+ }
45588
+ const videoId = params.videoId;
45589
+ if (typeof videoId === 'undefined' || videoId === '') {
45590
+ throw new AppwriteException('Missing required parameter: "videoId"');
45591
+ }
45592
+ const apiPath = '/videos/{videoId}/outputs/hls/master.m3u8'.replace('{videoId}', encodeURIComponent(String(videoId)));
45593
+ const apiPayload = {};
45594
+ const uri = new URL(this.client.config.endpoint + apiPath);
45595
+ apiPayload['project'] = this.client.config.project;
45596
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45597
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45598
+ uri.searchParams.append(key, value);
45599
+ }
45600
+ return uri.toString();
45601
+ }
45602
+ getStreamManifest(paramsOrFirst, ...rest) {
45603
+ let params;
45604
+ if (paramsOrFirst &&
45605
+ typeof paramsOrFirst === 'object' &&
45606
+ !Array.isArray(paramsOrFirst)) {
45607
+ params = (paramsOrFirst || {});
45608
+ }
45609
+ else {
45610
+ params = {
45611
+ videoId: paramsOrFirst,
45612
+ renditionId: rest[0],
45613
+ streamId: rest[1],
45614
+ };
45615
+ }
45616
+ const videoId = params.videoId;
45617
+ const renditionId = params.renditionId;
45618
+ const streamId = params.streamId;
45619
+ if (typeof videoId === 'undefined' || videoId === '') {
45620
+ throw new AppwriteException('Missing required parameter: "videoId"');
45621
+ }
45622
+ if (typeof renditionId === 'undefined' || renditionId === '') {
45623
+ throw new AppwriteException('Missing required parameter: "renditionId"');
45624
+ }
45625
+ if (typeof streamId === 'undefined') {
45626
+ throw new AppwriteException('Missing required parameter: "streamId"');
45627
+ }
45628
+ const apiPath = '/videos/{videoId}/outputs/hls/renditions/{renditionId}/streams/{streamId}/playlist.m3u8'
45629
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45630
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)))
45631
+ .replace('{streamId}', encodeURIComponent(String(streamId)));
45632
+ const apiPayload = {};
45633
+ const uri = new URL(this.client.config.endpoint + apiPath);
45634
+ apiPayload['project'] = this.client.config.project;
45635
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45636
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45637
+ uri.searchParams.append(key, value);
45638
+ }
45639
+ return uri.toString();
45640
+ }
45641
+ getSegment(paramsOrFirst, ...rest) {
45642
+ let params;
45643
+ if (paramsOrFirst &&
45644
+ typeof paramsOrFirst === 'object' &&
45645
+ !Array.isArray(paramsOrFirst)) {
45646
+ params = (paramsOrFirst || {});
45647
+ }
45648
+ else {
45649
+ params = {
45650
+ videoId: paramsOrFirst,
45651
+ output: rest[0],
45652
+ renditionId: rest[1],
45653
+ segmentId: rest[2],
45654
+ };
45655
+ }
45656
+ const videoId = params.videoId;
45657
+ const output = params.output;
45658
+ const renditionId = params.renditionId;
45659
+ const segmentId = params.segmentId;
45660
+ if (typeof videoId === 'undefined' || videoId === '') {
45661
+ throw new AppwriteException('Missing required parameter: "videoId"');
45662
+ }
45663
+ if (typeof output === 'undefined') {
45664
+ throw new AppwriteException('Missing required parameter: "output"');
45665
+ }
45666
+ if (typeof renditionId === 'undefined' || renditionId === '') {
45667
+ throw new AppwriteException('Missing required parameter: "renditionId"');
45668
+ }
45669
+ if (typeof segmentId === 'undefined' || segmentId === '') {
45670
+ throw new AppwriteException('Missing required parameter: "segmentId"');
45671
+ }
45672
+ const apiPath = '/videos/{videoId}/outputs/{output}/renditions/{renditionId}/segments/{segmentId}'
45673
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45674
+ .replace('{output}', encodeURIComponent(String(output)))
45675
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)))
45676
+ .replace('{segmentId}', encodeURIComponent(String(segmentId)));
45677
+ const apiPayload = {};
45678
+ const uri = new URL(this.client.config.endpoint + apiPath);
45679
+ apiPayload['project'] = this.client.config.project;
45680
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45681
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45682
+ uri.searchParams.append(key, value);
45683
+ }
45684
+ return uri.toString();
45685
+ }
45686
+ getSubtitleManifest(paramsOrFirst, ...rest) {
45687
+ let params;
45688
+ if (paramsOrFirst &&
45689
+ typeof paramsOrFirst === 'object' &&
45690
+ !Array.isArray(paramsOrFirst)) {
45691
+ params = (paramsOrFirst || {});
45692
+ }
45693
+ else {
45694
+ params = {
45695
+ videoId: paramsOrFirst,
45696
+ output: rest[0],
45697
+ subtitleId: rest[1],
45698
+ };
45699
+ }
45700
+ const videoId = params.videoId;
45701
+ const output = params.output;
45702
+ const subtitleId = params.subtitleId;
45703
+ if (typeof videoId === 'undefined' || videoId === '') {
45704
+ throw new AppwriteException('Missing required parameter: "videoId"');
45705
+ }
45706
+ if (typeof output === 'undefined') {
45707
+ throw new AppwriteException('Missing required parameter: "output"');
45708
+ }
45709
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
45710
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
45711
+ }
45712
+ const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/manifest'
45713
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45714
+ .replace('{output}', encodeURIComponent(String(output)))
45715
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
45716
+ const apiPayload = {};
45717
+ const uri = new URL(this.client.config.endpoint + apiPath);
45718
+ apiPayload['project'] = this.client.config.project;
45719
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45720
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45721
+ uri.searchParams.append(key, value);
45722
+ }
45723
+ return uri.toString();
45724
+ }
45725
+ getSubtitleSegment(paramsOrFirst, ...rest) {
45726
+ let params;
45727
+ if (paramsOrFirst &&
45728
+ typeof paramsOrFirst === 'object' &&
45729
+ !Array.isArray(paramsOrFirst)) {
45730
+ params = (paramsOrFirst || {});
45731
+ }
45732
+ else {
45733
+ params = {
45734
+ videoId: paramsOrFirst,
45735
+ output: rest[0],
45736
+ subtitleId: rest[1],
45737
+ segmentId: rest[2],
45738
+ };
45739
+ }
45740
+ const videoId = params.videoId;
45741
+ const output = params.output;
45742
+ const subtitleId = params.subtitleId;
45743
+ const segmentId = params.segmentId;
45744
+ if (typeof videoId === 'undefined' || videoId === '') {
45745
+ throw new AppwriteException('Missing required parameter: "videoId"');
45746
+ }
45747
+ if (typeof output === 'undefined') {
45748
+ throw new AppwriteException('Missing required parameter: "output"');
45749
+ }
45750
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
45751
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
45752
+ }
45753
+ if (typeof segmentId === 'undefined' || segmentId === '') {
45754
+ throw new AppwriteException('Missing required parameter: "segmentId"');
45755
+ }
45756
+ const apiPath = '/videos/{videoId}/outputs/{output}/subtitles/{subtitleId}/segments/{segmentId}'
45757
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45758
+ .replace('{output}', encodeURIComponent(String(output)))
45759
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)))
45760
+ .replace('{segmentId}', encodeURIComponent(String(segmentId)));
45761
+ const apiPayload = {};
45762
+ const uri = new URL(this.client.config.endpoint + apiPath);
45763
+ apiPayload['project'] = this.client.config.project;
45764
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45765
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45766
+ uri.searchParams.append(key, value);
45767
+ }
45768
+ return uri.toString();
45769
+ }
45770
+ getPreview(paramsOrFirst, ...rest) {
45771
+ let params;
45772
+ if (paramsOrFirst &&
45773
+ typeof paramsOrFirst === 'object' &&
45774
+ !Array.isArray(paramsOrFirst)) {
45775
+ params = (paramsOrFirst || {});
45776
+ }
45777
+ else {
45778
+ params = {
45779
+ videoId: paramsOrFirst,
45780
+ previewId: rest[0],
45781
+ width: rest[1],
45782
+ height: rest[2],
45783
+ output: rest[3],
45784
+ };
45785
+ }
45786
+ const videoId = params.videoId;
45787
+ const previewId = params.previewId;
45788
+ const width = params.width;
45789
+ const height = params.height;
45790
+ const output = params.output;
45791
+ if (typeof videoId === 'undefined' || videoId === '') {
45792
+ throw new AppwriteException('Missing required parameter: "videoId"');
45793
+ }
45794
+ if (typeof previewId === 'undefined' || previewId === '') {
45795
+ throw new AppwriteException('Missing required parameter: "previewId"');
45796
+ }
45797
+ const apiPath = '/videos/{videoId}/previews/{previewId}'
45798
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45799
+ .replace('{previewId}', encodeURIComponent(String(previewId)));
45800
+ const apiPayload = {};
45801
+ if (typeof width !== 'undefined') {
45802
+ apiPayload['width'] = width;
45803
+ }
45804
+ if (typeof height !== 'undefined') {
45805
+ apiPayload['height'] = height;
45806
+ }
45807
+ if (typeof output !== 'undefined') {
45808
+ apiPayload['output'] = output;
45809
+ }
45810
+ const uri = new URL(this.client.config.endpoint + apiPath);
45811
+ apiPayload['project'] = this.client.config.project;
45812
+ apiPayload['impersonateuserid'] = this.client.config.impersonateuserid;
45813
+ for (const [key, value] of Object.entries(Client.flatten(apiPayload))) {
45814
+ uri.searchParams.append(key, value);
45815
+ }
45816
+ return uri.toString();
45817
+ }
45818
+ listRenditions(paramsOrFirst, ...rest) {
45819
+ let params;
45820
+ if (paramsOrFirst &&
45821
+ typeof paramsOrFirst === 'object' &&
45822
+ !Array.isArray(paramsOrFirst)) {
45823
+ params = (paramsOrFirst || {});
45824
+ }
45825
+ else {
45826
+ params = {
45827
+ videoId: paramsOrFirst,
45828
+ output: rest[0],
45829
+ status: rest[1],
45830
+ };
45831
+ }
45832
+ const videoId = params.videoId;
45833
+ const output = params.output;
45834
+ const status = params.status;
45835
+ if (typeof videoId === 'undefined' || videoId === '') {
45836
+ throw new AppwriteException('Missing required parameter: "videoId"');
45837
+ }
45838
+ const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
45839
+ const apiPayload = {};
45840
+ if (typeof output !== 'undefined') {
45841
+ apiPayload['output'] = output;
45842
+ }
45843
+ if (typeof status !== 'undefined') {
45844
+ apiPayload['status'] = status;
45845
+ }
45846
+ const uri = new URL(this.client.config.endpoint + apiPath);
45847
+ const apiHeaders = {
45848
+ 'X-Appwrite-Project': this.client.config.project,
45849
+ accept: 'application/json',
45850
+ };
45851
+ return this.client.call('get', uri, apiHeaders, apiPayload);
45852
+ }
45853
+ createRendition(paramsOrFirst, ...rest) {
45854
+ let params;
45855
+ if (paramsOrFirst &&
45856
+ typeof paramsOrFirst === 'object' &&
45857
+ !Array.isArray(paramsOrFirst)) {
45858
+ params = (paramsOrFirst || {});
45859
+ }
45860
+ else {
45861
+ params = {
45862
+ videoId: paramsOrFirst,
45863
+ profileId: rest[0],
45864
+ output: rest[1],
45865
+ };
45866
+ }
45867
+ const videoId = params.videoId;
45868
+ const profileId = params.profileId;
45869
+ const output = params.output;
45870
+ if (typeof videoId === 'undefined' || videoId === '') {
45871
+ throw new AppwriteException('Missing required parameter: "videoId"');
45872
+ }
45873
+ if (typeof profileId === 'undefined') {
45874
+ throw new AppwriteException('Missing required parameter: "profileId"');
45875
+ }
45876
+ if (typeof output === 'undefined') {
45877
+ throw new AppwriteException('Missing required parameter: "output"');
45878
+ }
45879
+ const apiPath = '/videos/{videoId}/renditions'.replace('{videoId}', encodeURIComponent(String(videoId)));
45880
+ const apiPayload = {};
45881
+ if (typeof profileId !== 'undefined') {
45882
+ apiPayload['profileId'] = profileId;
45883
+ }
45884
+ if (typeof output !== 'undefined') {
45885
+ apiPayload['output'] = output;
45886
+ }
45887
+ const uri = new URL(this.client.config.endpoint + apiPath);
45888
+ const apiHeaders = {
45889
+ 'X-Appwrite-Project': this.client.config.project,
45890
+ 'content-type': 'application/json',
45891
+ accept: 'application/json',
45892
+ };
45893
+ return this.client.call('post', uri, apiHeaders, apiPayload);
45894
+ }
45895
+ getRendition(paramsOrFirst, ...rest) {
45896
+ let params;
45897
+ if (paramsOrFirst &&
45898
+ typeof paramsOrFirst === 'object' &&
45899
+ !Array.isArray(paramsOrFirst)) {
45900
+ params = (paramsOrFirst || {});
45901
+ }
45902
+ else {
45903
+ params = {
45904
+ videoId: paramsOrFirst,
45905
+ renditionId: rest[0],
45906
+ };
45907
+ }
45908
+ const videoId = params.videoId;
45909
+ const renditionId = params.renditionId;
45910
+ if (typeof videoId === 'undefined' || videoId === '') {
45911
+ throw new AppwriteException('Missing required parameter: "videoId"');
45912
+ }
45913
+ if (typeof renditionId === 'undefined' || renditionId === '') {
45914
+ throw new AppwriteException('Missing required parameter: "renditionId"');
45915
+ }
45916
+ const apiPath = '/videos/{videoId}/renditions/{renditionId}'
45917
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45918
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)));
45919
+ const apiPayload = {};
45920
+ const uri = new URL(this.client.config.endpoint + apiPath);
45921
+ const apiHeaders = {
45922
+ 'X-Appwrite-Project': this.client.config.project,
45923
+ accept: 'application/json',
45924
+ };
45925
+ return this.client.call('get', uri, apiHeaders, apiPayload);
45926
+ }
45927
+ deleteRendition(paramsOrFirst, ...rest) {
45928
+ let params;
45929
+ if (paramsOrFirst &&
45930
+ typeof paramsOrFirst === 'object' &&
45931
+ !Array.isArray(paramsOrFirst)) {
45932
+ params = (paramsOrFirst || {});
45933
+ }
45934
+ else {
45935
+ params = {
45936
+ videoId: paramsOrFirst,
45937
+ renditionId: rest[0],
45938
+ };
45939
+ }
45940
+ const videoId = params.videoId;
45941
+ const renditionId = params.renditionId;
45942
+ if (typeof videoId === 'undefined' || videoId === '') {
45943
+ throw new AppwriteException('Missing required parameter: "videoId"');
45944
+ }
45945
+ if (typeof renditionId === 'undefined' || renditionId === '') {
45946
+ throw new AppwriteException('Missing required parameter: "renditionId"');
45947
+ }
45948
+ const apiPath = '/videos/{videoId}/renditions/{renditionId}'
45949
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
45950
+ .replace('{renditionId}', encodeURIComponent(String(renditionId)));
45951
+ const apiPayload = {};
45952
+ const uri = new URL(this.client.config.endpoint + apiPath);
45953
+ const apiHeaders = {
45954
+ 'X-Appwrite-Project': this.client.config.project,
45955
+ 'content-type': 'application/json',
45956
+ accept: 'application/json',
45957
+ };
45958
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
45959
+ }
45960
+ createSource(paramsOrFirst) {
45961
+ let params;
45962
+ if (paramsOrFirst &&
45963
+ typeof paramsOrFirst === 'object' &&
45964
+ !Array.isArray(paramsOrFirst)) {
45965
+ params = (paramsOrFirst || {});
45966
+ }
45967
+ else {
45968
+ params = {
45969
+ videoId: paramsOrFirst,
45970
+ };
45971
+ }
45972
+ const videoId = params.videoId;
45973
+ if (typeof videoId === 'undefined' || videoId === '') {
45974
+ throw new AppwriteException('Missing required parameter: "videoId"');
45975
+ }
45976
+ const apiPath = '/videos/{videoId}/source'.replace('{videoId}', encodeURIComponent(String(videoId)));
45977
+ const apiPayload = {};
45978
+ const uri = new URL(this.client.config.endpoint + apiPath);
45979
+ const apiHeaders = {
45980
+ 'X-Appwrite-Project': this.client.config.project,
45981
+ 'content-type': 'application/json',
45982
+ accept: 'application/json',
45983
+ };
45984
+ return this.client.call('post', uri, apiHeaders, apiPayload);
45985
+ }
45986
+ listSubtitles(paramsOrFirst) {
45987
+ let params;
45988
+ if (paramsOrFirst &&
45989
+ typeof paramsOrFirst === 'object' &&
45990
+ !Array.isArray(paramsOrFirst)) {
45991
+ params = (paramsOrFirst || {});
45992
+ }
45993
+ else {
45994
+ params = {
45995
+ videoId: paramsOrFirst,
45996
+ };
45997
+ }
45998
+ const videoId = params.videoId;
45999
+ if (typeof videoId === 'undefined' || videoId === '') {
46000
+ throw new AppwriteException('Missing required parameter: "videoId"');
46001
+ }
46002
+ const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
46003
+ const apiPayload = {};
46004
+ const uri = new URL(this.client.config.endpoint + apiPath);
46005
+ const apiHeaders = {
46006
+ 'X-Appwrite-Project': this.client.config.project,
46007
+ accept: 'application/json',
46008
+ };
46009
+ return this.client.call('get', uri, apiHeaders, apiPayload);
46010
+ }
46011
+ createSubtitle(paramsOrFirst, ...rest) {
46012
+ let params;
46013
+ if (paramsOrFirst &&
46014
+ typeof paramsOrFirst === 'object' &&
46015
+ !Array.isArray(paramsOrFirst)) {
46016
+ params = (paramsOrFirst || {});
46017
+ }
46018
+ else {
46019
+ params = {
46020
+ videoId: paramsOrFirst,
46021
+ bucketId: rest[0],
46022
+ fileId: rest[1],
46023
+ name: rest[2],
46024
+ code: rest[3],
46025
+ xdefault: rest[4],
46026
+ };
46027
+ }
46028
+ const videoId = params.videoId;
46029
+ const bucketId = params.bucketId;
46030
+ const fileId = params.fileId;
46031
+ const name = params.name;
46032
+ const code = params.code;
46033
+ const xdefault = params.xdefault;
46034
+ if (typeof videoId === 'undefined' || videoId === '') {
46035
+ throw new AppwriteException('Missing required parameter: "videoId"');
46036
+ }
46037
+ if (typeof bucketId === 'undefined') {
46038
+ throw new AppwriteException('Missing required parameter: "bucketId"');
46039
+ }
46040
+ if (typeof fileId === 'undefined') {
46041
+ throw new AppwriteException('Missing required parameter: "fileId"');
46042
+ }
46043
+ if (typeof name === 'undefined') {
46044
+ throw new AppwriteException('Missing required parameter: "name"');
46045
+ }
46046
+ if (typeof code === 'undefined') {
46047
+ throw new AppwriteException('Missing required parameter: "code"');
46048
+ }
46049
+ const apiPath = '/videos/{videoId}/subtitles'.replace('{videoId}', encodeURIComponent(String(videoId)));
46050
+ const apiPayload = {};
46051
+ if (typeof bucketId !== 'undefined') {
46052
+ apiPayload['bucketId'] = bucketId;
46053
+ }
46054
+ if (typeof fileId !== 'undefined') {
46055
+ apiPayload['fileId'] = fileId;
46056
+ }
46057
+ if (typeof name !== 'undefined') {
46058
+ apiPayload['name'] = name;
46059
+ }
46060
+ if (typeof code !== 'undefined') {
46061
+ apiPayload['code'] = code;
46062
+ }
46063
+ if (typeof xdefault !== 'undefined') {
46064
+ apiPayload['default'] = xdefault;
46065
+ }
46066
+ const uri = new URL(this.client.config.endpoint + apiPath);
46067
+ const apiHeaders = {
46068
+ 'X-Appwrite-Project': this.client.config.project,
46069
+ 'content-type': 'application/json',
46070
+ accept: 'application/json',
46071
+ };
46072
+ return this.client.call('post', uri, apiHeaders, apiPayload);
46073
+ }
46074
+ updateSubtitle(paramsOrFirst, ...rest) {
46075
+ let params;
46076
+ if (paramsOrFirst &&
46077
+ typeof paramsOrFirst === 'object' &&
46078
+ !Array.isArray(paramsOrFirst)) {
46079
+ params = (paramsOrFirst || {});
46080
+ }
46081
+ else {
46082
+ params = {
46083
+ videoId: paramsOrFirst,
46084
+ subtitleId: rest[0],
46085
+ bucketId: rest[1],
46086
+ fileId: rest[2],
46087
+ name: rest[3],
46088
+ code: rest[4],
46089
+ xdefault: rest[5],
46090
+ };
46091
+ }
46092
+ const videoId = params.videoId;
46093
+ const subtitleId = params.subtitleId;
46094
+ const bucketId = params.bucketId;
46095
+ const fileId = params.fileId;
46096
+ const name = params.name;
46097
+ const code = params.code;
46098
+ const xdefault = params.xdefault;
46099
+ if (typeof videoId === 'undefined' || videoId === '') {
46100
+ throw new AppwriteException('Missing required parameter: "videoId"');
46101
+ }
46102
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
46103
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
46104
+ }
46105
+ const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
46106
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
46107
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
46108
+ const apiPayload = {};
46109
+ if (typeof bucketId !== 'undefined') {
46110
+ apiPayload['bucketId'] = bucketId;
46111
+ }
46112
+ if (typeof fileId !== 'undefined') {
46113
+ apiPayload['fileId'] = fileId;
46114
+ }
46115
+ if (typeof name !== 'undefined') {
46116
+ apiPayload['name'] = name;
46117
+ }
46118
+ if (typeof code !== 'undefined') {
46119
+ apiPayload['code'] = code;
46120
+ }
46121
+ if (typeof xdefault !== 'undefined') {
46122
+ apiPayload['default'] = xdefault;
46123
+ }
46124
+ const uri = new URL(this.client.config.endpoint + apiPath);
46125
+ const apiHeaders = {
46126
+ 'X-Appwrite-Project': this.client.config.project,
46127
+ 'content-type': 'application/json',
46128
+ accept: 'application/json',
46129
+ };
46130
+ return this.client.call('patch', uri, apiHeaders, apiPayload);
46131
+ }
46132
+ deleteSubtitle(paramsOrFirst, ...rest) {
46133
+ let params;
46134
+ if (paramsOrFirst &&
46135
+ typeof paramsOrFirst === 'object' &&
46136
+ !Array.isArray(paramsOrFirst)) {
46137
+ params = (paramsOrFirst || {});
46138
+ }
46139
+ else {
46140
+ params = {
46141
+ videoId: paramsOrFirst,
46142
+ subtitleId: rest[0],
46143
+ };
46144
+ }
46145
+ const videoId = params.videoId;
46146
+ const subtitleId = params.subtitleId;
46147
+ if (typeof videoId === 'undefined' || videoId === '') {
46148
+ throw new AppwriteException('Missing required parameter: "videoId"');
46149
+ }
46150
+ if (typeof subtitleId === 'undefined' || subtitleId === '') {
46151
+ throw new AppwriteException('Missing required parameter: "subtitleId"');
46152
+ }
46153
+ const apiPath = '/videos/{videoId}/subtitles/{subtitleId}'
46154
+ .replace('{videoId}', encodeURIComponent(String(videoId)))
46155
+ .replace('{subtitleId}', encodeURIComponent(String(subtitleId)));
46156
+ const apiPayload = {};
46157
+ const uri = new URL(this.client.config.endpoint + apiPath);
46158
+ const apiHeaders = {
46159
+ 'X-Appwrite-Project': this.client.config.project,
46160
+ 'content-type': 'application/json',
46161
+ accept: 'application/json',
46162
+ };
46163
+ return this.client.call('delete', uri, apiHeaders, apiPayload);
46164
+ }
46165
+ getTimeline(paramsOrFirst) {
46166
+ let params;
46167
+ if (paramsOrFirst &&
46168
+ typeof paramsOrFirst === 'object' &&
46169
+ !Array.isArray(paramsOrFirst)) {
46170
+ params = (paramsOrFirst || {});
46171
+ }
46172
+ else {
46173
+ params = {
46174
+ videoId: paramsOrFirst,
46175
+ };
46176
+ }
46177
+ const videoId = params.videoId;
46178
+ if (typeof videoId === 'undefined' || videoId === '') {
46179
+ throw new AppwriteException('Missing required parameter: "videoId"');
46180
+ }
46181
+ const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
46182
+ const apiPayload = {};
46183
+ const uri = new URL(this.client.config.endpoint + apiPath);
46184
+ const apiHeaders = {
46185
+ 'X-Appwrite-Project': this.client.config.project,
46186
+ accept: 'text/plain',
46187
+ };
46188
+ return this.client.call('get', uri, apiHeaders, apiPayload, 'text');
46189
+ }
46190
+ createTimeline(paramsOrFirst) {
46191
+ let params;
46192
+ if (paramsOrFirst &&
46193
+ typeof paramsOrFirst === 'object' &&
46194
+ !Array.isArray(paramsOrFirst)) {
46195
+ params = (paramsOrFirst || {});
46196
+ }
46197
+ else {
46198
+ params = {
46199
+ videoId: paramsOrFirst,
46200
+ };
46201
+ }
46202
+ const videoId = params.videoId;
46203
+ if (typeof videoId === 'undefined' || videoId === '') {
46204
+ throw new AppwriteException('Missing required parameter: "videoId"');
46205
+ }
46206
+ const apiPath = '/videos/{videoId}/timeline'.replace('{videoId}', encodeURIComponent(String(videoId)));
46207
+ const apiPayload = {};
46208
+ const uri = new URL(this.client.config.endpoint + apiPath);
46209
+ const apiHeaders = {
46210
+ 'X-Appwrite-Project': this.client.config.project,
46211
+ 'content-type': 'application/json',
46212
+ accept: 'application/json',
46213
+ };
46214
+ return this.client.call('post', uri, apiHeaders, apiPayload);
46215
+ }
46216
+ }
46217
+
44583
46218
  class Waf {
44584
46219
  constructor(client) {
44585
46220
  this.client = client;
@@ -48483,6 +50118,34 @@ exports.OAuthProvider = void 0;
48483
50118
  OAuthProvider["Zoom"] = "zoom";
48484
50119
  })(exports.OAuthProvider || (exports.OAuthProvider = {}));
48485
50120
 
50121
+ exports.PlatformResourceType = void 0;
50122
+ (function (PlatformResourceType) {
50123
+ PlatformResourceType["Projects"] = "projects";
50124
+ PlatformResourceType["Organizations"] = "organizations";
50125
+ PlatformResourceType["Users"] = "users";
50126
+ PlatformResourceType["Memberships"] = "memberships";
50127
+ PlatformResourceType["Rules"] = "rules";
50128
+ PlatformResourceType["Keys"] = "keys";
50129
+ PlatformResourceType["Platforms"] = "platforms";
50130
+ PlatformResourceType["Webhooks"] = "webhooks";
50131
+ PlatformResourceType["Certificates"] = "certificates";
50132
+ })(exports.PlatformResourceType || (exports.PlatformResourceType = {}));
50133
+
50134
+ exports.ProjectResourceType = void 0;
50135
+ (function (ProjectResourceType) {
50136
+ ProjectResourceType["Users"] = "users";
50137
+ ProjectResourceType["Teams"] = "teams";
50138
+ ProjectResourceType["Memberships"] = "memberships";
50139
+ ProjectResourceType["Databases"] = "databases";
50140
+ ProjectResourceType["Buckets"] = "buckets";
50141
+ ProjectResourceType["Functions"] = "functions";
50142
+ ProjectResourceType["Sites"] = "sites";
50143
+ ProjectResourceType["Deployments"] = "deployments";
50144
+ ProjectResourceType["Topics"] = "topics";
50145
+ ProjectResourceType["Providers"] = "providers";
50146
+ ProjectResourceType["Messages"] = "messages";
50147
+ })(exports.ProjectResourceType || (exports.ProjectResourceType = {}));
50148
+
48486
50149
  exports.AnalyticsInterval = void 0;
48487
50150
  (function (AnalyticsInterval) {
48488
50151
  AnalyticsInterval["OneHour"] = "1h";
@@ -49332,6 +50995,13 @@ exports.QuerySuggestionResource = void 0;
49332
50995
  QuerySuggestionResource["ResourceTokens"] = "resourcetokens";
49333
50996
  QuerySuggestionResource["Transactions"] = "transactions";
49334
50997
  QuerySuggestionResource["TransactionLogs"] = "transactionlogs";
50998
+ QuerySuggestionResource["Videos"] = "videos";
50999
+ QuerySuggestionResource["VideosPreviews"] = "videos_previews";
51000
+ QuerySuggestionResource["VideosRenditions"] = "videos_renditions";
51001
+ QuerySuggestionResource["VideosRenditionsSegments"] = "videos_renditions_segments";
51002
+ QuerySuggestionResource["VideosProfiles"] = "videos_profiles";
51003
+ QuerySuggestionResource["VideosSubtitles"] = "videos_subtitles";
51004
+ QuerySuggestionResource["VideosSubtitlesSegments"] = "videos_subtitles_segments";
49335
51005
  QuerySuggestionResource["AnalyticsProperties"] = "analyticsproperties";
49336
51006
  QuerySuggestionResource["DedicatedDatabases"] = "dedicateddatabases";
49337
51007
  QuerySuggestionResource["DedicatedDatabaseConfigs"] = "dedicateddatabaseconfigs";
@@ -49755,6 +51425,8 @@ exports.ProjectKeyScopes = void 0;
49755
51425
  ProjectKeyScopes["ReportsWrite"] = "reports.write";
49756
51426
  ProjectKeyScopes["PresencesRead"] = "presences.read";
49757
51427
  ProjectKeyScopes["PresencesWrite"] = "presences.write";
51428
+ ProjectKeyScopes["VideosRead"] = "videos.read";
51429
+ ProjectKeyScopes["VideosWrite"] = "videos.write";
49758
51430
  ProjectKeyScopes["DedicatedDatabasesExecute"] = "dedicatedDatabases.execute";
49759
51431
  ProjectKeyScopes["BackupsPoliciesRead"] = "backups.policies.read";
49760
51432
  ProjectKeyScopes["BackupsPoliciesWrite"] = "backups.policies.write";
@@ -50024,6 +51696,7 @@ exports.ProjectAuthMethodId = void 0;
50024
51696
  ProjectAuthMethodId["Invites"] = "invites";
50025
51697
  ProjectAuthMethodId["Jwt"] = "jwt";
50026
51698
  ProjectAuthMethodId["Phone"] = "phone";
51699
+ ProjectAuthMethodId["Passkey"] = "passkey";
50027
51700
  })(exports.ProjectAuthMethodId || (exports.ProjectAuthMethodId = {}));
50028
51701
 
50029
51702
  exports.ProjectOAuth2Auth0Prompt = void 0;
@@ -50165,6 +51838,7 @@ exports.ProjectPolicyId = void 0;
50165
51838
  ProjectPolicyId["Denydisposableemail"] = "deny-disposable-email";
50166
51839
  ProjectPolicyId["Denyfreeemail"] = "deny-free-email";
50167
51840
  ProjectPolicyId["Denycorporateemail"] = "deny-corporate-email";
51841
+ ProjectPolicyId["Passkey"] = "passkey";
50168
51842
  })(exports.ProjectPolicyId || (exports.ProjectPolicyId = {}));
50169
51843
 
50170
51844
  exports.ProjectProtocolId = void 0;
@@ -50627,6 +52301,24 @@ exports.VectorsDBIndexType = void 0;
50627
52301
  VectorsDBIndexType["Unique"] = "unique";
50628
52302
  })(exports.VectorsDBIndexType || (exports.VectorsDBIndexType = {}));
50629
52303
 
52304
+ exports.VideoOutput = void 0;
52305
+ (function (VideoOutput) {
52306
+ VideoOutput["Hls"] = "hls";
52307
+ VideoOutput["Dash"] = "dash";
52308
+ VideoOutput["Cmaf"] = "cmaf";
52309
+ })(exports.VideoOutput || (exports.VideoOutput = {}));
52310
+
52311
+ exports.VideoRenditionStatus = void 0;
52312
+ (function (VideoRenditionStatus) {
52313
+ VideoRenditionStatus["Pending"] = "pending";
52314
+ VideoRenditionStatus["Started"] = "started";
52315
+ VideoRenditionStatus["Ended"] = "ended";
52316
+ VideoRenditionStatus["Uploading"] = "uploading";
52317
+ VideoRenditionStatus["Ready"] = "ready";
52318
+ VideoRenditionStatus["Error"] = "error";
52319
+ VideoRenditionStatus["Aborted"] = "aborted";
52320
+ })(exports.VideoRenditionStatus || (exports.VideoRenditionStatus = {}));
52321
+
50630
52322
  exports.DatabaseType = void 0;
50631
52323
  (function (DatabaseType) {
50632
52324
  DatabaseType["Legacy"] = "legacy";
@@ -50863,6 +52555,7 @@ exports.WafRuleAction = void 0;
50863
52555
 
50864
52556
  exports.Account = Account;
50865
52557
  exports.Activities = Activities;
52558
+ exports.Admin = Admin;
50866
52559
  exports.Advisor = Advisor;
50867
52560
  exports.Affiliates = Affiliates;
50868
52561
  exports.Analytics = Analytics;
@@ -50915,6 +52608,7 @@ exports.Usage = Usage;
50915
52608
  exports.Users = Users;
50916
52609
  exports.Vcs = Vcs;
50917
52610
  exports.VectorsDB = VectorsDB;
52611
+ exports.Videos = Videos;
50918
52612
  exports.Waf = Waf;
50919
52613
  exports.Webhooks = Webhooks;
50920
52614
  //# sourceMappingURL=sdk.js.map