@timardex/cluemart-server-shared 1.0.310 → 1.1.0
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/{Affiliate-B76iZ3fE.d.mts → Affiliate-CtH6MdT3.d.ts} +38 -7
- package/dist/{Affiliate-gqV1-654.d.ts → Affiliate-DaFyIRHK.d.mts} +38 -7
- package/dist/{Chat-Wn7yfc3v.d.mts → Chat-NS-2VVEV.d.mts} +7 -5
- package/dist/{Chat-Wn7yfc3v.d.ts → Chat-NS-2VVEV.d.ts} +7 -5
- package/dist/{chunk-6PNG5BI5.mjs → chunk-RU5PTSIO.mjs} +1 -1
- package/dist/chunk-RU5PTSIO.mjs.map +1 -0
- package/dist/{chunk-U5ER6XDO.mjs → chunk-Z22PTYAL.mjs} +3184 -2276
- package/dist/chunk-Z22PTYAL.mjs.map +1 -0
- package/dist/index.cjs +3304 -2280
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +213 -66
- package/dist/index.d.ts +213 -66
- package/dist/index.mjs +3304 -2280
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +3174 -2214
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +163 -56
- package/dist/mongoose/index.d.ts +163 -56
- package/dist/mongoose/index.mjs +1 -1
- package/dist/service/index.cjs +3304 -2280
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +17 -10
- package/dist/service/index.d.ts +17 -10
- package/dist/service/index.mjs +167 -59
- package/dist/service/index.mjs.map +1 -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 +2 -2
- package/dist/chunk-6PNG5BI5.mjs.map +0 -1
- package/dist/chunk-U5ER6XDO.mjs.map +0 -1
|
@@ -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,
|
|
2
|
+
import { RelatedPostType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, SocialShareResourceType, PosterUsageType, RelationType, AffiliateRewardEnumType, AffiliateResourceType, AffiliateType } from '@timardex/cluemart-shared';
|
|
3
3
|
import mongoose__default from 'mongoose';
|
|
4
|
-
import { O as ObjectId } from './Chat-
|
|
4
|
+
import { O as ObjectId } from './Chat-NS-2VVEV.js';
|
|
5
5
|
|
|
6
6
|
type SchemaRelatedPostType = Omit<RelatedPostType, "postId"> & {
|
|
7
7
|
postId: ObjectId;
|
|
@@ -372,22 +372,53 @@ declare const RelationModel: mongoose__default.Model<SchemaRelationType, {}, {},
|
|
|
372
372
|
__v: number;
|
|
373
373
|
}, any>;
|
|
374
374
|
|
|
375
|
-
|
|
376
|
-
type
|
|
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;
|
|
377
385
|
resourceId: ObjectId;
|
|
378
386
|
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;
|
|
379
394
|
};
|
|
380
|
-
|
|
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[];
|
|
381
401
|
affiliateResources: SchemaAffiliateResourceType[];
|
|
402
|
+
approvedAt?: Date | null;
|
|
403
|
+
createdAt: Date;
|
|
404
|
+
deletedAt?: Date | null;
|
|
382
405
|
owner: SchemaOwnerType;
|
|
406
|
+
redeemHistory?: SchemaRedeemHistory[];
|
|
407
|
+
updatedAt: Date;
|
|
383
408
|
};
|
|
384
|
-
declare const AffiliateModel: mongoose__default.Model<
|
|
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[];
|
|
385
411
|
affiliateResources: SchemaAffiliateResourceType[];
|
|
412
|
+
approvedAt?: Date | null;
|
|
413
|
+
createdAt: Date;
|
|
414
|
+
deletedAt?: Date | null;
|
|
386
415
|
owner: SchemaOwnerType;
|
|
416
|
+
redeemHistory?: SchemaRedeemHistory[];
|
|
417
|
+
updatedAt: Date;
|
|
387
418
|
} & {
|
|
388
419
|
_id: mongoose__default.Types.ObjectId;
|
|
389
420
|
} & {
|
|
390
421
|
__v: number;
|
|
391
422
|
}, any>;
|
|
392
423
|
|
|
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 };
|
|
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 };
|
|
@@ -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,
|
|
2
|
+
import { RelatedPostType, OwnerType, SocialMediaType, ResourceImageType, Category, UserLicenceType, ResourceContactDetailsType, TermsAgreement, RelationDate, DateTimeType, LocationGeoType, LocationType, SocialShareResourceType, PosterUsageType, RelationType, AffiliateRewardEnumType, AffiliateResourceType, AffiliateType } from '@timardex/cluemart-shared';
|
|
3
3
|
import mongoose__default from 'mongoose';
|
|
4
|
-
import { O as ObjectId } from './Chat-
|
|
4
|
+
import { O as ObjectId } from './Chat-NS-2VVEV.mjs';
|
|
5
5
|
|
|
6
6
|
type SchemaRelatedPostType = Omit<RelatedPostType, "postId"> & {
|
|
7
7
|
postId: ObjectId;
|
|
@@ -372,22 +372,53 @@ declare const RelationModel: mongoose__default.Model<SchemaRelationType, {}, {},
|
|
|
372
372
|
__v: number;
|
|
373
373
|
}, any>;
|
|
374
374
|
|
|
375
|
-
|
|
376
|
-
type
|
|
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;
|
|
377
385
|
resourceId: ObjectId;
|
|
378
386
|
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;
|
|
379
394
|
};
|
|
380
|
-
|
|
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[];
|
|
381
401
|
affiliateResources: SchemaAffiliateResourceType[];
|
|
402
|
+
approvedAt?: Date | null;
|
|
403
|
+
createdAt: Date;
|
|
404
|
+
deletedAt?: Date | null;
|
|
382
405
|
owner: SchemaOwnerType;
|
|
406
|
+
redeemHistory?: SchemaRedeemHistory[];
|
|
407
|
+
updatedAt: Date;
|
|
383
408
|
};
|
|
384
|
-
declare const AffiliateModel: mongoose__default.Model<
|
|
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[];
|
|
385
411
|
affiliateResources: SchemaAffiliateResourceType[];
|
|
412
|
+
approvedAt?: Date | null;
|
|
413
|
+
createdAt: Date;
|
|
414
|
+
deletedAt?: Date | null;
|
|
386
415
|
owner: SchemaOwnerType;
|
|
416
|
+
redeemHistory?: SchemaRedeemHistory[];
|
|
417
|
+
updatedAt: Date;
|
|
387
418
|
} & {
|
|
388
419
|
_id: mongoose__default.Types.ObjectId;
|
|
389
420
|
} & {
|
|
390
421
|
__v: number;
|
|
391
422
|
}, any>;
|
|
392
423
|
|
|
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 };
|
|
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 };
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateBulkNotificationInput, NotificationType,
|
|
1
|
+
import { CreateBulkNotificationInput, NotificationType, UserRoleEnumType, ChatMessageType, ChatParticipantType, 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:
|
|
29
|
+
roles: UserRoleEnumType[];
|
|
30
30
|
userId: ObjectId;
|
|
31
31
|
}
|
|
32
32
|
interface SubscriptionPayload {
|
|
@@ -52,10 +52,12 @@ interface GraphQLContext {
|
|
|
52
52
|
type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
|
|
53
53
|
senderId: ObjectId;
|
|
54
54
|
};
|
|
55
|
-
type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number]
|
|
55
|
+
type SchemaChatMessageReactionType = Omit<NonNullable<NonNullable<ChatMessageType["likedBy"]>[number]>, "userId" | "createdAt"> & {
|
|
56
|
+
createdAt: Date;
|
|
56
57
|
userId: ObjectId;
|
|
57
58
|
};
|
|
58
|
-
type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number]
|
|
59
|
+
type SchemaChatMessageSeenType = Omit<NonNullable<NonNullable<ChatMessageType["seenBy"]>[number]>, "userId" | "seenAt"> & {
|
|
60
|
+
seenAt: Date;
|
|
59
61
|
userId: ObjectId;
|
|
60
62
|
};
|
|
61
63
|
type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
|
|
@@ -65,7 +67,7 @@ type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageI
|
|
|
65
67
|
likedBy?: SchemaChatMessageReactionType[];
|
|
66
68
|
seenBy?: SchemaChatMessageSeenType[];
|
|
67
69
|
};
|
|
68
|
-
type SchemaParticipantType = Omit<
|
|
70
|
+
type SchemaParticipantType = Omit<ChatParticipantType, "userId"> & {
|
|
69
71
|
userId: ObjectId;
|
|
70
72
|
};
|
|
71
73
|
type SchemaChatType = Omit<ChatType, "participants" | "messages"> & {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { CreateBulkNotificationInput, NotificationType,
|
|
1
|
+
import { CreateBulkNotificationInput, NotificationType, UserRoleEnumType, ChatMessageType, ChatParticipantType, 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:
|
|
29
|
+
roles: UserRoleEnumType[];
|
|
30
30
|
userId: ObjectId;
|
|
31
31
|
}
|
|
32
32
|
interface SubscriptionPayload {
|
|
@@ -52,10 +52,12 @@ interface GraphQLContext {
|
|
|
52
52
|
type SchemaChatMessageReplyPreviewType = Omit<NonNullable<ChatMessageType["replyPreview"]>, "senderId"> & {
|
|
53
53
|
senderId: ObjectId;
|
|
54
54
|
};
|
|
55
|
-
type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number]
|
|
55
|
+
type SchemaChatMessageReactionType = Omit<NonNullable<NonNullable<ChatMessageType["likedBy"]>[number]>, "userId" | "createdAt"> & {
|
|
56
|
+
createdAt: Date;
|
|
56
57
|
userId: ObjectId;
|
|
57
58
|
};
|
|
58
|
-
type SchemaChatMessageSeenType = Omit<NonNullable<ChatMessageType["seenBy"]>[number]
|
|
59
|
+
type SchemaChatMessageSeenType = Omit<NonNullable<NonNullable<ChatMessageType["seenBy"]>[number]>, "userId" | "seenAt"> & {
|
|
60
|
+
seenAt: Date;
|
|
59
61
|
userId: ObjectId;
|
|
60
62
|
};
|
|
61
63
|
type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageId" | "replyPreview" | "likedBy" | "seenBy"> & {
|
|
@@ -65,7 +67,7 @@ type SchemaChatMessageType = Omit<ChatMessageType, "senderId" | "replyToMessageI
|
|
|
65
67
|
likedBy?: SchemaChatMessageReactionType[];
|
|
66
68
|
seenBy?: SchemaChatMessageSeenType[];
|
|
67
69
|
};
|
|
68
|
-
type SchemaParticipantType = Omit<
|
|
70
|
+
type SchemaParticipantType = Omit<ChatParticipantType, "userId"> & {
|
|
69
71
|
userId: ObjectId;
|
|
70
72
|
};
|
|
71
73
|
type SchemaChatType = Omit<ChatType, "participants" | "messages"> & {
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/types/index.ts"],"sourcesContent":["import { UserRoleEnumType } 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: UserRoleEnumType[];\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"]}
|