Skip to content

Commit 5dfd8dc

Browse files
[Bot] push changes from Files.com
1 parent c5b8663 commit 5dfd8dc

7 files changed

Lines changed: 40 additions & 9 deletions

File tree

_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.697
1+
1.2.698

docs/models/Snapshot.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,8 @@
99
"finalized_at": "2000-01-01T01:00:00Z",
1010
"name": "My Snapshot",
1111
"user_id": 1,
12-
"bundle_id": 1
12+
"bundle_id": 1,
13+
"workspace_id": 1
1314
}
1415
```
1516

@@ -19,6 +20,7 @@
1920
* `name` (string): A name for the snapshot.
2021
* `user_id` (int64): The user that created this snapshot, if applicable.
2122
* `bundle_id` (int64): The bundle using this snapshot, if applicable.
23+
* `workspace_id` (int64): Workspace ID. `0` means the default workspace.
2224
* `paths` (array(string)): An array of paths to add to the snapshot.
2325

2426
---
@@ -56,6 +58,7 @@ await Snapshot.find(id)
5658
await Snapshot.create({
5759
'expires_at': "2000-01-01T01:00:00Z",
5860
'name': "My Snapshot",
61+
'workspace_id': 0,
5962
})
6063
```
6164

@@ -65,6 +68,7 @@ await Snapshot.create({
6568
* `expires_at` (string): When the snapshot expires.
6669
* `name` (string): A name for the snapshot.
6770
* `paths` (array(string)): An array of paths to add to the snapshot.
71+
* `workspace_id` (int64): Workspace ID. `0` means the default workspace.
6872

6973
---
7074

@@ -110,7 +114,8 @@ await snapshot.update({
110114
"finalized_at": "2000-01-01T01:00:00Z",
111115
"name": "My Snapshot",
112116
"user_id": 1,
113-
"bundle_id": 1
117+
"bundle_id": 1,
118+
"workspace_id": 1
114119
}
115120
```
116121

lib/Files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ var baseUrl = 'https://app.files.com';
1313
var sessionId = null;
1414
var workspaceId = null;
1515
var language = null;
16-
var version = '1.2.697';
16+
var version = '1.2.698';
1717
var userAgent = "Files.com JavaScript SDK v".concat(version);
1818
var logLevel = _Logger.LogLevel.INFO;
1919
var debugRequest = false;

lib/models/Snapshot.js

Lines changed: 17 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,13 @@ var Snapshot = /*#__PURE__*/(0, _createClass2.default)(function Snapshot() {
7474
(0, _defineProperty2.default)(this, "setBundleId", function (value) {
7575
_this.attributes.bundle_id = value;
7676
});
77+
// int64 # Workspace ID. `0` means the default workspace.
78+
(0, _defineProperty2.default)(this, "getWorkspaceId", function () {
79+
return _this.attributes.workspace_id;
80+
});
81+
(0, _defineProperty2.default)(this, "setWorkspaceId", function (value) {
82+
_this.attributes.workspace_id = value;
83+
});
7784
// array(string) # An array of paths to add to the snapshot.
7885
(0, _defineProperty2.default)(this, "getPaths", function () {
7986
return _this.attributes.paths;
@@ -398,6 +405,7 @@ _Snapshot = Snapshot;
398405
// expires_at - string - When the snapshot expires.
399406
// name - string - A name for the snapshot.
400407
// paths - array(string) - An array of paths to add to the snapshot.
408+
// workspace_id - int64 - Workspace ID. `0` means the default workspace.
401409
(0, _defineProperty2.default)(Snapshot, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee7() {
402410
var params,
403411
options,
@@ -426,12 +434,18 @@ _Snapshot = Snapshot;
426434
}
427435
throw new errors.InvalidParameterError("Bad parameter: paths must be of type Array, received ".concat((0, _utils.getType)(params.paths)));
428436
case 3:
429-
_context7.next = 4;
430-
return _Api.default.sendRequest('/snapshots', 'POST', params, options);
437+
if (!(params.workspace_id && !(0, _utils.isInt)(params.workspace_id))) {
438+
_context7.next = 4;
439+
break;
440+
}
441+
throw new errors.InvalidParameterError("Bad parameter: workspace_id must be of type Int, received ".concat((0, _utils.getType)(params.workspace_id)));
431442
case 4:
443+
_context7.next = 5;
444+
return _Api.default.sendRequest('/snapshots', 'POST', params, options);
445+
case 5:
432446
response = _context7.sent;
433447
return _context7.abrupt("return", new _Snapshot(response === null || response === void 0 ? void 0 : response.data, options));
434-
case 5:
448+
case 6:
435449
case "end":
436450
return _context7.stop();
437451
}

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "files.com",
3-
"version": "1.2.697",
3+
"version": "1.2.698",
44
"description": "Files.com SDK for JavaScript",
55
"keywords": [
66
"files.com",

src/Files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ let baseUrl = 'https://app.files.com'
77
let sessionId = null
88
let workspaceId = null
99
let language = null
10-
const version = '1.2.697'
10+
const version = '1.2.698'
1111
let userAgent = `Files.com JavaScript SDK v${version}`
1212

1313
let logLevel = LogLevel.INFO

src/models/Snapshot.js

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,6 +70,13 @@ class Snapshot {
7070
this.attributes.bundle_id = value
7171
}
7272

73+
// int64 # Workspace ID. `0` means the default workspace.
74+
getWorkspaceId = () => this.attributes.workspace_id
75+
76+
setWorkspaceId = value => {
77+
this.attributes.workspace_id = value
78+
}
79+
7380
// array(string) # An array of paths to add to the snapshot.
7481
getPaths = () => this.attributes.paths
7582

@@ -235,6 +242,7 @@ class Snapshot {
235242
// expires_at - string - When the snapshot expires.
236243
// name - string - A name for the snapshot.
237244
// paths - array(string) - An array of paths to add to the snapshot.
245+
// workspace_id - int64 - Workspace ID. `0` means the default workspace.
238246
static create = async (params = {}, options = {}) => {
239247
if (params.expires_at && !isString(params.expires_at)) {
240248
throw new errors.InvalidParameterError(`Bad parameter: expires_at must be of type String, received ${getType(params.expires_at)}`)
@@ -248,6 +256,10 @@ class Snapshot {
248256
throw new errors.InvalidParameterError(`Bad parameter: paths must be of type Array, received ${getType(params.paths)}`)
249257
}
250258

259+
if (params.workspace_id && !isInt(params.workspace_id)) {
260+
throw new errors.InvalidParameterError(`Bad parameter: workspace_id must be of type Int, received ${getType(params.workspace_id)}`)
261+
}
262+
251263
const response = await Api.sendRequest('/snapshots', 'POST', params, options)
252264

253265
return new Snapshot(response?.data, options)

0 commit comments

Comments
 (0)