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.
183 lines (174 loc) • 8.34 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
exports["default"] = void 0;
var _ApiClient = _interopRequireDefault(require("../ApiClient"));
var _Data = _interopRequireDefault(require("../model/Data"));
var _ErrorResponse = _interopRequireDefault(require("../model/ErrorResponse"));
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.
*
*/
/**
* Data service.
* @module api/DataApi
* @version 1.0.0
*/
var DataApi = exports["default"] = /*#__PURE__*/function () {
/**
* Constructs a new DataApi.
* @alias module:api/DataApi
* @class
* @param {module:ApiClient} [apiClient] Optional API client implementation to use,
* default to {@link module:ApiClient#instance} if unspecified.
*/
function DataApi(apiClient) {
_classCallCheck(this, DataApi);
this.apiClient = apiClient || _ApiClient["default"].instance;
}
/**
* Callback function to receive the result of the dataGet operation.
* @callback module:api/DataApi~dataGetCallback
* @param {String} error Error message, if any.
* @param {Array.<module:model/Data>} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Get all data
* This endpoint gets all data from logged user
* @param {module:api/DataApi~dataGetCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link Array.<module:model/Data>}
*/
return _createClass(DataApi, [{
key: "dataGet",
value: function dataGet(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 = [_Data["default"]];
return this.apiClient.callApi('/data', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the dataIdDelete operation.
* @callback module:api/DataApi~dataIdDeleteCallback
* @param {String} error Error message, if any.
* @param {module:model/Data} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Delete data by id
* Delete data generated by job by data id
* @param {String} id
* @param {module:api/DataApi~dataIdDeleteCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Data}
*/
}, {
key: "dataIdDelete",
value: function dataIdDelete(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 dataIdDelete");
}
var pathParams = {
'id': id
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var authNames = ['key'];
var contentTypes = [];
var accepts = ['application/json', 'application/octet-stream'];
var returnType = _Data["default"];
return this.apiClient.callApi('/data/{id}', 'DELETE', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the dataJobIdGet operation.
* @callback module:api/DataApi~dataJobIdGetCallback
* @param {String} error Error message, if any.
* @param {Array.<module:model/Data>} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* Get data by job id
* Get data generated by a job (it receives on the url the job id)
* @param {String} id
* @param {module:api/DataApi~dataJobIdGetCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link Array.<module:model/Data>}
*/
}, {
key: "dataJobIdGet",
value: function dataJobIdGet(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 dataJobIdGet");
}
var pathParams = {
'id': id
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var authNames = ['key'];
var contentTypes = [];
var accepts = ['application/json', 'application/octet-stream'];
var returnType = [_Data["default"]];
return this.apiClient.callApi('/data/job/{id}', 'GET', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
/**
* Callback function to receive the result of the dataUserIdPost operation.
* @callback module:api/DataApi~dataUserIdPostCallback
* @param {String} error Error message, if any.
* @param {module:model/Data} data The data returned by the service call.
* @param {String} response The complete HTTP response.
*/
/**
* WebHook to get data when done scraped by user id
* Subscribe to this webhook service to get done data related to a user id (so it'll watch all data status and send done when it's scraped)
* @param {String} id
* @param {module:api/DataApi~dataUserIdPostCallback} callback The callback function, accepting three arguments: error, data, response
* data is of type: {@link module:model/Data}
*/
}, {
key: "dataUserIdPost",
value: function dataUserIdPost(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 dataUserIdPost");
}
var pathParams = {
'id': id
};
var queryParams = {};
var headerParams = {};
var formParams = {};
var authNames = ['key'];
var contentTypes = [];
var accepts = ['application/json', 'application/octet-stream'];
var returnType = _Data["default"];
return this.apiClient.callApi('/data/user/{id}', 'POST', pathParams, queryParams, headerParams, formParams, postBody, authNames, contentTypes, accepts, returnType, null, callback);
}
}]);
}();