washday-sdk 0.0.137 → 0.0.139

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_AUTH = "api/v2/washdayapp/auth";
12
+ const REGULAR_USER_AUTH = "api/auth";
12
13
  export const appleLogin = function (params) {
13
14
  return __awaiter(this, void 0, void 0, function* () {
14
15
  try {
@@ -57,3 +58,27 @@ export const googleLogin = function (params) {
57
58
  }
58
59
  });
59
60
  };
61
+ export const regularUserLogin = function (params) {
62
+ return __awaiter(this, void 0, void 0, function* () {
63
+ try {
64
+ const config = {};
65
+ return yield axiosInstance.post(`${REGULAR_USER_AUTH}/login`, params, config);
66
+ }
67
+ catch (error) {
68
+ console.error('Error fetching regularUserLogin:', error);
69
+ throw error;
70
+ }
71
+ });
72
+ };
73
+ export const regularUserTokenLogin = function (params) {
74
+ return __awaiter(this, void 0, void 0, function* () {
75
+ try {
76
+ const config = {};
77
+ return yield axiosInstance.post(`${REGULAR_USER_AUTH}/tokenLogin`, params, config);
78
+ }
79
+ catch (error) {
80
+ console.error('Error fetching regularUserTokenLogin:', error);
81
+ throw error;
82
+ }
83
+ });
84
+ };
package/dist/api/index.js CHANGED
@@ -78,6 +78,8 @@ const WashdayClient = function WashdayClient(apiToken) {
78
78
  appleLogin: authEndpoints.postModule.appleLogin,
79
79
  customerRegularLogin: authEndpoints.postModule.customerRegularLogin,
80
80
  customerSignUp: authEndpoints.postModule.customerSignUp,
81
+ regularUserLogin: authEndpoints.postModule.regularUserLogin,
82
+ regularUserTokenLogin: authEndpoints.postModule.regularUserTokenLogin,
81
83
  });
82
84
  this.orders = bindMethods(this, {
83
85
  getList: ordersEndpoints.getModule.getList,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "washday-sdk",
3
- "version": "0.0.137",
3
+ "version": "0.0.139",
4
4
  "description": "Washday utilities functions and API",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -3,6 +3,7 @@ import { WashdayClientInstance } from "../../interfaces/Api";
3
3
  import { AppleAuthenticationCredential } from "../../interfaces/Apple";
4
4
  import axiosInstance from "../axiosInstance";
5
5
  const GET_AUTH = "api/v2/washdayapp/auth"
6
+ const REGULAR_USER_AUTH = "api/auth"
6
7
 
7
8
  export const appleLogin = async function (this: WashdayClientInstance, params: {
8
9
  companyId: string;
@@ -68,4 +69,30 @@ export const googleLogin = async function (this: WashdayClientInstance, params:
68
69
  console.error('Error fetching googleLogin:', error);
69
70
  throw error;
70
71
  }
71
- };
72
+ };
73
+
74
+ export const regularUserLogin = async function (this: WashdayClientInstance, params: {
75
+ email: string
76
+ password: string
77
+ }): Promise<any> {
78
+ try {
79
+ const config = {};
80
+ return await axiosInstance.post(`${REGULAR_USER_AUTH}/login`, params, config);
81
+ } catch (error) {
82
+ console.error('Error fetching regularUserLogin:', error);
83
+ throw error;
84
+ }
85
+ };
86
+
87
+
88
+ export const regularUserTokenLogin = async function (this: WashdayClientInstance, params: {
89
+ token: string
90
+ }): Promise<any> {
91
+ try {
92
+ const config = {};
93
+ return await axiosInstance.post(`${REGULAR_USER_AUTH}/tokenLogin`, params, config);
94
+ } catch (error) {
95
+ console.error('Error fetching regularUserTokenLogin:', error);
96
+ throw error;
97
+ }
98
+ };
package/src/api/index.ts CHANGED
@@ -84,6 +84,8 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
84
84
  appleLogin: authEndpoints.postModule.appleLogin,
85
85
  customerRegularLogin: authEndpoints.postModule.customerRegularLogin,
86
86
  customerSignUp: authEndpoints.postModule.customerSignUp,
87
+ regularUserLogin: authEndpoints.postModule.regularUserLogin,
88
+ regularUserTokenLogin: authEndpoints.postModule.regularUserTokenLogin,
87
89
  });
88
90
  this.orders = bindMethods(this, {
89
91
  getList: ordersEndpoints.getModule.getList,
@@ -60,6 +60,8 @@ export interface WashdayClientInstance {
60
60
  appleLogin: typeof authEndpoints.postModule.appleLogin;
61
61
  customerRegularLogin: typeof authEndpoints.postModule.customerRegularLogin;
62
62
  customerSignUp: typeof authEndpoints.postModule.customerSignUp;
63
+ regularUserLogin: typeof authEndpoints.postModule.regularUserLogin;
64
+ regularUserTokenLogin: typeof authEndpoints.postModule.regularUserTokenLogin;
63
65
  }
64
66
  review: {
65
67
  getList: typeof reviewsEndpoints.getModule.getList;