@timardex/cluemart-server-shared 1.1.0 → 1.1.1

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.
@@ -1,7 +1,7 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { RelatedPostType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, SocialShareResourceType, PosterUsageType, RelationType, AffiliateRewardEnumType, AffiliateResourceType, AffiliateType } from '@timardex/cluemart-shared';
2
+ import { RelatedPostType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, SocialShareResourceType, PosterUsageType, RelationType, AffiliateRewardType, AffiliateResourceType, AffiliateType } from '@timardex/cluemart-shared';
3
3
  import mongoose__default from 'mongoose';
4
- import { O as ObjectId } from './Chat-NS-2VVEV.js';
4
+ import { O as ObjectId } from './Chat-Wn7yfc3v.mjs';
5
5
 
6
6
  type SchemaRelatedPostType = Omit<RelatedPostType, "postId"> & {
7
7
  postId: ObjectId;
@@ -372,53 +372,22 @@ declare const RelationModel: mongoose__default.Model<SchemaRelationType, {}, {},
372
372
  __v: number;
373
373
  }, any>;
374
374
 
375
- /** Persistence reward dates are JS Date; GraphQL AffiliateRewardType uses ISO strings. */
376
- type SchemaAffiliateReward = {
377
- createdAt: Date;
378
- redeemedAt?: Date | null;
379
- rewardDescription: string;
380
- rewardType: AffiliateRewardEnumType;
381
- rewardValue: number;
382
- };
383
- type SchemaAffiliateResourceType = Omit<AffiliateResourceType, "resourceDeletedAt" | "resourceId" | "resourceOwner" | "rewards"> & {
384
- resourceDeletedAt?: Date | null;
375
+ type SchemaAffiliateReward = AffiliateRewardType;
376
+ type SchemaAffiliateResourceType = Omit<AffiliateResourceType, "resourceId" | "resourceOwner"> & {
385
377
  resourceId: ObjectId;
386
378
  resourceOwner: SchemaOwnerType;
387
- rewards?: SchemaAffiliateReward[];
388
- };
389
- /** Persistence redeem-history dates are JS Date; GraphQL RedeemHistoryType uses ISO strings. */
390
- type SchemaRedeemHistory = {
391
- paidAt?: Date | null;
392
- redeemedAt: Date;
393
- rewardValue: number;
394
379
  };
395
- /**
396
- * Mongoose affiliate document. GraphQL `Date` is an ISO string at the wire;
397
- * documents store JS Date. Dual-shape vs generated AffiliateType — do not collapse.
398
- */
399
- type SchemaAffiliateType = Omit<AffiliateType, "_id" | "affiliateBonusRewards" | "affiliateResources" | "approvedAt" | "createdAt" | "deletedAt" | "owner" | "redeemHistory" | "updatedAt"> & {
400
- affiliateBonusRewards?: SchemaAffiliateReward[];
380
+ type AffiliateDocument = Omit<AffiliateType, "_id" | "owner" | "affiliateResources"> & {
401
381
  affiliateResources: SchemaAffiliateResourceType[];
402
- approvedAt?: Date | null;
403
- createdAt: Date;
404
- deletedAt?: Date | null;
405
382
  owner: SchemaOwnerType;
406
- redeemHistory?: SchemaRedeemHistory[];
407
- updatedAt: Date;
408
383
  };
409
- declare const AffiliateModel: mongoose__default.Model<SchemaAffiliateType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaAffiliateType, {}, {}> & Omit<AffiliateType, "_id" | "createdAt" | "deletedAt" | "updatedAt" | "approvedAt" | "owner" | "affiliateBonusRewards" | "affiliateResources" | "redeemHistory"> & {
410
- affiliateBonusRewards?: SchemaAffiliateReward[];
384
+ declare const AffiliateModel: mongoose__default.Model<AffiliateDocument, {}, {}, {}, mongoose__default.Document<unknown, {}, AffiliateDocument, {}, {}> & Omit<AffiliateType, "_id" | "owner" | "affiliateResources"> & {
411
385
  affiliateResources: SchemaAffiliateResourceType[];
412
- approvedAt?: Date | null;
413
- createdAt: Date;
414
- deletedAt?: Date | null;
415
386
  owner: SchemaOwnerType;
416
- redeemHistory?: SchemaRedeemHistory[];
417
- updatedAt: Date;
418
387
  } & {
419
388
  _id: mongoose__default.Types.ObjectId;
420
389
  } & {
421
390
  __v: number;
422
391
  }, any>;
423
392
 
424
- export { AffiliateModel as A, CategorySchema as C, OwnerTypeSchema as O, ResourceImageTypeSchema as R, type SchemaOwnerType as S, type SchemaRelatedPostType as a, SocialMediaTypeSchema as b, ContactDetailsSchema as c, dateTimeSchema as d, locationsSchema as e, relatedPostSchema as f, baseResourceFields as g, relationDatesSchema as h, type SchemaRelationType as i, RelationTypeSchema as j, RelationModel as k, locationGeoSchema as l, type SchemaAffiliateReward as m, type SchemaAffiliateResourceType as n, type SchemaAffiliateType as o, resourceRelationsSchema as r, socialShareResourceSchema as s, termsAgreementSchema as t, userLicenseSchema as u };
393
+ export { AffiliateModel as A, CategorySchema as C, OwnerTypeSchema as O, ResourceImageTypeSchema as R, type SchemaOwnerType as S, type SchemaRelatedPostType as a, SocialMediaTypeSchema as b, ContactDetailsSchema as c, dateTimeSchema as d, locationsSchema as e, relatedPostSchema as f, baseResourceFields as g, relationDatesSchema as h, type SchemaRelationType as i, RelationTypeSchema as j, RelationModel as k, locationGeoSchema as l, type SchemaAffiliateReward as m, type SchemaAffiliateResourceType as n, resourceRelationsSchema as r, socialShareResourceSchema as s, termsAgreementSchema as t, userLicenseSchema as u };
@@ -1,7 +1,7 @@
1
1
  import * as _timardex_cluemart_shared from '@timardex/cluemart-shared';
2
- import { RelatedPostType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, SocialShareResourceType, PosterUsageType, RelationType, AffiliateRewardEnumType, AffiliateResourceType, AffiliateType } from '@timardex/cluemart-shared';
2
+ import { RelatedPostType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, SocialShareResourceType, PosterUsageType, RelationType, AffiliateRewardType, AffiliateResourceType, AffiliateType } from '@timardex/cluemart-shared';
3
3
  import mongoose__default from 'mongoose';
4
- import { O as ObjectId } from './Chat-NS-2VVEV.mjs';
4
+ import { O as ObjectId } from './Chat-Wn7yfc3v.js';
5
5
 
6
6
  type SchemaRelatedPostType = Omit<RelatedPostType, "postId"> & {
7
7
  postId: ObjectId;
@@ -372,53 +372,22 @@ declare const RelationModel: mongoose__default.Model<SchemaRelationType, {}, {},
372
372
  __v: number;
373
373
  }, any>;
374
374
 
375
- /** Persistence reward dates are JS Date; GraphQL AffiliateRewardType uses ISO strings. */
376
- type SchemaAffiliateReward = {
377
- createdAt: Date;
378
- redeemedAt?: Date | null;
379
- rewardDescription: string;
380
- rewardType: AffiliateRewardEnumType;
381
- rewardValue: number;
382
- };
383
- type SchemaAffiliateResourceType = Omit<AffiliateResourceType, "resourceDeletedAt" | "resourceId" | "resourceOwner" | "rewards"> & {
384
- resourceDeletedAt?: Date | null;
375
+ type SchemaAffiliateReward = AffiliateRewardType;
376
+ type SchemaAffiliateResourceType = Omit<AffiliateResourceType, "resourceId" | "resourceOwner"> & {
385
377
  resourceId: ObjectId;
386
378
  resourceOwner: SchemaOwnerType;
387
- rewards?: SchemaAffiliateReward[];
388
- };
389
- /** Persistence redeem-history dates are JS Date; GraphQL RedeemHistoryType uses ISO strings. */
390
- type SchemaRedeemHistory = {
391
- paidAt?: Date | null;
392
- redeemedAt: Date;
393
- rewardValue: number;
394
379
  };
395
- /**
396
- * Mongoose affiliate document. GraphQL `Date` is an ISO string at the wire;
397
- * documents store JS Date. Dual-shape vs generated AffiliateType — do not collapse.
398
- */
399
- type SchemaAffiliateType = Omit<AffiliateType, "_id" | "affiliateBonusRewards" | "affiliateResources" | "approvedAt" | "createdAt" | "deletedAt" | "owner" | "redeemHistory" | "updatedAt"> & {
400
- affiliateBonusRewards?: SchemaAffiliateReward[];
380
+ type AffiliateDocument = Omit<AffiliateType, "_id" | "owner" | "affiliateResources"> & {
401
381
  affiliateResources: SchemaAffiliateResourceType[];
402
- approvedAt?: Date | null;
403
- createdAt: Date;
404
- deletedAt?: Date | null;
405
382
  owner: SchemaOwnerType;
406
- redeemHistory?: SchemaRedeemHistory[];
407
- updatedAt: Date;
408
383
  };
409
- declare const AffiliateModel: mongoose__default.Model<SchemaAffiliateType, {}, {}, {}, mongoose__default.Document<unknown, {}, SchemaAffiliateType, {}, {}> & Omit<AffiliateType, "_id" | "createdAt" | "deletedAt" | "updatedAt" | "approvedAt" | "owner" | "affiliateBonusRewards" | "affiliateResources" | "redeemHistory"> & {
410
- affiliateBonusRewards?: SchemaAffiliateReward[];
384
+ declare const AffiliateModel: mongoose__default.Model<AffiliateDocument, {}, {}, {}, mongoose__default.Document<unknown, {}, AffiliateDocument, {}, {}> & Omit<AffiliateType, "_id" | "owner" | "affiliateResources"> & {
411
385
  affiliateResources: SchemaAffiliateResourceType[];
412
- approvedAt?: Date | null;
413
- createdAt: Date;
414
- deletedAt?: Date | null;
415
386
  owner: SchemaOwnerType;
416
- redeemHistory?: SchemaRedeemHistory[];
417
- updatedAt: Date;
418
387
  } & {
419
388
  _id: mongoose__default.Types.ObjectId;
420
389
  } & {
421
390
  __v: number;
422
391
  }, any>;
423
392
 
424
- export { AffiliateModel as A, CategorySchema as C, OwnerTypeSchema as O, ResourceImageTypeSchema as R, type SchemaOwnerType as S, type SchemaRelatedPostType as a, SocialMediaTypeSchema as b, ContactDetailsSchema as c, dateTimeSchema as d, locationsSchema as e, relatedPostSchema as f, baseResourceFields as g, relationDatesSchema as h, type SchemaRelationType as i, RelationTypeSchema as j, RelationModel as k, locationGeoSchema as l, type SchemaAffiliateReward as m, type SchemaAffiliateResourceType as n, type SchemaAffiliateType as o, resourceRelationsSchema as r, socialShareResourceSchema as s, termsAgreementSchema as t, userLicenseSchema as u };
393
+ export { AffiliateModel as A, CategorySchema as C, OwnerTypeSchema as O, ResourceImageTypeSchema as R, type SchemaOwnerType as S, type SchemaRelatedPostType as a, SocialMediaTypeSchema as b, ContactDetailsSchema as c, dateTimeSchema as d, locationsSchema as e, relatedPostSchema as f, baseResourceFields as g, relationDatesSchema as h, type SchemaRelationType as i, RelationTypeSchema as j, RelationModel as k, locationGeoSchema as l, type SchemaAffiliateReward as m, type SchemaAffiliateResourceType as n, resourceRelationsSchema as r, socialShareResourceSchema as s, termsAgreementSchema as t, userLicenseSchema as u };
@@ -1,4 +1,4 @@
1
- import { CreateBulkNotificationInput, NotificationType, UserRoleEnumType, ChatMessageType, ChatParticipantType, ChatType } from '@timardex/cluemart-shared';
1
+ import { CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType } from '@timardex/cluemart-shared';
2
2
  import mongoose__default from 'mongoose';
3
3
  import { NotificationCount } from '@timardex/cluemart-shared/types';
4
4
  import express from 'express';
@@ -26,7 +26,7 @@ declare enum EnumPubSubEvents {
26
26
  }
27
27
  interface AuthUser {
28
28
  email: string;
29
- roles: UserRoleEnumType[];
29
+ roles: EnumUserRole[];
30
30
  userId: ObjectId;
31
31
  }
32
32
  interface SubscriptionPayload {
@@ -52,12 +52,10 @@ interface GraphQLContext {
52
52
  type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
53
53
  senderId: ObjectId;
54
54
  };
55
- type SchemaChatMessageReactionType = Omit<NonNullable<NonNullable<ChatMessageType["likedBy"]>[number]>, "userId" | "createdAt"> & {
56
- createdAt: Date;
55
+ type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
57
56
  userId: ObjectId;
58
57
  };
59
- type SchemaChatMessageSeenType = Omit<NonNullable<NonNullable<ChatMessageType["seenBy"]>[number]>, "userId" | "seenAt"> & {
60
- seenAt: Date;
58
+ type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"> & {
61
59
  userId: ObjectId;
62
60
  };
63
61
  type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
@@ -67,7 +65,7 @@ type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageI
67
65
  likedBy?: SchemaChatMessageReactionType[];
68
66
  seenBy?: SchemaChatMessageSeenType[];
69
67
  };
70
- type SchemaParticipantType = Omit<ChatParticipantType, "userId"> & {
68
+ type SchemaParticipantType = Omit<ParticipantType, "userId"> & {
71
69
  userId: ObjectId;
72
70
  };
73
71
  type SchemaChatType = Omit<ChatType, "participants" | "messages"> & {
@@ -1,4 +1,4 @@
1
- import { CreateBulkNotificationInput, NotificationType, UserRoleEnumType, ChatMessageType, ChatParticipantType, ChatType } from '@timardex/cluemart-shared';
1
+ import { CreateBulkNotificationInput, NotificationType, EnumUserRole, ChatMessageType, ParticipantType, ChatType } from '@timardex/cluemart-shared';
2
2
  import mongoose__default from 'mongoose';
3
3
  import { NotificationCount } from '@timardex/cluemart-shared/types';
4
4
  import express from 'express';
@@ -26,7 +26,7 @@ declare enum EnumPubSubEvents {
26
26
  }
27
27
  interface AuthUser {
28
28
  email: string;
29
- roles: UserRoleEnumType[];
29
+ roles: EnumUserRole[];
30
30
  userId: ObjectId;
31
31
  }
32
32
  interface SubscriptionPayload {
@@ -52,12 +52,10 @@ interface GraphQLContext {
52
52
  type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
53
53
  senderId: ObjectId;
54
54
  };
55
- type SchemaChatMessageReactionType = Omit<NonNullable<NonNullable<ChatMessageType["likedBy"]>[number]>, "userId" | "createdAt"> & {
56
- createdAt: Date;
55
+ type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
57
56
  userId: ObjectId;
58
57
  };
59
- type SchemaChatMessageSeenType = Omit<NonNullable<NonNullable<ChatMessageType["seenBy"]>[number]>, "userId" | "seenAt"> & {
60
- seenAt: Date;
58
+ type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number], "userId"> & {
61
59
  userId: ObjectId;
62
60
  };
63
61
  type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
@@ -67,7 +65,7 @@ type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageI
67
65
  likedBy?: SchemaChatMessageReactionType[];
68
66
  seenBy?: SchemaChatMessageSeenType[];
69
67
  };
70
- type SchemaParticipantType = Omit<ChatParticipantType, "userId"> & {
68
+ type SchemaParticipantType = Omit<ParticipantType, "userId"> & {
71
69
  userId: ObjectId;
72
70
  };
73
71
  type SchemaChatType = Omit<ChatType, "participants" | "messages"> & {
@@ -14,4 +14,4 @@ export {
14
14
  mongoose,
15
15
  EnumPubSubEvents
16
16
  };
17
- //# sourceMappingURL=chunk-RU5PTSIO.mjs.map
17
+ //# sourceMappingURL=chunk-6PNG5BI5.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"sources":["../src/types/index.ts"],"sourcesContent":["import { EnumUserRole } from \"@timardex/cluemart-shared\";\nimport { NotificationCount } from \"@timardex/cluemart-shared/types\";\nimport express from \"express\";\nimport mongoose from \"mongoose\";\n\nimport { SchemaChatType } from \"../mongoose/chat/Chat\";\nimport { SchemaNotificationType } from \"../mongoose/Notification\";\n\n// chnage to export type ObjectId = mongoose.Types.ObjectId;\n// chnage in server when setting decideGameType\nexport type ObjectId = mongoose.Types.ObjectId;\n\nexport enum EnumPubSubEvents {\n GET_CHAT_MESSAGE = \"GET_CHAT_MESSAGE\",\n GET_NOTIFICATIONS = \"GET_NOTIFICATIONS\",\n GET_NOTIFICATIONS_COUNT = \"GET_NOTIFICATIONS_COUNT\",\n USER_TYPING = \"USER_TYPING\",\n}\n\nexport interface AuthUser {\n email: string;\n roles: EnumUserRole[];\n userId: ObjectId;\n}\n\nexport interface SubscriptionPayload {\n getChatMessage?: SchemaChatType;\n userTyping?: SchemaChatType; // NOT USED\n getNotifications?: SchemaNotificationType[];\n // Used only for filtering; not part of the GraphQL schema output\n getNotificationsUserId?: ObjectId;\n getNotificationsCount?: NotificationCount & { userId: ObjectId };\n}\n\nexport interface GraphQLContext {\n appVersion: string | null;\n user: AuthUser | null;\n pubsub: {\n publish: (\n eventName: EnumPubSubEvents,\n payload: SubscriptionPayload,\n ) => void;\n subscribe: (eventName: EnumPubSubEvents) => AsyncIterable<any>;\n };\n request: express.Request;\n response: express.Response;\n}\n\nexport { mongoose, express };\n"],"mappings":";AAEA,OAAO,aAAa;AACpB,OAAO,cAAc;AASd,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,sBAAmB;AACnB,EAAAA,kBAAA,uBAAoB;AACpB,EAAAA,kBAAA,6BAA0B;AAC1B,EAAAA,kBAAA,iBAAc;AAJJ,SAAAA;AAAA,GAAA;","names":["EnumPubSubEvents"]}