washday-sdk 0.0.142 → 0.0.144
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 +17 -5
- package/dist/api/customers/delete.js +15 -0
- package/dist/api/index.js +2 -0
- package/package.json +1 -1
- package/src/api/auth/post.ts +17 -5
- package/src/api/customers/delete.ts +14 -0
- package/src/api/index.ts +2 -0
- package/src/api/users/put.ts +1 -0
- package/src/interfaces/Api.ts +2 -0
package/dist/api/auth/post.js
CHANGED
|
@@ -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
|
|
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(`${
|
|
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(`${
|
|
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(`${
|
|
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(`${
|
|
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);
|
|
@@ -9,6 +9,21 @@ 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';
|
|
13
|
+
export const deleteByIdCustomersApp = function (id) {
|
|
14
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
15
|
+
try {
|
|
16
|
+
const config = {
|
|
17
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
18
|
+
};
|
|
19
|
+
return yield axiosInstance.delete(`${GET_SET_CUSTOMERS_APP}/${id}`, config);
|
|
20
|
+
}
|
|
21
|
+
catch (error) {
|
|
22
|
+
console.error('Error fetching deleteByIdCustomersApp:', error);
|
|
23
|
+
throw error;
|
|
24
|
+
}
|
|
25
|
+
});
|
|
26
|
+
};
|
|
12
27
|
export const deleteById = function (id) {
|
|
13
28
|
return __awaiter(this, void 0, void 0, function* () {
|
|
14
29
|
try {
|
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,
|
|
@@ -119,6 +120,7 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
119
120
|
create: customersEndpoints.postModule.create,
|
|
120
121
|
updateById: customersEndpoints.putModule.updateById,
|
|
121
122
|
deleteById: customersEndpoints.deleteModule.deleteById,
|
|
123
|
+
deleteByIdCustomersApp: customersEndpoints.deleteModule.deleteByIdCustomersApp,
|
|
122
124
|
updateByIdCustomersApp: customersEndpoints.putModule.updateByIdCustomersApp,
|
|
123
125
|
});
|
|
124
126
|
this.stores = bindMethods(this, {
|
package/package.json
CHANGED
package/src/api/auth/post.ts
CHANGED
|
@@ -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
|
|
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(`${
|
|
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(`${
|
|
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(`${
|
|
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(`${
|
|
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;
|
|
@@ -1,6 +1,20 @@
|
|
|
1
1
|
import { WashdayClientInstance } from "../../interfaces/Api";
|
|
2
2
|
import axiosInstance from "../axiosInstance";
|
|
3
3
|
const GET_SET_CUSTOMERS = 'api/customer';
|
|
4
|
+
const GET_SET_CUSTOMERS_APP = 'api/v2/washdayapp/customers';
|
|
5
|
+
|
|
6
|
+
export const deleteByIdCustomersApp = async function (this: WashdayClientInstance, id: string): Promise<any> {
|
|
7
|
+
try {
|
|
8
|
+
const config = {
|
|
9
|
+
headers: { Authorization: `Bearer ${this.apiToken}` }
|
|
10
|
+
};
|
|
11
|
+
return await axiosInstance.delete(`${GET_SET_CUSTOMERS_APP}/${id}`, config);
|
|
12
|
+
} catch (error) {
|
|
13
|
+
console.error('Error fetching deleteByIdCustomersApp:', error);
|
|
14
|
+
throw error;
|
|
15
|
+
}
|
|
16
|
+
};
|
|
17
|
+
|
|
4
18
|
|
|
5
19
|
export const deleteById = async function (this: WashdayClientInstance, id: string): Promise<any> {
|
|
6
20
|
try {
|
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,
|
|
@@ -125,6 +126,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
125
126
|
create: customersEndpoints.postModule.create,
|
|
126
127
|
updateById: customersEndpoints.putModule.updateById,
|
|
127
128
|
deleteById: customersEndpoints.deleteModule.deleteById,
|
|
129
|
+
deleteByIdCustomersApp: customersEndpoints.deleteModule.deleteByIdCustomersApp,
|
|
128
130
|
updateByIdCustomersApp: customersEndpoints.putModule.updateByIdCustomersApp,
|
|
129
131
|
});
|
|
130
132
|
this.stores = bindMethods(this, {
|
package/src/api/users/put.ts
CHANGED
package/src/interfaces/Api.ts
CHANGED
|
@@ -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;
|
|
@@ -111,6 +112,7 @@ export interface WashdayClientInstance {
|
|
|
111
112
|
create: typeof customersEndpoints.postModule.create;
|
|
112
113
|
updateById: typeof customersEndpoints.putModule.updateById;
|
|
113
114
|
deleteById: typeof customersEndpoints.deleteModule.deleteById;
|
|
115
|
+
deleteByIdCustomersApp: typeof customersEndpoints.deleteModule.deleteByIdCustomersApp;
|
|
114
116
|
updateByIdCustomersApp: typeof customersEndpoints.putModule.updateByIdCustomersApp;
|
|
115
117
|
};
|
|
116
118
|
stores: {
|