@timardex/cluemart-server-shared 1.0.128 → 1.0.130

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/index.d.mts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, CreateBulkNotificationInput, NotificationType, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, ResourceContactDetailsType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType } from '@timardex/cluemart-shared';
2
+ import { AdType, CreateBulkNotificationInput, NotificationType, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, ResourceContactDetailsType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType, EnumUserLicence } from '@timardex/cluemart-shared';
3
3
  import mongoose from 'mongoose';
4
4
  export { default as mongoose } from 'mongoose';
5
5
  import { NotificationCount } from '@timardex/cluemart-shared/types';
@@ -673,10 +673,10 @@ declare function updateAdStatuses(): Promise<void>;
673
673
  * If the user has a Pro Vendor license, they can have multiple associates and access to all availability types.
674
674
  * If they have a Standard Vendor license, their associates are removed and availability is restricted.
675
675
  * @param userId
676
- * @param licenceObject
676
+ * @param licenceType
677
677
  * @returns
678
678
  */
679
- declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceObject: UserLicenceType): Promise<void>;
679
+ declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: EnumUserLicence): Promise<void>;
680
680
 
681
681
  /**
682
682
  * Recursively converts all ObjectId fields to strings in an object
package/dist/index.d.ts CHANGED
@@ -1,5 +1,5 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { AdType, CreateBulkNotificationInput, NotificationType, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, ResourceContactDetailsType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType } from '@timardex/cluemart-shared';
2
+ import { AdType, CreateBulkNotificationInput, NotificationType, ChatMessageType, ParticipantType, ChatType, ReportChatUser, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, AssociateType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, ResourceContactDetailsType, PosterUsageType, GoogleImportedMarket, RelationType, ResourceActivityType, UserActivityEvent, UserType, VendorType, VendorInfoType, EventType, StallType, RefundPolicy, EventInfoType, PartnerType, PostType, PostContentType, AppSettingsType, GameType, EnumUserLicence } from '@timardex/cluemart-shared';
3
3
  import mongoose from 'mongoose';
4
4
  export { default as mongoose } from 'mongoose';
5
5
  import { NotificationCount } from '@timardex/cluemart-shared/types';
@@ -673,10 +673,10 @@ declare function updateAdStatuses(): Promise<void>;
673
673
  * If the user has a Pro Vendor license, they can have multiple associates and access to all availability types.
674
674
  * If they have a Standard Vendor license, their associates are removed and availability is restricted.
675
675
  * @param userId
676
- * @param licenceObject
676
+ * @param licenceType
677
677
  * @returns
678
678
  */
679
- declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceObject: UserLicenceType): Promise<void>;
679
+ declare function updateVendorBasedOnUserLicense(userId: ObjectId, licenceType: EnumUserLicence): Promise<void>;
680
680
 
681
681
  /**
682
682
  * Recursively converts all ObjectId fields to strings in an object
package/dist/index.mjs CHANGED
@@ -9858,12 +9858,24 @@ var DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT = gql`
9858
9858
  collected
9859
9859
  shuffled
9860
9860
  todaysLetter
9861
+ todaysClue
9861
9862
  todaysPlacement
9862
9863
  }
9863
9864
  streak
9864
9865
  }
9865
9866
  ${BASE_GAME_FIELDS_FRAGMENT}
9866
9867
  `;
9868
+ var GAME_HISTORY_FIELDS_FRAGMENT = gql`
9869
+ fragment GameHistoryFields on GameHistoryType {
9870
+ gameDate {
9871
+ ...GameDateFields
9872
+ }
9873
+ gameStatus
9874
+ gameType
9875
+ pointsEarned
9876
+ }
9877
+ ${GAME_DATE_FIELDS_FRAGMENT}
9878
+ `;
9867
9879
  var GAME_FIELDS_FRAGMENT = gql`
9868
9880
  fragment GameFields on GameType {
9869
9881
  _id
@@ -9876,11 +9888,7 @@ var GAME_FIELDS_FRAGMENT = gql`
9876
9888
  }
9877
9889
  }
9878
9890
  gameHistory {
9879
- gameDate {
9880
- ...GameDateFields
9881
- }
9882
- gameType
9883
- pointsEarned
9891
+ ...GameHistoryFields
9884
9892
  }
9885
9893
  updatedAt
9886
9894
  owner {
@@ -9891,6 +9899,7 @@ var GAME_FIELDS_FRAGMENT = gql`
9891
9899
  ${DAILY_CLUE_GAME_DATA_FIELDS_FRAGMENT}
9892
9900
  ${OWNER_FIELDS_FRAGMENT}
9893
9901
  ${GAME_DATE_FIELDS_FRAGMENT}
9902
+ ${GAME_HISTORY_FIELDS_FRAGMENT}
9894
9903
  `;
9895
9904
  var GET_GAMES = gql`
9896
9905
  query getGames {
@@ -9908,6 +9917,21 @@ var GET_GAME = gql`
9908
9917
  }
9909
9918
  ${GAME_FIELDS_FRAGMENT}
9910
9919
  `;
9920
+ var GET_GAME_LEADERBOARD = gql`
9921
+ query getGameLeaderboard {
9922
+ gameLeaderboard {
9923
+ gameHistory {
9924
+ ...GameHistoryFields
9925
+ }
9926
+ overallPoints
9927
+ owner {
9928
+ ...OwnerFields
9929
+ }
9930
+ }
9931
+ }
9932
+ ${OWNER_FIELDS_FRAGMENT}
9933
+ ${GAME_HISTORY_FIELDS_FRAGMENT}
9934
+ `;
9911
9935
  var POST_CONTENT_DATA_FIELDS_FRAGMENT = gql`
9912
9936
  fragment PostContentDataFields on PostContentData {
9913
9937
  game {
@@ -10699,6 +10723,11 @@ var EnumGameType = /* @__PURE__ */ ((EnumGameType2) => {
10699
10723
  EnumGameType2["DAILY_CLUE"] = "dailyClue";
10700
10724
  return EnumGameType2;
10701
10725
  })(EnumGameType || {});
10726
+ var EnumGameStatus = /* @__PURE__ */ ((EnumGameStatus2) => {
10727
+ EnumGameStatus2["GAME_COMPLETED"] = "GAME_COMPLETED";
10728
+ EnumGameStatus2["GAME_LEFT"] = "GAME_LEFT";
10729
+ return EnumGameStatus2;
10730
+ })(EnumGameStatus || {});
10702
10731
 
10703
10732
  // src/mongoose/Ad.ts
10704
10733
  import mongoose from "mongoose";
@@ -11989,6 +12018,11 @@ var gameDataDefinition = Object.fromEntries(
11989
12018
  var gameHistorySchema = new MongooseSchema19(
11990
12019
  {
11991
12020
  gameDate: { required: true, type: schemaGameDate },
12021
+ gameStatus: {
12022
+ enum: Object.values(EnumGameStatus),
12023
+ required: true,
12024
+ type: String
12025
+ },
11992
12026
  gameType: {
11993
12027
  enum: Object.values(EnumGameType),
11994
12028
  required: true,
@@ -12207,7 +12241,7 @@ async function updateAdStatuses() {
12207
12241
  }
12208
12242
 
12209
12243
  // src/service/vendor.ts
12210
- async function updateVendorBasedOnUserLicense(userId, licenceObject) {
12244
+ async function updateVendorBasedOnUserLicense(userId, licenceType) {
12211
12245
  try {
12212
12246
  const user = await UserModel.findById(userId).exec();
12213
12247
  if (!user) {
@@ -12217,7 +12251,7 @@ async function updateVendorBasedOnUserLicense(userId, licenceObject) {
12217
12251
  if (!userVendor) {
12218
12252
  return;
12219
12253
  }
12220
- const selectedLicence = licenceObject.licenceType;
12254
+ const selectedLicence = licenceType;
12221
12255
  if (selectedLicence === void 0) {
12222
12256
  return;
12223
12257
  }