washday-sdk 0.0.142 → 0.0.143

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.
@@ -8,13 +8,25 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
8
8
  });
9
9
  };
10
10
  import axiosInstance from "../axiosInstance";
11
- const GET_AUTH = "api/v2/washdayapp/auth";
11
+ const CUSTOMERSAPP_GET_AUTH = "api/v2/washdayapp/auth";
12
12
  const REGULAR_USER_AUTH = "api/auth";
13
+ export const customerLoginToken = function (params) {
14
+ return __awaiter(this, void 0, void 0, function* () {
15
+ try {
16
+ const config = {};
17
+ return yield axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/tokenLogin`, params, config);
18
+ }
19
+ catch (error) {
20
+ console.error('Error fetching customerLoginToken:', error);
21
+ throw error;
22
+ }
23
+ });
24
+ };
13
25
  export const appleLogin = function (params) {
14
26
  return __awaiter(this, void 0, void 0, function* () {
15
27
  try {
16
28
  const config = {};
17
- return yield axiosInstance.post(`${GET_AUTH}/apple`, params, config);
29
+ return yield axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/apple`, params, config);
18
30
  }
19
31
  catch (error) {
20
32
  console.error('Error fetching appleLogin:', error);
@@ -26,7 +38,7 @@ export const customerRegularLogin = function (params) {
26
38
  return __awaiter(this, void 0, void 0, function* () {
27
39
  try {
28
40
  const config = {};
29
- return yield axiosInstance.post(`${GET_AUTH}/login`, params, config);
41
+ return yield axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/login`, params, config);
30
42
  }
31
43
  catch (error) {
32
44
  console.error('Error fetching customerRegularLogin:', error);
@@ -38,7 +50,7 @@ export const customerSignUp = function (params) {
38
50
  return __awaiter(this, void 0, void 0, function* () {
39
51
  try {
40
52
  const config = {};
41
- return yield axiosInstance.post(`${GET_AUTH}/signUp`, params, config);
53
+ return yield axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/signUp`, params, config);
42
54
  }
43
55
  catch (error) {
44
56
  console.error('Error fetching customerSignUp:', error);
@@ -50,7 +62,7 @@ export const googleLogin = function (params) {
50
62
  return __awaiter(this, void 0, void 0, function* () {
51
63
  try {
52
64
  const config = {};
53
- return yield axiosInstance.post(`${GET_AUTH}/google`, params, config);
65
+ return yield axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/google`, params, config);
54
66
  }
55
67
  catch (error) {
56
68
  console.error('Error fetching googleLogin:', error);
package/dist/api/index.js CHANGED
@@ -75,6 +75,7 @@ const WashdayClient = function WashdayClient(apiToken) {
75
75
  closeStoreRoutes: routesEndpoints.putModule.closeStoreRoutes,
76
76
  });
77
77
  this.auth = bindMethods(this, {
78
+ customerLoginToken: authEndpoints.postModule.customerLoginToken,
78
79
  googleLogin: authEndpoints.postModule.googleLogin,
79
80
  appleLogin: authEndpoints.postModule.appleLogin,
80
81
  customerRegularLogin: authEndpoints.postModule.customerRegularLogin,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.142",
3
+ "version": "0.0.143",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -2,9 +2,21 @@
2
2
  import { WashdayClientInstance } from "../../interfaces/Api";
3
3
  import { AppleAuthenticationCredential } from "../../interfaces/Apple";
4
4
  import axiosInstance from "../axiosInstance";
5
- const GET_AUTH = "api/v2/washdayapp/auth"
5
+ const CUSTOMERSAPP_GET_AUTH = "api/v2/washdayapp/auth"
6
6
  const REGULAR_USER_AUTH = "api/auth"
7
7
 
8
+ export const customerLoginToken = async function (this: WashdayClientInstance, params: {
9
+ token: string;
10
+ }): Promise<any> {
11
+ try {
12
+ const config = {};
13
+ return await axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/tokenLogin`, params, config);
14
+ } catch (error) {
15
+ console.error('Error fetching customerLoginToken:', error);
16
+ throw error;
17
+ }
18
+ };
19
+
8
20
  export const appleLogin = async function (this: WashdayClientInstance, params: {
9
21
  companyId: string;
10
22
  storeId: string;
@@ -12,7 +24,7 @@ export const appleLogin = async function (this: WashdayClientInstance, params: {
12
24
  }): Promise<any> {
13
25
  try {
14
26
  const config = {};
15
- return await axiosInstance.post(`${GET_AUTH}/apple`, params, config);
27
+ return await axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/apple`, params, config);
16
28
  } catch (error) {
17
29
  console.error('Error fetching appleLogin:', error);
18
30
  throw error;
@@ -27,7 +39,7 @@ export const customerRegularLogin = async function (this: WashdayClientInstance,
27
39
  }): Promise<any> {
28
40
  try {
29
41
  const config = {};
30
- return await axiosInstance.post(`${GET_AUTH}/login`, params, config);
42
+ return await axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/login`, params, config);
31
43
  } catch (error) {
32
44
  console.error('Error fetching customerRegularLogin:', error);
33
45
  throw error;
@@ -44,7 +56,7 @@ export const customerSignUp = async function (this: WashdayClientInstance, param
44
56
  }): Promise<any> {
45
57
  try {
46
58
  const config = {};
47
- return await axiosInstance.post(`${GET_AUTH}/signUp`, params, config);
59
+ return await axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/signUp`, params, config);
48
60
  } catch (error) {
49
61
  console.error('Error fetching customerSignUp:', error);
50
62
  throw error;
@@ -64,7 +76,7 @@ export const googleLogin = async function (this: WashdayClientInstance, params:
64
76
  }): Promise<any> {
65
77
  try {
66
78
  const config = {};
67
- return await axiosInstance.post(`${GET_AUTH}/google`, params, config);
79
+ return await axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/google`, params, config);
68
80
  } catch (error) {
69
81
  console.error('Error fetching googleLogin:', error);
70
82
  throw error;
package/src/api/index.ts CHANGED
@@ -81,6 +81,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
81
81
  closeStoreRoutes: routesEndpoints.putModule.closeStoreRoutes,
82
82
  });
83
83
  this.auth = bindMethods(this, {
84
+ customerLoginToken: authEndpoints.postModule.customerLoginToken,
84
85
  googleLogin: authEndpoints.postModule.googleLogin,
85
86
  appleLogin: authEndpoints.postModule.appleLogin,
86
87
  customerRegularLogin: authEndpoints.postModule.customerRegularLogin,
@@ -13,6 +13,7 @@ interface userDTO {
13
13
  paperSize: string
14
14
  }
15
15
  freshChatRestoreID?: string
16
+ pushNotificationToken?: string
16
17
  }
17
18
 
18
19
  export const updateUserById = async function (this: WashdayClientInstance, userId: string, data: userDTO): Promise<any> {
@@ -57,6 +57,7 @@ export interface WashdayClientInstance {
57
57
  cancelCFDI: typeof cfdiEndpoints.deleteModule.cancelCFDI
58
58
  }
59
59
  auth: {
60
+ customerLoginToken: typeof authEndpoints.postModule.customerLoginToken;
60
61
  googleLogin: typeof authEndpoints.postModule.googleLogin;
61
62
  appleLogin: typeof authEndpoints.postModule.appleLogin;
62
63
  customerRegularLogin: typeof authEndpoints.postModule.customerRegularLogin;