files.com 1.0.153 → 1.0.154

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.153
1
+ 1.0.154
@@ -47,6 +47,12 @@ var RemoteServer = /*#__PURE__*/(0, _createClass2.default)(function RemoteServer
47
47
  (0, _defineProperty2.default)(this, "setId", function (value) {
48
48
  _this.attributes.id = value;
49
49
  });
50
+ (0, _defineProperty2.default)(this, "getDisabled", function () {
51
+ return _this.attributes.disabled;
52
+ });
53
+ (0, _defineProperty2.default)(this, "setDisabled", function (value) {
54
+ _this.attributes.disabled = value;
55
+ });
50
56
  (0, _defineProperty2.default)(this, "getAuthenticationMethod", function () {
51
57
  return _this.attributes.authentication_method;
52
58
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.0.153",
3
+ "version": "1.0.154",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
@@ -29,6 +29,13 @@ class RemoteServer {
29
29
  this.attributes.id = value
30
30
  }
31
31
 
32
+ // boolean # If true, this server has been disabled due to failures. Make any change or set disabled to false to clear this flag.
33
+ getDisabled = () => this.attributes.disabled
34
+
35
+ setDisabled = value => {
36
+ this.attributes.disabled = value
37
+ }
38
+
32
39
  // string # Type of authentication method
33
40
  getAuthenticationMethod = () => this.attributes.authentication_method
34
41
 
@@ -127,7 +127,7 @@ class SsoStrategy {
127
127
  // string # Domain name that will be appended to LDAP usernames
128
128
  getLdapDomain = () => this.attributes.ldap_domain
129
129
 
130
- // boolean # Is strategy enabled?
130
+ // boolean # Is strategy enabled? This may become automatically set to `false` after a high number and duration of failures.
131
131
  getEnabled = () => this.attributes.enabled
132
132
 
133
133
  // string # LDAP host
@@ -1,128 +0,0 @@
1
- "use strict";
2
-
3
- var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
4
-
5
- exports.__esModule = true;
6
- exports.default = void 0;
7
-
8
- var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
9
-
10
- var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
11
-
12
- var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
13
-
14
- var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
15
-
16
- var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
17
-
18
- var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
19
-
20
- var _Api = _interopRequireDefault(require("../Api"));
21
-
22
- var _Logger = _interopRequireDefault(require("../Logger"));
23
-
24
- var _utils = require("../utils");
25
-
26
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
27
-
28
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { (0, _defineProperty2.default)(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
29
-
30
- /**
31
- * Class SyncJob
32
- */
33
- var SyncJob = /*#__PURE__*/(0, _createClass2.default)(function SyncJob() {
34
- var _this = this;
35
-
36
- var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
37
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
38
- (0, _classCallCheck2.default)(this, SyncJob);
39
- (0, _defineProperty2.default)(this, "attributes", {});
40
- (0, _defineProperty2.default)(this, "options", {});
41
- (0, _defineProperty2.default)(this, "isLoaded", function () {
42
- return !!_this.attributes.id;
43
- });
44
- (0, _defineProperty2.default)(this, "getQueuedAt", function () {
45
- return _this.attributes.queued_at;
46
- });
47
- (0, _defineProperty2.default)(this, "getUpdatedAt", function () {
48
- return _this.attributes.updated_at;
49
- });
50
- (0, _defineProperty2.default)(this, "getStatus", function () {
51
- return _this.attributes.status;
52
- });
53
- (0, _defineProperty2.default)(this, "getRegionalWorkerStatus", function () {
54
- return _this.attributes.regional_worker_status;
55
- });
56
- (0, _defineProperty2.default)(this, "getUuid", function () {
57
- return _this.attributes.uuid;
58
- });
59
- (0, _defineProperty2.default)(this, "getFolderBehaviorId", function () {
60
- return _this.attributes.folder_behavior_id;
61
- });
62
- Object.entries(attributes).forEach(function (_ref) {
63
- var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
64
- key = _ref2[0],
65
- value = _ref2[1];
66
-
67
- var normalizedKey = key.replace('?', '');
68
- _this.attributes[normalizedKey] = value;
69
- Object.defineProperty(_this, normalizedKey, {
70
- value: value,
71
- writable: false
72
- });
73
- });
74
- this.options = _objectSpread({}, options);
75
- });
76
- (0, _defineProperty2.default)(SyncJob, "list", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
77
- var _response$data;
78
-
79
- var params,
80
- options,
81
- response,
82
- _args = arguments;
83
- return _regenerator.default.wrap(function _callee$(_context) {
84
- while (1) {
85
- switch (_context.prev = _context.next) {
86
- case 0:
87
- params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
88
- options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
89
-
90
- if (!(params['cursor'] && !(0, _utils.isString)(params['cursor']))) {
91
- _context.next = 4;
92
- break;
93
- }
94
-
95
- throw new Error("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(cursor)));
96
-
97
- case 4:
98
- if (!(params['per_page'] && !(0, _utils.isInt)(params['per_page']))) {
99
- _context.next = 6;
100
- break;
101
- }
102
-
103
- throw new Error("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(per_page)));
104
-
105
- case 6:
106
- _context.next = 8;
107
- return _Api.default.sendRequest("/sync_jobs", 'GET', params, options);
108
-
109
- case 8:
110
- response = _context.sent;
111
- return _context.abrupt("return", (response === null || response === void 0 ? void 0 : (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
112
- return new SyncJob(obj, options);
113
- })) || []);
114
-
115
- case 10:
116
- case "end":
117
- return _context.stop();
118
- }
119
- }
120
- }, _callee);
121
- })));
122
- (0, _defineProperty2.default)(SyncJob, "all", function () {
123
- var params = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
124
- var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
125
- return SyncJob.list(params, options);
126
- });
127
- var _default = SyncJob;
128
- exports.default = _default;
@@ -1,65 +0,0 @@
1
- import Api from '../Api'
2
- import Logger from '../Logger'
3
- import { getType, isArray, isBrowser, isInt, isObject, isString } from '../utils'
4
-
5
- /**
6
- * Class SyncJob
7
- */
8
- class SyncJob {
9
- attributes = {}
10
- options = {}
11
-
12
- constructor(attributes = {}, options = {}) {
13
- Object.entries(attributes).forEach(([key, value]) => {
14
- const normalizedKey = key.replace('?', '')
15
-
16
- this.attributes[normalizedKey] = value
17
-
18
- Object.defineProperty(this, normalizedKey, { value, writable: false })
19
- })
20
-
21
- this.options = { ...options }
22
- }
23
-
24
- isLoaded = () => !!this.attributes.id
25
- // date-time # Job enqueued at
26
- getQueuedAt = () => this.attributes.queued_at
27
-
28
- // date-time # Job updated at
29
- getUpdatedAt = () => this.attributes.updated_at
30
-
31
- // string # Status of the job
32
- getStatus = () => this.attributes.status
33
-
34
- // string # Most recent reported status of sync worker
35
- getRegionalWorkerStatus = () => this.attributes.regional_worker_status
36
-
37
- // string #
38
- getUuid = () => this.attributes.uuid
39
-
40
- // int64 #
41
- getFolderBehaviorId = () => this.attributes.folder_behavior_id
42
-
43
-
44
- // Parameters:
45
- // cursor - string - Used for pagination. Send a cursor value to resume an existing list from the point at which you left off. Get a cursor from an existing list via either the X-Files-Cursor-Next header or the X-Files-Cursor-Prev header.
46
- // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
47
- static list = async (params = {}, options = {}) => {
48
- if (params['cursor'] && !isString(params['cursor'])) {
49
- throw new Error(`Bad parameter: cursor must be of type String, received ${getType(cursor)}`)
50
- }
51
-
52
- if (params['per_page'] && !isInt(params['per_page'])) {
53
- throw new Error(`Bad parameter: per_page must be of type Int, received ${getType(per_page)}`)
54
- }
55
-
56
- const response = await Api.sendRequest(`/sync_jobs`, 'GET', params, options)
57
-
58
- return response?.data?.map(obj => new SyncJob(obj, options)) || []
59
- }
60
-
61
- static all = (params = {}, options = {}) =>
62
- SyncJob.list(params, options)
63
- }
64
-
65
- export default SyncJob