files.com 1.0.150 → 1.0.154

Sign up to get free protection for your applications and to get access to all the features.
package/_VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.150
1
+ 1.0.154
@@ -143,12 +143,6 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
143
143
  (0, _defineProperty2.default)(this, "setTriggerActions", function (value) {
144
144
  _this.attributes.trigger_actions = value;
145
145
  });
146
- (0, _defineProperty2.default)(this, "getTriggerActionPath", function () {
147
- return _this.attributes.trigger_action_path;
148
- });
149
- (0, _defineProperty2.default)(this, "setTriggerActionPath", function (value) {
150
- _this.attributes.trigger_action_path = value;
151
- });
152
146
  (0, _defineProperty2.default)(this, "getValue", function () {
153
147
  return _this.attributes.value;
154
148
  });
@@ -308,53 +302,45 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
308
302
  throw new Error("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(trigger_actions)));
309
303
 
310
304
  case 36:
311
- if (!(params['trigger_action_path'] && !(0, _utils.isString)(params['trigger_action_path']))) {
312
- _context.next = 38;
313
- break;
314
- }
315
-
316
- throw new Error("Bad parameter: trigger_action_path must be of type String, received ".concat((0, _utils.getType)(trigger_action_path)));
317
-
318
- case 38:
319
305
  if (params['id']) {
320
- _context.next = 44;
306
+ _context.next = 42;
321
307
  break;
322
308
  }
323
309
 
324
310
  if (!_this.attributes.id) {
325
- _context.next = 43;
311
+ _context.next = 41;
326
312
  break;
327
313
  }
328
314
 
329
315
  params['id'] = _this.id;
330
- _context.next = 44;
316
+ _context.next = 42;
331
317
  break;
332
318
 
333
- case 43:
319
+ case 41:
334
320
  throw new Error('Parameter missing: id');
335
321
 
336
- case 44:
322
+ case 42:
337
323
  if (params['automation']) {
338
- _context.next = 50;
324
+ _context.next = 48;
339
325
  break;
340
326
  }
341
327
 
342
328
  if (!_this.attributes.automation) {
343
- _context.next = 49;
329
+ _context.next = 47;
344
330
  break;
345
331
  }
346
332
 
347
333
  params['automation'] = _this.automation;
348
- _context.next = 50;
334
+ _context.next = 48;
349
335
  break;
350
336
 
351
- case 49:
337
+ case 47:
352
338
  throw new Error('Parameter missing: automation');
353
339
 
354
- case 50:
340
+ case 48:
355
341
  return _context.abrupt("return", _Api.default.sendRequest("/automations/".concat(params['id']), 'PATCH', params, _this.options));
356
342
 
357
- case 51:
343
+ case 49:
358
344
  case "end":
359
345
  return _context.stop();
360
346
  }
@@ -704,22 +690,14 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
704
690
  throw new Error("Bad parameter: trigger_actions must be of type Array, received ".concat((0, _utils.getType)(trigger_actions)));
705
691
 
706
692
  case 32:
707
- if (!(params['trigger_action_path'] && !(0, _utils.isString)(params['trigger_action_path']))) {
708
- _context5.next = 34;
709
- break;
710
- }
711
-
712
- throw new Error("Bad parameter: trigger_action_path must be of type String, received ".concat((0, _utils.getType)(trigger_action_path)));
713
-
714
- case 34:
715
- _context5.next = 36;
693
+ _context5.next = 34;
716
694
  return _Api.default.sendRequest("/automations", 'POST', params, options);
717
695
 
718
- case 36:
696
+ case 34:
719
697
  response = _context5.sent;
720
698
  return _context5.abrupt("return", new Automation(response === null || response === void 0 ? void 0 : response.data, options));
721
699
 
722
- case 38:
700
+ case 36:
723
701
  case "end":
724
702
  return _context5.stop();
725
703
  }
@@ -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.150",
3
+ "version": "1.0.154",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
@@ -141,13 +141,6 @@ class Automation {
141
141
  this.attributes.trigger_actions = value
142
142
  }
143
143
 
144
- // string # If trigger is `action`, this is the path to watch for the specified trigger actions.
145
- getTriggerActionPath = () => this.attributes.trigger_action_path
146
-
147
- setTriggerActionPath = value => {
148
- this.attributes.trigger_action_path = value
149
- }
150
-
151
144
  // object # A Hash of attributes specific to the automation type.
152
145
  getValue = () => this.attributes.value
153
146
 
@@ -179,7 +172,6 @@ class Automation {
179
172
  // name - string - Name for this automation.
180
173
  // trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
181
174
  // trigger_actions - array(string) - If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
182
- // trigger_action_path - string - If trigger is `action`, this is the path to watch for the specified trigger actions.
183
175
  // value - object - A Hash of attributes specific to the automation type.
184
176
  update = async (params = {}) => {
185
177
  if (!this.attributes.id) {
@@ -236,9 +228,6 @@ class Automation {
236
228
  if (params['trigger_actions'] && !isArray(params['trigger_actions'])) {
237
229
  throw new Error(`Bad parameter: trigger_actions must be of type Array, received ${getType(trigger_actions)}`)
238
230
  }
239
- if (params['trigger_action_path'] && !isString(params['trigger_action_path'])) {
240
- throw new Error(`Bad parameter: trigger_action_path must be of type String, received ${getType(trigger_action_path)}`)
241
- }
242
231
 
243
232
  if (!params['id']) {
244
233
  if (this.attributes.id) {
@@ -370,7 +359,6 @@ class Automation {
370
359
  // name - string - Name for this automation.
371
360
  // trigger - string - How this automation is triggered to run. One of: `realtime`, `daily`, `custom_schedule`, `webhook`, `email`, or `action`.
372
361
  // trigger_actions - array(string) - If trigger is `action`, this is the list of action types on which to trigger the automation. Valid actions are create, read, update, destroy, move, copy
373
- // trigger_action_path - string - If trigger is `action`, this is the path to watch for the specified trigger actions.
374
362
  // value - object - A Hash of attributes specific to the automation type.
375
363
  static create = async (params = {}, options = {}) => {
376
364
  if (!params['automation']) {
@@ -433,10 +421,6 @@ class Automation {
433
421
  throw new Error(`Bad parameter: trigger_actions must be of type Array, received ${getType(trigger_actions)}`)
434
422
  }
435
423
 
436
- if (params['trigger_action_path'] && !isString(params['trigger_action_path'])) {
437
- throw new Error(`Bad parameter: trigger_action_path must be of type String, received ${getType(trigger_action_path)}`)
438
- }
439
-
440
424
  const response = await Api.sendRequest(`/automations`, 'POST', params, options)
441
425
 
442
426
  return new Automation(response?.data, options)
@@ -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