files.com 1.0.212 → 1.0.214
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/Errors.md +1 -0
- package/lib/Api.js +9 -3
- package/lib/Errors.js +728 -708
- package/lib/Files.js +7 -0
- package/lib/models/File.js +35 -33
- package/package.json +1 -1
- package/src/Api.js +10 -3
- package/src/Errors.js +1 -0
- package/src/Files.js +4 -0
- package/src/models/File.js +20 -20
- package/test/src/index.js +2 -0
package/_VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
1.0.
|
1
|
+
1.0.214
|
package/docs/Errors.md
CHANGED
@@ -55,6 +55,7 @@ These errors are derived from the error groups listed above.
|
|
55
55
|
### BadRequest_FolderMustNotBeAFileError
|
56
56
|
### BadRequest_InvalidBodyError
|
57
57
|
### BadRequest_InvalidCursorError
|
58
|
+
### BadRequest_InvalidCursorTypeForSortError
|
58
59
|
### BadRequest_InvalidEtagsError
|
59
60
|
### BadRequest_InvalidFilterCombinationError
|
60
61
|
### BadRequest_InvalidFilterFieldError
|
package/lib/Api.js
CHANGED
@@ -76,7 +76,11 @@ var Api = /*#__PURE__*/(0, _createClass2.default)(function Api() {
|
|
76
76
|
|
77
77
|
_Logger.default.debug("Sending request: ".concat(verb, " ").concat(url));
|
78
78
|
|
79
|
-
_Logger.default.debug('Sending options:', options)
|
79
|
+
_Logger.default.debug('Sending options:', _objectSpread(_objectSpread({}, options), {}, {
|
80
|
+
headers: _objectSpread(_objectSpread({}, options.headers), {}, {
|
81
|
+
'X-FilesAPI-Key': '<redacted>'
|
82
|
+
})
|
83
|
+
}));
|
80
84
|
|
81
85
|
Api._configureAutoRetry();
|
82
86
|
|
@@ -137,13 +141,15 @@ var Api = /*#__PURE__*/(0, _createClass2.default)(function Api() {
|
|
137
141
|
});
|
138
142
|
(0, _defineProperty2.default)(Api, "_autoPaginate", /*#__PURE__*/function () {
|
139
143
|
var _ref2 = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(path, verb, params, options, response, metadata) {
|
144
|
+
var _options$autoPaginate;
|
145
|
+
|
140
146
|
var _response$headers, nextCursor, _ref3, autoPaginateCount, previousAutoPaginateData, nextPage, nextParams, nextMetadata;
|
141
147
|
|
142
148
|
return _regenerator.default.wrap(function _callee2$(_context2) {
|
143
149
|
while (1) {
|
144
150
|
switch (_context2.prev = _context2.next) {
|
145
151
|
case 0:
|
146
|
-
if (!_Files.default.getAutoPaginate()) {
|
152
|
+
if (!((_options$autoPaginate = options.autoPaginate) !== null && _options$autoPaginate !== void 0 ? _options$autoPaginate : _Files.default.getAutoPaginate())) {
|
147
153
|
_context2.next = 12;
|
148
154
|
break;
|
149
155
|
}
|
@@ -219,7 +225,7 @@ var Api = /*#__PURE__*/(0, _createClass2.default)(function Api() {
|
|
219
225
|
headers = _objectSpread(_objectSpread({
|
220
226
|
Accept: 'application/json'
|
221
227
|
}, options.headers), {}, {
|
222
|
-
'User-Agent':
|
228
|
+
'User-Agent': _Files.default.getUserAgent()
|
223
229
|
});
|
224
230
|
isExternal = /^[a-zA-Z]+:\/\//.test(path);
|
225
231
|
|