files.com 1.0.239 → 1.0.240

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/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.239
1
+ 1.0.240
@@ -78,6 +78,7 @@ await Folder.listFor(path, {
78
78
  ```
79
79
  await Folder.create(path, {
80
80
  'mkdir_parents': true,
81
+ 'provided_mtime': "2000-01-01T01:00:00Z",
81
82
  })
82
83
  ```
83
84
 
@@ -86,3 +87,4 @@ await Folder.create(path, {
86
87
 
87
88
  * `path` (string): Required - Path to operate on.
88
89
  * `mkdir_parents` (boolean): Create parent directories if they do not exist?
90
+ * `provided_mtime` (string): User provided modification time.
@@ -269,12 +269,18 @@ var Folder = /*#__PURE__*/(0, _createClass2.default)(function Folder() {
269
269
  }
270
270
  throw new errors.InvalidParameterError("Bad parameter: path must be of type String, received ".concat((0, _utils.getType)(params['path'])));
271
271
  case 9:
272
- _context2.next = 11;
273
- return _Api.default.sendRequest("/folders/".concat(encodeURIComponent(params['path'])), 'POST', params, options);
272
+ if (!(params['provided_mtime'] && !(0, _utils.isString)(params['provided_mtime']))) {
273
+ _context2.next = 11;
274
+ break;
275
+ }
276
+ throw new errors.InvalidParameterError("Bad parameter: provided_mtime must be of type String, received ".concat((0, _utils.getType)(params['provided_mtime'])));
274
277
  case 11:
278
+ _context2.next = 13;
279
+ return _Api.default.sendRequest("/folders/".concat(encodeURIComponent(params['path'])), 'POST', params, options);
280
+ case 13:
275
281
  response = _context2.sent;
276
282
  return _context2.abrupt("return", new _File.default(response === null || response === void 0 ? void 0 : response.data, options));
277
- case 13:
283
+ case 15:
278
284
  case "end":
279
285
  return _context2.stop();
280
286
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.0.239",
3
+ "version": "1.0.240",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
@@ -213,6 +213,7 @@ class Folder {
213
213
  // Parameters:
214
214
  // path (required) - string - Path to operate on.
215
215
  // mkdir_parents - boolean - Create parent directories if they do not exist?
216
+ // provided_mtime - string - User provided modification time.
216
217
  static create = async (path, params = {}, options = {}) => {
217
218
  if (!isObject(params)) {
218
219
  throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
@@ -228,6 +229,10 @@ class Folder {
228
229
  throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params['path'])}`)
229
230
  }
230
231
 
232
+ if (params['provided_mtime'] && !isString(params['provided_mtime'])) {
233
+ throw new errors.InvalidParameterError(`Bad parameter: provided_mtime must be of type String, received ${getType(params['provided_mtime'])}`)
234
+ }
235
+
231
236
  const response = await Api.sendRequest(`/folders/${encodeURIComponent(params['path'])}`, 'POST', params, options)
232
237
 
233
238
  return new File(response?.data, options)