timber-node 0.4.5 → 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/README.md CHANGED
@@ -50,8 +50,12 @@ client.customer;
50
50
  client.taxRate;
51
51
  client.salary;
52
52
  client.employee;
53
- client.bankStatement;
54
53
  client.cheque;
54
+ client.bankStatement;
55
+ client.company;
56
+ client.invoiceNumber;
57
+ client.invoiceSettings;
58
+ client.invoiceItem;
55
59
  ```
56
60
 
57
61
  Each service provides common operations like `create`, `get`, `list`, `update`, and `delete` where applicable.
package/dist/auth.js CHANGED
@@ -63,7 +63,7 @@ class AuthService {
63
63
  * ```
64
64
  */
65
65
  async create(data) {
66
- return await this.http.post('/auth/register', data);
66
+ return await this.http.post('/user/sdk/auth/register', data);
67
67
  }
68
68
  }
69
69
  exports.AuthService = AuthService;
@@ -30,7 +30,9 @@ class BankStatementService {
30
30
  * ```
31
31
  */
32
32
  async list(params = {}) {
33
- return await this.http.get('/customer/reconcile/bank-statement', { params });
33
+ return await this.http.get('/reconcile/sdk/customer/bank-statement', {
34
+ params,
35
+ });
34
36
  }
35
37
  /**
36
38
  * Create a new bank statement.
@@ -55,7 +57,7 @@ class BankStatementService {
55
57
  else {
56
58
  throw new Error('File is required');
57
59
  }
58
- return await this.http.post('/customer/reconcile/bank-statement', formData, {
60
+ return await this.http.post('/reconcile/sdk/customer/bank-statement', formData, {
59
61
  headers,
60
62
  cancelToken: data.cancelToken,
61
63
  onUploadProgress: data.progressCallback,
@@ -30,7 +30,7 @@ class BillPaymentService {
30
30
  * ```
31
31
  */
32
32
  async list(params) {
33
- return await this.http.get('/customer/purchase/payment-record', {
33
+ return await this.http.get('/user/sdk/customer/purchase/payment-record', {
34
34
  params,
35
35
  });
36
36
  }
@@ -79,7 +79,7 @@ class BillPaymentService {
79
79
  if (data.file) {
80
80
  formData.append('file', data.file);
81
81
  }
82
- return await this.http.post('/customer/purchase/payment-record', formData, {
82
+ return await this.http.post('/user/sdk/customer/purchase/payment-record', formData, {
83
83
  headers,
84
84
  });
85
85
  }
@@ -118,7 +118,7 @@ class BillPaymentService {
118
118
  if (data.file) {
119
119
  formData.append('file', data.file);
120
120
  }
121
- return await this.http.put(`/customer/purchase/payment-record/${id}`, formData, {
121
+ return await this.http.put(`/user/sdk/customer/purchase/payment-record/${id}`, formData, {
122
122
  headers,
123
123
  });
124
124
  }
@@ -135,7 +135,7 @@ class BillPaymentService {
135
135
  * ```
136
136
  */
137
137
  async delete(id) {
138
- return await this.http.delete(`/customer/purchase/payment-record/${id}`);
138
+ return await this.http.delete(`/user/sdk/customer/purchase/payment-record/${id}`);
139
139
  }
140
140
  }
141
141
  exports.BillPaymentService = BillPaymentService;
package/dist/cheque.js CHANGED
@@ -30,7 +30,7 @@ class ChequeService {
30
30
  * ```
31
31
  */
32
32
  async list(params = {}) {
33
- return await this.http.get('/customer/reconcile/cheque', { params });
33
+ return await this.http.get('/reconcile/sdk/customer/cheque', { params });
34
34
  }
35
35
  /**
36
36
  * Create a new cheque.
@@ -55,7 +55,7 @@ class ChequeService {
55
55
  else {
56
56
  throw new Error('File is required');
57
57
  }
58
- return await this.http.post('/customer/reconcile/cheque', formData, {
58
+ return await this.http.post('/reconcile/sdk/customer/cheque', formData, {
59
59
  headers,
60
60
  cancelToken: data.cancelToken,
61
61
  onUploadProgress: data.progressCallback,
package/dist/company.js CHANGED
@@ -48,7 +48,7 @@ class CompanyService {
48
48
  * ```
49
49
  */
50
50
  async get() {
51
- return await this.http.get(`/customer/company`);
51
+ return await this.http.get(`/user/sdk/customer/company`);
52
52
  }
53
53
  /**
54
54
  * Create a new company.
@@ -118,7 +118,7 @@ class CompanyService {
118
118
  data.sector.forEach((item, index) => {
119
119
  formData.append(`sector[${index}]`, item);
120
120
  });
121
- return await this.http.post('/customer/company', formData, {
121
+ return await this.http.post('/user/sdk/customer/company', formData, {
122
122
  headers: formData.getHeaders(),
123
123
  });
124
124
  }
@@ -169,7 +169,7 @@ class CompanyService {
169
169
  formData.append(`sector[${index}]`, item);
170
170
  });
171
171
  }
172
- return await this.http.put(`/customer/company/${id}`, data, {
172
+ return await this.http.put(`/user/sdk/customer/company/${id}`, data, {
173
173
  headers: formData.getHeaders(),
174
174
  });
175
175
  }
@@ -185,7 +185,7 @@ class CompanyService {
185
185
  * ```
186
186
  * */
187
187
  async default(id) {
188
- return await this.http.patch(`/customer/company/${id}/default`);
188
+ return await this.http.patch(`/user/sdk/customer/company/${id}/default`);
189
189
  }
190
190
  }
191
191
  exports.CompanyService = CompanyService;
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('/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('/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,9 @@ class CustomerService {
122
124
  Object.entries(data).forEach(([key, value]) => {
123
125
  appendFormData(key, value);
124
126
  });
125
- return await this.http.put(`/customer/customer/${id}`, formData, { headers });
127
+ return await this.http.put(`/user/sdk/customer/invoice-customer/${id}`, formData, {
128
+ headers,
129
+ });
126
130
  }
127
131
  /**
128
132
  * Delete an customer by ID.
@@ -137,7 +141,7 @@ class CustomerService {
137
141
  * ```
138
142
  */
139
143
  async delete(id) {
140
- return await this.http.delete(`/customer/customer/${id}`);
144
+ return await this.http.delete(`/user/sdk/customer/invoice-customer/${id}`);
141
145
  }
142
146
  }
143
147
  exports.CustomerService = CustomerService;
package/dist/employee.js CHANGED
@@ -18,7 +18,7 @@ class EmployeeService {
18
18
  * ```
19
19
  */
20
20
  async list(params) {
21
- return await this.http.get('/customer/employee', {
21
+ return await this.http.get('/user/sdk/customer/employee', {
22
22
  params,
23
23
  });
24
24
  }
package/dist/expense.js CHANGED
@@ -29,7 +29,7 @@ class ExpenseService {
29
29
  * ```
30
30
  */
31
31
  async list(params) {
32
- return await this.http.get('/customer/expense', { params });
32
+ return await this.http.get('/user/sdk/customer/expense', { params });
33
33
  }
34
34
  /**
35
35
  * Fetch a single expense by ID.
@@ -44,7 +44,7 @@ class ExpenseService {
44
44
  * ```
45
45
  */
46
46
  async get(id) {
47
- return await this.http.get(`/customer/expense/${id}`);
47
+ return await this.http.get(`/user/sdk/customer/expense/${id}`);
48
48
  }
49
49
  /**
50
50
  * Create a new expense.
@@ -67,7 +67,7 @@ class ExpenseService {
67
67
  * ```
68
68
  */
69
69
  async create(data) {
70
- return await this.http.post('/customer/expense', data);
70
+ return await this.http.post('/user/sdk/customer/expense', data);
71
71
  }
72
72
  /**
73
73
  * Update an existing expense.
@@ -84,7 +84,7 @@ class ExpenseService {
84
84
  * ```
85
85
  */
86
86
  async update(id, data) {
87
- return await this.http.put(`/customer/expense/${id}`, data);
87
+ return await this.http.put(`/user/sdk/customer/expense/${id}`, data);
88
88
  }
89
89
  /**
90
90
  * Delete an expense by ID.
@@ -99,7 +99,7 @@ class ExpenseService {
99
99
  * ```
100
100
  */
101
101
  async delete(id) {
102
- return await this.http.patch(`/customer/expense/${id}`);
102
+ return await this.http.patch(`/user/sdk/customer/expense/${id}`);
103
103
  }
104
104
  }
105
105
  exports.ExpenseService = ExpenseService;
@@ -29,7 +29,7 @@ class ExpenseCategoryService {
29
29
  * ```
30
30
  */
31
31
  async list(params) {
32
- return await this.http.get('/customer/expense/category', {
32
+ return await this.http.get('/user/sdk/customer/expense/category', {
33
33
  params,
34
34
  });
35
35
  }
@@ -49,7 +49,7 @@ class ExpenseCategoryService {
49
49
  * ```
50
50
  */
51
51
  async create(data) {
52
- return await this.http.post('/customer/expense/category', data);
52
+ return await this.http.post('/user/sdk/customer/expense/category', data);
53
53
  }
54
54
  /**
55
55
  * Update an existing expense category.
@@ -66,7 +66,7 @@ class ExpenseCategoryService {
66
66
  * ```
67
67
  */
68
68
  async update(id, data) {
69
- return await this.http.put(`/customer/expense/category/${id}`, data);
69
+ return await this.http.put(`/user/sdk/customer/expense/category/${id}`, data);
70
70
  }
71
71
  /**
72
72
  * Delete an expense category by ID.
@@ -81,7 +81,7 @@ class ExpenseCategoryService {
81
81
  * ```
82
82
  */
83
83
  async delete(id) {
84
- return await this.http.delete(`/customer/expense/category/${id}`);
84
+ return await this.http.delete(`/user/sdk/customer/expense/category/${id}`);
85
85
  }
86
86
  }
87
87
  exports.ExpenseCategoryService = ExpenseCategoryService;
package/dist/index.js CHANGED
@@ -25,7 +25,7 @@ const invoiceSettings_1 = require("./invoiceSettings");
25
25
  const invoiceItem_1 = require("./invoiceItem");
26
26
  class TimberClient {
27
27
  constructor(apiKey, options = {}) {
28
- const baseURL = `${options.baseURL || 'https://api.timber.me'}/api/v1/user/sdk`;
28
+ const baseURL = `${options.baseURL || 'https://api.timber.me'}/api/v1`;
29
29
  // Create HTTP client for regular services (non-auth)
30
30
  const http = axios_1.default.create({
31
31
  baseURL: baseURL,
@@ -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/dist/invoice.js CHANGED
@@ -31,7 +31,7 @@ class InvoiceService {
31
31
  * ```
32
32
  */
33
33
  async list(params = {}) {
34
- return await this.http.get('/customer/invoice', { params });
34
+ return await this.http.get('/user/sdk/customer/invoice', { params });
35
35
  }
36
36
  /**
37
37
  * Fetch an invoice by ID.
@@ -46,7 +46,7 @@ class InvoiceService {
46
46
  * ```
47
47
  */
48
48
  async get(id) {
49
- return await this.http.get(`/customer/invoice/${id}`);
49
+ return await this.http.get(`/user/sdk/customer/invoice/${id}`);
50
50
  }
51
51
  async create(data) {
52
52
  const { formData, headers } = await (0, getFormData_1.getFormData)();
@@ -64,7 +64,7 @@ class InvoiceService {
64
64
  // formattedFormData.append(key, value.toString());
65
65
  // }
66
66
  // }
67
- return await this.http.post('/customer/invoice', formattedFormData, {
67
+ return await this.http.post('/user/sdk/customer/invoice', formattedFormData, {
68
68
  headers,
69
69
  });
70
70
  }
@@ -84,7 +84,7 @@ class InvoiceService {
84
84
  // formattedFormData.append(key, value.toString());
85
85
  // }
86
86
  // }
87
- return await this.http.put(`/customer/invoice/${id}`, formattedFormData, {
87
+ return await this.http.put(`/user/sdk/customer/invoice/${id}`, formattedFormData, {
88
88
  headers,
89
89
  });
90
90
  }
@@ -101,7 +101,7 @@ class InvoiceService {
101
101
  * ```
102
102
  */
103
103
  async delete(id, data) {
104
- return await this.http.delete(`/customer/invoice/${id}`, {
104
+ return await this.http.delete(`/user/sdk/customer/invoice/${id}`, {
105
105
  data,
106
106
  });
107
107
  }
@@ -118,7 +118,7 @@ class InvoiceService {
118
118
  * ```
119
119
  */
120
120
  async download(id) {
121
- return await this.http.get(`/customer/invoice/download/${id}`, {
121
+ return await this.http.get(`/user/sdk/customer/invoice/download/${id}`, {
122
122
  responseType: 'arraybuffer', // Important: tells Axios to treat the response as binary
123
123
  });
124
124
  }
@@ -28,7 +28,7 @@ class InvoiceItemService {
28
28
  * ```
29
29
  */
30
30
  async list(params) {
31
- return await this.http.get('/customer/invoice-item', { params });
31
+ return await this.http.get('/user/sdk/customer/invoice-item', { params });
32
32
  }
33
33
  /**
34
34
  * Invoice Item suggestions.
@@ -43,7 +43,7 @@ class InvoiceItemService {
43
43
  * ```
44
44
  */
45
45
  async suggestions({ search }) {
46
- return await this.http.get('/customer/invoice-item/suggestions', {
46
+ return await this.http.get('/user/sdk/customer/invoice-item/suggestions', {
47
47
  params: { search },
48
48
  });
49
49
  }
@@ -66,7 +66,7 @@ class InvoiceItemService {
66
66
  * ```
67
67
  */
68
68
  async create(data) {
69
- return await this.http.post('/customer/invoice-item', data);
69
+ return await this.http.post('/user/sdk/customer/invoice-item', data);
70
70
  }
71
71
  /**
72
72
  * Update an existing invoice template.
@@ -83,7 +83,7 @@ class InvoiceItemService {
83
83
  * ```
84
84
  */
85
85
  async update(id, data) {
86
- return await this.http.patch(`/customer/invoice-item/${id}`, data);
86
+ return await this.http.patch(`/user/sdk/customer/invoice-item/${id}`, data);
87
87
  }
88
88
  }
89
89
  exports.InvoiceItemService = InvoiceItemService;
@@ -27,7 +27,7 @@ class InvoiceNumberService {
27
27
  * ```
28
28
  */
29
29
  async get() {
30
- return await this.http.get(`/customer/invoice-number`);
30
+ return await this.http.get(`/user/sdk/customer/invoice-number`);
31
31
  }
32
32
  /**
33
33
  * Fetch next invoice number.
@@ -41,7 +41,7 @@ class InvoiceNumberService {
41
41
  * ```
42
42
  */
43
43
  async next() {
44
- return await this.http.get(`/customer/invoice-number/next`);
44
+ return await this.http.get(`/user/sdk/customer/invoice-number/next`);
45
45
  }
46
46
  /**
47
47
  * Update an existing invoice number.
@@ -58,7 +58,7 @@ class InvoiceNumberService {
58
58
  * ```
59
59
  */
60
60
  async update(data) {
61
- return await this.http.patch(`/customer/invoice-number`, data);
61
+ return await this.http.patch(`/user/sdk/customer/invoice-number`, data);
62
62
  }
63
63
  }
64
64
  exports.InvoiceNumberService = InvoiceNumberService;
@@ -32,7 +32,9 @@ class InvoicePaymentService {
32
32
  async list(params = {
33
33
  invoice: '',
34
34
  }) {
35
- return await this.http.get('/customer/invoice/payment-records', { params });
35
+ return await this.http.get('/user/sdk/customer/invoice/payment-records', {
36
+ params,
37
+ });
36
38
  }
37
39
  /**
38
40
  * Create a new invoice payment.
@@ -79,7 +81,7 @@ class InvoicePaymentService {
79
81
  if (data.file) {
80
82
  formData.append('file', data.file);
81
83
  }
82
- return await this.http.post('/customer/invoice/payment-records', formData, {
84
+ return await this.http.post('/user/sdk/customer/invoice/payment-records', formData, {
83
85
  headers,
84
86
  });
85
87
  }
@@ -126,7 +128,7 @@ class InvoicePaymentService {
126
128
  if (data.file) {
127
129
  formData.append('file', data.file);
128
130
  }
129
- return await this.http.put(`/customer/invoice/payment-records/${id}`, formData, {
131
+ return await this.http.put(`/user/sdk/customer/invoice/payment-records/${id}`, formData, {
130
132
  headers,
131
133
  });
132
134
  }
@@ -143,7 +145,7 @@ class InvoicePaymentService {
143
145
  * ```
144
146
  */
145
147
  async get(id) {
146
- return await this.http.get(`/customer/invoice/payment-records/${id}`);
148
+ return await this.http.get(`/user/sdk/customer/invoice/payment-records/${id}`);
147
149
  }
148
150
  /**
149
151
  * Delete an invoice payment by ID.
@@ -158,7 +160,7 @@ class InvoicePaymentService {
158
160
  * ```
159
161
  */
160
162
  async delete(id, data) {
161
- return await this.http.delete(`/customer/invoice/payment-records/${id}`, {
163
+ return await this.http.delete(`/user/sdk/customer/invoice/payment-records/${id}`, {
162
164
  data,
163
165
  });
164
166
  }
@@ -28,7 +28,7 @@ class InvoiceSettingsService {
28
28
  * ```
29
29
  */
30
30
  async list(params) {
31
- return await this.http.get('/customer/invoice-settings', {
31
+ return await this.http.get('/user/sdk/customer/invoice-settings', {
32
32
  params,
33
33
  });
34
34
  }
@@ -44,7 +44,7 @@ class InvoiceSettingsService {
44
44
  * console.log(invoiceSettings.data);
45
45
  * ``` */
46
46
  async get(id) {
47
- return await this.http.get(`/customer/invoice-settings/${id}`);
47
+ return await this.http.get(`/user/sdk/customer/invoice-settings/${id}`);
48
48
  }
49
49
  /**
50
50
  * Create a new invoice template.
@@ -73,7 +73,7 @@ class InvoiceSettingsService {
73
73
  * ```
74
74
  */
75
75
  async create(data) {
76
- return await this.http.post('/customer/invoice-settings', data);
76
+ return await this.http.post('/user/sdk/customer/invoice-settings', data);
77
77
  }
78
78
  /**
79
79
  * Update an existing invoice template.
@@ -95,7 +95,7 @@ class InvoiceSettingsService {
95
95
  * ```
96
96
  */
97
97
  async update(id, data) {
98
- return await this.http.put(`/customer/invoice-settings/${id}`, data);
98
+ return await this.http.put(`/user/sdk/customer/invoice-settings/${id}`, data);
99
99
  }
100
100
  /**
101
101
  * Delete an invoice template by ID.
@@ -110,7 +110,7 @@ class InvoiceSettingsService {
110
110
  * ```
111
111
  */
112
112
  async delete(id) {
113
- return await this.http.delete(`/customer/invoice-settings/${id}`);
113
+ return await this.http.delete(`/user/sdk/customer/invoice-settings/${id}`);
114
114
  }
115
115
  }
116
116
  exports.InvoiceSettingsService = InvoiceSettingsService;
@@ -29,7 +29,7 @@ class RawExpenseService {
29
29
  * ```
30
30
  */
31
31
  async list(params) {
32
- return await this.http.get('/customer/expense/raw', {
32
+ return await this.http.get('/user/sdk/customer/expense/raw', {
33
33
  params,
34
34
  });
35
35
  }
@@ -51,7 +51,7 @@ class RawExpenseService {
51
51
  async create(data) {
52
52
  const formData = new FormData();
53
53
  formData.append('file', data.file);
54
- return await this.http.post('/customer/expense/raw', formData, {
54
+ return await this.http.post('/user/sdk/customer/expense/raw', formData, {
55
55
  headers: {
56
56
  'Content-Type': 'multipart/form-data',
57
57
  },
@@ -70,7 +70,7 @@ class RawExpenseService {
70
70
  * ```
71
71
  */
72
72
  async delete(id) {
73
- return await this.http.delete(`/customer/expense/raw/${id}`);
73
+ return await this.http.delete(`/user/sdk/customer/expense/raw/${id}`);
74
74
  }
75
75
  }
76
76
  exports.RawExpenseService = RawExpenseService;
package/dist/salary.js CHANGED
@@ -29,7 +29,7 @@ class SalaryService {
29
29
  * ```
30
30
  */
31
31
  async list(params) {
32
- return await this.http.get('/customer/salary', {
32
+ return await this.http.get('/user/sdk/customer/salary', {
33
33
  params,
34
34
  });
35
35
  }
@@ -46,7 +46,7 @@ class SalaryService {
46
46
  * ```
47
47
  */
48
48
  async get(id) {
49
- return await this.http.get(`/customer/salary/${id}`);
49
+ return await this.http.get(`/user/sdk/customer/salary/${id}`);
50
50
  }
51
51
  /**
52
52
  * Create a new salary.
@@ -78,7 +78,7 @@ class SalaryService {
78
78
  * ```
79
79
  */
80
80
  async create(data) {
81
- return await this.http.post('/customer/salary', data);
81
+ return await this.http.post('/user/sdk/customer/salary', data);
82
82
  }
83
83
  /**
84
84
  * Update an existing salary.
@@ -95,7 +95,7 @@ class SalaryService {
95
95
  * ```
96
96
  */
97
97
  async update(id, data) {
98
- return await this.http.put(`/customer/salary/${id}`, data);
98
+ return await this.http.put(`/user/sdk/customer/salary/${id}`, data);
99
99
  }
100
100
  }
101
101
  exports.SalaryService = SalaryService;
package/dist/taxRate.js CHANGED
@@ -37,10 +37,10 @@ class TaxRateService {
37
37
  this.http = http;
38
38
  }
39
39
  async list(params = {}) {
40
- return await this.http.get('/customer/tax-rate', { params });
40
+ return await this.http.get('/user/sdk/customer/tax-rate', { params });
41
41
  }
42
42
  async get(id) {
43
- return await this.http.get(`/customer/tax-rate/${id}`);
43
+ return await this.http.get(`/user/sdk/customer/tax-rate/${id}`);
44
44
  }
45
45
  }
46
46
  exports.TaxRateService = TaxRateService;
@@ -12,7 +12,7 @@ function convertToFormData(obj, formData = new FormData(), parentKey = '') {
12
12
  if (obj === null || obj === undefined) {
13
13
  return formData;
14
14
  }
15
- Object.keys(obj).forEach(key => {
15
+ Object.keys(obj).forEach((key) => {
16
16
  const value = obj[key];
17
17
  const formKey = parentKey ? `${parentKey}[${key}]` : key;
18
18
  // Handle null or undefined values - skip them
@@ -30,7 +30,7 @@ class VendorPaymentService {
30
30
  * ```
31
31
  */
32
32
  async list(params) {
33
- return await this.http.get('/customer/purchase', {
33
+ return await this.http.get('/user/sdk/customer/purchase', {
34
34
  params,
35
35
  });
36
36
  }
@@ -47,7 +47,7 @@ class VendorPaymentService {
47
47
  * ```
48
48
  */
49
49
  async get(id) {
50
- return await this.http.get(`/customer/purchase/${id}`);
50
+ return await this.http.get(`/user/sdk/customer/purchase/${id}`);
51
51
  }
52
52
  /**
53
53
  * Create a new vendor payment.
@@ -150,7 +150,7 @@ class VendorPaymentService {
150
150
  if (data.logo) {
151
151
  formData.append('file', data.logo);
152
152
  }
153
- return await this.http.post('/customer/purchase', formData, {
153
+ return await this.http.post('/user/sdk/customer/purchase', formData, {
154
154
  headers,
155
155
  });
156
156
  }
@@ -210,7 +210,7 @@ class VendorPaymentService {
210
210
  if (data.logo) {
211
211
  formData.append('file', data.logo);
212
212
  }
213
- return await this.http.put(`/customer/purchase/${id}`, formData, {
213
+ return await this.http.put(`/user/sdk/customer/purchase/${id}`, formData, {
214
214
  headers,
215
215
  });
216
216
  }
@@ -227,7 +227,7 @@ class VendorPaymentService {
227
227
  * ```
228
228
  */
229
229
  async delete(id) {
230
- return await this.http.patch(`/customer/purchase/${id}`);
230
+ return await this.http.patch(`/user/sdk/customer/purchase/${id}`);
231
231
  }
232
232
  /**
233
233
  * Download a vendor payment PDF by ID.
@@ -242,7 +242,7 @@ class VendorPaymentService {
242
242
  * ```
243
243
  */
244
244
  async download(id) {
245
- return await this.http.get(`/customer/purchase/download/${id}`, {
245
+ return await this.http.get(`/user/sdk/customer/purchase/download/${id}`, {
246
246
  responseType: 'arraybuffer', // Important: tells Axios to treat the response as binary
247
247
  });
248
248
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "timber-node",
3
- "version": "0.4.5",
3
+ "version": "0.4.7",
4
4
  "description": "Simplifying accounting and tax filing for businesses",
5
5
  "keywords": [
6
6
  "timber"