files.com 1.0.201 → 1.0.204

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.201
1
+ 1.0.204
package/docs/Errors.md CHANGED
@@ -176,6 +176,7 @@ These errors are derived from the error groups listed above.
176
176
  ### RateLimited_TooManyConcurrentRequestsError
177
177
  ### RateLimited_TooManyLoginAttemptsError
178
178
  ### RateLimited_TooManyRequestsError
179
+ ### RateLimited_TooManySharesError
179
180
  ### ServiceUnavailable_UploadsUnavailableError
180
181
  ### SiteConfiguration_AccountAlreadyExistsError
181
182
  ### SiteConfiguration_AccountOverdueError
package/lib/Api.js CHANGED
@@ -203,6 +203,7 @@ var Api = /*#__PURE__*/(0, _createClass2.default)(function Api() {
203
203
  sessionId,
204
204
  isCreatingSession,
205
205
  apiKey,
206
+ updatedOptions,
206
207
  requestPath,
207
208
  hasParams,
208
209
  pairs,
@@ -215,8 +216,9 @@ var Api = /*#__PURE__*/(0, _createClass2.default)(function Api() {
215
216
  params = _args3.length > 2 && _args3[2] !== undefined ? _args3[2] : null;
216
217
  options = _args3.length > 3 && _args3[3] !== undefined ? _args3[3] : {};
217
218
  metadata = _args3.length > 4 && _args3[4] !== undefined ? _args3[4] : null;
218
- headers = _objectSpread(_objectSpread({}, options.headers), {}, {
219
- Accept: 'application/json',
219
+ headers = _objectSpread(_objectSpread({
220
+ Accept: 'application/json'
221
+ }, options.headers), {}, {
220
222
  'User-Agent': 'Files.com JavaScript SDK v1.0'
221
223
  });
222
224
  isExternal = /^[a-zA-Z]+:\/\//.test(path);
@@ -258,6 +260,9 @@ var Api = /*#__PURE__*/(0, _createClass2.default)(function Api() {
258
260
  headers['X-FilesAPI-Key'] = apiKey;
259
261
 
260
262
  case 17:
263
+ updatedOptions = _objectSpread(_objectSpread({}, options), {}, {
264
+ headers: headers
265
+ });
261
266
  requestPath = path;
262
267
  hasParams = (0, _utils.isObject)(params) && !(0, _utils.isEmpty)(params);
263
268
 
@@ -273,17 +278,15 @@ var Api = /*#__PURE__*/(0, _createClass2.default)(function Api() {
273
278
  requestPath += path.includes('?') ? '&' : '?';
274
279
  requestPath += pairs.join('&');
275
280
  } else {
276
- options.data = JSON.stringify(params);
281
+ updatedOptions.data = JSON.stringify(params);
277
282
  headers['Content-Type'] = 'application/json';
278
283
  }
279
284
  }
280
285
 
281
- options.headers = headers;
282
-
283
286
  if (_Files.default.shouldDebugRequest()) {
284
287
  _Logger.default.debug('Request Options:');
285
288
 
286
- _Logger.default.debug(_objectSpread(_objectSpread({}, options), {}, {
289
+ _Logger.default.debug(_objectSpread(_objectSpread({}, updatedOptions), {}, {
287
290
  data: hasParams ? "payload keys: ".concat(Object.keys(params).join(', ')) : '(none)',
288
291
  headers: _objectSpread(_objectSpread({}, headers), {}, {
289
292
  'X-FilesAPI-Key': '<redacted>'
@@ -292,11 +295,11 @@ var Api = /*#__PURE__*/(0, _createClass2.default)(function Api() {
292
295
  }
293
296
 
294
297
  _context3.next = 24;
295
- return Api._sendVerbatim(requestPath, verb, options);
298
+ return Api._sendVerbatim(requestPath, verb, updatedOptions);
296
299
 
297
300
  case 24:
298
301
  response = _context3.sent;
299
- return _context3.abrupt("return", Api._autoPaginate(path, verb, params, options, response, metadata));
302
+ return _context3.abrupt("return", Api._autoPaginate(path, verb, params, updatedOptions, response, metadata));
300
303
 
301
304
  case 26:
302
305
  case "end":
package/lib/Errors.js CHANGED
@@ -4,7 +4,7 @@ var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefau
4
4
 
5
5
  exports.__esModule = true;
6
6
  exports.NotFound_SiteNotFoundError = exports.NotFound_PlanNotFoundError = exports.NotFound_NestedNotFoundError = exports.NotFound_InboxNotFoundError = exports.NotFound_GroupNotFoundError = exports.NotFound_FolderNotFoundError = exports.NotFound_FileUploadNotFoundError = exports.NotFound_FileNotFoundError = exports.NotFound_CodeNotFoundError = exports.NotFound_BundlePathNotFoundError = exports.NotFound_ApiKeyNotFoundError = exports.NotFoundError = exports.NotAuthorized_ZipDownloadIpMismatchError = exports.NotAuthorized_WritePermissionRequiredError = exports.NotAuthorized_UserIdWithoutSiteAdminError = exports.NotAuthorized_TwoFactorAuthenticationRequiredError = exports.NotAuthorized_SiteFilesAreImmutableError = exports.NotAuthorized_SiteAdminRequiredError = exports.NotAuthorized_SelfManagedRequiredError = exports.NotAuthorized_ReauthenticationNeededActionError = exports.NotAuthorized_ReauthenticationFailedFinalError = exports.NotAuthorized_ReauthenticationFailedError = exports.NotAuthorized_ReadPermissionRequiredError = exports.NotAuthorized_ReadOnlySessionError = exports.NotAuthorized_PasswordChangeRequiredError = exports.NotAuthorized_PasswordChangeNotRequiredError = exports.NotAuthorized_NotAllowedToCreateBundleError = exports.NotAuthorized_NonAdminsMustQueryByFolderOrPathError = exports.NotAuthorized_NeedAdminPermissionForInboxError = exports.NotAuthorized_MustAuthenticateWithApiKeyError = exports.NotAuthorized_InsufficientPermissionForParamsError = exports.NotAuthorized_HistoryPermissionRequiredError = exports.NotAuthorized_FullPermissionRequiredError = exports.NotAuthorized_FolderAdminPermissionRequiredError = exports.NotAuthorized_FolderAdminOrBillingPermissionRequiredError = exports.NotAuthorized_ContactAdminForPasswordChangeHelpError = exports.NotAuthorized_CantActForOtherUserError = exports.NotAuthorized_CannotLoginWhileUsingKeyError = exports.NotAuthorized_BundleMaximumUsesReachedError = exports.NotAuthorized_BillingPermissionRequiredError = exports.NotAuthorized_ApiKeyOnlyForOfficeIntegrationError = exports.NotAuthorized_ApiKeyOnlyForMobileAppError = exports.NotAuthorized_ApiKeyOnlyForDesktopAppError = exports.NotAuthorized_ApiKeyIsPathRestrictedError = exports.NotAuthorized_ApiKeyIsDisabledError = exports.NotAuthorizedError = exports.NotAuthenticated_TwoFactorAuthenticationSetupExpiredError = exports.NotAuthenticated_TwoFactorAuthenticationErrorError = exports.NotAuthenticated_OneTimePasswordIncorrectError = exports.NotAuthenticated_LockoutRegionMismatchError = exports.NotAuthenticated_LockedOutError = exports.NotAuthenticated_InvalidUsernameOrPasswordError = exports.NotAuthenticated_InvalidOrExpiredCodeError = exports.NotAuthenticated_InvalidOauthError = exports.NotAuthenticated_InvalidCredentialsError = exports.NotAuthenticated_InboxRegistrationCodeFailedError = exports.NotAuthenticated_BundleRegistrationCodeFailedError = exports.NotAuthenticated_AuthenticationRequiredError = exports.NotAuthenticatedError = exports.MissingParameterError = exports.InvalidParameterError = exports.FilesError = exports.FilesApiError = exports.EmptyPropertyError = exports.ConfigurationError = exports.BadRequest_UserRequiredError = exports.BadRequest_UserIdOnUserEndpointError = exports.BadRequest_UserIdInvalidError = exports.BadRequest_UnsupportedMediaTypeError = exports.BadRequest_UnsupportedHttpResponseFormatError = exports.BadRequest_UnsupportedCurrencyError = exports.BadRequest_SearchAllOnChildPathError = exports.BadRequest_RequestParamsRequiredError = exports.BadRequest_RequestParamsInvalidError = exports.BadRequest_RequestParamsContainInvalidCharacterError = exports.BadRequest_RequestParamPathCannotHaveTrailingWhitespaceError = exports.BadRequest_ReauthenticationNeededFieldsError = exports.BadRequest_PartNumberTooLargeError = exports.BadRequest_OperationOnNonScimResourceError = exports.BadRequest_NoValidInputParamsError = exports.BadRequest_MethodNotAllowedError = exports.BadRequest_InvalidUploadPartSizeError = exports.BadRequest_InvalidUploadPartGapError = exports.BadRequest_InvalidUploadOffsetError = exports.BadRequest_InvalidReturnToUrlError = exports.BadRequest_InvalidOauthProviderError = exports.BadRequest_InvalidInterfaceError = exports.BadRequest_InvalidInputEncodingError = exports.BadRequest_InvalidFilterFieldError = exports.BadRequest_InvalidFilterCombinationError = exports.BadRequest_InvalidEtagsError = exports.BadRequest_InvalidCursorError = exports.BadRequest_InvalidBodyError = exports.BadRequest_FolderMustNotBeAFileError = exports.BadRequest_DestinationSameError = exports.BadRequest_DatetimeParseError = exports.BadRequest_CantMoveWithMultipleLocationsError = exports.BadRequest_CannotDownloadDirectoryError = exports.BadRequest_AttachmentTooLargeError = exports.BadRequestError = void 0;
7
- exports.handleErrorResponse = exports.SiteConfiguration_UserRequestsEnabledRequiredError = exports.SiteConfiguration_TrialLockedError = exports.SiteConfiguration_TrialExpiredError = exports.SiteConfiguration_SiteWasRemovedError = exports.SiteConfiguration_NoAccountForSiteError = exports.SiteConfiguration_AccountOverdueError = exports.SiteConfiguration_AccountAlreadyExistsError = exports.SiteConfigurationError = exports.ServiceUnavailable_UploadsUnavailableError = exports.ServiceUnavailableError = exports.RateLimited_TooManyRequestsError = exports.RateLimited_TooManyLoginAttemptsError = exports.RateLimited_TooManyConcurrentRequestsError = exports.RateLimited_ReauthenticationRateLimitedError = exports.RateLimitedError = exports.ProcessingFailure_UpdatesNotAllowedForRemotesError = exports.ProcessingFailure_TwoFactorAuthenticationCodeAlreadySentError = exports.ProcessingFailure_SubfolderLockedError = exports.ProcessingFailure_ResourceLockedError = exports.ProcessingFailure_RemoteServerErrorError = exports.ProcessingFailure_RecipientAlreadySharedError = exports.ProcessingFailure_PathTooLongError = exports.ProcessingFailure_MultipleProcessingErrorsError = exports.ProcessingFailure_MultipartUploadsRequiredForRemotesError = exports.ProcessingFailure_ModelSaveErrorError = exports.ProcessingFailure_InvalidRangeError = exports.ProcessingFailure_InvalidFilenameError = exports.ProcessingFailure_InvalidFileTypeError = exports.ProcessingFailure_InvalidBundleCodeError = exports.ProcessingFailure_HistoryUnavailableError = exports.ProcessingFailure_FolderNotEmptyError = exports.ProcessingFailure_FolderLockedError = exports.ProcessingFailure_FileUploadedToWrongRegionError = exports.ProcessingFailure_FileTooBigToEncryptError = exports.ProcessingFailure_FileTooBigToDecryptError = exports.ProcessingFailure_FilePendingProcessingError = exports.ProcessingFailure_FileNotUploadedError = exports.ProcessingFailure_FileLockedError = exports.ProcessingFailure_FailedToChangePasswordError = exports.ProcessingFailure_ExportNotReadyError = exports.ProcessingFailure_ExportFailureError = exports.ProcessingFailure_ExpiredPublicKeyError = exports.ProcessingFailure_ExpiredPrivateKeyError = exports.ProcessingFailure_DestinationParentDoesNotExistError = exports.ProcessingFailure_DestinationParentConflictError = exports.ProcessingFailure_DestinationFolderLimitedError = exports.ProcessingFailure_DestinationExistsError = exports.ProcessingFailure_CouldNotCreateParentError = exports.ProcessingFailure_BundleOnlyAllowsPreviewsError = exports.ProcessingFailureError = exports.NotImplementedError = exports.NotFound_UserNotFoundError = void 0;
7
+ exports.handleErrorResponse = exports.SiteConfiguration_UserRequestsEnabledRequiredError = exports.SiteConfiguration_TrialLockedError = exports.SiteConfiguration_TrialExpiredError = exports.SiteConfiguration_SiteWasRemovedError = exports.SiteConfiguration_NoAccountForSiteError = exports.SiteConfiguration_AccountOverdueError = exports.SiteConfiguration_AccountAlreadyExistsError = exports.SiteConfigurationError = exports.ServiceUnavailable_UploadsUnavailableError = exports.ServiceUnavailableError = exports.RateLimited_TooManySharesError = exports.RateLimited_TooManyRequestsError = exports.RateLimited_TooManyLoginAttemptsError = exports.RateLimited_TooManyConcurrentRequestsError = exports.RateLimited_ReauthenticationRateLimitedError = exports.RateLimitedError = exports.ProcessingFailure_UpdatesNotAllowedForRemotesError = exports.ProcessingFailure_TwoFactorAuthenticationCodeAlreadySentError = exports.ProcessingFailure_SubfolderLockedError = exports.ProcessingFailure_ResourceLockedError = exports.ProcessingFailure_RemoteServerErrorError = exports.ProcessingFailure_RecipientAlreadySharedError = exports.ProcessingFailure_PathTooLongError = exports.ProcessingFailure_MultipleProcessingErrorsError = exports.ProcessingFailure_MultipartUploadsRequiredForRemotesError = exports.ProcessingFailure_ModelSaveErrorError = exports.ProcessingFailure_InvalidRangeError = exports.ProcessingFailure_InvalidFilenameError = exports.ProcessingFailure_InvalidFileTypeError = exports.ProcessingFailure_InvalidBundleCodeError = exports.ProcessingFailure_HistoryUnavailableError = exports.ProcessingFailure_FolderNotEmptyError = exports.ProcessingFailure_FolderLockedError = exports.ProcessingFailure_FileUploadedToWrongRegionError = exports.ProcessingFailure_FileTooBigToEncryptError = exports.ProcessingFailure_FileTooBigToDecryptError = exports.ProcessingFailure_FilePendingProcessingError = exports.ProcessingFailure_FileNotUploadedError = exports.ProcessingFailure_FileLockedError = exports.ProcessingFailure_FailedToChangePasswordError = exports.ProcessingFailure_ExportNotReadyError = exports.ProcessingFailure_ExportFailureError = exports.ProcessingFailure_ExpiredPublicKeyError = exports.ProcessingFailure_ExpiredPrivateKeyError = exports.ProcessingFailure_DestinationParentDoesNotExistError = exports.ProcessingFailure_DestinationParentConflictError = exports.ProcessingFailure_DestinationFolderLimitedError = exports.ProcessingFailure_DestinationExistsError = exports.ProcessingFailure_CouldNotCreateParentError = exports.ProcessingFailure_BundleOnlyAllowsPreviewsError = exports.ProcessingFailureError = exports.NotImplementedError = exports.NotFound_UserNotFoundError = void 0;
8
8
 
9
9
  var _slicedToArray2 = _interopRequireDefault(require("@babel/runtime/helpers/slicedToArray"));
10
10
 
@@ -2968,18 +2968,38 @@ var RateLimited_TooManyRequestsError = /*#__PURE__*/function (_RateLimitedError4
2968
2968
  exports.RateLimited_TooManyRequestsError = RateLimited_TooManyRequestsError;
2969
2969
  errorClasses.RateLimited_TooManyRequestsError = RateLimited_TooManyRequestsError;
2970
2970
 
2971
+ var RateLimited_TooManySharesError = /*#__PURE__*/function (_RateLimitedError5) {
2972
+ (0, _inherits2.default)(RateLimited_TooManySharesError, _RateLimitedError5);
2973
+
2974
+ var _super145 = _createSuper(RateLimited_TooManySharesError);
2975
+
2976
+ function RateLimited_TooManySharesError(message, code) {
2977
+ var _this145;
2978
+
2979
+ (0, _classCallCheck2.default)(this, RateLimited_TooManySharesError);
2980
+ _this145 = _super145.call(this, message, code);
2981
+ _this145.name = 'RateLimited_TooManySharesError';
2982
+ return _this145;
2983
+ }
2984
+
2985
+ return (0, _createClass2.default)(RateLimited_TooManySharesError);
2986
+ }(RateLimitedError);
2987
+
2988
+ exports.RateLimited_TooManySharesError = RateLimited_TooManySharesError;
2989
+ errorClasses.RateLimited_TooManySharesError = RateLimited_TooManySharesError;
2990
+
2971
2991
  var ServiceUnavailable_UploadsUnavailableError = /*#__PURE__*/function (_ServiceUnavailableEr) {
2972
2992
  (0, _inherits2.default)(ServiceUnavailable_UploadsUnavailableError, _ServiceUnavailableEr);
2973
2993
 
2974
- var _super145 = _createSuper(ServiceUnavailable_UploadsUnavailableError);
2994
+ var _super146 = _createSuper(ServiceUnavailable_UploadsUnavailableError);
2975
2995
 
2976
2996
  function ServiceUnavailable_UploadsUnavailableError(message, code) {
2977
- var _this145;
2997
+ var _this146;
2978
2998
 
2979
2999
  (0, _classCallCheck2.default)(this, ServiceUnavailable_UploadsUnavailableError);
2980
- _this145 = _super145.call(this, message, code);
2981
- _this145.name = 'ServiceUnavailable_UploadsUnavailableError';
2982
- return _this145;
3000
+ _this146 = _super146.call(this, message, code);
3001
+ _this146.name = 'ServiceUnavailable_UploadsUnavailableError';
3002
+ return _this146;
2983
3003
  }
2984
3004
 
2985
3005
  return (0, _createClass2.default)(ServiceUnavailable_UploadsUnavailableError);
@@ -2991,15 +3011,15 @@ errorClasses.ServiceUnavailable_UploadsUnavailableError = ServiceUnavailable_Upl
2991
3011
  var SiteConfiguration_AccountAlreadyExistsError = /*#__PURE__*/function (_SiteConfigurationErr) {
2992
3012
  (0, _inherits2.default)(SiteConfiguration_AccountAlreadyExistsError, _SiteConfigurationErr);
2993
3013
 
2994
- var _super146 = _createSuper(SiteConfiguration_AccountAlreadyExistsError);
3014
+ var _super147 = _createSuper(SiteConfiguration_AccountAlreadyExistsError);
2995
3015
 
2996
3016
  function SiteConfiguration_AccountAlreadyExistsError(message, code) {
2997
- var _this146;
3017
+ var _this147;
2998
3018
 
2999
3019
  (0, _classCallCheck2.default)(this, SiteConfiguration_AccountAlreadyExistsError);
3000
- _this146 = _super146.call(this, message, code);
3001
- _this146.name = 'SiteConfiguration_AccountAlreadyExistsError';
3002
- return _this146;
3020
+ _this147 = _super147.call(this, message, code);
3021
+ _this147.name = 'SiteConfiguration_AccountAlreadyExistsError';
3022
+ return _this147;
3003
3023
  }
3004
3024
 
3005
3025
  return (0, _createClass2.default)(SiteConfiguration_AccountAlreadyExistsError);
@@ -3011,15 +3031,15 @@ errorClasses.SiteConfiguration_AccountAlreadyExistsError = SiteConfiguration_Acc
3011
3031
  var SiteConfiguration_AccountOverdueError = /*#__PURE__*/function (_SiteConfigurationErr2) {
3012
3032
  (0, _inherits2.default)(SiteConfiguration_AccountOverdueError, _SiteConfigurationErr2);
3013
3033
 
3014
- var _super147 = _createSuper(SiteConfiguration_AccountOverdueError);
3034
+ var _super148 = _createSuper(SiteConfiguration_AccountOverdueError);
3015
3035
 
3016
3036
  function SiteConfiguration_AccountOverdueError(message, code) {
3017
- var _this147;
3037
+ var _this148;
3018
3038
 
3019
3039
  (0, _classCallCheck2.default)(this, SiteConfiguration_AccountOverdueError);
3020
- _this147 = _super147.call(this, message, code);
3021
- _this147.name = 'SiteConfiguration_AccountOverdueError';
3022
- return _this147;
3040
+ _this148 = _super148.call(this, message, code);
3041
+ _this148.name = 'SiteConfiguration_AccountOverdueError';
3042
+ return _this148;
3023
3043
  }
3024
3044
 
3025
3045
  return (0, _createClass2.default)(SiteConfiguration_AccountOverdueError);
@@ -3031,15 +3051,15 @@ errorClasses.SiteConfiguration_AccountOverdueError = SiteConfiguration_AccountOv
3031
3051
  var SiteConfiguration_NoAccountForSiteError = /*#__PURE__*/function (_SiteConfigurationErr3) {
3032
3052
  (0, _inherits2.default)(SiteConfiguration_NoAccountForSiteError, _SiteConfigurationErr3);
3033
3053
 
3034
- var _super148 = _createSuper(SiteConfiguration_NoAccountForSiteError);
3054
+ var _super149 = _createSuper(SiteConfiguration_NoAccountForSiteError);
3035
3055
 
3036
3056
  function SiteConfiguration_NoAccountForSiteError(message, code) {
3037
- var _this148;
3057
+ var _this149;
3038
3058
 
3039
3059
  (0, _classCallCheck2.default)(this, SiteConfiguration_NoAccountForSiteError);
3040
- _this148 = _super148.call(this, message, code);
3041
- _this148.name = 'SiteConfiguration_NoAccountForSiteError';
3042
- return _this148;
3060
+ _this149 = _super149.call(this, message, code);
3061
+ _this149.name = 'SiteConfiguration_NoAccountForSiteError';
3062
+ return _this149;
3043
3063
  }
3044
3064
 
3045
3065
  return (0, _createClass2.default)(SiteConfiguration_NoAccountForSiteError);
@@ -3051,15 +3071,15 @@ errorClasses.SiteConfiguration_NoAccountForSiteError = SiteConfiguration_NoAccou
3051
3071
  var SiteConfiguration_SiteWasRemovedError = /*#__PURE__*/function (_SiteConfigurationErr4) {
3052
3072
  (0, _inherits2.default)(SiteConfiguration_SiteWasRemovedError, _SiteConfigurationErr4);
3053
3073
 
3054
- var _super149 = _createSuper(SiteConfiguration_SiteWasRemovedError);
3074
+ var _super150 = _createSuper(SiteConfiguration_SiteWasRemovedError);
3055
3075
 
3056
3076
  function SiteConfiguration_SiteWasRemovedError(message, code) {
3057
- var _this149;
3077
+ var _this150;
3058
3078
 
3059
3079
  (0, _classCallCheck2.default)(this, SiteConfiguration_SiteWasRemovedError);
3060
- _this149 = _super149.call(this, message, code);
3061
- _this149.name = 'SiteConfiguration_SiteWasRemovedError';
3062
- return _this149;
3080
+ _this150 = _super150.call(this, message, code);
3081
+ _this150.name = 'SiteConfiguration_SiteWasRemovedError';
3082
+ return _this150;
3063
3083
  }
3064
3084
 
3065
3085
  return (0, _createClass2.default)(SiteConfiguration_SiteWasRemovedError);
@@ -3071,15 +3091,15 @@ errorClasses.SiteConfiguration_SiteWasRemovedError = SiteConfiguration_SiteWasRe
3071
3091
  var SiteConfiguration_TrialExpiredError = /*#__PURE__*/function (_SiteConfigurationErr5) {
3072
3092
  (0, _inherits2.default)(SiteConfiguration_TrialExpiredError, _SiteConfigurationErr5);
3073
3093
 
3074
- var _super150 = _createSuper(SiteConfiguration_TrialExpiredError);
3094
+ var _super151 = _createSuper(SiteConfiguration_TrialExpiredError);
3075
3095
 
3076
3096
  function SiteConfiguration_TrialExpiredError(message, code) {
3077
- var _this150;
3097
+ var _this151;
3078
3098
 
3079
3099
  (0, _classCallCheck2.default)(this, SiteConfiguration_TrialExpiredError);
3080
- _this150 = _super150.call(this, message, code);
3081
- _this150.name = 'SiteConfiguration_TrialExpiredError';
3082
- return _this150;
3100
+ _this151 = _super151.call(this, message, code);
3101
+ _this151.name = 'SiteConfiguration_TrialExpiredError';
3102
+ return _this151;
3083
3103
  }
3084
3104
 
3085
3105
  return (0, _createClass2.default)(SiteConfiguration_TrialExpiredError);
@@ -3091,15 +3111,15 @@ errorClasses.SiteConfiguration_TrialExpiredError = SiteConfiguration_TrialExpire
3091
3111
  var SiteConfiguration_TrialLockedError = /*#__PURE__*/function (_SiteConfigurationErr6) {
3092
3112
  (0, _inherits2.default)(SiteConfiguration_TrialLockedError, _SiteConfigurationErr6);
3093
3113
 
3094
- var _super151 = _createSuper(SiteConfiguration_TrialLockedError);
3114
+ var _super152 = _createSuper(SiteConfiguration_TrialLockedError);
3095
3115
 
3096
3116
  function SiteConfiguration_TrialLockedError(message, code) {
3097
- var _this151;
3117
+ var _this152;
3098
3118
 
3099
3119
  (0, _classCallCheck2.default)(this, SiteConfiguration_TrialLockedError);
3100
- _this151 = _super151.call(this, message, code);
3101
- _this151.name = 'SiteConfiguration_TrialLockedError';
3102
- return _this151;
3120
+ _this152 = _super152.call(this, message, code);
3121
+ _this152.name = 'SiteConfiguration_TrialLockedError';
3122
+ return _this152;
3103
3123
  }
3104
3124
 
3105
3125
  return (0, _createClass2.default)(SiteConfiguration_TrialLockedError);
@@ -3111,15 +3131,15 @@ errorClasses.SiteConfiguration_TrialLockedError = SiteConfiguration_TrialLockedE
3111
3131
  var SiteConfiguration_UserRequestsEnabledRequiredError = /*#__PURE__*/function (_SiteConfigurationErr7) {
3112
3132
  (0, _inherits2.default)(SiteConfiguration_UserRequestsEnabledRequiredError, _SiteConfigurationErr7);
3113
3133
 
3114
- var _super152 = _createSuper(SiteConfiguration_UserRequestsEnabledRequiredError);
3134
+ var _super153 = _createSuper(SiteConfiguration_UserRequestsEnabledRequiredError);
3115
3135
 
3116
3136
  function SiteConfiguration_UserRequestsEnabledRequiredError(message, code) {
3117
- var _this152;
3137
+ var _this153;
3118
3138
 
3119
3139
  (0, _classCallCheck2.default)(this, SiteConfiguration_UserRequestsEnabledRequiredError);
3120
- _this152 = _super152.call(this, message, code);
3121
- _this152.name = 'SiteConfiguration_UserRequestsEnabledRequiredError';
3122
- return _this152;
3140
+ _this153 = _super153.call(this, message, code);
3141
+ _this153.name = 'SiteConfiguration_UserRequestsEnabledRequiredError';
3142
+ return _this153;
3123
3143
  }
3124
3144
 
3125
3145
  return (0, _createClass2.default)(SiteConfiguration_UserRequestsEnabledRequiredError);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "files.com",
3
- "version": "1.0.201",
3
+ "version": "1.0.204",
4
4
  "description": "Files.com SDK for JavaScript",
5
5
  "keywords": [
6
6
  "files.com",
package/src/Api.js CHANGED
@@ -117,8 +117,8 @@ class Api {
117
117
 
118
118
  static sendRequest = async (path, verb, params = null, options = {}, metadata = null) => {
119
119
  const headers = {
120
- ...options.headers,
121
120
  Accept: 'application/json',
121
+ ...options.headers,
122
122
  'User-Agent': 'Files.com JavaScript SDK v1.0',
123
123
  }
124
124
 
@@ -145,6 +145,11 @@ class Api {
145
145
  }
146
146
  }
147
147
 
148
+ const updatedOptions = {
149
+ ...options,
150
+ headers,
151
+ }
152
+
148
153
  let requestPath = path
149
154
  const hasParams = isObject(params) && !isEmpty(params)
150
155
 
@@ -154,17 +159,15 @@ class Api {
154
159
  requestPath += path.includes('?') ? '&' : '?'
155
160
  requestPath += pairs.join('&')
156
161
  } else {
157
- options.data = JSON.stringify(params)
162
+ updatedOptions.data = JSON.stringify(params)
158
163
  headers['Content-Type'] = 'application/json'
159
164
  }
160
165
  }
161
166
 
162
- options.headers = headers
163
-
164
167
  if (Files.shouldDebugRequest()) {
165
168
  Logger.debug('Request Options:')
166
169
  Logger.debug({
167
- ...options,
170
+ ...updatedOptions,
168
171
  data: hasParams
169
172
  ? `payload keys: ${Object.keys(params).join(', ')}`
170
173
  : '(none)',
@@ -175,9 +178,9 @@ class Api {
175
178
  })
176
179
  }
177
180
 
178
- const response = await Api._sendVerbatim(requestPath, verb, options)
181
+ const response = await Api._sendVerbatim(requestPath, verb, updatedOptions)
179
182
 
180
- return Api._autoPaginate(path, verb, params, options, response, metadata)
183
+ return Api._autoPaginate(path, verb, params, updatedOptions, response, metadata)
181
184
  }
182
185
  }
183
186
 
package/src/Errors.js CHANGED
@@ -215,6 +215,7 @@ export class RateLimited_ReauthenticationRateLimitedError extends RateLimitedErr
215
215
  export class RateLimited_TooManyConcurrentRequestsError extends RateLimitedError { constructor(message, code) { super(message, code); this.name = 'RateLimited_TooManyConcurrentRequestsError' } } errorClasses.RateLimited_TooManyConcurrentRequestsError = RateLimited_TooManyConcurrentRequestsError
216
216
  export class RateLimited_TooManyLoginAttemptsError extends RateLimitedError { constructor(message, code) { super(message, code); this.name = 'RateLimited_TooManyLoginAttemptsError' } } errorClasses.RateLimited_TooManyLoginAttemptsError = RateLimited_TooManyLoginAttemptsError
217
217
  export class RateLimited_TooManyRequestsError extends RateLimitedError { constructor(message, code) { super(message, code); this.name = 'RateLimited_TooManyRequestsError' } } errorClasses.RateLimited_TooManyRequestsError = RateLimited_TooManyRequestsError
218
+ export class RateLimited_TooManySharesError extends RateLimitedError { constructor(message, code) { super(message, code); this.name = 'RateLimited_TooManySharesError' } } errorClasses.RateLimited_TooManySharesError = RateLimited_TooManySharesError
218
219
  export class ServiceUnavailable_UploadsUnavailableError extends ServiceUnavailableError { constructor(message, code) { super(message, code); this.name = 'ServiceUnavailable_UploadsUnavailableError' } } errorClasses.ServiceUnavailable_UploadsUnavailableError = ServiceUnavailable_UploadsUnavailableError
219
220
  export class SiteConfiguration_AccountAlreadyExistsError extends SiteConfigurationError { constructor(message, code) { super(message, code); this.name = 'SiteConfiguration_AccountAlreadyExistsError' } } errorClasses.SiteConfiguration_AccountAlreadyExistsError = SiteConfiguration_AccountAlreadyExistsError
220
221
  export class SiteConfiguration_AccountOverdueError extends SiteConfigurationError { constructor(message, code) { super(message, code); this.name = 'SiteConfiguration_AccountOverdueError' } } errorClasses.SiteConfiguration_AccountOverdueError = SiteConfiguration_AccountOverdueError