@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.
- package/dist/{Affiliate-CtH6MdT3.d.ts → Affiliate-B76iZ3fE.d.mts} +7 -38
- package/dist/{Affiliate-DaFyIRHK.d.mts → Affiliate-gqV1-654.d.ts} +7 -38
- package/dist/{Chat-NS-2VVEV.d.mts → Chat-Wn7yfc3v.d.mts} +5 -7
- package/dist/{Chat-NS-2VVEV.d.ts → Chat-Wn7yfc3v.d.ts} +5 -7
- package/dist/{chunk-RU5PTSIO.mjs → chunk-6PNG5BI5.mjs} +1 -1
- package/dist/chunk-6PNG5BI5.mjs.map +1 -0
- package/dist/{chunk-Z22PTYAL.mjs → chunk-YI7Y4K2J.mjs} +2202 -2874
- package/dist/chunk-YI7Y4K2J.mjs.map +1 -0
- package/dist/index.cjs +2232 -3020
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +66 -213
- package/dist/index.d.ts +66 -213
- package/dist/index.mjs +2232 -3020
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +2140 -2864
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +56 -163
- package/dist/mongoose/index.d.ts +56 -163
- package/dist/mongoose/index.mjs +1 -1
- package/dist/service/index.cjs +2232 -3020
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +10 -17
- package/dist/service/index.d.ts +10 -17
- package/dist/service/index.mjs +59 -167
- 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-RU5PTSIO.mjs.map +0 -1
- package/dist/chunk-Z22PTYAL.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, AffiliateRewardType, 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-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
|
-
|
|
376
|
-
type
|
|
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<
|
|
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,
|
|
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,
|
|
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-
|
|
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
|
-
|
|
376
|
-
type
|
|
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<
|
|
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,
|
|
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,
|
|
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:
|
|
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<
|
|
56
|
-
createdAt: Date;
|
|
55
|
+
type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
|
|
57
56
|
userId: ObjectId;
|
|
58
57
|
};
|
|
59
|
-
type SchemaChatMessageSeenType = Omit<NonNullable<
|
|
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<
|
|
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,
|
|
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:
|
|
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<
|
|
56
|
-
createdAt: Date;
|
|
55
|
+
type SchemaChatMessageReactionType = Omit<NonNullable<ChatMessageType["likedBy"]>[number], "userId"> & {
|
|
57
56
|
userId: ObjectId;
|
|
58
57
|
};
|
|
59
|
-
type SchemaChatMessageSeenType = Omit<NonNullable<
|
|
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<
|
|
68
|
+
type SchemaParticipantType = Omit<ParticipantType, "userId"> & {
|
|
71
69
|
userId: ObjectId;
|
|
72
70
|
};
|
|
73
71
|
type SchemaChatType = Omit<ChatType, "participants" | "messages"> & {
|
|
@@ -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"]}
|