washday-sdk 1.1.5 → 1.1.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.
@@ -18,7 +18,7 @@ export const getList = function (params, options) {
18
18
  headers: { Authorization: `Bearer ${this.apiToken}` },
19
19
  signal: (options === null || options === void 0 ? void 0 : options.signal) || params.signal || undefined
20
20
  };
21
- const queryParams = generateQueryParamsStr(['searchTerm', 'name', 'phone', 'email', 'fromDate', 'toDate', 'limit', 'pageNum'], params);
21
+ const queryParams = generateQueryParamsStr(['searchTerm', 'name', 'phone', 'email', 'fromDate', 'toDate', 'limit', 'pageNum', 'createdIn'], params);
22
22
  return yield axiosInstance.get(`${GET_SET_CUSTOMERS}?${queryParams}`, config);
23
23
  }
24
24
  catch (error) {
@@ -30,7 +30,7 @@ export const bulkCreate = function (storeId, data) {
30
30
  const config = {
31
31
  headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
32
32
  };
33
- const response = yield axiosInstance.post(`${GET_SET_CUSTOMERS}/bulk`, data, config);
33
+ const response = yield axiosInstance.post(`${GET_SET_CUSTOMERS}/bulk`, Object.assign(Object.assign({}, data), { createdIn: storeId }), config);
34
34
  return response.data || {};
35
35
  }
36
36
  catch (error) {
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "1.1.5",
3
+ "version": "1.1.7",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
7
7
  "scripts": {
8
8
  "test": "jest",
9
9
  "build": "tsc",
10
+ "bump-version": "npm version patch",
10
11
  "publishVersion": "npm run build && npm publish --access public"
11
12
  },
12
13
  "keywords": [
@@ -15,7 +15,8 @@ export const getList = async function (this: WashdayClientInstance, params: {
15
15
  fromDate?: string
16
16
  toDate?: string
17
17
  limit: string
18
- pageNum: string
18
+ pageNum: string,
19
+ createdIn?: string
19
20
  signal?: GenericAbortSignal
20
21
  }, options?: { signal?: GenericAbortSignal }): Promise<any> {
21
22
  try {
@@ -23,7 +24,7 @@ export const getList = async function (this: WashdayClientInstance, params: {
23
24
  headers: { Authorization: `Bearer ${this.apiToken}` },
24
25
  signal: options?.signal || params.signal || undefined
25
26
  };
26
- const queryParams = generateQueryParamsStr(['searchTerm', 'name', 'phone', 'email', 'fromDate', 'toDate', 'limit', 'pageNum'], params);
27
+ const queryParams = generateQueryParamsStr(['searchTerm', 'name', 'phone', 'email', 'fromDate', 'toDate', 'limit', 'pageNum', 'createdIn'], params);
27
28
  return await axiosInstance.get(`${GET_SET_CUSTOMERS}?${queryParams}`, config);
28
29
  } catch (error) {
29
30
  if (error instanceof Error && (error.name === 'AbortError' || error.name === 'CanceledError')) {
@@ -21,6 +21,7 @@ export const create = async function (this: WashdayClientInstance, data: {
21
21
  zipCode?: string;
22
22
  };
23
23
  isActive: boolean;
24
+ createdIn?: string;
24
25
  }): Promise<any> {
25
26
  try {
26
27
  const config = {
@@ -39,7 +40,10 @@ export const bulkCreate = async function (this: WashdayClientInstance, storeId:
39
40
  const config = {
40
41
  headers: { Authorization: `Bearer ${this.apiToken}`, 'Content-Type': false }
41
42
  };
42
- const response = await axiosInstance.post(`${GET_SET_CUSTOMERS}/bulk`, data, config);
43
+ const response = await axiosInstance.post(`${GET_SET_CUSTOMERS}/bulk`, {
44
+ ...data,
45
+ createdIn: storeId
46
+ }, config);
43
47
  return response.data || {}
44
48
  } catch (error) {
45
49
  console.error('Error fetching customers bulkCreate:', error);