box-node-sdk 1.11.0 → 1.12.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/.nycrc ADDED
@@ -0,0 +1,15 @@
1
+ {
2
+ "include": [
3
+ "lib/**/*.js"
4
+ ],
5
+ "reporter": [
6
+ "text-summary"
7
+ ],
8
+ "check-coverage": true,
9
+ "lines": 98,
10
+ "statements": 98,
11
+ "functions": 99,
12
+ "branches": 92,
13
+ "report-dir": "./coverage",
14
+ "all": true
15
+ }
package/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 1.12.0
4
+
5
+ - Added support for [metadata template deletion](./docs/metadata.md#delete-metadata-template)
6
+
3
7
  ## 1.11.0
4
8
 
5
9
  - Added options to preserve file timestamps on [file upload](./docs/files.md#upload-a-file)
package/Makefile.js CHANGED
@@ -11,6 +11,7 @@
11
11
 
12
12
  require('shelljs/make');
13
13
  var nodeCLI = require('shelljs-nodecli');
14
+ var semver = require('semver');
14
15
 
15
16
  //------------------------------------------------------------------------------
16
17
  // Helpers
@@ -85,7 +86,10 @@ target.lint = function() {
85
86
 
86
87
  target.test = function() {
87
88
  var code = target.lint();
88
- code += nodeCLI.exec('istanbul', 'cover', MOCHA_BINARY, '--', '-c', '-R spec', TEST_FILES).code;
89
+ if (semver.gte(process.version.substr(1), '6.0.0')) {
90
+ code += nodeCLI.exec('nsp', 'check').code;
91
+ }
92
+ code += nodeCLI.exec('nyc', MOCHA_BINARY, '-c', '-R spec', '--exit', TEST_FILES).code;
89
93
 
90
94
  if (code) {
91
95
  exit(code);
@@ -165,6 +165,24 @@ Metadata.prototype = {
165
165
  };
166
166
 
167
167
  return this.client.wrapWithDefaultHandler(this.client.put)(apiPath, params, callback);
168
+ },
169
+
170
+ /**
171
+ * Delete a metadata template from an enterprise.
172
+ *
173
+ * API Endpoint: '/metadata_templates/:scope/:template/schema'
174
+ * Method: DELETE
175
+ *
176
+ * @param {string} scope - The scope of the template to delete
177
+ * @param {string} template - The template to delete
178
+ * @param {Function} [callback] - Passed empty response body if successful, err otherwise
179
+ * @returns {Promise<void>} A promise resolving to nothing
180
+ * @see {@link https://docs.box.com/reference#delete-metadata-schema}
181
+ */
182
+ deleteTemplate: function(scope, template, callback) {
183
+
184
+ var apiPath = urlPath(BASE_PATH, scope, template, SCHEMA_SUBRESOURCE);
185
+ return this.client.wrapWithDefaultHandler(this.client.del)(apiPath, callback);
168
186
  }
169
187
  };
170
188
 
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.11.0",
4
+ "version": "1.12.0",
5
5
  "description": "Official Box SDK for Node.js",
6
6
  "license": "Apache-2.0",
7
7
  "repository": {
@@ -34,13 +34,15 @@
34
34
  "devDependencies": {
35
35
  "chai": "^4.1.1",
36
36
  "eslint": "^2.8.0",
37
- "istanbul": "^0.4.3",
38
- "jsdoc": "^3.4.0",
37
+ "jsdoc": "^3.5.5",
39
38
  "jsonlint": "~1.6.2",
40
- "leche": "^2.1.1",
41
- "mocha": "^2.4.5",
39
+ "leche": "^2.2.2",
40
+ "mocha": "^4.0.1",
42
41
  "mockery": "^1.4.1",
43
42
  "nock": "^9.0.13",
43
+ "nsp": "^3.1.0",
44
+ "nyc": "^11.3.0",
45
+ "semver": "^5.4.1",
44
46
  "shelljs": "^0.3.0",
45
47
  "shelljs-nodecli": "^0.1.1",
46
48
  "sinon": "^1.17.3"
package/.npmignore DELETED
@@ -1,4 +0,0 @@
1
- /tests/
2
- /docs/
3
- /examples/
4
- /coverage/