favesalon-embed 1.0.5 → 1.0.6

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.
Files changed (57) hide show
  1. package/dist/custom-elements/index.d.ts +36 -0
  2. package/dist/favesalon-embed/activate-form.entry.js +70 -0
  3. package/dist/favesalon-embed/app-globals-f954a22f.js +7 -0
  4. package/dist/favesalon-embed/change-password-form.entry.js +81 -0
  5. package/dist/favesalon-embed/chat-box.entry.js +1 -1
  6. package/dist/favesalon-embed/chat-button.entry.js +34 -11
  7. package/dist/favesalon-embed/chat-form.entry.js +1 -1
  8. package/dist/favesalon-embed/chat-messages.entry.js +1 -1
  9. package/dist/favesalon-embed/chat-rooms.entry.js +1 -1
  10. package/dist/favesalon-embed/favesalon-embed.esm.js +1 -1
  11. package/dist/favesalon-embed/index-a229b3b5.js +3371 -0
  12. package/dist/favesalon-embed/login-form.entry.js +67 -0
  13. package/dist/favesalon-embed/register-form.entry.js +88 -0
  14. package/dist/favesalon-embed/reset-password-form.entry.js +47 -0
  15. package/dist/favesalon-embed/salon-booking.entry.js +1 -1
  16. package/dist/favesalon-embed/salon-gift-card.entry.js +1 -1
  17. package/dist/favesalon-embed/salon-info.entry.js +1 -1
  18. package/dist/favesalon-embed/salon-latest-reviews.entry.js +19 -3
  19. package/dist/favesalon-embed/salon-latest-styles.entry.js +14 -7
  20. package/dist/favesalon-embed/salon-locations.entry.js +1 -1
  21. package/dist/favesalon-embed/salon-lookbook.entry.js +16 -4
  22. package/dist/favesalon-embed/salon-reviews.entry.js +18 -4
  23. package/dist/favesalon-embed/salon-schedules.entry.js +1 -1
  24. package/dist/favesalon-embed/salon-services.entry.js +23 -11
  25. package/dist/favesalon-embed/salon-stylists.entry.js +1 -1
  26. package/dist/favesalon-embed/{services-260ea6eb.js → services-5a4c43a6.js} +23 -0
  27. package/dist/favesalon-embed/{services-65a8cf4a.js → services-d71be591.js} +51 -19
  28. package/dist/favesalon-embed/style-detail.entry.js +26 -8
  29. package/dist/favesalon-embed/user-avatar.entry.js +3 -1
  30. package/dist/favesalon-embed/user-form.entry.js +44 -0
  31. package/dist/types/components/activate-form/activate-form.d.ts +12 -0
  32. package/dist/types/components/activate-form/test/activate-form.e2e.d.ts +1 -0
  33. package/dist/types/components/activate-form/test/activate-form.spec.d.ts +1 -0
  34. package/dist/types/components/change-password-form/change-password-form.d.ts +12 -0
  35. package/dist/types/components/chat-button/index.d.ts +6 -2
  36. package/dist/types/components/login-form/login-form.d.ts +10 -0
  37. package/dist/types/components/register-form/register-form.d.ts +13 -0
  38. package/dist/types/components/reset-password-form/reset-password-form.d.ts +9 -0
  39. package/dist/types/components/user-form/user-form.d.ts +7 -0
  40. package/dist/types/components.d.ts +106 -2
  41. package/dist/types/services/services.d.ts +16 -0
  42. package/dist/types/types/user.d.ts +6 -0
  43. package/dist/types/utils/utils.spec.d.ts +1 -0
  44. package/package.json +1 -1
  45. package/dist/favesalon-embed/services-122dcf73.js +0 -23886
  46. package/dist/favesalon-embed/services-23eda072.js +0 -23877
  47. package/dist/favesalon-embed/services-243eef47.js +0 -23880
  48. package/dist/favesalon-embed/services-27607998.js +0 -23886
  49. package/dist/favesalon-embed/services-46b2f0aa.js +0 -23867
  50. package/dist/favesalon-embed/services-8f52210f.js +0 -23880
  51. package/dist/favesalon-embed/services-de32365e.js +0 -23880
  52. package/dist/favesalon-embed/services-e9cfcd2b.js +0 -23885
  53. package/dist/favesalon-embed/services-f7278483.js +0 -23880
  54. package/dist/favesalon-embed/services-f9872bea.js +0 -23880
  55. package/dist/favesalon-embed/utils-2c19db45.js +0 -25
  56. package/dist/favesalon-embed/utils-89c2cff2.js +0 -32
  57. package/dist/favesalon-embed/utils-e226fa04.js +0 -32
@@ -23387,6 +23387,9 @@ function createUser(blob) {
23387
23387
  fullName: userNames.length > 0 ? userNames.join(' ') : (blob.fullName || blob.name || blob.username),
23388
23388
  avatar: blob.avatar || blob.full_profile_image_thumb,
23389
23389
  mobilePhone: blob.mobile_phone,
23390
+ accessToken: blob.access_token,
23391
+ email: blob.email,
23392
+ password: blob.password,
23390
23393
  };
23391
23394
  }
23392
23395
  function createUserFromChatRoom(blob) {
@@ -23585,17 +23588,6 @@ function createChatRoom(blob) {
23585
23588
  });
23586
23589
  }
23587
23590
 
23588
- var __rest = (undefined && undefined.__rest) || function (s, e) {
23589
- var t = {};
23590
- for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
23591
- t[p] = s[p];
23592
- if (s != null && typeof Object.getOwnPropertySymbols === "function")
23593
- for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
23594
- if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
23595
- t[p[i]] = s[p[i]];
23596
- }
23597
- return t;
23598
- };
23599
23591
  const apiV2Prefix = 'api-ver2';
23600
23592
  const firebaseMessagesNode = 'favesalon--messages';
23601
23593
  class HttpService {
@@ -23622,6 +23614,39 @@ class HttpService {
23622
23614
  }
23623
23615
  catch (error) { }
23624
23616
  }
23617
+ login(apiUrl, options) {
23618
+ const url = `${apiUrl}/${apiV2Prefix}/user/login`;
23619
+ return this.http.post(url, options)
23620
+ .then(response => {
23621
+ const status = get_1(response, 'data.status');
23622
+ const blob = get_1(response, 'data.data');
23623
+ if (status && blob.id) {
23624
+ const userEntity = createUser(blob);
23625
+ return Promise.resolve(userEntity);
23626
+ }
23627
+ return Promise.reject(response);
23628
+ });
23629
+ }
23630
+ register(options) {
23631
+ const url = `${apiV2Prefix}/user/create`;
23632
+ return this.http.post(url, options);
23633
+ }
23634
+ resendActivateCode(email) {
23635
+ const url = `${apiV2Prefix}/user/resend-activate?email=${email}`;
23636
+ return this.http.get(url);
23637
+ }
23638
+ activateAccount(email, code) {
23639
+ const url = `${apiV2Prefix}/user/active?email=${email}&code=${code}`;
23640
+ return this.http.get(url);
23641
+ }
23642
+ resetPassword(email) {
23643
+ const url = `${apiV2Prefix}/user/forgot-password?${email.indexOf('@') > -1 ? 'email' : 'phone'}=${email}`;
23644
+ return this.http.get(url);
23645
+ }
23646
+ onChangePassword(options) {
23647
+ const url = `${apiV2Prefix}/user/change-password`;
23648
+ return this.http.post(url, options);
23649
+ }
23625
23650
  fetchClients(salonId, keyword, accessToken) {
23626
23651
  const url = `${apiV1Prefix}/salon/clients/list/${salonId}?page=1&limit=10&access_token=${accessToken}`;
23627
23652
  const payload = {
@@ -23670,7 +23695,7 @@ class HttpService {
23670
23695
  }
23671
23696
  fetchSalonLatestStyles(salonId, options) {
23672
23697
  const url = `${apiV2Prefix}/salon/${salonId}/styles`;
23673
- return this.http.post(url, Object.assign(Object.assign({}, options), { sort: 'newest' }))
23698
+ return this.http.post(url, { ...options, sort: 'newest' })
23674
23699
  .then(response => {
23675
23700
  const { data } = response.data;
23676
23701
  return (data || []).slice(0, options.limit).map(createFaveStyle);
@@ -23694,7 +23719,7 @@ class HttpService {
23694
23719
  type: 'sub-category',
23695
23720
  data: (subCate.services || []).map(rawService => {
23696
23721
  const serviceObj = createService(rawService);
23697
- return Object.assign(Object.assign({}, serviceObj), { type: 'service' });
23722
+ return { ...serviceObj, type: 'service' };
23698
23723
  }),
23699
23724
  };
23700
23725
  }),
@@ -23727,7 +23752,7 @@ class HttpService {
23727
23752
  }
23728
23753
  fetchSalonReviews(salonId, options) {
23729
23754
  const url = `${apiV2Prefix}/salon/${salonId}/reviews`;
23730
- return this.http.post(url, Object.assign({ avg_point_greater_than: 0 }, options))
23755
+ return this.http.post(url, { avg_point_greater_than: 0, ...options })
23731
23756
  .then(response => {
23732
23757
  const { data, paging } = response.data || {};
23733
23758
  const { total_1star: onestar, total_2star: twoStar, total_3star: threeStar, total_4star: fourStar, total_5star: fiveStar, total_review: totalReviews, avg_point: reviewPoint, } = paging.review_detail || {};
@@ -23768,7 +23793,11 @@ class HttpService {
23768
23793
  fetchSalonLookbooks(salonId, options) {
23769
23794
  const noResult = { total: 0, allLookbooks: [] };
23770
23795
  const url = `${apiV2Prefix}/salon/${salonId}/styles`;
23771
- const postData = Object.assign({ page: 1, limit: 20 }, options);
23796
+ const postData = {
23797
+ page: 1,
23798
+ limit: 20,
23799
+ ...options,
23800
+ };
23772
23801
  return this.http.post(url, postData)
23773
23802
  .then(response => {
23774
23803
  const { status, data, paging } = response.data;
@@ -23827,7 +23856,7 @@ class HttpService {
23827
23856
  onValue(roomMessagesRef, (snapshot) => {
23828
23857
  const conversations = [];
23829
23858
  each$1(snapshot.val(), (message, key) => {
23830
- const chatMessage = createChatMessage(Object.assign(Object.assign({}, message), { uid: key }));
23859
+ const chatMessage = createChatMessage({ ...message, uid: key });
23831
23860
  conversations.push(chatMessage);
23832
23861
  });
23833
23862
  onDone(sortBy_1(conversations, 'timestamp'));
@@ -23845,8 +23874,8 @@ class HttpService {
23845
23874
  const roomMessagesRef = ref(this.firebaseDatabase, `${firebaseMessagesNode}/${roomId}`);
23846
23875
  const updates = {};
23847
23876
  roomMessages.forEach(message => {
23848
- const { uid } = message, nestedMessage = __rest(message, ["uid"]);
23849
- updates[`${message.uid}`] = Object.assign(Object.assign({}, nestedMessage), { unRead: 0 });
23877
+ const { uid, ...nestedMessage } = message;
23878
+ updates[`${message.uid}`] = { ...nestedMessage, unRead: 0 };
23850
23879
  });
23851
23880
  return update(roomMessagesRef, updates);
23852
23881
  }
@@ -23874,7 +23903,10 @@ class HttpService {
23874
23903
  };
23875
23904
  return update(roomMessagesRef, updates)
23876
23905
  .then(() => {
23877
- return Object.assign(Object.assign({}, newMessage), { uid: newMessageKey });
23906
+ return {
23907
+ ...newMessage,
23908
+ uid: newMessageKey,
23909
+ };
23878
23910
  });
23879
23911
  }
23880
23912
  catch (error) { }
@@ -1,5 +1,5 @@
1
1
  import { r as registerInstance, h } from './index-888e99e3.js';
2
- import { d as dayjs_min, H as HttpService, i as isVideoMedia, g as getSalonImage, s as shortDateYearFormat } from './services-260ea6eb.js';
2
+ import { d as dayjs_min, H as HttpService, i as isVideoMedia, g as getSalonImage, s as shortDateYearFormat } from './services-d71be591.js';
3
3
  import { r as relativeTime } from './relativeTime-268e64b0.js';
4
4
  import { C as Colors } from './colors-ea36347a.js';
5
5
  import './_commonjsHelpers-a4f66ccd.js';
@@ -121,7 +121,17 @@ const StyleDetail = class {
121
121
  return (h("div", { class: "salon-modal salon-modal--lookbook-detail" }, h("div", { class: "salon-modal--inner" }, h("div", { class: "salon-modal--content" }, h("div", { class: "style-detail" }, h("div", { class: "style-detail--header" }, h("div", { style: {
122
122
  position: 'relative',
123
123
  overflow: 'hidden',
124
- } }, h("div", { style: Object.assign({ backgroundColor: Colors.Gray01, backgroundSize: 'cover', backgroundRepeat: 'no-repeat', backgroundPosition: '0 0', filter: 'blur(30px)', position: 'absolute', inset: '0', zIndex: '1' }, this.currentMedia && !isVideoMedia(this.currentMedia) ? { backgroundImage: `url("${this.currentMedia.imageThumb}")` } : {}) }), h("div", { style: {
124
+ } }, h("div", { style: {
125
+ backgroundColor: Colors.Gray01,
126
+ backgroundSize: 'cover',
127
+ backgroundRepeat: 'no-repeat',
128
+ backgroundPosition: '0 0',
129
+ filter: 'blur(30px)',
130
+ position: 'absolute',
131
+ inset: '0',
132
+ zIndex: '1',
133
+ ...this.currentMedia && !isVideoMedia(this.currentMedia) ? { backgroundImage: `url("${this.currentMedia.imageThumb}")` } : {},
134
+ } }), h("div", { style: {
125
135
  zIndex: '2',
126
136
  position: 'relative',
127
137
  width: '100%',
@@ -176,12 +186,20 @@ const StyleDetail = class {
176
186
  position: 'relative',
177
187
  } }, this.albumMedias.map((media, idx) => {
178
188
  const isStyleVideo = isVideoMedia(media);
179
- return (h("div", { class: "style-detail--slides--thumbnail", style: Object.assign(Object.assign({ backgroundColor: Colors.Gray01, borderRadius: '4px', overflow: 'hidden', position: 'relative', cursor: 'pointer' }, this.currentMediaIdx !== idx ? { opacity: '0.75' } : {}), !isStyleVideo ? {
180
- backgroundImage: `url("${media.imageThumb || media.imageThumbMedium}")`,
181
- backgroundRepeat: 'no-repeat',
182
- backgroundPosition: 'center center',
183
- backgroundSize: 'cover',
184
- } : {}), onClick: () => {
189
+ return (h("div", { class: "style-detail--slides--thumbnail", style: {
190
+ backgroundColor: Colors.Gray01,
191
+ borderRadius: '4px',
192
+ overflow: 'hidden',
193
+ position: 'relative',
194
+ cursor: 'pointer',
195
+ ...this.currentMediaIdx !== idx ? { opacity: '0.75' } : {},
196
+ ...!isStyleVideo ? {
197
+ backgroundImage: `url("${media.imageThumb || media.imageThumbMedium}")`,
198
+ backgroundRepeat: 'no-repeat',
199
+ backgroundPosition: 'center center',
200
+ backgroundSize: 'cover',
201
+ } : {},
202
+ }, onClick: () => {
185
203
  this.currentMedia = media;
186
204
  this.currentMediaIdx = idx;
187
205
  } }, isStyleVideo && (h("div", null, h("video", { muted: true, width: "100%", height: "100%", poster: media.imageThumb }, h("source", { src: media.mediaUrl, type: "video/mp4" })), h("i", { class: "ri-play-circle-fill", style: {
@@ -41,7 +41,9 @@ const UserAvatar = class {
41
41
  overflow: 'hidden',
42
42
  whiteSpace: 'nowrap',
43
43
  textOverflow: 'ellipsis',
44
- } }, h("div", { style: Object.assign({}, this.nameStyle) }, this.name), this.description && h("div", { style: { color: '#999999' } }, this.description)))));
44
+ } }, h("div", { style: {
45
+ ...this.nameStyle,
46
+ } }, this.name), this.description && h("div", { style: { color: '#999999' } }, this.description)))));
45
47
  }
46
48
  };
47
49
  ;
@@ -0,0 +1,44 @@
1
+ import { r as registerInstance, h } from './index-888e99e3.js';
2
+
3
+ const userFormCss = ":host{display:block}";
4
+
5
+ var FormType;
6
+ (function (FormType) {
7
+ FormType["Login"] = "Login";
8
+ FormType["Register"] = "Register";
9
+ FormType["Activate"] = "Activate";
10
+ FormType["ResetPassword"] = "ResetPassword";
11
+ FormType["ChangePassword"] = "ChangePassword";
12
+ })(FormType || (FormType = {}));
13
+ const UserForm = class {
14
+ constructor(hostRef) {
15
+ registerInstance(this, hostRef);
16
+ this.onSuccess = undefined;
17
+ this.type = undefined;
18
+ this.currentUser = undefined;
19
+ }
20
+ render() {
21
+ if (this.type === FormType.Register) {
22
+ return (h("div", null, h("div", { style: { marginBottom: '24px' } }, h("h3", { style: { fontSize: '24px', margin: '8px 0' } }, "Create an account"), h("div", { style: { marginBottom: '4px' } }, "Already have an account? ", h("span", { onClick: () => this.type = FormType.Login, style: { cursor: 'pointer', textDecoration: 'underline' } }, "Signin now"))), h("register-form", { onSuccess: (user) => {
23
+ this.currentUser = user;
24
+ this.type = FormType.Activate;
25
+ } })));
26
+ }
27
+ if (this.type === FormType.Activate) {
28
+ return (h("div", null, h("div", { style: { marginBottom: '24px' } }, h("h3", { style: { fontSize: '24px', margin: '8px 0' } }, "Activate account"), h("div", { style: { marginBottom: '4px' } }, "We\u2019ve sent you a confirmation code. Please check your email inbox and enter the code below")), h("activate-form", { username: (this.currentUser || {}).email, password: (this.currentUser || {}).password, onSuccess: (user) => this.onSuccess(user) })));
29
+ }
30
+ if (this.type === FormType.ResetPassword) {
31
+ return (h("div", null, h("div", { style: { marginBottom: '24px' } }, h("h3", { style: { fontSize: '24px', margin: '8px 0' } }, "Reset password"), h("div", { style: { marginBottom: '4px' } }, "Already have an account? ", h("span", { onClick: () => this.type = FormType.Login, style: { cursor: 'pointer', textDecoration: 'underline' } }, "Signin now"))), h("reset-password-form", { onSuccess: (user) => {
32
+ this.currentUser = user;
33
+ this.type = FormType.ChangePassword;
34
+ } })));
35
+ }
36
+ if (this.type === FormType.ChangePassword) {
37
+ return (h("div", null, h("div", { style: { marginBottom: '24px' } }, h("h3", { style: { fontSize: '24px', margin: '8px 0' } }, "Change password"), h("div", { style: { marginBottom: '4px' } }, "We\u2019ve sent you a confirmation code. Please check your email inbox and enter the code below")), h("change-password-form", { username: (this.currentUser || {}).email, onSuccess: (user) => this.onSuccess(user) })));
38
+ }
39
+ return (h("div", null, h("div", { style: { marginBottom: '24px' } }, h("h3", { style: { fontSize: '24px', margin: '8px 0' } }, "Please login to continue"), h("div", { style: { marginBottom: '4px' } }, "Don\u2019t have an account? ", h("span", { onClick: () => this.type = FormType.Register, style: { cursor: 'pointer', textDecoration: 'underline' } }, "Signup now"))), h("login-form", { onSuccess: (user) => this.onSuccess(user) }), h("div", { style: { marginTop: '16px' } }, "Forgot your password? ", h("span", { onClick: () => this.type = FormType.ResetPassword, style: { cursor: 'pointer', textDecoration: 'underline' } }, "Reset now"))));
40
+ }
41
+ };
42
+ UserForm.style = userFormCss;
43
+
44
+ export { UserForm as user_form };
@@ -0,0 +1,12 @@
1
+ import { User } from '../../types/user';
2
+ export declare class ActivateForm {
3
+ username: string;
4
+ password: string;
5
+ onSuccess: (user: User) => void;
6
+ isSubmitting: boolean;
7
+ error: string;
8
+ confirmCode: string;
9
+ onSubmit(evt: any): Promise<void>;
10
+ resendCode(evt: any): Promise<void>;
11
+ render(): any;
12
+ }
@@ -0,0 +1,12 @@
1
+ import { User } from '../../types/user';
2
+ export declare class ChangePasswordForm {
3
+ username: string;
4
+ onSuccess: (user: User) => void;
5
+ isSubmitting: boolean;
6
+ error: string;
7
+ confirmCode: string;
8
+ password: string;
9
+ onSubmit(evt: any): Promise<void>;
10
+ resendCode(evt: any): Promise<void>;
11
+ render(): any;
12
+ }
@@ -2,9 +2,12 @@ import { User } from '../../types/user';
2
2
  import { ChatMessage, ChatRoom } from '../../types/chat';
3
3
  export declare class ChatButton {
4
4
  primaryColor: string;
5
- accessToken: string;
6
- senderId: string;
7
5
  receiverId: string;
6
+ accessToken?: string;
7
+ senderId?: string;
8
+ senderIdState: string;
9
+ accessTokenState: string;
10
+ isChatVerificationExpanded: boolean;
8
11
  senderInfo: User;
9
12
  receiverInfo: User;
10
13
  chatRoom: ChatRoom;
@@ -12,5 +15,6 @@ export declare class ChatButton {
12
15
  isChatExpanded: boolean;
13
16
  componentWillLoad(): void;
14
17
  fetchData(): Promise<void>;
18
+ onVerificationSuccess(user: User): void;
15
19
  render(): any;
16
20
  }
@@ -0,0 +1,10 @@
1
+ import { User } from '../../types/user';
2
+ export declare class LoginForm {
3
+ onSuccess: (user: User) => void;
4
+ isSubmitting: boolean;
5
+ error: string;
6
+ username: string;
7
+ password: string;
8
+ onSubmit(evt: any): Promise<void>;
9
+ render(): any;
10
+ }
@@ -0,0 +1,13 @@
1
+ import { User } from '../../types/user';
2
+ export declare class RegisterForm {
3
+ onSuccess: (user: User) => void;
4
+ isSubmitting: boolean;
5
+ error: string;
6
+ firstName: string;
7
+ lastName: string;
8
+ email: string;
9
+ phone: string;
10
+ password: string;
11
+ onSubmit(evt: any): Promise<void>;
12
+ render(): any;
13
+ }
@@ -0,0 +1,9 @@
1
+ import { User } from '../../types/user';
2
+ export declare class ResetPasswordForm {
3
+ onSuccess: (user: User) => void;
4
+ isSubmitting: boolean;
5
+ error: string;
6
+ username: string;
7
+ onSubmit(evt: any): Promise<void>;
8
+ render(): any;
9
+ }
@@ -0,0 +1,7 @@
1
+ import { User } from '../../types/user';
2
+ export declare class UserForm {
3
+ onSuccess: (user: User) => void;
4
+ type: string;
5
+ currentUser: User;
6
+ render(): any;
7
+ }
@@ -8,6 +8,19 @@ import { HTMLStencilElement, JSXBase } from "./stencil-public-runtime";
8
8
  import { User } from "./types/user";
9
9
  import { ChatMessage, ChatRoom } from "./types/chat";
10
10
  export namespace Components {
11
+ interface ActivateForm {
12
+ "onSubmit": (evt: any) => Promise<void>;
13
+ "onSuccess": (user: User) => void;
14
+ "password": string;
15
+ "resendCode": (evt: any) => Promise<void>;
16
+ "username": string;
17
+ }
18
+ interface ChangePasswordForm {
19
+ "onSubmit": (evt: any) => Promise<void>;
20
+ "onSuccess": (user: User) => void;
21
+ "resendCode": (evt: any) => Promise<void>;
22
+ "username": string;
23
+ }
11
24
  interface ChatBox {
12
25
  "accessToken": string;
13
26
  "fetchData": () => Promise<void>;
@@ -16,11 +29,12 @@ export namespace Components {
16
29
  "senderId": string;
17
30
  }
18
31
  interface ChatButton {
19
- "accessToken": string;
32
+ "accessToken"?: string;
20
33
  "fetchData": () => Promise<void>;
34
+ "onVerificationSuccess": (user: User) => Promise<void>;
21
35
  "primaryColor": string;
22
36
  "receiverId": string;
23
- "senderId": string;
37
+ "senderId"?: string;
24
38
  }
25
39
  interface ChatForm {
26
40
  "chatRoomId": string;
@@ -45,8 +59,20 @@ export namespace Components {
45
59
  "locationAddress"?: string;
46
60
  "locationName"?: string;
47
61
  }
62
+ interface LoginForm {
63
+ "onSubmit": (evt: any) => Promise<void>;
64
+ "onSuccess": (user: User) => void;
65
+ }
48
66
  interface NotifySounds {
49
67
  }
68
+ interface RegisterForm {
69
+ "onSubmit": (evt: any) => Promise<void>;
70
+ "onSuccess": (user: User) => void;
71
+ }
72
+ interface ResetPasswordForm {
73
+ "onSubmit": (evt: any) => Promise<void>;
74
+ "onSuccess": (user: User) => void;
75
+ }
50
76
  interface SalonBooking {
51
77
  "buttonClass": string;
52
78
  "buttonText": string;
@@ -136,8 +162,23 @@ export namespace Components {
136
162
  "shortName": string;
137
163
  "size": number;
138
164
  }
165
+ interface UserForm {
166
+ "onSuccess": (user: User) => void;
167
+ }
139
168
  }
140
169
  declare global {
170
+ interface HTMLActivateFormElement extends Components.ActivateForm, HTMLStencilElement {
171
+ }
172
+ var HTMLActivateFormElement: {
173
+ prototype: HTMLActivateFormElement;
174
+ new (): HTMLActivateFormElement;
175
+ };
176
+ interface HTMLChangePasswordFormElement extends Components.ChangePasswordForm, HTMLStencilElement {
177
+ }
178
+ var HTMLChangePasswordFormElement: {
179
+ prototype: HTMLChangePasswordFormElement;
180
+ new (): HTMLChangePasswordFormElement;
181
+ };
141
182
  interface HTMLChatBoxElement extends Components.ChatBox, HTMLStencilElement {
142
183
  }
143
184
  var HTMLChatBoxElement: {
@@ -174,12 +215,30 @@ declare global {
174
215
  prototype: HTMLGoogleMapElement;
175
216
  new (): HTMLGoogleMapElement;
176
217
  };
218
+ interface HTMLLoginFormElement extends Components.LoginForm, HTMLStencilElement {
219
+ }
220
+ var HTMLLoginFormElement: {
221
+ prototype: HTMLLoginFormElement;
222
+ new (): HTMLLoginFormElement;
223
+ };
177
224
  interface HTMLNotifySoundsElement extends Components.NotifySounds, HTMLStencilElement {
178
225
  }
179
226
  var HTMLNotifySoundsElement: {
180
227
  prototype: HTMLNotifySoundsElement;
181
228
  new (): HTMLNotifySoundsElement;
182
229
  };
230
+ interface HTMLRegisterFormElement extends Components.RegisterForm, HTMLStencilElement {
231
+ }
232
+ var HTMLRegisterFormElement: {
233
+ prototype: HTMLRegisterFormElement;
234
+ new (): HTMLRegisterFormElement;
235
+ };
236
+ interface HTMLResetPasswordFormElement extends Components.ResetPasswordForm, HTMLStencilElement {
237
+ }
238
+ var HTMLResetPasswordFormElement: {
239
+ prototype: HTMLResetPasswordFormElement;
240
+ new (): HTMLResetPasswordFormElement;
241
+ };
183
242
  interface HTMLSalonBookingElement extends Components.SalonBooking, HTMLStencilElement {
184
243
  }
185
244
  var HTMLSalonBookingElement: {
@@ -276,14 +335,25 @@ declare global {
276
335
  prototype: HTMLUserAvatarElement;
277
336
  new (): HTMLUserAvatarElement;
278
337
  };
338
+ interface HTMLUserFormElement extends Components.UserForm, HTMLStencilElement {
339
+ }
340
+ var HTMLUserFormElement: {
341
+ prototype: HTMLUserFormElement;
342
+ new (): HTMLUserFormElement;
343
+ };
279
344
  interface HTMLElementTagNameMap {
345
+ "activate-form": HTMLActivateFormElement;
346
+ "change-password-form": HTMLChangePasswordFormElement;
280
347
  "chat-box": HTMLChatBoxElement;
281
348
  "chat-button": HTMLChatButtonElement;
282
349
  "chat-form": HTMLChatFormElement;
283
350
  "chat-messages": HTMLChatMessagesElement;
284
351
  "chat-rooms": HTMLChatRoomsElement;
285
352
  "google-map": HTMLGoogleMapElement;
353
+ "login-form": HTMLLoginFormElement;
286
354
  "notify-sounds": HTMLNotifySoundsElement;
355
+ "register-form": HTMLRegisterFormElement;
356
+ "reset-password-form": HTMLResetPasswordFormElement;
287
357
  "salon-booking": HTMLSalonBookingElement;
288
358
  "salon-booking-modal": HTMLSalonBookingModalElement;
289
359
  "salon-gift-card": HTMLSalonGiftCardElement;
@@ -300,9 +370,19 @@ declare global {
300
370
  "salon-stylists": HTMLSalonStylistsElement;
301
371
  "style-detail": HTMLStyleDetailElement;
302
372
  "user-avatar": HTMLUserAvatarElement;
373
+ "user-form": HTMLUserFormElement;
303
374
  }
304
375
  }
305
376
  declare namespace LocalJSX {
377
+ interface ActivateForm {
378
+ "onSuccess"?: (user: User) => void;
379
+ "password"?: string;
380
+ "username"?: string;
381
+ }
382
+ interface ChangePasswordForm {
383
+ "onSuccess"?: (user: User) => void;
384
+ "username"?: string;
385
+ }
306
386
  interface ChatBox {
307
387
  "accessToken"?: string;
308
388
  "primaryColor"?: string;
@@ -338,8 +418,17 @@ declare namespace LocalJSX {
338
418
  "locationAddress"?: string;
339
419
  "locationName"?: string;
340
420
  }
421
+ interface LoginForm {
422
+ "onSuccess"?: (user: User) => void;
423
+ }
341
424
  interface NotifySounds {
342
425
  }
426
+ interface RegisterForm {
427
+ "onSuccess"?: (user: User) => void;
428
+ }
429
+ interface ResetPasswordForm {
430
+ "onSuccess"?: (user: User) => void;
431
+ }
343
432
  interface SalonBooking {
344
433
  "buttonClass"?: string;
345
434
  "buttonText"?: string;
@@ -416,14 +505,22 @@ declare namespace LocalJSX {
416
505
  "shortName"?: string;
417
506
  "size"?: number;
418
507
  }
508
+ interface UserForm {
509
+ "onSuccess"?: (user: User) => void;
510
+ }
419
511
  interface IntrinsicElements {
512
+ "activate-form": ActivateForm;
513
+ "change-password-form": ChangePasswordForm;
420
514
  "chat-box": ChatBox;
421
515
  "chat-button": ChatButton;
422
516
  "chat-form": ChatForm;
423
517
  "chat-messages": ChatMessages;
424
518
  "chat-rooms": ChatRooms;
425
519
  "google-map": GoogleMap;
520
+ "login-form": LoginForm;
426
521
  "notify-sounds": NotifySounds;
522
+ "register-form": RegisterForm;
523
+ "reset-password-form": ResetPasswordForm;
427
524
  "salon-booking": SalonBooking;
428
525
  "salon-booking-modal": SalonBookingModal;
429
526
  "salon-gift-card": SalonGiftCard;
@@ -440,19 +537,25 @@ declare namespace LocalJSX {
440
537
  "salon-stylists": SalonStylists;
441
538
  "style-detail": StyleDetail;
442
539
  "user-avatar": UserAvatar;
540
+ "user-form": UserForm;
443
541
  }
444
542
  }
445
543
  export { LocalJSX as JSX };
446
544
  declare module "@stencil/core" {
447
545
  export namespace JSX {
448
546
  interface IntrinsicElements {
547
+ "activate-form": LocalJSX.ActivateForm & JSXBase.HTMLAttributes<HTMLActivateFormElement>;
548
+ "change-password-form": LocalJSX.ChangePasswordForm & JSXBase.HTMLAttributes<HTMLChangePasswordFormElement>;
449
549
  "chat-box": LocalJSX.ChatBox & JSXBase.HTMLAttributes<HTMLChatBoxElement>;
450
550
  "chat-button": LocalJSX.ChatButton & JSXBase.HTMLAttributes<HTMLChatButtonElement>;
451
551
  "chat-form": LocalJSX.ChatForm & JSXBase.HTMLAttributes<HTMLChatFormElement>;
452
552
  "chat-messages": LocalJSX.ChatMessages & JSXBase.HTMLAttributes<HTMLChatMessagesElement>;
453
553
  "chat-rooms": LocalJSX.ChatRooms & JSXBase.HTMLAttributes<HTMLChatRoomsElement>;
454
554
  "google-map": LocalJSX.GoogleMap & JSXBase.HTMLAttributes<HTMLGoogleMapElement>;
555
+ "login-form": LocalJSX.LoginForm & JSXBase.HTMLAttributes<HTMLLoginFormElement>;
455
556
  "notify-sounds": LocalJSX.NotifySounds & JSXBase.HTMLAttributes<HTMLNotifySoundsElement>;
557
+ "register-form": LocalJSX.RegisterForm & JSXBase.HTMLAttributes<HTMLRegisterFormElement>;
558
+ "reset-password-form": LocalJSX.ResetPasswordForm & JSXBase.HTMLAttributes<HTMLResetPasswordFormElement>;
456
559
  "salon-booking": LocalJSX.SalonBooking & JSXBase.HTMLAttributes<HTMLSalonBookingElement>;
457
560
  "salon-booking-modal": LocalJSX.SalonBookingModal & JSXBase.HTMLAttributes<HTMLSalonBookingModalElement>;
458
561
  "salon-gift-card": LocalJSX.SalonGiftCard & JSXBase.HTMLAttributes<HTMLSalonGiftCardElement>;
@@ -469,6 +572,7 @@ declare module "@stencil/core" {
469
572
  "salon-stylists": LocalJSX.SalonStylists & JSXBase.HTMLAttributes<HTMLSalonStylistsElement>;
470
573
  "style-detail": LocalJSX.StyleDetail & JSXBase.HTMLAttributes<HTMLStyleDetailElement>;
471
574
  "user-avatar": LocalJSX.UserAvatar & JSXBase.HTMLAttributes<HTMLUserAvatarElement>;
575
+ "user-form": LocalJSX.UserForm & JSXBase.HTMLAttributes<HTMLUserFormElement>;
472
576
  }
473
577
  }
474
578
  }
@@ -5,6 +5,22 @@ declare class HttpService {
5
5
  firebaseDatabase: any;
6
6
  firebaseApp: any;
7
7
  constructor();
8
+ login(apiUrl: any, options: any): Promise<{
9
+ id: any;
10
+ firstName: any;
11
+ lastName: any;
12
+ fullName: any;
13
+ avatar: any;
14
+ mobilePhone: any;
15
+ accessToken: any;
16
+ email: any;
17
+ password: any;
18
+ }>;
19
+ register(options: any): Promise<import("axios").AxiosResponse<any>>;
20
+ resendActivateCode(email: string): Promise<import("axios").AxiosResponse<never>>;
21
+ activateAccount(email: any, code: any): Promise<import("axios").AxiosResponse<never>>;
22
+ resetPassword(email: string): Promise<import("axios").AxiosResponse<never>>;
23
+ onChangePassword(options: any): Promise<import("axios").AxiosResponse<any>>;
8
24
  fetchClients(salonId: number, keyword: string, accessToken: string): Promise<any>;
9
25
  fetchStyleDetail(styleId: number): Promise<{
10
26
  styleInfo: any;
@@ -4,7 +4,10 @@ export interface User {
4
4
  firstName: string;
5
5
  lastName: string;
6
6
  avatar: string;
7
+ email: string;
7
8
  mobilePhone: string;
9
+ accessToken: string;
10
+ password: string;
8
11
  }
9
12
  export declare function createUser(blob: any): {
10
13
  id: any;
@@ -13,6 +16,9 @@ export declare function createUser(blob: any): {
13
16
  fullName: any;
14
17
  avatar: any;
15
18
  mobilePhone: any;
19
+ accessToken: any;
20
+ email: any;
21
+ password: any;
16
22
  };
17
23
  export declare function createUserFromChatRoom(blob: any): {
18
24
  id: any;
@@ -0,0 +1 @@
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "favesalon-embed",
3
- "version": "1.0.5",
3
+ "version": "1.0.6",
4
4
  "description": "Favesalon Embed",
5
5
  "author": "Trung Luu <trung@favesalon.com> (https://favesalon.com)",
6
6
  "main": "dist/index.cjs.js",