@phygitallabs/tapquest-core 4.5.0 → 4.6.0
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/bun.lock +1068 -0
- package/dist/index.cjs +2 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +216 -23
- package/dist/index.d.ts +216 -23
- package/dist/index.js +2 -2
- package/dist/index.js.map +1 -1
- package/package.json +2 -1
- package/src/constants/firebase.ts +36 -0
- package/src/index.ts +4 -0
- package/src/modules/achievement/hooks/index.ts +0 -94
- package/src/modules/achivementWithReward/hooks/achivementPlusRewardModel.ts +30 -7
- package/src/modules/auth/hooks/useGoogleLogin.ts +5 -2
- package/src/modules/auth/hooks/useTokenRefresher.ts +3 -8
- package/src/modules/auth/providers/AuthProvider.tsx +3 -3
- package/src/modules/auth/services/FirebaseAuthService.ts +290 -0
- package/src/modules/auth/services/authServiceFactory.ts +22 -0
- package/src/modules/auth/services/index.ts +3 -0
- package/src/modules/auth/store/authStore.ts +30 -24
- package/src/modules/auth/utils/user.ts +11 -1
- package/src/modules/data-tracking/hooks/index.ts +2 -1
- package/src/modules/generate-certificate/hooks/index.ts +2 -0
- package/src/modules/reward/hooks/useRewardService.ts +1 -1
- package/src/modules/reward/types/requests.ts +1 -1
- package/src/providers/ServicesProvider.tsx +38 -2
- package/tsup.config.ts +10 -0
- package/src/store/hooks.ts +0 -6
- package/src/store/index.ts +0 -45
package/dist/index.d.mts
CHANGED
|
@@ -4,15 +4,15 @@ 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
|
|
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';
|
|
10
11
|
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
12
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
14
13
|
import { QueryClient } from '@tanstack/react-query';
|
|
15
|
-
|
|
14
|
+
import { ProtoSignInResponse, OAuthSignInResponse, ProtoSignUpResponse, ResetPasswordRequest, ProtoResetPasswordResponse, ChangePasswordRequest, ProtoChangePasswordResponse, VerifyEmailRequest, ProtoVerifyEmailResponse, SendVerifyCodeRequest, ProtoSendVerifyCodeResponse, ProtoRefreshTokenResponse } from '@phygitallabs/authentication';
|
|
15
|
+
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
16
|
export { cn, fileToBase64, parse } from '@phygitallabs/helpers';
|
|
17
17
|
|
|
18
18
|
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 +416,7 @@ declare enum UserRole {
|
|
|
416
416
|
SUPERADMIN = "SUPER_ADMIN",
|
|
417
417
|
ORGADMIN = "ORG_ADMIN"
|
|
418
418
|
}
|
|
419
|
-
type UserData = {
|
|
419
|
+
type UserData$1 = {
|
|
420
420
|
uid: string;
|
|
421
421
|
id: string;
|
|
422
422
|
userName: string;
|
|
@@ -433,7 +433,7 @@ type UserData = {
|
|
|
433
433
|
};
|
|
434
434
|
interface AuthResponse {
|
|
435
435
|
errorCode: string;
|
|
436
|
-
data: UserData | null;
|
|
436
|
+
data: UserData$1 | null;
|
|
437
437
|
}
|
|
438
438
|
interface AuthService {
|
|
439
439
|
signInWithEmailAndPassword(email: string, password: string): Promise<AuthResponse>;
|
|
@@ -443,8 +443,8 @@ interface AuthService {
|
|
|
443
443
|
sendPasswordResetEmail(email: string): Promise<void>;
|
|
444
444
|
sendEmailVerification(): Promise<void>;
|
|
445
445
|
changePassword(newPassword: string): Promise<void>;
|
|
446
|
-
onAuthStateChanged(callback: (user: UserData | null) => void): () => void;
|
|
447
|
-
getCurrentUser(): UserData | null;
|
|
446
|
+
onAuthStateChanged(callback: (user: UserData$1 | null) => void): () => void;
|
|
447
|
+
getCurrentUser(): UserData$1 | null;
|
|
448
448
|
}
|
|
449
449
|
interface AuthCallbacks {
|
|
450
450
|
onUserIdentify?: (userInfo: {
|
|
@@ -454,14 +454,14 @@ interface AuthCallbacks {
|
|
|
454
454
|
uid?: string;
|
|
455
455
|
}) => void;
|
|
456
456
|
onTrackingReset?: () => void;
|
|
457
|
-
onSignInSuccess?: (userData: UserData) => void;
|
|
457
|
+
onSignInSuccess?: (userData: UserData$1) => void;
|
|
458
458
|
onSignInError?: (error: string) => void;
|
|
459
459
|
onSignOutSuccess?: () => void;
|
|
460
|
-
onSignUpSuccess?: (userData: UserData) => void;
|
|
460
|
+
onSignUpSuccess?: (userData: UserData$1) => void;
|
|
461
461
|
onSignUpError?: (error: string) => void;
|
|
462
462
|
}
|
|
463
463
|
interface UseAuthReturn {
|
|
464
|
-
user: UserData;
|
|
464
|
+
user: UserData$1;
|
|
465
465
|
isSignedIn: boolean;
|
|
466
466
|
isLoading: boolean;
|
|
467
467
|
signIn: (email: string, password: string) => Promise<AuthResponse>;
|
|
@@ -472,7 +472,7 @@ interface UseAuthReturn {
|
|
|
472
472
|
sendEmailVerification: () => Promise<void>;
|
|
473
473
|
changePassword: (newPassword: string) => Promise<void>;
|
|
474
474
|
updateScanStatus: (status: boolean) => void;
|
|
475
|
-
refreshUser: (userData: UserData) => void;
|
|
475
|
+
refreshUser: (userData: UserData$1) => void;
|
|
476
476
|
}
|
|
477
477
|
interface AuthProviderProps$1 {
|
|
478
478
|
children: React.ReactNode;
|
|
@@ -496,10 +496,59 @@ interface AuthProviderProps {
|
|
|
496
496
|
}
|
|
497
497
|
declare const AuthProvider: ({ children, baseURL, queryClient, }: AuthProviderProps) => react_jsx_runtime.JSX.Element;
|
|
498
498
|
|
|
499
|
-
|
|
499
|
+
interface UserData extends UserModel {
|
|
500
|
+
provider?: string;
|
|
501
|
+
accessToken: string;
|
|
502
|
+
exp: number;
|
|
503
|
+
addressDetail: UserAddressDetail;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
interface AuthEventCallbacks {
|
|
507
|
+
onLoginSuccess?: (token: string) => void | Promise<void>;
|
|
508
|
+
onLoginError?: (error: Error) => void | Promise<void>;
|
|
509
|
+
onLogoutSuccess?: () => void | Promise<void>;
|
|
510
|
+
onLogoutError?: (error: Error) => void | Promise<void>;
|
|
511
|
+
onSignupSuccess?: () => void | Promise<void>;
|
|
512
|
+
onSignupError?: (error: Error) => void | Promise<void>;
|
|
513
|
+
onAuthStateChange?: (user?: UserData | null, isSignedIn?: boolean) => void | Promise<void>;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
interface AuthCleanupFunctions {
|
|
517
|
+
clearQueryCache?: () => void;
|
|
518
|
+
clearOrganization?: () => void;
|
|
519
|
+
clearHeaders?: () => void;
|
|
520
|
+
clearCustomData?: () => void;
|
|
521
|
+
}
|
|
522
|
+
declare const useAuth: () => {
|
|
523
|
+
setCleanupFunctions: (cleanupFunctions: Partial<AuthCleanupFunctions>) => void;
|
|
524
|
+
addEventCallbacks: (callbacks: AuthEventCallbacks) => () => void;
|
|
525
|
+
signInWithEmail: (email: string, password: string, updateHeaders?: (headers: Record<string, string>) => void, updateAuthenticationHeaders?: (headers: Record<string, string>) => void) => Promise<ProtoSignInResponse>;
|
|
526
|
+
signInWithGoogle: () => Promise<OAuthSignInResponse>;
|
|
527
|
+
signUpWithEmail: (email: string, password: string) => Promise<ProtoSignUpResponse>;
|
|
528
|
+
signOut: () => Promise<void>;
|
|
529
|
+
sendPasswordResetEmail: (email: string) => Promise<void>;
|
|
530
|
+
resetPassword: (data: ResetPasswordRequest) => Promise<ProtoResetPasswordResponse>;
|
|
531
|
+
changePassword: (data: ChangePasswordRequest) => Promise<ProtoChangePasswordResponse>;
|
|
532
|
+
verifyEmailCode: (data: VerifyEmailRequest) => Promise<ProtoVerifyEmailResponse>;
|
|
533
|
+
sendVerifyCode: (data: SendVerifyCodeRequest) => Promise<ProtoSendVerifyCodeResponse>;
|
|
534
|
+
refreshToken: (refreshToken?: string) => Promise<ProtoRefreshTokenResponse>;
|
|
535
|
+
clearError: () => void;
|
|
536
|
+
setUser: (user: UserData | null) => void;
|
|
537
|
+
patchUser: (user: Partial<UserData>) => void;
|
|
538
|
+
setIsSignedIn: (isSignedIn: boolean) => void;
|
|
539
|
+
setIsInitialized: (isInitialized: boolean) => void;
|
|
540
|
+
setIsLoading: (isLoading: boolean) => void;
|
|
541
|
+
initialize: () => void;
|
|
542
|
+
syncAuthState: () => void;
|
|
543
|
+
user: UserData | null;
|
|
544
|
+
isSignedIn: boolean;
|
|
545
|
+
isInitialized: boolean;
|
|
546
|
+
isLoading: boolean;
|
|
547
|
+
error: string | null;
|
|
548
|
+
};
|
|
500
549
|
|
|
501
550
|
interface UseGoogleLoginOptions {
|
|
502
|
-
onSuccess?: () => void;
|
|
551
|
+
onSuccess?: (userData: any) => void;
|
|
503
552
|
onError?: (error: string) => void;
|
|
504
553
|
onPopupBlocked?: () => void;
|
|
505
554
|
onPopupClosed?: () => void;
|
|
@@ -653,6 +702,149 @@ declare function useDataTracking(): {
|
|
|
653
702
|
trackLogoutEvent: () => void;
|
|
654
703
|
};
|
|
655
704
|
|
|
705
|
+
/**
|
|
706
|
+
* OpenReplay Session Replay Types
|
|
707
|
+
*
|
|
708
|
+
* Type definitions for OpenReplay session replay configuration and options
|
|
709
|
+
*/
|
|
710
|
+
/**
|
|
711
|
+
* OpenReplay Configuration Options
|
|
712
|
+
*/
|
|
713
|
+
interface OpenReplayConfig {
|
|
714
|
+
/**
|
|
715
|
+
* OpenReplay project key (required)
|
|
716
|
+
* Get this from your OpenReplay dashboard
|
|
717
|
+
*/
|
|
718
|
+
projectKey?: string;
|
|
719
|
+
/**
|
|
720
|
+
* Custom ingest endpoint URL (optional)
|
|
721
|
+
* For self-hosted OpenReplay instances
|
|
722
|
+
*/
|
|
723
|
+
ingestPoint?: string;
|
|
724
|
+
/**
|
|
725
|
+
* Enable user ID tracking (optional)
|
|
726
|
+
* When enabled, the tracker will automatically set user IDs
|
|
727
|
+
* @default false
|
|
728
|
+
*/
|
|
729
|
+
userIdEnabled?: boolean;
|
|
730
|
+
/**
|
|
731
|
+
* Custom function to get user ID (optional)
|
|
732
|
+
* If not provided and userIdEnabled is true, a UUID will be generated
|
|
733
|
+
*/
|
|
734
|
+
getUserId?: () => string;
|
|
735
|
+
/**
|
|
736
|
+
* Enable debug mode (optional)
|
|
737
|
+
* Shows debug logs in console when enabled
|
|
738
|
+
* @default false
|
|
739
|
+
*/
|
|
740
|
+
debug?: boolean;
|
|
741
|
+
/**
|
|
742
|
+
* Capture exceptions automatically (optional)
|
|
743
|
+
* @default true
|
|
744
|
+
*/
|
|
745
|
+
captureExceptions?: boolean;
|
|
746
|
+
/**
|
|
747
|
+
* Capture performance metrics (optional)
|
|
748
|
+
* @default true
|
|
749
|
+
*/
|
|
750
|
+
capturePerformance?: boolean;
|
|
751
|
+
/**
|
|
752
|
+
* Network tracking options (optional)
|
|
753
|
+
*/
|
|
754
|
+
network?: {
|
|
755
|
+
/**
|
|
756
|
+
* Capture network payload data
|
|
757
|
+
* @default true
|
|
758
|
+
*/
|
|
759
|
+
capturePayload?: boolean;
|
|
760
|
+
/**
|
|
761
|
+
* Sanitizer function for network data
|
|
762
|
+
* Use this to redact sensitive information
|
|
763
|
+
*/
|
|
764
|
+
sanitizer?: (data: any) => any;
|
|
765
|
+
};
|
|
766
|
+
/**
|
|
767
|
+
* Console log tracking options (optional)
|
|
768
|
+
*/
|
|
769
|
+
console?: {
|
|
770
|
+
/**
|
|
771
|
+
* Console log levels to capture
|
|
772
|
+
* @default ["error", "warn", "log"]
|
|
773
|
+
*/
|
|
774
|
+
levels?: Array<"error" | "warn" | "log" | "info" | "debug">;
|
|
775
|
+
};
|
|
776
|
+
/**
|
|
777
|
+
* Privacy settings
|
|
778
|
+
*/
|
|
779
|
+
obscureTextEmails?: boolean;
|
|
780
|
+
obscureTextNumbers?: boolean;
|
|
781
|
+
obscureInputEmails?: boolean;
|
|
782
|
+
/**
|
|
783
|
+
* Disable secure mode (for development)
|
|
784
|
+
* @default false in production, true in development
|
|
785
|
+
*/
|
|
786
|
+
__DISABLE_SECURE_MODE?: boolean;
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* Session Replay Provider Props
|
|
790
|
+
*/
|
|
791
|
+
interface SessionReplayProviderProps {
|
|
792
|
+
children: React.ReactNode;
|
|
793
|
+
config?: OpenReplayConfig;
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Tracker State
|
|
797
|
+
* Internal state for the tracker context reducer
|
|
798
|
+
*/
|
|
799
|
+
interface TrackerState {
|
|
800
|
+
tracker: any | null;
|
|
801
|
+
config: OpenReplayConfig;
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Tracker Actions
|
|
805
|
+
*/
|
|
806
|
+
type TrackerAction = {
|
|
807
|
+
type: "init";
|
|
808
|
+
} | {
|
|
809
|
+
type: "start";
|
|
810
|
+
} | {
|
|
811
|
+
type: "setUserId";
|
|
812
|
+
payload: string;
|
|
813
|
+
} | {
|
|
814
|
+
type: "setMetadata";
|
|
815
|
+
payload: Record<string, any>;
|
|
816
|
+
};
|
|
817
|
+
/**
|
|
818
|
+
* Tracker Context Value
|
|
819
|
+
* Methods available through the TrackerContext
|
|
820
|
+
*/
|
|
821
|
+
interface TrackerContextValue {
|
|
822
|
+
/**
|
|
823
|
+
* Initialize the OpenReplay tracker
|
|
824
|
+
* Must be called before startTracking
|
|
825
|
+
*/
|
|
826
|
+
initTracker: () => void;
|
|
827
|
+
/**
|
|
828
|
+
* Start tracking the session
|
|
829
|
+
* Must call initTracker first
|
|
830
|
+
*/
|
|
831
|
+
startTracking: () => void;
|
|
832
|
+
/**
|
|
833
|
+
* Set or update the user ID for the current session
|
|
834
|
+
* @param userId - The user ID to set
|
|
835
|
+
*/
|
|
836
|
+
setUserId: (userId: string) => void;
|
|
837
|
+
setMetadata: (metadata: Record<string, any>) => void;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
declare const TrackerContext: React$1.Context<TrackerContextValue | null>;
|
|
841
|
+
declare const SessionReplayProvider: React$1.FC<SessionReplayProviderProps>;
|
|
842
|
+
|
|
843
|
+
declare function useSessionReplay(): TrackerContextValue;
|
|
844
|
+
|
|
845
|
+
declare const getSessionUserId: (userId?: string) => string | null;
|
|
846
|
+
declare const isBrowser: () => boolean;
|
|
847
|
+
|
|
656
848
|
interface APIConfig {
|
|
657
849
|
environment: EnvironmentType;
|
|
658
850
|
version: APIVersionType;
|
|
@@ -668,17 +860,18 @@ declare const TapquestCoreProvider: React$1.FC<TapquestCoreProviderProps>;
|
|
|
668
860
|
interface UseAchivementPlusRewardModelParams {
|
|
669
861
|
campaignId: string;
|
|
670
862
|
}
|
|
671
|
-
|
|
672
|
-
|
|
863
|
+
interface AchievementWithRewardModel {
|
|
864
|
+
id: string;
|
|
865
|
+
name: string;
|
|
866
|
+
reward_model: EntityRewardModel | null;
|
|
867
|
+
subAchievements: {
|
|
673
868
|
id: string;
|
|
674
|
-
|
|
675
|
-
reward_model: EntityRewardModel;
|
|
676
|
-
subAchievements: {
|
|
677
|
-
id: string;
|
|
678
|
-
reward_model: EntityRewardModel;
|
|
679
|
-
}[];
|
|
869
|
+
reward_model: EntityRewardModel | null;
|
|
680
870
|
}[];
|
|
871
|
+
}
|
|
872
|
+
declare const useAchivementPlusRewardModel: ({ campaignId, }: UseAchivementPlusRewardModelParams) => {
|
|
873
|
+
mappedAchievements: AchievementWithRewardModel[];
|
|
681
874
|
isLoading: boolean;
|
|
682
875
|
};
|
|
683
876
|
|
|
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 };
|
|
877
|
+
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,15 @@ 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
|
|
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';
|
|
10
11
|
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
12
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
14
13
|
import { QueryClient } from '@tanstack/react-query';
|
|
15
|
-
|
|
14
|
+
import { ProtoSignInResponse, OAuthSignInResponse, ProtoSignUpResponse, ResetPasswordRequest, ProtoResetPasswordResponse, ChangePasswordRequest, ProtoChangePasswordResponse, VerifyEmailRequest, ProtoVerifyEmailResponse, SendVerifyCodeRequest, ProtoSendVerifyCodeResponse, ProtoRefreshTokenResponse } from '@phygitallabs/authentication';
|
|
15
|
+
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
16
|
export { cn, fileToBase64, parse } from '@phygitallabs/helpers';
|
|
17
17
|
|
|
18
18
|
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 +416,7 @@ declare enum UserRole {
|
|
|
416
416
|
SUPERADMIN = "SUPER_ADMIN",
|
|
417
417
|
ORGADMIN = "ORG_ADMIN"
|
|
418
418
|
}
|
|
419
|
-
type UserData = {
|
|
419
|
+
type UserData$1 = {
|
|
420
420
|
uid: string;
|
|
421
421
|
id: string;
|
|
422
422
|
userName: string;
|
|
@@ -433,7 +433,7 @@ type UserData = {
|
|
|
433
433
|
};
|
|
434
434
|
interface AuthResponse {
|
|
435
435
|
errorCode: string;
|
|
436
|
-
data: UserData | null;
|
|
436
|
+
data: UserData$1 | null;
|
|
437
437
|
}
|
|
438
438
|
interface AuthService {
|
|
439
439
|
signInWithEmailAndPassword(email: string, password: string): Promise<AuthResponse>;
|
|
@@ -443,8 +443,8 @@ interface AuthService {
|
|
|
443
443
|
sendPasswordResetEmail(email: string): Promise<void>;
|
|
444
444
|
sendEmailVerification(): Promise<void>;
|
|
445
445
|
changePassword(newPassword: string): Promise<void>;
|
|
446
|
-
onAuthStateChanged(callback: (user: UserData | null) => void): () => void;
|
|
447
|
-
getCurrentUser(): UserData | null;
|
|
446
|
+
onAuthStateChanged(callback: (user: UserData$1 | null) => void): () => void;
|
|
447
|
+
getCurrentUser(): UserData$1 | null;
|
|
448
448
|
}
|
|
449
449
|
interface AuthCallbacks {
|
|
450
450
|
onUserIdentify?: (userInfo: {
|
|
@@ -454,14 +454,14 @@ interface AuthCallbacks {
|
|
|
454
454
|
uid?: string;
|
|
455
455
|
}) => void;
|
|
456
456
|
onTrackingReset?: () => void;
|
|
457
|
-
onSignInSuccess?: (userData: UserData) => void;
|
|
457
|
+
onSignInSuccess?: (userData: UserData$1) => void;
|
|
458
458
|
onSignInError?: (error: string) => void;
|
|
459
459
|
onSignOutSuccess?: () => void;
|
|
460
|
-
onSignUpSuccess?: (userData: UserData) => void;
|
|
460
|
+
onSignUpSuccess?: (userData: UserData$1) => void;
|
|
461
461
|
onSignUpError?: (error: string) => void;
|
|
462
462
|
}
|
|
463
463
|
interface UseAuthReturn {
|
|
464
|
-
user: UserData;
|
|
464
|
+
user: UserData$1;
|
|
465
465
|
isSignedIn: boolean;
|
|
466
466
|
isLoading: boolean;
|
|
467
467
|
signIn: (email: string, password: string) => Promise<AuthResponse>;
|
|
@@ -472,7 +472,7 @@ interface UseAuthReturn {
|
|
|
472
472
|
sendEmailVerification: () => Promise<void>;
|
|
473
473
|
changePassword: (newPassword: string) => Promise<void>;
|
|
474
474
|
updateScanStatus: (status: boolean) => void;
|
|
475
|
-
refreshUser: (userData: UserData) => void;
|
|
475
|
+
refreshUser: (userData: UserData$1) => void;
|
|
476
476
|
}
|
|
477
477
|
interface AuthProviderProps$1 {
|
|
478
478
|
children: React.ReactNode;
|
|
@@ -496,10 +496,59 @@ interface AuthProviderProps {
|
|
|
496
496
|
}
|
|
497
497
|
declare const AuthProvider: ({ children, baseURL, queryClient, }: AuthProviderProps) => react_jsx_runtime.JSX.Element;
|
|
498
498
|
|
|
499
|
-
|
|
499
|
+
interface UserData extends UserModel {
|
|
500
|
+
provider?: string;
|
|
501
|
+
accessToken: string;
|
|
502
|
+
exp: number;
|
|
503
|
+
addressDetail: UserAddressDetail;
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
interface AuthEventCallbacks {
|
|
507
|
+
onLoginSuccess?: (token: string) => void | Promise<void>;
|
|
508
|
+
onLoginError?: (error: Error) => void | Promise<void>;
|
|
509
|
+
onLogoutSuccess?: () => void | Promise<void>;
|
|
510
|
+
onLogoutError?: (error: Error) => void | Promise<void>;
|
|
511
|
+
onSignupSuccess?: () => void | Promise<void>;
|
|
512
|
+
onSignupError?: (error: Error) => void | Promise<void>;
|
|
513
|
+
onAuthStateChange?: (user?: UserData | null, isSignedIn?: boolean) => void | Promise<void>;
|
|
514
|
+
}
|
|
515
|
+
|
|
516
|
+
interface AuthCleanupFunctions {
|
|
517
|
+
clearQueryCache?: () => void;
|
|
518
|
+
clearOrganization?: () => void;
|
|
519
|
+
clearHeaders?: () => void;
|
|
520
|
+
clearCustomData?: () => void;
|
|
521
|
+
}
|
|
522
|
+
declare const useAuth: () => {
|
|
523
|
+
setCleanupFunctions: (cleanupFunctions: Partial<AuthCleanupFunctions>) => void;
|
|
524
|
+
addEventCallbacks: (callbacks: AuthEventCallbacks) => () => void;
|
|
525
|
+
signInWithEmail: (email: string, password: string, updateHeaders?: (headers: Record<string, string>) => void, updateAuthenticationHeaders?: (headers: Record<string, string>) => void) => Promise<ProtoSignInResponse>;
|
|
526
|
+
signInWithGoogle: () => Promise<OAuthSignInResponse>;
|
|
527
|
+
signUpWithEmail: (email: string, password: string) => Promise<ProtoSignUpResponse>;
|
|
528
|
+
signOut: () => Promise<void>;
|
|
529
|
+
sendPasswordResetEmail: (email: string) => Promise<void>;
|
|
530
|
+
resetPassword: (data: ResetPasswordRequest) => Promise<ProtoResetPasswordResponse>;
|
|
531
|
+
changePassword: (data: ChangePasswordRequest) => Promise<ProtoChangePasswordResponse>;
|
|
532
|
+
verifyEmailCode: (data: VerifyEmailRequest) => Promise<ProtoVerifyEmailResponse>;
|
|
533
|
+
sendVerifyCode: (data: SendVerifyCodeRequest) => Promise<ProtoSendVerifyCodeResponse>;
|
|
534
|
+
refreshToken: (refreshToken?: string) => Promise<ProtoRefreshTokenResponse>;
|
|
535
|
+
clearError: () => void;
|
|
536
|
+
setUser: (user: UserData | null) => void;
|
|
537
|
+
patchUser: (user: Partial<UserData>) => void;
|
|
538
|
+
setIsSignedIn: (isSignedIn: boolean) => void;
|
|
539
|
+
setIsInitialized: (isInitialized: boolean) => void;
|
|
540
|
+
setIsLoading: (isLoading: boolean) => void;
|
|
541
|
+
initialize: () => void;
|
|
542
|
+
syncAuthState: () => void;
|
|
543
|
+
user: UserData | null;
|
|
544
|
+
isSignedIn: boolean;
|
|
545
|
+
isInitialized: boolean;
|
|
546
|
+
isLoading: boolean;
|
|
547
|
+
error: string | null;
|
|
548
|
+
};
|
|
500
549
|
|
|
501
550
|
interface UseGoogleLoginOptions {
|
|
502
|
-
onSuccess?: () => void;
|
|
551
|
+
onSuccess?: (userData: any) => void;
|
|
503
552
|
onError?: (error: string) => void;
|
|
504
553
|
onPopupBlocked?: () => void;
|
|
505
554
|
onPopupClosed?: () => void;
|
|
@@ -653,6 +702,149 @@ declare function useDataTracking(): {
|
|
|
653
702
|
trackLogoutEvent: () => void;
|
|
654
703
|
};
|
|
655
704
|
|
|
705
|
+
/**
|
|
706
|
+
* OpenReplay Session Replay Types
|
|
707
|
+
*
|
|
708
|
+
* Type definitions for OpenReplay session replay configuration and options
|
|
709
|
+
*/
|
|
710
|
+
/**
|
|
711
|
+
* OpenReplay Configuration Options
|
|
712
|
+
*/
|
|
713
|
+
interface OpenReplayConfig {
|
|
714
|
+
/**
|
|
715
|
+
* OpenReplay project key (required)
|
|
716
|
+
* Get this from your OpenReplay dashboard
|
|
717
|
+
*/
|
|
718
|
+
projectKey?: string;
|
|
719
|
+
/**
|
|
720
|
+
* Custom ingest endpoint URL (optional)
|
|
721
|
+
* For self-hosted OpenReplay instances
|
|
722
|
+
*/
|
|
723
|
+
ingestPoint?: string;
|
|
724
|
+
/**
|
|
725
|
+
* Enable user ID tracking (optional)
|
|
726
|
+
* When enabled, the tracker will automatically set user IDs
|
|
727
|
+
* @default false
|
|
728
|
+
*/
|
|
729
|
+
userIdEnabled?: boolean;
|
|
730
|
+
/**
|
|
731
|
+
* Custom function to get user ID (optional)
|
|
732
|
+
* If not provided and userIdEnabled is true, a UUID will be generated
|
|
733
|
+
*/
|
|
734
|
+
getUserId?: () => string;
|
|
735
|
+
/**
|
|
736
|
+
* Enable debug mode (optional)
|
|
737
|
+
* Shows debug logs in console when enabled
|
|
738
|
+
* @default false
|
|
739
|
+
*/
|
|
740
|
+
debug?: boolean;
|
|
741
|
+
/**
|
|
742
|
+
* Capture exceptions automatically (optional)
|
|
743
|
+
* @default true
|
|
744
|
+
*/
|
|
745
|
+
captureExceptions?: boolean;
|
|
746
|
+
/**
|
|
747
|
+
* Capture performance metrics (optional)
|
|
748
|
+
* @default true
|
|
749
|
+
*/
|
|
750
|
+
capturePerformance?: boolean;
|
|
751
|
+
/**
|
|
752
|
+
* Network tracking options (optional)
|
|
753
|
+
*/
|
|
754
|
+
network?: {
|
|
755
|
+
/**
|
|
756
|
+
* Capture network payload data
|
|
757
|
+
* @default true
|
|
758
|
+
*/
|
|
759
|
+
capturePayload?: boolean;
|
|
760
|
+
/**
|
|
761
|
+
* Sanitizer function for network data
|
|
762
|
+
* Use this to redact sensitive information
|
|
763
|
+
*/
|
|
764
|
+
sanitizer?: (data: any) => any;
|
|
765
|
+
};
|
|
766
|
+
/**
|
|
767
|
+
* Console log tracking options (optional)
|
|
768
|
+
*/
|
|
769
|
+
console?: {
|
|
770
|
+
/**
|
|
771
|
+
* Console log levels to capture
|
|
772
|
+
* @default ["error", "warn", "log"]
|
|
773
|
+
*/
|
|
774
|
+
levels?: Array<"error" | "warn" | "log" | "info" | "debug">;
|
|
775
|
+
};
|
|
776
|
+
/**
|
|
777
|
+
* Privacy settings
|
|
778
|
+
*/
|
|
779
|
+
obscureTextEmails?: boolean;
|
|
780
|
+
obscureTextNumbers?: boolean;
|
|
781
|
+
obscureInputEmails?: boolean;
|
|
782
|
+
/**
|
|
783
|
+
* Disable secure mode (for development)
|
|
784
|
+
* @default false in production, true in development
|
|
785
|
+
*/
|
|
786
|
+
__DISABLE_SECURE_MODE?: boolean;
|
|
787
|
+
}
|
|
788
|
+
/**
|
|
789
|
+
* Session Replay Provider Props
|
|
790
|
+
*/
|
|
791
|
+
interface SessionReplayProviderProps {
|
|
792
|
+
children: React.ReactNode;
|
|
793
|
+
config?: OpenReplayConfig;
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* Tracker State
|
|
797
|
+
* Internal state for the tracker context reducer
|
|
798
|
+
*/
|
|
799
|
+
interface TrackerState {
|
|
800
|
+
tracker: any | null;
|
|
801
|
+
config: OpenReplayConfig;
|
|
802
|
+
}
|
|
803
|
+
/**
|
|
804
|
+
* Tracker Actions
|
|
805
|
+
*/
|
|
806
|
+
type TrackerAction = {
|
|
807
|
+
type: "init";
|
|
808
|
+
} | {
|
|
809
|
+
type: "start";
|
|
810
|
+
} | {
|
|
811
|
+
type: "setUserId";
|
|
812
|
+
payload: string;
|
|
813
|
+
} | {
|
|
814
|
+
type: "setMetadata";
|
|
815
|
+
payload: Record<string, any>;
|
|
816
|
+
};
|
|
817
|
+
/**
|
|
818
|
+
* Tracker Context Value
|
|
819
|
+
* Methods available through the TrackerContext
|
|
820
|
+
*/
|
|
821
|
+
interface TrackerContextValue {
|
|
822
|
+
/**
|
|
823
|
+
* Initialize the OpenReplay tracker
|
|
824
|
+
* Must be called before startTracking
|
|
825
|
+
*/
|
|
826
|
+
initTracker: () => void;
|
|
827
|
+
/**
|
|
828
|
+
* Start tracking the session
|
|
829
|
+
* Must call initTracker first
|
|
830
|
+
*/
|
|
831
|
+
startTracking: () => void;
|
|
832
|
+
/**
|
|
833
|
+
* Set or update the user ID for the current session
|
|
834
|
+
* @param userId - The user ID to set
|
|
835
|
+
*/
|
|
836
|
+
setUserId: (userId: string) => void;
|
|
837
|
+
setMetadata: (metadata: Record<string, any>) => void;
|
|
838
|
+
}
|
|
839
|
+
|
|
840
|
+
declare const TrackerContext: React$1.Context<TrackerContextValue | null>;
|
|
841
|
+
declare const SessionReplayProvider: React$1.FC<SessionReplayProviderProps>;
|
|
842
|
+
|
|
843
|
+
declare function useSessionReplay(): TrackerContextValue;
|
|
844
|
+
|
|
845
|
+
declare const getSessionUserId: (userId?: string) => string | null;
|
|
846
|
+
declare const isBrowser: () => boolean;
|
|
847
|
+
|
|
656
848
|
interface APIConfig {
|
|
657
849
|
environment: EnvironmentType;
|
|
658
850
|
version: APIVersionType;
|
|
@@ -668,17 +860,18 @@ declare const TapquestCoreProvider: React$1.FC<TapquestCoreProviderProps>;
|
|
|
668
860
|
interface UseAchivementPlusRewardModelParams {
|
|
669
861
|
campaignId: string;
|
|
670
862
|
}
|
|
671
|
-
|
|
672
|
-
|
|
863
|
+
interface AchievementWithRewardModel {
|
|
864
|
+
id: string;
|
|
865
|
+
name: string;
|
|
866
|
+
reward_model: EntityRewardModel | null;
|
|
867
|
+
subAchievements: {
|
|
673
868
|
id: string;
|
|
674
|
-
|
|
675
|
-
reward_model: EntityRewardModel;
|
|
676
|
-
subAchievements: {
|
|
677
|
-
id: string;
|
|
678
|
-
reward_model: EntityRewardModel;
|
|
679
|
-
}[];
|
|
869
|
+
reward_model: EntityRewardModel | null;
|
|
680
870
|
}[];
|
|
871
|
+
}
|
|
872
|
+
declare const useAchivementPlusRewardModel: ({ campaignId, }: UseAchivementPlusRewardModelParams) => {
|
|
873
|
+
mappedAchievements: AchievementWithRewardModel[];
|
|
681
874
|
isLoading: boolean;
|
|
682
875
|
};
|
|
683
876
|
|
|
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 };
|
|
877
|
+
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 };
|