pancake-client-sdk
Version:
Official TypeScript SDK for Pancake POS API
104 lines • 3.06 kB
JavaScript
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.SettingsResource = void 0;
const base_1 = require("./base");
class SettingsResource extends base_1.BaseResource {
/**
* Get shop settings
*/
async getShopSettings() {
return this.client.get(this.getShopPath('/settings'));
}
/**
* Update general settings
*/
async updateGeneralSettings(settings) {
return this.client.put(this.getShopPath('/settings/general'), settings);
}
/**
* Update POS settings
*/
async updatePOSSettings(settings) {
return this.client.put(this.getShopPath('/settings/pos'), settings);
}
/**
* Update invoice settings
*/
async updateInvoiceSettings(settings) {
return this.client.put(this.getShopPath('/settings/invoice'), settings);
}
/**
* Update notification settings
*/
async updateNotificationSettings(settings) {
return this.client.put(this.getShopPath('/settings/notifications'), settings);
}
/**
* Update display settings
*/
async updateDisplaySettings(settings) {
return this.client.put(this.getShopPath('/settings/display'), settings);
}
/**
* Update automation settings
*/
async updateAutomationSettings(settings) {
return this.client.put(this.getShopPath('/settings/automation'), settings);
}
/**
* Update social settings
*/
async updateSocialSettings(settings) {
return this.client.put(this.getShopPath('/settings/social'), settings);
}
/**
* Update advanced settings
*/
async updateAdvancedSettings(settings) {
return this.client.put(this.getShopPath('/settings/advanced'), settings);
}
/**
* Get user preferences
*/
async getUserPreferences(userId) {
return this.client.get(this.getShopPath(`/users/${userId}/preferences`));
}
/**
* Update user preferences
*/
async updateUserPreferences(userId, preferences) {
return this.client.put(this.getShopPath(`/users/${userId}/preferences`), preferences);
}
/**
* Reset settings to default
*/
async resetToDefault(section) {
return this.client.post(this.getShopPath('/settings/reset'), { section });
}
/**
* Import settings
*/
async importSettings(settings) {
return this.client.post(this.getShopPath('/settings/import'), settings);
}
/**
* Export settings
*/
async exportSettings(sections) {
return this.client.get(this.getShopPath('/settings/export'), { sections });
}
/**
* Validate settings
*/
async validateSettings(settings) {
return this.client.post(this.getShopPath('/settings/validate'), settings);
}
/**
* Get audit log
*/
async getAuditLog(params) {
return this.client.get(this.getShopPath('/settings/audit-log'), params);
}
}
exports.SettingsResource = SettingsResource;
//# sourceMappingURL=settings.js.map