timber-node 0.4.6 → 0.4.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/customer.js CHANGED
@@ -30,7 +30,7 @@ class CustomerService {
30
30
  * ```
31
31
  */
32
32
  async list(params = { role: 'customer' }) {
33
- return await this.http.get('/user/sdk/customer/customer', { params });
33
+ return await this.http.get('/user/sdk/customer/invoice-customer', { params });
34
34
  }
35
35
  /**
36
36
  * Fetch a single customer by ID.
@@ -75,7 +75,9 @@ class CustomerService {
75
75
  Object.entries(data).forEach(([key, value]) => {
76
76
  appendFormData(key, value);
77
77
  });
78
- return await this.http.post('/user/sdk/customer/customer', formData, { headers });
78
+ return await this.http.post('/user/sdk/customer/invoice-customer', formData, {
79
+ headers,
80
+ });
79
81
  }
80
82
  /**
81
83
  * Update an existing customer.
@@ -122,7 +124,7 @@ class CustomerService {
122
124
  Object.entries(data).forEach(([key, value]) => {
123
125
  appendFormData(key, value);
124
126
  });
125
- return await this.http.put(`/user/sdk/customer/customer/${id}`, formData, {
127
+ return await this.http.put(`/user/sdk/customer/invoice-customer/${id}`, formData, {
126
128
  headers,
127
129
  });
128
130
  }
@@ -139,7 +141,7 @@ class CustomerService {
139
141
  * ```
140
142
  */
141
143
  async delete(id) {
142
- return await this.http.delete(`/user/sdk/customer/customer/${id}`);
144
+ return await this.http.delete(`/user/sdk/customer/invoice-customer/${id}`);
143
145
  }
144
146
  }
145
147
  exports.CustomerService = CustomerService;
package/dist/index.js CHANGED
@@ -34,6 +34,7 @@ class TimberClient {
34
34
  },
35
35
  });
36
36
  delete http.defaults.headers.post['Content-Type'];
37
+ http.interceptors.response.use((response) => response.data);
37
38
  // Create HTTP client for auth service only (with partner API key if provided)
38
39
  const authHttp = axios_1.default.create({
39
40
  baseURL: baseURL,
@@ -44,6 +45,7 @@ class TimberClient {
44
45
  },
45
46
  });
46
47
  delete authHttp.defaults.headers.post['Content-Type'];
48
+ authHttp.interceptors.response.use((response) => response.data);
47
49
  this.auth = new auth_1.AuthService(authHttp);
48
50
  this.expense = new expense_1.ExpenseService(http);
49
51
  this.expenseCategory = new expenseCategory_1.ExpenseCategoryService(http);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "timber-node",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "Simplifying accounting and tax filing for businesses",
5
5
  "keywords": [
6
6
  "timber"