washday-sdk 0.0.156 → 0.0.158
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 +12 -0
- package/dist/api/index.js +1 -0
- package/package.json +1 -1
- package/src/api/auth/post.ts +15 -0
- package/src/api/index.ts +1 -0
- package/src/interfaces/Api.ts +1 -0
- package/src/interfaces/Customer.ts +15 -11
- package/src/utils/orders/calculateOrderTotal.test.js +0 -2
package/dist/api/auth/post.js
CHANGED
|
@@ -34,6 +34,18 @@ export const appleLogin = function (params) {
|
|
|
34
34
|
}
|
|
35
35
|
});
|
|
36
36
|
};
|
|
37
|
+
export const facebookLogin = function (params) {
|
|
38
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
39
|
+
try {
|
|
40
|
+
const config = {};
|
|
41
|
+
return yield axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/facebook`, params, config);
|
|
42
|
+
}
|
|
43
|
+
catch (error) {
|
|
44
|
+
console.error('Error fetching facebookLogin:', error);
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
});
|
|
48
|
+
};
|
|
37
49
|
export const customerRegularLogin = function (params) {
|
|
38
50
|
return __awaiter(this, void 0, void 0, function* () {
|
|
39
51
|
try {
|
package/dist/api/index.js
CHANGED
|
@@ -78,6 +78,7 @@ const WashdayClient = function WashdayClient(apiToken) {
|
|
|
78
78
|
customerLoginToken: authEndpoints.postModule.customerLoginToken,
|
|
79
79
|
googleLogin: authEndpoints.postModule.googleLogin,
|
|
80
80
|
appleLogin: authEndpoints.postModule.appleLogin,
|
|
81
|
+
facebookLogin: authEndpoints.postModule.facebookLogin,
|
|
81
82
|
customerRegularLogin: authEndpoints.postModule.customerRegularLogin,
|
|
82
83
|
customerSignUp: authEndpoints.postModule.customerSignUp,
|
|
83
84
|
regularUserLogin: authEndpoints.postModule.regularUserLogin,
|
package/package.json
CHANGED
package/src/api/auth/post.ts
CHANGED
|
@@ -31,6 +31,21 @@ export const appleLogin = async function (this: WashdayClientInstance, params: {
|
|
|
31
31
|
}
|
|
32
32
|
};
|
|
33
33
|
|
|
34
|
+
export const facebookLogin = async function (this: WashdayClientInstance, params: {
|
|
35
|
+
companyId: string;
|
|
36
|
+
storeId: string;
|
|
37
|
+
accessToken: string,
|
|
38
|
+
authToken: string;
|
|
39
|
+
}): Promise<any> {
|
|
40
|
+
try {
|
|
41
|
+
const config = {};
|
|
42
|
+
return await axiosInstance.post(`${CUSTOMERSAPP_GET_AUTH}/facebook`, params, config);
|
|
43
|
+
} catch (error) {
|
|
44
|
+
console.error('Error fetching facebookLogin:', error);
|
|
45
|
+
throw error;
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
34
49
|
export const customerRegularLogin = async function (this: WashdayClientInstance, params: {
|
|
35
50
|
companyId: string;
|
|
36
51
|
storeId: string;
|
package/src/api/index.ts
CHANGED
|
@@ -85,6 +85,7 @@ const WashdayClient: WashdayClientConstructor = function WashdayClient(this: Was
|
|
|
85
85
|
customerLoginToken: authEndpoints.postModule.customerLoginToken,
|
|
86
86
|
googleLogin: authEndpoints.postModule.googleLogin,
|
|
87
87
|
appleLogin: authEndpoints.postModule.appleLogin,
|
|
88
|
+
facebookLogin: authEndpoints.postModule.facebookLogin,
|
|
88
89
|
customerRegularLogin: authEndpoints.postModule.customerRegularLogin,
|
|
89
90
|
customerSignUp: authEndpoints.postModule.customerSignUp,
|
|
90
91
|
regularUserLogin: authEndpoints.postModule.regularUserLogin,
|
package/src/interfaces/Api.ts
CHANGED
|
@@ -60,6 +60,7 @@ export interface WashdayClientInstance {
|
|
|
60
60
|
customerLoginToken: typeof authEndpoints.postModule.customerLoginToken;
|
|
61
61
|
googleLogin: typeof authEndpoints.postModule.googleLogin;
|
|
62
62
|
appleLogin: typeof authEndpoints.postModule.appleLogin;
|
|
63
|
+
facebookLogin: typeof authEndpoints.postModule.facebookLogin;
|
|
63
64
|
customerRegularLogin: typeof authEndpoints.postModule.customerRegularLogin;
|
|
64
65
|
customerSignUp: typeof authEndpoints.postModule.customerSignUp;
|
|
65
66
|
regularUserLogin: typeof authEndpoints.postModule.regularUserLogin;
|
|
@@ -7,15 +7,6 @@ interface IInvoiceInfo {
|
|
|
7
7
|
zipCode: string
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
interface IAddresses {
|
|
11
|
-
addressString: string,
|
|
12
|
-
addressName: string,
|
|
13
|
-
location: {
|
|
14
|
-
latitude: string,
|
|
15
|
-
longitude: string
|
|
16
|
-
}
|
|
17
|
-
}
|
|
18
|
-
|
|
19
10
|
interface IPaymentMethod {
|
|
20
11
|
stripeId: string,
|
|
21
12
|
brand: string,
|
|
@@ -24,10 +15,24 @@ interface IPaymentMethod {
|
|
|
24
15
|
last4: string,
|
|
25
16
|
}
|
|
26
17
|
|
|
18
|
+
export interface IAddress {
|
|
19
|
+
formattedAddress?: string; // A field to store the full address as a single string
|
|
20
|
+
street?: string;
|
|
21
|
+
neighborhood?: string;
|
|
22
|
+
postalCode?: string;
|
|
23
|
+
city?: string;
|
|
24
|
+
state?: string;
|
|
25
|
+
country?: string;
|
|
26
|
+
coordinates?: {
|
|
27
|
+
lat: number;
|
|
28
|
+
lng: number;
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
27
32
|
export interface ICustomer {
|
|
28
33
|
name: string,
|
|
29
34
|
phone: string,
|
|
30
|
-
address:
|
|
35
|
+
address: IAddress,
|
|
31
36
|
rfc?: string,
|
|
32
37
|
email: string,
|
|
33
38
|
notes?: string,
|
|
@@ -44,7 +49,6 @@ export interface ICustomer {
|
|
|
44
49
|
facebook?: boolean,
|
|
45
50
|
apple?: boolean,
|
|
46
51
|
useStoreApp?: boolean,
|
|
47
|
-
addresses?: [IAddresses],
|
|
48
52
|
paymentMethods?: [IPaymentMethod],
|
|
49
53
|
stripeCustomerId?: string,
|
|
50
54
|
invoiceInfo?: IInvoiceInfo,
|
|
@@ -92,7 +92,6 @@ describe("sum function", () => {
|
|
|
92
92
|
createdBy: "62d194d77ec933001631e831",
|
|
93
93
|
createdIn: "629c267812db5b001692adae",
|
|
94
94
|
company: "629c267712db5b001692ad9e",
|
|
95
|
-
addresses: [],
|
|
96
95
|
paymentMethods: [],
|
|
97
96
|
__v: 0,
|
|
98
97
|
title: "Carlos Piña 🍍",
|
|
@@ -152,7 +151,6 @@ describe("sum function", () => {
|
|
|
152
151
|
createdBy: "62d194d77ec933001631e831",
|
|
153
152
|
createdIn: "629c267812db5b001692adae",
|
|
154
153
|
company: "629c267712db5b001692ad9e",
|
|
155
|
-
addresses: [],
|
|
156
154
|
paymentMethods: [],
|
|
157
155
|
__v: 0,
|
|
158
156
|
},
|