washday-sdk 0.0.180 → 0.0.181

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.
@@ -41,6 +41,7 @@ export const getList = function (params, options) {
41
41
  'pickupToDate',
42
42
  'deliveryFromDate',
43
43
  'deliveryToDate',
44
+ 'fetchSection',
44
45
  ], params);
45
46
  // ], { ...params, q: params.q ? encodeURIComponent(params.q) : undefined });
46
47
  return yield axiosInstance.get(`${GET_SET_ORDER}?${queryParams}`, config);
@@ -69,13 +70,17 @@ export const getOrdersHeaderSummary = function (params) {
69
70
  }
70
71
  });
71
72
  };
72
- export const getById = function (id) {
73
+ export const getById = function (id, params, options) {
73
74
  return __awaiter(this, void 0, void 0, function* () {
74
75
  try {
75
76
  const config = {
76
- headers: { Authorization: `Bearer ${this.apiToken}` }
77
+ headers: { Authorization: `Bearer ${this.apiToken}` },
78
+ signal: (options === null || options === void 0 ? void 0 : options.signal) || undefined
77
79
  };
78
- return yield axiosInstance.get(`${GET_SET_ORDER}/${id}`, config);
80
+ const queryParams = generateQueryParamsStr([
81
+ 'fetchSection',
82
+ ], params);
83
+ return yield axiosInstance.get(`${GET_SET_ORDER}/${id}?${queryParams}`, config);
79
84
  }
80
85
  catch (error) {
81
86
  console.error('Error fetching:', error);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.180",
3
+ "version": "0.0.181",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -29,7 +29,8 @@ export const getList = async function (this: WashdayClientInstance, params: {
29
29
  pickupToDate: string | undefined,
30
30
  deliveryFromDate: string | undefined,
31
31
  deliveryToDate: string | undefined,
32
- signal?: GenericAbortSignal
32
+ signal?: GenericAbortSignal,
33
+ fetchSection?: string,
33
34
  }, options?: { signal?: GenericAbortSignal }): Promise<any> {
34
35
  try {
35
36
  const config = {
@@ -57,6 +58,7 @@ export const getList = async function (this: WashdayClientInstance, params: {
57
58
  'pickupToDate',
58
59
  'deliveryFromDate',
59
60
  'deliveryToDate',
61
+ 'fetchSection',
60
62
  ], params);
61
63
  // ], { ...params, q: params.q ? encodeURIComponent(params.q) : undefined });
62
64
  return await axiosInstance.get(`${GET_SET_ORDER}?${queryParams}`, config);
@@ -86,12 +88,18 @@ export const getOrdersHeaderSummary = async function (this: WashdayClientInstanc
86
88
  }
87
89
  };
88
90
 
89
- export const getById = async function (this: WashdayClientInstance, id: string): Promise<IOrder> {
91
+ export const getById = async function (this: WashdayClientInstance, id: string, params?: {
92
+ fetchSection?: string,
93
+ }, options?: { signal?: GenericAbortSignal }): Promise<IOrder> {
90
94
  try {
91
95
  const config = {
92
- headers: { Authorization: `Bearer ${this.apiToken}` }
96
+ headers: { Authorization: `Bearer ${this.apiToken}` },
97
+ signal: options?.signal || undefined
93
98
  };
94
- return await axiosInstance.get(`${GET_SET_ORDER}/${id}`, config);
99
+ const queryParams = generateQueryParamsStr([
100
+ 'fetchSection',
101
+ ], params);
102
+ return await axiosInstance.get(`${GET_SET_ORDER}/${id}?${queryParams}`, config);
95
103
  } catch (error) {
96
104
  console.error('Error fetching:', error);
97
105
  throw error;