| 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 |
18x
43x
34x
| /* @flow */
type pCloudApiMethod = { auth: boolean, type: "read" | "write" };
export const pCloudApiMethods: { [id: string]: pCloudApiMethod } = {
oauth2_token: { auth: false, type: "write" },
register: { auth: false, type: "write" },
listfolder: { auth: true, type: "read" },
createfolder: { auth: true, type: "write" },
userinfo: { auth: true, type: "read" },
currentserver: { auth: false, type: "read" },
uploadfile: { auth: true, type: "write" },
getfilelink: { auth: true, type: "read" },
getapiserver: { auth: false, type: "read" },
renamefolder: { auth: true, type: "write" },
deletefile: { auth: true, type: "write" },
deletefolderrecursive: { auth: true, type: "write" },
logout: { auth: true, type: "write" },
createfolderifnotexists: { auth: true, type: "write" },
getthumblink: { auth: true, type: "read" },
getvideolink: { auth: true, type: "read" },
getaudiolink: { auth: true, type: "read" },
deletefolder: { auth: true, type: "write" },
diff: { auth: true, type: "write" },
subscribe: { auth: true, type: "write" },
listnotifications: { auth: true, type: "write" },
readnotifications: { auth: true, type: "write" },
listshares: { auth: true, type: "read" },
acceptshare: { auth: true, type: "write" },
declineshare: { auth: true, type: "write" },
removeshare: { auth: true, type: "write" },
cancelsharerequest: { auth: true, type: "write" },
changeshare: { auth: true, type: "write" },
sharefolder: { auth: true, type: "write" },
copyfile: { auth: true, type: "write" },
copyfolder: { auth: true, type: "write" },
listpublinks: { auth: true, type: "read" },
getfilepublink: { auth: true, type: "write" },
getfolderpublink: { auth: true, type: "write" },
gettreepublink: { auth: true, type: "write" },
deletepublink: { auth: true, type: "write" },
changepublink: { auth: true, type: "write" },
copypubfile: { auth: true, type: "write" },
renamefile: { auth: true, type: "write" },
showpublink: { auth: false, type: "read" },
getzip: { auth: true, type: "write" },
getziplink: { auth: true, type: "write" },
createuploadlink: { auth: true, type: "write" },
listuploadlinks: { auth: true, type: "read" },
deleteuploadlink: { auth: true, type: "write" },
changeuploadlink: { auth: true, type: "write" },
uploadlinkprogress: { auth: true, type: "read" },
downloadfile: { auth: true, type: "write" },
lostpassword: { auth: false, type: "write" },
resetpassword: { auth: false, type: "write" },
changepassword: { auth: true, type: "write" },
verifyemail: { auth: false, type: "write" },
sharerequestinfo: { auth: false, type: "read" },
sendverificationemail: { auth: true, type: "write" },
getthumbslinks: { auth: true, type: "read" },
getthumbs: { auth: true, type: "read" },
uploadprogress: { auth: true, type: "write" },
invite: { auth: true, type: "write" },
fb_assign: { auth: true, type: "write" },
userbonuses: { auth: true, type: "write" },
givebonus: { auth: true, type: "write" },
userinvites: { auth: true, type: "write" },
getvideolinks: { auth: true, type: "read" },
backup_modify: { auth: true, type: "write" },
backup_list: { auth: true, type: "read" },
social_assign: { auth: true, type: "write" },
extractarchive: { auth: true, type: "write" },
extractarchiveprogress: { auth: true, type: "write" },
listrevisions: { auth: true, type: "read" },
revertrevision: { auth: true, type: "write" },
supportedlanguages: { auth: true, type: "read" },
newsletter_check: { auth: true, type: "read" },
blockchain_address: { auth: true, type: "read" },
trash_list: { auth: true, type: "read" },
trash_clear: { auth: true, type: "write" },
trash_restore: { auth: true, type: "write" },
trash_getrestorepath: { auth: true, type: "write" },
collection_list: { auth: true, type: "read" },
collection_details: { auth: true, type: "read" },
collection_create: { auth: true, type: "write" },
collection_rename: { auth: true, type: "write" },
collection_delete: { auth: true, type: "write" },
collection_linkfiles: { auth: true, type: "write" },
collection_unlinkfiles: { auth: true, type: "write" },
collection_move: { auth: true, type: "write" },
app_userlist: { auth: true, type: "read" },
app_userdelete: { auth: true, type: "write" },
gettextfile: { auth: true, type: "write" },
getpubtextfile: { auth: false, type: "write" },
// business
account_teams: { auth: true, type: "read" },
account_teamcreate: { auth: true, type: "read" },
account_info: { auth: true, type: "read" },
account_modify: { auth: true, type: "write" },
account_users: { auth: true, type: "read" },
account_invitemail: { auth: true, type: "read" },
account_usermodify: { auth: true, type: "write" },
account_teammodify: { auth: true, type: "write" },
account_teamlink: { auth: true, type: "write" },
account_billinginfo: { auth: true, type: "read" },
account_invoice_modify: { auth: true, type: "write" },
account_upload_avatar: { auth: true, type: "write" },
account_teamunlink: { auth: true, type: "write" },
account_teamlink_head: { auth: true, type: "write" },
account_teamlink_accept: { auth: true, type: "write" },
account_invitelist: { auth: true, type: "read" },
account_invalidate_password: { auth: true, type: "write" },
account_invitecancel: { auth: true, type: "write" },
commentlist: { auth: true, type: "read" },
commentpost: { auth: true, type: "write" },
commentdelete: { auth: true, type: "write" },
eventsubscribe: { auth: true, type: "write" },
account_teamshare: { auth: true, type: "write" },
account_modifyshare: { auth: true, type: "write" },
account_stopshare: { auth: true, type: "write" },
account_listshares: { auth: true, type: "read" },
account_log: { auth: true, type: "read" },
account_paystripe: { auth: true, type: "read" },
listtokens: { auth: true, type: "read" },
deletetoken: { auth: true, type: "write" },
savezip: { auth: true, type: "write" },
savezipprogress: { auth: true, type: "write" },
contactload: { auth: true, type: "write" },
sendpublink: { auth: true, type: "write" },
contactlist: { auth: true, type: "read" },
account_viewtoken: { auth: true, type: "write" },
eventslast: { auth: true, type: "write" },
search: { auth: true, type: "read" },
issueproforma: { auth: true, type: "write" },
listproforma: { auth: true, type: "write" },
getbreadcrumb: { auth: true, type: "read" },
getpreviewlink: { auth: true, type: "read" },
getpublinkpreviewdownload: { type: "read", auth: false },
setlanguage: { auth: true, type: "write" },
account_branding: { auth: true, type: "read" },
account_branding_set: { auth: true, type: "write" },
account_branding_logo_upload: { auth: true, type: "write" },
account_logintoken: { auth: true, type: "write" },
getpublinkstats: { auth: true, type: "read" },
getpublinkadpreference: { auth: true, type: "read" },
setpublinkadpreference: { auth: true, type: "write" },
account_ispublinktrafficlimited: { auth: true, type: "read" },
getreferrallink: { auth: true, type: "read" },
sendreferrallink: { auth: true, type: "write" },
listpaymentsubscriptions: { auth: true, type: "read" },
getip: { auth: false, type: "read" },
crypto_getuserkeys: { auth: true, type: "read" },
crypto_getfolderkey: { auth: true, type: "read" },
crypto_getfilekey: { auth: true, type: "read" },
crypto_reset: { auth: true, type: "write" },
crypto_setuserkeys: { auth: true, type: "write" },
crypto_getuserhint: { auth: true, type: "write" },
upload_create: { auth: true, type: "write" },
upload_write: { auth: true, type: "write" },
upload_save: { auth: true, type: "write" },
crypto_getroot: { auth: true, type: "read" },
crypto_getfolderskey: { auth: true, type: "read" },
stat: { auth: true, type: "read" }
};
export function isApiMethod(method: string): boolean {
return method in pCloudApiMethods;
}
export function isAuthMethod(method: string): boolean {
return isApiMethod(method) && pCloudApiMethods[method].auth;
}
export function isOAuthMethod(method: string): boolean {
return isAuthMethod(method) && "oauth" in pCloudApiMethods[method];
}
|