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.
- package/CHANGELOG.md +37 -2
- package/README.md +1 -1
- package/lib/api-request-manager.d.ts +38 -0
- package/lib/api-request-manager.js +48 -55
- package/lib/api-request-manager.js.map +1 -0
- package/lib/api-request.d.ts +141 -0
- package/lib/api-request.js +202 -281
- package/lib/api-request.js.map +1 -0
- package/lib/box-client.d.ts +269 -0
- package/lib/box-client.js +551 -713
- package/lib/box-client.js.map +1 -0
- package/lib/box-node-sdk.d.ts +216 -0
- package/lib/box-node-sdk.js +317 -352
- package/lib/box-node-sdk.js.map +1 -0
- package/lib/chunked-uploader.d.ts +129 -0
- package/lib/chunked-uploader.js +287 -358
- package/lib/chunked-uploader.js.map +1 -0
- package/lib/enterprise-event-stream.d.ts +82 -0
- package/lib/enterprise-event-stream.js +189 -203
- package/lib/enterprise-event-stream.js.map +1 -0
- package/lib/event-stream.d.ts +92 -0
- package/lib/event-stream.js +274 -302
- package/lib/event-stream.js.map +1 -0
- package/lib/managers/collaboration-allowlist.d.ts +137 -0
- package/lib/managers/collaboration-allowlist.js +200 -0
- package/lib/managers/collaboration-allowlist.js.map +1 -0
- package/lib/managers/collaboration-whitelist.d.ts +3 -0
- package/lib/managers/collaboration-whitelist.js +8 -222
- package/lib/managers/collaboration-whitelist.js.map +1 -0
- package/lib/managers/collaborations.d.ts +166 -0
- package/lib/managers/collaborations.js +225 -258
- package/lib/managers/collaborations.js.map +1 -0
- package/lib/managers/collections.d.ts +42 -0
- package/lib/managers/collections.js +45 -50
- package/lib/managers/collections.js.map +1 -0
- package/lib/managers/comments.d.ts +103 -0
- package/lib/managers/comments.js +158 -173
- package/lib/managers/comments.js.map +1 -0
- package/lib/managers/device-pins.d.ts +52 -0
- package/lib/managers/device-pins.js +75 -88
- package/lib/managers/device-pins.js.map +1 -0
- package/lib/managers/enterprise.d.ts +162 -0
- package/lib/managers/enterprise.js +168 -199
- package/lib/managers/enterprise.js.map +1 -0
- package/lib/managers/events.d.ts +177 -0
- package/lib/managers/events.js +230 -254
- package/lib/managers/events.js.map +1 -0
- package/lib/managers/files.d.ts +772 -0
- package/lib/managers/files.js +1400 -1602
- package/lib/managers/files.js.map +1 -0
- package/lib/managers/folders.d.ts +347 -0
- package/lib/managers/folders.js +551 -567
- package/lib/managers/folders.js.map +1 -0
- package/lib/managers/groups.d.ts +202 -0
- package/lib/managers/groups.js +238 -287
- package/lib/managers/groups.js.map +1 -0
- package/lib/managers/legal-hold-policies.d.ts +190 -0
- package/lib/managers/legal-hold-policies.js +228 -272
- package/lib/managers/legal-hold-policies.js.map +1 -0
- package/lib/managers/metadata.d.ts +228 -0
- package/lib/managers/metadata.js +265 -328
- package/lib/managers/metadata.js.map +1 -0
- package/lib/managers/recent-items.d.ts +38 -0
- package/lib/managers/recent-items.js +32 -39
- package/lib/managers/recent-items.js.map +1 -0
- package/lib/managers/retention-policies.d.ts +213 -0
- package/lib/managers/retention-policies.js +235 -281
- package/lib/managers/retention-policies.js.map +1 -0
- package/lib/managers/search.d.ts +82 -0
- package/lib/managers/search.js +68 -88
- package/lib/managers/search.js.map +1 -0
- package/lib/managers/shared-items.d.ts +33 -0
- package/lib/managers/shared-items.js +54 -62
- package/lib/managers/shared-items.js.map +1 -0
- package/lib/managers/storage-policies.d.ts +86 -0
- package/lib/managers/storage-policies.js +108 -142
- package/lib/managers/storage-policies.js.map +1 -0
- package/lib/managers/tasks.d.ts +161 -0
- package/lib/managers/tasks.js +219 -260
- package/lib/managers/tasks.js.map +1 -0
- package/lib/managers/terms-of-service.d.ts +161 -0
- package/lib/managers/terms-of-service.js +250 -273
- package/lib/managers/terms-of-service.js.map +1 -0
- package/lib/managers/trash.d.ts +30 -0
- package/lib/managers/trash.js +30 -41
- package/lib/managers/trash.js.map +1 -0
- package/lib/managers/users.d.ts +131 -0
- package/lib/managers/users.js +160 -203
- package/lib/managers/users.js.map +1 -0
- package/lib/managers/web-links.d.ts +127 -0
- package/lib/managers/web-links.js +183 -209
- package/lib/managers/web-links.js.map +1 -0
- package/lib/managers/webhooks.d.ts +166 -0
- package/lib/managers/webhooks.js +312 -305
- package/lib/managers/webhooks.js.map +1 -0
- package/lib/sessions/anonymous-session.d.ts +69 -0
- package/lib/sessions/anonymous-session.js +88 -102
- package/lib/sessions/anonymous-session.js.map +1 -0
- package/lib/sessions/app-auth-session.d.ts +92 -0
- package/lib/sessions/app-auth-session.js +140 -160
- package/lib/sessions/app-auth-session.js.map +1 -0
- package/lib/sessions/basic-session.d.ts +56 -0
- package/lib/sessions/basic-session.js +40 -50
- package/lib/sessions/basic-session.js.map +1 -0
- package/lib/sessions/persistent-session.d.ts +96 -0
- package/lib/sessions/persistent-session.js +191 -211
- package/lib/sessions/persistent-session.js.map +1 -0
- package/lib/token-manager.d.ts +191 -0
- package/lib/token-manager.js +390 -465
- package/lib/token-manager.js.map +1 -0
- package/lib/util/config.d.ts +86 -0
- package/lib/util/config.js +124 -152
- package/lib/util/config.js.map +1 -0
- package/lib/util/errors.d.ts +50 -0
- package/lib/util/errors.js +134 -145
- package/lib/util/errors.js.map +1 -0
- package/lib/util/exponential-backoff.d.ts +11 -0
- package/lib/util/exponential-backoff.js +10 -22
- package/lib/util/exponential-backoff.js.map +1 -0
- package/lib/util/paging-iterator.d.ts +53 -0
- package/lib/util/paging-iterator.js +202 -218
- package/lib/util/paging-iterator.js.map +1 -0
- package/lib/util/url-path.d.ts +16 -0
- package/lib/util/url-path.js +20 -35
- package/lib/util/url-path.js.map +1 -0
- package/package.json +24 -9
|
@@ -0,0 +1,190 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @fileoverview Manager for the Legal Hold Policies Resource
|
|
3
|
+
*/
|
|
4
|
+
import BoxClient from '../box-client';
|
|
5
|
+
/**
|
|
6
|
+
* Enum of valid policy assignment types, which specify what object the policy applies to
|
|
7
|
+
* @readonly
|
|
8
|
+
* @enum {LegalHoldPolicyAssignmentType}
|
|
9
|
+
*/
|
|
10
|
+
declare enum LegalHoldPolicyAssignmentType {
|
|
11
|
+
FOLDER = "folder",
|
|
12
|
+
USER = "user",
|
|
13
|
+
FILE = "file",
|
|
14
|
+
FILE_VERSION = "file_version"
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Simple manager for interacting with all Legal Holds 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
|
+
declare class LegalHoldPolicies {
|
|
24
|
+
client: BoxClient;
|
|
25
|
+
assignmentTypes: typeof LegalHoldPolicyAssignmentType;
|
|
26
|
+
constructor(client: BoxClient);
|
|
27
|
+
/**
|
|
28
|
+
* Used to create a single legal hold policy for an enterprise
|
|
29
|
+
*
|
|
30
|
+
* API Endpoint: '/legal_hold_policies'
|
|
31
|
+
* Method: POST
|
|
32
|
+
*
|
|
33
|
+
* @param {string} name - The name of the legal hold policy to be created
|
|
34
|
+
* @param {Object} [options] - Additional parameters
|
|
35
|
+
* @param {string} [options.description] - Description of the legal hold policy
|
|
36
|
+
* @param {string} [options.filter_started_at] - Date filter, any Custodian assignments will apply only to file versions created or uploaded inside of the date range
|
|
37
|
+
* @param {string} [options.filter_ended_at] - Date filter, any Custodian assignments will apply only to file versions created or uploaded inside of the date range
|
|
38
|
+
* @param {boolean} [options.is_ongoing] - After initialization, Assignments under this Policy will continue applying to files based on events, indefinitely
|
|
39
|
+
* @param {Function} [callback] - Passed the new policy information if it was acquired successfully, error otherwise
|
|
40
|
+
* @returns {Promise<Object>} A promise resolving to the created policy
|
|
41
|
+
*/
|
|
42
|
+
create(name: string, options?: {
|
|
43
|
+
description?: string;
|
|
44
|
+
filter_started_at?: string;
|
|
45
|
+
filter_ended_at?: string;
|
|
46
|
+
is_ongoing?: boolean;
|
|
47
|
+
}, callback?: Function): any;
|
|
48
|
+
/**
|
|
49
|
+
* Fetches details about a specific legal hold policy
|
|
50
|
+
*
|
|
51
|
+
* API Endpoint: '/legal_hold_policies/:policyID'
|
|
52
|
+
* Method: GET
|
|
53
|
+
*
|
|
54
|
+
* @param {string} policyID - The Box ID of the legal hold policy being requested
|
|
55
|
+
* @param {Object} [options] - Additional options for the request. Can be left null in most cases.
|
|
56
|
+
* @param {Function} [callback] - Passed the policy information if it was acquired successfully, error otherwise
|
|
57
|
+
* @returns {Promise<Object>} A promise resolving to the policy object
|
|
58
|
+
*/
|
|
59
|
+
get(policyID: string, options?: Record<string, any>, callback?: Function): any;
|
|
60
|
+
/**
|
|
61
|
+
* Update or modify a legal hold policy.
|
|
62
|
+
*
|
|
63
|
+
* API Endpoint: '/legal_hold_policies/:policyID'
|
|
64
|
+
* Method: PUT
|
|
65
|
+
*
|
|
66
|
+
* @param {string} policyID - The Box ID of the legal hold policy to update
|
|
67
|
+
* @param {Object} updates - The information to be updated
|
|
68
|
+
* @param {string} [updates.policy_name] - Name of Legal Hold Policy
|
|
69
|
+
* @param {string} [updates.description] - Description of Legal Hold Policy
|
|
70
|
+
* @param {string} [updates.release_notes] - Notes around why the policy was released
|
|
71
|
+
* @param {Function} [callback] - Passed the updated policy information if it was acquired successfully, error otherwise
|
|
72
|
+
* @returns {Promise<Object>} A promise resolving to the updated policy
|
|
73
|
+
*/
|
|
74
|
+
update(policyID: string, updates: {
|
|
75
|
+
policy_name?: string;
|
|
76
|
+
description?: string;
|
|
77
|
+
release_notes?: string;
|
|
78
|
+
}, callback?: Function): any;
|
|
79
|
+
/**
|
|
80
|
+
* Fetches a list of legal hold policies for the enterprise
|
|
81
|
+
*
|
|
82
|
+
* API Endpoint: '/legal_hold_policies'
|
|
83
|
+
* Method: GET
|
|
84
|
+
*
|
|
85
|
+
* @param {Object} [options] - Additional options for the request. Can be left null in most cases.
|
|
86
|
+
* @param {string} [options.policy_name] - A full or partial name to filter the legal hold policies by
|
|
87
|
+
* @param {int} [options.limit] - Limit result size to this number
|
|
88
|
+
* @param {string} [options.marker] - Paging marker, leave blank to start at the first page
|
|
89
|
+
* @param {Function} [callback] - Passed the policy objects if they were acquired successfully, error otherwise
|
|
90
|
+
* @returns {Promise<Object>} A promise resolving to the collection of policies
|
|
91
|
+
*/
|
|
92
|
+
getAll(options?: {
|
|
93
|
+
policy_name?: string;
|
|
94
|
+
limit?: number;
|
|
95
|
+
marker?: string;
|
|
96
|
+
}, callback?: Function): any;
|
|
97
|
+
/**
|
|
98
|
+
* Sends request to delete an existing legal hold policy. Note that this is an
|
|
99
|
+
* asynchronous process - the policy will not be fully deleted yet when the
|
|
100
|
+
* response comes back.
|
|
101
|
+
*
|
|
102
|
+
* API Endpoint: '/legal_hold_policies/:policyID'
|
|
103
|
+
* Method: DELETE
|
|
104
|
+
*
|
|
105
|
+
* @param {string} policyID - The legal hold policy to delete
|
|
106
|
+
* @param {Function} [callback] - Passed nothing if successful, error otherwise
|
|
107
|
+
* @returns {Promise<void>} A promise resolving to nothing
|
|
108
|
+
*/
|
|
109
|
+
delete(policyID: string, callback?: Function): any;
|
|
110
|
+
/**
|
|
111
|
+
* Fetch a list of assignments for a given legal hold policy
|
|
112
|
+
*
|
|
113
|
+
* API Endpoint: '/legal_hold_policies/:policyID/assignments'
|
|
114
|
+
* Method: GET
|
|
115
|
+
*
|
|
116
|
+
* @param {string} policyID - The Box ID of the legal hold policy to get assignments for
|
|
117
|
+
* @param {Object} [options] - Additional options for the request. Can be left null in most cases.
|
|
118
|
+
* @param {LegalHoldPolicyAssignmentType} [options.assign_to_type] - Filter assignments of this type only
|
|
119
|
+
* @param {string} [options.assign_to_id] - Filter assignments to this ID only. Note that this will only show assignments applied directly to this entity.
|
|
120
|
+
* @param {Function} [callback] - Passed the assignment objects if they were acquired successfully, error otherwise
|
|
121
|
+
* @returns {Promise<Object>} A promise resolving to the collection of policy assignments
|
|
122
|
+
*/
|
|
123
|
+
getAssignments(policyID: string, options?: {
|
|
124
|
+
assign_to_type?: LegalHoldPolicyAssignmentType;
|
|
125
|
+
assign_to_id?: string;
|
|
126
|
+
}, callback?: Function): any;
|
|
127
|
+
/**
|
|
128
|
+
* Assign a lehal hold policy to an object
|
|
129
|
+
*
|
|
130
|
+
* API Endpoint: '/legal_hold_policy_assignments
|
|
131
|
+
* Method: POST
|
|
132
|
+
*
|
|
133
|
+
* @param {string} policyID - The ID of the policy to assign
|
|
134
|
+
* @param {LegalHoldPolicyAssignmentType} assignType - The type of object the policy will be assigned to
|
|
135
|
+
* @param {string} assignID - The Box ID of the object to assign the legal hold policy to
|
|
136
|
+
* @param {Function} [callback] - Passed the new assignment object if successful, error otherwise
|
|
137
|
+
* @returns {Promise<Object>} A promise resolving to the created assignment object
|
|
138
|
+
*/
|
|
139
|
+
assign(policyID: string, assignType: LegalHoldPolicyAssignmentType, assignID: string, callback?: Function): any;
|
|
140
|
+
/**
|
|
141
|
+
* Fetch a specific policy assignment
|
|
142
|
+
*
|
|
143
|
+
* API Endpoint: '/legal_hold_policy_assignments/:assignmentID'
|
|
144
|
+
* Method: GET
|
|
145
|
+
*
|
|
146
|
+
* @param {string} assignmentID - The Box ID of the policy assignment object to fetch
|
|
147
|
+
* @param {Object} [options] - Additional options for the request. Can be left null in most cases.
|
|
148
|
+
* @param {Function} [callback] - Passed the assignment object if it was acquired successfully, error otherwise
|
|
149
|
+
* @returns {Promise<Object>} A promise resolving to the assignment object
|
|
150
|
+
*/
|
|
151
|
+
getAssignment(assignmentID: string, options?: Record<string, any>, callback?: Function): any;
|
|
152
|
+
/**
|
|
153
|
+
* Sends request to delete an existing legal hold policy. Note that this is an
|
|
154
|
+
* asynchronous process - the policy will not be fully deleted yet when the
|
|
155
|
+
* response comes back.
|
|
156
|
+
*
|
|
157
|
+
* API Endpoint: '/legal_hold_policy_assignments/:assignmentID'
|
|
158
|
+
* Method: DELETE
|
|
159
|
+
*
|
|
160
|
+
* @param {string} assignmentID - The legal hold policy assignment to delete
|
|
161
|
+
* @param {Function} [callback] - Passed nothing if successful, error otherwise
|
|
162
|
+
* @returns {Promise<void>} A promise resolving to nothing
|
|
163
|
+
*/
|
|
164
|
+
deleteAssignment(assignmentID: string, callback?: Function): any;
|
|
165
|
+
/**
|
|
166
|
+
* Get the specific legal hold record for a held file version.
|
|
167
|
+
*
|
|
168
|
+
* API Endpoint: '/file_version_legal_holds/:legalHoldID'
|
|
169
|
+
* Method: GET
|
|
170
|
+
*
|
|
171
|
+
* @param {string} legalHoldID - The ID for the file legal hold record to retrieve
|
|
172
|
+
* @param {Object} [options] - Additional options for the request. Can be left null in most cases.
|
|
173
|
+
* @param {Function} [callback] - Pass the file version legal hold record if successful, error otherwise
|
|
174
|
+
* @returns {Promise<Object>} A promise resolving to the legal hold record
|
|
175
|
+
*/
|
|
176
|
+
getFileVersionLegalHold(legalHoldID: string, options?: Record<string, any>, callback?: Function): any;
|
|
177
|
+
/**
|
|
178
|
+
* Get a list of legal hold records for held file versions in an enterprise.
|
|
179
|
+
*
|
|
180
|
+
* API Endpoint: '/file_version_legal_holds'
|
|
181
|
+
* Method: GET
|
|
182
|
+
*
|
|
183
|
+
* @param {string} policyID - ID of Legal Hold Policy to get File Version Legal Holds for
|
|
184
|
+
* @param {Object} [options] - Additional options for the request. Can be left null in most cases.
|
|
185
|
+
* @param {Function} [callback] - Pass the file version legal holds records if successful, error otherwise
|
|
186
|
+
* @returns {Promise<Object>} A promise resolving to the collection of all file version legal holds
|
|
187
|
+
*/
|
|
188
|
+
getAllFileVersionLegalHolds(policyID: string, options?: Record<string, any>, callback?: Function): any;
|
|
189
|
+
}
|
|
190
|
+
export = LegalHoldPolicies;
|