@phygitallabs/tapquest-core 6.7.3 → 6.7.5

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/index.d.mts CHANGED
@@ -6,13 +6,13 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import React$1, { ReactNode } from 'react';
7
7
  import { EntityRewardModel, UserReward } from '@phygitallabs/reward';
8
8
  export { CmentityRewardType, CmentityStatus, CmentityUserReward, EntityRewardModel, UserReward, useClaimUserReward, useClearUserRewardCache, useCreateModelGroupReward, useCreateRewardModel, useDeleteRewardModel, useGetRewardModel, useGetUserRewards, useListRewardModels, useManyUserRewards, useUpdateRewardModel, useV1ListRewards } from '@phygitallabs/reward';
9
+ import * as _phygitallabs_api_core from '@phygitallabs/api-core';
9
10
  import { PaginationRequest, GetManyResponse, UserModel, UserAddressDetail, ProjectModel, LocationModel } from '@phygitallabs/api-core';
10
11
  export { AIBotConfig, AdvertisingConfig, CampaignModel, CampaignState, ChipScanModel, CommonModel, CoreLocationModel, CreateCampaignRequest, CreateCampaignResponse, DateTimeNumber, DeviceMedia, EntityStatus, GeoPosition, GetManyCampaignRequest, GetManyCampaignResponse, GetManyUserActionLocationResponse, GetOneCampaignRequest, LocationAddress, LocationModel, LocationTranslations, Media, MediaType, MemoryModel, Mission, MissionProgress, MissionWithProgress, ProjectModel, SocialMedia, TaskProgress, TaskWithProgress, UpdateCampaignRequest, UpdateCampaignResponse, UserActionLocation, UserCampaignMission, UserCampaignModel, UserSourceType, locationQueryKeys, memoriesKey, resetMemoriesQuery, useOneCampaign as useCampaignDetail, useCancelUserRewardsRequest, useChipScanStory, useCreateClickButtonActionLog, useCreateMemory, useInfiniteMemories, useOneLocation as useLocationDetail, useUserCampaignsCompletedLocation as useLocationProgress, useManyLocations as useLocationsList, useManyMemory, useManyUserActionLocations, useMyProfile, useOneMemory, useOneUserCampaign, usePGLCoreService, useSendEmail, useSyncCheckin, useUpdateMyProfile, useUploadMedia, useUserCampaignAction } from '@phygitallabs/api-core';
11
12
  import { LPResponse } from '@phygitallabs/notification-api';
12
13
  export * from '@phygitallabs/notification-api';
13
14
  export { useDefaultServiceGetPollStats, useDefaultServicePostPoll, useNotificationRewardHandler, useNotificationStore, usePageVisibility, useTCVNotificationRewardHandler, useWebSocket } from '@phygitallabs/notification-api';
14
15
  import { QueryClient } from '@tanstack/react-query';
15
- import * as immer from 'immer';
16
16
  import * as zustand_middleware from 'zustand/middleware';
17
17
  import * as zustand from 'zustand';
18
18
  import { ProtoSignInResponse, OAuthSignInResponse, ProtoSignUpResponse, ResetPasswordRequest, ProtoResetPasswordResponse, ChangePasswordRequest, ProtoChangePasswordResponse, VerifyEmailRequest, ProtoVerifyEmailResponse, SendVerifyCodeRequest, ProtoSendVerifyCodeResponse, ProtoRefreshTokenResponse } from '@phygitallabs/authentication';
@@ -72,7 +72,7 @@ type ConvertSnakeToCamel<T> = T extends (infer U)[] ? ConvertSnakeToCamel<U>[] :
72
72
  declare function convertSnakeToCamel<T>(obj: T): ConvertSnakeToCamel<T>;
73
73
 
74
74
  type TrackingEventName = "challenge_start" | "quest_start" | "challenge_complete" | "quest_complete";
75
- type AchievementActionType = "tap_chip" | "create_memory" | "take_survey";
75
+ type AchievementActionType = "tap_chip" | "create_memory" | "take_survey" | "click_button";
76
76
  interface AchievementTrackingContextValue {
77
77
  trackChallengeStart: (actionType: AchievementActionType) => void;
78
78
  trackQuestStart: () => void;
@@ -634,13 +634,205 @@ declare const useAuthStore: zustand.UseBoundStore<Omit<Omit<Omit<Omit<zustand.St
634
634
  } | undefined): () => void;
635
635
  };
636
636
  }, "setState"> & {
637
- setState(nextStateOrUpdater: AuthStoreState | Partial<AuthStoreState> | ((state: immer.WritableDraft<AuthStoreState>) => void), shouldReplace?: false, action?: (string | {
637
+ setState(nextStateOrUpdater: AuthStoreState | Partial<AuthStoreState> | ((state: {
638
+ actions: {
639
+ setCleanupFunctions: (cleanupFunctions: Partial<AuthCleanupFunctions>) => void;
640
+ addEventCallbacks: (callbacks: AuthEventCallbacks) => () => void;
641
+ signInWithEmail: (email: string, password: string, updateHeaders?: (headers: Record<string, string>) => void, updateAuthenticationHeaders?: (headers: Record<string, string>) => void) => Promise<ProtoSignInResponse>;
642
+ signInWithGoogle: () => Promise<OAuthSignInResponse>;
643
+ signUpWithEmail: (email: string, password: string) => Promise<ProtoSignUpResponse>;
644
+ signOut: () => Promise<void>;
645
+ sendPasswordResetEmail: (email: string) => Promise<void>;
646
+ resetPassword: (data: ResetPasswordRequest) => Promise<ProtoResetPasswordResponse>;
647
+ changePassword: (data: ChangePasswordRequest) => Promise<ProtoChangePasswordResponse>;
648
+ verifyEmailCode: (data: VerifyEmailRequest) => Promise<ProtoVerifyEmailResponse>;
649
+ sendVerifyCode: (data: SendVerifyCodeRequest) => Promise<ProtoSendVerifyCodeResponse>;
650
+ refreshToken: (refreshToken?: string) => Promise<ProtoRefreshTokenResponse>;
651
+ clearError: () => void;
652
+ setUser: (user: UserData | null) => void;
653
+ patchUser: (user: Partial<UserData>) => void;
654
+ setIsSignedIn: (isSignedIn: boolean) => void;
655
+ setIsInitialized: (isInitialized: boolean) => void;
656
+ setIsLoading: (isLoading: boolean) => void;
657
+ initialize: () => void;
658
+ syncAuthState: () => void;
659
+ };
660
+ user: {
661
+ provider?: string | undefined;
662
+ accessToken: string;
663
+ exp: number;
664
+ addressDetail: {
665
+ country?: string | undefined;
666
+ province?: string | undefined;
667
+ district?: string | undefined;
668
+ ward?: string | undefined;
669
+ street?: string | undefined;
670
+ };
671
+ uid: string;
672
+ full_name: string;
673
+ family_name: string;
674
+ given_name: string;
675
+ email: string;
676
+ email_verified: boolean;
677
+ phone?: string | undefined;
678
+ description?: string | undefined;
679
+ picture?: string | undefined;
680
+ dob?: string | undefined;
681
+ sex?: string | undefined;
682
+ roles?: string[] | _phygitallabs_api_core.UserRole[] | undefined;
683
+ account_type?: number | undefined;
684
+ address_detail?: {
685
+ country?: string | undefined;
686
+ province?: string | undefined;
687
+ district?: string | undefined;
688
+ ward?: string | undefined;
689
+ street?: string | undefined;
690
+ } | undefined;
691
+ full_address?: string | undefined;
692
+ adify_point?: number | undefined;
693
+ checked_count?: number | undefined;
694
+ date?: string | undefined;
695
+ device_uid?: string | undefined;
696
+ invited_by?: string | undefined;
697
+ organization?: string | undefined;
698
+ source_item_id?: string | undefined;
699
+ source_chip_uid?: string | undefined;
700
+ source_location_id?: string | undefined;
701
+ source_org_id?: string | undefined;
702
+ source_product_id?: string | undefined;
703
+ source_project_id?: string | undefined;
704
+ source_type?: _phygitallabs_api_core.UserSourceType | undefined;
705
+ user_type?: any;
706
+ wallet_address?: string | undefined;
707
+ id: string;
708
+ status: _phygitallabs_api_core.EntityStatus;
709
+ created_at: _phygitallabs_api_core.DateTimeNumber;
710
+ updated_at: _phygitallabs_api_core.DateTimeNumber;
711
+ created_by?: string | undefined;
712
+ updated_by?: string | undefined;
713
+ } | null;
714
+ isSignedIn: boolean;
715
+ isInitialized: boolean;
716
+ isLoading: boolean;
717
+ error: string | null;
718
+ cleanupFunctions: {
719
+ clearQueryCache?: (() => void) | undefined;
720
+ clearOrganization?: (() => void) | undefined;
721
+ clearHeaders?: (() => void) | undefined;
722
+ clearCustomData?: (() => void) | undefined;
723
+ };
724
+ eventCallbacks: {
725
+ onLoginSuccess?: ((token: string) => void | Promise<void>) | undefined;
726
+ onLoginError?: ((error: Error) => void | Promise<void>) | undefined;
727
+ onLogoutSuccess?: (() => void | Promise<void>) | undefined;
728
+ onLogoutError?: ((error: Error) => void | Promise<void>) | undefined;
729
+ onSignupSuccess?: (() => void | Promise<void>) | undefined;
730
+ onSignupError?: ((error: Error) => void | Promise<void>) | undefined;
731
+ onAuthStateChange?: ((user?: UserData | null, isSignedIn?: boolean) => void | Promise<void>) | undefined;
732
+ };
733
+ }) => void), shouldReplace?: false, action?: (string | {
638
734
  [x: string]: unknown;
639
735
  [x: number]: unknown;
640
736
  [x: symbol]: unknown;
641
737
  type: string;
642
738
  }) | undefined): unknown;
643
- setState(nextStateOrUpdater: AuthStoreState | ((state: immer.WritableDraft<AuthStoreState>) => void), shouldReplace: true, action?: (string | {
739
+ setState(nextStateOrUpdater: AuthStoreState | ((state: {
740
+ actions: {
741
+ setCleanupFunctions: (cleanupFunctions: Partial<AuthCleanupFunctions>) => void;
742
+ addEventCallbacks: (callbacks: AuthEventCallbacks) => () => void;
743
+ signInWithEmail: (email: string, password: string, updateHeaders?: (headers: Record<string, string>) => void, updateAuthenticationHeaders?: (headers: Record<string, string>) => void) => Promise<ProtoSignInResponse>;
744
+ signInWithGoogle: () => Promise<OAuthSignInResponse>;
745
+ signUpWithEmail: (email: string, password: string) => Promise<ProtoSignUpResponse>;
746
+ signOut: () => Promise<void>;
747
+ sendPasswordResetEmail: (email: string) => Promise<void>;
748
+ resetPassword: (data: ResetPasswordRequest) => Promise<ProtoResetPasswordResponse>;
749
+ changePassword: (data: ChangePasswordRequest) => Promise<ProtoChangePasswordResponse>;
750
+ verifyEmailCode: (data: VerifyEmailRequest) => Promise<ProtoVerifyEmailResponse>;
751
+ sendVerifyCode: (data: SendVerifyCodeRequest) => Promise<ProtoSendVerifyCodeResponse>;
752
+ refreshToken: (refreshToken?: string) => Promise<ProtoRefreshTokenResponse>;
753
+ clearError: () => void;
754
+ setUser: (user: UserData | null) => void;
755
+ patchUser: (user: Partial<UserData>) => void;
756
+ setIsSignedIn: (isSignedIn: boolean) => void;
757
+ setIsInitialized: (isInitialized: boolean) => void;
758
+ setIsLoading: (isLoading: boolean) => void;
759
+ initialize: () => void;
760
+ syncAuthState: () => void;
761
+ };
762
+ user: {
763
+ provider?: string | undefined;
764
+ accessToken: string;
765
+ exp: number;
766
+ addressDetail: {
767
+ country?: string | undefined;
768
+ province?: string | undefined;
769
+ district?: string | undefined;
770
+ ward?: string | undefined;
771
+ street?: string | undefined;
772
+ };
773
+ uid: string;
774
+ full_name: string;
775
+ family_name: string;
776
+ given_name: string;
777
+ email: string;
778
+ email_verified: boolean;
779
+ phone?: string | undefined;
780
+ description?: string | undefined;
781
+ picture?: string | undefined;
782
+ dob?: string | undefined;
783
+ sex?: string | undefined;
784
+ roles?: string[] | _phygitallabs_api_core.UserRole[] | undefined;
785
+ account_type?: number | undefined;
786
+ address_detail?: {
787
+ country?: string | undefined;
788
+ province?: string | undefined;
789
+ district?: string | undefined;
790
+ ward?: string | undefined;
791
+ street?: string | undefined;
792
+ } | undefined;
793
+ full_address?: string | undefined;
794
+ adify_point?: number | undefined;
795
+ checked_count?: number | undefined;
796
+ date?: string | undefined;
797
+ device_uid?: string | undefined;
798
+ invited_by?: string | undefined;
799
+ organization?: string | undefined;
800
+ source_item_id?: string | undefined;
801
+ source_chip_uid?: string | undefined;
802
+ source_location_id?: string | undefined;
803
+ source_org_id?: string | undefined;
804
+ source_product_id?: string | undefined;
805
+ source_project_id?: string | undefined;
806
+ source_type?: _phygitallabs_api_core.UserSourceType | undefined;
807
+ user_type?: any;
808
+ wallet_address?: string | undefined;
809
+ id: string;
810
+ status: _phygitallabs_api_core.EntityStatus;
811
+ created_at: _phygitallabs_api_core.DateTimeNumber;
812
+ updated_at: _phygitallabs_api_core.DateTimeNumber;
813
+ created_by?: string | undefined;
814
+ updated_by?: string | undefined;
815
+ } | null;
816
+ isSignedIn: boolean;
817
+ isInitialized: boolean;
818
+ isLoading: boolean;
819
+ error: string | null;
820
+ cleanupFunctions: {
821
+ clearQueryCache?: (() => void) | undefined;
822
+ clearOrganization?: (() => void) | undefined;
823
+ clearHeaders?: (() => void) | undefined;
824
+ clearCustomData?: (() => void) | undefined;
825
+ };
826
+ eventCallbacks: {
827
+ onLoginSuccess?: ((token: string) => void | Promise<void>) | undefined;
828
+ onLoginError?: ((error: Error) => void | Promise<void>) | undefined;
829
+ onLogoutSuccess?: (() => void | Promise<void>) | undefined;
830
+ onLogoutError?: ((error: Error) => void | Promise<void>) | undefined;
831
+ onSignupSuccess?: (() => void | Promise<void>) | undefined;
832
+ onSignupError?: ((error: Error) => void | Promise<void>) | undefined;
833
+ onAuthStateChange?: ((user?: UserData | null, isSignedIn?: boolean) => void | Promise<void>) | undefined;
834
+ };
835
+ }) => void), shouldReplace: true, action?: (string | {
644
836
  [x: string]: unknown;
645
837
  [x: number]: unknown;
646
838
  [x: symbol]: unknown;
package/dist/index.d.ts CHANGED
@@ -6,13 +6,13 @@ import * as react_jsx_runtime from 'react/jsx-runtime';
6
6
  import React$1, { ReactNode } from 'react';
7
7
  import { EntityRewardModel, UserReward } from '@phygitallabs/reward';
8
8
  export { CmentityRewardType, CmentityStatus, CmentityUserReward, EntityRewardModel, UserReward, useClaimUserReward, useClearUserRewardCache, useCreateModelGroupReward, useCreateRewardModel, useDeleteRewardModel, useGetRewardModel, useGetUserRewards, useListRewardModels, useManyUserRewards, useUpdateRewardModel, useV1ListRewards } from '@phygitallabs/reward';
9
+ import * as _phygitallabs_api_core from '@phygitallabs/api-core';
9
10
  import { PaginationRequest, GetManyResponse, UserModel, UserAddressDetail, ProjectModel, LocationModel } from '@phygitallabs/api-core';
10
11
  export { AIBotConfig, AdvertisingConfig, CampaignModel, CampaignState, ChipScanModel, CommonModel, CoreLocationModel, CreateCampaignRequest, CreateCampaignResponse, DateTimeNumber, DeviceMedia, EntityStatus, GeoPosition, GetManyCampaignRequest, GetManyCampaignResponse, GetManyUserActionLocationResponse, GetOneCampaignRequest, LocationAddress, LocationModel, LocationTranslations, Media, MediaType, MemoryModel, Mission, MissionProgress, MissionWithProgress, ProjectModel, SocialMedia, TaskProgress, TaskWithProgress, UpdateCampaignRequest, UpdateCampaignResponse, UserActionLocation, UserCampaignMission, UserCampaignModel, UserSourceType, locationQueryKeys, memoriesKey, resetMemoriesQuery, useOneCampaign as useCampaignDetail, useCancelUserRewardsRequest, useChipScanStory, useCreateClickButtonActionLog, useCreateMemory, useInfiniteMemories, useOneLocation as useLocationDetail, useUserCampaignsCompletedLocation as useLocationProgress, useManyLocations as useLocationsList, useManyMemory, useManyUserActionLocations, useMyProfile, useOneMemory, useOneUserCampaign, usePGLCoreService, useSendEmail, useSyncCheckin, useUpdateMyProfile, useUploadMedia, useUserCampaignAction } from '@phygitallabs/api-core';
11
12
  import { LPResponse } from '@phygitallabs/notification-api';
12
13
  export * from '@phygitallabs/notification-api';
13
14
  export { useDefaultServiceGetPollStats, useDefaultServicePostPoll, useNotificationRewardHandler, useNotificationStore, usePageVisibility, useTCVNotificationRewardHandler, useWebSocket } from '@phygitallabs/notification-api';
14
15
  import { QueryClient } from '@tanstack/react-query';
15
- import * as immer from 'immer';
16
16
  import * as zustand_middleware from 'zustand/middleware';
17
17
  import * as zustand from 'zustand';
18
18
  import { ProtoSignInResponse, OAuthSignInResponse, ProtoSignUpResponse, ResetPasswordRequest, ProtoResetPasswordResponse, ChangePasswordRequest, ProtoChangePasswordResponse, VerifyEmailRequest, ProtoVerifyEmailResponse, SendVerifyCodeRequest, ProtoSendVerifyCodeResponse, ProtoRefreshTokenResponse } from '@phygitallabs/authentication';
@@ -72,7 +72,7 @@ type ConvertSnakeToCamel<T> = T extends (infer U)[] ? ConvertSnakeToCamel<U>[] :
72
72
  declare function convertSnakeToCamel<T>(obj: T): ConvertSnakeToCamel<T>;
73
73
 
74
74
  type TrackingEventName = "challenge_start" | "quest_start" | "challenge_complete" | "quest_complete";
75
- type AchievementActionType = "tap_chip" | "create_memory" | "take_survey";
75
+ type AchievementActionType = "tap_chip" | "create_memory" | "take_survey" | "click_button";
76
76
  interface AchievementTrackingContextValue {
77
77
  trackChallengeStart: (actionType: AchievementActionType) => void;
78
78
  trackQuestStart: () => void;
@@ -634,13 +634,205 @@ declare const useAuthStore: zustand.UseBoundStore<Omit<Omit<Omit<Omit<zustand.St
634
634
  } | undefined): () => void;
635
635
  };
636
636
  }, "setState"> & {
637
- setState(nextStateOrUpdater: AuthStoreState | Partial<AuthStoreState> | ((state: immer.WritableDraft<AuthStoreState>) => void), shouldReplace?: false, action?: (string | {
637
+ setState(nextStateOrUpdater: AuthStoreState | Partial<AuthStoreState> | ((state: {
638
+ actions: {
639
+ setCleanupFunctions: (cleanupFunctions: Partial<AuthCleanupFunctions>) => void;
640
+ addEventCallbacks: (callbacks: AuthEventCallbacks) => () => void;
641
+ signInWithEmail: (email: string, password: string, updateHeaders?: (headers: Record<string, string>) => void, updateAuthenticationHeaders?: (headers: Record<string, string>) => void) => Promise<ProtoSignInResponse>;
642
+ signInWithGoogle: () => Promise<OAuthSignInResponse>;
643
+ signUpWithEmail: (email: string, password: string) => Promise<ProtoSignUpResponse>;
644
+ signOut: () => Promise<void>;
645
+ sendPasswordResetEmail: (email: string) => Promise<void>;
646
+ resetPassword: (data: ResetPasswordRequest) => Promise<ProtoResetPasswordResponse>;
647
+ changePassword: (data: ChangePasswordRequest) => Promise<ProtoChangePasswordResponse>;
648
+ verifyEmailCode: (data: VerifyEmailRequest) => Promise<ProtoVerifyEmailResponse>;
649
+ sendVerifyCode: (data: SendVerifyCodeRequest) => Promise<ProtoSendVerifyCodeResponse>;
650
+ refreshToken: (refreshToken?: string) => Promise<ProtoRefreshTokenResponse>;
651
+ clearError: () => void;
652
+ setUser: (user: UserData | null) => void;
653
+ patchUser: (user: Partial<UserData>) => void;
654
+ setIsSignedIn: (isSignedIn: boolean) => void;
655
+ setIsInitialized: (isInitialized: boolean) => void;
656
+ setIsLoading: (isLoading: boolean) => void;
657
+ initialize: () => void;
658
+ syncAuthState: () => void;
659
+ };
660
+ user: {
661
+ provider?: string | undefined;
662
+ accessToken: string;
663
+ exp: number;
664
+ addressDetail: {
665
+ country?: string | undefined;
666
+ province?: string | undefined;
667
+ district?: string | undefined;
668
+ ward?: string | undefined;
669
+ street?: string | undefined;
670
+ };
671
+ uid: string;
672
+ full_name: string;
673
+ family_name: string;
674
+ given_name: string;
675
+ email: string;
676
+ email_verified: boolean;
677
+ phone?: string | undefined;
678
+ description?: string | undefined;
679
+ picture?: string | undefined;
680
+ dob?: string | undefined;
681
+ sex?: string | undefined;
682
+ roles?: string[] | _phygitallabs_api_core.UserRole[] | undefined;
683
+ account_type?: number | undefined;
684
+ address_detail?: {
685
+ country?: string | undefined;
686
+ province?: string | undefined;
687
+ district?: string | undefined;
688
+ ward?: string | undefined;
689
+ street?: string | undefined;
690
+ } | undefined;
691
+ full_address?: string | undefined;
692
+ adify_point?: number | undefined;
693
+ checked_count?: number | undefined;
694
+ date?: string | undefined;
695
+ device_uid?: string | undefined;
696
+ invited_by?: string | undefined;
697
+ organization?: string | undefined;
698
+ source_item_id?: string | undefined;
699
+ source_chip_uid?: string | undefined;
700
+ source_location_id?: string | undefined;
701
+ source_org_id?: string | undefined;
702
+ source_product_id?: string | undefined;
703
+ source_project_id?: string | undefined;
704
+ source_type?: _phygitallabs_api_core.UserSourceType | undefined;
705
+ user_type?: any;
706
+ wallet_address?: string | undefined;
707
+ id: string;
708
+ status: _phygitallabs_api_core.EntityStatus;
709
+ created_at: _phygitallabs_api_core.DateTimeNumber;
710
+ updated_at: _phygitallabs_api_core.DateTimeNumber;
711
+ created_by?: string | undefined;
712
+ updated_by?: string | undefined;
713
+ } | null;
714
+ isSignedIn: boolean;
715
+ isInitialized: boolean;
716
+ isLoading: boolean;
717
+ error: string | null;
718
+ cleanupFunctions: {
719
+ clearQueryCache?: (() => void) | undefined;
720
+ clearOrganization?: (() => void) | undefined;
721
+ clearHeaders?: (() => void) | undefined;
722
+ clearCustomData?: (() => void) | undefined;
723
+ };
724
+ eventCallbacks: {
725
+ onLoginSuccess?: ((token: string) => void | Promise<void>) | undefined;
726
+ onLoginError?: ((error: Error) => void | Promise<void>) | undefined;
727
+ onLogoutSuccess?: (() => void | Promise<void>) | undefined;
728
+ onLogoutError?: ((error: Error) => void | Promise<void>) | undefined;
729
+ onSignupSuccess?: (() => void | Promise<void>) | undefined;
730
+ onSignupError?: ((error: Error) => void | Promise<void>) | undefined;
731
+ onAuthStateChange?: ((user?: UserData | null, isSignedIn?: boolean) => void | Promise<void>) | undefined;
732
+ };
733
+ }) => void), shouldReplace?: false, action?: (string | {
638
734
  [x: string]: unknown;
639
735
  [x: number]: unknown;
640
736
  [x: symbol]: unknown;
641
737
  type: string;
642
738
  }) | undefined): unknown;
643
- setState(nextStateOrUpdater: AuthStoreState | ((state: immer.WritableDraft<AuthStoreState>) => void), shouldReplace: true, action?: (string | {
739
+ setState(nextStateOrUpdater: AuthStoreState | ((state: {
740
+ actions: {
741
+ setCleanupFunctions: (cleanupFunctions: Partial<AuthCleanupFunctions>) => void;
742
+ addEventCallbacks: (callbacks: AuthEventCallbacks) => () => void;
743
+ signInWithEmail: (email: string, password: string, updateHeaders?: (headers: Record<string, string>) => void, updateAuthenticationHeaders?: (headers: Record<string, string>) => void) => Promise<ProtoSignInResponse>;
744
+ signInWithGoogle: () => Promise<OAuthSignInResponse>;
745
+ signUpWithEmail: (email: string, password: string) => Promise<ProtoSignUpResponse>;
746
+ signOut: () => Promise<void>;
747
+ sendPasswordResetEmail: (email: string) => Promise<void>;
748
+ resetPassword: (data: ResetPasswordRequest) => Promise<ProtoResetPasswordResponse>;
749
+ changePassword: (data: ChangePasswordRequest) => Promise<ProtoChangePasswordResponse>;
750
+ verifyEmailCode: (data: VerifyEmailRequest) => Promise<ProtoVerifyEmailResponse>;
751
+ sendVerifyCode: (data: SendVerifyCodeRequest) => Promise<ProtoSendVerifyCodeResponse>;
752
+ refreshToken: (refreshToken?: string) => Promise<ProtoRefreshTokenResponse>;
753
+ clearError: () => void;
754
+ setUser: (user: UserData | null) => void;
755
+ patchUser: (user: Partial<UserData>) => void;
756
+ setIsSignedIn: (isSignedIn: boolean) => void;
757
+ setIsInitialized: (isInitialized: boolean) => void;
758
+ setIsLoading: (isLoading: boolean) => void;
759
+ initialize: () => void;
760
+ syncAuthState: () => void;
761
+ };
762
+ user: {
763
+ provider?: string | undefined;
764
+ accessToken: string;
765
+ exp: number;
766
+ addressDetail: {
767
+ country?: string | undefined;
768
+ province?: string | undefined;
769
+ district?: string | undefined;
770
+ ward?: string | undefined;
771
+ street?: string | undefined;
772
+ };
773
+ uid: string;
774
+ full_name: string;
775
+ family_name: string;
776
+ given_name: string;
777
+ email: string;
778
+ email_verified: boolean;
779
+ phone?: string | undefined;
780
+ description?: string | undefined;
781
+ picture?: string | undefined;
782
+ dob?: string | undefined;
783
+ sex?: string | undefined;
784
+ roles?: string[] | _phygitallabs_api_core.UserRole[] | undefined;
785
+ account_type?: number | undefined;
786
+ address_detail?: {
787
+ country?: string | undefined;
788
+ province?: string | undefined;
789
+ district?: string | undefined;
790
+ ward?: string | undefined;
791
+ street?: string | undefined;
792
+ } | undefined;
793
+ full_address?: string | undefined;
794
+ adify_point?: number | undefined;
795
+ checked_count?: number | undefined;
796
+ date?: string | undefined;
797
+ device_uid?: string | undefined;
798
+ invited_by?: string | undefined;
799
+ organization?: string | undefined;
800
+ source_item_id?: string | undefined;
801
+ source_chip_uid?: string | undefined;
802
+ source_location_id?: string | undefined;
803
+ source_org_id?: string | undefined;
804
+ source_product_id?: string | undefined;
805
+ source_project_id?: string | undefined;
806
+ source_type?: _phygitallabs_api_core.UserSourceType | undefined;
807
+ user_type?: any;
808
+ wallet_address?: string | undefined;
809
+ id: string;
810
+ status: _phygitallabs_api_core.EntityStatus;
811
+ created_at: _phygitallabs_api_core.DateTimeNumber;
812
+ updated_at: _phygitallabs_api_core.DateTimeNumber;
813
+ created_by?: string | undefined;
814
+ updated_by?: string | undefined;
815
+ } | null;
816
+ isSignedIn: boolean;
817
+ isInitialized: boolean;
818
+ isLoading: boolean;
819
+ error: string | null;
820
+ cleanupFunctions: {
821
+ clearQueryCache?: (() => void) | undefined;
822
+ clearOrganization?: (() => void) | undefined;
823
+ clearHeaders?: (() => void) | undefined;
824
+ clearCustomData?: (() => void) | undefined;
825
+ };
826
+ eventCallbacks: {
827
+ onLoginSuccess?: ((token: string) => void | Promise<void>) | undefined;
828
+ onLoginError?: ((error: Error) => void | Promise<void>) | undefined;
829
+ onLogoutSuccess?: (() => void | Promise<void>) | undefined;
830
+ onLogoutError?: ((error: Error) => void | Promise<void>) | undefined;
831
+ onSignupSuccess?: (() => void | Promise<void>) | undefined;
832
+ onSignupError?: ((error: Error) => void | Promise<void>) | undefined;
833
+ onAuthStateChange?: ((user?: UserData | null, isSignedIn?: boolean) => void | Promise<void>) | undefined;
834
+ };
835
+ }) => void), shouldReplace: true, action?: (string | {
644
836
  [x: string]: unknown;
645
837
  [x: number]: unknown;
646
838
  [x: symbol]: unknown;