UNPKG

pancake-client-sdk

Version:
98 lines 2.76 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ReportResource = void 0; const base_1 = require("./base"); class ReportResource extends base_1.BaseResource { /** * Get sales report */ async getSalesReport(params) { return this.client.get(this.getShopPath('/reports/sales'), params); } /** * Get inventory report */ async getInventoryReport(params) { return this.client.get(this.getShopPath('/reports/inventory'), params); } /** * Get customer report */ async getCustomerReport(params) { return this.client.get(this.getShopPath('/reports/customers'), params); } /** * Get marketing report */ async getMarketingReport(params) { return this.client.get(this.getShopPath('/reports/marketing'), params); } /** * List custom formulas */ async listFormulas() { return this.client.get(this.getShopPath('/reports/formulas')); } /** * Create custom formula */ async createFormula(data) { return this.client.post(this.getShopPath('/reports/formulas'), data); } /** * Update custom formula */ async updateFormula(formulaId, data) { return this.client.put(this.getShopPath(`/reports/formulas/${formulaId}`), data); } /** * Delete custom formula */ async deleteFormula(formulaId) { return this.client.delete(this.getShopPath(`/reports/formulas/${formulaId}`)); } /** * List report schedules */ async listSchedules() { return this.client.get(this.getShopPath('/report-schedules')); } /** * Create report schedule */ async createSchedule(data) { return this.client.post(this.getShopPath('/report-schedules'), data); } /** * Update report schedule */ async updateSchedule(scheduleId, data) { return this.client.put(this.getShopPath(`/report-schedules/${scheduleId}`), data); } /** * Delete report schedule */ async deleteSchedule(scheduleId) { return this.client.delete(this.getShopPath(`/report-schedules/${scheduleId}`)); } /** * Export report */ async exportReport(data) { return this.client.post(this.getShopPath('/reports/export'), data); } /** * Get export status */ async getExportStatus(exportId) { return this.client.get(this.getShopPath(`/reports/export/${exportId}`)); } /** * Get default metrics */ async getDefaultMetrics() { return this.client.get(this.getShopPath('/reports/default-metrics')); } } exports.ReportResource = ReportResource; //# sourceMappingURL=reports.js.map