@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
|
@@ -2,7 +2,7 @@ import {
|
|
|
2
2
|
EnumInviteStatus,
|
|
3
3
|
EnumPaymentMethod,
|
|
4
4
|
EnumRegions
|
|
5
|
-
} from "./chunk-
|
|
5
|
+
} from "./chunk-VE6JFCH2.mjs";
|
|
6
6
|
|
|
7
7
|
// src/utils/index.ts
|
|
8
8
|
import dayjs from "dayjs";
|
|
@@ -176,4 +176,4 @@ export {
|
|
|
176
176
|
IOS_URL,
|
|
177
177
|
ANDROID_URL
|
|
178
178
|
};
|
|
179
|
-
//# sourceMappingURL=chunk-
|
|
179
|
+
//# sourceMappingURL=chunk-2VZKL2X6.mjs.map
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import {
|
|
2
2
|
mapArrayToOptions
|
|
3
|
-
} from "./chunk-
|
|
3
|
+
} from "./chunk-2VZKL2X6.mjs";
|
|
4
4
|
import {
|
|
5
5
|
EnumFoodFlavor
|
|
6
|
-
} from "./chunk-
|
|
6
|
+
} from "./chunk-VE6JFCH2.mjs";
|
|
7
7
|
|
|
8
8
|
// src/formFields/vendor/vendor.ts
|
|
9
9
|
var vendorBasicInfoFields = [
|
|
@@ -1952,4 +1952,4 @@ export {
|
|
|
1952
1952
|
contactUsFields,
|
|
1953
1953
|
partnerBasicInfoFields
|
|
1954
1954
|
};
|
|
1955
|
-
//# sourceMappingURL=chunk-
|
|
1955
|
+
//# sourceMappingURL=chunk-AOPQ64JU.mjs.map
|
|
@@ -44,10 +44,11 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
|
44
44
|
var EnumPostType = /* @__PURE__ */ ((EnumPostType2) => {
|
|
45
45
|
EnumPostType2["DAILY_MEETS"] = "daily_meets";
|
|
46
46
|
EnumPostType2["DAILY_TIPS"] = "daily_tips";
|
|
47
|
-
EnumPostType2["
|
|
47
|
+
EnumPostType2["DAILY_GAMES"] = "daily_games";
|
|
48
48
|
return EnumPostType2;
|
|
49
49
|
})(EnumPostType || {});
|
|
50
50
|
var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
|
|
51
|
+
EnumPostContentType2["GAME"] = "game";
|
|
51
52
|
EnumPostContentType2["IMAGE"] = "image";
|
|
52
53
|
EnumPostContentType2["LIST"] = "list";
|
|
53
54
|
EnumPostContentType2["TEXTAREA"] = "textarea";
|
|
@@ -65,4 +66,4 @@ export {
|
|
|
65
66
|
EnumPostType,
|
|
66
67
|
EnumPostContentType
|
|
67
68
|
};
|
|
68
|
-
//# sourceMappingURL=chunk-
|
|
69
|
+
//# sourceMappingURL=chunk-HU2XPJFC.mjs.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/auth.ts","../src/types/ad.ts","../src/types/resourceActivities.ts","../src/types/post.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 { CreateFormData, ResourceImageType } from \"./global\";\n\nexport enum EnumPostType {\n DAILY_MEETS = \"daily_meets\",\n DAILY_TIPS = \"daily_tips\",\n
|
|
1
|
+
{"version":3,"sources":["../src/types/auth.ts","../src/types/ad.ts","../src/types/resourceActivities.ts","../src/types/post.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 { EnumGameType, EnumResourceType } from \"src/enums\";\n\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: {\n title: string;\n gameType: EnumGameType;\n gameInfo: {\n dailyClue?: string; // this is what needs to be found in the daily clue game, like CLUEMART\n };\n gameEndDate?: string; // \"YYYY-MM-DD\" This is the date when the game ends, after this date the game content will not be shown in the post\n };\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"],"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;;;ACJL,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;","names":["EnumVerificationType","EnumAdShowOn","EnumAdStatus","EnumAdType","EnumAdStyle","EnumActivity","EnumPostType","EnumPostContentType"]}
|
|
@@ -166,12 +166,14 @@ var USER_FIELDS_FRAGMENT = gql2`
|
|
|
166
166
|
email
|
|
167
167
|
events
|
|
168
168
|
firstName
|
|
169
|
+
games
|
|
169
170
|
isTester
|
|
170
171
|
lastName
|
|
171
172
|
licences {
|
|
172
173
|
...LicenceFields
|
|
173
174
|
}
|
|
174
175
|
partner
|
|
176
|
+
points
|
|
175
177
|
platform
|
|
176
178
|
preferredRegion
|
|
177
179
|
promoCodes
|
|
@@ -3187,6 +3189,14 @@ import { gql as gql30 } from "@apollo/client";
|
|
|
3187
3189
|
import { gql as gql29 } from "@apollo/client";
|
|
3188
3190
|
var POST_CONTENT_DATA_FIELDS_FRAGMENT = gql29`
|
|
3189
3191
|
fragment PostContentDataFields on PostContentData {
|
|
3192
|
+
game {
|
|
3193
|
+
title
|
|
3194
|
+
gameType
|
|
3195
|
+
gameInfo {
|
|
3196
|
+
dailyClue
|
|
3197
|
+
}
|
|
3198
|
+
gameEndDate
|
|
3199
|
+
}
|
|
3190
3200
|
textarea {
|
|
3191
3201
|
title
|
|
3192
3202
|
data
|
|
@@ -3414,6 +3424,133 @@ var useGetAppSettings = () => {
|
|
|
3414
3424
|
return { appSettings, error, loading, refetch };
|
|
3415
3425
|
};
|
|
3416
3426
|
|
|
3427
|
+
// src/graphql/hooks/game/hooksMutation.ts
|
|
3428
|
+
import { useMutation as useMutation18 } from "@apollo/client";
|
|
3429
|
+
|
|
3430
|
+
// src/graphql/mutations/game.ts
|
|
3431
|
+
import { gql as gql34 } from "@apollo/client";
|
|
3432
|
+
|
|
3433
|
+
// src/graphql/queries/game.ts
|
|
3434
|
+
import { gql as gql33 } from "@apollo/client";
|
|
3435
|
+
var DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT = gql33`
|
|
3436
|
+
fragment DailyClueGameDataFields on DailyClueGameDataType {
|
|
3437
|
+
lastFoundDate
|
|
3438
|
+
streak
|
|
3439
|
+
points
|
|
3440
|
+
collectedLetters
|
|
3441
|
+
gameEndDate
|
|
3442
|
+
}
|
|
3443
|
+
`;
|
|
3444
|
+
var GAME_FIELDS_FRAGMENT = gql33`
|
|
3445
|
+
fragment GameFields on GameType {
|
|
3446
|
+
_id
|
|
3447
|
+
active
|
|
3448
|
+
createdAt
|
|
3449
|
+
deletedAt
|
|
3450
|
+
gameData {
|
|
3451
|
+
dailyClue {
|
|
3452
|
+
...DailyClueGameDataFields
|
|
3453
|
+
}
|
|
3454
|
+
}
|
|
3455
|
+
updatedAt
|
|
3456
|
+
owner {
|
|
3457
|
+
...OwnerFields
|
|
3458
|
+
}
|
|
3459
|
+
}
|
|
3460
|
+
${DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT}
|
|
3461
|
+
${OWNER_FIELDS_FRAGMENT}
|
|
3462
|
+
`;
|
|
3463
|
+
var GET_GAMES = gql33`
|
|
3464
|
+
query getGames($userId: ID) {
|
|
3465
|
+
games(userId: $userId) {
|
|
3466
|
+
...GameFields
|
|
3467
|
+
}
|
|
3468
|
+
}
|
|
3469
|
+
${GAME_FIELDS_FRAGMENT}
|
|
3470
|
+
`;
|
|
3471
|
+
var GET_GAME = gql33`
|
|
3472
|
+
query getGame($_id: ID!) {
|
|
3473
|
+
game(_id: $_id) {
|
|
3474
|
+
...GameFields
|
|
3475
|
+
}
|
|
3476
|
+
}
|
|
3477
|
+
${GAME_FIELDS_FRAGMENT}
|
|
3478
|
+
`;
|
|
3479
|
+
|
|
3480
|
+
// src/graphql/mutations/game.ts
|
|
3481
|
+
var START_GAME_MUTATION = gql34`
|
|
3482
|
+
mutation startGame($input: GameInputType!) {
|
|
3483
|
+
startGame(input: $input) {
|
|
3484
|
+
...GameFields
|
|
3485
|
+
}
|
|
3486
|
+
}
|
|
3487
|
+
${GAME_FIELDS_FRAGMENT}
|
|
3488
|
+
`;
|
|
3489
|
+
var LEAVE_GAME_MUTATION = gql34`
|
|
3490
|
+
mutation leaveGame($_id: ID!) {
|
|
3491
|
+
leaveGame(_id: $_id) {
|
|
3492
|
+
...GameFields
|
|
3493
|
+
}
|
|
3494
|
+
}
|
|
3495
|
+
${GAME_FIELDS_FRAGMENT}
|
|
3496
|
+
`;
|
|
3497
|
+
|
|
3498
|
+
// src/graphql/hooks/game/hooksMutation.ts
|
|
3499
|
+
var useStartGame = () => {
|
|
3500
|
+
const [startGame, { loading, error }] = useMutation18(START_GAME_MUTATION, {
|
|
3501
|
+
awaitRefetchQueries: true,
|
|
3502
|
+
refetchQueries: (mutationResult) => {
|
|
3503
|
+
const gameId = mutationResult?.data?.startGame?._id;
|
|
3504
|
+
if (!gameId) return [];
|
|
3505
|
+
return [
|
|
3506
|
+
{
|
|
3507
|
+
query: GET_GAME,
|
|
3508
|
+
variables: { _id: gameId }
|
|
3509
|
+
// Pass the gameId for refetching
|
|
3510
|
+
}
|
|
3511
|
+
];
|
|
3512
|
+
}
|
|
3513
|
+
});
|
|
3514
|
+
return { error, loading, startGame };
|
|
3515
|
+
};
|
|
3516
|
+
var useLeaveGame = () => {
|
|
3517
|
+
const [leaveGame, { loading, error }] = useMutation18(LEAVE_GAME_MUTATION, {
|
|
3518
|
+
awaitRefetchQueries: true,
|
|
3519
|
+
refetchQueries: (mutationResult) => {
|
|
3520
|
+
const userId = mutationResult?.data?.leaveGame?.userId;
|
|
3521
|
+
if (!userId) return [];
|
|
3522
|
+
return [
|
|
3523
|
+
{
|
|
3524
|
+
query: GET_GAMES,
|
|
3525
|
+
variables: { userId }
|
|
3526
|
+
// Pass the userId for refetching
|
|
3527
|
+
}
|
|
3528
|
+
];
|
|
3529
|
+
}
|
|
3530
|
+
});
|
|
3531
|
+
return { error, leaveGame, loading };
|
|
3532
|
+
};
|
|
3533
|
+
|
|
3534
|
+
// src/graphql/hooks/game/hooksQuery.ts
|
|
3535
|
+
import { useQuery as useQuery13 } from "@apollo/client";
|
|
3536
|
+
var useGetGames = (userId) => {
|
|
3537
|
+
const { loading, error, data, refetch } = useQuery13(GET_GAMES, {
|
|
3538
|
+
fetchPolicy: "network-only",
|
|
3539
|
+
variables: { userId }
|
|
3540
|
+
});
|
|
3541
|
+
const games = data?.games || [];
|
|
3542
|
+
return { error, games, loading, refetch };
|
|
3543
|
+
};
|
|
3544
|
+
var useGetGame = (_id) => {
|
|
3545
|
+
const { loading, error, data, refetch } = useQuery13(GET_GAME, {
|
|
3546
|
+
fetchPolicy: "network-only",
|
|
3547
|
+
skip: !_id,
|
|
3548
|
+
variables: { _id }
|
|
3549
|
+
});
|
|
3550
|
+
const game = data?.game || null;
|
|
3551
|
+
return { error, game, loading, refetch };
|
|
3552
|
+
};
|
|
3553
|
+
|
|
3417
3554
|
export {
|
|
3418
3555
|
useAdminUpdateResourceType,
|
|
3419
3556
|
useAdminResendUserVerificationEmail,
|
|
@@ -3535,6 +3672,10 @@ export {
|
|
|
3535
3672
|
useUpdateAppSettings,
|
|
3536
3673
|
useCrawlGoogleMarkets,
|
|
3537
3674
|
useUpdateGoogleImportedMarkets,
|
|
3538
|
-
useGetAppSettings
|
|
3675
|
+
useGetAppSettings,
|
|
3676
|
+
useStartGame,
|
|
3677
|
+
useLeaveGame,
|
|
3678
|
+
useGetGames,
|
|
3679
|
+
useGetGame
|
|
3539
3680
|
};
|
|
3540
|
-
//# sourceMappingURL=chunk-
|
|
3681
|
+
//# sourceMappingURL=chunk-T6D7HTHH.mjs.map
|