washday-sdk 0.0.109 → 0.0.110

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.
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import axiosInstance from "../axiosInstance";
11
11
  const GET_SET_CUSTOMERS = 'api/customer';
12
+ const GET_SET_CUSTOMERS_APP = 'api/v2/washdayapp/customers';
12
13
  // export const bulkUpdate = async function (this: WashdayClientInstance, storeId: string, data: any): Promise<any> {
13
14
  // try {
14
15
  // const config = {
@@ -35,3 +36,17 @@ export const updateById = function (id, data) {
35
36
  }
36
37
  });
37
38
  };
39
+ export const updateByIdCustomersApp = function (id, data) {
40
+ return __awaiter(this, void 0, void 0, function* () {
41
+ try {
42
+ const config = {
43
+ headers: { Authorization: `Bearer ${this.apiToken}` }
44
+ };
45
+ return yield axiosInstance.put(`${GET_SET_CUSTOMERS_APP}/${id}`, data, config);
46
+ }
47
+ catch (error) {
48
+ console.error('Error fetching updateByIdCustomersApp:', error);
49
+ throw error;
50
+ }
51
+ });
52
+ };
package/dist/api/index.js CHANGED
@@ -100,6 +100,7 @@ const WashdayClient = function WashdayClient(apiToken) {
100
100
  create: customersEndpoints.postModule.create,
101
101
  updateById: customersEndpoints.putModule.updateById,
102
102
  deleteById: customersEndpoints.deleteModule.deleteById,
103
+ updateByIdCustomersApp: customersEndpoints.putModule.updateByIdCustomersApp,
103
104
  });
104
105
  this.stores = bindMethods(this, {
105
106
  getStores: getStores,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.109",
3
+ "version": "0.0.110",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -1,7 +1,7 @@
1
1
  import { WashdayClientInstance } from "../../interfaces/Api";
2
2
  import axiosInstance from "../axiosInstance";
3
3
  const GET_SET_CUSTOMERS = 'api/customer';
4
-
4
+ const GET_SET_CUSTOMERS_APP = 'api/v2/washdayapp/customers';
5
5
  // export const bulkUpdate = async function (this: WashdayClientInstance, storeId: string, data: any): Promise<any> {
6
6
  // try {
7
7
  // const config = {
@@ -42,3 +42,20 @@ export const updateById = async function (this: WashdayClientInstance, id: strin
42
42
  throw error;
43
43
  }
44
44
  };
45
+
46
+ export const updateByIdCustomersApp = async function (this: WashdayClientInstance, id: string, data: {
47
+ name?: string;
48
+ phone?: string;
49
+ address?: string;
50
+ notes?: string;
51
+ }): Promise<any> {
52
+ try {
53
+ const config = {
54
+ headers: { Authorization: `Bearer ${this.apiToken}` }
55
+ };
56
+ return await axiosInstance.put(`${GET_SET_CUSTOMERS_APP}/${id}`, data, config);
57
+ } catch (error) {
58
+ console.error('Error fetching updateByIdCustomersApp:', error);
59
+ throw error;
60
+ }
61
+ };
package/src/api/index.ts CHANGED
@@ -106,6 +106,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
106
106
  create: customersEndpoints.postModule.create,
107
107
  updateById: customersEndpoints.putModule.updateById,
108
108
  deleteById: customersEndpoints.deleteModule.deleteById,
109
+ updateByIdCustomersApp: customersEndpoints.putModule.updateByIdCustomersApp,
109
110
  });
110
111
  this.stores = bindMethods(this, {
111
112
  getStores: getStores,
@@ -92,6 +92,7 @@ export interface WashdayClientInstance {
92
92
  create: typeof customersEndpoints.postModule.create;
93
93
  updateById: typeof customersEndpoints.putModule.updateById;
94
94
  deleteById: typeof customersEndpoints.deleteModule.deleteById;
95
+ updateByIdCustomersApp: typeof customersEndpoints.putModule.updateByIdCustomersApp;
95
96
  };
96
97
  stores: {
97
98
  getStores: typeof getStores;