washday-sdk 0.0.115 → 0.0.117
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.
- package/dist/api/auth/post.js +24 -0
- package/dist/api/customers/get.js +15 -0
- package/dist/api/index.js +3 -0
- package/package.json +1 -1
- package/src/api/auth/post.ts +32 -0
- package/src/api/customers/get.ts +14 -1
- package/src/api/index.ts +3 -0
- package/src/interfaces/Api.ts +3 -0
package/dist/api/auth/post.js
CHANGED
|
@@ -21,3 +21,27 @@ export const appleLogin = function (params) {
|
|
|
21
21
|
}
|
|
22
22
|
});
|
|
23
23
|
};
|
|
24
|
+
export const customerRegularLogin = function (params) {
|
|
25
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
26
|
+
try {
|
|
27
|
+
const config = {};
|
|
28
|
+
return yield axiosInstance.post(`${GET_AUTH}/login`, params, config);
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
console.error('Error fetching customerRegularLogin:', error);
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
});
|
|
35
|
+
};
|
|
36
|
+
export const customerSignUp = function (params) {
|
|
37
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
38
|
+
try {
|
|
39
|
+
const config = {};
|
|
40
|
+
return yield axiosInstance.post(`${GET_AUTH}/signUp`, params, config);
|
|
41
|
+
}
|
|
42
|
+
catch (error) {
|
|
43
|
+
console.error('Error fetching customerSignUp:', error);
|
|
44
|
+
throw error;
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
};
|
|
@@ -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
|
@@ -73,6 +73,8 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
73
73
|
});
|
|
74
74
|
this.auth = bindMethods(this, {
|
|
75
75
|
appleLogin: authEndpoints.postModule.appleLogin,
|
|
76
|
+
customerRegularLogin: authEndpoints.postModule.customerRegularLogin,
|
|
77
|
+
customerSignUp: authEndpoints.postModule.customerSignUp,
|
|
76
78
|
});
|
|
77
79
|
this.orders = bindMethods(this, {
|
|
78
80
|
getList: ordersEndpoints.getModule.getList,
|
|
@@ -99,6 +101,7 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
99
101
|
getCustomerById: customersEndpoints.getModule.getCustomerById,
|
|
100
102
|
getCustomerHighlightsById: customersEndpoints.getModule.getCustomerHighlightsById,
|
|
101
103
|
getCustomerOrders: customersEndpoints.getModule.getCustomerOrders,
|
|
104
|
+
getCustomerByIdCustomersApp: customersEndpoints.getModule.getCustomerByIdCustomersApp,
|
|
102
105
|
create: customersEndpoints.postModule.create,
|
|
103
106
|
updateById: customersEndpoints.putModule.updateById,
|
|
104
107
|
deleteById: customersEndpoints.deleteModule.deleteById,
|
package/package.json
CHANGED
package/src/api/auth/post.ts
CHANGED
|
@@ -17,3 +17,35 @@ export const appleLogin = async function (this: WashdayClientInstance, params: {
|
|
|
17
17
|
throw error;
|
|
18
18
|
}
|
|
19
19
|
};
|
|
20
|
+
|
|
21
|
+
export const customerRegularLogin = async function (this: WashdayClientInstance, params: {
|
|
22
|
+
companyId: string;
|
|
23
|
+
storeId: string;
|
|
24
|
+
email: string;
|
|
25
|
+
password: string;
|
|
26
|
+
}): Promise<any> {
|
|
27
|
+
try {
|
|
28
|
+
const config = {};
|
|
29
|
+
return await axiosInstance.post(`${GET_AUTH}/login`, params, config);
|
|
30
|
+
} catch (error) {
|
|
31
|
+
console.error('Error fetching customerRegularLogin:', error);
|
|
32
|
+
throw error;
|
|
33
|
+
}
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const customerSignUp = async function (this: WashdayClientInstance, params: {
|
|
37
|
+
storeId: string;
|
|
38
|
+
companyId: string;
|
|
39
|
+
name: string;
|
|
40
|
+
phone: string;
|
|
41
|
+
email: string;
|
|
42
|
+
password: string;
|
|
43
|
+
}): Promise<any> {
|
|
44
|
+
try {
|
|
45
|
+
const config = {};
|
|
46
|
+
return await axiosInstance.post(`${GET_AUTH}/signUp`, params, config);
|
|
47
|
+
} catch (error) {
|
|
48
|
+
console.error('Error fetching customerSignUp:', error);
|
|
49
|
+
throw error;
|
|
50
|
+
}
|
|
51
|
+
};
|
package/src/api/customers/get.ts
CHANGED
|
@@ -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
|
@@ -79,6 +79,8 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
79
79
|
});
|
|
80
80
|
this.auth = bindMethods(this, {
|
|
81
81
|
appleLogin: authEndpoints.postModule.appleLogin,
|
|
82
|
+
customerRegularLogin: authEndpoints.postModule.customerRegularLogin,
|
|
83
|
+
customerSignUp: authEndpoints.postModule.customerSignUp,
|
|
82
84
|
});
|
|
83
85
|
this.orders = bindMethods(this, {
|
|
84
86
|
getList: ordersEndpoints.getModule.getList,
|
|
@@ -105,6 +107,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
105
107
|
getCustomerById: customersEndpoints.getModule.getCustomerById,
|
|
106
108
|
getCustomerHighlightsById: customersEndpoints.getModule.getCustomerHighlightsById,
|
|
107
109
|
getCustomerOrders: customersEndpoints.getModule.getCustomerOrders,
|
|
110
|
+
getCustomerByIdCustomersApp: customersEndpoints.getModule.getCustomerByIdCustomersApp,
|
|
108
111
|
create: customersEndpoints.postModule.create,
|
|
109
112
|
updateById: customersEndpoints.putModule.updateById,
|
|
110
113
|
deleteById: customersEndpoints.deleteModule.deleteById,
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -55,6 +55,8 @@ export interface WashdayClientInstance {
|
|
|
55
55
|
}
|
|
56
56
|
auth: {
|
|
57
57
|
appleLogin: typeof authEndpoints.postModule.appleLogin;
|
|
58
|
+
customerRegularLogin: typeof authEndpoints.postModule.customerRegularLogin;
|
|
59
|
+
customerSignUp: typeof authEndpoints.postModule.customerSignUp;
|
|
58
60
|
}
|
|
59
61
|
review: {
|
|
60
62
|
getList: typeof reviewsEndpoints.getModule.getList;
|
|
@@ -91,6 +93,7 @@ export interface WashdayClientInstance {
|
|
|
91
93
|
getCustomerById: typeof customersEndpoints.getModule.getCustomerById;
|
|
92
94
|
getCustomerHighlightsById: typeof customersEndpoints.getModule.getCustomerHighlightsById;
|
|
93
95
|
getCustomerOrders: typeof customersEndpoints.getModule.getCustomerOrders;
|
|
96
|
+
getCustomerByIdCustomersApp: typeof customersEndpoints.getModule.getCustomerByIdCustomersApp;
|
|
94
97
|
create: typeof customersEndpoints.postModule.create;
|
|
95
98
|
updateById: typeof customersEndpoints.putModule.updateById;
|
|
96
99
|
deleteById: typeof customersEndpoints.deleteModule.deleteById;
|