@protontech/drive-sdk 0.0.10

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.
Files changed (594) hide show
  1. package/README.md +17 -0
  2. package/dist/cache/index.d.ts +2 -0
  3. package/dist/cache/index.js +6 -0
  4. package/dist/cache/index.js.map +1 -0
  5. package/dist/cache/interface.d.ts +105 -0
  6. package/dist/cache/interface.js +3 -0
  7. package/dist/cache/interface.js.map +1 -0
  8. package/dist/cache/memoryCache.d.ts +18 -0
  9. package/dist/cache/memoryCache.js +78 -0
  10. package/dist/cache/memoryCache.js.map +1 -0
  11. package/dist/cache/memoryCache.test.d.ts +1 -0
  12. package/dist/cache/memoryCache.test.js +121 -0
  13. package/dist/cache/memoryCache.test.js.map +1 -0
  14. package/dist/config.d.ts +2 -0
  15. package/dist/config.js +11 -0
  16. package/dist/config.js.map +1 -0
  17. package/dist/crypto/driveCrypto.d.ts +209 -0
  18. package/dist/crypto/driveCrypto.js +364 -0
  19. package/dist/crypto/driveCrypto.js.map +1 -0
  20. package/dist/crypto/driveCrypto.test.d.ts +1 -0
  21. package/dist/crypto/driveCrypto.test.js +42 -0
  22. package/dist/crypto/driveCrypto.test.js.map +1 -0
  23. package/dist/crypto/hmac.d.ts +22 -0
  24. package/dist/crypto/hmac.js +44 -0
  25. package/dist/crypto/hmac.js.map +1 -0
  26. package/dist/crypto/index.d.ts +6 -0
  27. package/dist/crypto/index.js +13 -0
  28. package/dist/crypto/index.js.map +1 -0
  29. package/dist/crypto/interface.d.ts +125 -0
  30. package/dist/crypto/interface.js +10 -0
  31. package/dist/crypto/interface.js.map +1 -0
  32. package/dist/crypto/openPGPCrypto.d.ts +145 -0
  33. package/dist/crypto/openPGPCrypto.js +250 -0
  34. package/dist/crypto/openPGPCrypto.js.map +1 -0
  35. package/dist/crypto/utils.d.ts +2 -0
  36. package/dist/crypto/utils.js +35 -0
  37. package/dist/crypto/utils.js.map +1 -0
  38. package/dist/errors.d.ts +138 -0
  39. package/dist/errors.js +163 -0
  40. package/dist/errors.js.map +1 -0
  41. package/dist/index.d.ts +24 -0
  42. package/dist/index.js +48 -0
  43. package/dist/index.js.map +1 -0
  44. package/dist/interface/account.d.ts +36 -0
  45. package/dist/interface/account.js +3 -0
  46. package/dist/interface/account.js.map +1 -0
  47. package/dist/interface/author.d.ts +26 -0
  48. package/dist/interface/author.js +3 -0
  49. package/dist/interface/author.js.map +1 -0
  50. package/dist/interface/devices.d.ts +18 -0
  51. package/dist/interface/devices.js +10 -0
  52. package/dist/interface/devices.js.map +1 -0
  53. package/dist/interface/download.d.ts +29 -0
  54. package/dist/interface/download.js +3 -0
  55. package/dist/interface/download.js.map +1 -0
  56. package/dist/interface/events.d.ts +26 -0
  57. package/dist/interface/events.js +11 -0
  58. package/dist/interface/events.js.map +1 -0
  59. package/dist/interface/httpClient.d.ts +38 -0
  60. package/dist/interface/httpClient.js +3 -0
  61. package/dist/interface/httpClient.js.map +1 -0
  62. package/dist/interface/index.d.ts +43 -0
  63. package/dist/interface/index.js +22 -0
  64. package/dist/interface/index.js.map +1 -0
  65. package/dist/interface/nodes.d.ts +161 -0
  66. package/dist/interface/nodes.js +21 -0
  67. package/dist/interface/nodes.js.map +1 -0
  68. package/dist/interface/result.d.ts +9 -0
  69. package/dist/interface/result.js +11 -0
  70. package/dist/interface/result.js.map +1 -0
  71. package/dist/interface/sharing.d.ts +73 -0
  72. package/dist/interface/sharing.js +9 -0
  73. package/dist/interface/sharing.js.map +1 -0
  74. package/dist/interface/telemetry.d.ts +61 -0
  75. package/dist/interface/telemetry.js +18 -0
  76. package/dist/interface/telemetry.js.map +1 -0
  77. package/dist/interface/thumbnail.d.ts +17 -0
  78. package/dist/interface/thumbnail.js +9 -0
  79. package/dist/interface/thumbnail.js.map +1 -0
  80. package/dist/interface/upload.d.ts +16 -0
  81. package/dist/interface/upload.js +3 -0
  82. package/dist/interface/upload.js.map +1 -0
  83. package/dist/internal/apiService/apiService.d.ts +51 -0
  84. package/dist/internal/apiService/apiService.js +305 -0
  85. package/dist/internal/apiService/apiService.js.map +1 -0
  86. package/dist/internal/apiService/apiService.test.d.ts +1 -0
  87. package/dist/internal/apiService/apiService.test.js +237 -0
  88. package/dist/internal/apiService/apiService.test.js.map +1 -0
  89. package/dist/internal/apiService/coreTypes.d.ts +24438 -0
  90. package/dist/internal/apiService/coreTypes.js +7 -0
  91. package/dist/internal/apiService/coreTypes.js.map +1 -0
  92. package/dist/internal/apiService/driveTypes.d.ts +11840 -0
  93. package/dist/internal/apiService/driveTypes.js +7 -0
  94. package/dist/internal/apiService/driveTypes.js.map +1 -0
  95. package/dist/internal/apiService/errorCodes.d.ts +30 -0
  96. package/dist/internal/apiService/errorCodes.js +11 -0
  97. package/dist/internal/apiService/errorCodes.js.map +1 -0
  98. package/dist/internal/apiService/errors.d.ts +19 -0
  99. package/dist/internal/apiService/errors.js +76 -0
  100. package/dist/internal/apiService/errors.js.map +1 -0
  101. package/dist/internal/apiService/errors.test.d.ts +1 -0
  102. package/dist/internal/apiService/errors.test.js +69 -0
  103. package/dist/internal/apiService/errors.test.js.map +1 -0
  104. package/dist/internal/apiService/index.d.ts +7 -0
  105. package/dist/internal/apiService/index.js +30 -0
  106. package/dist/internal/apiService/index.js.map +1 -0
  107. package/dist/internal/apiService/observerStream.d.ts +3 -0
  108. package/dist/internal/apiService/observerStream.js +15 -0
  109. package/dist/internal/apiService/observerStream.js.map +1 -0
  110. package/dist/internal/apiService/transformers.d.ts +4 -0
  111. package/dist/internal/apiService/transformers.js +48 -0
  112. package/dist/internal/apiService/transformers.js.map +1 -0
  113. package/dist/internal/batchLoading.d.ts +34 -0
  114. package/dist/internal/batchLoading.js +68 -0
  115. package/dist/internal/batchLoading.js.map +1 -0
  116. package/dist/internal/batchLoading.test.d.ts +1 -0
  117. package/dist/internal/batchLoading.test.js +50 -0
  118. package/dist/internal/batchLoading.test.js.map +1 -0
  119. package/dist/internal/devices/apiService.d.ts +38 -0
  120. package/dist/internal/devices/apiService.js +105 -0
  121. package/dist/internal/devices/apiService.js.map +1 -0
  122. package/dist/internal/devices/cryptoService.d.ts +30 -0
  123. package/dist/internal/devices/cryptoService.js +47 -0
  124. package/dist/internal/devices/cryptoService.js.map +1 -0
  125. package/dist/internal/devices/index.d.ts +15 -0
  126. package/dist/internal/devices/index.js +22 -0
  127. package/dist/internal/devices/index.js.map +1 -0
  128. package/dist/internal/devices/interface.d.ts +31 -0
  129. package/dist/internal/devices/interface.js +3 -0
  130. package/dist/internal/devices/interface.js.map +1 -0
  131. package/dist/internal/devices/manager.d.ts +18 -0
  132. package/dist/internal/devices/manager.js +103 -0
  133. package/dist/internal/devices/manager.js.map +1 -0
  134. package/dist/internal/devices/manager.test.d.ts +1 -0
  135. package/dist/internal/devices/manager.test.js +100 -0
  136. package/dist/internal/devices/manager.test.js.map +1 -0
  137. package/dist/internal/download/apiService.d.ts +27 -0
  138. package/dist/internal/download/apiService.js +110 -0
  139. package/dist/internal/download/apiService.js.map +1 -0
  140. package/dist/internal/download/controller.d.ts +8 -0
  141. package/dist/internal/download/controller.js +22 -0
  142. package/dist/internal/download/controller.js.map +1 -0
  143. package/dist/internal/download/cryptoService.d.ts +17 -0
  144. package/dist/internal/download/cryptoService.js +82 -0
  145. package/dist/internal/download/cryptoService.js.map +1 -0
  146. package/dist/internal/download/fileDownloader.d.ts +33 -0
  147. package/dist/internal/download/fileDownloader.js +226 -0
  148. package/dist/internal/download/fileDownloader.js.map +1 -0
  149. package/dist/internal/download/fileDownloader.test.d.ts +1 -0
  150. package/dist/internal/download/fileDownloader.test.js +324 -0
  151. package/dist/internal/download/fileDownloader.test.js.map +1 -0
  152. package/dist/internal/download/index.d.ts +10 -0
  153. package/dist/internal/download/index.js +82 -0
  154. package/dist/internal/download/index.js.map +1 -0
  155. package/dist/internal/download/interface.d.ts +35 -0
  156. package/dist/internal/download/interface.js +3 -0
  157. package/dist/internal/download/interface.js.map +1 -0
  158. package/dist/internal/download/queue.d.ts +5 -0
  159. package/dist/internal/download/queue.js +31 -0
  160. package/dist/internal/download/queue.js.map +1 -0
  161. package/dist/internal/download/telemetry.d.ts +14 -0
  162. package/dist/internal/download/telemetry.js +106 -0
  163. package/dist/internal/download/telemetry.js.map +1 -0
  164. package/dist/internal/download/telemetry.test.d.ts +1 -0
  165. package/dist/internal/download/telemetry.test.js +111 -0
  166. package/dist/internal/download/telemetry.test.js.map +1 -0
  167. package/dist/internal/download/thumbnailDownloader.d.ts +19 -0
  168. package/dist/internal/download/thumbnailDownloader.js +198 -0
  169. package/dist/internal/download/thumbnailDownloader.js.map +1 -0
  170. package/dist/internal/download/thumbnailDownloader.test.d.ts +1 -0
  171. package/dist/internal/download/thumbnailDownloader.test.js +179 -0
  172. package/dist/internal/download/thumbnailDownloader.test.js.map +1 -0
  173. package/dist/internal/errors.d.ts +6 -0
  174. package/dist/internal/errors.js +28 -0
  175. package/dist/internal/errors.js.map +1 -0
  176. package/dist/internal/errors.test.d.ts +1 -0
  177. package/dist/internal/errors.test.js +22 -0
  178. package/dist/internal/errors.test.js.map +1 -0
  179. package/dist/internal/events/apiService.d.ts +18 -0
  180. package/dist/internal/events/apiService.js +81 -0
  181. package/dist/internal/events/apiService.js.map +1 -0
  182. package/dist/internal/events/cache.d.ts +28 -0
  183. package/dist/internal/events/cache.js +67 -0
  184. package/dist/internal/events/cache.js.map +1 -0
  185. package/dist/internal/events/cache.test.d.ts +1 -0
  186. package/dist/internal/events/cache.test.js +43 -0
  187. package/dist/internal/events/cache.test.js.map +1 -0
  188. package/dist/internal/events/coreEventManager.d.ts +25 -0
  189. package/dist/internal/events/coreEventManager.js +63 -0
  190. package/dist/internal/events/coreEventManager.js.map +1 -0
  191. package/dist/internal/events/eventManager.d.ts +62 -0
  192. package/dist/internal/events/eventManager.js +159 -0
  193. package/dist/internal/events/eventManager.js.map +1 -0
  194. package/dist/internal/events/eventManager.test.d.ts +1 -0
  195. package/dist/internal/events/eventManager.test.js +120 -0
  196. package/dist/internal/events/eventManager.test.js.map +1 -0
  197. package/dist/internal/events/index.d.ts +50 -0
  198. package/dist/internal/events/index.js +117 -0
  199. package/dist/internal/events/index.js.map +1 -0
  200. package/dist/internal/events/interface.d.ts +47 -0
  201. package/dist/internal/events/interface.js +12 -0
  202. package/dist/internal/events/interface.js.map +1 -0
  203. package/dist/internal/events/volumeEventManager.d.ts +27 -0
  204. package/dist/internal/events/volumeEventManager.js +69 -0
  205. package/dist/internal/events/volumeEventManager.js.map +1 -0
  206. package/dist/internal/nodes/apiService.d.ts +54 -0
  207. package/dist/internal/nodes/apiService.js +308 -0
  208. package/dist/internal/nodes/apiService.js.map +1 -0
  209. package/dist/internal/nodes/apiService.test.d.ts +1 -0
  210. package/dist/internal/nodes/apiService.test.js +344 -0
  211. package/dist/internal/nodes/apiService.test.js.map +1 -0
  212. package/dist/internal/nodes/cache.d.ts +57 -0
  213. package/dist/internal/nodes/cache.js +226 -0
  214. package/dist/internal/nodes/cache.js.map +1 -0
  215. package/dist/internal/nodes/cache.test.d.ts +1 -0
  216. package/dist/internal/nodes/cache.test.js +160 -0
  217. package/dist/internal/nodes/cache.test.js.map +1 -0
  218. package/dist/internal/nodes/cryptoCache.d.ts +16 -0
  219. package/dist/internal/nodes/cryptoCache.js +50 -0
  220. package/dist/internal/nodes/cryptoCache.js.map +1 -0
  221. package/dist/internal/nodes/cryptoCache.test.d.ts +1 -0
  222. package/dist/internal/nodes/cryptoCache.test.js +79 -0
  223. package/dist/internal/nodes/cryptoCache.test.js.map +1 -0
  224. package/dist/internal/nodes/cryptoService.d.ts +75 -0
  225. package/dist/internal/nodes/cryptoService.js +409 -0
  226. package/dist/internal/nodes/cryptoService.js.map +1 -0
  227. package/dist/internal/nodes/cryptoService.test.d.ts +1 -0
  228. package/dist/internal/nodes/cryptoService.test.js +698 -0
  229. package/dist/internal/nodes/cryptoService.test.js.map +1 -0
  230. package/dist/internal/nodes/events.d.ts +91 -0
  231. package/dist/internal/nodes/events.js +243 -0
  232. package/dist/internal/nodes/events.js.map +1 -0
  233. package/dist/internal/nodes/events.test.d.ts +1 -0
  234. package/dist/internal/nodes/events.test.js +318 -0
  235. package/dist/internal/nodes/events.test.js.map +1 -0
  236. package/dist/internal/nodes/extendedAttributes.d.ts +23 -0
  237. package/dist/internal/nodes/extendedAttributes.js +117 -0
  238. package/dist/internal/nodes/extendedAttributes.js.map +1 -0
  239. package/dist/internal/nodes/extendedAttributes.test.d.ts +1 -0
  240. package/dist/internal/nodes/extendedAttributes.test.js +176 -0
  241. package/dist/internal/nodes/extendedAttributes.test.js.map +1 -0
  242. package/dist/internal/nodes/index.d.ts +26 -0
  243. package/dist/internal/nodes/index.js +40 -0
  244. package/dist/internal/nodes/index.js.map +1 -0
  245. package/dist/internal/nodes/index.test.d.ts +1 -0
  246. package/dist/internal/nodes/index.test.js +112 -0
  247. package/dist/internal/nodes/index.test.js.map +1 -0
  248. package/dist/internal/nodes/interface.d.ts +135 -0
  249. package/dist/internal/nodes/interface.js +3 -0
  250. package/dist/internal/nodes/interface.js.map +1 -0
  251. package/dist/internal/nodes/mediaTypes.d.ts +2 -0
  252. package/dist/internal/nodes/mediaTypes.js +13 -0
  253. package/dist/internal/nodes/mediaTypes.js.map +1 -0
  254. package/dist/internal/nodes/nodesAccess.d.ts +49 -0
  255. package/dist/internal/nodes/nodesAccess.js +332 -0
  256. package/dist/internal/nodes/nodesAccess.js.map +1 -0
  257. package/dist/internal/nodes/nodesAccess.test.d.ts +1 -0
  258. package/dist/internal/nodes/nodesAccess.test.js +487 -0
  259. package/dist/internal/nodes/nodesAccess.test.js.map +1 -0
  260. package/dist/internal/nodes/nodesManagement.d.ts +33 -0
  261. package/dist/internal/nodes/nodesManagement.js +222 -0
  262. package/dist/internal/nodes/nodesManagement.js.map +1 -0
  263. package/dist/internal/nodes/nodesManagement.test.d.ts +1 -0
  264. package/dist/internal/nodes/nodesManagement.test.js +178 -0
  265. package/dist/internal/nodes/nodesManagement.test.js.map +1 -0
  266. package/dist/internal/nodes/nodesRevisions.d.ts +18 -0
  267. package/dist/internal/nodes/nodesRevisions.js +55 -0
  268. package/dist/internal/nodes/nodesRevisions.js.map +1 -0
  269. package/dist/internal/nodes/validations.d.ts +4 -0
  270. package/dist/internal/nodes/validations.js +21 -0
  271. package/dist/internal/nodes/validations.js.map +1 -0
  272. package/dist/internal/photos/albums.d.ts +13 -0
  273. package/dist/internal/photos/albums.js +30 -0
  274. package/dist/internal/photos/albums.js.map +1 -0
  275. package/dist/internal/photos/apiService.d.ts +8 -0
  276. package/dist/internal/photos/apiService.js +18 -0
  277. package/dist/internal/photos/apiService.js.map +1 -0
  278. package/dist/internal/photos/cache.d.ts +6 -0
  279. package/dist/internal/photos/cache.js +15 -0
  280. package/dist/internal/photos/cache.js.map +1 -0
  281. package/dist/internal/photos/index.d.ts +9 -0
  282. package/dist/internal/photos/index.js +18 -0
  283. package/dist/internal/photos/index.js.map +1 -0
  284. package/dist/internal/photos/interface.d.ts +6 -0
  285. package/dist/internal/photos/interface.js +3 -0
  286. package/dist/internal/photos/interface.js.map +1 -0
  287. package/dist/internal/photos/photosTimeline.d.ts +10 -0
  288. package/dist/internal/photos/photosTimeline.js +20 -0
  289. package/dist/internal/photos/photosTimeline.js.map +1 -0
  290. package/dist/internal/sdkEvents.d.ts +12 -0
  291. package/dist/internal/sdkEvents.js +44 -0
  292. package/dist/internal/sdkEvents.js.map +1 -0
  293. package/dist/internal/sdkEvents.test.d.ts +1 -0
  294. package/dist/internal/sdkEvents.test.js +45 -0
  295. package/dist/internal/sdkEvents.test.js.map +1 -0
  296. package/dist/internal/shares/apiService.d.ts +51 -0
  297. package/dist/internal/shares/apiService.js +128 -0
  298. package/dist/internal/shares/apiService.js.map +1 -0
  299. package/dist/internal/shares/cache.d.ts +15 -0
  300. package/dist/internal/shares/cache.js +63 -0
  301. package/dist/internal/shares/cache.js.map +1 -0
  302. package/dist/internal/shares/cache.test.d.ts +1 -0
  303. package/dist/internal/shares/cache.test.js +54 -0
  304. package/dist/internal/shares/cache.test.js.map +1 -0
  305. package/dist/internal/shares/cryptoCache.d.ts +20 -0
  306. package/dist/internal/shares/cryptoCache.js +35 -0
  307. package/dist/internal/shares/cryptoCache.js.map +1 -0
  308. package/dist/internal/shares/cryptoCache.test.d.ts +1 -0
  309. package/dist/internal/shares/cryptoCache.test.js +58 -0
  310. package/dist/internal/shares/cryptoCache.test.js.map +1 -0
  311. package/dist/internal/shares/cryptoService.d.ts +42 -0
  312. package/dist/internal/shares/cryptoService.js +126 -0
  313. package/dist/internal/shares/cryptoService.js.map +1 -0
  314. package/dist/internal/shares/cryptoService.test.d.ts +1 -0
  315. package/dist/internal/shares/cryptoService.test.js +120 -0
  316. package/dist/internal/shares/cryptoService.test.js.map +1 -0
  317. package/dist/internal/shares/index.d.ts +15 -0
  318. package/dist/internal/shares/index.js +26 -0
  319. package/dist/internal/shares/index.js.map +1 -0
  320. package/dist/internal/shares/interface.d.ts +94 -0
  321. package/dist/internal/shares/interface.js +11 -0
  322. package/dist/internal/shares/interface.js.map +1 -0
  323. package/dist/internal/shares/manager.d.ts +68 -0
  324. package/dist/internal/shares/manager.js +186 -0
  325. package/dist/internal/shares/manager.js.map +1 -0
  326. package/dist/internal/shares/manager.test.d.ts +1 -0
  327. package/dist/internal/shares/manager.test.js +176 -0
  328. package/dist/internal/shares/manager.test.js.map +1 -0
  329. package/dist/internal/sharing/apiService.d.ts +80 -0
  330. package/dist/internal/sharing/apiService.js +325 -0
  331. package/dist/internal/sharing/apiService.js.map +1 -0
  332. package/dist/internal/sharing/cache.d.ts +37 -0
  333. package/dist/internal/sharing/cache.js +105 -0
  334. package/dist/internal/sharing/cache.js.map +1 -0
  335. package/dist/internal/sharing/cache.test.d.ts +1 -0
  336. package/dist/internal/sharing/cache.test.js +82 -0
  337. package/dist/internal/sharing/cache.test.js.map +1 -0
  338. package/dist/internal/sharing/cryptoService.d.ts +112 -0
  339. package/dist/internal/sharing/cryptoService.js +269 -0
  340. package/dist/internal/sharing/cryptoService.js.map +1 -0
  341. package/dist/internal/sharing/events.d.ts +57 -0
  342. package/dist/internal/sharing/events.js +153 -0
  343. package/dist/internal/sharing/events.js.map +1 -0
  344. package/dist/internal/sharing/events.test.d.ts +1 -0
  345. package/dist/internal/sharing/events.test.js +246 -0
  346. package/dist/internal/sharing/events.test.js.map +1 -0
  347. package/dist/internal/sharing/index.d.ts +20 -0
  348. package/dist/internal/sharing/index.js +30 -0
  349. package/dist/internal/sharing/index.js.map +1 -0
  350. package/dist/internal/sharing/interface.d.ts +169 -0
  351. package/dist/internal/sharing/interface.js +9 -0
  352. package/dist/internal/sharing/interface.js.map +1 -0
  353. package/dist/internal/sharing/sharingAccess.d.ts +32 -0
  354. package/dist/internal/sharing/sharingAccess.js +119 -0
  355. package/dist/internal/sharing/sharingAccess.js.map +1 -0
  356. package/dist/internal/sharing/sharingAccess.test.d.ts +1 -0
  357. package/dist/internal/sharing/sharingAccess.test.js +84 -0
  358. package/dist/internal/sharing/sharingAccess.test.js.map +1 -0
  359. package/dist/internal/sharing/sharingManagement.d.ts +43 -0
  360. package/dist/internal/sharing/sharingManagement.js +439 -0
  361. package/dist/internal/sharing/sharingManagement.js.map +1 -0
  362. package/dist/internal/sharing/sharingManagement.test.d.ts +1 -0
  363. package/dist/internal/sharing/sharingManagement.test.js +788 -0
  364. package/dist/internal/sharing/sharingManagement.test.js.map +1 -0
  365. package/dist/internal/uids.d.ts +38 -0
  366. package/dist/internal/uids.js +85 -0
  367. package/dist/internal/uids.js.map +1 -0
  368. package/dist/internal/upload/apiService.d.ts +65 -0
  369. package/dist/internal/upload/apiService.js +137 -0
  370. package/dist/internal/upload/apiService.js.map +1 -0
  371. package/dist/internal/upload/blockVerifier.d.ts +16 -0
  372. package/dist/internal/upload/blockVerifier.js +33 -0
  373. package/dist/internal/upload/blockVerifier.js.map +1 -0
  374. package/dist/internal/upload/chunkStreamReader.d.ts +13 -0
  375. package/dist/internal/upload/chunkStreamReader.js +46 -0
  376. package/dist/internal/upload/chunkStreamReader.js.map +1 -0
  377. package/dist/internal/upload/chunkStreamReader.test.d.ts +1 -0
  378. package/dist/internal/upload/chunkStreamReader.test.js +75 -0
  379. package/dist/internal/upload/chunkStreamReader.test.js.map +1 -0
  380. package/dist/internal/upload/controller.d.ts +8 -0
  381. package/dist/internal/upload/controller.js +25 -0
  382. package/dist/internal/upload/controller.js.map +1 -0
  383. package/dist/internal/upload/cryptoService.d.ts +29 -0
  384. package/dist/internal/upload/cryptoService.js +104 -0
  385. package/dist/internal/upload/cryptoService.js.map +1 -0
  386. package/dist/internal/upload/digests.d.ts +8 -0
  387. package/dist/internal/upload/digests.js +22 -0
  388. package/dist/internal/upload/digests.js.map +1 -0
  389. package/dist/internal/upload/fileUploader.d.ts +65 -0
  390. package/dist/internal/upload/fileUploader.js +463 -0
  391. package/dist/internal/upload/fileUploader.js.map +1 -0
  392. package/dist/internal/upload/fileUploader.test.d.ts +1 -0
  393. package/dist/internal/upload/fileUploader.test.js +393 -0
  394. package/dist/internal/upload/fileUploader.test.js.map +1 -0
  395. package/dist/internal/upload/index.d.ts +16 -0
  396. package/dist/internal/upload/index.js +77 -0
  397. package/dist/internal/upload/index.js.map +1 -0
  398. package/dist/internal/upload/interface.d.ts +117 -0
  399. package/dist/internal/upload/interface.js +3 -0
  400. package/dist/internal/upload/interface.js.map +1 -0
  401. package/dist/internal/upload/manager.d.ts +31 -0
  402. package/dist/internal/upload/manager.js +250 -0
  403. package/dist/internal/upload/manager.js.map +1 -0
  404. package/dist/internal/upload/manager.test.d.ts +1 -0
  405. package/dist/internal/upload/manager.test.js +349 -0
  406. package/dist/internal/upload/manager.test.js.map +1 -0
  407. package/dist/internal/upload/queue.d.ts +5 -0
  408. package/dist/internal/upload/queue.js +32 -0
  409. package/dist/internal/upload/queue.js.map +1 -0
  410. package/dist/internal/upload/telemetry.d.ts +15 -0
  411. package/dist/internal/upload/telemetry.js +111 -0
  412. package/dist/internal/upload/telemetry.js.map +1 -0
  413. package/dist/internal/upload/telemetry.test.d.ts +1 -0
  414. package/dist/internal/upload/telemetry.test.js +107 -0
  415. package/dist/internal/upload/telemetry.test.js.map +1 -0
  416. package/dist/internal/utils.d.ts +1 -0
  417. package/dist/internal/utils.js +13 -0
  418. package/dist/internal/utils.js.map +1 -0
  419. package/dist/internal/wait.d.ts +3 -0
  420. package/dist/internal/wait.js +28 -0
  421. package/dist/internal/wait.js.map +1 -0
  422. package/dist/internal/wait.test.d.ts +1 -0
  423. package/dist/internal/wait.test.js +21 -0
  424. package/dist/internal/wait.test.js.map +1 -0
  425. package/dist/protonDriveClient.d.ts +593 -0
  426. package/dist/protonDriveClient.js +768 -0
  427. package/dist/protonDriveClient.js.map +1 -0
  428. package/dist/protonDrivePhotosClient.d.ts +16 -0
  429. package/dist/protonDrivePhotosClient.js +46 -0
  430. package/dist/protonDrivePhotosClient.js.map +1 -0
  431. package/dist/telemetry.d.ts +187 -0
  432. package/dist/telemetry.js +297 -0
  433. package/dist/telemetry.js.map +1 -0
  434. package/dist/tests/logger.d.ts +2 -0
  435. package/dist/tests/logger.js +12 -0
  436. package/dist/tests/logger.js.map +1 -0
  437. package/dist/tests/telemetry.d.ts +2 -0
  438. package/dist/tests/telemetry.js +11 -0
  439. package/dist/tests/telemetry.js.map +1 -0
  440. package/dist/transformers.d.ts +17 -0
  441. package/dist/transformers.js +77 -0
  442. package/dist/transformers.js.map +1 -0
  443. package/dist/version.d.ts +1 -0
  444. package/dist/version.js +6 -0
  445. package/dist/version.js.map +1 -0
  446. package/package.json +49 -0
  447. package/src/cache/index.ts +2 -0
  448. package/src/cache/interface.ts +104 -0
  449. package/src/cache/memoryCache.test.ts +150 -0
  450. package/src/cache/memoryCache.ts +85 -0
  451. package/src/config.ts +9 -0
  452. package/src/crypto/driveCrypto.test.ts +45 -0
  453. package/src/crypto/driveCrypto.ts +696 -0
  454. package/src/crypto/hmac.ts +46 -0
  455. package/src/crypto/index.ts +6 -0
  456. package/src/crypto/interface.ts +230 -0
  457. package/src/crypto/openPGPCrypto.ts +398 -0
  458. package/src/crypto/utils.ts +40 -0
  459. package/src/errors.ts +168 -0
  460. package/src/index.ts +30 -0
  461. package/src/interface/account.ts +38 -0
  462. package/src/interface/author.ts +29 -0
  463. package/src/interface/devices.ts +21 -0
  464. package/src/interface/download.ts +32 -0
  465. package/src/interface/events.ts +30 -0
  466. package/src/interface/httpClient.ts +42 -0
  467. package/src/interface/index.ts +46 -0
  468. package/src/interface/nodes.ts +168 -0
  469. package/src/interface/result.ts +11 -0
  470. package/src/interface/sharing.ts +87 -0
  471. package/src/interface/telemetry.ts +107 -0
  472. package/src/interface/thumbnail.ts +14 -0
  473. package/src/interface/upload.ts +19 -0
  474. package/src/internal/apiService/apiService.test.ts +285 -0
  475. package/src/internal/apiService/apiService.ts +353 -0
  476. package/src/internal/apiService/coreTypes.ts +24439 -0
  477. package/src/internal/apiService/driveTypes.ts +11841 -0
  478. package/src/internal/apiService/errorCodes.ts +38 -0
  479. package/src/internal/apiService/errors.test.ts +63 -0
  480. package/src/internal/apiService/errors.ts +91 -0
  481. package/src/internal/apiService/index.ts +7 -0
  482. package/src/internal/apiService/observerStream.ts +10 -0
  483. package/src/internal/apiService/transformers.ts +45 -0
  484. package/src/internal/batchLoading.test.ts +58 -0
  485. package/src/internal/batchLoading.ts +74 -0
  486. package/src/internal/devices/apiService.ts +142 -0
  487. package/src/internal/devices/cryptoService.ts +65 -0
  488. package/src/internal/devices/index.ts +31 -0
  489. package/src/internal/devices/interface.ts +28 -0
  490. package/src/internal/devices/manager.test.ts +129 -0
  491. package/src/internal/devices/manager.ts +113 -0
  492. package/src/internal/download/apiService.ts +145 -0
  493. package/src/internal/download/controller.ts +22 -0
  494. package/src/internal/download/cryptoService.ts +96 -0
  495. package/src/internal/download/fileDownloader.test.ts +381 -0
  496. package/src/internal/download/fileDownloader.ts +266 -0
  497. package/src/internal/download/index.ts +122 -0
  498. package/src/internal/download/interface.ts +38 -0
  499. package/src/internal/download/queue.ts +30 -0
  500. package/src/internal/download/telemetry.test.ts +134 -0
  501. package/src/internal/download/telemetry.ts +115 -0
  502. package/src/internal/download/thumbnailDownloader.test.ts +226 -0
  503. package/src/internal/download/thumbnailDownloader.ts +250 -0
  504. package/src/internal/errors.test.ts +21 -0
  505. package/src/internal/errors.ts +28 -0
  506. package/src/internal/events/apiService.ts +87 -0
  507. package/src/internal/events/cache.test.ts +47 -0
  508. package/src/internal/events/cache.ts +80 -0
  509. package/src/internal/events/coreEventManager.ts +69 -0
  510. package/src/internal/events/eventManager.test.ts +139 -0
  511. package/src/internal/events/eventManager.ts +168 -0
  512. package/src/internal/events/index.ts +131 -0
  513. package/src/internal/events/interface.ts +51 -0
  514. package/src/internal/events/volumeEventManager.ts +74 -0
  515. package/src/internal/nodes/apiService.test.ts +394 -0
  516. package/src/internal/nodes/apiService.ts +455 -0
  517. package/src/internal/nodes/cache.test.ts +197 -0
  518. package/src/internal/nodes/cache.ts +240 -0
  519. package/src/internal/nodes/cryptoCache.test.ts +92 -0
  520. package/src/internal/nodes/cryptoCache.ts +47 -0
  521. package/src/internal/nodes/cryptoService.test.ts +814 -0
  522. package/src/internal/nodes/cryptoService.ts +550 -0
  523. package/src/internal/nodes/events.test.ts +383 -0
  524. package/src/internal/nodes/events.ts +271 -0
  525. package/src/internal/nodes/extendedAttributes.test.ts +177 -0
  526. package/src/internal/nodes/extendedAttributes.ts +180 -0
  527. package/src/internal/nodes/index.test.ts +135 -0
  528. package/src/internal/nodes/index.ts +52 -0
  529. package/src/internal/nodes/interface.ts +152 -0
  530. package/src/internal/nodes/mediaTypes.ts +10 -0
  531. package/src/internal/nodes/nodesAccess.test.ts +555 -0
  532. package/src/internal/nodes/nodesAccess.ts +360 -0
  533. package/src/internal/nodes/nodesManagement.test.ts +221 -0
  534. package/src/internal/nodes/nodesManagement.ts +272 -0
  535. package/src/internal/nodes/nodesRevisions.ts +58 -0
  536. package/src/internal/nodes/validations.ts +26 -0
  537. package/src/internal/photos/albums.ts +29 -0
  538. package/src/internal/photos/apiService.ts +16 -0
  539. package/src/internal/photos/cache.ts +11 -0
  540. package/src/internal/photos/index.ts +23 -0
  541. package/src/internal/photos/interface.ts +7 -0
  542. package/src/internal/photos/photosTimeline.ts +18 -0
  543. package/src/internal/sdkEvents.test.ts +55 -0
  544. package/src/internal/sdkEvents.ts +52 -0
  545. package/src/internal/shares/apiService.ts +176 -0
  546. package/src/internal/shares/cache.test.ts +58 -0
  547. package/src/internal/shares/cache.ts +64 -0
  548. package/src/internal/shares/cryptoCache.test.ts +70 -0
  549. package/src/internal/shares/cryptoCache.ts +35 -0
  550. package/src/internal/shares/cryptoService.test.ts +137 -0
  551. package/src/internal/shares/cryptoService.ts +143 -0
  552. package/src/internal/shares/index.ts +35 -0
  553. package/src/internal/shares/interface.ts +104 -0
  554. package/src/internal/shares/manager.test.ts +210 -0
  555. package/src/internal/shares/manager.ts +213 -0
  556. package/src/internal/sharing/apiService.ts +483 -0
  557. package/src/internal/sharing/cache.test.ts +99 -0
  558. package/src/internal/sharing/cache.ts +109 -0
  559. package/src/internal/sharing/cryptoService.ts +378 -0
  560. package/src/internal/sharing/events.test.ts +268 -0
  561. package/src/internal/sharing/events.ts +166 -0
  562. package/src/internal/sharing/index.ts +43 -0
  563. package/src/internal/sharing/interface.ts +177 -0
  564. package/src/internal/sharing/sharingAccess.test.ts +102 -0
  565. package/src/internal/sharing/sharingAccess.ts +133 -0
  566. package/src/internal/sharing/sharingManagement.test.ts +895 -0
  567. package/src/internal/sharing/sharingManagement.ts +521 -0
  568. package/src/internal/uids.ts +83 -0
  569. package/src/internal/upload/apiService.ts +243 -0
  570. package/src/internal/upload/blockVerifier.ts +40 -0
  571. package/src/internal/upload/chunkStreamReader.test.ts +89 -0
  572. package/src/internal/upload/chunkStreamReader.ts +49 -0
  573. package/src/internal/upload/controller.ts +25 -0
  574. package/src/internal/upload/cryptoService.ts +162 -0
  575. package/src/internal/upload/digests.ts +18 -0
  576. package/src/internal/upload/fileUploader.test.ts +513 -0
  577. package/src/internal/upload/fileUploader.ts +576 -0
  578. package/src/internal/upload/index.ts +126 -0
  579. package/src/internal/upload/interface.ts +128 -0
  580. package/src/internal/upload/manager.test.ts +390 -0
  581. package/src/internal/upload/manager.ts +320 -0
  582. package/src/internal/upload/queue.ts +31 -0
  583. package/src/internal/upload/telemetry.test.ts +129 -0
  584. package/src/internal/upload/telemetry.ts +121 -0
  585. package/src/internal/utils.ts +9 -0
  586. package/src/internal/wait.test.ts +21 -0
  587. package/src/internal/wait.ts +26 -0
  588. package/src/protonDriveClient.ts +861 -0
  589. package/src/protonDrivePhotosClient.ts +56 -0
  590. package/src/telemetry.ts +346 -0
  591. package/src/tests/logger.ts +10 -0
  592. package/src/tests/telemetry.ts +9 -0
  593. package/src/transformers.ts +98 -0
  594. package/src/version.ts +4 -0
@@ -0,0 +1,593 @@
1
+ import { ProtonDriveClientContructorParameters, NodeOrUid, MaybeNode, MaybeMissingNode, NodeResult, Revision, ShareNodeSettings, UnshareNodeSettings, ProtonInvitationOrUid, NonProtonInvitationOrUid, ProtonInvitationWithNode, ShareResult, Device, DeviceType, DeviceOrUid, UploadMetadata, FileDownloader, Fileuploader, ThumbnailType, ThumbnailResult, SDKEvent, DeviceEventCallback, NodeEventCallback } from './interface';
2
+ import { SessionKey } from './crypto';
3
+ /**
4
+ * ProtonDriveClient is the main interface for the ProtonDrive SDK.
5
+ *
6
+ * The client provides high-level operations for managing nodes, sharing,
7
+ * and downloading/uploading files. It is the main entry point for using
8
+ * the ProtonDrive SDK.
9
+ */
10
+ export declare class ProtonDriveClient {
11
+ private logger;
12
+ private sdkEvents;
13
+ private events;
14
+ private shares;
15
+ private nodes;
16
+ private sharing;
17
+ private download;
18
+ private upload;
19
+ private devices;
20
+ experimental: {
21
+ /**
22
+ * Experimental feature to return the URL of the node.
23
+ *
24
+ * Use it when you want to open the node in the ProtonDrive web app.
25
+ *
26
+ * It has hardcoded URLs to open in production client only.
27
+ */
28
+ getNodeUrl: (nodeUid: NodeOrUid) => Promise<string>;
29
+ /**
30
+ * Experimental feature to get the docs key for a node.
31
+ *
32
+ * This is used by Docs app to encrypt and decrypt document updates.
33
+ */
34
+ getDocsKey: (nodeUid: NodeOrUid) => Promise<SessionKey>;
35
+ };
36
+ constructor({ httpClient, entitiesCache, cryptoCache, account, openPGPCryptoModule, srpModule, config, telemetry, }: ProtonDriveClientContructorParameters);
37
+ /**
38
+ * Subscribes to the general SDK events.
39
+ *
40
+ * This is not connected to the remote data updates. For that, use
41
+ * and see `subscribeToRemoteDataUpdates`.
42
+ *
43
+ * @param eventName - SDK event name.
44
+ * @param callback - Callback to be called when the event is emitted.
45
+ * @returns Callback to unsubscribe from the event.
46
+ */
47
+ onMessage(eventName: SDKEvent, callback: () => void): () => void;
48
+ /**
49
+ * Subscribes to the remote data updates.
50
+ *
51
+ * By default, SDK doesn't subscribe to remote data updates. If you
52
+ * cache the data locally, you need to call this method so the SDK
53
+ * keeps the local cache in sync with the remote data.
54
+ *
55
+ * Only one instance of the SDK should subscribe to remote data updates.
56
+ *
57
+ * Once subscribed, the SDK will poll for events for core user events and
58
+ * for own data at minimum. Updates to nodes from other users are polled
59
+ * with lower frequency depending on the number of subscriptions, and only
60
+ * after accessing them for the first time via `iterateSharedNodesWithMe`.
61
+ */
62
+ subscribeToRemoteDataUpdates(): Promise<void>;
63
+ /**
64
+ * Subscribe to updates of the devices.
65
+ *
66
+ * Clients should subscribe to this before beginning to list devices
67
+ * to ensure that updates are reflected once a device is in the cache.
68
+ * Subscribing before listing is also required to ensure that devices
69
+ * that are created during the listing will be recognized.
70
+ *
71
+ * ```typescript
72
+ * const unsubscribe = sdk.subscribeToDevices((event) => {
73
+ * if (event.type === 'update') {
74
+ * // Update the device in the UI
75
+ * } else if (event.type === 'remove') {
76
+ * // Remove the device from the UI
77
+ * }
78
+ * });
79
+ *
80
+ * const devices = await Array.fromAsync(sdk.iterateDevices());
81
+ * // Render the devices in the UI
82
+ *
83
+ * // Unsubscribe from the updates when the component is unmounted
84
+ * unsubscribe();
85
+ * ```
86
+ *
87
+ * @param callback - Callback to be called when the event is emitted.
88
+ * @returns Callback to unsubscribe from the event.
89
+ */
90
+ subscribeToDevices(callback: DeviceEventCallback): () => void;
91
+ /**
92
+ * Subscribe to updates of the children of the given parent node.
93
+ *
94
+ * Clients should subscribe to this before beginning to list children
95
+ * to ensure that updates are reflected once a node is in the cache.
96
+ * Subscribing before listing is also required to ensure that nodes
97
+ * that are created during the listing will be recognized.
98
+ *
99
+ * ```typescript
100
+ * const unsubscribe = sdk.subscribeToChildren(parentNodeUid, (event) => {
101
+ * if (event.type === 'update') {
102
+ * // Update the node in the UI
103
+ * } else if (event.type === 'remove') {
104
+ * // Remove the node from the UI
105
+ * }
106
+ * });
107
+ *
108
+ * const nodes = await Array.fromAsync(sdk.iterateChildren(parentNodeUid));
109
+ * // Render the nodes in the UI
110
+ *
111
+ * // Unsubscribe from the updates when the component is unmounted
112
+ * unsubscribe();
113
+ * ```
114
+ *
115
+ * @param parentNodeUid - Node entity or its UID string.
116
+ * @param callback - Callback to be called when the event is emitted.
117
+ * @returns Callback to unsubscribe from the event.
118
+ */
119
+ subscribeToFolder(parentNodeUid: NodeOrUid, callback: NodeEventCallback): () => void;
120
+ /**
121
+ * Subscribe to updates of the trashed nodes.
122
+ *
123
+ * Clients should subscribe to this before beginning to list trashed
124
+ * nodes to ensure that updates are reflected once a node is in the cache.
125
+ * Subscribing before listing is also required to ensure that nodes
126
+ * that are trashed during the listing will be recognized.
127
+ *
128
+ * ```typescript
129
+ * const unsubscribe = sdk.subscribeToTrashedNodes((event) => {
130
+ * if (event.type === 'update') {
131
+ * // Update the node in the UI
132
+ * } else if (event.type === 'remove') {
133
+ * // Remove the node from the UI
134
+ * }
135
+ * });
136
+ *
137
+ * const nodes = await Array.fromAsync(sdk.iterateTrashedNodes());
138
+ * // Render the nodes in the UI
139
+ *
140
+ * // Unsubscribe from the updates when the component is unmounted
141
+ * unsubscribe();
142
+ * ```
143
+ *
144
+ * @param callback - Callback to be called when the event is emitted.
145
+ * @returns Callback to unsubscribe from the event.
146
+ */
147
+ subscribeToTrashedNodes(callback: NodeEventCallback): () => void;
148
+ /**
149
+ * Subscribe to updates of the nodes shared by the user.
150
+ *
151
+ * Clients should subscribe to this before beginning to list shared
152
+ * nodes to ensure that updates are reflected once a node is in the cache.
153
+ * Subscribing before listing is also required to ensure that nodes
154
+ * that are shared during the listing will be recognized.
155
+ *
156
+ * ```typescript
157
+ * const unsubscribe = sdk.subscribeToSharedNodesByMe((event) => {
158
+ * if (event.type === 'update') {
159
+ * // Update the node in the UI
160
+ * } else if (event.type === 'remove') {
161
+ * // Remove the node from the UI
162
+ * }
163
+ * });
164
+ *
165
+ * const nodes = await Array.fromAsync(sdk.iterateSharedNodes());
166
+ * // Render the nodes in the UI
167
+ *
168
+ * // Unsubscribe from the updates when the component is unmounted
169
+ * unsubscribe();
170
+ * ```
171
+ *
172
+ * @param callback - Callback to be called when the event is emitted.
173
+ * @returns Callback to unsubscribe from the event.
174
+ */
175
+ subscribeToSharedNodesByMe(callback: NodeEventCallback): () => void;
176
+ /**
177
+ * Subscribe to updates of the nodes shared with the user.
178
+ *
179
+ * Clients should subscribe to this before beginning to list shared
180
+ * nodes to ensure that updates are reflected once a node is in the cache.
181
+ * Subscribing before listing is also required to ensure that nodes
182
+ * that are shared during the listing will be recognized.
183
+ *
184
+ * ```typescript
185
+ * const unsubscribe = sdk.subscribeToSharedNodesWithMe((event) => {
186
+ * if (event.type === 'update') {
187
+ * // Update the node in the UI
188
+ * } else if (event.type === 'remove') {
189
+ * // Remove the node from the UI
190
+ * }
191
+ * });
192
+ *
193
+ * const nodes = await Array.fromAsync(sdk.iterateSharedNodesWithMe());
194
+ * // Render the nodes in the UI
195
+ *
196
+ * // Unsubscribe from the updates when the component is unmounted
197
+ * unsubscribe();
198
+ * ```
199
+ *
200
+ * @param callback - Callback to be called when the event is emitted.
201
+ * @returns Callback to unsubscribe from the event.
202
+ */
203
+ subscribeToSharedNodesWithMe(callback: NodeEventCallback): () => void;
204
+ /**
205
+ * Provides the node UID for the given raw share and node IDs.
206
+ *
207
+ * This is required only for the internal implementation to provide
208
+ * backward compatibility with the old Drive web setup.
209
+ *
210
+ * If you are having volume ID, use `generateNodeUid` instead.
211
+ *
212
+ * @deprecated This method is not part of the public API.
213
+ * @param shareId - Context share of the node.
214
+ * @param nodeId - Node/link ID (not UID).
215
+ * @returns The node UID.
216
+ */
217
+ getNodeUid(shareId: string, nodeId: string): Promise<string>;
218
+ /**
219
+ * @returns The root folder to My files section of the user.
220
+ */
221
+ getMyFilesRootFolder(): Promise<MaybeNode>;
222
+ /**
223
+ * Iterates the children of the given parent node.
224
+ *
225
+ * The output is not sorted and the order of the children is not guaranteed.
226
+ *
227
+ * You can listen to updates via `subscribeToChildren`.
228
+ *
229
+ * @param parentNodeUid - Node entity or its UID string.
230
+ * @param signal - Signal to abort the operation.
231
+ * @returns An async generator of the children of the given parent node.
232
+ */
233
+ iterateFolderChildren(parentNodeUid: NodeOrUid, signal?: AbortSignal): AsyncGenerator<MaybeNode>;
234
+ /**
235
+ * Iterates the trashed nodes.
236
+ *
237
+ * The list of trashed nodes is not cached and is fetched from the server
238
+ * on each call. The node data itself are served from cached if available.
239
+ *
240
+ * The output is not sorted and the order of the trashed nodes is not guaranteed.
241
+ *
242
+ * You can listen to updates via `subscribeToTrashedNodes`.
243
+ *
244
+ * @param signal - Signal to abort the operation.
245
+ * @returns An async generator of the trashed nodes.
246
+ */
247
+ iterateTrashedNodes(signal?: AbortSignal): AsyncGenerator<MaybeNode>;
248
+ /**
249
+ * Iterates the nodes by their UIDs.
250
+ *
251
+ * The output is not sorted and the order of the nodes is not guaranteed.
252
+ *
253
+ * @param nodeUids - List of node entities or their UIDs.
254
+ * @param signal - Signal to abort the operation.
255
+ * @returns An async generator of the nodes.
256
+ */
257
+ iterateNodes(nodeUids: NodeOrUid[], signal?: AbortSignal): AsyncGenerator<MaybeMissingNode>;
258
+ /**
259
+ * Get the node by its UID.
260
+ *
261
+ * @param nodeUid - Node entity or its UID string.
262
+ * @returns The node entity.
263
+ */
264
+ getNode(nodeUid: NodeOrUid): Promise<MaybeNode>;
265
+ /**
266
+ * Rename the node.
267
+ *
268
+ * @param nodeUid - Node entity or its UID string.
269
+ * @returns The updated node entity.
270
+ * @throws {@link ValidationError} If the name is empty, too long, or contains a slash.
271
+ * @throws {@link Error} If another node with the same name already exists.
272
+ */
273
+ renameNode(nodeUid: NodeOrUid, newName: string): Promise<MaybeNode>;
274
+ /**
275
+ * Move the nodes to a new parent node.
276
+ *
277
+ * The operation is performed node by node and the results are yielded
278
+ * as they are available. Order of the results is not guaranteed.
279
+ *
280
+ * If one of the nodes fails to move, the operation continues with the
281
+ * rest of the nodes. Use `NodeResult` to check the status of the action.
282
+ *
283
+ * Only move withing the same section is supported at this moment.
284
+ * That means that the new parent node must be in the same section
285
+ * as the nodes being moved. E.g., moving from My files to Shared with
286
+ * me is not supported yet.
287
+ *
288
+ * @param nodeUids - List of node entities or their UIDs.
289
+ * @param newParentNodeUid - Node entity or its UID string.
290
+ * @param signal - Signal to abort the operation.
291
+ * @returns An async generator of the results of the move operation
292
+ */
293
+ moveNodes(nodeUids: NodeOrUid[], newParentNodeUid: NodeOrUid, signal?: AbortSignal): AsyncGenerator<NodeResult>;
294
+ /**
295
+ * Trash the nodes.
296
+ *
297
+ * The operation is performed in batches and the results are yielded
298
+ * as they are available. Order of the results is not guaranteed.
299
+ *
300
+ * If one of the nodes fails to trash, the operation continues with the
301
+ * rest of the nodes. Use `NodeResult` to check the status of the action.
302
+ *
303
+ * @param nodeUids - List of node entities or their UIDs.
304
+ * @param signal - Signal to abort the operation.
305
+ * @returns An async generator of the results of the trash operation
306
+ */
307
+ trashNodes(nodeUids: NodeOrUid[], signal?: AbortSignal): AsyncGenerator<NodeResult>;
308
+ /**
309
+ * Restore the nodes from the trash to their original place.
310
+ *
311
+ * The operation is performed in batches and the results are yielded
312
+ * as they are available. Order of the results is not guaranteed.
313
+ *
314
+ * If one of the nodes fails to restore, the operation continues with the
315
+ * rest of the nodes. Use `NodeResult` to check the status of the action.
316
+ *
317
+ * @param nodeUids - List of node entities or their UIDs.
318
+ * @param signal - Signal to abort the operation.
319
+ * @returns An async generator of the results of the restore operation
320
+ */
321
+ restoreNodes(nodeUids: NodeOrUid[], signal?: AbortSignal): AsyncGenerator<NodeResult>;
322
+ /**
323
+ * Delete the nodes permanently.
324
+ *
325
+ * The operation is performed in batches and the results are yielded
326
+ * as they are available. Order of the results is not guaranteed.
327
+ *
328
+ * If one of the nodes fails to delete, the operation continues with the
329
+ * rest of the nodes. Use `NodeResult` to check the status of the action.
330
+ *
331
+ * @param nodeUids - List of node entities or their UIDs.
332
+ * @param signal - Signal to abort the operation.
333
+ * @returns An async generator of the results of the delete operation
334
+ */
335
+ deleteNodes(nodeUids: NodeOrUid[], signal?: AbortSignal): AsyncGenerator<NodeResult>;
336
+ emptyTrash(): Promise<void>;
337
+ /**
338
+ * Create a new folder.
339
+ *
340
+ * The folder is created in the given parent node.
341
+ *
342
+ * @param parentNodeUid - Node entity or its UID string of the parent folder.
343
+ * @param name - Name of the new folder.
344
+ * @param modificationTime - Optional modification time of the folder.
345
+ * @returns The created node entity.
346
+ * @throws {@link Error} If the parent node is not a folder.
347
+ * @throws {@link ValidationError} If the name is empty, too long, or contains a slash.
348
+ * @throws {@link Error} If another node with the same name already exists.
349
+ */
350
+ createFolder(parentNodeUid: NodeOrUid, name: string, modificationTime?: Date): Promise<MaybeNode>;
351
+ /**
352
+ * Iterates the revisions of given node.
353
+ *
354
+ * The list of node revisions is not cached and is fetched and decrypted
355
+ * from the server on each call.
356
+ *
357
+ * The output is sorted by the revision date in descending order (newest
358
+ * first).
359
+ *
360
+ * @param nodeUid - Node entity or its UID string.
361
+ * @param signal - Signal to abort the operation.
362
+ * @returns An async generator of the node revisions.
363
+ */
364
+ iterateRevisions(nodeUid: NodeOrUid, signal?: AbortSignal): AsyncGenerator<Revision>;
365
+ /**
366
+ * Restore the node to the given revision.
367
+ *
368
+ * Warning: Restoring revisions might be accepted by the server but not
369
+ * applied. If the client re-loads list of revisions quickly after the
370
+ * restore, the change might not be visible. Update the UI optimistically to
371
+ * reflect the change.
372
+ *
373
+ * @param revisionUid - UID of the revision to restore.
374
+ */
375
+ restoreRevision(revisionUid: string): Promise<void>;
376
+ /**
377
+ * Delete the revision.
378
+ *
379
+ * @param revisionUid - UID of the revision to delete.
380
+ */
381
+ deleteRevision(revisionUid: string): Promise<void>;
382
+ /**
383
+ * Iterates the nodes shared by the user.
384
+ *
385
+ * The output is not sorted and the order of the shared nodes is not guaranteed.
386
+ *
387
+ * You can listen to updates via `subscribeToSharedNodesByMe`.
388
+ *
389
+ * @param signal - Signal to abort the operation.
390
+ * @returns An async generator of the shared nodes.
391
+ */
392
+ iterateSharedNodes(signal?: AbortSignal): AsyncGenerator<MaybeNode>;
393
+ /**
394
+ * Iterates the nodes shared with the user.
395
+ *
396
+ * The output is not sorted and the order of the shared nodes is not guaranteed.
397
+ *
398
+ * At the end of the iteration, if `subscribeToRemoteDataUpdates` was called,
399
+ * the SDK will listen to updates for the shared nodes to keep the local cache
400
+ * in sync with the remote data.
401
+ *
402
+ * You can listen to updates via `subscribeToSharedNodesWithMe`.
403
+ *
404
+ * @param signal - Signal to abort the operation.
405
+ * @returns An async generator of the shared nodes.
406
+ */
407
+ iterateSharedNodesWithMe(signal?: AbortSignal): AsyncGenerator<MaybeNode>;
408
+ /**
409
+ * Leave shared node that was previously shared with the user.
410
+ *
411
+ * @param nodeUid - Node entity or its UID string.
412
+ */
413
+ leaveSharedNode(nodeUid: NodeOrUid): Promise<void>;
414
+ /**
415
+ * Iterates the invitations to shared nodes.
416
+ *
417
+ * The output is not sorted and the order of the invitations is not guaranteed.
418
+ *
419
+ * @param signal - Signal to abort the operation.
420
+ * @returns An async generator of the invitations.
421
+ */
422
+ iterateInvitations(signal?: AbortSignal): AsyncGenerator<ProtonInvitationWithNode>;
423
+ /**
424
+ * Accept the invitation to the shared node.
425
+ *
426
+ * @param invitationId - Invitation entity or its UID string.
427
+ */
428
+ acceptInvitation(invitationId: string): Promise<void>;
429
+ /**
430
+ * Reject the invitation to the shared node.
431
+ *
432
+ * @param invitationId - Invitation entity or its UID string.
433
+ */
434
+ rejectInvitation(invitationId: string): Promise<void>;
435
+ /**
436
+ * Get sharing info of the node.
437
+ *
438
+ * The sharing info contains the list of invitations, members,
439
+ * public link and permission for each.
440
+ *
441
+ * The sharing info is not cached and is fetched from the server
442
+ * on each call.
443
+ *
444
+ * @param nodeUid - Node entity or its UID string.
445
+ * @returns The sharing info of the node. Undefined if not shared.
446
+ */
447
+ getSharingInfo(nodeUid: NodeOrUid): Promise<ShareResult | undefined>;
448
+ /**
449
+ * Share or update sharing of the node.
450
+ *
451
+ * If the node is already shared, the sharing settings are updated.
452
+ * If the member is already present but with different role, the role
453
+ * is updated. If the sharing settings is identical, the sharing info
454
+ * is returned without any change.
455
+ *
456
+ * @param nodeUid - Node entity or its UID string.
457
+ * @param settings - Settings for sharing the node.
458
+ * @returns The updated sharing info of the node.
459
+ */
460
+ shareNode(nodeUid: NodeOrUid, settings: ShareNodeSettings): Promise<ShareResult>;
461
+ /**
462
+ * Unshare the node, completely or partially.
463
+ *
464
+ * @param nodeUid - Node entity or its UID string.
465
+ * @param settings - Settings for unsharing the node. If not provided, the node
466
+ * is unshared completely.
467
+ * @returns The updated sharing info of the node. Undefined if unshared completely.
468
+ */
469
+ unshareNode(nodeUid: NodeOrUid, settings?: UnshareNodeSettings): Promise<ShareResult | undefined>;
470
+ resendInvitation(nodeUid: NodeOrUid, invitationUid: ProtonInvitationOrUid | NonProtonInvitationOrUid): Promise<void>;
471
+ /**
472
+ * Get the file downloader to download the node content of the active
473
+ * revision. For downloading specific revision of the file, use
474
+ * `getFileRevisionDownloader`.
475
+ *
476
+ * The number of ongoing downloads is limited. If the limit is reached,
477
+ * the download is queued and started when the slot is available. It is
478
+ * recommended to not start too many downloads at once to avoid having
479
+ * many open promises.
480
+ *
481
+ * The file downloader is not reusable. If the download is interrupted,
482
+ * a new file downloader must be created.
483
+ *
484
+ * Before download, the authorship of the node should be checked and
485
+ * reported to the user if there is any signature issue, notably on the
486
+ * content author on the revision.
487
+ *
488
+ * Client should not automatically retry the download if it fails. The
489
+ * download should be initiated by the user again. The downloader does
490
+ * automatically retry the download if it fails due to network issues,
491
+ * or if the server is temporarily unavailable.
492
+ *
493
+ * Once download is initiated, the download can fail, besides network
494
+ * issues etc., only when there is integrity error. It should be considered
495
+ * a bug and reported to the Drive developers. The SDK provides option
496
+ * to bypass integrity checks, but that should be used only for debugging
497
+ * purposes, not available to the end users.
498
+ *
499
+ * Example usage:
500
+ *
501
+ * ```typescript
502
+ * const downloader = await client.getFileDownloader(nodeUid, signal);
503
+ * const claimedSize = fileDownloader.getClaimedSizeInBytes();
504
+ * const downloadController = fileDownloader.writeToStream(stream, (downloadedBytes) => { ... });
505
+ *
506
+ * signalController.abort(); // to cancel
507
+ * downloadController.pause(); // to pause
508
+ * downloadController.resume(); // to resume
509
+ * await downloadController.completion(); // to await completion
510
+ * ```
511
+ */
512
+ getFileDownloader(nodeUid: NodeOrUid, signal?: AbortSignal): Promise<FileDownloader>;
513
+ /**
514
+ * Same as `getFileDownloader`, but for a specific revision of the file.
515
+ */
516
+ getFileRevisionDownloader(nodeRevisionUid: string, signal?: AbortSignal): Promise<FileDownloader>;
517
+ /**
518
+ * Iterates the thumbnails of the given nodes.
519
+ *
520
+ * The output is not sorted and the order of the nodes is not guaranteed.
521
+ *
522
+ * @param nodeUids - List of node entities or their UIDs.
523
+ * @param thumbnailType - Type of the thumbnail to download.
524
+ * @returns An async generator of the results of the restore operation
525
+ */
526
+ iterateThumbnails(nodeUids: NodeOrUid[], thumbnailType?: ThumbnailType, signal?: AbortSignal): AsyncGenerator<ThumbnailResult>;
527
+ /**
528
+ * Get the file uploader to upload a new file. For uploading a new
529
+ * revision, use `getFileRevisionUploader` instead.
530
+ *
531
+ * The number of ongoing uploads is limited. If the limit is reached,
532
+ * the upload is queued and started when the slot is available. It is
533
+ * recommended to not start too many uploads at once to avoid having
534
+ * many open promises.
535
+ *
536
+ * The file uploader is not reusable. If the upload is interrupted,
537
+ * a new file uploader must be created.
538
+ *
539
+ * Client should not automatically retry the upload if it fails. The
540
+ * upload should be initiated by the user again. The uploader does
541
+ * automatically retry the upload if it fails due to network issues,
542
+ * or if the server is temporarily unavailable.
543
+ *
544
+ * Example usage:
545
+ *
546
+ * ```typescript
547
+ * const uploader = await client.getFileUploader(parentFolderUid, name, metadata, signal);
548
+ * const uploadController = uploader.writeStream(stream, thumbnails, (uploadedBytes) => { ... });
549
+ *
550
+ * signalController.abort(); // to cancel
551
+ * uploadController.pause(); // to pause
552
+ * uploadController.resume(); // to resume
553
+ * const nodeUid = await uploadController.completion(); // to await completion
554
+ * ```
555
+ */
556
+ getFileUploader(parentFolderUid: NodeOrUid, name: string, metadata: UploadMetadata, signal?: AbortSignal): Promise<Fileuploader>;
557
+ /**
558
+ * Same as `getFileUploader`, but for a uploading new revision of the file.
559
+ */
560
+ getFileRevisionUploader(nodeUid: NodeOrUid, metadata: UploadMetadata, signal?: AbortSignal): Promise<Fileuploader>;
561
+ /**
562
+ * Iterates the devices of the user.
563
+ *
564
+ * The output is not sorted and the order of the devices is not guaranteed.
565
+ *
566
+ * You can listen to updates via `subscribeToDevices`.
567
+ *
568
+ * @returns An async generator of devices.
569
+ */
570
+ iterateDevices(signal?: AbortSignal): AsyncGenerator<Device>;
571
+ /**
572
+ * Creates a new device.
573
+ *
574
+ * @param nodeUid - Device entity or its UID string.
575
+ * @returns The created device entity.
576
+ * @throws {@link ValidationError} If the name is empty, too long, or contains a slash.
577
+ */
578
+ createDevice(name: string, deviceType: DeviceType): Promise<Device>;
579
+ /**
580
+ * Renames a device.
581
+ *
582
+ * @param deviceOrUid - Device entity or its UID string.
583
+ * @returns The updated device entity.
584
+ * @throws {@link ValidationError} If the name is empty, too long, or contains a slash.
585
+ */
586
+ renameDevice(deviceOrUid: DeviceOrUid, name: string): Promise<Device>;
587
+ /**
588
+ * Deletes a device.
589
+ *
590
+ * @param deviceOrUid - Device entity or its UID string.
591
+ */
592
+ deleteDevice(deviceOrUid: DeviceOrUid): Promise<void>;
593
+ }