timber-node 0.0.7 → 0.0.9

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.
@@ -1,6 +1,8 @@
1
- import { AxiosInstance, AxiosResponse } from 'axios';
1
+ import { AxiosInstance, AxiosProgressEvent, AxiosResponse, CancelToken } from 'axios';
2
2
  export interface BankStatementData {
3
3
  file: File | string;
4
+ progressCallback?: (progressEvent: AxiosProgressEvent) => void;
5
+ cancelToken?: CancelToken;
4
6
  }
5
7
  export interface BankStatement extends BankStatementData {
6
8
  _id: string;
@@ -54,13 +54,14 @@ class BankStatementService {
54
54
  const formData = new form_data_1.default();
55
55
  if (data === null || data === void 0 ? void 0 : data.file) {
56
56
  formData.append('file', data.file);
57
- formData.append('company', '6777a90c5cd5d327209fa239');
58
57
  }
59
58
  else {
60
59
  throw new Error('File is required');
61
60
  }
62
61
  return await this.http.post('/customer/reconcile/bank-statement', formData, {
63
62
  headers: formData.getHeaders(),
63
+ cancelToken: data.cancelToken,
64
+ onUploadProgress: data.progressCallback,
64
65
  });
65
66
  }
66
67
  }
package/dist/company.d.ts CHANGED
@@ -62,7 +62,6 @@ export declare class CompanyService {
62
62
  * console.log(companies.data);
63
63
  * ```
64
64
  */
65
- list(params?: CompanyQueryParams): Promise<AxiosResponse<Company[]>>;
66
65
  /**
67
66
  * Fetch an company by ID.
68
67
  *
@@ -75,7 +74,7 @@ export declare class CompanyService {
75
74
  * console.log(company.data);
76
75
  * ```
77
76
  */
78
- get(id: string): Promise<AxiosResponse<Company>>;
77
+ get(): Promise<AxiosResponse<Company>>;
79
78
  /**
80
79
  * Create a new company.
81
80
  *
package/dist/company.js CHANGED
@@ -32,9 +32,9 @@ class CompanyService {
32
32
  * console.log(companies.data);
33
33
  * ```
34
34
  */
35
- async list(params = {}) {
36
- return await this.http.get('/customer/company', { params });
37
- }
35
+ // async list(params: CompanyQueryParams = {}): Promise<AxiosResponse<Company[]>> {
36
+ // return await this.http.get<Company[]>('/customer/company', { params });
37
+ // }
38
38
  /**
39
39
  * Fetch an company by ID.
40
40
  *
@@ -47,8 +47,8 @@ class CompanyService {
47
47
  * console.log(company.data);
48
48
  * ```
49
49
  */
50
- async get(id) {
51
- return await this.http.get(`/customer/company/${id}`);
50
+ async get() {
51
+ return await this.http.get(`/customer/company`);
52
52
  }
53
53
  /**
54
54
  * Create a new company.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "timber-node",
3
- "version": "0.0.7",
3
+ "version": "0.0.9",
4
4
  "description": "Simplifying accounting and tax filing for businesses",
5
5
  "keywords": [
6
6
  "timber"