UNPKG

@coveo/platform-client

Version:

The main goal of this package is to provide an easy to configure and straightforward way of querying Coveo Cloud APIs using JavaScript.

124 lines 4.46 kB
import ReadServiceResource from '../ReadServiceResource.js'; export default class Exports extends ReadServiceResource { static baseUrl = '/rest/ua/v15/exports'; /** * Lists all exports. */ list() { return this.api.get(this.buildPathWithOrg(Exports.baseUrl)); } /** * Generate an export. * @param params The parameters to generate the export with. */ generate(params) { return this.api.post(this.buildPathWithOrg(Exports.baseUrl, params)); } /** * Generate an export with the parameters in the request body. * @param params The parameters to generate the export with, passed in the request body. * @param args */ generateExportWithBody(params, args) { return this.api.post(this.buildPathWithOrg(`${Exports.baseUrl}/create`), params, args); } /** * Get information on an export. * @param exportId The export's unique identifier. * @param redirect Whether to return a HTTP redirect to the actual file. */ get(exportId, redirect = false) { return this.api.get(this.buildPathWithOrg(`${Exports.baseUrl}/${exportId}`, { redirect })); } /** * Get the download link of an export. * @param exportId The export's unique identifier. */ getExportDownloadLink(exportId) { return this.api.get(this.buildPathWithOrg(`${Exports.baseUrl}/${exportId}/downloadlink`)); } /** * Delete an export. * @param exportId The export's unique identifier. */ delete(exportId) { return this.api.delete(this.buildPathWithOrg(`${Exports.baseUrl}/${exportId}`)); } /** * Estimate the number of rows in an export. * @param params The date range and other parameters for the export. */ estimateRowsCount(params) { return this.api.get(this.buildPathWithOrg(`${Exports.baseUrl}/estimate`, params)); } /** * Generate a visit export. * @param params The parameters to generate the visit export with. */ generateVisitExport(params) { return this.api.post(this.buildPathWithOrg(`${Exports.baseUrl}/visits`, params)); } /** * Generate a visit export with the parameters in the request body. * @param params The parameters to generate the visit export with, passed in the request body. * @param args */ generateVisitExportWithBody(params, args) { return this.api.post(this.buildPathWithOrg(`${Exports.baseUrl}/visits/create`), params, args); } /** * Estimate the number of rows in a visit export. * @param params The parameters of the visit export to estimate. */ estimateVisitExportRowsCount(params) { return this.api.get(this.buildPathWithOrg(`${Exports.baseUrl}/visits/estimate`, params)); } /** * Get all the export schedules. */ listSchedules() { return this.api.get(this.buildPathWithOrg(`${Exports.baseUrl}/schedules`)); } /** * Create an export schedule. * @param model The export schedule to create. */ createSchedule(model) { return this.api.post(this.buildPathWithOrg(`${Exports.baseUrl}/schedules`), model); } /** * Get information on an export schedule. * @param exportScheduleId The export schedule's unique identifier. */ getSchedule(exportScheduleId) { return this.api.get(this.buildPathWithOrg(`${Exports.baseUrl}/schedules/${exportScheduleId}`)); } /** * Update an existing export schedule. * @param exportScheduleId The export schedule's unique identifier. * @param model */ updateSchedule(exportScheduleId, model) { return this.api.put(this.buildPathWithOrg(`${Exports.baseUrl}/schedules/${exportScheduleId}`), model); } /** * Delete an export schedule. * @param exportScheduleId The export schedule's unique identifier. */ deleteSchedule(exportScheduleId) { return this.api.delete(this.buildPathWithOrg(`${Exports.baseUrl}/schedules/${exportScheduleId}`)); } /** * Get the export row limit for this org. */ getRowLimit() { return this.api.get(this.buildPathWithOrg(`${Exports.baseUrl}/rowLimit`)); } checkHealth() { return this.api.get(`${Exports.baseUrl}/monitoring/health`); } checkStatus() { return this.api.get(`${Exports.baseUrl}/status`); } } //# sourceMappingURL=Exports.js.map