files.com 1.2.526 → 1.2.528
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 +1 -1
- package/docs/models/AutomationRun.md +1 -1
- package/docs/models/Bundle.md +1 -1
- package/docs/models/File.md +73 -0
- package/docs/models/User.md +2 -2
- package/docs/models/ZipListEntry.md +13 -0
- package/lib/Files.js +1 -1
- package/lib/models/AutomationRun.js +1 -1
- package/lib/models/Bundle.js +1 -1
- package/lib/models/File.js +410 -215
- package/lib/models/User.js +2 -2
- package/lib/models/ZipListEntry.js +54 -0
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/AutomationRun.js +1 -1
- package/src/models/Bundle.js +1 -1
- package/src/models/File.js +106 -0
- package/src/models/User.js +2 -2
- package/src/models/ZipListEntry.js +41 -0
package/lib/models/User.js
CHANGED
|
@@ -1164,10 +1164,10 @@ _User = User;
|
|
|
1164
1164
|
// 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.
|
|
1165
1165
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
1166
1166
|
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `workspace_id`, `company`, `name`, `disabled`, `authenticate_until`, `username`, `email`, `last_desktop_login_at`, `last_login_at`, `site_admin`, `password_validity_days` or `ssl_required`.
|
|
1167
|
-
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `username`, `name`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until`, `not_site_admin`, `disabled`, `partner_id` or `workspace_id`. Valid field combinations are `[ site_admin, username ]`, `[ not_site_admin, username ]`, `[ workspace_id, username ]`, `[
|
|
1167
|
+
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `username`, `name`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until`, `not_site_admin`, `disabled`, `partner_id` or `workspace_id`. Valid field combinations are `[ site_admin, username ]`, `[ not_site_admin, username ]`, `[ workspace_id, username ]`, `[ workspace_id, disabled ]` or `[ workspace_id, disabled, username ]`.
|
|
1168
1168
|
// filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
|
|
1169
1169
|
// filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
|
|
1170
|
-
// filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `username`, `name`, `email` or `company`.
|
|
1170
|
+
// filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `username`, `name`, `email` or `company`.
|
|
1171
1171
|
// filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
|
|
1172
1172
|
// filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
|
|
1173
1173
|
// ids - string - comma-separated list of User IDs
|
|
@@ -0,0 +1,54 @@
|
|
|
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 ZipListEntry
|
|
20
|
+
*/
|
|
21
|
+
var ZipListEntry = /*#__PURE__*/(0, _createClass2.default)(function ZipListEntry() {
|
|
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, ZipListEntry);
|
|
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 # Entry path inside the ZIP. 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
|
+
// int64 # Uncompressed size in bytes.
|
|
36
|
+
(0, _defineProperty2.default)(this, "getSize", function () {
|
|
37
|
+
return _this.attributes.size;
|
|
38
|
+
});
|
|
39
|
+
Object.entries(attributes).forEach(function (_ref) {
|
|
40
|
+
var _ref2 = (0, _slicedToArray2.default)(_ref, 2),
|
|
41
|
+
key = _ref2[0],
|
|
42
|
+
value = _ref2[1];
|
|
43
|
+
var normalizedKey = key.replace('?', '');
|
|
44
|
+
_this.attributes[normalizedKey] = value;
|
|
45
|
+
Object.defineProperty(_this, normalizedKey, {
|
|
46
|
+
value: value,
|
|
47
|
+
writable: false
|
|
48
|
+
});
|
|
49
|
+
});
|
|
50
|
+
this.options = _objectSpread({}, options);
|
|
51
|
+
});
|
|
52
|
+
var _default = exports.default = ZipListEntry;
|
|
53
|
+
module.exports = ZipListEntry;
|
|
54
|
+
module.exports.default = ZipListEntry;
|
package/package.json
CHANGED
package/src/Files.js
CHANGED
|
@@ -75,7 +75,7 @@ class AutomationRun {
|
|
|
75
75
|
// 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.
|
|
76
76
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
77
77
|
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `automation_id`, `created_at` or `status`.
|
|
78
|
-
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `status`, `workspace_id` or `automation_id`. Valid field combinations are `[ automation_id, status ]`, `[ workspace_id, automation_id ]` or `[ workspace_id, automation_id, status ]`.
|
|
78
|
+
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `status`, `workspace_id` or `automation_id`. Valid field combinations are `[ workspace_id, status ]`, `[ automation_id, status ]`, `[ workspace_id, automation_id ]` or `[ workspace_id, automation_id, status ]`.
|
|
79
79
|
// automation_id (required) - int64 - ID of the associated Automation.
|
|
80
80
|
static list = async (params = {}, options = {}) => {
|
|
81
81
|
if (!params.automation_id) {
|
package/src/models/Bundle.js
CHANGED
|
@@ -556,7 +556,7 @@ class Bundle {
|
|
|
556
556
|
// 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.
|
|
557
557
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
558
558
|
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `expires_at`.
|
|
559
|
-
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `expires_at`, `code` or `user_id`. Valid field combinations are `[ user_id,
|
|
559
|
+
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `created_at`, `expires_at`, `code` or `user_id`. Valid field combinations are `[ user_id, expires_at ]`.
|
|
560
560
|
// filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `created_at` and `expires_at`.
|
|
561
561
|
// filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `created_at` and `expires_at`.
|
|
562
562
|
// filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `code`.
|
package/src/models/File.js
CHANGED
|
@@ -731,6 +731,35 @@ class File {
|
|
|
731
731
|
destroy = (params = {}) =>
|
|
732
732
|
this.delete(params)
|
|
733
733
|
|
|
734
|
+
// List the contents of a ZIP file
|
|
735
|
+
zipListContents = async (params = {}) => {
|
|
736
|
+
if (!this.attributes.path) {
|
|
737
|
+
throw new errors.EmptyPropertyError('Current object has no path')
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
if (!isObject(params)) {
|
|
741
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
params.path = this.attributes.path
|
|
745
|
+
if (params.path && !isString(params.path)) {
|
|
746
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params.path)}`)
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
if (!params.path) {
|
|
750
|
+
if (this.attributes.path) {
|
|
751
|
+
params.path = this.path
|
|
752
|
+
} else {
|
|
753
|
+
throw new errors.MissingParameterError('Parameter missing: path')
|
|
754
|
+
}
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
const response = await Api.sendRequest(`/file_actions/zip_list/${encodeURIComponent(params.path)}`, 'GET', params, this.options)
|
|
758
|
+
|
|
759
|
+
const ZipListEntry = require('./ZipListEntry.js').default
|
|
760
|
+
return response?.data?.map(obj => new ZipListEntry(obj, this.options)) || []
|
|
761
|
+
}
|
|
762
|
+
|
|
734
763
|
// Copy File/Folder
|
|
735
764
|
//
|
|
736
765
|
// Parameters:
|
|
@@ -822,6 +851,56 @@ class File {
|
|
|
822
851
|
return new FileAction(response?.data, this.options)
|
|
823
852
|
}
|
|
824
853
|
|
|
854
|
+
// Extract a ZIP file to a destination folder
|
|
855
|
+
//
|
|
856
|
+
// Parameters:
|
|
857
|
+
// destination (required) - string - Destination folder path for extracted files.
|
|
858
|
+
// filename - string - Optional single entry filename to extract.
|
|
859
|
+
// overwrite - boolean - Overwrite existing files in the destination?
|
|
860
|
+
unzip = async (params = {}) => {
|
|
861
|
+
if (!this.attributes.path) {
|
|
862
|
+
throw new errors.EmptyPropertyError('Current object has no path')
|
|
863
|
+
}
|
|
864
|
+
|
|
865
|
+
if (!isObject(params)) {
|
|
866
|
+
throw new errors.InvalidParameterError(`Bad parameter: params must be of type object, received ${getType(params)}`)
|
|
867
|
+
}
|
|
868
|
+
|
|
869
|
+
params.path = this.attributes.path
|
|
870
|
+
if (params.path && !isString(params.path)) {
|
|
871
|
+
throw new errors.InvalidParameterError(`Bad parameter: path must be of type String, received ${getType(params.path)}`)
|
|
872
|
+
}
|
|
873
|
+
|
|
874
|
+
if (params.destination && !isString(params.destination)) {
|
|
875
|
+
throw new errors.InvalidParameterError(`Bad parameter: destination must be of type String, received ${getType(params.destination)}`)
|
|
876
|
+
}
|
|
877
|
+
|
|
878
|
+
if (params.filename && !isString(params.filename)) {
|
|
879
|
+
throw new errors.InvalidParameterError(`Bad parameter: filename must be of type String, received ${getType(params.filename)}`)
|
|
880
|
+
}
|
|
881
|
+
|
|
882
|
+
if (!params.path) {
|
|
883
|
+
if (this.attributes.path) {
|
|
884
|
+
params.path = this.path
|
|
885
|
+
} else {
|
|
886
|
+
throw new errors.MissingParameterError('Parameter missing: path')
|
|
887
|
+
}
|
|
888
|
+
}
|
|
889
|
+
|
|
890
|
+
if (!params.destination) {
|
|
891
|
+
if (this.attributes.destination) {
|
|
892
|
+
params.destination = this.destination
|
|
893
|
+
} else {
|
|
894
|
+
throw new errors.MissingParameterError('Parameter missing: destination')
|
|
895
|
+
}
|
|
896
|
+
}
|
|
897
|
+
|
|
898
|
+
const response = await Api.sendRequest('/file_actions/unzip', 'POST', params, this.options)
|
|
899
|
+
|
|
900
|
+
const FileAction = require('./FileAction.js').default
|
|
901
|
+
return new FileAction(response?.data, this.options)
|
|
902
|
+
}
|
|
903
|
+
|
|
825
904
|
// Begin File Upload
|
|
826
905
|
//
|
|
827
906
|
// Parameters:
|
|
@@ -989,6 +1068,33 @@ class File {
|
|
|
989
1068
|
|
|
990
1069
|
static get = (path, params = {}, options = {}) =>
|
|
991
1070
|
File.find(path, params, options)
|
|
1071
|
+
|
|
1072
|
+
// Parameters:
|
|
1073
|
+
// paths (required) - array(string) - Paths to include in the ZIP.
|
|
1074
|
+
// destination (required) - string - Destination file path for the ZIP.
|
|
1075
|
+
// overwrite - boolean - Overwrite existing file in the destination?
|
|
1076
|
+
static zip = async (params = {}, options = {}) => {
|
|
1077
|
+
if (!params.paths) {
|
|
1078
|
+
throw new errors.MissingParameterError('Parameter missing: paths')
|
|
1079
|
+
}
|
|
1080
|
+
|
|
1081
|
+
if (!params.destination) {
|
|
1082
|
+
throw new errors.MissingParameterError('Parameter missing: destination')
|
|
1083
|
+
}
|
|
1084
|
+
|
|
1085
|
+
if (params.paths && !isArray(params.paths)) {
|
|
1086
|
+
throw new errors.InvalidParameterError(`Bad parameter: paths must be of type Array, received ${getType(params.paths)}`)
|
|
1087
|
+
}
|
|
1088
|
+
|
|
1089
|
+
if (params.destination && !isString(params.destination)) {
|
|
1090
|
+
throw new errors.InvalidParameterError(`Bad parameter: destination must be of type String, received ${getType(params.destination)}`)
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
const response = await Api.sendRequest('/file_actions/zip', 'POST', params, options)
|
|
1094
|
+
|
|
1095
|
+
const FileAction = require('./FileAction.js').default
|
|
1096
|
+
return new FileAction(response?.data, options)
|
|
1097
|
+
}
|
|
992
1098
|
}
|
|
993
1099
|
|
|
994
1100
|
export default File
|
package/src/models/User.js
CHANGED
|
@@ -949,10 +949,10 @@ class User {
|
|
|
949
949
|
// 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.
|
|
950
950
|
// per_page - int64 - Number of records to show per page. (Max: 10,000, 1,000 or less is recommended).
|
|
951
951
|
// sort_by - object - If set, sort records by the specified field in either `asc` or `desc` direction. Valid fields are `site_id`, `workspace_id`, `company`, `name`, `disabled`, `authenticate_until`, `username`, `email`, `last_desktop_login_at`, `last_login_at`, `site_admin`, `password_validity_days` or `ssl_required`.
|
|
952
|
-
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `username`, `name`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until`, `not_site_admin`, `disabled`, `partner_id` or `workspace_id`. Valid field combinations are `[ site_admin, username ]`, `[ not_site_admin, username ]`, `[ workspace_id, username ]`, `[
|
|
952
|
+
// filter - object - If set, return records where the specified field is equal to the supplied value. Valid fields are `username`, `name`, `email`, `company`, `site_admin`, `password_validity_days`, `ssl_required`, `last_login_at`, `authenticate_until`, `not_site_admin`, `disabled`, `partner_id` or `workspace_id`. Valid field combinations are `[ site_admin, username ]`, `[ not_site_admin, username ]`, `[ workspace_id, username ]`, `[ workspace_id, disabled ]` or `[ workspace_id, disabled, username ]`.
|
|
953
953
|
// filter_gt - object - If set, return records where the specified field is greater than the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
|
|
954
954
|
// filter_gteq - object - If set, return records where the specified field is greater than or equal the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
|
|
955
|
-
// filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `username`, `name`, `email` or `company`.
|
|
955
|
+
// filter_prefix - object - If set, return records where the specified field is prefixed by the supplied value. Valid fields are `username`, `name`, `email` or `company`.
|
|
956
956
|
// filter_lt - object - If set, return records where the specified field is less than the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
|
|
957
957
|
// filter_lteq - object - If set, return records where the specified field is less than or equal the supplied value. Valid fields are `password_validity_days`, `last_login_at` or `authenticate_until`.
|
|
958
958
|
// ids - string - comma-separated list of User IDs
|
|
@@ -0,0 +1,41 @@
|
|
|
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 ZipListEntry
|
|
11
|
+
*/
|
|
12
|
+
class ZipListEntry {
|
|
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 # Entry path inside the ZIP. This must be slash-delimited, but it must neither start nor end with a slash. Maximum of 5000 characters.
|
|
32
|
+
getPath = () => this.attributes.path
|
|
33
|
+
|
|
34
|
+
// int64 # Uncompressed size in bytes.
|
|
35
|
+
getSize = () => this.attributes.size
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
export default ZipListEntry
|
|
39
|
+
|
|
40
|
+
module.exports = ZipListEntry
|
|
41
|
+
module.exports.default = ZipListEntry
|