Skip to content

Commit aea2bb0

Browse files
[Bot] push changes from Files.com
1 parent 9a0f7ed commit aea2bb0

11 files changed

Lines changed: 201 additions & 7 deletions

File tree

_VERSION

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
1.2.604
1+
1.2.605

docs/models/Sync.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,18 @@
6868
"successful_files": 1,
6969
"sync_id": 1,
7070
"sync_name": "Azure to SharePoint Sync",
71-
"updated_at": "2000-01-01T01:00:00Z"
71+
"updated_at": "2000-01-01T01:00:00Z",
72+
"live_transfers": [
73+
{
74+
"path": "example",
75+
"status": "example",
76+
"bytes_copied": 1,
77+
"bytes_total": 1,
78+
"percentage": 1.0,
79+
"eta": "example",
80+
"started_at": "example"
81+
}
82+
]
7283
}
7384
}
7485
```
@@ -341,7 +352,18 @@ await sync.update({
341352
"successful_files": 1,
342353
"sync_id": 1,
343354
"sync_name": "Azure to SharePoint Sync",
344-
"updated_at": "2000-01-01T01:00:00Z"
355+
"updated_at": "2000-01-01T01:00:00Z",
356+
"live_transfers": [
357+
{
358+
"path": "example",
359+
"status": "example",
360+
"bytes_copied": 1,
361+
"bytes_total": 1,
362+
"percentage": 1.0,
363+
"eta": "example",
364+
"started_at": "example"
365+
}
366+
]
345367
}
346368
}
347369
```

docs/models/SyncRun.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,18 @@
2727
"successful_files": 1,
2828
"sync_id": 1,
2929
"sync_name": "Azure to SharePoint Sync",
30-
"updated_at": "2000-01-01T01:00:00Z"
30+
"updated_at": "2000-01-01T01:00:00Z",
31+
"live_transfers": [
32+
{
33+
"path": "example",
34+
"status": "example",
35+
"bytes_copied": 1,
36+
"bytes_total": 1,
37+
"percentage": 1.0,
38+
"eta": "example",
39+
"started_at": "example"
40+
}
41+
]
3142
}
3243
```
3344

@@ -53,6 +64,7 @@
5364
* `sync_id` (int64): ID of the Sync this run belongs to
5465
* `sync_name` (string): Name of the Sync this run belongs to
5566
* `updated_at` (date-time): When this run was last updated
67+
* `live_transfers` (array(object)): Array of in-progress file transfers with progress data. Only present when the sync run status is in_progress.
5668

5769
---
5870

docs/models/SyncRunLiveTransfer.md

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# SyncRunLiveTransfer
2+
3+
## Example SyncRunLiveTransfer Object
4+
5+
```
6+
{
7+
"path": "example",
8+
"status": "example",
9+
"bytes_copied": 1,
10+
"bytes_total": 1,
11+
"percentage": 1.0,
12+
"eta": "example",
13+
"started_at": "example"
14+
}
15+
```
16+
17+
* `path` (string): The file path being transferred. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
18+
* `status` (string): Status of this individual transfer
19+
* `bytes_copied` (int64): Bytes transferred so far
20+
* `bytes_total` (int64): Total bytes of the file being transferred
21+
* `percentage` (double): Transfer progress from 0.0 to 1.0
22+
* `eta` (string): Estimated time remaining (human-readable)
23+
* `started_at` (string): When this individual transfer started

lib/Files.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ var apiKey;
1212
var baseUrl = 'https://app.files.com';
1313
var sessionId = null;
1414
var language = null;
15-
var version = '1.2.604';
15+
var version = '1.2.605';
1616
var userAgent = "Files.com JavaScript SDK v".concat(version);
1717
var logLevel = _Logger.LogLevel.INFO;
1818
var debugRequest = false;

lib/models/SyncRun.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,10 @@ var SyncRun = /*#__PURE__*/(0, _createClass2.default)(function SyncRun() {
120120
(0, _defineProperty2.default)(this, "getUpdatedAt", function () {
121121
return _this.attributes.updated_at;
122122
});
123+
// array(object) # Array of in-progress file transfers with progress data. Only present when the sync run status is in_progress.
124+
(0, _defineProperty2.default)(this, "getLiveTransfers", function () {
125+
return _this.attributes.live_transfers;
126+
});
123127
Object.entries(attributes).forEach(function (_ref) {
124128
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
125129
key = _ref2[0],

lib/models/SyncRunLiveTransfer.js

Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
"use strict";
2+
3+
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4+
var _typeof = require("@babel/runtime/helpers/typeof");
5+
exports.__esModule = true;
6+
exports.default = void 0;
7+
var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
8+
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
9+
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
10+
var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
11+
var _Api = _interopRequireDefault(require("../Api"));
12+
var errors = _interopRequireWildcard(require("../Errors"));
13+
var _utils = require("../utils");
14+
function _interopRequireWildcard(e, t) { if ("function" == typeof WeakMap) var r = new WeakMap(), n = new WeakMap(); return (_interopRequireWildcard = function _interopRequireWildcard(e, t) { if (!t && e && e.__esModule) return e; var o, i, f = { __proto__: null, default: e }; if (null === e || "object" != _typeof(e) && "function" != typeof e) return f; if (o = t ? n : r) { if (o.has(e)) return o.get(e); o.set(e, f); } for (var _t in e) "default" !== _t && {}.hasOwnProperty.call(e, _t) && ((i = (o = Object.defineProperty) && Object.getOwnPropertyDescriptor(e, _t)) && (i.get || i.set) ? o(f, _t, i) : f[_t] = e[_t]); return f; })(e, t); }
15+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
16+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), !0).forEach(function (r) { (0, _defineProperty2.default)(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; } /* eslint-disable no-unused-vars */
17+
/* eslint-enable no-unused-vars */
18+
/**
19+
* Class SyncRunLiveTransfer
20+
*/
21+
var SyncRunLiveTransfer = /*#__PURE__*/(0, _createClass2.default)(function SyncRunLiveTransfer() {
22+
var _this = this;
23+
var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
24+
var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
25+
(0, _classCallCheck2.default)(this, SyncRunLiveTransfer);
26+
(0, _defineProperty2.default)(this, "attributes", {});
27+
(0, _defineProperty2.default)(this, "options", {});
28+
(0, _defineProperty2.default)(this, "isLoaded", function () {
29+
return !!_this.attributes.id;
30+
});
31+
// string # The file path being transferred. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
32+
(0, _defineProperty2.default)(this, "getPath", function () {
33+
return _this.attributes.path;
34+
});
35+
// string # Status of this individual transfer
36+
(0, _defineProperty2.default)(this, "getStatus", function () {
37+
return _this.attributes.status;
38+
});
39+
// int64 # Bytes transferred so far
40+
(0, _defineProperty2.default)(this, "getBytesCopied", function () {
41+
return _this.attributes.bytes_copied;
42+
});
43+
// int64 # Total bytes of the file being transferred
44+
(0, _defineProperty2.default)(this, "getBytesTotal", function () {
45+
return _this.attributes.bytes_total;
46+
});
47+
// double # Transfer progress from 0.0 to 1.0
48+
(0, _defineProperty2.default)(this, "getPercentage", function () {
49+
return _this.attributes.percentage;
50+
});
51+
// string # Estimated time remaining (human-readable)
52+
(0, _defineProperty2.default)(this, "getEta", function () {
53+
return _this.attributes.eta;
54+
});
55+
// string # When this individual transfer started
56+
(0, _defineProperty2.default)(this, "getStartedAt", function () {
57+
return _this.attributes.started_at;
58+
});
59+
Object.entries(attributes).forEach(function (_ref) {
60+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
61+
key = _ref2[0],
62+
value = _ref2[1];
63+
var normalizedKey = key.replace('?', '');
64+
_this.attributes[normalizedKey] = value;
65+
Object.defineProperty(_this, normalizedKey, {
66+
value: value,
67+
writable: false
68+
});
69+
});
70+
this.options = _objectSpread({}, options);
71+
});
72+
var _default = exports.default = SyncRunLiveTransfer;
73+
module.exports = SyncRunLiveTransfer;
74+
module.exports.default = SyncRunLiveTransfer;

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.604",
3+
"version": "1.2.605",
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
@@ -6,7 +6,7 @@ let apiKey
66
let baseUrl = 'https://app.files.com'
77
let sessionId = null
88
let language = null
9-
const version = '1.2.604'
9+
const version = '1.2.605'
1010
let userAgent = `Files.com JavaScript SDK v${version}`
1111

1212
let logLevel = LogLevel.INFO

src/models/SyncRun.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ class SyncRun {
9494
// date-time # When this run was last updated
9595
getUpdatedAt = () => this.attributes.updated_at
9696

97+
// array(object) # Array of in-progress file transfers with progress data. Only present when the sync run status is in_progress.
98+
getLiveTransfers = () => this.attributes.live_transfers
99+
97100
// Parameters:
98101
// user_id - int64 - User ID. Provide a value of `0` to operate the current session's user.
99102
// cursor - string - Used for pagination. When a list request has more records available, cursors are provided in the response headers `X-Files-Cursor-Next` and `X-Files-Cursor-Prev`. Send one of those cursor value here to resume an existing list from the next available record. Note: many of our SDKs have iterator methods that will automatically handle cursor-based pagination.

0 commit comments

Comments
 (0)