box-node-sdk 1.35.0 → 1.37.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 (126) hide show
  1. package/CHANGELOG.md +37 -2
  2. package/README.md +1 -1
  3. package/lib/api-request-manager.d.ts +38 -0
  4. package/lib/api-request-manager.js +48 -55
  5. package/lib/api-request-manager.js.map +1 -0
  6. package/lib/api-request.d.ts +141 -0
  7. package/lib/api-request.js +202 -281
  8. package/lib/api-request.js.map +1 -0
  9. package/lib/box-client.d.ts +269 -0
  10. package/lib/box-client.js +551 -713
  11. package/lib/box-client.js.map +1 -0
  12. package/lib/box-node-sdk.d.ts +216 -0
  13. package/lib/box-node-sdk.js +317 -352
  14. package/lib/box-node-sdk.js.map +1 -0
  15. package/lib/chunked-uploader.d.ts +129 -0
  16. package/lib/chunked-uploader.js +287 -358
  17. package/lib/chunked-uploader.js.map +1 -0
  18. package/lib/enterprise-event-stream.d.ts +82 -0
  19. package/lib/enterprise-event-stream.js +189 -203
  20. package/lib/enterprise-event-stream.js.map +1 -0
  21. package/lib/event-stream.d.ts +92 -0
  22. package/lib/event-stream.js +274 -302
  23. package/lib/event-stream.js.map +1 -0
  24. package/lib/managers/collaboration-allowlist.d.ts +137 -0
  25. package/lib/managers/collaboration-allowlist.js +200 -0
  26. package/lib/managers/collaboration-allowlist.js.map +1 -0
  27. package/lib/managers/collaboration-whitelist.d.ts +3 -0
  28. package/lib/managers/collaboration-whitelist.js +8 -222
  29. package/lib/managers/collaboration-whitelist.js.map +1 -0
  30. package/lib/managers/collaborations.d.ts +166 -0
  31. package/lib/managers/collaborations.js +225 -258
  32. package/lib/managers/collaborations.js.map +1 -0
  33. package/lib/managers/collections.d.ts +42 -0
  34. package/lib/managers/collections.js +45 -50
  35. package/lib/managers/collections.js.map +1 -0
  36. package/lib/managers/comments.d.ts +103 -0
  37. package/lib/managers/comments.js +158 -173
  38. package/lib/managers/comments.js.map +1 -0
  39. package/lib/managers/device-pins.d.ts +52 -0
  40. package/lib/managers/device-pins.js +75 -88
  41. package/lib/managers/device-pins.js.map +1 -0
  42. package/lib/managers/enterprise.d.ts +162 -0
  43. package/lib/managers/enterprise.js +168 -199
  44. package/lib/managers/enterprise.js.map +1 -0
  45. package/lib/managers/events.d.ts +177 -0
  46. package/lib/managers/events.js +230 -254
  47. package/lib/managers/events.js.map +1 -0
  48. package/lib/managers/files.d.ts +772 -0
  49. package/lib/managers/files.js +1400 -1602
  50. package/lib/managers/files.js.map +1 -0
  51. package/lib/managers/folders.d.ts +347 -0
  52. package/lib/managers/folders.js +551 -567
  53. package/lib/managers/folders.js.map +1 -0
  54. package/lib/managers/groups.d.ts +202 -0
  55. package/lib/managers/groups.js +238 -287
  56. package/lib/managers/groups.js.map +1 -0
  57. package/lib/managers/legal-hold-policies.d.ts +190 -0
  58. package/lib/managers/legal-hold-policies.js +228 -272
  59. package/lib/managers/legal-hold-policies.js.map +1 -0
  60. package/lib/managers/metadata.d.ts +228 -0
  61. package/lib/managers/metadata.js +265 -328
  62. package/lib/managers/metadata.js.map +1 -0
  63. package/lib/managers/recent-items.d.ts +38 -0
  64. package/lib/managers/recent-items.js +32 -39
  65. package/lib/managers/recent-items.js.map +1 -0
  66. package/lib/managers/retention-policies.d.ts +213 -0
  67. package/lib/managers/retention-policies.js +235 -281
  68. package/lib/managers/retention-policies.js.map +1 -0
  69. package/lib/managers/search.d.ts +82 -0
  70. package/lib/managers/search.js +68 -88
  71. package/lib/managers/search.js.map +1 -0
  72. package/lib/managers/shared-items.d.ts +33 -0
  73. package/lib/managers/shared-items.js +54 -62
  74. package/lib/managers/shared-items.js.map +1 -0
  75. package/lib/managers/storage-policies.d.ts +86 -0
  76. package/lib/managers/storage-policies.js +108 -142
  77. package/lib/managers/storage-policies.js.map +1 -0
  78. package/lib/managers/tasks.d.ts +161 -0
  79. package/lib/managers/tasks.js +219 -260
  80. package/lib/managers/tasks.js.map +1 -0
  81. package/lib/managers/terms-of-service.d.ts +161 -0
  82. package/lib/managers/terms-of-service.js +250 -273
  83. package/lib/managers/terms-of-service.js.map +1 -0
  84. package/lib/managers/trash.d.ts +30 -0
  85. package/lib/managers/trash.js +30 -41
  86. package/lib/managers/trash.js.map +1 -0
  87. package/lib/managers/users.d.ts +131 -0
  88. package/lib/managers/users.js +160 -203
  89. package/lib/managers/users.js.map +1 -0
  90. package/lib/managers/web-links.d.ts +127 -0
  91. package/lib/managers/web-links.js +183 -209
  92. package/lib/managers/web-links.js.map +1 -0
  93. package/lib/managers/webhooks.d.ts +166 -0
  94. package/lib/managers/webhooks.js +312 -305
  95. package/lib/managers/webhooks.js.map +1 -0
  96. package/lib/sessions/anonymous-session.d.ts +69 -0
  97. package/lib/sessions/anonymous-session.js +88 -102
  98. package/lib/sessions/anonymous-session.js.map +1 -0
  99. package/lib/sessions/app-auth-session.d.ts +92 -0
  100. package/lib/sessions/app-auth-session.js +140 -160
  101. package/lib/sessions/app-auth-session.js.map +1 -0
  102. package/lib/sessions/basic-session.d.ts +56 -0
  103. package/lib/sessions/basic-session.js +40 -50
  104. package/lib/sessions/basic-session.js.map +1 -0
  105. package/lib/sessions/persistent-session.d.ts +96 -0
  106. package/lib/sessions/persistent-session.js +191 -211
  107. package/lib/sessions/persistent-session.js.map +1 -0
  108. package/lib/token-manager.d.ts +191 -0
  109. package/lib/token-manager.js +390 -465
  110. package/lib/token-manager.js.map +1 -0
  111. package/lib/util/config.d.ts +86 -0
  112. package/lib/util/config.js +124 -152
  113. package/lib/util/config.js.map +1 -0
  114. package/lib/util/errors.d.ts +50 -0
  115. package/lib/util/errors.js +134 -145
  116. package/lib/util/errors.js.map +1 -0
  117. package/lib/util/exponential-backoff.d.ts +11 -0
  118. package/lib/util/exponential-backoff.js +10 -22
  119. package/lib/util/exponential-backoff.js.map +1 -0
  120. package/lib/util/paging-iterator.d.ts +53 -0
  121. package/lib/util/paging-iterator.js +202 -218
  122. package/lib/util/paging-iterator.js.map +1 -0
  123. package/lib/util/url-path.d.ts +16 -0
  124. package/lib/util/url-path.js +20 -35
  125. package/lib/util/url-path.js.map +1 -0
  126. package/package.json +24 -9
@@ -0,0 +1,166 @@
1
+ /**
2
+ * @fileoverview Manager for the Box Collaboration Resource
3
+ */
4
+ import BoxClient from '../box-client';
5
+ declare type CollaborationRole = any;
6
+ declare type ItemType = 'folder' | string;
7
+ /**
8
+ * Simple manager for interacting with all 'Collaboration' endpoints and actions.
9
+ *
10
+ * @constructor
11
+ * @param {BoxClient} client - The Box API Client that is responsible for making calls to the API
12
+ * @returns {void}
13
+ */
14
+ declare class Collaborations {
15
+ client: BoxClient;
16
+ constructor(client: BoxClient);
17
+ /**
18
+ * Requests a collaboration object with a given ID.
19
+ *
20
+ * API Endpoint: '/collaborations/:collaborationID'
21
+ * Method: GET
22
+ *
23
+ * @param {string} collaborationID - Box ID of the collaboration being requested
24
+ * @param {Object} [options] - Additional options for the request. Can be left null in most cases.
25
+ * @param {Function} [callback] - Passed the collaboration information if it was acquired successfully
26
+ * @returns {Promise<Object>} A promise resolving to the collaboration object
27
+ */
28
+ get(collaborationID: string, options?: Record<string, any>, callback?: Function): any;
29
+ /**
30
+ * Gets a user's pending collaborations
31
+ *
32
+ * API Endpoint: '/collaborations'
33
+ * Method: GET
34
+ *
35
+ * @param {Function} [callback] - Called with a collection of pending collaborations if successful
36
+ * @returns {Promise<Object>} A promise resolving to the collection of pending collaborations
37
+ */
38
+ getPending(callback?: Function): any;
39
+ /**
40
+ * Update some information about a given collaboration.
41
+ *
42
+ * API Endpoint: '/collaborations/:collaborationID'
43
+ * Method: PUT
44
+ *
45
+ * @param {string} collaborationID - Box ID of the collaboration being requested
46
+ * @param {Object} updates - Fields of the collaboration to be updated
47
+ * @param {Function} [callback] - Passed the updated collaboration information if it was acquired successfully
48
+ * @returns {Promise<Object>} A promise resolving to the updated collaboration object
49
+ */
50
+ update(collaborationID: string, updates: Record<string, any>, callback?: Function): any;
51
+ /**
52
+ * Update the status of a pending collaboration.
53
+ *
54
+ * API Endpoint: '/collaborations/:collaborationID'
55
+ * Method: PUT
56
+ *
57
+ * @param {string} collaborationID - Box ID of the collaboration being requested
58
+ * @param {string} newStatus - The new collaboration status ('accepted'/'rejected')
59
+ * @param {Function} [callback] - Passed the updated collaboration information if it was acquired successfully
60
+ * @returns {Promise<Object>} A promise resolving to the accepted collaboration object
61
+ */
62
+ respondToPending(collaborationID: string, newStatus: string, callback?: Function): any;
63
+ /**
64
+ * Invite a collaborator to a folder. You'll have to create the 'accessible_by' input object
65
+ * yourself, but the method allows for multiple types of collaborator invites. See
66
+ * {@link http://developers.box.com/docs/#collaborations-add-a-collaboration} for formatting
67
+ * help.
68
+ *
69
+ * API Endpoint: '/collaborations
70
+ * Method: POST
71
+ *
72
+ * @param {Object} accessibleBy - The accessible_by object expected by the API
73
+ * @param {string} itemID - Box ID of the item to which the user should be invited
74
+ * @param {CollaborationRole} role - The role which the invited collaborator should have
75
+ * @param {Object} [options] - Optional parameters for the collaboration
76
+ * @param {ItemType} [options.type=folder] - Type of object to be collaborated
77
+ * @param {boolean} [options.notify] - Determines if the user or group will receive email notifications
78
+ * @param {boolean} [options.can_view_path] - Whether view path collaboration feature is enabled or not
79
+ * @param {Function} [callback] - Called with the new collaboration if successful
80
+ * @returns {Promise<Object>} A promise resolving to the created collaboration object
81
+ */
82
+ create(accessibleBy: Record<string, any>, itemID: string, role: CollaborationRole, options?: {
83
+ type?: ItemType;
84
+ notify?: boolean;
85
+ can_view_path?: boolean;
86
+ } | Function, callback?: Function): any;
87
+ /**
88
+ * Invite a user to collaborate on an item via their user ID.
89
+ *
90
+ * API Endpoint: '/collaborations
91
+ * Method: POST
92
+ *
93
+ * @param {int} userID - The ID of the user you'll invite as a collaborator
94
+ * @param {string} itemID - Box ID of the item to which the user should be invited
95
+ * @param {CollaborationRole} role - The role which the invited collaborator should have
96
+ * @param {Object} [options] - Optional parameters for the collaboration
97
+ * @param {ItemType} [options.type=folder] - Type of object to be collaborated
98
+ * @param {boolean} [options.notify] - Determines if the user will receive email notifications
99
+ * @param {boolean} [options.can_view_path] - Whether view path collaboration feature is enabled or not
100
+ * @param {Function} [callback] - Called with the new collaboration if successful
101
+ * @returns {Promise<Object>} A promise resolving to the created collaboration object
102
+ */
103
+ createWithUserID(userID: number, itemID: string, role: CollaborationRole, options?: {
104
+ type?: ItemType;
105
+ notify?: boolean;
106
+ can_view_path?: boolean;
107
+ } | Function, callback?: Function): any;
108
+ /**
109
+ * Invite a user to collaborate on an item via their user login email address.
110
+ *
111
+ * API Endpoint: '/collaborations
112
+ * Method: POST
113
+ *
114
+ * @param {string} email - The collaborator's email address
115
+ * @param {string} itemID - Box ID of the item to which the user should be invited
116
+ * @param {CollaborationRole} role - The role which the invited collaborator should have
117
+ * @param {Object} [options] - Optional parameters for the collaboration
118
+ * @param {ItemType} [options.type=folder] - Type of object to be collaborated
119
+ * @param {boolean} [options.notify] - Determines if the user will receive email notifications
120
+ * @param {boolean} [options.can_view_path] - Whether view path collaboration feature is enabled or not
121
+ * @param {Function} [callback] - Called with the new collaboration if successful
122
+ * @returns {Promise<Object>} A promise resolving to the created collaboration object
123
+ */
124
+ createWithUserEmail(email: string, itemID: string, role: CollaborationRole, options?: {
125
+ type?: ItemType;
126
+ notify?: boolean;
127
+ can_view_path?: boolean;
128
+ } | Function, callback?: Function): any;
129
+ /**
130
+ * Invite a group to collaborate on an item via their group ID.
131
+ *
132
+ * API Endpoint: '/collaborations
133
+ * Method: POST
134
+ *
135
+ * @param {int} groupID - The ID of the group you'll invite as a collaborator
136
+ * @param {string} itemID - Box ID of the item to which the group should be invited
137
+ * @param {CollaborationRole} role - The role which the invited collaborator should have
138
+ * @param {Object} [options] - Optional parameters for the collaboration
139
+ * @param {ItemType} [options.type=folder] - Type of object to be collaborated
140
+ * @param {boolean} [options.notify] - Determines if the group will receive email notifications
141
+ * @param {boolean} [options.can_view_path] - Whether view path collaboration feature is enabled or not
142
+ * @param {Function} [callback] - Called with the new collaboration if successful
143
+ * @returns {Promise<Object>} A promise resolving to the created collaboration object
144
+ */
145
+ createWithGroupID(groupID: number, itemID: string, role: CollaborationRole, options?: {
146
+ type?: ItemType;
147
+ notify?: boolean;
148
+ can_view_path?: boolean;
149
+ } | Function, callback?: Function): any;
150
+ /**
151
+ * Delete a given collaboration.
152
+ *
153
+ * API Endpoint: '/collaborations/:collaborationID'
154
+ * Method: DELETE
155
+ *
156
+ * @param {string} collaborationID - Box ID of the collaboration being requested
157
+ * @param {Function} [callback] - Empty response body passed if successful.
158
+ * @returns {Promise<void>} A promise resolving to nothing
159
+ */
160
+ delete(collaborationID: string, callback?: Function): any;
161
+ }
162
+ /**
163
+ * @module box-node-sdk/lib/managers/collaborations
164
+ * @see {@Link Collaborations}
165
+ */
166
+ export = Collaborations;