@timardex/cluemart-shared 1.2.30 → 1.2.32
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/{ad-C02AZIGy.d.ts → ad-Cv1V8lgJ.d.ts} +1 -1
- package/dist/{ad-CTWMmc7b.d.mts → ad-IVwm5MLY.d.mts} +1 -1
- package/dist/{auth-o_ns6gLk.d.ts → auth-BCxQp_CF.d.ts} +1 -1
- package/dist/{auth-YsJJnj12.d.mts → auth-BczaOu28.d.mts} +1 -1
- package/dist/{chunk-BO3HICLR.mjs → chunk-4OLDTZXH.mjs} +3 -1
- package/dist/chunk-4OLDTZXH.mjs.map +1 -0
- package/dist/{chunk-O6LVIQFK.mjs → chunk-NPHPFWQH.mjs} +3 -6
- package/dist/chunk-NPHPFWQH.mjs.map +1 -0
- package/dist/formFields/index.d.mts +2 -1
- package/dist/formFields/index.d.ts +2 -1
- package/dist/{global-4lS-fh61.d.ts → global-Bnr6l_NH.d.ts} +1 -0
- package/dist/{global-_ZHkOcnR.d.mts → global-_89-F0iL.d.mts} +1 -0
- package/dist/graphql/index.d.mts +3 -2
- package/dist/graphql/index.d.ts +3 -2
- package/dist/hooks/index.d.mts +4 -3
- package/dist/hooks/index.d.ts +4 -3
- package/dist/index.cjs +78 -84
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +11 -11
- package/dist/index.d.ts +11 -11
- package/dist/index.mjs +77 -84
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +65 -77
- package/dist/mongoose/index.cjs.map +1 -1
- package/dist/mongoose/index.d.mts +6 -13
- package/dist/mongoose/index.d.ts +6 -13
- package/dist/mongoose/index.mjs +13 -25
- package/dist/mongoose/index.mjs.map +1 -1
- package/dist/service/index.cjs +18 -12
- package/dist/service/index.cjs.map +1 -1
- package/dist/service/index.d.mts +9 -2
- package/dist/service/index.d.ts +9 -2
- package/dist/service/index.mjs +12 -6
- package/dist/service/index.mjs.map +1 -1
- package/dist/types/index.cjs +15 -2
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +5 -4
- package/dist/types/index.d.ts +5 -4
- package/dist/types/index.mjs +5 -3
- package/dist/utils/index.d.mts +2 -1
- package/dist/utils/index.d.ts +2 -1
- package/package.json +3 -1
- package/dist/chunk-BO3HICLR.mjs.map +0 -1
- package/dist/chunk-O6LVIQFK.mjs.map +0 -1
package/dist/types/index.cjs
CHANGED
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __create = Object.create;
|
|
2
3
|
var __defProp = Object.defineProperty;
|
|
3
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
5
|
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
6
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
5
7
|
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
8
|
var __export = (target, all) => {
|
|
7
9
|
for (var name in all)
|
|
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
|
|
|
15
17
|
}
|
|
16
18
|
return to;
|
|
17
19
|
};
|
|
20
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
|
|
21
|
+
// If the importer is in node compatibility mode or this is not an ESM
|
|
22
|
+
// file that has been converted to a CommonJS file using a Babel-
|
|
23
|
+
// compatible transform (i.e. "__esModule" has not been set), then set
|
|
24
|
+
// "default" to the CommonJS "module.exports" for node compatibility.
|
|
25
|
+
isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
|
|
26
|
+
mod
|
|
27
|
+
));
|
|
18
28
|
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
29
|
|
|
20
30
|
// src/types/index.ts
|
|
@@ -25,11 +35,13 @@ __export(types_exports, {
|
|
|
25
35
|
EnumAdStatus: () => EnumAdStatus,
|
|
26
36
|
EnumAdStyle: () => EnumAdStyle,
|
|
27
37
|
EnumAdType: () => EnumAdType,
|
|
28
|
-
EnumPubSubEvents: () => EnumPubSubEvents
|
|
38
|
+
EnumPubSubEvents: () => EnumPubSubEvents,
|
|
39
|
+
mongoose: () => import_mongoose.default
|
|
29
40
|
});
|
|
30
41
|
module.exports = __toCommonJS(types_exports);
|
|
31
42
|
|
|
32
43
|
// src/types/global.ts
|
|
44
|
+
var import_mongoose = __toESM(require("mongoose"));
|
|
33
45
|
var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
34
46
|
EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
|
|
35
47
|
EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
|
|
@@ -78,6 +90,7 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
|
78
90
|
EnumAdStatus,
|
|
79
91
|
EnumAdStyle,
|
|
80
92
|
EnumAdType,
|
|
81
|
-
EnumPubSubEvents
|
|
93
|
+
EnumPubSubEvents,
|
|
94
|
+
mongoose
|
|
82
95
|
});
|
|
83
96
|
//# sourceMappingURL=index.cjs.map
|
package/dist/types/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts","../../src/types/global.ts","../../src/types/ad.ts","../../src/types/resourceActivities.ts"],"sourcesContent":["export * from \"./admin\";\nexport * from \"./auth\";\nexport * from \"./chat\";\nexport * from \"./contactUs\";\nexport * from \"./global\";\nexport * from \"./event\";\nexport * from \"./notification\";\nexport * from \"./poster\";\nexport * from \"./relation\";\nexport * from \"./vendor\";\nexport * from \"./testers\";\nexport * from \"./user\";\nexport * from \"./ad\";\nexport * from \"./resourceActivities\";\n","import mongoose from \"mongoose\";\nimport {\n Control,\n FieldErrors,\n FieldValues,\n UseFormHandleSubmit,\n UseFormReset,\n UseFormSetValue,\n UseFormWatch,\n} from \"react-hook-form\";\n\nimport { SchemaChatType } from \"src/mongoose/Chat\";\nimport { SchemaNotificationType } from \"src/mongoose/Notification\";\n\nimport { EnumResourceType, EnumSocialMedia, EnumUserLicence } from \"../enums\";\n\nimport { EventType } from \"./event\";\nimport { NotificationCount } from \"./notification\";\nimport { RelationDate } from \"./relation\";\nimport { VendorType } from \"./vendor\";\n\nexport type Nullable<T> = {\n [K in keyof T]: T[K] | null | undefined;\n};\n\nexport type DeviceInfo = {\n appBuildNumber: string;\n appId: string;\n appVersion: string;\n brand: string;\n deviceName: string;\n installationId: string;\n manufacturer: string;\n modelName: string;\n osName: string;\n osVersion: string;\n timestamp: string;\n};\n\nexport type TermsAgreement = DeviceInfo & {\n termVersion: string;\n};\n\nexport type ResourceContactDetailsType = {\n email?: string | null;\n landlinePhone?: string | null;\n mobilePhone?: string | null;\n};\n\nexport type ResourceImageType = {\n source: string;\n title: string;\n};\n\nexport type SocialMediaType = {\n name?: EnumSocialMedia;\n link?: string;\n};\n\nexport type PartnerType = {\n email: string;\n resourceId: string;\n resourceType: EnumResourceType;\n licence: EnumUserLicence;\n};\n\nexport type OwnerType = {\n email: string;\n userId: string;\n};\n\nexport interface BaseResourceTypeFormData {\n _id?: string;\n active: boolean;\n contactDetails?: ResourceContactDetailsType | null;\n cover: ResourceImageType;\n coverUpload?: ResourceImageType | null;\n description: string;\n images?: ResourceImageType[] | null;\n imagesUpload?: ResourceImageType[] | null;\n logo?: ResourceImageType | null;\n logoUpload?: ResourceImageType | null;\n name: string;\n owner?: OwnerType | null;\n partners?: PartnerType[] | null;\n promoCodes?: string[] | null;\n region: string;\n socialMedia?: SocialMediaType[] | null;\n termsAgreement?: TermsAgreement | null;\n}\n\nexport type PosterUsageType = {\n month: string;\n count: number;\n};\n\nexport type BaseResourceType = Omit<\n BaseResourceTypeFormData,\n \"_id\" | \"coverUpload\" | \"imagesUpload\" | \"logoUpload\" | \"owner\"\n> & {\n _id: string;\n adIds?: string[] | null;\n createdAt: string;\n deletedAt: string | null;\n owner: OwnerType;\n posterUsage?: PosterUsageType | null;\n relations:\n | {\n relationId: string | null;\n relationDates: RelationDate[] | null;\n }[]\n | null;\n updatedAt: string;\n};\n\nexport type LocationType = {\n city: string;\n coordinates: number[]; // [longitude, latitude]\n country: string;\n fullAddress: string;\n latitude: number;\n longitude: number;\n region: string;\n type: \"Point\"; // Mongoose GeoJSON type\n};\n\nexport type DateTimeType = {\n endDate: string;\n endTime: string;\n startDate: string;\n startTime: string;\n};\n\nexport type Region = {\n latitude: number;\n latitudeDelta: number;\n longitude: number;\n longitudeDelta: number;\n};\n\nexport type GeocodeLocation = Pick<LocationType, \"latitude\" | \"longitude\">;\n\nexport type MapMultiLocation = {\n dateTime: DateTimeType | null;\n location: LocationType | null;\n resourceId?: string;\n resourceName?: string;\n resourceType?: EnumResourceType;\n};\n\nexport interface FormField {\n disabled?: boolean;\n helperText?: string;\n isTextArea?: boolean;\n keyboardType?:\n | \"default\"\n | \"email-address\"\n | \"number-pad\"\n | \"url\"\n | \"decimal-pad\"\n | \"phone-pad\";\n name: string;\n placeholder: string;\n secureTextEntry?: boolean;\n}\n\nexport interface FormDateField {\n dateMode: \"date\" | \"time\";\n helperText?: string;\n name: \"endDate\" | \"endTime\" | \"startDate\" | \"startTime\";\n placeholder: string;\n}\n\nexport interface SubcategoryItems {\n id: string;\n name: string;\n description?: string | null;\n}\n\nexport interface Subcategory {\n id: string;\n name: string;\n items?: SubcategoryItems[] | null;\n}\n\nexport interface Category {\n color?: string | null;\n description?: string | null;\n id: string;\n name: string;\n subcategories: Subcategory[];\n}\n\nexport type OptionItem = {\n value: string;\n label: string;\n};\n\nexport type ImageObjectType = {\n uri: string;\n type: string;\n name: string;\n};\n\nexport interface ResourceConnectionsType {\n events: EventType[] | null;\n vendors: VendorType[] | null;\n}\n\nexport interface CreateFormData<T extends FieldValues> {\n control: Control<T, any>;\n fields: T;\n formState: { errors: FieldErrors<T> };\n handleSubmit: UseFormHandleSubmit<T, any>;\n reset: UseFormReset<T>;\n setValue: UseFormSetValue<T>;\n watch: UseFormWatch<T>;\n}\n\nexport type ObjectId = mongoose.Schema.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 role: string;\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 user: AuthUser | null;\n pubsub: {\n publish: (\n eventName: EnumPubSubEvents,\n payload: SubscriptionPayload,\n ) => void;\n subscribe: (eventName: EnumPubSubEvents) => AsyncIterable<any>;\n };\n request: Request;\n response: Response;\n}\n","import { EnumResourceType } from \"src/enums\";\n\nimport { CreateFormData, SocialMediaType } from \"./global\";\n\nexport enum EnumAdShowOn {\n FRONT_PAGE = \"Front_page\",\n EVENTS_PAGE = \"Events_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 interface AdFormData {\n active: boolean;\n adStyle: EnumAdStyle;\n adType: EnumAdType;\n clui?: string | null;\n end: Date; // ISO date string\n resourceCover: string;\n resourceDescription: string;\n resourceId: string;\n resourceLogo?: string | null;\n resourceName: string;\n resourceRegion: string;\n resourceType: EnumResourceType;\n showOn: EnumAdShowOn;\n socialMedia?: SocialMediaType[] | null;\n start?: Date; // ISO date string\n status: EnumAdStatus;\n targetRegion?: string | null;\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;\n}\n","import { EnumOSPlatform, EnumResourceType } from \"src/enums\";\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: {\n type: \"Point\";\n coordinates: number[]; // [longitude, latitude]\n } | 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: string;\n activity: Omit<ResourceActivityEntry, \"timestamp\">;\n};\n"],"mappings":"
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts","../../src/types/global.ts","../../src/types/ad.ts","../../src/types/resourceActivities.ts"],"sourcesContent":["export * from \"./admin\";\nexport * from \"./auth\";\nexport * from \"./chat\";\nexport * from \"./contactUs\";\nexport * from \"./global\";\nexport * from \"./event\";\nexport * from \"./notification\";\nexport * from \"./poster\";\nexport * from \"./relation\";\nexport * from \"./vendor\";\nexport * from \"./testers\";\nexport * from \"./user\";\nexport * from \"./ad\";\nexport * from \"./resourceActivities\";\n","import { Request } from \"express\";\nimport mongoose from \"mongoose\";\nimport {\n Control,\n FieldErrors,\n FieldValues,\n UseFormHandleSubmit,\n UseFormReset,\n UseFormSetValue,\n UseFormWatch,\n} from \"react-hook-form\";\n\nimport { SchemaChatType } from \"src/mongoose/Chat\";\nimport { SchemaNotificationType } from \"src/mongoose/Notification\";\n\nimport { EnumResourceType, EnumSocialMedia, EnumUserLicence } from \"../enums\";\n\nimport { EventType } from \"./event\";\nimport { NotificationCount } from \"./notification\";\nimport { RelationDate } from \"./relation\";\nimport { VendorType } from \"./vendor\";\n\nexport type Nullable<T> = {\n [K in keyof T]: T[K] | null | undefined;\n};\n\nexport type DeviceInfo = {\n appBuildNumber: string;\n appId: string;\n appVersion: string;\n brand: string;\n deviceName: string;\n installationId: string;\n manufacturer: string;\n modelName: string;\n osName: string;\n osVersion: string;\n timestamp: string;\n};\n\nexport type TermsAgreement = DeviceInfo & {\n termVersion: string;\n};\n\nexport type ResourceContactDetailsType = {\n email?: string | null;\n landlinePhone?: string | null;\n mobilePhone?: string | null;\n};\n\nexport type ResourceImageType = {\n source: string;\n title: string;\n};\n\nexport type SocialMediaType = {\n name?: EnumSocialMedia;\n link?: string;\n};\n\nexport type PartnerType = {\n email: string;\n resourceId: string;\n resourceType: EnumResourceType;\n licence: EnumUserLicence;\n};\n\nexport type OwnerType = {\n email: string;\n userId: string;\n};\n\nexport interface BaseResourceTypeFormData {\n _id?: string;\n active: boolean;\n contactDetails?: ResourceContactDetailsType | null;\n cover: ResourceImageType;\n coverUpload?: ResourceImageType | null;\n description: string;\n images?: ResourceImageType[] | null;\n imagesUpload?: ResourceImageType[] | null;\n logo?: ResourceImageType | null;\n logoUpload?: ResourceImageType | null;\n name: string;\n owner?: OwnerType | null;\n partners?: PartnerType[] | null;\n promoCodes?: string[] | null;\n region: string;\n socialMedia?: SocialMediaType[] | null;\n termsAgreement?: TermsAgreement | null;\n}\n\nexport type PosterUsageType = {\n month: string;\n count: number;\n};\n\nexport type BaseResourceType = Omit<\n BaseResourceTypeFormData,\n \"_id\" | \"coverUpload\" | \"imagesUpload\" | \"logoUpload\" | \"owner\"\n> & {\n _id: string;\n adIds?: string[] | null;\n createdAt: string;\n deletedAt: string | null;\n owner: OwnerType;\n posterUsage?: PosterUsageType | null;\n relations:\n | {\n relationId: string | null;\n relationDates: RelationDate[] | null;\n }[]\n | null;\n updatedAt: string;\n};\n\nexport type LocationType = {\n city: string;\n coordinates: number[]; // [longitude, latitude]\n country: string;\n fullAddress: string;\n latitude: number;\n longitude: number;\n region: string;\n type: \"Point\"; // Mongoose GeoJSON type\n};\n\nexport type DateTimeType = {\n endDate: string;\n endTime: string;\n startDate: string;\n startTime: string;\n};\n\nexport type Region = {\n latitude: number;\n latitudeDelta: number;\n longitude: number;\n longitudeDelta: number;\n};\n\nexport type GeocodeLocation = Pick<LocationType, \"latitude\" | \"longitude\">;\n\nexport type MapMultiLocation = {\n dateTime: DateTimeType | null;\n location: LocationType | null;\n resourceId?: string;\n resourceName?: string;\n resourceType?: EnumResourceType;\n};\n\nexport interface FormField {\n disabled?: boolean;\n helperText?: string;\n isTextArea?: boolean;\n keyboardType?:\n | \"default\"\n | \"email-address\"\n | \"number-pad\"\n | \"url\"\n | \"decimal-pad\"\n | \"phone-pad\";\n name: string;\n placeholder: string;\n secureTextEntry?: boolean;\n}\n\nexport interface FormDateField {\n dateMode: \"date\" | \"time\";\n helperText?: string;\n name: \"endDate\" | \"endTime\" | \"startDate\" | \"startTime\";\n placeholder: string;\n}\n\nexport interface SubcategoryItems {\n id: string;\n name: string;\n description?: string | null;\n}\n\nexport interface Subcategory {\n id: string;\n name: string;\n items?: SubcategoryItems[] | null;\n}\n\nexport interface Category {\n color?: string | null;\n description?: string | null;\n id: string;\n name: string;\n subcategories: Subcategory[];\n}\n\nexport type OptionItem = {\n value: string;\n label: string;\n};\n\nexport type ImageObjectType = {\n uri: string;\n type: string;\n name: string;\n};\n\nexport interface ResourceConnectionsType {\n events: EventType[] | null;\n vendors: VendorType[] | null;\n}\n\nexport interface CreateFormData<T extends FieldValues> {\n control: Control<T, any>;\n fields: T;\n formState: { errors: FieldErrors<T> };\n handleSubmit: UseFormHandleSubmit<T, any>;\n reset: UseFormReset<T>;\n setValue: UseFormSetValue<T>;\n watch: UseFormWatch<T>;\n}\n\nexport type ObjectId = mongoose.Schema.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 role: string;\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 user: AuthUser | null;\n pubsub: {\n publish: (\n eventName: EnumPubSubEvents,\n payload: SubscriptionPayload,\n ) => void;\n subscribe: (eventName: EnumPubSubEvents) => AsyncIterable<any>;\n };\n request: Request;\n response: Response;\n}\n\nexport { mongoose };\n","import { EnumResourceType } from \"src/enums\";\n\nimport { CreateFormData, SocialMediaType } from \"./global\";\n\nexport enum EnumAdShowOn {\n FRONT_PAGE = \"Front_page\",\n EVENTS_PAGE = \"Events_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 interface AdFormData {\n active: boolean;\n adStyle: EnumAdStyle;\n adType: EnumAdType;\n clui?: string | null;\n end: Date; // ISO date string\n resourceCover: string;\n resourceDescription: string;\n resourceId: string;\n resourceLogo?: string | null;\n resourceName: string;\n resourceRegion: string;\n resourceType: EnumResourceType;\n showOn: EnumAdShowOn;\n socialMedia?: SocialMediaType[] | null;\n start?: Date; // ISO date string\n status: EnumAdStatus;\n targetRegion?: string | null;\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;\n}\n","import { EnumOSPlatform, EnumResourceType } from \"src/enums\";\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: {\n type: \"Point\";\n coordinates: number[]; // [longitude, latitude]\n } | 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: string;\n activity: Omit<ResourceActivityEntry, \"timestamp\">;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,kCAAAA;AAAA;AAAA;;;ACCA,sBAAqB;AA6Nd,IAAK,mBAAL,kBAAKC,sBAAL;AACL,EAAAA,kBAAA,sBAAmB;AACnB,EAAAA,kBAAA,uBAAoB;AACpB,EAAAA,kBAAA,6BAA0B;AAC1B,EAAAA,kBAAA,iBAAc;AAJJ,SAAAA;AAAA,GAAA;;;AC1NL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,kBAAe;AAHL,SAAAA;AAAA,GAAA;AAML,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;;;ACnBL,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;","names":["mongoose","EnumPubSubEvents","EnumAdShowOn","EnumAdStatus","EnumAdType","EnumAdStyle","EnumActivity"]}
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { EnumResourceType } from '../enums/index.mjs';
|
|
2
|
-
export { e as ContactUsFormData, f as CreateContactUsFormData, C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, d as CreateResetPasswordFormData, c as CreateValidateVerificationTokenFormData, L as LoginFormData, R as RegisterFormData, g as RequestPasswordResetFormData, h as ResetPasswordFormData, V as ValidateVerificationTokenFormData } from '../auth-
|
|
3
|
-
export { a5 as AuthUser, X as BaseResourceType, B as BaseResourceTypeFormData, C as Category, Q as ChatMessageInput, U as ChatMessageType, b as ChatType, a9 as CreateBulkNotificationInput, m as CreateEventFormData, o as CreateEventInfoFormData, a3 as CreateFormData, i as CreateVendorFormData, k as CreateVendorInfoFormData, Y as DateTimeType, a7 as DateTimeWithPriceType, D as DeviceInfo, a4 as EnumPubSubEvents, l as EventFormData, n as EventInfoFormData, c as EventInfoType, E as EventType, a as FormDateField, F as FormField, _ as GeocodeLocation, J as GraphQLContext, a2 as ImageObjectType, L as LocationType, $ as MapMultiLocation, d as NotificationCount, K as NotificationDataType, N as NotificationType, W as Nullable, q as ObjectId, O as OptionItem, p as OwnerType, M as ParticipantType, P as PartnerType, a8 as PaymentInfoType, u as PosterUsageType, Z as Region, v as RelationDate, e as RelationType, R as Requirement, f as ResourceConnectionsType, t as ResourceContactDetailsType, s as ResourceImageType, r as SocialMediaType, S as StallType, a1 as Subcategory, a0 as SubcategoryItems, a6 as SubscriptionPayload, T as TermsAgreement, ac as VendorAttributes, h as VendorFormData, j as VendorInfoFormData, g as VendorInfoType, aa as VendorLocation, ab as VendorMenuType, V as VendorType } from '../global-
|
|
4
|
-
export { d as AdFormData, A as AdType, e as CreateAdFormData, c as CreateTestersFormData, C as CreateUserFormData, h as EnumAdShowOn, E as EnumAdStatus, j as EnumAdStyle, i as EnumAdType, T as TesterType, b as TestersFormData, g as UserActivity, f as UserActivityEvent, a as UserFormData, U as UserType } from '../ad-
|
|
2
|
+
export { e as ContactUsFormData, f as CreateContactUsFormData, C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, d as CreateResetPasswordFormData, c as CreateValidateVerificationTokenFormData, L as LoginFormData, R as RegisterFormData, g as RequestPasswordResetFormData, h as ResetPasswordFormData, V as ValidateVerificationTokenFormData } from '../auth-BczaOu28.mjs';
|
|
3
|
+
export { a5 as AuthUser, X as BaseResourceType, B as BaseResourceTypeFormData, C as Category, Q as ChatMessageInput, U as ChatMessageType, b as ChatType, a9 as CreateBulkNotificationInput, m as CreateEventFormData, o as CreateEventInfoFormData, a3 as CreateFormData, i as CreateVendorFormData, k as CreateVendorInfoFormData, Y as DateTimeType, a7 as DateTimeWithPriceType, D as DeviceInfo, a4 as EnumPubSubEvents, l as EventFormData, n as EventInfoFormData, c as EventInfoType, E as EventType, a as FormDateField, F as FormField, _ as GeocodeLocation, J as GraphQLContext, a2 as ImageObjectType, L as LocationType, $ as MapMultiLocation, d as NotificationCount, K as NotificationDataType, N as NotificationType, W as Nullable, q as ObjectId, O as OptionItem, p as OwnerType, M as ParticipantType, P as PartnerType, a8 as PaymentInfoType, u as PosterUsageType, Z as Region, v as RelationDate, e as RelationType, R as Requirement, f as ResourceConnectionsType, t as ResourceContactDetailsType, s as ResourceImageType, r as SocialMediaType, S as StallType, a1 as Subcategory, a0 as SubcategoryItems, a6 as SubscriptionPayload, T as TermsAgreement, ac as VendorAttributes, h as VendorFormData, j as VendorInfoFormData, g as VendorInfoType, aa as VendorLocation, ab as VendorMenuType, V as VendorType } from '../global-_89-F0iL.mjs';
|
|
4
|
+
export { d as AdFormData, A as AdType, e as CreateAdFormData, c as CreateTestersFormData, C as CreateUserFormData, h as EnumAdShowOn, E as EnumAdStatus, j as EnumAdStyle, i as EnumAdType, T as TesterType, b as TestersFormData, g as UserActivity, f as UserActivityEvent, a as UserFormData, U as UserType } from '../ad-IVwm5MLY.mjs';
|
|
5
5
|
export { E as EnumActivity, a as ResourceActivityEntry, b as ResourceActivityInputType, R as ResourceActivityType } from '../resourceActivities-BIjtlOGp.mjs';
|
|
6
|
-
|
|
6
|
+
export { default as mongoose } from 'mongoose';
|
|
7
|
+
import 'express';
|
|
7
8
|
import 'react-hook-form';
|
|
8
9
|
|
|
9
10
|
interface AdminUpdateResourceType {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { EnumResourceType } from '../enums/index.js';
|
|
2
|
-
export { e as ContactUsFormData, f as CreateContactUsFormData, C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, d as CreateResetPasswordFormData, c as CreateValidateVerificationTokenFormData, L as LoginFormData, R as RegisterFormData, g as RequestPasswordResetFormData, h as ResetPasswordFormData, V as ValidateVerificationTokenFormData } from '../auth-
|
|
3
|
-
export { a5 as AuthUser, X as BaseResourceType, B as BaseResourceTypeFormData, C as Category, Q as ChatMessageInput, U as ChatMessageType, b as ChatType, a9 as CreateBulkNotificationInput, m as CreateEventFormData, o as CreateEventInfoFormData, a3 as CreateFormData, i as CreateVendorFormData, k as CreateVendorInfoFormData, Y as DateTimeType, a7 as DateTimeWithPriceType, D as DeviceInfo, a4 as EnumPubSubEvents, l as EventFormData, n as EventInfoFormData, c as EventInfoType, E as EventType, a as FormDateField, F as FormField, _ as GeocodeLocation, J as GraphQLContext, a2 as ImageObjectType, L as LocationType, $ as MapMultiLocation, d as NotificationCount, K as NotificationDataType, N as NotificationType, W as Nullable, q as ObjectId, O as OptionItem, p as OwnerType, M as ParticipantType, P as PartnerType, a8 as PaymentInfoType, u as PosterUsageType, Z as Region, v as RelationDate, e as RelationType, R as Requirement, f as ResourceConnectionsType, t as ResourceContactDetailsType, s as ResourceImageType, r as SocialMediaType, S as StallType, a1 as Subcategory, a0 as SubcategoryItems, a6 as SubscriptionPayload, T as TermsAgreement, ac as VendorAttributes, h as VendorFormData, j as VendorInfoFormData, g as VendorInfoType, aa as VendorLocation, ab as VendorMenuType, V as VendorType } from '../global-
|
|
4
|
-
export { d as AdFormData, A as AdType, e as CreateAdFormData, c as CreateTestersFormData, C as CreateUserFormData, h as EnumAdShowOn, E as EnumAdStatus, j as EnumAdStyle, i as EnumAdType, T as TesterType, b as TestersFormData, g as UserActivity, f as UserActivityEvent, a as UserFormData, U as UserType } from '../ad-
|
|
2
|
+
export { e as ContactUsFormData, f as CreateContactUsFormData, C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, d as CreateResetPasswordFormData, c as CreateValidateVerificationTokenFormData, L as LoginFormData, R as RegisterFormData, g as RequestPasswordResetFormData, h as ResetPasswordFormData, V as ValidateVerificationTokenFormData } from '../auth-BCxQp_CF.js';
|
|
3
|
+
export { a5 as AuthUser, X as BaseResourceType, B as BaseResourceTypeFormData, C as Category, Q as ChatMessageInput, U as ChatMessageType, b as ChatType, a9 as CreateBulkNotificationInput, m as CreateEventFormData, o as CreateEventInfoFormData, a3 as CreateFormData, i as CreateVendorFormData, k as CreateVendorInfoFormData, Y as DateTimeType, a7 as DateTimeWithPriceType, D as DeviceInfo, a4 as EnumPubSubEvents, l as EventFormData, n as EventInfoFormData, c as EventInfoType, E as EventType, a as FormDateField, F as FormField, _ as GeocodeLocation, J as GraphQLContext, a2 as ImageObjectType, L as LocationType, $ as MapMultiLocation, d as NotificationCount, K as NotificationDataType, N as NotificationType, W as Nullable, q as ObjectId, O as OptionItem, p as OwnerType, M as ParticipantType, P as PartnerType, a8 as PaymentInfoType, u as PosterUsageType, Z as Region, v as RelationDate, e as RelationType, R as Requirement, f as ResourceConnectionsType, t as ResourceContactDetailsType, s as ResourceImageType, r as SocialMediaType, S as StallType, a1 as Subcategory, a0 as SubcategoryItems, a6 as SubscriptionPayload, T as TermsAgreement, ac as VendorAttributes, h as VendorFormData, j as VendorInfoFormData, g as VendorInfoType, aa as VendorLocation, ab as VendorMenuType, V as VendorType } from '../global-Bnr6l_NH.js';
|
|
4
|
+
export { d as AdFormData, A as AdType, e as CreateAdFormData, c as CreateTestersFormData, C as CreateUserFormData, h as EnumAdShowOn, E as EnumAdStatus, j as EnumAdStyle, i as EnumAdType, T as TesterType, b as TestersFormData, g as UserActivity, f as UserActivityEvent, a as UserFormData, U as UserType } from '../ad-Cv1V8lgJ.js';
|
|
5
5
|
export { E as EnumActivity, a as ResourceActivityEntry, b as ResourceActivityInputType, R as ResourceActivityType } from '../resourceActivities-B4roVKtQ.js';
|
|
6
|
-
|
|
6
|
+
export { default as mongoose } from 'mongoose';
|
|
7
|
+
import 'express';
|
|
7
8
|
import 'react-hook-form';
|
|
8
9
|
|
|
9
10
|
interface AdminUpdateResourceType {
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import {
|
|
2
2
|
EnumActivity,
|
|
3
|
-
EnumPubSubEvents
|
|
4
|
-
|
|
3
|
+
EnumPubSubEvents,
|
|
4
|
+
mongoose
|
|
5
|
+
} from "../chunk-4OLDTZXH.mjs";
|
|
5
6
|
import {
|
|
6
7
|
EnumAdShowOn,
|
|
7
8
|
EnumAdStatus,
|
|
@@ -14,6 +15,7 @@ export {
|
|
|
14
15
|
EnumAdStatus,
|
|
15
16
|
EnumAdStyle,
|
|
16
17
|
EnumAdType,
|
|
17
|
-
EnumPubSubEvents
|
|
18
|
+
EnumPubSubEvents,
|
|
19
|
+
mongoose
|
|
18
20
|
};
|
|
19
21
|
//# sourceMappingURL=index.mjs.map
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EnumInviteStatus, EnumRegions } from '../enums/index.mjs';
|
|
2
|
-
import { Z as Region, O as OptionItem } from '../global-
|
|
2
|
+
import { Z as Region, O as OptionItem } from '../global-_89-F0iL.mjs';
|
|
3
|
+
import 'express';
|
|
3
4
|
import 'mongoose';
|
|
4
5
|
import 'react-hook-form';
|
|
5
6
|
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EnumInviteStatus, EnumRegions } from '../enums/index.js';
|
|
2
|
-
import { Z as Region, O as OptionItem } from '../global-
|
|
2
|
+
import { Z as Region, O as OptionItem } from '../global-Bnr6l_NH.js';
|
|
3
|
+
import 'express';
|
|
3
4
|
import 'mongoose';
|
|
4
5
|
import 'react-hook-form';
|
|
5
6
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timardex/cluemart-shared",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.32",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -75,6 +75,7 @@
|
|
|
75
75
|
"author": "",
|
|
76
76
|
"license": "ISC",
|
|
77
77
|
"devDependencies": {
|
|
78
|
+
"@types/express": "^5.0.5",
|
|
78
79
|
"@types/node": "^22.13.4",
|
|
79
80
|
"@types/react": "~19.0.10",
|
|
80
81
|
"@typescript-eslint/eslint-plugin": "^8.20.0",
|
|
@@ -96,6 +97,7 @@
|
|
|
96
97
|
"@hookform/resolvers": "^4.1.1",
|
|
97
98
|
"dayjs": "^1.11.13",
|
|
98
99
|
"expo-server-sdk": "^4.0.0",
|
|
100
|
+
"express": "^5.1.0",
|
|
99
101
|
"mongoose": "^8.19.3",
|
|
100
102
|
"react": "^19.0.0",
|
|
101
103
|
"react-hook-form": "^7.54.2",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/global.ts","../src/types/resourceActivities.ts"],"sourcesContent":["import mongoose from \"mongoose\";\nimport {\n Control,\n FieldErrors,\n FieldValues,\n UseFormHandleSubmit,\n UseFormReset,\n UseFormSetValue,\n UseFormWatch,\n} from \"react-hook-form\";\n\nimport { SchemaChatType } from \"src/mongoose/Chat\";\nimport { SchemaNotificationType } from \"src/mongoose/Notification\";\n\nimport { EnumResourceType, EnumSocialMedia, EnumUserLicence } from \"../enums\";\n\nimport { EventType } from \"./event\";\nimport { NotificationCount } from \"./notification\";\nimport { RelationDate } from \"./relation\";\nimport { VendorType } from \"./vendor\";\n\nexport type Nullable<T> = {\n [K in keyof T]: T[K] | null | undefined;\n};\n\nexport type DeviceInfo = {\n appBuildNumber: string;\n appId: string;\n appVersion: string;\n brand: string;\n deviceName: string;\n installationId: string;\n manufacturer: string;\n modelName: string;\n osName: string;\n osVersion: string;\n timestamp: string;\n};\n\nexport type TermsAgreement = DeviceInfo & {\n termVersion: string;\n};\n\nexport type ResourceContactDetailsType = {\n email?: string | null;\n landlinePhone?: string | null;\n mobilePhone?: string | null;\n};\n\nexport type ResourceImageType = {\n source: string;\n title: string;\n};\n\nexport type SocialMediaType = {\n name?: EnumSocialMedia;\n link?: string;\n};\n\nexport type PartnerType = {\n email: string;\n resourceId: string;\n resourceType: EnumResourceType;\n licence: EnumUserLicence;\n};\n\nexport type OwnerType = {\n email: string;\n userId: string;\n};\n\nexport interface BaseResourceTypeFormData {\n _id?: string;\n active: boolean;\n contactDetails?: ResourceContactDetailsType | null;\n cover: ResourceImageType;\n coverUpload?: ResourceImageType | null;\n description: string;\n images?: ResourceImageType[] | null;\n imagesUpload?: ResourceImageType[] | null;\n logo?: ResourceImageType | null;\n logoUpload?: ResourceImageType | null;\n name: string;\n owner?: OwnerType | null;\n partners?: PartnerType[] | null;\n promoCodes?: string[] | null;\n region: string;\n socialMedia?: SocialMediaType[] | null;\n termsAgreement?: TermsAgreement | null;\n}\n\nexport type PosterUsageType = {\n month: string;\n count: number;\n};\n\nexport type BaseResourceType = Omit<\n BaseResourceTypeFormData,\n \"_id\" | \"coverUpload\" | \"imagesUpload\" | \"logoUpload\" | \"owner\"\n> & {\n _id: string;\n adIds?: string[] | null;\n createdAt: string;\n deletedAt: string | null;\n owner: OwnerType;\n posterUsage?: PosterUsageType | null;\n relations:\n | {\n relationId: string | null;\n relationDates: RelationDate[] | null;\n }[]\n | null;\n updatedAt: string;\n};\n\nexport type LocationType = {\n city: string;\n coordinates: number[]; // [longitude, latitude]\n country: string;\n fullAddress: string;\n latitude: number;\n longitude: number;\n region: string;\n type: \"Point\"; // Mongoose GeoJSON type\n};\n\nexport type DateTimeType = {\n endDate: string;\n endTime: string;\n startDate: string;\n startTime: string;\n};\n\nexport type Region = {\n latitude: number;\n latitudeDelta: number;\n longitude: number;\n longitudeDelta: number;\n};\n\nexport type GeocodeLocation = Pick<LocationType, \"latitude\" | \"longitude\">;\n\nexport type MapMultiLocation = {\n dateTime: DateTimeType | null;\n location: LocationType | null;\n resourceId?: string;\n resourceName?: string;\n resourceType?: EnumResourceType;\n};\n\nexport interface FormField {\n disabled?: boolean;\n helperText?: string;\n isTextArea?: boolean;\n keyboardType?:\n | \"default\"\n | \"email-address\"\n | \"number-pad\"\n | \"url\"\n | \"decimal-pad\"\n | \"phone-pad\";\n name: string;\n placeholder: string;\n secureTextEntry?: boolean;\n}\n\nexport interface FormDateField {\n dateMode: \"date\" | \"time\";\n helperText?: string;\n name: \"endDate\" | \"endTime\" | \"startDate\" | \"startTime\";\n placeholder: string;\n}\n\nexport interface SubcategoryItems {\n id: string;\n name: string;\n description?: string | null;\n}\n\nexport interface Subcategory {\n id: string;\n name: string;\n items?: SubcategoryItems[] | null;\n}\n\nexport interface Category {\n color?: string | null;\n description?: string | null;\n id: string;\n name: string;\n subcategories: Subcategory[];\n}\n\nexport type OptionItem = {\n value: string;\n label: string;\n};\n\nexport type ImageObjectType = {\n uri: string;\n type: string;\n name: string;\n};\n\nexport interface ResourceConnectionsType {\n events: EventType[] | null;\n vendors: VendorType[] | null;\n}\n\nexport interface CreateFormData<T extends FieldValues> {\n control: Control<T, any>;\n fields: T;\n formState: { errors: FieldErrors<T> };\n handleSubmit: UseFormHandleSubmit<T, any>;\n reset: UseFormReset<T>;\n setValue: UseFormSetValue<T>;\n watch: UseFormWatch<T>;\n}\n\nexport type ObjectId = mongoose.Schema.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 role: string;\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 user: AuthUser | null;\n pubsub: {\n publish: (\n eventName: EnumPubSubEvents,\n payload: SubscriptionPayload,\n ) => void;\n subscribe: (eventName: EnumPubSubEvents) => AsyncIterable<any>;\n };\n request: Request;\n response: Response;\n}\n","import { EnumOSPlatform, EnumResourceType } from \"src/enums\";\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: {\n type: \"Point\";\n coordinates: number[]; // [longitude, latitude]\n } | 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: string;\n activity: Omit<ResourceActivityEntry, \"timestamp\">;\n};\n"],"mappings":";AA6NO,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,sBAAmB;AACnB,EAAAA,kBAAA,uBAAoB;AACpB,EAAAA,kBAAA,6BAA0B;AAC1B,EAAAA,kBAAA,iBAAc;AAJJ,SAAAA;AAAA,GAAA;;;AC3NL,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;","names":["EnumPubSubEvents","EnumActivity"]}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/mongoose/Notification.ts","../src/mongoose/PushToken.ts"],"sourcesContent":["import mongoose from \"mongoose\";\n\nimport { EnumNotificationResourceType, EnumNotificationType } from \"src/enums\";\nimport {\n CreateBulkNotificationInput,\n NotificationType,\n ObjectId,\n} from \"src/types\";\n\nconst MongooseSchema = mongoose.Schema;\n\nexport type SchemaCreateBulkNotificationInput = Omit<\n CreateBulkNotificationInput,\n \"userIds\"\n> & {\n userIds: ObjectId[];\n};\n\nexport type SchemaNotificationType = Omit<NotificationType, \"userId\"> & {\n userId: ObjectId;\n};\n/**\n * Schema for storing in-app notifications\n * Each notification is tied to a specific user and can be marked as read/unread\n */\nconst schema = new MongooseSchema<SchemaNotificationType>(\n {\n data: {\n resourceId: { required: true, type: String },\n resourceName: { required: true, type: String },\n resourceType: {\n enum: Object.values(EnumNotificationResourceType),\n required: true,\n type: String,\n },\n },\n isRead: { default: false, index: true, required: true, type: Boolean },\n message: { required: true, type: String },\n title: { required: true, type: String },\n type: {\n default: EnumNotificationType.SYSTEM,\n enum: Object.values(EnumNotificationType),\n required: true,\n type: String,\n },\n userId: {\n ref: \"User\",\n required: true,\n type: mongoose.Schema.Types.ObjectId,\n },\n },\n { timestamps: true },\n);\n\n// Compound index for efficient queries\nschema.index({ isRead: 1, userId: 1 });\nschema.index({ createdAt: -1, userId: 1 });\n\nexport const NotificationModel = mongoose.model<SchemaNotificationType>(\n \"Notification\",\n schema,\n);\n","import mongoose from \"mongoose\";\n\nimport { EnumOSPlatform } from \"src/enums\";\nimport { ObjectId } from \"src/types\";\n\nconst MongooseSchema = mongoose.Schema;\n\ntype PushTokenType = {\n _id: string;\n createdAt: Date;\n platform: EnumOSPlatform;\n token: string;\n updatedAt: Date;\n userId: string;\n};\n\nexport type SchemaPushTokenType = Omit<PushTokenType, \"userId\"> & {\n userId: ObjectId;\n};\n\n/**\n * This is the schema for the push token type.\n * It is used to define the structure of the push token type in the database.\n * The schema is used by Mongoose to create a model for the push token type.\n */\nconst schema = new MongooseSchema<SchemaPushTokenType>(\n {\n platform: {\n enum: Object.values(EnumOSPlatform),\n required: true,\n type: String,\n },\n token: { required: true, type: String },\n userId: { required: true, type: mongoose.Schema.Types.ObjectId },\n },\n { timestamps: true },\n);\n\nexport const PushTokenModel = mongoose.model<SchemaPushTokenType>(\"PushToken\", schema);\n"],"mappings":";;;;;;;AAAA,OAAO,cAAc;AASrB,IAAM,iBAAiB,SAAS;AAgBhC,IAAM,SAAS,IAAI;AAAA,EACjB;AAAA,IACE,MAAM;AAAA,MACJ,YAAY,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,MAC3C,cAAc,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,MAC7C,cAAc;AAAA,QACZ,MAAM,OAAO,OAAO,4BAA4B;AAAA,QAChD,UAAU;AAAA,QACV,MAAM;AAAA,MACR;AAAA,IACF;AAAA,IACA,QAAQ,EAAE,SAAS,OAAO,OAAO,MAAM,UAAU,MAAM,MAAM,QAAQ;AAAA,IACrE,SAAS,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,IACxC,OAAO,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,IACtC,MAAM;AAAA,MACJ;AAAA,MACA,MAAM,OAAO,OAAO,oBAAoB;AAAA,MACxC,UAAU;AAAA,MACV,MAAM;AAAA,IACR;AAAA,IACA,QAAQ;AAAA,MACN,KAAK;AAAA,MACL,UAAU;AAAA,MACV,MAAM,SAAS,OAAO,MAAM;AAAA,IAC9B;AAAA,EACF;AAAA,EACA,EAAE,YAAY,KAAK;AACrB;AAGA,OAAO,MAAM,EAAE,QAAQ,GAAG,QAAQ,EAAE,CAAC;AACrC,OAAO,MAAM,EAAE,WAAW,IAAI,QAAQ,EAAE,CAAC;AAElC,IAAM,oBAAoB,SAAS;AAAA,EACxC;AAAA,EACA;AACF;;;AC7DA,OAAOA,eAAc;AAKrB,IAAMC,kBAAiBC,UAAS;AAoBhC,IAAMC,UAAS,IAAIF;AAAA,EACjB;AAAA,IACE,UAAU;AAAA,MACR,MAAM,OAAO,OAAO,cAAc;AAAA,MAClC,UAAU;AAAA,MACV,MAAM;AAAA,IACR;AAAA,IACA,OAAO,EAAE,UAAU,MAAM,MAAM,OAAO;AAAA,IACtC,QAAQ,EAAE,UAAU,MAAM,MAAMC,UAAS,OAAO,MAAM,SAAS;AAAA,EACjE;AAAA,EACA,EAAE,YAAY,KAAK;AACrB;AAEO,IAAM,iBAAiBA,UAAS,MAA2B,aAAaC,OAAM;","names":["mongoose","MongooseSchema","mongoose","schema"]}
|