@timardex/cluemart-shared 1.4.78 → 1.4.80
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/{chunk-KYDS4REE.mjs → chunk-2VZKL2X6.mjs} +2 -2
- package/dist/{chunk-4LT5GOOP.mjs → chunk-AOPQ64JU.mjs} +3 -3
- package/dist/{chunk-FL4P2WWM.mjs → chunk-HU2XPJFC.mjs} +3 -2
- package/dist/{chunk-FL4P2WWM.mjs.map → chunk-HU2XPJFC.mjs.map} +1 -1
- package/dist/{chunk-SSNWS3V4.mjs → chunk-T6D7HTHH.mjs} +143 -2
- package/dist/chunk-T6D7HTHH.mjs.map +1 -0
- package/dist/{chunk-USQKKCIA.mjs → chunk-VE6JFCH2.mjs} +8 -2
- package/dist/{chunk-USQKKCIA.mjs.map → chunk-VE6JFCH2.mjs.map} +1 -1
- package/dist/enums/index.cjs +7 -0
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.mts +5 -1
- package/dist/enums/index.d.ts +5 -1
- package/dist/enums/index.mjs +3 -1
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.mjs +3 -3
- package/dist/graphql/index.cjs +145 -0
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +47 -3
- package/dist/graphql/index.d.ts +47 -3
- package/dist/graphql/index.mjs +10 -2
- package/dist/hooks/index.cjs +86 -1
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.mjs +5 -5
- package/dist/index.cjs +154 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +83 -3
- package/dist/index.d.ts +83 -3
- package/dist/index.mjs +149 -1
- package/dist/index.mjs.map +1 -1
- package/dist/{post-DZF3nYKf.d.mts → post-7mWg32YL.d.mts} +17 -4
- package/dist/{post-DdErP7-k.d.ts → post-Bf93S2HP.d.ts} +17 -4
- package/dist/{resourceActivities-CqrscA5x.d.mts → resourceActivities-5kKwlOry.d.mts} +21 -2
- package/dist/{resourceActivities-2FaGRW-i.d.ts → resourceActivities-Bf_CX38O.d.ts} +21 -2
- package/dist/types/index.cjs +2 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.mjs +1 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-SSNWS3V4.mjs.map +0 -1
- /package/dist/{chunk-KYDS4REE.mjs.map → chunk-2VZKL2X6.mjs.map} +0 -0
- /package/dist/{chunk-4LT5GOOP.mjs.map → chunk-AOPQ64JU.mjs.map} +0 -0
package/dist/graphql/index.cjs
CHANGED
|
@@ -73,6 +73,8 @@ __export(graphql_exports, {
|
|
|
73
73
|
useGetEvents: () => useGetEvents,
|
|
74
74
|
useGetEventsByRegion: () => useGetEventsByRegion,
|
|
75
75
|
useGetEventsNearMe: () => useGetEventsNearMe,
|
|
76
|
+
useGetGame: () => useGetGame,
|
|
77
|
+
useGetGames: () => useGetGames,
|
|
76
78
|
useGetNotificationCount: () => useGetNotificationCount,
|
|
77
79
|
useGetNotificationCountSubscription: () => useGetNotificationCountSubscription,
|
|
78
80
|
useGetPartner: () => useGetPartner,
|
|
@@ -105,6 +107,7 @@ __export(graphql_exports, {
|
|
|
105
107
|
useGetVendorRelations: () => useGetVendorRelations,
|
|
106
108
|
useGetVendors: () => useGetVendors,
|
|
107
109
|
useGetVendorsByRegion: () => useGetVendorsByRegion,
|
|
110
|
+
useLeaveGame: () => useLeaveGame,
|
|
108
111
|
useLogin: () => useLogin,
|
|
109
112
|
useLogout: () => useLogout,
|
|
110
113
|
useMarkAllNotificationsRead: () => useMarkAllNotificationsRead,
|
|
@@ -126,6 +129,7 @@ __export(graphql_exports, {
|
|
|
126
129
|
useSelectPackage: () => useSelectPackage,
|
|
127
130
|
useSelectStandardPackage: () => useSelectStandardPackage,
|
|
128
131
|
useSendChatMessage: () => useSendChatMessage,
|
|
132
|
+
useStartGame: () => useStartGame,
|
|
129
133
|
useToggleChatMessageLike: () => useToggleChatMessageLike,
|
|
130
134
|
useUpdateAd: () => useUpdateAd,
|
|
131
135
|
useUpdateAppSettings: () => useUpdateAppSettings,
|
|
@@ -312,12 +316,14 @@ var USER_FIELDS_FRAGMENT = import_client2.gql`
|
|
|
312
316
|
email
|
|
313
317
|
events
|
|
314
318
|
firstName
|
|
319
|
+
games
|
|
315
320
|
isTester
|
|
316
321
|
lastName
|
|
317
322
|
licences {
|
|
318
323
|
...LicenceFields
|
|
319
324
|
}
|
|
320
325
|
partner
|
|
326
|
+
points
|
|
321
327
|
platform
|
|
322
328
|
preferredRegion
|
|
323
329
|
promoCodes
|
|
@@ -3333,6 +3339,14 @@ var import_client56 = require("@apollo/client");
|
|
|
3333
3339
|
var import_client55 = require("@apollo/client");
|
|
3334
3340
|
var POST_CONTENT_DATA_FIELDS_FRAGMENT = import_client55.gql`
|
|
3335
3341
|
fragment PostContentDataFields on PostContentData {
|
|
3342
|
+
game {
|
|
3343
|
+
title
|
|
3344
|
+
gameType
|
|
3345
|
+
gameInfo {
|
|
3346
|
+
dailyClue
|
|
3347
|
+
}
|
|
3348
|
+
gameEndDate
|
|
3349
|
+
}
|
|
3336
3350
|
textarea {
|
|
3337
3351
|
title
|
|
3338
3352
|
data
|
|
@@ -3559,6 +3573,133 @@ var useGetAppSettings = () => {
|
|
|
3559
3573
|
const appSettings = data?.appSettings || null;
|
|
3560
3574
|
return { appSettings, error, loading, refetch };
|
|
3561
3575
|
};
|
|
3576
|
+
|
|
3577
|
+
// src/graphql/hooks/game/hooksMutation.ts
|
|
3578
|
+
var import_client65 = require("@apollo/client");
|
|
3579
|
+
|
|
3580
|
+
// src/graphql/mutations/game.ts
|
|
3581
|
+
var import_client64 = require("@apollo/client");
|
|
3582
|
+
|
|
3583
|
+
// src/graphql/queries/game.ts
|
|
3584
|
+
var import_client63 = require("@apollo/client");
|
|
3585
|
+
var DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT = import_client63.gql`
|
|
3586
|
+
fragment DailyClueGameDataFields on DailyClueGameDataType {
|
|
3587
|
+
lastFoundDate
|
|
3588
|
+
streak
|
|
3589
|
+
points
|
|
3590
|
+
collectedLetters
|
|
3591
|
+
gameEndDate
|
|
3592
|
+
}
|
|
3593
|
+
`;
|
|
3594
|
+
var GAME_FIELDS_FRAGMENT = import_client63.gql`
|
|
3595
|
+
fragment GameFields on GameType {
|
|
3596
|
+
_id
|
|
3597
|
+
active
|
|
3598
|
+
createdAt
|
|
3599
|
+
deletedAt
|
|
3600
|
+
gameData {
|
|
3601
|
+
dailyClue {
|
|
3602
|
+
...DailyClueGameDataFields
|
|
3603
|
+
}
|
|
3604
|
+
}
|
|
3605
|
+
updatedAt
|
|
3606
|
+
owner {
|
|
3607
|
+
...OwnerFields
|
|
3608
|
+
}
|
|
3609
|
+
}
|
|
3610
|
+
${DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT}
|
|
3611
|
+
${OWNER_FIELDS_FRAGMENT}
|
|
3612
|
+
`;
|
|
3613
|
+
var GET_GAMES = import_client63.gql`
|
|
3614
|
+
query getGames($userId: ID) {
|
|
3615
|
+
games(userId: $userId) {
|
|
3616
|
+
...GameFields
|
|
3617
|
+
}
|
|
3618
|
+
}
|
|
3619
|
+
${GAME_FIELDS_FRAGMENT}
|
|
3620
|
+
`;
|
|
3621
|
+
var GET_GAME = import_client63.gql`
|
|
3622
|
+
query getGame($_id: ID!) {
|
|
3623
|
+
game(_id: $_id) {
|
|
3624
|
+
...GameFields
|
|
3625
|
+
}
|
|
3626
|
+
}
|
|
3627
|
+
${GAME_FIELDS_FRAGMENT}
|
|
3628
|
+
`;
|
|
3629
|
+
|
|
3630
|
+
// src/graphql/mutations/game.ts
|
|
3631
|
+
var START_GAME_MUTATION = import_client64.gql`
|
|
3632
|
+
mutation startGame($input: GameInputType!) {
|
|
3633
|
+
startGame(input: $input) {
|
|
3634
|
+
...GameFields
|
|
3635
|
+
}
|
|
3636
|
+
}
|
|
3637
|
+
${GAME_FIELDS_FRAGMENT}
|
|
3638
|
+
`;
|
|
3639
|
+
var LEAVE_GAME_MUTATION = import_client64.gql`
|
|
3640
|
+
mutation leaveGame($_id: ID!) {
|
|
3641
|
+
leaveGame(_id: $_id) {
|
|
3642
|
+
...GameFields
|
|
3643
|
+
}
|
|
3644
|
+
}
|
|
3645
|
+
${GAME_FIELDS_FRAGMENT}
|
|
3646
|
+
`;
|
|
3647
|
+
|
|
3648
|
+
// src/graphql/hooks/game/hooksMutation.ts
|
|
3649
|
+
var useStartGame = () => {
|
|
3650
|
+
const [startGame, { loading, error }] = (0, import_client65.useMutation)(START_GAME_MUTATION, {
|
|
3651
|
+
awaitRefetchQueries: true,
|
|
3652
|
+
refetchQueries: (mutationResult) => {
|
|
3653
|
+
const gameId = mutationResult?.data?.startGame?._id;
|
|
3654
|
+
if (!gameId) return [];
|
|
3655
|
+
return [
|
|
3656
|
+
{
|
|
3657
|
+
query: GET_GAME,
|
|
3658
|
+
variables: { _id: gameId }
|
|
3659
|
+
// Pass the gameId for refetching
|
|
3660
|
+
}
|
|
3661
|
+
];
|
|
3662
|
+
}
|
|
3663
|
+
});
|
|
3664
|
+
return { error, loading, startGame };
|
|
3665
|
+
};
|
|
3666
|
+
var useLeaveGame = () => {
|
|
3667
|
+
const [leaveGame, { loading, error }] = (0, import_client65.useMutation)(LEAVE_GAME_MUTATION, {
|
|
3668
|
+
awaitRefetchQueries: true,
|
|
3669
|
+
refetchQueries: (mutationResult) => {
|
|
3670
|
+
const userId = mutationResult?.data?.leaveGame?.userId;
|
|
3671
|
+
if (!userId) return [];
|
|
3672
|
+
return [
|
|
3673
|
+
{
|
|
3674
|
+
query: GET_GAMES,
|
|
3675
|
+
variables: { userId }
|
|
3676
|
+
// Pass the userId for refetching
|
|
3677
|
+
}
|
|
3678
|
+
];
|
|
3679
|
+
}
|
|
3680
|
+
});
|
|
3681
|
+
return { error, leaveGame, loading };
|
|
3682
|
+
};
|
|
3683
|
+
|
|
3684
|
+
// src/graphql/hooks/game/hooksQuery.ts
|
|
3685
|
+
var import_client66 = require("@apollo/client");
|
|
3686
|
+
var useGetGames = (userId) => {
|
|
3687
|
+
const { loading, error, data, refetch } = (0, import_client66.useQuery)(GET_GAMES, {
|
|
3688
|
+
fetchPolicy: "network-only",
|
|
3689
|
+
variables: { userId }
|
|
3690
|
+
});
|
|
3691
|
+
const games = data?.games || [];
|
|
3692
|
+
return { error, games, loading, refetch };
|
|
3693
|
+
};
|
|
3694
|
+
var useGetGame = (_id) => {
|
|
3695
|
+
const { loading, error, data, refetch } = (0, import_client66.useQuery)(GET_GAME, {
|
|
3696
|
+
fetchPolicy: "network-only",
|
|
3697
|
+
skip: !_id,
|
|
3698
|
+
variables: { _id }
|
|
3699
|
+
});
|
|
3700
|
+
const game = data?.game || null;
|
|
3701
|
+
return { error, game, loading, refetch };
|
|
3702
|
+
};
|
|
3562
3703
|
// Annotate the CommonJS export names for ESM import in node:
|
|
3563
3704
|
0 && (module.exports = {
|
|
3564
3705
|
useAddParticipantToChat,
|
|
@@ -3614,6 +3755,8 @@ var useGetAppSettings = () => {
|
|
|
3614
3755
|
useGetEvents,
|
|
3615
3756
|
useGetEventsByRegion,
|
|
3616
3757
|
useGetEventsNearMe,
|
|
3758
|
+
useGetGame,
|
|
3759
|
+
useGetGames,
|
|
3617
3760
|
useGetNotificationCount,
|
|
3618
3761
|
useGetNotificationCountSubscription,
|
|
3619
3762
|
useGetPartner,
|
|
@@ -3646,6 +3789,7 @@ var useGetAppSettings = () => {
|
|
|
3646
3789
|
useGetVendorRelations,
|
|
3647
3790
|
useGetVendors,
|
|
3648
3791
|
useGetVendorsByRegion,
|
|
3792
|
+
useLeaveGame,
|
|
3649
3793
|
useLogin,
|
|
3650
3794
|
useLogout,
|
|
3651
3795
|
useMarkAllNotificationsRead,
|
|
@@ -3667,6 +3811,7 @@ var useGetAppSettings = () => {
|
|
|
3667
3811
|
useSelectPackage,
|
|
3668
3812
|
useSelectStandardPackage,
|
|
3669
3813
|
useSendChatMessage,
|
|
3814
|
+
useStartGame,
|
|
3670
3815
|
useToggleChatMessageLike,
|
|
3671
3816
|
useUpdateAd,
|
|
3672
3817
|
useUpdateAppSettings,
|