@phygitallabs/tapquest-core 4.5.0 → 4.6.1

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
@@ -4,15 +4,16 @@ import { GetManyUserOrDeviceAchievementProgressParams, Achievement, UserAchievem
4
4
  export { Achievement, AchievementRuleActionType, AchievementServiceProvider, GetAchievementProgressResponse, UserAchievementProgress, useAchievementProgress, useManyAchievements, useManyAchievementsRewardModels, useManyChildrenAchievements, useOneAchievement, useUserAchievementAction } from '@phygitallabs/achievement';
5
5
  import { EntityRewardModel, UserReward } from '@phygitallabs/reward';
6
6
  export { CmentityRewardType, CmentityStatus, CmentityUserReward, EntityRewardModel, UserReward, useClaimUserReward, useClearUserRewardCache, useCreateModelGroupReward, useCreateRewardModel, useDeleteRewardModel, useGetRewardModel, useGetUserRewards, useListRewardModels, useManyUserRewards, useUpdateRewardModel, useV1ListRewards } from '@phygitallabs/reward';
7
- import { PaginationRequest, GetManyResponse } from '@phygitallabs/api-core/src/types/pagination';
7
+ import { PaginationRequest, GetManyResponse, UserModel, UserAddressDetail, ProjectModel, LocationModel } from '@phygitallabs/api-core';
8
+ 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, 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';
8
9
  import { LPResponse } from '@phygitallabs/notification-api';
9
10
  export * from '@phygitallabs/notification-api';
11
+ export { useDefaultServiceGetPollStats, useDefaultServicePostPoll, useNotificationRewardHandler, useNotificationStore, usePageVisibility, useTCVNotificationRewardHandler, useWebSocket } from '@phygitallabs/notification-api';
10
12
  import React$1 from 'react';
11
- import { ProjectModel, LocationModel } from '@phygitallabs/api-core';
12
- 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, 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';
13
13
  import * as react_jsx_runtime from 'react/jsx-runtime';
14
14
  import { QueryClient } from '@tanstack/react-query';
15
- export { CommonModel as GenerateCertificateCommonModel, DateTimeNumber as GenerateCertificateDateTimeNumber, EntityStatus as GenerateCertificateEntityStatus, Media as GenerateCertificateMedia, MediaType as GenerateCertificateMediaType, useCreateCertificate, useCreateCertificateAnonymous, useCreateCertificateWithMask, useGenerateFansipanCertificate, useGenerateTemplateCertificate, useGenerateThaocamvienCertificate, wrapTextWithFont } from '@phygitallabs/generate-certificate';
15
+ import { ProtoSignInResponse, OAuthSignInResponse, ProtoSignUpResponse, ResetPasswordRequest, ProtoResetPasswordResponse, ChangePasswordRequest, ProtoChangePasswordResponse, VerifyEmailRequest, ProtoVerifyEmailResponse, SendVerifyCodeRequest, ProtoSendVerifyCodeResponse, ProtoRefreshTokenResponse } from '@phygitallabs/authentication';
16
+ 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';
16
17
  export { cn, fileToBase64, parse } from '@phygitallabs/helpers';
17
18
 
18
19
  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>;
@@ -416,7 +417,7 @@ declare enum UserRole {
416
417
  SUPERADMIN = "SUPER_ADMIN",
417
418
  ORGADMIN = "ORG_ADMIN"
418
419
  }
419
- type UserData = {
420
+ type UserData$1 = {
420
421
  uid: string;
421
422
  id: string;
422
423
  userName: string;
@@ -433,7 +434,7 @@ type UserData = {
433
434
  };
434
435
  interface AuthResponse {
435
436
  errorCode: string;
436
- data: UserData | null;
437
+ data: UserData$1 | null;
437
438
  }
438
439
  interface AuthService {
439
440
  signInWithEmailAndPassword(email: string, password: string): Promise<AuthResponse>;
@@ -443,8 +444,8 @@ interface AuthService {
443
444
  sendPasswordResetEmail(email: string): Promise<void>;
444
445
  sendEmailVerification(): Promise<void>;
445
446
  changePassword(newPassword: string): Promise<void>;
446
- onAuthStateChanged(callback: (user: UserData | null) => void): () => void;
447
- getCurrentUser(): UserData | null;
447
+ onAuthStateChanged(callback: (user: UserData$1 | null) => void): () => void;
448
+ getCurrentUser(): UserData$1 | null;
448
449
  }
449
450
  interface AuthCallbacks {
450
451
  onUserIdentify?: (userInfo: {
@@ -454,14 +455,14 @@ interface AuthCallbacks {
454
455
  uid?: string;
455
456
  }) => void;
456
457
  onTrackingReset?: () => void;
457
- onSignInSuccess?: (userData: UserData) => void;
458
+ onSignInSuccess?: (userData: UserData$1) => void;
458
459
  onSignInError?: (error: string) => void;
459
460
  onSignOutSuccess?: () => void;
460
- onSignUpSuccess?: (userData: UserData) => void;
461
+ onSignUpSuccess?: (userData: UserData$1) => void;
461
462
  onSignUpError?: (error: string) => void;
462
463
  }
463
464
  interface UseAuthReturn {
464
- user: UserData;
465
+ user: UserData$1;
465
466
  isSignedIn: boolean;
466
467
  isLoading: boolean;
467
468
  signIn: (email: string, password: string) => Promise<AuthResponse>;
@@ -472,7 +473,7 @@ interface UseAuthReturn {
472
473
  sendEmailVerification: () => Promise<void>;
473
474
  changePassword: (newPassword: string) => Promise<void>;
474
475
  updateScanStatus: (status: boolean) => void;
475
- refreshUser: (userData: UserData) => void;
476
+ refreshUser: (userData: UserData$1) => void;
476
477
  }
477
478
  interface AuthProviderProps$1 {
478
479
  children: React.ReactNode;
@@ -496,10 +497,59 @@ interface AuthProviderProps {
496
497
  }
497
498
  declare const AuthProvider: ({ children, baseURL, queryClient, }: AuthProviderProps) => react_jsx_runtime.JSX.Element;
498
499
 
499
- declare const useAuth: () => any;
500
+ interface UserData extends UserModel {
501
+ provider?: string;
502
+ accessToken: string;
503
+ exp: number;
504
+ addressDetail: UserAddressDetail;
505
+ }
506
+
507
+ interface AuthEventCallbacks {
508
+ onLoginSuccess?: (token: string) => void | Promise<void>;
509
+ onLoginError?: (error: Error) => void | Promise<void>;
510
+ onLogoutSuccess?: () => void | Promise<void>;
511
+ onLogoutError?: (error: Error) => void | Promise<void>;
512
+ onSignupSuccess?: () => void | Promise<void>;
513
+ onSignupError?: (error: Error) => void | Promise<void>;
514
+ onAuthStateChange?: (user?: UserData | null, isSignedIn?: boolean) => void | Promise<void>;
515
+ }
516
+
517
+ interface AuthCleanupFunctions {
518
+ clearQueryCache?: () => void;
519
+ clearOrganization?: () => void;
520
+ clearHeaders?: () => void;
521
+ clearCustomData?: () => void;
522
+ }
523
+ declare const useAuth: () => {
524
+ setCleanupFunctions: (cleanupFunctions: Partial<AuthCleanupFunctions>) => void;
525
+ addEventCallbacks: (callbacks: AuthEventCallbacks) => () => void;
526
+ signInWithEmail: (email: string, password: string, updateHeaders?: (headers: Record<string, string>) => void, updateAuthenticationHeaders?: (headers: Record<string, string>) => void) => Promise<ProtoSignInResponse>;
527
+ signInWithGoogle: () => Promise<OAuthSignInResponse>;
528
+ signUpWithEmail: (email: string, password: string) => Promise<ProtoSignUpResponse>;
529
+ signOut: () => Promise<void>;
530
+ sendPasswordResetEmail: (email: string) => Promise<void>;
531
+ resetPassword: (data: ResetPasswordRequest) => Promise<ProtoResetPasswordResponse>;
532
+ changePassword: (data: ChangePasswordRequest) => Promise<ProtoChangePasswordResponse>;
533
+ verifyEmailCode: (data: VerifyEmailRequest) => Promise<ProtoVerifyEmailResponse>;
534
+ sendVerifyCode: (data: SendVerifyCodeRequest) => Promise<ProtoSendVerifyCodeResponse>;
535
+ refreshToken: (refreshToken?: string) => Promise<ProtoRefreshTokenResponse>;
536
+ clearError: () => void;
537
+ setUser: (user: UserData | null) => void;
538
+ patchUser: (user: Partial<UserData>) => void;
539
+ setIsSignedIn: (isSignedIn: boolean) => void;
540
+ setIsInitialized: (isInitialized: boolean) => void;
541
+ setIsLoading: (isLoading: boolean) => void;
542
+ initialize: () => void;
543
+ syncAuthState: () => void;
544
+ user: UserData | null;
545
+ isSignedIn: boolean;
546
+ isInitialized: boolean;
547
+ isLoading: boolean;
548
+ error: string | null;
549
+ };
500
550
 
501
551
  interface UseGoogleLoginOptions {
502
- onSuccess?: () => void;
552
+ onSuccess?: (userData: any) => void;
503
553
  onError?: (error: string) => void;
504
554
  onPopupBlocked?: () => void;
505
555
  onPopupClosed?: () => void;
@@ -653,6 +703,149 @@ declare function useDataTracking(): {
653
703
  trackLogoutEvent: () => void;
654
704
  };
655
705
 
706
+ /**
707
+ * OpenReplay Session Replay Types
708
+ *
709
+ * Type definitions for OpenReplay session replay configuration and options
710
+ */
711
+ /**
712
+ * OpenReplay Configuration Options
713
+ */
714
+ interface OpenReplayConfig {
715
+ /**
716
+ * OpenReplay project key (required)
717
+ * Get this from your OpenReplay dashboard
718
+ */
719
+ projectKey?: string;
720
+ /**
721
+ * Custom ingest endpoint URL (optional)
722
+ * For self-hosted OpenReplay instances
723
+ */
724
+ ingestPoint?: string;
725
+ /**
726
+ * Enable user ID tracking (optional)
727
+ * When enabled, the tracker will automatically set user IDs
728
+ * @default false
729
+ */
730
+ userIdEnabled?: boolean;
731
+ /**
732
+ * Custom function to get user ID (optional)
733
+ * If not provided and userIdEnabled is true, a UUID will be generated
734
+ */
735
+ getUserId?: () => string;
736
+ /**
737
+ * Enable debug mode (optional)
738
+ * Shows debug logs in console when enabled
739
+ * @default false
740
+ */
741
+ debug?: boolean;
742
+ /**
743
+ * Capture exceptions automatically (optional)
744
+ * @default true
745
+ */
746
+ captureExceptions?: boolean;
747
+ /**
748
+ * Capture performance metrics (optional)
749
+ * @default true
750
+ */
751
+ capturePerformance?: boolean;
752
+ /**
753
+ * Network tracking options (optional)
754
+ */
755
+ network?: {
756
+ /**
757
+ * Capture network payload data
758
+ * @default true
759
+ */
760
+ capturePayload?: boolean;
761
+ /**
762
+ * Sanitizer function for network data
763
+ * Use this to redact sensitive information
764
+ */
765
+ sanitizer?: (data: any) => any;
766
+ };
767
+ /**
768
+ * Console log tracking options (optional)
769
+ */
770
+ console?: {
771
+ /**
772
+ * Console log levels to capture
773
+ * @default ["error", "warn", "log"]
774
+ */
775
+ levels?: Array<"error" | "warn" | "log" | "info" | "debug">;
776
+ };
777
+ /**
778
+ * Privacy settings
779
+ */
780
+ obscureTextEmails?: boolean;
781
+ obscureTextNumbers?: boolean;
782
+ obscureInputEmails?: boolean;
783
+ /**
784
+ * Disable secure mode (for development)
785
+ * @default false in production, true in development
786
+ */
787
+ __DISABLE_SECURE_MODE?: boolean;
788
+ }
789
+ /**
790
+ * Session Replay Provider Props
791
+ */
792
+ interface SessionReplayProviderProps {
793
+ children: React.ReactNode;
794
+ config?: OpenReplayConfig;
795
+ }
796
+ /**
797
+ * Tracker State
798
+ * Internal state for the tracker context reducer
799
+ */
800
+ interface TrackerState {
801
+ tracker: any | null;
802
+ config: OpenReplayConfig;
803
+ }
804
+ /**
805
+ * Tracker Actions
806
+ */
807
+ type TrackerAction = {
808
+ type: "init";
809
+ } | {
810
+ type: "start";
811
+ } | {
812
+ type: "setUserId";
813
+ payload: string;
814
+ } | {
815
+ type: "setMetadata";
816
+ payload: Record<string, any>;
817
+ };
818
+ /**
819
+ * Tracker Context Value
820
+ * Methods available through the TrackerContext
821
+ */
822
+ interface TrackerContextValue {
823
+ /**
824
+ * Initialize the OpenReplay tracker
825
+ * Must be called before startTracking
826
+ */
827
+ initTracker: () => void;
828
+ /**
829
+ * Start tracking the session
830
+ * Must call initTracker first
831
+ */
832
+ startTracking: () => void;
833
+ /**
834
+ * Set or update the user ID for the current session
835
+ * @param userId - The user ID to set
836
+ */
837
+ setUserId: (userId: string) => void;
838
+ setMetadata: (metadata: Record<string, any>) => void;
839
+ }
840
+
841
+ declare const TrackerContext: React$1.Context<TrackerContextValue | null>;
842
+ declare const SessionReplayProvider: React$1.FC<SessionReplayProviderProps>;
843
+
844
+ declare function useSessionReplay(): TrackerContextValue;
845
+
846
+ declare const getSessionUserId: (userId?: string) => string | null;
847
+ declare const isBrowser: () => boolean;
848
+
656
849
  interface APIConfig {
657
850
  environment: EnvironmentType;
658
851
  version: APIVersionType;
@@ -668,17 +861,18 @@ declare const TapquestCoreProvider: React$1.FC<TapquestCoreProviderProps>;
668
861
  interface UseAchivementPlusRewardModelParams {
669
862
  campaignId: string;
670
863
  }
671
- declare const useAchivementPlusRewardModel: ({ campaignId }: UseAchivementPlusRewardModelParams) => {
672
- mappedAchievements: {
864
+ interface AchievementWithRewardModel {
865
+ id: string;
866
+ name: string;
867
+ reward_model: EntityRewardModel | null;
868
+ subAchievements: {
673
869
  id: string;
674
- name: string;
675
- reward_model: EntityRewardModel;
676
- subAchievements: {
677
- id: string;
678
- reward_model: EntityRewardModel;
679
- }[];
870
+ reward_model: EntityRewardModel | null;
680
871
  }[];
872
+ }
873
+ declare const useAchivementPlusRewardModel: ({ campaignId, }: UseAchivementPlusRewardModelParams) => {
874
+ mappedAchievements: AchievementWithRewardModel[];
681
875
  isLoading: boolean;
682
876
  };
683
877
 
684
- export { ALLOWED_ORIGINS, AchievementType, type AchievementWithProgress, type AuthCallbacks, AuthProvider, type AuthProviderProps$1 as AuthProviderProps, type AuthResponse, type AuthService, CALLBACK_URL, type CampaignByProjectIdModel, type CampaignLocationSummary, type CampaignLocationSummaryQueryOptions, type ClaimUserRewardPayload, type ClaimUserRewardRequest, type ClaimUserRewardResponse, type CreateModelGroupRewardRequest, type CreateModelGroupRewardResponse, type CreateRewardGroupRequest, type CreateRewardGroupResponse, type CreateRewardModelRequest, type CreateRewardModelResponse, type CreateUserRewardRequest, type CreateUserRewardResponse, type FirebaseConfig, type GetManyRewardGroupsRequest, type GetManyRewardModelsRequest, type GetManyRewardModelsResponse, type GetManyUserRewardsRequest, type GetManyUserRewardsResponse, type GetOneRewardGroupRequest, type GetOneRewardModelRequest, type GetOneRewardModelResponse, type GetOneUserRewardRequest, type GetOneUserRewardResponse, NotificationProvider, RewardClaimStatus, type RewardFilter, type RewardGroup, type RewardModelFilter, type RewardNotifyTheme, type RewardRule, type ScanChipData, type ScanChipResponse, type SignInProvider, TapquestCoreProvider, TaskType, type UpdateRewardGroupRequest, type UpdateRewardModelRequest, type UpdateRewardModelResponse, type UpdateUserRewardRequest, type UpdateUserRewardResponse, type UseAuthReturn, type UseGoogleLoginOptions, type UseGoogleLoginReturn, type UseManyAchievementWithProgressParams, type UseManyAchievementWithProgressReturn, type UserCheckinLocationRanking, type UserData, UserRole, accessTokenKey, checkDeviceUid, chipAuthTokenKey, convertSnakeToCamel, deviceUIDKey, filterLocationsByProperty, generateDeviceId, getAccessToken, getActionsFromAchievementRule, getChipAuthToken, getDeviceUid, getLocationIdsFromAchievementRule, getRefreshToken, getRetryAttemptsRefreshToken, getUserInfo, httpMaxRetries, isAchievementCompleted, refreshTokenKey, removeAccessToken, removeChipAuthToken, removeDeviceUid, removeRefreshToken, removeUserInfo, retryAttemptsRefreshToken, setAccessToken, setChipAuthToken, setDeviceUid, setRefreshToken, setRetryAttemptsRefreshToken, setUserInfo, sortLocationsByIndex, useAchivementPlusRewardModel, useAuth, useDataTracking, useGoogleLogin, useManyAchievementProgress, useScanChip, userInfoKey };
878
+ export { ALLOWED_ORIGINS, AchievementType, type AchievementWithProgress, type AuthCallbacks, AuthProvider, type AuthProviderProps$1 as AuthProviderProps, type AuthResponse, type AuthService, CALLBACK_URL, type CampaignByProjectIdModel, type CampaignLocationSummary, type CampaignLocationSummaryQueryOptions, type ClaimUserRewardPayload, type ClaimUserRewardRequest, type ClaimUserRewardResponse, type CreateModelGroupRewardRequest, type CreateModelGroupRewardResponse, type CreateRewardGroupRequest, type CreateRewardGroupResponse, type CreateRewardModelRequest, type CreateRewardModelResponse, type CreateUserRewardRequest, type CreateUserRewardResponse, type FirebaseConfig, type GetManyRewardGroupsRequest, type GetManyRewardModelsRequest, type GetManyRewardModelsResponse, type GetManyUserRewardsRequest, type GetManyUserRewardsResponse, type GetOneRewardGroupRequest, type GetOneRewardModelRequest, type GetOneRewardModelResponse, type GetOneUserRewardRequest, type GetOneUserRewardResponse, NotificationProvider, type OpenReplayConfig, RewardClaimStatus, type RewardFilter, type RewardGroup, type RewardModelFilter, type RewardNotifyTheme, type RewardRule, type ScanChipData, type ScanChipResponse, SessionReplayProvider, type SessionReplayProviderProps, type SignInProvider, TapquestCoreProvider, TaskType, type TrackerAction, TrackerContext, type TrackerContextValue, type TrackerState, type UpdateRewardGroupRequest, type UpdateRewardModelRequest, type UpdateRewardModelResponse, type UpdateUserRewardRequest, type UpdateUserRewardResponse, type UseAuthReturn, type UseGoogleLoginOptions, type UseGoogleLoginReturn, type UseManyAchievementWithProgressParams, type UseManyAchievementWithProgressReturn, type UserCheckinLocationRanking, type UserData$1 as UserData, UserRole, accessTokenKey, checkDeviceUid, chipAuthTokenKey, convertSnakeToCamel, deviceUIDKey, filterLocationsByProperty, generateDeviceId, getAccessToken, getActionsFromAchievementRule, getChipAuthToken, getDeviceUid, getLocationIdsFromAchievementRule, getRefreshToken, getRetryAttemptsRefreshToken, getSessionUserId, getUserInfo, httpMaxRetries, isAchievementCompleted, isBrowser, refreshTokenKey, removeAccessToken, removeChipAuthToken, removeDeviceUid, removeRefreshToken, removeUserInfo, retryAttemptsRefreshToken, setAccessToken, setChipAuthToken, setDeviceUid, setRefreshToken, setRetryAttemptsRefreshToken, setUserInfo, sortLocationsByIndex, useAchivementPlusRewardModel, useAuth, useDataTracking, useGoogleLogin, useManyAchievementProgress, useScanChip, useSessionReplay, userInfoKey };
package/dist/index.d.ts CHANGED
@@ -4,15 +4,16 @@ import { GetManyUserOrDeviceAchievementProgressParams, Achievement, UserAchievem
4
4
  export { Achievement, AchievementRuleActionType, AchievementServiceProvider, GetAchievementProgressResponse, UserAchievementProgress, useAchievementProgress, useManyAchievements, useManyAchievementsRewardModels, useManyChildrenAchievements, useOneAchievement, useUserAchievementAction } from '@phygitallabs/achievement';
5
5
  import { EntityRewardModel, UserReward } from '@phygitallabs/reward';
6
6
  export { CmentityRewardType, CmentityStatus, CmentityUserReward, EntityRewardModel, UserReward, useClaimUserReward, useClearUserRewardCache, useCreateModelGroupReward, useCreateRewardModel, useDeleteRewardModel, useGetRewardModel, useGetUserRewards, useListRewardModels, useManyUserRewards, useUpdateRewardModel, useV1ListRewards } from '@phygitallabs/reward';
7
- import { PaginationRequest, GetManyResponse } from '@phygitallabs/api-core/src/types/pagination';
7
+ import { PaginationRequest, GetManyResponse, UserModel, UserAddressDetail, ProjectModel, LocationModel } from '@phygitallabs/api-core';
8
+ 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, 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';
8
9
  import { LPResponse } from '@phygitallabs/notification-api';
9
10
  export * from '@phygitallabs/notification-api';
11
+ export { useDefaultServiceGetPollStats, useDefaultServicePostPoll, useNotificationRewardHandler, useNotificationStore, usePageVisibility, useTCVNotificationRewardHandler, useWebSocket } from '@phygitallabs/notification-api';
10
12
  import React$1 from 'react';
11
- import { ProjectModel, LocationModel } from '@phygitallabs/api-core';
12
- 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, 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';
13
13
  import * as react_jsx_runtime from 'react/jsx-runtime';
14
14
  import { QueryClient } from '@tanstack/react-query';
15
- export { CommonModel as GenerateCertificateCommonModel, DateTimeNumber as GenerateCertificateDateTimeNumber, EntityStatus as GenerateCertificateEntityStatus, Media as GenerateCertificateMedia, MediaType as GenerateCertificateMediaType, useCreateCertificate, useCreateCertificateAnonymous, useCreateCertificateWithMask, useGenerateFansipanCertificate, useGenerateTemplateCertificate, useGenerateThaocamvienCertificate, wrapTextWithFont } from '@phygitallabs/generate-certificate';
15
+ import { ProtoSignInResponse, OAuthSignInResponse, ProtoSignUpResponse, ResetPasswordRequest, ProtoResetPasswordResponse, ChangePasswordRequest, ProtoChangePasswordResponse, VerifyEmailRequest, ProtoVerifyEmailResponse, SendVerifyCodeRequest, ProtoSendVerifyCodeResponse, ProtoRefreshTokenResponse } from '@phygitallabs/authentication';
16
+ 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';
16
17
  export { cn, fileToBase64, parse } from '@phygitallabs/helpers';
17
18
 
18
19
  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>;
@@ -416,7 +417,7 @@ declare enum UserRole {
416
417
  SUPERADMIN = "SUPER_ADMIN",
417
418
  ORGADMIN = "ORG_ADMIN"
418
419
  }
419
- type UserData = {
420
+ type UserData$1 = {
420
421
  uid: string;
421
422
  id: string;
422
423
  userName: string;
@@ -433,7 +434,7 @@ type UserData = {
433
434
  };
434
435
  interface AuthResponse {
435
436
  errorCode: string;
436
- data: UserData | null;
437
+ data: UserData$1 | null;
437
438
  }
438
439
  interface AuthService {
439
440
  signInWithEmailAndPassword(email: string, password: string): Promise<AuthResponse>;
@@ -443,8 +444,8 @@ interface AuthService {
443
444
  sendPasswordResetEmail(email: string): Promise<void>;
444
445
  sendEmailVerification(): Promise<void>;
445
446
  changePassword(newPassword: string): Promise<void>;
446
- onAuthStateChanged(callback: (user: UserData | null) => void): () => void;
447
- getCurrentUser(): UserData | null;
447
+ onAuthStateChanged(callback: (user: UserData$1 | null) => void): () => void;
448
+ getCurrentUser(): UserData$1 | null;
448
449
  }
449
450
  interface AuthCallbacks {
450
451
  onUserIdentify?: (userInfo: {
@@ -454,14 +455,14 @@ interface AuthCallbacks {
454
455
  uid?: string;
455
456
  }) => void;
456
457
  onTrackingReset?: () => void;
457
- onSignInSuccess?: (userData: UserData) => void;
458
+ onSignInSuccess?: (userData: UserData$1) => void;
458
459
  onSignInError?: (error: string) => void;
459
460
  onSignOutSuccess?: () => void;
460
- onSignUpSuccess?: (userData: UserData) => void;
461
+ onSignUpSuccess?: (userData: UserData$1) => void;
461
462
  onSignUpError?: (error: string) => void;
462
463
  }
463
464
  interface UseAuthReturn {
464
- user: UserData;
465
+ user: UserData$1;
465
466
  isSignedIn: boolean;
466
467
  isLoading: boolean;
467
468
  signIn: (email: string, password: string) => Promise<AuthResponse>;
@@ -472,7 +473,7 @@ interface UseAuthReturn {
472
473
  sendEmailVerification: () => Promise<void>;
473
474
  changePassword: (newPassword: string) => Promise<void>;
474
475
  updateScanStatus: (status: boolean) => void;
475
- refreshUser: (userData: UserData) => void;
476
+ refreshUser: (userData: UserData$1) => void;
476
477
  }
477
478
  interface AuthProviderProps$1 {
478
479
  children: React.ReactNode;
@@ -496,10 +497,59 @@ interface AuthProviderProps {
496
497
  }
497
498
  declare const AuthProvider: ({ children, baseURL, queryClient, }: AuthProviderProps) => react_jsx_runtime.JSX.Element;
498
499
 
499
- declare const useAuth: () => any;
500
+ interface UserData extends UserModel {
501
+ provider?: string;
502
+ accessToken: string;
503
+ exp: number;
504
+ addressDetail: UserAddressDetail;
505
+ }
506
+
507
+ interface AuthEventCallbacks {
508
+ onLoginSuccess?: (token: string) => void | Promise<void>;
509
+ onLoginError?: (error: Error) => void | Promise<void>;
510
+ onLogoutSuccess?: () => void | Promise<void>;
511
+ onLogoutError?: (error: Error) => void | Promise<void>;
512
+ onSignupSuccess?: () => void | Promise<void>;
513
+ onSignupError?: (error: Error) => void | Promise<void>;
514
+ onAuthStateChange?: (user?: UserData | null, isSignedIn?: boolean) => void | Promise<void>;
515
+ }
516
+
517
+ interface AuthCleanupFunctions {
518
+ clearQueryCache?: () => void;
519
+ clearOrganization?: () => void;
520
+ clearHeaders?: () => void;
521
+ clearCustomData?: () => void;
522
+ }
523
+ declare const useAuth: () => {
524
+ setCleanupFunctions: (cleanupFunctions: Partial<AuthCleanupFunctions>) => void;
525
+ addEventCallbacks: (callbacks: AuthEventCallbacks) => () => void;
526
+ signInWithEmail: (email: string, password: string, updateHeaders?: (headers: Record<string, string>) => void, updateAuthenticationHeaders?: (headers: Record<string, string>) => void) => Promise<ProtoSignInResponse>;
527
+ signInWithGoogle: () => Promise<OAuthSignInResponse>;
528
+ signUpWithEmail: (email: string, password: string) => Promise<ProtoSignUpResponse>;
529
+ signOut: () => Promise<void>;
530
+ sendPasswordResetEmail: (email: string) => Promise<void>;
531
+ resetPassword: (data: ResetPasswordRequest) => Promise<ProtoResetPasswordResponse>;
532
+ changePassword: (data: ChangePasswordRequest) => Promise<ProtoChangePasswordResponse>;
533
+ verifyEmailCode: (data: VerifyEmailRequest) => Promise<ProtoVerifyEmailResponse>;
534
+ sendVerifyCode: (data: SendVerifyCodeRequest) => Promise<ProtoSendVerifyCodeResponse>;
535
+ refreshToken: (refreshToken?: string) => Promise<ProtoRefreshTokenResponse>;
536
+ clearError: () => void;
537
+ setUser: (user: UserData | null) => void;
538
+ patchUser: (user: Partial<UserData>) => void;
539
+ setIsSignedIn: (isSignedIn: boolean) => void;
540
+ setIsInitialized: (isInitialized: boolean) => void;
541
+ setIsLoading: (isLoading: boolean) => void;
542
+ initialize: () => void;
543
+ syncAuthState: () => void;
544
+ user: UserData | null;
545
+ isSignedIn: boolean;
546
+ isInitialized: boolean;
547
+ isLoading: boolean;
548
+ error: string | null;
549
+ };
500
550
 
501
551
  interface UseGoogleLoginOptions {
502
- onSuccess?: () => void;
552
+ onSuccess?: (userData: any) => void;
503
553
  onError?: (error: string) => void;
504
554
  onPopupBlocked?: () => void;
505
555
  onPopupClosed?: () => void;
@@ -653,6 +703,149 @@ declare function useDataTracking(): {
653
703
  trackLogoutEvent: () => void;
654
704
  };
655
705
 
706
+ /**
707
+ * OpenReplay Session Replay Types
708
+ *
709
+ * Type definitions for OpenReplay session replay configuration and options
710
+ */
711
+ /**
712
+ * OpenReplay Configuration Options
713
+ */
714
+ interface OpenReplayConfig {
715
+ /**
716
+ * OpenReplay project key (required)
717
+ * Get this from your OpenReplay dashboard
718
+ */
719
+ projectKey?: string;
720
+ /**
721
+ * Custom ingest endpoint URL (optional)
722
+ * For self-hosted OpenReplay instances
723
+ */
724
+ ingestPoint?: string;
725
+ /**
726
+ * Enable user ID tracking (optional)
727
+ * When enabled, the tracker will automatically set user IDs
728
+ * @default false
729
+ */
730
+ userIdEnabled?: boolean;
731
+ /**
732
+ * Custom function to get user ID (optional)
733
+ * If not provided and userIdEnabled is true, a UUID will be generated
734
+ */
735
+ getUserId?: () => string;
736
+ /**
737
+ * Enable debug mode (optional)
738
+ * Shows debug logs in console when enabled
739
+ * @default false
740
+ */
741
+ debug?: boolean;
742
+ /**
743
+ * Capture exceptions automatically (optional)
744
+ * @default true
745
+ */
746
+ captureExceptions?: boolean;
747
+ /**
748
+ * Capture performance metrics (optional)
749
+ * @default true
750
+ */
751
+ capturePerformance?: boolean;
752
+ /**
753
+ * Network tracking options (optional)
754
+ */
755
+ network?: {
756
+ /**
757
+ * Capture network payload data
758
+ * @default true
759
+ */
760
+ capturePayload?: boolean;
761
+ /**
762
+ * Sanitizer function for network data
763
+ * Use this to redact sensitive information
764
+ */
765
+ sanitizer?: (data: any) => any;
766
+ };
767
+ /**
768
+ * Console log tracking options (optional)
769
+ */
770
+ console?: {
771
+ /**
772
+ * Console log levels to capture
773
+ * @default ["error", "warn", "log"]
774
+ */
775
+ levels?: Array<"error" | "warn" | "log" | "info" | "debug">;
776
+ };
777
+ /**
778
+ * Privacy settings
779
+ */
780
+ obscureTextEmails?: boolean;
781
+ obscureTextNumbers?: boolean;
782
+ obscureInputEmails?: boolean;
783
+ /**
784
+ * Disable secure mode (for development)
785
+ * @default false in production, true in development
786
+ */
787
+ __DISABLE_SECURE_MODE?: boolean;
788
+ }
789
+ /**
790
+ * Session Replay Provider Props
791
+ */
792
+ interface SessionReplayProviderProps {
793
+ children: React.ReactNode;
794
+ config?: OpenReplayConfig;
795
+ }
796
+ /**
797
+ * Tracker State
798
+ * Internal state for the tracker context reducer
799
+ */
800
+ interface TrackerState {
801
+ tracker: any | null;
802
+ config: OpenReplayConfig;
803
+ }
804
+ /**
805
+ * Tracker Actions
806
+ */
807
+ type TrackerAction = {
808
+ type: "init";
809
+ } | {
810
+ type: "start";
811
+ } | {
812
+ type: "setUserId";
813
+ payload: string;
814
+ } | {
815
+ type: "setMetadata";
816
+ payload: Record<string, any>;
817
+ };
818
+ /**
819
+ * Tracker Context Value
820
+ * Methods available through the TrackerContext
821
+ */
822
+ interface TrackerContextValue {
823
+ /**
824
+ * Initialize the OpenReplay tracker
825
+ * Must be called before startTracking
826
+ */
827
+ initTracker: () => void;
828
+ /**
829
+ * Start tracking the session
830
+ * Must call initTracker first
831
+ */
832
+ startTracking: () => void;
833
+ /**
834
+ * Set or update the user ID for the current session
835
+ * @param userId - The user ID to set
836
+ */
837
+ setUserId: (userId: string) => void;
838
+ setMetadata: (metadata: Record<string, any>) => void;
839
+ }
840
+
841
+ declare const TrackerContext: React$1.Context<TrackerContextValue | null>;
842
+ declare const SessionReplayProvider: React$1.FC<SessionReplayProviderProps>;
843
+
844
+ declare function useSessionReplay(): TrackerContextValue;
845
+
846
+ declare const getSessionUserId: (userId?: string) => string | null;
847
+ declare const isBrowser: () => boolean;
848
+
656
849
  interface APIConfig {
657
850
  environment: EnvironmentType;
658
851
  version: APIVersionType;
@@ -668,17 +861,18 @@ declare const TapquestCoreProvider: React$1.FC<TapquestCoreProviderProps>;
668
861
  interface UseAchivementPlusRewardModelParams {
669
862
  campaignId: string;
670
863
  }
671
- declare const useAchivementPlusRewardModel: ({ campaignId }: UseAchivementPlusRewardModelParams) => {
672
- mappedAchievements: {
864
+ interface AchievementWithRewardModel {
865
+ id: string;
866
+ name: string;
867
+ reward_model: EntityRewardModel | null;
868
+ subAchievements: {
673
869
  id: string;
674
- name: string;
675
- reward_model: EntityRewardModel;
676
- subAchievements: {
677
- id: string;
678
- reward_model: EntityRewardModel;
679
- }[];
870
+ reward_model: EntityRewardModel | null;
680
871
  }[];
872
+ }
873
+ declare const useAchivementPlusRewardModel: ({ campaignId, }: UseAchivementPlusRewardModelParams) => {
874
+ mappedAchievements: AchievementWithRewardModel[];
681
875
  isLoading: boolean;
682
876
  };
683
877
 
684
- export { ALLOWED_ORIGINS, AchievementType, type AchievementWithProgress, type AuthCallbacks, AuthProvider, type AuthProviderProps$1 as AuthProviderProps, type AuthResponse, type AuthService, CALLBACK_URL, type CampaignByProjectIdModel, type CampaignLocationSummary, type CampaignLocationSummaryQueryOptions, type ClaimUserRewardPayload, type ClaimUserRewardRequest, type ClaimUserRewardResponse, type CreateModelGroupRewardRequest, type CreateModelGroupRewardResponse, type CreateRewardGroupRequest, type CreateRewardGroupResponse, type CreateRewardModelRequest, type CreateRewardModelResponse, type CreateUserRewardRequest, type CreateUserRewardResponse, type FirebaseConfig, type GetManyRewardGroupsRequest, type GetManyRewardModelsRequest, type GetManyRewardModelsResponse, type GetManyUserRewardsRequest, type GetManyUserRewardsResponse, type GetOneRewardGroupRequest, type GetOneRewardModelRequest, type GetOneRewardModelResponse, type GetOneUserRewardRequest, type GetOneUserRewardResponse, NotificationProvider, RewardClaimStatus, type RewardFilter, type RewardGroup, type RewardModelFilter, type RewardNotifyTheme, type RewardRule, type ScanChipData, type ScanChipResponse, type SignInProvider, TapquestCoreProvider, TaskType, type UpdateRewardGroupRequest, type UpdateRewardModelRequest, type UpdateRewardModelResponse, type UpdateUserRewardRequest, type UpdateUserRewardResponse, type UseAuthReturn, type UseGoogleLoginOptions, type UseGoogleLoginReturn, type UseManyAchievementWithProgressParams, type UseManyAchievementWithProgressReturn, type UserCheckinLocationRanking, type UserData, UserRole, accessTokenKey, checkDeviceUid, chipAuthTokenKey, convertSnakeToCamel, deviceUIDKey, filterLocationsByProperty, generateDeviceId, getAccessToken, getActionsFromAchievementRule, getChipAuthToken, getDeviceUid, getLocationIdsFromAchievementRule, getRefreshToken, getRetryAttemptsRefreshToken, getUserInfo, httpMaxRetries, isAchievementCompleted, refreshTokenKey, removeAccessToken, removeChipAuthToken, removeDeviceUid, removeRefreshToken, removeUserInfo, retryAttemptsRefreshToken, setAccessToken, setChipAuthToken, setDeviceUid, setRefreshToken, setRetryAttemptsRefreshToken, setUserInfo, sortLocationsByIndex, useAchivementPlusRewardModel, useAuth, useDataTracking, useGoogleLogin, useManyAchievementProgress, useScanChip, userInfoKey };
878
+ export { ALLOWED_ORIGINS, AchievementType, type AchievementWithProgress, type AuthCallbacks, AuthProvider, type AuthProviderProps$1 as AuthProviderProps, type AuthResponse, type AuthService, CALLBACK_URL, type CampaignByProjectIdModel, type CampaignLocationSummary, type CampaignLocationSummaryQueryOptions, type ClaimUserRewardPayload, type ClaimUserRewardRequest, type ClaimUserRewardResponse, type CreateModelGroupRewardRequest, type CreateModelGroupRewardResponse, type CreateRewardGroupRequest, type CreateRewardGroupResponse, type CreateRewardModelRequest, type CreateRewardModelResponse, type CreateUserRewardRequest, type CreateUserRewardResponse, type FirebaseConfig, type GetManyRewardGroupsRequest, type GetManyRewardModelsRequest, type GetManyRewardModelsResponse, type GetManyUserRewardsRequest, type GetManyUserRewardsResponse, type GetOneRewardGroupRequest, type GetOneRewardModelRequest, type GetOneRewardModelResponse, type GetOneUserRewardRequest, type GetOneUserRewardResponse, NotificationProvider, type OpenReplayConfig, RewardClaimStatus, type RewardFilter, type RewardGroup, type RewardModelFilter, type RewardNotifyTheme, type RewardRule, type ScanChipData, type ScanChipResponse, SessionReplayProvider, type SessionReplayProviderProps, type SignInProvider, TapquestCoreProvider, TaskType, type TrackerAction, TrackerContext, type TrackerContextValue, type TrackerState, type UpdateRewardGroupRequest, type UpdateRewardModelRequest, type UpdateRewardModelResponse, type UpdateUserRewardRequest, type UpdateUserRewardResponse, type UseAuthReturn, type UseGoogleLoginOptions, type UseGoogleLoginReturn, type UseManyAchievementWithProgressParams, type UseManyAchievementWithProgressReturn, type UserCheckinLocationRanking, type UserData$1 as UserData, UserRole, accessTokenKey, checkDeviceUid, chipAuthTokenKey, convertSnakeToCamel, deviceUIDKey, filterLocationsByProperty, generateDeviceId, getAccessToken, getActionsFromAchievementRule, getChipAuthToken, getDeviceUid, getLocationIdsFromAchievementRule, getRefreshToken, getRetryAttemptsRefreshToken, getSessionUserId, getUserInfo, httpMaxRetries, isAchievementCompleted, isBrowser, refreshTokenKey, removeAccessToken, removeChipAuthToken, removeDeviceUid, removeRefreshToken, removeUserInfo, retryAttemptsRefreshToken, setAccessToken, setChipAuthToken, setDeviceUid, setRefreshToken, setRetryAttemptsRefreshToken, setUserInfo, sortLocationsByIndex, useAchivementPlusRewardModel, useAuth, useDataTracking, useGoogleLogin, useManyAchievementProgress, useScanChip, useSessionReplay, userInfoKey };