@phygitallabs/tapquest-core 6.7.4 → 6.7.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.
package/dist/index.d.mts CHANGED
@@ -6,18 +6,19 @@ 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';
19
19
  export { CommonModel as GenerateCertificateCommonModel, DateTimeNumber as GenerateCertificateDateTimeNumber, EntityStatus as GenerateCertificateEntityStatus, Media as GenerateCertificateMedia, MediaType as GenerateCertificateMediaType, useAddFrame, useCreateCertificate, useCreateCertificateAnonymous, useCreateCertificateWithMask, useGenerateFansipanCertificate, useGenerateTemplateCertificate, useGenerateThaocamvienCertificate, wrapTextWithFont } from '@phygitallabs/generate-certificate';
20
20
  export { cn, fileToBase64, parse } from '@phygitallabs/helpers';
21
+ export { CookieConsentBanner, PhygitalConsentProvider, usePhygitalConsent } from '@phygitallabs/phygital-consent';
21
22
 
22
23
  declare const useManyAchievementProgress: (params: GetManyUserOrDeviceAchievementProgressParams, options?: any) => _tanstack_query_core.QueryObserverRefetchErrorResult<_phygitallabs_achievement.UserAchievementProgress[], Error> | _tanstack_query_core.QueryObserverSuccessResult<_phygitallabs_achievement.UserAchievementProgress[], Error> | _tanstack_query_core.QueryObserverLoadingErrorResult<_phygitallabs_achievement.UserAchievementProgress[], Error> | _tanstack_query_core.QueryObserverPendingResult<_phygitallabs_achievement.UserAchievementProgress[], Error> | _tanstack_query_core.QueryObserverPlaceholderResult<_phygitallabs_achievement.UserAchievementProgress[], Error>;
23
24
 
@@ -634,13 +635,205 @@ declare const useAuthStore: zustand.UseBoundStore<Omit<Omit<Omit<Omit<zustand.St
634
635
  } | undefined): () => void;
635
636
  };
636
637
  }, "setState"> & {
637
- setState(nextStateOrUpdater: AuthStoreState | Partial<AuthStoreState> | ((state: immer.WritableDraft<AuthStoreState>) => void), shouldReplace?: false, action?: (string | {
638
+ setState(nextStateOrUpdater: AuthStoreState | Partial<AuthStoreState> | ((state: {
639
+ actions: {
640
+ setCleanupFunctions: (cleanupFunctions: Partial<AuthCleanupFunctions>) => void;
641
+ addEventCallbacks: (callbacks: AuthEventCallbacks) => () => void;
642
+ signInWithEmail: (email: string, password: string, updateHeaders?: (headers: Record<string, string>) => void, updateAuthenticationHeaders?: (headers: Record<string, string>) => void) => Promise<ProtoSignInResponse>;
643
+ signInWithGoogle: () => Promise<OAuthSignInResponse>;
644
+ signUpWithEmail: (email: string, password: string) => Promise<ProtoSignUpResponse>;
645
+ signOut: () => Promise<void>;
646
+ sendPasswordResetEmail: (email: string) => Promise<void>;
647
+ resetPassword: (data: ResetPasswordRequest) => Promise<ProtoResetPasswordResponse>;
648
+ changePassword: (data: ChangePasswordRequest) => Promise<ProtoChangePasswordResponse>;
649
+ verifyEmailCode: (data: VerifyEmailRequest) => Promise<ProtoVerifyEmailResponse>;
650
+ sendVerifyCode: (data: SendVerifyCodeRequest) => Promise<ProtoSendVerifyCodeResponse>;
651
+ refreshToken: (refreshToken?: string) => Promise<ProtoRefreshTokenResponse>;
652
+ clearError: () => void;
653
+ setUser: (user: UserData | null) => void;
654
+ patchUser: (user: Partial<UserData>) => void;
655
+ setIsSignedIn: (isSignedIn: boolean) => void;
656
+ setIsInitialized: (isInitialized: boolean) => void;
657
+ setIsLoading: (isLoading: boolean) => void;
658
+ initialize: () => void;
659
+ syncAuthState: () => void;
660
+ };
661
+ user: {
662
+ provider?: string | undefined;
663
+ accessToken: string;
664
+ exp: number;
665
+ addressDetail: {
666
+ country?: string | undefined;
667
+ province?: string | undefined;
668
+ district?: string | undefined;
669
+ ward?: string | undefined;
670
+ street?: string | undefined;
671
+ };
672
+ uid: string;
673
+ full_name: string;
674
+ family_name: string;
675
+ given_name: string;
676
+ email: string;
677
+ email_verified: boolean;
678
+ phone?: string | undefined;
679
+ description?: string | undefined;
680
+ picture?: string | undefined;
681
+ dob?: string | undefined;
682
+ sex?: string | undefined;
683
+ roles?: string[] | _phygitallabs_api_core.UserRole[] | undefined;
684
+ account_type?: number | undefined;
685
+ address_detail?: {
686
+ country?: string | undefined;
687
+ province?: string | undefined;
688
+ district?: string | undefined;
689
+ ward?: string | undefined;
690
+ street?: string | undefined;
691
+ } | undefined;
692
+ full_address?: string | undefined;
693
+ adify_point?: number | undefined;
694
+ checked_count?: number | undefined;
695
+ date?: string | undefined;
696
+ device_uid?: string | undefined;
697
+ invited_by?: string | undefined;
698
+ organization?: string | undefined;
699
+ source_item_id?: string | undefined;
700
+ source_chip_uid?: string | undefined;
701
+ source_location_id?: string | undefined;
702
+ source_org_id?: string | undefined;
703
+ source_product_id?: string | undefined;
704
+ source_project_id?: string | undefined;
705
+ source_type?: _phygitallabs_api_core.UserSourceType | undefined;
706
+ user_type?: any;
707
+ wallet_address?: string | undefined;
708
+ id: string;
709
+ status: _phygitallabs_api_core.EntityStatus;
710
+ created_at: _phygitallabs_api_core.DateTimeNumber;
711
+ updated_at: _phygitallabs_api_core.DateTimeNumber;
712
+ created_by?: string | undefined;
713
+ updated_by?: string | undefined;
714
+ } | null;
715
+ isSignedIn: boolean;
716
+ isInitialized: boolean;
717
+ isLoading: boolean;
718
+ error: string | null;
719
+ cleanupFunctions: {
720
+ clearQueryCache?: (() => void) | undefined;
721
+ clearOrganization?: (() => void) | undefined;
722
+ clearHeaders?: (() => void) | undefined;
723
+ clearCustomData?: (() => void) | undefined;
724
+ };
725
+ eventCallbacks: {
726
+ onLoginSuccess?: ((token: string) => void | Promise<void>) | undefined;
727
+ onLoginError?: ((error: Error) => void | Promise<void>) | undefined;
728
+ onLogoutSuccess?: (() => void | Promise<void>) | undefined;
729
+ onLogoutError?: ((error: Error) => void | Promise<void>) | undefined;
730
+ onSignupSuccess?: (() => void | Promise<void>) | undefined;
731
+ onSignupError?: ((error: Error) => void | Promise<void>) | undefined;
732
+ onAuthStateChange?: ((user?: UserData | null, isSignedIn?: boolean) => void | Promise<void>) | undefined;
733
+ };
734
+ }) => void), shouldReplace?: false, action?: (string | {
638
735
  [x: string]: unknown;
639
736
  [x: number]: unknown;
640
737
  [x: symbol]: unknown;
641
738
  type: string;
642
739
  }) | undefined): unknown;
643
- setState(nextStateOrUpdater: AuthStoreState | ((state: immer.WritableDraft<AuthStoreState>) => void), shouldReplace: true, action?: (string | {
740
+ setState(nextStateOrUpdater: AuthStoreState | ((state: {
741
+ actions: {
742
+ setCleanupFunctions: (cleanupFunctions: Partial<AuthCleanupFunctions>) => void;
743
+ addEventCallbacks: (callbacks: AuthEventCallbacks) => () => void;
744
+ signInWithEmail: (email: string, password: string, updateHeaders?: (headers: Record<string, string>) => void, updateAuthenticationHeaders?: (headers: Record<string, string>) => void) => Promise<ProtoSignInResponse>;
745
+ signInWithGoogle: () => Promise<OAuthSignInResponse>;
746
+ signUpWithEmail: (email: string, password: string) => Promise<ProtoSignUpResponse>;
747
+ signOut: () => Promise<void>;
748
+ sendPasswordResetEmail: (email: string) => Promise<void>;
749
+ resetPassword: (data: ResetPasswordRequest) => Promise<ProtoResetPasswordResponse>;
750
+ changePassword: (data: ChangePasswordRequest) => Promise<ProtoChangePasswordResponse>;
751
+ verifyEmailCode: (data: VerifyEmailRequest) => Promise<ProtoVerifyEmailResponse>;
752
+ sendVerifyCode: (data: SendVerifyCodeRequest) => Promise<ProtoSendVerifyCodeResponse>;
753
+ refreshToken: (refreshToken?: string) => Promise<ProtoRefreshTokenResponse>;
754
+ clearError: () => void;
755
+ setUser: (user: UserData | null) => void;
756
+ patchUser: (user: Partial<UserData>) => void;
757
+ setIsSignedIn: (isSignedIn: boolean) => void;
758
+ setIsInitialized: (isInitialized: boolean) => void;
759
+ setIsLoading: (isLoading: boolean) => void;
760
+ initialize: () => void;
761
+ syncAuthState: () => void;
762
+ };
763
+ user: {
764
+ provider?: string | undefined;
765
+ accessToken: string;
766
+ exp: number;
767
+ addressDetail: {
768
+ country?: string | undefined;
769
+ province?: string | undefined;
770
+ district?: string | undefined;
771
+ ward?: string | undefined;
772
+ street?: string | undefined;
773
+ };
774
+ uid: string;
775
+ full_name: string;
776
+ family_name: string;
777
+ given_name: string;
778
+ email: string;
779
+ email_verified: boolean;
780
+ phone?: string | undefined;
781
+ description?: string | undefined;
782
+ picture?: string | undefined;
783
+ dob?: string | undefined;
784
+ sex?: string | undefined;
785
+ roles?: string[] | _phygitallabs_api_core.UserRole[] | undefined;
786
+ account_type?: number | undefined;
787
+ address_detail?: {
788
+ country?: string | undefined;
789
+ province?: string | undefined;
790
+ district?: string | undefined;
791
+ ward?: string | undefined;
792
+ street?: string | undefined;
793
+ } | undefined;
794
+ full_address?: string | undefined;
795
+ adify_point?: number | undefined;
796
+ checked_count?: number | undefined;
797
+ date?: string | undefined;
798
+ device_uid?: string | undefined;
799
+ invited_by?: string | undefined;
800
+ organization?: string | undefined;
801
+ source_item_id?: string | undefined;
802
+ source_chip_uid?: string | undefined;
803
+ source_location_id?: string | undefined;
804
+ source_org_id?: string | undefined;
805
+ source_product_id?: string | undefined;
806
+ source_project_id?: string | undefined;
807
+ source_type?: _phygitallabs_api_core.UserSourceType | undefined;
808
+ user_type?: any;
809
+ wallet_address?: string | undefined;
810
+ id: string;
811
+ status: _phygitallabs_api_core.EntityStatus;
812
+ created_at: _phygitallabs_api_core.DateTimeNumber;
813
+ updated_at: _phygitallabs_api_core.DateTimeNumber;
814
+ created_by?: string | undefined;
815
+ updated_by?: string | undefined;
816
+ } | null;
817
+ isSignedIn: boolean;
818
+ isInitialized: boolean;
819
+ isLoading: boolean;
820
+ error: string | null;
821
+ cleanupFunctions: {
822
+ clearQueryCache?: (() => void) | undefined;
823
+ clearOrganization?: (() => void) | undefined;
824
+ clearHeaders?: (() => void) | undefined;
825
+ clearCustomData?: (() => void) | undefined;
826
+ };
827
+ eventCallbacks: {
828
+ onLoginSuccess?: ((token: string) => void | Promise<void>) | undefined;
829
+ onLoginError?: ((error: Error) => void | Promise<void>) | undefined;
830
+ onLogoutSuccess?: (() => void | Promise<void>) | undefined;
831
+ onLogoutError?: ((error: Error) => void | Promise<void>) | undefined;
832
+ onSignupSuccess?: (() => void | Promise<void>) | undefined;
833
+ onSignupError?: ((error: Error) => void | Promise<void>) | undefined;
834
+ onAuthStateChange?: ((user?: UserData | null, isSignedIn?: boolean) => void | Promise<void>) | undefined;
835
+ };
836
+ }) => void), shouldReplace: true, action?: (string | {
644
837
  [x: string]: unknown;
645
838
  [x: number]: unknown;
646
839
  [x: symbol]: unknown;
package/dist/index.d.ts CHANGED
@@ -6,18 +6,19 @@ 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';
19
19
  export { CommonModel as GenerateCertificateCommonModel, DateTimeNumber as GenerateCertificateDateTimeNumber, EntityStatus as GenerateCertificateEntityStatus, Media as GenerateCertificateMedia, MediaType as GenerateCertificateMediaType, useAddFrame, useCreateCertificate, useCreateCertificateAnonymous, useCreateCertificateWithMask, useGenerateFansipanCertificate, useGenerateTemplateCertificate, useGenerateThaocamvienCertificate, wrapTextWithFont } from '@phygitallabs/generate-certificate';
20
20
  export { cn, fileToBase64, parse } from '@phygitallabs/helpers';
21
+ export { CookieConsentBanner, PhygitalConsentProvider, usePhygitalConsent } from '@phygitallabs/phygital-consent';
21
22
 
22
23
  declare const useManyAchievementProgress: (params: GetManyUserOrDeviceAchievementProgressParams, options?: any) => _tanstack_query_core.QueryObserverRefetchErrorResult<_phygitallabs_achievement.UserAchievementProgress[], Error> | _tanstack_query_core.QueryObserverSuccessResult<_phygitallabs_achievement.UserAchievementProgress[], Error> | _tanstack_query_core.QueryObserverLoadingErrorResult<_phygitallabs_achievement.UserAchievementProgress[], Error> | _tanstack_query_core.QueryObserverPendingResult<_phygitallabs_achievement.UserAchievementProgress[], Error> | _tanstack_query_core.QueryObserverPlaceholderResult<_phygitallabs_achievement.UserAchievementProgress[], Error>;
23
24
 
@@ -634,13 +635,205 @@ declare const useAuthStore: zustand.UseBoundStore<Omit<Omit<Omit<Omit<zustand.St
634
635
  } | undefined): () => void;
635
636
  };
636
637
  }, "setState"> & {
637
- setState(nextStateOrUpdater: AuthStoreState | Partial<AuthStoreState> | ((state: immer.WritableDraft<AuthStoreState>) => void), shouldReplace?: false, action?: (string | {
638
+ setState(nextStateOrUpdater: AuthStoreState | Partial<AuthStoreState> | ((state: {
639
+ actions: {
640
+ setCleanupFunctions: (cleanupFunctions: Partial<AuthCleanupFunctions>) => void;
641
+ addEventCallbacks: (callbacks: AuthEventCallbacks) => () => void;
642
+ signInWithEmail: (email: string, password: string, updateHeaders?: (headers: Record<string, string>) => void, updateAuthenticationHeaders?: (headers: Record<string, string>) => void) => Promise<ProtoSignInResponse>;
643
+ signInWithGoogle: () => Promise<OAuthSignInResponse>;
644
+ signUpWithEmail: (email: string, password: string) => Promise<ProtoSignUpResponse>;
645
+ signOut: () => Promise<void>;
646
+ sendPasswordResetEmail: (email: string) => Promise<void>;
647
+ resetPassword: (data: ResetPasswordRequest) => Promise<ProtoResetPasswordResponse>;
648
+ changePassword: (data: ChangePasswordRequest) => Promise<ProtoChangePasswordResponse>;
649
+ verifyEmailCode: (data: VerifyEmailRequest) => Promise<ProtoVerifyEmailResponse>;
650
+ sendVerifyCode: (data: SendVerifyCodeRequest) => Promise<ProtoSendVerifyCodeResponse>;
651
+ refreshToken: (refreshToken?: string) => Promise<ProtoRefreshTokenResponse>;
652
+ clearError: () => void;
653
+ setUser: (user: UserData | null) => void;
654
+ patchUser: (user: Partial<UserData>) => void;
655
+ setIsSignedIn: (isSignedIn: boolean) => void;
656
+ setIsInitialized: (isInitialized: boolean) => void;
657
+ setIsLoading: (isLoading: boolean) => void;
658
+ initialize: () => void;
659
+ syncAuthState: () => void;
660
+ };
661
+ user: {
662
+ provider?: string | undefined;
663
+ accessToken: string;
664
+ exp: number;
665
+ addressDetail: {
666
+ country?: string | undefined;
667
+ province?: string | undefined;
668
+ district?: string | undefined;
669
+ ward?: string | undefined;
670
+ street?: string | undefined;
671
+ };
672
+ uid: string;
673
+ full_name: string;
674
+ family_name: string;
675
+ given_name: string;
676
+ email: string;
677
+ email_verified: boolean;
678
+ phone?: string | undefined;
679
+ description?: string | undefined;
680
+ picture?: string | undefined;
681
+ dob?: string | undefined;
682
+ sex?: string | undefined;
683
+ roles?: string[] | _phygitallabs_api_core.UserRole[] | undefined;
684
+ account_type?: number | undefined;
685
+ address_detail?: {
686
+ country?: string | undefined;
687
+ province?: string | undefined;
688
+ district?: string | undefined;
689
+ ward?: string | undefined;
690
+ street?: string | undefined;
691
+ } | undefined;
692
+ full_address?: string | undefined;
693
+ adify_point?: number | undefined;
694
+ checked_count?: number | undefined;
695
+ date?: string | undefined;
696
+ device_uid?: string | undefined;
697
+ invited_by?: string | undefined;
698
+ organization?: string | undefined;
699
+ source_item_id?: string | undefined;
700
+ source_chip_uid?: string | undefined;
701
+ source_location_id?: string | undefined;
702
+ source_org_id?: string | undefined;
703
+ source_product_id?: string | undefined;
704
+ source_project_id?: string | undefined;
705
+ source_type?: _phygitallabs_api_core.UserSourceType | undefined;
706
+ user_type?: any;
707
+ wallet_address?: string | undefined;
708
+ id: string;
709
+ status: _phygitallabs_api_core.EntityStatus;
710
+ created_at: _phygitallabs_api_core.DateTimeNumber;
711
+ updated_at: _phygitallabs_api_core.DateTimeNumber;
712
+ created_by?: string | undefined;
713
+ updated_by?: string | undefined;
714
+ } | null;
715
+ isSignedIn: boolean;
716
+ isInitialized: boolean;
717
+ isLoading: boolean;
718
+ error: string | null;
719
+ cleanupFunctions: {
720
+ clearQueryCache?: (() => void) | undefined;
721
+ clearOrganization?: (() => void) | undefined;
722
+ clearHeaders?: (() => void) | undefined;
723
+ clearCustomData?: (() => void) | undefined;
724
+ };
725
+ eventCallbacks: {
726
+ onLoginSuccess?: ((token: string) => void | Promise<void>) | undefined;
727
+ onLoginError?: ((error: Error) => void | Promise<void>) | undefined;
728
+ onLogoutSuccess?: (() => void | Promise<void>) | undefined;
729
+ onLogoutError?: ((error: Error) => void | Promise<void>) | undefined;
730
+ onSignupSuccess?: (() => void | Promise<void>) | undefined;
731
+ onSignupError?: ((error: Error) => void | Promise<void>) | undefined;
732
+ onAuthStateChange?: ((user?: UserData | null, isSignedIn?: boolean) => void | Promise<void>) | undefined;
733
+ };
734
+ }) => void), shouldReplace?: false, action?: (string | {
638
735
  [x: string]: unknown;
639
736
  [x: number]: unknown;
640
737
  [x: symbol]: unknown;
641
738
  type: string;
642
739
  }) | undefined): unknown;
643
- setState(nextStateOrUpdater: AuthStoreState | ((state: immer.WritableDraft<AuthStoreState>) => void), shouldReplace: true, action?: (string | {
740
+ setState(nextStateOrUpdater: AuthStoreState | ((state: {
741
+ actions: {
742
+ setCleanupFunctions: (cleanupFunctions: Partial<AuthCleanupFunctions>) => void;
743
+ addEventCallbacks: (callbacks: AuthEventCallbacks) => () => void;
744
+ signInWithEmail: (email: string, password: string, updateHeaders?: (headers: Record<string, string>) => void, updateAuthenticationHeaders?: (headers: Record<string, string>) => void) => Promise<ProtoSignInResponse>;
745
+ signInWithGoogle: () => Promise<OAuthSignInResponse>;
746
+ signUpWithEmail: (email: string, password: string) => Promise<ProtoSignUpResponse>;
747
+ signOut: () => Promise<void>;
748
+ sendPasswordResetEmail: (email: string) => Promise<void>;
749
+ resetPassword: (data: ResetPasswordRequest) => Promise<ProtoResetPasswordResponse>;
750
+ changePassword: (data: ChangePasswordRequest) => Promise<ProtoChangePasswordResponse>;
751
+ verifyEmailCode: (data: VerifyEmailRequest) => Promise<ProtoVerifyEmailResponse>;
752
+ sendVerifyCode: (data: SendVerifyCodeRequest) => Promise<ProtoSendVerifyCodeResponse>;
753
+ refreshToken: (refreshToken?: string) => Promise<ProtoRefreshTokenResponse>;
754
+ clearError: () => void;
755
+ setUser: (user: UserData | null) => void;
756
+ patchUser: (user: Partial<UserData>) => void;
757
+ setIsSignedIn: (isSignedIn: boolean) => void;
758
+ setIsInitialized: (isInitialized: boolean) => void;
759
+ setIsLoading: (isLoading: boolean) => void;
760
+ initialize: () => void;
761
+ syncAuthState: () => void;
762
+ };
763
+ user: {
764
+ provider?: string | undefined;
765
+ accessToken: string;
766
+ exp: number;
767
+ addressDetail: {
768
+ country?: string | undefined;
769
+ province?: string | undefined;
770
+ district?: string | undefined;
771
+ ward?: string | undefined;
772
+ street?: string | undefined;
773
+ };
774
+ uid: string;
775
+ full_name: string;
776
+ family_name: string;
777
+ given_name: string;
778
+ email: string;
779
+ email_verified: boolean;
780
+ phone?: string | undefined;
781
+ description?: string | undefined;
782
+ picture?: string | undefined;
783
+ dob?: string | undefined;
784
+ sex?: string | undefined;
785
+ roles?: string[] | _phygitallabs_api_core.UserRole[] | undefined;
786
+ account_type?: number | undefined;
787
+ address_detail?: {
788
+ country?: string | undefined;
789
+ province?: string | undefined;
790
+ district?: string | undefined;
791
+ ward?: string | undefined;
792
+ street?: string | undefined;
793
+ } | undefined;
794
+ full_address?: string | undefined;
795
+ adify_point?: number | undefined;
796
+ checked_count?: number | undefined;
797
+ date?: string | undefined;
798
+ device_uid?: string | undefined;
799
+ invited_by?: string | undefined;
800
+ organization?: string | undefined;
801
+ source_item_id?: string | undefined;
802
+ source_chip_uid?: string | undefined;
803
+ source_location_id?: string | undefined;
804
+ source_org_id?: string | undefined;
805
+ source_product_id?: string | undefined;
806
+ source_project_id?: string | undefined;
807
+ source_type?: _phygitallabs_api_core.UserSourceType | undefined;
808
+ user_type?: any;
809
+ wallet_address?: string | undefined;
810
+ id: string;
811
+ status: _phygitallabs_api_core.EntityStatus;
812
+ created_at: _phygitallabs_api_core.DateTimeNumber;
813
+ updated_at: _phygitallabs_api_core.DateTimeNumber;
814
+ created_by?: string | undefined;
815
+ updated_by?: string | undefined;
816
+ } | null;
817
+ isSignedIn: boolean;
818
+ isInitialized: boolean;
819
+ isLoading: boolean;
820
+ error: string | null;
821
+ cleanupFunctions: {
822
+ clearQueryCache?: (() => void) | undefined;
823
+ clearOrganization?: (() => void) | undefined;
824
+ clearHeaders?: (() => void) | undefined;
825
+ clearCustomData?: (() => void) | undefined;
826
+ };
827
+ eventCallbacks: {
828
+ onLoginSuccess?: ((token: string) => void | Promise<void>) | undefined;
829
+ onLoginError?: ((error: Error) => void | Promise<void>) | undefined;
830
+ onLogoutSuccess?: (() => void | Promise<void>) | undefined;
831
+ onLogoutError?: ((error: Error) => void | Promise<void>) | undefined;
832
+ onSignupSuccess?: (() => void | Promise<void>) | undefined;
833
+ onSignupError?: ((error: Error) => void | Promise<void>) | undefined;
834
+ onAuthStateChange?: ((user?: UserData | null, isSignedIn?: boolean) => void | Promise<void>) | undefined;
835
+ };
836
+ }) => void), shouldReplace: true, action?: (string | {
644
837
  [x: string]: unknown;
645
838
  [x: number]: unknown;
646
839
  [x: symbol]: unknown;