files.com 1.2.271 → 1.2.272

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.2.271
1
+ 1.2.272
@@ -86,7 +86,8 @@
86
86
  "value": {
87
87
  "limit": "1"
88
88
  },
89
- "webhook_url": "https://app.files.com/api/webhooks/abc123"
89
+ "webhook_url": "https://app.files.com/api/webhooks/abc123",
90
+ "holiday_region": "us_dc"
90
91
  }
91
92
  ```
92
93
 
@@ -128,6 +129,7 @@
128
129
  * `user_ids` (array(int64)): IDs of Users for the Automation (i.e. who to Request File from)
129
130
  * `value` (object): A Hash of attributes specific to the automation type.
130
131
  * `webhook_url` (string): If trigger is `webhook`, this is the URL of the webhook to trigger the Automation.
132
+ * `holiday_region` (string): If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
131
133
 
132
134
  ---
133
135
 
@@ -415,7 +417,8 @@ await automation.update({
415
417
  "value": {
416
418
  "limit": "1"
417
419
  },
418
- "webhook_url": "https://app.files.com/api/webhooks/abc123"
420
+ "webhook_url": "https://app.files.com/api/webhooks/abc123",
421
+ "holiday_region": "us_dc"
419
422
  }
420
423
  ```
421
424
 
@@ -0,0 +1,27 @@
1
+ # HolidayRegion
2
+
3
+ ## Example HolidayRegion Object
4
+
5
+ ```
6
+ {
7
+ "code": "us_dc",
8
+ "name": "United States - District of Columbia"
9
+ }
10
+ ```
11
+
12
+ * `code` (string): The code representing a region
13
+ * `name` (string): The name of the region
14
+
15
+ ---
16
+
17
+ ## List all possible holiday regions
18
+
19
+ ```
20
+ await HolidayRegion.getSupported
21
+ ```
22
+
23
+
24
+ ### Parameters
25
+
26
+ * `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.
27
+ * `per_page` (int64): Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
@@ -39,7 +39,8 @@
39
39
  "06:30",
40
40
  "14:30"
41
41
  ],
42
- "schedule_time_zone": "Eastern Time (US & Canada)"
42
+ "schedule_time_zone": "Eastern Time (US & Canada)",
43
+ "holiday_region": "us_dc"
43
44
  }
44
45
  ```
45
46
 
@@ -68,6 +69,7 @@
68
69
  * `schedule_days_of_week` (array(int64)): If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. 0-based days of the week. 0 is Sunday, 1 is Monday, etc.
69
70
  * `schedule_times_of_day` (array(string)): If trigger is `custom_schedule`, Custom schedule description for when the sync should be run. Times of day in HH:MM format.
70
71
  * `schedule_time_zone` (string): If trigger is `custom_schedule`, Custom schedule Time Zone for when the sync should be run.
72
+ * `holiday_region` (string): If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
71
73
 
72
74
  ---
73
75
 
@@ -255,7 +257,8 @@ await sync.update({
255
257
  "06:30",
256
258
  "14:30"
257
259
  ],
258
- "schedule_time_zone": "Eastern Time (US & Canada)"
260
+ "schedule_time_zone": "Eastern Time (US & Canada)",
261
+ "holiday_region": "us_dc"
259
262
  }
260
263
  ```
261
264
 
package/lib/Files.js CHANGED
@@ -12,7 +12,7 @@ var apiKey;
12
12
  var baseUrl = 'https://app.files.com';
13
13
  var sessionId = null;
14
14
  var language = null;
15
- var version = '1.2.271';
15
+ var version = '1.2.272';
16
16
  var userAgent = "Files.com JavaScript SDK v".concat(version);
17
17
  var logLevel = _Logger.LogLevel.INFO;
18
18
  var debugRequest = false;
@@ -298,6 +298,13 @@ var Automation = /*#__PURE__*/(0, _createClass2.default)(function Automation() {
298
298
  (0, _defineProperty2.default)(this, "setWebhookUrl", function (value) {
299
299
  _this.attributes.webhook_url = value;
300
300
  });
301
+ // string # If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
302
+ (0, _defineProperty2.default)(this, "getHolidayRegion", function () {
303
+ return _this.attributes.holiday_region;
304
+ });
305
+ (0, _defineProperty2.default)(this, "setHolidayRegion", function (value) {
306
+ _this.attributes.holiday_region = value;
307
+ });
301
308
  // Manually Run Automation
302
309
  (0, _defineProperty2.default)(this, "manualRun", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
303
310
  var params,
@@ -0,0 +1,98 @@
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 _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator"));
8
+ var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
9
+ var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
+ var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass"));
11
+ var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck"));
12
+ var _defineProperty2 = _interopRequireDefault(require("@babel/runtime/helpers/defineProperty"));
13
+ var _Api = _interopRequireDefault(require("../Api"));
14
+ var errors = _interopRequireWildcard(require("../Errors"));
15
+ var _utils = require("../utils");
16
+ var _HolidayRegion;
17
+ /* eslint-disable no-unused-vars */
18
+ 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); }
19
+ 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; }
20
+ 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; }
21
+ /* eslint-enable no-unused-vars */
22
+ /**
23
+ * Class HolidayRegion
24
+ */
25
+ var HolidayRegion = /*#__PURE__*/(0, _createClass2.default)(function HolidayRegion() {
26
+ var _this = this;
27
+ var attributes = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
28
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
29
+ (0, _classCallCheck2.default)(this, HolidayRegion);
30
+ (0, _defineProperty2.default)(this, "attributes", {});
31
+ (0, _defineProperty2.default)(this, "options", {});
32
+ (0, _defineProperty2.default)(this, "isLoaded", function () {
33
+ return !!_this.attributes.id;
34
+ });
35
+ // string # The code representing a region
36
+ (0, _defineProperty2.default)(this, "getCode", function () {
37
+ return _this.attributes.code;
38
+ });
39
+ // string # The name of the region
40
+ (0, _defineProperty2.default)(this, "getName", function () {
41
+ return _this.attributes.name;
42
+ });
43
+ Object.entries(attributes).forEach(function (_ref) {
44
+ var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
45
+ key = _ref2[0],
46
+ value = _ref2[1];
47
+ var normalizedKey = key.replace('?', '');
48
+ _this.attributes[normalizedKey] = value;
49
+ Object.defineProperty(_this, normalizedKey, {
50
+ value: value,
51
+ writable: false
52
+ });
53
+ });
54
+ this.options = _objectSpread({}, options);
55
+ });
56
+ _HolidayRegion = HolidayRegion;
57
+ // Parameters:
58
+ // 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.
59
+ // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
60
+ (0, _defineProperty2.default)(HolidayRegion, "getSupported", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
61
+ var _response$data;
62
+ var params,
63
+ options,
64
+ response,
65
+ _args = arguments;
66
+ return _regenerator.default.wrap(function (_context) {
67
+ while (1) switch (_context.prev = _context.next) {
68
+ case 0:
69
+ params = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
70
+ options = _args.length > 1 && _args[1] !== undefined ? _args[1] : {};
71
+ if (!(params.cursor && !(0, _utils.isString)(params.cursor))) {
72
+ _context.next = 1;
73
+ break;
74
+ }
75
+ throw new errors.InvalidParameterError("Bad parameter: cursor must be of type String, received ".concat((0, _utils.getType)(params.cursor)));
76
+ case 1:
77
+ if (!(params.per_page && !(0, _utils.isInt)(params.per_page))) {
78
+ _context.next = 2;
79
+ break;
80
+ }
81
+ throw new errors.InvalidParameterError("Bad parameter: per_page must be of type Int, received ".concat((0, _utils.getType)(params.per_page)));
82
+ case 2:
83
+ _context.next = 3;
84
+ return _Api.default.sendRequest('/holiday_regions/supported', 'GET', params, options);
85
+ case 3:
86
+ response = _context.sent;
87
+ return _context.abrupt("return", (response === null || response === void 0 || (_response$data = response.data) === null || _response$data === void 0 ? void 0 : _response$data.map(function (obj) {
88
+ return new _HolidayRegion(obj, options);
89
+ })) || []);
90
+ case 4:
91
+ case "end":
92
+ return _context.stop();
93
+ }
94
+ }, _callee);
95
+ })));
96
+ var _default = exports.default = HolidayRegion;
97
+ module.exports = HolidayRegion;
98
+ module.exports.default = HolidayRegion;
@@ -201,6 +201,13 @@ var Sync = /*#__PURE__*/(0, _createClass2.default)(function Sync() {
201
201
  (0, _defineProperty2.default)(this, "setScheduleTimeZone", function (value) {
202
202
  _this.attributes.schedule_time_zone = value;
203
203
  });
204
+ // string # If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
205
+ (0, _defineProperty2.default)(this, "getHolidayRegion", function () {
206
+ return _this.attributes.holiday_region;
207
+ });
208
+ (0, _defineProperty2.default)(this, "setHolidayRegion", function (value) {
209
+ _this.attributes.holiday_region = value;
210
+ });
204
211
  // Manually Run Sync
205
212
  (0, _defineProperty2.default)(this, "manualRun", /*#__PURE__*/(0, _asyncToGenerator2.default)(/*#__PURE__*/_regenerator.default.mark(function _callee() {
206
213
  var params,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.2.271",
3
+ "version": "1.2.272",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
package/src/Files.js CHANGED
@@ -6,7 +6,7 @@ let apiKey
6
6
  let baseUrl = 'https://app.files.com'
7
7
  let sessionId = null
8
8
  let language = null
9
- const version = '1.2.271'
9
+ const version = '1.2.272'
10
10
  let userAgent = `Files.com JavaScript SDK v${version}`
11
11
 
12
12
  let logLevel = LogLevel.INFO
@@ -294,6 +294,13 @@ class Automation {
294
294
  this.attributes.webhook_url = value
295
295
  }
296
296
 
297
+ // string # If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
298
+ getHolidayRegion = () => this.attributes.holiday_region
299
+
300
+ setHolidayRegion = value => {
301
+ this.attributes.holiday_region = value
302
+ }
303
+
297
304
  // Manually Run Automation
298
305
  manualRun = async (params = {}) => {
299
306
  if (!this.attributes.id) {
@@ -0,0 +1,58 @@
1
+ /* eslint-disable no-unused-vars */
2
+ import Api from '../Api'
3
+ import * as errors from '../Errors'
4
+ import {
5
+ getType, isArray, isInt, isObject, isString,
6
+ } from '../utils'
7
+ /* eslint-enable no-unused-vars */
8
+
9
+ /**
10
+ * Class HolidayRegion
11
+ */
12
+ class HolidayRegion {
13
+ attributes = {}
14
+
15
+ options = {}
16
+
17
+ constructor(attributes = {}, options = {}) {
18
+ Object.entries(attributes).forEach(([key, value]) => {
19
+ const normalizedKey = key.replace('?', '')
20
+
21
+ this.attributes[normalizedKey] = value
22
+
23
+ Object.defineProperty(this, normalizedKey, { value, writable: false })
24
+ })
25
+
26
+ this.options = { ...options }
27
+ }
28
+
29
+ isLoaded = () => !!this.attributes.id
30
+
31
+ // string # The code representing a region
32
+ getCode = () => this.attributes.code
33
+
34
+ // string # The name of the region
35
+ getName = () => this.attributes.name
36
+
37
+ // Parameters:
38
+ // 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.
39
+ // per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
40
+ static getSupported = async (params = {}, options = {}) => {
41
+ if (params.cursor && !isString(params.cursor)) {
42
+ throw new errors.InvalidParameterError(`Bad parameter: cursor must be of type String, received ${getType(params.cursor)}`)
43
+ }
44
+
45
+ if (params.per_page && !isInt(params.per_page)) {
46
+ throw new errors.InvalidParameterError(`Bad parameter: per_page must be of type Int, received ${getType(params.per_page)}`)
47
+ }
48
+
49
+ const response = await Api.sendRequest('/holiday_regions/supported', 'GET', params, options)
50
+
51
+ return response?.data?.map(obj => new HolidayRegion(obj, options)) || []
52
+ }
53
+ }
54
+
55
+ export default HolidayRegion
56
+
57
+ module.exports = HolidayRegion
58
+ module.exports.default = HolidayRegion
@@ -195,6 +195,13 @@ class Sync {
195
195
  this.attributes.schedule_time_zone = value
196
196
  }
197
197
 
198
+ // string # If trigger is `custom_schedule`, the Automation will check if there is a formal, observed holiday for the region, and if so, it will not run.
199
+ getHolidayRegion = () => this.attributes.holiday_region
200
+
201
+ setHolidayRegion = value => {
202
+ this.attributes.holiday_region = value
203
+ }
204
+
198
205
  // Manually Run Sync
199
206
  manualRun = async (params = {}) => {
200
207
  if (!this.attributes.id) {