scraper-api-datachaser
Version:
The scraping SaaS platform provides a RESTful API for developers to perform web scraping tasks. Users can submit scraping tasks, monitor task status, retrieve scraped data, and manage their account through the API.
111 lines (106 loc) • 5.25 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse"));
var _Log = _interopRequireDefault(require("../model/Log"));
function _interopRequireDefault(e) { return e && e.__esModule ? e : { "default": e }; }
function _typeof(o) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o; }, _typeof(o); }
function _classCallCheck(a, n) { if (!(a instanceof n)) throw new TypeError("Cannot call a class as a function"); }
function _defineProperties(e, r) { for (var t = 0; t < r.length; t++) { var o = r[t]; o.enumerable = o.enumerable || !1, o.configurable = !0, "value" in o && (o.writable = !0), Object.defineProperty(e, _toPropertyKey(o.key), o); } }
function _createClass(e, r, t) { return r && _defineProperties(e.prototype, r), t && _defineProperties(e, t), Object.defineProperty(e, "prototype", { writable: !1 }), e; }
function _toPropertyKey(t) { var i = _toPrimitive(t, "string"); return "symbol" == _typeof(i) ? i : i + ""; }
function _toPrimitive(t, r) { if ("object" != _typeof(t) || !t) return t; var e = t[Symbol.toPrimitive]; if (void 0 !== e) { var i = e.call(t, r || "default"); if ("object" != _typeof(i)) return i; throw new TypeError("@@toPrimitive must return a primitive value."); } return ("string" === r ? String : Number)(t); } /**
* Scraper API
* The scraping SaaS platform provides a RESTful API for developers to perform web scraping tasks. Users can submit scraping tasks, monitor task status, retrieve scraped data, and manage their account through the API.
*
* The version of the OpenAPI document: 1.0.0
*
*
* NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
* https://openapi-generator.tech
* Do not edit the class manually.
*
*/
/**
* Logs service.
* @module api/LogsApi
* @version 1.0.0
*/
var LogsApi = exports["default"] = /*#__PURE__*/function () {
/**
* Constructs a new LogsApi.
* @alias module:api/LogsApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
function LogsApi(apiClient) {
_classCallCheck(this, LogsApi);
this.apiClient = apiClient || _ApiClient["default"].instance;
}
/**
* Callback function to receive the result of the logJobIdGet operation.
* @callback module:api/LogsApi~logJobIdGetCallback
* @param {String} error Error message, if any.
* @param {Array.<module:model/Log>} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Get log by job id
* Get log generated by job by job id
* @param {String} id
* @param {module:api/LogsApi~logJobIdGetCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link Array.<module:model/Log>}
*/
return _createClass(LogsApi, [{
key: "logJobIdGet",
value: function logJobIdGet(id, callback) {
var postBody = null;
// verify the required parameter 'id' is set
if (id === undefined || id === null) {
throw new Error("Missing the required parameter 'id' when calling logJobIdGet");
}
var pathParams = {
'id': id
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var authNames = ['key'];
var contentTypes = [];
var accepts = ['application/json', 'application/octet-stream'];
var returnType = [_Log["default"]];
return this.apiClient.callApi('/log/job/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the logsGet operation.
* @callback module:api/LogsApi~logsGetCallback
* @param {String} error Error message, if any.
* @param {Array.<module:model/Log>} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Get all logs
* Get all logs from logged user
* @param {module:api/LogsApi~logsGetCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link Array.<module:model/Log>}
*/
}, {
key: "logsGet",
value: function logsGet(callback) {
var postBody = null;
var pathParams = {};
var queryParams = {};
var headerParams = {};
var formParams = {};
var authNames = ['key'];
var contentTypes = [];
var accepts = ['application/json', 'application/octet-stream'];
var returnType = [_Log["default"]];
return this.apiClient.callApi('/logs', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
}]);
}();