files.com 1.1.16 → 1.1.17
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/ApiKey.md +4 -4
- package/lib/Files.js +1 -1
- package/lib/models/ApiKey.js +23 -17
- package/package.json +1 -1
- package/src/Files.js +1 -1
- package/src/models/ApiKey.js +13 -9
    
        package/_VERSION
    CHANGED
    
    | @@ -1 +1 @@ | |
| 1 | 
            -
            1.1. | 
| 1 | 
            +
            1.1.17
         | 
    
        package/docs/models/ApiKey.md
    CHANGED
    
    | @@ -85,10 +85,10 @@ await ApiKey.find(id) | |
| 85 85 | 
             
            ```
         | 
| 86 86 | 
             
            await ApiKey.create({
         | 
| 87 87 | 
             
              'user_id': 1,
         | 
| 88 | 
            -
              'name': "My Main API Key",
         | 
| 89 88 | 
             
              'description': "example",
         | 
| 90 89 | 
             
              'expires_at': "2000-01-01T01:00:00Z",
         | 
| 91 90 | 
             
              'permission_set': "full",
         | 
| 91 | 
            +
              'name': "My Main API Key",
         | 
| 92 92 | 
             
            })
         | 
| 93 93 | 
             
            ```
         | 
| 94 94 |  | 
| @@ -96,10 +96,10 @@ await ApiKey.create({ | |
| 96 96 | 
             
            ### Parameters
         | 
| 97 97 |  | 
| 98 98 | 
             
            * `user_id` (int64): User ID.  Provide a value of `0` to operate the current session's user.
         | 
| 99 | 
            -
            * `name` (string): Internal name for the API Key.  For your use.
         | 
| 100 99 | 
             
            * `description` (string): User-supplied description of API key.
         | 
| 101 100 | 
             
            * `expires_at` (string): API Key expiration date
         | 
| 102 101 | 
             
            * `permission_set` (string): Permissions for this API Key. It must be full for site-wide API Keys.  Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).  Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges.  If you have ideas for permission sets, please let us know.
         | 
| 102 | 
            +
            * `name` (string): Required - Internal name for the API Key.  For your use.
         | 
| 103 103 |  | 
| 104 104 | 
             
            ---
         | 
| 105 105 |  | 
| @@ -137,20 +137,20 @@ await ApiKey.deleteCurrent | |
| 137 137 | 
             
            const [api_key] = await ApiKey.list()
         | 
| 138 138 |  | 
| 139 139 | 
             
            await api_key.update({
         | 
| 140 | 
            -
              'name': "My Main API Key",
         | 
| 141 140 | 
             
              'description': "example",
         | 
| 142 141 | 
             
              'expires_at': "2000-01-01T01:00:00Z",
         | 
| 143 142 | 
             
              'permission_set': "full",
         | 
| 143 | 
            +
              'name': "My Main API Key",
         | 
| 144 144 | 
             
            })
         | 
| 145 145 | 
             
            ```
         | 
| 146 146 |  | 
| 147 147 | 
             
            ### Parameters
         | 
| 148 148 |  | 
| 149 149 | 
             
            * `id` (int64): Required - Api Key ID.
         | 
| 150 | 
            -
            * `name` (string): Internal name for the API Key.  For your use.
         | 
| 151 150 | 
             
            * `description` (string): User-supplied description of API key.
         | 
| 152 151 | 
             
            * `expires_at` (string): API Key expiration date
         | 
| 153 152 | 
             
            * `permission_set` (string): Permissions for this API Key. It must be full for site-wide API Keys.  Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).  Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges.  If you have ideas for permission sets, please let us know.
         | 
| 153 | 
            +
            * `name` (string): Internal name for the API Key.  For your use.
         | 
| 154 154 |  | 
| 155 155 | 
             
            ### Example Response
         | 
| 156 156 |  | 
    
        package/lib/Files.js
    CHANGED
    
    | @@ -11,7 +11,7 @@ var endpointPrefix = '/api/rest/v1'; | |
| 11 11 | 
             
            var apiKey;
         | 
| 12 12 | 
             
            var baseUrl = 'https://app.files.com';
         | 
| 13 13 | 
             
            var sessionId = null;
         | 
| 14 | 
            -
            var version = '1.1. | 
| 14 | 
            +
            var version = '1.1.17';
         | 
| 15 15 | 
             
            var userAgent = "Files.com JavaScript SDK v".concat(version);
         | 
| 16 16 | 
             
            var logLevel = _Logger.LogLevel.INFO;
         | 
| 17 17 | 
             
            var debugRequest = false;
         | 
    
        package/lib/models/ApiKey.js
    CHANGED
    
    | @@ -115,10 +115,10 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() { | |
| 115 115 | 
             
                _this.attributes.user_id = value;
         | 
| 116 116 | 
             
              });
         | 
| 117 117 | 
             
              // Parameters:
         | 
| 118 | 
            -
              //   name - string - Internal name for the API Key.  For your use.
         | 
| 119 118 | 
             
              //   description - string - User-supplied description of API key.
         | 
| 120 119 | 
             
              //   expires_at - string - API Key expiration date
         | 
| 121 120 | 
             
              //   permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys.  Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).  Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges.  If you have ideas for permission sets, please let us know.
         | 
| 121 | 
            +
              //   name - string - Internal name for the API Key.  For your use.
         | 
| 122 122 | 
             
              (0, _defineProperty2.default)(this, "update", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee() {
         | 
| 123 123 | 
             
                var params,
         | 
| 124 124 | 
             
                  response,
         | 
| @@ -146,29 +146,29 @@ var ApiKey = /*#__PURE__*/(0, _createClass2.default)(function ApiKey() { | |
| 146 146 | 
             
                      }
         | 
| 147 147 | 
             
                      throw new errors.InvalidParameterError("Bad parameter: id must be of type Int, received ".concat((0, _utils.getType)(params['id'])));
         | 
| 148 148 | 
             
                    case 8:
         | 
| 149 | 
            -
                      if (!(params[' | 
| 149 | 
            +
                      if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
         | 
| 150 150 | 
             
                        _context.next = 10;
         | 
| 151 151 | 
             
                        break;
         | 
| 152 152 | 
             
                      }
         | 
| 153 | 
            -
                      throw new errors.InvalidParameterError("Bad parameter:  | 
| 153 | 
            +
                      throw new errors.InvalidParameterError("Bad parameter: description must be of type String, received ".concat((0, _utils.getType)(params['description'])));
         | 
| 154 154 | 
             
                    case 10:
         | 
| 155 | 
            -
                      if (!(params[' | 
| 155 | 
            +
                      if (!(params['expires_at'] && !(0, _utils.isString)(params['expires_at']))) {
         | 
| 156 156 | 
             
                        _context.next = 12;
         | 
| 157 157 | 
             
                        break;
         | 
| 158 158 | 
             
                      }
         | 
| 159 | 
            -
                      throw new errors.InvalidParameterError("Bad parameter:  | 
| 159 | 
            +
                      throw new errors.InvalidParameterError("Bad parameter: expires_at must be of type String, received ".concat((0, _utils.getType)(params['expires_at'])));
         | 
| 160 160 | 
             
                    case 12:
         | 
| 161 | 
            -
                      if (!(params[' | 
| 161 | 
            +
                      if (!(params['permission_set'] && !(0, _utils.isString)(params['permission_set']))) {
         | 
| 162 162 | 
             
                        _context.next = 14;
         | 
| 163 163 | 
             
                        break;
         | 
| 164 164 | 
             
                      }
         | 
| 165 | 
            -
                      throw new errors.InvalidParameterError("Bad parameter:  | 
| 165 | 
            +
                      throw new errors.InvalidParameterError("Bad parameter: permission_set must be of type String, received ".concat((0, _utils.getType)(params['permission_set'])));
         | 
| 166 166 | 
             
                    case 14:
         | 
| 167 | 
            -
                      if (!(params[' | 
| 167 | 
            +
                      if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
         | 
| 168 168 | 
             
                        _context.next = 16;
         | 
| 169 169 | 
             
                        break;
         | 
| 170 170 | 
             
                      }
         | 
| 171 | 
            -
                      throw new errors.InvalidParameterError("Bad parameter:  | 
| 171 | 
            +
                      throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
         | 
| 172 172 | 
             
                    case 16:
         | 
| 173 173 | 
             
                      if (params['id']) {
         | 
| 174 174 | 
             
                        _context.next = 22;
         | 
| @@ -423,10 +423,10 @@ _class = ApiKey; | |
| 423 423 | 
             
            });
         | 
| 424 424 | 
             
            // Parameters:
         | 
| 425 425 | 
             
            //   user_id - int64 - User ID.  Provide a value of `0` to operate the current session's user.
         | 
| 426 | 
            -
            //   name - string - Internal name for the API Key.  For your use.
         | 
| 427 426 | 
             
            //   description - string - User-supplied description of API key.
         | 
| 428 427 | 
             
            //   expires_at - string - API Key expiration date
         | 
| 429 428 | 
             
            //   permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys.  Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).  Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges.  If you have ideas for permission sets, please let us know.
         | 
| 429 | 
            +
            //   name (required) - string - Internal name for the API Key.  For your use.
         | 
| 430 430 | 
             
            (0, _defineProperty2.default)(ApiKey, "create", /*#__PURE__*/(0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee7() {
         | 
| 431 431 | 
             
              var params,
         | 
| 432 432 | 
             
                options,
         | 
| @@ -437,17 +437,17 @@ _class = ApiKey; | |
| 437 437 | 
             
                  case 0:
         | 
| 438 438 | 
             
                    params = _args7.length > 0 && _args7[0] !== undefined ? _args7[0] : {};
         | 
| 439 439 | 
             
                    options = _args7.length > 1 && _args7[1] !== undefined ? _args7[1] : {};
         | 
| 440 | 
            -
                    if ( | 
| 440 | 
            +
                    if (params['name']) {
         | 
| 441 441 | 
             
                      _context7.next = 4;
         | 
| 442 442 | 
             
                      break;
         | 
| 443 443 | 
             
                    }
         | 
| 444 | 
            -
                    throw new errors. | 
| 444 | 
            +
                    throw new errors.MissingParameterError('Parameter missing: name');
         | 
| 445 445 | 
             
                  case 4:
         | 
| 446 | 
            -
                    if (!(params[' | 
| 446 | 
            +
                    if (!(params['user_id'] && !(0, _utils.isInt)(params['user_id']))) {
         | 
| 447 447 | 
             
                      _context7.next = 6;
         | 
| 448 448 | 
             
                      break;
         | 
| 449 449 | 
             
                    }
         | 
| 450 | 
            -
                    throw new errors.InvalidParameterError("Bad parameter:  | 
| 450 | 
            +
                    throw new errors.InvalidParameterError("Bad parameter: user_id must be of type Int, received ".concat((0, _utils.getType)(params['user_id'])));
         | 
| 451 451 | 
             
                  case 6:
         | 
| 452 452 | 
             
                    if (!(params['description'] && !(0, _utils.isString)(params['description']))) {
         | 
| 453 453 | 
             
                      _context7.next = 8;
         | 
| @@ -467,12 +467,18 @@ _class = ApiKey; | |
| 467 467 | 
             
                    }
         | 
| 468 468 | 
             
                    throw new errors.InvalidParameterError("Bad parameter: permission_set must be of type String, received ".concat((0, _utils.getType)(params['permission_set'])));
         | 
| 469 469 | 
             
                  case 12:
         | 
| 470 | 
            -
                     | 
| 471 | 
            -
             | 
| 470 | 
            +
                    if (!(params['name'] && !(0, _utils.isString)(params['name']))) {
         | 
| 471 | 
            +
                      _context7.next = 14;
         | 
| 472 | 
            +
                      break;
         | 
| 473 | 
            +
                    }
         | 
| 474 | 
            +
                    throw new errors.InvalidParameterError("Bad parameter: name must be of type String, received ".concat((0, _utils.getType)(params['name'])));
         | 
| 472 475 | 
             
                  case 14:
         | 
| 476 | 
            +
                    _context7.next = 16;
         | 
| 477 | 
            +
                    return _Api.default.sendRequest("/api_keys", 'POST', params, options);
         | 
| 478 | 
            +
                  case 16:
         | 
| 473 479 | 
             
                    response = _context7.sent;
         | 
| 474 480 | 
             
                    return _context7.abrupt("return", new _class(response === null || response === void 0 ? void 0 : response.data, options));
         | 
| 475 | 
            -
                  case  | 
| 481 | 
            +
                  case 18:
         | 
| 476 482 | 
             
                  case "end":
         | 
| 477 483 | 
             
                    return _context7.stop();
         | 
| 478 484 | 
             
                }
         | 
    
        package/package.json
    CHANGED
    
    
    
        package/src/Files.js
    CHANGED
    
    
    
        package/src/models/ApiKey.js
    CHANGED
    
    | @@ -106,10 +106,10 @@ class ApiKey { | |
| 106 106 |  | 
| 107 107 |  | 
| 108 108 | 
             
              // Parameters:
         | 
| 109 | 
            -
              //   name - string - Internal name for the API Key.  For your use.
         | 
| 110 109 | 
             
              //   description - string - User-supplied description of API key.
         | 
| 111 110 | 
             
              //   expires_at - string - API Key expiration date
         | 
| 112 111 | 
             
              //   permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys.  Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).  Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges.  If you have ideas for permission sets, please let us know.
         | 
| 112 | 
            +
              //   name - string - Internal name for the API Key.  For your use.
         | 
| 113 113 | 
             
              update = async (params = {}) => {
         | 
| 114 114 | 
             
                if (!this.attributes.id) {
         | 
| 115 115 | 
             
                  throw new errors.EmptyPropertyError('Current object has no id')
         | 
| @@ -123,9 +123,6 @@ class ApiKey { | |
| 123 123 | 
             
                if (params['id'] && !isInt(params['id'])) {
         | 
| 124 124 | 
             
                  throw new errors.InvalidParameterError(`Bad parameter: id must be of type Int, received ${getType(params['id'])}`)
         | 
| 125 125 | 
             
                }
         | 
| 126 | 
            -
                if (params['name'] && !isString(params['name'])) {
         | 
| 127 | 
            -
                  throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
         | 
| 128 | 
            -
                }
         | 
| 129 126 | 
             
                if (params['description'] && !isString(params['description'])) {
         | 
| 130 127 | 
             
                  throw new errors.InvalidParameterError(`Bad parameter: description must be of type String, received ${getType(params['description'])}`)
         | 
| 131 128 | 
             
                }
         | 
| @@ -135,6 +132,9 @@ class ApiKey { | |
| 135 132 | 
             
                if (params['permission_set'] && !isString(params['permission_set'])) {
         | 
| 136 133 | 
             
                  throw new errors.InvalidParameterError(`Bad parameter: permission_set must be of type String, received ${getType(params['permission_set'])}`)
         | 
| 137 134 | 
             
                }
         | 
| 135 | 
            +
                if (params['name'] && !isString(params['name'])) {
         | 
| 136 | 
            +
                  throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
         | 
| 137 | 
            +
                }
         | 
| 138 138 |  | 
| 139 139 | 
             
                if (!params['id']) {
         | 
| 140 140 | 
             
                  if (this.attributes.id) {
         | 
| @@ -259,17 +259,17 @@ class ApiKey { | |
| 259 259 |  | 
| 260 260 | 
             
              // Parameters:
         | 
| 261 261 | 
             
              //   user_id - int64 - User ID.  Provide a value of `0` to operate the current session's user.
         | 
| 262 | 
            -
              //   name - string - Internal name for the API Key.  For your use.
         | 
| 263 262 | 
             
              //   description - string - User-supplied description of API key.
         | 
| 264 263 | 
             
              //   expires_at - string - API Key expiration date
         | 
| 265 264 | 
             
              //   permission_set - string - Permissions for this API Key. It must be full for site-wide API Keys.  Keys with the `desktop_app` permission set only have the ability to do the functions provided in our Desktop App (File and Share Link operations).  Additional permission sets may become available in the future, such as for a Site Admin to give a key with no administrator privileges.  If you have ideas for permission sets, please let us know.
         | 
| 265 | 
            +
              //   name (required) - string - Internal name for the API Key.  For your use.
         | 
| 266 266 | 
             
              static create = async (params = {}, options = {}) => {
         | 
| 267 | 
            -
                if ( | 
| 268 | 
            -
                  throw new errors. | 
| 267 | 
            +
                if (!params['name']) {
         | 
| 268 | 
            +
                  throw new errors.MissingParameterError('Parameter missing: name')
         | 
| 269 269 | 
             
                }
         | 
| 270 270 |  | 
| 271 | 
            -
                if (params[' | 
| 272 | 
            -
                  throw new errors.InvalidParameterError(`Bad parameter:  | 
| 271 | 
            +
                if (params['user_id'] && !isInt(params['user_id'])) {
         | 
| 272 | 
            +
                  throw new errors.InvalidParameterError(`Bad parameter: user_id must be of type Int, received ${getType(params['user_id'])}`)
         | 
| 273 273 | 
             
                }
         | 
| 274 274 |  | 
| 275 275 | 
             
                if (params['description'] && !isString(params['description'])) {
         | 
| @@ -284,6 +284,10 @@ class ApiKey { | |
| 284 284 | 
             
                  throw new errors.InvalidParameterError(`Bad parameter: permission_set must be of type String, received ${getType(params['permission_set'])}`)
         | 
| 285 285 | 
             
                }
         | 
| 286 286 |  | 
| 287 | 
            +
                if (params['name'] && !isString(params['name'])) {
         | 
| 288 | 
            +
                  throw new errors.InvalidParameterError(`Bad parameter: name must be of type String, received ${getType(params['name'])}`)
         | 
| 289 | 
            +
                }
         | 
| 290 | 
            +
             | 
| 287 291 | 
             
                const response = await Api.sendRequest(`/api_keys`, 'POST', params, options)
         | 
| 288 292 |  | 
| 289 293 |  |