timber-node 0.2.2 → 0.2.4

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.
@@ -19,6 +19,7 @@ export interface Customer extends CustomerData {
19
19
  export interface CustomerQueryParams {
20
20
  page?: number;
21
21
  limit?: number;
22
+ role: 'customer' | 'vendor' | 'biller';
22
23
  }
23
24
  /**
24
25
  * Service for Customer
package/dist/customer.js CHANGED
@@ -29,7 +29,7 @@ class CustomerService {
29
29
  * console.log(customers.data);
30
30
  * ```
31
31
  */
32
- async list(params = {}) {
32
+ async list(params = { role: 'customer' }) {
33
33
  return await this.http.get('/customer/customer', { params });
34
34
  }
35
35
  /**
@@ -23,6 +23,9 @@ export interface InvoiceItemQueryParams {
23
23
  search?: string;
24
24
  filters?: string;
25
25
  }
26
+ interface SuggestionParams {
27
+ search: string;
28
+ }
26
29
  /**
27
30
  * Service for Invoice Item
28
31
  *
@@ -44,11 +47,24 @@ export declare class InvoiceItemService {
44
47
  *
45
48
  * @example
46
49
  * ```ts
47
- * const invoiceItems = await client.InvoiceItem.list();
50
+ * const invoiceItems = await client.InvoiceItem.list({page: 1, limit: 10});
51
+ * console.log(invoiceItems.data);
52
+ * ```
53
+ */
54
+ list(params: InvoiceItemQueryParams): Promise<AxiosResponse<InvoiceItem>>;
55
+ /**
56
+ * Invoice Item suggestions.
57
+ *
58
+ * @param params
59
+ * @returns
60
+ *
61
+ * @example
62
+ * ```ts
63
+ * const invoiceItems = await client.InvoiceItem.suggestions({search: ''});
48
64
  * console.log(invoiceItems.data);
49
65
  * ```
50
66
  */
51
- list(): Promise<AxiosResponse<InvoiceItem>>;
67
+ suggestions({ search }: SuggestionParams): Promise<AxiosResponse<InvoiceItem>>;
52
68
  /**
53
69
  * Create a new invoice template.
54
70
  *
@@ -84,3 +100,4 @@ export declare class InvoiceItemService {
84
100
  */
85
101
  update(id: string, data: CreateInvoiceItemRequest): Promise<AxiosResponse<InvoiceItem>>;
86
102
  }
103
+ export {};
@@ -23,12 +23,29 @@ class InvoiceItemService {
23
23
  *
24
24
  * @example
25
25
  * ```ts
26
- * const invoiceItems = await client.InvoiceItem.list();
26
+ * const invoiceItems = await client.InvoiceItem.list({page: 1, limit: 10});
27
27
  * console.log(invoiceItems.data);
28
28
  * ```
29
29
  */
30
- async list() {
31
- return await this.http.get('/customer/invoice-item');
30
+ async list(params) {
31
+ return await this.http.get('/customer/invoice-item', { params });
32
+ }
33
+ /**
34
+ * Invoice Item suggestions.
35
+ *
36
+ * @param params
37
+ * @returns
38
+ *
39
+ * @example
40
+ * ```ts
41
+ * const invoiceItems = await client.InvoiceItem.suggestions({search: ''});
42
+ * console.log(invoiceItems.data);
43
+ * ```
44
+ */
45
+ async suggestions({ search }) {
46
+ return await this.http.get('/customer/invoice-item/suggestions', {
47
+ params: { search },
48
+ });
32
49
  }
33
50
  /**
34
51
  * Create a new invoice template.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "timber-node",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "Simplifying accounting and tax filing for businesses",
5
5
  "keywords": [
6
6
  "timber"