UNPKG

pancake-client-sdk

Version:
44 lines 1.29 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.CustomerResource = void 0; const base_1 = require("./base"); class CustomerResource extends base_1.BaseResource { /** * Get list of customers */ async list(params) { return this.client.get(this.getShopPath('/customers'), params); } /** * Get customer by ID */ async getById(customerId) { return this.client.get(this.getShopPath(`/customers/${customerId}`)); } /** * Create new customer */ async create(data) { return this.client.post(this.getShopPath('/customers'), data); } /** * Update customer */ async update(customerId, data) { return this.client.put(this.getShopPath(`/customers/${customerId}`), data); } /** * Add customer address */ async addAddress(customerId, address) { return this.client.post(this.getShopPath(`/customers/${customerId}/addresses`), address); } /** * Get customer reward points history */ async getRewardHistory(customerId) { return this.client.get(this.getShopPath(`/customers/${customerId}/reward-points`)); } } exports.CustomerResource = CustomerResource; //# sourceMappingURL=customer.js.map