-
Notifications
You must be signed in to change notification settings - Fork 352
/
Copy pathindex.d.ts
3989 lines (3701 loc) · 163 KB
/
index.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
// Auto-generated by Stone, do not modify.
import { account, async, auth, check, common, contacts, file_properties, file_requests, files, paper, secondary_emails, seen_state, sharing, team, team_common, team_log, team_policies, users, users_common } from './dropbox_types';
export * from './dropbox_types';
export interface DropboxAuthOptions {
// An access token for making authenticated requests.
accessToken?: string;
// The time at which the access token expires.
accessTokenExpiresAt?: Date;
// A refresh token for retrieving access tokens
refreshToken?: string;
// The client id for your app. Used to create authentication URL.
clientId?: string;
// The client secret for your app. Used for refresh and token exchange.
clientSecret?: string;
// The fetch library for making requests.
fetch?: Function;
// A custom domain to use when making api requests. This should only be used for testing as scaffolding to avoid making network requests.
domain?: string;
// A custom delimiter to use when separating domain from subdomain. This should only be used for testing as scaffolding.
domainDelimiter?: string;
// An object (in the form of header: value) designed to set custom headers to use during a request.
customHeaders?: object;
// Whether request data is sent on body or as URL params. Defaults to false.
dataOnBody?: boolean;
}
export class DropboxAuth {
/**
* The DropboxAuth class that provides methods to manage, acquire, and refresh tokens.
*/
constructor();
/**
* The DropboxAuth class that provides methods to manage, acquire, and refresh tokens.
*/
constructor(options: DropboxAuthOptions);
/**
* Get the access token
* @returns {String} Access token
*/
getAccessToken(): string;
/**
* Get an OAuth2 access token from an OAuth2 Code.
* @param redirectUri A URL to redirect the user to after authenticating.
* This must be added to your app through the admin interface.
* @param code An OAuth2 code.
* @returns {Object} An object containing the token and related info (if applicable)
*/
getAccessTokenFromCode(redirectUri: string, code: string): Promise<DropboxResponse<object>>;
/**
* Get a URL that can be used to authenticate users for the Dropbox API.
* @arg {String} redirectUri - A URL to redirect the user to after
* authenticating. This must be added to your app through the admin interface.
* @arg {String} [state] - State that will be returned in the redirect URL to help
* prevent cross site scripting attacks.
* @arg {String} [authType] - auth type, defaults to 'token', other option is 'code'
* @arg {String} [tokenAccessType] - type of token to request. From the following:
* null - creates a token with the app default (either legacy or online)
* legacy - creates one long-lived token with no expiration
* online - create one short-lived token with an expiration
* offline - create one short-lived token with an expiration with a refresh token
* @arg {Array<String>} [scope] - scopes to request for the grant
* @arg {String} [includeGrantedScopes] - whether or not to include previously granted scopes.
* From the following:
* user - include user scopes in the grant
* team - include team scopes in the grant
* Note: if this user has never linked the app, include_granted_scopes must be None
* @arg {boolean} [usePKCE] - Whether or not to use Sha256 based PKCE. PKCE should be only use on
* client apps which doesn't call your server. It is less secure than non-PKCE flow but
* can be used if you are unable to safely retrieve your app secret
* @returns {Promise<String>} - Url to send user to for Dropbox API authentication
* returned in a promise
*/
getAuthenticationUrl(redirectUri: string, state?: string, authType?: 'token' | 'code', tokenAccessType?: null | 'legacy' | 'offline' | 'online', scope?: Array<String>, includeGrantedScopes?: 'none' | 'user' | 'team', usePKCE?: boolean): Promise<String>;
/**
* Get the client id
* @returns {String} Client id
*/
getClientId(): string;
/**
* Set the access token used to authenticate requests to the API.
* @param accessToken An access token.
*/
setAccessToken(accessToken: string): void;
/**
* Set the client id, which is used to help gain an access token.
* @param clientId Your app's client ID.
*/
setClientId(clientId: string): void;
/**
* Set the client secret
* @param clientSecret Your app's client secret.
*/
setClientSecret(clientSecret: string): void;
/**
* Sets the refresh token
* @param refreshToken - A refresh token
*/
setRefreshToken(refreshToken: string): void;
/**
* Gets the refresh token
* @returns {String} Refresh token
*/
getRefreshToken(): string;
/**
* Sets the access token's expiration date
* @param accessTokenExpiresAt - new expiration date
*/
setAccessTokenExpiresAt(accessTokenExpiresAt: Date): void;
/**
* Gets the access token's expiration date
* @returns {Date} date of token expiration
*/
getAccessTokenExpiresAt(): Date;
/**
* Sets the code verifier for PKCE flow
* @param {String} codeVerifier - new code verifier
*/
setCodeVerifier(codeVerifier: string): void;
/**
* Gets the code verifier for PKCE flow
* @returns {String} - code verifier for PKCE
*/
getCodeVerifier(): string;
/**
* Checks if a token is needed, can be refreshed and if the token is expired.
* If so, attempts to refresh access token
* @returns {Promise<*>}
*/
checkAndRefreshAccessToken(): void;
/**
* Refreshes the access token using the refresh token, if available
* @arg {List} scope - a subset of scopes from the original
* refresh to acquire with an access token
* @returns {Promise<*>}
*/
refreshAccessToken(scope?: Array<String>): void;
}
export interface DropboxOptions {
// Select user is only used for team functionality. It specifies which user the team access token should be acting as.
selectUser?: string;
// Select admin is only used by team functionality. It specifies which team admin the team access token should be acting as.
selectAdmin?: string;
// Root path to access other namespaces. Use to access team folders for example
pathRoot?: string;
// The DropboxAuth object used to authenticate requests. If this is set, the remaining parameters will be ignored.
auth?: DropboxAuth | null;
// An access token for making authenticated requests.
accessToken?: string;
// The time at which the access token expires.
accessTokenExpiresAt?: Date;
// A refresh token for retrieving access tokens
refreshToken?: string;
// The client id for your app. Used to create authentication URL.
clientId?: string;
// The client secret for your app. Used for refresh and token exchange.
clientSecret?: string;
// The fetch library for making requests.
fetch?: Function;
// A custom domain to use when making api requests. This should only be used for testing as scaffolding to avoid making network requests.
domain?: string;
// A custom delimiter to use when separating domain subdomain. This should only be used for testing as scaffolding.
domainDelimiter?: string;
// An object (in the form of header: value) designed to set custom headers to use during a request.
customHeaders?: object;
}
export class DropboxResponseError<T> {
/**
* The response class of HTTP errors from API calls using the Dropbox SDK.
*/
constructor(status: number, headers: any, error: T);
/**
* HTTP Status code of the call
*/
status: number;
/**
* Headers returned from the call. Set as any to support both node and browser.
*/
headers: any;
/**
* Serialized Error of the call
*/
error: T;
}
export class DropboxResponse<T> {
/**
* The response class of all successful API calls using the Dropbox SDK.
*/
constructor(status: number, headers: any, result: T);
/**
* HTTP Status code of the call
*/
status: number;
/**
* Headers returned from the call. Set as any to support both node and browser.
*/
headers: any;
/**
* Serialized Result of the call
*/
result: T;
}
export class Dropbox {
/**
* The Dropbox SDK class that provides methods to read, write and
* create files or folders in a user or team's Dropbox.
*/
constructor();
/**
* The Dropbox SDK class that provides methods to read, write and
* create files or folders in a user or team's Dropbox.
*/
constructor(options: DropboxOptions);
/*ROUTES*/
/**
* Sets a user's profile photo.
*
* Route attributes:
* scope: account_info.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<account.SetProfilePhotoError>.
* @param arg The request parameters.
*/
public accountSetProfilePhoto(arg: account.SetProfilePhotoArg): Promise<DropboxResponse<account.SetProfilePhotoResult>>;
/**
* Creates an OAuth 2.0 access token from the supplied OAuth 1.0 access
* token.
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<auth.TokenFromOAuth1Error>.
* @param arg The request parameters.
*/
public authTokenFromOauth1(arg: auth.TokenFromOAuth1Arg): Promise<DropboxResponse<auth.TokenFromOAuth1Result>>;
/**
* Disables the access token used to authenticate the call. If there is a
* corresponding refresh token for the access token, this disables that
* refresh token, as well as any other access tokens for that refresh token.
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<void>.
*/
public authTokenRevoke(): Promise<DropboxResponse<void>>;
/**
* This endpoint performs App Authentication, validating the supplied app
* key and secret, and returns the supplied string, to allow you to test
* your code and connection to the Dropbox API. It has no other effect. If
* you receive an HTTP 200 response with the supplied query, it indicates at
* least part of the Dropbox API infrastructure is working and that the app
* key and secret valid.
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<void>.
* @param arg The request parameters.
*/
public checkApp(arg: check.EchoArg): Promise<DropboxResponse<check.EchoResult>>;
/**
* This endpoint performs User Authentication, validating the supplied
* access token, and returns the supplied string, to allow you to test your
* code and connection to the Dropbox API. It has no other effect. If you
* receive an HTTP 200 response with the supplied query, it indicates at
* least part of the Dropbox API infrastructure is working and that the
* access token is valid.
*
* Route attributes:
* scope: account_info.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<void>.
* @param arg The request parameters.
*/
public checkUser(arg: check.EchoArg): Promise<DropboxResponse<check.EchoResult>>;
/**
* Removes all manually added contacts. You'll still keep contacts who are
* on your team or who you imported. New contacts will be added when you
* share.
*
* Route attributes:
* scope: contacts.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<void>.
*/
public contactsDeleteManualContacts(): Promise<DropboxResponse<void>>;
/**
* Removes manually added contacts from the given list.
*
* Route attributes:
* scope: contacts.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<contacts.DeleteManualContactsError>.
* @param arg The request parameters.
*/
public contactsDeleteManualContactsBatch(arg: contacts.DeleteManualContactsArg): Promise<DropboxResponse<void>>;
/**
* Add property groups to a Dropbox file. See templatesAddForUser() or
* templatesAddForTeam() to create new templates.
*
* Route attributes:
* scope: files.metadata.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.AddPropertiesError>.
* @param arg The request parameters.
*/
public filePropertiesPropertiesAdd(arg: file_properties.AddPropertiesArg): Promise<DropboxResponse<void>>;
/**
* Overwrite property groups associated with a file. This endpoint should be
* used instead of propertiesUpdate() when property groups are being updated
* via a "snapshot" instead of via a "delta". In other words, this endpoint
* will delete all omitted fields from a property group, whereas
* propertiesUpdate() will only delete fields that are explicitly marked for
* deletion.
*
* Route attributes:
* scope: files.metadata.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.InvalidPropertyGroupError>.
* @param arg The request parameters.
*/
public filePropertiesPropertiesOverwrite(arg: file_properties.OverwritePropertyGroupArg): Promise<DropboxResponse<void>>;
/**
* Permanently removes the specified property group from the file. To remove
* specific property field key value pairs, see propertiesUpdate(). To
* update a template, see templatesUpdateForUser() or
* templatesUpdateForTeam(). To remove a template, see
* templatesRemoveForUser() or templatesRemoveForTeam().
*
* Route attributes:
* scope: files.metadata.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.RemovePropertiesError>.
* @param arg The request parameters.
*/
public filePropertiesPropertiesRemove(arg: file_properties.RemovePropertiesArg): Promise<DropboxResponse<void>>;
/**
* Search across property templates for particular property field values.
*
* Route attributes:
* scope: files.metadata.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.PropertiesSearchError>.
* @param arg The request parameters.
*/
public filePropertiesPropertiesSearch(arg: file_properties.PropertiesSearchArg): Promise<DropboxResponse<file_properties.PropertiesSearchResult>>;
/**
* Once a cursor has been retrieved from propertiesSearch(), use this to
* paginate through all search results.
*
* Route attributes:
* scope: files.metadata.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.PropertiesSearchContinueError>.
* @param arg The request parameters.
*/
public filePropertiesPropertiesSearchContinue(arg: file_properties.PropertiesSearchContinueArg): Promise<DropboxResponse<file_properties.PropertiesSearchResult>>;
/**
* Add, update or remove properties associated with the supplied file and
* templates. This endpoint should be used instead of propertiesOverwrite()
* when property groups are being updated via a "delta" instead of via a
* "snapshot" . In other words, this endpoint will not delete any omitted
* fields from a property group, whereas propertiesOverwrite() will delete
* any fields that are omitted from a property group.
*
* Route attributes:
* scope: files.metadata.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.UpdatePropertiesError>.
* @param arg The request parameters.
*/
public filePropertiesPropertiesUpdate(arg: file_properties.UpdatePropertiesArg): Promise<DropboxResponse<void>>;
/**
* Add a template associated with a team. See propertiesAdd() to add
* properties to a file or folder. Note: this endpoint will create
* team-owned templates.
*
* Route attributes:
* scope: files.team_metadata.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.ModifyTemplateError>.
* @param arg The request parameters.
*/
public filePropertiesTemplatesAddForTeam(arg: file_properties.AddTemplateArg): Promise<DropboxResponse<file_properties.AddTemplateResult>>;
/**
* Add a template associated with a user. See propertiesAdd() to add
* properties to a file. This endpoint can't be called on a team member or
* admin's behalf.
*
* Route attributes:
* scope: files.metadata.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.ModifyTemplateError>.
* @param arg The request parameters.
*/
public filePropertiesTemplatesAddForUser(arg: file_properties.AddTemplateArg): Promise<DropboxResponse<file_properties.AddTemplateResult>>;
/**
* Get the schema for a specified template.
*
* Route attributes:
* scope: files.team_metadata.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.TemplateError>.
* @param arg The request parameters.
*/
public filePropertiesTemplatesGetForTeam(arg: file_properties.GetTemplateArg): Promise<DropboxResponse<file_properties.GetTemplateResult>>;
/**
* Get the schema for a specified template. This endpoint can't be called on
* a team member or admin's behalf.
*
* Route attributes:
* scope: files.metadata.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.TemplateError>.
* @param arg The request parameters.
*/
public filePropertiesTemplatesGetForUser(arg: file_properties.GetTemplateArg): Promise<DropboxResponse<file_properties.GetTemplateResult>>;
/**
* Get the template identifiers for a team. To get the schema of each
* template use templatesGetForTeam().
*
* Route attributes:
* scope: files.team_metadata.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.TemplateError>.
*/
public filePropertiesTemplatesListForTeam(): Promise<DropboxResponse<file_properties.ListTemplateResult>>;
/**
* Get the template identifiers for a team. To get the schema of each
* template use templatesGetForUser(). This endpoint can't be called on a
* team member or admin's behalf.
*
* Route attributes:
* scope: files.metadata.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.TemplateError>.
*/
public filePropertiesTemplatesListForUser(): Promise<DropboxResponse<file_properties.ListTemplateResult>>;
/**
* Permanently removes the specified template created from
* templatesAddForUser(). All properties associated with the template will
* also be removed. This action cannot be undone.
*
* Route attributes:
* scope: files.team_metadata.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.TemplateError>.
* @param arg The request parameters.
*/
public filePropertiesTemplatesRemoveForTeam(arg: file_properties.RemoveTemplateArg): Promise<DropboxResponse<void>>;
/**
* Permanently removes the specified template created from
* templatesAddForUser(). All properties associated with the template will
* also be removed. This action cannot be undone.
*
* Route attributes:
* scope: files.metadata.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.TemplateError>.
* @param arg The request parameters.
*/
public filePropertiesTemplatesRemoveForUser(arg: file_properties.RemoveTemplateArg): Promise<DropboxResponse<void>>;
/**
* Update a template associated with a team. This route can update the
* template name, the template description and add optional properties to
* templates.
*
* Route attributes:
* scope: files.team_metadata.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.ModifyTemplateError>.
* @param arg The request parameters.
*/
public filePropertiesTemplatesUpdateForTeam(arg: file_properties.UpdateTemplateArg): Promise<DropboxResponse<file_properties.UpdateTemplateResult>>;
/**
* Update a template associated with a user. This route can update the
* template name, the template description and add optional properties to
* templates. This endpoint can't be called on a team member or admin's
* behalf.
*
* Route attributes:
* scope: files.metadata.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_properties.ModifyTemplateError>.
* @param arg The request parameters.
*/
public filePropertiesTemplatesUpdateForUser(arg: file_properties.UpdateTemplateArg): Promise<DropboxResponse<file_properties.UpdateTemplateResult>>;
/**
* Returns the total number of file requests owned by this user. Includes
* both open and closed file requests.
*
* Route attributes:
* scope: file_requests.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_requests.CountFileRequestsError>.
*/
public fileRequestsCount(): Promise<DropboxResponse<file_requests.CountFileRequestsResult>>;
/**
* Creates a file request for this user.
*
* Route attributes:
* scope: file_requests.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_requests.CreateFileRequestError>.
* @param arg The request parameters.
*/
public fileRequestsCreate(arg: file_requests.CreateFileRequestArgs): Promise<DropboxResponse<file_requests.FileRequest>>;
/**
* Delete a batch of closed file requests.
*
* Route attributes:
* scope: file_requests.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_requests.DeleteFileRequestError>.
* @param arg The request parameters.
*/
public fileRequestsDelete(arg: file_requests.DeleteFileRequestArgs): Promise<DropboxResponse<file_requests.DeleteFileRequestsResult>>;
/**
* Delete all closed file requests owned by this user.
*
* Route attributes:
* scope: file_requests.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_requests.DeleteAllClosedFileRequestsError>.
*/
public fileRequestsDeleteAllClosed(): Promise<DropboxResponse<file_requests.DeleteAllClosedFileRequestsResult>>;
/**
* Returns the specified file request.
*
* Route attributes:
* scope: file_requests.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_requests.GetFileRequestError>.
* @param arg The request parameters.
*/
public fileRequestsGet(arg: file_requests.GetFileRequestArgs): Promise<DropboxResponse<file_requests.FileRequest>>;
/**
* Returns a list of file requests owned by this user. For apps with the app
* folder permission, this will only return file requests with destinations
* in the app folder.
*
* Route attributes:
* scope: file_requests.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_requests.ListFileRequestsError>.
* @param arg The request parameters.
*/
public fileRequestsListV2(arg: file_requests.ListFileRequestsArg): Promise<DropboxResponse<file_requests.ListFileRequestsV2Result>>;
/**
* Returns a list of file requests owned by this user. For apps with the app
* folder permission, this will only return file requests with destinations
* in the app folder.
*
* Route attributes:
* scope: file_requests.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_requests.ListFileRequestsError>.
*/
public fileRequestsList(): Promise<DropboxResponse<file_requests.ListFileRequestsResult>>;
/**
* Once a cursor has been retrieved from listV2(), use this to paginate
* through all file requests. The cursor must come from a previous call to
* listV2() or listContinue().
*
* Route attributes:
* scope: file_requests.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_requests.ListFileRequestsContinueError>.
* @param arg The request parameters.
*/
public fileRequestsListContinue(arg: file_requests.ListFileRequestsContinueArg): Promise<DropboxResponse<file_requests.ListFileRequestsV2Result>>;
/**
* Update a file request.
*
* Route attributes:
* scope: file_requests.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<file_requests.UpdateFileRequestError>.
* @param arg The request parameters.
*/
public fileRequestsUpdate(arg: file_requests.UpdateFileRequestArgs): Promise<DropboxResponse<file_requests.FileRequest>>;
/**
* Returns the metadata for a file or folder. This is an alpha endpoint
* compatible with the properties API. Note: Metadata for the root folder is
* unsupported.
*
* Route attributes:
* scope: files.metadata.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<files.AlphaGetMetadataError>.
* @deprecated
* @param arg The request parameters.
*/
public filesAlphaGetMetadata(arg: files.AlphaGetMetadataArg): Promise<DropboxResponse<files.FileMetadataReference|files.FolderMetadataReference|files.DeletedMetadataReference>>;
/**
* Create a new file with the contents provided in the request. Note that
* the behavior of this alpha endpoint is unstable and subject to change. Do
* not use this to upload a file larger than 150 MB. Instead, create an
* upload session with uploadSessionStart().
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<files.UploadError>.
* @deprecated
* @param arg The request parameters.
*/
public filesAlphaUpload(arg: files.UploadArg): Promise<DropboxResponse<files.FileMetadata>>;
/**
* Copy a file or folder to a different location in the user's Dropbox. If
* the source path is a folder all its contents will be copied.
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<files.RelocationError>.
* @param arg The request parameters.
*/
public filesCopyV2(arg: files.RelocationArg): Promise<DropboxResponse<files.RelocationResult>>;
/**
* Copy a file or folder to a different location in the user's Dropbox. If
* the source path is a folder all its contents will be copied.
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<files.RelocationError>.
* @deprecated
* @param arg The request parameters.
*/
public filesCopy(arg: files.RelocationArg): Promise<DropboxResponse<files.FileMetadataReference|files.FolderMetadataReference|files.DeletedMetadataReference>>;
/**
* Copy multiple files or folders to different locations at once in the
* user's Dropbox. This route will replace copyBatch(). The main difference
* is this route will return status for each entry, while copyBatch() raises
* failure if any entry fails. This route will either finish synchronously,
* or return a job ID and do the async copy job in background. Please use
* copyBatchCheckV2() to check the job status.
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<void>.
* @param arg The request parameters.
*/
public filesCopyBatchV2(arg: files.CopyBatchArg): Promise<DropboxResponse<files.RelocationBatchV2Launch>>;
/**
* Copy multiple files or folders to different locations at once in the
* user's Dropbox. This route will return job ID immediately and do the
* async copy job in background. Please use copyBatchCheck() to check the
* job status.
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<void>.
* @deprecated
* @param arg The request parameters.
*/
public filesCopyBatch(arg: files.RelocationBatchArg): Promise<DropboxResponse<files.RelocationBatchLaunch>>;
/**
* Returns the status of an asynchronous job for copyBatchV2(). It returns
* list of results for each entry.
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<async.PollError>.
* @param arg The request parameters.
*/
public filesCopyBatchCheckV2(arg: async.PollArg): Promise<DropboxResponse<files.RelocationBatchV2JobStatus>>;
/**
* Returns the status of an asynchronous job for copyBatch(). If success, it
* returns list of results for each entry.
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<async.PollError>.
* @deprecated
* @param arg The request parameters.
*/
public filesCopyBatchCheck(arg: async.PollArg): Promise<DropboxResponse<files.RelocationBatchJobStatus>>;
/**
* Get a copy reference to a file or folder. This reference string can be
* used to save that file or folder to another user's Dropbox by passing it
* to copyReferenceSave().
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<files.GetCopyReferenceError>.
* @param arg The request parameters.
*/
public filesCopyReferenceGet(arg: files.GetCopyReferenceArg): Promise<DropboxResponse<files.GetCopyReferenceResult>>;
/**
* Save a copy reference returned by copyReferenceGet() to the user's
* Dropbox.
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<files.SaveCopyReferenceError>.
* @param arg The request parameters.
*/
public filesCopyReferenceSave(arg: files.SaveCopyReferenceArg): Promise<DropboxResponse<files.SaveCopyReferenceResult>>;
/**
* Create a folder at a given path.
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<files.CreateFolderError>.
* @param arg The request parameters.
*/
public filesCreateFolderV2(arg: files.CreateFolderArg): Promise<DropboxResponse<files.CreateFolderResult>>;
/**
* Create a folder at a given path.
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<files.CreateFolderError>.
* @deprecated
* @param arg The request parameters.
*/
public filesCreateFolder(arg: files.CreateFolderArg): Promise<DropboxResponse<files.FolderMetadata>>;
/**
* Create multiple folders at once. This route is asynchronous for large
* batches, which returns a job ID immediately and runs the create folder
* batch asynchronously. Otherwise, creates the folders and returns the
* result synchronously for smaller inputs. You can force asynchronous
* behaviour by using the CreateFolderBatchArg.force_async flag. Use
* createFolderBatchCheck() to check the job status.
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<void>.
* @param arg The request parameters.
*/
public filesCreateFolderBatch(arg: files.CreateFolderBatchArg): Promise<DropboxResponse<files.CreateFolderBatchLaunch>>;
/**
* Returns the status of an asynchronous job for createFolderBatch(). If
* success, it returns list of result for each entry.
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<async.PollError>.
* @param arg The request parameters.
*/
public filesCreateFolderBatchCheck(arg: async.PollArg): Promise<DropboxResponse<files.CreateFolderBatchJobStatus>>;
/**
* Delete the file or folder at a given path. If the path is a folder, all
* its contents will be deleted too. A successful response indicates that
* the file or folder was deleted. The returned metadata will be the
* corresponding FileMetadata or FolderMetadata for the item at time of
* deletion, and not a DeletedMetadata object.
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<files.DeleteError>.
* @param arg The request parameters.
*/
public filesDeleteV2(arg: files.DeleteArg): Promise<DropboxResponse<files.DeleteResult>>;
/**
* Delete the file or folder at a given path. If the path is a folder, all
* its contents will be deleted too. A successful response indicates that
* the file or folder was deleted. The returned metadata will be the
* corresponding FileMetadata or FolderMetadata for the item at time of
* deletion, and not a DeletedMetadata object.
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<files.DeleteError>.
* @deprecated
* @param arg The request parameters.
*/
public filesDelete(arg: files.DeleteArg): Promise<DropboxResponse<files.FileMetadataReference|files.FolderMetadataReference|files.DeletedMetadataReference>>;
/**
* Delete multiple files/folders at once. This route is asynchronous, which
* returns a job ID immediately and runs the delete batch asynchronously.
* Use deleteBatchCheck() to check the job status.
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<void>.
* @param arg The request parameters.
*/
public filesDeleteBatch(arg: files.DeleteBatchArg): Promise<DropboxResponse<files.DeleteBatchLaunch>>;
/**
* Returns the status of an asynchronous job for deleteBatch(). If success,
* it returns list of result for each entry.
*
* Route attributes:
* scope: files.content.write
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<async.PollError>.
* @param arg The request parameters.
*/
public filesDeleteBatchCheck(arg: async.PollArg): Promise<DropboxResponse<files.DeleteBatchJobStatus>>;
/**
* Download a file from a user's Dropbox.
*
* Route attributes:
* scope: files.content.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<files.DownloadError>.
* @param arg The request parameters.
*/
public filesDownload(arg: files.DownloadArg): Promise<DropboxResponse<files.FileMetadata>>;
/**
* Download a folder from the user's Dropbox, as a zip file. The folder must
* be less than 20 GB in size and any single file within must be less than 4
* GB in size. The resulting zip must have fewer than 10,000 total file and
* folder entries, including the top level folder. The input cannot be a
* single file.
*
* Route attributes:
* scope: files.content.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<files.DownloadZipError>.
* @param arg The request parameters.
*/
public filesDownloadZip(arg: files.DownloadZipArg): Promise<DropboxResponse<files.DownloadZipResult>>;
/**
* Export a file from a user's Dropbox. This route only supports exporting
* files that cannot be downloaded directly and whose
* ExportResult.file_metadata has ExportInfo.export_as populated.
*
* Route attributes:
* scope: files.content.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<files.ExportError>.
* @param arg The request parameters.
*/
public filesExport(arg: files.ExportArg): Promise<DropboxResponse<files.ExportResult>>;
/**
* Return the lock metadata for the given list of paths.
*
* Route attributes:
* scope: files.content.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<files.LockFileError>.
* @param arg The request parameters.
*/
public filesGetFileLockBatch(arg: files.LockFileBatchArg): Promise<DropboxResponse<files.LockFileBatchResult>>;
/**
* Returns the metadata for a file or folder. Note: Metadata for the root
* folder is unsupported.
*
* Route attributes:
* scope: files.metadata.read
*
* When an error occurs, the route rejects the promise with type
* DropboxResponseError<files.GetMetadataError>.
* @param arg The request parameters.
*/
public filesGetMetadata(arg: files.GetMetadataArg): Promise<DropboxResponse<files.FileMetadataReference|files.FolderMetadataReference|files.DeletedMetadataReference>>;
/**
* Get a preview for a file. Currently, PDF previews are generated for files
* with the following extensions: .ai, .doc, .docm, .docx, .eps, .gdoc,
* .gslides, .odp, .odt, .pps, .ppsm, .ppsx, .ppt, .pptm, .pptx, .rtf. HTML
* previews are generated for files with the following extensions: .csv,