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,252 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Manager for the Box Collaboration Resource
4
+ */
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ const url_path_1 = __importDefault(require("../util/url-path"));
9
+ // ------------------------------------------------------------------------------
10
+ // Private
11
+ // ------------------------------------------------------------------------------
12
+ const BASE_PATH = '/collaborations';
13
+ // ------------------------------------------------------------------------------
14
+ // Public
15
+ // ------------------------------------------------------------------------------
16
+ /**
17
+ * Simple manager for interacting with all 'Collaboration' endpoints and actions.
18
+ *
19
+ * @constructor
20
+ * @param {BoxClient} client - The Box API Client that is responsible for making calls to the API
21
+ * @returns {void}
22
+ */
23
+ class Collaborations {
24
+ constructor(client) {
25
+ this.client = client;
26
+ }
27
+ /**
28
+ * Requests a collaboration object with a given ID.
29
+ *
30
+ * API Endpoint: '/collaborations/:collaborationID'
31
+ * Method: GET
32
+ *
33
+ * @param {string} collaborationID - Box ID of the collaboration being requested
34
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
35
+ * @param {Function} [callback] - Passed the collaboration information if it was acquired successfully
36
+ * @returns {Promise<Collaboration>} A promise resolving to the collaboration object
37
+ */
38
+ get(collaborationID, options, callback) {
39
+ const params = {
40
+ qs: options,
41
+ };
42
+ const apiPath = (0, url_path_1.default)(BASE_PATH, collaborationID);
43
+ return this.client.wrapWithDefaultHandler(this.client.get)(apiPath, params, callback);
44
+ }
45
+ /**
46
+ * Gets a user's pending collaborations
47
+ *
48
+ * API Endpoint: '/collaborations'
49
+ * Method: GET
50
+ *
51
+ * @param {Function} [callback] - Called with a collection of pending collaborations if successful
52
+ * @returns {Promise<Collaborations>} A promise resolving to the collection of pending collaborations
53
+ */
54
+ getPending(callback) {
55
+ const params = {
56
+ qs: {
57
+ status: 'pending',
58
+ },
59
+ };
60
+ return this.client.wrapWithDefaultHandler(this.client.get)(BASE_PATH, params, callback);
61
+ }
62
+ updateInternal(collaborationID, updates, callback) {
63
+ const params = {
64
+ body: updates,
65
+ };
66
+ const apiPath = (0, url_path_1.default)(BASE_PATH, collaborationID);
67
+ return this.client.wrapWithDefaultHandler(this.client.put)(apiPath, params, callback);
68
+ }
69
+ /**
70
+ * Update some information about a given collaboration.
71
+ *
72
+ * API Endpoint: '/collaborations/:collaborationID'
73
+ * Method: PUT
74
+ *
75
+ * @param {string} collaborationID - Box ID of the collaboration being requested
76
+ * @param {CollaborationUpdate} updates - Fields of the collaboration to be updated
77
+ * @param {Function} [callback] - Passed the updated collaboration information if it was acquired successfully
78
+ * @returns {Promise<Collaboration>} A promise resolving to the updated collaboration object
79
+ */
80
+ update(collaborationID, updates, callback) {
81
+ return this.updateInternal(collaborationID, updates, callback);
82
+ }
83
+ /**
84
+ * Update the status of a pending collaboration.
85
+ *
86
+ * API Endpoint: '/collaborations/:collaborationID'
87
+ * Method: PUT
88
+ *
89
+ * @param {string} collaborationID - Box ID of the collaboration being requested
90
+ * @param {CollaborationStatus} newStatus - The new collaboration status ('accepted'/'rejected')
91
+ * @param {Function} [callback] - Passed the updated collaboration information if it was acquired successfully
92
+ * @returns {Promise<Collaboration>} A promise resolving to the accepted collaboration object
93
+ */
94
+ respondToPending(collaborationID, newStatus, callback) {
95
+ return this.updateInternal(collaborationID, {
96
+ status: newStatus,
97
+ }, callback);
98
+ }
99
+ /**
100
+ * Invite a collaborator to a folder. You'll have to create the 'accessible_by' input object
101
+ * yourself, but the method allows for multiple types of collaborator invites. See
102
+ * {@link http://developers.box.com/docs/#collaborations-add-a-collaboration} for formatting
103
+ * help.
104
+ *
105
+ * API Endpoint: '/collaborations
106
+ * Method: POST
107
+ *
108
+ * @param {CollaborationAccesibleBy} accessibleBy - The accessible_by object expected by the API
109
+ * @param {string} itemID - Box ID of the item to which the user should be invited
110
+ * @param {CollaborationRole} role - The role which the invited collaborator should have
111
+ * @param {Object} [options] - Optional parameters for the collaboration
112
+ * @param {ItemType} [options.type=folder] - Type of object to be collaborated
113
+ * @param {boolean} [options.notify] - Determines if the user or group will receive email notifications
114
+ * @param {boolean} [options.can_view_path] - Whether view path collaboration feature is enabled or not
115
+ * @param {boolean} [options.is_access_only] - WARN: Feature not yet available.
116
+ * Do not display collaborated items on collaborator's All Files Pages
117
+ * and suppress notifications sent to collaborators regarding access-only content.
118
+ * This feature is going to be released in Q4. Watch our
119
+ * [announcements](https://developer.box.com/changelog/) to learn about its availability.
120
+ * @param {Function} [callback] - Called with the new collaboration if successful
121
+ * @returns {Promise<Collaboration>} A promise resolving to the created collaboration object
122
+ */
123
+ create(accessibleBy, itemID, role, options, callback) {
124
+ const defaultOptions = {
125
+ type: 'folder',
126
+ };
127
+ if (typeof options === 'function') {
128
+ callback = options;
129
+ options = {};
130
+ }
131
+ options = Object.assign({}, defaultOptions, options);
132
+ const params = {
133
+ body: {
134
+ item: {
135
+ type: options.type,
136
+ id: itemID,
137
+ },
138
+ accessible_by: accessibleBy,
139
+ role,
140
+ },
141
+ };
142
+ if (typeof options.can_view_path === 'boolean') {
143
+ params.body.can_view_path = options.can_view_path;
144
+ }
145
+ if (typeof options.notify === 'boolean') {
146
+ params.qs = {
147
+ notify: options.notify,
148
+ };
149
+ }
150
+ if (typeof options.is_access_only === 'boolean') {
151
+ params.body.is_access_only = options.is_access_only;
152
+ }
153
+ return this.client.wrapWithDefaultHandler(this.client.post)(BASE_PATH, params, callback);
154
+ }
155
+ /**
156
+ * Invite a user to collaborate on an item via their user ID.
157
+ *
158
+ * API Endpoint: '/collaborations
159
+ * Method: POST
160
+ *
161
+ * @param {int | string} userID - The ID of the user you'll invite as a collaborator
162
+ * @param {string} itemID - Box ID of the item to which the user should be invited
163
+ * @param {CollaborationRole} role - The role which the invited collaborator should have
164
+ * @param {Object} [options] - Optional parameters for the collaboration
165
+ * @param {ItemType} [options.type=folder] - Type of object to be collaborated
166
+ * @param {boolean} [options.notify] - Determines if the user will receive email notifications
167
+ * @param {boolean} [options.can_view_path] - Whether view path collaboration feature is enabled or not
168
+ * @param {Function} [callback] - Called with the new collaboration if successful
169
+ * @returns {Promise<Collaboration>} A promise resolving to the created collaboration object
170
+ */
171
+ createWithUserID(userID, itemID, role, options, callback) {
172
+ if (typeof options === 'function') {
173
+ callback = options;
174
+ options = {};
175
+ }
176
+ const accessibleBy = {
177
+ type: 'user',
178
+ id: `${userID}`,
179
+ };
180
+ return this.create(accessibleBy, itemID, role, options, callback);
181
+ }
182
+ /**
183
+ * Invite a user to collaborate on an item via their user login email address.
184
+ *
185
+ * API Endpoint: '/collaborations
186
+ * Method: POST
187
+ *
188
+ * @param {string} email - The collaborator's email address
189
+ * @param {string} itemID - Box ID of the item to which the user should be invited
190
+ * @param {CollaborationRole} role - The role which the invited collaborator should have
191
+ * @param {Object} [options] - Optional parameters for the collaboration
192
+ * @param {ItemType} [options.type=folder] - Type of object to be collaborated
193
+ * @param {boolean} [options.notify] - Determines if the user will receive email notifications
194
+ * @param {boolean} [options.can_view_path] - Whether view path collaboration feature is enabled or not
195
+ * @param {Function} [callback] - Called with the new collaboration if successful
196
+ * @returns {Promise<Collaboration>} A promise resolving to the created collaboration object
197
+ */
198
+ createWithUserEmail(email, itemID, role, options, callback) {
199
+ if (typeof options === 'function') {
200
+ callback = options;
201
+ options = {};
202
+ }
203
+ const accessibleBy = {
204
+ type: 'user',
205
+ login: email,
206
+ };
207
+ return this.create(accessibleBy, itemID, role, options, callback);
208
+ }
209
+ /**
210
+ * Invite a group to collaborate on an item via their group ID.
211
+ *
212
+ * API Endpoint: '/collaborations
213
+ * Method: POST
214
+ *
215
+ * @param {int | string} groupID - The ID of the group you'll invite as a collaborator
216
+ * @param {string} itemID - Box ID of the item to which the group should be invited
217
+ * @param {CollaborationRole} role - The role which the invited collaborator should have
218
+ * @param {Object} [options] - Optional parameters for the collaboration
219
+ * @param {ItemType} [options.type=folder] - Type of object to be collaborated
220
+ * @param {boolean} [options.notify] - Determines if the group will receive email notifications
221
+ * @param {boolean} [options.can_view_path] - Whether view path collaboration feature is enabled or not
222
+ * @param {Function} [callback] - Called with the new collaboration if successful
223
+ * @returns {Promise<Collaboration>} A promise resolving to the created collaboration object
224
+ */
225
+ createWithGroupID(groupID, itemID, role, options, callback) {
226
+ if (typeof options === 'function') {
227
+ callback = options;
228
+ options = {};
229
+ }
230
+ const accessibleBy = {
231
+ type: 'group',
232
+ id: `${groupID}`,
233
+ };
234
+ return this.create(accessibleBy, itemID, role, options, callback);
235
+ }
236
+ /**
237
+ * Delete a given collaboration.
238
+ *
239
+ * API Endpoint: '/collaborations/:collaborationID'
240
+ * Method: DELETE
241
+ *
242
+ * @param {string} collaborationID - Box ID of the collaboration being requested
243
+ * @param {Function} [callback] - Empty response body passed if successful.
244
+ * @returns {Promise<void>} A promise resolving to nothing
245
+ */
246
+ delete(collaborationID, callback) {
247
+ const apiPath = (0, url_path_1.default)(BASE_PATH, collaborationID);
248
+ return this.client.wrapWithDefaultHandler(this.client.del)(apiPath, null, callback);
249
+ }
250
+ }
251
+ module.exports = Collaborations;
252
+ //# sourceMappingURL=collaborations.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collaborations.js","sourceRoot":"","sources":["../../src/managers/collaborations.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAOH,gEAAuC;AAevC,iFAAiF;AACjF,UAAU;AACV,iFAAiF;AACjF,MAAM,SAAS,GAAG,iBAAiB,CAAC;AAEpC,iFAAiF;AACjF,SAAS;AACT,iFAAiF;AAEjF;;;;;;GAMG;AACH,MAAM,cAAc;IAGlB,YAAY,MAAiB;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;OAUG;IACH,GAAG,CACD,eAAuB,EACvB,OAA6B,EAC7B,QAAmB;QAEnB,MAAM,MAAM,GAAG;YACb,EAAE,EAAE,OAAO;SACZ,CAAC;QACF,MAAM,OAAO,GAAG,IAAA,kBAAO,EAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CACxD,OAAO,EACP,MAAM,EACN,QAAQ,CACT,CAAC;IACJ,CAAC;IAED;;;;;;;;OAQG;IACH,UAAU,CAAC,QAAmB;QAC5B,MAAM,MAAM,GAAG;YACb,EAAE,EAAE;gBACF,MAAM,EAAE,SAAS;aAClB;SACF,CAAC;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CACxD,SAAS,EACT,MAAM,EACN,QAAQ,CACT,CAAC;IACJ,CAAC;IAEO,cAAc,CACpB,eAAuB,EACvB,OAA8D,EAC9D,QAAmB;QAEnB,MAAM,MAAM,GAAG;YACb,IAAI,EAAE,OAAO;SACd,CAAC;QAEF,MAAM,OAAO,GAAG,IAAA,kBAAO,EAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC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,iBAAiB,CACf,OAAwB,EACxB,MAAc,EACd,IAAuB,EACvB,OAMY,EACZ,QAAmB;QAEnB,IAAI,OAAO,OAAO,KAAK,UAAU,EAAE,CAAC;YAClC,QAAQ,GAAG,OAAO,CAAC;YACnB,OAAO,GAAG,EAAE,CAAC;QACf,CAAC;QAED,MAAM,YAAY,GAA6B;YAC7C,IAAI,EAAE,OAAO;YACb,EAAE,EAAE,GAAG,OAAO,EAAE;SACjB,CAAC;QACF,OAAO,IAAI,CAAC,MAAM,CAAC,YAAY,EAAE,MAAM,EAAE,IAAI,EAAE,OAAO,EAAE,QAAQ,CAAC,CAAC;IACpE,CAAC;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,eAAuB,EAAE,QAAmB;QACjD,MAAM,OAAO,GAAG,IAAA,kBAAO,EAAC,SAAS,EAAE,eAAe,CAAC,CAAC;QACpD,OAAO,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CACxD,OAAO,EACP,IAAI,EACJ,QAAQ,CACT,CAAC;IACJ,CAAC;CACF;AAMD,iBAAS,cAAc,CAAC"}
@@ -0,0 +1,42 @@
1
+ /**
2
+ * @fileoverview Manager for the Box Collection Resource
3
+ */
4
+ import BoxClient from '../box-client';
5
+ /**
6
+ * Simple manager for interacting with all 'Collection' endpoints and actions.
7
+ *
8
+ * @constructor
9
+ * @param {BoxClient} client - The Box API Client that is responsible for making calls to the API
10
+ * @returns {void}
11
+ */
12
+ declare class Collections {
13
+ client: BoxClient;
14
+ constructor(client: BoxClient);
15
+ /**
16
+ * Requests all of a user's collection objects.
17
+ *
18
+ * API Endpoint: '/collections'
19
+ * Method: GET
20
+ *
21
+ * @param {Function} [callback] - Called with a collection of collections if successful
22
+ * @returns {Promise<Object>} A promise resolving to the collection of collections
23
+ */
24
+ getAll(callback?: Function): any;
25
+ /**
26
+ * Requests the items in the collection object with a given ID.
27
+ *
28
+ * API Endpoint: '/collections/:collectionID/items'
29
+ * Method: GET
30
+ *
31
+ * @param {string} collectionID - Box ID of the collection with items being requested
32
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
33
+ * @param {Function} [callback] - Passed the items information if they were acquired successfully
34
+ * @returns {Promise<Object>} A promise resolving to the collection of items in the collection
35
+ */
36
+ getItems(collectionID: string, options?: Record<string, any>, callback?: Function): any;
37
+ }
38
+ /**
39
+ * @module box-node-sdk/lib/managers/collections
40
+ * @see {@Link Collections}
41
+ */
42
+ export = Collections;
@@ -0,0 +1,62 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Manager for the Box Collection Resource
4
+ */
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ const url_path_1 = __importDefault(require("../util/url-path"));
9
+ // -----------------------------------------------------------------------------
10
+ // Typedefs
11
+ // -----------------------------------------------------------------------------
12
+ // ------------------------------------------------------------------------------
13
+ // Private
14
+ // ------------------------------------------------------------------------------
15
+ const BASE_PATH = '/collections';
16
+ // ------------------------------------------------------------------------------
17
+ // Public
18
+ // ------------------------------------------------------------------------------
19
+ /**
20
+ * Simple manager for interacting with all 'Collection' endpoints and actions.
21
+ *
22
+ * @constructor
23
+ * @param {BoxClient} client - The Box API Client that is responsible for making calls to the API
24
+ * @returns {void}
25
+ */
26
+ class Collections {
27
+ constructor(client) {
28
+ this.client = client;
29
+ }
30
+ /**
31
+ * Requests all of a user's collection objects.
32
+ *
33
+ * API Endpoint: '/collections'
34
+ * Method: GET
35
+ *
36
+ * @param {Function} [callback] - Called with a collection of collections if successful
37
+ * @returns {Promise<Object>} A promise resolving to the collection of collections
38
+ */
39
+ getAll(callback) {
40
+ return this.client.wrapWithDefaultHandler(this.client.get)(BASE_PATH, {}, callback);
41
+ }
42
+ /**
43
+ * Requests the items in the collection object with a given ID.
44
+ *
45
+ * API Endpoint: '/collections/:collectionID/items'
46
+ * Method: GET
47
+ *
48
+ * @param {string} collectionID - Box ID of the collection with items being requested
49
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
50
+ * @param {Function} [callback] - Passed the items information if they were acquired successfully
51
+ * @returns {Promise<Object>} A promise resolving to the collection of items in the collection
52
+ */
53
+ getItems(collectionID, options, callback) {
54
+ var params = {
55
+ qs: options,
56
+ };
57
+ var apiPath = (0, url_path_1.default)(BASE_PATH, collectionID, 'items');
58
+ return this.client.wrapWithDefaultHandler(this.client.get)(apiPath, params, callback);
59
+ }
60
+ }
61
+ module.exports = Collections;
62
+ //# sourceMappingURL=collections.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"collections.js","sourceRoot":"","sources":["../../src/managers/collections.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAOH,gEAAuC;AAEvC,gFAAgF;AAChF,WAAW;AACX,gFAAgF;AAEhF,iFAAiF;AACjF,UAAU;AACV,iFAAiF;AAEjF,MAAM,SAAS,GAAG,cAAc,CAAC;AAEjC,iFAAiF;AACjF,SAAS;AACT,iFAAiF;AAEjF;;;;;;GAMG;AACH,MAAM,WAAW;IAGf,YAAY,MAAiB;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,QAAmB;QACxB,OAAO,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CACxD,SAAS,EACT,EAAE,EACF,QAAQ,CACT,CAAC;IACJ,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CACN,YAAoB,EACpB,OAA6B,EAC7B,QAAmB;QAEnB,IAAI,MAAM,GAAG;YACX,EAAE,EAAE,OAAO;SACZ,CAAC;QACF,IAAI,OAAO,GAAG,IAAA,kBAAO,EAAC,SAAS,EAAE,YAAY,EAAE,OAAO,CAAC,CAAC;QACxD,OAAO,IAAI,CAAC,MAAM,CAAC,sBAAsB,CAAC,IAAI,CAAC,MAAM,CAAC,GAAG,CAAC,CACxD,OAAO,EACP,MAAM,EACN,QAAQ,CACT,CAAC;IACJ,CAAC;CACF;AAMD,iBAAS,WAAW,CAAC"}
@@ -0,0 +1,103 @@
1
+ /**
2
+ * @fileoverview Manager for the Box Comments Resource
3
+ */
4
+ import BoxClient from '../box-client';
5
+ /**
6
+ * Simple manager for interacting with all 'Comment' endpoints and actions.
7
+ *
8
+ * @constructor
9
+ * @param {BoxClient} client - The Box API Client that is responsible for making calls to the API
10
+ * @returns {void}
11
+ */
12
+ declare class Comments {
13
+ client: BoxClient;
14
+ constructor(client: BoxClient);
15
+ /**
16
+ * Requests a comment object with the given ID.
17
+ *
18
+ * API Endpoint: '/comments/:commentID'
19
+ * Method: GET
20
+ *
21
+ * @param {string} commentID - Box ID of the comment being requested
22
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
23
+ * @param {Function} [callback] - Passed the comment information if it was acquired successfully
24
+ * @returns {Promise<Object>} A promise resolving to the comment object
25
+ */
26
+ get(commentID: string, options?: Record<string, any>, callback?: Function): any;
27
+ /**
28
+ * Posts a new comment on a file.
29
+ *
30
+ * API Endpoint: '/comments
31
+ * Method: POST
32
+ *
33
+ * @param {string} fileID - Box file id of the file to comment on
34
+ * @param {string} commentBody - text of the comment
35
+ * @param {Function} [callback] - passed the new comment data if it was posted successfully
36
+ * @returns {Promise<Object>} A promise resolving to the new comment object
37
+ */
38
+ create(fileID: string, commentBody: string, callback?: Function): any;
39
+ /**
40
+ * Posts a new tagged comment on a file.
41
+ *
42
+ * API Endpoint: '/comments
43
+ * Method: POST
44
+ *
45
+ * @param {string} fileID - Box file id of the file to comment on
46
+ * @param {string} commentBody - text of the tagged comment
47
+ * @param {Function} [callback] - passed the new tagged comment data if it was posted successfully
48
+ * @returns {Promise<Object>} A promise resolving to the new comment object
49
+ */
50
+ createTaggedComment(fileID: string, commentBody: string, callback?: Function): any;
51
+ /**
52
+ * Posts a new comment as a reply to another comment.
53
+ *
54
+ * API Endpoint: '/comments
55
+ * Method: POST
56
+ *
57
+ * @param {string} commentID - Comment ID of the comment to reply to
58
+ * @param {string} commentBody - text of the comment
59
+ * @param {Function} [callback] - passed the new comment data if it was posted successfully
60
+ * @returns {Promise<Object>} A promise resolving to the new comment object
61
+ */
62
+ reply(commentID: string, commentBody: string, callback?: Function): any;
63
+ /**
64
+ * Posts a new tagged comment as a reply to another comment.
65
+ *
66
+ * API Endpoint: '/comments
67
+ * Method: POST
68
+ *
69
+ * @param {string} commentID - Comment ID of the comment to reply to
70
+ * @param {string} commentBody - text of the tagged comment
71
+ * @param {Function} [callback] - passed the new tagged comment data if it was posted successfully
72
+ * @returns {Promise<Object>} A promise resolving to the new comment object
73
+ */
74
+ createTaggedReply(commentID: string, commentBody: string, callback?: Function): any;
75
+ /**
76
+ * Update some information about a given comment.
77
+ *
78
+ * API Endpoint: '/comments/:commentID'
79
+ * Method: PUT
80
+ *
81
+ * @param {string} commentID - Box ID of the comment being requested
82
+ * @param {Object} updates - Fields to update on the comment
83
+ * @param {Function} [callback] - Passed the updated comment information if it was acquired successfully
84
+ * @returns {Promise<Object>} A promise resolving to the updated comment object
85
+ */
86
+ update(commentID: string, updates: Record<string, any>, callback?: Function): any;
87
+ /**
88
+ * Delete a given comment.
89
+ *
90
+ * API Endpoint: '/comments/:commentID'
91
+ * Method: DELETE
92
+ *
93
+ * @param {string} commentID - Box ID of the comment being requested
94
+ * @param {Function} [callback] - Empty response body passed if successful.
95
+ * @returns {Promise<void>} A promise resolving to nothing
96
+ */
97
+ delete(commentID: string, callback?: Function): any;
98
+ }
99
+ /**
100
+ * @module box-node-sdk/lib/managers/comments
101
+ * @see {@Link Comments}
102
+ */
103
+ export = Comments;
@@ -0,0 +1,175 @@
1
+ "use strict";
2
+ /**
3
+ * @fileoverview Manager for the Box Comments Resource
4
+ */
5
+ var __importDefault = (this && this.__importDefault) || function (mod) {
6
+ return (mod && mod.__esModule) ? mod : { "default": mod };
7
+ };
8
+ const url_path_1 = __importDefault(require("../util/url-path"));
9
+ // -----------------------------------------------------------------------------
10
+ // Typedefs
11
+ // -----------------------------------------------------------------------------
12
+ // ------------------------------------------------------------------------------
13
+ // Private
14
+ // ------------------------------------------------------------------------------
15
+ const BASE_PATH = '/comments';
16
+ // ------------------------------------------------------------------------------
17
+ // Public
18
+ // ------------------------------------------------------------------------------
19
+ /**
20
+ * Simple manager for interacting with all 'Comment' endpoints and actions.
21
+ *
22
+ * @constructor
23
+ * @param {BoxClient} client - The Box API Client that is responsible for making calls to the API
24
+ * @returns {void}
25
+ */
26
+ class Comments {
27
+ constructor(client) {
28
+ this.client = client;
29
+ }
30
+ /**
31
+ * Requests a comment object with the given ID.
32
+ *
33
+ * API Endpoint: '/comments/:commentID'
34
+ * Method: GET
35
+ *
36
+ * @param {string} commentID - Box ID of the comment being requested
37
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
38
+ * @param {Function} [callback] - Passed the comment information if it was acquired successfully
39
+ * @returns {Promise<Object>} A promise resolving to the comment object
40
+ */
41
+ get(commentID, options, callback) {
42
+ var params = {
43
+ qs: options,
44
+ };
45
+ var apiPath = (0, url_path_1.default)(BASE_PATH, commentID);
46
+ return this.client.wrapWithDefaultHandler(this.client.get)(apiPath, params, callback);
47
+ }
48
+ /**
49
+ * Posts a new comment on a file.
50
+ *
51
+ * API Endpoint: '/comments
52
+ * Method: POST
53
+ *
54
+ * @param {string} fileID - Box file id of the file to comment on
55
+ * @param {string} commentBody - text of the comment
56
+ * @param {Function} [callback] - passed the new comment data if it was posted successfully
57
+ * @returns {Promise<Object>} A promise resolving to the new comment object
58
+ */
59
+ create(fileID, commentBody, callback) {
60
+ // @TODO(bemerick) 2013-10-29: Don't hardcode this 'item'. Abstract to all commentable types...
61
+ var params = {
62
+ body: {
63
+ item: {
64
+ type: 'file',
65
+ id: fileID,
66
+ },
67
+ message: commentBody,
68
+ },
69
+ };
70
+ return this.client.wrapWithDefaultHandler(this.client.post)(BASE_PATH, params, callback);
71
+ }
72
+ /**
73
+ * Posts a new tagged comment on a file.
74
+ *
75
+ * API Endpoint: '/comments
76
+ * Method: POST
77
+ *
78
+ * @param {string} fileID - Box file id of the file to comment on
79
+ * @param {string} commentBody - text of the tagged comment
80
+ * @param {Function} [callback] - passed the new tagged comment data if it was posted successfully
81
+ * @returns {Promise<Object>} A promise resolving to the new comment object
82
+ */
83
+ createTaggedComment(fileID, commentBody, callback) {
84
+ var params = {
85
+ body: {
86
+ item: {
87
+ type: 'file',
88
+ id: fileID,
89
+ },
90
+ tagged_message: commentBody,
91
+ },
92
+ };
93
+ return this.client.wrapWithDefaultHandler(this.client.post)(BASE_PATH, params, callback);
94
+ }
95
+ /**
96
+ * Posts a new comment as a reply to another comment.
97
+ *
98
+ * API Endpoint: '/comments
99
+ * Method: POST
100
+ *
101
+ * @param {string} commentID - Comment ID of the comment to reply to
102
+ * @param {string} commentBody - text of the comment
103
+ * @param {Function} [callback] - passed the new comment data if it was posted successfully
104
+ * @returns {Promise<Object>} A promise resolving to the new comment object
105
+ */
106
+ reply(commentID, commentBody, callback) {
107
+ var params = {
108
+ body: {
109
+ item: {
110
+ type: 'comment',
111
+ id: commentID,
112
+ },
113
+ message: commentBody,
114
+ },
115
+ };
116
+ return this.client.wrapWithDefaultHandler(this.client.post)(BASE_PATH, params, callback);
117
+ }
118
+ /**
119
+ * Posts a new tagged comment as a reply to another comment.
120
+ *
121
+ * API Endpoint: '/comments
122
+ * Method: POST
123
+ *
124
+ * @param {string} commentID - Comment ID of the comment to reply to
125
+ * @param {string} commentBody - text of the tagged comment
126
+ * @param {Function} [callback] - passed the new tagged comment data if it was posted successfully
127
+ * @returns {Promise<Object>} A promise resolving to the new comment object
128
+ */
129
+ createTaggedReply(commentID, commentBody, callback) {
130
+ var params = {
131
+ body: {
132
+ item: {
133
+ type: 'comment',
134
+ id: commentID,
135
+ },
136
+ tagged_message: commentBody,
137
+ },
138
+ };
139
+ return this.client.wrapWithDefaultHandler(this.client.post)(BASE_PATH, params, callback);
140
+ }
141
+ /**
142
+ * Update some information about a given comment.
143
+ *
144
+ * API Endpoint: '/comments/:commentID'
145
+ * Method: PUT
146
+ *
147
+ * @param {string} commentID - Box ID of the comment being requested
148
+ * @param {Object} updates - Fields to update on the comment
149
+ * @param {Function} [callback] - Passed the updated comment information if it was acquired successfully
150
+ * @returns {Promise<Object>} A promise resolving to the updated comment object
151
+ */
152
+ update(commentID, updates, callback) {
153
+ var params = {
154
+ body: updates,
155
+ };
156
+ var apiPath = (0, url_path_1.default)(BASE_PATH, commentID);
157
+ return this.client.wrapWithDefaultHandler(this.client.put)(apiPath, params, callback);
158
+ }
159
+ /**
160
+ * Delete a given comment.
161
+ *
162
+ * API Endpoint: '/comments/:commentID'
163
+ * Method: DELETE
164
+ *
165
+ * @param {string} commentID - Box ID of the comment being requested
166
+ * @param {Function} [callback] - Empty response body passed if successful.
167
+ * @returns {Promise<void>} A promise resolving to nothing
168
+ */
169
+ delete(commentID, callback) {
170
+ var apiPath = (0, url_path_1.default)(BASE_PATH, commentID);
171
+ return this.client.wrapWithDefaultHandler(this.client.del)(apiPath, null, callback);
172
+ }
173
+ }
174
+ module.exports = Comments;
175
+ //# sourceMappingURL=comments.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"comments.js","sourceRoot":"","sources":["../../src/managers/comments.ts"],"names":[],"mappings":";AAAA;;GAEG;;;;AAOH,gEAAuC;AAEvC,gFAAgF;AAChF,WAAW;AACX,gFAAgF;AAEhF,iFAAiF;AACjF,UAAU;AACV,iFAAiF;AAEjF,MAAM,SAAS,GAAG,WAAW,CAAC;AAE9B,iFAAiF;AACjF,SAAS;AACT,iFAAiF;AAEjF;;;;;;GAMG;AACH,MAAM,QAAQ;IAGZ,YAAY,MAAiB;QAC3B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;;;;;;;;;OAUG;IACH,GAAG,CAAC,SAAiB,EAAE,OAA6B,EAAE,QAAmB;QACvE,IAAI,MAAM,GAAG;YACX,EAAE,EAAE,OAAO;SACZ,CAAC;QACF,I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