@timardex/cluemart-shared 1.4.97 → 1.4.99
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-DQNJKQTY.mjs → chunk-DMNIELEW.mjs} +1 -1
- package/dist/{chunk-DQNJKQTY.mjs.map → chunk-DMNIELEW.mjs.map} +1 -1
- package/dist/{chunk-4VZXLFSL.mjs → chunk-X52YRYVX.mjs} +34 -3
- package/dist/{chunk-4VZXLFSL.mjs.map → chunk-X52YRYVX.mjs.map} +1 -1
- package/dist/graphql/index.cjs +34 -2
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +13 -8
- package/dist/graphql/index.d.ts +13 -8
- package/dist/graphql/index.mjs +3 -1
- package/dist/hooks/index.cjs +8 -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 +2 -2
- package/dist/index.cjs +34 -2
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +12 -8
- package/dist/index.d.ts +12 -8
- package/dist/index.mjs +33 -2
- package/dist/index.mjs.map +1 -1
- package/dist/{post-XlgaT3Yb.d.mts → post-DCtZdyYx.d.mts} +0 -1
- package/dist/{post-DdQKmJ86.d.ts → post-DVWX_kia.d.ts} +0 -1
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +1 -1
- package/dist/types/index.d.ts +1 -1
- package/dist/types/index.mjs +1 -1
- package/package.json +1 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/auth.ts","../src/types/ad.ts","../src/types/resourceActivities.ts","../src/types/post.ts","../src/types/game.ts"],"sourcesContent":["import { CreateFormData, EnumOSPlatform, TermsAgreement } from \"src\";\n\nexport enum EnumVerificationType {\n REGISTER = \"register\",\n RESET_PASSWORD = \"resetPassword\",\n}\n\nexport type LoginFormData = {\n email: string;\n isAdminPage?: boolean;\n password: string;\n platform?: EnumOSPlatform;\n};\n\nexport type CreateLoginFormData = CreateFormData<LoginFormData>;\n\nexport type RegisterFormData = {\n email: string;\n firstName: string;\n lastName: string;\n password: string;\n platform?: EnumOSPlatform;\n preferredRegion: string;\n promoCode?: string | null;\n termsAgreement?: TermsAgreement | null;\n};\n\nexport type CreateRegisterFormData = CreateFormData<RegisterFormData>;\n\nexport type RequestPasswordResetFormData = {\n email: string;\n};\n\nexport type CreateRequestPasswordResetFormData =\n CreateFormData<RequestPasswordResetFormData>;\n\nexport type ResetPasswordFormData = {\n confirmPassword: string;\n email: string;\n password: string;\n};\n\nexport type CreateResetPasswordFormData = CreateFormData<ResetPasswordFormData>;\n\nexport type ValidateVerificationTokenFormData = {\n email: string;\n verificationToken: string;\n verificationType?: EnumVerificationType;\n};\n\nexport type CreateValidateVerificationTokenFormData =\n CreateFormData<ValidateVerificationTokenFormData>;\n","import { EnumResourceType } from \"src/enums\";\n\nimport { CreateFormData, SocialMediaType } from \"./global\";\n\nexport enum EnumAdShowOn {\n EVENTS_PAGE = \"Events_page\",\n FRONT_PAGE = \"Front_page\",\n PARTNERS_PAGE = \"Partners_page\",\n VENDORS_PAGE = \"Vendors_page\",\n}\n\nexport enum EnumAdStatus {\n ACTIVE = \"Active\",\n PAUSED = \"Paused\",\n EXPIRED = \"Expired\",\n}\n\nexport enum EnumAdType {\n SPONSORED = \"Sponsored\",\n FREE = \"Free\",\n}\n\nexport enum EnumAdStyle {\n BLOOM = \"Bloom\",\n RISE = \"Rise\",\n}\n\nexport type AdResource = {\n adDescription: string | null;\n adImage: string | null;\n adStyle: EnumAdStyle | null;\n adTitle: string | null;\n adType: EnumAdType | null;\n resourceId: string | null;\n resourceName: string | null;\n resourceRegion: string | null;\n resourceType: EnumResourceType | null;\n};\n\nexport interface AdFormData {\n active: boolean;\n end: Date; // ISO date string\n resource: AdResource;\n showOn: EnumAdShowOn[];\n start?: Date; // ISO date string\n status: EnumAdStatus;\n targetRegion: string[];\n}\n\nexport type CreateAdFormData = CreateFormData<AdFormData>;\n\nexport interface AdType extends AdFormData {\n _id: string;\n clicks?: number; // How many times the ad was clicked\n createdAt: Date;\n impressions?: number; // How often the ad was seen\n start: Date; // ISO date string\n updatedAt: Date | null;\n}\n","import {\n EnumEventDateStatus,\n EnumOSPlatform,\n EnumResourceType,\n} from \"src/enums\";\n\nimport { LocationGeoType } from \"./global\";\n\nexport enum EnumActivity {\n FAVORITE = \"FAVORITE\",\n GOING = \"GOING\",\n INTERESTED = \"INTERESTED\",\n PRESENT = \"PRESENT\",\n VIEW = \"VIEW\",\n}\n\nexport type ResourceActivityEntry = {\n activityType: EnumActivity;\n location: LocationGeoType | null;\n dateStatus?: EnumEventDateStatus | null;\n startDate?: string | null;\n startTime?: string | null;\n timestamp: Date;\n userAgent: EnumOSPlatform;\n userId?: string | null;\n};\n\nexport type ResourceActivityType = {\n _id: string;\n resourceType: EnumResourceType;\n resourceId: string;\n activity: ResourceActivityEntry[];\n};\n\nexport type ResourceActivityInputType = {\n resourceId: string;\n resourceType: EnumResourceType;\n activity: Omit<ResourceActivityEntry, \"timestamp\">;\n};\n","import { EnumResourceType } from \"src/enums\";\n\nimport { BaseGame } from \"./game\";\nimport { CreateFormData, ResourceImageType } from \"./global\";\n\nexport enum EnumPostType {\n DAILY_MEETS = \"daily_meets\",\n DAILY_TIPS = \"daily_tips\",\n DAILY_GAMES = \"daily_games\",\n}\n\nexport enum EnumPostContentType {\n GAME = \"game\",\n IMAGE = \"image\",\n LIST = \"list\",\n TEXTAREA = \"textarea\",\n VIDEO = \"video\",\n}\n\nexport type PostFileInput = {\n source: File;\n title?: string;\n};\n\nexport type PostContentTextarea = {\n textarea: {\n title?: string;\n data: string;\n };\n};\n\nexport type PostContentImage = {\n images: ResourceImageType[] | null;\n imagesUpload?: PostFileInput[] | null;\n};\n\nexport type PostContentVideo = {\n video: {\n source: string;\n title?: string;\n };\n};\n\nexport type PostContentList = {\n list: {\n title?: string;\n items: {\n text: string;\n }[];\n };\n};\n\nexport type PostContentGame = {\n game: BaseGame;\n};\n\nexport type PostContentData =\n | PostContentGame\n | PostContentTextarea\n | PostContentImage\n | PostContentVideo\n | PostContentList;\n\nexport type PostContentFormData = {\n contentData?: PostContentData | null;\n contentOrder?: number | null;\n contentType?: EnumPostContentType | null;\n};\n\nexport interface PostFormData {\n active: boolean;\n caption: string;\n content: PostContentFormData[];\n cover?: ResourceImageType | null;\n coverUpload?: PostFileInput | null;\n postType: EnumPostType;\n resource?: {\n resourceId: string;\n resourceType: EnumResourceType;\n } | null;\n tags?: string[] | null;\n title: string;\n}\n\nexport type CreatePostFormData = CreateFormData<PostFormData>;\n\nexport type PostContentType = Omit<PostContentFormData, \"contentData\"> & {\n contentData: Omit<PostContentData, \"imagesUpload\">;\n};\n\nexport type PostType = Omit<PostFormData, \"content\" | \"coverUpload\"> & {\n _id: string;\n content: PostContentType[];\n createdAt: Date;\n deletedAt: Date | null;\n updatedAt: Date | null;\n};\n","import { OwnerType } from \"./global\";\n\nexport enum EnumGameType {\n DAILY_CLUE = \"dailyClue\",\n}\n\nexport type BaseGame = {\n gameDate: {\n endDate: Date;\n startDate: Date;\n };\n gameSolution: string;\n gameType: EnumGameType;\n
|
|
1
|
+
{"version":3,"sources":["../src/types/auth.ts","../src/types/ad.ts","../src/types/resourceActivities.ts","../src/types/post.ts","../src/types/game.ts"],"sourcesContent":["import { CreateFormData, EnumOSPlatform, TermsAgreement } from \"src\";\n\nexport enum EnumVerificationType {\n REGISTER = \"register\",\n RESET_PASSWORD = \"resetPassword\",\n}\n\nexport type LoginFormData = {\n email: string;\n isAdminPage?: boolean;\n password: string;\n platform?: EnumOSPlatform;\n};\n\nexport type CreateLoginFormData = CreateFormData<LoginFormData>;\n\nexport type RegisterFormData = {\n email: string;\n firstName: string;\n lastName: string;\n password: string;\n platform?: EnumOSPlatform;\n preferredRegion: string;\n promoCode?: string | null;\n termsAgreement?: TermsAgreement | null;\n};\n\nexport type CreateRegisterFormData = CreateFormData<RegisterFormData>;\n\nexport type RequestPasswordResetFormData = {\n email: string;\n};\n\nexport type CreateRequestPasswordResetFormData =\n CreateFormData<RequestPasswordResetFormData>;\n\nexport type ResetPasswordFormData = {\n confirmPassword: string;\n email: string;\n password: string;\n};\n\nexport type CreateResetPasswordFormData = CreateFormData<ResetPasswordFormData>;\n\nexport type ValidateVerificationTokenFormData = {\n email: string;\n verificationToken: string;\n verificationType?: EnumVerificationType;\n};\n\nexport type CreateValidateVerificationTokenFormData =\n CreateFormData<ValidateVerificationTokenFormData>;\n","import { EnumResourceType } from \"src/enums\";\n\nimport { CreateFormData, SocialMediaType } from \"./global\";\n\nexport enum EnumAdShowOn {\n EVENTS_PAGE = \"Events_page\",\n FRONT_PAGE = \"Front_page\",\n PARTNERS_PAGE = \"Partners_page\",\n VENDORS_PAGE = \"Vendors_page\",\n}\n\nexport enum EnumAdStatus {\n ACTIVE = \"Active\",\n PAUSED = \"Paused\",\n EXPIRED = \"Expired\",\n}\n\nexport enum EnumAdType {\n SPONSORED = \"Sponsored\",\n FREE = \"Free\",\n}\n\nexport enum EnumAdStyle {\n BLOOM = \"Bloom\",\n RISE = \"Rise\",\n}\n\nexport type AdResource = {\n adDescription: string | null;\n adImage: string | null;\n adStyle: EnumAdStyle | null;\n adTitle: string | null;\n adType: EnumAdType | null;\n resourceId: string | null;\n resourceName: string | null;\n resourceRegion: string | null;\n resourceType: EnumResourceType | null;\n};\n\nexport interface AdFormData {\n active: boolean;\n end: Date; // ISO date string\n resource: AdResource;\n showOn: EnumAdShowOn[];\n start?: Date; // ISO date string\n status: EnumAdStatus;\n targetRegion: string[];\n}\n\nexport type CreateAdFormData = CreateFormData<AdFormData>;\n\nexport interface AdType extends AdFormData {\n _id: string;\n clicks?: number; // How many times the ad was clicked\n createdAt: Date;\n impressions?: number; // How often the ad was seen\n start: Date; // ISO date string\n updatedAt: Date | null;\n}\n","import {\n EnumEventDateStatus,\n EnumOSPlatform,\n EnumResourceType,\n} from \"src/enums\";\n\nimport { LocationGeoType } from \"./global\";\n\nexport enum EnumActivity {\n FAVORITE = \"FAVORITE\",\n GOING = \"GOING\",\n INTERESTED = \"INTERESTED\",\n PRESENT = \"PRESENT\",\n VIEW = \"VIEW\",\n}\n\nexport type ResourceActivityEntry = {\n activityType: EnumActivity;\n location: LocationGeoType | null;\n dateStatus?: EnumEventDateStatus | null;\n startDate?: string | null;\n startTime?: string | null;\n timestamp: Date;\n userAgent: EnumOSPlatform;\n userId?: string | null;\n};\n\nexport type ResourceActivityType = {\n _id: string;\n resourceType: EnumResourceType;\n resourceId: string;\n activity: ResourceActivityEntry[];\n};\n\nexport type ResourceActivityInputType = {\n resourceId: string;\n resourceType: EnumResourceType;\n activity: Omit<ResourceActivityEntry, \"timestamp\">;\n};\n","import { EnumResourceType } from \"src/enums\";\n\nimport { BaseGame } from \"./game\";\nimport { CreateFormData, ResourceImageType } from \"./global\";\n\nexport enum EnumPostType {\n DAILY_MEETS = \"daily_meets\",\n DAILY_TIPS = \"daily_tips\",\n DAILY_GAMES = \"daily_games\",\n}\n\nexport enum EnumPostContentType {\n GAME = \"game\",\n IMAGE = \"image\",\n LIST = \"list\",\n TEXTAREA = \"textarea\",\n VIDEO = \"video\",\n}\n\nexport type PostFileInput = {\n source: File;\n title?: string;\n};\n\nexport type PostContentTextarea = {\n textarea: {\n title?: string;\n data: string;\n };\n};\n\nexport type PostContentImage = {\n images: ResourceImageType[] | null;\n imagesUpload?: PostFileInput[] | null;\n};\n\nexport type PostContentVideo = {\n video: {\n source: string;\n title?: string;\n };\n};\n\nexport type PostContentList = {\n list: {\n title?: string;\n items: {\n text: string;\n }[];\n };\n};\n\nexport type PostContentGame = {\n game: BaseGame;\n};\n\nexport type PostContentData =\n | PostContentGame\n | PostContentTextarea\n | PostContentImage\n | PostContentVideo\n | PostContentList;\n\nexport type PostContentFormData = {\n contentData?: PostContentData | null;\n contentOrder?: number | null;\n contentType?: EnumPostContentType | null;\n};\n\nexport interface PostFormData {\n active: boolean;\n caption: string;\n content: PostContentFormData[];\n cover?: ResourceImageType | null;\n coverUpload?: PostFileInput | null;\n postType: EnumPostType;\n resource?: {\n resourceId: string;\n resourceType: EnumResourceType;\n } | null;\n tags?: string[] | null;\n title: string;\n}\n\nexport type CreatePostFormData = CreateFormData<PostFormData>;\n\nexport type PostContentType = Omit<PostContentFormData, \"contentData\"> & {\n contentData: Omit<PostContentData, \"imagesUpload\">;\n};\n\nexport type PostType = Omit<PostFormData, \"content\" | \"coverUpload\"> & {\n _id: string;\n content: PostContentType[];\n createdAt: Date;\n deletedAt: Date | null;\n updatedAt: Date | null;\n};\n","import { OwnerType } from \"./global\";\n\nexport enum EnumGameType {\n DAILY_CLUE = \"dailyClue\",\n}\n\nexport type BaseGame = {\n gameDate: {\n endDate: Date;\n startDate: Date;\n };\n gameSolution: string;\n gameType: EnumGameType;\n};\n\nexport type DailyClueGameData = {\n collectedLetters: string[] | null; // Tracks which letters the user has found, e.g. [\"C\", \"L\", \"U\"]\n gameFields: BaseGame;\n lastFoundDate: Date | null;\n points: number;\n streak: number; // User has found the clue 3 days in a row, this is incrementing if the user finds the clue and decrements if user misses a day\n};\n\ntype GameDataMap = {\n [EnumGameType.DAILY_CLUE]: DailyClueGameData;\n};\nexport type GameData = {\n [K in keyof GameDataMap]?: GameDataMap[K] | null;\n};\nexport type GameType = {\n _id: string;\n active: boolean;\n createdAt: Date;\n deletedAt: Date | null;\n gameData: GameData | null;\n owner: OwnerType;\n points: number;\n updatedAt: Date | null;\n};\n"],"mappings":";AAEO,IAAK,uBAAL,kBAAKA,0BAAL;AACL,EAAAA,sBAAA,cAAW;AACX,EAAAA,sBAAA,oBAAiB;AAFP,SAAAA;AAAA,GAAA;;;ACEL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,mBAAgB;AAChB,EAAAA,cAAA,kBAAe;AAJL,SAAAA;AAAA,GAAA;AAOL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,aAAU;AAHA,SAAAA;AAAA,GAAA;AAML,IAAK,aAAL,kBAAKC,gBAAL;AACL,EAAAA,YAAA,eAAY;AACZ,EAAAA,YAAA,UAAO;AAFG,SAAAA;AAAA,GAAA;AAKL,IAAK,cAAL,kBAAKC,iBAAL;AACL,EAAAA,aAAA,WAAQ;AACR,EAAAA,aAAA,UAAO;AAFG,SAAAA;AAAA,GAAA;;;ACdL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,WAAQ;AACR,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,UAAO;AALG,SAAAA;AAAA,GAAA;;;ACHL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,iBAAc;AAHJ,SAAAA;AAAA,GAAA;AAML,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,WAAQ;AALE,SAAAA;AAAA,GAAA;;;ACTL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,gBAAa;AADH,SAAAA;AAAA,GAAA;","names":["EnumVerificationType","EnumAdShowOn","EnumAdStatus","EnumAdType","EnumAdStyle","EnumActivity","EnumPostType","EnumPostContentType","EnumGameType"]}
|
|
@@ -3202,7 +3202,6 @@ var BASE_GAME_FIELDS_FRAGMENT = gql29`
|
|
|
3202
3202
|
}
|
|
3203
3203
|
gameSolution
|
|
3204
3204
|
gameType
|
|
3205
|
-
title
|
|
3206
3205
|
}
|
|
3207
3206
|
`;
|
|
3208
3207
|
var DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT = gql29`
|
|
@@ -3506,6 +3505,14 @@ var LEAVE_GAME_MUTATION = gql34`
|
|
|
3506
3505
|
leaveGame(_id: $_id, gameType: $gameType)
|
|
3507
3506
|
}
|
|
3508
3507
|
`;
|
|
3508
|
+
var UPDATE_DAILY_CLUE_MUTATION = gql34`
|
|
3509
|
+
mutation updateDailyClueGame($_id: ID!, $foundLetter: String!) {
|
|
3510
|
+
updateDailyClueGame(_id: $_id, foundLetter: $foundLetter) {
|
|
3511
|
+
...GameFields
|
|
3512
|
+
}
|
|
3513
|
+
}
|
|
3514
|
+
${GAME_FIELDS_FRAGMENT}
|
|
3515
|
+
`;
|
|
3509
3516
|
|
|
3510
3517
|
// src/graphql/hooks/game/hooksMutation.ts
|
|
3511
3518
|
var useStartGame = () => {
|
|
@@ -3513,12 +3520,18 @@ var useStartGame = () => {
|
|
|
3513
3520
|
awaitRefetchQueries: true,
|
|
3514
3521
|
refetchQueries: (mutationResult) => {
|
|
3515
3522
|
const gameId = mutationResult?.data?.startGame?._id;
|
|
3516
|
-
|
|
3523
|
+
const userId = mutationResult?.data?.startGame?.owner?.userId;
|
|
3524
|
+
if (!gameId || !userId) return [];
|
|
3517
3525
|
return [
|
|
3518
3526
|
{
|
|
3519
3527
|
query: GET_GAME,
|
|
3520
3528
|
variables: { _id: gameId }
|
|
3521
3529
|
// Pass the gameId for refetching
|
|
3530
|
+
},
|
|
3531
|
+
{
|
|
3532
|
+
query: GET_USER,
|
|
3533
|
+
variables: { _id: userId }
|
|
3534
|
+
// Pass the userId for refetching
|
|
3522
3535
|
}
|
|
3523
3536
|
];
|
|
3524
3537
|
}
|
|
@@ -3536,6 +3549,23 @@ var useLeaveGame = () => {
|
|
|
3536
3549
|
});
|
|
3537
3550
|
return { error, leaveGame, loading };
|
|
3538
3551
|
};
|
|
3552
|
+
var useUpdateDailyClueGame = () => {
|
|
3553
|
+
const [updateDailyClueGame, { loading, error }] = useMutation18(UPDATE_DAILY_CLUE_MUTATION, {
|
|
3554
|
+
awaitRefetchQueries: true,
|
|
3555
|
+
refetchQueries: (mutationResult) => {
|
|
3556
|
+
const gameId = mutationResult?.data?.updateDailyClueGame?._id;
|
|
3557
|
+
if (!gameId) return [];
|
|
3558
|
+
return [
|
|
3559
|
+
{
|
|
3560
|
+
query: GET_GAME,
|
|
3561
|
+
variables: { _id: gameId }
|
|
3562
|
+
// Pass the gameId for refetching
|
|
3563
|
+
}
|
|
3564
|
+
];
|
|
3565
|
+
}
|
|
3566
|
+
});
|
|
3567
|
+
return { error, loading, updateDailyClueGame };
|
|
3568
|
+
};
|
|
3539
3569
|
|
|
3540
3570
|
// src/graphql/hooks/game/hooksQuery.ts
|
|
3541
3571
|
import { useQuery as useQuery13 } from "@apollo/client";
|
|
@@ -3680,7 +3710,8 @@ export {
|
|
|
3680
3710
|
useGetAppSettings,
|
|
3681
3711
|
useStartGame,
|
|
3682
3712
|
useLeaveGame,
|
|
3713
|
+
useUpdateDailyClueGame,
|
|
3683
3714
|
useGetGames,
|
|
3684
3715
|
useGetGame
|
|
3685
3716
|
};
|
|
3686
|
-
//# sourceMappingURL=chunk-
|
|
3717
|
+
//# sourceMappingURL=chunk-X52YRYVX.mjs.map
|