UNPKG

pancake-client-sdk

Version:
80 lines 2.68 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CustomerNoteResource = void 0; const base_1 = require("./base"); class CustomerNoteResource extends base_1.BaseResource { /** * Get list of customer notes */ async list(customerId, params) { return this.client.get(this.getShopPath(`/customers/${customerId}/notes`), params); } /** * Get customer note by ID */ async getById(customerId, noteId) { return this.client.get(this.getShopPath(`/customers/${customerId}/notes/${noteId}`)); } /** * Create new customer note */ async create(customerId, data) { return this.client.post(this.getShopPath(`/customers/${customerId}/notes`), data); } /** * Update customer note */ async update(customerId, noteId, data) { return this.client.put(this.getShopPath(`/customers/${customerId}/notes/${noteId}`), data); } /** * Delete customer note */ async delete(customerId, noteId) { return this.client.delete(this.getShopPath(`/customers/${customerId}/notes/${noteId}`)); } /** * Get communication history */ async getCommunicationHistory(customerId, params) { return this.client.get(this.getShopPath(`/customers/${customerId}/communications`), params); } /** * Create communication record */ async createCommunication(customerId, data) { return this.client.post(this.getShopPath(`/customers/${customerId}/communications`), data); } /** * Get communication statistics */ async getCommunicationStats(customerId, params) { return this.client.get(this.getShopPath(`/customers/${customerId}/communications/stats`), params); } /** * Get customer notes by tag */ async getByTag(tag, params) { return this.client.get(this.getShopPath(`/customer-notes/by-tag/${tag}`), params); } /** * Get notes requiring follow-up */ async getRequiringFollowUp(params) { return this.client.get(this.getShopPath('/customer-notes/requiring-follow-up'), params); } /** * Mark note as followed up */ async markAsFollowedUp(customerId, noteId, comment) { return this.client.post(this.getShopPath(`/customers/${customerId}/notes/${noteId}/follow-up`), { comment }); } /** * Get notes mentioning user */ async getMentioningUser(userId, params) { return this.client.get(this.getShopPath(`/customer-notes/mentioning/${userId}`), params); } } exports.CustomerNoteResource = CustomerNoteResource; //# sourceMappingURL=customer-note.js.map