box-node-sdk 3.8.1 → 3.8.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (358) hide show
  1. package/lib-esm/api-request-manager.d.ts +36 -0
  2. package/lib-esm/api-request-manager.js +78 -0
  3. package/lib-esm/api-request-manager.js.map +1 -0
  4. package/lib-esm/api-request.d.ts +135 -0
  5. package/lib-esm/api-request.js +282 -0
  6. package/lib-esm/api-request.js.map +1 -0
  7. package/lib-esm/box-client.d.ts +274 -0
  8. package/lib-esm/box-client.js +594 -0
  9. package/lib-esm/box-client.js.map +1 -0
  10. package/lib-esm/box-node-sdk.d.ts +227 -0
  11. package/lib-esm/box-node-sdk.js +373 -0
  12. package/lib-esm/box-node-sdk.js.map +1 -0
  13. package/lib-esm/chunked-uploader.d.ts +128 -0
  14. package/lib-esm/chunked-uploader.js +276 -0
  15. package/lib-esm/chunked-uploader.js.map +1 -0
  16. package/lib-esm/enterprise-event-stream.d.ts +82 -0
  17. package/lib-esm/enterprise-event-stream.js +205 -0
  18. package/lib-esm/enterprise-event-stream.js.map +1 -0
  19. package/lib-esm/event-stream.d.ts +91 -0
  20. package/lib-esm/event-stream.js +277 -0
  21. package/lib-esm/event-stream.js.map +1 -0
  22. package/lib-esm/managers/ai.generated.d.ts +58 -0
  23. package/lib-esm/managers/ai.generated.js +66 -0
  24. package/lib-esm/managers/ai.generated.js.map +1 -0
  25. package/lib-esm/managers/collaboration-allowlist.d.ts +133 -0
  26. package/lib-esm/managers/collaboration-allowlist.js +194 -0
  27. package/lib-esm/managers/collaboration-allowlist.js.map +1 -0
  28. package/lib-esm/managers/collaborations.d.ts +173 -0
  29. package/lib-esm/managers/collaborations.js +252 -0
  30. package/lib-esm/managers/collaborations.js.map +1 -0
  31. package/lib-esm/managers/collections.d.ts +42 -0
  32. package/lib-esm/managers/collections.js +62 -0
  33. package/lib-esm/managers/collections.js.map +1 -0
  34. package/lib-esm/managers/comments.d.ts +103 -0
  35. package/lib-esm/managers/comments.js +175 -0
  36. package/lib-esm/managers/comments.js.map +1 -0
  37. package/lib-esm/managers/device-pins.d.ts +52 -0
  38. package/lib-esm/managers/device-pins.js +91 -0
  39. package/lib-esm/managers/device-pins.js.map +1 -0
  40. package/lib-esm/managers/enterprise.d.ts +164 -0
  41. package/lib-esm/managers/enterprise.js +193 -0
  42. package/lib-esm/managers/enterprise.js.map +1 -0
  43. package/lib-esm/managers/events.d.ts +222 -0
  44. package/lib-esm/managers/events.js +295 -0
  45. package/lib-esm/managers/events.js.map +1 -0
  46. package/lib-esm/managers/file-requests-manager.d.ts +56 -0
  47. package/lib-esm/managers/file-requests-manager.js +81 -0
  48. package/lib-esm/managers/file-requests-manager.js.map +1 -0
  49. package/lib-esm/managers/files.d.ts +817 -0
  50. package/lib-esm/managers/files.js +1408 -0
  51. package/lib-esm/managers/files.js.map +1 -0
  52. package/lib-esm/managers/folders.d.ts +396 -0
  53. package/lib-esm/managers/folders.js +570 -0
  54. package/lib-esm/managers/folders.js.map +1 -0
  55. package/lib-esm/managers/groups.d.ts +213 -0
  56. package/lib-esm/managers/groups.js +289 -0
  57. package/lib-esm/managers/groups.js.map +1 -0
  58. package/lib-esm/managers/integration-mappings.d.ts +116 -0
  59. package/lib-esm/managers/integration-mappings.js +101 -0
  60. package/lib-esm/managers/integration-mappings.js.map +1 -0
  61. package/lib-esm/managers/legal-hold-policies.d.ts +190 -0
  62. package/lib-esm/managers/legal-hold-policies.js +254 -0
  63. package/lib-esm/managers/legal-hold-policies.js.map +1 -0
  64. package/lib-esm/managers/metadata.d.ts +232 -0
  65. package/lib-esm/managers/metadata.js +288 -0
  66. package/lib-esm/managers/metadata.js.map +1 -0
  67. package/lib-esm/managers/recent-items.d.ts +38 -0
  68. package/lib-esm/managers/recent-items.js +49 -0
  69. package/lib-esm/managers/recent-items.js.map +1 -0
  70. package/lib-esm/managers/retention-policies.d.ts +308 -0
  71. package/lib-esm/managers/retention-policies.js +374 -0
  72. package/lib-esm/managers/retention-policies.js.map +1 -0
  73. package/lib-esm/managers/search.d.ts +82 -0
  74. package/lib-esm/managers/search.js +90 -0
  75. package/lib-esm/managers/search.js.map +1 -0
  76. package/lib-esm/managers/shared-items.d.ts +33 -0
  77. package/lib-esm/managers/shared-items.js +74 -0
  78. package/lib-esm/managers/shared-items.js.map +1 -0
  79. package/lib-esm/managers/shield-information-barrier-reports.generated.d.ts +65 -0
  80. package/lib-esm/managers/shield-information-barrier-reports.generated.js +65 -0
  81. package/lib-esm/managers/shield-information-barrier-reports.generated.js.map +1 -0
  82. package/lib-esm/managers/shield-information-barrier-segment-members.generated.d.ts +83 -0
  83. package/lib-esm/managers/shield-information-barrier-segment-members.generated.js +83 -0
  84. package/lib-esm/managers/shield-information-barrier-segment-members.generated.js.map +1 -0
  85. package/lib-esm/managers/shield-information-barrier-segment-restrictions.generated.d.ts +84 -0
  86. package/lib-esm/managers/shield-information-barrier-segment-restrictions.generated.js +84 -0
  87. package/lib-esm/managers/shield-information-barrier-segment-restrictions.generated.js.map +1 -0
  88. package/lib-esm/managers/shield-information-barrier-segments.generated.d.ts +98 -0
  89. package/lib-esm/managers/shield-information-barrier-segments.generated.js +99 -0
  90. package/lib-esm/managers/shield-information-barrier-segments.generated.js.map +1 -0
  91. package/lib-esm/managers/shield-information-barriers.generated.d.ts +79 -0
  92. package/lib-esm/managers/shield-information-barriers.generated.js +83 -0
  93. package/lib-esm/managers/shield-information-barriers.generated.js.map +1 -0
  94. package/lib-esm/managers/sign-requests.generated.d.ts +93 -0
  95. package/lib-esm/managers/sign-requests.generated.js +97 -0
  96. package/lib-esm/managers/sign-requests.generated.js.map +1 -0
  97. package/lib-esm/managers/sign-templates.generated.d.ts +51 -0
  98. package/lib-esm/managers/sign-templates.generated.js +49 -0
  99. package/lib-esm/managers/sign-templates.generated.js.map +1 -0
  100. package/lib-esm/managers/storage-policies.d.ts +86 -0
  101. package/lib-esm/managers/storage-policies.js +174 -0
  102. package/lib-esm/managers/storage-policies.js.map +1 -0
  103. package/lib-esm/managers/tasks.d.ts +161 -0
  104. package/lib-esm/managers/tasks.js +243 -0
  105. package/lib-esm/managers/tasks.js.map +1 -0
  106. package/lib-esm/managers/terms-of-service.d.ts +161 -0
  107. package/lib-esm/managers/terms-of-service.js +283 -0
  108. package/lib-esm/managers/terms-of-service.js.map +1 -0
  109. package/lib-esm/managers/trash.d.ts +30 -0
  110. package/lib-esm/managers/trash.js +47 -0
  111. package/lib-esm/managers/trash.js.map +1 -0
  112. package/lib-esm/managers/users.d.ts +171 -0
  113. package/lib-esm/managers/users.js +230 -0
  114. package/lib-esm/managers/users.js.map +1 -0
  115. package/lib-esm/managers/web-links.d.ts +127 -0
  116. package/lib-esm/managers/web-links.js +200 -0
  117. package/lib-esm/managers/web-links.js.map +1 -0
  118. package/lib-esm/managers/webhooks.d.ts +169 -0
  119. package/lib-esm/managers/webhooks.js +398 -0
  120. package/lib-esm/managers/webhooks.js.map +1 -0
  121. package/lib-esm/schemas/ai-agent-ask.generated.d.ts +17 -0
  122. package/lib-esm/schemas/ai-agent-ask.generated.js +3 -0
  123. package/lib-esm/schemas/ai-agent-ask.generated.js.map +1 -0
  124. package/lib-esm/schemas/ai-agent-basic-gen-tool.generated.d.ts +14 -0
  125. package/lib-esm/schemas/ai-agent-basic-gen-tool.generated.js +3 -0
  126. package/lib-esm/schemas/ai-agent-basic-gen-tool.generated.js.map +1 -0
  127. package/lib-esm/schemas/ai-agent-basic-text-tool-ask.generated.d.ts +34 -0
  128. package/lib-esm/schemas/ai-agent-basic-text-tool-ask.generated.js +3 -0
  129. package/lib-esm/schemas/ai-agent-basic-text-tool-ask.generated.js.map +1 -0
  130. package/lib-esm/schemas/ai-agent-basic-text-tool-text-gen.generated.d.ts +36 -0
  131. package/lib-esm/schemas/ai-agent-basic-text-tool-text-gen.generated.js +3 -0
  132. package/lib-esm/schemas/ai-agent-basic-text-tool-text-gen.generated.js.map +1 -0
  133. package/lib-esm/schemas/ai-agent-long-text-tool.generated.d.ts +9 -0
  134. package/lib-esm/schemas/ai-agent-long-text-tool.generated.js +3 -0
  135. package/lib-esm/schemas/ai-agent-long-text-tool.generated.js.map +1 -0
  136. package/lib-esm/schemas/ai-agent-text-gen.generated.d.ts +14 -0
  137. package/lib-esm/schemas/ai-agent-text-gen.generated.js +3 -0
  138. package/lib-esm/schemas/ai-agent-text-gen.generated.js.map +1 -0
  139. package/lib-esm/schemas/ai-ask.generated.d.ts +40 -0
  140. package/lib-esm/schemas/ai-ask.generated.js +3 -0
  141. package/lib-esm/schemas/ai-ask.generated.js.map +1 -0
  142. package/lib-esm/schemas/ai-citation.generated.d.ts +27 -0
  143. package/lib-esm/schemas/ai-citation.generated.js +3 -0
  144. package/lib-esm/schemas/ai-citation.generated.js.map +1 -0
  145. package/lib-esm/schemas/ai-dialogue-history.generated.d.ts +22 -0
  146. package/lib-esm/schemas/ai-dialogue-history.generated.js +3 -0
  147. package/lib-esm/schemas/ai-dialogue-history.generated.js.map +1 -0
  148. package/lib-esm/schemas/ai-llm-endpoint-params-google.generated.d.ts +31 -0
  149. package/lib-esm/schemas/ai-llm-endpoint-params-google.generated.js +3 -0
  150. package/lib-esm/schemas/ai-llm-endpoint-params-google.generated.js.map +1 -0
  151. package/lib-esm/schemas/ai-llm-endpoint-params-open-ai.generated.d.ts +43 -0
  152. package/lib-esm/schemas/ai-llm-endpoint-params-open-ai.generated.js +3 -0
  153. package/lib-esm/schemas/ai-llm-endpoint-params-open-ai.generated.js.map +1 -0
  154. package/lib-esm/schemas/ai-response-full.generated.d.ts +12 -0
  155. package/lib-esm/schemas/ai-response-full.generated.js +3 -0
  156. package/lib-esm/schemas/ai-response-full.generated.js.map +1 -0
  157. package/lib-esm/schemas/ai-response.generated.d.ts +22 -0
  158. package/lib-esm/schemas/ai-response.generated.js +3 -0
  159. package/lib-esm/schemas/ai-response.generated.js.map +1 -0
  160. package/lib-esm/schemas/ai-text-gen.generated.d.ts +30 -0
  161. package/lib-esm/schemas/ai-text-gen.generated.js +3 -0
  162. package/lib-esm/schemas/ai-text-gen.generated.js.map +1 -0
  163. package/lib-esm/schemas/collaboration-create.d.ts +5 -0
  164. package/lib-esm/schemas/collaboration-create.js +3 -0
  165. package/lib-esm/schemas/collaboration-create.js.map +1 -0
  166. package/lib-esm/schemas/collaboration-update.d.ts +7 -0
  167. package/lib-esm/schemas/collaboration-update.js +3 -0
  168. package/lib-esm/schemas/collaboration-update.js.map +1 -0
  169. package/lib-esm/schemas/collaboration.d.ts +108 -0
  170. package/lib-esm/schemas/collaboration.js +3 -0
  171. package/lib-esm/schemas/collaboration.js.map +1 -0
  172. package/lib-esm/schemas/collaborations.d.ts +13 -0
  173. package/lib-esm/schemas/collaborations.js +3 -0
  174. package/lib-esm/schemas/collaborations.js.map +1 -0
  175. package/lib-esm/schemas/enterprise-base.generated.d.ts +18 -0
  176. package/lib-esm/schemas/enterprise-base.generated.js +3 -0
  177. package/lib-esm/schemas/enterprise-base.generated.js.map +1 -0
  178. package/lib-esm/schemas/file-base.generated.d.ts +32 -0
  179. package/lib-esm/schemas/file-base.generated.js +3 -0
  180. package/lib-esm/schemas/file-base.generated.js.map +1 -0
  181. package/lib-esm/schemas/file-mini.generated.d.ts +41 -0
  182. package/lib-esm/schemas/file-mini.generated.js +3 -0
  183. package/lib-esm/schemas/file-mini.generated.js.map +1 -0
  184. package/lib-esm/schemas/file-request.d.ts +41 -0
  185. package/lib-esm/schemas/file-request.js +3 -0
  186. package/lib-esm/schemas/file-request.js.map +1 -0
  187. package/lib-esm/schemas/file-version-base.generated.d.ts +19 -0
  188. package/lib-esm/schemas/file-version-base.generated.js +3 -0
  189. package/lib-esm/schemas/file-version-base.generated.js.map +1 -0
  190. package/lib-esm/schemas/file-version-mini.generated.d.ts +14 -0
  191. package/lib-esm/schemas/file-version-mini.generated.js +3 -0
  192. package/lib-esm/schemas/file-version-mini.generated.js.map +1 -0
  193. package/lib-esm/schemas/folder-base.generated.d.ts +32 -0
  194. package/lib-esm/schemas/folder-base.generated.js +3 -0
  195. package/lib-esm/schemas/folder-base.generated.js.map +1 -0
  196. package/lib-esm/schemas/folder-mini.generated.d.ts +31 -0
  197. package/lib-esm/schemas/folder-mini.generated.js +3 -0
  198. package/lib-esm/schemas/folder-mini.generated.js.map +1 -0
  199. package/lib-esm/schemas/index.d.ts +15 -0
  200. package/lib-esm/schemas/index.generated.d.ts +52 -0
  201. package/lib-esm/schemas/index.generated.js +69 -0
  202. package/lib-esm/schemas/index.generated.js.map +1 -0
  203. package/lib-esm/schemas/index.js +32 -0
  204. package/lib-esm/schemas/index.js.map +1 -0
  205. package/lib-esm/schemas/integration-mapping-base.d.ts +23 -0
  206. package/lib-esm/schemas/integration-mapping-base.js +3 -0
  207. package/lib-esm/schemas/integration-mapping-base.js.map +1 -0
  208. package/lib-esm/schemas/integration-mapping-box-item-slack.d.ts +17 -0
  209. package/lib-esm/schemas/integration-mapping-box-item-slack.js +3 -0
  210. package/lib-esm/schemas/integration-mapping-box-item-slack.js.map +1 -0
  211. package/lib-esm/schemas/integration-mapping-partner-item-slack.d.ts +27 -0
  212. package/lib-esm/schemas/integration-mapping-partner-item-slack.js +3 -0
  213. package/lib-esm/schemas/integration-mapping-partner-item-slack.js.map +1 -0
  214. package/lib-esm/schemas/integration-mapping-slack-create-request.d.ts +12 -0
  215. package/lib-esm/schemas/integration-mapping-slack-create-request.js +3 -0
  216. package/lib-esm/schemas/integration-mapping-slack-create-request.js.map +1 -0
  217. package/lib-esm/schemas/integration-mapping-slack-options.d.ts +16 -0
  218. package/lib-esm/schemas/integration-mapping-slack-options.js +3 -0
  219. package/lib-esm/schemas/integration-mapping-slack-options.js.map +1 -0
  220. package/lib-esm/schemas/integration-mapping.d.ts +55 -0
  221. package/lib-esm/schemas/integration-mapping.js +3 -0
  222. package/lib-esm/schemas/integration-mapping.js.map +1 -0
  223. package/lib-esm/schemas/integration-mappings.d.ts +27 -0
  224. package/lib-esm/schemas/integration-mappings.js +3 -0
  225. package/lib-esm/schemas/integration-mappings.js.map +1 -0
  226. package/lib-esm/schemas/shield-information-barrier-base.generated.d.ts +18 -0
  227. package/lib-esm/schemas/shield-information-barrier-base.generated.js +3 -0
  228. package/lib-esm/schemas/shield-information-barrier-base.generated.js.map +1 -0
  229. package/lib-esm/schemas/shield-information-barrier-reference.generated.d.ts +9 -0
  230. package/lib-esm/schemas/shield-information-barrier-reference.generated.js +3 -0
  231. package/lib-esm/schemas/shield-information-barrier-reference.generated.js.map +1 -0
  232. package/lib-esm/schemas/shield-information-barrier-report-base.generated.d.ts +18 -0
  233. package/lib-esm/schemas/shield-information-barrier-report-base.generated.js +3 -0
  234. package/lib-esm/schemas/shield-information-barrier-report-base.generated.js.map +1 -0
  235. package/lib-esm/schemas/shield-information-barrier-report-details.generated.d.ts +9 -0
  236. package/lib-esm/schemas/shield-information-barrier-report-details.generated.js +3 -0
  237. package/lib-esm/schemas/shield-information-barrier-report-details.generated.js.map +1 -0
  238. package/lib-esm/schemas/shield-information-barrier-report.generated.d.ts +32 -0
  239. package/lib-esm/schemas/shield-information-barrier-report.generated.js +3 -0
  240. package/lib-esm/schemas/shield-information-barrier-report.generated.js.map +1 -0
  241. package/lib-esm/schemas/shield-information-barrier-reports.generated.d.ts +26 -0
  242. package/lib-esm/schemas/shield-information-barrier-reports.generated.js +3 -0
  243. package/lib-esm/schemas/shield-information-barrier-reports.generated.js.map +1 -0
  244. package/lib-esm/schemas/shield-information-barrier-segment-member-base.generated.d.ts +19 -0
  245. package/lib-esm/schemas/shield-information-barrier-segment-member-base.generated.js +3 -0
  246. package/lib-esm/schemas/shield-information-barrier-segment-member-base.generated.js.map +1 -0
  247. package/lib-esm/schemas/shield-information-barrier-segment-member-mini.generated.d.ts +13 -0
  248. package/lib-esm/schemas/shield-information-barrier-segment-member-mini.generated.js +3 -0
  249. package/lib-esm/schemas/shield-information-barrier-segment-member-mini.generated.js.map +1 -0
  250. package/lib-esm/schemas/shield-information-barrier-segment-member.generated.d.ts +39 -0
  251. package/lib-esm/schemas/shield-information-barrier-segment-member.generated.js +3 -0
  252. package/lib-esm/schemas/shield-information-barrier-segment-member.generated.js.map +1 -0
  253. package/lib-esm/schemas/shield-information-barrier-segment-members.generated.d.ts +26 -0
  254. package/lib-esm/schemas/shield-information-barrier-segment-members.generated.js +3 -0
  255. package/lib-esm/schemas/shield-information-barrier-segment-members.generated.js.map +1 -0
  256. package/lib-esm/schemas/shield-information-barrier-segment-restriction-base.generated.d.ts +20 -0
  257. package/lib-esm/schemas/shield-information-barrier-segment-restriction-base.generated.js +3 -0
  258. package/lib-esm/schemas/shield-information-barrier-segment-restriction-base.generated.js.map +1 -0
  259. package/lib-esm/schemas/shield-information-barrier-segment-restriction-mini.generated.d.ts +20 -0
  260. package/lib-esm/schemas/shield-information-barrier-segment-restriction-mini.generated.js +3 -0
  261. package/lib-esm/schemas/shield-information-barrier-segment-restriction-mini.generated.js.map +1 -0
  262. package/lib-esm/schemas/shield-information-barrier-segment-restriction.generated.d.ts +33 -0
  263. package/lib-esm/schemas/shield-information-barrier-segment-restriction.generated.js +3 -0
  264. package/lib-esm/schemas/shield-information-barrier-segment-restriction.generated.js.map +1 -0
  265. package/lib-esm/schemas/shield-information-barrier-segment-restrictions.generated.d.ts +26 -0
  266. package/lib-esm/schemas/shield-information-barrier-segment-restrictions.generated.js +3 -0
  267. package/lib-esm/schemas/shield-information-barrier-segment-restrictions.generated.js.map +1 -0
  268. package/lib-esm/schemas/shield-information-barrier-segment.generated.d.ts +50 -0
  269. package/lib-esm/schemas/shield-information-barrier-segment.generated.js +3 -0
  270. package/lib-esm/schemas/shield-information-barrier-segment.generated.js.map +1 -0
  271. package/lib-esm/schemas/shield-information-barrier-segments.generated.d.ts +26 -0
  272. package/lib-esm/schemas/shield-information-barrier-segments.generated.js +3 -0
  273. package/lib-esm/schemas/shield-information-barrier-segments.generated.js.map +1 -0
  274. package/lib-esm/schemas/shield-information-barrier.generated.d.ts +56 -0
  275. package/lib-esm/schemas/shield-information-barrier.generated.js +3 -0
  276. package/lib-esm/schemas/shield-information-barrier.generated.js.map +1 -0
  277. package/lib-esm/schemas/shield-information-barriers.generated.d.ts +25 -0
  278. package/lib-esm/schemas/shield-information-barriers.generated.js +3 -0
  279. package/lib-esm/schemas/shield-information-barriers.generated.js.map +1 -0
  280. package/lib-esm/schemas/sign-request-base.generated.d.ts +78 -0
  281. package/lib-esm/schemas/sign-request-base.generated.js +3 -0
  282. package/lib-esm/schemas/sign-request-base.generated.js.map +1 -0
  283. package/lib-esm/schemas/sign-request-create-request.generated.d.ts +39 -0
  284. package/lib-esm/schemas/sign-request-create-request.generated.js +3 -0
  285. package/lib-esm/schemas/sign-request-create-request.generated.js.map +1 -0
  286. package/lib-esm/schemas/sign-request-create-signer.generated.d.ts +95 -0
  287. package/lib-esm/schemas/sign-request-create-signer.generated.js +3 -0
  288. package/lib-esm/schemas/sign-request-create-signer.generated.js.map +1 -0
  289. package/lib-esm/schemas/sign-request-prefill-tag.generated.d.ts +28 -0
  290. package/lib-esm/schemas/sign-request-prefill-tag.generated.js +3 -0
  291. package/lib-esm/schemas/sign-request-prefill-tag.generated.js.map +1 -0
  292. package/lib-esm/schemas/sign-request-signer-input.generated.d.ts +28 -0
  293. package/lib-esm/schemas/sign-request-signer-input.generated.js +3 -0
  294. package/lib-esm/schemas/sign-request-signer-input.generated.js.map +1 -0
  295. package/lib-esm/schemas/sign-request-signer.generated.d.ts +34 -0
  296. package/lib-esm/schemas/sign-request-signer.generated.js +3 -0
  297. package/lib-esm/schemas/sign-request-signer.generated.js.map +1 -0
  298. package/lib-esm/schemas/sign-request.generated.d.ts +72 -0
  299. package/lib-esm/schemas/sign-request.generated.js +3 -0
  300. package/lib-esm/schemas/sign-request.generated.js.map +1 -0
  301. package/lib-esm/schemas/sign-requests.generated.d.ts +25 -0
  302. package/lib-esm/schemas/sign-requests.generated.js +3 -0
  303. package/lib-esm/schemas/sign-requests.generated.js.map +1 -0
  304. package/lib-esm/schemas/sign-template.generated.d.ts +94 -0
  305. package/lib-esm/schemas/sign-template.generated.js +3 -0
  306. package/lib-esm/schemas/sign-template.generated.js.map +1 -0
  307. package/lib-esm/schemas/sign-templates.generated.d.ts +30 -0
  308. package/lib-esm/schemas/sign-templates.generated.js +3 -0
  309. package/lib-esm/schemas/sign-templates.generated.js.map +1 -0
  310. package/lib-esm/schemas/template-signer-input.generated.d.ts +61 -0
  311. package/lib-esm/schemas/template-signer-input.generated.js +3 -0
  312. package/lib-esm/schemas/template-signer-input.generated.js.map +1 -0
  313. package/lib-esm/schemas/template-signer.generated.d.ts +43 -0
  314. package/lib-esm/schemas/template-signer.generated.js +3 -0
  315. package/lib-esm/schemas/template-signer.generated.js.map +1 -0
  316. package/lib-esm/schemas/user-base.generated.d.ts +18 -0
  317. package/lib-esm/schemas/user-base.generated.js +3 -0
  318. package/lib-esm/schemas/user-base.generated.js.map +1 -0
  319. package/lib-esm/schemas/user-integration-mappings.d.ts +19 -0
  320. package/lib-esm/schemas/user-integration-mappings.js +3 -0
  321. package/lib-esm/schemas/user-integration-mappings.js.map +1 -0
  322. package/lib-esm/schemas/user-mini.d.ts +6 -0
  323. package/lib-esm/schemas/user-mini.js +3 -0
  324. package/lib-esm/schemas/user-mini.js.map +1 -0
  325. package/lib-esm/sessions/app-auth-session.d.ts +92 -0
  326. package/lib-esm/sessions/app-auth-session.js +176 -0
  327. package/lib-esm/sessions/app-auth-session.js.map +1 -0
  328. package/lib-esm/sessions/basic-session.d.ts +55 -0
  329. package/lib-esm/sessions/basic-session.js +62 -0
  330. package/lib-esm/sessions/basic-session.js.map +1 -0
  331. package/lib-esm/sessions/ccg-session.d.ts +72 -0
  332. package/lib-esm/sessions/ccg-session.js +111 -0
  333. package/lib-esm/sessions/ccg-session.js.map +1 -0
  334. package/lib-esm/sessions/persistent-session.d.ts +96 -0
  335. package/lib-esm/sessions/persistent-session.js +234 -0
  336. package/lib-esm/sessions/persistent-session.js.map +1 -0
  337. package/lib-esm/token-manager.d.ts +191 -0
  338. package/lib-esm/token-manager.js +453 -0
  339. package/lib-esm/token-manager.js.map +1 -0
  340. package/lib-esm/util/config.d.ts +85 -0
  341. package/lib-esm/util/config.js +212 -0
  342. package/lib-esm/util/config.js.map +1 -0
  343. package/lib-esm/util/errors.d.ts +50 -0
  344. package/lib-esm/util/errors.js +176 -0
  345. package/lib-esm/util/errors.js.map +1 -0
  346. package/lib-esm/util/exponential-backoff.d.ts +11 -0
  347. package/lib-esm/util/exponential-backoff.js +17 -0
  348. package/lib-esm/util/exponential-backoff.js.map +1 -0
  349. package/lib-esm/util/paging-iterator.d.ts +53 -0
  350. package/lib-esm/util/paging-iterator.js +247 -0
  351. package/lib-esm/util/paging-iterator.js.map +1 -0
  352. package/lib-esm/util/serializable.d.ts +10 -0
  353. package/lib-esm/util/serializable.js +17 -0
  354. package/lib-esm/util/serializable.js.map +1 -0
  355. package/lib-esm/util/url-path.d.ts +16 -0
  356. package/lib-esm/util/url-path.js +36 -0
  357. package/lib-esm/util/url-path.js.map +1 -0
  358. package/package.json +18 -4
@@ -0,0 +1,817 @@
1
+ /**
2
+ * @fileoverview Manager for the Box Files Resource
3
+ */
4
+ import Promise from 'bluebird';
5
+ import { Readable, Writable } from 'stream';
6
+ import BoxClient from '../box-client';
7
+ import * as schemas from '../schemas';
8
+ /**
9
+ * Enum of valid x-rep- hint values for generating representation info
10
+ *
11
+ * @readonly
12
+ * @enum {FileRepresentationType}
13
+ */
14
+ declare enum FileRepresentationType {
15
+ PDF = "[pdf]",
16
+ THUMBNAIL = "[jpg?dimensions=320x320]",
17
+ IMAGE_MEDIUM = "[jpg?dimensions=1024x1024][png?dimensions=1024x1024]",
18
+ IMAGE_LARGE = "[jpg?dimensions=2048x2048][png?dimensions=2048x2048]",
19
+ EXTRACTED_TEXT = "[extracted_text]"
20
+ }
21
+ /**
22
+ * @typedef {Object} UploadPart
23
+ * @property {string} part_id An 8-character hexadecimal string identifying the part
24
+ * @property {int} offset The byte offset of the part within the whole file
25
+ * @property {int} size The size of the part in bytes
26
+ */
27
+ type UploadPart = {
28
+ part_id: string;
29
+ offset: number;
30
+ size: number;
31
+ };
32
+ type FileSharedLinkAccess = 'open' | 'company' | 'collaborators' | null;
33
+ type FileSharedLinkPermissions = {
34
+ /**
35
+ * If the shared link allows only to view files. This can only be set when access is set to open or company.
36
+ */
37
+ can_view?: true;
38
+ /**
39
+ * If the shared link allows only to download files. This can only be set when access is set to open or company.
40
+ */
41
+ can_download?: boolean;
42
+ /**
43
+ * If the shared link allows only to edit files. This can only be set when access is set to open or company.
44
+ */
45
+ can_edit?: boolean;
46
+ };
47
+ type FileSharedLink = {
48
+ /**
49
+ * The level of access for the shared link. This can be restricted to anyone with the link (open),
50
+ * only people within the company (company) and only those who have been invited to the file (collaborators).
51
+ *
52
+ * If not set, this field defaults to the access level specified by the enterprise admin.
53
+ * To create a shared link with this default setting pass the shared_link object with no access field.
54
+ * To remove access and change its value to default one pass the shared_link object with null value access field.
55
+ */
56
+ access?: FileSharedLinkAccess;
57
+ /**
58
+ * The password required to access the shared link. Set the password to null to remove it.
59
+ * A password can only be set when access is set to open.
60
+ */
61
+ password?: string | null;
62
+ /**
63
+ * The timestamp at which this shared link will expire. This field can only be set by users with paid accounts.
64
+ * The value must be greater than the current date and time.
65
+ * Example value: '2012-12-12T10:53:43-08:00'
66
+ */
67
+ unshared_at?: string | null;
68
+ /**
69
+ * Defines a custom vanity name to use in the shared link URL, for example vanity_name: "my-shared-link" will
70
+ * produce a shared link of "https://app.box.com/v/my-shared-link".
71
+ *
72
+ * Custom URLs should not be used when sharing sensitive content as vanity URLs are a lot easier to guess
73
+ * than regular shared links.
74
+ */
75
+ vanity_name?: string | null;
76
+ /**
77
+ * Defines what actions are allowed on a shared link.
78
+ */
79
+ permissions?: FileSharedLinkPermissions;
80
+ };
81
+ /**
82
+ * Simple manager for interacting with all 'File' endpoints and actions.
83
+ *
84
+ * @param {BoxClient} client The Box API Client that is responsible for making calls to the API
85
+ * @constructor
86
+ */
87
+ declare class Files {
88
+ client: BoxClient;
89
+ representation: typeof FileRepresentationType;
90
+ constructor(client: BoxClient);
91
+ /**
92
+ * Requests a file object with the given ID.
93
+ *
94
+ * API Endpoint: '/files/:fileID'
95
+ * Method: GET
96
+ *
97
+ * @param {string} fileID - Box ID of the file being requested
98
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
99
+ * @param {Function} [callback] - Passed the file information if it was acquired successfully
100
+ * @returns {Promise<Object>} A promise resolving to the file object
101
+ */
102
+ get(fileID: string, options?: Record<string, any>, callback?: Function): any;
103
+ /**
104
+ * Requests a download URL for a given file.
105
+ *
106
+ * API Endpoint: '/files/:fileID/content'
107
+ * Method: GET
108
+ * Special Expected Responses:
109
+ * 202 ACCEPTED - Download isn't available yet. Returns an error.
110
+ * 302 FOUND - Download is available. A Download URL is returned.
111
+ *
112
+ * @param {string} fileID - Box ID of the file being requested
113
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
114
+ * @param {Function} [callback] - Passed the download URL if request was successful.
115
+ * @returns {Promise<string>} A promise resolving to the file's download URL
116
+ */
117
+ getDownloadURL(fileID: string, options?: Record<string, any>, callback?: Function): any;
118
+ /**
119
+ * Requests a Readable Stream for the given file ID.
120
+ *
121
+ * API Endpoint: '/files/:fileID/content'
122
+ * Method: GET
123
+ * Special Expected Responses:
124
+ * 202 ACCEPTED - Download isn't available yet. Returns an error.
125
+ * 302 FOUND - Download is available. A Download stream is returned.
126
+ *
127
+ * @param {string} fileID - Box ID of the file being requested
128
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
129
+ * @param {string} [options.version] - ID of the version of this file to download
130
+ * @param {int[]} [options.byteRange] - starting and ending bytes of the file to read, e.g. [0, 99] to read the first 100 bytes
131
+ * @param {Function} [callback] - passed the readable stream if request was successful
132
+ * @returns {Promise<Readable>} A promise resolving for the file stream
133
+ */
134
+ getReadStream(fileID: string, options?: {
135
+ version?: string;
136
+ byteRange?: number[];
137
+ }, callback?: Function): any;
138
+ /**
139
+ * Gets the comments on a file.
140
+ *
141
+ * API Endpoint: '/files/:fileID/comments'
142
+ * Method: GET
143
+ *
144
+ * @param {string} fileID - Box file id of the file
145
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
146
+ * @param {Function} [callback] - passed the file comments if they were successfully acquired
147
+ * @returns {Promise<Object>} A promise resolving to the collection of comments
148
+ */
149
+ getComments(fileID: string, options?: Record<string, any>, callback?: Function): any;
150
+ /**
151
+ * Update some information about a given file.
152
+ *
153
+ * API Endpoint: '/files/:fileID'
154
+ * Method: PUT
155
+ *
156
+ * @param {string} fileID - Box ID of the file being requested
157
+ * @param {Object} updates - File fields to update
158
+ * @param {string} [updates.etag] Only apply the updates if the file etag matches
159
+ * @param {string} [updates.fields] Comma-separated list of fields to return
160
+ * @param {Function} [callback] - Passed the updated file information if it was acquired successfully
161
+ * @returns {Promise<Object>} A promise resolving to the update file object
162
+ */
163
+ update(fileID: string, updates: {
164
+ [key: string]: any;
165
+ etag?: string;
166
+ shared_link?: FileSharedLink;
167
+ fields?: string;
168
+ }, callback?: Function): any;
169
+ /**
170
+ * Add a file to a given collection
171
+ *
172
+ * API Endpoint: '/files/:fileID'
173
+ * Method: PUT
174
+ *
175
+ * @param {string} fileID - The file to add to the collection
176
+ * @param {string} collectionID - The collection to add the file to
177
+ * @param {Function} [callback] - Passed the updated file if successful, error otherwise
178
+ * @returns {Promise<Object>} A promise resolving to the updated file object
179
+ */
180
+ addToCollection(fileID: string, collectionID: string, callback?: Function): any;
181
+ /**
182
+ * Remove a file from a given collection
183
+ *
184
+ * API Endpoint: '/files/:fileID'
185
+ * Method: PUT
186
+ *
187
+ * @param {string} fileID - The file to remove from the collection
188
+ * @param {string} collectionID - The collection to remove the file from
189
+ * @param {Function} [callback] - Passed the updated file if successful, error otherwise
190
+ * @returns {Promise<Object>} A promise resolving to the updated file object
191
+ */
192
+ removeFromCollection(fileID: string, collectionID: string, callback?: Function): any;
193
+ /**
194
+ * Move a file into a new parent folder.
195
+ *
196
+ * API Endpoint: '/files/:fileID'
197
+ * Method: PUT
198
+ *
199
+ * @param {string} fileID - The Box ID of the file being requested
200
+ * @param {string} newParentID - The Box ID for the new parent folder. '0' to move to All Files.
201
+ * @param {Function} [callback] - Passed the updated file information if it was acquired successfully
202
+ * @returns {Promise<Object>} A promise resolving to the updated file object
203
+ */
204
+ move(fileID: string, newParentID: string, callback?: Function): any;
205
+ /**
206
+ * Copy a file into a new folder.
207
+ *
208
+ * API Endpoint: '/files/:fileID/copy
209
+ * Method: POST
210
+ *
211
+ * @param {string} fileID - The Box ID of the file being requested
212
+ * @param {string} newParentID - The Box ID for the new parent folder. '0' to copy to All Files.
213
+ * @param {Object} [options] - Optional parameters for the copy operation, can be left null in most cases
214
+ * @param {string} [options.name] - A new name to use if there is an identically-named item in the new parent folder
215
+ * @param {string} [options.version] - An optional ID of the specific file version to copy
216
+ * @param {Function} [callback] - passed the new file info if call was successful
217
+ * @returns {Promise<Object>} A promise resolving to the new file object
218
+ */
219
+ copy(fileID: string, newParentID: string, options?: {
220
+ name?: string;
221
+ version?: string;
222
+ } | Function, callback?: Function): any;
223
+ /**
224
+ * Delete a given file.
225
+ *
226
+ * API Endpoint: '/files/:fileID'
227
+ * Method: DELETE
228
+ *
229
+ * @param {string} fileID - Box ID of the file being requested
230
+ * @param {Object} [options] Optional parameters
231
+ * @param {string} [options.etag] Only delete the file if the etag value matches
232
+ * @param {Function} [callback] - Empty response body passed if successful.
233
+ * @returns {Promise<void>} A promise resolving to nothing
234
+ */
235
+ delete(fileID: string, options?: {
236
+ [key: string]: any;
237
+ etag?: string;
238
+ } | Function, callback?: Function): any;
239
+ /**
240
+ * Get preflight information for a new file upload. Without any file data,
241
+ * this will return an upload URL and token to be used when uploading the file.
242
+ * Using this upload URL will allow for the fastest upload, and the one-time
243
+ * token can be passed to a worker or other client to actually perform the
244
+ * upload with. If file data (e.g. size, parent, name) is passed, it will be
245
+ * validated as if the actual file were being uploaded. This enables checking
246
+ * of preconditions such as name uniqueness and available storage space before
247
+ * attempting a large file upload.
248
+ *
249
+ * API Endpoint: '/files/content'
250
+ * Method: OPTIONS
251
+ *
252
+ * @param {string} parentFolderID - The id of the parent folder to upload to
253
+ * @param {Object} [fileData] - Optional data about the file to be uploaded
254
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
255
+ * @param {Function} [callback] - Called with upload data if successful, or err if the upload would not succeed
256
+ * @returns {Promise<Object>} A promise resolving to the upload data
257
+ */
258
+ preflightUploadFile(parentFolderID: string, fileData?: Record<string, any>, options?: Record<string, any>, callback?: Function): any;
259
+ /**
260
+ * Get preflight information for a file version upload. Without any file data,
261
+ * this will return an upload URL and token to be used when uploading the file.
262
+ * Using this upload URL will allow for the fastest upload, and the one-time
263
+ * token can be passed to a worker or other client to actually perform the
264
+ * upload with. If file data (e.g. size, parent, name) is passed, it will be
265
+ * validated as if the actual file were being uploaded. This enables checking
266
+ * of preconditions such as name uniqueness and available storage space before
267
+ * attempting a large file upload.
268
+ *
269
+ * API Endpoint: '/files/:fileID/content'
270
+ * Method: OPTIONS
271
+ *
272
+ * @param {string} fileID - The file ID to which a new version will be uploaded
273
+ * @param {Object} [fileData] - Optional data about the file to be uploaded
274
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
275
+ * @param {Function} [callback] - Called with upload data if successful, or err if the upload would not succeed
276
+ * @returns {Promise<Object>} A promise resolving to the upload data
277
+ */
278
+ preflightUploadNewFileVersion(fileID: string, fileData?: Record<string, any>, options?: Record<string, any>, callback?: Function): any;
279
+ /**
280
+ * If there are previous versions of this file, this method can be used to promote one of the older
281
+ * versions to the top of the stack. This actually mints a copy of the old version and puts it on
282
+ * the top of the versions stack. The file will have the exact same contents, the same SHA1/etag,
283
+ * and the same name as the original. Other properties such as comments do not get updated to their former values.
284
+ *
285
+ * API Endpoint: '/files/:fileID/versions/current'
286
+ * Method: POST
287
+ *
288
+ * @param {string} fileID - The file ID which version will be promoted
289
+ * @param {string} versionID - The ID of the file_version that you want to make current
290
+ * @param {Function} [callback] - Passed the promoted file version information if successful, error otherwise
291
+ * @returns {Promise<Object>} A promise resolving to the promoted file version
292
+ */
293
+ promoteVersion(fileID: string, versionID: string, callback?: Function): any;
294
+ /**
295
+ * Uploads a new file. Unlike non-upload methods, this method will not perform any retries.
296
+ * This method currently does not support any optional parameters such as contentModifiedAt.
297
+ *
298
+ * API Endpoint: '/files/content'
299
+ * Method: POST
300
+ *
301
+ * @param {string} parentFolderID - the id of the parent folder to upload to
302
+ * @param {string} filename - the file name that the uploaded file should have
303
+ * @param {string|Buffer|ReadStream} content - the content of the file. It can be a string, a Buffer, or a read stream
304
+ * (like that returned by fs.createReadStream()).
305
+ * @param {Object} [options] - Optional parameters
306
+ * @param {string} [options.content_created_at] - RFC 3339 timestamp when the file was created
307
+ * @param {string} [options.content_modified_at] - RFC 3339 timestamp when the file was last modified
308
+ * @param {int} [options.content_length] - Optional length of the content. Required if content is a read stream of any type other than fs stream.
309
+ * @param {string} [options.description] - Optional description of the uploaded file.
310
+ * @param {Function} [callback] - called with data about the upload if successful, or an error if the
311
+ * upload failed
312
+ * @returns {Promise<Object>} A promise resolving to the uploaded file
313
+ */
314
+ uploadFile(parentFolderID: string, filename: string, content: string | Buffer | Readable, options?: {
315
+ content_created_at?: string;
316
+ content_modified_at?: string;
317
+ content_length?: number;
318
+ description?: string;
319
+ } | Function, callback?: Function): any;
320
+ /**
321
+ * Uploads a new version of a file. Unlike non-upload methods, this method will not perform any retries.
322
+ * This method currently does not support any optional parameters such as contentModifiedAt.
323
+ *
324
+ * API Endpoint: '/files/:fileID/content'
325
+ * Method: POST
326
+ *
327
+ * @param {string} fileID - the id of the file to upload a new version of
328
+ * @param {string|Buffer|Stream} content - the content of the file. It can be a string, a Buffer, or a read stream
329
+ * (like that returned by fs.createReadStream()).
330
+ * @param {Object} [options] - Optional parameters
331
+ * @param {string} [options.content_modified_at] - RFC 3339 timestamp when the file was last modified
332
+ * @param {string} [options.name] - A new name for the file
333
+ * @param {int} [options.content_length] - Optional length of the content. Required if content is a read stream of any type other than fs stream.
334
+ * @param {string} [options.description] - Optional description of the uploaded new file version.
335
+ * @param {Function} [callback] - called with data about the upload if successful, or an error if the
336
+ * upload failed
337
+ * @returns {Promise<Object>} A promise resolving to the uploaded file
338
+ */
339
+ uploadNewFileVersion(fileID: string, content: string | Buffer | Readable, options?: {
340
+ content_modified_at?: string;
341
+ name?: string;
342
+ content_length?: number;
343
+ description?: string;
344
+ } | Function, callback?: Function): any;
345
+ /**
346
+ * Retrieves all metadata associated with a file.
347
+ *
348
+ * API Endpoint: '/files/:fileID/metadata'
349
+ * Method: GET
350
+ *
351
+ * @param {string} fileID - the ID of the file to get metadata for
352
+ * @param {Function} [callback] - called with an array of metadata when successful
353
+ * @returns {Promise<Object>} A promise resolving to a collection of metadata on the file
354
+ */
355
+ getAllMetadata(fileID: string, callback?: Function): any;
356
+ /**
357
+ * Retrieve a single metadata template instance for a file.
358
+ *
359
+ * API Endpoint: '/files/:fileID/metadata/:scope/:template'
360
+ * Method: GET
361
+ *
362
+ * @param {string} fileID - The ID of the file to retrive the metadata of
363
+ * @param {string} scope - The scope of the metadata template, e.g. "global"
364
+ * @param {string} template - The metadata template to retrieve
365
+ * @param {Function} [callback] - Passed the metadata template if successful
366
+ * @returns {Promise<Object>} A promise resolving to the metadata template
367
+ */
368
+ getMetadata(fileID: string, scope: string, template: string, callback?: Function): any;
369
+ /**
370
+ * Adds metadata to a file. Metadata must either match a template schema or
371
+ * be placed into the unstructured "properties" template in global scope.
372
+ *
373
+ * API Endpoint: '/files/:fileID/metadata/:scope/:template'
374
+ * Method: POST
375
+ *
376
+ * @param {string} fileID - The ID of the file to add metadata to
377
+ * @param {string} scope - The scope of the metadata template, e.g. "enterprise"
378
+ * @param {string} template - The metadata template schema to add
379
+ * @param {Object} data - Key/value pairs tp add as metadata
380
+ * @param {Function} [callback] - Called with error if unsuccessful
381
+ * @returns {Promise<Object>} A promise resolving to the new metadata
382
+ */
383
+ addMetadata(fileID: string, scope: string, template: string, data: Record<string, any>, callback?: Function): any;
384
+ /**
385
+ * Updates a metadata template instance with JSON Patch-formatted data.
386
+ *
387
+ * API Endpoint: '/files/:fileID/metadata/:scope/:template'
388
+ * Method: PUT
389
+ *
390
+ * @param {string} fileID - The file to update metadata for
391
+ * @param {string} scope - The scope of the template to update
392
+ * @param {string} template - The template to update
393
+ * @param {Object} patch - The patch data
394
+ * @param {Function} [callback] - Called with updated metadata if successful
395
+ * @returns {Promise<Object>} A promise resolving to the updated metadata
396
+ */
397
+ updateMetadata(fileID: string, scope: string, template: string, patch: Record<string, any>, callback?: Function): any;
398
+ /**
399
+ * Sets metadata on a file, overwriting any metadata that exists for the provided keys.
400
+ *
401
+ * @param {string} fileID - The file to set metadata on
402
+ * @param {string} scope - The scope of the metadata template
403
+ * @param {string} template - The key of the metadata template
404
+ * @param {Object} metadata - The metadata to set
405
+ * @param {Function} [callback] - Called with updated metadata if successful
406
+ * @returns {Promise<Object>} A promise resolving to the updated metadata
407
+ */
408
+ setMetadata(fileID: string, scope: string, template: string, metadata: Record<string, any>, callback?: Function): any;
409
+ /**
410
+ * Deletes a metadata template from a file.
411
+ *
412
+ * API Endpoint: '/files/:fileID/metadata/:scope/:template'
413
+ * Method: DELETE
414
+ *
415
+ * @param {string} fileID - The ID of the file to remove metadata from
416
+ * @param {string} scope - The scope of the metadata template
417
+ * @param {string} template - The template to remove from the file
418
+ * @param {Function} [callback] - Called with nothing if successful, error otherwise
419
+ * @returns {Promise<void>} A promise resolving to nothing
420
+ */
421
+ deleteMetadata(fileID: string, scope: string, template: string, callback?: Function): any;
422
+ /**
423
+ * Permanently deletes an item that is in the trash. The item will no longer exist in Box. This action cannot be undone.
424
+ *
425
+ * API Endpoint: '/files/:fileID/trash'
426
+ * Method: DELETE
427
+ *
428
+ * @param {string} fileID - The ID of the file to remove metadata from
429
+ * @param {Object} [options] Optional parameters
430
+ * @param {string} [options.etag] Only delete the file if the etag matches
431
+ * @param {Function} [callback] - Called with nothing if successful, error otherwise
432
+ * @returns {Promise<void>} A promise resolving to nothing
433
+ */
434
+ deletePermanently(fileID: string, options?: {
435
+ [key: string]: any;
436
+ etag?: string;
437
+ } | Function, callback?: Function): any;
438
+ /**
439
+ * Retrieves a file that has been moved to the trash.
440
+ *
441
+ * API Endpoint: '/files/:fileID/trash'
442
+ * Method: GET
443
+ *
444
+ * @param {string} fileID - The ID of the file being requested
445
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
446
+ * @param {Function} [callback] - Passed the trashed file information if successful, error otherwise
447
+ * @returns {Promise<Object>} A promise resolving to the trashed file
448
+ */
449
+ getTrashedFile(fileID: string, options?: Record<string, any>, callback?: Function): any;
450
+ /**
451
+ * Retrieves all of the tasks for given file.
452
+ *
453
+ * API Endpoint: '/files/:fileID/tasks'
454
+ * Method: GET
455
+ *
456
+ * @param {string} fileID - The ID of the file to get tasks for
457
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
458
+ * @param {Function} [callback] - Passed the file tasks if successful, error otherwise
459
+ * @returns {Promise<Object>} A promise resolving to a collections of tasks on the file
460
+ */
461
+ getTasks(fileID: string, options?: Record<string, any>, callback?: Function): any;
462
+ /**
463
+ * Used to retrieve an expiring URL for creating an embedded preview session.
464
+ * The URL will expire after 60 seconds and the preview session will expire after 60 minutes.
465
+ *
466
+ * API Endpoint: '/files/:fileID?fields=expiring_embed_link'
467
+ * Method: GET
468
+ *
469
+ * @param {string} fileID - The ID of the file to generate embed link for
470
+ * @param {Function} [callback] - Passed with the embed link if successful, error otherwise
471
+ * @returns {Promise<string>} A promise resolving to the file embed link URL
472
+ */
473
+ getEmbedLink(fileID: string, callback?: Function): any;
474
+ /**
475
+ * Locks a file.
476
+ *
477
+ * API Endpoint: '/files/:fileID'
478
+ * Method: PUT
479
+ *
480
+ * @param {string} fileID - The ID of the file to lock
481
+ * @param {Object} [options] - Optional parameters, can be left null in most cases
482
+ * @param {?string} [options.expires_at] - The time the lock expires
483
+ * @param {boolean} [options.is_download_prevented] - Whether or not the file can be downloaded while locked
484
+ * @param {Function} [callback] - Passed with the locked file information if successful, error otherwise
485
+ * @returns {Promise<Object>} A promise resolving to the locked file object
486
+ */
487
+ lock(fileID: string, options?: {
488
+ expires_at?: string;
489
+ is_download_prevented?: boolean;
490
+ }, callback?: Function): any;
491
+ /**
492
+ * Unlocks a file.
493
+ *
494
+ * API Endpoint: '/files/:fileID'
495
+ * Method: PUT
496
+ *
497
+ * @param {string} fileID - The ID of the file to unlock
498
+ * @param {Function} [callback] - Passed with the unlocked file information if successful, error otherwise
499
+ * @returns {Promise<Object>} A promise resolving to the unlocked file object
500
+ */
501
+ unlock(fileID: string, callback?: Function): any;
502
+ /**
503
+ * Restores an item that has been moved to the trash. Default behavior is to
504
+ * restore the item to the folder it was in before it was moved to the trash.
505
+ * If that parent folder no longer exists or if there is now an item with the
506
+ * same name in that parent folder, the new parent folder and/or new name will
507
+ * need to be included in the request.
508
+ *
509
+ * API Endpoint: '/files/:fileID'
510
+ * Method: POST
511
+ *
512
+ * @param {string} fileID - The ID of the file to restore
513
+ * @param {Object} [options] - Optional parameters, can be left null in most cases
514
+ * @param {string} [options.name] - The new name for this item
515
+ * @param {string} [options.parent_id] - The new parent folder for this item
516
+ * @param {Function} [callback] - Called with item information if successful, error otherwise
517
+ * @returns {Promise<Object>} A promise resolving to the restored file object
518
+ */
519
+ restoreFromTrash(fileID: string, options?: {
520
+ name?: string;
521
+ parent_id?: string;
522
+ }, callback?: Function): any;
523
+ /**
524
+ * If there are previous versions of this file, this method can be used to retrieve information
525
+ * about the older versions.
526
+ *
527
+ * API Endpoint: '/files/:fileID/versions'
528
+ * Method: GET
529
+ *
530
+ * @param {string} fileID - The ID of the file to view version for
531
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
532
+ * @param {Function} [callback] - Passed a list of previous file versions if successful, error otherwise
533
+ * @returns {Promise<Object>} A promise resolving to the collection of file versions
534
+ */
535
+ getVersions(fileID: string, options?: Record<string, any>, callback?: Function): any;
536
+ /**
537
+ * Used to retrieve the watermark for a corresponding Box file.
538
+ *
539
+ * API Endpoint: '/files/:fileID/watermark'
540
+ * Method: GET
541
+ *
542
+ * @param {string} fileID - The Box ID of the file to get watermark for
543
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
544
+ * @param {Function} [callback] - Passed the watermark information if successful, error otherwise
545
+ * @returns {Promise<Object>} A promise resolving to the watermark info
546
+ */
547
+ getWatermark(fileID: string, options?: Record<string, any>, callback?: Function): any;
548
+ /**
549
+ * Used to apply or update the watermark for a corresponding Box file.
550
+ *
551
+ * API Endpoint: '/files/:fileID/watermark'
552
+ * Method: PUT
553
+ *
554
+ * @param {string} fileID - The Box ID of the file to update watermark for
555
+ * @param {Object} [options] - Optional parameters, can be left null
556
+ * @param {Function} [callback] - Passed the watermark information if successful, error otherwise
557
+ * @returns {Promise<Object>} A promise resolving to the watermark info
558
+ */
559
+ applyWatermark(fileID: string, options?: Record<string, any>, callback?: Function): any;
560
+ /**
561
+ * Used to remove the watermark for a corresponding Box file.
562
+ *
563
+ * API Endpoint: '/files/:fileID/watermark'
564
+ * Method: DELETE
565
+ *
566
+ * @param {string} fileID - The Box ID of the file to remove watermark from
567
+ * @param {Function} [callback] - Empty response body passed if successful, error otherwise
568
+ * @returns {Promise<void>} A promise resolving to nothing
569
+ */
570
+ removeWatermark(fileID: string, callback: Function): any;
571
+ /**
572
+ * Discards a specific file version to the trash. Depending on the enterprise settings
573
+ * for this user, the item will either be actually deleted from Box or moved to the trash.
574
+ *
575
+ * API Endpoint: '/files/:fileID/version/:versionID'
576
+ * Method: DELETE
577
+ *
578
+ * @param {string} fileID - The file ID which old version will be moved to the trash or delete permanently
579
+ * @param {string} versionID - The ID of the version to move to the trash or delete permanently
580
+ * @param {Object} [options] Optional parameters
581
+ * @param {string} [options.etag] Only delete the version of the file etag matches
582
+ * @param {Function} [callback] - Empty response body, error otherwise
583
+ * @returns {Promise<void>} A promise resolving to nothing
584
+ */
585
+ deleteVersion(fileID: string, versionID: string, options?: {
586
+ [key: string]: any;
587
+ etag?: string;
588
+ } | Function, callback?: Function): any;
589
+ /**
590
+ * Creates a session used to upload a new file in chunks.. This will first
591
+ * verify that the file can be created and then open a session for uploading
592
+ * pieces of the file.
593
+ *
594
+ * API Endpoint: '/files/upload_sessions'
595
+ * Method: POST
596
+ *
597
+ * @param {string} folderID - The ID of the folder to upload the file to
598
+ * @param {int} size - The size of the file that will be uploaded
599
+ * @param {string} name - The name of the file to be created
600
+ * @param {Function} [callback] - Passed the upload session info if successful
601
+ * @returns {Promise<Object>} A promise resolving to the new upload session object
602
+ */
603
+ createUploadSession(folderID: string, size: number, name: string, callback?: Function): any;
604
+ /**
605
+ * Creates a session used to upload a new version of a file in chunks. This
606
+ * will first verify that the version can be created and then open a session for
607
+ * uploading pieces of the file.
608
+ *
609
+ * API Endpoint: '/files/:fileID/upload_sessions'
610
+ * Method: POST
611
+ *
612
+ * @param {string} fileID - The ID of the file to upload a new version of
613
+ * @param {int} size - The size of the file that will be uploaded
614
+ * @param {Function} [callback] - Passed the upload session info if successful
615
+ * @returns {Promise<Object>} A promise resolving to the new upload session object
616
+ */
617
+ createNewVersionUploadSession(fileID: string, size: number, callback?: Function): any;
618
+ /**
619
+ * Uploads a chunk of a file to an open upload session
620
+ *
621
+ * API Endpoint: '/files/upload_sessions/:sessionID'
622
+ * Method: PUT
623
+ *
624
+ * @param {string} sessionID - The ID of the upload session to upload to
625
+ * @param {Buffer|string} part - The chunk of the file to upload
626
+ * @param {int} offset - The byte position where the chunk begins in the file
627
+ * @param {int} totalSize - The total size of the file being uploaded
628
+ * @param {Function} [callback] - Passed the part definition if successful
629
+ * @returns {Promise<Object>} A promise resolving to the part object
630
+ */
631
+ uploadPart(sessionID: string, part: Buffer | string, offset: number, totalSize: number, callback?: Function): any;
632
+ /**
633
+ * Commit an upload session after all parts have been uploaded, creating the new file
634
+ *
635
+ * API Endpoint: '/files/upload_sessions/:sessionID/commit'
636
+ * Method: POST
637
+ *
638
+ * @param {string} sessionID - The ID of the upload session to commit
639
+ * @param {string} fileHash - The base64-encoded SHA-1 hash of the file being uploaded
640
+ * @param {Object} [options] - Optional parameters set on the created file, can be left null
641
+ * @param {UploadPart[]} [options.parts] The list of uploaded parts to be committed, will be fetched from the API otherwise
642
+ * @param {string} [options.description] - Optional description of the uploaded file.
643
+ * @param {Function} [callback] - Passed the new file information if successful
644
+ * @returns {Promise<Object>} A promise resolving to the uploaded file object
645
+ */
646
+ commitUploadSession(sessionID: string, fileHash: string, options?: {
647
+ parts?: UploadPart[];
648
+ description?: string;
649
+ }, callback?: Function): any;
650
+ /**
651
+ * Abort an upload session, discarding any chunks that were uploaded to it
652
+ *
653
+ * API Endpoint: '/files/upload_sessions/:sessionID'
654
+ * Method: DELETE
655
+ *
656
+ * @param {string} sessionID - The ID of the upload session to commit
657
+ * @param {Function} [callback] - Passed nothing if successful, error otherwise
658
+ * @returns {Promise<void>} A promise resolving to nothing
659
+ */
660
+ abortUploadSession(sessionID: string, callback?: Function): any;
661
+ /**
662
+ * Get a list of all parts that have been uploaded to an upload session
663
+ *
664
+ * API Endpoint: '/files/upload_sessions/:sessionID/parts'
665
+ * Method: GET
666
+ *
667
+ * @param {string} sessionID - The ID of the session to get a list of parts from
668
+ * @param {Object} [options] - Optional parameters, can be left null
669
+ * @param {string} [options.offset] - Paging offset for the list of parts
670
+ * @param {int} [options.limit] - Maximum number of parts to return
671
+ * @param {Function} [callback] - Passed the list of parts if successful
672
+ * @returns {Promise<Object>} A promise resolving to the collection of uploaded parts
673
+ */
674
+ getUploadSessionParts(sessionID: string, options?: {
675
+ offset?: string;
676
+ limit?: number;
677
+ }, callback?: Function): any;
678
+ /**
679
+ * Get the status of an upload session, e.g. whether or not is has started or
680
+ * finished committing
681
+ *
682
+ * API Endpoint: '/files/upload_sessions/:sessionID'
683
+ * Method: GET
684
+ *
685
+ * @param {string} sessionID - The ID of the upload session to get the status of
686
+ * @param {Function} [callback] - Passed the session status if successful
687
+ * @returns {Promise<Object>} A promise resolving to the upload session object
688
+ */
689
+ getUploadSession(sessionID: string, callback?: Function): any;
690
+ /**
691
+ * Upload a file in chunks, which is generally faster and more reliable for
692
+ * large files.
693
+ *
694
+ * API Endpoint: '/files/upload_sessions'
695
+ * Method: POST
696
+ *
697
+ * @param {string} folderID - The ID of the folder to upload the file to
698
+ * @param {int} size - The size of the file that will be uploaded
699
+ * @param {string} name - The name of the file to be created
700
+ * @param {Buffer|string|Readable} file - The file to upload
701
+ * @param {Object} [options] - Optional parameters for the upload
702
+ * @param {int} [options.parallelism] The number of chunks to upload concurrently
703
+ * @param {int} [options.retryInterval] The amount of time to wait before retrying a failed chunk upload, in ms
704
+ * @param {Object} [options.fileAttributes] Attributes to set on the newly-uploaded file
705
+ * @param {Function} [callback] - Passed the uploader if successful
706
+ * @returns {Promise<ChunkedUploader>} A promise resolving to the chunked uploader
707
+ */
708
+ getChunkedUploader(folderID: string, size: number, name: string, file: Buffer | string | Readable, options?: {
709
+ parallelism?: number;
710
+ retryInterval?: number;
711
+ fileAttributes?: Record<string, any>;
712
+ }, callback?: Function): any;
713
+ /**
714
+ * Upload a new file version in chunks, which is generally faster and more
715
+ * reliable for large files.
716
+ *
717
+ * API Endpoint: '/files/:fileID/upload_sessions'
718
+ * Method: POST
719
+ *
720
+ * @param {string} fileID - The ID of the file to upload a new version of
721
+ * @param {int} size - The size of the file that will be uploaded
722
+ * @param {Buffer|string|Readable} file - The file to upload
723
+ * @param {Object} [options] - Optional parameters for the upload
724
+ * @param {int} [options.parallelism] The number of chunks to upload concurrently
725
+ * @param {int} [options.retryInterval] The amount of time to wait before retrying a failed chunk upload, in ms
726
+ * @param {Object} [options.fileAttributes] Attributes to set on the updated file object
727
+ * @param {Function} [callback] - Passed the uploader if successful
728
+ * @returns {Promise<ChunkedUploader>} A promise resolving to the chunked uploader
729
+ */
730
+ getNewVersionChunkedUploader(fileID: string, size: number, file: Buffer | string | Readable, options?: {
731
+ parallelism?: number;
732
+ retryInterval?: number;
733
+ fileAttributes?: Record<string, any>;
734
+ }, callback?: Function): any;
735
+ /**
736
+ * Requests collaborations on a given file.
737
+ *
738
+ * API Endpoint: '/files/:fileID/collaborations'
739
+ * Method: GET
740
+ *
741
+ * @param {string} fileID - Box ID of the file being requested
742
+ * @param {Object} [options] - Additional options. Can be left null in most cases.
743
+ * @param {int} [options.limit] - The maximum number of collaborations to return
744
+ * @param {int} [options.offset] - Paging parameter for the collaborations collection
745
+ * @param {string} [options.fields] - Comma-separated list of fields to return on the collaboration objects
746
+ * @param {Function} [callback] - Passed the collaborations if successful, error otherwise
747
+ * @returns {Promise<schemas.Collaborations>} A promise resolving to the collection of collaborations on the file
748
+ */
749
+ getCollaborations(fileID: string, options?: {
750
+ limit?: number;
751
+ offset?: number;
752
+ fields?: string;
753
+ }, callback?: Function): Promise<schemas.Collaborations>;
754
+ /**
755
+ * Requests information for all representation objects generated for a specific Box file
756
+ *
757
+ * API Endpoint: '/files/:fileID?fields=representations'
758
+ * Method : GET
759
+ *
760
+ * @param {string} fileID - Box ID of the file being requested
761
+ * @param {client.files.representation} representationType - The x-rep-hints value the application should create a
762
+ * representation for. This value can either come from FileRepresentationType enum or manually created
763
+ * @param {Object} [options] - Additional options. Can be left empty
764
+ * @param {boolean} [options.generateRepresentations = false] - Set to true to return representation info where all states resolve to success.
765
+ * @param {Function} [callback] - Passed an array of representaton objects if successful
766
+ * @returns {Promise<Object>} A promise resolving to the representation response objects
767
+ */
768
+ getRepresentationInfo(fileID: string, representationType: FileRepresentationType | string, options?: {
769
+ generateRepresentations?: boolean;
770
+ } | Function, callback?: Function): any;
771
+ /**
772
+ * Get the contents of a representation of a file, e.g, the binary content of an image or pdf.
773
+ *
774
+ * API Endpoint: '/files/:fileID?fields=representations'
775
+ * Method : GET
776
+ *
777
+ * @param {string} fileID The file ID to get the representation of
778
+ * @param {string} representationType The X-Rep-Hints type to request
779
+ * @param {Object} [options] Optional parameters
780
+ * @param {string} [options.assetPath] Asset path for representations with multiple files
781
+ * @param {Function} [callback] Passed a stream over the representation contents if successful
782
+ * @returns {Promise<Readable>} A promise resolving to a stream over the representation contents
783
+ */
784
+ getRepresentationContent(fileID: string, representationType: FileRepresentationType | string, options?: {
785
+ assetPath?: string;
786
+ }, callback?: Function): any;
787
+ /**
788
+ * Creates a zip of multiple files and folders.
789
+ *
790
+ * API Endpoint: '/zip_downloads'
791
+ * Method: POST
792
+ *
793
+ * @param {name} name - The name of the zip file to be created
794
+ * @param {Array} items - Array of files or folders to be part of the created zip
795
+ * @param {Function} [callback] Passed a zip information object
796
+ * @returns {Promise<string>} A promise resolving to a zip information object
797
+ */
798
+ createZip(name: string, items: any[], callback?: Function): any;
799
+ /**
800
+ * Creates a zip of multiple files and folders and downloads it.
801
+ *
802
+ * API Endpoint: '/zip_downloads'
803
+ * Method: GET
804
+ *
805
+ * @param {name} name - The name of the zip file to be created
806
+ * @param {Array} items - Array of files or folders to be part of the created zip
807
+ * @param {Stream} stream - Stream to pipe the readable stream of the zip file
808
+ * @param {Function} [callback] - Passed a zip download status object
809
+ * @returns {Promise<Readable>} A promise resolving to a zip download status object
810
+ */
811
+ downloadZip(name: string, items: any[], stream: Writable, callback?: Function): any;
812
+ }
813
+ /**
814
+ * @module box-node-sdk/lib/managers/files
815
+ * @see {@Link Files}
816
+ */
817
+ export = Files;