@serptech/api 1.0.2 → 1.0.3

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@serptech/api",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Library for work with SERP API",
5
5
  "source": "index.js",
6
6
  "main": "./dist/SerpApi.node.js",
@@ -1023,7 +1023,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
1023
1023
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
1024
1024
 
1025
1025
  "use strict";
1026
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Auth\", function() { return Auth; });\n/* harmony import */ var _base_auth_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/auth-api */ \"./src/base/auth-api.ts\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\nvar Auth = /*#__PURE__*/function (_AuthApi) {\n _inherits(Auth, _AuthApi);\n\n var _super = _createSuper(Auth);\n\n function Auth(settings) {\n var _this;\n\n _classCallCheck(this, Auth);\n\n _this = _super.call(this, settings);\n _this.login = _this.login.bind(_assertThisInitialized(_this));\n _this.logout = _this.logout.bind(_assertThisInitialized(_this));\n _this.whoami = _this.whoami.bind(_assertThisInitialized(_this));\n _this.changePassword = _this.changePassword.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(Auth, [{\n key: \"login\",\n value: function login(username, password) {\n var data = new FormData();\n data.append(\"username\", username);\n data.append(\"password\", password);\n return this.httpClient.post(this.authURL + \"auth/token/\", data).then(function (body) {\n return {\n token: {\n id: body.token_meta.id,\n key: body.access_token,\n created: body.token_meta.created,\n expires: body.token_meta.expires,\n expires_in: body.expires_in,\n is_active: body.token_meta.is_active\n },\n user: {\n username: body.user_meta.username,\n created: body.user_meta.created,\n space: {\n id: body.user_meta.id,\n name: \"default\"\n }\n }\n };\n });\n }\n }, {\n key: \"logout\",\n value: function logout(tokenId) {\n return this.httpClient[\"delete\"](this.authURL + \"tokens/\".concat(tokenId, \"/\"));\n }\n }, {\n key: \"whoami\",\n value: function whoami() {\n return this.httpClient.get(this.authURL + \"whoami/\");\n }\n }, {\n key: \"changePassword\",\n value: function changePassword(data) {\n return this.httpClient.post(this.authURL + \"auth/password/change/\", data);\n }\n }]);\n\n return Auth;\n}(_base_auth_api__WEBPACK_IMPORTED_MODULE_0__[\"AuthApi\"]);\n\n\n\n//# sourceURL=webpack://SerpREST/./src/serp-rest-api/features/auth/v1/index.ts?");
1026
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Auth\", function() { return Auth; });\n/* harmony import */ var _base_auth_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/auth-api */ \"./src/base/auth-api.ts\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\nvar Auth = /*#__PURE__*/function (_AuthApi) {\n _inherits(Auth, _AuthApi);\n\n var _super = _createSuper(Auth);\n\n function Auth(settings) {\n var _this;\n\n _classCallCheck(this, Auth);\n\n _this = _super.call(this, settings);\n _this.login = _this.login.bind(_assertThisInitialized(_this));\n _this.logout = _this.logout.bind(_assertThisInitialized(_this));\n _this.whoami = _this.whoami.bind(_assertThisInitialized(_this));\n _this.changePassword = _this.changePassword.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(Auth, [{\n key: \"login\",\n value: function login(username, password) {\n var data = new FormData();\n data.append(\"username\", username);\n data.append(\"password\", password);\n return this.httpClient.post(this.authURL + \"auth/token/\", data).then(function (body) {\n return {\n token: {\n id: body.token_meta.id,\n key: body.access_token,\n created: body.token_meta.created,\n expires: body.token_meta.expires,\n expires_in: body.expires_in,\n is_active: body.token_meta.is_active\n },\n user: {\n username: body.user_meta.username,\n created: body.user_meta.created,\n space: {\n id: body.user_meta.id,\n name: \"default\"\n }\n }\n };\n });\n }\n }, {\n key: \"logout\",\n value: function logout(tokenId) {\n return this.httpClient[\"delete\"](this.authURL + \"tokens/access/\".concat(tokenId, \"/\"));\n }\n }, {\n key: \"whoami\",\n value: function whoami() {\n return this.httpClient.get(this.authURL + \"whoami/\");\n }\n }, {\n key: \"changePassword\",\n value: function changePassword(data) {\n return this.httpClient.post(this.authURL + \"auth/password/change/\", data);\n }\n }]);\n\n return Auth;\n}(_base_auth_api__WEBPACK_IMPORTED_MODULE_0__[\"AuthApi\"]);\n\n\n\n//# sourceURL=webpack://SerpREST/./src/serp-rest-api/features/auth/v1/index.ts?");
1027
1027
 
1028
1028
  /***/ }),
1029
1029
 
@@ -779,7 +779,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) *
779
779
  /***/ (function(module, __webpack_exports__, __webpack_require__) {
780
780
 
781
781
  "use strict";
782
- eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Auth\", function() { return Auth; });\n/* harmony import */ var _base_auth_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/auth-api */ \"./src/base/auth-api.ts\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\nvar Auth = /*#__PURE__*/function (_AuthApi) {\n _inherits(Auth, _AuthApi);\n\n var _super = _createSuper(Auth);\n\n function Auth(settings) {\n var _this;\n\n _classCallCheck(this, Auth);\n\n _this = _super.call(this, settings);\n _this.login = _this.login.bind(_assertThisInitialized(_this));\n _this.logout = _this.logout.bind(_assertThisInitialized(_this));\n _this.whoami = _this.whoami.bind(_assertThisInitialized(_this));\n _this.changePassword = _this.changePassword.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(Auth, [{\n key: \"login\",\n value: function login(username, password) {\n var data = new FormData();\n data.append(\"username\", username);\n data.append(\"password\", password);\n return this.httpClient.post(this.authURL + \"auth/token/\", data).then(function (body) {\n return {\n token: {\n id: body.token_meta.id,\n key: body.access_token,\n created: body.token_meta.created,\n expires: body.token_meta.expires,\n expires_in: body.expires_in,\n is_active: body.token_meta.is_active\n },\n user: {\n username: body.user_meta.username,\n created: body.user_meta.created,\n space: {\n id: body.user_meta.id,\n name: \"default\"\n }\n }\n };\n });\n }\n }, {\n key: \"logout\",\n value: function logout(tokenId) {\n return this.httpClient.delete(this.authURL + \"tokens/\".concat(tokenId, \"/\"));\n }\n }, {\n key: \"whoami\",\n value: function whoami() {\n return this.httpClient.get(this.authURL + \"whoami/\");\n }\n }, {\n key: \"changePassword\",\n value: function changePassword(data) {\n return this.httpClient.post(this.authURL + \"auth/password/change/\", data);\n }\n }]);\n\n return Auth;\n}(_base_auth_api__WEBPACK_IMPORTED_MODULE_0__[\"AuthApi\"]);\n\n\n\n//# sourceURL=webpack://SerpREST/./src/serp-rest-api/features/auth/v1/index.ts?");
782
+ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Auth\", function() { return Auth; });\n/* harmony import */ var _base_auth_api__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../../../base/auth-api */ \"./src/base/auth-api.ts\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; if (typeof Symbol === \"function\" && typeof Symbol.iterator === \"symbol\") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === \"function\" && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }; } return _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\n\nvar Auth = /*#__PURE__*/function (_AuthApi) {\n _inherits(Auth, _AuthApi);\n\n var _super = _createSuper(Auth);\n\n function Auth(settings) {\n var _this;\n\n _classCallCheck(this, Auth);\n\n _this = _super.call(this, settings);\n _this.login = _this.login.bind(_assertThisInitialized(_this));\n _this.logout = _this.logout.bind(_assertThisInitialized(_this));\n _this.whoami = _this.whoami.bind(_assertThisInitialized(_this));\n _this.changePassword = _this.changePassword.bind(_assertThisInitialized(_this));\n return _this;\n }\n\n _createClass(Auth, [{\n key: \"login\",\n value: function login(username, password) {\n var data = new FormData();\n data.append(\"username\", username);\n data.append(\"password\", password);\n return this.httpClient.post(this.authURL + \"auth/token/\", data).then(function (body) {\n return {\n token: {\n id: body.token_meta.id,\n key: body.access_token,\n created: body.token_meta.created,\n expires: body.token_meta.expires,\n expires_in: body.expires_in,\n is_active: body.token_meta.is_active\n },\n user: {\n username: body.user_meta.username,\n created: body.user_meta.created,\n space: {\n id: body.user_meta.id,\n name: \"default\"\n }\n }\n };\n });\n }\n }, {\n key: \"logout\",\n value: function logout(tokenId) {\n return this.httpClient.delete(this.authURL + \"tokens/access/\".concat(tokenId, \"/\"));\n }\n }, {\n key: \"whoami\",\n value: function whoami() {\n return this.httpClient.get(this.authURL + \"whoami/\");\n }\n }, {\n key: \"changePassword\",\n value: function changePassword(data) {\n return this.httpClient.post(this.authURL + \"auth/password/change/\", data);\n }\n }]);\n\n return Auth;\n}(_base_auth_api__WEBPACK_IMPORTED_MODULE_0__[\"AuthApi\"]);\n\n\n\n//# sourceURL=webpack://SerpREST/./src/serp-rest-api/features/auth/v1/index.ts?");
783
783
 
784
784
  /***/ }),
785
785