washday-sdk 0.0.116 → 0.0.118

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.
@@ -45,3 +45,15 @@ export const customerSignUp = function (params) {
45
45
  }
46
46
  });
47
47
  };
48
+ export const googleLogin = function (params) {
49
+ return __awaiter(this, void 0, void 0, function* () {
50
+ try {
51
+ const config = {};
52
+ return yield axiosInstance.post(`${GET_AUTH}/google`, params, config);
53
+ }
54
+ catch (error) {
55
+ console.error('Error fetching googleLogin:', error);
56
+ throw error;
57
+ }
58
+ });
59
+ };
@@ -9,6 +9,7 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
9
9
  };
10
10
  import { generateQueryParamsStr } from "../../utils/apiUtils";
11
11
  import axiosInstance from "../axiosInstance";
12
+ const GET_SET_CUSTOMERS_APP = 'api/v2/washdayapp/customers';
12
13
  const GET_SET_CUSTOMERS = 'api/customer';
13
14
  export const getList = function (params) {
14
15
  return __awaiter(this, void 0, void 0, function* () {
@@ -70,3 +71,17 @@ export const getCustomerOrders = function (customerId, params) {
70
71
  }
71
72
  });
72
73
  };
74
+ export const getCustomerByIdCustomersApp = function (customerId) {
75
+ return __awaiter(this, void 0, void 0, function* () {
76
+ try {
77
+ const config = {
78
+ headers: { Authorization: `Bearer ${this.apiToken}` }
79
+ };
80
+ return yield axiosInstance.get(`${GET_SET_CUSTOMERS_APP}/${customerId}`, config);
81
+ }
82
+ catch (error) {
83
+ console.error('Error fetching customer:', error);
84
+ throw error;
85
+ }
86
+ });
87
+ };
package/dist/api/index.js CHANGED
@@ -72,6 +72,7 @@ const WashdayClient = function WashdayClient(apiToken) {
72
72
  closeStoreRoutes: routesEndpoints.putModule.closeStoreRoutes,
73
73
  });
74
74
  this.auth = bindMethods(this, {
75
+ googleLogin: authEndpoints.postModule.googleLogin,
75
76
  appleLogin: authEndpoints.postModule.appleLogin,
76
77
  customerRegularLogin: authEndpoints.postModule.customerRegularLogin,
77
78
  customerSignUp: authEndpoints.postModule.customerSignUp,
@@ -101,6 +102,7 @@ const WashdayClient = function WashdayClient(apiToken) {
101
102
  getCustomerById: customersEndpoints.getModule.getCustomerById,
102
103
  getCustomerHighlightsById: customersEndpoints.getModule.getCustomerHighlightsById,
103
104
  getCustomerOrders: customersEndpoints.getModule.getCustomerOrders,
105
+ getCustomerByIdCustomersApp: customersEndpoints.getModule.getCustomerByIdCustomersApp,
104
106
  create: customersEndpoints.postModule.create,
105
107
  updateById: customersEndpoints.putModule.updateById,
106
108
  deleteById: customersEndpoints.deleteModule.deleteById,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.116",
3
+ "version": "0.0.118",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -48,4 +48,24 @@ export const customerSignUp = async function (this: WashdayClientInstance, param
48
48
  console.error('Error fetching customerSignUp:', error);
49
49
  throw error;
50
50
  }
51
+ };
52
+
53
+ export const googleLogin = async function (this: WashdayClientInstance, params: {
54
+ companyId: string;
55
+ storeId: string;
56
+ credentials: {
57
+ email: string;
58
+ verified_email: boolean;
59
+ name: string;
60
+ give_name: string;
61
+ locale: string;
62
+ },
63
+ }): Promise<any> {
64
+ try {
65
+ const config = {};
66
+ return await axiosInstance.post(`${GET_AUTH}/google`, params, config);
67
+ } catch (error) {
68
+ console.error('Error fetching googleLogin:', error);
69
+ throw error;
70
+ }
51
71
  };
@@ -3,7 +3,7 @@ import { ICustomer } from "../../interfaces/Customer";
3
3
  import { IOrderInfo } from "../../interfaces/Order";
4
4
  import { generateQueryParamsStr } from "../../utils/apiUtils";
5
5
  import axiosInstance from "../axiosInstance";
6
-
6
+ const GET_SET_CUSTOMERS_APP = 'api/v2/washdayapp/customers';
7
7
  const GET_SET_CUSTOMERS = 'api/customer';
8
8
 
9
9
  export const getList = async function (this: WashdayClientInstance, params: {
@@ -69,3 +69,16 @@ export const getCustomerOrders = async function (this: WashdayClientInstance, cu
69
69
  throw error;
70
70
  }
71
71
  };
72
+
73
+
74
+ export const getCustomerByIdCustomersApp = async function (this: WashdayClientInstance, customerId: string): Promise<{ customer: ICustomer }> {
75
+ try {
76
+ const config = {
77
+ headers: { Authorization: `Bearer ${this.apiToken}` }
78
+ };
79
+ return await axiosInstance.get(`${GET_SET_CUSTOMERS_APP}/${customerId}`, config);
80
+ } catch (error) {
81
+ console.error('Error fetching customer:', error);
82
+ throw error;
83
+ }
84
+ };
package/src/api/index.ts CHANGED
@@ -78,6 +78,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
78
78
  closeStoreRoutes: routesEndpoints.putModule.closeStoreRoutes,
79
79
  });
80
80
  this.auth = bindMethods(this, {
81
+ googleLogin: authEndpoints.postModule.googleLogin,
81
82
  appleLogin: authEndpoints.postModule.appleLogin,
82
83
  customerRegularLogin: authEndpoints.postModule.customerRegularLogin,
83
84
  customerSignUp: authEndpoints.postModule.customerSignUp,
@@ -107,6 +108,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
107
108
  getCustomerById: customersEndpoints.getModule.getCustomerById,
108
109
  getCustomerHighlightsById: customersEndpoints.getModule.getCustomerHighlightsById,
109
110
  getCustomerOrders: customersEndpoints.getModule.getCustomerOrders,
111
+ getCustomerByIdCustomersApp: customersEndpoints.getModule.getCustomerByIdCustomersApp,
110
112
  create: customersEndpoints.postModule.create,
111
113
  updateById: customersEndpoints.putModule.updateById,
112
114
  deleteById: customersEndpoints.deleteModule.deleteById,
@@ -54,6 +54,7 @@ export interface WashdayClientInstance {
54
54
  cancelCFDI: typeof cfdiEndpoints.deleteModule.cancelCFDI
55
55
  }
56
56
  auth: {
57
+ googleLogin: typeof authEndpoints.postModule.googleLogin;
57
58
  appleLogin: typeof authEndpoints.postModule.appleLogin;
58
59
  customerRegularLogin: typeof authEndpoints.postModule.customerRegularLogin;
59
60
  customerSignUp: typeof authEndpoints.postModule.customerSignUp;
@@ -93,6 +94,7 @@ export interface WashdayClientInstance {
93
94
  getCustomerById: typeof customersEndpoints.getModule.getCustomerById;
94
95
  getCustomerHighlightsById: typeof customersEndpoints.getModule.getCustomerHighlightsById;
95
96
  getCustomerOrders: typeof customersEndpoints.getModule.getCustomerOrders;
97
+ getCustomerByIdCustomersApp: typeof customersEndpoints.getModule.getCustomerByIdCustomersApp;
96
98
  create: typeof customersEndpoints.postModule.create;
97
99
  updateById: typeof customersEndpoints.putModule.updateById;
98
100
  deleteById: typeof customersEndpoints.deleteModule.deleteById;