@phygitallabs/tapquest-core 4.4.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.
@@ -0,0 +1,877 @@
1
+ import * as _tanstack_query_core from '@tanstack/query-core';
2
+ import * as _phygitallabs_achievement from '@phygitallabs/achievement';
3
+ import { GetManyUserOrDeviceAchievementProgressParams, Achievement, UserAchievementProgress } from '@phygitallabs/achievement';
4
+ export { Achievement, AchievementRuleActionType, AchievementServiceProvider, GetAchievementProgressResponse, UserAchievementProgress, useAchievementProgress, useManyAchievements, useManyAchievementsRewardModels, useManyChildrenAchievements, useOneAchievement, useUserAchievementAction } from '@phygitallabs/achievement';
5
+ import { EntityRewardModel, UserReward } from '@phygitallabs/reward';
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, 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';
9
+ import { LPResponse } from '@phygitallabs/notification-api';
10
+ export * from '@phygitallabs/notification-api';
11
+ import React$1 from 'react';
12
+ import * as react_jsx_runtime from 'react/jsx-runtime';
13
+ import { QueryClient } from '@tanstack/react-query';
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
+ export { cn, fileToBase64, parse } from '@phygitallabs/helpers';
17
+
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>;
19
+
20
+ interface AchievementWithProgress {
21
+ achievement: Achievement;
22
+ progress: UserAchievementProgress | null;
23
+ hasProgressError?: boolean;
24
+ hasAchievementError?: boolean;
25
+ }
26
+ interface UseManyAchievementWithProgressParams {
27
+ userId?: string;
28
+ deviceUid?: string;
29
+ applicationId?: string;
30
+ achievementIds?: string[];
31
+ }
32
+ interface UseManyAchievementWithProgressReturn {
33
+ data: AchievementWithProgress[];
34
+ isLoading: boolean;
35
+ isSuccess: boolean;
36
+ achievementsError: Error | null;
37
+ progressError: Error | null;
38
+ refetchAchievements: () => void;
39
+ refetchProgress: () => void;
40
+ refetchAll: () => void;
41
+ }
42
+ declare enum AchievementType {
43
+ DEFAULT = "default",
44
+ MULTIPLE_CHECK_INS = "multiple_check_ins",
45
+ RANDOM_CHECK_INS = "random_check_ins",
46
+ GROUP_MISSION = "group_mission"
47
+ }
48
+
49
+ declare const getLocationIdsFromAchievementRule: (achievement: Achievement) => string[];
50
+ declare const getActionsFromAchievementRule: (achievement: Achievement) => string[];
51
+ declare const isAchievementCompleted: (achievement: UserAchievementProgress) => boolean;
52
+ type SnakeToCamelCase<S extends string> = S extends `${infer T}_${infer U}` ? `${T}${Capitalize<SnakeToCamelCase<U>>}` : S;
53
+ type ConvertSnakeToCamel<T> = T extends (infer U)[] ? ConvertSnakeToCamel<U>[] : T extends Record<string, unknown> ? {
54
+ [K in keyof T as K extends string ? SnakeToCamelCase<K> : K]: ConvertSnakeToCamel<T[K]>;
55
+ } : T;
56
+ /**
57
+ * Converts snake_case keys to camelCase keys in an object or array of objects
58
+ */
59
+ declare function convertSnakeToCamel<T>(obj: T): ConvertSnakeToCamel<T>;
60
+
61
+ declare enum RewardClaimStatus {
62
+ NOT_CLAIMED = "not_claimed",
63
+ CLAIMED = "claimed",
64
+ IN_PROGRESS = "in_progress",
65
+ FAILED = "failed"
66
+ }
67
+
68
+ interface RewardRule {
69
+ id: string;
70
+ name: string;
71
+ description?: string;
72
+ type: string;
73
+ conditions: Record<string, any>;
74
+ is_active: boolean;
75
+ priority?: number;
76
+ created_at: string;
77
+ updated_at: string;
78
+ }
79
+ interface RewardGroup {
80
+ id: string;
81
+ name: string;
82
+ description?: string;
83
+ is_active: boolean;
84
+ reward_ids: string[];
85
+ rewards?: EntityRewardModel[];
86
+ project_id?: string;
87
+ campaign_id?: string;
88
+ achievement_id?: string;
89
+ labels?: Record<string, any>;
90
+ custom_info?: Record<string, any>;
91
+ metadata?: Record<string, any>;
92
+ created_at: string;
93
+ updated_at: string;
94
+ }
95
+ interface RewardNotifyTheme {
96
+ backgroundImage: string;
97
+ giftImage: string;
98
+ }
99
+ interface RewardFilter {
100
+ user_id?: string;
101
+ device_uid?: string;
102
+ reward_model_id?: string;
103
+ group_reward_id?: string;
104
+ project_id?: string;
105
+ campaign_id?: string;
106
+ achievement_id?: string;
107
+ status?: string;
108
+ claim_status?: string;
109
+ is_claimable?: boolean;
110
+ is_expired?: boolean;
111
+ type?: string;
112
+ labels?: Record<string, any>;
113
+ created_from?: string;
114
+ created_to?: string;
115
+ claimed_from?: string;
116
+ claimed_to?: string;
117
+ }
118
+ interface RewardModelFilter {
119
+ name?: string;
120
+ type?: string;
121
+ is_active?: boolean;
122
+ is_claimable?: boolean;
123
+ project_id?: string;
124
+ campaign_id?: string;
125
+ achievement_id?: string;
126
+ group_reward_id?: string;
127
+ labels?: Record<string, any>;
128
+ created_from?: string;
129
+ created_to?: string;
130
+ valid_from?: string;
131
+ valid_until?: string;
132
+ }
133
+ interface ClaimUserRewardPayload {
134
+ certificate?: {
135
+ thumbnail_url?: string;
136
+ type?: string;
137
+ url?: string;
138
+ };
139
+ user_info: Record<string, any>;
140
+ }
141
+
142
+ interface GetManyUserRewardsRequest extends PaginationRequest {
143
+ user_id?: string;
144
+ device_uid?: string;
145
+ group_reward_id?: string;
146
+ project_id?: string;
147
+ campaign_id?: string;
148
+ achievement_id?: string;
149
+ status?: string;
150
+ claim_status?: string;
151
+ is_claimable?: boolean;
152
+ is_expired?: boolean;
153
+ type?: string;
154
+ labels?: string;
155
+ created_from?: string;
156
+ created_to?: string;
157
+ claimed_from?: string;
158
+ claimed_to?: string;
159
+ }
160
+ interface GetOneUserRewardRequest {
161
+ id: string;
162
+ include_reward_model?: boolean;
163
+ include_certificate?: boolean;
164
+ }
165
+ interface CreateUserRewardRequest {
166
+ user_id: string;
167
+ device_uid?: string;
168
+ reward_model_id: string;
169
+ group_reward_id?: string;
170
+ project_id?: string;
171
+ campaign_id?: string;
172
+ achievement_id?: string;
173
+ custom_info?: Record<string, any>;
174
+ labels?: Record<string, any>;
175
+ metadata?: Record<string, any>;
176
+ claim_data?: Record<string, any>;
177
+ }
178
+ interface UpdateUserRewardRequest {
179
+ status?: string;
180
+ claim_status?: string;
181
+ claimed_at?: string;
182
+ claimed_by?: string;
183
+ claim_data?: Record<string, any>;
184
+ certificate?: {
185
+ thumbnail_url?: string;
186
+ image_url?: string;
187
+ title?: string;
188
+ subtitle?: string;
189
+ user_name?: string;
190
+ user_email?: string;
191
+ user_phone?: string;
192
+ issued_at?: string;
193
+ issued_by?: string;
194
+ };
195
+ custom_info?: Record<string, any>;
196
+ labels?: Record<string, any>;
197
+ metadata?: Record<string, any>;
198
+ }
199
+ interface ClaimUserRewardRequest {
200
+ id: string;
201
+ data: {
202
+ certificate?: {
203
+ thumbnail_url?: string;
204
+ image_url?: string;
205
+ title?: string;
206
+ subtitle?: string;
207
+ user_name?: string;
208
+ user_email?: string;
209
+ user_phone?: string;
210
+ issued_at?: string;
211
+ issued_by?: string;
212
+ };
213
+ custom_info?: Record<string, any>;
214
+ labels?: Record<string, any>;
215
+ metadata?: Record<string, any>;
216
+ claim_data?: Record<string, any>;
217
+ };
218
+ }
219
+ interface GetManyRewardModelsRequest extends PaginationRequest {
220
+ name?: string;
221
+ type?: string;
222
+ is_active?: boolean;
223
+ is_claimable?: boolean;
224
+ project_id?: string;
225
+ campaign_id?: string;
226
+ achievement_id?: string;
227
+ group_reward_id?: string;
228
+ labels?: string;
229
+ created_from?: string;
230
+ created_to?: string;
231
+ valid_from?: string;
232
+ valid_until?: string;
233
+ }
234
+ interface GetOneRewardModelRequest {
235
+ id: string;
236
+ include_rules?: boolean;
237
+ include_media?: boolean;
238
+ }
239
+ interface CreateRewardModelRequest {
240
+ name: string;
241
+ description?: string;
242
+ type: string;
243
+ image_url?: string;
244
+ thumbnail_url?: string;
245
+ value?: number;
246
+ currency?: string;
247
+ is_active?: boolean;
248
+ is_claimable?: boolean;
249
+ claim_limit?: number;
250
+ valid_from?: string;
251
+ valid_until?: string;
252
+ labels?: Record<string, any>;
253
+ custom_info?: Record<string, any>;
254
+ group_reward_id?: string;
255
+ project_id?: string;
256
+ campaign_id?: string;
257
+ achievement_id?: string;
258
+ media?: {
259
+ type: string;
260
+ url: string;
261
+ thumbnail_url?: string;
262
+ };
263
+ rules?: Array<{
264
+ name: string;
265
+ description?: string;
266
+ type: string;
267
+ conditions: Record<string, any>;
268
+ is_active?: boolean;
269
+ priority?: number;
270
+ }>;
271
+ metadata?: Record<string, any>;
272
+ }
273
+ interface UpdateRewardModelRequest {
274
+ name?: string;
275
+ description?: string;
276
+ type?: string;
277
+ image_url?: string;
278
+ thumbnail_url?: string;
279
+ value?: number;
280
+ currency?: string;
281
+ is_active?: boolean;
282
+ is_claimable?: boolean;
283
+ claim_limit?: number;
284
+ valid_from?: string;
285
+ valid_until?: string;
286
+ labels?: Record<string, any>;
287
+ custom_info?: Record<string, any>;
288
+ group_reward_id?: string;
289
+ project_id?: string;
290
+ campaign_id?: string;
291
+ achievement_id?: string;
292
+ media?: {
293
+ type: string;
294
+ url: string;
295
+ thumbnail_url?: string;
296
+ };
297
+ rules?: Array<{
298
+ id?: string;
299
+ name: string;
300
+ description?: string;
301
+ type: string;
302
+ conditions: Record<string, any>;
303
+ is_active?: boolean;
304
+ priority?: number;
305
+ }>;
306
+ metadata?: Record<string, any>;
307
+ }
308
+ interface GetManyRewardGroupsRequest extends PaginationRequest {
309
+ name?: string;
310
+ is_active?: boolean;
311
+ project_id?: string;
312
+ campaign_id?: string;
313
+ achievement_id?: string;
314
+ labels?: string;
315
+ created_from?: string;
316
+ created_to?: string;
317
+ }
318
+ interface GetOneRewardGroupRequest {
319
+ id: string;
320
+ include_rewards?: boolean;
321
+ }
322
+ interface CreateRewardGroupRequest {
323
+ name: string;
324
+ description?: string;
325
+ is_active?: boolean;
326
+ reward_ids: string[];
327
+ project_id?: string;
328
+ campaign_id?: string;
329
+ achievement_id?: string;
330
+ labels?: Record<string, any>;
331
+ custom_info?: Record<string, any>;
332
+ metadata?: Record<string, any>;
333
+ }
334
+ interface UpdateRewardGroupRequest {
335
+ name?: string;
336
+ description?: string;
337
+ is_active?: boolean;
338
+ reward_ids?: string[];
339
+ project_id?: string;
340
+ campaign_id?: string;
341
+ achievement_id?: string;
342
+ labels?: Record<string, any>;
343
+ custom_info?: Record<string, any>;
344
+ metadata?: Record<string, any>;
345
+ }
346
+ interface CreateModelGroupRewardRequest {
347
+ group_reward_ids: string[];
348
+ }
349
+ interface GetManyUserRewardsResponse extends GetManyResponse<UserReward> {
350
+ }
351
+ interface GetOneUserRewardResponse {
352
+ data: UserReward;
353
+ }
354
+ interface GetManyRewardModelsResponse extends GetManyResponse<EntityRewardModel> {
355
+ }
356
+ interface GetOneRewardModelResponse {
357
+ data: EntityRewardModel;
358
+ }
359
+ interface CreateUserRewardResponse {
360
+ data: UserReward;
361
+ }
362
+ interface UpdateUserRewardResponse {
363
+ data: UserReward;
364
+ }
365
+ interface ClaimUserRewardResponse {
366
+ data: UserReward;
367
+ }
368
+ interface CreateRewardModelResponse {
369
+ data: EntityRewardModel;
370
+ }
371
+ interface UpdateRewardModelResponse {
372
+ data: EntityRewardModel;
373
+ }
374
+ interface CreateRewardGroupResponse {
375
+ data: {
376
+ id: string;
377
+ name: string;
378
+ description?: string;
379
+ is_active: boolean;
380
+ reward_ids: string[];
381
+ project_id?: string;
382
+ campaign_id?: string;
383
+ achievement_id?: string;
384
+ labels?: Record<string, any>;
385
+ custom_info?: Record<string, any>;
386
+ metadata?: Record<string, any>;
387
+ created_at: string;
388
+ updated_at: string;
389
+ };
390
+ }
391
+ interface CreateModelGroupRewardResponse {
392
+ data: EntityRewardModel[];
393
+ }
394
+
395
+ type EnvironmentType = "dev" | "staging" | "production";
396
+
397
+ interface NotificationCallbacks {
398
+ onWebSocketOpen?: (metadata: Record<string, any>) => void;
399
+ onWebSocketClose?: (metadata: Record<string, any>) => void;
400
+ onWebSocketMessage?: (data: LPResponse) => void;
401
+ }
402
+ interface NotificationProviderProps extends NotificationCallbacks {
403
+ children: React$1.ReactNode;
404
+ autoConnect?: boolean;
405
+ user: {
406
+ id?: string;
407
+ accessToken?: string;
408
+ };
409
+ environment?: EnvironmentType;
410
+ }
411
+ declare const NotificationProvider: React$1.FC<NotificationProviderProps>;
412
+
413
+ type SignInProvider = "password" | "google.com";
414
+ declare enum UserRole {
415
+ NULL = "NULL",
416
+ SUPERADMIN = "SUPER_ADMIN",
417
+ ORGADMIN = "ORG_ADMIN"
418
+ }
419
+ type UserData$1 = {
420
+ uid: string;
421
+ id: string;
422
+ userName: string;
423
+ displayName?: string;
424
+ avatar: string;
425
+ exp: number;
426
+ email: string;
427
+ emailVerified: boolean;
428
+ accessToken: string;
429
+ refreshToken: string;
430
+ signInProvider?: SignInProvider;
431
+ role?: UserRole;
432
+ scanStatus?: boolean;
433
+ };
434
+ interface AuthResponse {
435
+ errorCode: string;
436
+ data: UserData$1 | null;
437
+ }
438
+ interface AuthService {
439
+ signInWithEmailAndPassword(email: string, password: string): Promise<AuthResponse>;
440
+ signInWithGoogle(): Promise<AuthResponse>;
441
+ signUp(email: string, password: string): Promise<AuthResponse>;
442
+ signOut(): Promise<void>;
443
+ sendPasswordResetEmail(email: string): Promise<void>;
444
+ sendEmailVerification(): Promise<void>;
445
+ changePassword(newPassword: string): Promise<void>;
446
+ onAuthStateChanged(callback: (user: UserData$1 | null) => void): () => void;
447
+ getCurrentUser(): UserData$1 | null;
448
+ }
449
+ interface AuthCallbacks {
450
+ onUserIdentify?: (userInfo: {
451
+ email: string;
452
+ name?: string;
453
+ avatar?: string;
454
+ uid?: string;
455
+ }) => void;
456
+ onTrackingReset?: () => void;
457
+ onSignInSuccess?: (userData: UserData$1) => void;
458
+ onSignInError?: (error: string) => void;
459
+ onSignOutSuccess?: () => void;
460
+ onSignUpSuccess?: (userData: UserData$1) => void;
461
+ onSignUpError?: (error: string) => void;
462
+ }
463
+ interface UseAuthReturn {
464
+ user: UserData$1;
465
+ isSignedIn: boolean;
466
+ isLoading: boolean;
467
+ signIn: (email: string, password: string) => Promise<AuthResponse>;
468
+ signInWithGoogle: () => Promise<AuthResponse>;
469
+ signUp: (email: string, password: string) => Promise<AuthResponse>;
470
+ signOut: () => Promise<void>;
471
+ forgotPassword: (email: string) => Promise<void>;
472
+ sendEmailVerification: () => Promise<void>;
473
+ changePassword: (newPassword: string) => Promise<void>;
474
+ updateScanStatus: (status: boolean) => void;
475
+ refreshUser: (userData: UserData$1) => void;
476
+ }
477
+ interface AuthProviderProps$1 {
478
+ children: React.ReactNode;
479
+ authService: AuthService;
480
+ authCallbacks?: AuthCallbacks;
481
+ }
482
+ interface FirebaseConfig {
483
+ apiKey: string;
484
+ authDomain: string;
485
+ projectId: string;
486
+ storageBucket: string;
487
+ messagingSenderId: string;
488
+ appId: string;
489
+ measurementId: string;
490
+ }
491
+
492
+ interface AuthProviderProps {
493
+ children: React.ReactNode;
494
+ baseURL: string;
495
+ queryClient: QueryClient;
496
+ }
497
+ declare const AuthProvider: ({ children, baseURL, queryClient, }: AuthProviderProps) => react_jsx_runtime.JSX.Element;
498
+
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
+ };
549
+
550
+ interface UseGoogleLoginOptions {
551
+ onSuccess?: (userData: any) => void;
552
+ onError?: (error: string) => void;
553
+ onPopupBlocked?: () => void;
554
+ onPopupClosed?: () => void;
555
+ }
556
+ interface UseGoogleLoginReturn {
557
+ signIn: () => Promise<void>;
558
+ isLoading: boolean;
559
+ error: string | null;
560
+ }
561
+ declare function useGoogleLogin(options?: UseGoogleLoginOptions): UseGoogleLoginReturn;
562
+
563
+ declare const userInfoKey = "phygital-user-info";
564
+ declare const accessTokenKey = "accessToken";
565
+ declare const refreshTokenKey = "refreshToken";
566
+ declare const httpMaxRetries = 3;
567
+ declare const retryAttemptsRefreshToken = "retryAttemptsRefreshToken";
568
+ declare const deviceUIDKey = "Device-UID";
569
+ declare const chipAuthTokenKey = "chip-auth-token";
570
+ declare const CALLBACK_URL = "https://s3-sgn10.fptcloud.com/nomion-assets/platform/callback.html";
571
+ declare const ALLOWED_ORIGINS: string[];
572
+
573
+ declare const generateDeviceId: () => Promise<string>;
574
+ declare const getDeviceUid: () => string | null;
575
+ declare const setDeviceUid: (deviceId: string) => void;
576
+ declare const removeDeviceUid: () => void;
577
+ declare const checkDeviceUid: () => Promise<string>;
578
+ declare const getChipAuthToken: () => string | null;
579
+ declare const setChipAuthToken: (value: string) => void;
580
+ declare const removeChipAuthToken: () => void;
581
+ declare const getRetryAttemptsRefreshToken: () => string | null;
582
+ declare const setRetryAttemptsRefreshToken: (value: string) => void;
583
+ declare const getAccessToken: () => string | null;
584
+ declare const setAccessToken: (value: string) => void;
585
+ declare const removeAccessToken: () => void;
586
+ declare const getRefreshToken: () => string | null;
587
+ declare const setRefreshToken: (value: string) => void;
588
+ declare const removeRefreshToken: () => void;
589
+ declare const getUserInfo: () => any;
590
+ declare const setUserInfo: (userData: any) => void;
591
+ declare const removeUserInfo: () => void;
592
+
593
+ type ScanChipData = {
594
+ externalUrl?: string;
595
+ campaignDetail?: ProjectModel;
596
+ locationDetail?: LocationModel;
597
+ scanCounter?: number;
598
+ campaignId?: string;
599
+ chipModelId?: string;
600
+ organizationId?: string;
601
+ projectId?: string;
602
+ locationId?: string;
603
+ chipUid?: string;
604
+ };
605
+ interface ScanChipResponse {
606
+ data: ScanChipData | null;
607
+ isLoading: boolean;
608
+ isError: boolean;
609
+ isSuccess: boolean;
610
+ }
611
+
612
+ interface UseScanChipProps {
613
+ token?: string;
614
+ id?: string;
615
+ onScanChipError?: () => void;
616
+ }
617
+
618
+ declare function useScanChip({ token, id, onScanChipError }: UseScanChipProps): ScanChipResponse;
619
+
620
+ declare enum TaskType {
621
+ CHECK_IN = "check_in",
622
+ CREATE_MEMORY = "create_memory",
623
+ FILL_FORM = "fill_form",
624
+ SHARE = "share"
625
+ }
626
+ interface CampaignByProjectIdModel {
627
+ id: string;
628
+ certificate_index?: number;
629
+ completed_checkin_rule?: number;
630
+ completed_device_uids?: string[];
631
+ completed_location_ids?: string[];
632
+ completed_user_ids?: string[];
633
+ description?: string;
634
+ image_url?: string;
635
+ is_custom_checkin_rule?: boolean;
636
+ location_ids?: string[];
637
+ name: string;
638
+ total_completed?: number;
639
+ user_campaign?: any;
640
+ custom_info: Record<string, any>;
641
+ mission: Record<string, any>;
642
+ achievement_id: string;
643
+ start_date: string;
644
+ end_date: string;
645
+ certificate: {
646
+ image: any;
647
+ title: string;
648
+ };
649
+ project_id?: string;
650
+ status: string;
651
+ created_at: number;
652
+ updated_at: number;
653
+ created_by?: string;
654
+ updated_by?: string;
655
+ }
656
+
657
+ interface UserCheckinLocationRanking {
658
+ user_id: string;
659
+ email: string;
660
+ full_name: string;
661
+ picture: string;
662
+ completed_location_count: number;
663
+ }
664
+ interface CampaignLocationSummaryQueryOptions {
665
+ page?: number;
666
+ limit?: number;
667
+ orderBy?: string;
668
+ orderDirection?: 'asc' | 'desc';
669
+ [key: string]: any;
670
+ }
671
+ interface CampaignLocationSummary {
672
+ address: {
673
+ custom_map_position: {
674
+ x: number;
675
+ y: number;
676
+ };
677
+ province: string;
678
+ region: string;
679
+ };
680
+ id: string;
681
+ name?: string;
682
+ position: {
683
+ latitude: number;
684
+ longitude: number;
685
+ };
686
+ visit_count?: number;
687
+ }
688
+
689
+ declare const sortLocationsByIndex: <T extends {
690
+ index?: number;
691
+ }>(locations: T[]) => T[];
692
+ declare const filterLocationsByProperty: <T extends Record<string, any>>(locations: T[], propertyName: keyof T, value: boolean) => T[];
693
+
694
+ declare global {
695
+ interface Window {
696
+ dataLayer: Record<string, any>[];
697
+ }
698
+ }
699
+ declare function useDataTracking(): {
700
+ trackEvent: (eventName: string, eventData: Record<string, any>, useTools?: ("gtm" | "ga" | "posthog")[]) => void;
701
+ trackUserIdentify: (userInfo: Record<string, any>) => void;
702
+ trackLogoutEvent: () => void;
703
+ };
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
+
848
+ interface APIConfig {
849
+ environment: EnvironmentType;
850
+ version: APIVersionType;
851
+ }
852
+
853
+ interface TapquestCoreProviderProps {
854
+ children: React$1.ReactNode;
855
+ queryClient: QueryClient;
856
+ apiConfig: APIConfig;
857
+ }
858
+ declare const TapquestCoreProvider: React$1.FC<TapquestCoreProviderProps>;
859
+
860
+ interface UseAchivementPlusRewardModelParams {
861
+ campaignId: string;
862
+ }
863
+ interface AchievementWithRewardModel {
864
+ id: string;
865
+ name: string;
866
+ reward_model: EntityRewardModel | null;
867
+ subAchievements: {
868
+ id: string;
869
+ reward_model: EntityRewardModel | null;
870
+ }[];
871
+ }
872
+ declare const useAchivementPlusRewardModel: ({ campaignId, }: UseAchivementPlusRewardModelParams) => {
873
+ mappedAchievements: AchievementWithRewardModel[];
874
+ isLoading: boolean;
875
+ };
876
+
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 };