washday-sdk 0.0.80 → 0.0.82

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.
@@ -32,3 +32,41 @@ export const exportCustomersList = function (params) {
32
32
  }
33
33
  });
34
34
  };
35
+ export const exportOrdersList = function (params) {
36
+ return __awaiter(this, void 0, void 0, function* () {
37
+ try {
38
+ const config = {
39
+ headers: {
40
+ Authorization: `Bearer ${this.apiToken}`,
41
+ 'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
42
+ 'Content-disposition': 'attachment; filename=[file.csv]'
43
+ },
44
+ params: {
45
+ responseType: 'blob'
46
+ }
47
+ };
48
+ const queryParams = generateQueryParamsStr([
49
+ 'storeId',
50
+ 'status',
51
+ 'name',
52
+ 'phone',
53
+ 'email',
54
+ 'fromDate',
55
+ 'toDate',
56
+ 'sequence',
57
+ 'pageNum',
58
+ 'limit',
59
+ 'sequenceSort',
60
+ 'cleanedDateTime',
61
+ 'readyDateTime',
62
+ 'collectedDateTime',
63
+ 'q'
64
+ ], params);
65
+ return yield axiosInstance.get(`${GENERATE_EXPORT}/export-all-orders?${queryParams}`, config);
66
+ }
67
+ catch (error) {
68
+ console.error('Error fetching exportOrdersList:', error);
69
+ throw error;
70
+ }
71
+ });
72
+ };
package/dist/api/index.js CHANGED
@@ -156,6 +156,7 @@ const WashdayClient = function WashdayClient(apiToken) {
156
156
  });
157
157
  this.csv = bindMethods(this, {
158
158
  exportCustomersList: csvExportEndpoints.getModule.exportCustomersList,
159
+ exportOrdersList: csvExportEndpoints.getModule.exportOrdersList
159
160
  });
160
161
  };
161
162
  export default WashdayClient;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.80",
3
+ "version": "0.0.82",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -31,4 +31,56 @@ export const exportCustomersList = async function (this: WashdayClientInstance,
31
31
  console.error('Error fetching exportCustomersList:', error);
32
32
  throw error;
33
33
  }
34
+ };
35
+
36
+ export const exportOrdersList = async function (this: WashdayClientInstance, params: {
37
+ storeId: string | undefined,
38
+ status: string | undefined,
39
+ name: string | undefined,
40
+ phone: string | undefined,
41
+ email: string | undefined,
42
+ fromDate: string | undefined,
43
+ toDate: string | undefined,
44
+ sequence: string | undefined,
45
+ pageNum: string | undefined,
46
+ limit: string | undefined,
47
+ sequenceSort: string,
48
+ cleanedDateTime: string | undefined,
49
+ readyDateTime: string | undefined,
50
+ collectedDateTime: string | undefined,
51
+ q: string | undefined
52
+ }): Promise<any> {
53
+ try {
54
+ const config = {
55
+ headers: {
56
+ Authorization: `Bearer ${this.apiToken}`,
57
+ 'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet',
58
+ 'Content-disposition': 'attachment; filename=[file.csv]'
59
+ },
60
+ params: {
61
+ responseType: 'blob'
62
+ }
63
+ };
64
+ const queryParams = generateQueryParamsStr([
65
+ 'storeId',
66
+ 'status',
67
+ 'name',
68
+ 'phone',
69
+ 'email',
70
+ 'fromDate',
71
+ 'toDate',
72
+ 'sequence',
73
+ 'pageNum',
74
+ 'limit',
75
+ 'sequenceSort',
76
+ 'cleanedDateTime',
77
+ 'readyDateTime',
78
+ 'collectedDateTime',
79
+ 'q'
80
+ ], params)
81
+ return await axiosInstance.get(`${GENERATE_EXPORT}/export-all-orders?${queryParams}`, config);
82
+ } catch (error) {
83
+ console.error('Error fetching exportOrdersList:', error);
84
+ throw error;
85
+ }
34
86
  };
package/src/api/index.ts CHANGED
@@ -162,6 +162,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
162
162
  });
163
163
  this.csv = bindMethods(this, {
164
164
  exportCustomersList: csvExportEndpoints.getModule.exportCustomersList,
165
+ exportOrdersList: csvExportEndpoints.getModule.exportOrdersList
165
166
  });
166
167
  } as any;
167
168