box-node-sdk 1.35.0 → 1.36.0
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 +12 -0
- package/lib/managers/folders.js +63 -0
- package/lib/managers/groups.js +1 -0
- package/package.json +12 -7
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 1.36.0 (2020-01-27)
|
|
4
|
+
|
|
5
|
+
**New Features and Enhancements:**
|
|
6
|
+
|
|
7
|
+
- Add folder lock functionality ([#560](https://github.com/box/box-node-sdk/pull/560))
|
|
8
|
+
- Add support for filtering groups by name ([#561](https://github.com/box/box-node-sdk/pull/561))
|
|
9
|
+
|
|
10
|
+
**Bug Fixes:**
|
|
11
|
+
|
|
12
|
+
- Update proxy-agent to patch proxy support issue ([#563](https://github.com/box/box-node-sdk/pull/563))
|
|
13
|
+
- Update dependencies to patch security vulnerabilities ([#566](https://github.com/box/box-node-sdk/pull/566))
|
|
14
|
+
|
|
3
15
|
## 1.35.0 (2020-11-02)
|
|
4
16
|
|
|
5
17
|
**New Features and Enhancements:**
|
package/lib/managers/folders.js
CHANGED
|
@@ -15,6 +15,7 @@ var urlPath = require('../util/url-path'),
|
|
|
15
15
|
// Private
|
|
16
16
|
// ------------------------------------------------------------------------------
|
|
17
17
|
var BASE_PATH = '/folders',
|
|
18
|
+
FOLDER_LOCK = '/folder_locks',
|
|
18
19
|
WATERMARK_SUBRESOURCE = '/watermark';
|
|
19
20
|
|
|
20
21
|
|
|
@@ -577,6 +578,68 @@ Folders.prototype.removeWatermark = function(folderID, callback) {
|
|
|
577
578
|
|
|
578
579
|
return this.client.wrapWithDefaultHandler(this.client.del)(apiPath, null, callback);
|
|
579
580
|
};
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Used to lock a Box folder.
|
|
584
|
+
*
|
|
585
|
+
* API Endpoint: '/folder_locks'
|
|
586
|
+
* Method: POST
|
|
587
|
+
*
|
|
588
|
+
* @param {string} folderID - The Box ID of the folder to lock
|
|
589
|
+
* @param {Function} [callback] - Passed the folder lock object if successful, error otherwise
|
|
590
|
+
* @returns {Promise<void>} A promise resolving to a folder lock object
|
|
591
|
+
*/
|
|
592
|
+
Folders.prototype.lock = function(folderID, callback) {
|
|
593
|
+
var params = {
|
|
594
|
+
body: {
|
|
595
|
+
folder: {
|
|
596
|
+
type: 'folder',
|
|
597
|
+
id: folderID
|
|
598
|
+
},
|
|
599
|
+
locked_operations: {
|
|
600
|
+
move: true,
|
|
601
|
+
delete: true
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
};
|
|
605
|
+
return this.client.wrapWithDefaultHandler(this.client.post)(FOLDER_LOCK, params, callback);
|
|
606
|
+
};
|
|
607
|
+
|
|
608
|
+
/**
|
|
609
|
+
* Used to get all locks on a folder.
|
|
610
|
+
*
|
|
611
|
+
* API Endpoint: '/folder_locks'
|
|
612
|
+
* Method: GET
|
|
613
|
+
*
|
|
614
|
+
* @param {string} folderID - The Box ID of the folder to lock
|
|
615
|
+
* @param {Function} [callback] - Passed a collection of folder lock objects if successful, error otherwise
|
|
616
|
+
* @returns {Promise<void>} A promise resolving to a collection of folder lock objects
|
|
617
|
+
*/
|
|
618
|
+
Folders.prototype.getLocks = function(folderID, callback) {
|
|
619
|
+
var params = {
|
|
620
|
+
qs: {
|
|
621
|
+
folder_id: folderID
|
|
622
|
+
}
|
|
623
|
+
};
|
|
624
|
+
return this.client.wrapWithDefaultHandler(this.client.get)(FOLDER_LOCK, params, callback);
|
|
625
|
+
};
|
|
626
|
+
|
|
627
|
+
/**
|
|
628
|
+
* Used to delete a lock on a folder.
|
|
629
|
+
*
|
|
630
|
+
* API Endpoint: '/folder_locks/:folderLockID'
|
|
631
|
+
* Method: DELETE
|
|
632
|
+
*
|
|
633
|
+
* @param {string} folderLockID - The Box ID of the folder lock
|
|
634
|
+
* @param {Function} [callback] - Empty response body passed if successful, error otherwise
|
|
635
|
+
* @returns {Promise<void>} A promise resolving to nothing
|
|
636
|
+
*/
|
|
637
|
+
Folders.prototype.deleteLock = function(folderLockID, callback) {
|
|
638
|
+
|
|
639
|
+
var apiPath = urlPath(FOLDER_LOCK, folderLockID);
|
|
640
|
+
|
|
641
|
+
return this.client.wrapWithDefaultHandler(this.client.del)(apiPath, null, callback);
|
|
642
|
+
};
|
|
580
643
|
/**
|
|
581
644
|
* @module box-node-sdk/lib/managers/folders
|
|
582
645
|
* @see {@Link Folders}
|
package/lib/managers/groups.js
CHANGED
|
@@ -279,6 +279,7 @@ Groups.prototype.getMemberships = function(groupID, options, callback) {
|
|
|
279
279
|
* Method: GET
|
|
280
280
|
*
|
|
281
281
|
* @param {Object} [options] - Optional parameters, can be left null in most cases
|
|
282
|
+
* @param {string} [options.filter_term] - Limits the results to only groups whose name starts with the search term
|
|
282
283
|
* @param {int} [options.limit] - The number of memberships to retrieve
|
|
283
284
|
* @param {int} [options.offset] - Paging marker, retrieve records starting at this position in the list
|
|
284
285
|
* @param {Function} [callback] - Passed a list of groups if successful, error otherwise
|
package/package.json
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "box-node-sdk",
|
|
3
3
|
"author": "Box <oss@box.com>",
|
|
4
|
-
"version": "1.
|
|
4
|
+
"version": "1.36.0",
|
|
5
5
|
"description": "Official SDK for Box Plaform APIs",
|
|
6
6
|
"license": "Apache-2.0",
|
|
7
7
|
"repository": {
|
|
@@ -38,14 +38,14 @@
|
|
|
38
38
|
"jsonwebtoken": "^8.5.1",
|
|
39
39
|
"merge-options": "^1.0.1",
|
|
40
40
|
"promise-queue": "^2.2.3",
|
|
41
|
-
"proxy-agent": "^
|
|
41
|
+
"proxy-agent": "^4.0.0",
|
|
42
42
|
"request": "^2.88.0",
|
|
43
43
|
"url-template": "^2.0.8",
|
|
44
44
|
"uuid": "^3.3.3"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
47
|
"chai": "^4.2.0",
|
|
48
|
-
"coveralls": "^3.0
|
|
48
|
+
"coveralls": "^3.1.0",
|
|
49
49
|
"eslint": "^4.19.1",
|
|
50
50
|
"eslint-plugin-node": "^6.0.1",
|
|
51
51
|
"eslint-plugin-promise": "^3.8.0",
|
|
@@ -54,12 +54,13 @@
|
|
|
54
54
|
"jsdoc": "^3.6.3",
|
|
55
55
|
"jsonlint2": "^1.7.1",
|
|
56
56
|
"leche": "^2.3.0",
|
|
57
|
-
"mocha": "^
|
|
57
|
+
"mocha": "^6.0.0",
|
|
58
58
|
"mockery": "^2.1.0",
|
|
59
59
|
"nock": "^9.6.1",
|
|
60
|
-
"np": "^
|
|
60
|
+
"np": "^7.2.0",
|
|
61
|
+
"npm-force-resolutions": "0.0.3",
|
|
61
62
|
"npm-upgrade": "^2.0.3",
|
|
62
|
-
"nyc": "^
|
|
63
|
+
"nyc": "^14.0.0",
|
|
63
64
|
"shelljs": "^0.8.3",
|
|
64
65
|
"shelljs-nodecli": "^0.1.1",
|
|
65
66
|
"sinon": "^7.5.0"
|
|
@@ -67,5 +68,9 @@
|
|
|
67
68
|
"files": [
|
|
68
69
|
"config",
|
|
69
70
|
"lib"
|
|
70
|
-
]
|
|
71
|
+
],
|
|
72
|
+
"resolutions": {
|
|
73
|
+
"handlebars": "4.5.3",
|
|
74
|
+
"minimist": "1.2.5"
|
|
75
|
+
}
|
|
71
76
|
}
|